aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wick...@apache.org
Subject [2/3] Apply build-support/isort-run
Date Tue, 13 May 2014 01:18:47 GMT
http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/config/schema_base.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/config/schema_base.py b/src/main/python/apache/thermos/config/schema_base.py
index e59edbd..146cbb7 100644
--- a/src/main/python/apache/thermos/config/schema_base.py
+++ b/src/main/python/apache/thermos/config/schema_base.py
@@ -14,19 +14,7 @@
 # limitations under the License.
 #
 
-from pystachio import (
-  Boolean,
-  Default,
-  Empty,
-  Float,
-  Integer,
-  List,
-  Map,
-  Required,
-  String,
-  Struct
-)
-
+from pystachio import Boolean, Default, Empty, Float, Integer, List, Map, Required, String, Struct
 
 # Define constants for resources
 BYTES = 1

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/config/schema_helpers.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/config/schema_helpers.py b/src/main/python/apache/thermos/config/schema_helpers.py
index b496ccf..f6a5caa 100644
--- a/src/main/python/apache/thermos/config/schema_helpers.py
+++ b/src/main/python/apache/thermos/config/schema_helpers.py
@@ -17,17 +17,10 @@
 """Helpers for composing Thermos workflows."""
 import itertools
 
-from .schema_base import (
-   Constraint,
-   GB,
-   Process,
-   Resources,
-   Task,
-)
-
 from pystachio import Empty, List
 from twitter.common.lang import Compatibility
 
