parameters: (filename)
return_statement: return sig.hexdigest()
docstring: Return a signature for a file.
docstring_summary: Return a signature for a file.
docstring_tokens: Return a signature for a file .
function: def file_signature(filename):
      """
      Return a signature for a file.
  
      """
  
      if not os.path.isfile(filename):
          return None
      if not os.path.exists(filename):
          return None
  
      # Duplicate auto-generated files can be recognized with the sha1 hash.
      sig = hashlib.sha1()
      with open(filename, "rb") as f:
          buf = f.read()
          sig.update(buf)
  
      return sig.hexdigest()
function_tokens: def file_signature ( filename ) : if not os . path . isfile ( filename ) : return None if not os . path . exists ( filename ) : return None # Duplicate auto-generated files can be recognized with the sha1 hash. sig = hashlib . sha1 ( ) with open ( filename , "rb" ) as f : buf = f . read ( ) sig . update ( buf ) return sig . hexdigest ( )