def create_context_store(name='default',
                         ttl=settings.CONTEXT_DEFAULT_TTL,
                         store=settings.CONTEXT_STORE) -> 'BaseContextStore':
    """
    Create a context store. By default using the default configured context
    store, but you can use a custom class if you want to using the `store`
    setting.

    The time to live of each store (aka there is one per conversation) is
    defined by the `ttl` value, which is also inferred by default from the
    configuration.

    You can have several stores existing in parallel. To make the distinction
    between them you need to give them different names, using the `name`
    parameter.

    The usage looks like:

    >>> cs = create_context_store()
    >>> class Hello(BaseTestState):
    >>>     @cs.inject(['foo'])
    >>>     async def handle(self, context):
    >>>         logger.debug('foo is %s', context['foo'])
    >>>
    >>>     async def missing_context(self):
    >>>         self.send(lyr.Text('`foo` is not in context'))

    This requires that `foo` is present in the context in order to enter the
    handler.

    See `BaseContextStore.inject()` for more info.
    """

    store_class = import_class(store['class'])
    return store_class(name=name, ttl=ttl, **store['params'])
Create a context store. By default using the default configured context
    store, but you can use a custom class if you want to using the `store`
    setting.

    The time to live of each store (aka there is one per conversation) is
    defined by the `ttl` value, which is also inferred by default from the
    configuration.

    You can have several stores existing in parallel. To make the distinction
    between them you need to give them different names, using the `name`
    parameter.

    The usage looks like:

    >>> cs = create_context_store()
    >>> class Hello(BaseTestState):
    >>>     @cs.inject(['foo'])
    >>>     async def handle(self, context):
    >>>         logger.debug('foo is %s', context['foo'])
    >>>
    >>>     async def missing_context(self):
    >>>         self.send(lyr.Text('`foo` is not in context'))

    This requires that `foo` is present in the context in order to enter the
    handler.

    See `BaseContextStore.inject()` for more info.