+from .schema_base import Constraint, GB, Process, Resources, Task
 
 __all__ = (
   # shorthand for process ordering constraint

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/core/helper.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/core/helper.py b/src/main/python/apache/thermos/core/helper.py
index d4f473d..126e0ac 100644
--- a/src/main/python/apache/thermos/core/helper.py
+++ b/src/main/python/apache/thermos/core/helper.py
@@ -14,21 +14,11 @@
 # limitations under the License.
 #
 
-from contextlib import closing
 import errno
 import os
 import signal
 import time
-
-from apache.thermos.common.ckpt import CheckpointDispatcher
-from apache.thermos.common.path import TaskPath
-
-from gen.apache.thermos.ttypes import (
-  ProcessState,
-  ProcessStatus,
-  RunnerCkpt,
-  TaskState,
-  TaskStatus)
+from contextlib import closing
 
 import psutil
 from twitter.common import log
@@ -36,6 +26,11 @@ from twitter.common.dirutil import lock_file, safe_mkdir
 from twitter.common.quantity import Amount, Time
 from twitter.common.recordio import ThriftRecordWriter
 
+from apache.thermos.common.ckpt import CheckpointDispatcher
+from apache.thermos.common.path import TaskPath
+
+from gen.apache.thermos.ttypes import ProcessState, ProcessStatus, RunnerCkpt, TaskState, TaskStatus
+
 
 class TaskKiller(object):
   """

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/core/inspector.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/core/inspector.py b/src/main/python/apache/thermos/core/inspector.py
index d79042a..c69ce64 100644
--- a/src/main/python/apache/thermos/core/inspector.py
+++ b/src/main/python/apache/thermos/core/inspector.py
@@ -14,23 +14,19 @@
 # limitations under the License.
 #
 
+import pwd
 from collections import namedtuple
 from contextlib import closing
-import pwd
+
+from twitter.common import log
+from twitter.common.recordio import RecordIO, ThriftRecordReader
 
 from apache.thermos.common.ckpt import CheckpointDispatcher
 from apache.thermos.common.path import TaskPath
 
-from gen.apache.thermos.ttypes import (
-  ProcessState,
-  RunnerCkpt,
-  RunnerState)
-
 from .muxer import ProcessMuxer
 
-from twitter.common import log
-from twitter.common.recordio import RecordIO, ThriftRecordReader
-
+from gen.apache.thermos.ttypes import ProcessState, RunnerCkpt, RunnerState
 
 CheckpointInspection = namedtuple('CheckpointInspection',
     ['runner_latest_update',

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/core/muxer.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/core/muxer.py b/src/main/python/apache/thermos/core/muxer.py
index 08fdbb2..0a4a677 100644
--- a/src/main/python/apache/thermos/core/muxer.py
+++ b/src/main/python/apache/thermos/core/muxer.py
@@ -14,14 +14,14 @@
 # limitations under the License.
 #
 
-import os
 import errno
-
-from gen.apache.thermos.ttypes import RunnerCkpt
+import os
 
 from twitter.common import log
 from twitter.common.recordio import ThriftRecordReader
 
+from gen.apache.thermos.ttypes import RunnerCkpt
+
 
 class ProcessMuxer(object):
   class ProcessExists(Exception): pass

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/core/process.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/core/process.py b/src/main/python/apache/thermos/core/process.py
index 5658ebe..efd0a9e 100644
--- a/src/main/python/apache/thermos/core/process.py
+++ b/src/main/python/apache/thermos/core/process.py
@@ -22,7 +22,6 @@ commandline in a subprocess of its own.
 
 """
 
-from abc import abstractmethod
 import getpass
 import grp
 import os
@@ -31,24 +30,16 @@ import signal
 import subprocess
 import sys
 import time
+from abc import abstractmethod
 
-
-from gen.apache.thermos.ttypes import (
-    ProcessState,
-    ProcessStatus,
-    RunnerCkpt,
-)
-
-from twitter.common.dirutil import (
-    lock_file,
-    safe_mkdir,
-    safe_open,
-)
-from twitter.common.lang import Interface
 from twitter.common import log
+from twitter.common.dirutil import lock_file, safe_mkdir, safe_open
+from twitter.common.lang import Interface
 from twitter.common.quantity import Amount, Time
 from twitter.common.recordio import ThriftRecordReader, ThriftRecordWriter
 
+from gen.apache.thermos.ttypes import ProcessState, ProcessStatus, RunnerCkpt
+
 
 class Platform(Interface):
   """Abstract representation of a platform encapsulating system-level functions"""

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/core/runner.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/core/runner.py b/src/main/python/apache/thermos/core/runner.py
index a187618..4eb04ad 100644
--- a/src/main/python/apache/thermos/core/runner.py
+++ b/src/main/python/apache/thermos/core/runner.py
@@ -41,48 +41,50 @@ terminal state.
 
 """
 
-from contextlib import contextmanager
 import errno
-from functools import partial
 import os
 import socket
 import sys
 import time
 import traceback
+from contextlib import contextmanager
+from functools import partial
+
+from pystachio import Environment
+from twitter.common import log
+from twitter.common.dirutil import safe_mkdir
+from twitter.common.quantity import Amount, Time
+from twitter.common.recordio import ThriftRecordReader
 
 from apache.thermos.common.ckpt import (
-  CheckpointDispatcher,
-  UniversalStateHandler,
-  ProcessStateHandler,
-  TaskStateHandler)
+    CheckpointDispatcher,
+    ProcessStateHandler,
+    TaskStateHandler,
+    UniversalStateHandler
+)
 from apache.thermos.common.path import TaskPath
 from apache.thermos.common.planner import TaskPlanner
 from apache.thermos.config.loader import (
-  ThermosConfigLoader,
-  ThermosProcessWrapper,
-  ThermosTaskWrapper,
-  ThermosTaskValidator)
-from apache.thermos.config.schema import ThermosContext
-
-from gen.apache.thermos.ttypes import (
-  ProcessState,
-  ProcessStatus,
-  RunnerCkpt,
-  RunnerHeader,
-  RunnerState,
-  TaskState,
-  TaskStatus,
+    ThermosConfigLoader,
+    ThermosProcessWrapper,
+    ThermosTaskValidator,
+    ThermosTaskWrapper
 )
+from apache.thermos.config.schema import ThermosContext
 
 from .helper import TaskRunnerHelper
 from .muxer import ProcessMuxer
 from .process import Process
 
-from pystachio import Environment
-from twitter.common import log
-from twitter.common.dirutil import safe_mkdir
-from twitter.common.quantity import Amount, Time
-from twitter.common.recordio import ThriftRecordReader
+from gen.apache.thermos.ttypes import (
+    ProcessState,
+    ProcessStatus,
+    RunnerCkpt,
+    RunnerHeader,
+    RunnerState,
+    TaskState,
+    TaskStatus
+)
 
 
 # TODO(wickman) Currently this is messy because of all the private access into ._runner.

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/monitoring/disk.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/monitoring/disk.py b/src/main/python/apache/thermos/monitoring/disk.py
index e03002a..b3d39fb 100644
--- a/src/main/python/apache/thermos/monitoring/disk.py
+++ b/src/main/python/apache/thermos/monitoring/disk.py
@@ -32,20 +32,20 @@ import threading
 import time
 from Queue import Empty, Queue
 
-from watchdog.observers import Observer as WatchdogObserver
-from watchdog.events import (
-  FileSystemEventHandler,
-  FileCreatedEvent,
-  FileDeletedEvent,
-  FileModifiedEvent,
-  FileMovedEvent,
-)
-
 from twitter.common import log
 from twitter.common.dirutil import du, safe_bsize
 from twitter.common.exceptions import ExceptionalThread
 from twitter.common.lang import Lockable
 from twitter.common.quantity import Amount, Time
+from watchdog.events import (
+    FileCreatedEvent,
+    FileDeletedEvent,
+    FileModifiedEvent,
+    FileMovedEvent,
+    FileSystemEventHandler
+)
+from watchdog.observers import Observer as WatchdogObserver
+
 
 class DiskCollectorThread(ExceptionalThread):
   """ Thread to calculate aggregate disk usage under a given path using a simple algorithm """

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/monitoring/garbage.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/monitoring/garbage.py b/src/main/python/apache/thermos/monitoring/garbage.py
index 60d159f..1bb54ca 100644
--- a/src/main/python/apache/thermos/monitoring/garbage.py
+++ b/src/main/python/apache/thermos/monitoring/garbage.py
@@ -14,21 +14,21 @@
 # limitations under the License.
 #
 
-from abc import abstractmethod
-from collections import namedtuple
 import os
 import sys
 import time
+from abc import abstractmethod
+from collections import namedtuple
+
+from twitter.common.dirutil import safe_bsize, safe_delete, safe_rmtree
+from twitter.common.lang import Interface
+from twitter.common.quantity import Amount, Data, Time
 
 from apache.thermos.common.ckpt import CheckpointDispatcher
 from apache.thermos.common.path import TaskPath
 
 from .detector import TaskDetector
 
-from twitter.common.dirutil import safe_delete, safe_rmtree, safe_bsize
-from twitter.common.lang import Interface
-from twitter.common.quantity import Amount, Data, Time
-
 
 class TaskGarbageCollector(object):
   def __init__(self, root):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/monitoring/monitor.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/monitoring/monitor.py b/src/main/python/apache/thermos/monitoring/monitor.py
index d524a1d..bcaf00d 100644
--- a/src/main/python/apache/thermos/monitoring/monitor.py
+++ b/src/main/python/apache/thermos/monitoring/monitor.py
@@ -24,23 +24,18 @@ as their corresponding Thrift structs:
 
 """
 
-import os
 import copy
 import errno
+import os
 import threading
 
-from apache.thermos.common.ckpt import CheckpointDispatcher
-
-from gen.apache.thermos.ttypes import (
-  ProcessState,
-  RunnerCkpt,
-  RunnerState,
-  TaskState,
-)
-
 from twitter.common import log
 from twitter.common.recordio import ThriftRecordReader
 
+from apache.thermos.common.ckpt import CheckpointDispatcher
+
+from gen.apache.thermos.ttypes import ProcessState, RunnerCkpt, RunnerState, TaskState
+
 
 class TaskMonitor(object):
   """

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/monitoring/process_collector_psutil.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/monitoring/process_collector_psutil.py b/src/main/python/apache/thermos/monitoring/process_collector_psutil.py
index c4530f2..5be7af6 100644
--- a/src/main/python/apache/thermos/monitoring/process_collector_psutil.py
+++ b/src/main/python/apache/thermos/monitoring/process_collector_psutil.py
@@ -19,12 +19,12 @@
 from operator import attrgetter
 from time import time
 
-from .process import ProcessSample
-
-from psutil import Process
-from psutil import NoSuchProcess, AccessDenied, Error as PsutilError
+from psutil import Error as PsutilError
+from psutil import AccessDenied, NoSuchProcess, Process
 from twitter.common import log
 
+from .process import ProcessSample
+
 
 def process_to_sample(process):
   """ Given a psutil.Process, return a current ProcessSample """
@@ -104,4 +104,3 @@ class ProcessTreeCollector(object):
   def procs(self):
     """ Number of active processes in the tree """
     return len(self._sampled_tree)
-

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/monitoring/resource.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/monitoring/resource.py b/src/main/python/apache/thermos/monitoring/resource.py
index 2056872..fa5a973 100644
--- a/src/main/python/apache/thermos/monitoring/resource.py
+++ b/src/main/python/apache/thermos/monitoring/resource.py
@@ -29,18 +29,13 @@ disk consumption and retaining a limited (FIFO) in-memory history of this data.
 
 """
 
+import platform
+import threading
+import time
 from abc import abstractmethod
 from bisect import bisect_left
 from collections import namedtuple
 from operator import attrgetter
-import platform
-import threading
-import time
-
-from .disk import DiskCollector
-from .monitor import TaskMonitor
-from .process import ProcessSample
-from .process_collector_psutil import ProcessTreeCollector
 
 from twitter.common import log
 from twitter.common.collections import RingBuffer
@@ -48,6 +43,11 @@ from twitter.common.concurrent import EventMuxer
 from twitter.common.lang import Interface
 from twitter.common.quantity import Amount, Time
 
+from .disk import DiskCollector
+from .monitor import TaskMonitor
+from .process import ProcessSample
+from .process_collector_psutil import ProcessTreeCollector
+
 
 class ResourceMonitorBase(Interface):
   """ Defines the interface for interacting with a ResourceMonitor """

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/observer/bin/thermos_observer.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/observer/bin/thermos_observer.py b/src/main/python/apache/thermos/observer/bin/thermos_observer.py
index 614b0bd..27b22d4 100644
--- a/src/main/python/apache/thermos/observer/bin/thermos_observer.py
+++ b/src/main/python/apache/thermos/observer/bin/thermos_observer.py
@@ -20,15 +20,14 @@ import socket
 import sys
 import time
 
-from apache.thermos.common.path import TaskPath
-from apache.thermos.observer.task_observer import TaskObserver
-from apache.thermos.observer.http.http_observer import BottleObserver
-
 from twitter.common import app
 from twitter.common.exceptions import ExceptionalThread
 from twitter.common.http import HttpServer
 from twitter.common.http.diagnostics import DiagnosticsEndpoints
 
+from apache.thermos.common.path import TaskPath
+from apache.thermos.observer.http.http_observer import BottleObserver
+from apache.thermos.observer.task_observer import TaskObserver
 
 app.add_option("--root",
                dest="root",

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/observer/http/file_browser.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/observer/http/file_browser.py b/src/main/python/apache/thermos/observer/http/file_browser.py
index 75d5ff8..4a7ddaf 100644
--- a/src/main/python/apache/thermos/observer/http/file_browser.py
+++ b/src/main/python/apache/thermos/observer/http/file_browser.py
@@ -18,13 +18,12 @@ import os
 import pprint
 from xml.sax.saxutils import escape
 
-from .templating import HttpTemplate
-
 import bottle
 from mako.template import Template
 from twitter.common import log
 from twitter.common.http import HttpServer
 
+from .templating import HttpTemplate
 
 MB = 1024 * 1024
 DEFAULT_CHUNK_LENGTH = MB

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/observer/http/http_observer.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/observer/http/http_observer.py b/src/main/python/apache/thermos/observer/http/http_observer.py
index caceabc..be91005 100644
--- a/src/main/python/apache/thermos/observer/http/http_observer.py
+++ b/src/main/python/apache/thermos/observer/http/http_observer.py
@@ -24,14 +24,14 @@ system. To do this, it relies heavily on the Thermos TaskObserver.
 import os
 import socket
 
+from twitter.common import log
+from twitter.common.http import HttpServer
+
 from .file_browser import TaskObserverFileBrowser
 from .json import TaskObserverJSONBindings
 from .static_assets import StaticAssets
 from .templating import HttpTemplate
 
-from twitter.common import log
-from twitter.common.http import HttpServer
-
 
 class BottleObserver(HttpServer, StaticAssets, TaskObserverFileBrowser, TaskObserverJSONBindings):
   """

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/observer/http/json.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/observer/http/json.py b/src/main/python/apache/thermos/observer/http/json.py
index 66401b1..e7f47ca 100644
--- a/src/main/python/apache/thermos/observer/http/json.py
+++ b/src/main/python/apache/thermos/observer/http/json.py
@@ -69,4 +69,3 @@ class TaskObserverJSONBindings(object):
     if task_ids:
       task_ids = urllib.unquote(task_ids).split(',')
     return self._observer.processes(task_ids)
-

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/observer/http/static_assets.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/observer/http/static_assets.py b/src/main/python/apache/thermos/observer/http/static_assets.py
index 22e5247..c29f2cd 100644
--- a/src/main/python/apache/thermos/observer/http/static_assets.py
+++ b/src/main/python/apache/thermos/observer/http/static_assets.py
@@ -17,8 +17,8 @@
 import mimetypes
 import os
 
-from bottle import HTTPResponse
 import pkg_resources
+from bottle import HTTPResponse
 from twitter.common import log
 from twitter.common.http.server import HttpServer
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/observer/http/templating.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/observer/http/templating.py b/src/main/python/apache/thermos/observer/http/templating.py
index fd14650..ede30f2 100644
--- a/src/main/python/apache/thermos/observer/http/templating.py
+++ b/src/main/python/apache/thermos/observer/http/templating.py
@@ -15,6 +15,7 @@
 #
 
 import os
+
 import pkg_resources
 
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/observer/observed_task.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/observer/observed_task.py b/src/main/python/apache/thermos/observer/observed_task.py
index 18a2a5a..2c8d503 100644
--- a/src/main/python/apache/thermos/observer/observed_task.py
+++ b/src/main/python/apache/thermos/observer/observed_task.py
@@ -14,17 +14,17 @@
 # limitations under the License.
 #
 
-from abc import abstractproperty
 import os
-
-from apache.thermos.config.loader import ThermosTaskWrapper
-from apache.thermos.config.schema import ThermosContext
-from apache.thermos.common.ckpt import CheckpointDispatcher
+from abc import abstractproperty
 
 from pystachio import Environment
 from twitter.common import log
 from twitter.common.lang import AbstractClass
 
+from apache.thermos.common.ckpt import CheckpointDispatcher
+from apache.thermos.config.loader import ThermosTaskWrapper
+from apache.thermos.config.schema import ThermosContext
+
 
 class ObservedTask(AbstractClass):
   """ Represents a Task being observed """

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/observer/task_observer.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/observer/task_observer.py b/src/main/python/apache/thermos/observer/task_observer.py
index 8feaa40..a064be4 100644
--- a/src/main/python/apache/thermos/observer/task_observer.py
+++ b/src/main/python/apache/thermos/observer/task_observer.py
@@ -21,10 +21,15 @@ finished Thermos tasks on a system. The primary entry point is the TaskObserver,
 polls a designated Thermos checkpoint root and collates information about all tasks it discovers.
 
 """
-from operator import attrgetter
 import os
 import threading
 import time
+from operator import attrgetter
+
+from twitter.common import log
+from twitter.common.exceptions import ExceptionalThread
+from twitter.common.lang import Lockable
+from twitter.common.quantity import Amount, Time
 
 from apache.thermos.common.path import TaskPath
 from apache.thermos.monitoring.detector import TaskDetector
@@ -32,14 +37,9 @@ from apache.thermos.monitoring.monitor import TaskMonitor
 from apache.thermos.monitoring.process import ProcessSample
 from apache.thermos.monitoring.resource import ResourceMonitorBase, TaskResourceMonitor
 
-from gen.apache.thermos.ttypes import ProcessState, TaskState
-
 from .observed_task import ActiveObservedTask, FinishedObservedTask
 
-from twitter.common import log
-from twitter.common.exceptions import ExceptionalThread
-from twitter.common.lang import Lockable
-from twitter.common.quantity import Amount, Time
+from gen.apache.thermos.ttypes import ProcessState, TaskState
 
 
 class TaskObserver(ExceptionalThread, Lockable):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/main/python/apache/thermos/testing/runner.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/testing/runner.py b/src/main/python/apache/thermos/testing/runner.py
index 291fdb0..8780ef6 100644
--- a/src/main/python/apache/thermos/testing/runner.py
+++ b/src/main/python/apache/thermos/testing/runner.py
@@ -25,19 +25,15 @@ import sys
 import tempfile
 import time
 
-from apache.thermos.common.path import TaskPath
+from thrift.TSerialization import deserialize as thrift_deserialize
+from twitter.common import log
+from twitter.common.contextutil import environment_as, temporary_file
+
 from apache.thermos.common.ckpt import CheckpointDispatcher
+from apache.thermos.common.path import TaskPath
 from apache.thermos.config.loader import ThermosTaskWrapper
 
-from gen.apache.thermos.ttypes import (
-  TaskState,
-  RunnerCkpt,
-  RunnerState,
-)
-
-from thrift.TSerialization import deserialize as thrift_deserialize
-from twitter.common import log
-from twitter.common.contextutil import temporary_file, environment_as
+from gen.apache.thermos.ttypes import RunnerCkpt, RunnerState, TaskState
 
 
 class Runner(object):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/admin/test_host_maintenance.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/admin/test_host_maintenance.py b/src/test/python/apache/aurora/admin/test_host_maintenance.py
index 0ba3262..18bf622 100644
--- a/src/test/python/apache/aurora/admin/test_host_maintenance.py
+++ b/src/test/python/apache/aurora/admin/test_host_maintenance.py
@@ -16,18 +16,13 @@
 
 import unittest
 
-from apache.aurora.admin.host_maintenance import HostMaintenance
-from apache.aurora.common.cluster import Cluster
-
-from gen.apache.aurora.api.ttypes import (
-    Hosts,
-    Response,
-    ResponseCode,
-)
-
 import mock
 import pytest
 
+from apache.aurora.admin.host_maintenance import HostMaintenance
+from apache.aurora.common.cluster import Cluster
+
+from gen.apache.aurora.api.ttypes import Hosts, Response, ResponseCode
 
 DEFAULT_CLUSTER = Cluster(
     name='us-west',

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/api/test_disambiguator.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/api/test_disambiguator.py b/src/test/python/apache/aurora/client/api/test_disambiguator.py
index 8f989ef..e9fe47a 100644
--- a/src/test/python/apache/aurora/client/api/test_disambiguator.py
+++ b/src/test/python/apache/aurora/client/api/test_disambiguator.py
@@ -16,23 +16,16 @@
 
 import functools
 
+import mox
+import pytest
+
 from apache.aurora.client.api import AuroraClientAPI
 from apache.aurora.client.api.disambiguator import LiveJobDisambiguator
 from apache.aurora.common.aurora_job_key import AuroraJobKey
 from apache.aurora.common.cluster import Cluster
 
 from gen.apache.aurora.api.constants import ResponseCode
-from gen.apache.aurora.api.ttypes import (
-   Response,
-   Result,
-   GetJobsResult,
-   JobConfiguration,
-   JobKey,
-)
-
-import mox
-import pytest
-
+from gen.apache.aurora.api.ttypes import GetJobsResult, JobConfiguration, JobKey, Response, Result
 
 TEST_CLUSTER = Cluster(name = 'smf1')
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/api/test_health_check.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/api/test_health_check.py b/src/test/python/apache/aurora/client/api/test_health_check.py
index 946b905..15bd75c 100644
--- a/src/test/python/apache/aurora/client/api/test_health_check.py
+++ b/src/test/python/apache/aurora/client/api/test_health_check.py
@@ -16,6 +16,9 @@
 
 import unittest
 
+import mox
+import pytest
+
 from apache.aurora.client.api.health_check import (
     HealthCheck,
     NotRetriable,
@@ -23,16 +26,7 @@ from apache.aurora.client.api.health_check import (
     StatusHealthCheck
 )
 
-from gen.apache.aurora.api.ttypes import (
-    AssignedTask,
-    ScheduledTask,
-    ScheduleStatus,
-    TaskConfig
-)
-
-import mox
-import pytest
-
+from gen.apache.aurora.api.ttypes import AssignedTask, ScheduledTask, ScheduleStatus, TaskConfig
 
 PENDING = ScheduleStatus.PENDING
 RUNNING = ScheduleStatus.RUNNING

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/api/test_instance_watcher.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/api/test_instance_watcher.py b/src/test/python/apache/aurora/client/api/test_instance_watcher.py
index 18c9a87..09dda3b 100644
--- a/src/test/python/apache/aurora/client/api/test_instance_watcher.py
+++ b/src/test/python/apache/aurora/client/api/test_instance_watcher.py
@@ -14,16 +14,16 @@
 # limitations under the License.
 #
 
-from math import ceil
 import unittest
+from math import ceil
+
+import mox
 
 from apache.aurora.client.api.health_check import HealthCheck
 from apache.aurora.client.api.instance_watcher import InstanceWatcher
 
-from gen.apache.aurora.api.ttypes import *
 from gen.apache.aurora.api.AuroraSchedulerManager import Client as scheduler_client
-
-import mox
+from gen.apache.aurora.api.ttypes import *
 
 
 class FakeClock(object):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/api/test_job_monitor.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/api/test_job_monitor.py b/src/test/python/apache/aurora/client/api/test_job_monitor.py
index bfb7fed..3df0420 100644
--- a/src/test/python/apache/aurora/client/api/test_job_monitor.py
+++ b/src/test/python/apache/aurora/client/api/test_job_monitor.py
@@ -15,6 +15,12 @@
 #
 import unittest
 
+from mock import Mock
+
+from apache.aurora.client.api import AuroraClientAPI
+from apache.aurora.client.api.job_monitor import JobMonitor
+from apache.aurora.common.aurora_job_key import AuroraJobKey
+
 from gen.apache.aurora.api.AuroraSchedulerManager import Client
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
@@ -22,17 +28,12 @@ from gen.apache.aurora.api.ttypes import (
     Response,
     ResponseCode,
     Result,
+    ScheduledTask,
     ScheduleStatus,
     ScheduleStatusResult,
-    ScheduledTask,
     TaskEvent,
-    TaskQuery,
+    TaskQuery
 )
-from apache.aurora.client.api import AuroraClientAPI
-from apache.aurora.client.api.job_monitor import JobMonitor
-from apache.aurora.common.aurora_job_key import AuroraJobKey
-
-from mock import Mock
 
 
 class FakeClock(object):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/api/test_quota_check.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/api/test_quota_check.py b/src/test/python/apache/aurora/client/api/test_quota_check.py
index 229f9a5..854a98c 100644
--- a/src/test/python/apache/aurora/client/api/test_quota_check.py
+++ b/src/test/python/apache/aurora/client/api/test_quota_check.py
@@ -15,9 +15,10 @@
 #
 
 import unittest
-
 from copy import deepcopy
 
+from mock import Mock
+
 from apache.aurora.client.api.quota_check import CapacityRequest, QuotaCheck
 
 from gen.apache.aurora.api.AuroraSchedulerManager import Client as scheduler_client
@@ -27,9 +28,8 @@ from gen.apache.aurora.api.ttypes import (
     ResourceAggregate,
     Response,
     ResponseCode,
-    Result)
-
-from mock import Mock
+    Result
+)
 
 
 class QuotaCheckTest(unittest.TestCase):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/api/test_restarter.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/api/test_restarter.py b/src/test/python/apache/aurora/client/api/test_restarter.py
index b0e092b..8079945 100644
--- a/src/test/python/apache/aurora/client/api/test_restarter.py
+++ b/src/test/python/apache/aurora/client/api/test_restarter.py
@@ -14,18 +14,18 @@
 # limitations under the License.
 #
 
-from apache.aurora.client.api.restarter import Restarter
+from mox import IgnoreArg, MoxTestBase
+
 from apache.aurora.client.api.instance_watcher import InstanceWatcher
+from apache.aurora.client.api.restarter import Restarter
 from apache.aurora.client.api.updater_util import UpdaterConfig
+from apache.aurora.client.fake_scheduler_proxy import FakeSchedulerProxy
 from apache.aurora.common.aurora_job_key import AuroraJobKey
 
 from gen.apache.aurora.api.AuroraSchedulerManager import Client as scheduler_client
 from gen.apache.aurora.api.ttypes import *
 
-from mox import IgnoreArg, MoxTestBase
-
 # test space
-from apache.aurora.client.fake_scheduler_proxy import FakeSchedulerProxy
 
 
 SESSION_KEY = 'test_session'

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/api/test_scheduler_client.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/api/test_scheduler_client.py b/src/test/python/apache/aurora/client/api/test_scheduler_client.py
index 2736d67..399d4c6 100644
--- a/src/test/python/apache/aurora/client/api/test_scheduler_client.py
+++ b/src/test/python/apache/aurora/client/api/test_scheduler_client.py
@@ -17,20 +17,19 @@
 import inspect
 import unittest
 
-from apache.aurora.common.cluster import Cluster
-import apache.aurora.client.api.scheduler_client as scheduler_client
+from mox import IgnoreArg, IsA, Mox
 from twitter.common.quantity import Amount, Time
 from twitter.common.zookeeper.kazoo_client import TwitterKazooClient
 from twitter.common.zookeeper.serverset.endpoint import ServiceInstance
 
+import apache.aurora.client.api.scheduler_client as scheduler_client
+from apache.aurora.common.cluster import Cluster
+
 import gen.apache.aurora.api.AuroraAdmin as AuroraAdmin
 import gen.apache.aurora.api.AuroraSchedulerManager as AuroraSchedulerManager
-from gen.apache.aurora.api.constants import DEFAULT_ENVIRONMENT, CURRENT_API_VERSION
+from gen.apache.aurora.api.constants import CURRENT_API_VERSION, DEFAULT_ENVIRONMENT
 from gen.apache.aurora.api.ttypes import *
 
-from mox import IgnoreArg, IsA, Mox
-
-
 ROLE = 'foorole'
 JOB_NAME = 'barjobname'
 JOB_KEY = JobKey(role=ROLE, environment=DEFAULT_ENVIRONMENT, name=JOB_NAME)

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/api/test_sla.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/api/test_sla.py b/src/test/python/apache/aurora/client/api/test_sla.py
index 17bd72b..86b6775 100644
--- a/src/test/python/apache/aurora/client/api/test_sla.py
+++ b/src/test/python/apache/aurora/client/api/test_sla.py
@@ -17,12 +17,9 @@
 import time
 import unittest
 
-from apache.aurora.client.api.sla import (
-    DomainUpTimeSlaVector,
-    JobUpTimeSlaVector,
-    Sla,
-    task_query
-)
+from mock import call, Mock, patch
+
+from apache.aurora.client.api.sla import DomainUpTimeSlaVector, JobUpTimeSlaVector, Sla, task_query
 from apache.aurora.common.aurora_job_key import AuroraJobKey
 from apache.aurora.common.cluster import Cluster
 
@@ -34,16 +31,14 @@ from gen.apache.aurora.api.ttypes import (
     Response,
     ResponseCode,
     Result,
+    ScheduledTask,
     ScheduleStatus,
     ScheduleStatusResult,
-    ScheduledTask,
     TaskConfig,
     TaskEvent,
     TaskQuery
 )
 
-from mock import call, Mock, patch
-
 
 class SlaTest(unittest.TestCase):
   def setUp(self):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/api/test_updater.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/api/test_updater.py b/src/test/python/apache/aurora/client/api/test_updater.py
index 4c931d5..03a1418 100644
--- a/src/test/python/apache/aurora/client/api/test_updater.py
+++ b/src/test/python/apache/aurora/client/api/test_updater.py
@@ -18,6 +18,9 @@ from copy import deepcopy
 from os import environ
 from unittest import TestCase
 
+from mox import MockObject, Replay, Verify
+from pytest import raises
+
 from apache.aurora.client.api.instance_watcher import InstanceWatcher
 from apache.aurora.client.api.job_monitor import JobMonitor
 from apache.aurora.client.api.quota_check import CapacityRequest, QuotaCheck
@@ -28,35 +31,32 @@ from apache.aurora.common.aurora_job_key import AuroraJobKey
 from gen.apache.aurora.api.AuroraSchedulerManager import Client as scheduler_client
 from gen.apache.aurora.api.constants import ACTIVE_STATES
 from gen.apache.aurora.api.ttypes import (
-  AddInstancesConfig,
-  AcquireLockResult,
-  AssignedTask,
-  Constraint,
-  ExecutorConfig,
-  JobConfiguration,
-  JobKey,
-  Identity,
-  LimitConstraint,
-  Lock,
-  LockKey,
-  LockValidation,
-  Metadata,
-  PopulateJobResult,
-  ResourceAggregate,
-  Response,
-  ResponseCode,
-  Result,
-  ScheduleStatusResult,
-  ScheduledTask,
-  TaskConfig,
-  TaskConstraint,
-  TaskQuery,
-  ValueConstraint,
+    AcquireLockResult,
+    AddInstancesConfig,
+    AssignedTask,
+    Constraint,
+    ExecutorConfig,
+    Identity,
+    JobConfiguration,
+    JobKey,
+    LimitConstraint,
+    Lock,
+    LockKey,
+    LockValidation,
+    Metadata,
+    PopulateJobResult,
+    ResourceAggregate,
+    Response,
+    ResponseCode,
+    Result,
+    ScheduledTask,
+    ScheduleStatusResult,
+    TaskConfig,
+    TaskConstraint,
+    TaskQuery,
+    ValueConstraint
 )
 
-from mox import MockObject, Replay, Verify
-from pytest import raises
-
 # Debug output helper -> enables log.* in source.
 if 'UPDATER_DEBUG' in environ:
   from twitter.common import log
@@ -827,4 +827,3 @@ class UpdaterTest(TestCase):
 
     self.update_and_expect_response(ResponseCode.ERROR)
     self.verify_mocks()
-

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/cli/test_bridge.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_bridge.py b/src/test/python/apache/aurora/client/cli/test_bridge.py
index 094bc1c..70084c3 100644
--- a/src/test/python/apache/aurora/client/cli/test_bridge.py
+++ b/src/test/python/apache/aurora/client/cli/test_bridge.py
@@ -85,4 +85,3 @@ class TestBridgedCommandLine(unittest.TestCase):
     bridge2 = Bridge([self.two, self.one, self.three])
     assert bridge1.execute(['test', 'three']) == 1
     assert bridge2.execute(['test', 'three']) == 2
-

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/cli/test_cancel_update.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_cancel_update.py b/src/test/python/apache/aurora/client/cli/test_cancel_update.py
index f27781c..6fa26dd 100644
--- a/src/test/python/apache/aurora/client/cli/test_cancel_update.py
+++ b/src/test/python/apache/aurora/client/cli/test_cancel_update.py
@@ -16,21 +16,21 @@
 
 import contextlib
 
+from mock import Mock, patch
+from twitter.common.contextutil import temporary_file
+
 from apache.aurora.client.cli.client import AuroraCommandLine
 from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
 from apache.aurora.common.aurora_job_key import AuroraJobKey
-from twitter.common.contextutil import temporary_file
 
 from gen.apache.aurora.api.ttypes import (
     Identity,
     JobKey,
     ScheduleStatus,
     ScheduleStatusResult,
-    TaskQuery,
+    TaskQuery
 )
 
-from mock import Mock, patch
-
 
 class TestClientCancelUpdateCommand(AuroraClientCommandTest):
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/cli/test_command_hooks.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_command_hooks.py b/src/test/python/apache/aurora/client/cli/test_command_hooks.py
index 8835d82..7bdf367 100644
--- a/src/test/python/apache/aurora/client/cli/test_command_hooks.py
+++ b/src/test/python/apache/aurora/client/cli/test_command_hooks.py
@@ -16,6 +16,15 @@
 
 import contextlib
 
+from mock import Mock, patch
+from twitter.common.contextutil import temporary_file
+
+from apache.aurora.client.cli import EXIT_PERMISSION_VIOLATION
+from apache.aurora.client.cli.client import AuroraCommandLine
+from apache.aurora.client.cli.command_hooks import CommandHook, GlobalCommandHookRegistry
+from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
+from apache.aurora.config import AuroraConfig
+
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
     Identity,
@@ -23,18 +32,9 @@ from gen.apache.aurora.api.ttypes import (
     ScheduleStatus,
     ScheduleStatusResult,
     TaskEvent,
-    TaskQuery,
+    TaskQuery
 )
 
-from apache.aurora.client.cli import EXIT_PERMISSION_VIOLATION
-from apache.aurora.client.cli.client import AuroraCommandLine
-from apache.aurora.client.cli.command_hooks import CommandHook, GlobalCommandHookRegistry
-from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
-from apache.aurora.config import AuroraConfig
-
-from mock import Mock, patch
-from twitter.common.contextutil import temporary_file
-
 
 class HookForTesting(CommandHook):
   def __init__(self, succeed):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/cli/test_create.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_create.py b/src/test/python/apache/aurora/client/cli/test_create.py
index 96dc592..ba1d1fb 100644
--- a/src/test/python/apache/aurora/client/cli/test_create.py
+++ b/src/test/python/apache/aurora/client/cli/test_create.py
@@ -16,8 +16,15 @@
 
 import contextlib
 
+from mock import Mock, patch
 from twitter.common.contextutil import temporary_file
 
+from apache.aurora.client.cli import EXIT_COMMAND_FAILURE, EXIT_INVALID_CONFIGURATION
+from apache.aurora.client.cli.client import AuroraCommandLine
+from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
+from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
+from apache.aurora.config import AuroraConfig
+
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
     Identity,
@@ -25,19 +32,9 @@ from gen.apache.aurora.api.ttypes import (
     ScheduleStatus,
     ScheduleStatusResult,
     TaskEvent,
-    TaskQuery,
+    TaskQuery
 )
 
-from apache.aurora.client.cli import (
-    EXIT_COMMAND_FAILURE,
-    EXIT_INVALID_CONFIGURATION
-)
-from apache.aurora.client.cli.client import AuroraCommandLine
-from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
-from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
-from apache.aurora.config import AuroraConfig
-from mock import Mock, patch
-
 
 class TestClientCreateCommand(AuroraClientCommandTest):
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/cli/test_diff.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_diff.py b/src/test/python/apache/aurora/client/cli/test_diff.py
index f0a9e93..00a7f0b 100644
--- a/src/test/python/apache/aurora/client/cli/test_diff.py
+++ b/src/test/python/apache/aurora/client/cli/test_diff.py
@@ -17,10 +17,10 @@
 import contextlib
 import os
 
-from apache.aurora.client.cli import (
-    EXIT_INVALID_CONFIGURATION,
-    EXIT_INVALID_PARAMETER
-)
+from mock import Mock, patch
+from twitter.common.contextutil import temporary_file
+
+from apache.aurora.client.cli import EXIT_INVALID_CONFIGURATION, EXIT_INVALID_PARAMETER
 from apache.aurora.client.cli.client import AuroraCommandLine
 from apache.aurora.client.cli.util import AuroraClientCommandTest
 
@@ -37,12 +37,9 @@ from gen.apache.aurora.api.ttypes import (
     ScheduleStatusResult,
     TaskConfig,
     TaskEvent,
-    TaskQuery,
+    TaskQuery
 )
 
-from mock import Mock, patch
-from twitter.common.contextutil import temporary_file
-
 
 class TestDiffCommand(AuroraClientCommandTest):
   @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/cli/test_help.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_help.py b/src/test/python/apache/aurora/client/cli/test_help.py
index 12d8671..bd8e2e1 100644
--- a/src/test/python/apache/aurora/client/cli/test_help.py
+++ b/src/test/python/apache/aurora/client/cli/test_help.py
@@ -17,11 +17,11 @@
 import contextlib
 import unittest
 
+from mock import patch
+
 from apache.aurora.client.cli import EXIT_INVALID_PARAMETER, EXIT_OK
 from apache.aurora.client.cli.client import AuroraCommandLine
 
-from mock import patch
-
 
 class TestHelp(unittest.TestCase):
   """Tests of the help command for the Aurora v2 client framework"""

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/cli/test_kill.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_kill.py b/src/test/python/apache/aurora/client/cli/test_kill.py
index 4f62c46..3c8e72d 100644
--- a/src/test/python/apache/aurora/client/cli/test_kill.py
+++ b/src/test/python/apache/aurora/client/cli/test_kill.py
@@ -17,6 +17,7 @@
 import contextlib
 import unittest
 
+from mock import Mock, patch
 from twitter.common.contextutil import temporary_file
 
 from apache.aurora.client.cli import EXIT_TIMEOUT
@@ -25,20 +26,17 @@ from apache.aurora.client.cli.options import parse_instances
 from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
 from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
 from apache.aurora.common.aurora_job_key import AuroraJobKey
-from twitter.common.contextutil import temporary_file
 
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
     Identity,
+    ScheduledTask,
     ScheduleStatus,
     ScheduleStatusResult,
-    ScheduledTask,
     TaskEvent,
-    TaskQuery,
+    TaskQuery
 )
 
-from mock import Mock, patch
-
 
 class TestInstancesParser(unittest.TestCase):
   def test_parse_instances(self):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/cli/test_logging.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_logging.py b/src/test/python/apache/aurora/client/cli/test_logging.py
index 6051ba9..d236626 100644
--- a/src/test/python/apache/aurora/client/cli/test_logging.py
+++ b/src/test/python/apache/aurora/client/cli/test_logging.py
@@ -17,8 +17,13 @@
 import logging
 from logging import Handler
 
+from mock import Mock, patch
 from twitter.common.contextutil import temporary_file
 
+from apache.aurora.client.cli.client import AuroraCommandLine
+from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
+from apache.aurora.config import AuroraConfig
+
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
     Identity,
@@ -26,14 +31,9 @@ from gen.apache.aurora.api.ttypes import (
     ScheduleStatus,
     ScheduleStatusResult,
     TaskEvent,
-    TaskQuery,
+    TaskQuery
 )
 
-from apache.aurora.client.cli.client import AuroraCommandLine
-from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
-from apache.aurora.config import AuroraConfig
-from mock import Mock, patch
-
 
 class MockHandler(Handler):
   def __init__(self):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/cli/test_open.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_open.py b/src/test/python/apache/aurora/client/cli/test_open.py
index ef816ad..601d5d7 100644
--- a/src/test/python/apache/aurora/client/cli/test_open.py
+++ b/src/test/python/apache/aurora/client/cli/test_open.py
@@ -16,10 +16,12 @@
 
 import contextlib
 
-from apache.aurora.client.cli import EXIT_OK, EXIT_INVALID_PARAMETER
+from mock import Mock, patch
+
+from apache.aurora.client.cli import EXIT_INVALID_PARAMETER, EXIT_OK
 from apache.aurora.client.cli.client import AuroraCommandLine
 from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
-from mock import Mock, patch
+
 
 class TestClientOpenCommand(AuroraClientCommandTest):
 
@@ -61,5 +63,3 @@ class TestClientOpenCommand(AuroraClientCommandTest):
       cmd = AuroraCommandLine()
       self.assertRaises(SystemExit, cmd.execute, (['job', 'open']))
       assert mock_context.showed_urls == []
-
-

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/cli/test_plugins.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_plugins.py b/src/test/python/apache/aurora/client/cli/test_plugins.py
index 21c4400..95edbe3 100644
--- a/src/test/python/apache/aurora/client/cli/test_plugins.py
+++ b/src/test/python/apache/aurora/client/cli/test_plugins.py
@@ -16,30 +16,30 @@
 
 import contextlib
 
+from mock import Mock, patch
 from twitter.common.contextutil import temporary_file
 
-from gen.apache.aurora.api.ttypes import (
-    AssignedTask,
-    Identity,
-    ScheduledTask,
-    ScheduleStatus,
-    ScheduleStatusResult,
-    TaskEvent,
-    TaskQuery,
-)
-
 from apache.aurora.client.cli import (
     ConfigurationPlugin,
     EXIT_COMMAND_FAILURE,
     EXIT_INVALID_CONFIGURATION,
-    EXIT_OK,
+    EXIT_OK
 )
 from apache.aurora.client.cli.client import AuroraCommandLine
 from apache.aurora.client.cli.options import CommandOption
 from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
 from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
 from apache.aurora.config import AuroraConfig
-from mock import Mock, patch
+
+from gen.apache.aurora.api.ttypes import (
+    AssignedTask,
+    Identity,
+    ScheduledTask,
+    ScheduleStatus,
+    ScheduleStatusResult,
+    TaskEvent,
+    TaskQuery
+)
 
 
 class BogusPlugin(ConfigurationPlugin):
@@ -202,4 +202,3 @@ class TestPlugins(AuroraClientCommandTest):
       assert not any('list' in t for t in self.transcript)
       assert "Options:" in self.transcript
       assert any('bogosity' in t for t in self.transcript)
-

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/cli/test_quota.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_quota.py b/src/test/python/apache/aurora/client/cli/test_quota.py
index 44908d2..9172f13 100644
--- a/src/test/python/apache/aurora/client/cli/test_quota.py
+++ b/src/test/python/apache/aurora/client/cli/test_quota.py
@@ -17,15 +17,12 @@
 import contextlib
 import json
 
+from mock import patch
+
 from apache.aurora.client.cli.client import AuroraCommandLine
 from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
 
-from gen.apache.aurora.api.ttypes import (
-  GetQuotaResult,
-  ResourceAggregate,
-  )
-
-from mock import patch
+from gen.apache.aurora.api.ttypes import GetQuotaResult, ResourceAggregate
 
 
 class TestGetQuotaCommand(AuroraClientCommandTest):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/cli/test_restart.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_restart.py b/src/test/python/apache/aurora/client/cli/test_restart.py
index 7749580..d365ef4 100644
--- a/src/test/python/apache/aurora/client/cli/test_restart.py
+++ b/src/test/python/apache/aurora/client/cli/test_restart.py
@@ -16,24 +16,23 @@
 import contextlib
 import functools
 
-from apache.aurora.client.api.health_check import StatusHealthCheck, Retriable
+from mock import Mock, patch
+from twitter.common.contextutil import temporary_file
+
+from apache.aurora.client.api.health_check import Retriable, StatusHealthCheck
 from apache.aurora.client.cli import EXIT_API_ERROR
 from apache.aurora.client.cli.client import AuroraCommandLine
 from apache.aurora.client.cli.util import AuroraClientCommandTest
 
-from twitter.common.contextutil import temporary_file
-
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
     JobKey,
     PopulateJobResult,
     ScheduledTask,
     ScheduleStatusResult,
-    TaskConfig,
+    TaskConfig
 )
 
-from mock import Mock, patch
-
 
 class TestRestartCommand(AuroraClientCommandTest):
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/cli/test_sla.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_sla.py b/src/test/python/apache/aurora/client/cli/test_sla.py
index 7d0381c..9a02e89 100644
--- a/src/test/python/apache/aurora/client/cli/test_sla.py
+++ b/src/test/python/apache/aurora/client/cli/test_sla.py
@@ -16,11 +16,11 @@
 
 import contextlib
 
+from mock import Mock, patch
+
 from apache.aurora.client.cli.client import AuroraCommandLine
 from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
 
-from mock import Mock, patch
-
 
 class TestGetTaskUpCountCommand(AuroraClientCommandTest):
   @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/cli/test_status.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_status.py b/src/test/python/apache/aurora/client/cli/test_status.py
index a8269ac..c440849 100644
--- a/src/test/python/apache/aurora/client/cli/test_status.py
+++ b/src/test/python/apache/aurora/client/cli/test_status.py
@@ -16,6 +16,13 @@
 
 import contextlib
 
+from mock import call, Mock, patch
+
+from apache.aurora.client.cli import EXIT_INVALID_PARAMETER
+from apache.aurora.client.cli.client import AuroraCommandLine
+from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
+from apache.aurora.common.aurora_job_key import AuroraJobKey
+
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
     Identity,
@@ -25,18 +32,9 @@ from gen.apache.aurora.api.ttypes import (
     ScheduleStatusResult,
     TaskConfig,
     TaskEvent,
-    TaskQuery,
+    TaskQuery
 )
 
-from apache.aurora.client.cli import (
-    EXIT_INVALID_PARAMETER
-)
-from apache.aurora.client.cli.client import AuroraCommandLine
-from apache.aurora.common.aurora_job_key import AuroraJobKey
-from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
-
-from mock import call, Mock, patch
-
 
 class TestJobStatus(AuroraClientCommandTest):
   @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/cli/test_task_run.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_task_run.py b/src/test/python/apache/aurora/client/cli/test_task_run.py
index fba812e..c60189c 100644
--- a/src/test/python/apache/aurora/client/cli/test_task_run.py
+++ b/src/test/python/apache/aurora/client/cli/test_task_run.py
@@ -15,12 +15,13 @@
 #
 
 import contextlib
+
 from mock import Mock, patch
 
 from apache.aurora.client.cli import EXIT_INVALID_PARAMETER
 from apache.aurora.client.cli.client import AuroraCommandLine
-from apache.aurora.common.aurora_job_key import AuroraJobKey
 from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
+from apache.aurora.common.aurora_job_key import AuroraJobKey
 
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
@@ -31,7 +32,7 @@ from gen.apache.aurora.api.ttypes import (
     ScheduleStatusResult,
     TaskConfig,
     TaskEvent,
-    TaskQuery,
+    TaskQuery
 )
 
 
@@ -191,4 +192,3 @@ class TestSshCommand(AuroraClientCommandTest):
       mock_subprocess.assert_called_with(['ssh', '-t', 'bozo@slavehost',
           'cd /slaveroot/slaves/*/frameworks/*/executors/thermos-1287391823/runs/'
           'slaverun/sandbox;ls'])
-

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/cli/test_update.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_update.py b/src/test/python/apache/aurora/client/cli/test_update.py
index 854d583..a357c44 100644
--- a/src/test/python/apache/aurora/client/cli/test_update.py
+++ b/src/test/python/apache/aurora/client/cli/test_update.py
@@ -16,12 +16,13 @@
 import contextlib
 import functools
 
+from mock import Mock, patch
 from twitter.common.contextutil import temporary_file
 
-from apache.aurora.client.api.updater import Updater
-from apache.aurora.client.api.health_check import StatusHealthCheck, Retriable
+from apache.aurora.client.api.health_check import Retriable, StatusHealthCheck
 from apache.aurora.client.api.job_monitor import JobMonitor
 from apache.aurora.client.api.quota_check import QuotaCheck
+from apache.aurora.client.api.updater import Updater
 from apache.aurora.client.cli import EXIT_INVALID_CONFIGURATION
 from apache.aurora.client.cli.client import AuroraCommandLine
 from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext
@@ -43,8 +44,6 @@ from gen.apache.aurora.api.ttypes import (
     TaskQuery
 )
 
-from mock import Mock, patch
-
 
 class TestUpdateCommand(AuroraClientCommandTest):
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/cli/util.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/util.py b/src/test/python/apache/aurora/client/cli/util.py
index e17f256..9d51a2e 100644
--- a/src/test/python/apache/aurora/client/cli/util.py
+++ b/src/test/python/apache/aurora/client/cli/util.py
@@ -16,25 +16,25 @@
 
 import unittest
 
+from mock import Mock
+
+from apache.aurora.client.cli.context import AuroraCommandContext
+from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
+from apache.aurora.common.cluster import Cluster
+from apache.aurora.common.clusters import Clusters
+
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
     Response,
     ResponseCode,
     Result,
+    ScheduledTask,
     ScheduleStatus,
     ScheduleStatusResult,
-    ScheduledTask,
     TaskConfig,
-    TaskEvent,
+    TaskEvent
 )
 
