human
Here's a good function header given the following:
I wrote the below code

    if (func_arg_map is None):
        func_arg_map = get_default_func_arg_map()
    if (fields.InputDataFields.image in tensor_dict):
        images = tensor_dict[fields.InputDataFields.image]
        if (len(images.get_shape()) != 4):
            raise ValueError('images    in    tensor_dict    should    be    rank    4')
        image = tf.squeeze(images, squeeze_dims=[0])
        tensor_dict[fields.InputDataFields.image] = image
    for option in preprocess_options:
        (func, params) = option
        if (func not in func_arg_map):
            raise ValueError(('The    function    %s    does    not    exist    in    func_arg_map' % func.__name__))
        arg_names = func_arg_map[func]
        for a in arg_names:
            if ((a is not None) and (a not in tensor_dict)):
                raise ValueError(('The    function    %s    requires    argument    %s' % (func.__name__, a)))
        def get_arg(key):
            return (tensor_dict[key] if (key is not None) else None)
        args = [get_arg(a) for a in arg_names]
        results = func(*args, **params)
        if (not isinstance(results, (list, tuple))):
            results = (results,)
        arg_names = [arg_name for arg_name in arg_names if (arg_name is not None)]
        for (res, arg_name) in zip(results, arg_names):
            tensor_dict[arg_name] = res
    if (fields.InputDataFields.image in tensor_dict):
        image = tensor_dict[fields.InputDataFields.image]
        images = tf.expand_dims(image, 0)
        tensor_dict[fields.InputDataFields.image] = images
    return tensor_dict

What's a good function header?
assistant
#Here's a good function header.

def preprocess(tensor_dict, preprocess_options, func_arg_map=None):