ECMA-262 15.2.2 Imports
175923
function() {
      var node = this.startNode(_ImportDeclaration);

      this.expect('import');
      node.specifiers = this.parseImportClause();

      if (this.value === 'from') {
        this.next();
      }

      this.assertType(_String);
      node.source = this.parseLiteral();
      this.expectSemicolon();

      return this.finishNode(node);
    }
306667
function moduleExport(getters, constant) {
  utils.setESModule(this.exports);
  var entry = Entry.getOrCreate(this.id, this);
  entry.addGetters(getters, constant);
  if (this.loaded) {
    // If the module has already been evaluated, then we need to trigger
    // another round of entry.runSetters calls, which begins by calling
    // entry.runModuleGetters(module).
    entry.runSetters();
  }
}
1231253
private static void prepImportsList(List<SymbolTable> importsList,
                                        IonReader reader,
                                        IonCatalog catalog)
    {
        assert IMPORTS.equals(reader.getFieldName());

        reader.stepIn();
        IonType t;
        while ((t = reader.next()) != null)
        {
            if (!reader.isNullValue() && t == IonType.STRUCT)
            {
                SymbolTable importedTable = readOneImport(reader, catalog);

                if (importedTable != null)
                {
                    importsList.add(importedTable);
                }
            }
        }
        reader.stepOut();
    }
1343580
private Map<String, ImportConfiguration> loadNewConfigAndBundles(CatalogContext catalogContext) {
        Map<String, ImportConfiguration> newProcessorConfig;

        ImportType importElement = catalogContext.getDeployment().getImport();
        if (importElement == null || importElement.getConfiguration().isEmpty()) {
            newProcessorConfig = new HashMap<>();
        } else {
            newProcessorConfig = CatalogUtil.getImportProcessorConfig(importElement);
        }

        Iterator<Map.Entry<String, ImportConfiguration>> iter = newProcessorConfig.entrySet().iterator();
        while (iter.hasNext()) {
            String configName = iter.next().getKey();
            ImportConfiguration importConfig = newProcessorConfig.get(configName);
            Properties properties = importConfig.getmoduleProperties();

            String importBundleJar = properties.getProperty(ImportDataProcessor.IMPORT_MODULE);
            Preconditions.checkNotNull(importBundleJar,
                    "Import source is undefined or custom import plugin class missing.");
            if (!importConfig.checkProcedures(catalogContext, importLog, configName)) {
                iter.remove();
                continue;
            }
            // NOTE: if bundle is already loaded, loadImporterBundle does nothing and returns true
            boolean bundlePresent = loadImporterBundle(properties);
            if (!bundlePresent) {
                iter.remove();
            }
        }
        m_formatterFactories.clear();
        for (ImportConfiguration config : newProcessorConfig.values()) {
            Map<String, FormatterBuilder> formatters = config.getFormatterBuilders();
            if (formatters != null) {
                try {
                    for (FormatterBuilder builder : formatters.values()) {
                        String module = builder.getFormatterProperties().getProperty(ImportDataProcessor.IMPORT_FORMATTER);
                        AbstractFormatterFactory formatterFactory = m_formatterFactories.get(module);
                        if (formatterFactory == null) {
                            URI moduleURI = URI.create(module);
                            formatterFactory = m_moduleManager.getService(moduleURI, AbstractFormatterFactory.class);
                            if (formatterFactory == null) {
                                VoltDB.crashLocalVoltDB("Failed to initialize formatter from: " + module);
                            }
                            m_formatterFactories.put(module, formatterFactory);
                        }
                        builder.setFormatterFactory(formatterFactory);
                    }
                } catch(Throwable t) {
                    VoltDB.crashLocalVoltDB("Failed to initialize formatter.");
                }
            }
        }

        importLog.info("Final importer count:" + newProcessorConfig.size());
        return newProcessorConfig;
    }
