# Path: supplement/linter.py
# def lint(source):
#     source = sanitize_encoding(source)
#     tree = parse(source)
#     result = []
#     result.extend(check_names(source, tree))
# 
#     if isinstance(source, unicode):
#         result = translate_offsets(source, result)
# 
#     return result
# 
# Path: tests/helpers.py
# def cleantabs(text):
#     lines = text.splitlines()
#     if not lines[0].strip():
#         lines = lines[1:]
# 
#     toremove = 999
#     for l in lines:
#         stripped = l.lstrip()
#         if stripped:
#             toremove = min(toremove, len(l) - len(stripped))
# 
#     if toremove < 999:
#         return '\n'.join(l[toremove:] for l in lines)
#     else:
#         return '\n'.join(lines)


import re
from supplement.linter import lint
from .helpers import cleantabs
    assert_names('''
        def foo():
            if True:
                boo = 2

            if True:
                boo = 0

            return boo
    ''')

def test_parent_subbranches1():
    assert_names('''
        def foo():
            if True:
                boo = 2

            if True:
                return boo
    ''')

def test_parent_subbranches2():
    assert_names('''
        def foo():
            if True:
                boo = 1

                if True:
                    boo = 2


# Path: supplement/linter.py
# def lint(source):
#     source = sanitize_encoding(source)
#     tree = parse(source)
#     result = []
#     result.extend(check_names(source, tree))
# 
#     if isinstance(source, unicode):
#         result = translate_offsets(source, result)
# 
#     return result
# 
# Path: tests/helpers.py
# def cleantabs(text):
#     lines = text.splitlines()
#     if not lines[0].strip():
#         lines = lines[1:]
# 
#     toremove = 999
#     for l in lines:
#         stripped = l.lstrip()
#         if stripped:
#             toremove = min(toremove, len(l) - len(stripped))
# 
#     if toremove < 999:
#         return '\n'.join(l[toremove:] for l in lines)
#     else:
#         return '\n'.join(lines)


# Path: tests/test_linter.py
import re
from supplement.linter import lint
from .helpers import cleantabs

    assert_names('''
        def foo():
            if True:
                boo = 2

            if True:
                boo = 0

            return boo
    ''')

def test_parent_subbranches1():
    assert_names('''
        def foo():
            if True:
                boo = 2

            if True:
                return boo
    ''')

def test_parent_subbranches2():
    assert_names('''
        def foo():
            if True:
                boo = 1

                if True:
                    boo = 2


                if True: