code: def build_paths(self, end_entity_cert):
          
  
          if not isinstance(end_entity_cert, byte_cls) and not isinstance(end_entity_cert, x509.Certificate):
              raise TypeError(pretty_message(
                  '''
                  end_entity_cert must be a byte string or an instance of
                  asn1crypto.x509.Certificate, not %s
                  ''',
                  type_name(end_entity_cert)
              ))
  
          if isinstance(end_entity_cert, byte_cls):
              if pem.detect(end_entity_cert):
                  _, _, end_entity_cert = pem.unarmor(end_entity_cert)
              end_entity_cert = x509.Certificate.load(end_entity_cert)
  
          path = ValidationPath(end_entity_cert)
          paths = []
          failed_paths = []
  
          self._walk_issuers(path, paths, failed_paths)
  
          if len(paths) == 0:
              cert_name = end_entity_cert.subject.human_friendly
              missing_issuer_name = failed_paths[0].first.issuer.human_friendly
              raise PathBuildingError(pretty_message(
                  '''
                  Unable to build a validation path for the certificate "%s" - no
                  issuer matching "%s" was found
                  ''',
                  cert_name,
                  missing_issuer_name
              ))
  
          return paths
docs: Builds a list of ValidationPath objects from a certificate in the
          operating system trust store to the end-entity certificate
  
          :param end_entity_cert:
              A byte string of a DER or PEM-encoded X.509 certificate, or an
              instance of asn1crypto.x509.Certificate
  
          :return:
              A list of certvalidator.path.ValidationPath objects that represent
              the possible paths from the end-entity certificate to one of the CA
              certs.