# Path: pysc2/lib/remote_controller.py
# FLAGS = flags.FLAGS
# class ConnectError(Exception):
# class RequestError(Exception):
# class RemoteController(object):
#   def __init__(self, description, res):
# def check_error(res, error_enum):
# def decorate_check_error(error_enum):
#   def decorator(func):
#     def _check_error(*args, **kwargs):
# def skip_status(*skipped):
#   def decorator(func):
#     def _skip_status(self, *args, **kwargs):
# def valid_status(*valid):
#   def decorator(func):
#     def _valid_status(self, *args, **kwargs):
# def catch_game_end(func):
#   def _catch_game_end(self, *args, **kwargs):
#   def __init__(self, host, port, proc=None, timeout_seconds=None):
#   def _connect(self, host, port, proc, timeout_seconds):
#   def close(self):
#   def status_ended(self):
#   def create_game(self, req_create_game):
#   def save_map(self, map_path, map_data):
#   def join_game(self, req_join_game):
#   def restart(self):
#   def start_replay(self, req_start_replay):
#   def game_info(self):
#   def data_raw(self, ability_id=True, unit_type_id=True, upgrade_id=True,
#                buff_id=True, effect_id=True):
#   def data(self):
#   def observe(self, disable_fog=False, target_game_loop=0):
#   def available_maps(self):
#   def step(self, count=1):
#   def actions(self, req_action):
#   def act(self, action):
#   def observer_actions(self, req_observer_action):
#   def observer_act(self, action):
#   def chat(self, message, channel=sc_pb.ActionChat.Broadcast):
#   def leave(self):
#   def save_replay(self):
#   def debug(self, debug_commands):
#   def query(self, query):
#   def quit(self):
#   def ping(self):
#   def replay_info(self, replay_data):
#   def status(self):
# 
# Path: pysc2/lib/stopwatch.py
# class Stat(object):
# class StopWatchContext(object):
# class TracingStopWatchContext(StopWatchContext):
# class FakeStopWatchContext(object):
# class StopWatch(object):
#   def __init__(self):
#   def reset(self):
#   def add(self, val):
#   def avg(self):
#   def dev(self):
#   def merge(self, other):
#   def build(summation, average, standard_deviation, minimum, maximum, number):
#   def parse(s):
#   def __str__(self):
#   def __init__(self, stopwatch, name):
#   def __enter__(self):
#   def __exit__(self, unused_exception_type, unused_exc_value, unused_traceback):
#   def __enter__(self):
#   def __exit__(self, *args, **kwargs):
#   def _log(self, s):
#   def __enter__(self):
#   def __exit__(self, unused_exception_type, unused_exc_value, unused_traceback):
#   def __init__(self, enabled=True, trace=False):
#   def disable(self):
#   def enable(self):
#   def trace(self):
#   def custom(self, factory):
#   def __call__(self, name):
#   def decorate(self, name_or_func):
#     def decorator(name, func):
#       def _stopwatch(*args, **kwargs):
#   def push(self, name):
#   def pop(self):
#   def cur_stack(self):
#   def clear(self):
#   def add(self, name, duration):
#   def __getitem__(self, name):
#   def times(self):
#   def merge(self, other):
#   def parse(s):
#   def str(self, threshold=0.1):
#   def __str__(self):


from absl import logging
from absl import flags
from future.builtins import range  # pylint: disable=redefined-builtin
from pysc2.lib import remote_controller
from pysc2.lib import stopwatch
import os
import platform
import shutil
import subprocess
import tempfile
import time
import portpicker
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS-IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Launch the game and set up communication."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function




flags.DEFINE_bool(
    "sc2_verbose", False, "Enable SC2 verbose logging.", allow_hide_cpp=True)
flags.DEFINE_bool(
    "sc2_verbose_mp", False, "Enable SC2 verbose multiplayer logging.")
flags.DEFINE_bool("sc2_gdb", False, "Run SC2 in gdb.")
flags.DEFINE_bool("sc2_strace", False, "Run SC2 in strace.")
flags.DEFINE_integer("sc2_port", None,
                     "If set, connect to the instance on "
                     "localhost:sc2_port instead of launching one.")
FLAGS = flags.FLAGS


