def _predicate(self, gate: cirq.Gate) -> bool:
        """Checks whether `cirq.Gate` instance `gate` belongs to this GateFamily.

        To get accepted, `gate` must be an instance of a type present in `self.gate_types_to_check`
        and match a gate / gate type present in `self.gates_to_accept`.

        Let `target_gate` be an element of `self.gates_to_accept`. `gate` would match `target_gate`
        if
            a) Type Equality Check: `target_gate` is one of `POSSIBLE_FSIM_GATES` types and `gate`
               can be converted to an instance of `target_gate`.
            b) Value Equality Check: `target_gate` is an instance of `POSSIBLE_FSIM_GATES` and is
               equal to `gate` (modulo type conversion). Note that value equality for parameterized
               gates tries to be lenient and assumes that the correct parameters would eventually
               be filled during parameter resolution.
        Args:
           gate: `cirq.Gate` instance which should be checked for containment.
        """
        if not isinstance(gate, self.gate_types_to_check):
            return False
        gate = cast(POSSIBLE_FSIM_GATES, gate)
        for g in self.gates_to_accept:
            if isinstance(g, type):
                cg = self.convert(gate, cast(type, g))  # mypy hack.
                if cg is not None:
                    return True
            elif isinstance(g, cirq.Gate):
                for target in type(gate).mro():
                    if target in self.gate_types_to_check:
                        cg = self.convert(g, target)
                        if cg is None:
                            continue
                        if self._check_equal(gate, cg):
                            return True
                        break
        return False
Checks whether `cirq.Gate` instance `gate` belongs to this GateFamily.

        To get accepted, `gate` must be an instance of a type present in `self.gate_types_to_check`
        and match a gate / gate type present in `self.gates_to_accept`.

        Let `target_gate` be an element of `self.gates_to_accept`. `gate` would match `target_gate`
        if
            a) Type Equality Check: `target_gate` is one of `POSSIBLE_FSIM_GATES` types and `gate`
               can be converted to an instance of `target_gate`.
            b) Value Equality Check: `target_gate` is an instance of `POSSIBLE_FSIM_GATES` and is
               equal to `gate` (modulo type conversion). Note that value equality for parameterized
               gates tries to be lenient and assumes that the correct parameters would eventually
               be filled during parameter resolution.
        Args:
           gate: `cirq.Gate` instance which should be checked for containment.
        
cirq-google/cirq_google/ops/fsim_gate_family.py