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

def get_capabilities(image=None):
    '''
    List all capabilities on the system

    Args:
        image (Optional[str]): The path to the root directory of an offline
            Windows image. If `None` is passed, the running operating system is
            targeted. Default is None.

    Raises:
        NotImplementedError: For all versions of Windows that are not Windows 10
        and later. Server editions of Windows use ServerManager instead.

    Returns:
        list: A list of capabilities

    CLI Example:

    .. code-block:: bash

        salt '*' dism.get_capabilities
    '''
    if salt.utils.versions.version_cmp(__grains__['osversion'], '10') == -1:
        raise NotImplementedError(
            '`installed_capabilities` is not available on this version of '
            'Windows: {0}'.format(__grains__['osversion']))

    cmd = ['DISM',
           '/English',
           '/Image:{0}'.format(image) if image else '/Online',
           '/Get-Capabilities']
    out = __salt__['cmd.run'](cmd)

    pattern = r'Capability Identity : (.*)\r\n'
    capabilities = re.findall(pattern, out, re.MULTILINE)
    capabilities.sort()

    return capabilities