code: def populate_device(dev):
          
          try:
              tgt = PackTargets._generate_pack_target_class(dev)
              if tgt is None:
                  return
              part = dev.part_number.lower()
              LOG.debug("Loading target '%s' from CMSIS-Pack", part)
  
              # Make sure there isn't a duplicate target name.
              if part not in TARGET:
                  TARGET[part] = tgt
          except (MalformedCmsisPackError, FileNotFoundError_) as err:
              LOG.warning(err)
docs: ! @brief Generates and populates the target defined by a CmsisPackDevice.
  
          The new target class is added to the `#TARGET` list.
  
          @param dev A CmsisPackDevice object.