code: def test_providers_multiple_matches(path=None):
      providers = Providers.from_config_files(
          files=[op.join(path, "providers.cfg")], reload=True
      )
      all_provs = providers.get_provider(
          "https://foo.org/data", return_all=True
      )
      assert_equal({p.name for p in all_provs}, {"foo0", "foo1"})
  
      # When selecting a single one, the later one is given priority.
      the_chosen_one = providers.get_provider("https://foo.org/data")
      assert_equal(the_chosen_one.name, "foo1")
  
file_path: datalad/datalad/downloaders/tests/test_providers.py
imports: import logging
  import os.path
  from unittest.mock import patch
  from ...support.external_versions import external_versions
  from ...tests.utils_pytest import assert_equal, assert_false, assert_greater, assert_in, assert_raises, ok_exists, swallow_logs, with_tempfile, with_testsui, with_tree
  from ...utils import chpwd, create_tree
  from ..providers import HTTPDownloader, Provider, Providers
label_desc: Use image node_id 7 for calling a global function with example usage: test_providers_multiple_matches(path) without return types