human
I wrote the below code

    global called
    global TYPE_COUNTER
    TYPE_COUNTER += 1
    import clr
    from System.Reflection.Emit import CustomAttributeBuilder, OpCodes
    clr.AddReference('Microsoft.Scripting')
    from Microsoft.Scripting.Generation import Snippets
    if is_netstandard:
        clr.AddReference('System.Xml.XmlSerializer')
    else:
        clr.AddReference('System.Xml')
    from System.Xml.Serialization import XmlRootAttribute
    xmlroot_clrtype = clr.GetClrType(XmlRootAttribute)
    xmlroot_ci = xmlroot_clrtype.GetConstructor((clr.GetClrType(str),))
    XmlRootInstance = CustomAttributeBuilder(xmlroot_ci, ('product',), (xmlroot_clrtype.GetProperty('Namespace'),), ('http://ironpython.codeplex.com',), (), ())
    called = False
    class MyType(type, ):
        def __clrtype__(self):
            global called
            baseType = super(MyType, self).__clrtype__()
            typegen = Snippets.Shared.DefineType(('faux    type' + str(TYPE_COUNTER)), baseType, True, False)
            typebld = typegen.TypeBuilder
            for ctor in baseType.GetConstructors():
                ctorparams = ctor.GetParameters()
                ctorbld = typebld.DefineConstructor(ctor.Attributes, ctor.CallingConvention, tuple([p.ParameterType for p in ctorparams]))
                ilgen = ctorbld.GetILGenerator()
                ilgen.Emit(OpCodes.Ldarg, 0)
                for index in range(len(ctorparams)):
                    ilgen.Emit(OpCodes.Ldarg, (index + 1))
                ilgen.Emit(OpCodes.Call, ctor)
                ilgen.Emit(OpCodes.Ret)
            typebld.SetCustomAttribute(XmlRootInstance)
            called = True
            return typebld.CreateType()
    class X(object, ):
        __metaclass__ = MyType
    AreEqual(called, True)
    x = X()
    x_clrtype = clr.GetClrType(X)
    AreEqual(x_clrtype.GetCustomAttributes(XmlRootAttribute, True)[0].ElementName, 'product')
    AreEqual(x_clrtype.GetCustomAttributes(XmlRootAttribute, True)[0].Namespace, 'http://ironpython.codeplex.com')

What's a good function header?
 Here's a good function header?
assistant
#Here's a good function header.

def test_critical_custom_attributes():