def get(self, key, default=None):
        '''
        Get object by key.

        Args:
            key: cache key as str.
            default: default value if key not found. default to None.
        Returns:
            object or default value if not found.

        >>> key = uuid.uuid4().hex
        >>> c = RedisClient('localhost')
        >>> c.get(key)
        >>> c.get(key, 'DEFAULT_REDIS')
        'DEFAULT_REDIS'
        >>> c.set(key, u'hello redis')
        >>> c.get(key)
        u'hello redis'
        >>> c.set(key, 12345)
        >>> c.get(key)
        12345
        '''
        logging.debug('get cache: key = %s' % key)
        r = self._client.get(key)
        if r is None:
            return default
        return _safe_pickle_loads(r)
dataset/ETHPy150Open michaelliao/transwarp/transwarp/cache.py/RedisClient.get/original