def transform_geography_targeting_from_dfp(targeting):
    if not targeting:
        return None

    exclude_list = []
    excluded = targeting.get('excludedLocations', [])
    for g in excluded:
        exclude_list.append(_geo_from_dfp(g))

    include_list = []
    included = targeting.get('targetedLocations', [])
    for g in included:
        include_list.append(_geo_from_dfp(g))

    return _make_criterion_from_lists(include_list, exclude_list)
Convert dfp dictionary to geography targeting model
dataset/ETHPy150Open chartbeat-labs/parselmouth/parselmouth/adapters/dfp/targeting_utils.py/transform_geography_targeting_from_dfp