code: def file_path(fobj):
      
      if isinstance(fobj, string_types) and fobj.startswith("file:"):
          return urlparse(fobj).path
      if isinstance(fobj, string_types):
          return fobj
      if (isinstance(fobj, FILE_LIKE) and hasattr(fobj, "name")):
          return fobj.name
      try:
          return fobj.path
      except AttributeError:
          raise ValueError("Cannot parse file name for {!r}".format(fobj))
docs: Determine the path of a file.
  
      This doesn't do any sanity checking to check that the file
      actually exists, or is readable.
  
      Parameters
      ----------
      fobj : `file`, `str`, `CacheEntry`, ...
          the file object or path to parse
  
      Returns
      -------
      path : `str`
          the path of the underlying file
  
      Raises
      ------
      ValueError
          if a file path cannnot be determined
  
      Examples
      --------
      >>> from gwpy.io.utils import file_path
      >>> file_path("test.txt")
      'test.txt'
      >>> file_path(open("test.txt", "r"))
      'test.txt'
      >>> file_path("file:///home/user/test.txt")
      '/home/user/test.txt'