console.log('in t7_calibration_operations.js getDeviceCalibrationStatus');
326252
function(msg) {
        var errFunc = function(err) {
            console.log('in getDeviceCalibrationStatus, error', err, msg);
            defered.reject(err);
        };
        return errFunc;
    }
65979
function(error) {
        if (connectError) {return;}
        if (error) {
          var err = {code:'CONNECT_ERROR', err: error};
          connectError = true;
          logger.error('start', err);
          return callback(err);
        }
        for (var name1 in t.monitors) {
          if (!t.monitors[name1].isConnected()) {
            return;
          }
        }
        t.set({started:true});
        t.connectListeners(true);
        callback();
      }
85599
async function checkNewVersion() {
    try {
        const file = path.join(constants.GLOBAL_DIR, constants.GLOBAL_INFO);

        // If it does not exist, create it.
        if (!fs.existsSync(file)) {
            createFile({
                name: file,
                source: `{"lastCheckForUpdate": 0}\n`,
            });
        }

        // Read info file
        const json = fs.readJsonSync(file, 'utf8');
        const lastCheckForUpdate = json.lastCheckForUpdate;

        // Show update message
        if (lastCheckForUpdate + (6 * 3600 * 1000) < Date.now()) {
            const latestVersion = await request(`${constants.FIREBASE_DATABASE_URL}/version/cli/latest.json`);
            if (latestVersion && latestVersion !== 'null' && latestVersion !== `"${pjson.version}"`) {
                const scale = pjson.version.length + latestVersion.length - 10;

                console.log();
                console.log(`${`   ┏`.yellow}${`─`.repeat(scale + 45).yellow}${`┓`.yellow}`);
                console.log(`${`   │`.yellow}${` `.repeat(scale + 45)}${`│`.yellow}`);
                console.log(`${`   │`.yellow}${`      Update available ${pjson.version} -> `}${`${latestVersion}`.green}${`        │`.yellow}`);
                console.log(`${`   │`.yellow}${`  Run `}${`npm i -g google-apps-script`.red}${` to update`}${` `.repeat(scale + 2)}${`│`.yellow}`);
                console.log(`${`   │`.yellow}${` `.repeat(scale + 45)}${`│`.yellow}`);
                console.log(`${`   ┗`.yellow}${`─`.repeat(scale + 45).yellow}${`┛`.yellow}`);
                console.log();
            }

            // Update lastCheckForUpdate
            json.lastCheckForUpdate = Date.now();
            createFile({
                name: file,
                source: JSON.stringify(json),
            });
            return true;
        }
        return false;
    } catch (err) {
        err.origin = 'checkNewVersion';
        await error.log(err);
        return false;
    }
}
1239385
function logInfo () {
	console.log(`Running on node ${process.version} with ${os.cpus()[0].model} x ${os.cpus().length}`);
	console.log('');
	console.log('Testing:');

	var columns = columnsCreate(['name', 'version', 'homepage']);

	var infoStatic = require('serve-static/package.json');
	infoStatic.version = 'v' + infoStatic.version;
	columnsUpdate(columns, infoStatic);

	var infoStatique = require('statique/package.json');
	infoStatique.version = 'v' + infoStatique.version;
	columnsUpdate(columns, infoStatique);

	var infoFiles = require('../package.json');
	infoFiles.version = 'v' + infoFiles.version;
	columnsUpdate(columns, infoFiles);

	console.log('- ' + columnsText(columns, infoStatic));
	console.log('- ' + columnsText(columns, infoStatique));
	console.log('- ' + columnsText(columns, infoFiles));
	console.log('');

	function columnsCreate (names) {
		return names.map(name => {
			return {size: 0, source: name};
		});
	}

	function columnsUpdate (columns, info) {
		var size;
		var col;
		for (var i = 0; i < columns.length; i++) {
			col = columns[i];
			size = (info[col.source] && info[col.source].length) || 0;
			if (info[col.source] && (size = info[col.source].length) && size > col.size) {
				col.size = size;
			}
		}
	}

	function columnsText (columns, info) {
		var result = '';

		for (var i = 0; i < columns.length; i++) {
			result += columnText(columns[i], info);
			result += ' ';
		}

		return result + ' ';
	}

	function columnText (column, info) {
		var value = info[column.source] || '';
		var padSize = column.size - value.length;
		var pad = '';

		if (padSize) {
			pad += (new Array(padSize + 1)).join(' ');
		}

		return value + pad;
	}
}
549926
function(interval, callback) {
    if (lookupIntervalId) {
      return;
    }

    isRunning = true;

    if (!callback && _.isFunction(interval)) {
      callback = interval;
      interval = null;
    }

    interval = interval || 500;

    globalSerialDeviceLoader.trigger(function(err) {
      var triggering = false;
      lookupIntervalId = setInterval(function() {
        if (triggering) return;
        triggering = true;
        globalSerialDeviceLoader.trigger(function() {
          triggering = false;
        });
      }, interval);

      if (err && !err.name) {
        err = new Error(err);
      }
      if (callback) { callback(err); }
    });
  }
