def normalize_precinct(header):

    regex = re.compile(r'.*(precinct|precinct.*name).*', re.IGNORECASE)

    return filter(lambda x: regex.search(x), header)[0]
Regex examples:
dataset/ETHPy150Open openelections/openelections-core/openelex/us/wa/load.py/normalize_precinct