Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make spacing before imports consistent #1798

Merged
merged 1 commit into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================


import os
import sys
from sphinx.application import ConfigError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
# limitations under the License.
"""Shortcuts for base model configurations."""


from .mobilenetv2_base import MobileNetV2Base
from .saved_model_base import SavedModelBase
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
"""Base model configuration for MobileNetV2."""


from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
"""Base model abstract base class that handles quantization."""


from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
"""Base model configuration that reads a specified SavedModel."""


from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
"""Shortcuts for head model configurations."""


from .keras_model_head import KerasModelHead
from .logits_saved_model_head import LogitsSavedModelHead
from .softmax_classifier_head import SoftmaxClassifierHead
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
"""Head model configuration for Keras models."""


from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
"""Head model configuration for classifier SavedModels."""


from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
"""Head model configuration for simple softmax classifiers."""


from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
"""End-to-end tests that check model correctness."""


from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
# limitations under the License.
"""Shortcuts for optimizer configurations."""


from .adam import Adam
from .sgd import SGD
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
"""Adam optimizer implementation for transfer learning models."""


from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
"""SGD optimizer implementation for transfer learning models."""


from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
Converts a pair of TF models to a TFLite transfer learning model.
"""


from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
transfer learning library.
"""


from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
"""Tests for tflite_transfer_converter."""


from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
Expand Down
1 change: 1 addition & 0 deletions examples/android/tflite_convertor/tfltransfer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
"""Helper utilities for various parts of the converter."""


from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
Expand Down
1 change: 1 addition & 0 deletions examples/mxnet_from_centralized_to_federated/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Flower client example using MXNet for MNIST classification."""


from typing import Dict, List, Tuple

import flwr as fl
Expand Down
1 change: 1 addition & 0 deletions examples/mxnet_from_centralized_to_federated/server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Flower server example."""


import flwr as fl

if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions examples/pytorch_from_centralized_to_federated/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Flower client example using PyTorch for CIFAR-10 image classification."""


import os
import sys
import timeit
Expand Down
1 change: 1 addition & 0 deletions examples/quickstart_jax/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Flower client example using JAX for linear regression."""


from typing import Dict, List, Tuple, Callable

import flwr as fl
Expand Down
1 change: 1 addition & 0 deletions examples/quickstart_jax/jax_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
please read the JAX documentation or the mentioned tutorial.
"""


from typing import Dict, List, Tuple, Callable
import jax
import jax.numpy as jnp
Expand Down
1 change: 1 addition & 0 deletions examples/quickstart_mxnet/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
https://mxnet.apache.org/api/python/docs/tutorials/packages/gluon/image/mnist.html
"""


import flwr as fl
import numpy as np
import mxnet as mx
Expand Down
1 change: 1 addition & 0 deletions examples/quickstart_mxnet/server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Flower server example."""


import flwr as fl

if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions src/py/flwr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ==============================================================================
"""Flower main package."""


from flwr.common.version import package_version as _package_version

from . import client, common, server, simulation
Expand Down
1 change: 1 addition & 0 deletions src/py/flwr/__init___test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ==============================================================================
"""Test for flwr __init__.py."""


import semver


Expand Down
1 change: 1 addition & 0 deletions src/py/flwr/client/grpc_client/connection_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ==============================================================================
"""Tests for module connection."""


import concurrent.futures
import socket
from contextlib import closing
Expand Down
1 change: 1 addition & 0 deletions src/py/flwr/common/dp.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ==============================================================================
"""Building block functions for DP algorithms."""


from typing import Tuple

import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions src/py/flwr/common/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# limitations under the License.
# ==============================================================================
"""Flower Logger."""


import logging
from logging import LogRecord
from logging.handlers import HTTPHandler
Expand Down
1 change: 1 addition & 0 deletions src/py/flwr/common/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ==============================================================================
"""Flower telemetry."""


import datetime
import json
import logging
Expand Down
1 change: 1 addition & 0 deletions src/py/flwr/common/telemetry_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ==============================================================================
"""Telemetry tests."""


import time
import unittest
from typing import Callable
Expand Down
2 changes: 2 additions & 0 deletions src/py/flwr/common/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Flower package version helper."""