-from apache.aurora.client.cli.context import AuroraCommandContext
-from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
-from apache.aurora.common.cluster import Cluster
-from apache.aurora.common.clusters import Clusters
-
-from mock import Mock
-
 
 class FakeAuroraCommandContext(AuroraCommandContext):
   def __init__(self):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/commands/test_admin_sla.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_admin_sla.py b/src/test/python/apache/aurora/client/commands/test_admin_sla.py
index cb86f83..df007f2 100644
--- a/src/test/python/apache/aurora/client/commands/test_admin_sla.py
+++ b/src/test/python/apache/aurora/client/commands/test_admin_sla.py
@@ -15,20 +15,17 @@
 #
 
 import contextlib
-
 from collections import defaultdict
 
+from mock import Mock, patch
+from twitter.common.contextutil import temporary_file
+
 from apache.aurora.client.api import AuroraClientAPI
 from apache.aurora.client.api.sla import DomainUpTimeSlaVector
 from apache.aurora.client.commands.admin import sla_list_safe_domain, sla_probe_hosts
 from apache.aurora.client.commands.util import AuroraClientCommandTest
 from apache.aurora.common.aurora_job_key import AuroraJobKey
 
-from twitter.common.contextutil import temporary_file
-
-from mock import Mock, patch
-
-
 MIN_INSTANCE_COUNT = 1
 
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/commands/test_cancel_update.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_cancel_update.py b/src/test/python/apache/aurora/client/commands/test_cancel_update.py
index d765431..6473d33 100644
--- a/src/test/python/apache/aurora/client/commands/test_cancel_update.py
+++ b/src/test/python/apache/aurora/client/commands/test_cancel_update.py
@@ -17,24 +17,24 @@
 import contextlib
 import unittest
 
