code: def from_json(cls, name, spec):
          
          if "run" not in spec:
              raise TuneError("No trainable specified!")
  
          # Special case the `env` param for RLlib by automatically
          # moving it into the `config` section.
          if "env" in spec:
              spec["config"] = spec.get("config", {})
              spec["config"]["env"] = spec["env"]
              del spec["env"]
  
          spec = copy.deepcopy(spec)
  
          run_value = spec.pop("run")
          try:
              exp = cls(name, run_value, **spec)
          except TypeError:
              raise TuneError("Improper argument from JSON: {}.".format(spec))
          return exp
docs: Generates an Experiment object from JSON.
  
          Args:
              name (str): Name of Experiment.
              spec (dict): JSON configuration of experiment.