original_docstring: Build parameters representing a fiel stream for a POST request.
  
      :param file-like source: file-like object to send.
      :param str mime_type: MIME type of the file.
      :returns tuple: File object information.
      :raises InvalidFileError: When 'file_path' is not a file.
  
      Note : source could be :
      - a string representing path to file
      - a pathlib.Path representing path to file
      - a subclass of io.BufferedIOBase
      
docstring: Build parameters representing a fiel stream for a POST request.
docstring_tokens: Build parameters representing a fiel stream for a POST request .
code: def build_http_file_obj(source, mime_type):
      """Build parameters representing a fiel stream for a POST request.
  
      :param file-like source: file-like object to send.
      :param str mime_type: MIME type of the file.
      :returns tuple: File object information.
      :raises InvalidFileError: When 'file_path' is not a file.
  
      Note : source could be :
      - a string representing path to file
      - a pathlib.Path representing path to file
      - a subclass of io.BufferedIOBase
      """
      if isinstance(source, (str, Path)):
          # ensure 'source' is instance of 'Path'
          source = Path(source)
          if not source.is_file():
              raise InvalidFileError(str(source))
          return (source.name, open(str(source), 'rb'), mime_type)
  
      if issubclass(source.__class__, BufferedIOBase):
          return ('unknown', source, mime_type)
  
      if isinstance(source, bytes):
          return ('unknown', BytesIO(source), mime_type)
  
      raise InvalidFileError(str(source))
code_tokens: def build_http_file_obj ( source , mime_type ) : if isinstance ( source , ( str , Path ) ) : source = Path ( source ) if not source . is_file ( ) : raise InvalidFileError ( str ( source ) ) return ( source . name , open ( str ( source ) , 'rb' ) , mime_type ) if issubclass ( source . __class__ , BufferedIOBase ) : return ( 'unknown' , source , mime_type ) if isinstance ( source , bytes ) : return ( 'unknown' , BytesIO ( source ) , mime_type ) raise InvalidFileError ( str ( source ) )
short_docstring: Build parameters representing a fiel stream for a POST request.
short_docstring_tokens: Build parameters representing a fiel stream for a POST request .
comment: """Build parameters representing a fiel stream for a POST request.
  
      :param file-like source: file-like object to send.
      :param str mime_type: MIME type of the file.
      :returns tuple: File object information.
      :raises InvalidFileError: When 'file_path' is not a file.
  
      Note : source could be :
      - a string representing path to file
      - a pathlib.Path representing path to file
      - a subclass of io.BufferedIOBase
      """$SEP$# ensure 'source' is instance of 'Path'