def replace_dependencies(package_json, kind, memo={}):
    deps = package_json.get(kind, None)
    if deps is None:
        return package_json, memo
    for dependency in deps.keys():
        if dependency not in memo:
            package = project_info(dependency)
            if package is None:
                continue
            repo = repository_url(package)
            if repo is None:
                continue
            if repo.startswith('http'):
                repo = 'git+' + repo
            package_json[kind][dependency] = repo
            memo[dependency] = repo
        else:
            package_json[kind][dependency] = memo[dependency]
    return package_json, memo
Replace a top-level package's dependencies with their repository URLs.
dataset/ETHPy150Open zsck/npm-to-git/n2g.py/replace_dependencies