Find exported variables from raw graph files (including malformed ones).
* @param appDirectory the application's directory (can be null)
@return a non-null map of exported variables (key = name, value = default value)
777504
public static Map<String,String> findAllExportedVariables( File appDirectory ) {

		// TreeMap: keys are sorted alphabetically.
		Map<String,String> result = new TreeMap<> ();
		for( RoboconfTypeBean type : findAllTypes( appDirectory ).values()) {
			if( type.exportedVariables.size() > 0 )
				result.put( type.getName() + ".*", IMPORT_ALL_THE_VARIABLES );

			for( Map.Entry<String,String> entry : type.exportedVariables.entrySet()) {
				String desc = resolveStringDescription( entry.getKey(), entry.getValue());
				result.put( entry.getKey(), desc );
			}
		}

		return result;
	}
719206
@Override
	public Response getApplicationBindings( String applicationName ) {

		Response response;
		ManagedApplication ma = this.manager.applicationMngr().findManagedApplicationByName( applicationName );
		if( ma == null ) {
			response = handleError(
					Status.NOT_FOUND,
					new RestError( REST_INEXISTING, application( applicationName )),
					lang( this.manager )).build();

		} else {
			ApplicationBindings bindings = new ApplicationBindings();

			// Find all the external prefixes to resolve
			for( Component c : ComponentHelpers.findAllComponents( ma.getApplication())) {
				for( ImportedVariable var : ComponentHelpers.findAllImportedVariables( c ).values()) {
					if( ! var.isExternal())
						continue;

					String prefix = VariableHelpers.parseVariableName( var.getName()).getKey();
					bindings.prefixToItems.put( prefix, new ArrayList<ApplicationBindingItem> ());
				}
			}

			// Find all the applications that match a given prefix
			for( ManagedApplication managedApp : this.manager.applicationMngr().getManagedApplications()) {

				// Any potential bindings with this application?
				// There should be AT MOST 1 matching template for a given prefix.
				// One template means there can be several applications.
				String prefix = managedApp.getApplication().getTemplate().getExternalExportsPrefix();
				if( prefix == null || ! bindings.prefixToItems.containsKey( prefix ))
					continue;

				// There is a potential match. Is there an effective bound?
				Set<String> boundApps = ma.getApplication().getApplicationBindings().get( prefix );
				boolean bound = boundApps != null && boundApps.contains( managedApp.getName());
				ApplicationBindingItem item = new ApplicationBindingItem( managedApp.getName(), bound );
				bindings.prefixToItems.get( prefix ).add( item );
			}

			response = Response.ok().entity( bindings ).build();
		}

		return response;
	}
433400
function getAppFileNames(appName, dir) {
    var partialsDir = this.pancakes.getRootDir() + delim + 'app' + delim + appName + delim + dir;
    return fs.existsSync(partialsDir) ? fs.readdirSync(partialsDir) : [];
}
374453
protected static String getFileName(Appender app) {

        String result = null;
        Method getFileName;
        try {
            getFileName = app.getClass().getDeclaredMethod("getFileName", (Class<?>[])null);

            result = (String)getFileName.invoke(app, (Object[])null);
        } catch (Exception e) {
            LOG.warn(e.getLocalizedMessage(), e);
        }
        return result;
    }
1367295
function() {
  // Get list of dirs from app registry.
  return getAppRegistry()
  // Map app dirs to app names.
  .then(inspectDirs)
  .all()
  .tap(function(appRegistryApps) {
    log.debug(format('Apps in registry: %j', appRegistryApps));
  });

}
172406
private String resolveVariables(String name) {
		// Replace __variable__ with ${variable} and then evaluate the name as a groovy string
		String outName = "";
		int startPos = 0;
		int pos = name.indexOf("__", startPos);
		while (pos != -1) {
			outName += name.substring(startPos, pos);
			int endPos = name.indexOf("__", pos + 2);
			String variableName = name.substring(pos + 2, endPos);
			Object variableValue = model.resolveParameter(variableName, null);
			if (variableValue == null) {
				logWarn("Found no filepath variable __" + variableName + "__! Will use default value: " + variableName);
				variableValue = variableName;
			}
			logDebug("Found filepath variable: " + variableName + " = " + variableValue);
			outName += variableValue;
			startPos = endPos + 2;

			// Look for the next variable
			pos = name.indexOf("__", startPos);
		}
		outName += name.substring(startPos);
		logDebug("Resolved filepath [" + name + "] to [" + outName + "]");
		return outName;
	}
812365
public String lookupVariableDefaultValue(String variableName) {
        ConfigVariable cv = configVariables.get(variableName);
        return cv == null ? null : cv.getDefaultValue();
    }
849027
@Export
	public Map getMap(String applicationId, String mapId) {
		HashMap<String, Map> application = maps.get(applicationId);
		if (null == application) {
			return null;
		}
		return application.get(mapId);
	}
