code: def detect_format(filename):
      
      filename = Path(filename)
  
      if filename.suffix == '.csv':
          recformat = 'csv'
      elif filename.suffix == '.sfp':
          recformat = 'sfp'
  
      else:
          recformat = 'unknown'
  
      return recformat
docs: Detect file format of the channels based on extension.
  
      Parameters
      ----------
      filename : Path
          name of the filename
  
      Returns
      -------
      str
          file format