def parseCallable(targetCall, name, user_args, user_kwargs):
    '''
    '''
    #
    # Check callable given
    #
    import inspect

    if not (inspect.ismethod(targetCall) or inspect.isfunction(targetCall)):
        raise GraphError("Callable must be a function or method.")

    # Common args
    callableArgs = {}
    callableArgs['sysPath'] = sys.path
    callableArgs['moduleName'] = targetCall.__module__

    # Ensure params can be serialized i.e. not object, instance or function
    try:
        callableArgs['user_args'] = json.dumps(user_args)
        callableArgs['user_kwargs'] = json.dumps(user_kwargs)
    except __HOLE__:
        raise GraphError("Error: invalid parameters (not JSON serializable): %s" % params)

    # Specific args
    if inspect.isfunction(targetCall):
        callableArgs['execType'] = 'function'
        callableArgs['funcName'] = targetCall.__name__
        taskName = name if name != "" else callableArgs['funcName']

    if inspect.ismethod(targetCall):
        callableArgs['execType'] = 'method'
        callableArgs['className'] = inspect.getmro(targetCall.im_class)[0].__name__
        callableArgs['methodName'] = targetCall.__name__
        taskName = name if name != "" else callableArgs['className'] + "." + callableArgs['methodName']

    return (taskName, callableArgs)
dataset/ETHPy150Open mikrosimage/OpenRenderManagement/src/puliclient/__init__.py/parseCallable