def get_shard_by_num(self, shard_num):
        """
        get_shard_by_num returns the shard at index shard_num.

        Keyword arguments:
        shard_num -- The shard index

        Returns a redis.StrictRedis connection or raises a ValueError.
        """
        if shard_num < 0 or shard_num >= self.num_shards():
            raise ValueError("requested invalid shard# {0}".format(shard_num))

        return self._shards[shard_num]
def get_shard_by_num ( self , shard_num ) : if shard_num < 0 or shard_num >= self . num_shards ( ) : raise ValueError ( "requested invalid shard# {0}" . format ( shard_num ) ) return self . _shards [ shard_num ]
get_shard_by_num returns the shard at index shard_num.

        Keyword arguments:
        shard_num -- The shard index

        Returns a redis.StrictRedis connection or raises a ValueError.