original_docstring: Guess the format of a file based on the file suffix
docstring: Guess the format of a file based on the file suffix
docstring_tokens: Guess the format of a file based on the file suffix
code: def guess_format(file_path: Union[str, pathlib.Path]) -> str:
      """Guess the format of a file based on the file suffix"""
      if not FORMATS:
          _read_formats()
  
      file_path = pathlib.Path(file_path)
      suffix = file_path.suffix
      for format, suffixes in FORMATS.items():
          if suffix in suffixes:
              return format
  
      raise UnknownFormat(f"Could not guess format of {file_path}")
code_tokens: def guess_format ( file_path : Union [ str , pathlib . Path ] ) -> str : if not FORMATS : _read_formats ( ) file_path = pathlib . Path ( file_path ) suffix = file_path . suffix for format , suffixes in FORMATS . items ( ) : if suffix in suffixes : return format raise UnknownFormat ( f"Could not guess format of {file_path}" )
short_docstring: Guess the format of a file based on the file suffix
short_docstring_tokens: Guess the format of a file based on the file suffix
comment: """Guess the format of a file based on the file suffix"""