aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wick...@apache.org
Subject git commit: AURORA-157: Reorder python imports to be consistent
Date Thu, 06 Feb 2014 00:43:55 GMT
Updated Branches:
  refs/heads/master c57dfa976 -> c18a8e53d


AURORA-157: Reorder python imports to be consistent

Move python imports to adhere to the following order:
- standard library deps
- apache.* deps
- gen.* (code generated) deps
- within-package (.-prefixed) deps
- third party deps

Testing Done:
./gradlew build && ./pants src/test/python:all -vxs

Bugs closed: AURORA-157

Reviewed at https://reviews.apache.org/r/17734/


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/c18a8e53
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/c18a8e53
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/c18a8e53

Branch: refs/heads/master
Commit: c18a8e53d16a7d6fe5c16ac0a3713d511d1ea863
Parents: c57dfa9
Author: Dan Norris <protochron@gmail.com>
Authored: Wed Feb 5 16:43:36 2014 -0800
Committer: Brian Wickman <wickman@apache.org>
Committed: Wed Feb 5 16:43:36 2014 -0800

----------------------------------------------------------------------
 .../python/apache/aurora/admin/mesos_maintenance.py  |  6 +++---
 .../apache/aurora/client/api/command_runner.py       |  3 +--
 .../python/apache/aurora/client/api/disambiguator.py |  4 ++--
 .../python/apache/aurora/client/api/health_check.py  |  6 +++---
 .../apache/aurora/client/api/instance_watcher.py     |  8 +++++---
 .../python/apache/aurora/client/api/job_monitor.py   |  3 +--
 .../python/apache/aurora/client/api/quota_check.py   |  4 ++--
 .../python/apache/aurora/client/api/restarter.py     |  4 ++--
 .../apache/aurora/client/api/scheduler_client.py     | 12 ++++++------
 src/main/python/apache/aurora/client/api/updater.py  |  4 +---
 src/main/python/apache/aurora/client/base.py         |  3 ++-
 .../python/apache/aurora/client/bin/aurora_admin.py  |  1 +
 .../python/apache/aurora/client/bin/aurora_client.py |  1 +
 src/main/python/apache/aurora/client/cli/context.py  |  2 +-
 .../python/apache/aurora/client/commands/admin.py    |  7 ++++---
 .../python/apache/aurora/client/commands/core.py     |  8 ++++----
 .../python/apache/aurora/client/commands/help.py     |  1 +
 src/main/python/apache/aurora/client/commands/run.py |  3 ++-
 src/main/python/apache/aurora/client/commands/ssh.py |  3 ++-
 src/main/python/apache/aurora/client/config.py       |  3 +--
 src/main/python/apache/aurora/client/factory.py      |  3 ++-
 .../python/apache/aurora/client/hooks/hooked_api.py  |  3 ++-
 .../python/apache/aurora/common/aurora_job_key.py    |  5 +++--
 src/main/python/apache/aurora/common/clusters.py     |  4 ++--
 src/main/python/apache/aurora/config/repl.py         |  1 +
 src/main/python/apache/aurora/config/thrift.py       |  2 +-
 .../apache/aurora/executor/bin/gc_executor_main.py   |  7 +++----
 .../aurora/executor/bin/thermos_executor_main.py     |  5 ++---
 .../aurora/executor/bin/thermos_runner_main.py       |  3 ++-
 .../apache/aurora/executor/common/health_checker.py  |  4 ++--
 .../apache/aurora/executor/common/task_info.py       |  3 +--
 .../python/apache/aurora/executor/executor_base.py   |  3 +--
 .../python/apache/aurora/executor/executor_vars.py   |  3 +--
 .../python/apache/aurora/executor/gc_executor.py     | 10 +++++-----
 .../python/apache/aurora/executor/status_manager.py  |  4 ++--
 .../apache/aurora/executor/thermos_executor.py       |  9 ++++-----
 .../python/apache/aurora/executor/thermos_runner.py  |  3 ++-
 .../apache/aurora/executor/thermos_task_runner.py    |  9 +++++----
 src/main/python/apache/thermos/bin/thermos.py        | 14 +++++++-------
 src/main/python/apache/thermos/bin/thermos_ckpt.py   |  3 ++-
 src/main/python/apache/thermos/common/ckpt.py        |  4 ++--
 .../python/apache/thermos/config/bin/config_load.py  |  4 +++-
 src/main/python/apache/thermos/config/loader.py      |  5 ++---
 .../python/apache/thermos/config/schema_helpers.py   |  3 +--
 src/main/python/apache/thermos/core/helper.py        |  8 ++++----
 src/main/python/apache/thermos/core/inspector.py     |  6 +++---
 src/main/python/apache/thermos/core/muxer.py         |  3 ++-
 src/main/python/apache/thermos/core/process.py       | 15 ++++++++-------
 src/main/python/apache/thermos/core/runner.py        |  9 ++++-----
 src/main/python/apache/thermos/monitoring/disk.py    | 11 +++++------
 src/main/python/apache/thermos/monitoring/garbage.py |  7 ++++---
 src/main/python/apache/thermos/monitoring/monitor.py |  5 +++--
 .../thermos/monitoring/process_collector_psutil.py   |  3 +--
 .../python/apache/thermos/monitoring/resource.py     | 10 +++++-----
 .../apache/thermos/observer/bin/thermos_observer.py  |  7 ++++---
 .../apache/thermos/observer/http/file_browser.py     |  7 +++----
 .../apache/thermos/observer/http/http_observer.py    |  6 +++---
 .../apache/thermos/observer/http/static_assets.py    |  5 ++---
 .../python/apache/thermos/observer/observed_task.py  |  4 ++--
 .../python/apache/thermos/observer/task_observer.py  | 10 +++++-----
 src/main/python/apache/thermos/testing/runner.py     |  7 ++++---
 .../apache/aurora/executor/test_gc_executor.py       | 13 ++++++-------
 .../apache/aurora/executor/test_thermos_executor.py  | 14 +++++++-------
 63 files changed, 178 insertions(+), 172 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/admin/mesos_maintenance.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/admin/mesos_maintenance.py b/src/main/python/apache/aurora/admin/mesos_maintenance.py
index ab5e912..d8ffdec 100644
--- a/src/main/python/apache/aurora/admin/mesos_maintenance.py
+++ b/src/main/python/apache/aurora/admin/mesos_maintenance.py
@@ -17,14 +17,14 @@
 from collections import defaultdict
 import time
 
-from twitter.common import log
-from twitter.common.quantity import Amount, Time
-
 from apache.aurora.client.api import AuroraClientAPI
 from apache.aurora.client.base import check_and_log_response
 
 from gen.apache.aurora.ttypes import Hosts, MaintenanceMode
 
