parameters: (filepath_or_buffer: FilePathOrBuffer)
return_statement: return exists
docstring: Test whether file exists.
docstring_summary: Test whether file exists.
docstring_tokens: Test whether file exists .
function: def file_exists(filepath_or_buffer: FilePathOrBuffer) -> bool:
      """Test whether file exists."""
      exists = False
      filepath_or_buffer = stringify_path(filepath_or_buffer)
      if not isinstance(filepath_or_buffer, str):
          return exists
      try:
          exists = os.path.exists(filepath_or_buffer)
          # gh-5874: if the filepath is too long will raise here
      except (TypeError, ValueError):
          pass
      return exists
function_tokens: def file_exists ( filepath_or_buffer : FilePathOrBuffer ) -> bool : exists = False filepath_or_buffer = stringify_path ( filepath_or_buffer ) if not isinstance ( filepath_or_buffer , str ) : return exists try : exists = os . path . exists ( filepath_or_buffer ) # gh-5874: if the filepath is too long will raise here except ( TypeError , ValueError ) : pass return exists