<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def normalize_reference_name(name):
 """ Search the dictionary of species-specific references to find a reference name that matches aside from capitalization. If no matching reference is found, raise an exception. """

    lower_name = name.strip().lower()
    for reference in Species._reference_names_to_species.keys():
        if reference.lower() == lower_name:
            return reference
    raise ValueError("Reference genome '%s' not found" % name)