def lookup_ref(repo, ref_name):
    try:
        return repo.lookup_reference(ref_name)
    except (ValueError, KeyError):
        if ref_name in "/" and not ref_name.startswith("refs/"):
            ref_name = "refs/" + ref_name
        else:
            ref_name = "refs/heads/" + ref_name

        try:
            return repo.lookup_reference(ref_name)
        except (ValueError, KeyError):
            return None
dataset/ETHPy150Open hulu/restfulgit/restfulgit/plumbing/retrieval.py/lookup_ref/swapped operands of `in`