116504
function getLessImports() {
    if (cache.lessImports) return cache.lessImports;

    var semanticUiLessPath = getPackagePath('semantic-ui-less');
    if (!semanticUiLessPath) {
        error('Package semantic-ui-less could not be found. Install semantic-ui-less or set addLessImports to false.');
    }

    var lessImportsFilePath = path.resolve(semanticUiLessPath, 'semantic.less');
    var lessImportsFile = fs.readFileSync(lessImportsFilePath, 'utf8');

    var importRegex = /@import\s+"([^"]+)"/g;
    var lessImports = {};
    var match;
    while(match = importRegex.exec(lessImportsFile)) {
        var importPath = match[1];
        var component = importPath.substring(importPath.lastIndexOf('/') + 1);
        if (lessImports[component]) {
            error('duplicate less component name \'' + component + '\' - probably the plugin needs an update');
        }
        lessImports[component] = 'semantic-ui-less/' + importPath + '.less';
    }

    cache.lessImports = lessImports;
    return lessImports;
}
1290555
function findImports(filePath, result) {
  var importPaths = getImportPaths(filePath);
  var importPathsAbs = resolveImportPaths(filePath, importPaths);
  if( importPathsAbs.length )
    result.full[filePath] = importPathsAbs;
  importPathsAbs.forEach(function(path){
    if (result.simple.indexOf(path) === -1) {
      result.simple.push(path);
      findImports(path, result);
    }
  });
  return result;
}
639369
function buildNamespaceReexport(meta, namespace, checkExport) {
    checkExport();
    return babelTemplate.statement(`
        (function() {
          for (var key in NAMESPACE) {
            if (NAMESPACE == null || !NAMESPACE.hasOwnProperty(key) || key === 'default' || key === '__esModule') return;
            VERIFY_NAME_LIST;
            exports[key] = NAMESPACE[key];
          }
        })();
    `)({
        NAMESPACE: namespace,
        VERIFY_NAME_LIST: meta.exportNameListName
            ? babelTemplate.statement(`
                if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return;
            `)({EXPORTS_LIST: meta.exportNameListName})
            : null
    });
}
848333
def FromImport(package_name, name_leafs):
    
    # XXX: May not handle dotted imports properly (eg, package_name='foo.bar')
    #assert package_name == '.' or '.' not in package_name, "FromImport has "\
    #       "not been tested with dotted package names -- use at your own "\
    #       "peril!"

    for leaf in name_leafs:
        # Pull the leaves out of their old tree
        leaf.remove()

    children = [Leaf(token.NAME, u"from"),
                Leaf(token.NAME, package_name, prefix=u" "),
                Leaf(token.NAME, u"import", prefix=u" "),
                Node(syms.import_as_names, name_leafs)]
    imp = Node(syms.import_from, children)
    return imp
295248
def check_imports(self):
        
        modules = []
        for filename in sorted(os.listdir(self.app_path)):
            if not filename.endswith('.py'):
                continue

            fq_path = os.path.join(self.app_path, filename)
            with open(fq_path, 'rb') as f:
                # TODO: fix this
                code_lines = deque([(f.read(), 1)])

                while code_lines:
                    m_status = True
                    code, lineno = code_lines.popleft()  # pylint: disable=W0612
                    try:
                        parsed_code = ast.parse(code)
                        for node in ast.walk(parsed_code):
                            if isinstance(node, ast.Import):
                                for n in node.names:
                                    m = n.name.split('.')[0]
                                    if self.check_import_stdlib(m):
                                        # stdlib module, not need to proceed
                                        continue
                                    m_status = self.check_imported(m)
                                    modules.append(
                                        {'file': filename, 'module': m, 'status': m_status}
                                    )
                            elif isinstance(node, ast.ImportFrom):
                                m = node.module.split('.')[0]
                                if self.check_import_stdlib(m):
                                    # stdlib module, not need to proceed
                                    continue
                                m_status = self.check_imported(m)
                                modules.append({'file': filename, 'module': m, 'status': m_status})
                            else:
                                continue
                    except SyntaxError:
                        pass

        for module_data in modules:
            status = True
            if not module_data.get('status'):
                status = False
                # update validation data errors
                self.validation_data['errors'].append(
                    'Module validation failed for {} (module "{}" could not be imported).'.format(
                        module_data.get('file'), module_data.get('module')
                    )
                )
            # update validation data for module
            self.validation_data['moduleImports'].append(
                {
                    'filename': module_data.get('file'),
                    'module': module_data.get('module'),
                    'status': status,
                }
            )
