create a new export function, used by both the main export and the .ctor export, contains common logic for dealing with arguments
515881
function through2 (construct) {
  return function (options, transform, flush) {
    if (typeof options == 'function') {
      flush     = transform
      transform = options
      options   = {}
    }

    if (typeof transform != 'function')
      transform = noop

    if (typeof flush != 'function')
      flush = null

    return construct(options, transform, flush)
  }
}
736631
function createImportTargets(importTargets, targetName, targetDirectory) {
  const importMap = {};
  for (const x in importTargets) {
    importMap['rxjs/' + x] = ('rxjs-compat/' + targetName + importTargets[x]).replace(/\.js$/, '');
  }

  const outputData =
`
"use strict"

var path = require('path');
var dir = path.resolve(__dirname);

module.exports = function() {
  return ${JSON.stringify(importMap, null, 4)};
}
`

  fs.outputFileSync(targetDirectory + 'path-mapping.js', outputData);
}
587531
def exec_function(ast, globals_map):
    
    locals_map = globals_map
    exec ast in globals_map, locals_map
    return locals_map
339390
function tb(func, opt) {
        /* should get value false for the first call. This can be done by calling the 
        exported function, or the firstBy property on it (for es6 module compatibility)
        */
        var x = (typeof(this) == "function" && !this.firstBy) ? this : false;
        var y = makeCompareFunction(func, opt);
        var f = x ? function(a, b) {
                        return x(a,b) || y(a,b);
                    }
                  : y;
        f.thenBy = tb;
        return f;
    }
193944
def export_args(subparsers):
    """"""
    export_parser = subparsers.add_parser('export')
    export_parser.add_argument('directory',
                               help='Path where secrets will be exported into')
    secretfile_args(export_parser)
    vars_args(export_parser)
    base_args(export_parser)
730221
def create_arguments(primary, pyfunction, call_node, scope):
    """"""
    args = list(call_node.args)
    args.extend(call_node.keywords)
    called = call_node.func
    # XXX: Handle constructors
    if _is_method_call(primary, pyfunction) and \
       isinstance(called, ast.Attribute):
        args.insert(0, called.value)
    return Arguments(args, scope)
292297
function generate_exports (module) {
  // # 85
  // Before module factory being invoked, mark the module as `loaded`
  // so we will not execute the factory function again.

  // `mod.loaded` indicates that a module has already been `require()`d
  // When there are cyclic dependencies, neuron will not fail.
  module.loaded = true;

  // During the execution of factory,
  // the reference of `module.exports` might be changed.
  // But we still set the `module.exports` as `{}`,
  // because the module might be `require()`d during the execution of factory
  // if cyclic dependency occurs.
  var exports = module.exports = {};

  // TODO:
  // Calculate `filename` ahead of time
  var __filename
    // = module.filename
    = NEURON_CONF.resolve(module.id);
  var __dirname = dirname(__filename);

  // to keep the object mod away from the executing context of factory,
  // use `factory` instead `mod.factory`,
  // preventing user from fetching runtime data by 'this'
  var factory = module.factory;
  factory(create_require(module), exports, module, __filename, __dirname);
  return module.exports;
}
768262
function instantiateImports(
  n: Module,
  allocator: Allocator,
  externalElements: Object,
  internals: Object,
  moduleInstance: ModuleInstance
) {
  function getExternalElementOrThrow(key: string, key2: string): any {
    if (
      typeof externalElements[key] === "undefined" ||
      typeof externalElements[key][key2] === "undefined"
    ) {
      throw new CompileError(`Unknown import ${key}.${key2}`);
    }

    return externalElements[key][key2];
  }

  function handleFuncImport(node: ModuleImport, descr: FuncImportDescr) {
    const element = getExternalElementOrThrow(node.module, node.name);

    const params = descr.signature.params != null ? descr.signature.params : [];
    const results =
      descr.signature.results != null ? descr.signature.results : [];

    const externFuncinstance = externvalue.createFuncInstance(
      element,
      // $FlowIgnore
      params,
      results
    );

    const externFuncinstanceAddr = allocator.malloc(
      1 /* sizeof externFuncinstance */
    );
    allocator.set(externFuncinstanceAddr, externFuncinstance);

    moduleInstance.funcaddrs.push(externFuncinstanceAddr);
  }

  function handleGlobalImport(node: ModuleImport, descr: GlobalType) {
    const element = getExternalElementOrThrow(node.module, node.name);

    const externglobalinstance = externvalue.createGlobalInstance(
      new i32(element),
      descr.valtype,
      descr.mutability
    );

    const addr = allocator.malloc(1 /* size of the globalinstance struct */);
    allocator.set(addr, externglobalinstance);

    moduleInstance.globaladdrs.push(addr);
  }

  function handleMemoryImport(node: ModuleImport) {
    const memoryinstance = getExternalElementOrThrow(node.module, node.name);

    const addr = allocator.malloc(1 /* size of the memoryinstance struct */);
    allocator.set(addr, memoryinstance);

    moduleInstance.memaddrs.push(addr);
  }

  function handleTableImport(node: ModuleImport) {
    const tableinstance = getExternalElementOrThrow(node.module, node.name);

    const addr = allocator.malloc(1 /* size of the tableinstance struct */);
    allocator.set(addr, tableinstance);

    moduleInstance.tableaddrs.push(addr);
  }

  traverse(n, {
    ModuleImport({ node }: NodePath<ModuleImport>) {
      switch (node.descr.type) {
        case "FuncImportDescr":
          return handleFuncImport(node, node.descr);
        case "GlobalType":
          return handleGlobalImport(node, node.descr);
        case "Memory":
          return handleMemoryImport(node);
        case "Table":
          return handleTableImport(node);
        default:
          throw new Error("Unsupported import of type: " + node.descr.type);
      }
    }
  });
}
996582
def create_new_file(self, current_path, title, filters, create_func):
        """"""
        if current_path is None:
            current_path = ''
        if osp.isfile(current_path):
            current_path = osp.dirname(current_path)
        self.redirect_stdio.emit(False)
        fname, _selfilter = getsavefilename(self, title, current_path, filters)
        self.redirect_stdio.emit(True)
        if fname:
            try:
                create_func(fname)
                return fname
            except EnvironmentError as error:
                QMessageBox.critical(self, _("New file"),
                                     _("<b>Unable to create file <i>%s</i>"
                                       "</b><br><br>Error message:<br>%s"
                                       ) % (fname, to_text_string(error)))
