<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def exists(name):
    '''
    Returns true if the named container exists

    CLI Example:

    .. code-block:: bash

        salt myminion nspawn.exists <name>
    '''
    contextkey = 'nspawn.exists.{0}'.format(name)
    if contextkey in __context__:
        return __context__[contextkey]
    __context__[contextkey] = name in list_all()
    return __context__[contextkey]