+from twitter.common import log
+from twitter.common.quantity import Amount, Time
+
 
 def group_by_host(hostname):
   return hostname

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/api/command_runner.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/api/command_runner.py b/src/main/python/apache/aurora/client/api/command_runner.py
index c645e95..f7605f4 100644
--- a/src/main/python/apache/aurora/client/api/command_runner.py
+++ b/src/main/python/apache/aurora/client/api/command_runner.py
@@ -18,8 +18,6 @@ from multiprocessing.pool import ThreadPool
 import posixpath
 import subprocess
 
-from twitter.common import log
-
 from apache.aurora.client.api import AuroraClientAPI
 from apache.aurora.config.schema.base import MesosContext
 from apache.aurora.common.cluster import Cluster
@@ -32,6 +30,7 @@ from gen.apache.aurora.ttypes import (
   TaskQuery)
 
 from pystachio import Environment, Required, String
+from twitter.common import log
 
 
 class CommandRunnerTrait(Cluster.Trait):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/api/disambiguator.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/api/disambiguator.py b/src/main/python/apache/aurora/client/api/disambiguator.py
index d163a18..18339b2 100644
--- a/src/main/python/apache/aurora/client/api/disambiguator.py
+++ b/src/main/python/apache/aurora/client/api/disambiguator.py
@@ -14,12 +14,12 @@
 # limitations under the License.
 #
 
-from twitter.common import log
-
 from apache.aurora.client.api import AuroraClientAPI
 from apache.aurora.client.base import check_and_log_response, deprecation_warning, die
 from apache.aurora.common.aurora_job_key import AuroraJobKey
 
