code: def download_plugin(
      url_or_gh_repo, plugin_names=None, overwrite=False
  ):
      """Downloads the plugin(s) from the given location to your local plugins
      directory (``fo.config.plugins_dir``).
  
      .. note::
  
          To download from a private GitHub repository that you have access to,
          provide your GitHub personal access token by setting the
          ``GITHUB_TOKEN`` environment variable.
  
      Args:
          url_or_gh_repo: the location to download from, which can be:
  
              -   a GitHub repo URL like ``https://github.com/<user>/<repo>``
              -   a GitHub ref like
                  ``https://github.com/<user>/<repo>/tree/<branch>`` or
                  ``https://github.com/<user>/<repo>/commit/<commit>``
              -   a GitHub ref string like ``<user>/<repo>[/<ref>]``
              -   a publicly accessible URL of an archive (eg zip or tar) file
  
          plugin_names (None): a plugin name or iterable of plugin names to
              download. By default, all found plugins are downloaded
          overwrite (False): whether to overwrite an existing plugin with the
              same name if it already exists
  
      Returns:
          a dict mapping plugin names to plugin directories on disk
      """
      url = None
      repo = None
      if etaw.is_url(url_or_gh_repo):
          if "github" in url_or_gh_repo:
              repo = GitHubRepository(url_or_gh_repo)
          else:
              url = url_or_gh_repo
      else:
          repo = GitHubRepository(url_or_gh_repo)
  
      if etau.is_str(plugin_names):
          plugin_names = {plugin_names}
      elif plugin_names is not None:
          plugin_names = set(plugin_names)
  
      existing_plugin_dirs = {p.name: p.path for p in _list_plugins()}
  
      downloaded_plugins = {}
      with etau.TempDir() as tmpdir:
          if repo is not None:
              logger.info(f"Downloading {repo.identifier}...")
              repo.download(tmpdir)
          else:
              logger.info(f"Downloading {url}...")
              _download_archive(url, tmpdir)
  
          metadata_paths = list(
              _iter_plugin_metadata_files(root_dir=tmpdir)
          )
          if not metadata_paths:
              logger.info(
                  f"No {PLUGIN_METADATA_FILENAMES} files found in {url}"
              )
  
          for metadata_path in metadata_paths:
              try:
                  plugin = _parse_plugin_metadata(metadata_path)
              except AttributeError:
                  logger.debug(
                      f"Failed to load plugin name from '{metadata_path}'"
                  )
                  continue
  
              if (
                  plugin_names is not None
                  and plugin.name not in plugin_names
              ):
                  logger.debug(
                      f"Skipping unwanted plugin '{plugin.name}'"
                  )
                  continue
  
              existing_dir = existing_plugin_dirs.get(plugin.name, None)
              if existing_dir is not None:
                  if not overwrite:
                      logger.info(
                          f"Skipping existing plugin '{plugin.name}'"
                      )
                      continue
  
                  logger.debug(
                      f"Overwriting existing plugin '{plugin.name}'"
                  )
                  etau.delete_dir(existing_dir)
                  plugin_dir = existing_dir
              else:
                  plugin_dir = _recommend_plugin_dir(plugin.name)
  
              logger.info(
                  f"Copying plugin '{plugin.name}' to '{plugin_dir}'"
              )
              etau.copy_dir(plugin.path, plugin_dir)
              downloaded_plugins[plugin.name] = plugin_dir
  
      if plugin_names is not None:
          missing_plugins = set(plugin_names) - set(
              downloaded_plugins.keys()
          )
          if missing_plugins:
              logger.warning(f"Plugins not found: {missing_plugins}")
  
      return downloaded_plugins
  
imports: from collections import Counter
  from dataclasses import dataclass
  import json
  import logging
  import os
  from packaging.requirements import Requirement
  import re
  import shutil
  import yaml
  import eta.core.utils
  import eta.core.web
  import fiftyone
  import fiftyone.constants
  from fiftyone.core.config import locate_app_config
  import fiftyone.core.utils
  from fiftyone.plugins.definitions import PluginDefinition
  from fiftyone.utils.github import GitHubRepository
label_desc: Use image node_id 10 for calling a global function with example usage: download_plugin(url_or_gh_repo, plugin_names, overwrite) and returns: downloaded_plugins