Returns the directory containing rules.

@param rootModule     The root module of the project.
@param rulesDirectory The name of the directory used for identifying the root module.
@return The file representing the directory.
496248
static File getRulesDirectory(MavenProject rootModule, String rulesDirectory) {
        File rules = new File(rulesDirectory);
        return rules.isAbsolute() ? rules : new File(rootModule.getBasedir().getAbsolutePath() + File.separator + rulesDirectory);
    }
681040
public OptionsBuilder executionDirectory(File executionDirectory) {
		options.put(Options.EXECUTION_DIRECTORY, executionDirectory != null ? executionDirectory : defaultExecutionDirectory());
		return this;
	}
645433
private StoreConfiguration getStoreConfiguration(MavenProject rootModule) {
        StoreConfiguration.StoreConfigurationBuilder builder = StoreConfiguration.builder();
        if (store.getUri() == null) {
            File storeDirectory = OptionHelper.selectValue(new File(rootModule.getBuild().getDirectory(), STORE_DIRECTORY), this.storeDirectory);
            storeDirectory.getParentFile().mkdirs();
            URI uri = new File(storeDirectory, "/").toURI();
            builder.uri(uri);
        } else {
            builder.uri(store.getUri());
            builder.username(store.getUsername());
            builder.password(store.getPassword());
            builder.encryptionLevel(store.getEncryptionLevel());
        }
        builder.properties(store.getProperties());
        builder.embedded(getEmbeddedNeo4jConfiguration());
        StoreConfiguration storeConfiguration = builder.build();
        getLog().debug("Using store configuration " + storeConfiguration);
        return storeConfiguration;
    }
