class_docstr: Consistent bidirectional mapping between integer positional dimensions and names.
  Can be queried like a dictionary (``value = frame[key]``, ``frame[key] = value``).
class_docstr_tok: ["Consistent","bidirectional","mapping","between","integer","positional","dimensions","and","names",".","Can","be","queried","like","a","dictionary","(","``","value","=","frame","[","key","]","``",",","``","frame","[","key","]","=","value","``",")","."]
code: def __setitem__(self, key, value):
      assert (
          isinstance(key, (int, str))
          and isinstance(value, (int, str))
          and type(key) != type(value)
      )
      name, dim = (value, key) if isinstance(key, int) else (key, value)
      self.name_to_dim[name], self.dim_to_name[dim] = dim, name
  
imports: from collections import Counter, OrderedDict, namedtuple
  from enum import Enum
label_desc: Use image node_id 2 for calling the StackFrame obj's underlying member method code with example usage: obj.__setitem__(key, value) without return types