code: def sniff(filepath):
      
  
      with open(filepath, "rb") as csvfile:
          sample = csvfile.read(config["sniff_size"])
  
      sniffer = csv.Sniffer()
      dialect = sniffer.sniff(sample)()
      has_header = sniffer.has_header(sample)
  
      return dialect, has_header
docs: Sniffs CSV dialect and header info from csvfilepath
  
      Returns a tuple of dialect and has_header