def get_metadata(stn_name, pi_name, lookup_lists):
    """Look up station metadata given a station name."""
    stn_key = stn_name
    agency_key = pi_name
    stations, agencies = lookup_lists['stations'], lookup_lists['agencies']
    agency_acronym, country_id, station_id = None, None, None
    if stn_key is not None:
        stn_key = stn_name.lower()
    if stn_key in stations:
        country_id = stations[stn_key][0]
        station_id = stations[stn_key][1]
    if agency_key in stations:
        agency_acronym = agencies[agency_key]

    metadata = (agency_acronym, country_id, station_id)
    return metadata