def get_cinspect_object(obj):
    """ Returns the object wrapped in the appropriate CInspectObject class. """

    try:
        with inspect_restored():
            inspect.getsource(obj)

    except (TypeError, __HOLE__):
        wrapped = _get_cinspect_object(obj)

    else:
        wrapped = PythonObject(obj)

    return wrapped
dataset/ETHPy150Open punchagan/cinspect/cinspect/_types.py/get_cinspect_object