docstr: :param framework_type: deep learning framework type. currently only tensorflow is supported
  :param evaluate_only: if not None, the task will be used only for evaluating the model for the given number of steps.
                          A value of 0 means that task will be evaluated for an infinite number of steps.
  :param parameters_server_hosts: comma-separated list of hostname:port pairs to which the parameter servers are
                                  assigned
  :param worker_hosts: comma-separated list of hostname:port pairs to which the workers are assigned
  :param job_type: the job type - either ps (short for parameters server) or worker
  :param task_index: the index of the process
  :param num_tasks: the number of total tasks that are running (not including the parameters server)
  :param num_training_tasks: the number of tasks that are training (not including the parameters server)
  :param use_cpu: use the cpu for this task
  :param experiment_path: the path to the directory which will store all the experiment outputs
  :param dnd: an external DND to use for NEC. This is a workaround needed for a shared DND not using the scratchpad.
  :param seed: a seed to use for the random numbers generator
  :param checkpoint_save_secs: the number of seconds between each checkpoint saving
  :param checkpoint_restore_path: the path to restore the checkpoints from
  :param checkpoint_save_dir: the directory to store the checkpoints in
  :param export_onnx_graph: If set to True, this will export an onnx graph each time a checkpoint is saved
  :param apply_stop_condition: If set to True, this will apply the stop condition defined by reaching a target success rate
docstr_tok: [":","param","framework_type",":","deep","learning","framework","type",".","currently","only","tensorflow","is","supported",":","param","evaluate_only",":","if","not","None",",","the","task","will","be","used","only","for","evaluating","the","model","for","the","given","number","of","steps",".","A","value","of","0","means","that","task","will","be","evaluated","for","an","infinite","number","of","steps",".",":","param","parameters_server_hosts",":","comma-separated","list","of","hostname",":","port","pairs","to","which","the","parameter","servers","are","assigned",":","param","worker_hosts",":","comma-separated","list","of","hostname",":","port","pairs","to","which","the","workers","are","assigned",":","param","job_type",":","the","job","type","-","either","ps","(","short","for","parameters","server",")","or","worker",":","param","task_index",":","the","index","of","the","process",":","param","num_tasks",":","the","number","of","total","tasks","that","are","running","(","not","including","the","parameters","server",")",":","param","num_training_tasks",":","the","number","of","tasks","that","are","training","(","not","including","the","parameters","server",")",":","param","use_cpu",":","use","the","cpu","for","this","task",":","param","experiment_path",":","the","path","to","the","directory","which","will","store","all","the","experiment","outputs",":","param","dnd",":","an","external","DND","to","use","for","NEC",".","This","is","a","workaround","needed","for","a","shared","DND","not","using","the","scratchpad",".",":","param","seed",":","a","seed","to","use","for","the","random","numbers","generator",":","param","checkpoint_save_secs",":","the","number","of","seconds","between","each","checkpoint","saving",":","param","checkpoint_restore_path",":","the","path","to","restore","the","checkpoints","from",":","param","checkpoint_save_dir",":","the","directory","to","store","the","checkpoints","in",":","param","export_onnx_graph",":","If","set","to","True",",","this","will","export","an","onnx","graph","each","time","a","checkpoint","is","saved",":","param","apply_stop_condition",":","If","set","to","True",",","this","will","apply","the","stop","condition","defined","by","reaching","a","target","success","rate"]
code: def __init__(
      self,
      framework_type: Frameworks,
      parameters_server_hosts: str,
      worker_hosts: str,
      job_type: str,
      task_index: int,
      evaluate_only: int = None,
      num_tasks: int = None,
      num_training_tasks: int = None,
      use_cpu: bool = False,
      experiment_path=None,
      dnd=None,
      shared_memory_scratchpad=None,
      seed=None,
      checkpoint_save_secs=None,
      checkpoint_restore_path=None,
      checkpoint_save_dir=None,
      export_onnx_graph: bool = False,
      apply_stop_condition: bool = False,
  ):
      """
      :param framework_type: deep learning framework type. currently only tensorflow is supported
      :param evaluate_only: if not None, the task will be used only for evaluating the model for the given number of steps.
                              A value of 0 means that task will be evaluated for an infinite number of steps.
      :param parameters_server_hosts: comma-separated list of hostname:port pairs to which the parameter servers are
                                      assigned
      :param worker_hosts: comma-separated list of hostname:port pairs to which the workers are assigned
      :param job_type: the job type - either ps (short for parameters server) or worker
      :param task_index: the index of the process
      :param num_tasks: the number of total tasks that are running (not including the parameters server)
      :param num_training_tasks: the number of tasks that are training (not including the parameters server)
      :param use_cpu: use the cpu for this task
      :param experiment_path: the path to the directory which will store all the experiment outputs
      :param dnd: an external DND to use for NEC. This is a workaround needed for a shared DND not using the scratchpad.
      :param seed: a seed to use for the random numbers generator
      :param checkpoint_save_secs: the number of seconds between each checkpoint saving
      :param checkpoint_restore_path: the path to restore the checkpoints from
      :param checkpoint_save_dir: the directory to store the checkpoints in
      :param export_onnx_graph: If set to True, this will export an onnx graph each time a checkpoint is saved
      :param apply_stop_condition: If set to True, this will apply the stop condition defined by reaching a target success rate
  
      """
      super().__init__(
          framework_type=framework_type,
          evaluate_only=evaluate_only,
          use_cpu=use_cpu,
          experiment_path=experiment_path,
          seed=seed,
          checkpoint_save_secs=checkpoint_save_secs,
          checkpoint_restore_path=checkpoint_restore_path,
          checkpoint_save_dir=checkpoint_save_dir,
          export_onnx_graph=export_onnx_graph,
          apply_stop_condition=apply_stop_condition,
      )
      self.parameters_server_hosts = parameters_server_hosts
      self.worker_hosts = worker_hosts
      self.job_type = job_type
      self.task_index = task_index
      self.num_tasks = num_tasks
      self.num_training_tasks = num_training_tasks
      self.device = None  # the replicated device which will be used for the global parameters
      self.worker_target = None
      self.dnd = dnd
      self.shared_memory_scratchpad = shared_memory_scratchpad
  
imports: import inspect
  import json
  import os
  import sys
  import types
  from collections import OrderedDict
  from enum import Enum
  from typing import Dict, List, Union
  from rl_coach.core_types import TrainingSteps, EnvironmentSteps, GradientClippingMethod, RunPhase, SelectedPhaseOnlyDumpFilter, MaxDumpFilter
  from rl_coach.filters.filter import NoInputFilter
  from rl_coach.logger import screen
label_desc: Use image node_id 1 to create a new DistributedTaskParameters object from inherited base classes: TaskParameters with example: obj = DistributedTaskParameters(framework_type, parameters_server_hosts, worker_hosts, job_type, task_index, evaluate_only, num_tasks, num_training_tasks, use_cpu, experiment_path, dnd, shared_memory_scratchpad, seed, checkpoint_save_secs, checkpoint_restore_path, checkpoint_save_dir, export_onnx_graph, apply_stop_condition)