def get_population_from_record(record):
    """ The shapefile population records aren't consistent, so we use this
    method to search for and return the population entry. """
    record_keys = record.keys()
    possible_keys = ['Total_Pop', 'Population', 'Total_INDs']
    for key in possible_keys:
        if key in record_keys:
            return record[key]

    raise RuntimeError('Could not find valid population key! Possible keys are: {}'.format(record_keys))