class_docstr: `NotebookJobStep` for SageMaker Pipelines Workflows.
  
  For more details about SageMaker Notebook Jobs, see `SageMaker Notebook Jobs
  <https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-auto-run.html>`_.
class_docstr_tok: ["`","NotebookJobStep","`","for","SageMaker","Pipelines","Workflows",".","For","more","details","about","SageMaker","Notebook","Jobs",",","see","`","SageMaker","Notebook","Jobs","<","https",":","\/\/docs.aws.amazon.com\/sagemaker\/latest\/dg\/notebook-auto-run.html",">","`","_","."]
docstr: Prepare environment variable for calling training job API.
  
  Attach the system environments used to pass execution context to the backend
  execution mechanism.
docstr_tok: ["Prepare","environment","variable","for","calling","training","job","API",".","Attach","the","system","environments","used","to","pass","execution","context","to","the","backend","execution","mechanism","."]
code: def _prepare_env_variables(self):
      """Prepare environment variable for calling training job API.
  
      Attach the system environments used to pass execution context to the backend
      execution mechanism.
      """
  
      job_envs = (
          self.environment_variables
          if self.environment_variables
          else {}
      )
      system_envs = {
          "AWS_DEFAULT_REGION": self._region_from_session,
          "SM_JOB_DEF_VERSION": "1.0",
          "SM_ENV_NAME": "sagemaker-default-env",
          "SM_SKIP_EFS_SIMULATION": "true",
          "SM_EXECUTION_INPUT_PATH": "/opt/ml/input/data/"
          "sagemaker_headless_execution_pipelinestep",
          "SM_KERNEL_NAME": self.kernel_name,
          "SM_INPUT_NOTEBOOK_NAME": os.path.basename(
              self.input_notebook
          ),
          "SM_OUTPUT_NOTEBOOK_NAME": f"{self._underlying_job_prefix}.ipynb",
      }
      if self.initialization_script:
          system_envs["SM_INIT_SCRIPT"] = os.path.basename(
              self.initialization_script
          )
      job_envs.update(system_envs)
      return job_envs
  
imports: from __future__ import absolute_import
  import re
  import shutil
  import os
  from typing import List, Optional, Union, Dict
  from sagemaker.workflow.execution_variables import ExecutionVariables
  from sagemaker.workflow.functions import Join
  from sagemaker.workflow.properties import Properties
  from sagemaker.workflow.retry import RetryPolicy
  from sagemaker.workflow.steps import Step, ConfigurableRetryStep, StepTypeEnum
  from sagemaker.workflow.step_collections import StepCollection
  from sagemaker.workflow.step_outputs import StepOutput
  from sagemaker.workflow.entities import RequestType, PipelineVariable
  from sagemaker.workflow.utilities import _collect_parameters, load_step_compilation_context
  from sagemaker.session import get_execution_role
  from sagemaker.s3_utils import s3_path_join
  from sagemaker.s3 import S3Uploader
  from sagemaker.utils import _tmpdir, name_from_base, resolve_value_from_config, format_tags, Tags
  from sagemaker import vpc_utils
  from sagemaker.config.config_schema import NOTEBOOK_JOB_ROLE_ARN, NOTEBOOK_JOB_S3_ROOT_URI, NOTEBOOK_JOB_S3_KMS_KEY_ID, NOTEBOOK_JOB_VOLUME_KMS_KEY_ID, NOTEBOOK_JOB_VPC_CONFIG_SUBNETS, NOTEBOOK_JOB_VPC_CONFIG_SECURITY_GROUP_IDS
label_desc: Use image node_id 5 for calling the NotebookJobStep obj's underlying member method code with example usage: obj._prepare_env_variables() and returns: job_envs