environment/lib/python2.7/site-packages/IPython/parallel/client/client.py
def _build_targets(self, targets):
        """Turn valid target IDs or 'all' into two lists:
        (int_ids, uuids).
        """
        if not self._ids:
            # flush notification socket if no engines yet, just in case
            if not self.ids:
                raise error.NoEnginesRegistered("Can't build targets without any engines")

        if targets is None:
            targets = self._ids
        elif isinstance(targets, basestring):
            if targets.lower() == 'all':
                targets = self._ids
            else:
                raise TypeError("%r not valid str target, must be 'all'"%(targets))
        elif isinstance(targets, int):
            if targets < 0:
                targets = self.ids[targets]
            if targets not in self._ids:
                raise IndexError("No such engine: %i"%targets)
            targets = [targets]

        if isinstance(targets, slice):
            indices = range(len(self._ids))[targets]
            ids = self.ids
            targets = [ ids[i] for i in indices ]

        if not isinstance(targets, (tuple, list, xrange)):
            raise TypeError("targets by int/slice/collection of ints only, not %s"%(type(targets)))

        return [cast_bytes(self._engines[t]) for t in targets], list(targets)
def _build_targets(self, targets):
        """Turn valid target IDs or 'all' into two lists:
        (int_ids, uuids).
        """
        if not self._ids:
            # flush notification socket if no engines yet, just in case
            if not self.ids:
                raise error.NoEnginesRegistered("Can't build targets without any engines")

        if targets is None:
            targets = self._ids
        elif isinstance(targets, basestring):
            if targets.lower() == 'all':
                targets = self._ids
            else:
                raise TypeError("%r not valid str target, must be 'all'"%(targets))
        elif isinstance(targets, int):
            if targets < 0:
                targets = self.ids[targets]
            if targets not in self._ids:
                raise IndexError("No such engine: %i"%targets)
            targets = [targets]

        if isinstance(targets, slice):
            indices = range(len(self._ids))[targets]
            ids = self.ids
            targets = [ ids[i] for i in indices ]

        if not isinstance(targets, (tuple, list, xrange)):
            raise TypeError("targets by int/slice/collection of ints only, not %s"%(type(targets)))

        return [cast_bytes(self._engines[t]) for t in targets], list(targets)
def _build_targets ( self , targets ) : if not self . _ids : # flush notification socket if no engines yet, just in case if not self . ids : raise error . NoEnginesRegistered ( "Can't build targets without any engines" ) if targets is None : targets = self . _ids elif isinstance ( targets , basestring ) : if targets . lower ( ) == 'all' : targets = self . _ids else : raise TypeError ( "%r not valid str target, must be 'all'" % ( targets ) ) elif isinstance ( targets , int ) : if targets < 0 : targets = self . ids [ targets ] if targets not in self . _ids : raise IndexError ( "No such engine: %i" % targets ) targets = [ targets ] if isinstance ( targets , slice ) : indices = range ( len ( self . _ids ) ) [ targets ] ids = self . ids targets = [ ids [ i ] for i in indices ] if not isinstance ( targets , ( tuple , list , xrange ) ) : raise TypeError ( "targets by int/slice/collection of ints only, not %s" % ( type ( targets ) ) ) return [ cast_bytes ( self . _engines [ t ] ) for t in targets ] , list ( targets )
Turn valid target IDs or 'all' into two lists:
        (int_ids, uuids).
Turn valid target IDs or all into two lists : ( int_ids uuids ) .