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

        The default predicate depends on the gate family initialization type:

        - Instance Family: `cirq.equal_up_to_global_phase(gate, self.gate)`
            if self._ignore_global_phase else `gate == self.gate`.
        - Type Family: `isinstance(gate, self.gate)`.

        Args:
            gate: `cirq.Gate` instance which should be checked for containment.
        """
        if isinstance(self.gate, raw_types.Gate):
            return (
                protocols.equal_up_to_global_phase(gate, self.gate)
                if self._ignore_global_phase
                else gate == self._gate
            )
        return isinstance(gate, self.gate)
Checks whether `cirq.Gate` instance `gate` belongs to this GateFamily.

        The default predicate depends on the gate family initialization type:

        - Instance Family: `cirq.equal_up_to_global_phase(gate, self.gate)`
            if self._ignore_global_phase else `gate == self.gate`.
        - Type Family: `isinstance(gate, self.gate)`.

        Args:
            gate: `cirq.Gate` instance which should be checked for containment.
        
cirq-core/cirq/ops/gateset.py