def get_context_text(pathfile):
    start = re.compile(r'.*?{%\s*zorna\s+(.*?)(%}|$)')
    end = re.compile(r'(.*?)(%})')
    try:
        fin = open(pathfile, 'r')
    except IOError:
        return '', ''
    started = False
    context = ''
    text = ''
    matcher = start
    for line in fin:
        match = matcher.match(line)
        if match:
            context = context + match.group(1)
            if started:
                break
            else:
                matcher = end
                started = True
        elif started:
            context = context + line
        else:
            text = text + line
    for line in fin:
        text = text + line
    # tag_re = re.compile(r'(%s\s*block(.*?)\s*%s)(.*?)(%s\s*endblock.*?\s*%s)' % (re.escape('{%'), re.escape('%}'),re.escape('{%'), re.escape('%}')), re.M|re.DOTALL)
    # tag_re2 = re.compile(r'(%s\s*zorna)(.*?)(\s*%s)' % (re.escape('{%'), re.escape('%}')), re.M|re.DOTALL)
    # for match in tag_re.finditer(text):
    #    g = match.groups()
    return context, text
A session with an invalid token raises an unauthorized exception
dataset/ETHPy150Open zorna/zorna/zorna/utils.py/get_context_text--crossover with--dataset/ETHPy150Open freakboy3742/pyxero/tests/exceptions.py/ExceptionsTest.test_unauthorized_invalid