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: Upload the notebook job files/folders to s3 staged folder.
docstr_tok: ["Upload","the","notebook","job","files\/folders","to","s3","staged","folder","."]
code: def _upload_job_files(
      self, s3_base_uri, paths_to_upload, kms_key, sagemaker_session
  ):
      """Upload the notebook job files/folders to s3 staged folder."""
  
      # copy all inputs into a local temp folder in order to only upload once.
      with _tmpdir() as temp_input_folder:
          for path in paths_to_upload:
              if os.path.isfile(path):
                  shutil.copy2(path, temp_input_folder)
              elif os.path.isdir(path):
                  shutil.copytree(
                      path,
                      os.path.join(
                          temp_input_folder, os.path.basename(path)
                      ),
                  )
              else:
                  # for safety to handle edge case e.g. file or dir gets deleted after validation
                  raise ValueError(f"Not supported file type: {path}")
          S3Uploader.upload(
              temp_input_folder, s3_base_uri, kms_key, sagemaker_session
          )
  
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 12 for calling the NotebookJobStep obj's underlying member method code with example usage: obj._upload_job_files(s3_base_uri, paths_to_upload, kms_key, sagemaker_session) without return types