def _extract_country_code(number):
 if ((len(number) == 0) or (number[0] == U_ZERO)):
  return (0, number)
 for ii in range(1, (min(len(number), _MAX_LENGTH_COUNTRY_CODE) + 1)):
  try:
   country_code = int(number[:ii])
   if (country_code in COUNTRY_CODE_TO_REGION_CODE):
    return (country_code, number[ii:])
  except Exception:
   pass
 return (0, number)

def _extract_country_code ( number ) : if ( ( len ( number ) == 0 ) or ( number [ 0 ] == U_ZERO ) ) : return ( 0 , number ) for ii in range ( 1 , ( min ( len ( number ) , _MAX_LENGTH_COUNTRY_CODE ) + 1 ) ) : try : country_code = int ( number [ : ii ] ) if ( country_code in COUNTRY_CODE_TO_REGION_CODE ) : return ( country_code , number [ ii : ] ) except Exception : pass return ( 0 , number )
extracts country calling code from number .