code: def __getitem__(self, item):
      if isinstance(item, int):
          if item >= len(self):
              raise KeyError(
                  f"指定的下标 {item} 在长度为 {len(self)} 的 {self} 中越界"
              )
          return list(self._components_dict.values())[item]
      if item not in self._components_dict.keys():
          raise KeyError(f"{self} 中不存在 {item}")
      return self._components_dict[item]
  
file_path: PaddleSeg/EISeg/eiseg/util/manager.py
imports: import inspect
  from collections.abc import Sequence
label_desc: Use image node_id 4 for calling the ComponentManager obj's underlying member method code with example usage: obj.__getitem__(item) and returns: self, list