code: def unify_bucket_name_and_key(func: T) -> T:
      """Unify bucket name and key in case no bucket name and at least a key has been passed to the function."""
      function_signature = signature(func)
  
      @wraps(func)
      def wrapper(*args, **kwargs) -> T:
          bound_args = function_signature.bind(*args, **kwargs)
  
          if "wildcard_key" in bound_args.arguments:
              key_name = "wildcard_key"
          elif "key" in bound_args.arguments:
              key_name = "key"
          else:
              raise ValueError("Missing key parameter!")
  
          if "bucket_name" not in bound_args.arguments:
              with suppress(S3HookUriParseFailure):
                  (
                      bound_args.arguments["bucket_name"],
                      bound_args.arguments[key_name],
                  ) = S3Hook.parse_s3_url(
                      bound_args.arguments[key_name]
                  )
  
          return func(*bound_args.args, **bound_args.kwargs)
  
      # set attr _unify_bucket_name_and_key_wrapped so that we can check at
      # class definition that unify is the first decorator applied
      # if provide_bucket_name is applied first, and there's a bucket defined in conn
      # then if user supplies full key, bucket in key is not respected
      wrapper._unify_bucket_name_and_key_wrapped = True  # type: ignore[attr-defined]
      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 3 for calling a global function with example usage: unify_bucket_name_and_key(func) and returns: cast, func