diff --git a/custom_model_runner/datarobot_drum/drum/adapters/cli/drum_fit_adapter.py b/custom_model_runner/datarobot_drum/drum/adapters/cli/drum_fit_adapter.py index 399e52565..b3d7976d9 100644 --- a/custom_model_runner/datarobot_drum/drum/adapters/cli/drum_fit_adapter.py +++ b/custom_model_runner/datarobot_drum/drum/adapters/cli/drum_fit_adapter.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import json import logging import shutil diff --git a/custom_model_runner/datarobot_drum/drum/adapters/cli/drum_score_adapter.py b/custom_model_runner/datarobot_drum/drum/adapters/cli/drum_score_adapter.py index 55a6869b2..f1ee6bd73 100644 --- a/custom_model_runner/datarobot_drum/drum/adapters/cli/drum_score_adapter.py +++ b/custom_model_runner/datarobot_drum/drum/adapters/cli/drum_score_adapter.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging from datarobot_drum.drum.adapters.cli.shared.drum_class_label_adapter import DrumClassLabelAdapter diff --git a/custom_model_runner/datarobot_drum/drum/adapters/cli/shared/drum_class_label_adapter.py b/custom_model_runner/datarobot_drum/drum/adapters/cli/shared/drum_class_label_adapter.py index b7e39bade..680701c23 100644 --- a/custom_model_runner/datarobot_drum/drum/adapters/cli/shared/drum_class_label_adapter.py +++ b/custom_model_runner/datarobot_drum/drum/adapters/cli/shared/drum_class_label_adapter.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging import sys diff --git a/custom_model_runner/datarobot_drum/drum/adapters/cli/shared/drum_input_file_adapter.py b/custom_model_runner/datarobot_drum/drum/adapters/cli/shared/drum_input_file_adapter.py index 2fc933af3..325361f7e 100644 --- a/custom_model_runner/datarobot_drum/drum/adapters/cli/shared/drum_input_file_adapter.py +++ b/custom_model_runner/datarobot_drum/drum/adapters/cli/shared/drum_input_file_adapter.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging import sys from typing import Optional diff --git a/custom_model_runner/datarobot_drum/drum/adapters/model_adapters/python_model_adapter.py b/custom_model_runner/datarobot_drum/drum/adapters/model_adapters/python_model_adapter.py index bbdfcf7e8..f584500b8 100644 --- a/custom_model_runner/datarobot_drum/drum/adapters/model_adapters/python_model_adapter.py +++ b/custom_model_runner/datarobot_drum/drum/adapters/model_adapters/python_model_adapter.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging import os import sys @@ -440,9 +441,9 @@ def supported_payload_formats(self): def model_info(self): return { - ModelInfoKeys.PREDICTOR: None - if self._predictor_to_use is None - else self._predictor_to_use.name, + ModelInfoKeys.PREDICTOR: ( + None if self._predictor_to_use is None else self._predictor_to_use.name + ), } def load_data(self, binary_data, mimetype, try_hook=True, sparse_colnames=None): diff --git a/custom_model_runner/datarobot_drum/drum/adapters/model_adapters/r_model_adapter.py b/custom_model_runner/datarobot_drum/drum/adapters/model_adapters/r_model_adapter.py index db77bd9dc..520d62bb2 100644 --- a/custom_model_runner/datarobot_drum/drum/adapters/model_adapters/r_model_adapter.py +++ b/custom_model_runner/datarobot_drum/drum/adapters/model_adapters/r_model_adapter.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging import os from typing import Optional diff --git a/custom_model_runner/datarobot_drum/drum/args_parser.py b/custom_model_runner/datarobot_drum/drum/args_parser.py index a0001e665..9951d5e7e 100644 --- a/custom_model_runner/datarobot_drum/drum/args_parser.py +++ b/custom_model_runner/datarobot_drum/drum/args_parser.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import argparse import os import subprocess diff --git a/custom_model_runner/datarobot_drum/drum/artifact_predictors/artifact_predictor.py b/custom_model_runner/datarobot_drum/drum/artifact_predictors/artifact_predictor.py index 7baf32827..5402f19ca 100644 --- a/custom_model_runner/datarobot_drum/drum/artifact_predictors/artifact_predictor.py +++ b/custom_model_runner/datarobot_drum/drum/artifact_predictors/artifact_predictor.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from abc import ABC, abstractmethod import logging from typing import Optional diff --git a/custom_model_runner/datarobot_drum/drum/artifact_predictors/sklearn_predictor.py b/custom_model_runner/datarobot_drum/drum/artifact_predictors/sklearn_predictor.py index 76aaf48d5..7f501b5c8 100644 --- a/custom_model_runner/datarobot_drum/drum/artifact_predictors/sklearn_predictor.py +++ b/custom_model_runner/datarobot_drum/drum/artifact_predictors/sklearn_predictor.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pickle from datarobot_drum.drum.artifact_predictors.artifact_predictor import ArtifactPredictor diff --git a/custom_model_runner/datarobot_drum/drum/artifact_predictors/torch_predictor.py b/custom_model_runner/datarobot_drum/drum/artifact_predictors/torch_predictor.py index b290cc3a6..7c420e4ea 100644 --- a/custom_model_runner/datarobot_drum/drum/artifact_predictors/torch_predictor.py +++ b/custom_model_runner/datarobot_drum/drum/artifact_predictors/torch_predictor.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import sys import numpy as np diff --git a/custom_model_runner/datarobot_drum/drum/artifact_predictors/xgboost_predictor.py b/custom_model_runner/datarobot_drum/drum/artifact_predictors/xgboost_predictor.py index bb8be3a45..d7f6606bb 100644 --- a/custom_model_runner/datarobot_drum/drum/artifact_predictors/xgboost_predictor.py +++ b/custom_model_runner/datarobot_drum/drum/artifact_predictors/xgboost_predictor.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pickle from datarobot_drum.drum.artifact_predictors.artifact_predictor import ArtifactPredictor diff --git a/custom_model_runner/datarobot_drum/drum/common.py b/custom_model_runner/datarobot_drum/drum/common.py index 17ebb47e6..5e41f054e 100644 --- a/custom_model_runner/datarobot_drum/drum/common.py +++ b/custom_model_runner/datarobot_drum/drum/common.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging import os import sys diff --git a/custom_model_runner/datarobot_drum/drum/data_marshalling.py b/custom_model_runner/datarobot_drum/drum/data_marshalling.py index 28748caa7..5986cf46b 100644 --- a/custom_model_runner/datarobot_drum/drum/data_marshalling.py +++ b/custom_model_runner/datarobot_drum/drum/data_marshalling.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging from distutils.util import strtobool from typing import Any, List, Optional, Union diff --git a/custom_model_runner/datarobot_drum/drum/description.py b/custom_model_runner/datarobot_drum/drum/description.py index de69953b6..cf5200355 100644 --- a/custom_model_runner/datarobot_drum/drum/description.py +++ b/custom_model_runner/datarobot_drum/drum/description.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + version = "1.10.20" __version__ = version project_name = "datarobot-drum" diff --git a/custom_model_runner/datarobot_drum/drum/drum.py b/custom_model_runner/datarobot_drum/drum/drum.py index 246adfbbf..6954eaee5 100644 --- a/custom_model_runner/datarobot_drum/drum/drum.py +++ b/custom_model_runner/datarobot_drum/drum/drum.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import copy import glob import json @@ -740,12 +741,16 @@ def _prepare_prediction_server_or_batch_pipeline(self, run_language): "triton_grpc_port": options.triton_grpc_port, "api_token": options.api_token, "allow_dr_api_access": options.allow_dr_api_access, - "query_params": '"{}"'.format(options.query) - if getattr(options, "query", None) is not None - else "null", - "content_type": '"{}"'.format(options.content_type) - if getattr(options, "content_type", None) is not None - else "null", + "query_params": ( + '"{}"'.format(options.query) + if getattr(options, "query", None) is not None + else "null" + ), + "content_type": ( + '"{}"'.format(options.content_type) + if getattr(options, "content_type", None) is not None + else "null" + ), "target_type": self.target_type.value, "user_secrets_mount_path": getattr(options, "user_secrets_mount_path", None), "user_secrets_prefix": getattr(options, "user_secrets_prefix", None), @@ -769,16 +774,18 @@ def _prepare_prediction_server_or_batch_pipeline(self, run_language): "port": port, "show_perf": str(options.show_perf).lower(), "engine_type": "RestModelServing" if options.production else "Generic", - "component_type": "uwsgi_serving" - if options.production - else "prediction_server", - "uwsgi_max_workers": options.max_workers - if getattr(options, "max_workers") - else "null", + "component_type": ( + "uwsgi_serving" if options.production else "prediction_server" + ), + "uwsgi_max_workers": ( + options.max_workers if getattr(options, "max_workers") else "null" + ), "single_uwsgi_worker": (options.max_workers == 1), - "deployment_config": '"{}"'.format(options.deployment_config) - if getattr(options, "deployment_config", None) is not None - else "null", + "deployment_config": ( + '"{}"'.format(options.deployment_config) + if getattr(options, "deployment_config", None) is not None + else "null" + ), } ) diff --git a/custom_model_runner/datarobot_drum/drum/enum.py b/custom_model_runner/datarobot_drum/drum/enum.py index 0afafb3e9..af6aea61a 100644 --- a/custom_model_runner/datarobot_drum/drum/enum.py +++ b/custom_model_runner/datarobot_drum/drum/enum.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging import os from enum import Enum diff --git a/custom_model_runner/datarobot_drum/drum/language_predictors/base_language_predictor.py b/custom_model_runner/datarobot_drum/drum/language_predictors/base_language_predictor.py index 386d8b1ad..e112021fe 100644 --- a/custom_model_runner/datarobot_drum/drum/language_predictors/base_language_predictor.py +++ b/custom_model_runner/datarobot_drum/drum/language_predictors/base_language_predictor.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging import os import time diff --git a/custom_model_runner/datarobot_drum/drum/language_predictors/java_predictor/java_predictor.py b/custom_model_runner/datarobot_drum/drum/language_predictors/java_predictor/java_predictor.py index dc343de57..19f425aaa 100644 --- a/custom_model_runner/datarobot_drum/drum/language_predictors/java_predictor/java_predictor.py +++ b/custom_model_runner/datarobot_drum/drum/language_predictors/java_predictor/java_predictor.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import glob import logging import os diff --git a/custom_model_runner/datarobot_drum/drum/language_predictors/julia_predictor/julia_predictor.py b/custom_model_runner/datarobot_drum/drum/language_predictors/julia_predictor/julia_predictor.py index 4c4ae4e77..467b317e1 100644 --- a/custom_model_runner/datarobot_drum/drum/language_predictors/julia_predictor/julia_predictor.py +++ b/custom_model_runner/datarobot_drum/drum/language_predictors/julia_predictor/julia_predictor.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging import os diff --git a/custom_model_runner/datarobot_drum/drum/language_predictors/python_predictor/python_predictor.py b/custom_model_runner/datarobot_drum/drum/language_predictors/python_predictor/python_predictor.py index b64fa3fba..0216d4dd7 100644 --- a/custom_model_runner/datarobot_drum/drum/language_predictors/python_predictor/python_predictor.py +++ b/custom_model_runner/datarobot_drum/drum/language_predictors/python_predictor/python_predictor.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging import tempfile import shutil diff --git a/custom_model_runner/datarobot_drum/drum/language_predictors/r_predictor/r_predictor.py b/custom_model_runner/datarobot_drum/drum/language_predictors/r_predictor/r_predictor.py index 79a0a2e16..1ed934aa0 100644 --- a/custom_model_runner/datarobot_drum/drum/language_predictors/r_predictor/r_predictor.py +++ b/custom_model_runner/datarobot_drum/drum/language_predictors/r_predictor/r_predictor.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging import os @@ -260,9 +261,11 @@ def _transform(self, **kwargs): with capture_R_traceback_if_errors(r_handler, logger): transformations = r_handler.outer_transform( binary_data=ro.vectors.ByteVector(input_binary_data), - target_binary_data=ro.NULL - if target_binary_data is None - else ro.vectors.ByteVector(target_binary_data), + target_binary_data=( + ro.NULL + if target_binary_data is None + else ro.vectors.ByteVector(target_binary_data) + ), mimetype=ro.NULL if mimetype is None else mimetype, transformer=self._model, sparse_colnames=self._get_sparse_colnames(kwargs), diff --git a/custom_model_runner/datarobot_drum/drum/language_predictors/triton_predictor/triton_predictor.py b/custom_model_runner/datarobot_drum/drum/language_predictors/triton_predictor/triton_predictor.py index 096e865d6..351181fa7 100644 --- a/custom_model_runner/datarobot_drum/drum/language_predictors/triton_predictor/triton_predictor.py +++ b/custom_model_runner/datarobot_drum/drum/language_predictors/triton_predictor/triton_predictor.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging import requests diff --git a/custom_model_runner/datarobot_drum/drum/model_metadata.py b/custom_model_runner/datarobot_drum/drum/model_metadata.py index 8633a2576..8dd145d72 100644 --- a/custom_model_runner/datarobot_drum/drum/model_metadata.py +++ b/custom_model_runner/datarobot_drum/drum/model_metadata.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import json import os import re diff --git a/custom_model_runner/datarobot_drum/drum/perf_testing.py b/custom_model_runner/datarobot_drum/drum/perf_testing.py index 435e77c2d..c9402cf36 100644 --- a/custom_model_runner/datarobot_drum/drum/perf_testing.py +++ b/custom_model_runner/datarobot_drum/drum/perf_testing.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import collections import json import os diff --git a/custom_model_runner/datarobot_drum/drum/push.py b/custom_model_runner/datarobot_drum/drum/push.py index eadc3123b..5dc0c5600 100644 --- a/custom_model_runner/datarobot_drum/drum/push.py +++ b/custom_model_runner/datarobot_drum/drum/push.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import os import re from pathlib import Path diff --git a/custom_model_runner/datarobot_drum/drum/resource_monitor.py b/custom_model_runner/datarobot_drum/drum/resource_monitor.py index 698c6668d..8134debdc 100644 --- a/custom_model_runner/datarobot_drum/drum/resource_monitor.py +++ b/custom_model_runner/datarobot_drum/drum/resource_monitor.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import os import psutil diff --git a/custom_model_runner/datarobot_drum/drum/runtime.py b/custom_model_runner/datarobot_drum/drum/runtime.py index a5484c084..dda31f9f8 100644 --- a/custom_model_runner/datarobot_drum/drum/runtime.py +++ b/custom_model_runner/datarobot_drum/drum/runtime.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging from datarobot_drum.drum.server import ( empty_api_blueprint, diff --git a/custom_model_runner/datarobot_drum/drum/server.py b/custom_model_runner/datarobot_drum/drum/server.py index ad9b31dca..450379474 100644 --- a/custom_model_runner/datarobot_drum/drum/server.py +++ b/custom_model_runner/datarobot_drum/drum/server.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from flask import Flask, Blueprint import os diff --git a/custom_model_runner/datarobot_drum/drum/templates_generator.py b/custom_model_runner/datarobot_drum/drum/templates_generator.py index 5f8d84c5c..f1422d62c 100644 --- a/custom_model_runner/datarobot_drum/drum/templates_generator.py +++ b/custom_model_runner/datarobot_drum/drum/templates_generator.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import os import logging import time diff --git a/custom_model_runner/datarobot_drum/drum/typeschema_validation.py b/custom_model_runner/datarobot_drum/drum/typeschema_validation.py index 6fcbe89a3..062ad22fd 100644 --- a/custom_model_runner/datarobot_drum/drum/typeschema_validation.py +++ b/custom_model_runner/datarobot_drum/drum/typeschema_validation.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import numbers import sys from abc import ABC, abstractmethod diff --git a/custom_model_runner/datarobot_drum/drum/utils/dataframe.py b/custom_model_runner/datarobot_drum/drum/utils/dataframe.py index 33858d6c6..e2dcf646a 100644 --- a/custom_model_runner/datarobot_drum/drum/utils/dataframe.py +++ b/custom_model_runner/datarobot_drum/drum/utils/dataframe.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from typing import List, Tuple, Optional, Union import numpy as np diff --git a/custom_model_runner/datarobot_drum/drum/utils/drum_utils.py b/custom_model_runner/datarobot_drum/drum/utils/drum_utils.py index 588eb066e..eba1bb9b2 100644 --- a/custom_model_runner/datarobot_drum/drum/utils/drum_utils.py +++ b/custom_model_runner/datarobot_drum/drum/utils/drum_utils.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import glob import json import logging diff --git a/custom_model_runner/datarobot_drum/drum/utils/stacktraces.py b/custom_model_runner/datarobot_drum/drum/utils/stacktraces.py index 8a97c65d3..a98d11595 100644 --- a/custom_model_runner/datarobot_drum/drum/utils/stacktraces.py +++ b/custom_model_runner/datarobot_drum/drum/utils/stacktraces.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging from contextlib import contextmanager diff --git a/custom_model_runner/datarobot_drum/drum/utils/structured_input_read_utils.py b/custom_model_runner/datarobot_drum/drum/utils/structured_input_read_utils.py index c6d7a93e8..9c153d49f 100644 --- a/custom_model_runner/datarobot_drum/drum/utils/structured_input_read_utils.py +++ b/custom_model_runner/datarobot_drum/drum/utils/structured_input_read_utils.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import io import logging import os diff --git a/custom_model_runner/datarobot_drum/profiler/stats_collector.py b/custom_model_runner/datarobot_drum/profiler/stats_collector.py index ff0a6c423..f065aa43b 100644 --- a/custom_model_runner/datarobot_drum/profiler/stats_collector.py +++ b/custom_model_runner/datarobot_drum/profiler/stats_collector.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pandas as pd import time diff --git a/custom_model_runner/datarobot_drum/resource/components/Python/generic_predictor/generic_predictor.py b/custom_model_runner/datarobot_drum/resource/components/Python/generic_predictor/generic_predictor.py index 376eb3c5d..0c4af9341 100644 --- a/custom_model_runner/datarobot_drum/resource/components/Python/generic_predictor/generic_predictor.py +++ b/custom_model_runner/datarobot_drum/resource/components/Python/generic_predictor/generic_predictor.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging import urllib from typing import Optional diff --git a/custom_model_runner/datarobot_drum/resource/components/Python/prediction_server/prediction_server.py b/custom_model_runner/datarobot_drum/resource/components/Python/prediction_server/prediction_server.py index 33f9c75bd..4f6f769e0 100644 --- a/custom_model_runner/datarobot_drum/resource/components/Python/prediction_server/prediction_server.py +++ b/custom_model_runner/datarobot_drum/resource/components/Python/prediction_server/prediction_server.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging import sys from pathlib import Path diff --git a/custom_model_runner/datarobot_drum/resource/components/Python/uwsgi_component/uwsgi_serving.py b/custom_model_runner/datarobot_drum/resource/components/Python/uwsgi_component/uwsgi_serving.py index e818198dc..31a9df3f1 100644 --- a/custom_model_runner/datarobot_drum/resource/components/Python/uwsgi_component/uwsgi_serving.py +++ b/custom_model_runner/datarobot_drum/resource/components/Python/uwsgi_component/uwsgi_serving.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging import os import sys diff --git a/custom_model_runner/datarobot_drum/resource/deployment_config_helpers.py b/custom_model_runner/datarobot_drum/resource/deployment_config_helpers.py index fddc15437..ca4eeacf1 100644 --- a/custom_model_runner/datarobot_drum/resource/deployment_config_helpers.py +++ b/custom_model_runner/datarobot_drum/resource/deployment_config_helpers.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import json from datarobot_drum.drum.exceptions import DrumCommonException diff --git a/custom_model_runner/datarobot_drum/resource/drum_server_utils.py b/custom_model_runner/datarobot_drum/resource/drum_server_utils.py index 032836449..3a2fe5f25 100644 --- a/custom_model_runner/datarobot_drum/resource/drum_server_utils.py +++ b/custom_model_runner/datarobot_drum/resource/drum_server_utils.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging import os from typing import Optional diff --git a/custom_model_runner/datarobot_drum/resource/predict_mixin.py b/custom_model_runner/datarobot_drum/resource/predict_mixin.py index 172b0ccc3..2d3c2622c 100644 --- a/custom_model_runner/datarobot_drum/resource/predict_mixin.py +++ b/custom_model_runner/datarobot_drum/resource/predict_mixin.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import werkzeug from flask import request, Response from requests_toolbelt import MultipartEncoder diff --git a/custom_model_runner/datarobot_drum/resource/transform_helpers.py b/custom_model_runner/datarobot_drum/resource/transform_helpers.py index 3c1ea3d1f..d15a707b0 100644 --- a/custom_model_runner/datarobot_drum/resource/transform_helpers.py +++ b/custom_model_runner/datarobot_drum/resource/transform_helpers.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pandas as pd import logging diff --git a/custom_model_runner/datarobot_drum/resource/unstructured_helpers.py b/custom_model_runner/datarobot_drum/resource/unstructured_helpers.py index 1030e8b72..29eee71c3 100644 --- a/custom_model_runner/datarobot_drum/resource/unstructured_helpers.py +++ b/custom_model_runner/datarobot_drum/resource/unstructured_helpers.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from datarobot_drum.drum.exceptions import DrumCommonException from datarobot_drum.drum.enum import UnstructuredDtoKeys, PredictionServerMimetypes diff --git a/custom_model_runner/datarobot_drum/resource/utils.py b/custom_model_runner/datarobot_drum/resource/utils.py index ef33930a7..16bb9473b 100644 --- a/custom_model_runner/datarobot_drum/resource/utils.py +++ b/custom_model_runner/datarobot_drum/resource/utils.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import os import glob import shutil diff --git a/custom_model_runner/datarobot_drum/runtime_parameters/runtime_parameters.py b/custom_model_runner/datarobot_drum/runtime_parameters/runtime_parameters.py index 973a01c49..d4e115377 100644 --- a/custom_model_runner/datarobot_drum/runtime_parameters/runtime_parameters.py +++ b/custom_model_runner/datarobot_drum/runtime_parameters/runtime_parameters.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import json import os from collections import namedtuple diff --git a/custom_model_runner/datarobot_drum/runtime_parameters/runtime_parameters_schema.py b/custom_model_runner/datarobot_drum/runtime_parameters/runtime_parameters_schema.py index 6debf3537..bfc78ae2e 100644 --- a/custom_model_runner/datarobot_drum/runtime_parameters/runtime_parameters_schema.py +++ b/custom_model_runner/datarobot_drum/runtime_parameters/runtime_parameters_schema.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from enum import Enum import trafaret as t diff --git a/custom_model_runner/setup.py b/custom_model_runner/setup.py index 567916dba..9dd65b978 100644 --- a/custom_model_runner/setup.py +++ b/custom_model_runner/setup.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from pathlib import Path from setuptools import setup, find_packages diff --git a/model_templates/flask_extension_httpauth/custom.py b/model_templates/flask_extension_httpauth/custom.py index 77e4d5978..4bf3e01d9 100644 --- a/model_templates/flask_extension_httpauth/custom.py +++ b/model_templates/flask_extension_httpauth/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pandas as pd diff --git a/model_templates/flask_extension_httpauth/custom_flask.py b/model_templates/flask_extension_httpauth/custom_flask.py index 8f418a198..24dbe5ced 100644 --- a/model_templates/flask_extension_httpauth/custom_flask.py +++ b/model_templates/flask_extension_httpauth/custom_flask.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging from flask import request diff --git a/model_templates/proxy_model_azureml/custom.py b/model_templates/proxy_model_azureml/custom.py index 334130c42..5e28ba112 100644 --- a/model_templates/proxy_model_azureml/custom.py +++ b/model_templates/proxy_model_azureml/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import json import logging import ssl diff --git a/model_templates/proxy_model_datarobot/custom.py b/model_templates/proxy_model_datarobot/custom.py index fb313bd9f..c11bddf31 100644 --- a/model_templates/proxy_model_datarobot/custom.py +++ b/model_templates/proxy_model_datarobot/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import logging import pandas as pd diff --git a/model_templates/python3_keras_joblib/custom.py b/model_templates/python3_keras_joblib/custom.py index 8e9fe3bf9..4a551cfcc 100644 --- a/model_templates/python3_keras_joblib/custom.py +++ b/model_templates/python3_keras_joblib/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from model_deserializer import deserialize_estimator_pipeline from sklearn.pipeline import Pipeline diff --git a/model_templates/python3_keras_joblib/model_deserializer.py b/model_templates/python3_keras_joblib/model_deserializer.py index 4f2e9e612..9551008ff 100644 --- a/model_templates/python3_keras_joblib/model_deserializer.py +++ b/model_templates/python3_keras_joblib/model_deserializer.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from tensorflow.keras.models import load_model from sklearn.pipeline import Pipeline import joblib diff --git a/model_templates/python3_keras_vizai_joblib/custom.py b/model_templates/python3_keras_vizai_joblib/custom.py index 758f761c8..409190088 100644 --- a/model_templates/python3_keras_vizai_joblib/custom.py +++ b/model_templates/python3_keras_vizai_joblib/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from sklearn.pipeline import Pipeline from model_utils import deserialize_estimator_pipeline, get_imputation_img diff --git a/model_templates/python3_keras_vizai_joblib/model_utils.py b/model_templates/python3_keras_vizai_joblib/model_utils.py index c8af1df59..232ce73b5 100644 --- a/model_templates/python3_keras_vizai_joblib/model_utils.py +++ b/model_templates/python3_keras_vizai_joblib/model_utils.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + # keras imports from tensorflow.keras.models import load_model, Model from tensorflow.keras.applications.mobilenet_v2 import preprocess_input diff --git a/model_templates/python3_onnx_anomaly/custom.py b/model_templates/python3_onnx_anomaly/custom.py index 7cafd02e5..a89436b28 100644 --- a/model_templates/python3_onnx_anomaly/custom.py +++ b/model_templates/python3_onnx_anomaly/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pandas as pd diff --git a/model_templates/python3_onnx_binary/custom.py b/model_templates/python3_onnx_binary/custom.py index 40e39eb33..92444a0f3 100644 --- a/model_templates/python3_onnx_binary/custom.py +++ b/model_templates/python3_onnx_binary/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + """ In this example we show a complex pipeline with a binary linear model. """ diff --git a/model_templates/python3_onnx_multiclass/custom.py b/model_templates/python3_onnx_multiclass/custom.py index 2ab5c74c1..54fdf4de6 100644 --- a/model_templates/python3_onnx_multiclass/custom.py +++ b/model_templates/python3_onnx_multiclass/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import os import pickle import pandas as pd diff --git a/model_templates/python3_onnx_multiclass/preprocessing.py b/model_templates/python3_onnx_multiclass/preprocessing.py index 5a9071640..e1c3eb8f4 100644 --- a/model_templates/python3_onnx_multiclass/preprocessing.py +++ b/model_templates/python3_onnx_multiclass/preprocessing.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import numpy as np import pandas as pd from sklearn.compose import ColumnTransformer, make_column_selector diff --git a/model_templates/python3_pmml/custom.py b/model_templates/python3_pmml/custom.py index 7500bd9b2..eef0b866d 100644 --- a/model_templates/python3_pmml/custom.py +++ b/model_templates/python3_pmml/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pandas as pd diff --git a/model_templates/python3_pytorch/PyTorch.py b/model_templates/python3_pytorch/PyTorch.py index 538002463..f34b23ea5 100644 --- a/model_templates/python3_pytorch/PyTorch.py +++ b/model_templates/python3_pytorch/PyTorch.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + #!/usr/bin/env python # coding: utf-8 diff --git a/model_templates/python3_pytorch_multiclass/model_utils.py b/model_templates/python3_pytorch_multiclass/model_utils.py index d427ceea1..d5d074a77 100644 --- a/model_templates/python3_pytorch_multiclass/model_utils.py +++ b/model_templates/python3_pytorch_multiclass/model_utils.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + #!/usr/bin/env python # coding: utf-8 diff --git a/model_templates/python3_pytorch_multiclass/preprocessing.py b/model_templates/python3_pytorch_multiclass/preprocessing.py index 5a9071640..e1c3eb8f4 100644 --- a/model_templates/python3_pytorch_multiclass/preprocessing.py +++ b/model_templates/python3_pytorch_multiclass/preprocessing.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import numpy as np import pandas as pd from sklearn.compose import ColumnTransformer, make_column_selector diff --git a/model_templates/python3_sklearn/custom.py b/model_templates/python3_sklearn/custom.py index 77e4d5978..4bf3e01d9 100644 --- a/model_templates/python3_sklearn/custom.py +++ b/model_templates/python3_sklearn/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pandas as pd diff --git a/model_templates/python3_sklearn_anomaly/custom.py b/model_templates/python3_sklearn_anomaly/custom.py index b055c5065..53d18f8eb 100644 --- a/model_templates/python3_sklearn_anomaly/custom.py +++ b/model_templates/python3_sklearn_anomaly/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from typing import List, Optional import pickle import pandas as pd diff --git a/model_templates/python3_sklearn_runtime_params/custom.py b/model_templates/python3_sklearn_runtime_params/custom.py index 36e06c032..3c49bb00c 100644 --- a/model_templates/python3_sklearn_runtime_params/custom.py +++ b/model_templates/python3_sklearn_runtime_params/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + # Use this helper class to access the runtime parameter values in your model from datarobot_drum import RuntimeParameters diff --git a/model_templates/python_multi_codejen_reg_class/custom.py b/model_templates/python_multi_codejen_reg_class/custom.py index 50638868d..44f146315 100644 --- a/model_templates/python_multi_codejen_reg_class/custom.py +++ b/model_templates/python_multi_codejen_reg_class/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from datarobot_drum.drum.language_predictors.java_predictor.java_predictor import JavaPredictor diff --git a/model_templates/python_multiple_codegen/custom.py b/model_templates/python_multiple_codegen/custom.py index c06232072..47dbc08a4 100644 --- a/model_templates/python_multiple_codegen/custom.py +++ b/model_templates/python_multiple_codegen/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from datarobot_drum.drum.language_predictors.java_predictor.java_predictor import JavaPredictor diff --git a/public_dropin_gpu_environments/triton_server/proto/src/triton_model_config/model_config_pb2.py b/public_dropin_gpu_environments/triton_server/proto/src/triton_model_config/model_config_pb2.py index 815f72a73..a3dafc33b 100644 --- a/public_dropin_gpu_environments/triton_server/proto/src/triton_model_config/model_config_pb2.py +++ b/public_dropin_gpu_environments/triton_server/proto/src/triton_model_config/model_config_pb2.py @@ -100,9 +100,9 @@ _globals["_MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_SHAPE"]._serialized_end = 2929 _globals["_MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND"]._serialized_start = 2932 _globals["_MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND"]._serialized_end = 3155 - _globals[ - "_MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND_INPUTENTRY" - ]._serialized_start = 3054 + _globals["_MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND_INPUTENTRY"]._serialized_start = ( + 3054 + ) _globals["_MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND_INPUTENTRY"]._serialized_end = 3155 _globals["_MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_INPUTENTRY"]._serialized_start = 3054 _globals["_MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_INPUTENTRY"]._serialized_end = 3155 diff --git a/public_dropin_notebook_environments/python311_notebook/extensions/dataframe_formatter.py b/public_dropin_notebook_environments/python311_notebook/extensions/dataframe_formatter.py index c76837929..4d8a90db6 100644 --- a/public_dropin_notebook_environments/python311_notebook/extensions/dataframe_formatter.py +++ b/public_dropin_notebook_environments/python311_notebook/extensions/dataframe_formatter.py @@ -319,9 +319,9 @@ def _check_return(self, r: Any, obj: Any) -> Any: # Load our extension into ipython kernel def load_ipython_extension(ipython: Magics) -> None: if is_pandas_loaded: - ipython.display_formatter.formatters[ - "application/vnd.dataframe+json" - ] = DataFrameFormatter() + ipython.display_formatter.formatters["application/vnd.dataframe+json"] = ( + DataFrameFormatter() + ) dataframe_json_formatter = ipython.display_formatter.formatters[ "application/vnd.dataframe+json" ] diff --git a/public_dropin_notebook_environments/python38_snowflake_notebook/extensions/dataframe_formatter.py b/public_dropin_notebook_environments/python38_snowflake_notebook/extensions/dataframe_formatter.py index c76837929..4d8a90db6 100644 --- a/public_dropin_notebook_environments/python38_snowflake_notebook/extensions/dataframe_formatter.py +++ b/public_dropin_notebook_environments/python38_snowflake_notebook/extensions/dataframe_formatter.py @@ -319,9 +319,9 @@ def _check_return(self, r: Any, obj: Any) -> Any: # Load our extension into ipython kernel def load_ipython_extension(ipython: Magics) -> None: if is_pandas_loaded: - ipython.display_formatter.formatters[ - "application/vnd.dataframe+json" - ] = DataFrameFormatter() + ipython.display_formatter.formatters["application/vnd.dataframe+json"] = ( + DataFrameFormatter() + ) dataframe_json_formatter = ipython.display_formatter.formatters[ "application/vnd.dataframe+json" ] diff --git a/public_dropin_notebook_environments/python39_notebook/extensions/dataframe_formatter.py b/public_dropin_notebook_environments/python39_notebook/extensions/dataframe_formatter.py index c76837929..4d8a90db6 100644 --- a/public_dropin_notebook_environments/python39_notebook/extensions/dataframe_formatter.py +++ b/public_dropin_notebook_environments/python39_notebook/extensions/dataframe_formatter.py @@ -319,9 +319,9 @@ def _check_return(self, r: Any, obj: Any) -> Any: # Load our extension into ipython kernel def load_ipython_extension(ipython: Magics) -> None: if is_pandas_loaded: - ipython.display_formatter.formatters[ - "application/vnd.dataframe+json" - ] = DataFrameFormatter() + ipython.display_formatter.formatters["application/vnd.dataframe+json"] = ( + DataFrameFormatter() + ) dataframe_json_formatter = ipython.display_formatter.formatters[ "application/vnd.dataframe+json" ] diff --git a/public_dropin_notebook_environments/python39_notebook_gpu/extensions/dataframe_formatter.py b/public_dropin_notebook_environments/python39_notebook_gpu/extensions/dataframe_formatter.py index c76837929..4d8a90db6 100644 --- a/public_dropin_notebook_environments/python39_notebook_gpu/extensions/dataframe_formatter.py +++ b/public_dropin_notebook_environments/python39_notebook_gpu/extensions/dataframe_formatter.py @@ -319,9 +319,9 @@ def _check_return(self, r: Any, obj: Any) -> Any: # Load our extension into ipython kernel def load_ipython_extension(ipython: Magics) -> None: if is_pandas_loaded: - ipython.display_formatter.formatters[ - "application/vnd.dataframe+json" - ] = DataFrameFormatter() + ipython.display_formatter.formatters["application/vnd.dataframe+json"] = ( + DataFrameFormatter() + ) dataframe_json_formatter = ipython.display_formatter.formatters[ "application/vnd.dataframe+json" ] diff --git a/public_dropin_notebook_environments/python39_notebook_gpu_tf/extensions/dataframe_formatter.py b/public_dropin_notebook_environments/python39_notebook_gpu_tf/extensions/dataframe_formatter.py index c76837929..4d8a90db6 100644 --- a/public_dropin_notebook_environments/python39_notebook_gpu_tf/extensions/dataframe_formatter.py +++ b/public_dropin_notebook_environments/python39_notebook_gpu_tf/extensions/dataframe_formatter.py @@ -319,9 +319,9 @@ def _check_return(self, r: Any, obj: Any) -> Any: # Load our extension into ipython kernel def load_ipython_extension(ipython: Magics) -> None: if is_pandas_loaded: - ipython.display_formatter.formatters[ - "application/vnd.dataframe+json" - ] = DataFrameFormatter() + ipython.display_formatter.formatters["application/vnd.dataframe+json"] = ( + DataFrameFormatter() + ) dataframe_json_formatter = ipython.display_formatter.formatters[ "application/vnd.dataframe+json" ] diff --git a/requirements_lint.txt b/requirements_lint.txt index d24a7dc4e..ce9e6abbc 100644 --- a/requirements_lint.txt +++ b/requirements_lint.txt @@ -1,3 +1,3 @@ -black==23.10.1 +black==24.3.0 pylint==3.1.0 click==8.1.7 diff --git a/task_templates/1_transforms/1_python_missing_values/custom.py b/task_templates/1_transforms/1_python_missing_values/custom.py index 5dd154b84..3e4b75f23 100644 --- a/task_templates/1_transforms/1_python_missing_values/custom.py +++ b/task_templates/1_transforms/1_python_missing_values/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + # This custom transform task implements missing values imputation using a median import pandas as pd diff --git a/task_templates/1_transforms/3_python3_sklearn_transform/create_transform_pipeline.py b/task_templates/1_transforms/3_python3_sklearn_transform/create_transform_pipeline.py index 31d8f3ed6..52f3c9cd1 100644 --- a/task_templates/1_transforms/3_python3_sklearn_transform/create_transform_pipeline.py +++ b/task_templates/1_transforms/3_python3_sklearn_transform/create_transform_pipeline.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import numpy as np from sklearn.compose import ColumnTransformer, make_column_selector from sklearn.decomposition import TruncatedSVD diff --git a/task_templates/1_transforms/3_python3_sklearn_transform/custom.py b/task_templates/1_transforms/3_python3_sklearn_transform/custom.py index cadde0929..648bc1b81 100644 --- a/task_templates/1_transforms/3_python3_sklearn_transform/custom.py +++ b/task_templates/1_transforms/3_python3_sklearn_transform/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pickle import pandas as pd from scipy.sparse.csr import csr_matrix diff --git a/task_templates/1_transforms/5_python3_image_transform/custom.py b/task_templates/1_transforms/5_python3_image_transform/custom.py index dd2715421..88ed184f2 100644 --- a/task_templates/1_transforms/5_python3_image_transform/custom.py +++ b/task_templates/1_transforms/5_python3_image_transform/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from typing import Union, Any import pandas as pd diff --git a/task_templates/1_transforms/5_python3_image_transform/img_utils.py b/task_templates/1_transforms/5_python3_image_transform/img_utils.py index a23cc37f4..0a5883c10 100644 --- a/task_templates/1_transforms/5_python3_image_transform/img_utils.py +++ b/task_templates/1_transforms/5_python3_image_transform/img_utils.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import base64 from io import BytesIO import numpy as np diff --git a/task_templates/1_transforms/6_python_bool_to_int_transform/custom.py b/task_templates/1_transforms/6_python_bool_to_int_transform/custom.py index 4c9b7eab5..b3e908fa5 100644 --- a/task_templates/1_transforms/6_python_bool_to_int_transform/custom.py +++ b/task_templates/1_transforms/6_python_bool_to_int_transform/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from typing import Any import numpy as np diff --git a/task_templates/2_estimators/11_python_huggingface_vit/img_utils.py b/task_templates/2_estimators/11_python_huggingface_vit/img_utils.py index a23cc37f4..0a5883c10 100644 --- a/task_templates/2_estimators/11_python_huggingface_vit/img_utils.py +++ b/task_templates/2_estimators/11_python_huggingface_vit/img_utils.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import base64 from io import BytesIO import numpy as np diff --git a/task_templates/2_estimators/12_python_pretrained/custom.py b/task_templates/2_estimators/12_python_pretrained/custom.py index f8da0a234..ccc482990 100644 --- a/task_templates/2_estimators/12_python_pretrained/custom.py +++ b/task_templates/2_estimators/12_python_pretrained/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from pathlib import Path import joblib diff --git a/task_templates/2_estimators/13_python_credentials_and_internet_access/custom.py b/task_templates/2_estimators/13_python_credentials_and_internet_access/custom.py index 29fc16a2a..223d3c3fd 100644 --- a/task_templates/2_estimators/13_python_credentials_and_internet_access/custom.py +++ b/task_templates/2_estimators/13_python_credentials_and_internet_access/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + # This import pandas as pd diff --git a/task_templates/2_estimators/1_python_regression/custom.py b/task_templates/2_estimators/1_python_regression/custom.py index 277a43b46..66d982382 100644 --- a/task_templates/2_estimators/1_python_regression/custom.py +++ b/task_templates/2_estimators/1_python_regression/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + # This custom estimator task implements a decision tree regressor import pandas as pd diff --git a/task_templates/2_estimators/4_python_binary_classification/custom.py b/task_templates/2_estimators/4_python_binary_classification/custom.py index 2999036ce..45f7e7084 100644 --- a/task_templates/2_estimators/4_python_binary_classification/custom.py +++ b/task_templates/2_estimators/4_python_binary_classification/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + # This custom estimator task implements a decision tree classifier import pandas as pd diff --git a/task_templates/2_estimators/6_python_multiclass_classification/custom.py b/task_templates/2_estimators/6_python_multiclass_classification/custom.py index 4eabd28ec..9f9ac20ac 100644 --- a/task_templates/2_estimators/6_python_multiclass_classification/custom.py +++ b/task_templates/2_estimators/6_python_multiclass_classification/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + # This custom estimator task implements a decision tree classifier import pandas as pd diff --git a/task_templates/2_estimators/7_python_anomaly/custom.py b/task_templates/2_estimators/7_python_anomaly/custom.py index f49234459..51b3d9592 100644 --- a/task_templates/2_estimators/7_python_anomaly/custom.py +++ b/task_templates/2_estimators/7_python_anomaly/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + # This custom estimator task implements anomaly detection using OneClassSVM import pandas as pd diff --git a/task_templates/2_estimators/9_python_calibrator/custom.py b/task_templates/2_estimators/9_python_calibrator/custom.py index 5d459b4f9..58afe39bb 100644 --- a/task_templates/2_estimators/9_python_calibrator/custom.py +++ b/task_templates/2_estimators/9_python_calibrator/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + # In some cases, avg(predictions) might not match avg(actuals) # This task, added as a calibrator in the end of a regression blueprint, can help to fix that # During fit(), it computes and stores the calibration coefficient that is equal to avg(actuals) / avg(predicted) on diff --git a/task_templates/3_pipelines/10_python3_sparse/custom.py b/task_templates/3_pipelines/10_python3_sparse/custom.py index 1b6f2f2b2..9c60e1d77 100644 --- a/task_templates/3_pipelines/10_python3_sparse/custom.py +++ b/task_templates/3_pipelines/10_python3_sparse/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + """ In this example we show how to implement a simple Ridge Regression that handles sparse input. Intended for binary classification diff --git a/task_templates/3_pipelines/11_python3_pytorch_regression/custom.py b/task_templates/3_pipelines/11_python3_pytorch_regression/custom.py index f723fd66d..29234ca4b 100644 --- a/task_templates/3_pipelines/11_python3_pytorch_regression/custom.py +++ b/task_templates/3_pipelines/11_python3_pytorch_regression/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + """ In this example we see how to create a regression neural net with pytorch """ diff --git a/task_templates/3_pipelines/11_python3_pytorch_regression/model_utils.py b/task_templates/3_pipelines/11_python3_pytorch_regression/model_utils.py index 21ab85356..aadb503c0 100644 --- a/task_templates/3_pipelines/11_python3_pytorch_regression/model_utils.py +++ b/task_templates/3_pipelines/11_python3_pytorch_regression/model_utils.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + #!/usr/bin/env python # coding: utf-8 diff --git a/task_templates/3_pipelines/12_python3_pytorch/custom.py b/task_templates/3_pipelines/12_python3_pytorch/custom.py index 4f7c626c7..a5bec4370 100644 --- a/task_templates/3_pipelines/12_python3_pytorch/custom.py +++ b/task_templates/3_pipelines/12_python3_pytorch/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + """ In this example we see how to create either a classification or regression model with pytorch """ diff --git a/task_templates/3_pipelines/12_python3_pytorch/model_utils.py b/task_templates/3_pipelines/12_python3_pytorch/model_utils.py index 7118da975..95b5518d0 100644 --- a/task_templates/3_pipelines/12_python3_pytorch/model_utils.py +++ b/task_templates/3_pipelines/12_python3_pytorch/model_utils.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + #!/usr/bin/env python # coding: utf-8 diff --git a/task_templates/3_pipelines/13_python3_pytorch_multiclass/custom.py b/task_templates/3_pipelines/13_python3_pytorch_multiclass/custom.py index e5da6c4af..63e10177e 100644 --- a/task_templates/3_pipelines/13_python3_pytorch_multiclass/custom.py +++ b/task_templates/3_pipelines/13_python3_pytorch_multiclass/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + """ In this example we see how to create a multiclass neural net with pytorch """ diff --git a/task_templates/3_pipelines/13_python3_pytorch_multiclass/model_utils.py b/task_templates/3_pipelines/13_python3_pytorch_multiclass/model_utils.py index d427ceea1..d5d074a77 100644 --- a/task_templates/3_pipelines/13_python3_pytorch_multiclass/model_utils.py +++ b/task_templates/3_pipelines/13_python3_pytorch_multiclass/model_utils.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + #!/usr/bin/env python # coding: utf-8 diff --git a/task_templates/3_pipelines/13_python3_pytorch_multiclass/preprocessing.py b/task_templates/3_pipelines/13_python3_pytorch_multiclass/preprocessing.py index 5a9071640..e1c3eb8f4 100644 --- a/task_templates/3_pipelines/13_python3_pytorch_multiclass/preprocessing.py +++ b/task_templates/3_pipelines/13_python3_pytorch_multiclass/preprocessing.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import numpy as np import pandas as pd from sklearn.compose import ColumnTransformer, make_column_selector diff --git a/task_templates/3_pipelines/14_python3_keras_joblib/custom.py b/task_templates/3_pipelines/14_python3_keras_joblib/custom.py index ed724b315..6376fcfa5 100644 --- a/task_templates/3_pipelines/14_python3_keras_joblib/custom.py +++ b/task_templates/3_pipelines/14_python3_keras_joblib/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + """ In this example we show how to create a Pytorch regression or classifiction model """ diff --git a/task_templates/3_pipelines/14_python3_keras_joblib/example_code.py b/task_templates/3_pipelines/14_python3_keras_joblib/example_code.py index 891c36593..6af326bc4 100644 --- a/task_templates/3_pipelines/14_python3_keras_joblib/example_code.py +++ b/task_templates/3_pipelines/14_python3_keras_joblib/example_code.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Dropout from tensorflow.keras.callbacks import EarlyStopping diff --git a/task_templates/3_pipelines/15_python3_keras_vizai_joblib/custom.py b/task_templates/3_pipelines/15_python3_keras_vizai_joblib/custom.py index d33837a12..5ba11a798 100644 --- a/task_templates/3_pipelines/15_python3_keras_vizai_joblib/custom.py +++ b/task_templates/3_pipelines/15_python3_keras_vizai_joblib/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + """ In this example we show how flexible pipelines can be by creating a computer vision pipeline and classifier. Note how we use load_model and a custom deserialize diff --git a/task_templates/3_pipelines/15_python3_keras_vizai_joblib/model_utils.py b/task_templates/3_pipelines/15_python3_keras_vizai_joblib/model_utils.py index 1b3889ef8..a23f5d5a8 100644 --- a/task_templates/3_pipelines/15_python3_keras_vizai_joblib/model_utils.py +++ b/task_templates/3_pipelines/15_python3_keras_vizai_joblib/model_utils.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from typing import Tuple # keras imports diff --git a/task_templates/3_pipelines/2_python3_sklearn_regression/create_pipeline.py b/task_templates/3_pipelines/2_python3_sklearn_regression/create_pipeline.py index 30be09eb8..287b302cc 100644 --- a/task_templates/3_pipelines/2_python3_sklearn_regression/create_pipeline.py +++ b/task_templates/3_pipelines/2_python3_sklearn_regression/create_pipeline.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import numpy as np from sklearn.compose import ColumnTransformer, make_column_selector from sklearn.decomposition import TruncatedSVD diff --git a/task_templates/3_pipelines/2_python3_sklearn_regression/custom.py b/task_templates/3_pipelines/2_python3_sklearn_regression/custom.py index 1a141683c..499ff1c41 100644 --- a/task_templates/3_pipelines/2_python3_sklearn_regression/custom.py +++ b/task_templates/3_pipelines/2_python3_sklearn_regression/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + """ This shows how we handle regression using an sklearn pipeline """ diff --git a/task_templates/3_pipelines/4_python3_xgboost/create_pipeline.py b/task_templates/3_pipelines/4_python3_xgboost/create_pipeline.py index ec05f4b1d..bcff8decb 100644 --- a/task_templates/3_pipelines/4_python3_xgboost/create_pipeline.py +++ b/task_templates/3_pipelines/4_python3_xgboost/create_pipeline.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + """ This is a helper file for the custom.py main file which actually creates the pipeline, which consists of data preprocessing steps and an XGBoost model diff --git a/task_templates/3_pipelines/4_python3_xgboost/custom.py b/task_templates/3_pipelines/4_python3_xgboost/custom.py index 2e558b9f5..4cb001f8c 100644 --- a/task_templates/3_pipelines/4_python3_xgboost/custom.py +++ b/task_templates/3_pipelines/4_python3_xgboost/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + """ In this example we show how to implement a simple XGBoost classifier (binary and multiclass) or regressor (see IF conditional in fit hook and commented out code in score) diff --git a/task_templates/3_pipelines/5_python3_sklearn_binary/create_pipeline.py b/task_templates/3_pipelines/5_python3_sklearn_binary/create_pipeline.py index 0a5f18f81..331c61d65 100644 --- a/task_templates/3_pipelines/5_python3_sklearn_binary/create_pipeline.py +++ b/task_templates/3_pipelines/5_python3_sklearn_binary/create_pipeline.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import numpy as np from sklearn.compose import ColumnTransformer, make_column_selector from sklearn.decomposition import TruncatedSVD diff --git a/task_templates/3_pipelines/5_python3_sklearn_binary/custom.py b/task_templates/3_pipelines/5_python3_sklearn_binary/custom.py index d75c9021c..f6a854fe9 100644 --- a/task_templates/3_pipelines/5_python3_sklearn_binary/custom.py +++ b/task_templates/3_pipelines/5_python3_sklearn_binary/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + """ In this example we show a complex pipeline with a binary linear model. """ diff --git a/task_templates/3_pipelines/6_python3_sklearn_multiclass/create_pipeline.py b/task_templates/3_pipelines/6_python3_sklearn_multiclass/create_pipeline.py index a4e6a65ed..b3cdf5c8c 100644 --- a/task_templates/3_pipelines/6_python3_sklearn_multiclass/create_pipeline.py +++ b/task_templates/3_pipelines/6_python3_sklearn_multiclass/create_pipeline.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import numpy as np import pandas as pd from sklearn.compose import ColumnTransformer, make_column_selector diff --git a/task_templates/3_pipelines/6_python3_sklearn_multiclass/custom.py b/task_templates/3_pipelines/6_python3_sklearn_multiclass/custom.py index 5e6b2471f..3caf5f2a8 100644 --- a/task_templates/3_pipelines/6_python3_sklearn_multiclass/custom.py +++ b/task_templates/3_pipelines/6_python3_sklearn_multiclass/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + """ In this example we show a complex pipeline with a multiclass linear model. Note in the score hook how we grab the class labels. Contrast this with the regression and binary examples diff --git a/task_templates/3_pipelines/7_python3_anomaly_detection/build_pipeline.py b/task_templates/3_pipelines/7_python3_anomaly_detection/build_pipeline.py index 00f7b92b2..5fb0b66fb 100644 --- a/task_templates/3_pipelines/7_python3_anomaly_detection/build_pipeline.py +++ b/task_templates/3_pipelines/7_python3_anomaly_detection/build_pipeline.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import numpy as np import pandas as pd diff --git a/task_templates/3_pipelines/7_python3_anomaly_detection/custom.py b/task_templates/3_pipelines/7_python3_anomaly_detection/custom.py index bb9169a0a..e8a99d5af 100644 --- a/task_templates/3_pipelines/7_python3_anomaly_detection/custom.py +++ b/task_templates/3_pipelines/7_python3_anomaly_detection/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + """ In this example we see how to create an anomaly detection (i.e. unsupervised) pipeline """ diff --git a/task_templates/3_pipelines/8_python3_calibrated_anomaly_detection/anomaly_helpers.py b/task_templates/3_pipelines/8_python3_calibrated_anomaly_detection/anomaly_helpers.py index cc7a55e55..42c20b6e0 100644 --- a/task_templates/3_pipelines/8_python3_calibrated_anomaly_detection/anomaly_helpers.py +++ b/task_templates/3_pipelines/8_python3_calibrated_anomaly_detection/anomaly_helpers.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import numpy as np from sklearn.base import BaseEstimator diff --git a/task_templates/3_pipelines/8_python3_calibrated_anomaly_detection/build_pipeline.py b/task_templates/3_pipelines/8_python3_calibrated_anomaly_detection/build_pipeline.py index ef8e294d1..1991e59a0 100644 --- a/task_templates/3_pipelines/8_python3_calibrated_anomaly_detection/build_pipeline.py +++ b/task_templates/3_pipelines/8_python3_calibrated_anomaly_detection/build_pipeline.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import numpy as np from sklearn.pipeline import Pipeline diff --git a/task_templates/3_pipelines/8_python3_calibrated_anomaly_detection/custom.py b/task_templates/3_pipelines/8_python3_calibrated_anomaly_detection/custom.py index 3663f9357..f0e24c68c 100644 --- a/task_templates/3_pipelines/8_python3_calibrated_anomaly_detection/custom.py +++ b/task_templates/3_pipelines/8_python3_calibrated_anomaly_detection/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + """ In this example we show how to create an unsupervised anomaly detection model with calibrated predictions diff --git a/task_templates/3_pipelines/9_python3_sklearn_with_custom_classes/custom.py b/task_templates/3_pipelines/9_python3_sklearn_with_custom_classes/custom.py index c6deeae75..36fe6cf83 100644 --- a/task_templates/3_pipelines/9_python3_sklearn_with_custom_classes/custom.py +++ b/task_templates/3_pipelines/9_python3_sklearn_with_custom_classes/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + """ In this example we use an sklearn pipeline that is built using custom classes diff --git a/task_templates/3_pipelines/9_python3_sklearn_with_custom_classes/custom_pipeline.py b/task_templates/3_pipelines/9_python3_sklearn_with_custom_classes/custom_pipeline.py index b1d17b2ba..21b6ec772 100644 --- a/task_templates/3_pipelines/9_python3_sklearn_with_custom_classes/custom_pipeline.py +++ b/task_templates/3_pipelines/9_python3_sklearn_with_custom_classes/custom_pipeline.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from sklearn.pipeline import Pipeline import pandas as pd import numpy as np diff --git a/tests/conftest.py b/tests/conftest.py index e23299a78..01bbd6fdd 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import io import os from unittest.mock import Mock, patch diff --git a/tests/constants.py b/tests/constants.py index 0b16480a1..0e25b18cb 100644 --- a/tests/constants.py +++ b/tests/constants.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import os REPO_ROOT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) diff --git a/tests/e2e/conftest.py b/tests/e2e/conftest.py index d98be4c0b..9a4740e06 100644 --- a/tests/e2e/conftest.py +++ b/tests/e2e/conftest.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import os import uuid import warnings diff --git a/tests/e2e/test_custom_task_templates.py b/tests/e2e/test_custom_task_templates.py index b88a25171..6e1a091d9 100644 --- a/tests/e2e/test_custom_task_templates.py +++ b/tests/e2e/test_custom_task_templates.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from __future__ import absolute_import from typing import List, Tuple, Union diff --git a/tests/e2e/test_drop_in_environments.py b/tests/e2e/test_drop_in_environments.py index dae048874..9b4fde0fe 100644 --- a/tests/e2e/test_drop_in_environments.py +++ b/tests/e2e/test_drop_in_environments.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from __future__ import absolute_import import os diff --git a/tests/e2e/test_drum_push.py b/tests/e2e/test_drum_push.py index 0b3351b9e..0952461c2 100644 --- a/tests/e2e/test_drum_push.py +++ b/tests/e2e/test_drum_push.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from __future__ import absolute_import import os diff --git a/tests/e2e/test_inference_model_templates.py b/tests/e2e/test_inference_model_templates.py index b766ac14c..2f6dc226f 100644 --- a/tests/e2e/test_inference_model_templates.py +++ b/tests/e2e/test_inference_model_templates.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from __future__ import absolute_import import os diff --git a/tests/fixtures/all_predict_structured_hooks_custom.py b/tests/fixtures/all_predict_structured_hooks_custom.py index bf90d39c1..aafdbd7b9 100644 --- a/tests/fixtures/all_predict_structured_hooks_custom.py +++ b/tests/fixtures/all_predict_structured_hooks_custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import io import pandas as pd diff --git a/tests/fixtures/all_predict_unstructured_hooks_custom.py b/tests/fixtures/all_predict_unstructured_hooks_custom.py index 36051fd7e..5b7fc2dea 100644 --- a/tests/fixtures/all_predict_unstructured_hooks_custom.py +++ b/tests/fixtures/all_predict_unstructured_hooks_custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + prediction_value = None diff --git a/tests/fixtures/artifacts.py b/tests/fixtures/artifacts.py index 65a5f76a2..d93ec8054 100644 --- a/tests/fixtures/artifacts.py +++ b/tests/fixtures/artifacts.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import os import glob import shutil diff --git a/tests/fixtures/custom_flask_demo_auth.py b/tests/fixtures/custom_flask_demo_auth.py index 004a03810..958fc698d 100644 --- a/tests/fixtures/custom_flask_demo_auth.py +++ b/tests/fixtures/custom_flask_demo_auth.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from flask import request, jsonify diff --git a/tests/fixtures/custom_pred_consistency/custom.py b/tests/fixtures/custom_pred_consistency/custom.py index c0e22db40..643f41e9f 100644 --- a/tests/fixtures/custom_pred_consistency/custom.py +++ b/tests/fixtures/custom_pred_consistency/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pandas as pd import numpy as np import joblib diff --git a/tests/fixtures/custom_task_interface_binary/custom.py b/tests/fixtures/custom_task_interface_binary/custom.py index 0c8753a24..72212abbe 100644 --- a/tests/fixtures/custom_task_interface_binary/custom.py +++ b/tests/fixtures/custom_task_interface_binary/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + # This custom estimator task implements a decision tree classifier import pandas as pd diff --git a/tests/fixtures/custom_task_interface_keras_regression/custom.py b/tests/fixtures/custom_task_interface_keras_regression/custom.py index e14442809..7739c3a18 100644 --- a/tests/fixtures/custom_task_interface_keras_regression/custom.py +++ b/tests/fixtures/custom_task_interface_keras_regression/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from pathlib import Path import keras.models diff --git a/tests/fixtures/custom_task_interface_keras_visual/custom.py b/tests/fixtures/custom_task_interface_keras_visual/custom.py index 445b9c7f3..1ca8f4d50 100644 --- a/tests/fixtures/custom_task_interface_keras_visual/custom.py +++ b/tests/fixtures/custom_task_interface_keras_visual/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pandas as pd from model_utils import ( diff --git a/tests/fixtures/custom_task_interface_keras_visual/model_utils.py b/tests/fixtures/custom_task_interface_keras_visual/model_utils.py index ef56adc62..069131aea 100644 --- a/tests/fixtures/custom_task_interface_keras_visual/model_utils.py +++ b/tests/fixtures/custom_task_interface_keras_visual/model_utils.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import base64 from pathlib import Path from typing import Tuple diff --git a/tests/fixtures/custom_task_interface_multiclass/custom.py b/tests/fixtures/custom_task_interface_multiclass/custom.py index c149d4d5e..0b0b4f8a6 100644 --- a/tests/fixtures/custom_task_interface_multiclass/custom.py +++ b/tests/fixtures/custom_task_interface_multiclass/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pandas as pd from sklearn.ensemble import GradientBoostingClassifier diff --git a/tests/fixtures/custom_task_interface_pytorch_binary/custom.py b/tests/fixtures/custom_task_interface_pytorch_binary/custom.py index 4fa0bf5e8..4a4bf418d 100644 --- a/tests/fixtures/custom_task_interface_pytorch_binary/custom.py +++ b/tests/fixtures/custom_task_interface_pytorch_binary/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from pathlib import Path import pandas as pd import torch diff --git a/tests/fixtures/custom_task_interface_pytorch_binary/model_utils.py b/tests/fixtures/custom_task_interface_pytorch_binary/model_utils.py index 5d659a2f3..486128d91 100644 --- a/tests/fixtures/custom_task_interface_pytorch_binary/model_utils.py +++ b/tests/fixtures/custom_task_interface_pytorch_binary/model_utils.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + #!/usr/bin/env python # coding: utf-8 diff --git a/tests/fixtures/custom_task_interface_pytorch_multiclass/custom.py b/tests/fixtures/custom_task_interface_pytorch_multiclass/custom.py index 0116eaee7..ea9f8a660 100644 --- a/tests/fixtures/custom_task_interface_pytorch_multiclass/custom.py +++ b/tests/fixtures/custom_task_interface_pytorch_multiclass/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from pathlib import Path from typing import List, Optional, Any, Dict import pandas as pd diff --git a/tests/fixtures/custom_task_interface_pytorch_multiclass/model_utils.py b/tests/fixtures/custom_task_interface_pytorch_multiclass/model_utils.py index 349fca04a..e0ec912f4 100644 --- a/tests/fixtures/custom_task_interface_pytorch_multiclass/model_utils.py +++ b/tests/fixtures/custom_task_interface_pytorch_multiclass/model_utils.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + #!/usr/bin/env python # coding: utf-8 diff --git a/tests/fixtures/custom_task_interface_regression/custom.py b/tests/fixtures/custom_task_interface_regression/custom.py index e8edd88df..d3d16cd50 100644 --- a/tests/fixtures/custom_task_interface_regression/custom.py +++ b/tests/fixtures/custom_task_interface_regression/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + # This custom estimator task implements a decision tree regressor import pandas as pd diff --git a/tests/fixtures/custom_task_interface_regression_with_custom_class/custom_calibrator.py b/tests/fixtures/custom_task_interface_regression_with_custom_class/custom_calibrator.py index df5456438..33ecec7fe 100644 --- a/tests/fixtures/custom_task_interface_regression_with_custom_class/custom_calibrator.py +++ b/tests/fixtures/custom_task_interface_regression_with_custom_class/custom_calibrator.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import numpy as np diff --git a/tests/fixtures/custom_task_interface_transform_bool_to_int/custom.py b/tests/fixtures/custom_task_interface_transform_bool_to_int/custom.py index 6866469f9..19485ec9b 100644 --- a/tests/fixtures/custom_task_interface_transform_bool_to_int/custom.py +++ b/tests/fixtures/custom_task_interface_transform_bool_to_int/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import numpy as np import pandas as pd diff --git a/tests/fixtures/custom_task_interface_transform_image/custom.py b/tests/fixtures/custom_task_interface_transform_image/custom.py index 944909e01..00f027471 100644 --- a/tests/fixtures/custom_task_interface_transform_image/custom.py +++ b/tests/fixtures/custom_task_interface_transform_image/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from typing import Union import pandas as pd diff --git a/tests/fixtures/custom_task_interface_transform_image/img_utils.py b/tests/fixtures/custom_task_interface_transform_image/img_utils.py index a23cc37f4..0a5883c10 100644 --- a/tests/fixtures/custom_task_interface_transform_image/img_utils.py +++ b/tests/fixtures/custom_task_interface_transform_image/img_utils.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import base64 from io import BytesIO import numpy as np diff --git a/tests/fixtures/custom_task_interface_xgboost_regression/create_pipeline.py b/tests/fixtures/custom_task_interface_xgboost_regression/create_pipeline.py index a57f5c9c6..9cffe691b 100644 --- a/tests/fixtures/custom_task_interface_xgboost_regression/create_pipeline.py +++ b/tests/fixtures/custom_task_interface_xgboost_regression/create_pipeline.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from xgboost import XGBRegressor from sklearn.compose import ColumnTransformer diff --git a/tests/fixtures/drop_in_model_artifacts/PyTorch.py b/tests/fixtures/drop_in_model_artifacts/PyTorch.py index 538002463..f34b23ea5 100644 --- a/tests/fixtures/drop_in_model_artifacts/PyTorch.py +++ b/tests/fixtures/drop_in_model_artifacts/PyTorch.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + #!/usr/bin/env python # coding: utf-8 diff --git a/tests/fixtures/drop_in_model_artifacts/generate_h2o_artifacts.py b/tests/fixtures/drop_in_model_artifacts/generate_h2o_artifacts.py index 80d77c373..2853b528f 100644 --- a/tests/fixtures/drop_in_model_artifacts/generate_h2o_artifacts.py +++ b/tests/fixtures/drop_in_model_artifacts/generate_h2o_artifacts.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + ## would require a pip install of h2o==3.34.0.1 import h2o import logging diff --git a/tests/fixtures/load_model_custom.py b/tests/fixtures/load_model_custom.py index 8f78b6e55..0aa47422c 100644 --- a/tests/fixtures/load_model_custom.py +++ b/tests/fixtures/load_model_custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import os import pickle diff --git a/tests/fixtures/no_artifact_regression_custom.py b/tests/fixtures/no_artifact_regression_custom.py index cc5d759b1..01dca303e 100644 --- a/tests/fixtures/no_artifact_regression_custom.py +++ b/tests/fixtures/no_artifact_regression_custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pandas as pd diff --git a/tests/fixtures/pred_validation_custom.py b/tests/fixtures/pred_validation_custom.py index fc97a88e6..4d506ae0e 100644 --- a/tests/fixtures/pred_validation_custom.py +++ b/tests/fixtures/pred_validation_custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pandas as pd diff --git a/tests/fixtures/python3_sklearn_binary_hyperparameters/create_pipeline.py b/tests/fixtures/python3_sklearn_binary_hyperparameters/create_pipeline.py index 730523738..de163a61b 100644 --- a/tests/fixtures/python3_sklearn_binary_hyperparameters/create_pipeline.py +++ b/tests/fixtures/python3_sklearn_binary_hyperparameters/create_pipeline.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import numpy as np from sklearn.compose import ColumnTransformer, make_column_selector from sklearn.decomposition import TruncatedSVD diff --git a/tests/fixtures/python3_sklearn_binary_hyperparameters/custom.py b/tests/fixtures/python3_sklearn_binary_hyperparameters/custom.py index 3563b3a81..ee2eb60b0 100644 --- a/tests/fixtures/python3_sklearn_binary_hyperparameters/custom.py +++ b/tests/fixtures/python3_sklearn_binary_hyperparameters/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pickle from typing import List, Optional diff --git a/tests/fixtures/python3_sklearn_transform_hyperparameters/custom.py b/tests/fixtures/python3_sklearn_transform_hyperparameters/custom.py index cc51ea211..c4c166b14 100644 --- a/tests/fixtures/python3_sklearn_transform_hyperparameters/custom.py +++ b/tests/fixtures/python3_sklearn_transform_hyperparameters/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from datarobot_drum.custom_task_interfaces import TransformerInterface import pandas as pd diff --git a/tests/fixtures/python3_weight_test/custom.py b/tests/fixtures/python3_weight_test/custom.py index b33944a08..108ce5806 100644 --- a/tests/fixtures/python3_weight_test/custom.py +++ b/tests/fixtures/python3_weight_test/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + """ Task to verify that sample weights are handled correctly """ diff --git a/tests/fixtures/sparse_predict.py b/tests/fixtures/sparse_predict.py index 0718cbd0f..0a866061a 100644 --- a/tests/fixtures/sparse_predict.py +++ b/tests/fixtures/sparse_predict.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import numpy as np import pandas as pd diff --git a/tests/fixtures/text_generation_custom.py b/tests/fixtures/text_generation_custom.py index 1fc09c2dd..74fafdee5 100644 --- a/tests/fixtures/text_generation_custom.py +++ b/tests/fixtures/text_generation_custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pandas as pd diff --git a/tests/fixtures/transform_custom.py b/tests/fixtures/transform_custom.py index 7d02492b5..5a176cc71 100644 --- a/tests/fixtures/transform_custom.py +++ b/tests/fixtures/transform_custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pandas as pd from scipy.sparse import issparse diff --git a/tests/fixtures/transform_custom_with_y.py b/tests/fixtures/transform_custom_with_y.py index d93b90ef7..7d9f8ae5b 100644 --- a/tests/fixtures/transform_custom_with_y.py +++ b/tests/fixtures/transform_custom_with_y.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pandas as pd from scipy.sparse.csr import csr_matrix diff --git a/tests/fixtures/transform_fit_custom.py b/tests/fixtures/transform_fit_custom.py index a0d4d125c..367c57920 100644 --- a/tests/fixtures/transform_fit_custom.py +++ b/tests/fixtures/transform_fit_custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pickle import pandas as pd from scipy.sparse.csr import csr_matrix diff --git a/tests/fixtures/transform_fit_custom_no_hook.py b/tests/fixtures/transform_fit_custom_no_hook.py index d5c04ee23..80842a4cf 100644 --- a/tests/fixtures/transform_fit_custom_no_hook.py +++ b/tests/fixtures/transform_fit_custom_no_hook.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pickle import pandas as pd diff --git a/tests/fixtures/transform_fit_custom_non_numeric.py b/tests/fixtures/transform_fit_custom_non_numeric.py index 6af82993c..ad27dfe60 100644 --- a/tests/fixtures/transform_fit_custom_non_numeric.py +++ b/tests/fixtures/transform_fit_custom_non_numeric.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pickle import string import random diff --git a/tests/fixtures/transform_fit_custom_sparse_in_out.py b/tests/fixtures/transform_fit_custom_sparse_in_out.py index 1aceded35..1a0dcad4a 100644 --- a/tests/fixtures/transform_fit_custom_sparse_in_out.py +++ b/tests/fixtures/transform_fit_custom_sparse_in_out.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pickle import pandas as pd from sklearn.preprocessing import StandardScaler diff --git a/tests/fixtures/transform_fit_custom_sparse_input.py b/tests/fixtures/transform_fit_custom_sparse_input.py index 83ae20268..8b50b1fc2 100644 --- a/tests/fixtures/transform_fit_custom_sparse_input.py +++ b/tests/fixtures/transform_fit_custom_sparse_input.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pickle import pandas as pd from sklearn.decomposition import TruncatedSVD diff --git a/tests/fixtures/transform_fit_custom_sparse_input_y_output.py b/tests/fixtures/transform_fit_custom_sparse_input_y_output.py index 1e9bb6c8c..c4a4cef40 100644 --- a/tests/fixtures/transform_fit_custom_sparse_input_y_output.py +++ b/tests/fixtures/transform_fit_custom_sparse_input_y_output.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pickle import pandas as pd from sklearn.decomposition import TruncatedSVD diff --git a/tests/fixtures/transform_fit_custom_with_y.py b/tests/fixtures/transform_fit_custom_with_y.py index e73bbe411..31784b916 100644 --- a/tests/fixtures/transform_fit_custom_with_y.py +++ b/tests/fixtures/transform_fit_custom_with_y.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pickle from scipy.sparse.csr import csr_matrix diff --git a/tests/fixtures/transform_sparse_input.py b/tests/fixtures/transform_sparse_input.py index 24eaca734..6be7eb6a8 100644 --- a/tests/fixtures/transform_sparse_input.py +++ b/tests/fixtures/transform_sparse_input.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pandas as pd from scipy.sparse import issparse diff --git a/tests/fixtures/unstructured_custom_runtime_parameters.py b/tests/fixtures/unstructured_custom_runtime_parameters.py index 93398ac34..36bf10bb5 100644 --- a/tests/fixtures/unstructured_custom_runtime_parameters.py +++ b/tests/fixtures/unstructured_custom_runtime_parameters.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import json from pathlib import Path diff --git a/tests/fixtures/validate_sparse_columns/custom.py b/tests/fixtures/validate_sparse_columns/custom.py index 6e29d2196..96e7d2d26 100644 --- a/tests/fixtures/validate_sparse_columns/custom.py +++ b/tests/fixtures/validate_sparse_columns/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pickle from typing import Any, List, Optional diff --git a/tests/fixtures/validate_transform_fail_input_schema_validation/custom.py b/tests/fixtures/validate_transform_fail_input_schema_validation/custom.py index e89de4893..d5d1a7e18 100644 --- a/tests/fixtures/validate_transform_fail_input_schema_validation/custom.py +++ b/tests/fixtures/validate_transform_fail_input_schema_validation/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from typing import Any, List, Optional import numpy as np diff --git a/tests/fixtures/validate_transform_fail_output_schema_validation/custom.py b/tests/fixtures/validate_transform_fail_output_schema_validation/custom.py index 89cdca9e4..ccf3bdb56 100644 --- a/tests/fixtures/validate_transform_fail_output_schema_validation/custom.py +++ b/tests/fixtures/validate_transform_fail_output_schema_validation/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pickle from typing import Any, List, Optional diff --git a/tests/functional/test_deployment_config.py b/tests/functional/test_deployment_config.py index 7016905e8..9531f9ba0 100644 --- a/tests/functional/test_deployment_config.py +++ b/tests/functional/test_deployment_config.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import json import os from tempfile import NamedTemporaryFile diff --git a/tests/functional/test_dr_api_access.py b/tests/functional/test_dr_api_access.py index c61f8e4c0..0b11690ca 100644 --- a/tests/functional/test_dr_api_access.py +++ b/tests/functional/test_dr_api_access.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import contextlib import json import multiprocessing diff --git a/tests/functional/test_drum_docker.py b/tests/functional/test_drum_docker.py index 1eef80c69..f3788b4d3 100644 --- a/tests/functional/test_drum_docker.py +++ b/tests/functional/test_drum_docker.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import os import pandas as pd import pytest diff --git a/tests/functional/test_drum_runtime.py b/tests/functional/test_drum_runtime.py index 5bbd09c9a..295ae5d35 100644 --- a/tests/functional/test_drum_runtime.py +++ b/tests/functional/test_drum_runtime.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import collections from unittest import mock import pytest diff --git a/tests/functional/test_drum_server_custom_flask.py b/tests/functional/test_drum_server_custom_flask.py index 810f533ef..e4431d4fa 100644 --- a/tests/functional/test_drum_server_custom_flask.py +++ b/tests/functional/test_drum_server_custom_flask.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from pathlib import Path import shutil diff --git a/tests/functional/test_drum_server_failures.py b/tests/functional/test_drum_server_failures.py index 98ee02943..465737868 100644 --- a/tests/functional/test_drum_server_failures.py +++ b/tests/functional/test_drum_server_failures.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import collections import os import pickle diff --git a/tests/functional/test_fit.py b/tests/functional/test_fit.py index 4241ff69e..99aaca437 100644 --- a/tests/functional/test_fit.py +++ b/tests/functional/test_fit.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import os import shutil from tempfile import NamedTemporaryFile diff --git a/tests/functional/test_fit_per_framework.py b/tests/functional/test_fit_per_framework.py index 6dcbcdc38..9eee79c91 100644 --- a/tests/functional/test_fit_per_framework.py +++ b/tests/functional/test_fit_per_framework.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import json import os import shutil @@ -664,16 +665,18 @@ def test_fit_sh( "..", "public_dropin_environments/{}_{}/fit.sh".format( PYTHON, - framework - if framework - not in [ - SKLEARN_ANOMALY, - SKLEARN_BINARY, - SKLEARN_MULTICLASS, - SKLEARN_SPARSE, - SKLEARN_BINARY_HYPERPARAMETERS, - ] - else SKLEARN, + ( + framework + if framework + not in [ + SKLEARN_ANOMALY, + SKLEARN_BINARY, + SKLEARN_MULTICLASS, + SKLEARN_SPARSE, + SKLEARN_BINARY_HYPERPARAMETERS, + ] + else SKLEARN + ), ), ) diff --git a/tests/functional/test_inference.py b/tests/functional/test_inference.py index f998e9287..d16e7a3fb 100644 --- a/tests/functional/test_inference.py +++ b/tests/functional/test_inference.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import json from tempfile import NamedTemporaryFile diff --git a/tests/functional/test_inference_custom_java_predictor.py b/tests/functional/test_inference_custom_java_predictor.py index 578e27ad4..a0b3d1e78 100644 --- a/tests/functional/test_inference_custom_java_predictor.py +++ b/tests/functional/test_inference_custom_java_predictor.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import json import os import pandas as pd @@ -45,9 +46,9 @@ def test_custom_model_with_custom_java_predictor( cur_file_dir = os.path.dirname(os.path.abspath(__file__)) # have to point model dir to a folder with jar, so drum could detect the language model_dir = os.path.join(cur_file_dir, "custom_java_predictor") - os.environ[ - EnvVarNames.DRUM_JAVA_CUSTOM_PREDICTOR_CLASS - ] = "com.datarobot.test.TestCustomPredictor" + os.environ[EnvVarNames.DRUM_JAVA_CUSTOM_PREDICTOR_CLASS] = ( + "com.datarobot.test.TestCustomPredictor" + ) os.environ[EnvVarNames.DRUM_JAVA_CUSTOM_CLASS_PATH] = os.path.join(model_dir, "*") with DrumServerRun( resources.target_types(problem), diff --git a/tests/functional/test_inference_per_framework.py b/tests/functional/test_inference_per_framework.py index ebc560961..ca2250ead 100644 --- a/tests/functional/test_inference_per_framework.py +++ b/tests/functional/test_inference_per_framework.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import json from tempfile import NamedTemporaryFile from textwrap import dedent diff --git a/tests/functional/test_mlops_monitoring.py b/tests/functional/test_mlops_monitoring.py index 703494715..aec51c669 100644 --- a/tests/functional/test_mlops_monitoring.py +++ b/tests/functional/test_mlops_monitoring.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import contextlib import json import multiprocessing diff --git a/tests/functional/test_other_cases.py b/tests/functional/test_other_cases.py index 4c6cba0b3..40788cb70 100644 --- a/tests/functional/test_other_cases.py +++ b/tests/functional/test_other_cases.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import os from uuid import uuid4 import pandas as pd diff --git a/tests/functional/test_other_cases_per_framework.py b/tests/functional/test_other_cases_per_framework.py index ed0461e82..56253969b 100644 --- a/tests/functional/test_other_cases_per_framework.py +++ b/tests/functional/test_other_cases_per_framework.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pandas as pd import pytest diff --git a/tests/functional/test_performance_check.py b/tests/functional/test_performance_check.py index 96bd5f8b1..ca6232f08 100644 --- a/tests/functional/test_performance_check.py +++ b/tests/functional/test_performance_check.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pytest import subprocess import os diff --git a/tests/functional/test_stats.py b/tests/functional/test_stats.py index 86d67929d..c0041d006 100644 --- a/tests/functional/test_stats.py +++ b/tests/functional/test_stats.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import json from tempfile import NamedTemporaryFile import pandas as pd diff --git a/tests/functional/test_unstructured_mode_per_framework.py b/tests/functional/test_unstructured_mode_per_framework.py index 2513dc0fe..1c6897af2 100644 --- a/tests/functional/test_unstructured_mode_per_framework.py +++ b/tests/functional/test_unstructured_mode_per_framework.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pytest import requests import werkzeug diff --git a/tests/functional/test_validation_check.py b/tests/functional/test_validation_check.py index 9b73096a0..c34f1988b 100644 --- a/tests/functional/test_validation_check.py +++ b/tests/functional/test_validation_check.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import re import pytest import pandas as pd diff --git a/tests/functional/utils.py b/tests/functional/utils.py index 3edc78edc..f4b79a6af 100644 --- a/tests/functional/utils.py +++ b/tests/functional/utils.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import json import tempfile from contextlib import ContextDecorator diff --git a/tests/locust/suits/predict.py b/tests/locust/suits/predict.py index 3b7786130..6ee8ff482 100644 --- a/tests/locust/suits/predict.py +++ b/tests/locust/suits/predict.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import os from locust import HttpUser, task, between diff --git a/tests/locust/suits/predict_unstructured.py b/tests/locust/suits/predict_unstructured.py index 313210da6..9ea036310 100644 --- a/tests/locust/suits/predict_unstructured.py +++ b/tests/locust/suits/predict_unstructured.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from locust import HttpUser, task, between diff --git a/tests/unit/datarobot_drum/conftest.py b/tests/unit/datarobot_drum/conftest.py index 54a54a493..66f70437d 100644 --- a/tests/unit/datarobot_drum/conftest.py +++ b/tests/unit/datarobot_drum/conftest.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import tempfile from contextlib import contextmanager from textwrap import dedent diff --git a/tests/unit/datarobot_drum/drum/artifact_predictors/test_artifact_predictors.py b/tests/unit/datarobot_drum/drum/artifact_predictors/test_artifact_predictors.py index d7fe24998..de16bafa7 100644 --- a/tests/unit/datarobot_drum/drum/artifact_predictors/test_artifact_predictors.py +++ b/tests/unit/datarobot_drum/drum/artifact_predictors/test_artifact_predictors.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + from datarobot_drum.drum.artifact_predictors.keras_predictor import KerasPredictor from datarobot_drum.drum.artifact_predictors.onnx_predictor import ONNXPredictor from datarobot_drum.drum.artifact_predictors.pmml_predictor import PMMLPredictor diff --git a/tests/unit/datarobot_drum/drum/test_args_parser.py b/tests/unit/datarobot_drum/drum/test_args_parser.py index 93d655f65..e6f36b2b2 100644 --- a/tests/unit/datarobot_drum/drum/test_args_parser.py +++ b/tests/unit/datarobot_drum/drum/test_args_parser.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import argparse import contextlib import os diff --git a/tests/unit/datarobot_drum/drum/test_data_marshalling.py b/tests/unit/datarobot_drum/drum/test_data_marshalling.py index 5313f9108..d62e9228b 100644 --- a/tests/unit/datarobot_drum/drum/test_data_marshalling.py +++ b/tests/unit/datarobot_drum/drum/test_data_marshalling.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import numpy as np import pandas as pd import pytest diff --git a/tests/unit/datarobot_drum/drum/test_push.py b/tests/unit/datarobot_drum/drum/test_push.py index 1573ce058..6e3c7e8d6 100644 --- a/tests/unit/datarobot_drum/drum/test_push.py +++ b/tests/unit/datarobot_drum/drum/test_push.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import json import os import time diff --git a/tests/unit/datarobot_drum/drum/utils/test_structured_input_read_utils.py b/tests/unit/datarobot_drum/drum/utils/test_structured_input_read_utils.py index 6271b5b98..f26d99855 100644 --- a/tests/unit/datarobot_drum/drum/utils/test_structured_input_read_utils.py +++ b/tests/unit/datarobot_drum/drum/utils/test_structured_input_read_utils.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import os import tempfile diff --git a/tests/unit/datarobot_drum/model_metadata/test_model_metadata.py b/tests/unit/datarobot_drum/model_metadata/test_model_metadata.py index 69d06f3d8..23d9689b4 100644 --- a/tests/unit/datarobot_drum/model_metadata/test_model_metadata.py +++ b/tests/unit/datarobot_drum/model_metadata/test_model_metadata.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import itertools import logging import os diff --git a/tests/unit/datarobot_drum/resource/test_transform_helpers.py b/tests/unit/datarobot_drum/resource/test_transform_helpers.py index de5b4a827..c4bb1f2a3 100644 --- a/tests/unit/datarobot_drum/resource/test_transform_helpers.py +++ b/tests/unit/datarobot_drum/resource/test_transform_helpers.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pandas as pd import numpy as np import pytest diff --git a/tests/unit/datarobot_drum/runtime_parameters/test_runtime_parameters.py b/tests/unit/datarobot_drum/runtime_parameters/test_runtime_parameters.py index b3663e5cb..1e45388fa 100644 --- a/tests/unit/datarobot_drum/runtime_parameters/test_runtime_parameters.py +++ b/tests/unit/datarobot_drum/runtime_parameters/test_runtime_parameters.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import json import os from unittest.mock import patch diff --git a/tools/env_version_update.py b/tools/env_version_update.py index 6753e62e1..fdef7e35e 100644 --- a/tools/env_version_update.py +++ b/tools/env_version_update.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import argparse import os import json diff --git a/tools/parallel_requests.py b/tools/parallel_requests.py index 20aa64aae..fe2d233f2 100644 --- a/tools/parallel_requests.py +++ b/tools/parallel_requests.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + # This script creates parallel processes to send predict requests import argparse diff --git a/tools/r2d2/custom.py b/tools/r2d2/custom.py index 317dde66c..92019d993 100644 --- a/tools/r2d2/custom.py +++ b/tools/r2d2/custom.py @@ -4,6 +4,7 @@ This is proprietary source code of DataRobot, Inc. and its affiliates. Released under the terms of DataRobot Tool and Utility Agreement. """ + import pandas as pd import sys import time