

def format_in_original_format(numobj, region_calling_from):
    "Format a number using the original format that the number was parsed from.\n\n    The original format is embedded in the country_code_source field of the\n    PhoneNumber object passed in. If such information is missing, the number\n    will be formatted into the NATIONAL format by default.\n\n    When the number contains a leading zero and this is unexpected for this\n    country, or we don't have a formatting pattern for the number, the method\n    returns the raw input when it is available.\n\n    Note this method guarantees no digit will be inserted, removed or modified\n    as a result of formatting.\n\n    Arguments:\n    number -- The phone number that needs to be formatted in its original\n              number format\n    region_calling_from -- The region whose IDD needs to be prefixed if the\n              original number has one.\n\n    Returns the formatted phone number in its original number format.\n    "
    if ((numobj.raw_input is not None) and (_has_unexpected_italian_leading_zero(numobj) or (not _has_formatting_pattern_for_number(numobj)))):
        return numobj.raw_input
    if (numobj.country_code_source is None):
        return format_number(numobj, PhoneNumberFormat.NATIONAL)
    formatted_number = _format_original_allow_mods(numobj, region_calling_from)
    num_raw_input = numobj.raw_input
    if ((formatted_number is not None) and (num_raw_input is not None) and (len(num_raw_input) > 0)):
        normalized_formatted_number = _normalize_diallable_chars_only(formatted_number)
        normalized_raw_input = _normalize_diallable_chars_only(num_raw_input)
        if (normalized_formatted_number != normalized_raw_input):
            formatted_number = num_raw_input
    return formatted_number

dataset/ETHPy150Open daviddrysdale/python-phonenumbers/python/phonenumbers/phonenumberutil.py format_in_original_format/original