-from apache.aurora.common.cluster import Cluster
-from apache.aurora.common.clusters import Clusters
+from mock import Mock, patch
+from twitter.common.contextutil import temporary_file
+
 from apache.aurora.client.commands.core import cancel_update
 from apache.aurora.client.commands.util import AuroraClientCommandTest
 from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
 from apache.aurora.common.aurora_job_key import AuroraJobKey
-from twitter.common.contextutil import temporary_file
+from apache.aurora.common.cluster import Cluster
+from apache.aurora.common.clusters import Clusters
 
 from gen.apache.aurora.api.ttypes import (
     Identity,
     JobKey,
     ScheduleStatus,
     ScheduleStatusResult,
-    TaskQuery,
+    TaskQuery
 )
 
-from mock import Mock, patch
-
 
 class TestClientCancelUpdateCommand(AuroraClientCommandTest):
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/commands/test_create.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_create.py b/src/test/python/apache/aurora/client/commands/test_create.py
index 328b980..09a392f 100644
--- a/src/test/python/apache/aurora/client/commands/test_create.py
+++ b/src/test/python/apache/aurora/client/commands/test_create.py
@@ -17,13 +17,15 @@
 import contextlib
 import unittest
 
+from mock import Mock, patch
+from pystachio.config import Config
+from twitter.common import app
+from twitter.common.contextutil import temporary_file
 
 from apache.aurora.client.commands.core import create
 from apache.aurora.client.commands.util import AuroraClientCommandTest
 from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
 from apache.aurora.config import AuroraConfig
