code: def main():
      parser = argparse.ArgumentParser(
          description="Download feature datasets."
      )
      parser.add_argument(
          "group_names",
          nargs="+",
          choices=FEATURE_DEFN_GROUPS,
          metavar="GROUP_NAME",
          help="Feature group name: %(choices)s",
      )
      parser.add_argument(
          "--output",
          "-o",
          help="save datasets in the specified directory "
          "(default: user cache directory)",
      )
      parser.add_argument(
          "--dry-run",
          help="just print the URLs to download",
          action="store_true",
      )
      parser.add_argument(
          "--ignore-repo-data",
          action="store_true",
          help="ignore existing repo data when downloading",
      )
      parser.add_argument(
          "--no-warn",
          action="store_true",
          help='ignore cartopy "DownloadWarning" warnings',
      )
      args = parser.parse_args()
  
      if args.output:
          target_dir = pathlib.Path(args.output).expanduser().resolve()
          target_dir.mkdir(parents=True, exist_ok=True)
          config["pre_existing_data_dir"] = target_dir
          config["data_dir"] = target_dir
      if args.ignore_repo_data:
          config["repo_data_dir"] = config["data_dir"]
      if args.no_warn:
          import warnings
  
          warnings.filterwarnings("ignore", category=DownloadWarning)
  
      # Enforce use of stable AWS endpoint, regardless of cartopy version.
      # In doing so, this allows users to download this script and execute it
      # with any version of cartopy, thus taking advantage of the stable AWS
      # endpoint.
      # This removes the need to backport the associated fix
      # https://github.com/SciTools/cartopy/pull/1833.
      config["downloaders"][SHP_NE_SPEC].url_template = URL_TEMPLATE
  
      download_features(args.group_names, dry_run=args.dry_run)
  
imports: import argparse
  import pathlib
  from cartopy import config
  from cartopy.feature import Feature, GSHHSFeature, NaturalEarthFeature
  from cartopy.io import Downloader, DownloadWarning
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types