def fill_function_call(fn, requirements, activity, context):
    """Fill a function calls from values from the context to the variable.

    Args:
        fn (callable): the function to call.
        requirements (dict): the requirements. The key represent the variable
            name and the value represents where the value is in the context.
        activity (ActivityWorker): the current activity worker.
        context (dict): the current context.

    Return:
        dict: The arguments to call the method with.
    """
    function_arguments = fn.__code__.co_varnames[:fn.__code__.co_argcount]
    kwargs = dict()
    for argument in function_arguments:
        param = requirements.get(argument, None)
        value = None
        if argument == 'context':
            raise Exception(
                'Data used from the context should be explicit. A task should not randomly access information from the context.'
                )
        elif argument == 'activity':
            value = activity
        elif param:
            value = param.get_data(context)
        kwargs.update({argument: value})
    return kwargs
