diff --git a/openfl/__version__.py b/openfl/__version__.py index 713ad49b87a..44cb4cc1db3 100644 --- a/openfl/__version__.py +++ b/openfl/__version__.py @@ -3,4 +3,5 @@ """openfl version information.""" + __version__ = "1.6" diff --git a/openfl/component/aggregator/aggregator.py b/openfl/component/aggregator/aggregator.py index 805193cf778..3128ef3e894 100644 --- a/openfl/component/aggregator/aggregator.py +++ b/openfl/component/aggregator/aggregator.py @@ -3,6 +3,7 @@ """Aggregator module.""" + import queue import time from logging import getLogger diff --git a/openfl/component/collaborator/collaborator.py b/openfl/component/collaborator/collaborator.py index 3418afab731..b327cd91170 100644 --- a/openfl/component/collaborator/collaborator.py +++ b/openfl/component/collaborator/collaborator.py @@ -3,6 +3,7 @@ """Collaborator module.""" + from enum import Enum from logging import getLogger from time import sleep diff --git a/openfl/component/straggler_handling_functions/cutoff_time_based_straggler_handling.py b/openfl/component/straggler_handling_functions/cutoff_time_based_straggler_handling.py index ca8e218f7c8..c3d11ffa4bf 100644 --- a/openfl/component/straggler_handling_functions/cutoff_time_based_straggler_handling.py +++ b/openfl/component/straggler_handling_functions/cutoff_time_based_straggler_handling.py @@ -3,6 +3,7 @@ """Cutoff time based Straggler Handling function.""" + import threading import time from logging import getLogger diff --git a/openfl/component/straggler_handling_functions/percentage_based_straggler_handling.py b/openfl/component/straggler_handling_functions/percentage_based_straggler_handling.py index e556ea291b0..099ab7e870e 100644 --- a/openfl/component/straggler_handling_functions/percentage_based_straggler_handling.py +++ b/openfl/component/straggler_handling_functions/percentage_based_straggler_handling.py @@ -3,6 +3,7 @@ """Percentage based Straggler Handling function.""" + from logging import getLogger from openfl.component.straggler_handling_functions.straggler_handling_function import ( diff --git a/openfl/cryptography/participant.py b/openfl/cryptography/participant.py index 6e18840ff9e..f190f687142 100644 --- a/openfl/cryptography/participant.py +++ b/openfl/cryptography/participant.py @@ -3,6 +3,7 @@ """Cryptography participant utilities.""" + from typing import Tuple from cryptography import x509 diff --git a/openfl/experimental/workflow/component/aggregator/aggregator.py b/openfl/experimental/workflow/component/aggregator/aggregator.py index cd15b515701..4e034aa3156 100644 --- a/openfl/experimental/workflow/component/aggregator/aggregator.py +++ b/openfl/experimental/workflow/component/aggregator/aggregator.py @@ -3,6 +3,7 @@ """Experimental Aggregator module.""" + import inspect import pickle import queue diff --git a/openfl/experimental/workflow/component/collaborator/collaborator.py b/openfl/experimental/workflow/component/collaborator/collaborator.py index e753180158d..a683bbfeb72 100644 --- a/openfl/experimental/workflow/component/collaborator/collaborator.py +++ b/openfl/experimental/workflow/component/collaborator/collaborator.py @@ -3,6 +3,7 @@ """Experimental Collaborator module.""" + import pickle import time from logging import getLogger diff --git a/openfl/experimental/workflow/federated/plan/plan.py b/openfl/experimental/workflow/federated/plan/plan.py index 22f2e2e2cdc..6df27d8b1c7 100644 --- a/openfl/experimental/workflow/federated/plan/plan.py +++ b/openfl/experimental/workflow/federated/plan/plan.py @@ -3,6 +3,7 @@ """Plan module.""" + import inspect import os from hashlib import sha384 diff --git a/openfl/experimental/workflow/interface/cli/aggregator.py b/openfl/experimental/workflow/interface/cli/aggregator.py index 2af60af0203..2c458fa2fe8 100644 --- a/openfl/experimental/workflow/interface/cli/aggregator.py +++ b/openfl/experimental/workflow/interface/cli/aggregator.py @@ -3,6 +3,7 @@ """Aggregator module.""" + import os import sys import threading diff --git a/openfl/experimental/workflow/interface/cli/cli_helper.py b/openfl/experimental/workflow/interface/cli/cli_helper.py index d782c3b7e6a..e45b3cdd094 100644 --- a/openfl/experimental/workflow/interface/cli/cli_helper.py +++ b/openfl/experimental/workflow/interface/cli/cli_helper.py @@ -3,6 +3,7 @@ """Module with auxiliary CLI helper functions.""" + import os import re from itertools import islice diff --git a/openfl/experimental/workflow/interface/cli/collaborator.py b/openfl/experimental/workflow/interface/cli/collaborator.py index 52f679fa233..fe0cb329401 100644 --- a/openfl/experimental/workflow/interface/cli/collaborator.py +++ b/openfl/experimental/workflow/interface/cli/collaborator.py @@ -3,6 +3,7 @@ """Collaborator module.""" + import os import sys from glob import glob diff --git a/openfl/experimental/workflow/interface/cli/plan.py b/openfl/experimental/workflow/interface/cli/plan.py index 532350aa925..9f40db67ded 100644 --- a/openfl/experimental/workflow/interface/cli/plan.py +++ b/openfl/experimental/workflow/interface/cli/plan.py @@ -3,6 +3,7 @@ """Plan module.""" + import sys from logging import getLogger from pathlib import Path diff --git a/openfl/experimental/workflow/interface/cli/workspace.py b/openfl/experimental/workflow/interface/cli/workspace.py index d89d4b239d9..1d65d0dde00 100644 --- a/openfl/experimental/workflow/interface/cli/workspace.py +++ b/openfl/experimental/workflow/interface/cli/workspace.py @@ -3,6 +3,7 @@ """Workspace module.""" + import os import sys from hashlib import sha256 diff --git a/openfl/experimental/workflow/interface/participants.py b/openfl/experimental/workflow/interface/participants.py index 618f40161de..5c9c9d594f0 100644 --- a/openfl/experimental/workflow/interface/participants.py +++ b/openfl/experimental/workflow/interface/participants.py @@ -123,7 +123,7 @@ def __init__( private_attributes_callable: Callable = None, num_cpus: int = 0, num_gpus: int = 0.0, - **kwargs + **kwargs, ): """Initializes the Collaborator object. @@ -190,7 +190,7 @@ def __init__( private_attributes_callable: Callable = None, num_cpus: int = 0, num_gpus: int = 0.0, - **kwargs + **kwargs, ): """Initializes the Aggregator object. diff --git a/openfl/experimental/workflow/protocols/interceptors.py b/openfl/experimental/workflow/protocols/interceptors.py index 3549529da69..e6a9b57b3f0 100644 --- a/openfl/experimental/workflow/protocols/interceptors.py +++ b/openfl/experimental/workflow/protocols/interceptors.py @@ -3,6 +3,7 @@ """gRPC interceptors module.""" + import collections import grpc diff --git a/openfl/experimental/workflow/runtime/__init__.py b/openfl/experimental/workflow/runtime/__init__.py index 991792046e1..5d13960b270 100644 --- a/openfl/experimental/workflow/runtime/__init__.py +++ b/openfl/experimental/workflow/runtime/__init__.py @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 -""" openfl.experimental.workflow.runtime package Runtime class.""" +"""openfl.experimental.workflow.runtime package Runtime class.""" from openfl.experimental.workflow.runtime.federated_runtime import FederatedRuntime from openfl.experimental.workflow.runtime.local_runtime import LocalRuntime diff --git a/openfl/experimental/workflow/runtime/federated_runtime.py b/openfl/experimental/workflow/runtime/federated_runtime.py index 885dbe261c8..9684fad4042 100644 --- a/openfl/experimental/workflow/runtime/federated_runtime.py +++ b/openfl/experimental/workflow/runtime/federated_runtime.py @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 -""" openfl.experimental.workflow.runtime package LocalRuntime class.""" +"""openfl.experimental.workflow.runtime package LocalRuntime class.""" from __future__ import annotations diff --git a/openfl/experimental/workflow/runtime/local_runtime.py b/openfl/experimental/workflow/runtime/local_runtime.py index beb2818e7c9..7a7aa3f7a23 100644 --- a/openfl/experimental/workflow/runtime/local_runtime.py +++ b/openfl/experimental/workflow/runtime/local_runtime.py @@ -2,7 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 -""" openfl.experimental.workflow.runtime package LocalRuntime class.""" +"""openfl.experimental.workflow.runtime package LocalRuntime class.""" + from __future__ import annotations import gc diff --git a/openfl/experimental/workflow/runtime/runtime.py b/openfl/experimental/workflow/runtime/runtime.py index 3cffeccafc3..317c26ede6a 100644 --- a/openfl/experimental/workflow/runtime/runtime.py +++ b/openfl/experimental/workflow/runtime/runtime.py @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 -""" openfl.experimental.workflow.runtime module Runtime class.""" +"""openfl.experimental.workflow.runtime module Runtime class.""" from typing import Callable, List diff --git a/openfl/experimental/workflow/transport/__init__.py b/openfl/experimental/workflow/transport/__init__.py index 83c441b84fe..6a8abc0d3fe 100644 --- a/openfl/experimental/workflow/transport/__init__.py +++ b/openfl/experimental/workflow/transport/__init__.py @@ -3,4 +3,5 @@ """openfl.experimental.workflow.transport package.""" + from openfl.experimental.workflow.transport.grpc import AggregatorGRPCClient, AggregatorGRPCServer diff --git a/openfl/experimental/workflow/utilities/metaflow_utils.py b/openfl/experimental/workflow/utilities/metaflow_utils.py index 559cbef5b32..ddb08f19050 100644 --- a/openfl/experimental/workflow/utilities/metaflow_utils.py +++ b/openfl/experimental/workflow/utilities/metaflow_utils.py @@ -65,9 +65,7 @@ def __init__(self, name): self.name = name def __enter__(self): - lock_id = hashlib.new( - "sha256", self.name.encode("utf8"), usedforsecurity=False - ).hexdigest() # nosec + lock_id = hashlib.new("sha256", self.name.encode("utf8"), usedforsecurity=False).hexdigest() # nosec # Using SHA-256 to address security warning self.fp = open(f"/tmp/.lock-{lock_id}.lck", "wb") fcntl.flock(self.fp.fileno(), fcntl.LOCK_EX) diff --git a/openfl/experimental/workflow/utilities/runtime_utils.py b/openfl/experimental/workflow/utilities/runtime_utils.py index 193941bc2e8..1aba29605a0 100644 --- a/openfl/experimental/workflow/utilities/runtime_utils.py +++ b/openfl/experimental/workflow/utilities/runtime_utils.py @@ -176,7 +176,7 @@ def check_resource_allocation(num_gpus, each_participant_gpu_usage): # buffer to cycle though since need_assigned will change sizes as we # assign participants current_dict = need_assigned.copy() - for (participant_name, participant_gpu_usage) in current_dict.items(): + for participant_name, participant_gpu_usage in current_dict.items(): if gpu == 0: break if gpu < participant_gpu_usage: diff --git a/openfl/experimental/workflow/workspace_export/export.py b/openfl/experimental/workflow/workspace_export/export.py index 52e5dab8f98..7df2a7684b0 100644 --- a/openfl/experimental/workflow/workspace_export/export.py +++ b/openfl/experimental/workflow/workspace_export/export.py @@ -3,6 +3,7 @@ """Workspace Builder module.""" + import ast import importlib import inspect diff --git a/openfl/federated/data/loader_gandlf.py b/openfl/federated/data/loader_gandlf.py index 648ebe2930c..0dda8e3a465 100644 --- a/openfl/federated/data/loader_gandlf.py +++ b/openfl/federated/data/loader_gandlf.py @@ -3,6 +3,7 @@ """PyTorchDataLoader module.""" + from openfl.federated.data.loader import DataLoader diff --git a/openfl/federated/plan/plan.py b/openfl/federated/plan/plan.py index bf9fe1d57ae..34c50a4d1e6 100644 --- a/openfl/federated/plan/plan.py +++ b/openfl/federated/plan/plan.py @@ -3,6 +3,7 @@ """Plan module.""" + from hashlib import sha384 from importlib import import_module from logging import getLogger diff --git a/openfl/federated/task/fl_model.py b/openfl/federated/task/fl_model.py index 110c91c5bc1..70bc537324b 100644 --- a/openfl/federated/task/fl_model.py +++ b/openfl/federated/task/fl_model.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 """FederatedModel module.""" + import inspect from openfl.federated.task.runner import TaskRunner @@ -129,7 +130,7 @@ def setup(self, num_collaborators, **kwargs): optimizer=self.lambda_opt, loss_fn=self.loss_fn, data_loader=data_slice, - **kwargs + **kwargs, ) for data_slice in self.data_loader.split(num_collaborators) ] diff --git a/openfl/federated/task/runner_keras.py b/openfl/federated/task/runner_keras.py index df56fd97e1f..b33b20fde57 100644 --- a/openfl/federated/task/runner_keras.py +++ b/openfl/federated/task/runner_keras.py @@ -7,6 +7,7 @@ You may copy this file as the starting point of your own keras model. """ + from warnings import catch_warnings, simplefilter import numpy as np diff --git a/openfl/federated/task/runner_pt.py b/openfl/federated/task/runner_pt.py index 2adfe9d5bbc..30b56a41202 100644 --- a/openfl/federated/task/runner_pt.py +++ b/openfl/federated/task/runner_pt.py @@ -504,8 +504,9 @@ def validate_(self, validation_dataloader: Iterator[Tuple[np.ndarray, np.ndarray for data, target in validation_dataloader: samples = target.shape[0] total_samples += samples - data, target = torch.tensor(data).to(self.device), torch.tensor(target).to( - self.device, dtype=torch.int64 + data, target = ( + torch.tensor(data).to(self.device), + torch.tensor(target).to(self.device, dtype=torch.int64), ) output = self(data) # get the index of the max log-probability diff --git a/openfl/interface/aggregation_functions/core/interface.py b/openfl/interface/aggregation_functions/core/interface.py index c11fd626215..10f91ace3a8 100644 --- a/openfl/interface/aggregation_functions/core/interface.py +++ b/openfl/interface/aggregation_functions/core/interface.py @@ -3,6 +3,7 @@ """Aggregation function interface module.""" + from abc import abstractmethod from typing import Iterator, List, Tuple diff --git a/openfl/interface/aggregation_functions/experimental/privileged_aggregation.py b/openfl/interface/aggregation_functions/experimental/privileged_aggregation.py index 00b8bf76253..0e8beacebce 100644 --- a/openfl/interface/aggregation_functions/experimental/privileged_aggregation.py +++ b/openfl/interface/aggregation_functions/experimental/privileged_aggregation.py @@ -3,6 +3,7 @@ """Aggregation function interface module.""" + from abc import abstractmethod from typing import List, Tuple diff --git a/openfl/interface/aggregation_functions/fedcurv_weighted_average.py b/openfl/interface/aggregation_functions/fedcurv_weighted_average.py index ba87da9c11e..7fb0ffe992b 100644 --- a/openfl/interface/aggregation_functions/fedcurv_weighted_average.py +++ b/openfl/interface/aggregation_functions/fedcurv_weighted_average.py @@ -3,6 +3,7 @@ """FedCurv Aggregation function module.""" + import numpy as np from openfl.interface.aggregation_functions.weighted_average import WeightedAverage diff --git a/openfl/interface/aggregator.py b/openfl/interface/aggregator.py index 60bd874ee97..80ce56e32e5 100644 --- a/openfl/interface/aggregator.py +++ b/openfl/interface/aggregator.py @@ -3,6 +3,7 @@ """Aggregator module.""" + import sys from logging import getLogger from pathlib import Path diff --git a/openfl/interface/cli.py b/openfl/interface/cli.py index e497f47e9e0..314cfebf3ac 100755 --- a/openfl/interface/cli.py +++ b/openfl/interface/cli.py @@ -2,6 +2,7 @@ # Copyright (C) 2020-2023 Intel Corporation # SPDX-License-Identifier: Apache-2.0 """CLI module.""" + import logging import os import re diff --git a/openfl/interface/cli_helper.py b/openfl/interface/cli_helper.py index cfabe77a0b2..065dd43da37 100644 --- a/openfl/interface/cli_helper.py +++ b/openfl/interface/cli_helper.py @@ -3,6 +3,7 @@ """Module with auxiliary CLI helper functions.""" + import os import re from itertools import islice diff --git a/openfl/interface/collaborator.py b/openfl/interface/collaborator.py index 6716fe338cd..862ae4db846 100644 --- a/openfl/interface/collaborator.py +++ b/openfl/interface/collaborator.py @@ -3,6 +3,7 @@ """Collaborator module.""" + import os import sys from glob import glob @@ -406,8 +407,10 @@ def certify(collaborator_name, silent, request_pkg=None, import_=False): echo(f"The CSR Hash for file {file_name}.csr is {csr_hash}") if silent: - echo("Signing COLLABORATOR certificate, " - "Warning: manual check of certificate hashes is bypassed in silent mode.") + echo( + "Signing COLLABORATOR certificate, " + "Warning: manual check of certificate hashes is bypassed in silent mode." + ) signed_col_cert = sign_certificate(csr, signing_key, signing_crt.subject) write_crt(signed_col_cert, f"{cert_name}.crt") register_collaborator(CERT_DIR / "client" / f"{file_name}.crt") @@ -455,6 +458,7 @@ def certify(collaborator_name, silent, request_pkg=None, import_=False): else: _import_certificates(import_) + def _import_certificates(archive: str): # Copy the signed certificate and cert chain into PKI_DIR previous_crts = glob(f"{CERT_DIR}/client/*.crt") diff --git a/openfl/interface/director.py b/openfl/interface/director.py index fb1460539e9..bd73d865c12 100644 --- a/openfl/interface/director.py +++ b/openfl/interface/director.py @@ -3,6 +3,7 @@ """Director CLI.""" + import logging import shutil import sys diff --git a/openfl/interface/envoy.py b/openfl/interface/envoy.py index 1d99061f405..4e35391bbab 100644 --- a/openfl/interface/envoy.py +++ b/openfl/interface/envoy.py @@ -3,6 +3,7 @@ """Envoy CLI.""" + import logging import shutil import sys diff --git a/openfl/interface/experimental.py b/openfl/interface/experimental.py index e2cf08aa78b..67c77073fce 100644 --- a/openfl/interface/experimental.py +++ b/openfl/interface/experimental.py @@ -3,6 +3,7 @@ """Experimental CLI.""" + from logging import getLogger from pathlib import Path from subprocess import check_call diff --git a/openfl/interface/interactive_api/experiment.py b/openfl/interface/interactive_api/experiment.py index afaad329389..111c6f12389 100644 --- a/openfl/interface/interactive_api/experiment.py +++ b/openfl/interface/interactive_api/experiment.py @@ -3,6 +3,7 @@ """Python low-level API module.""" + import os import time from collections import defaultdict @@ -396,6 +397,7 @@ def define_task_assigner(self, task_keeper, rounds_to_train): # noqa: C901 "because only validation tasks were given" ) if is_train_task_exist and self.is_validate_task_exist: + def assigner(collaborators, round_number, **kwargs): tasks_by_collaborator = {} for collaborator in collaborators: @@ -405,9 +407,11 @@ def assigner(collaborators, round_number, **kwargs): tasks["aggregated_model_validate"], ] return tasks_by_collaborator + return assigner elif not is_train_task_exist and self.is_validate_task_exist: + def assigner(collaborators, round_number, **kwargs): tasks_by_collaborator = {} for collaborator in collaborators: @@ -415,6 +419,7 @@ def assigner(collaborators, round_number, **kwargs): tasks["aggregated_model_validate"], ] return tasks_by_collaborator + return assigner elif is_train_task_exist and not self.is_validate_task_exist: @@ -566,9 +571,9 @@ def _prepare_plan( # Collaborator part self.plan.config["collaborator"]["settings"]["delta_updates"] = delta_updates self.plan.config["collaborator"]["settings"]["opt_treatment"] = opt_treatment - self.plan.config["collaborator"]["settings"][ - "device_assignment_policy" - ] = device_assignment_policy + self.plan.config["collaborator"]["settings"]["device_assignment_policy"] = ( + device_assignment_policy + ) # DataLoader part for setting, value in data_loader.kwargs.items(): diff --git a/openfl/interface/model.py b/openfl/interface/model.py index 9852124c6d5..37035818998 100644 --- a/openfl/interface/model.py +++ b/openfl/interface/model.py @@ -3,6 +3,7 @@ """Model CLI module.""" + from logging import getLogger from pathlib import Path from typing import Union diff --git a/openfl/interface/plan.py b/openfl/interface/plan.py index 04f5dd9da8f..93d09c02a56 100644 --- a/openfl/interface/plan.py +++ b/openfl/interface/plan.py @@ -3,6 +3,7 @@ """Plan module.""" + import os import sys from logging import getLogger diff --git a/openfl/interface/tutorial.py b/openfl/interface/tutorial.py index 2c1975f5763..e3de9ee7b06 100644 --- a/openfl/interface/tutorial.py +++ b/openfl/interface/tutorial.py @@ -3,6 +3,7 @@ """Tutorial module.""" + from logging import getLogger from os import environ, sep from subprocess import check_call # nosec diff --git a/openfl/interface/workspace.py b/openfl/interface/workspace.py index 567a58f37d1..52129a967e0 100644 --- a/openfl/interface/workspace.py +++ b/openfl/interface/workspace.py @@ -3,6 +3,7 @@ """Workspace module.""" + import logging import os import shutil diff --git a/openfl/native/fastestimator.py b/openfl/native/fastestimator.py index b99765fabd6..a95db185d00 100644 --- a/openfl/native/fastestimator.py +++ b/openfl/native/fastestimator.py @@ -3,6 +3,7 @@ """FederatedFastEstimator module.""" + import os from logging import getLogger from pathlib import Path diff --git a/openfl/native/native.py b/openfl/native/native.py index c9a44cd64f8..117058abbb6 100644 --- a/openfl/native/native.py +++ b/openfl/native/native.py @@ -7,6 +7,7 @@ This file defines openfl entrypoints to be used directly through python (not CLI) """ + import json import logging import os diff --git a/openfl/pipelines/stc_pipeline.py b/openfl/pipelines/stc_pipeline.py index 61e2fcf704f..4a5a9126cea 100644 --- a/openfl/pipelines/stc_pipeline.py +++ b/openfl/pipelines/stc_pipeline.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 """STCPipelinemodule.""" + import copy import gzip as gz diff --git a/openfl/plugins/frameworks_adapters/flax_adapter.py b/openfl/plugins/frameworks_adapters/flax_adapter.py index 332b73a1fce..ce9399d7e8f 100644 --- a/openfl/plugins/frameworks_adapters/flax_adapter.py +++ b/openfl/plugins/frameworks_adapters/flax_adapter.py @@ -3,6 +3,7 @@ """Custom model DeviceArray - JAX Numpy adapter.""" + import jax import jax.numpy as jnp import numpy as np diff --git a/openfl/plugins/frameworks_adapters/keras_adapter.py b/openfl/plugins/frameworks_adapters/keras_adapter.py index 971be7840e1..a484372ad0d 100644 --- a/openfl/plugins/frameworks_adapters/keras_adapter.py +++ b/openfl/plugins/frameworks_adapters/keras_adapter.py @@ -3,6 +3,7 @@ """Keras Framework Adapter plugin.""" + from logging import getLogger from packaging import version diff --git a/openfl/plugins/frameworks_adapters/pytorch_adapter.py b/openfl/plugins/frameworks_adapters/pytorch_adapter.py index a4b33fd73f4..60a6db54f47 100644 --- a/openfl/plugins/frameworks_adapters/pytorch_adapter.py +++ b/openfl/plugins/frameworks_adapters/pytorch_adapter.py @@ -3,6 +3,7 @@ """Pytorch Framework Adapter plugin.""" + from copy import deepcopy import numpy as np diff --git a/openfl/protocols/interceptors.py b/openfl/protocols/interceptors.py index 3549529da69..e6a9b57b3f0 100644 --- a/openfl/protocols/interceptors.py +++ b/openfl/protocols/interceptors.py @@ -3,6 +3,7 @@ """gRPC interceptors module.""" + import collections import grpc diff --git a/openfl/utilities/ca.py b/openfl/utilities/ca.py index ddedef10160..d522d541cd8 100644 --- a/openfl/utilities/ca.py +++ b/openfl/utilities/ca.py @@ -3,6 +3,7 @@ """Generic check functions.""" + import os diff --git a/openfl/utilities/ca/ca.py b/openfl/utilities/ca/ca.py index acf3a50e013..e75d68c4917 100644 --- a/openfl/utilities/ca/ca.py +++ b/openfl/utilities/ca/ca.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 """CA module.""" + import base64 import json import os diff --git a/openfl/utilities/data_splitters/__init__.py b/openfl/utilities/data_splitters/__init__.py index 5322f461886..fdf28bb45d9 100644 --- a/openfl/utilities/data_splitters/__init__.py +++ b/openfl/utilities/data_splitters/__init__.py @@ -3,6 +3,7 @@ """openfl.utilities.data package.""" + from openfl.utilities.data_splitters.data_splitter import DataSplitter from openfl.utilities.data_splitters.numpy import ( DirichletNumPyDataSplitter, diff --git a/openfl/utilities/data_splitters/data_splitter.py b/openfl/utilities/data_splitters/data_splitter.py index 19333be59a2..216607eb3db 100644 --- a/openfl/utilities/data_splitters/data_splitter.py +++ b/openfl/utilities/data_splitters/data_splitter.py @@ -3,6 +3,7 @@ """openfl.utilities.data_splitters.data_splitter module.""" + from abc import ABC, abstractmethod from typing import Iterable, List, TypeVar diff --git a/openfl/utilities/optimizers/keras/fedprox.py b/openfl/utilities/optimizers/keras/fedprox.py index ef1634d77c2..2e87648c20d 100644 --- a/openfl/utilities/optimizers/keras/fedprox.py +++ b/openfl/utilities/optimizers/keras/fedprox.py @@ -3,6 +3,7 @@ """FedProx Keras optimizer module.""" + import tensorflow as tf import tensorflow.keras as keras from tensorflow.python.ops import standard_ops diff --git a/openfl/utilities/optimizers/numpy/base_optimizer.py b/openfl/utilities/optimizers/numpy/base_optimizer.py index d748727dea2..bbbae93ce48 100644 --- a/openfl/utilities/optimizers/numpy/base_optimizer.py +++ b/openfl/utilities/optimizers/numpy/base_optimizer.py @@ -3,6 +3,7 @@ """Base abstract optimizer class module.""" + import abc from importlib import import_module from os.path import splitext diff --git a/openfl/utilities/optimizers/torch/__init__.py b/openfl/utilities/optimizers/torch/__init__.py index 77e989cdd40..7b595b3d7a6 100644 --- a/openfl/utilities/optimizers/torch/__init__.py +++ b/openfl/utilities/optimizers/torch/__init__.py @@ -3,6 +3,7 @@ """PyTorch optimizers package.""" + from importlib import util if util.find_spec("torch") is not None: diff --git a/openfl/utilities/workspace.py b/openfl/utilities/workspace.py index e88f431625d..e19b03cf163 100644 --- a/openfl/utilities/workspace.py +++ b/openfl/utilities/workspace.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 """Workspace utils module.""" + import logging import os import shutil