1009489
public static Set<String> findInstancesFilesToImport( File appDirectory, File editedFile, String fileContent ) {

		File instancesDir = new File( appDirectory, Constants.PROJECT_DIR_INSTANCES );
		return findFilesToImport( instancesDir, Constants.FILE_EXT_INSTANCES, editedFile, fileContent );
	}
684708
public static Path get(String appName) {
        final Path applicationDataDirectory = getPath(appName);

        try {
            Files.createDirectories(applicationDataDirectory);
        } catch (IOException ioe) {
            throw new RuntimeException("Couldn't find/create AppDataDirectory", ioe);
        }

        return applicationDataDirectory;
    }
337513
public Map<String, SDVariable> variableMap() {
        Map<String,SDVariable> ret = new LinkedHashMap<>();
        for(Variable v : variables.values()){
            ret.put(v.getName(), v.getVariable());
        }
        return ret;
    }
1364324
def get_variables_path(export_dir):
  """"""
  return os.path.join(
      tf.compat.as_bytes(export_dir),
      tf.compat.as_bytes(tf_v1.saved_model.constants.VARIABLES_DIRECTORY),
      tf.compat.as_bytes(tf_v1.saved_model.constants.VARIABLES_FILENAME))
731002
function getPaths(path) {
        var appPath = path;
        if (/dev\/temp\.ts$/.test(path)) // hack used when debugging.
            appPath = 'pargv';
        var appName = path_1.basename(appPath); // get the basename from path.
        var completionsDir = path_1.join(env.HOME_PATH, "." + appName);
        if (/\.(ts|js)$/.test(appPath)) {
            appPath = "./" + appPath; // not installed as bin.
            var parsedPath = path_1.parse(appPath);
            completionsDir = parsedPath.dir; // store completions.sh at executable file path.
        }
        var bashPath = !/^win/.test(env.PLATFORM) ? /^darwin/.test(env.PLATFORM) ? '.bash_profile' : '.bashrc' : false;
        if (bashPath)
            bashPath = path_1.join(env.HOME_PATH, bashPath);
        var completionsPath = path_1.join(completionsDir, 'completions.sh');
        return {
            appName: appName,
            appPath: appPath,
            bashPath: bashPath,
            completionsDir: completionsDir,
            completionsPath: completionsPath // the completions path.
        };
    }
407231
public static String findIconUrl( AbstractApplication app ) {

		StringBuilder sb = new StringBuilder();
		File iconFile = findIcon( app );
		if( iconFile != null ) {
			sb.append( "/" );
			sb.append( app.getName());

			if( app instanceof ApplicationTemplate ) {
				sb.append( "/" );
				sb.append(((ApplicationTemplate) app).getVersion());
			}

			sb.append( "/" );
			sb.append( iconFile.getName());
		}

		return sb.toString();
	}
935281
function extractImportedVariables(context) {
  if (!context.importedVariables) {
    return {};
  }
  const importedVariables = {};
  Object.entries(context.importedVariables).forEach(([src, variables]) => {
    variables.forEach((variableName) => {
      const actualFilePath = utils.isUrl()
        ? src
        : path.resolve(path.dirname(context.cwf), decodeURIComponent(url.parse(src).path));
      if (!VARIABLE_LOOKUP[actualFilePath] || !VARIABLE_LOOKUP[actualFilePath][variableName]) {
        // eslint-disable-next-line no-console
        console.warn(`Missing variable ${variableName} in ${src} referenced by ${context.cwf}\n`);
        return;
      }
      const variableValue = VARIABLE_LOOKUP[actualFilePath][variableName];
      if (!importedVariables[variableName]) {
        importedVariables[variableName] = variableValue;
      }
    });
  });
  return importedVariables;
}
684293
public static Set<String> findPrefixesForExportedVariables( Instance instance ) {

		Set<String> result = new HashSet<> ();
		for( String exportedVariableName : InstanceHelpers.findAllExportedVariables( instance ).keySet())
			result.add( VariableHelpers.parseVariableName( exportedVariableName ).getKey());

		return result;
	}
1077923
public static Map<String, Object> findFreeMarkerContextVariables(Variables variables, String... varNames)
    {
        Map<String, Object> results = new HashMap<>();

        for (String varName : varNames)
        {
            WindupVertexFrame payload = null;
            try
            {
                payload = Iteration.getCurrentPayload(variables, null, varName);
            }
            catch (IllegalStateException | IllegalArgumentException e)
            {
                // oh well
            }

            if (payload != null)
            {
                results.put(varName, payload);
            }
            else
            {
                Iterable<? extends WindupVertexFrame> var = variables.findVariable(varName);
                if (var != null)
                {
                    results.put(varName, var);
                }
            }
        }
        return results;
    }