We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Fix deprecation warning for newly added `ClassicallyControlledOperation`
**Description of the issue**
The following deprecation warning is emitted on running the json serialization test and should be fixed.
```python
~/quantum/Cirq/cirq-core/cirq/protocols/json_serialization.py:283: DeprecationWarning: Found 'cirq_type': 'ClassicallyControlledOperation' in _json_dict_. Custom values of this field are not permitted, and will produce an error starting in Cirq v0.15.
```
**Cirq version**
0.14dev


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `cirq-core/cirq/ops/classically_controlled_operation.py`
Content:
```
1 # Copyright 2021 The Cirq Developers
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     https://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 from typing import (
15     AbstractSet,
16     Any,
17     Dict,
18     FrozenSet,
19     List,
20     Optional,
21     Sequence,
22     TYPE_CHECKING,
23     Tuple,
24     Union,
25 )
26 
27 import sympy
28 
29 from cirq import protocols, value
30 from cirq.ops import raw_types
31 
32 if TYPE_CHECKING:
33     import cirq
34 
35 
36 @value.value_equality
37 class ClassicallyControlledOperation(raw_types.Operation):
38     """Augments existing operations to be conditionally executed.
39 
40     An operation that is classically controlled is executed iff all conditions
41     evaluate to True. Currently the only condition type is a measurement key.
42     A measurement key evaluates to True iff any qubit in the corresponding
43     measurement operation evaluated to a non-zero value.
44 
45     This object is typically created via
46      `operation.with_classical_controls(*conditions)`.
47     """
48 
49     def __init__(
50         self,
51         sub_operation: 'cirq.Operation',
52         conditions: Sequence[Union[str, 'cirq.MeasurementKey', 'cirq.Condition', sympy.Basic]],
53     ):
54         """Initializes a `ClassicallyControlledOperation`.
55 
56         Multiple consecutive `ClassicallyControlledOperation` layers are
57         squashed when possible, so one should not depend on a specific number
58         of layers.
59 
60         Args:
61             sub_operation: The operation to gate with a classical control
62                 condition.
63             conditions: A sequence of measurement keys, or strings that can be
64                 parsed into measurement keys.
65 
66         Raises:
67             ValueError: If an unsupported gate is being classically
68                 controlled.
69         """
70         if protocols.measurement_key_objs(sub_operation):
71             raise ValueError(
72                 f'Cannot conditionally run operations with measurements: {sub_operation}'
73             )
74         conditions = tuple(conditions)
75         if isinstance(sub_operation, ClassicallyControlledOperation):
76             conditions += sub_operation._conditions
77             sub_operation = sub_operation._sub_operation
78         conds: List['cirq.Condition'] = []
79         for c in conditions:
80             if isinstance(c, str):
81                 c = value.MeasurementKey.parse_serialized(c)
82             if isinstance(c, value.MeasurementKey):
83                 c = value.KeyCondition(c)
84             if isinstance(c, sympy.Basic):
85                 c = value.SympyCondition(c)
86             conds.append(c)
87         self._conditions: Tuple['cirq.Condition', ...] = tuple(conds)
88         self._sub_operation: 'cirq.Operation' = sub_operation
89 
90     @property
91     def classical_controls(self) -> FrozenSet['cirq.Condition']:
92         return frozenset(self._conditions).union(self._sub_operation.classical_controls)
93 
94     def without_classical_controls(self) -> 'cirq.Operation':
95         return self._sub_operation.without_classical_controls()
96 
97     @property
98     def qubits(self):
99         return self._sub_operation.qubits
100 
101     def with_qubits(self, *new_qubits):
102         return self._sub_operation.with_qubits(*new_qubits).with_classical_controls(
103             *self._conditions
104         )
105 
106     def _decompose_(self):
107         result = protocols.decompose_once(self._sub_operation, NotImplemented)
108         if result is NotImplemented:
109             return NotImplemented
110 
111         return [ClassicallyControlledOperation(op, self._conditions) for op in result]
112 
113     def _value_equality_values_(self):
114         return (frozenset(self._conditions), self._sub_operation)
115 
116     def __str__(self) -> str:
117         keys = ', '.join(map(str, self._conditions))
118         return f'{self._sub_operation}.with_classical_controls({keys})'
119 
120     def __repr__(self):
121         return (
122             f'cirq.ClassicallyControlledOperation('
123             f'{self._sub_operation!r}, {list(self._conditions)!r})'
124         )
125 
126     def _is_parameterized_(self) -> bool:
127         return protocols.is_parameterized(self._sub_operation)
128 
129     def _parameter_names_(self) -> AbstractSet[str]:
130         return protocols.parameter_names(self._sub_operation)
131 
132     def _resolve_parameters_(
133         self, resolver: 'cirq.ParamResolver', recursive: bool
134     ) -> 'ClassicallyControlledOperation':
135         new_sub_op = protocols.resolve_parameters(self._sub_operation, resolver, recursive)
136         return new_sub_op.with_classical_controls(*self._conditions)
137 
138     def _circuit_diagram_info_(
139         self, args: 'cirq.CircuitDiagramInfoArgs'
140     ) -> Optional['protocols.CircuitDiagramInfo']:
141         sub_args = protocols.CircuitDiagramInfoArgs(
142             known_qubit_count=args.known_qubit_count,
143             known_qubits=args.known_qubits,
144             use_unicode_characters=args.use_unicode_characters,
145             precision=args.precision,
146             label_map=args.label_map,
147         )
148         sub_info = protocols.circuit_diagram_info(self._sub_operation, sub_args, None)
149         if sub_info is None:
150             return NotImplemented  # coverage: ignore
151 
152         control_count = len({k for c in self._conditions for k in c.keys})
153         wire_symbols = sub_info.wire_symbols + ('^',) * control_count
154         if any(not isinstance(c, value.KeyCondition) for c in self._conditions):
155             wire_symbols = (
156                 wire_symbols[0]
157                 + '(conditions=['
158                 + ', '.join(str(c) for c in self._conditions)
159                 + '])',
160             ) + wire_symbols[1:]
161         exponent_qubit_index = None
162         if sub_info.exponent_qubit_index is not None:
163             exponent_qubit_index = sub_info.exponent_qubit_index + control_count
164         elif sub_info.exponent is not None:
165             exponent_qubit_index = control_count
166         return protocols.CircuitDiagramInfo(
167             wire_symbols=wire_symbols,
168             exponent=sub_info.exponent,
169             exponent_qubit_index=exponent_qubit_index,
170         )
171 
172     def _json_dict_(self) -> Dict[str, Any]:
173         return {
174             'cirq_type': self.__class__.__name__,
175             'conditions': self._conditions,
176             'sub_operation': self._sub_operation,
177         }
178 
179     def _act_on_(self, args: 'cirq.ActOnArgs') -> bool:
180         if all(c.resolve(args.log_of_measurement_results) for c in self._conditions):
181             protocols.act_on(self._sub_operation, args)
182         return True
183 
184     def _with_measurement_key_mapping_(
185         self, key_map: Dict[str, str]
186     ) -> 'ClassicallyControlledOperation':
187         conditions = [protocols.with_measurement_key_mapping(c, key_map) for c in self._conditions]
188         sub_operation = protocols.with_measurement_key_mapping(self._sub_operation, key_map)
189         sub_operation = self._sub_operation if sub_operation is NotImplemented else sub_operation
190         return sub_operation.with_classical_controls(*conditions)
191 
192     def _with_key_path_prefix_(self, prefix: Tuple[str, ...]) -> 'ClassicallyControlledOperation':
193         conditions = [protocols.with_key_path_prefix(c, prefix) for c in self._conditions]
194         sub_operation = protocols.with_key_path_prefix(self._sub_operation, prefix)
195         sub_operation = self._sub_operation if sub_operation is NotImplemented else sub_operation
196         return sub_operation.with_classical_controls(*conditions)
197 
198     def _with_rescoped_keys_(
199         self,
200         path: Tuple[str, ...],
201         bindable_keys: FrozenSet['cirq.MeasurementKey'],
202     ) -> 'ClassicallyControlledOperation':
203         conds = [protocols.with_rescoped_keys(c, path, bindable_keys) for c in self._conditions]
204         sub_operation = protocols.with_rescoped_keys(self._sub_operation, path, bindable_keys)
205         return sub_operation.with_classical_controls(*conds)
206 
207     def _control_keys_(self) -> FrozenSet['cirq.MeasurementKey']:
208         local_keys: FrozenSet['cirq.MeasurementKey'] = frozenset(
209             k for condition in self._conditions for k in condition.keys
210         )
211         return local_keys.union(protocols.control_keys(self._sub_operation))
212 
213     def _qasm_(self, args: 'cirq.QasmArgs') -> Optional[str]:
214         args.validate_version('2.0')
215         all_keys = " && ".join(c.qasm for c in self._conditions)
216         return args.format('if ({0}) {1}', all_keys, protocols.qasm(self._sub_operation, args=args))
217
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/cirq-core/cirq/ops/classically_controlled_operation.py b/cirq-core/cirq/ops/classically_controlled_operation.py
--- a/cirq-core/cirq/ops/classically_controlled_operation.py
+++ b/cirq-core/cirq/ops/classically_controlled_operation.py
@@ -171,7 +171,6 @@
 
     def _json_dict_(self) -> Dict[str, Any]:
         return {
-            'cirq_type': self.__class__.__name__,
             'conditions': self._conditions,
             'sub_operation': self._sub_operation,
         }

{"golden_diff": "diff --git a/cirq-core/cirq/ops/classically_controlled_operation.py b/cirq-core/cirq/ops/classically_controlled_operation.py\n--- a/cirq-core/cirq/ops/classically_controlled_operation.py\n+++ b/cirq-core/cirq/ops/classically_controlled_operation.py\n@@ -171,7 +171,6 @@\n \n     def _json_dict_(self) -> Dict[str, Any]:\n         return {\n-            'cirq_type': self.__class__.__name__,\n             'conditions': self._conditions,\n             'sub_operation': self._sub_operation,\n         }\n", "issue": "Fix deprecation warning for newly added `ClassicallyControlledOperation`\n**Description of the issue**\r\nThe following deprecation warning is emitted on running the json serialization test and should be fixed.\r\n```python\r\n~/quantum/Cirq/cirq-core/cirq/protocols/json_serialization.py:283: DeprecationWarning: Found 'cirq_type': 'ClassicallyControlledOperation' in _json_dict_. Custom values of this field are not permitted, and will produce an error starting in Cirq v0.15.\r\n```\r\n**Cirq version**\r\n0.14dev\r\n\n", "before_files": [{"content": "# Copyright 2021 The Cirq Developers\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom typing import (\n    AbstractSet,\n    Any,\n    Dict,\n    FrozenSet,\n    List,\n    Optional,\n    Sequence,\n    TYPE_CHECKING,\n    Tuple,\n    Union,\n)\n\nimport sympy\n\nfrom cirq import protocols, value\nfrom cirq.ops import raw_types\n\nif TYPE_CHECKING:\n    import cirq\n\n\n@value.value_equality\nclass ClassicallyControlledOperation(raw_types.Operation):\n    \"\"\"Augments existing operations to be conditionally executed.\n\n    An operation that is classically controlled is executed iff all conditions\n    evaluate to True. Currently the only condition type is a measurement key.\n    A measurement key evaluates to True iff any qubit in the corresponding\n    measurement operation evaluated to a non-zero value.\n\n    This object is typically created via\n     `operation.with_classical_controls(*conditions)`.\n    \"\"\"\n\n    def __init__(\n        self,\n        sub_operation: 'cirq.Operation',\n        conditions: Sequence[Union[str, 'cirq.MeasurementKey', 'cirq.Condition', sympy.Basic]],\n    ):\n        \"\"\"Initializes a `ClassicallyControlledOperation`.\n\n        Multiple consecutive `ClassicallyControlledOperation` layers are\n        squashed when possible, so one should not depend on a specific number\n        of layers.\n\n        Args:\n            sub_operation: The operation to gate with a classical control\n                condition.\n            conditions: A sequence of measurement keys, or strings that can be\n                parsed into measurement keys.\n\n        Raises:\n            ValueError: If an unsupported gate is being classically\n                controlled.\n        \"\"\"\n        if protocols.measurement_key_objs(sub_operation):\n            raise ValueError(\n                f'Cannot conditionally run operations with measurements: {sub_operation}'\n            )\n        conditions = tuple(conditions)\n        if isinstance(sub_operation, ClassicallyControlledOperation):\n            conditions += sub_operation._conditions\n            sub_operation = sub_operation._sub_operation\n        conds: List['cirq.Condition'] = []\n        for c in conditions:\n            if isinstance(c, str):\n                c = value.MeasurementKey.parse_serialized(c)\n            if isinstance(c, value.MeasurementKey):\n                c = value.KeyCondition(c)\n            if isinstance(c, sympy.Basic):\n                c = value.SympyCondition(c)\n            conds.append(c)\n        self._conditions: Tuple['cirq.Condition', ...] = tuple(conds)\n        self._sub_operation: 'cirq.Operation' = sub_operation\n\n    @property\n    def classical_controls(self) -> FrozenSet['cirq.Condition']:\n        return frozenset(self._conditions).union(self._sub_operation.classical_controls)\n\n    def without_classical_controls(self) -> 'cirq.Operation':\n        return self._sub_operation.without_classical_controls()\n\n    @property\n    def qubits(self):\n        return self._sub_operation.qubits\n\n    def with_qubits(self, *new_qubits):\n        return self._sub_operation.with_qubits(*new_qubits).with_classical_controls(\n            *self._conditions\n        )\n\n    def _decompose_(self):\n        result = protocols.decompose_once(self._sub_operation, NotImplemented)\n        if result is NotImplemented:\n            return NotImplemented\n\n        return [ClassicallyControlledOperation(op, self._conditions) for op in result]\n\n    def _value_equality_values_(self):\n        return (frozenset(self._conditions), self._sub_operation)\n\n    def __str__(self) -> str:\n        keys = ', '.join(map(str, self._conditions))\n        return f'{self._sub_operation}.with_classical_controls({keys})'\n\n    def __repr__(self):\n        return (\n            f'cirq.ClassicallyControlledOperation('\n            f'{self._sub_operation!r}, {list(self._conditions)!r})'\n        )\n\n    def _is_parameterized_(self) -> bool:\n        return protocols.is_parameterized(self._sub_operation)\n\n    def _parameter_names_(self) -> AbstractSet[str]:\n        return protocols.parameter_names(self._sub_operation)\n\n    def _resolve_parameters_(\n        self, resolver: 'cirq.ParamResolver', recursive: bool\n    ) -> 'ClassicallyControlledOperation':\n        new_sub_op = protocols.resolve_parameters(self._sub_operation, resolver, recursive)\n        return new_sub_op.with_classical_controls(*self._conditions)\n\n    def _circuit_diagram_info_(\n        self, args: 'cirq.CircuitDiagramInfoArgs'\n    ) -> Optional['protocols.CircuitDiagramInfo']:\n        sub_args = protocols.CircuitDiagramInfoArgs(\n            known_qubit_count=args.known_qubit_count,\n            known_qubits=args.known_qubits,\n            use_unicode_characters=args.use_unicode_characters,\n            precision=args.precision,\n            label_map=args.label_map,\n        )\n        sub_info = protocols.circuit_diagram_info(self._sub_operation, sub_args, None)\n        if sub_info is None:\n            return NotImplemented  # coverage: ignore\n\n        control_count = len({k for c in self._conditions for k in c.keys})\n        wire_symbols = sub_info.wire_symbols + ('^',) * control_count\n        if any(not isinstance(c, value.KeyCondition) for c in self._conditions):\n            wire_symbols = (\n                wire_symbols[0]\n                + '(conditions=['\n                + ', '.join(str(c) for c in self._conditions)\n                + '])',\n            ) + wire_symbols[1:]\n        exponent_qubit_index = None\n        if sub_info.exponent_qubit_index is not None:\n            exponent_qubit_index = sub_info.exponent_qubit_index + control_count\n        elif sub_info.exponent is not None:\n            exponent_qubit_index = control_count\n        return protocols.CircuitDiagramInfo(\n            wire_symbols=wire_symbols,\n            exponent=sub_info.exponent,\n            exponent_qubit_index=exponent_qubit_index,\n        )\n\n    def _json_dict_(self) -> Dict[str, Any]:\n        return {\n            'cirq_type': self.__class__.__name__,\n            'conditions': self._conditions,\n            'sub_operation': self._sub_operation,\n        }\n\n    def _act_on_(self, args: 'cirq.ActOnArgs') -> bool:\n        if all(c.resolve(args.log_of_measurement_results) for c in self._conditions):\n            protocols.act_on(self._sub_operation, args)\n        return True\n\n    def _with_measurement_key_mapping_(\n        self, key_map: Dict[str, str]\n    ) -> 'ClassicallyControlledOperation':\n        conditions = [protocols.with_measurement_key_mapping(c, key_map) for c in self._conditions]\n        sub_operation = protocols.with_measurement_key_mapping(self._sub_operation, key_map)\n        sub_operation = self._sub_operation if sub_operation is NotImplemented else sub_operation\n        return sub_operation.with_classical_controls(*conditions)\n\n    def _with_key_path_prefix_(self, prefix: Tuple[str, ...]) -> 'ClassicallyControlledOperation':\n        conditions = [protocols.with_key_path_prefix(c, prefix) for c in self._conditions]\n        sub_operation = protocols.with_key_path_prefix(self._sub_operation, prefix)\n        sub_operation = self._sub_operation if sub_operation is NotImplemented else sub_operation\n        return sub_operation.with_classical_controls(*conditions)\n\n    def _with_rescoped_keys_(\n        self,\n        path: Tuple[str, ...],\n        bindable_keys: FrozenSet['cirq.MeasurementKey'],\n    ) -> 'ClassicallyControlledOperation':\n        conds = [protocols.with_rescoped_keys(c, path, bindable_keys) for c in self._conditions]\n        sub_operation = protocols.with_rescoped_keys(self._sub_operation, path, bindable_keys)\n        return sub_operation.with_classical_controls(*conds)\n\n    def _control_keys_(self) -> FrozenSet['cirq.MeasurementKey']:\n        local_keys: FrozenSet['cirq.MeasurementKey'] = frozenset(\n            k for condition in self._conditions for k in condition.keys\n        )\n        return local_keys.union(protocols.control_keys(self._sub_operation))\n\n    def _qasm_(self, args: 'cirq.QasmArgs') -> Optional[str]:\n        args.validate_version('2.0')\n        all_keys = \" && \".join(c.qasm for c in self._conditions)\n        return args.format('if ({0}) {1}', all_keys, protocols.qasm(self._sub_operation, args=args))\n", "path": "cirq-core/cirq/ops/classically_controlled_operation.py"}], "after_files": [{"content": "# Copyright 2021 The Cirq Developers\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom typing import (\n    AbstractSet,\n    Any,\n    Dict,\n    FrozenSet,\n    List,\n    Optional,\n    Sequence,\n    TYPE_CHECKING,\n    Tuple,\n    Union,\n)\n\nimport sympy\n\nfrom cirq import protocols, value\nfrom cirq.ops import raw_types\n\nif TYPE_CHECKING:\n    import cirq\n\n\n@value.value_equality\nclass ClassicallyControlledOperation(raw_types.Operation):\n    \"\"\"Augments existing operations to be conditionally executed.\n\n    An operation that is classically controlled is executed iff all conditions\n    evaluate to True. Currently the only condition type is a measurement key.\n    A measurement key evaluates to True iff any qubit in the corresponding\n    measurement operation evaluated to a non-zero value.\n\n    This object is typically created via\n     `operation.with_classical_controls(*conditions)`.\n    \"\"\"\n\n    def __init__(\n        self,\n        sub_operation: 'cirq.Operation',\n        conditions: Sequence[Union[str, 'cirq.MeasurementKey', 'cirq.Condition', sympy.Basic]],\n    ):\n        \"\"\"Initializes a `ClassicallyControlledOperation`.\n\n        Multiple consecutive `ClassicallyControlledOperation` layers are\n        squashed when possible, so one should not depend on a specific number\n        of layers.\n\n        Args:\n            sub_operation: The operation to gate with a classical control\n                condition.\n            conditions: A sequence of measurement keys, or strings that can be\n                parsed into measurement keys.\n\n        Raises:\n            ValueError: If an unsupported gate is being classically\n                controlled.\n        \"\"\"\n        if protocols.measurement_key_objs(sub_operation):\n            raise ValueError(\n                f'Cannot conditionally run operations with measurements: {sub_operation}'\n            )\n        conditions = tuple(conditions)\n        if isinstance(sub_operation, ClassicallyControlledOperation):\n            conditions += sub_operation._conditions\n            sub_operation = sub_operation._sub_operation\n        conds: List['cirq.Condition'] = []\n        for c in conditions:\n            if isinstance(c, str):\n                c = value.MeasurementKey.parse_serialized(c)\n            if isinstance(c, value.MeasurementKey):\n                c = value.KeyCondition(c)\n            if isinstance(c, sympy.Basic):\n                c = value.SympyCondition(c)\n            conds.append(c)\n        self._conditions: Tuple['cirq.Condition', ...] = tuple(conds)\n        self._sub_operation: 'cirq.Operation' = sub_operation\n\n    @property\n    def classical_controls(self) -> FrozenSet['cirq.Condition']:\n        return frozenset(self._conditions).union(self._sub_operation.classical_controls)\n\n    def without_classical_controls(self) -> 'cirq.Operation':\n        return self._sub_operation.without_classical_controls()\n\n    @property\n    def qubits(self):\n        return self._sub_operation.qubits\n\n    def with_qubits(self, *new_qubits):\n        return self._sub_operation.with_qubits(*new_qubits).with_classical_controls(\n            *self._conditions\n        )\n\n    def _decompose_(self):\n        result = protocols.decompose_once(self._sub_operation, NotImplemented)\n        if result is NotImplemented:\n            return NotImplemented\n\n        return [ClassicallyControlledOperation(op, self._conditions) for op in result]\n\n    def _value_equality_values_(self):\n        return (frozenset(self._conditions), self._sub_operation)\n\n    def __str__(self) -> str:\n        keys = ', '.join(map(str, self._conditions))\n        return f'{self._sub_operation}.with_classical_controls({keys})'\n\n    def __repr__(self):\n        return (\n            f'cirq.ClassicallyControlledOperation('\n            f'{self._sub_operation!r}, {list(self._conditions)!r})'\n        )\n\n    def _is_parameterized_(self) -> bool:\n        return protocols.is_parameterized(self._sub_operation)\n\n    def _parameter_names_(self) -> AbstractSet[str]:\n        return protocols.parameter_names(self._sub_operation)\n\n    def _resolve_parameters_(\n        self, resolver: 'cirq.ParamResolver', recursive: bool\n    ) -> 'ClassicallyControlledOperation':\n        new_sub_op = protocols.resolve_parameters(self._sub_operation, resolver, recursive)\n        return new_sub_op.with_classical_controls(*self._conditions)\n\n    def _circuit_diagram_info_(\n        self, args: 'cirq.CircuitDiagramInfoArgs'\n    ) -> Optional['protocols.CircuitDiagramInfo']:\n        sub_args = protocols.CircuitDiagramInfoArgs(\n            known_qubit_count=args.known_qubit_count,\n            known_qubits=args.known_qubits,\n            use_unicode_characters=args.use_unicode_characters,\n            precision=args.precision,\n            label_map=args.label_map,\n        )\n        sub_info = protocols.circuit_diagram_info(self._sub_operation, sub_args, None)\n        if sub_info is None:\n            return NotImplemented  # coverage: ignore\n\n        control_count = len({k for c in self._conditions for k in c.keys})\n        wire_symbols = sub_info.wire_symbols + ('^',) * control_count\n        if any(not isinstance(c, value.KeyCondition) for c in self._conditions):\n            wire_symbols = (\n                wire_symbols[0]\n                + '(conditions=['\n                + ', '.join(str(c) for c in self._conditions)\n                + '])',\n            ) + wire_symbols[1:]\n        exponent_qubit_index = None\n        if sub_info.exponent_qubit_index is not None:\n            exponent_qubit_index = sub_info.exponent_qubit_index + control_count\n        elif sub_info.exponent is not None:\n            exponent_qubit_index = control_count\n        return protocols.CircuitDiagramInfo(\n            wire_symbols=wire_symbols,\n            exponent=sub_info.exponent,\n            exponent_qubit_index=exponent_qubit_index,\n        )\n\n    def _json_dict_(self) -> Dict[str, Any]:\n        return {\n            'conditions': self._conditions,\n            'sub_operation': self._sub_operation,\n        }\n\n    def _act_on_(self, args: 'cirq.ActOnArgs') -> bool:\n        if all(c.resolve(args.log_of_measurement_results) for c in self._conditions):\n            protocols.act_on(self._sub_operation, args)\n        return True\n\n    def _with_measurement_key_mapping_(\n        self, key_map: Dict[str, str]\n    ) -> 'ClassicallyControlledOperation':\n        conditions = [protocols.with_measurement_key_mapping(c, key_map) for c in self._conditions]\n        sub_operation = protocols.with_measurement_key_mapping(self._sub_operation, key_map)\n        sub_operation = self._sub_operation if sub_operation is NotImplemented else sub_operation\n        return sub_operation.with_classical_controls(*conditions)\n\n    def _with_key_path_prefix_(self, prefix: Tuple[str, ...]) -> 'ClassicallyControlledOperation':\n        conditions = [protocols.with_key_path_prefix(c, prefix) for c in self._conditions]\n        sub_operation = protocols.with_key_path_prefix(self._sub_operation, prefix)\n        sub_operation = self._sub_operation if sub_operation is NotImplemented else sub_operation\n        return sub_operation.with_classical_controls(*conditions)\n\n    def _with_rescoped_keys_(\n        self,\n        path: Tuple[str, ...],\n        bindable_keys: FrozenSet['cirq.MeasurementKey'],\n    ) -> 'ClassicallyControlledOperation':\n        conds = [protocols.with_rescoped_keys(c, path, bindable_keys) for c in self._conditions]\n        sub_operation = protocols.with_rescoped_keys(self._sub_operation, path, bindable_keys)\n        return sub_operation.with_classical_controls(*conds)\n\n    def _control_keys_(self) -> FrozenSet['cirq.MeasurementKey']:\n        local_keys: FrozenSet['cirq.MeasurementKey'] = frozenset(\n            k for condition in self._conditions for k in condition.keys\n        )\n        return local_keys.union(protocols.control_keys(self._sub_operation))\n\n    def _qasm_(self, args: 'cirq.QasmArgs') -> Optional[str]:\n        args.validate_version('2.0')\n        all_keys = \" && \".join(c.qasm for c in self._conditions)\n        return args.format('if ({0}) {1}', all_keys, protocols.qasm(self._sub_operation, args=args))\n", "path": "cirq-core/cirq/ops/classically_controlled_operation.py"}]}