code: def get_proxy_ticket(self, pgt):
          
          response = urllib_request.urlopen(self.get_proxy_url(pgt))
          if response.code == 200:
              from lxml import etree
              root = etree.fromstring(response.read())
              tickets = root.xpath(
                  "//cas:proxyTicket",
                  namespaces={"cas": "http://www.yale.edu/tp/cas"}
              )
              if len(tickets) == 1:
                  return tickets[0].text
              errors = root.xpath(
                  "//cas:authenticationFailure",
                  namespaces={"cas": "http://www.yale.edu/tp/cas"}
              )
              if len(errors) == 1:
                  raise CASError(errors[0].attrib['code'], errors[0].text)
          raise CASError("Bad http code %s" % response.code)
docs: Returns proxy ticket given the proxy granting ticket