def get_regexp_pattern(regexp):
    """
    Helper that returns regexp pattern from given value.

    :param regexp: regular expression to stringify
    :type regexp: _sre.SRE_Pattern or str
    :returns: string representation of given regexp pattern
    :rtype: str
    """
    try:
        return regexp.pattern
    except __HOLE__:
        return str(regexp)
dataset/ETHPy150Open corydolphin/flask-cors/flask_cors/core.py/get_regexp_pattern