Used when app is in dev mode (`ember serve`). Creates a new coverage map on every request.
190286
function(app, options) {
  app.post(WRITE_COVERAGE,
    bodyParser,
    (req, res) => {
      let map = istanbul.libCoverage.createCoverageMap();
      coverageHandler(map, options, req, res);
    },
    logError);
}
1104363
function EmberAddon() {
    var args = [];
    var options = {};
    console.log("Addon init")

    for (var i = 0, l = arguments.length; i < l; i++) {
        args.push(arguments[i]);
    }

    if (args.length === 1) {
        options = args[0];
    } else if (args.length > 1) {
        args.reverse();
        options = defaults.apply(null, args);
    }

    process.env.EMBER_ADDON_ENV = process.env.EMBER_ADDON_ENV || 'development';

    this.appConstructor(defaults(options, {
        name: 'dummy',
        configPath: './tests/dummy/config/environment',
        trees: {
            app: 'tests/dummy/app',
            styles: 'tests/dummy/app/styles',
            templates: 'tests/dummy/app/templates',
            public: 'tests/dummy/public',
            tests: new Funnel('tests', {
                exclude: [ /^dummy/ ]
            })
        },
        jshintrc: {
            tests: './tests',
            app: './tests/dummy'
        },
    }));
}
142632
def serve(path=None, host=None, port=None, user_content=False, context=None,
          username=None, password=None, render_offline=False,
          render_wide=False, render_inline=False, api_url=None, title=None,
          autorefresh=True, browser=False, quiet=None, grip_class=None):
    
    app = create_app(path, user_content, context, username, password,
                     render_offline, render_wide, render_inline, api_url,
                     title, None, autorefresh, quiet, grip_class)
    app.run(host, port, open_browser=browser)
1217682
function createPlugin (appName, hotReloadService, rootURL) {

  function Plugin (window, host) {
    this.window = window;
    this.host = host;
  }
  Plugin.identifier = 'ember-hot-reload';
  Plugin.version = '1.0'; // Just following the example, this might not be even used
  Plugin.prototype.reload = function(path) {
    const cancelableEvent = { modulePath: path, cancel: false};
    hotReloadService.trigger('willLiveReload', cancelableEvent);
    if (cancelableEvent.cancel) {   // Only hotreload if someone canceled the regular reload
      // Reloading app.js will fire Application.create unless we set this.
      window.runningTests = true;
      var tags = document.getElementsByTagName('script');
      for (var i = tags.length; i >= 0; i--){
        if (tags[i] && tags[i].getAttribute('src') != null && tags[i].getAttribute('src').indexOf(appName) !== -1) {
          tags[i].parentNode.removeChild(tags[i]);
        }
      }
      var script = document.createElement('script');
      script.onload = function() {
        setTimeout(function() {
          window.runningTests = false;
          hotReloadService.trigger('willHotReload', path);
        }, 10);
      };
      script.type = 'text/javascript';
      script.src = `${rootURL}assets/${appName}.js`;
      document.body.appendChild(script);

      return true;
    }
    return false;
  };
  Plugin.prototype.analyze = function() {
    return {
      disable: false
    };
  };

  return Plugin;
}
1139664
function (reInit = false) {
        //load routes
        var environment = Shared.config("environment");
        var hosts = environment.hosts;
        if (hosts) {
            if (!_.isArray(hosts)) {
                hosts = [hosts];
            }
            for (var host in hosts) {
                _parseHosts(hosts[host], reInit);
            }
        }
        _vhosts["*"] = {
            host: '*',
            router: new express.Router()
        };

        _applyRouterConfig(_vhosts["*"]["router"]);
        _customInitFuncton(_vhosts["*"]["router"]);

        return RoutesHandler.initializeRoutes(_vhosts, reInit === false);
    }
118524
def create(self, request, project):
        """"""
        job_id = int(request.data['job_id'])
        bug_id = int(request.data['bug_id'])

        try:
            BugJobMap.create(
                job_id=job_id,
                bug_id=bug_id,
                user=request.user,
            )
            message = "Bug job map saved"
        except IntegrityError:
            message = "Bug job map skipped: mapping already exists"

        return Response({"message": message})
145209
def make_map():
    """"""
    map = Mapper(directory=config['pylons.paths']['controllers'],
                 always_scan=config['debug'])

    # The ErrorController route (handles 404/500 error pages); it should
    # likely stay at the top, ensuring it can always be resolved
    map.connect('error/:action/:id', controller='error')

    # CUSTOM ROUTES HERE

    map.connect(':controller/:action/:id')

    return map
523312
function() {
    this._super();

    set(this, 'stateMeta', Ember.Map.create());

    var initialState = get(this, 'initialState');

    if (!initialState && get(this, 'states.start')) {
      initialState = 'start';
    }

    if (initialState) {
      this.transitionTo(initialState);
      Ember.assert('Failed to transition to initial state "' + initialState + '"', !!get(this, 'currentState'));
    }
  }
