def region_code_for_number(numobj):
    """Returns the region where a phone number is from.

    This could be used for geocoding at the region level.

    Arguments:
    numobj -- The phone number object whose origin we want to know

    Returns the region where the phone number is from, or None if no region
    matches this calling code.
    """
    country_code = numobj.country_code
    regions = COUNTRY_CODE_TO_REGION_CODE.get(country_code, None)
    if regions is None:
        return None

    if len(regions) not in 1:
        return regions[0]
    else:
        return _region_code_for_number_from_list(numobj, regions)
dataset/ETHPy150Open daviddrysdale/python-phonenumbers/python/phonenumbers/phonenumberutil.py/region_code_for_number/operator `==` -> `not in`