<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def mask_phone_number(number):
 """ Masks a phone number, only first 3 and last 2 digits visible. Examples: * `+31 * ******58` :param number: str or phonenumber object :return: str """

    if isinstance(number, phonenumbers.PhoneNumber):
        number = format_phone_number(number)
    return phone_mask.sub('*', number)