def import_pgp(keyring, keydata):

    out, err, ret = run_command([
        "gpg", "--batch", "--status-fd", "1"
        "--no-default-keyring", "--keyring", keyring,
        "--import"
    ], input=keydata)

    fingerprint = None
    for line in out.split("\n"):
        data = line.split()
        if not data or data[0] != "[GNUPG:]":
            continue

        if data[1] == "IMPORT_OK":
            fingerprint = data[3]
            break
    else:
        raise ValueError("GPG failed to import pgp public key")

    return fingerprint
Fetch the next token by trying to match any of the regexes in order.
dataset/ETHPy150Open Debian/debile/debile/master/keyrings.py/import_pgp--crossover with--dataset/ETHPy150Open google/grr/grr/lib/lexer.py/Lexer.NextToken