139199
public void addImportedPackages(String... importedPackages) {
		String oldBundles = mainAttributes.get(IMPORT_PACKAGE);
		if (oldBundles == null)
			oldBundles = "";
		BundleList oldResultList = BundleList.fromInput(oldBundles, newline);
		BundleList resultList = BundleList.fromInput(oldBundles, newline);
		for (String bundle : importedPackages)
			resultList.mergeInto(Bundle.fromInput(bundle));
		String result = resultList.toString();
		boolean changed = !oldResultList.toString().equals(result);
		modified |= changed;
		if (changed)
			mainAttributes.put(IMPORT_PACKAGE, result);
	}
752295
async function compileModel (projectPath, model) {
  await copyExternalScripts(projectPath, model)
  deInlineScripts(projectPath, model)

  const lookup = resolveScriptPaths(projectPath, model)

  let imports = ''
  for (let moduleName in lookup) {
    let p = path.isAbsolute(lookup[moduleName]) ? lookup[moduleName] : `./${path.normalize(lookup[moduleName])}`
    imports += `import ${moduleName} from '${p}'\n`
  }

  const pre = JSON.stringify(model, null, 2)

  let post = pre
  for (let moduleName in lookup)
    post = replaceAll(post, moduleName)

  return `import substrate from 'substrate'

// imports generated by the compiler
${imports}

const dom = document.createElement('div')
dom.id = 'myapp'
document.body.appendChild(dom)

const model = ${post}

const app = substrate({ dom, node: model.rootNode, registry: model.registry })`
}
1271930
function createDiTokenExpression(token) {
    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__facade_lang__["c" /* isPresent */])(token.value)) {
        return __WEBPACK_IMPORTED_MODULE_2__output_output_ast__["f" /* literal */](token.value);
    }
    else {
        return __WEBPACK_IMPORTED_MODULE_2__output_output_ast__["g" /* importExpr */](token.identifier);
    }
}
1331297
def commonjs_module?
      data.to_s.include?("module.exports") || data.present? && data.to_s.match(/(require\(.*\)|import)/) && dependencies.length > 0
    end
