def __getitem__(self, index):
        """:rtype: `PyNode` """
        if index >= len(self):
            raise IndexError, "index out of range"

        plug = _api.MPlug()
        obj = _api.MObject()
        dag = _api.MDagPath()
        comp = _api.MObject()

        # Go from most specific to least - plug, dagPath, dependNode
        try:
            self.apicls.getPlug( self, index, plug )
            assert not plug.isNull()
        except (RuntimeError, AssertionError):
            try:
                self.apicls.getDagPath( self, index, dag, comp )
            except RuntimeError:
                try:
                    self.apicls.getDependNode( self, index, obj )
                    return general.PyNode( obj )
                except:
                    pass
            else:
                if comp.isNull():
                    return general.PyNode( dag )
                else:
                    return general.PyNode( dag, comp )
        else:
            return general.PyNode( plug )
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.3/pymel/core/nodetypes.py/SelectionSet.__getitem__/original