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")
def url(self, resource_path):
assert isinstance(resource_path, basestring)
if not resource_path.startswith("/"):
resource_path = "/" + resource_path
return self._api_base + resource_path