Skip to content

Commit 250f129

Browse files
authored
Sort import statements - no change in the effective code (quantumlib#7195)
Executed check/format-incremental --all --apply Related to quantumlib#4863
1 parent fa18b82 commit 250f129

File tree

634 files changed

+1400
-1365
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

634 files changed

+1400
-1365
lines changed

benchmarks/circuit_construction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
import itertools
15-
from typing import Tuple, Set, Sequence
15+
from typing import Sequence, Set, Tuple
1616

1717
import cirq
1818

benchmarks/parameter_resolution.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
# limitations under the License.
1414

1515
import random
16+
1617
import numpy as np
1718
import sympy
19+
1820
import cirq
1921

2022

benchmarks/randomized_benchmarking.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import List, Sequence
1615
import functools
16+
from typing import List, Sequence
17+
1718
import numpy as np
19+
1820
import cirq
19-
from cirq.experiments.qubit_characterizations import _single_qubit_cliffords, _find_inv_matrix
21+
from cirq.experiments.qubit_characterizations import _find_inv_matrix, _single_qubit_cliffords
2022

2123

2224
def dot(args: Sequence[np.ndarray]) -> np.ndarray:

cirq-aqt/cirq_aqt/aqt_sampler.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,15 @@
2525
import json
2626
import time
2727
import uuid
28-
from typing import Callable, cast, Dict, List, Sequence, Tuple, Union, Literal, TypedDict
28+
from typing import Callable, cast, Dict, List, Literal, Sequence, Tuple, TypedDict, Union
2929
from urllib.parse import urljoin
3030

3131
import numpy as np
32-
from requests import post, get
32+
from requests import get, post
3333

3434
import cirq
3535
from cirq_aqt.aqt_device import AQTSimulator, get_op_string, OperationString
3636

37-
3837
_DEFAULT_HOST = "https://arnica.aqt.eu/api/v1/"
3938

4039

cirq-aqt/cirq_aqt/aqt_sampler_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from unittest import mock
1615
import json
16+
from unittest import mock
17+
1718
import numpy as np
1819
import pytest
1920
import sympy

cirq-aqt/cirq_aqt/aqt_simulator_test.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
import pytest
1616

1717
import cirq
18-
1918
from cirq_aqt import AQTSimulator
20-
from cirq_aqt.aqt_device import get_aqt_device
21-
from cirq_aqt.aqt_device import AQTNoiseModel
19+
from cirq_aqt.aqt_device import AQTNoiseModel, get_aqt_device
2220

2321

2422
def test_simulator_no_circ():

cirq-aqt/cirq_aqt/aqt_target_gateset_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import cirq
2121
from cirq_aqt import aqt_target_gateset
2222

23-
2423
Q, Q2, Q3, Q4 = cirq.LineQubit.range(4)
2524

2625

cirq-aqt/cirq_aqt/json_test_data/spec.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
import pathlib
1616

1717
import cirq_aqt
18-
from cirq_aqt.json_resolver_cache import _class_resolver_dictionary
19-
2018
from cirq.testing.json import ModuleJsonTestSpec
19+
from cirq_aqt.json_resolver_cache import _class_resolver_dictionary
2120

2221
TestSpec = ModuleJsonTestSpec(
2322
name="cirq_aqt",

cirq-core/cirq/_compat_test.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
import traceback
2323
import types
2424
import warnings
25+
from importlib.machinery import ModuleSpec
2526
from types import ModuleType
2627
from typing import Any, Callable, Dict, Optional, Tuple
27-
from importlib.machinery import ModuleSpec
2828
from unittest import mock
2929

3030
import duet
@@ -38,16 +38,16 @@
3838
from cirq._compat import (
3939
block_overlapping_deprecation,
4040
cached_method,
41-
proper_repr,
4241
dataclass_repr,
43-
deprecated,
44-
deprecated_parameter,
45-
proper_eq,
4642
deprecate_attributes,
43+
deprecated,
4744
deprecated_class,
45+
deprecated_parameter,
4846
deprecated_submodule,
49-
DeprecatedModuleLoader,
5047
DeprecatedModuleImportError,
48+
DeprecatedModuleLoader,
49+
proper_eq,
50+
proper_repr,
5151
)
5252

5353

@@ -564,9 +564,10 @@ def _import_deprecated_same_name_in_earlier_subtree():
564564

565565

566566
def _import_top_level_deprecated():
567-
from cirq.testing._compat_test_data.fake_freezegun import api # type: ignore
568567
import time
569568

569+
from cirq.testing._compat_test_data.fake_freezegun import api # type: ignore
570+
570571
assert api.real_time == time.time
571572

572573

@@ -873,11 +874,12 @@ def test_new_module_is_top_level():
873874
def _test_new_module_is_top_level_inner():
874875
# sets up the DeprecationFinders
875876
# pylint: disable=unused-import
876-
import cirq.testing._compat_test_data
877+
import time
877878

878879
# imports a top level module that was also deprecated
879880
from freezegun import api
880-
import time
881+
882+
import cirq.testing._compat_test_data
881883

882884
assert api.real_time == time.time
883885

cirq-core/cirq/_import.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import Any, Callable, cast, List, Optional
16-
from types import ModuleType
17-
from importlib.machinery import ModuleSpec
18-
from importlib.abc import Loader
19-
20-
from contextlib import contextmanager
2115
import importlib
22-
from importlib import abc
2316
import sys
17+
from contextlib import contextmanager
18+
from importlib import abc
19+
from importlib.abc import Loader
20+
from importlib.machinery import ModuleSpec
21+
from types import ModuleType
22+
from typing import Any, Callable, cast, List, Optional
2423

2524

2625
class InstrumentedFinder(abc.MetaPathFinder):

0 commit comments

Comments
 (0)