

def format_number_for_mobile_dialing(numobj, region_calling_from, with_formatting):
    'Returns a number formatted in such a way that it can be dialed from a\n     mobile phone in a specific region.\n\n    If the number cannot be reached from the region (e.g. some countries block\n    toll-free numbers from being called outside of the country), the method\n    returns an empty string.\n\n    Arguments:\n    numobj -- The phone number to be formatted\n    region_calling_from -- The region where the call is being placed.\n\n    with_formatting -- whether the number should be returned with formatting\n              symbols, such as spaces and dashes.\n\n    Returns the formatted phone number.\n    '
    country_calling_code = numobj.country_code
    if (not _has_valid_country_calling_code(country_calling_code)):
        if (numobj.raw_input is None):
            return U_EMPTY_STRING
        else:
            return numobj.raw_input
    formatted_number = U_EMPTY_STRING
    numobj_no_ext = PhoneNumber()
    country_calling_code.merge_from(numobj)
    numobj_no_ext.extension = None
    region_code = region_code_for_country_code(country_calling_code)
    numobj_type = number_type(numobj_no_ext)
    is_valid_number = (numobj_type != PhoneNumberType.UNKNOWN)
    if (region_calling_from == region_code):
        is_fixed_line_or_mobile = ((numobj_type == PhoneNumberType.FIXED_LINE) or (numobj_type == PhoneNumberType.MOBILE) or (numobj_type == PhoneNumberType.FIXED_LINE_OR_MOBILE))
        if ((region_code == 'CO') and (numobj_type == PhoneNumberType.FIXED_LINE)):
            formatted_number = format_national_number_with_carrier_code(numobj_no_ext, _COLOMBIA_MOBILE_TO_FIXED_LINE_PREFIX)
        elif ((region_code == 'BR') and is_fixed_line_or_mobile):
            if (numobj_no_ext.preferred_domestic_carrier_code is not None):
                formatted_number = format_national_number_with_preferred_carrier_code(numobj_no_ext, '')
            else:
                formatted_number = U_EMPTY_STRING
        elif (is_valid_number and (region_code == 'HU')):
            formatted_number = ((ndd_prefix_for_region(region_code, True) + U_SPACE) + format_number(numobj_no_ext, PhoneNumberFormat.NATIONAL))
        elif (country_calling_code == _NANPA_COUNTRY_CODE):
            metadata = PhoneMetadata.metadata_for_region(region_calling_from)
            if (_can_be_internationally_dialled(numobj_no_ext) and (not _is_shorter_than_possible_normal_number(metadata, national_significant_number(numobj_no_ext)))):
                formatted_number = format_number(numobj_no_ext, PhoneNumberFormat.INTERNATIONAL)
            else:
                formatted_number = format_number(numobj_no_ext, PhoneNumberFormat.NATIONAL)
        elif (((region_code == REGION_CODE_FOR_NON_GEO_ENTITY) or (((region_code == unicod('MX')) or (region_code == unicod('CL'))) and is_fixed_line_or_mobile)) and _can_be_internationally_dialled(numobj_no_ext)):
            formatted_number = format_number(numobj_no_ext, PhoneNumberFormat.INTERNATIONAL)
        else:
            formatted_number = format_number(numobj_no_ext, PhoneNumberFormat.NATIONAL)
    elif (is_valid_number and _can_be_internationally_dialled(numobj_no_ext)):
        if with_formatting:
            return format_number(numobj_no_ext, PhoneNumberFormat.INTERNATIONAL)
        else:
            return format_number(numobj_no_ext, PhoneNumberFormat.E164)
    if with_formatting:
        return formatted_number
    else:
        return _normalize_diallable_chars_only(formatted_number)

dataset/ETHPy150Open daviddrysdale/python-phonenumbers/python/phonenumbers/phonenumberutil.py format_number_for_mobile_dialing/VarMisuse@69/352 `numobj_no_ext`->`country_calling_code`