Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _make_ref(self, ref, refName="the ref"):
if isinstance(ref, basestring):
repo = self._parent.get()
return PullRequestRef(repo['project']['key'], repo['slug'], ref).to_dict()
elif isinstance(ref, PullRequestRef):
return ref.to_dict()
elif isinstance(ref, dict):
return ref
else:
raise ValueError(refName + " should be either a string, a dict, or a PullRequestRef")