Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setupAndStart(testRoot, extraParameters=[], debugInformation=True, waitTime=DELAY_REFERENCE):
"""
@brief setup and start netedit
"""
if os.name == "posix":
# to work around non working gtk clipboard
pyperclip.set_clipboard("xclip")
# Open Netedit
neteditProcess = Popen(extraParameters, debugInformation)
# atexit.register(quit, neteditProcess, False, False)
# print debug information
print("TestFunctions: Netedit opened successfully")
# Wait for Netedit reference
return neteditProcess, getReferenceMatch(neteditProcess, waitTime)
self.dqn = DQN(
model_file_path=model_file_path if os.path.isfile(model_file_path) else None,
input_shape=(67, 120, 8),
input_mapping=input_mapping,
action_space=action_space,
replay_memory_size=1000,
max_steps=100000,
observe_steps=1000,
batch_size=64,
initial_epsilon=0.5,
final_epsilon=0.1,
override_epsilon=False
)
pyperclip.set_clipboard("xsel")
pyperclip.copy(f"goto s.boss.{str(self.config['boss'])}")
from tornado import websocket, web, ioloop
import time
from threading import Thread
import sys
import os
from itertools import zip_longest
try:
from tornado.platform.asyncio import AnyThreadEventLoopPolicy
import asyncio
asyncio.set_event_loop_policy(AnyThreadEventLoopPolicy())
except:
pass
if os.name == 'posix':
pyperclip.set_clipboard('xclip')
clients = []
def remove_repetition(text, n):
if len(text) % n != 0:
return text
output = []
args = [iter(text)] * n
for group in zip_longest(*args):
first_char = group[0]
output.append(first_char)
for c in group[1:]:
if c != first_char:
return text