def extend(
            expansion: value.LinearDict[str],
            qubits: tuple[cirq.Qid, ...],
            all_qubits: tuple[cirq.Qid, ...],
        ) -> value.LinearDict[str]:
            """Extends Pauli expansion on qubits to expansion on all_qubits."""
            return value.LinearDict(
                {extend_term(p, qubits, all_qubits): c for p, c in expansion.items()}
            )
Extends Pauli expansion on qubits to expansion on all_qubits.
cirq-core/cirq/ops/linear_combinations.py