class_docstr: Contains lambda boto3 wrappers to Create, Update, Delete and Invoke Lambda functions.
class_docstr_tok: ["Contains","lambda","boto3","wrappers","to","Create",",","Update",",","Delete","and","Invoke","Lambda","functions","."]
docstr: Method to update a lambda function.
  
  Returns: boto3 response from Lambda's update_function method.
docstr_tok: ["Method","to","update","a","lambda","function",".","Returns",":","boto3","response","from","Lambda","'s","update_function","method","."]
code: def update(self):
      """Method to update a lambda function.
  
      Returns: boto3 response from Lambda's update_function method.
      """
      lambda_client = _get_lambda_client(self.session)
      retry_attempts = 7
      for i in range(retry_attempts):
          try:
              if self.script is not None:
                  response = lambda_client.update_function_code(
                      FunctionName=self.function_name
                      or self.function_arn,
                      ZipFile=_zip_lambda_code(self.script),
                  )
              else:
                  bucket, key_prefix = s3.determine_bucket_and_prefix(
                      bucket=self.s3_bucket,
                      key_prefix=None,
                      sagemaker_session=self.session,
                  )
  
                  # get function name to be used in S3 upload path
                  if self.function_arn:
                      versioned_function_name = self.function_arn.split(
                          "funtion:"
                      )[-1]
                      if ":" in versioned_function_name:
                          function_name_for_s3 = (
                              versioned_function_name.split(":")[0]
                          )
                      else:
                          function_name_for_s3 = versioned_function_name
                  else:
                      function_name_for_s3 = self.function_name
  
                  response = lambda_client.update_function_code(
                      FunctionName=(
                          self.function_name or self.function_arn
                      ),
                      S3Bucket=bucket,
                      S3Key=_upload_to_s3(
                          s3_client=_get_s3_client(self.session),
                          function_name=function_name_for_s3,
                          zipped_code_dir=self.zipped_code_dir,
                          s3_bucket=bucket,
                          s3_key_prefix=key_prefix,
                      ),
                  )
              return response
          except ClientError as e:
              error = e.response["Error"]
              code = error["Code"]
              if code == "ResourceConflictException":
                  if i == retry_attempts - 1:
                      raise ValueError(error)
                  # max wait time = 2**0 + 2**1 + .. + 2**6 = 127 seconds
                  time.sleep(2**i)
              else:
                  raise ValueError(error)
  
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 3 for calling the Lambda obj's underlying member method code with example usage: obj.update() and returns: response