See `Module.export`.
338734
def export(self, path, session):
    """"""
    def variables_saver(variables_path):
      if self._saver:
        self._saver.save(
            session, variables_path,
            write_meta_graph=False,
            write_state=False)

    self._spec._export(path, variables_saver)
597174
private void exportModules() {

        // avoid to export modules if unnecessary
        if (((null != m_copyAndUnzip) && !m_copyAndUnzip.booleanValue())
            || ((null == m_copyAndUnzip) && !m_currentConfiguration.getDefaultCopyAndUnzip())) {
            m_logStream.println();
            m_logStream.println("NOT EXPORTING MODULES - you disabled copy and unzip.");
            m_logStream.println();
            return;
        }
        CmsModuleManager moduleManager = OpenCms.getModuleManager();

        Collection<String> modulesToExport = ((m_modulesToExport == null) || m_modulesToExport.isEmpty())
        ? m_currentConfiguration.getConfiguredModules()
        : m_modulesToExport;

        for (String moduleName : modulesToExport) {
            CmsModule module = moduleManager.getModule(moduleName);
            if (module != null) {
                CmsModuleImportExportHandler handler = CmsModuleImportExportHandler.getExportHandler(
                    getCmsObject(),
                    module,
                    "Git export handler");
                try {
                    handler.exportData(
                        getCmsObject(),
                        new CmsPrintStreamReport(
                            m_logStream,
                            OpenCms.getWorkplaceManager().getWorkplaceLocale(getCmsObject()),
                            false));
                } catch (CmsRoleViolationException | CmsConfigurationException | CmsImportExportException e) {
                    e.printStackTrace(m_logStream);
                }
            }
        }
    }
1227898
def exports(self):
        
        if self._exports is None:
            self._exports = ExportList(self)
        return self._exports
912150
def export(self):
        """"""
        top = self._top_element()
        properties = self._properties_element(top)
        self._fill_requirements(top)
        self._fill_lookup_prop(properties)
        return utils.prettify_xml(top)
264385
def export(self, fn:PathOrStr, **kwargs):
        ""
        pickle.dump(self.get_state(**kwargs), open(fn, 'wb'))
982339
function getExports(fullpath, { initializer, call, inject }, pathName) {
  let exports = utils.loadFile(fullpath);
  // process exports as you like
  if (initializer) {
    exports = initializer(exports, { path: fullpath, pathName });
  }

  // return exports when it's a class or generator
  //
  // module.exports = class Service {};
  // or
  // module.exports = function*() {}
  if (is.class(exports) || is.generatorFunction(exports) || is.asyncFunction(exports)) {
    return exports;
  }

  // return exports after call when it's a function
  //
  // module.exports = function(app) {
  //   return {};
  // }
  if (call && is.function(exports)) {
    exports = exports(inject);
    if (exports != null) {
      return exports;
    }
  }

  // return exports what is
  return exports;
}
839263
def process_module_output(self, module):
        
        outputs = module["module"].get_latest()
        color = module["color"]
        if color:
            for output in outputs:
                # Color: substitute the config defined color
                if "color" not in output:
                    output["color"] = color
        # Create the json string output.
        return ",".join([dumps(x) for x in outputs])
700915
def export_osm_file(self):
        """"""
        osm = create_elem('osm', {'generator': self.generator,
                                  'version': self.version})
        osm.extend(obj.toosm() for obj in self)

        return etree.ElementTree(osm)
608717
def view_export(self, id, **kwargs):
        ""
        api_path = "/api/v2/views/{id}/export.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
807886
def __build_export(self, stats):
        """"""
        export_names = []
        export_values = []

        if isinstance(stats, dict):
            # Stats is a dict
            # Is there a key ?
            if 'key' in iterkeys(stats) and stats['key'] in iterkeys(stats):
                pre_key = '{}.'.format(stats[stats['key']])
            else:
                pre_key = ''
            # Walk through the dict
            for key, value in iteritems(stats):
                if isinstance(value, bool):
                    value = json.dumps(value)
                if isinstance(value, list):
                    try:
                        value = value[0]
                    except IndexError:
                        value = ''
                if isinstance(value, dict):
                    item_names, item_values = self.__build_export(value)
                    item_names = [pre_key + key.lower() + str(i) for i in item_names]
                    export_names += item_names
                    export_values += item_values
                else:
                    export_names.append(pre_key + key.lower())
                    export_values.append(value)
        elif isinstance(stats, list):
            # Stats is a list (of dict)
            # Recursive loop through the list
            for item in stats:
                item_names, item_values = self.__build_export(item)
                export_names += item_names
                export_values += item_values
        return export_names, export_values
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;
}
612254
public function export()
    {
        $path = $this->module->dataPath;
        FileHelper::createDirectory($path, $this->module->dirMode);

        $summary = $this->collectSummary();
        $dataFile = "$path/{$this->tag}.log";
        $data = [];

        $data['log'] = $this->save();

        $data['summary'] = $summary;
        file_put_contents($dataFile, $this->convertArrayToText($data));
        if ($this->module->fileMode !== null) {
            @chmod($dataFile, $this->module->fileMode);
        }

        $indexFile = "$path/index.data";
        $this->updateIndexFile($indexFile, $summary);
    }
