code: def transform(self, node, results):
      if not has_metaclass(node):
          return
  
      fixup_parse_tree(node)
  
      # find metaclasses, keep the last one
      last_metaclass = None
      for suite, i, stmt in find_metas(node):
          last_metaclass = stmt
          stmt.remove()
  
      text_type = node.children[0].type  # always Leaf(nnn, 'class')
  
      # figure out what kind of classdef we have
      if len(node.children) == 7:
          # Node(classdef, ['class', 'name', '(', arglist, ')', ':', suite])
          #                 0        1       2    3        4    5    6
          if node.children[3].type == syms.arglist:
              arglist = node.children[3]
          # Node(classdef, ['class', 'name', '(', 'Parent', ')', ':', suite])
          else:
              parent = node.children[3].clone()
              arglist = Node(syms.arglist, [parent])
              node.set_child(3, arglist)
      elif len(node.children) == 6:
          # Node(classdef, ['class', 'name', '(',  ')', ':', suite])
          #                 0        1       2     3    4    5
          arglist = Node(syms.arglist, [])
          node.insert_child(3, arglist)
      elif len(node.children) == 4:
          # Node(classdef, ['class', 'name', ':', suite])
          #                 0        1       2    3
          arglist = Node(syms.arglist, [])
          node.insert_child(2, Leaf(token.RPAR, ")"))
          node.insert_child(2, arglist)
          node.insert_child(2, Leaf(token.LPAR, "("))
      else:
          raise ValueError("Unexpected class definition")
  
      # now stick the metaclass in the arglist
      meta_txt = last_metaclass.children[0].children[0]
      meta_txt.value = "metaclass"
      orig_meta_prefix = meta_txt.prefix
  
      if arglist.children:
          arglist.append_child(Leaf(token.COMMA, ","))
          meta_txt.prefix = " "
      else:
          meta_txt.prefix = ""
  
      # compact the expression "metaclass = Meta" -> "metaclass=Meta"
      expr_stmt = last_metaclass.children[0]
      assert expr_stmt.type == syms.expr_stmt
      expr_stmt.children[1].prefix = ""
      expr_stmt.children[2].prefix = ""
  
      arglist.append_child(last_metaclass)
  
      fixup_indent(suite)
  
      # check for empty suite
      if not suite.children:
          # one-liner that was just __metaclass_
          suite.remove()
          pass_leaf = Leaf(text_type, "pass")
          pass_leaf.prefix = orig_meta_prefix
          node.append_child(pass_leaf)
          node.append_child(Leaf(token.NEWLINE, "\n"))
  
      elif len(suite.children) > 1 and (
          suite.children[-2].type == token.INDENT
          and suite.children[-1].type == token.DEDENT
      ):
          # there was only one line in the class body and it was __metaclass__
          pass_leaf = Leaf(text_type, "pass")
          suite.insert_child(-1, pass_leaf)
          suite.insert_child(-1, Leaf(token.NEWLINE, "\n"))
  
file_path: catboost/contrib/tools/python/src/Lib/lib2to3/fixes/fix_metaclass.py
imports: from ..None import fixer_base
  from ..pygram import token
  from ..fixer_util import Name, syms, Node, Leaf
label_desc: Use image node_id 1 for calling the FixMetaclass obj's underlying member method code with example usage: obj.transform(node, results) without return types