151609
function getModuleName(filepath, source) {

        filepath = PathModule.resolve(filepath);

        if (/\bdefine\s*\(\s*("|')([\s\S]+?)\1\s*,\s*/g.test(source)) {
            return {
                type: "id",
                value: RegExp.$2,
                path: filepath
            };
        }

        return {
            type: "path",
            value: PathModule.resolve(filepath),
            path: filepath
        };

    }
1016644
def rp_module_level_in_stack():
    
    from traceback import extract_stack
    from rootpy import _ROOTPY_SOURCE_PATH
    modlevel_files = [filename for filename, _, func, _ in extract_stack()
                      if func == "<module>"]

    return any(path.startswith(_ROOTPY_SOURCE_PATH) for path in modlevel_files)
1204034
def get_rulesets():
    "
    rulesets_dirs = get_ruleset_dirs()
    ruleset_files = []
    for rulesets_dir in rulesets_dirs:
        for f in os.listdir(rulesets_dir):
            for ext in EXTS:
                file_path = os.path.join(rulesets_dir, f)
                if os.path.isfile(file_path) and f.lower().endswith(ext):
                    ruleset_files.append((f[:-len(ext)], file_path))
    return ruleset_files
567351
func (s *State) RootModule() *ModuleState {
	root := s.ModuleByPath(addrs.RootModuleInstance)
	if root == nil {
		panic("missing root module")
	}
	return root
}
905284
public synchronized ModuleList getModuleList() throws NotAllowedException
	{
		ModuleList modules = new ModuleList();
		for (Object definition : getRootElementList())
		{
			if (definition instanceof AModuleModules)
				modules.add((AModuleModules) definition);
			else
				throw new NotAllowedException("Other definition than Module is found: "
						+ definition.getClass().getName());
		}

		modules.combineDefaults();

		return modules;
	}
416640
static public String getPathToRoot(JBakeConfiguration config, File rootPath, File sourceFile) {

        Path r = Paths.get(rootPath.toURI());
        Path s = Paths.get(sourceFile.getParentFile().toURI());
        Path relativePath = s.relativize(r);

        StringBuilder sb = new StringBuilder();

        sb.append(asPath(relativePath.toString()));

        if (config.getUriWithoutExtension()) {
            sb.append("/..");
        }
        if (sb.length() > 0) {  // added as calling logic assumes / at end.
            sb.append("/");
        }
        return sb.toString();
    }
84727
public static List<File> listFileWithRegexFileName(final File rootDir, final String regexFileNamePattern) {
		return Files.fileTreeTraverser().preOrderTraversal(rootDir)
				.filter(new RegexFileNameFilter(regexFileNamePattern)).toList();
	}
497042
static File getOutputDirectory(MavenProject rootModule) {
        String directoryName = rootModule.getBuild().getDirectory() + "/" + OUTPUT_DIRECTORY;
        File directory = new File(directoryName);
        directory.mkdirs();
        return directory;
    }
709676
public File findRootPackage(File directory) throws IOException {
        if (!directory.isDirectory()) {
            throw new IllegalArgumentException("Can't find package inside file. Argument should be valid directory.");
        }
        File[] children = directory.listFiles(new FileFilter() {
            @Override
            public boolean accept(File pathname) {
                return isValidSourceFileOrDir(pathname);
            }
        });
        if (children != null) {
            List<File> results = new LinkedList<File>();
            for (File it : children) {
                if (!it.isDirectory()) {
                    // we have file - let's assume we have main project's package
                    results.add(directory);
                    break;
                } else {
                    File pkg = findRootPackage(it);
                    if (pkg != null) {
                        results.add(pkg);
                    }
                }
            }

            if (results.size() == 1) {
                return results.get(0);
            } else {
                return directory;
            }
        }
        return null;
    }
985331
public List<Path> getDefaultUserRulesDirectories()
    {
        List<Path> paths = getOptionValue(DEFAULT_USER_RULES_DIRECTORIES_OPTION);
        if (paths == null)
        {
            return Collections.emptyList();
        }
        return Collections.unmodifiableList(paths);
    }
1167382
function (loadModule) {
            this._rootModule = loadModule.moduleCtrlPrivate;
            this._data = this._rootModule.getData().storage;
            var siteHelper = this._siteConfigHelper;

            ariaUtilsCSSLoader.add(siteHelper.getSiteCss());

            var classesToLoad = siteHelper.getListOfContentProcessors();
            var navigationManagerClass = siteHelper.getNavigationManagerClass();

            if (navigationManagerClass) {
                classesToLoad.push(navigationManagerClass);
            }
            if (siteHelper.siteConfig.animations) {
                classesToLoad.push("aria.pageEngine.utils.AnimationsManager");
            }
            var commonModulesToLoad = siteHelper.getCommonModulesDescription({
                priority : 1
            });

            this._utils.wiseConcat(classesToLoad, this._utils.extractPropertyFromArrayElements(commonModulesToLoad, "classpath"));

            Aria.load({
                classes : classesToLoad,
                oncomplete : {
                    fn : this._loadGlobalModules,
                    scope : this,
                    args : commonModulesToLoad
                },
                onerror : this._getErrorCallbackConfig([this.MISSING_DEPENDENCIES])
            });

        }
930352
public static String getCategoryPath(String rootPath, String baseFolder) throws CmsException {

        String base;
        if (rootPath.startsWith(CmsCategoryService.CENTRALIZED_REPOSITORY)) {
            base = CmsCategoryService.CENTRALIZED_REPOSITORY;
        } else {
            base = baseFolder;
            if (!base.endsWith("/")) {
                base += "/";
            }
            if (!base.startsWith("/")) {
                base = "/" + base;
            }
            int pos = rootPath.indexOf(base);
            if (pos < 0) {
                throw new CmsDataAccessException(
                    Messages.get().container(Messages.ERR_CATEGORY_INVALID_LOCATION_1, rootPath));
            }
            base = rootPath.substring(0, pos + base.length());
        }
        return rootPath.substring(base.length());
    }
33017
public void importModule(String importFile) throws Exception {

        CmsImportParameters params = new CmsImportParameters(importFile, "/", true);

        OpenCms.getImportExportManager().importData(
            m_cms,
            new CmsShellReport(m_cms.getRequestContext().getLocale()),
            params);
    }
149883
func (d *Diff) RootModule() *ModuleDiff {
	root := d.ModuleByPath(addrs.RootModuleInstance)
	if root == nil {
		panic("missing root module")
	}
	return root
}