code: def setEnumVals(self, opts):
      vals = opts.get("values", {})
  
      prevState = {}
      for ch in self.children():
          prevState[ch.name()] = ch.value()
          self.removeChild(ch)
  
      if not isinstance(vals, dict):
          vals = OrderedDict([(v, (str(v), True)) for v in vals])
  
      # Each filterable value can come with either (1) a string name, (2) a bool
      # indicating whether the value is enabled by default, or (3) a tuple providing
      # both.
      for val, valopts in vals.items():
          if isinstance(valopts, bool):
              enabled = valopts
              vname = str(val)
          elif isinstance(valopts, str):
              enabled = True
              vname = valopts
          elif isinstance(valopts, tuple):
              vname, enabled = valopts
  
          ch = ptree.Parameter.create(
              name=vname,
              type="bool",
              value=prevState.get(vname, enabled),
          )
          ch.maskValue = val
          self.addChild(ch)
      ch = ptree.Parameter.create(
          name="(other)",
          type="bool",
          value=prevState.get("(other)", True),
      )
      ch.maskValue = "__other__"
      self.addChild(ch)
  
imports: from collections import OrderedDict
  import numpy
  from ..None import functions
  from ..None import parametertree
  from ..Qt import QtCore
label_desc: Use image node_id 5 for calling the EnumFilterItem obj's underlying member method code with example usage: obj.setEnumVals(opts) without return types