class_docstr: A setting that displays a drop-down set of choices
  
      
class_docstr_tok: ["A","setting","that","displays","a","drop-down","set","of","choices"]
docstr: Initializer
  module - the module containing the setting
  text - the explanatory text for the setting
  choices - a sequence of string choices to be displayed in the drop-down
            if an enum is provided, member values are used as choices
  value - the default choice or None to choose the first of the choices.
  tooltips - a dictionary of choice to tooltip
  choices_fn - a function that, if present, supplies the choices. The
               function should have the signature, fn(pipeline).
docstr_tok: ["Initializer","module","-","the","module","containing","the","setting","text","-","the","explanatory","text","for","the","setting","choices","-","a","sequence","of","string","choices","to","be","displayed","in","the","drop-down","if","an","enum","is","provided",",","member","values","are","used","as","choices","value","-","the","default","choice","or","None","to","choose","the","first","of","the","choices",".","tooltips","-","a","dictionary","of","choice","to","tooltip","choices_fn","-","a","function","that",",","if","present",",","supplies","the","choices",".","The","function","should","have","the","signature",",","fn","(","pipeline",")","."]
code: def __init__(
      self,
      text,
      choices,
      value=None,
      tooltips=None,
      choices_fn=None,
      *args,
      **kwargs,
  ):
      """Initializer
      module - the module containing the setting
      text - the explanatory text for the setting
      choices - a sequence of string choices to be displayed in the drop-down
                if an enum is provided, member values are used as choices
      value - the default choice or None to choose the first of the choices.
      tooltips - a dictionary of choice to tooltip
      choices_fn - a function that, if present, supplies the choices. The
                   function should have the signature, fn(pipeline).
      """
      if isinstance(choices, type(Enum)):
          self.__enum = choices
          choices = [member.value for member in self.__enum]
  
      super(Choice, self).__init__(
          text, value or choices[0], *args, **kwargs
      )
      self.__choices = choices
      self.__tooltips = tooltips
      self.__choices_fn = choices_fn
  
file_path: CellProfiler/src/subpackages/core/cellprofiler_core/setting/choice/_choice.py
imports: from enum import Enum
  from .._setting import Setting
  from .._validation_error import ValidationError
label_desc: Use image node_id 1 to create a new Choice object from inherited base classes: Setting with example: obj = Choice(text, choices, value, tooltips, choices_fn)