def one_of(*generators):
    """
    Generates an arbitrary value of one of the specified generators.
    This is a class factory, it makes a class which is a closure around the
    specified generators.
    """

    class OneOfGenerators(ArbitraryInterface):
        """
        A closure class around the generators specified above, which
        generates one of the generators.
        """

        @classmethod
        def arbitrary(cls):
            """
            Generate one of the enclosed generators.
            """
            return arbitrary(random.choice(generators))

    OneOfGenerators.__name__ = ''.join([
        'one_of(', ', '.join(generator.__name__ for generator in generators),
        ')'
    ])
    return OneOfGenerators
def one_of ( * generators ) : class OneOfGenerators ( ArbitraryInterface ) : @ classmethod def arbitrary ( cls ) : return arbitrary ( random . choice ( generators ) ) OneOfGenerators . __name__ = '' . join ( [ 'one_of(' , ', ' . join ( generator . __name__ for generator in generators ) , ')' ] ) return OneOfGenerators
Generates an arbitrary value of one of the specified generators.
    This is a class factory, it makes a class which is a closure around the
    specified generators.