def dummytable(numrows=100,
               fields=(('foo', partial(random.randint, 0, 100)),
                       ('bar', partial(random.choice, ('apples', 'pears',
                                                       'bananas', 'oranges'))),
                       ('baz', random.random)),
               wait=0, seed=None):
    """
    Construct a table with dummy data. Use `numrows` to specify the number of
    rows. Set `wait` to a float greater than zero to simulate a delay on each
    row generation (number of seconds per row). E.g.::

        >>> import petl as etl
        >>> table1 = etl.dummytable(100, seed=42)
        >>> table1
        +-----+----------+----------------------+
        | foo | bar      | baz                  |
        +=====+==========+======================+
        |  81 | 'apples' | 0.025010755222666936 |
        +-----+----------+----------------------+
        |  35 | 'pears'  |  0.22321073814882275 |
        +-----+----------+----------------------+
        |  94 | 'apples' |   0.6766994874229113 |
        +-----+----------+----------------------+
        |  69 | 'apples' |   0.5904925124490397 |
        +-----+----------+----------------------+
        |   4 | 'apples' |  0.09369523986159245 |
        +-----+----------+----------------------+
        ...

        >>> # customise fields
        ... import random
        >>> from functools import partial
        >>> fields = [('foo', random.random),
        ...           ('bar', partial(random.randint, 0, 500)),
        ...           ('baz', partial(random.choice,
        ...                           ['chocolate', 'strawberry', 'vanilla']))]
        >>> table2 = etl.dummytable(100, fields=fields, seed=42)
        >>> table2
        +---------------------+-----+-------------+
        | foo                 | bar | baz         |
        +=====================+=====+=============+
        |  0.6394267984578837 |  12 | 'vanilla'   |
        +---------------------+-----+-------------+
        | 0.27502931836911926 | 114 | 'chocolate' |
        +---------------------+-----+-------------+
        |  0.7364712141640124 | 346 | 'vanilla'   |
        +---------------------+-----+-------------+
        |  0.8921795677048454 |  44 | 'vanilla'   |
        +---------------------+-----+-------------+
        |  0.4219218196852704 |  15 | 'chocolate' |
        +---------------------+-----+-------------+
        ...

    Data generation functions can be specified via the `fields` keyword
    argument.

    Note that the data are generated on the fly and are not stored in memory,
    so this function can be used to simulate very large tables.

    """

    return DummyTable(numrows=numrows, fields=fields, wait=wait, seed=seed)
Construct a table with dummy data. Use `numrows` to specify the number of
    rows. Set `wait` to a float greater than zero to simulate a delay on each
    row generation (number of seconds per row). E.g.::

        >>> import petl as etl
        >>> table1 = etl.dummytable(100, seed=42)
        >>> table1
        +-----+----------+----------------------+
        | foo | bar      | baz                  |
        +=====+==========+======================+
        |  81 | 'apples' | 0.025010755222666936 |
        +-----+----------+----------------------+
        |  35 | 'pears'  |  0.22321073814882275 |
        +-----+----------+----------------------+
        |  94 | 'apples' |   0.6766994874229113 |
        +-----+----------+----------------------+
        |  69 | 'apples' |   0.5904925124490397 |
        +-----+----------+----------------------+
        |   4 | 'apples' |  0.09369523986159245 |
        +-----+----------+----------------------+
        ...

        >>> # customise fields
        ... import random
        >>> from functools import partial
        >>> fields = [('foo', random.random),
        ...           ('bar', partial(random.randint, 0, 500)),
        ...           ('baz', partial(random.choice,
        ...                           ['chocolate', 'strawberry', 'vanilla']))]
        >>> table2 = etl.dummytable(100, fields=fields, seed=42)
        >>> table2
        +---------------------+-----+-------------+
        | foo                 | bar | baz         |
        +=====================+=====+=============+
        |  0.6394267984578837 |  12 | 'vanilla'   |
        +---------------------+-----+-------------+
        | 0.27502931836911926 | 114 | 'chocolate' |
        +---------------------+-----+-------------+
        |  0.7364712141640124 | 346 | 'vanilla'   |
        +---------------------+-----+-------------+
        |  0.8921795677048454 |  44 | 'vanilla'   |
        +---------------------+-----+-------------+
        |  0.4219218196852704 |  15 | 'chocolate' |
        +---------------------+-----+-------------+
        ...

    Data generation functions can be specified via the `fields` keyword
    argument.

    Note that the data are generated on the fly and are not stored in memory,
    so this function can be used to simulate very large tables.