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 create a lambda function.
  
  Returns: boto3 response from Lambda's create_function method.
docstr_tok: ["Method","to","create","a","lambda","function",".","Returns",":","boto3","response","from","Lambda","'s","create_function","method","."]
code: def create(self):
      """Method to create a lambda function.
  
      Returns: boto3 response from Lambda's create_function method.
      """
      lambda_client = _get_lambda_client(self.session)
  
      if self.function_name is None:
          raise ValueError(
              "FunctionName must be provided to create a Lambda function."
          )
  
      if self.script is not None:
          code = {"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,
          )
          key = _upload_to_s3(
              s3_client=_get_s3_client(self.session),
              function_name=self.function_name,
              zipped_code_dir=self.zipped_code_dir,
              s3_bucket=bucket,
              s3_key_prefix=key_prefix,
          )
          code = {"S3Bucket": bucket, "S3Key": key}
  
      try:
          response = lambda_client.create_function(
              FunctionName=self.function_name,
              Runtime=self.runtime,
              Handler=self.handler,
              Role=self.execution_role_arn,
              Code=code,
              Timeout=self.timeout,
              MemorySize=self.memory_size,
              VpcConfig=self.vpc_config,
              Environment=self.environment,
              Layers=self.layers,
          )
          return response
      except ClientError as e:
          error = e.response["Error"]
          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 2 for calling the Lambda obj's underlying member method code with example usage: obj.create() and returns: response