def recursively_replace_dependencies(node_modules_path, kind, memo={}):
    package_json_filename = os.sep.join([node_modules_path, 'package.json'])
    if os.path.isfile(package_json_filename):
        try:
            in_file = open(package_json_filename)
            package_json = json.loads(in_file.read())
            in_file.close()
            new_pkg_json, new_memos = replace_dependencies(package_json, kind, memo)
            memo.update(new_memos)
            out_file = open(package_json_filename, 'w')
            out_file.write(json.dumps(new_pkg_json, indent=4))
            out_file.close()
        except IOError:
            sys.stderr.write('Could not read/write {0}'.format(package_json_filename))
    for name in os.listdir(node_modules_path):
        path = os.sep.join([node_modules_path, name])
        if os.path.isdir(path):
            recursively_replace_dependencies(path, kind, memo)
    return memo
openconnect-helper is a simple command line application that
dataset/ETHPy150Open zsck/npm-to-git/n2g.py/recursively_replace_dependencies--crossover with--dataset/ETHPy150Open mitsuhiko/osx-openconnect-helper/openconnect_helper.py/cli