mirror of
https://github.com/gryf/coach.git
synced 2025-12-17 19:20:19 +01:00
Cleanup imports.
Till now, most of the modules were importing all of the module objects (variables, classes, functions, other imports) into module namespace, which potentially could (and was) cause of unintentional use of class or methods, which was indirect imported. With this patch, all the star imports were substituted with top-level module, which provides desired class or function. Besides, all imports where sorted (where possible) in a way pep8[1] suggests - first are imports from standard library, than goes third party imports (like numpy, tensorflow etc) and finally coach modules. All of those sections are separated by one empty line. [1] https://www.python.org/dev/peps/pep-0008/#imports
This commit is contained in:
20
utils.py
20
utils.py
@@ -13,20 +13,22 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
import json
|
||||
import inspect
|
||||
import os
|
||||
import numpy as np
|
||||
import threading
|
||||
from subprocess import call, Popen
|
||||
import signal
|
||||
import copy
|
||||
import inspect
|
||||
import json
|
||||
import os
|
||||
import signal
|
||||
import subprocess
|
||||
import threading
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
||||
killed_processes = []
|
||||
|
||||
eps = np.finfo(np.float32).eps
|
||||
|
||||
|
||||
class Enum(object):
|
||||
def __init__(self):
|
||||
pass
|
||||
@@ -161,7 +163,7 @@ def ClassToDict(x):
|
||||
|
||||
|
||||
def cmd_line_run(result, run_cmd, id=-1):
|
||||
p = Popen(run_cmd, shell=True, executable="/bin/bash")
|
||||
p = subprocess.Popen(run_cmd, shell=True, executable="/bin/bash")
|
||||
while result[0] is None or result[0] == [None]:
|
||||
if id in killed_processes:
|
||||
p.kill()
|
||||
|
||||
Reference in New Issue
Block a user