def connections(self, type=None, unit=None, plugs=False):
    'Yield plugs of node with a connection to any other plug\n\n        Arguments:\n            unit (int, optional): Return plug in this unit,\n                e.g. Meters or Radians\n            type (str, optional): Restrict output to nodes of this type,\n                e.g. "transform" or "mesh"\n            plugs (bool, optional): Return plugs, rather than nodes\n\n        Example:\n            >>> _ = cmds.file(new=True, force=True)\n            >>> a = createNode("transform", name="A")\n            >>> b = createNode("multDoubleLinear", name="B")\n            >>> a["ihi"] << b["ihi"]\n            >>> list(a.connections()) == [b]\n            True\n            >>> list(b.connections()) == [a]\n            True\n            >>> a.connection() == b\n            True\n\n        '
    for plug in self._fn.getConnections():
        mobject = plug.node()
        node = Node(mobject)
        if ((not type) or (type == node._fn.typeName)):
            plug = Plug(node, plug, unit)
            for connection in plug.connections(plugs=plugs):
                (yield connection)
Yield plugs of node with a connection to any other plug

Arguments:
    unit (int, optional): Return plug in this unit,
        e.g. Meters or Radians
    type (str, optional): Restrict output to nodes of this type,
        e.g. "transform" or "mesh"
    plugs (bool, optional): Return plugs, rather than nodes

Example:
    >>> _ = cmds.file(new=True, force=True)
    >>> a = createNode("transform", name="A")
    >>> b = createNode("multDoubleLinear", name="B")
    >>> a["ihi"] << b["ihi"]
    >>> list(a.connections()) == [b]
    True
    >>> list(b.connections()) == [a]
    True
    >>> a.connection() == b
    True
def connections(self, type=None, unit=None, plugs=False):
    'Yield plugs of node with a connection to any other plug\n\n        Arguments:\n            unit (int, optional): Return plug in this unit,\n                e.g. Meters or Radians\n            type (str, optional): Restrict output to nodes of this type,\n                e.g. "transform" or "mesh"\n            plugs (bool, optional): Return plugs, rather than nodes\n\n        Example:\n            >>> _ = cmds.file(new=True, force=True)\n            >>> a = createNode("transform", name="A")\n            >>> b = createNode("multDoubleLinear", name="B")\n            >>> a["ihi"] << b["ihi"]\n            >>> list(a.connections()) == [b]\n            True\n            >>> list(b.connections()) == [a]\n            True\n            >>> a.connection() == b\n            True\n\n        '
    for plug in self._fn.getConnections():
        mobject = plug.node()
        node = Node(mobject)
        if ((not type) or (type == node._fn.typeName)):
            plug = Plug(node, plug, unit)
            for connection in plug.connections(plugs=plugs):
                (yield connection)