docstr: Make sure chosen objects and images are selected only once
docstr_tok: ["Make","sure","chosen","objects","and","images","are","selected","only","once"]
code: def validate_module(self, pipeline):
      """Make sure chosen objects and images are selected only once"""
      images = set()
      if len(self.images_list.value) == 0:
          raise ValidationError("No images selected", self.images_list)
      for image_name in self.images_list.value:
          if image_name in images:
              raise ValidationError(
                  "%s has already been selected" % image_name,
                  image_name,
              )
          images.add(image_name)
      if self.wants_objects:
          objects = set()
          if len(self.objects_list.value) == 0:
              raise ValidationError(
                  "No objects selected", self.objects_list
              )
          for object_name in self.objects_list.value:
              if object_name in objects:
                  raise ValidationError(
                      "%s has already been selected" % object_name,
                      object_name,
                  )
              objects.add(object_name)
      if self.wants_percentiles:
          percentiles = self.percentiles.value.replace(" ", "")
          if len(percentiles) == 0:
              raise ValidationError(
                  "No percentiles have been specified", self.percentiles
              )
          for percentile in percentiles.split(","):
              if percentile == "":
                  continue
              elif percentile.isdigit():
                  percentile = int(percentile)
              else:
                  raise ValidationError(
                      "Percentile was not a valid integer",
                      self.percentiles,
                  )
              if not 0 <= percentile <= 100:
                  raise ValidationError(
                      "Percentile not within valid range (0-100)",
                      self.percentiles,
                  )
  
imports: import logging
  import numpy
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  from cellprofiler_core.module import Module
  from cellprofiler_core.setting import Binary, ValidationError, Divider
  from cellprofiler_core.setting.text import Text
  from cellprofiler_core.setting.subscriber import LabelListSubscriber, ImageListSubscriber
  from cellprofiler.modules import _help
label_desc: Use image node_id 2 for calling the MeasureImageIntensity obj's underlying member method code with example usage: obj.validate_module(pipeline) without return types