def save(self, path: str | bytes | int) -> None:
        """Write QASM output to a file specified by path."""
        with open(path, 'w') as f:

            def write(s: str) -> None:
                f.write(s)

            self._write_qasm(write)
Write QASM output to a file specified by path.
cirq-core/cirq/circuits/qasm_output.py