def _get_op_class(op: cirq.Operation, classifiers: Sequence[Classifier]) -> int:
    """Get the "class" of an operator, by index."""
    for class_index, classifier in enumerate(classifiers):
        if classifier is _mock_classifier:
            mock_classifier_index = class_index
        elif classifier(op):
            return class_index
    # If we got this far, the operation did not match any "actual" classifier,
    # so return the index of the mock classifer.
    try:
        return mock_classifier_index
    except NameError:
        raise ValueError(f"Operation {op} not identified by any classifier")
Get the "class" of an operator, by index.
cirq-core/cirq/transformers/stratify.py