def __new__(mcs, name, bases, namespace):
<EOL>if '<STR_LIT>' in namespace:<EOL><INDENT>prefix = utils.norm_path(namespace['<STR_LIT>'], False)<EOL>base_pfxs = [getattr(b, '<STR_LIT>') for b in bases<EOL>if hasattr(b, '<STR_LIT>')]<EOL>if base_pfxs:<EOL><INDENT>prefix = base_pfxs[<NUM_LIT:0>] + prefix<EOL><DEDENT>namespace['<STR_LIT>'] = prefix<EOL><DEDENT>actions = set()<EOL>extensions = set()<EOL>serializers = {}<EOL>deserializers = {}<EOL>namespace['<STR_LIT>'] = actions<EOL>namespace['<STR_LIT>'] = extensions<EOL>namespace['<STR_LIT>'] = serializers<EOL>namespace['<STR_LIT>'] = deserializers<EOL>for key, value in namespace.items():<EOL><INDENT>if key[<NUM_LIT:0>] == '<STR_LIT:_>' or key.startswith('<STR_LIT>') or not callable(value):<EOL><INDENT>continue<EOL><DEDENT>if hasattr(value, '<STR_LIT>'):<EOL><INDENT>actions.add(key)<EOL><DEDENT>elif hasattr(value, '<STR_LIT>'):<EOL><INDENT>extensions.add(key)<EOL><DEDENT><DEDENT>for base in mcs.iter_bases(bases):<EOL><INDENT>mcs.inherit_set(base, namespace, '<STR_LIT>')<EOL>mcs.inherit_set(base, namespace, '<STR_LIT>')<EOL>mcs.inherit_dict(base, namespace, '<STR_LIT>')<EOL>mcs.inherit_dict(base, namespace, '<STR_LIT>')<EOL>mcs.inherit_dict(base, namespace, '<STR_LIT>')<EOL><DEDENT>return super(ControllerMeta, mcs).__new__(mcs, name, bases, namespace)<EOL>
Create a new Controller subclass.