code: def __new__(mcs, name, bases, attrs):
      current_states = []
      for key, value in attrs.items():
          if isinstance(value, State):
              current_states.append((key, value))
  
      current_states.sort(key=lambda x: x[0])
      attrs["states"] = OrderedDict(current_states)
      new_class = super(StateMeta, mcs).__new__(mcs, name, bases, attrs)
  
      # Walk through the MRO
      states = OrderedDict()
      for base in reversed(new_class.__mro__):
          if hasattr(base, "states"):
              states.update(base.states)
      new_class.states = states
  
      for key, value in states.items():
          setattr(new_class, key, value.default)
  
      return new_class
  
file_path: EasyOCR/easyocr/DBNet/model/constructor.py
imports: import importlib
  from collections import OrderedDict
label_desc: Use image node_id 1 for calling the StateMeta obj's underlying member method code with example usage: obj.__new__(mcs, name, bases, attrs) and returns: new_class