# Path: pysc2/lib/gfile.py



import collections
import datetime
import os
from pysc2.lib import gfile
      cwd: Where to set the current working directory.
      env: What to pass as the environment variables.
    """
    self.replay_dir = replay_dir
    self.data_dir = data_dir
    self.tmp_dir = tmp_dir
    self.cwd = cwd
    self.env = env
    self.version = self._get_version(version)

  def map_data(self, map_name, players=None):
    """Return the map data for a map by name or path."""
    map_names = [map_name]
    if players:
      map_names.append(os.path.join(
          os.path.dirname(map_name),
          "(%s)%s" % (players, os.path.basename(map_name))))
    for name in map_names:
      path = os.path.join(self.data_dir, "Maps", name)
      if gfile.Exists(path):
        with gfile.Open(path, "rb") as f:
          return f.read()
    raise ValueError("Map '%s' not found." % map_name)

  def abs_replay_path(self, replay_path):
    """Return the absolute path to the replay, outside the sandbox."""
    return os.path.join(self.replay_dir, replay_path)

  def replay_data(self, replay_path):
    """Return the replay data given a path to the replay."""

# Path: pysc2/lib/gfile.py



# Path: pysc2/run_configs/lib.py
import collections
import datetime
import os
from pysc2.lib import gfile

      cwd: Where to set the current working directory.
      env: What to pass as the environment variables.
    """
    self.replay_dir = replay_dir
    self.data_dir = data_dir
    self.tmp_dir = tmp_dir
    self.cwd = cwd
    self.env = env
    self.version = self._get_version(version)

  def map_data(self, map_name, players=None):
    """Return the map data for a map by name or path."""
    map_names = [map_name]
    if players:
      map_names.append(os.path.join(
          os.path.dirname(map_name),
          "(%s)%s" % (players, os.path.basename(map_name))))
    for name in map_names:
      path = os.path.join(self.data_dir, "Maps", name)
      if gfile.Exists(path):
        with gfile.Open(path, "rb") as f:
          return f.read()
    raise ValueError("Map '%s' not found." % map_name)

  def abs_replay_path(self, replay_path):
    """Return the absolute path to the replay, outside the sandbox."""
    return os.path.join(self.replay_dir, replay_path)

  def replay_data(self, replay_path):
    """Return the replay data given a path to the replay."""

    with gfile.Open(self.abs_replay_path(replay_path), "rb") as f: