def ops_parse(func, name=None):
    """
    Wraps function with a class to allow __getattr__ on a function.
    """
    new_class = type(func.__name__, (
        OpsParser,
        object,
    ), dict(__doc__=func.__doc__))
    return new_class(func, name)
Wraps function with a class to allow __getattr__ on a function.
towhee/runtime/factory.py