parameters: (f, a)
return_statement: return h.hexdigest()
docstring: I take a file like object 'f' and return a hex-string containing
      of the result of the algorithm 'a' applied to 'f'.
docstring_summary: I take a file like object 'f' and return a hex-string containing
      of the result of the algorithm 'a' applied to 'f'.
docstring_tokens: I take a file like object f and return a hex - string containing of the result of the algorithm a applied to f .
function: def digest_file(f, a):
      """I take a file like object 'f' and return a hex-string containing
      of the result of the algorithm 'a' applied to 'f'."""
      h = hashlib.new(a)
      chunk_size = 1024 * 10
      data = f.read(chunk_size)
      while data:
          h.update(data)
          data = f.read(chunk_size)
      name = repr(f.name) if hasattr(f, 'name') else 'a file'
      log.debug('hashed %s with %s to be %s', name, a, h.hexdigest())
      return h.hexdigest()
function_tokens: def digest_file ( f , a ) : h = hashlib . new ( a ) chunk_size = 1024 * 10 data = f . read ( chunk_size ) while data : h . update ( data ) data = f . read ( chunk_size ) name = repr ( f . name ) if hasattr ( f , 'name' ) else 'a file' log . debug ( 'hashed %s with %s to be %s' , name , a , h . hexdigest ( ) ) return h . hexdigest ( )