def get_ave_weight(state):
    """Return the average weight parameter for a state"""
    import metatab as mt
    doc = mt.open_package(
        'http://s3.amazonaws.com/library.metatab.org/census.gov-varrep_tables_support-2011e2015-1.csv'
        )
    r = doc.resource('ave_weights')
    d = {}
    for row in r.iterdict:
        try:
            if int(row['fips_state_code']) == int(state):
                return int(row['average_weight'])
        except TypeError:
            continue
