Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self):
self.logger = get_logger(str(type(self).__name__))
def __init__(self):
self.logger = get_logger(type(self).__name__)
pass
def __init__(self):
self.logger = get_logger(str(type(self).__name__))
def __load_model_safely(self):
try:
self.model.load(self.get_file_path())
except Exception as e:
get_logger(str(type(self).__name__)).warn("Unable to load model: " + str(e))
import subprocess
import sys
DEFAULT_LOGGER = 'rlbot'
if __name__ == '__main__':
try:
from rlbot.utils import public_utils, logging_utils
logger = logging_utils.get_logger(DEFAULT_LOGGER)
if not public_utils.have_internet():
logger.log(logging_utils.logging_level,
'Skipping upgrade check for now since it looks like you have no internet')
elif public_utils.is_safe_to_upgrade():
subprocess.call([sys.executable, "-m", "pip", "install", '-r', 'requirements.txt', '--upgrade', '--upgrade-strategy=eager'])
# https://stackoverflow.com/a/44401013
rlbots = [module for module in sys.modules if module.startswith('rlbot')]
for rlbot_module in rlbots:
sys.modules.pop(rlbot_module)
except ImportError:
subprocess.call([sys.executable, "-m", "pip", "install", '-r', 'requirements.txt', '--upgrade', '--upgrade-strategy=eager'])
try:
if len(sys.argv) > 1 and sys.argv[1] == 'gui':
def __init__(self, agent_metadata_queue, quit_event):
super().__init__(agent_metadata_queue, quit_event)
from multiprocessing.managers import BaseManager
from leviathan.torch_memory import RewardMemory
BaseManager.register('Memory', RewardMemory)
self.logger = get_logger('torch_mgr')
self.metadata_list = [None, None]
self.manager = BaseManager()
self.manager.start()
self.game_memory = self.manager.Memory()
self.writer = SummaryWriter()
self.n_iter = 0
if load_exp:
self.game_memory.load(name + '.exp')
from leviathan.torch_model import SymmetricModel, RewardModel
self.actor_model = SymmetricModel()
import torch
if load_model:
self.actor_model.load_state_dict(torch.load(name + '.actor'))
def __init__(self, name, team, index):
super().__init__(name, team, index)
self.logger = get_logger(name)
self.manager_path = None
sys.path.insert(0, get_repo_directory()) # this is for separate process imports
def __init__(self, name, team, index):
super().__init__(name, team, index)
self.logger = get_logger(name)
path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(path)
def __init__(self):
self.logger = get_logger(str(type(self).__name__))