***private functions for internal use only****** to check weather path b is subset of path a
192108
function matchPath(a, b) {
        var regex = new RegExp('^' + a.join('~~'), 'i');
        return regex.test(b.join('~~'));
    }
992503
function findPathIndexInArray(array, path) {
  for(var i = 0; i < array.length; i++) {
    if(array[i].path === path) {
      return i;
    }
  }

  return -1;
}
407736
function booleanEnvTrace(condition) {
    var conditionObj = parseCondition(condition);

    if (conditionObj.negate)
      return traceCondition(conditionalComplement(condition), false);
    else
      return traceCondition(condition, true);
  }
175127
function getTemperatureIn(where, callback) {
  var options = {
    host: 'api.openweathermap.org',
    path: '/data/2.5/weather?q=' + where
  };

  // perform an asynchronous action inside a timeout
  http.get(options, function(res) {
    var body = '';
    res.on('data', function(chunk) {
      body += chunk;
    });
    res.on('end', function() {
      var data = JSON.parse(body);
      var tempK = data.main.temp;
      var tempC = tempK - 273.15;
      callback(null, Math.round(tempC * 100) / 100);
    });
  }).on('error', callback);
}
1121077
function isPathPartial(fs, path, callback) {
  hasAttr(fs, path, constants.attributes.partial, callback);
}
414312
function checkPath(expected, actual){
    if(!expected && expected !== ""){
        return;
    }
    if(actual.toLowerCase() !== expected.toLowerCase()){
        return {
            error: "Url paths are not equal",
            actual: actual,
            expected: expected,
            showDiff: true
        };
    }
}
1189302
function _checkPath (npmPath) {
  return new Promise((resolve, reject) => {
    if (npmPath) {
      fs.lstat(npmPath, (err, stats) => {
        if (err || !stats || (stats.isDirectory && !stats.isDirectory())) {
          reject(new Error(strings.givenPathNotValid(npmPath)))
        } else {
          resolve({
            path: npmPath,
            message: strings.givenPathValid(npmPath)
          })
        }
      })
    } else {
      reject(new Error('Called _checkPath() with insufficient parameters'))
    }
  })
}
977950
function _checkCircular (opts, obj) {
  var key
  if (util.isObject(obj)) {
    if (~opts._visited.indexOf(obj)) {
      return true
    }
    opts._visited.push(obj)
    for (key in obj) {
      if (obj.hasOwnProperty(key) && _checkCircular(opts, obj[key])) {
        return true
      }
    }
  }
  return false
}
256748
private boolean checkAppPathsForVia(Set<String> keySet, List<String> errors) {
        for (String key : keySet) {
            if (!key.equals("defaultKey")) {
                File file = new File(key);
                if (!file.exists()) {
                    errors.add("Effective Usage Analysis will not run if the -appPath parameter references an invalid file path. Check that the -appPath parameter specifies a valid path");
                    return false;
                } else if (!file.isFile()) {
                    errors.add("Effective Usage Analysis will not run if the -appPath parameter references an invalid file path. Check that the -appPath parameter specifies a valid path");
                    return false;
                } else {
                    return true;
                }
            }
        }
        return false;
    }
287781
function isValidPath(path) {
  if (path === null || path === undefined) return false;
  return typeof path === 'string' && path.length > 0;
}
559242
function (a, b) {
            var other = false;
            Y.some(a, function (i, k) {
                if ((i.itemtype === b.itemtype) && (i.name === b.name)) {
                    other = k;
                    return true;
                }
            });
            return other;
        }
1115068
function ensurePathsExist(pathsList, cb) {
	async.eachLimit(pathsList, 10, function (pathItem, callback) {
		var absolutePath = path.resolve(pathItem);
		fs.stat(absolutePath, function (error, stats) {
			if (error) {
				return callback(new Error('Path does not exist: ' + absolutePath));
			}

			if (!stats.isDirectory()) {
				return callback(new Error('Path is not a directory: ' + absolutePath));
			}

			return callback();
		});
	}, cb);
}
935333
function(a, b, aParent, bParent, prop, compares, options){
		if(typeof compares === "function") {
			var compareResult = compares(a, b, aParent, bParent, prop, options);
			if(typeof compareResult === "boolean") {
				return compareResult;
			} else if(compareResult && typeof compareResult === "object"){
				if( compareResult.getSubset ) {
					if(h.indexOf.call(options.getSubsets, compareResult.getSubset) === -1) {
						options.getSubsets.push(compareResult.getSubset);
					}
				}
				if(compareResult.intersection === h.ignoreType || compareResult.difference === h.ignoreType) { // as in the case of a sort props
					return true;
				}
				// A \ B subset intersects in both directions
				// but does not diff from
				if( ("intersection" in compareResult) && !("difference" in compareResult)) {
					var reverseResult =  compares(b, a,bParent, aParent, prop, options);
					return ("intersection" in reverseResult);
				}
				return false;
			}
			return compareResult;
		}
	}
93131
function(p, cb)
{
  //Get the status of the path
  return fs.stat(p, function(error, stat)
  {
    //Check the error
    if(error)
    {
      //Check the error code
      if(error.code !== 'ENOENT')
      {
        //Do the callback with the error
        return cb(error, false, stat);
      }
      else
      {
        //Do the callback without error
        return cb(null, false, stat);
      }
    }

    //Do the callback with the stat
    return cb(null, true, stat);
  });
}
1046559
function(path, callback){

        fs.exists(path, function(exists){
            if (exists) {
                fs.lstat(path, function(err, stats){
                    if (err) console.error(err.stack);

                    if ( stats.isSymbolicLink() ) fs.unlink(path, function(err){
                        if (err) {
                            console.error(err.stack);
                            callback(err)
                        } else {
                            //Trigger.
                            onSymlinkRemoved(self.paths, function(err){
                                if (err) console.error(err.stack);

                                callback(false)
                            })
                        }
                    })
                })
            } else {
                //log & ignore. This is not a real issue.
                //logger.warn('gina', 'UTILS:CONFIG:WARN:1', 'Path not found: ' + path, __stack);
                console.warn( 'Path not found: ' + path, __stack);
                onSymlinkRemoved(self.paths, function(err){
                    //if (err) logger.error('gina', 'UTILS:CONFIG:ERR:9', err, __stack);
                    if (err) console.error(err.stack||err.message);

                    callback(false)
                })
            }
        })
    }
155094
def check(a, b):
    
    aencrypt = encrypt(a)
    bencrypt = encrypt(b)

    return a == b or a == bencrypt or aencrypt == b
368051
function byName(a, b) {
  if (a === INDEX_FILE) {
    return a === b ? 0 : -1;
  }
  if (b === INDEX_FILE) {
    return 1;
  }
  return a.toLowerCase().localeCompare(b.toLowerCase());
}