Find the litmus.Test or litmus.Suite for a module.
Previous versions of litmus expected this to be exposed under a 'test' key.
970160
function getLitmusForModule (module) {

    if (isLitmus(module)) {
        return module;
    }

    if (module.test && isLitmus(module.test)) {
        return module.test;
    }

    throw new Error('litmus: expected module to export litmus.Test or litmus.Suite');
}
1106094
def find_modules(self, requested_names):
        
        found_modules = set()
        for requested_name in requested_names:
            is_instance = " " in requested_name

            for module_name, module in self.py3_wrapper.output_modules.items():
                if module["type"] == "py3status":
                    name = module["module"].module_nice_name
                else:
                    name = module["module"].module_name
                if is_instance:
                    if requested_name == name:
                        found_modules.add(module_name)
                else:
                    if requested_name == name.split(" ")[0]:
                        found_modules.add(module_name)

        if self.debug:
            self.py3_wrapper.log("found %s" % found_modules)
        return found_modules
457468
function() {
    let addon = this._findCoveredAddon();
    if (addon) {
      const addonDir = path.join(this.project.root, 'addon');
      const addonTestSupportDir = path.join(this.project.root, 'addon-test-support');
      return concat(
        this._getIncludesForDir(addonDir, addon.name),
        this._getIncludesForDir(addonTestSupportDir, `${addon.name}/test-support`)
      );
    }
  }
200
def find_module(modpath):
    """"""
    module_path = modpath.replace('.', '/') + '.py'
    init_path = modpath.replace('.', '/') + '/__init__.py'
    for root_path in sys.path:
        path = os.path.join(root_path, module_path)
        if os.path.isfile(path):
            return path
        path = os.path.join(root_path, init_path)
        if os.path.isfile(path):
            return path
115681
def find_module_named(name)
      # First check the enclosed modules, then check the module itself,
      # then check the enclosing modules (this mirrors the check done by
      # the Ruby parser)
      res = @modules[name] || @classes[name]
      return res if res
      return self if self.name == name
      find_enclosing_module_named(name)
    end
248506
function _suite(description, cb) {
            var test = new this(description, {});
            var it = test._addAction;
            _(["suite", "test", "timeout", "getAction", "beforeAll", "beforeEach",
                "afterAll", "afterEach", "context", "get", "set", "skip"]).forEach(function (key) {
                    it[key] = test[key];
                });
            cb(test);
            return test;
        }
779605
def find_module(self, name):
        """"""
        defmodule = lib.EnvFindDefmodule(self._env, name.encode())
        if defmodule == ffi.NULL:
            raise LookupError("Module '%s' not found" % name)

        return Module(self._env, defmodule)
409012
def check(module):
  global passed, failed
  '''
  
  '''
  module_name = module.rsplit('/', 1)[1]
  if module[-3:] == ".py" and module_name not in IGNORED_FILES:
    print ("CHECKING ", module)
    pout = os.popen('pylint %s'% module, 'r')
    for line in pout:
      if "Your code has been rated at" in line:
        print ("PASSED pylint inspection: " + line)
        passed += 1
        return True
      if "-error" in line:
        print ("FAILED pylint inspection: " + line)
        failed += 1
        errors.append("FILE: " + module)
        errors.append("FAILED pylint inspection: " + line)
        return False