981578
function() {

			// version check => only if minVersion is available a warning
			// will be logged and the debug mode is turned on
			// TODO: enhance version check also for libraries and components
			var sMinUI5Version = this.getEntry("/sap.ui5/dependencies/minUI5Version");
			if (sMinUI5Version &&
				Log.isLoggable(Log.Level.WARNING) &&
				sap.ui.getCore().getConfiguration().getDebug()) {
				sap.ui.getVersionInfo({async: true}).then(function(oVersionInfo) {
					var oMinVersion = getVersionWithoutSuffix(sMinUI5Version);
					var oVersion = getVersionWithoutSuffix(oVersionInfo && oVersionInfo.version);
					if (oMinVersion.compareTo(oVersion) > 0) {
						Log.warning("Component \"" + this.getComponentName() + "\" requires at least version \"" + oMinVersion.toString() + "\" but running on \"" + oVersion.toString() + "\"!");
					}
				}.bind(this), function(e) {
					Log.warning("The validation of the version for Component \"" + this.getComponentName() + "\" failed! Reasion: " + e);
				}.bind(this));
			}

		}
1171280
function(r, callback) {
      result = r || {};

      RunUtil.displayScriptData(grunt, result);
      RunUtil.displayScriptOutput(grunt, outputs, result);

      try {
        RunUtil.checkRunScriptResult(result, method);
      } catch(e) {
        CommonUtil.header(grunt, 'VALIDATION:', 'red');
        grunt.fail.fatal(e);
      }
      callback();
    }
221850
function () {
/*Line 41 - 'AtomItemsControl.js' */                if (!this._valueSeparator)
/*Line 42 - 'AtomItemsControl.js' */                    return;
/*Line 43 - 'AtomItemsControl.js' */                if (!this._valuePath)
/*Line 44 - 'AtomItemsControl.js' */                    return;
/*Line 45 - 'AtomItemsControl.js' */                var list = [];
/*Line 46 - 'AtomItemsControl.js' */                var vp = this._valuePath;
/*Line 47 - 'AtomItemsControl.js' */                var vfp = function (item) {
/*Line 48 - 'AtomItemsControl.js' */                    return item[vp];
/*Line 49 - 'AtomItemsControl.js' */                };
/*Line 50 - 'AtomItemsControl.js' */                var ae = Atom.query(this.get_dataItems());
/*Line 51 - 'AtomItemsControl.js' */                while (ae.next()) {
/*Line 52 - 'AtomItemsControl.js' */                    list.push( vfp( ae.current()));                    
/*Line 53 - 'AtomItemsControl.js' */                }
/*Line 54 - 'AtomItemsControl.js' */                return list.join(this._valueSeparator);
/*Line 55 - 'AtomItemsControl.js' */            }
1029206
function getPerformOpenAllScanMethod(bundle) {
        return function performOpenAllScanMethod(scanMethod, cb) {
            debugOpenAll('in performOpenAllScanMethod');
            var scanIterations = [];
            var numAttempts = scanMethod.numAttempts;
            for(var i = 0; i < numAttempts; i++) {
                scanIterations.push(scanMethod);
            }

            var performAsync = scanMethod.async;

            function finishedScanning() {
                debugOpenAll('Finished performing scanMethod...');
                // We are finished scanning...
                debugOpenAll(
                    'Finished performing openAll scans, sm:',
                    scanMethod.deviceType,
                    scanMethod.connectionType
                );
                cb();
            }

            if(performAsync) {
                async.each(
                    scanIterations,
                    getPerformOpenAllScanIteration(bundle),
                    finishedScanning
                );
            } else {
                async.eachSeries(
                    scanIterations,
                    getPerformOpenAllScanIteration(bundle),
                    finishedScanning
                );
            }
        }
    }
550053
function helpCli() {
	console.log('');
	console.log('usage: node <script> [--version] [--help] <command> [<args>]');
	console.log('usage with demo: node demo/index.js [--version] [--help] <command> [<args>]');
	console.log('');
	console.log('node-mock-server commands:');
	console.log('    --version            print node-mock-server version');
	console.log('    swagger-import       run a swagger import');
	console.log('    validate             run a validation for all mock data');
	console.log('    collections          lists all available collections');
	console.log('    collections <id>     activate collection');
	console.log('');
}
1170676
function checkNpm () {
  /**
   * CI 环境下不执行，不然单元测试会报错，系统测试前会单独检测并升级 npm
   */
  if (process.env.CI) {
    return
  }

  const { npmVersion, npmLifecycleVersion, pass } = npmVersions

  info(
    `npm version: ${npmVersion}`,
    `npm-lifecycle version: ${npmLifecycleVersion || '-'}`
  )

  if (!pass) {
    error(
      'elint 在当前的 npm 版本下无法正常运行，请升级 npm 后再安装',
      '更多信息请访问：http://t.cn/Rg7xvP0'
    )

    process.exit(1)
  }
}
308481
def getControllerRoleForTrackedDeviceIndex(self, unDeviceIndex):
        """"""

        fn = self.function_table.getControllerRoleForTrackedDeviceIndex
        result = fn(unDeviceIndex)
        return result
