def connections(self, type=None, source=True, destination=True, plugs=False, unit=None):
    'Yield plugs connected to self\n\n        Arguments:\n            type (int, optional): Only return nodes of this type\n            source (bool, optional): Return source plugs,\n                default is True\n            destination (bool, optional): Return destination plugs,\n                default is True\n            plugs (bool, optional): Return connected plugs instead of nodes\n            unit (int, optional): Return plug in this unit, e.g. Meters\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            >>> a["ihi"].connection() == b\n            True\n            >>> b["ihi"].connection() == a\n            True\n            >>> a["ihi"]\n            2\n\n        '
    op = operator.eq
    other = 'typeId'
    if isinstance(type, string_types):
        other = 'typeName'
    if isinstance(type, (tuple, list)):
        op = operator.contains
    for plug in self._mplug.connectedTo(source, destination):
        mobject = plug.node()
        node = Node(mobject)
        if ((not type) or op(type, getattr(node._fn, other))):
            (yield (Plug(node, plug, unit) if plugs else node))
Yield plugs connected to self

Arguments:
    type (int, optional): Only return nodes of this type
    source (bool, optional): Return source plugs,
        default is True
    destination (bool, optional): Return destination plugs,
        default is True
    plugs (bool, optional): Return connected plugs instead of nodes
    unit (int, optional): Return plug in this unit, e.g. Meters

Example:
    >>> _ = cmds.file(new=True, force=True)
    >>> a = createNode("transform", name="A")
    >>> b = createNode("multDoubleLinear", name="B")
    >>> a["ihi"] << b["ihi"]
    >>> a["ihi"].connection() == b
    True
    >>> b["ihi"].connection() == a
    True
    >>> a["ihi"]
    2
def connections(self, type=None, source=True, destination=True, plugs=False, unit=None):
    'Yield plugs connected to self\n\n        Arguments:\n            type (int, optional): Only return nodes of this type\n            source (bool, optional): Return source plugs,\n                default is True\n            destination (bool, optional): Return destination plugs,\n                default is True\n            plugs (bool, optional): Return connected plugs instead of nodes\n            unit (int, optional): Return plug in this unit, e.g. Meters\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            >>> a["ihi"].connection() == b\n            True\n            >>> b["ihi"].connection() == a\n            True\n            >>> a["ihi"]\n            2\n\n        '
    op = operator.eq
    other = 'typeId'
    if isinstance(type, string_types):
        other = 'typeName'
    if isinstance(type, (tuple, list)):
        op = operator.contains
    for plug in self._mplug.connectedTo(source, destination):
        mobject = plug.node()
        node = Node(mobject)
        if ((not type) or op(type, getattr(node._fn, other))):
            (yield (Plug(node, plug, unit) if plugs else node))