human
I wrote the below code

    inputs = tool.inputs
    galaxy_request = {}
    def from_simple_value(input, param_dict_value, cwl_type=None):
        if (cwl_type == 'json'):
            return json.dumps(param_dict_value)
        else:
            return param_dict_value
    for (input_name, input) in inputs.iteritems():
        as_dict_value = as_dict.get(input_name, NOT_PRESENT)
        galaxy_input_type = input.type
        if (galaxy_input_type == 'repeat'):
            if (input_name not in as_dict):
                continue
            only_input = input.inputs.values()[0]
            for (index, value) in enumerate(as_dict_value):
                key = ('%s_repeat_0|%s' % (input_name, only_input.name))
                galaxy_value = from_simple_value(only_input, value)
                galaxy_request[key] = galaxy_value
        elif (galaxy_input_type == 'conditional'):
            case_strings = input.case_strings
            if (((as_dict_value is NOT_PRESENT) or (as_dict_value is None)) and ('null' in case_strings)):
                cwl_type = 'null'
            elif ((as_dict_value is NOT_PRESENT) or (as_dict_value is None)):
                raise RequestParameterInvalidException(('Cannot    translate    CWL    datatype    -    value    [%s]    of    type    [%s]    with    case_strings    [%s].    Non-null    property    must    be    set.' % (as_dict_value, type(as_dict_value), case_strings)))
            elif (isinstance(as_dict_value, bool) and ('boolean' in case_strings)):
                cwl_type = 'boolean'
            elif (isinstance(as_dict_value, int) and ('integer' in case_strings)):
                cwl_type = 'integer'
            elif (isinstance(as_dict_value, int) and ('long' in case_strings)):
                cwl_type = 'long'
            elif (isinstance(as_dict_value, (int, float)) and ('float' in case_strings)):
                cwl_type = 'float'
            elif (isinstance(as_dict_value, (int, float)) and ('double' in case_strings)):
                cwl_type = 'double'
            elif...

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

def to_galaxy_parameters(tool, as_dict):