code: def objects_insert(bucket_name):
      """Implement the 'Objects: insert' API.  Insert a new GCS Object."""
      gcs_url = flask.url_for(
          "objects_insert", bucket_name=bucket_name, _external=True
      ).replace("/upload/", "/")
      insert_magic_bucket(gcs_url)
  
      upload_type = flask.request.args.get("uploadType")
      if upload_type is None:
          raise error_response.ErrorResponse(
              "uploadType not set in Objects: insert", status_code=400
          )
      if upload_type not in {"multipart", "media", "resumable"}:
          raise error_response.ErrorResponse(
              "testbench does not support %s uploadType" % upload_type,
              status_code=400,
          )
  
      if upload_type == "resumable":
          bucket = testbench_utils.lookup_bucket(bucket_name)
          upload_url = flask.url_for(
              "objects_insert", bucket_name=bucket_name, _external=True
          )
          return bucket.create_resumable_upload(
              upload_url, flask.request
          )
  
      object_path = None
      blob = None
      current_version = None
      if upload_type == "media":
          object_name = flask.request.args.get("name", None)
          if object_name is None:
              raise error_response.ErrorResponse(
                  "name not set in Objects: insert", status_code=412
              )
          object_path, blob = testbench_utils.get_object(
              bucket_name,
              object_name,
              gcs_object.GcsObject(bucket_name, object_name),
          )
          blob.check_preconditions(flask.request)
          current_version = blob.insert(gcs_url, flask.request)
      else:
          (
              resource,
              media_headers,
              media_body,
          ) = testbench_utils.parse_multi_part(flask.request)
          object_name = flask.request.args.get(
              "name", resource.get("name", None)
          )
          if object_name is None:
              raise error_response.ErrorResponse(
                  "name not set in Objects: insert", status_code=412
              )
          object_path, blob = testbench_utils.get_object(
              bucket_name,
              object_name,
              gcs_object.GcsObject(bucket_name, object_name),
          )
          blob.check_preconditions(flask.request)
          current_version = blob.insert_multipart(
              gcs_url,
              flask.request,
              resource,
              media_headers,
              media_body,
          )
      testbench_utils.insert_object(object_path, blob)
      return testbench_utils.filtered_response(
          flask.request, current_version.metadata
      )
  
imports: import argparse
  import error_response
  import flask
  import gcs_bucket
  import gcs_object
  import json
  import os
  import re
  import testbench_utils
  import time
  import sys
  from werkzeug import serving
  from werkzeug.middleware.dispatcher import DispatcherMiddleware
label_desc: Use image node_id 23 for calling a global function with example usage: objects_insert(bucket_name) and returns: testbench_utils, bucket