def get_branches(proj_dir) :
    branches = {}
    try:
        output = subprocess.check_output('git branch -vv', cwd=proj_dir, shell=True)
        lines = output.splitlines()
        for line in lines :
            tokens = line[2:].split()
            local_branch = tokens[0]
            if re.compile("^\[.*(:|\])$").match(tokens[2]) :
                remote_branch = tokens[2][1:-1]
                branches[local_branch] = remote_branch
    except subprocess.CalledProcessError :
        log.error("failed to call 'git branch -vv'")
    return branches;

#-------------------------------------------------------------------------------
A variable-length version of Python's builtin hash. Neat!
dataset/ETHPy150Open floooh/fips/mod/tools/git.py/get_branches--crossover with--dataset/ETHPy150Open androguard/androguard/elsim/elsim/similarity/simhash.py/simhash._string_hash