code: def write_sample(binary, payload, path, filename):  # pragma: no cover
      
      if not os.path.exists(path):
          os.makedirs(path)
  
      sample = os.path.join(path, filename)
  
      if binary:
          with open(sample, "wb") as f:
              f.write(base64.b64decode(payload))
      else:
          with open(sample, "w") as f:
              f.write(payload)
docs: This function writes a sample on file system.
  
      Args:
          binary (bool): True if it's a binary file
          payload: payload of sample, in base64 if it's a binary
          path (string): path of file
          filename (string): name of file
          hash_ (string): file hash