def transform_six_add_metaclass(node):
if not node.decorators:<EOL><INDENT>return<EOL><DEDENT>for decorator in node.decorators.nodes:<EOL><INDENT>if not isinstance(decorator, nodes.Call):<EOL><INDENT>continue<EOL><DEDENT>try:<EOL><INDENT>func = next(decorator.func.infer())<EOL><DEDENT>except InferenceError:<EOL><INDENT>continue<EOL><DEDENT>if func.qname() == SIX_ADD_METACLASS and decorator.args:<EOL><INDENT>metaclass = decorator.args[<NUM_LIT:0>]<EOL>node._metaclass = metaclass<EOL>return node<EOL><DEDENT><DEDENT>
Check if the given class node is decorated with *six.add_metaclass*

    If so, inject its argument as the metaclass of the underlying class.