code: def test_download_many(
      run_cli, api, tmpdir, smallest_online_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,
          ),
      )
  
      ids = sorted(
          product["id"] for product in smallest_online_products
      )
  
      command = ["--download", "--path", str(tmpdir)]
      for id in ids:
          command += ["--uuid", id]
  
      # Download 3 tiny products
      run_cli(*command)
  
      # Should not re-download
      run_cli(*command)
  
      # clean up
      for f in tmpdir.listdir():
          f.remove()
  
      # Prepare a response with an invalid checksum
      product_id = ids[0]
      url = (
          "https://apihub.copernicus.eu/apihub/odata/v1/Products('%s')?$format=json"
          % product_id
      )
      json = api.session.get(url).json()
      json["d"]["Checksum"][
          "Value"
      ] = "00000000000000000000000000000000"
  
      # Force one download to fail
      with requests_mock.mock(real_http=True) as rqst:
          rqst.get(url, json=json)
          # md5 flag set (implicitly), should raise an exception
          result = run_cli(*command, must_return_nonzero=True)
          assert "is corrupted" in result.output
  
      assert tmpdir.join("corrupt_scenes.txt").check()
      with tmpdir.join("corrupt_scenes.txt").open() as f:
          assert product_id in f.read()
  
      # 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 29 for calling a global function with example usage: test_download_many(run_cli, api, tmpdir, smallest_online_products, monkeypatch) without return types