def __converting_factory(specimen_cls, original_factory):
    """Return a wrapper that converts a "canned" collection like
    set, dict, list into the Instrumented* version.

    """

    instrumented_cls = __canned_instrumentation[specimen_cls]

    def wrapper():
        collection = original_factory()
        return instrumented_cls(collection)

    # often flawed but better than nothing
    wrapper.__name__ = "%sWrapper" % original_factory.__name__
    wrapper.__doc__ = original_factory.__doc__

    return wrapper
dataset/ETHPy150Open goFrendiAsgard/kokoropy/kokoropy/packages/sqlalchemy/orm/collections.py/__converting_factory/original