def createNode(type, name=None, parent=None):
    'Create a new node\n\n    This function forms the basic building block\n    with which to create new nodes in Maya.\n\n    .. note:: Missing arguments `shared` and `skipSelect`\n    .. tip:: For additional performance, `type` may be given as an MTypeId\n\n    Arguments:\n        type (str): Type name of new node, e.g. "transform"\n        name (str, optional): Sets the name of the newly-created node\n        parent (Node, optional): Specifies the parent in the DAG under which\n            the new node belongs\n\n    Example:\n        >>> node = createNode("transform")  # Type as string\n        >>> node = createNode(tTransform)  # Type as ID\n\n    '
    try:
        with DagModifier() as mod:
            node = mod.createNode(type, name=name, parent=parent)
    except TypeError:
        with DGModifier() as mod:
            node = mod.createNode(type, name=name)
    return node
Create a new node

This function forms the basic building block
with which to create new nodes in Maya.

.. note:: Missing arguments `shared` and `skipSelect`
.. tip:: For additional performance, `type` may be given as an MTypeId

Arguments:
    type (str): Type name of new node, e.g. "transform"
    name (str, optional): Sets the name of the newly-created node
    parent (Node, optional): Specifies the parent in the DAG under which
        the new node belongs

Example:
    >>> node = createNode("transform")  # Type as string
    >>> node = createNode(tTransform)  # Type as ID
def createNode(type, name=None, parent=None):
    'Create a new node\n\n    This function forms the basic building block\n    with which to create new nodes in Maya.\n\n    .. note:: Missing arguments `shared` and `skipSelect`\n    .. tip:: For additional performance, `type` may be given as an MTypeId\n\n    Arguments:\n        type (str): Type name of new node, e.g. "transform"\n        name (str, optional): Sets the name of the newly-created node\n        parent (Node, optional): Specifies the parent in the DAG under which\n            the new node belongs\n\n    Example:\n        >>> node = createNode("transform")  # Type as string\n        >>> node = createNode(tTransform)  # Type as ID\n\n    '
    try:
        with DagModifier() as mod:
            node = mod.createNode(type, name=name, parent=parent)
    except TypeError:
        with DGModifier() as mod:
            node = mod.createNode(type, name=name)
    return node