'Set the source `item` (:class:`.NodeItem`). Use `anchor`
(:class:`.AnchorPoint`) as the curve start point (if ``None`` a new
output anchor will be created using ``item.newOutputAnchor()``).
Setting item to ``None`` and a valid anchor is a valid operation
(for instance while mouse dragging one end of the link).'

def setSourceItem(self, item, anchor=None):

    if ((item is not None) and (anchor is not None)):
        if (anchor not in item.outputAnchors()):
            raise ValueError('Anchor    must    be    belong    to    the    item')
    if (self.sourceItem != item):
        if self.sourceAnchor:
            self.sourceAnchor.scenePositionChanged.disconnect(self._sourcePosChanged)
            if (self.sourceItem is not None):
                self.sourceItem.removeOutputAnchor(self.sourceAnchor)
            self.sourceItem = self.sourceAnchor = None
        self.sourceItem = item
        if ((item is not None) and (anchor is None)):
            anchor = item.newOutputAnchor()
        self.sourceIndicator.setVisible(bool(item))
    if (anchor != self.sourceAnchor):
        if (self.sourceAnchor is not None):
            self.sourceAnchor.scenePositionChanged.disconnect(self._sourcePosChanged)
        self.sourceAnchor = anchor
        if (self.sourceAnchor is not None):
            self.sourceAnchor.scenePositionChanged.connect(self._sourcePosChanged)
    self.__updateCurve()
