Skip to content

Commit

Permalink
infra: sort imports in all .py files with isort (aws#2225)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaykarpur authored May 11, 2021
1 parent af6667b commit 187e52f
Show file tree
Hide file tree
Showing 623 changed files with 2,849 additions and 2,883 deletions.
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
import sys
import os
import argparse
import logging
import warnings
import time
import copy
import json
import logging
import os
import subprocess
import copy
import sys
import time
import warnings

warnings.filterwarnings("ignore", category=FutureWarning)

import numpy as np
import pandas as pd
import pickle
from collections import Counter
from io import StringIO
from timeit import default_timer as timer
from itertools import islice
from collections import Counter
from timeit import default_timer as timer

import numpy as np
import pandas as pd

with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
from autogluon.tabular import TabularDataset, TabularPredictor
from prettytable import PrettyTable
from autogluon.tabular import TabularPredictor, TabularDataset


def make_str_table(df):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import ast
import argparse
import ast
import glob
import json
import logging
import warnings
import os
import json
import glob
import pickle
import shutil
import subprocess
import sys
import boto3
import pickle
import pandas as pd
import warnings
from collections import Counter
from timeit import default_timer as timer

import numpy as np
import seaborn as sns
import boto3
import matplotlib.pyplot as plt
import shutil
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns

logging.basicConfig(level=logging.DEBUG)
logging.info(subprocess.call("ls -lR /opt/ml/input".split()))
Expand All @@ -29,12 +29,10 @@

with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
from prettytable import PrettyTable
import autogluon as ag

from autogluon.tabular import TabularDataset, TabularPredictor

from autogluon.core.constants import BINARY, MULTICLASS, REGRESSION, SOFTCLASS
from autogluon.tabular import TabularDataset, TabularPredictor
from prettytable import PrettyTable

# print(f'DEBUG AutoGluon version : {ag.__version__}')

Expand Down Expand Up @@ -74,11 +72,11 @@ def format_for_print(df):


def get_roc_auc(y_test_true, y_test_pred, labels, class_labels_internal, model_output_dir):
from sklearn.preprocessing import label_binarize
from sklearn.metrics import roc_curve, auc

from itertools import cycle

from sklearn.metrics import auc, roc_curve
from sklearn.preprocessing import label_binarize

y_test_true_binalized = label_binarize(y_test_true, classes=labels)

if len(labels) == 2:
Expand Down
10 changes: 4 additions & 6 deletions advanced_functionality/autogluon-tabular/utils/ag_utils.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
from IPython.display import display, IFrame
from ipywidgets import interact, Image, VBox, HTML, GridspecLayout, Layout, widgets
import ipywidgets as ipyw

import boto3

import os
import tarfile

import boto3
import ipywidgets as ipyw
import pandas as pd
from IPython.display import IFrame, display
from ipywidgets import HTML, GridspecLayout, Image, Layout, VBox, interact, widgets


def search_training_jobs(job_tag_name, job_tag_value):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
from __future__ import absolute_import

import os
import sys
import time
import os

from utils import ExitSignalHandler
from utils import (
write_failure_file,
print_json_object,
ExitSignalHandler,
load_json_object,
save_model_artifacts,
print_files_in_path,
print_json_object,
save_model_artifacts,
write_failure_file,
)

hyperparameters_file_path = "/opt/ml/input/config/hyperparameters.json"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import signal
import pprint
import json
import os
import pprint
import signal
from os import path


Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from __future__ import absolute_import

import argparse
import os
import sys
import time
import os
import argparse

from utils import save_model_artifacts, print_files_in_path
from utils import print_files_in_path, save_model_artifacts


def train(hp1, hp2, hp3, train_channel, validation_channel):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from __future__ import absolute_import

from glob import glob
import os
from os.path import basename
from os.path import splitext
from glob import glob
from os.path import basename, splitext

from setuptools import find_packages, setup

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import absolute_import

import logging

from sagemaker_training import entry_point, environment

logger = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from __future__ import absolute_import

import argparse
import os
import sys
import time
import os
import argparse

from utils import save_model_artifacts, print_files_in_path
from utils import print_files_in_path, save_model_artifacts


def train(hp1, hp2, hp3, train_channel, validation_channel):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from __future__ import absolute_import

import argparse
import os
import sys
import time
import os
import argparse

from utils import save_model_artifacts, print_files_in_path
from utils import print_files_in_path, save_model_artifacts


def train(hp1, hp2, hp3, train_channel, validation_channel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""

import glob
import json
import os
import shutil
import signal
import socket
import subprocess
import sys
import time
import signal
import socket
import glob


def copy_files(src, dest):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import glob
import json
import os
import shutil
import signal
import socket
import subprocess
import sys
import time
import signal
import socket
import glob

from contextlib import contextmanager


Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import glob
import json
import os
import shutil
import signal
import socket
import subprocess
import sys
import time
import signal
import socket
import glob

from contextlib import contextmanager


Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import glob
import json
import os
import shutil
import signal
import socket
import subprocess
import sys
import time
import signal
import socket
import glob

from contextlib import contextmanager


Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import os, glob
import glob
import os
import sys

sys.path.append("/mask-rcnn-tensorflow/MaskRCNN")

from model.generalized_rcnn import ResNetFPNModel
from config import finalize_configs, config as cfg
from dataset import DetectionDataset
from itertools import groupby
from threading import Lock

import cv2
import numpy as np
from config import config as cfg
from config import finalize_configs
from dataset import DetectionDataset
from model.generalized_rcnn import ResNetFPNModel
from tensorpack.predict.base import OfflinePredictor
from tensorpack.tfutils.sessinit import get_model_loader
from tensorpack.predict.config import PredictConfig

import numpy as np
import cv2
from itertools import groupby
from threading import Lock
from tensorpack.tfutils.sessinit import get_model_loader


class MaskRCNNService:
Expand All @@ -25,7 +26,7 @@ class MaskRCNNService:
# class method to load trained model and create an offline predictor
@classmethod
def get_predictor(cls):
""" load trained model"""
"""load trained model"""

with cls.lock:
# check if model is already loaded
Expand Down Expand Up @@ -172,11 +173,10 @@ def binary_mask_to_rle(cls, binary_mask):
# create predictor
MaskRCNNService.get_predictor()

import json
from flask import Flask
from flask import request
from flask import Response
import base64
import json

from flask import Flask, Response, request

app = Flask(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
# timeout MODEL_SERVER_TIMEOUT 70 seconds

from __future__ import print_function

import os
import signal
import subprocess
import sys


model_server_timeout = os.environ.get("MODEL_SERVER_TIMEOUT", 70)
model_server_workers = int(os.environ.get("MODEL_SERVER_WORKERS", 1))

Expand Down
Loading

0 comments on commit 187e52f

Please sign in to comment.