class_docstr: Creates experiment log directories and runs an experiment.
  
  This class should only be created by calling garage.wrap_experiment.
  Generally, it's used as a decorator like this:
  
      @wrap_experiment(snapshot_mode='all')
      def my_experiment(ctxt, seed, lr=0.5):
          ...
  
      my_experiment(seed=1)
  
  Even though this class could be implemented as a closure in
  wrap_experiment(), it's more readable (and easier to pickle) implemented as
  a class.
  
  Note that the full path that will be created is
  f'{data}/local/{prefix}/{name}'.
  
  Args:
      function (callable or None): The experiment function to wrap.
      log_dir (str or None): The full log directory to log to. Will be
          computed from `name` if omitted.
      name (str or None): The name of this experiment template. Will be
          filled from the wrapped function's name if omitted.
      prefix (str): Directory under data/local in which to place the
          experiment directory.
      snapshot_mode (str): Policy for which snapshots to keep (or make at
          all). Can be either "all" (all iterations will be saved), "last"
          (only the last iteration will be saved), "gap" (every snapshot_gap
          iterations are saved), or "none" (do not save snapshots).
      snapshot_gap (int): Gap between snapshot iterations. Waits this number
          of iterations before taking another snapshot.
      archive_launch_repo (bool): Whether to save an archive of the
          repository containing the launcher script. This is a potentially
          expensive operation which is useful for ensuring reproducibility.
      name_parameters (str or None): Parameters to insert into the experiment
          name. Should be either None (the default), 'all' (all parameters
          will be used), or 'passed' (only passed parameters will be used).
          The used parameters will be inserted in the order they appear in
          the function definition.
      use_existing_dir (bool): If true, (re)use the directory for this
          experiment, even if it already contains data.
      x_axis (str): Key to use for x axis of plots.
docstr: Augment the experiment name with parameters.
  
  Args:
      options (dict): Options to `wrap_experiment` itself. See the
          function documentation for details.
      name (str): Name without parameter names.
      params (dict): Dictionary of parameters.
  
  Raises:
      ValueError: If self.name_parameters is not set to None, "passed",
          or "all".
  
  Returns:
      str: Returns the augmented name.
docstr_tok: ["Augment","the","experiment","name","with","parameters",".","Args",":","options","(","dict",")",":","Options","to","`","wrap_experiment","`","itself",".","See","the","function","documentation","for","details",".","name","(","str",")",":","Name","without","parameter","names",".","params","(","dict",")",":","Dictionary","of","parameters",".","Raises",":","ValueError",":","If","self.name_parameters","is","not","set","to","None",",","``","passed","''",",","or","``","all","''",".","Returns",":","str",":","Returns","the","augmented","name","."]
code: def _augment_name(cls, options, name, params):
      """Augment the experiment name with parameters.
  
      Args:
          options (dict): Options to `wrap_experiment` itself. See the
              function documentation for details.
          name (str): Name without parameter names.
          params (dict): Dictionary of parameters.
  
      Raises:
          ValueError: If self.name_parameters is not set to None, "passed",
              or "all".
  
      Returns:
          str: Returns the augmented name.
  
      """
      name_parameters = collections.OrderedDict()
  
      if options["name_parameters"] == "passed":
          for param in options["signature"].parameters.values():
              try:
                  name_parameters[param.name] = params[param.name]
              except KeyError:
                  pass
      elif options["name_parameters"] == "all":
          for param in options["signature"].parameters.values():
              name_parameters[param.name] = params.get(
                  param.name, param.default
              )
      elif options["name_parameters"] is not None:
          raise ValueError(
              "wrap_experiment.name_parameters should be set "
              'to one of None, "passed", or "all"'
          )
      param_str = "_".join(
          "{}={}".format(k, v) for (k, v) in name_parameters.items()
      )
      if param_str:
          return "{}_{}".format(name, param_str)
      else:
          return name
  
imports: import collections
  import datetime
  import enum
  import functools
  import gc
  import inspect
  import json
  import os
  import pathlib
  import subprocess
  import warnings
  import weakref
  import dateutil.tz
  import dowel
  from dowel import logger
  import numpy
  import __main__
label_desc: Use image node_id 3 for calling the ExperimentTemplate obj's underlying member method code with example usage: obj._augment_name(cls, options, name, params) and returns: str, name