human
I wrote the below code

    if (not data):
        return {}
    try:
        choices = [x.value for x in data]
    except AttributeError:
        choices = data
    def _type(value):
        return (next((x for x in choices if (x.lower() == value.lower())), value) if value else value)
    params = {'choices': CaseInsensitiveList(choices), 'type': _type}
    return params

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

def enum_choice_list(data):