655668
function generateImportDeclaration(stmt, semicolon) {
        var result, cursor;

        // If no ImportClause is present,
        // this should be `import ModuleSpecifier` so skip `from`
        // ModuleSpecifier is StringLiteral.
        if (stmt.specifiers.length === 0) {
            // import ModuleSpecifier ;
            return [
                'import',
                space,
                // ModuleSpecifier
                generateExpression(stmt.source, {
                    precedence: Precedence.Sequence,
                    allowIn: true,
                    allowCall: true
                }),
                semicolon
            ];
        }

        // import ImportClause FromClause ;
        result = [
            'import'
        ];
        cursor = 0;

        // ImportedBinding
        if (stmt.specifiers[cursor].type === Syntax.ImportDefaultSpecifier) {
            result = join(result, [
                    generateExpression(stmt.specifiers[cursor], {
                        precedence: Precedence.Sequence,
                        allowIn: true,
                        allowCall: true
                    })
            ]);
            ++cursor;
        }

        if (stmt.specifiers[cursor]) {
            if (cursor !== 0) {
                result.push(',');
            }

            if (stmt.specifiers[cursor].type === Syntax.ImportNamespaceSpecifier) {
                // NameSpaceImport
                result = join(result, [
                        space,
                        generateExpression(stmt.specifiers[cursor], {
                            precedence: Precedence.Sequence,
                            allowIn: true,
                            allowCall: true
                        })
                ]);
            } else {
                // NamedImports
                result.push(space + '{');

                if ((stmt.specifiers.length - cursor) === 1) {
                    // import { ... } from "...";
                    result.push(space);
                    result.push(generateExpression(stmt.specifiers[cursor], {
                        precedence: Precedence.Sequence,
                        allowIn: true,
                        allowCall: true
                    }));
                    result.push(space + '}' + space);
                } else {
                    // import {
                    //    ...,
                    //    ...,
                    // } from "...";
                    withIndent(function (indent) {
                        var i, iz;
                        result.push(newline);
                        for (i = cursor, iz = stmt.specifiers.length; i < iz; ++i) {
                            result.push(indent);
                            result.push(generateExpression(stmt.specifiers[i], {
                                precedence: Precedence.Sequence,
                                allowIn: true,
                                allowCall: true
                            }));
                            if (i + 1 < iz) {
                                result.push(',' + newline);
                            }
                        }
                    });
                    if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) {
                        result.push(newline);
                    }
                    result.push(base + '}' + space);
                }
            }
        }

        result = join(result, [
            'from' + space,
            // ModuleSpecifier
            generateExpression(stmt.source, {
                precedence: Precedence.Sequence,
                allowIn: true,
                allowCall: true
            }),
            semicolon
        ]);
        return result;
    }
1087829
function getDefaultModules() {
  return {
    rules: [
      {
        test: /\.(ts|tsx)$/,
        include: srcPath,
        loader: 'tslint-loader',
        enforce: 'pre',
        exclude: '/node_modules/'
      },
      {
        test: /\.(ts|tsx)$/,
        include: srcPath,
        loader: 'ts-loader',
        exclude: '/node_modules/'
      },
      {
        test: /\.(js|jsx)$/,
        include: srcPath,
        loader: 'tslint-loader',
        enforce: 'pre',
        exclude: '/node_modules/'
      },
      {
        test: /\.(js|jsx)$/,
        loader: 'babel-loader',
        exclude: '/node_modules/'
      },
      {
        test: /\.css$/,
        use: [
          'style-loader',
          'css-loader',
        ]
      },
      {
        test: /\.sass/,
        use: [
          'style-loader',
          'css-loader',
          {
            loader: 'sass-loader',
            options: {
              outputStyle: 'expanded',
              indentedSyntax: true
            }
          }
        ]
      },
      {
        test: /\.scss/,
        use: [
          'style-loader',
          'css-loader',
          {
            loader: 'sass-loader',
            options: {
              outputStyle: 'expanded'
            }
          }
        ]
      },
      {
        test: /\.less/,
        use: [
          'style-loader',
          'css-loader',
          'less-loader'
        ]
      },
      {
        test: /\.styl/,
        use: [
          'style-loader',
          'css-loader',
          'stylus-loader'
        ]
      },
      {
        test: /\.(png|jpg|gif|woff|woff2)$/,
        loader: 'url-loader',
        options: {
          limit: 8192
        }
      },
      {
        test: /\.svg/,
        loader: 'raw-loader',
      },
      {
        test: /\.(mp4|ogg)$/,
        loader: 'file-loader'
      }
    ]
  };
}
844953
def transform_import(self, node, results):
        
        import_mod = results.get("module")
        pref = import_mod.prefix

        names = []

        # create a Node list of the replacement modules
        for name in MAPPING[import_mod.value][:-1]:
            names.extend([Name(name[0], prefix=pref), Comma()])
        names.append(Name(MAPPING[import_mod.value][-1][0], prefix=pref))
        import_mod.replace(names)
1257191
function importTypes(names: Array<string>, module: string) {
  const importDeclaration = t.importDeclaration(
    names.map(name =>
      t.importSpecifier(t.identifier(name), t.identifier(name)),
    ),
    t.stringLiteral(module),
  );
  importDeclaration.importKind = 'type';
  return importDeclaration;
}