code: def _zip_lambda_code(script):
      """This method zips the lambda function script.
  
      Lambda function script is provided in the lambda instance and reads that zipped file.
  
      Returns: A buffer of zipped lambda function script.
      """
      buffer = BytesIO()
      code_dir = script.split("/")[-1]
  
      with zipfile.ZipFile(buffer, "w") as z:
          z.write(script, code_dir)
      buffer.seek(0)
      return buffer.read()
  
file_path: sagemaker-python-sdk/src/sagemaker/lambda_helper.py
imports: from __future__ import print_function, absolute_import
  from io import BytesIO
  import zipfile
  import time
  from botocore.exceptions import ClientError
  from sagemaker import s3
  from sagemaker.session import Session
label_desc: Use image node_id 4 for calling a global function with example usage: _zip_lambda_code(script) and returns: buffer