parameters: (task_name, is_remote)
docstring: Return powercycle task config.
docstring_summary: Return powercycle task config.
docstring_tokens: Return powercycle task config .
function: def get_task_config(task_name, is_remote):
      """Return powercycle task config."""
  
      if is_remote:
          config_location = powercycle.abs_path(
              f"{powercycle_constants.REMOTE_DIR}/{POWERCYCLE_TASKS_CONFIG}")
      else:
          config_location = powercycle.abs_path(POWERCYCLE_TASKS_CONFIG)
  
      with open(config_location) as file_handle:
          raw_yaml = yaml.safe_load(file_handle)
      tasks_raw_yaml = raw_yaml.get("tasks", [])
  
      for single_task_yaml in tasks_raw_yaml:
          if single_task_yaml["name"] == task_name:
              return PowercycleTaskConfig(single_task_yaml)
  
      raise Exception(f"Task with name '{task_name}' is not found"
                      f" in powercycle tasks configuration file '{POWERCYCLE_TASKS_CONFIG}'."
                      f" Please add a task there with the appropriate name.")
function_tokens: def get_task_config ( task_name , is_remote ) : if is_remote : config_location = powercycle . abs_path ( f"{powercycle_constants.REMOTE_DIR}/{POWERCYCLE_TASKS_CONFIG}" ) else : config_location = powercycle . abs_path ( POWERCYCLE_TASKS_CONFIG ) with open ( config_location ) as file_handle : raw_yaml = yaml . safe_load ( file_handle ) tasks_raw_yaml = raw_yaml . get ( "tasks" , [ ] ) for single_task_yaml in tasks_raw_yaml : if single_task_yaml [ "name" ] == task_name : return PowercycleTaskConfig ( single_task_yaml ) raise Exception ( f"Task with name '{task_name}' is not found" f" in powercycle tasks configuration file '{POWERCYCLE_TASKS_CONFIG}'." f" Please add a task there with the appropriate name." )