class_docstr: Runtime Environment Manager class to manage runtime environment.
class_docstr_tok: ["Runtime","Environment","Manager","class","to","manage","runtime","environment","."]
docstr: Change the permission of given directories
  
  Args:
      dirs (list[str]): A list of directories for permission update.
      new_permission (str): The new permission for the given directories.
code: def change_dir_permission(self, dirs: list, new_permission: str):
      """Change the permission of given directories
  
      Args:
          dirs (list[str]): A list of directories for permission update.
          new_permission (str): The new permission for the given directories.
      """
  
      _ERROR_MSG_PREFIX = (
          "Failed to change directory permissions due to: "
      )
      command = ["sudo", "chmod", "-R", new_permission] + dirs
      logger.info("Executing '%s'.", " ".join(command))
  
      try:
          subprocess.run(command, check=True, stderr=subprocess.PIPE)
      except subprocess.CalledProcessError as called_process_err:
          err_msg = called_process_err.stderr.decode("utf-8")
          raise RuntimeEnvironmentError(
              f"{_ERROR_MSG_PREFIX} {err_msg}"
          )
      except FileNotFoundError as file_not_found_err:
          if "[Errno 2] No such file or directory: 'sudo'" in str(
              file_not_found_err
          ):
              raise RuntimeEnvironmentError(
                  f"{_ERROR_MSG_PREFIX} {file_not_found_err}. "
                  "Please contact the image owner to install 'sudo' in the job container "
                  "and provide sudo privilege to the container user."
              )
          raise RuntimeEnvironmentError(file_not_found_err)
  
imports: from __future__ import absolute_import
  import logging
  import sys
  import shlex
  import os
  import subprocess
  import time
  import dataclasses
  import json
label_desc: Use image node_id 7 for calling the RuntimeEnvironmentManager obj's underlying member method code with example usage: obj.change_dir_permission(dirs, new_permission) without return types