import sys
from typing import Tuple

Expand Down
1 change: 1 addition & 0 deletions src/py/flwr/server/criterion_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ==============================================================================
"""Tests for criterion sampling."""


from unittest.mock import MagicMock

from flwr.server.client_manager import SimpleClientManager
Expand Down
2 changes: 2 additions & 0 deletions src/py/flwr/server/grpc_server/grpc_server_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# limitations under the License.
# ==============================================================================
"""Tests for module server."""


import socket
import subprocess
from contextlib import closing
Expand Down
1 change: 1 addition & 0 deletions src/py/flwr/server/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ==============================================================================
"""Training history."""


from functools import reduce
from typing import Dict, List, Tuple

Expand Down
1 change: 1 addition & 0 deletions src/py/flwr/server/state/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ==============================================================================
"""Flower server state."""


from .in_memory_state import InMemoryState as InMemoryState
from .sqlite_state import SqliteState as SqliteState
from .state import State as State
Expand Down
1 change: 1 addition & 0 deletions src/py/flwr/server/strategy/dpfedavg_fixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
Paper: https://arxiv.org/pdf/1710.06963.pdf
"""


from typing import Dict, List, Optional, Tuple, Union

from flwr.common import EvaluateIns, EvaluateRes, FitIns, FitRes, Parameters, Scalar
Expand Down
1 change: 1 addition & 0 deletions src/py/flwr/server/strategy/fedavgm_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ==============================================================================
"""FedAvgM tests."""


from typing import List, Tuple, Union
from unittest.mock import MagicMock

Expand Down
1 change: 1 addition & 0 deletions src/py/flwr/server/strategy/fedmedian_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ==============================================================================
"""FedMedian tests."""


from typing import List, Tuple
from unittest.mock import MagicMock

Expand Down
1 change: 1 addition & 0 deletions src/py/flwr/server/strategy/krum_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ==============================================================================
"""Krum tests."""


from typing import List, Tuple
from unittest.mock import MagicMock

Expand Down
1 change: 1 addition & 0 deletions src/py/flwr/server/strategy/multikrum_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ==============================================================================
"""Krum tests."""


from typing import List, Tuple
from unittest.mock import MagicMock

Expand Down
2 changes: 2 additions & 0 deletions src/py/flwr/server/utils/tensorboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# limitations under the License.
# ==============================================================================
"""Flower TensorBoard utilities."""


import os
from datetime import datetime
from typing import Callable, Dict, List, Optional, Tuple, TypeVar, Union, cast
Expand Down
2 changes: 2 additions & 0 deletions src/py/flwr/server/utils/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# limitations under the License.
# ==============================================================================
"""Validators."""


from typing import List, Union

from flwr.proto.task_pb2 import TaskIns, TaskRes
Expand Down
2 changes: 2 additions & 0 deletions src/py/flwr/server/utils/validator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# limitations under the License.
# ==============================================================================
"""Validator tests."""


import unittest
from typing import List, Tuple

Expand Down
1 change: 1 addition & 0 deletions src/py/flwr/simulation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ==============================================================================
"""Flower simulation."""


import importlib

is_ray_installed = importlib.util.find_spec("ray") is not None
Expand Down
1 change: 1 addition & 0 deletions src/py/flwr_tool/init_py_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
python -m flwr_tool.init_py_check src/py/flwr
"""


import os
import re
import sys
Expand Down
1 change: 1 addition & 0 deletions src/py/flwr_tool/protoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ==============================================================================
"""This module contains functions related to proto compilation."""


import glob
from os import path

Expand Down
1 change: 1 addition & 0 deletions src/py/flwr_tool/protoc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ==============================================================================
"""This module contains functions related to proto compilation."""


from os import path

from .protoc import IN_PATH, OUT_PATH, PROTO_FILES
Expand Down