class_docstr: A class that supports simple attribute setter/getter.
  It is intended for storing metadata of a dataset and make it accessible globally.
  
  Examples:
  ::
      # somewhere when you load the data:
      MetadataCatalog.get("mydataset").thing_classes = ["person", "dog"]
  
      # somewhere when you print statistics or visualize:
      classes = MetadataCatalog.get("mydataset").thing_classes
class_docstr_tok: ["A","class","that","supports","simple","attribute","setter\/getter",".","It","is","intended","for","storing","metadata","of","a","dataset","and","make","it","accessible","globally",".","Examples",":",":",":","#","somewhere","when","you","load","the","data",":","MetadataCatalog.get","(","``","mydataset","''",")",".thing_classes","=","[","``","person","''",",","``","dog","''","]","#","somewhere","when","you","print","statistics","or","visualize",":","classes","=","MetadataCatalog.get","(","``","mydataset","''",")",".thing_classes"]
code: def __setattr__(self, key, val):
      if key in self._RENAMED:
          log_first_n(
              logging.WARNING,
              "Metadata '{}' was renamed to '{}'!".format(
                  key, self._RENAMED[key]
              ),
              n=10,
          )
          setattr(self, self._RENAMED[key], val)
  
      # Ensure that metadata of the same name stays consistent
      try:
          oldval = getattr(self, key)
          assert oldval == val, (
              "Attribute '{}' in the metadata of '{}' cannot be set "
              "to a different value!\n{} != {}".format(
                  key, self.name, oldval, val
              )
          )
      except AttributeError:
          super().__setattr__(key, val)
  
imports: import copy
  import logging
  import types
  from collections import UserDict
  from typing import List
  from detectron2.utils.logger import log_first_n
label_desc: Use image node_id 2 for calling the Metadata obj's underlying member method code with example usage: obj.__setattr__(key, val) without return types