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 __init__(self, name_to_dim, dim_to_name, history=1, keep=False):
      assert isinstance(name_to_dim, OrderedDict) and all(
          isinstance(name, str) and isinstance(dim, int)
          for name, dim in name_to_dim.items()
      )
      assert isinstance(dim_to_name, OrderedDict) and all(
          isinstance(name, str) and isinstance(dim, int)
          for dim, name in dim_to_name.items()
      )
      self.name_to_dim = name_to_dim
      self.dim_to_name = dim_to_name
      self.history = history
      self.keep = keep
  
imports: from collections import Counter, OrderedDict, namedtuple
  from enum import Enum
label_desc: Use image node_id 1 to create a new StackFrame object  with example: obj = StackFrame(name_to_dim, dim_to_name, history, keep)