AM-flask/app/firebase_logging.py
def text_parse(text):
    """
    parse the response text and split the record
    :param text:
    :return tuple <times(int), is_connected(boolean)>
    """
    is_connected = False
    times = 0

    text = clean_text(text)

    """
    Since the response follow that, if yes, "Y<whatever>3"; if no, "N"
    we just need find the digit in the text

    if the text does contain digit, it must be no;
    if contains and great than 0, it must be yes.
    """
    match = re.search(r"\d+", text)
    if match:
        times = int(match.group())
        if times > 0:
            is_connected = True

    elif "once" in text:
        is_connected = True
        times = 1

    return times, is_connected

    parse the response text and split the record
    :param text:
    :return tuple <times(int), is_connected(boolean)>
    
parse the response text and split the record
:param text:
:return tuple 
parse the response text and split the record : param text : : return tuple
def text_parse(text):
    is_connected = False
    times = 0
    text = clean_text(text)
    match = re.search(r"\d+", text)
    if match:
        times = int(match.group())
        if times > 0:
            is_connected = True
    elif "once" in text:
        is_connected = True
        times = 1
    return times, is_connected
def text_parse ( text ) : is_connected = False times = 0 text = clean_text ( text ) """
    Since the response follow that, if yes, "Y<whatever>3"; if no, "N"
    we just need find the digit in the text

    if the text does contain digit, it must be no;
    if contains and great than 0, it must be yes.
    """ match = re . search ( r"\d+" , text ) if match : times = int ( match . group ( ) ) if times > 0 : is_connected = True elif "once" in text : is_connected = True times = 1 return times , is_connected
parse the response text and split the record
:param text:
:return tuple <times(int), is_connected(boolean)>
parse the response text and split the record : param text : : return tuple <times ( int ) is_connected ( boolean ) >
"""
    parse the response text and split the record
    :param text:
    :return tuple <times(int), is_connected(boolean)>
    """ """
    Since the response follow that, if yes, "Y<whatever>3"; if no, "N"
    we just need find the digit in the text

    if the text does contain digit, it must be no;
    if contains and great than 0, it must be yes.
    """
text