code: def add_to_loader_class(cls, loader_class=None, tag=None, **kwargs):
          if tag is None:
              tag = ''
          tag = tag.strip()
          if not tag:
              tag = cls.DEFAULT_TAG_NAME
          if not tag.startswith('!'):
              raise ValueError('`tag` argument should start with character "!"')
          instance = cls(**kwargs)
          if loader_class is None:
              if FullLoader:
                  yaml.add_constructor(tag, instance, FullLoader)
              else:
                  yaml.add_constructor(tag, instance)
          else:
              yaml.add_constructor(tag, instance, loader_class)
          return instance