837258
function checkDeviceValue() {
    		debug('Checking Device Value');
    		self.iRead(context.register)
    		.then(function(res) {
    			var val = res.val;
    			var sandbox = {
    				'x': val,
    			};
    			var scriptContext = new vm.createContext(sandbox);
    			var result = context.script.runInContext(scriptContext);
    			if(result) {
    				reportResult(res, result, 'resolve');
    			} else {
    				performRetry(res, result);
    			}
    		}, function(err) {
    			errorLog('Error...', err);
    		});
    	}
861424
function (i2copts_arg) {
    var i2copts;
    var raspi_check;
    if (typeof i2copts_arg === 'undefined') {
        i2copts = {device: '/dev/i2c-1'};
        raspi_check = raspi_i2c_devname();
        if (raspi_check !== '') {
            //console.log('Raspberry Pi I2C device name is: ', raspi_check);
            i2copts.device = raspi_check;
        }
    }
    else {
        i2copts = i2copts_arg;
        if ((typeof i2copts.device === 'undefined') || (i2copts.device === '')) {
            raspi_check = raspi_i2c_devname();
            if (raspi_check !== '') {
                //console.log('Raspberry Pi I2C device name is: ', raspi_check);
                i2copts.device = raspi_check;
            }
        }
    }
    //console.log('i2c options: ', i2copts);
    this.i2c        = new i2c(HTU21D_I2CADDR, i2copts);
}
240346
function(viewPort) {
					if (!that.hasValue()) return 0;
					var s = that.value+'';
					if (s.match(/em$/)) return that.numValue() * this.EM(viewPort);
					if (s.match(/ex$/)) return that.numValue() * this.EM(viewPort) / 2.0;
					if (s.match(/px$/)) return that.numValue();
					if (s.match(/pt$/)) return that.numValue() * 1.25;
					if (s.match(/pc$/)) return that.numValue() * 15;
					if (s.match(/cm$/)) return that.numValue() * this.DPI(viewPort) / 2.54;
					if (s.match(/mm$/)) return that.numValue() * this.DPI(viewPort) / 25.4;
					if (s.match(/in$/)) return that.numValue() * this.DPI(viewPort);
					if (s.match(/%$/)) return that.numValue() * svg.ViewPort.ComputeSize(viewPort);
					return that.numValue();
				}
668196
function outputData()
{
    sensor.update();

    var floatData = sensor.getEulerAngles();
    console.log("Euler: Heading: " + floatData.get(0)
                + " Roll: " + floatData.get(1)
                + " Pitch: " + floatData.get(2)
                + " degrees");

    floatData = sensor.getQuaternions();
    console.log("Quaternion: W: " + floatData.get(0)
                + " X:" + floatData.get(1)
                + " Y: " + floatData.get(2)
                + " Z: " + floatData.get(3));

    floatData = sensor.getLinearAcceleration();
    console.log("Linear Acceleration: X: " + floatData.get(0)
                + " Y: " + floatData.get(1)
                + " Z: " + floatData.get(2)
                + " m/s^2");

    floatData = sensor.getGravityVectors();
    console.log("Gravity Vector: X: " + floatData.get(0)
                + " Y: " + floatData.get(1)
                + " Z: " + floatData.get(2)
                + " m/s^2");

    console.log("");
}
1331753
function(){
		if(initialised)
			return isnode;
		if(package && package.name && package.version)
			console.log("\n" + package.name + " v" + package.version + "\n");

		if(config && config.loader && config.loader.startupModules && config.loader.startupModules.length > 0) {
			for (var i = 0; i < config.loader.startupModules.length; i++) {
				var startMod = "isnode-mod-"+config.loader.startupModules[i];
				loadModule(startMod);
			}
		} else {
			isnode.shutdown();
			return;
		}
		if(!modules.logger || !modules.logger.log){
			if(!modules.logger)
				modules.logger = {};
			modules.logger.log = function(level, message, data){
				var currentDate = new Date();
				currentDate = currentDate.toISOString();
				console.log(currentDate + " (" + level + ") " + message);
			}
			modules.logger.log("warning", "Logger module not loaded. Using stub method.");
		}
		isnode.on("listenForExit", function(){
			var stdin = process.openStdin();
			stdin.setRawMode(true); 
			stdin.setEncoding('utf8');
			stdin.on('data', function(chunk) {
					if(chunk == "e")
						isnode.shutdown();
			});
		});
		var started = false;
		var loadListener = function(){
			isnode.removeListener("loadDependencies", loadListener);
			loadDependencies(); 
			started = true;
		}
		isnode.on("loadDependencies", loadListener); 
		var counter = 0;
		if(config.loader.timeouts.loadDependencies)
			var timeout = config.loader.timeouts.loadDependencies;
		else
			var timeout = 5000;
		var interval = setInterval(function(){
			if(started == true){
				clearInterval(interval);
			}
			if(counter >= timeout) {
				modules.logger.log("startup","ISNode System > Timed out initiating startup. Terminating application server.");
				clearInterval(interval);
				isnode.shutdown();
			}
			counter += 500;
		}, 500);
		initialised = true;
		return isnode;
	}