Pop an item

def pop(self, timeout=0):
        '''
        Pop an item
        '''
        if timeout > 0:
            data = self.server.brpop(self.key, timeout)
            if isinstance(data, tuple):
                data = data[1]
        else:
            data = self.server.rpop(self.key)
        if data:
            return self._decode_item(data)