code: def test_product_node_download_single_with_filter(
      run_cli, api, tmpdir, node_test_products, monkeypatch
  ):
      # Change default arguments for quicker test.
      # Also, vcrpy is not threadsafe, so only one worker is used.
      monkeypatch.setattr(
          "sentinelsat.SentinelAPI.download_all",
          partialmethod(
              SentinelAPI.download_all,
              max_attempts=2,
              n_concurrent_dl=1,
          ),
      )
  
      product_id = node_test_products[0]["id"]
      command = [
          "--uuid",
          product_id,
          "--download",
          "--path",
          str(tmpdir),
          "--include-pattern",
          "*.kml",
      ]
  
      run_cli(*command)
  
      # The file already exists, should not be re-downloaded
      run_cli(*command)
  
      files = list(glob.glob(str(tmpdir.join("S*.SAFE", "*"))))
      assert len(files) == 2
      basenames = [os.path.basename(filename) for filename in files]
      assert "manifest.safe" in basenames
      assert "preview" in basenames
  
      files = list(
          glob.glob(str(tmpdir.join("S*.SAFE", "preview", "*")))
      )
      assert len(files) == 1
      basenames = [os.path.basename(filename) for filename in files]
      assert "map-overlay.kml" in basenames
  
      # clean up
      tmpdir.remove()
  
imports: import json
  import os
  import re
  import glob
  import shutil
  from contextlib import contextmanager
  from functools import partialmethod
  import pytest
  import requests_mock
  from click.testing import CliRunner
  from sentinelsat import SentinelAPI, InvalidChecksumError
  from sentinelsat.scripts.cli import cli
label_desc: Use image node_id 28 for calling a global function with example usage: test_product_node_download_single_with_filter(run_cli, api, tmpdir, node_test_products, monkeypatch) without return types