863409
function( name, testEnvironment, executeNow ) {
		var module, moduleFns;
		var currentModule = config.currentModule;

		if ( arguments.length === 2 ) {
			if ( objectType( testEnvironment ) === "function" ) {
				executeNow = testEnvironment;
				testEnvironment = undefined;
			}
		}

		module = createModule();

		if ( testEnvironment && ( testEnvironment.setup || testEnvironment.teardown ) ) {
			console.warn(
				"Module's `setup` and `teardown` are not hooks anymore on QUnit 2.0, use " +
				"`beforeEach` and `afterEach` instead\n" +
				"Details in our upgrade guide at https://qunitjs.com/upgrade-guide-2.x/"
			);
		}

		moduleFns = {
			before: setHook( module, "before" ),
			beforeEach: setHook( module, "beforeEach" ),
			afterEach: setHook( module, "afterEach" ),
			after: setHook( module, "after" )
		};

		if ( objectType( executeNow ) === "function" ) {
			config.moduleStack.push( module );
			setCurrentModule( module );
			executeNow.call( module.testEnvironment, moduleFns );
			config.moduleStack.pop();
			module = module.parentModule || currentModule;
		}

		setCurrentModule( module );

		function createModule() {
			var parentModule = config.moduleStack.length ?
				config.moduleStack.slice( -1 )[ 0 ] : null;
			var moduleName = parentModule !== null ?
				[ parentModule.name, name ].join( " > " ) : name;
			var module = {
				name: moduleName,
				parentModule: parentModule,
				tests: [],
				moduleId: generateHash( moduleName ),
				testsRun: 0
			};

			var env = {};
			if ( parentModule ) {
				parentModule.childModule = module;
				extend( env, parentModule.testEnvironment );
				delete env.beforeEach;
				delete env.afterEach;
			}
			extend( env, testEnvironment );
			module.testEnvironment = env;

			config.modules.push( module );
			return module;
		}

		function setCurrentModule( module ) {
			config.currentModule = module;
		}

	}
1158472
def get_module_toc(mod_name):
    ""
    mod = import_mod(mod_name)
    ft_names = mod.__all__ if hasattr(mod,'__all__') else get_ft_names(mod)
    ft_names.sort(key = str.lower)
    tabmat = ''
    for ft_name in ft_names:
        tabmat += f'- [{ft_name}](#{ft_name})\n'
        elt = getattr(mod, ft_name)
        if inspect.isclass(elt) and not is_enum(elt.__class__):
            in_ft_names = get_inner_fts(elt)
            for name in in_ft_names:
                tabmat += f'  - [{name}](#{name})\n'
    display(Markdown(tabmat))
546491
function verifyModules(filePaths) {
  return Promise.all(
    _.map(filePaths, function(filePath) {
      return firstline(filePath).then(function(line) {
        var matches = line.match(/^(?:(?:port|effect)\s+)?module\s+(\S+)\s*/);

        if (matches) {
          var moduleName = matches[1];
          var testModulePaths = moduleFromTestName(moduleName);
          var modulePath = moduleFromFilePath(filePath);

          // A module path matches if it lines up completely with a known one.
          if (
            !testModulePaths.every(function(testModulePath, index) {
              return testModulePath === modulePath[index];
            })
          ) {
            return Promise.reject(
              filePath +
                ' has a module declaration of "' +
                moduleName +
                '" - which does not match its filename!'
            );
          }
        } else {
          return Promise.reject(
            filePath +
              ' has an invalid module declaration. Check the first line of the file and make sure it has a valid module declaration there!'
          );
        }
      });
    })
  );
}
846415
def get_stack(method_name):
    
    global test_suite
    trace_string      = method_name + " "
    for f in inspect.stack():
        module_name = os.path.basename(f[1])
        method_name = f[3]
        trace_string = trace_string + "%s %s " % (module_name, method_name)
        if test_suite and module_name == test_suite or (module_name == 'patch.py' and method_name == 'patched_test'):
            return trace_string
    return trace_string
252256
Module findModuleFromPackageName(String pkg) {
        int cp = pkg.indexOf(':');
        assert(cp != -1);
        String mod = pkg.substring(0, cp);
        return lookupModule(mod);
    }
441787
def find_module(slug)
      modules.find { |m| m.slug.to_s == slug.to_s }
    end
1284819
def find_module(self, fullname, path=None):
        
        if fullname.startswith('pygal.maps.') and hasattr(
                maps, fullname.split('.')[2]):
            return self
        return None
1238524
def find_module(module, paths=None):
    """"""

    parts = module.split('.')

    while parts:
        part = parts.pop(0)
        f, path, (suffix, mode, kind) = info = imp.find_module(part, paths)

        if kind == PKG_DIRECTORY:
            parts = parts or ['__init__']
            paths = [path]

        elif parts:
            raise ImportError("Can't find %r in %s" % (parts, module))

    return info
556339
def find_module(self, modname, folder=None):
        
        for src in self.get_source_folders():
            module = _find_module_in_folder(src, modname)
            if module is not None:
                return module
        for src in self.get_python_path_folders():
            module = _find_module_in_folder(src, modname)
            if module is not None:
                return module
        if folder is not None:
            module = _find_module_in_folder(folder, modname)
            if module is not None:
                return module
        return None