

def _maybe_append_formatted_extension(numobj, metadata, num_format, number):
    'Appends the formatted extension of a phone number to formatted number,\n    if the phone number had an extension specified.\n    '
    if ((numobj.extension is not None) and (len(numobj.extension) > 0)):
        if (num_format == PhoneNumberFormat.RFC3966):
            return ((metadata + _RFC3966_EXTN_PREFIX) + numobj.extension)
        elif (metadata.preferred_extn_prefix is not None):
            return ((number + metadata.preferred_extn_prefix) + numobj.extension)
        else:
            return ((number + _DEFAULT_EXTN_PREFIX) + numobj.extension)
    return number

dataset/ETHPy150Open daviddrysdale/python-phonenumbers/python/phonenumbers/phonenumberutil.py _maybe_append_formatted_extension/VarMisuse@57/119 `number`->`metadata`