+from twitter.common import log
+
 
 class LiveJobDisambiguator(object):
   """

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/api/health_check.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/api/health_check.py b/src/main/python/apache/aurora/client/api/health_check.py
index bd2bcaa..de7dc69 100644
--- a/src/main/python/apache/aurora/client/api/health_check.py
+++ b/src/main/python/apache/aurora/client/api/health_check.py
@@ -16,13 +16,13 @@
 
 from abc import abstractmethod
 
-from twitter.common import log
-from twitter.common.lang import Interface
-
 from apache.aurora.common.http_signaler import HttpSignaler
 
 from gen.apache.aurora.ttypes import ScheduleStatus
 
+from twitter.common import log
+from twitter.common.lang import Interface
+
 
 class HealthCheck(Interface):
   @abstractmethod

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/api/instance_watcher.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/api/instance_watcher.py b/src/main/python/apache/aurora/client/api/instance_watcher.py
index dcfae5a..d7db426 100644
--- a/src/main/python/apache/aurora/client/api/instance_watcher.py
+++ b/src/main/python/apache/aurora/client/api/instance_watcher.py
@@ -16,9 +16,6 @@
 
 import time
 
-from twitter.common import log
-from .health_check import InstanceWatcherHealthCheck
-
 from gen.apache.aurora.ttypes import (
   Identity,
   ResponseCode,
@@ -26,6 +23,11 @@ from gen.apache.aurora.ttypes import (
   TaskQuery,
 )
 
+from .health_check import InstanceWatcherHealthCheck
+
+from twitter.common import log
+
+
 class Instance(object):
   def __init__(self, birthday=None, finished=False):
     self.birthday = birthday

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/api/job_monitor.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/api/job_monitor.py b/src/main/python/apache/aurora/client/api/job_monitor.py
index 2ca417b..537e417 100644
--- a/src/main/python/apache/aurora/client/api/job_monitor.py
+++ b/src/main/python/apache/aurora/client/api/job_monitor.py
@@ -16,8 +16,6 @@
 
 import time
 
-from twitter.common.quantity import Amount, Time
-
 from gen.apache.aurora.constants import (
     LIVE_STATES,
     TERMINAL_STATES
@@ -28,6 +26,7 @@ from gen.apache.aurora.ttypes import (
 )
 
 from thrift.transport import TTransport
+from twitter.common.quantity import Amount, Time
 
 
 class JobMonitor(object):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/api/quota_check.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/api/quota_check.py b/src/main/python/apache/aurora/client/api/quota_check.py
index 46701f2..7de02c4 100644
--- a/src/main/python/apache/aurora/client/api/quota_check.py
+++ b/src/main/python/apache/aurora/client/api/quota_check.py
@@ -18,10 +18,10 @@ import operator
 
 from copy import deepcopy
 
-from twitter.common import log
-
 from gen.apache.aurora.ttypes import Quota, Response, ResponseCode
 
+from twitter.common import log
+
 
 class CapacityRequest(object):
   """Facilitates Quota manipulations."""

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/api/restarter.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/api/restarter.py b/src/main/python/apache/aurora/client/api/restarter.py
index 9a1fcdc..d060c1b 100644
--- a/src/main/python/apache/aurora/client/api/restarter.py
+++ b/src/main/python/apache/aurora/client/api/restarter.py
@@ -14,14 +14,14 @@
 # limitations under the License.
 #
 
-from twitter.common import log
-
 from gen.apache.aurora.constants import ACTIVE_STATES
 from gen.apache.aurora.ttypes import ResponseCode
 
 from .instance_watcher import InstanceWatcher
 from .updater_util import FailureThreshold
 
+from twitter.common import log
+
 
 class Restarter(object):
   def __init__(self,

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/api/scheduler_client.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/api/scheduler_client.py b/src/main/python/apache/aurora/client/api/scheduler_client.py
index 18f9790..f770df7 100644
--- a/src/main/python/apache/aurora/client/api/scheduler_client.py
+++ b/src/main/python/apache/aurora/client/api/scheduler_client.py
@@ -20,18 +20,18 @@ import time
 
 from apache.aurora.common.auth import make_session_key, SessionKeyError
 from apache.aurora.common.cluster import Cluster
-from twitter.common import log
-from twitter.common.quantity import Amount, Time
-from twitter.common.rpc.transports.tsslsocket import DelayedHandshakeTSSLSocket
-from twitter.common.zookeeper.kazoo_client import TwitterKazooClient
-from twitter.common.zookeeper.serverset import ServerSet
 
 from gen.apache.aurora import AuroraAdmin
 from gen.apache.aurora.constants import CURRENT_API_VERSION
 
+from pystachio import Boolean, Default, Integer, String
 from thrift.protocol import TBinaryProtocol
 from thrift.transport import TSocket, TTransport
-from pystachio import Boolean, Default, Integer, String
+from twitter.common import log
+from twitter.common.quantity import Amount, Time
+from twitter.common.rpc.transports.tsslsocket import DelayedHandshakeTSSLSocket
+from twitter.common.zookeeper.kazoo_client import TwitterKazooClient
+from twitter.common.zookeeper.serverset import ServerSet
 
 
 class SchedulerClientTrait(Cluster.Trait):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/api/updater.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/api/updater.py b/src/main/python/apache/aurora/client/api/updater.py
index 61e5737..39ccb1d 100644
--- a/src/main/python/apache/aurora/client/api/updater.py
+++ b/src/main/python/apache/aurora/client/api/updater.py
@@ -18,10 +18,7 @@ import json
 from collections import namedtuple
 from difflib import unified_diff
 
-from twitter.common import log
-
 from gen.apache.aurora.constants import ACTIVE_STATES
-
 from gen.apache.aurora.ttypes import (
     AddInstancesConfig,
     JobConfigValidation,
@@ -43,6 +40,7 @@ from .updater_util import FailureThreshold, UpdaterConfig
 
 from thrift.protocol import TJSONProtocol
 from thrift.TSerialization import serialize
+from twitter.common import log
 
 class Updater(object):
   """Update the instances of a job in batches."""

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/base.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/base.py b/src/main/python/apache/aurora/client/base.py
index 3ccbcf3..c5c969f 100644
--- a/src/main/python/apache/aurora/client/base.py
+++ b/src/main/python/apache/aurora/client/base.py
@@ -19,9 +19,10 @@ import functools
 import sys
 from urlparse import urljoin
 
+from gen.apache.aurora.ttypes import ResponseCode
+
 from twitter.common import app, log
 
-from gen.apache.aurora.ttypes import ResponseCode
 
 LOCKED_WARNING = """
 Note: if the scheduler detects that a job update is in progress (or was not

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/bin/aurora_admin.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/bin/aurora_admin.py b/src/main/python/apache/aurora/client/bin/aurora_admin.py
index efbbb6f..2853660 100644
--- a/src/main/python/apache/aurora/client/bin/aurora_admin.py
+++ b/src/main/python/apache/aurora/client/bin/aurora_admin.py
@@ -17,6 +17,7 @@
 from apache.aurora.client.base import generate_terse_usage
 from apache.aurora.client.commands import admin, help
 from apache.aurora.client.options import add_verbosity_options
+
 from twitter.common import app
 from twitter.common.log.options import LogOptions
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/bin/aurora_client.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/bin/aurora_client.py b/src/main/python/apache/aurora/client/bin/aurora_client.py
index fa8b514..936d819 100644
--- a/src/main/python/apache/aurora/client/bin/aurora_client.py
+++ b/src/main/python/apache/aurora/client/bin/aurora_client.py
@@ -15,6 +15,7 @@
 #
 
 from apache.aurora.client.base import generate_terse_usage
+
 from twitter.common import app
 from twitter.common.log.options import LogOptions
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/cli/context.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/cli/context.py b/src/main/python/apache/aurora/client/cli/context.py
index b54c5a0..4d1de48 100644
--- a/src/main/python/apache/aurora/client/cli/context.py
+++ b/src/main/python/apache/aurora/client/cli/context.py
@@ -30,10 +30,10 @@ from apache.aurora.client.cli import (
 )
 from apache.aurora.client.config import get_config
 from apache.aurora.client.factory import make_client
-from twitter.common import log
 
 from gen.apache.aurora.ttypes import ResponseCode
 
+from twitter.common import log
 
 # Utility type, representing job keys with wildcards.
 PartialJobKey = namedtuple('PartialJobKey', ['cluster', 'role', 'env', 'name'])

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/commands/admin.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/commands/admin.py b/src/main/python/apache/aurora/client/commands/admin.py
index 96f7f70..45686ae 100644
--- a/src/main/python/apache/aurora/client/commands/admin.py
+++ b/src/main/python/apache/aurora/client/commands/admin.py
@@ -27,9 +27,6 @@ from apache.aurora.admin.mesos_maintenance import MesosMaintenance
 from apache.aurora.client.api import AuroraClientAPI
 from apache.aurora.client.base import check_and_log_response, die, requires
 from apache.aurora.common.clusters import CLUSTERS
-from twitter.common import app, log
-from twitter.common.quantity import Amount, Data
-from twitter.common.quantity.parse_simple import parse_data
 
 from gen.apache.aurora.constants import ACTIVE_STATES, TERMINAL_STATES
 from gen.apache.aurora.ttypes import (
@@ -38,6 +35,10 @@ from gen.apache.aurora.ttypes import (
     TaskQuery,
 )
 
+from twitter.common import app, log
+from twitter.common.quantity import Amount, Data
+from twitter.common.quantity.parse_simple import parse_data
+
 
 GROUPING_OPTION = optparse.Option(
     '--grouping',

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/commands/core.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/commands/core.py b/src/main/python/apache/aurora/client/commands/core.py
index f973d60..ff0f1f8 100644
--- a/src/main/python/apache/aurora/client/commands/core.py
+++ b/src/main/python/apache/aurora/client/commands/core.py
@@ -29,10 +29,6 @@ import sys
 import time
 from tempfile import NamedTemporaryFile
 
-from twitter.common import app, log
-from twitter.common.python.pex import PexInfo
-from twitter.common.python.dirwrapper import PythonDirectoryWrapper
-
 from apache.aurora.client.base import (
     check_and_log_response,
     deprecation_warning,
@@ -63,6 +59,10 @@ from apache.aurora.common.aurora_job_key import AuroraJobKey
 from gen.apache.aurora.constants import ACTIVE_STATES, CURRENT_API_VERSION, AURORA_EXECUTOR_NAME
 from gen.apache.aurora.ttypes import ExecutorConfig, ResponseCode, ScheduleStatus
 
+from twitter.common import app, log
+from twitter.common.python.pex import PexInfo
+from twitter.common.python.dirwrapper import PythonDirectoryWrapper
+
 
 def get_job_config(job_spec, config_file, options):
   try:

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/commands/help.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/commands/help.py b/src/main/python/apache/aurora/client/commands/help.py
index 29002c6..36e548f 100644
--- a/src/main/python/apache/aurora/client/commands/help.py
+++ b/src/main/python/apache/aurora/client/commands/help.py
@@ -20,6 +20,7 @@ import collections
 import sys
 
 from apache.aurora.client.base import die
+
 from twitter.common import app
 
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/commands/run.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/commands/run.py b/src/main/python/apache/aurora/client/commands/run.py
index 0725999..332bded 100644
--- a/src/main/python/apache/aurora/client/commands/run.py
+++ b/src/main/python/apache/aurora/client/commands/run.py
@@ -14,7 +14,6 @@
 # limitations under the License.
 #
 
-from twitter.common import app
 from apache.aurora.client.base import die
 from apache.aurora.client.options import (
     EXECUTOR_SANDBOX_OPTION,
@@ -24,6 +23,8 @@ from apache.aurora.common.aurora_job_key import AuroraJobKey
 from apache.aurora.common.clusters import CLUSTERS
 from apache.aurora.client.api.command_runner import DistributedCommandRunner
 
+from twitter.common import app
+
 
 @app.command
 @app.command_option('-t', '--threads', type=int, default=1, dest='num_threads',

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/commands/ssh.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/commands/ssh.py b/src/main/python/apache/aurora/client/commands/ssh.py
index 4ccf7f5..d1499ec 100644
--- a/src/main/python/apache/aurora/client/commands/ssh.py
+++ b/src/main/python/apache/aurora/client/commands/ssh.py
@@ -16,7 +16,6 @@
 
 import subprocess
 
-from twitter.common import app
 from apache.aurora.client.base import check_and_log_response, die
 from apache.aurora.client.factory import make_client
 from apache.aurora.client.options import (
@@ -26,6 +25,8 @@ from apache.aurora.client.options import (
 from apache.aurora.common.aurora_job_key import AuroraJobKey
 from apache.aurora.client.api.command_runner import DistributedCommandRunner
 
+from twitter.common import app
+
 
 @app.command
 @app.command_option(EXECUTOR_SANDBOX_OPTION)

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/config.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/config.py b/src/main/python/apache/aurora/client/config.py
index d96376a..32ac6cc 100644
--- a/src/main/python/apache/aurora/client/config.py
+++ b/src/main/python/apache/aurora/client/config.py
@@ -25,8 +25,6 @@ import posixpath
 import re
 import sys
 
-from twitter.common import app, log
-
 from apache.aurora.client import binding_helper
 from apache.aurora.client.base import deprecation_warning, die
 from apache.aurora.config import AuroraConfig
@@ -35,6 +33,7 @@ from apache.thermos.config.schema_helpers import Tasks
 from gen.apache.aurora.constants import DEFAULT_ENVIRONMENT
 
 from pystachio import Empty, Ref
+from twitter.common import app, log
 
 
 APPAPP_DEPRECATION_WARNING = """

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/factory.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/factory.py b/src/main/python/apache/aurora/client/factory.py
index 6635ec0..00c4041 100644
--- a/src/main/python/apache/aurora/client/factory.py
+++ b/src/main/python/apache/aurora/client/factory.py
@@ -19,10 +19,11 @@ import functools
 from apache.aurora.client.hooks.hooked_api import HookedAuroraClientAPI
 from apache.aurora.common.cluster import Cluster
 from apache.aurora.common.clusters import CLUSTERS
-from twitter.common import app
 
 from .base import die
 
+from twitter.common import app
+
 
 # TODO(wickman) Kill make_client and make_client_factory as part of MESOS-3801.
 # These are currently necessary indirections for the LiveJobDisambiguator among

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/client/hooks/hooked_api.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/hooks/hooked_api.py b/src/main/python/apache/aurora/client/hooks/hooked_api.py
index 532f385..6de8134 100644
--- a/src/main/python/apache/aurora/client/hooks/hooked_api.py
+++ b/src/main/python/apache/aurora/client/hooks/hooked_api.py
@@ -17,12 +17,13 @@
 import functools
 import traceback
 
-from twitter.common import log
 from apache.aurora.client.api import AuroraClientAPI
 from apache.aurora.common.aurora_job_key import AuroraJobKey
 
 from gen.apache.aurora.ttypes import ResponseCode
 
+from twitter.common import log
+
 
 def _partial(function, *args, **kw):
   """Returns a partial function __name__ inherited from parent function."""

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/common/aurora_job_key.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/common/aurora_job_key.py b/src/main/python/apache/aurora/common/aurora_job_key.py
index 4ab6b39..a0bc6e5 100644
--- a/src/main/python/apache/aurora/common/aurora_job_key.py
+++ b/src/main/python/apache/aurora/common/aurora_job_key.py
@@ -16,11 +16,12 @@
 
 import re
 
-from twitter.common.lang import Compatibility, total_ordering
-
 from gen.apache.aurora.constants import GOOD_IDENTIFIER_PATTERN_PYTHON
 from gen.apache.aurora.ttypes import Identity, JobKey, TaskQuery
 
+from twitter.common.lang import Compatibility, total_ordering
+
+
 # TODO(ksweeney): This can just probably just extend namedtuple.
 @total_ordering
 class AuroraJobKey(object):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/common/clusters.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/common/clusters.py b/src/main/python/apache/aurora/common/clusters.py
index aab7fb6..88986ee 100644
--- a/src/main/python/apache/aurora/common/clusters.py
+++ b/src/main/python/apache/aurora/common/clusters.py
@@ -23,11 +23,11 @@ import json
 import os
 import sys
 
-from twitter.common.collections import maybe_list
-
 from .cluster import Cluster
 
 from pystachio import Required, String
+from twitter.common.collections import maybe_list
+
 
 try:
   import yaml

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/config/repl.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/config/repl.py b/src/main/python/apache/aurora/config/repl.py
index d3d2398..bfbff0d 100644
--- a/src/main/python/apache/aurora/config/repl.py
+++ b/src/main/python/apache/aurora/config/repl.py
@@ -15,6 +15,7 @@
 #
 
 from apache.aurora.config.loader import AuroraConfigLoader
+
 from twitter.common.lang import Compatibility
 
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/config/thrift.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/config/thrift.py b/src/main/python/apache/aurora/config/thrift.py
index 5546a1e..e293c92 100644
--- a/src/main/python/apache/aurora/config/thrift.py
+++ b/src/main/python/apache/aurora/config/thrift.py
@@ -22,7 +22,6 @@ from apache.aurora.config.schema.base import (
   MesosContext,
   MesosTaskInstance,
 )
-from twitter.common.lang import Compatibility
 from apache.thermos.config.loader import ThermosTaskValidator
 
 from gen.apache.aurora.constants import GOOD_IDENTIFIER_PATTERN_PYTHON, AURORA_EXECUTOR_NAME
@@ -41,6 +40,7 @@ from gen.apache.aurora.ttypes import (
 )
 
 from pystachio import Empty, Ref
+from twitter.common.lang import Compatibility
 
 __all__ = (
   'InvalidConfig',

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/executor/bin/gc_executor_main.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/executor/bin/gc_executor_main.py b/src/main/python/apache/aurora/executor/bin/gc_executor_main.py
index 1a24b9f..488828f 100644
--- a/src/main/python/apache/aurora/executor/bin/gc_executor_main.py
+++ b/src/main/python/apache/aurora/executor/bin/gc_executor_main.py
@@ -23,13 +23,12 @@ slave.
 
 from apache.aurora.executor.executor_detector import ExecutorDetector
 from apache.aurora.executor.gc_executor import ThermosGCExecutor
-from twitter.common import app, log
-from twitter.common.log.options import LogOptions
-from twitter.common.metrics.sampler import DiskMetricWriter
 from apache.thermos.common.path import TaskPath
 
 import mesos
-
+from twitter.common import app, log
+from twitter.common.log.options import LogOptions
+from twitter.common.metrics.sampler import DiskMetricWriter
 
 app.configure(debug=True)
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/executor/bin/thermos_executor_main.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/executor/bin/thermos_executor_main.py b/src/main/python/apache/aurora/executor/bin/thermos_executor_main.py
index 1f3f830..8968e89 100644
--- a/src/main/python/apache/aurora/executor/bin/thermos_executor_main.py
+++ b/src/main/python/apache/aurora/executor/bin/thermos_executor_main.py
@@ -23,15 +23,14 @@ slave.
 
 import os
 
-from twitter.common import app, log
-from twitter.common.log.options import LogOptions
-
 from apache.aurora.executor.common.executor_timeout import ExecutorTimeout
 from apache.aurora.executor.common.health_checker import HealthCheckerProvider
 from apache.aurora.executor.thermos_executor import ThermosExecutor
 from apache.aurora.executor.thermos_task_runner import DefaultThermosTaskRunnerProvider
 
 import mesos
+from twitter.common import app, log
+from twitter.common.log.options import LogOptions
 
 
 app.configure(debug=True)

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/executor/bin/thermos_runner_main.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/executor/bin/thermos_runner_main.py b/src/main/python/apache/aurora/executor/bin/thermos_runner_main.py
index f350347..74397dc 100644
--- a/src/main/python/apache/aurora/executor/bin/thermos_runner_main.py
+++ b/src/main/python/apache/aurora/executor/bin/thermos_runner_main.py
@@ -14,9 +14,10 @@
 # limitations under the License.
 #
 
+from apache.aurora.executor.thermos_runner import proxy_main as runner_proxy_main
+
 from twitter.common import app
 from twitter.common.log.options import LogOptions
-from apache.aurora.executor.thermos_runner import proxy_main as runner_proxy_main
 
 
 LogOptions.set_simple(True)

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/executor/common/health_checker.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/executor/common/health_checker.py b/src/main/python/apache/aurora/executor/common/health_checker.py
index 84cfe99..503d5c6 100644
--- a/src/main/python/apache/aurora/executor/common/health_checker.py
+++ b/src/main/python/apache/aurora/executor/common/health_checker.py
@@ -18,8 +18,6 @@ import threading
 import time
 
 from apache.aurora.common.http_signaler import HttpSignaler
-from twitter.common import log
-from twitter.common.exceptions import ExceptionalThread
 
 from .status_checker import (
     ExitState,
@@ -29,6 +27,8 @@ from .status_checker import (
 )
 from .task_info import mesos_task_instance_from_assigned_task, resolve_ports
 
+from twitter.common import log
+from twitter.common.exceptions import ExceptionalThread
 
 class HealthCheckerThread(StatusChecker, ExceptionalThread):
   """Generic, StatusChecker-conforming thread for arbitrary periodic health checks

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/executor/common/task_info.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/executor/common/task_info.py b/src/main/python/apache/aurora/executor/common/task_info.py
index 544c1c1..29a05be 100644
--- a/src/main/python/apache/aurora/executor/common/task_info.py
+++ b/src/main/python/apache/aurora/executor/common/task_info.py
@@ -19,14 +19,13 @@ import json
 from apache.aurora.config.port_resolver import PortResolver
 from apache.aurora.config.schema.base import MesosJob, MesosTaskInstance
 from apache.aurora.config.thrift import task_instance_from_job
-from twitter.common import log
 
 from gen.apache.aurora.ttypes import AssignedTask
 
 from pystachio import Ref
 from thrift.Thrift import TException
 from thrift.TSerialization import deserialize as thrift_deserialize
-
+from twitter.common import log
 
 def assigned_task_from_mesos_task(task):
   """Deserialize AssignedTask from a launchTask task protocol buffer."""

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/executor/executor_base.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/executor/executor_base.py b/src/main/python/apache/aurora/executor/executor_base.py
index 2b0b5f4..a1310cc 100644
--- a/src/main/python/apache/aurora/executor/executor_base.py
+++ b/src/main/python/apache/aurora/executor/executor_base.py
@@ -14,14 +14,13 @@
 # limitations under the License.
 #
 
-from twitter.common import log
-
 from gen.apache.aurora.constants import TERMINAL_STATES as AURORA_TERMINAL_STATES
 from gen.apache.aurora.ttypes import ScheduleStatus
 from gen.apache.thermos.ttypes import TaskState
 
 import mesos
 import mesos_pb2 as mesos_pb
+from twitter.common import log
 
 
 class ThermosExecutorBase(mesos.Executor):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/executor/executor_vars.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/executor/executor_vars.py b/src/main/python/apache/aurora/executor/executor_vars.py
index a5294aa..f358fe5 100644
--- a/src/main/python/apache/aurora/executor/executor_vars.py
+++ b/src/main/python/apache/aurora/executor/executor_vars.py
@@ -17,6 +17,7 @@
 import os
 import time
 
+import psutil
 from twitter.common.exceptions import ExceptionalThread
 from twitter.common.metrics import (
     LambdaGauge,
@@ -28,8 +29,6 @@ from twitter.common.python.pex import PexInfo
 from twitter.common.quantity import Amount, Time
 from twitter.common.string.scanf import ScanfParser
 
-import psutil
-
 
 class ExecutorVars(Observable, ExceptionalThread):
   """

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/executor/gc_executor.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/executor/gc_executor.py b/src/main/python/apache/aurora/executor/gc_executor.py
index 709d8c6..cc4e517 100644
--- a/src/main/python/apache/aurora/executor/gc_executor.py
+++ b/src/main/python/apache/aurora/executor/gc_executor.py
@@ -26,11 +26,6 @@ import os
 import threading
 import time
 
-from twitter.common.collections import OrderedDict
-from twitter.common.exceptions import ExceptionalThread
-from twitter.common.metrics import Observable
-from twitter.common.metrics.gauge import AtomicGauge
-from twitter.common.quantity import Amount, Time
 from apache.thermos.common.ckpt import CheckpointDispatcher
 from apache.thermos.common.path import TaskPath
 from apache.thermos.core.inspector import CheckpointInspector
@@ -52,6 +47,11 @@ import mesos_pb2 as mesos_pb
 import psutil
 from thrift.TSerialization import deserialize as thrift_deserialize
 from thrift.TSerialization import serialize as thrift_serialize
+from twitter.common.collections import OrderedDict
+from twitter.common.exceptions import ExceptionalThread
+from twitter.common.metrics import Observable
+from twitter.common.metrics.gauge import AtomicGauge
+from twitter.common.quantity import Amount, Time
 
 
 class ThermosGCExecutor(ThermosExecutorBase, ExceptionalThread, Observable):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/executor/status_manager.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/executor/status_manager.py b/src/main/python/apache/aurora/executor/status_manager.py
index 54b6053..44a896f 100644
--- a/src/main/python/apache/aurora/executor/status_manager.py
+++ b/src/main/python/apache/aurora/executor/status_manager.py
@@ -16,12 +16,12 @@
 
 import time
 
+from .common.status_checker import StatusChecker
+
 from twitter.common import log
 from twitter.common.exceptions import ExceptionalThread
 from twitter.common.quantity import Amount, Time
 
-from .common.status_checker import StatusChecker
-
 
 class StatusManager(ExceptionalThread):
   """

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/executor/thermos_executor.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/executor/thermos_executor.py b/src/main/python/apache/aurora/executor/thermos_executor.py
index edb09a8..252ba5f 100644
--- a/src/main/python/apache/aurora/executor/thermos_executor.py
+++ b/src/main/python/apache/aurora/executor/thermos_executor.py
@@ -19,11 +19,6 @@ import threading
 import time
 import traceback
 
-from twitter.common import log
-from twitter.common.concurrent import deadline, defer, Timeout
-from twitter.common.metrics import Observable
-from twitter.common.quantity import Amount, Time
-
 from .common.kill_manager import KillManager
 from .common.sandbox import DirectorySandbox, SandboxProvider
 from .common.status_checker import ChainedStatusChecker, ExitState
@@ -41,6 +36,10 @@ from .executor_base import ThermosExecutorBase
 from .status_manager import StatusManager
 
 import mesos_pb2 as mesos_pb
+from twitter.common import log
+from twitter.common.concurrent import deadline, defer, Timeout
+from twitter.common.metrics import Observable
+from twitter.common.quantity import Amount, Time
 
 
 class DefaultSandboxProvider(SandboxProvider):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/executor/thermos_runner.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/executor/thermos_runner.py b/src/main/python/apache/aurora/executor/thermos_runner.py
index 4749e5e..1e6634d 100644
--- a/src/main/python/apache/aurora/executor/thermos_runner.py
+++ b/src/main/python/apache/aurora/executor/thermos_runner.py
@@ -20,12 +20,13 @@ import signal
 import sys
 import traceback
 
-from twitter.common import app, log
 from apache.thermos.common.options import add_port_to
 from apache.thermos.common.planner import TaskPlanner
 from apache.thermos.config.loader import ThermosConfigLoader
 from apache.thermos.core.runner import TaskRunner
 
+from twitter.common import app, log
+
 
 app.add_option(
     "--thermos_json",

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/aurora/executor/thermos_task_runner.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/executor/thermos_task_runner.py b/src/main/python/apache/aurora/executor/thermos_task_runner.py
index 4fee863..8e18928 100644
--- a/src/main/python/apache/aurora/executor/thermos_task_runner.py
+++ b/src/main/python/apache/aurora/executor/thermos_task_runner.py
@@ -23,10 +23,6 @@ import threading
 import time
 
 from apache.aurora.common.http_signaler import HttpSignaler
-from twitter.common import log
-from twitter.common.dirutil import chmod_plus_x, safe_mkdtemp
-from twitter.common.log.options import LogOptions
-from twitter.common.quantity import Amount, Time
 from apache.thermos.common.path import TaskPath
 from apache.thermos.config.loader import ThermosTaskWrapper
 from apache.thermos.core import runner as core
@@ -45,6 +41,11 @@ from .common.task_runner import (
     TaskRunnerProvider,
 )
 
+from twitter.common import log
+from twitter.common.dirutil import chmod_plus_x, safe_mkdtemp
+from twitter.common.log.options import LogOptions
+from twitter.common.quantity import Amount, Time
+
 
 class ThermosTaskRunner(TaskRunner):
   ESCALATION_WAIT = Amount(5, Time.SECONDS)

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/thermos/bin/thermos.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/bin/thermos.py b/src/main/python/apache/thermos/bin/thermos.py
index a80bf1d..a310802 100644
--- a/src/main/python/apache/thermos/bin/thermos.py
+++ b/src/main/python/apache/thermos/bin/thermos.py
@@ -27,13 +27,6 @@ import re
 import sys
 import time
 
-from twitter.common import app, log
-from twitter.common.log.options import LogOptions
-from twitter.common.dirutil import du, tail_f
-from twitter.common.dirutil.tail import tail as tail_closed
-from twitter.common.quantity import Amount, Time, Data
-from twitter.common.quantity.parse_simple import parse_time, parse_data
-from twitter.common.recordio import RecordIO, ThriftRecordReader
 from apache.thermos.common.path import TaskPath
 from apache.thermos.common.ckpt import CheckpointDispatcher
 from apache.thermos.common.options import add_port_to, add_binding_to
@@ -56,6 +49,13 @@ from gen.apache.thermos.ttypes import (
 
 from pystachio import Ref
 from pystachio.naming import frozendict
+from twitter.common import app, log
+from twitter.common.log.options import LogOptions
+from twitter.common.dirutil import du, tail_f
+from twitter.common.dirutil.tail import tail as tail_closed
+from twitter.common.quantity import Amount, Time, Data
+from twitter.common.quantity.parse_simple import parse_time, parse_data
+from twitter.common.recordio import RecordIO, ThriftRecordReader
 
 app.add_option("--root", dest="root", metavar="PATH",
                default=TaskPath.DEFAULT_CHECKPOINT_ROOT,

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/thermos/bin/thermos_ckpt.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/bin/thermos_ckpt.py b/src/main/python/apache/thermos/bin/thermos_ckpt.py
index 515abb5..16942c4 100644
--- a/src/main/python/apache/thermos/bin/thermos_ckpt.py
+++ b/src/main/python/apache/thermos/bin/thermos_ckpt.py
@@ -19,11 +19,12 @@ import sys
 import pprint
 import time
 
+from apache.thermos.common.ckpt import CheckpointDispatcher
+
 from gen.apache.thermos.ttypes import RunnerState, RunnerCkpt, TaskState
 
 from twitter.common import app
 from twitter.common.recordio import RecordIO, ThriftRecordReader
-from apache.thermos.common.ckpt import CheckpointDispatcher
 
 app.add_option("--checkpoint", dest = "ckpt", metavar = "CKPT",
                help = "read checkpoint from CKPT")

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/thermos/common/ckpt.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/common/ckpt.py b/src/main/python/apache/thermos/common/ckpt.py
index 7dcb07e..ea1d6cc 100644
--- a/src/main/python/apache/thermos/common/ckpt.py
+++ b/src/main/python/apache/thermos/common/ckpt.py
@@ -26,8 +26,6 @@ Task state machines.
 
 import os
 
-from twitter.common import log
-from twitter.common.recordio import RecordIO, ThriftRecordReader
 from gen.apache.thermos.ttypes import (
   ProcessState,
   ProcessStatus,
@@ -36,6 +34,8 @@ from gen.apache.thermos.ttypes import (
   TaskState,
 )
 
+from twitter.common import log
+from twitter.common.recordio import RecordIO, ThriftRecordReader
 
 class UniversalStateHandler(object):
   """

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/thermos/config/bin/config_load.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/config/bin/config_load.py b/src/main/python/apache/thermos/config/bin/config_load.py
index d7728ab..0fa7695 100644
--- a/src/main/python/apache/thermos/config/bin/config_load.py
+++ b/src/main/python/apache/thermos/config/bin/config_load.py
@@ -19,9 +19,11 @@ import sys
 import json
 import pprint
 
-from twitter.common import app
 from apache.thermos.config.loader import ThermosConfigLoader
 
+from twitter.common import app
+
+
 def main(args):
   """
     Given .thermos configs, loads them and prints out information about them.

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/main/python/apache/thermos/config/loader.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/thermos/config/loader.py b/src/main/python/apache/thermos/config/loader.py
index 3c6d673..7fb86e1 100644
--- a/src/main/python/apache/thermos/config/loader.py
+++ b/src/main/python/apache/thermos/config/loader.py
@@ -20,14 +20,13 @@ import os
 import re
 import textwrap
 
-from twitter.common.dirutil import safe_open
-from twitter.common.lang import Compatibility
 from apache.thermos.common.planner import TaskPlanner
 from apache.thermos.config.schema import Task
 
 from pystachio import Ref
 from pystachio.config import Config
-
+from twitter.common.dirutil import safe_open
+from twitter.common.lang import Compatibility
 
 class PortExtractor(object):
   class InvalidPorts(Exception): pass

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/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 73789dd..b496ccf 100644
--- a/src/main/python/apache/thermos/config/schema_helpers.py
+++ b/src/main/python/apache/thermos/config/schema_helpers.py
@@ -17,8 +17,6 @@
 """Helpers for composing Thermos workflows."""
 import itertools
 
-from twitter.common.lang import Compatibility
-
 from .schema_base import (
    Constraint,
    GB,
@@ -28,6 +26,7 @@ from .schema_base import (
 )
 
 from pystachio import Empty, List
+from twitter.common.lang import Compatibility
 
 
 __all__ = (

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/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 c9b4837..d4f473d 100644
--- a/src/main/python/apache/thermos/core/helper.py
+++ b/src/main/python/apache/thermos/core/helper.py
@@ -20,10 +20,6 @@ import os
 import signal
 import time
 
-from twitter.common import log
-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
 
@@ -35,6 +31,10 @@ from gen.apache.thermos.ttypes import (
   TaskStatus)
 
 import psutil
+from twitter.common import log
+from twitter.common.dirutil import lock_file, safe_mkdir
+from twitter.common.quantity import Amount, Time
+from twitter.common.recordio import ThriftRecordWriter
 
 
 class TaskKiller(object):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/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 c9899ef..d79042a 100644
--- a/src/main/python/apache/thermos/core/inspector.py
+++ b/src/main/python/apache/thermos/core/inspector.py
@@ -18,9 +18,6 @@ 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
 
@@ -31,6 +28,9 @@ from gen.apache.thermos.ttypes import (
 
 from .muxer import ProcessMuxer
 
+from twitter.common import log
+from twitter.common.recordio import RecordIO, ThriftRecordReader
+
 
 CheckpointInspection = namedtuple('CheckpointInspection',
     ['runner_latest_update',

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/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 2268764..08fdbb2 100644
--- a/src/main/python/apache/thermos/core/muxer.py
+++ b/src/main/python/apache/thermos/core/muxer.py
@@ -17,9 +17,10 @@
 import os
 import errno
 
+from gen.apache.thermos.ttypes import RunnerCkpt
+
 from twitter.common import log
 from twitter.common.recordio import ThriftRecordReader
-from gen.apache.thermos.ttypes import RunnerCkpt
 
 
 class ProcessMuxer(object):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/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 90fd1da..5658ebe 100644
--- a/src/main/python/apache/thermos/core/process.py
+++ b/src/main/python/apache/thermos/core/process.py
@@ -32,22 +32,23 @@ import subprocess
 import sys
 import time
 
-from twitter.common import log
+
+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.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/c18a8e53/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 77f0a92..a187618 100644
--- a/src/main/python/apache/thermos/core/runner.py
+++ b/src/main/python/apache/thermos/core/runner.py
@@ -50,11 +50,6 @@ import sys
 import time
 import traceback
 
-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,
@@ -84,6 +79,10 @@ 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
 
 
 # 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/c18a8e53/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 b6140e9..e03002a 100644
--- a/src/main/python/apache/thermos/monitoring/disk.py
+++ b/src/main/python/apache/thermos/monitoring/disk.py
@@ -32,12 +32,6 @@ import threading
 import time
 from Queue import Empty, Queue
 
-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.observers import Observer as WatchdogObserver
 from watchdog.events import (
   FileSystemEventHandler,
@@ -47,6 +41,11 @@ from watchdog.events import (
   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
 
 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/c18a8e53/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 9508c13..60d159f 100644
--- a/src/main/python/apache/thermos/monitoring/garbage.py
+++ b/src/main/python/apache/thermos/monitoring/garbage.py
@@ -20,14 +20,15 @@ import os
 import sys
 import time
 
-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
 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/c18a8e53/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 f11a912..d524a1d 100644
--- a/src/main/python/apache/thermos/monitoring/monitor.py
+++ b/src/main/python/apache/thermos/monitoring/monitor.py
@@ -29,8 +29,6 @@ import copy
 import errno
 import threading
 
-from twitter.common import log
-from twitter.common.recordio import ThriftRecordReader
 from apache.thermos.common.ckpt import CheckpointDispatcher
 
 from gen.apache.thermos.ttypes import (
@@ -40,6 +38,9 @@ from gen.apache.thermos.ttypes import (
   TaskState,
 )
 
+from twitter.common import log
+from twitter.common.recordio import ThriftRecordReader
+
 
 class TaskMonitor(object):
   """

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/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 07c6abe..c4530f2 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,11 @@
 from operator import attrgetter
 from time import time
 
-from twitter.common import log
-
 from .process import ProcessSample
 
 from psutil import Process
 from psutil import NoSuchProcess, AccessDenied, Error as PsutilError
+from twitter.common import log
 
 
 def process_to_sample(process):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/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 06e994c..2056872 100644
--- a/src/main/python/apache/thermos/monitoring/resource.py
+++ b/src/main/python/apache/thermos/monitoring/resource.py
@@ -37,17 +37,17 @@ 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
 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/c18a8e53/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 d4115eb..614b0bd 100644
--- a/src/main/python/apache/thermos/observer/bin/thermos_observer.py
+++ b/src/main/python/apache/thermos/observer/bin/thermos_observer.py
@@ -20,13 +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.task_observer import TaskObserver
-from apache.thermos.observer.http.http_observer import BottleObserver
 
 
 app.add_option("--root",

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/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 2c5332b..75d5ff8 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 twitter.common import log
-from twitter.common.http import HttpServer
+from .templating import HttpTemplate
 
 import bottle
 from mako.template import Template
-
-from .templating import HttpTemplate
+from twitter.common import log
+from twitter.common.http import HttpServer
 
 
 MB = 1024 * 1024

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/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 190bc29..118bd2f 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/c18a8e53/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 040715b..22e5247 100644
--- a/src/main/python/apache/thermos/observer/http/static_assets.py
+++ b/src/main/python/apache/thermos/observer/http/static_assets.py
@@ -17,11 +17,10 @@
 import mimetypes
 import os
 
-from twitter.common import log
-from twitter.common.http.server import HttpServer
-
 from bottle import HTTPResponse
 import pkg_resources
+from twitter.common import log
+from twitter.common.http.server import HttpServer
 
 
 class StaticAssets(object):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/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 d72ff18..18a2a5a 100644
--- a/src/main/python/apache/thermos/observer/observed_task.py
+++ b/src/main/python/apache/thermos/observer/observed_task.py
@@ -17,13 +17,13 @@
 from abc import abstractproperty
 import os
 
-from twitter.common import log
-from twitter.common.lang import AbstractClass
 from apache.thermos.config.loader import ThermosTaskWrapper
 from apache.thermos.config.schema import ThermosContext
 from apache.thermos.common.ckpt import CheckpointDispatcher
 
 from pystachio import Environment
+from twitter.common import log
+from twitter.common.lang import AbstractClass
 
 
 class ObservedTask(AbstractClass):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/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 eae6b79..ea40bfa 100644
--- a/src/main/python/apache/thermos/observer/task_observer.py
+++ b/src/main/python/apache/thermos/observer/task_observer.py
@@ -26,11 +26,6 @@ import os
 import threading
 import time
 
-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
 from apache.thermos.monitoring.monitor import TaskMonitor
@@ -41,6 +36,11 @@ 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
+
 
 class TaskObserver(ExceptionalThread, Lockable):
   """

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/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 64de3bd..0ef4cac 100644
--- a/src/main/python/apache/thermos/testing/runner.py
+++ b/src/main/python/apache/thermos/testing/runner.py
@@ -25,12 +25,9 @@ import sys
 import tempfile
 import time
 
-from twitter.common import log
-from twitter.common.contextutil import temporary_file, environment_as
 from apache.thermos.common.path import TaskPath
 from apache.thermos.common.ckpt import CheckpointDispatcher
 from apache.thermos.config.loader import ThermosTaskWrapper
-from thrift.TSerialization import deserialize as thrift_deserialize
 
 from gen.apache.thermos.ttypes import (
   TaskState,
@@ -38,6 +35,10 @@ from gen.apache.thermos.ttypes import (
   RunnerState,
 )
 
+from thrift.TSerialization import deserialize as thrift_deserialize
+from twitter.common import log
+from twitter.common.contextutil import temporary_file, environment_as
+
 
 class Runner(object):
   RUN_JOB_SCRIPT = """

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/test/python/apache/aurora/executor/test_gc_executor.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/executor/test_gc_executor.py b/src/test/python/apache/aurora/executor/test_gc_executor.py
index 0359098..73aea7b 100644
--- a/src/test/python/apache/aurora/executor/test_gc_executor.py
+++ b/src/test/python/apache/aurora/executor/test_gc_executor.py
@@ -25,11 +25,6 @@ import time
 import unittest
 
 from apache.aurora.executor.gc_executor import ThermosGCExecutor
-from twitter.common.concurrent import deadline, Timeout
-from twitter.common.contextutil import temporary_dir
-from twitter.common.dirutil import safe_rmtree
-from twitter.common.quantity import Amount, Time
-from twitter.common.testing.clock import ThreadedClock
 from apache.thermos.common.path import TaskPath
 from apache.thermos.config.schema import SimpleTask
 from apache.thermos.core.runner import TaskRunner
@@ -40,10 +35,14 @@ from gen.apache.aurora.ttypes import ScheduleStatus
 from gen.apache.thermos.ttypes import ProcessState, TaskState
 
 import mock
+import mesos_pb2 as mesos
 from thrift.TSerialization import serialize as thrift_serialize
 from thrift.TSerialization import deserialize as thrift_deserialize
-import mesos_pb2 as mesos
-
+from twitter.common.concurrent import deadline, Timeout
+from twitter.common.contextutil import temporary_dir
+from twitter.common.dirutil import safe_rmtree
+from twitter.common.quantity import Amount, Time
+from twitter.common.testing.clock import ThreadedClock
 
 
 ACTIVE_TASKS = ('sleep60-lost',)

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c18a8e53/src/test/python/apache/aurora/executor/test_thermos_executor.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/executor/test_thermos_executor.py b/src/test/python/apache/aurora/executor/test_thermos_executor.py
index d91c3b0..3810ea3 100644
--- a/src/test/python/apache/aurora/executor/test_thermos_executor.py
+++ b/src/test/python/apache/aurora/executor/test_thermos_executor.py
@@ -43,12 +43,6 @@ from apache.aurora.executor.thermos_task_runner import (
     ThermosTaskRunner,
 )
 from apache.aurora.executor.thermos_executor import ThermosExecutor
-from twitter.common import log
-from twitter.common.contextutil import temporary_dir
-from twitter.common.dirutil import safe_mkdtemp, safe_rmtree
-from twitter.common.exceptions import ExceptionalThread
-from twitter.common.log.options import LogOptions
-from twitter.common.quantity import Amount, Time
 from apache.thermos.common.path import TaskPath
 from apache.thermos.core.runner import TaskRunner
 from apache.thermos.monitoring.monitor import TaskMonitor
@@ -61,8 +55,14 @@ from gen.apache.aurora.ttypes import (
   TaskConfig,
 )
 
-from thrift.TSerialization import serialize
 import mesos_pb2 as mesos_pb
+from thrift.TSerialization import serialize
+from twitter.common import log
+from twitter.common.contextutil import temporary_dir
+from twitter.common.dirutil import safe_mkdtemp, safe_rmtree
+from twitter.common.exceptions import ExceptionalThread
+from twitter.common.log.options import LogOptions
+from twitter.common.quantity import Amount, Time
 
 
 if 'THERMOS_DEBUG' in os.environ:


Mime
View raw message