def get_repo_contents(repo):
    returned = {}
    path = repo.path
    if not path.endswith(os.sep):
        path += os.sep
    for dirpath, dirnames, filenames in os.walk(path):
        if '.git' in dirnames:
            dirnames.remove('.git')
        for filename in filenames:
            full_filename = os.path.join(dirpath, filename)
            returned[full_filename[len(path):]] = hashlib.sha512(open(full_filename, "rb").read()).hexdigest()
    return returned
dataset/ETHPy150Open Infinidat/gitpy/tests/utils.py/get_repo_contents/original