'Creates a new instance.
Arguments:
text -- The character sequence that we will search, None for no text.
country -- The country to assume for phone numbers not written in
international format (with a leading plus, or with the
international dialing prefix of the specified region). May be
None or "ZZ" if only numbers with a leading plus should be
considered.
leniency -- The leniency to use when evaluating candidate phone
numbers.
max_tries -- The maximum number of invalid numbers to try before
giving up on the text.  This is to cover degenerate cases where
the text has a lot of false positives in it. Must be >= 0.'

def __init__(self, text, region, leniency=Leniency.VALID, max_tries=65535):

    if (leniency is None):
        raise ValueError('Need    a    leniency    value')
    if (int(max_tries) < 0):
        raise ValueError('Need    max_tries    to    be    positive    int')
    self.text = text
    if (self.text is None):
        self.text = U_EMPTY_STRING
    self.preferred_region = region
    self.leniency = leniency
    self._max_tries = int(max_tries)
    self._state = PhoneNumberMatcher._NOT_READY
    self._last_match = None
    self._search_index = 0