772434
function require(p) {
  var path = require.resolve(p)
  var module = require.modules[path];
  if(!module) throw("couldn't find module for: " + p);
  if(!module.exports) {
    module.exports = {};
    module.call(module.exports, module, module.exports, require.bind(path));
  }
  return module.exports;
}
182850
def export_py(
            self,
            py_module_name=PY_MODULE_NAME,
            py_template=PY_TEMPLATE,
            py_indent=PY_INDENTATION):
        ''''''

        language = []
        classes = {'Grammar'}
        indent = 0

        for name in self._order:
            elem = getattr(self, name, None)
            if not isinstance(elem, Element):
                continue
            if not hasattr(elem, '_export_py'):
                continue
            language.append('{indent}{name} = {value}'.format(
                indent=py_indent,
                name=name,
                value=elem._export_py(py_indent, indent, classes)))

        for name, ref in self._refs.items():
            language.append(
                '{indent}{name} = {value}'
                .format(
                    indent=py_indent,
                    name=name,
                    value=ref._element._export_py(
                        py_indent,
                        indent,
                        classes)))

        return py_template.format(
            name=self.__class__.__name__,
            indent=py_indent,
            py_module=py_module_name,
            datetime=time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()),
            language='\n'.join(language),
            re_keywords=self.RE_KEYWORDS.pattern.replace('\\', '\\\\'),
            imports='\n'.join(
                map(lambda s: s, [
                    ' '.join(['from', py_module_name, 'import', n])
                    for n in classes if n != 'Rule'])))
937230
def compute_exports(exports):
    """"""

    loc, glob = get_calling_namespaces()

    retval = {}
    try:
        for export in exports:
            if SCons.Util.is_Dict(export):
                retval.update(export)
            else:
                try:
                    retval[export] = loc[export]
                except KeyError:
                    retval[export] = glob[export]
    except KeyError as x:
        raise SCons.Errors.UserError("Export of non-existent variable '%s'"%x)

    return retval
434962
function(target) {
                // Only store the `module` in the local cache since `module.exports` may not be accurate
                // if there was a circular dependency
                var module = localCache[target] || (localCache[target] = requireModule(target, dirname));
                return module.exports;
            }
