def get_version(package):
    path = os.path.join(os.path.dirname(__file__), package, '__init__.py')
    with open(path, 'rb') as f:
        init_py = f.read().decode('utf-8')
    return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)
Test starts_with function on generators
dataset/ETHPy150Open jonathanslenders/python-prompt-toolkit/setup.py/get_version--crossover with--dataset/ETHPy150Open duerrp/pyexperiment/tests/test_functional.py/TestStartsWith.test_starts_with_generators