code: def make_tohu_items_class(clsname, attr_names):
      
  
      item_cls = attr.make_class(clsname, {name: attr.ib() for name in attr_names}, repr=False, cmp=True, frozen=True)
  
      def new_repr(self):
          all_fields = ', '.join([f'{name}={repr(value)}' for name, value in attr.asdict(self).items()])
          return f'{clsname}({all_fields})'
  
      orig_eq = item_cls.__eq__
  
      def new_eq(self, other):
          """
          Custom __eq__() method which also allows comparisons with
          tuples and dictionaries. This is mostly for convenience
          during testing.
          """
  
          if isinstance(other, self.__class__):
              return orig_eq(self, other)
          else:
              if isinstance(other, tuple):
                  return attr.astuple(self) == other
              elif isinstance(other, dict):
                  return attr.asdict(self) == other
              else:
                  return NotImplemented
  
      item_cls.__repr__ = new_repr
      item_cls.__eq__ = new_eq
      item_cls.keys = lambda self: attr_names
      item_cls.__getitem__ = lambda self, key: getattr(self, key)
      item_cls.as_dict = lambda self: attr.asdict(self)
      item_cls.to_series = lambda self: pd.Series(attr.asdict(self))
  
      return item_cls
docs: Parameters
      ----------
      clsname: string
          Name of the class to be created
  
      attr_names: list of strings
          Names of the attributes of the class to be created