code: def truncate_to(self, cert):
          
  
          cert_index = None
          for index, entry in enumerate(self):
              if entry.issuer_serial == cert.issuer_serial:
                  cert_index = index
                  break
  
          if cert_index is None:
              raise LookupError('Unable to find the certificate specified')
  
          while len(self) > cert_index + 1:
              self.pop()
  
          return self
docs: Remove all certificates in the path after the cert specified
  
          :param cert:
              An asn1crypto.x509.Certificate object to find
  
          :raises:
              LookupError - when the certificate could not be found
  
          :return:
              The current ValidationPath object, for chaining