parameters: (obj)
docstring: Checks whether a given file-like object is closed.
  
      :param obj:
          The file-like object to check.
docstring_summary: Checks whether a given file-like object is closed.
docstring_tokens: Checks whether a given file - like object is closed .
function: def is_fp_closed(obj):
      """
      Checks whether a given file-like object is closed.
  
      :param obj:
          The file-like object to check.
      """
  
      try:
          # Check `isclosed()` first, in case Python3 doesn't set `closed`.
          # GH Issue #928
          return obj.isclosed()
      except AttributeError:
          pass
  
      try:
          # Check via the official file-like-object way.
          return obj.closed
      except AttributeError:
          pass
  
      try:
          # Check if the object is a container for another file-like object that
          # gets released on exhaustion (e.g. HTTPResponse).
          return obj.fp is None
      except AttributeError:
          pass
  
      raise ValueError("Unable to determine whether fp is closed.")
function_tokens: def is_fp_closed ( obj ) : try : # Check `isclosed()` first, in case Python3 doesn't set `closed`. # GH Issue #928 return obj . isclosed ( ) except AttributeError : pass try : # Check via the official file-like-object way. return obj . closed except AttributeError : pass try : # Check if the object is a container for another file-like object that # gets released on exhaustion (e.g. HTTPResponse). return obj . fp is None except AttributeError : pass raise ValueError ( "Unable to determine whether fp is closed." )