# Path: pysc2/lib/remote_controller.py
# FLAGS = flags.FLAGS
# class ConnectError(Exception):
# class RequestError(Exception):
# class RemoteController(object):
#   def __init__(self, description, res):
# def check_error(res, error_enum):
# def decorate_check_error(error_enum):
#   def decorator(func):
#     def _check_error(*args, **kwargs):
# def skip_status(*skipped):
#   def decorator(func):
#     def _skip_status(self, *args, **kwargs):
# def valid_status(*valid):
#   def decorator(func):
#     def _valid_status(self, *args, **kwargs):
# def catch_game_end(func):
#   def _catch_game_end(self, *args, **kwargs):
#   def __init__(self, host, port, proc=None, timeout_seconds=None):
#   def _connect(self, host, port, proc, timeout_seconds):
#   def close(self):
#   def status_ended(self):
#   def create_game(self, req_create_game):
#   def save_map(self, map_path, map_data):
#   def join_game(self, req_join_game):
#   def restart(self):
#   def start_replay(self, req_start_replay):
#   def game_info(self):
#   def data_raw(self, ability_id=True, unit_type_id=True, upgrade_id=True,
#                buff_id=True, effect_id=True):
#   def data(self):
#   def observe(self, disable_fog=False, target_game_loop=0):
#   def available_maps(self):
#   def step(self, count=1):
#   def actions(self, req_action):
#   def act(self, action):
#   def observer_actions(self, req_observer_action):
#   def observer_act(self, action):
#   def chat(self, message, channel=sc_pb.ActionChat.Broadcast):
#   def leave(self):
#   def save_replay(self):
#   def debug(self, debug_commands):
#   def query(self, query):
#   def quit(self):
#   def ping(self):
#   def replay_info(self, replay_data):
#   def status(self):
# 
# Path: pysc2/lib/stopwatch.py
# class Stat(object):
# class StopWatchContext(object):
# class TracingStopWatchContext(StopWatchContext):
# class FakeStopWatchContext(object):
# class StopWatch(object):
#   def __init__(self):
#   def reset(self):
#   def add(self, val):
#   def avg(self):
#   def dev(self):
#   def merge(self, other):
#   def build(summation, average, standard_deviation, minimum, maximum, number):
#   def parse(s):
#   def __str__(self):
#   def __init__(self, stopwatch, name):
#   def __enter__(self):
#   def __exit__(self, unused_exception_type, unused_exc_value, unused_traceback):
#   def __enter__(self):
#   def __exit__(self, *args, **kwargs):
#   def _log(self, s):
#   def __enter__(self):
#   def __exit__(self, unused_exception_type, unused_exc_value, unused_traceback):
#   def __init__(self, enabled=True, trace=False):
#   def disable(self):
#   def enable(self):
#   def trace(self):
#   def custom(self, factory):
#   def __call__(self, name):
#   def decorate(self, name_or_func):
#     def decorator(name, func):
#       def _stopwatch(*args, **kwargs):
#   def push(self, name):
#   def pop(self):
#   def cur_stack(self):
#   def clear(self):
#   def add(self, name, duration):
#   def __getitem__(self, name):
#   def times(self):
#   def merge(self, other):
#   def parse(s):
#   def str(self, threshold=0.1):
#   def __str__(self):


# Path: pysc2/lib/sc_process.py
from absl import logging
from absl import flags
from future.builtins import range  # pylint: disable=redefined-builtin
from pysc2.lib import remote_controller
from pysc2.lib import stopwatch
import os
import platform
import shutil
import subprocess
import tempfile
import time
import portpicker

# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS-IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Launch the game and set up communication."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function




flags.DEFINE_bool(
    "sc2_verbose", False, "Enable SC2 verbose logging.", allow_hide_cpp=True)
flags.DEFINE_bool(
    "sc2_verbose_mp", False, "Enable SC2 verbose multiplayer logging.")
flags.DEFINE_bool("sc2_gdb", False, "Run SC2 in gdb.")
flags.DEFINE_bool("sc2_strace", False, "Run SC2 in strace.")
flags.DEFINE_integer("sc2_port", None,
                     "If set, connect to the instance on "
                     "localhost:sc2_port instead of launching one.")
FLAGS = flags.FLAGS


sw = stopwatch.sw