1200425
function exports(grunt) {
	'use strict';

	var jsFiles = ['bin/ninejs', '*.js', '**/*.js', '!node_modules/**', '!out/**', '!nineplate/utils/parser/**/commonjs.js', '!nineplate/utils/parser/**/amd.js', '!nineplate/tests/template-generated.js', '!modernizer.js', '!modules/webserver/jsClientUtils/*'],
		testFiles = ['**/tests/**/*.js', '!coverage/**', '!**/tests/**/phantom*.js', '!node_modules/**', '!out/**', '!nineplate/tests/template-generated.js'],
		phantomWatch = ['nineplate/tests/phantomTest.js'],
		stylusFiles = [ '**/*.styl', '!node_modules/**', '!ui/bootstrap/extension.styl' ],
		ncssFiles = ['ui/bootstrap/less/bootstrap.ncss'],
		tsfiles = ['**/*.ts', '!**/*.d.ts', '!node_modules/**/*.ts'],
		Q = require('kew');

	require('load-grunt-tasks')(grunt);
	// Project configuration.
	grunt.initConfig({
		mocha: { //Phantomjs
			index: {
				src: ['nineplate/tests/phantomTest.html']
			}
		},
		mochaTest: {
			normal: {
				src: testFiles,
				options: {
					reporter: 'spec',
					globals: []
				}
			},
			watch: {
				src: testFiles,
				options: {
					reporter: 'spec',
					globals: []
				}
			}
		},
		watch: {
			//jshint : {
			//	files : jsFiles,
			//	tasks : 'jshint'
			//},
			ts: {
				files : tsfiles,
				tasks : 'ts'
			},
			stylus: {
				files: stylusFiles,
				tasks: ['stylus']
			},
			phantom: {
				files: phantomWatch.slice(0).concat(jsFiles),
				tasks: ['mocha']
			}
			//,
			//test: {
			//	files: testFiles.slice(0).concat(jsFiles),
			//	tasks: ['generateParsers', 'mochaTest:watch', 'mocha']
			//}

		},
		stylus:
		{
			files: stylusFiles,
			options:
			{
				urlfunc: 'embedurl', // use embedurl('test.png') in our code to trigger Data URI
				compress: true
			}
		},
		ncss:
		{
			files: ncssFiles,
			options: {}
		},
		exec: {
			less: (process.env.LESS_COMPILER || "node ./node_modules/less/bin/lessc") + " ui/bootstrap/less/bootstrap.less > ui/bootstrap/less/bootstrap.ncss",
			defaultTs : (process.env.TS_COMPILER || "./node_modules/typescript/bin/tsc") + " -p ./tsconfig.json"
		},
		dts_bundle: {
			build: {
				options: {
					name: 'ninejs',
					main: '9js.d.ts',
					exclude: function (n, external) {
						return /*external || (n.indexOf('typings/') >= 0) ||*/ (n.indexOf('node_modules') >= 0);
					},
					prefix: '',
					externals: false,
					referenceExternals: false,
					verbose: false,
					removeSource: false
				}
			}
		},
		globaltsd: {
			options: {
				target: __dirname + '/9js.ts',
				baseDir: __dirname,
				exclude: [
					'ninejs.d.ts',
					'9js.d.ts',
					'typings',
					'node_modules'
				],
				references: [
					'./typings/node/node.d.ts'
				]
			}
		},
		nineplate: {
			html: {
				mode: 'html',
				pattern: '\\.html$',
				src: [
					'ui/css',
					'!ui/tests/logic/FilterBuilder/demo.html',
					'modules'
				]
			},
			css: {
				mode: 'css',
				pattern: '\\.css$',
				extension: 'ncss.js',
				src: [
					'ui',
					'modules'
				]
			}
		}
	});

	grunt.loadNpmTasks('grunt-njs-css');
	grunt.loadNpmTasks('grunt-mocha-test');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-globaltsd');
	grunt.task.loadTasks('grunt');
	grunt.registerMultiTask('mocha','run Phantomjs tests with Mocha', function() {
		var done = this.async(),
			files = this.filesSrc,
			queues = [],
			command = 'mocha-phantomjs',
			platform = require('os').platform();
		if ((/win/).test(platform)) {
			command += '.cmd';
		}

		files.forEach(function(file) {
			var childProcess = require('child_process'),
				defer = Q.defer();
			queues.push(defer.promise);
			var mochaPhantom = childProcess.spawn(command, [file], { stdio: 'inherit' });
			mochaPhantom.on('exit', function(/*code*/) {
				defer.resolve();
			});
		});
		Q.all(queues).then(function() {
			done();
		});
	});
	grunt.registerTask('tsd','Install TypeScript definitions', function() {
		var done = this.async(),
			command = 'node',
			path = require('path'),
			cliPath = path.resolve(__dirname, 'node_modules', 'tsd', 'build', 'cli.js');

		var childProcess = require('child_process'),
			defer = Q.defer();
		var tsdProcess = childProcess.spawn(command, [cliPath, 'install'], { stdio: 'inherit' });
		tsdProcess.on('exit', function(/*code*/) {
			defer.resolve();
		});
		defer.promise.then(function () {
			done();
		});
	});

	var childProcess = require('child_process'),
			path = require('path');

	grunt.registerMultiTask('nineplate', 'Generates nineplate and css functions', function () {
		console.log('Running nineplate ');
		var done = this.async();
		var files = this.filesSrc;
		var pattern = '';
		var extension = '';
		var data = this.data;
		if (this.data.pattern) {
			pattern = ' --pattern=' + this.data.pattern;
		}
		if (this.data.extension) {
			extension = ' --extension=' + this.data.extension;
		}

		console.log('nineplate ' + files.length + ' files');

		files.forEach(function(file) {
			childProcess.execSync('node ./cli/nineplate.js ' + file + ' --target=amd --mode=' + data.mode + ' --toBase64 --baseUrl=' + path.resolve(process.cwd()) + pattern + extension, {
				stdio: 'inherit'
			});
		});
		done();
	});

	grunt.registerTask('test', ['mochaTest:normal', 'mocha']);
	grunt.registerTask('css', ['less', 'ncss', 'stylus']);
	grunt.registerTask('less', ['exec:less']);
	// Default task.
	grunt.registerTask('default', ['css', 'generateParsers', 'nineplate', 'exec', /*'typedoc', */'test']);

}