code: def get_ref(self, branch, origin=None):
          
          if not origin:
              origin = self.origin
          uri = "{api}/repos/{origin}/git/refs/heads/{branch}".format(
              api=self.github_api_url,
              origin=origin,
              branch=branch
          )
          data = self.request("GET", uri)
          if data.status_code == 200:
              data = json.loads(data.content.decode("utf-8"))
              if isinstance(data, list):
                  # No addresses matches, we get search results which stars with {branch}
                  return False
              #  Otherwise, we get one record
              return data["object"]["sha"]
          elif data.status_code == 404:
              return False
          else:
              decoded_data = json.loads(data.content.decode("utf-8"))
              return self.ProxyError(
                  data.status_code, (decoded_data, "message"),
                  step="get_ref", context={
                      "uri": uri
                  }
              )
docs: Check if a reference exists
  
          :param branch: The branch to check if it exists
          :return: Sha of the branch if it exists, False if it does not exist, self.ProxyError if it went wrong