code: def get_file_extension(format_):
      
      if format_ not in FORMAT_IDENTIFIER_TO_FORMAT_CLASS:
          raise UnknownFormatIdentifierError(format_)
  
      for ext, f in FILE_EXTENSION_TO_FORMAT_IDENTIFIER.items():
          if f == format_:
              return ext
  
      raise RuntimeError("No file extension for format %r" % format_)
docs: Format identifier -> file extension