Recursively replace @imports with the text at that url
168255
function(text, url, callback) {
    var done = function(map) {
      callback(this.flatten(text, url, map));
    }.bind(this);
    this.loader.process(text, url, done);
  }
972357
function replacePath (path, keys) {
  var index = 0;

  function replace (_, escaped, prefix, key, capture, group, suffix, escape) {
    if (escaped) {
      return escaped;
    }

    if (escape) {
      return '\\' + escape;
    }

    var repeat   = suffix === '+' || suffix === '*';
    var optional = suffix === '?' || suffix === '*';

    keys.push({
      name:      key || index++,
      delimiter: prefix || '/',
      optional:  optional,
      repeat:    repeat
    });

    prefix = prefix ? ('\\' + prefix) : '';
    capture = escapeGroup(capture || group || '[^' + (prefix || '\\/') + ']+?');

    if (repeat) {
      capture = capture + '(?:' + prefix + capture + ')*';
    }

    if (optional) {
      return '(?:' + prefix + '(' + capture + '))?';
    }

    // Basic parameter support.
    return prefix + '(' + capture + ')';
  }

  return path.replace(PATH_REGEXP, replace);
}
487295
function replace(pathname) {
        if (typeof routesMap === 'function') {
            return routesMap(pathname) || pathname
        }

        let matched = false
        return pathname
            .split('/')
            .map(chunk => {
                // console.log(chunk);
                if (!matched) {
                    if (routesMap[chunk]) {
                        matched = true
                    }
                    return typeof routesMap[chunk] === 'string' ? routesMap[chunk] : chunk
                }
                else {
                    return chunk
                }
            })
            .join('/')
            .replace(/\/\//, '/')
    }
529231
function parseCssForImports(link, css) {
    link.imports = resolveCssImportUrls(link.url, css)
    status.total += link.imports.length
    result.css += css

    link.imports.forEach(function(importUrl) {
      var importLink = createLink(importUrl, importUrl)
      result.links.push(importLink)

      getLinkContents(importLink.url, options)
        .then(function(css) {
          handleCssFromLink(importLink, css)
        })
        .catch(function(error) {
          link.error = error
          status.parsed++
          handleResolve()
        })
    })
  }
1183021
def _at_dump_imports(self, calculator, rule, scope, block):
        
        sys.stderr.write("%s\n" % repr(rule.namespace._imports))
1346400
private List<String> convertImports( Collection<ImportedVariable> importedVariables ) {

		List<String> result = new ArrayList<> ();
		for( ImportedVariable var : importedVariables ) {
			String componentOrFacet = VariableHelpers.parseVariableName( var.getName()).getKey();
			String s = applyLink( var.getName(), componentOrFacet );
			s += var.isOptional() ? this.messages.get( "optional" ) : this.messages.get( "required" ); //$NON-NLS-1$ //$NON-NLS-2$
			if( var.isExternal())
				s += this.messages.get( "external" ); //$NON-NLS-1$

			result.add( s );
		}

		return result;
	}
1105257
def parse_imports(self, src):
        "  "
        result = []

        def child(obj):
            result.append(obj.group(1))
        src = self.import_re.sub(child, src)
        return src, result
1330807
function replace_content(fullpath) {
	var source = fs.readFileSync(fullpath, 'utf8');
	var regex = /(require\s*\(\s*['"]alloy\/underscore['"]\s*\))._/g
	var test = regex.test(source);
	if(test) {
		logger.trace("Fixing file: " + fullpath);
		source = source.replace(regex, "$1");
		fs.writeFileSync(fullpath, source);
	}
}
1139847
def inject_import_path(path, options = {})
      path = path.to_s unless path.is_a?(String)
      if path =~ /(.*?)\/.*/
        import_name = Regexp.last_match[1].downcase.to_sym
        if import_name == :origen || import_name == :origen_core || Origen.app.plugins.names.include?(import_name) ||
           import_name == :doc_helpers
          # Special case to allow a shortcut for this common import plugin and to also handle legacy
          # code from when it was called doc_helpers instead of origen_doc_helpers
          if import_name == :doc_helpers
            root = Origen.app(:origen_doc_helpers).root
          else
            unless import_name == :origen || import_name == :origen_core
              root = Origen.app(import_name).root
            end
          end
          if options[:type] == :template
            if import_name == :origen || import_name == :origen_core
              path.sub! 'origen', "#{Origen.top}/templates/shared"
            else
              path.sub! Regexp.last_match[1], "#{root}/templates/shared"
            end
          else
            fail 'Unknown import path type!'
          end
        end
      end
      path
    end
86431
function replacements(src) {
  return src
    .replace(/babel-preset-react-app/g, 'babel-preset-moped')
    .replace(/\.\/polyfills/g, '../lib/config/polyfills.js')
    .replace(/require\(paths\.appPackageJson\)\.homepage/g, 'undefined')
    .replace(/\.\.\/\.eslintrc/g, '../moped-eslint-config/.eslintrc');
}
1329784
private String replaceMacros(String msg, String contentLocale) {

        CmsMacroResolver resolver = CmsMacroResolver.newInstance();
        resolver.addMacro(MACRO_DECORATION, m_decoration);
        resolver.addMacro(MACRO_DECORATIONKEY, m_decorationKey);
        if (m_locale != null) {
            resolver.addMacro(MACRO_LOCALE, m_locale.toString());
            if (!contentLocale.equals(m_locale.toString())) {
                resolver.addMacro(MACRO_LANGUAGE, "lang=\"" + m_locale.toString() + "\"");
            }
        }

        return resolver.resolveMacros(msg);
    }
895058
function parseImportData(cssText, baseUrl, ignoreRules = []) {
        const importData = {};

        // @import rules
        // Ex: @import "file.css";
        importData.rules = (cssText
            // Remove comments to avoid processing @import in comments
            .replace(regex.cssComments, '')
            // Find all @import rules
            .match(regex.cssImports)
            // Force empty array if no match
            || [])
            // Remove rules found in ignoreRules array
            .filter(rule => ignoreRules.indexOf(rule) === -1);

        // @import urls
        // Ex: file.css
        importData.urls = importData.rules.map(rule => rule.replace(regex.cssImports, '$1'));

        // Absolute @import urls
        // Ex: /path/to/file.css
        importData.absoluteUrls = importData.urls.map(url => getFullUrl(url, baseUrl));

        // Absolute @import rules
        // Ex: @import "/path/to/file.css";
        importData.absoluteRules = importData.rules.map((rule, i) => {
            const oldUrl = importData.urls[i];
            const newUrl = getFullUrl(importData.absoluteUrls[i], baseUrl);

            return rule.replace(oldUrl, newUrl);
        });

        return importData;
    }
770682
function (module, config) {
            var ret = {
                url: (config.root||'')+module,
                version: (config.ver||_o)[module]
            };
            // convert xxx.html to xxx_ver.html
            if (!!config.mode&&!!ret.version){
                ret.url = ret.url.replace(
                    /(\.[^.\/]*?)$/,
                    '_'+ret.version+'$1'
                );
                ret.version = null;
            }
            return ret;
        }
175430
function fixRelativeUrls(cssText, href) {
	var base = resolveRelativeUrl(href, document.baseURI);
	return cssText.replace(URL_VALUE_REGEXP, function(match, quote, url1, url2) {
		var url = url1 || url2;
		if (!url) {
			return match;
		}
		return 'url(' + (quote || '"') + resolveRelativeUrl(url, base) + (quote || '"') + ')';
	});
}
1040328
function substituteVars(rawText, vars)
{
    if (!vars)
    {
        return rawText;
    }
    //after loading contents, perform variable substitution
    Object.keys(vars).forEach(function (varName)
    {
        if (vars.hasOwnProperty(varName))
        {
            var varValue = vars[varName];
            rawText = replaceAll(rawText, varName, varValue);
        }
    });
    return rawText;
}
140170
def resolve(tex):
    

    # soupify
    soup = TexSoup(tex)

    # resolve subimports
    for subimport in soup.find_all('subimport'):
        path = subimport.args[0] + subimport.args[1]
        subimport.replace_with(*resolve(open(path)).contents)

    # resolve imports
    for _import in soup.find_all('import'):
        _import.replace_with(*resolve(open(_import.args[0])).contents)

    # resolve includes
    for include in soup.find_all('include'):
        include.replace_with(*resolve(open(include.args[0])).contents)

    return soup
12039
private static ImmutableList<ImportTree> getWildcardImports(List<? extends ImportTree> imports) {
    ImmutableList.Builder<ImportTree> result = ImmutableList.builder();
    for (ImportTree tree : imports) {
      // javac represents on-demand imports as a member select where the selected name is '*'.
      Tree ident = tree.getQualifiedIdentifier();
      if (!(ident instanceof MemberSelectTree)) {
        continue;
      }
      MemberSelectTree select = (MemberSelectTree) ident;
      if (select.getIdentifier().contentEquals("*")) {
        result.add(tree);
      }
    }
    return result.build();
  }