def infer_func_form(node, base_type, context=None, enum=False):
<EOL>try:<EOL><INDENT>name, names = _find_func_form_arguments(node, context)<EOL>try:<EOL><INDENT>attributes = names.value.replace("<STR_LIT:U+002C>", "<STR_LIT:U+0020>").split()<EOL><DEDENT>except AttributeError:<EOL><INDENT>if not enum:<EOL><INDENT>attributes = [<EOL>_infer_first(const, context).value for const in names.elts<EOL>]<EOL><DEDENT>else:<EOL><INDENT>if hasattr(names, "<STR_LIT>") and isinstance(names.items, list):<EOL><INDENT>attributes = [<EOL>_infer_first(const[<NUM_LIT:0>], context).value<EOL>for const in names.items<EOL>if isinstance(const[<NUM_LIT:0>], nodes.Const)<EOL>]<EOL><DEDENT>elif hasattr(names, "<STR_LIT>"):<EOL><INDENT>if all(isinstance(const, nodes.Tuple) for const in names.elts):<EOL><INDENT>attributes = [<EOL>_infer_first(const.elts[<NUM_LIT:0>], context).value<EOL>for const in names.elts<EOL>if isinstance(const, nodes.Tuple)<EOL>]<EOL><DEDENT>else:<EOL><INDENT>attributes = [<EOL>_infer_first(const, context).value for const in names.elts<EOL>]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise AttributeError<EOL><DEDENT>if not attributes:<EOL><INDENT>raise AttributeError<EOL><DEDENT><DEDENT><DEDENT><DEDENT>except (AttributeError, exceptions.InferenceError):<EOL><INDENT>raise UseInferenceDefault()<EOL><DEDENT>name = name or "<STR_LIT>"<EOL>class_node = nodes.ClassDef(name, "<STR_LIT>")<EOL>class_node.parent = node.parent<EOL>class_node.bases.append(base_type)<EOL>for attr in attributes:<EOL><INDENT>fake_node = nodes.EmptyNode()<EOL>fake_node.parent = class_node<EOL>fake_node.attrname = attr<EOL>class_node.instance_attrs[attr] = [fake_node]<EOL><DEDENT>return class_node, name, attributes<EOL>
Specific inference function for namedtuple or Python 3 enum.