code: def render(cls, obj):
          
          class_hierarchy = inspect.getmro(type(obj))
          hooks = []
          for _, type_hooks in cls._display_hooks.items():
              for cls in class_hierarchy:
                  if cls in type_hooks:
                      hooks.append(type_hooks[cls])
                      break
  
          data, metadata = {}, {}
          for hook in hooks:
              ret = hook(obj)
              if ret is None:
                  continue
              d, md = ret
              data.update(d)
              metadata.update(md)
          return data, metadata
docs: Using any display hooks that have been registered, render the
          object to a dictionary of MIME types and metadata information.