def _predicate(self, g: cirq.Gate) -> bool:
        """Checks whether gate instance `g` belongs to this GateFamily."""
        if not super()._predicate(g) or cirq.is_parameterized(g):
            return False
        exp = cast(CustomXPowGate, g).exponent
        return int(exp) == exp
Checks whether gate instance `g` belongs to this GateFamily.
cirq-core/cirq/ops/gateset_test.py