class_docstr: Base class for different run configs.
class_docstr_tok: ["Base","class","for","different","run","configs","."]
docstr: Save a replay to a directory, returning the path to the replay.
  
  Args:
    replay_data: The result of controller.save_replay(), ie the binary data.
    replay_dir: Where to save the replay. This can be absolute or relative.
    prefix: Optional prefix for the replay filename.
  
  Returns:
    The full path where the replay is saved.
  
  Raises:
    ValueError: If the prefix contains the path seperator.
docstr_tok: ["Save","a","replay","to","a","directory",",","returning","the","path","to","the","replay",".","Args",":","replay_data",":","The","result","of","controller.save_replay","(",")",",","ie","the","binary","data",".","replay_dir",":","Where","to","save","the","replay",".","This","can","be","absolute","or","relative",".","prefix",":","Optional","prefix","for","the","replay","filename",".","Returns",":","The","full","path","where","the","replay","is","saved",".","Raises",":","ValueError",":","If","the","prefix","contains","the","path","seperator","."]
code: def save_replay(self, replay_data, replay_dir, prefix=None):
      """Save a replay to a directory, returning the path to the replay.
  
      Args:
        replay_data: The result of controller.save_replay(), ie the binary data.
        replay_dir: Where to save the replay. This can be absolute or relative.
        prefix: Optional prefix for the replay filename.
  
      Returns:
        The full path where the replay is saved.
  
      Raises:
        ValueError: If the prefix contains the path seperator.
      """
      if not prefix:
          replay_filename = ""
      elif os.path.sep in prefix:
          raise ValueError(
              "Prefix '%s' contains '%s', use replay_dir instead."
              % (prefix, os.path.sep)
          )
      else:
          replay_filename = prefix + "_"
      now = datetime.datetime.utcnow().replace(microsecond=0)
      replay_filename += "%s.SC2Replay" % now.isoformat("-").replace(
          ":", "-"
      )
      replay_dir = self.abs_replay_path(replay_dir)
      if not gfile.Exists(replay_dir):
          gfile.MakeDirs(replay_dir)
      replay_path = os.path.join(replay_dir, replay_filename)
      with gfile.Open(replay_path, "wb") as f:
          f.write(replay_data)
      return replay_path
  
imports: import collections
  import datetime
  import os
  from pysc2.lib import gfile
label_desc: Use image node_id 6 for calling the RunConfig obj's underlying member method code with example usage: obj.save_replay(replay_data, replay_dir, prefix) and returns: replay_path