(storage: Union[None, str, BaseStorage])
Only for internal usage. It might be deprecated in the future.
Only for internal usage. It might be deprecated in the future.
Only for internal usage . It might be deprecated in the future .
def get_storage(storage: Union[None, str, BaseStorage]) -> BaseStorage:
    """Only for internal usage. It might be deprecated in the future."""

    if storage is None:
        return InMemoryStorage()
    if isinstance(storage, str):
        if storage.startswith("redis"):
            return RedisStorage(storage)
        else:
            return _CachedStorage(RDBStorage(storage))
    elif isinstance(storage, RDBStorage):
        return _CachedStorage(storage)
    else:
        return storage
def get_storage ( storage : Union [ None , str , BaseStorage ] ) -> BaseStorage : if storage is None : return InMemoryStorage ( ) if isinstance ( storage , str ) : if storage . startswith ( "redis" ) : return RedisStorage ( storage ) else : return _CachedStorage ( RDBStorage ( storage ) ) elif isinstance ( storage , RDBStorage ) : return _CachedStorage ( storage ) else : return storage