<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_keytab(keytab):
 """Read the contents of a KRB5 keytab file, returning a list of credentials listed within Parameters keytab : `str` path to keytab file Returns ------- creds : `list` of `tuple` the (unique) list of `(username, realm, kvno)` as read from the keytab file Examples -------- [('albert.einstein', 'LIGO.ORG', 1)] """

    try:
        out = subprocess.check_output(['klist', '-k', keytab],
                                      stderr=subprocess.PIPE)
    except OSError:
        raise KerberosError("Failed to locate klist, cannot read keytab")
    except subprocess.CalledProcessError:
        raise KerberosError("Cannot read keytab {!r}".format(keytab))
    principals = []
    for line in out.splitlines():
        if isinstance(line, bytes):
            line = line.decode('utf-8')
        try:
            kvno, principal, = re.split(r'\s+', line.strip(' '), 1)
        except ValueError:
            continue
        else:
            if not kvno.isdigit():
                continue
            principals.append(tuple(principal.split('@')) + (int(kvno),))
    # return unique, ordered list
    return list(OrderedDict.fromkeys(principals).keys())