code: def provide_bucket_name(func: T) -> T:
      """Provide a bucket name taken from the connection if no bucket name has been passed to the function."""
      if hasattr(func, "_unify_bucket_name_and_key_wrapped"):
          logger.warning(
              "`unify_bucket_name_and_key` should wrap `provide_bucket_name`."
          )
      function_signature = signature(func)
  
      @wraps(func)
      def wrapper(*args, **kwargs) -> T:
          bound_args = function_signature.bind(*args, **kwargs)
  
          if "bucket_name" not in bound_args.arguments:
              self = args[0]
  
              if "bucket_name" in self.service_config:
                  bound_args.arguments[
                      "bucket_name"
                  ] = self.service_config["bucket_name"]
              elif self.conn_config and self.conn_config.schema:
                  warnings.warn(
                      "s3 conn_type, and the associated schema field, is deprecated. "
                      "Please use aws conn_type instead, and specify `bucket_name` "
                      "in `service_config.s3` within `extras`.",
                      AirflowProviderDeprecationWarning,
                      stacklevel=2,
                  )
                  bound_args.arguments[
                      "bucket_name"
                  ] = self.conn_config.schema
  
          return func(*bound_args.args, **bound_args.kwargs)
  
      return cast(T, wrapper)
  
imports: from __future__ import annotations
  import asyncio
  import fnmatch
  import gzip
  import logging
  import os
  import re
  import shutil
  import time
  import warnings
  from contextlib import suppress
  from copy import deepcopy
  from datetime import datetime
  from functools import wraps
  from inspect import signature
  from io import BytesIO
  from pathlib import Path
  from tempfile import NamedTemporaryFile, gettempdir
  from typing import TYPE_CHECKING, Any, Callable, TypeVar, cast
  from urllib.parse import urlsplit
  from uuid import uuid4
  from asgiref.sync import sync_to_async
  from boto3.s3.transfer import S3Transfer, TransferConfig
  from botocore.exceptions import ClientError
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.providers.amazon.aws.exceptions import S3HookUriParseFailure
  from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
  from airflow.providers.amazon.aws.utils.tags import format_tags
  from airflow.utils.helpers import chunks
label_desc: Use image node_id 1 for calling a global function with example usage: provide_bucket_name(func) and returns: cast, func