768761
@Override
    public void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar myToolbar = findViewById(R.id.my_toolbar);
        setSupportActionBar(myToolbar);
        // Generate a ListView with Sample Maps
        final ArrayList<String> list = new ArrayList<>();
        list.add("OSMDroid Sample map (Start Here)");
        list.add("OSMapView with Minimap, ZoomControls, Animations, Scale Bar and MyLocationOverlay");
        list.add("OSMapView with ItemizedOverlay");
        list.add("OSMapView with Minimap and ZoomControls");
        list.add("Sample with tiles overlay");
        list.add("Sample with tiles overlay and secondary tile overlay");
        list.add("More Samples");

        list.add("Report a bug");
        list.add("Settings");
        list.add("Bug Drivers");
        list.add("Diagnostics");
        list.add("View the intro again");
        list.add("Licenses");
        if (BuildConfig.VERSION_CODE >= 11)
            list.add("Cache Analyzer");

        ListView lv = findViewById(R.id.activitylist);
        ArrayAdapter adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, list);

        lv.setAdapter(adapter);
        lv.setOnItemClickListener(this);

    }
1132894
function createApp (appname, spec, cb, resourceModules) {
  var moduleNames = resourceModules
  async.parallel([ function (cb) {
    async.each(spec.agents, function (agent, cb) {
      moduleNames.push(agent.name)
      createAgent(appname, spec, agent, cb)
    }, cb)
  }, function (cb) {
    async.each(spec.crud, function (crud, cb) {
      var crudName = crud.name
      if (crudName.charAt(0) == '/') {
        crudName = crudName.substr(1)
      }
      crud.name = crudName.replace(/\//g, '_')
      moduleNames.push(crud.name)
      createCrud(appname, spec, crud, cb)
    }, cb)
  }, function (cb) {
    createTemplate(appname, 'app.js', {
      moduleNames: moduleNames,
      agents: spec.agents
    })
    cb()
  }, function (cb) {
    createTemplate(appname, 'appConfig.js', {
      moduleNames: moduleNames,
      agents: spec.agents
    })
    cb()
  } ], function (err) {
    fs.mkdir(path.join(path.resolve(appname), 'generated', 'locale'), function (response) {
      createLocale(appname)
      cb()
    })
  })
}
592548
function createHostComponentMeta(compMeta) {
	      var template = CssSelector.parse(compMeta.selector)[0].getMatchingElementTemplate();
	      return CompileDirectiveMetadata.create({
	          type: new CompileTypeMetadata({
	              reference: Object,
	              name: compMeta.type.name + "_Host",
	              moduleUrl: compMeta.type.moduleUrl,
	              isHost: true
	          }),
	          template: new CompileTemplateMetadata({
	              encapsulation: _angular_core.ViewEncapsulation.None,
	              template: template,
	              templateUrl: '',
	              styles: [],
	              styleUrls: [],
	              ngContentSelectors: [],
	              animations: []
	          }),
	          changeDetection: _angular_core.ChangeDetectionStrategy.Default,
	          inputs: [],
	          outputs: [],
	          host: {},
	          isComponent: true,
	          selector: '*',
	          providers: [],
	          viewProviders: [],
	          queries: [],
	          viewQueries: []
	      });
	  }
1298968
function (options, send) {

	var clientPath = options.clientPath,
		coverage = options.coverage,
		parentId = options.parentId,
		configuration = options.configuration,
		globalConfig = options.globalConfig,
		decorators = options.decorators,
		decoratorPlugins = options.decoratorPlugins,

		ClientClass,
		clientInstance,

		coverageVar = '__preceptorCoverage__',
		instrumenter,
		transformer,
		globalCoverageConfig = globalConfig.coverage,
		coverageIncludes = globalCoverageConfig.includes || ['**/*.js'],
		coverageExcludes = globalCoverageConfig.excludes || ['**/node_modules/**', '**/test/**', '**/tests/**'];

	// Make global configuration available
	global.PRECEPTOR = {
		config: globalConfig
	};

	// Create client and run it
	ClientClass = require(clientPath);
	clientInstance = new ClientClass(decorators, decoratorPlugins, configuration);
	clientInstance.on('reportMessage', function (messageType, data) {
		send({
			type: "reportMessage",
			messageType: messageType,
			data: data
		});
	});

	// Is coverage requested?
	if (((coverage === undefined) || (coverage === true)) && globalCoverageConfig.active) {

		// Prepare coverage instrumentation
		instrumenter = new istanbul.Instrumenter({ coverageVariable: coverageVar, preserveComments: true });
		transformer = instrumenter.instrumentSync.bind(instrumenter);

		// Hook-up transformer for every new file loaded
		istanbul.hook.hookRequire(function (filePath) {
			var allowed = false;

			// Inclusion
			_.each(coverageIncludes, function (include) {
				allowed = allowed || minimatch(filePath, include);
			});

			if (allowed) {
				// Exclusion
				_.each(coverageExcludes, function (exclude) {
					allowed = allowed && !minimatch(filePath, exclude);
				});
			}

			return allowed;

		}, transformer, {});

		// Prepare variable
		global[coverageVar] = {};
	}

	// Run client
	clientInstance.run(parentId).then(function () {
		send({
			type: "completion",
			data: {
				success: true,
				coverage: global[coverageVar]
			}
		});
		global[coverageVar] = {}; // Reset

	}, function (err) {
		send({
			type: "completion",
			data: {
				success: false,
				coverage: global[coverageVar],
				context: err.stack
			}
		});
		global[coverageVar] = {}; // Reset
	});
}
1308968
def _create_request_map(cls, input_map):
        """"""
        mapped = super(Certificate, cls)._create_request_map(input_map)
        if mapped.get('service') == CertificateType.developer:
            mapped['service'] = CertificateType.bootstrap
        return mapped
1028967
function () {
				this.oModel = new JSONModel();
				this.getView().setModel(this.oModel);

				this.router = this.getRouter();
				this.router.getRoute("code").attachPatternMatched(this.onRouteMatched, this);
				this.router.getRoute("codeFile").attachPatternMatched(this.onRouteMatched, this);

				this._codeCache = {};
				this._aFilesAvailable = [];

				this._bFirstLoad = true;
			}
207206
function createReport(coverage, opts) {
  const collector = new istanbul.Collector();
  const reporter = new istanbul.Reporter(null, opts.coverage);
  const sync = true;

  sh.echo('Creating reports...');

  collector.add(coverage);
  reporter.addAll(opts.reports);
  reporter.write(collector, sync, () => sh.echo('Reports created.'));
}
455302
function(runs, suites, tests, coverages, logs) {
    debug('setting up Mocha command line reporter');

    runs.on('error', this.proxy('error'));

    runs.on('created', this.proxy('startRun'));
    runs.on('patched', this.proxy('updateRun'));

    suites.on('created', this.proxy('startSuite'));
    suites.on('patched', this.proxy('updateSuite'));

    tests.on('created', this.proxy('startTest'));
    tests.on('patched', this.proxy('updateTest'));

    logs.on('created', this.proxy('captureLog'));

    coverages.on('created', this.proxy('reportCoverage'));

    this.start();
  }
360763
function renderModule(context, options) {
	var  cacheKey
		,modSourceTemplate
		,mergedData
		,html
	;

	// this check is used when rendering isolated modules or views for development and testing (in the default layout!).
	// skip any modules that are not THE module or THE view.
	// view: skip all modules that have the attribute _isLayout="true"
	// module: skip all other modules
	if (
		context.skipModules === true ||                         // case: module
		context.skipModules == 'layout' && options._isLayout    // case: view
		)
	{ return ''; }

	options.template = options.template || options.name;
	options.tag = options.tag || defaults.tag;
	options.data = options.data || {};
	options.data.moduleNestingLevel = typeof context.moduleNestingLevel === 'undefined' ? 0 : context.moduleNestingLevel + 1;
	autoIncrementIndent = options.data.moduleNestingLevel > 0 ? 1 : false;
	options.data.indent = options.indent || autoIncrementIndent || context.indent || 0;

	// merge the request context and data in the module include, with the latter trumping the former.
	mergedData = _.merge({}, context, options.data);

	// create a unique identifier for the module/template combination
	cacheKey = options.name + ' ' + options.template;

	// If addTest exists it means we should pass module options into it for later client-side module testing.
	context._locals && context._locals.addTest && context._locals.addTest(options);

	// force reading from disk in development mode
	NODE_ENV == 'development' && (cache[cacheKey] = null);

	// if the module/template combination is cached use it, else read from disk and cache it.
	modSourceTemplate = cache[cacheKey] || (cache[cacheKey] = getModTemplate(options));

	// render the module source in the locally merged context
	// moduleSrc is a {{variable}} in the moduleWrapper template
	try {
		options.moduleSrc = modSourceTemplate.fn(mergedData);
	}
	catch (e) {
		if (process.env.NODE_ENV != 'test') {
			if (e instanceof RenderError)   // if this is our error from a nested template rethrow it.
				throw e;
			else                            // if this is the original Handlebars error, make it useful
				throw new RenderError('Module: ' + options.name + ', Template: ' + options.template + cfg.templateExtension +'\n'+ e.toString().replace(/^Error/, 'Reason'));
		}
	}


	if (options.noWrapper) {
		html = options.moduleSrc;
	}
	else {
		// if we have a persisted read error, add the error class to the module.
		modSourceTemplate.err && (options.classes = options.classes ? options.classes + ' xtc-error' : 'xtc-error');

		if (annotateModules) {
			options._module = modSourceTemplate.name;
			options._file = modSourceTemplate.file;
			options._path = modSourceTemplate.path;
			options._repository = modSourceTemplate.repository;
		}

		// render the wrapper template
		html = wrapperFn(options);
	}

	// manage indentation
	if (mergedData.indent) {
		html = utils.indent(html, mergedData.indent, cfg.indentString);
	}

	return html;
}