def METHOD_NAME(self, dag: DAGCircuit):
    """Run the InverseCancellation pass on `dag`.
    Args:
        dag: the directed acyclic graph to run on.
    Returns:
        DAGCircuit: Transformed DAG.
    """
    dag = self._run_on_self_inverse(dag, self.self_inverse_gates)
    return self._run_on_inverse_pairs(dag, self.inverse_gate_pairs)