<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _wrap_function_return(val):
 """ Recursively walks each thing in val, opening lists and dictionaries, converting all occurrences of UnityGraphProxy to an SGraph, UnitySFrameProxy to SFrame, and UnitySArrayProxy to SArray. """


    if type(val) is _UnityGraphProxy:
        return _SGraph(_proxy = val)
    elif type(val) is _UnitySFrameProxy:
        return _SFrame(_proxy = val)
    elif type(val) is _UnitySArrayProxy:
        return _SArray(_proxy = val)
    elif type(val) is _UnityModel:
        # we need to cast it up to the appropriate type
        uid = val.get_uid()
        if uid in class_uid_to_class:
            return class_uid_to_class[uid](_proxy=val)
        else:
            return val
    elif type(val) is list:
        return [_wrap_function_return(i) for i in val]
    elif type(val) is dict:
        return dict( (i, _wrap_function_return(val[i])) for i in val)
    else:
        return val