371498
def main(unused_argv):
    """"""
    utils.ensure_dir_exists(os.path.dirname(FLAGS.export_path))
    if FLAGS.create_bootstrap:
        dual_net.bootstrap()
    dual_net.export_model(FLAGS.export_path)
76146
def ctor(self, name, func, *args, **kwargs):
        '''
        

        '''
        self.ctors[name] = (func, args, kwargs)
123869
function createExport(options) {
  options = Object.assign({}, options, { prepare: false })

  /** we need no styleguide preparation, like asset copying etc. */
  return resolveStyleguide(options)
  .then(function (styleguide) {
    return styleguide.exportStyleguide()
  })
  .catch(function (e) {
    error('Cli.createExport', 'failed to build Styleguide', e)
    throw (e)
  })
    /** create static styleguide structure */
}
1202635
async function exportCustomSelectorsToMjsFile(to, customSelectors) {
	const mjsContents = Object.keys(customSelectors).reduce((mjsLines, name) => {
		mjsLines.push(`\t'${escapeForJS(name)}': '${escapeForJS(customSelectors[name])}'`);

		return mjsLines;
	}, []).join(',\n');
	const mjs = `export const customSelectors = {\n${mjsContents}\n};\n`;

	await writeFile(to, mjs);
}
189029
function Export(clazz, name, context) {
    if (name === void 0) { name = clazz.name; }
    if (context === void 0) { context = context_constanst_1.SERVICE_FACTORY_DEFAULT_CONTEXT; }
    // Export clazz if name is set
    service_factory_1.ServiceFactory.export(clazz, name, context);
    /**
     * Modify constructor
     */
    return function (constructor) {
        // Preserve original
        var original = constructor;
        // Construct function
        function construct(constructor) {
            // Create constructor
            var c = function () {
                return constructor.apply(this);
            };
            // Assign prototype
            c.prototype = constructor.prototype;
            // Create new instance
            return service_factory_1.ServiceFactory.export(c, name, context);
        }
        // Constructor behaviour
        var f = function () {
            return construct(original);
        };
        // Copy prototype
        f.prototype = original.prototype;
        // Return new 
        return f;
    };
}
40659
function exportConfig(optionalPath) {
    // Read content of the global config file
    let config = fs.readFileSync(configFile, 'utf8');

    if (!config) {
        config = '{}';
    }

    // Create file or print output
    if (optionalPath) {
        process.stdout.write(`Exporting your config to '${optionalPath}'`);

        // Create a file in the specified location
        const file = {
            name: optionalPath,
            source: config,
        };
        createFile(file);
        checkbox.display('green');
    } else {
        console.log(config);
    }
}
8493
function visitExportDeclaration(traverse, node, path, state) {
  var specifier, name, len, i;
  utils.catchup(node.range[0], state);

  if (node.declaration) {

    // export default = value
    if (Array.isArray(node.declaration)) {

      assert(
        node.declaration.length === 1,
        formatError('cannot export more than a single declaration', node));

      name = node.declaration[0].id.name;
      switch (name) {
        case 'default':
          utils.append('module.exports =', state);
          break;
        default:
          utils.append('module.exports.' + name + ' = ', state);
      }

      if (node.declaration[0].init) {
        // -1 compensates for an additional space after '=' token
        utils.move(node.declaration[0].init.range[0] - 1, state);
        traverse(node.declaration[0].init, path, state);
      } else {
        utils.move(node.range[1], state);
      }


    // export DECLARATION
    } else {
      switch (node.declaration.type) {
        // export var name = value
        case Syntax.VariableDeclaration:
          utils.move(node.declaration.range[0], state);
          node.declaration.declarations.forEach(function(declaration) {
            utils.catchup(declaration.id.range[1], state);
            utils.append(' = module.exports.' + declaration.id.name, state);
            traverse(declaration.init, path, state);
          });
          break;
        case Syntax.FunctionDeclaration:
          name = node.declaration.id.name;
          utils.move(node.declaration.range[0], state);
          traverse(node.declaration, path, state);
          utils.append(' module.exports.' + name + ' = ' + name + ';', state);
          break;
        case Syntax.ClassDeclaration:
          name = node.declaration.id.name;
          utils.move(node.declaration.range[0], state);
          traverse(node.declaration, path, state);
          utils.append('module.exports.' + name + ' = ' + name + ';', state);
          break;
        default:
          assert(false, "unknown declaration: " + node.declaration.type);
      }
    }

  } else if (node.source) {

    var modID;

    // export * from "module"
    if (node.specifiers.length === 1 &&
        node.specifiers[0].type === Syntax.ExportBatchSpecifier) {

      modID = genID('mod');
      utils.append('var ' + modID + ' = require(' + node.source.raw + ');', state);

      var keyID = genID('key');
      utils.append(
        'for (var ' + keyID + ' in ' + modID + ') ' +
        'module.exports[' + keyID + '] = ' + modID + '[' + keyID + '];',
        state
      );

      utils.move(node.range[1], state);

    // export {name, one as other} from "module"
    } else {

      if (node.specifiers.length === 1) {
        modID = 'require(' + node.source.raw + ')';
      } else {
        modID = genID('mod');
        utils.append('var ' + modID + ' = require(' + node.source.raw + ');', state);
      }

      for (i = 0, len = node.specifiers.length; i < len; i++) {
        specifier = node.specifiers[i];
        utils.catchupNewlines(specifier.range[0], state);
        name = specifier.name ? specifier.name.name : specifier.id.name;
        utils.append(
          'module.exports.' + name + ' = ' + modID +
          '.' + specifier.id.name + ';',
          state
        );
        utils.move(specifier.id.range[1], state);
      }
    }

    utils.catchupNewlines(node.range[1], state);
    utils.move(node.range[1], state);

  } else if (node.specifiers) {

    // export { name, one as other }
    for (i = 0, len = node.specifiers.length; i < len; i++) {
      specifier = node.specifiers[i];
      utils.catchupNewlines(specifier.range[0], state);
      name = specifier.name ? specifier.name.name : specifier.id.name;
      utils.append('module.exports.' + name + ' = ' + specifier.id.name + ';', state);
    }

    utils.catchupNewlines(node.range[1], state);
    utils.move(node.range[1], state);

  } else {

    assert(false, "don't know how to compile export declaration");
  }

  return false;
}
396732
function extendExportSymbols(target, source, lookupTable, exportNode) {
            for (var id in source) {
                if (id !== "default" && !target[id]) {
                    target[id] = source[id];
                    if (lookupTable && exportNode) {
                        lookupTable[id] = {
                            specifierText: ts.getTextOfNode(exportNode.moduleSpecifier)
                        };
                    }
                }
                else if (lookupTable && exportNode && id !== "default" && target[id] && resolveSymbol(target[id]) !== resolveSymbol(source[id])) {
                    if (!lookupTable[id].exportsWithDuplicate) {
                        lookupTable[id].exportsWithDuplicate = [exportNode];
                    }
                    else {
                        lookupTable[id].exportsWithDuplicate.push(exportNode);
                    }
                }
            }
        }