-from twitter.common import app
-from twitter.common.contextutil import temporary_file
 
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
@@ -35,12 +37,9 @@ from gen.apache.aurora.api.ttypes import (
     ScheduleStatus,
     ScheduleStatusResult,
     TaskEvent,
-    TaskQuery,
+    TaskQuery
 )
 
-from mock import Mock, patch
-from pystachio.config import Config
-
 
 class TestClientCreateCommand(AuroraClientCommandTest):
   @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/commands/test_diff.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_diff.py b/src/test/python/apache/aurora/client/commands/test_diff.py
index a9d4581..86e6cf0 100644
--- a/src/test/python/apache/aurora/client/commands/test_diff.py
+++ b/src/test/python/apache/aurora/client/commands/test_diff.py
@@ -17,9 +17,12 @@
 import contextlib
 import os
 
+from mock import Mock, patch
+from pystachio.config import Config
+from twitter.common.contextutil import temporary_file
+
 from apache.aurora.client.commands.core import diff
 from apache.aurora.client.commands.util import AuroraClientCommandTest
-from twitter.common.contextutil import temporary_file
 
 from gen.apache.aurora.api.constants import ACTIVE_STATES
 from gen.apache.aurora.api.ttypes import (
@@ -34,12 +37,9 @@ from gen.apache.aurora.api.ttypes import (
     ScheduleStatusResult,
     TaskConfig,
     TaskEvent,
-    TaskQuery,
+    TaskQuery
 )
 
-from mock import Mock, patch
-from pystachio.config import Config
-
 
 class TestDiffCommand(AuroraClientCommandTest):
   @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/commands/test_hooks.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_hooks.py b/src/test/python/apache/aurora/client/commands/test_hooks.py
index 97ec14e..5e4227f 100644
--- a/src/test/python/apache/aurora/client/commands/test_hooks.py
+++ b/src/test/python/apache/aurora/client/commands/test_hooks.py
@@ -17,12 +17,15 @@
 import contextlib
 import unittest
 
+from mock import Mock, patch
+from pystachio.config import Config
+from twitter.common import app
+from twitter.common.contextutil import temporary_file
+
 from apache.aurora.client.commands.core import create
 from apache.aurora.client.commands.util import AuroraClientCommandTest
 from apache.aurora.client.config import AuroraConfig, GlobalHookRegistry
 from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
-from twitter.common import app
-from twitter.common.contextutil import temporary_file
 
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
@@ -34,12 +37,9 @@ from gen.apache.aurora.api.ttypes import (
     ScheduleStatus,
     ScheduleStatusResult,
     TaskEvent,
-    TaskQuery,
+    TaskQuery
 )
 
-from mock import Mock, patch
-from pystachio.config import Config
-
 
 class CreateHookForTesting(object):
   def __init__(self, succeed):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/commands/test_kill.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_kill.py b/src/test/python/apache/aurora/client/commands/test_kill.py
index 65c8dde..bc3b92b 100644
--- a/src/test/python/apache/aurora/client/commands/test_kill.py
+++ b/src/test/python/apache/aurora/client/commands/test_kill.py
@@ -17,13 +17,15 @@
 import contextlib
 import unittest
 
-from apache.aurora.common.cluster import Cluster
-from apache.aurora.common.clusters import Clusters
+from mock import Mock, patch
+from twitter.common.contextutil import temporary_file
+
 from apache.aurora.client.commands.core import kill, killall
+from apache.aurora.client.commands.util import AuroraClientCommandTest
 from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
 from apache.aurora.common.aurora_job_key import AuroraJobKey
-from twitter.common.contextutil import temporary_file
-from apache.aurora.client.commands.util import AuroraClientCommandTest
+from apache.aurora.common.cluster import Cluster
+from apache.aurora.common.clusters import Clusters
 
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
@@ -33,14 +35,11 @@ from gen.apache.aurora.api.ttypes import (
     Result,
     ScheduledTask,
     ScheduleStatus,
-    ScheduledTask,
     ScheduleStatusResult,
     TaskEvent,
-    TaskQuery,
+    TaskQuery
 )
 
-from mock import Mock, patch
-
 
 class TestClientKillCommand(AuroraClientCommandTest):
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/commands/test_listjobs.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_listjobs.py b/src/test/python/apache/aurora/client/commands/test_listjobs.py
index 092b707..2afbc98 100644
--- a/src/test/python/apache/aurora/client/commands/test_listjobs.py
+++ b/src/test/python/apache/aurora/client/commands/test_listjobs.py
@@ -17,17 +17,14 @@
 import contextlib
 import unittest
 
-from apache.aurora.common.cluster import Cluster
-from apache.aurora.common.clusters import Clusters
+from mock import Mock, patch
+
 from apache.aurora.client.commands.core import list_jobs
 from apache.aurora.client.commands.util import AuroraClientCommandTest
+from apache.aurora.common.cluster import Cluster
+from apache.aurora.common.clusters import Clusters
 
-from gen.apache.aurora.api.ttypes import (
-    GetJobsResult,
-    JobKey,
-)
-
-from mock import Mock, patch
+from gen.apache.aurora.api.ttypes import GetJobsResult, JobKey
 
 
 class TestListJobs(AuroraClientCommandTest):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/commands/test_maintenance.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_maintenance.py b/src/test/python/apache/aurora/client/commands/test_maintenance.py
index c684a52..99cbb15 100644
--- a/src/test/python/apache/aurora/client/commands/test_maintenance.py
+++ b/src/test/python/apache/aurora/client/commands/test_maintenance.py
@@ -16,13 +16,15 @@
 
 import contextlib
 
-from apache.aurora.client.commands.util import AuroraClientCommandTest
+from mock import Mock, patch
+
 from apache.aurora.client.commands.maintenance import (
     end_maintenance_hosts,
     host_maintenance_status,
     perform_maintenance_hosts,
-    start_maintenance_hosts,
+    start_maintenance_hosts
 )
+from apache.aurora.client.commands.util import AuroraClientCommandTest
 
 from gen.apache.aurora.api.ttypes import (
     DrainHostsResult,
@@ -31,11 +33,9 @@ from gen.apache.aurora.api.ttypes import (
     HostStatus,
     MaintenanceMode,
     MaintenanceStatusResult,
-    StartMaintenanceResult,
+    StartMaintenanceResult
 )
 
-from mock import Mock, patch
-
 
 class TestMaintenanceCommands(AuroraClientCommandTest):
   HOSTNAMES = ['us-grf-20', 'us-jim-47', 'us-suz-01']

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/commands/test_restart.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_restart.py b/src/test/python/apache/aurora/client/commands/test_restart.py
index 29da5ac..fba529f 100644
--- a/src/test/python/apache/aurora/client/commands/test_restart.py
+++ b/src/test/python/apache/aurora/client/commands/test_restart.py
@@ -17,10 +17,12 @@
 import contextlib
 import functools
 
+from mock import Mock, patch
+from twitter.common.contextutil import temporary_file
+
+from apache.aurora.client.api.health_check import Retriable, StatusHealthCheck
 from apache.aurora.client.commands.core import restart
 from apache.aurora.client.commands.util import AuroraClientCommandTest
-from apache.aurora.client.api.health_check import StatusHealthCheck, Retriable
-from twitter.common.contextutil import temporary_file
 
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
@@ -28,11 +30,9 @@ from gen.apache.aurora.api.ttypes import (
     PopulateJobResult,
     ScheduledTask,
     ScheduleStatusResult,
-    TaskConfig,
+    TaskConfig
 )
 
-from mock import Mock, patch
-
 
 class TestRestartCommand(AuroraClientCommandTest):
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/commands/test_run.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_run.py b/src/test/python/apache/aurora/client/commands/test_run.py
index dad238b..e9485d2 100644
--- a/src/test/python/apache/aurora/client/commands/test_run.py
+++ b/src/test/python/apache/aurora/client/commands/test_run.py
@@ -16,6 +16,8 @@
 
 import contextlib
 
+from mock import Mock, patch
+
 from apache.aurora.client.commands.run import run
 from apache.aurora.client.commands.util import AuroraClientCommandTest
 
@@ -29,11 +31,9 @@ from gen.apache.aurora.api.ttypes import (
     ScheduleStatusResult,
     TaskConfig,
     TaskEvent,
-    TaskQuery,
+    TaskQuery
 )
 
-from mock import Mock, patch
-
 
 class TestRunCommand(AuroraClientCommandTest):
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/commands/test_ssh.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_ssh.py b/src/test/python/apache/aurora/client/commands/test_ssh.py
index bfe24d4..5c6776e 100644
--- a/src/test/python/apache/aurora/client/commands/test_ssh.py
+++ b/src/test/python/apache/aurora/client/commands/test_ssh.py
@@ -16,6 +16,8 @@
 
 import contextlib
 
+from mock import Mock, patch
+
 from apache.aurora.client.commands.ssh import ssh
 from apache.aurora.client.commands.util import AuroraClientCommandTest
 
@@ -29,11 +31,9 @@ from gen.apache.aurora.api.ttypes import (
     ScheduleStatusResult,
     TaskConfig,
     TaskEvent,
-    TaskQuery,
+    TaskQuery
 )
 
-from mock import Mock, patch
-
 
 class TestSshCommand(AuroraClientCommandTest):
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/commands/test_status.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_status.py b/src/test/python/apache/aurora/client/commands/test_status.py
index 2b97702..f04f7ca 100644
--- a/src/test/python/apache/aurora/client/commands/test_status.py
+++ b/src/test/python/apache/aurora/client/commands/test_status.py
@@ -17,10 +17,12 @@
 import contextlib
 import unittest
 
-from apache.aurora.common.cluster import Cluster
-from apache.aurora.common.clusters import Clusters
+from mock import Mock, patch
+
 from apache.aurora.client.commands.core import status
 from apache.aurora.client.commands.util import AuroraClientCommandTest
+from apache.aurora.common.cluster import Cluster
+from apache.aurora.common.clusters import Clusters
 
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
@@ -31,11 +33,9 @@ from gen.apache.aurora.api.ttypes import (
     ScheduleStatusResult,
     TaskConfig,
     TaskEvent,
-    TaskQuery,
+    TaskQuery
 )
 
-from mock import Mock, patch
-
 
 class TestListJobs(AuroraClientCommandTest):
   @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/commands/test_update.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_update.py b/src/test/python/apache/aurora/client/commands/test_update.py
index d51579f..0b1e349 100644
--- a/src/test/python/apache/aurora/client/commands/test_update.py
+++ b/src/test/python/apache/aurora/client/commands/test_update.py
@@ -18,17 +18,19 @@ import contextlib
 import functools
 import unittest
 
-from apache.aurora.common.cluster import Cluster
-from apache.aurora.common.clusters import Clusters
+from mock import Mock, patch
+from twitter.common.contextutil import temporary_file
+
+from apache.aurora.client.api.health_check import Retriable, StatusHealthCheck
+from apache.aurora.client.api.job_monitor import JobMonitor
+from apache.aurora.client.api.quota_check import QuotaCheck
+from apache.aurora.client.api.updater import Updater
 from apache.aurora.client.commands.core import update
 from apache.aurora.client.commands.util import AuroraClientCommandTest
-from apache.aurora.client.api.updater import Updater
-from apache.aurora.client.api.health_check import StatusHealthCheck, Retriable
-from apache.aurora.client.api.quota_check import QuotaCheck
-from apache.aurora.client.api.job_monitor import JobMonitor
 from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
+from apache.aurora.common.cluster import Cluster
+from apache.aurora.common.clusters import Clusters
 from apache.aurora.config import AuroraConfig
-from twitter.common.contextutil import temporary_file
 
 from gen.apache.aurora.api.constants import ACTIVE_STATES
 from gen.apache.aurora.api.ttypes import (
@@ -47,8 +49,6 @@ from gen.apache.aurora.api.ttypes import (
     TaskQuery
 )
 
-from mock import Mock, patch
-
 
 class TestUpdateCommand(AuroraClientCommandTest):
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/commands/util.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/util.py b/src/test/python/apache/aurora/client/commands/util.py
index c28096f..fc9e2f1 100644
--- a/src/test/python/apache/aurora/client/commands/util.py
+++ b/src/test/python/apache/aurora/client/commands/util.py
@@ -16,17 +16,13 @@
 
 import unittest
 
+from mock import Mock
+
 from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
 from apache.aurora.common.cluster import Cluster
 from apache.aurora.common.clusters import Clusters
 
-from gen.apache.aurora.api.ttypes import (
-    Response,
-    ResponseCode,
-    Result,
-)
-
-from mock import Mock
+from gen.apache.aurora.api.ttypes import Response, ResponseCode, Result
 
 
 class AuroraClientCommandTest(unittest.TestCase):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/hooks/test_hooked_api.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/hooks/test_hooked_api.py b/src/test/python/apache/aurora/client/hooks/test_hooked_api.py
index 488d2be..93ad465 100644
--- a/src/test/python/apache/aurora/client/hooks/test_hooked_api.py
+++ b/src/test/python/apache/aurora/client/hooks/test_hooked_api.py
@@ -16,12 +16,11 @@
 
 from inspect import getargspec
 
-from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI, NonHookedAuroraClientAPI
-from apache.aurora.client.api import AuroraClientAPI
-from apache.aurora.common.cluster import Cluster
-
 from mock import Mock
 
+from apache.aurora.client.api import AuroraClientAPI
+from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI, NonHookedAuroraClientAPI
+from apache.aurora.common.cluster import Cluster
 
 API_METHODS = ('cancel_update', 'create_job', 'kill_job', 'restart', 'start_cronjob', 'update_job')
 API_METHODS_WITH_CONFIG_PARAM_ADDED = ('cancel_update', 'kill_job', 'restart', 'start_cronjob')
@@ -69,5 +68,3 @@ def test_api_methods_params(method_name):
   else:
     assert nonhooked_argspec == hooked_argspec
   assert nonhooked_argspec == nonhooked_argspec
-
-

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/hooks/test_non_hooked_api.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/hooks/test_non_hooked_api.py b/src/test/python/apache/aurora/client/hooks/test_non_hooked_api.py
index 711f72a..9fba62e 100644
--- a/src/test/python/apache/aurora/client/hooks/test_non_hooked_api.py
+++ b/src/test/python/apache/aurora/client/hooks/test_non_hooked_api.py
@@ -17,9 +17,8 @@
 import functools
 import unittest
 
-from apache.aurora.common.aurora_job_key import AuroraJobKey
 from apache.aurora.client.hooks.hooked_api import NonHookedAuroraClientAPI
-
+from apache.aurora.common.aurora_job_key import AuroraJobKey
 
 API_METHODS = ('cancel_update', 'create_job', 'kill_job', 'restart', 'start_cronjob', 'update_job')
 API_METHODS_WITH_CONFIG_PARAM_ADDED = ('cancel_update', 'kill_job', 'restart', 'start_cronjob')

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/test_binding_helper.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/test_binding_helper.py b/src/test/python/apache/aurora/client/test_binding_helper.py
index 338f18a..38f7e15 100644
--- a/src/test/python/apache/aurora/client/test_binding_helper.py
+++ b/src/test/python/apache/aurora/client/test_binding_helper.py
@@ -16,13 +16,13 @@
 
 import textwrap
 
+from pystachio import Ref
+from pystachio.matcher import Any, Matcher
+from twitter.common.contextutil import temporary_file
+
 from apache.aurora.client import binding_helper
 from apache.aurora.client.binding_helper import BindingHelper, CachingBindingHelper
 from apache.aurora.config import AuroraConfig
-from twitter.common.contextutil import temporary_file
-
-from pystachio import Ref
-from pystachio.matcher import Matcher, Any
 
 
 GENERIC_CONFIG = """

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/client/test_config.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/test_config.py b/src/test/python/apache/aurora/client/test_config.py
index 8ef0868..6a83a11 100644
--- a/src/test/python/apache/aurora/client/test_config.py
+++ b/src/test/python/apache/aurora/client/test_config.py
@@ -16,6 +16,7 @@
 
 import os
 
+import pytest
 from twitter.common.contextutil import temporary_dir, temporary_file
 
 from apache.aurora.client import config
@@ -25,9 +26,6 @@ from apache.aurora.config.schema.base import Announcer, Job, MB, Resources, Task
 
 from gen.apache.aurora.api.constants import DEFAULT_ENVIRONMENT
 
-import pytest
-
-
 MESOS_CONFIG_BASE = """
 HELLO_WORLD = Job(
   name = 'hello_world',

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/common/test_aurora_job_key.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/common/test_aurora_job_key.py b/src/test/python/apache/aurora/common/test_aurora_job_key.py
index 34f1ead..036da82 100644
--- a/src/test/python/apache/aurora/common/test_aurora_job_key.py
+++ b/src/test/python/apache/aurora/common/test_aurora_job_key.py
@@ -18,6 +18,7 @@ import unittest
 
 from apache.aurora.common.aurora_job_key import AuroraJobKey
 
+
 # TODO(ksweeney): Moar coverage
 class AuroraJobKeyTest(unittest.TestCase):
   def test_basic(self):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/common/test_cluster.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/common/test_cluster.py b/src/test/python/apache/aurora/common/test_cluster.py
index 6ef735f..d35c2e3 100644
--- a/src/test/python/apache/aurora/common/test_cluster.py
+++ b/src/test/python/apache/aurora/common/test_cluster.py
@@ -14,14 +14,10 @@
 # limitations under the License.
 #
 
-from apache.aurora.common.cluster import Cluster
-
-from pystachio import (
-    Default,
-    Integer,
-    Required,
-    String)
 import pytest
+from pystachio import Default, Integer, Required, String
+
+from apache.aurora.common.cluster import Cluster
 
 
 def test_simple():

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/common/test_cluster_option.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/common/test_cluster_option.py b/src/test/python/apache/aurora/common/test_cluster_option.py
index 850b7d6..1918bac 100644
--- a/src/test/python/apache/aurora/common/test_cluster_option.py
+++ b/src/test/python/apache/aurora/common/test_cluster_option.py
@@ -15,13 +15,11 @@
 #
 
 import pytest
-
 from twitter.common import options
 
 from apache.aurora.common.cluster import Cluster
-from apache.aurora.common.clusters import Clusters
 from apache.aurora.common.cluster_option import ClusterOption
-
+from apache.aurora.common.clusters import Clusters
 
 CLUSTER_LIST = Clusters((
   Cluster(name = 'smf1'),

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/common/test_clusters.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/common/test_clusters.py b/src/test/python/apache/aurora/common/test_clusters.py
index 0a0329b..4a9d24b 100644
--- a/src/test/python/apache/aurora/common/test_clusters.py
+++ b/src/test/python/apache/aurora/common/test_clusters.py
@@ -17,12 +17,11 @@
 import json
 import os
 
-from apache.aurora.common.clusters import Clusters, Parser
-from twitter.common.contextutil import temporary_dir
-
 import pytest
 import yaml
+from twitter.common.contextutil import temporary_dir
 
+from apache.aurora.common.clusters import Clusters, Parser
 
 TEST_YAML = """
 __default: &default

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/common/test_http_signaler.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/common/test_http_signaler.py b/src/test/python/apache/aurora/common/test_http_signaler.py
index 661a017..00541b3 100644
--- a/src/test/python/apache/aurora/common/test_http_signaler.py
+++ b/src/test/python/apache/aurora/common/test_http_signaler.py
@@ -14,15 +14,14 @@
 # limitations under the License.
 #
 
-from socket import timeout as SocketTimeout
 import unittest
+from socket import timeout as SocketTimeout
 
+import mox
 from twitter.common.lang import Compatibility
 
 from apache.aurora.common.http_signaler import HttpSignaler
 
-import mox
-
 if Compatibility.PY3:
   import urllib.request as urllib_request
 else:

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/config/test_base.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/config/test_base.py b/src/test/python/apache/aurora/config/test_base.py
index 31ad21f..372b1cc 100644
--- a/src/test/python/apache/aurora/config/test_base.py
+++ b/src/test/python/apache/aurora/config/test_base.py
@@ -15,7 +15,6 @@
 #
 
 import pytest
-
 from twitter.common.contextutil import temporary_file
 
 from apache.aurora.config import AuroraConfig, PortResolver
@@ -26,12 +25,11 @@ from apache.aurora.config.schema.base import (
     Job,
     Process,
     Resources,
-    Task,
+    Task
 )
 
 from gen.apache.aurora.api.ttypes import Identity
 
-
 resolve = PortResolver.resolve
 
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/config/test_constraint_parsing.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/config/test_constraint_parsing.py b/src/test/python/apache/aurora/config/test_constraint_parsing.py
index 4249269..310d0c3 100644
--- a/src/test/python/apache/aurora/config/test_constraint_parsing.py
+++ b/src/test/python/apache/aurora/config/test_constraint_parsing.py
@@ -14,9 +14,10 @@
 # limitations under the License.
 #
 
-import pytest
 import unittest
 
+import pytest
+
 from apache.aurora.config.thrift import constraints_to_thrift
 
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/config/test_loader.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/config/test_loader.py b/src/test/python/apache/aurora/config/test_loader.py
index 619b270..1170bd5 100644
--- a/src/test/python/apache/aurora/config/test_loader.py
+++ b/src/test/python/apache/aurora/config/test_loader.py
@@ -17,16 +17,14 @@
 import json
 import tempfile
 
+import pytest
+from pystachio import Environment
 from twitter.common.contextutil import temporary_file
 
 from apache.aurora.config import AuroraConfig
 from apache.aurora.config.loader import AuroraConfigLoader
 from apache.thermos.config.loader import ThermosTaskWrapper
 
-from pystachio import Environment
-import pytest
-
-
 
 BAD_MESOS_CONFIG = """
 3 2 1 3 2 4 2 3

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1c058f72/src/test/python/apache/aurora/config/test_thrift.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/config/test_thrift.py b/src/test/python/apache/aurora/config/test_thrift.py
index 93b8f6f..334011d 100644
--- a/src/test/python/apache/aurora/config/test_thrift.py
+++ b/src/test/python/apache/aurora/config/test_thrift.py
@@ -17,34 +17,19 @@
 import getpass
 import re
 
+import pytest
+from pystachio import Map, String
+from pystachio.naming import frozendict
+
 from apache.aurora.config import AuroraConfig
 from apache.aurora.config.schema.base import Job, SimpleTask
-from apache.aurora.config.thrift import (
-    convert as convert_pystachio_to_thrift,
-    InvalidConfig,
-    task_instance_from_job,
-)
-from apache.thermos.config.schema import (
-    Process,
-    Resources,
-    Task,
-)
+from apache.aurora.config.thrift import convert as convert_pystachio_to_thrift
+from apache.aurora.config.thrift import InvalidConfig, task_instance_from_job
+from apache.thermos.config.schema import Process, Resources, Task
 
 from gen.apache.aurora.api.constants import GOOD_IDENTIFIER_PATTERN_PYTHON
-from gen.apache.aurora.api.ttypes import (
-    CronCollisionPolicy,
-    JobKey,
-    Identity,
-)
-from gen.apache.aurora.test.constants import (
-    INVALID_IDENTIFIERS,
-    VALID_IDENTIFIERS,
-)
-
-from pystachio import Map, String
-from pystachio.naming import frozendict
-import pytest
-
+from gen.apache.aurora.api.ttypes import CronCollisionPolicy, Identity, JobKey
+from gen.apache.aurora.test.constants import INVALID_IDENTIFIERS, VALID_IDENTIFIERS
 
 HELLO_WORLD = Job(
   name = 'hello_world',


Mime
View raw message