def _find(model_class, **kwargs):
    """Finds a single item satisfying a given expression.

    Args:
        model_class: Model that manages stored items.
        **kwargs: Filtering expression, at most one element can satisfy it.
    Returns:
        An item that satisfies expression or None.
    """
    items = [item for item in model_class.objects.filter(**kwargs)]
    count = len(items)
    assert count <= 1
    if count == 0:
        return None
    return items[0]
dataset/ETHPy150Open wrr/wwwhisper/wwwhisper_auth/models.py/_find/original