code: def copy_provider_sources_to_target(provider_id: str) -> Path:
      target_provider_root_path = (
          get_target_root_for_copied_provider_sources(provider_id)
      )
  
      if (
          target_provider_root_path.exists()
          and not target_provider_root_path.is_dir()
      ):
          get_console().print(
              f"[error]Target folder for {provider_id} sources is not a directory "
              f"please delete {target_provider_root_path} and try again!"
          )
      rmtree(target_provider_root_path, ignore_errors=True)
      target_provider_root_path.mkdir(parents=True)
      source_provider_sources_path = get_source_package_path(
          provider_id
      )
      relative_provider_path = source_provider_sources_path.relative_to(
          AIRFLOW_SOURCES_ROOT
      )
      target_providers_sub_folder = (
          target_provider_root_path / relative_provider_path
      )
      get_console().print(
          f"[info]Copying provider sources: {source_provider_sources_path} -> {target_providers_sub_folder}"
      )
      copytree(
          source_provider_sources_path, target_providers_sub_folder
      )
      shutil.copy(
          AIRFLOW_SOURCES_ROOT / "LICENSE",
          target_providers_sub_folder / "LICENSE",
      )
      # We do not copy NOTICE from the top level source of Airflow because NOTICE only refers to
      # Airflow sources - not to providers. If any of the providers is going to have a code that
      # requires NOTICE, then it should be stored in the provider sources (airflow/providers/PROVIDER_ID)
      # And it will be copied from there.
      (
          target_providers_sub_folder / ".latest-doc-only-change.txt"
      ).unlink(missing_ok=True)
      (target_providers_sub_folder / "CHANGELOG.rst").unlink(
          missing_ok=True
      )
      (target_providers_sub_folder / "provider.yaml").unlink(
          missing_ok=True
      )
      return target_provider_root_path
  
imports: from __future__ import annotations
  import shutil
  import subprocess
  import sys
  from pathlib import Path
  from shutil import copytree, rmtree
  from typing import Any, TextIO
  from airflow_breeze.utils.console import get_console
  from airflow_breeze.utils.packages import get_available_packages, get_latest_provider_tag, get_not_ready_provider_ids, get_provider_details, get_provider_jinja_context, get_removed_provider_ids, get_source_package_path, get_target_root_for_copied_provider_sources, render_template, tag_exists_for_provider
  from airflow_breeze.utils.path_utils import AIRFLOW_SOURCES_ROOT
  from airflow_breeze.utils.run_utils import run_command
label_desc: Use image node_id 1 for calling a global function with example usage: copy_provider_sources_to_target(provider_id) and returns: target_provider_root_path