code: def test_getitem():
      assert _attrs._getitem([1, 2, 3], 1) == 2
      assert _attrs._getitem(2, 0) == 2
      expr = _attrs._getitem(Categorical([3, (4, 5), 6], label="a"), 1)
      assert expr.freeze({"a": 3}) == 3
      assert expr.freeze({"a": (4, 5)}) == 5
      assert expr.freeze({"a": 6}) == 6
  
file_path: nni/test/ut/nas/profiler/test_utils.py
imports: import torch
  from torch import nn
  import nni
  import nni.nas.nn.pytorch
  from nni.mutable import Categorical, frozen_context
  from nni.mutable.mutable import _mutable_equal
  from nni.nas.profiler.pytorch.utils import _attrs, is_leaf_module, _expression
label_desc: Use image node_id 2 for calling a global function with example usage: test_getitem() without return types