code: def fold(table, key, f, value=None, presorted=False, buffersize=None,
           tempdir=None, cache=True):
      
  
      return FoldView(table, key, f, value=value, presorted=presorted,
                      buffersize=buffersize, tempdir=tempdir, cache=cache)
docs: Reduce rows recursively via the Python standard :func:`reduce` function.
      E.g.::
  
          >>> import petl as etl
          >>> table1 = [['id', 'count'],
          ...           [1, 3],
          ...           [1, 5],
          ...           [2, 4],
          ...           [2, 8]]
          >>> import operator
          >>> table2 = etl.fold(table1, 'id', operator.add, 'count',
          ...                   presorted=True)
          >>> table2
          +-----+-------+
          | key | value |
          +=====+=======+
          |   1 |     8 |
          +-----+-------+
          |   2 |    12 |
          +-----+-------+
  
      See also :func:`petl.transform.reductions.aggregate`,
      :func:`petl.transform.reductions.rowreduce`.