import re


def get_link_from_query(query):
    m = re.findall("(https?://\S+)", query)
    if len(m) > 0:
        return m[0]
    return None


def validate_query(query):
    return get_link_from_query(query) or re.search("aliexpress", query) or is_digits(query)


def is_digits(query):
    return re.search("^\d+$", query)

c5869fd46cd70044af9687ae3ce7e0bb0854c570
<mask token>


def get_link_from_query(query):
    m = re.findall('(https?://\\S+)', query)
    if len(m) > 0:
        return m[0]
    return None


<mask token>

<mask token>


def get_link_from_query(query):
    m = re.findall('(https?://\\S+)', query)
    if len(m) > 0:
        return m[0]
    return None


<mask token>


def is_digits(query):
    return re.search('^\\d+$', query)

<mask token>


def get_link_from_query(query):
    m = re.findall('(https?://\\S+)', query)
    if len(m) > 0:
        return m[0]
    return None


def validate_query(query):
    return get_link_from_query(query) or re.search('aliexpress', query
        ) or is_digits(query)


def is_digits(query):
    return re.search('^\\d+$', query)

import re


def get_link_from_query(query):
    m = re.findall('(https?://\\S+)', query)
    if len(m) > 0:
        return m[0]
    return None


def validate_query(query):
    return get_link_from_query(query) or re.search('aliexpress', query
        ) or is_digits(query)


def is_digits(query):
    return re.search('^\\d+$', query)

import re


def get_link_from_query(query):
    m = re.findall("(https?://\S+)", query)
    if len(m) > 0:
        return m[0]
    return None


def validate_query(query):
    return get_link_from_query(query) or re.search("aliexpress", query) or is_digits(query)


def is_digits(query):
    return re.search("^\d+$", query)
