def get_random_value(field):
func = get_factory_func(field)<EOL>if field.default is not None:<EOL><INDENT>if callable(field.default):<EOL><INDENT>return field.default()<EOL><DEDENT>return field.default<EOL><DEDENT>if field.choices:<EOL><INDENT>return random.choice(field.choices)<EOL><DEDENT>return func(field)<EOL>
Calls the dispatch method (``get_factory_func``) and passes the field
obj argument to the callable returned.

Returns:
    random value depending on field type and constraints in the field
        object