def get_keypair(client, name_or_id):
    """Load a keypair by name or ID."""
    if name_or_id.isdigit():
        return client.get_keypair(name_or_id)
    keypairs = client.get_keypairs({'name': name_or_id})
    if not keypairs:
        return
    return client.reload(keypairs[0])
