@task
def patch_version(vs, path=pjoin(here, '..')):
    v = parse_vs(vs)
    version_py = pjoin(path, 'jupyterhub', 'version.py')
    print("patching %s with %s" % (version_py, vs))
    # read version.py, minus version parts
    with open(version_py) as f:
        pre_lines = []
        post_lines = []
        for line in f:
            pre_lines.append(line)
            if line.startswith("version_info"):
                break
        for line in f:
            if line.startswith(')'):
                post_lines.append(line)
                break
        for line in f:
            post_lines.append(line)
    
    # write new version.py
    with open(version_py, 'w') as f:
        for line in pre_lines:
            f.write(line)
        for part in v:
            f.write('    %r,\n' % part)
        for line in post_lines:
            f.write(line)
    
    # verify result
    ns = {}
    with open(version_py) as f:
        exec(f.read(), {}, ns)
    assert ns['__version__'] == vs, "%r != %r" % (ns['__version__'], vs)
Initialize the Robot resource.
dataset/ETHPy150Open jupyterhub/jupyterhub/tools/tasks.py/patch_version--crossover with--dataset/ETHPy150Open rapyuta/rce/rce-comm/rce/comm/server.py/RobotResource.__init__