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

def list_licenses():
    '''
    returns a list of applied powerpath license keys
    '''
    KEY_PATTERN = re.compile('Key (.*)')

    keys = []
    out = __salt__['cmd.run']('/sbin/emcpreg -list')
    for line in out.splitlines():
        match = KEY_PATTERN.match(line)

        if not match:
            continue

        keys.append({'key': match.group(1)})

    return keys