code: def cls_register(cls, frameset, new_class, init_args, name=None):
      
      name = name or getattr(frameset, 'name', None)
      if name is None:
          raise ValueError(
              '`name` is needed when the `frameset` has no name attribute.'
          )
      kwargs = {'name': name}
      for initarg in init_args:
          kwargs[initarg] = getattr(frameset, initarg, None)
  
      newframeset = new_class(frameset, **kwargs)
      # Mark this FrameSet/BarSet as a registered item (not basic/original).
      newframeset._registered = True
      setattr(cls, name, newframeset)
      return newframeset
docs: Register a new FrameSet or FrameSet subclass as a member/attribute
          of a class.
          Returns the new FrameSet or FrameSet subclass.
          Arguments:
              frameset  : An existing FrameSet, or an iterable of strings.
              init_args : A list of properties from the `frameset` to try to use
                          for initializing the new FrameSet.
              new_class : The class type to initialize.
              name      : New name for the FrameSet, also used as the
                          classes attribute name.
                          If the `frameset` object has not `name` attribute,
                          this argument is required. It must not be empty
                          when given.