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 params:
        return '?' % params
    return ''
dataset/ETHPy150Open CenterForOpenScience/osf.io/website/addons/github/api.py/ref_to_params/operator `+` -> `%`