parameters: (filename)
return_statement: return result
docstring: Quickly see if a file is a ZIP file by checking the magic number.
  
      The filename argument may be a file or file-like object too.
docstring_summary: Quickly see if a file is a ZIP file by checking the magic number.
docstring_tokens: Quickly see if a file is a ZIP file by checking the magic number .
function: def is_zipfile(filename):
      """Quickly see if a file is a ZIP file by checking the magic number.
  
      The filename argument may be a file or file-like object too.
      """
      result = False
      try:
          if hasattr(filename, "read"):
              result = _check_zipfile(fp=filename)
          else:
              with open(filename, "rb") as fp:
                  result = _check_zipfile(fp)
      except IOError:
          pass
      return result
function_tokens: def is_zipfile ( filename ) : result = False try : if hasattr ( filename , "read" ) : result = _check_zipfile ( fp = filename ) else : with open ( filename , "rb" ) as fp : result = _check_zipfile ( fp ) except IOError : pass return result