code: def test_custom_base_dir():
      from tests.basedir.my_experiment import some_func
  
      main, sources, deps = gather_sources_and_dependencies(
          some_func.__globals__, False, TEST_DIRECTORY
      )
      assert isinstance(main, Source)
      assert isinstance(sources, set)
      assert isinstance(deps, set)
      assert main == Source.create(
          os.path.join(TEST_DIRECTORY, "basedir", "my_experiment.py")
      )
      expected_sources = {
          Source.create(os.path.join(TEST_DIRECTORY, "__init__.py")),
          Source.create(
              os.path.join(TEST_DIRECTORY, "basedir", "__init__.py")
          ),
          Source.create(
              os.path.join(
                  TEST_DIRECTORY, "basedir", "my_experiment.py"
              )
          ),
          Source.create(
              os.path.join(TEST_DIRECTORY, "foo", "__init__.py")
          ),
          Source.create(os.path.join(TEST_DIRECTORY, "foo", "bar.py")),
      }
      assert sources == expected_sources
  
imports: import os.path
  import os
  from pathlib import Path
  import mock
  import pytest
  from sacred.dependencies import PEP440_VERSION_PATTERN, PackageDependency, Source, gather_sources_and_dependencies, get_digest, get_py_file_if_possible, is_local_source
  import sacred.optional
label_desc: Use image node_id 18 for calling a global function with example usage: test_custom_base_dir() without return types