

def ref_to_params(branch=None, sha=None):
    params = urllib.urlencode({key: value for (key, value) in {
        'branch': branch,
        'sha': sha,
    }.iteritems() if value})
    if branch:
        return ('?' + params)
    return ''

dataset/ETHPy150Open CenterForOpenScience/osf.io/website/addons/github/api.py ref_to_params/VarMisuse@56/63 `params`->`branch`