class_docstr: A setting that represents selection of multiple choices from a list
docstr: Ensure that the selections are among the choices
docstr_tok: ["Ensure","that","the","selections","are","among","the","choices"]
code: def test_valid(self, pipeline):
      """Ensure that the selections are among the choices"""
      for selection in self.get_selections():
          if selection not in self.choices:
              if len(self.choices) == 0:
                  raise ValidationError("No available choices", self)
              elif len(self.choices) > 25:
                  raise ValidationError(
                      "%s is not one of the choices" % selection, self
                  )
              raise ValidationError(
                  "%s is not one of %s"
                  % (
                      selection,
                      functools.reduce(
                          lambda x, y: "%s,%s" % (x, y), self.choices
                      ),
                  ),
                  self,
              )
  
file_path: CellProfiler/src/subpackages/core/cellprofiler_core/setting/multichoice/_multichoice.py
imports: import functools
  from .._setting import Setting
  from .._validation_error import ValidationError
label_desc: Use image node_id 9 for calling the MultiChoice obj's underlying member method code with example usage: obj.test_valid(pipeline) without return types