Checks whether the modules in the specified file path need
        to be reparsed because the file was changed since it was
        last loaded.
349023
def _check_parse_modtime(self, filepath, fname):
        """"""       
        #We also want to perform a reparse if the XML documentation file for the
        #module changed, since the docs are also cached.
        file_mtime = self._get_mod_mtime(filepath)
        
        #If we have parsed this file and have its modules in memory, its
        #filepath will be in self._parsed. Otherwise we can load it from
        #file or from a cached pickle version.
        if filepath.lower() in self._parsed: 
            #Get the name of the first module in that file from the modulefiles
            #list. Find out when it was last modified.
            module_mtime = None
            if fname in self._modulefiles:
                if len(self._modulefiles[fname]) == 0:
                    msg.warn("Module file {} has no modules defined inside of it!".format(fname))
                    return None
                
                modulename = self._modulefiles[fname][0]
                if modulename in self.modules:
                    #Make sure that if there are modules with the same name but different
                    #files, that we are working with the correct one.
                    if filepath.lower() != self.modules[modulename].filepath:
                        msg.warn("module {} parsed ".format(modulename) + 
                                 "from {}, not {}".format(self.modules[modulename].filepath,
                                                          filepath))
                    module_mtime = self.modules[modulename].change_time

            if module_mtime is not None:
                if module_mtime < file_mtime:
                    #The file has been modified since we reloaded the module.
                    #Return the two times we used for the comparison so the
                    #module file can be reloaded.
                    return [module_mtime, file_mtime]
                else:
                    return None
        else:
            #The file has never been parsed by this CodeParser. We can
            #either do a full parse or a pickle load.
            return [file_mtime]
509107
def unload_module(self, path):
        '''

        '''
        with self._mutex:
            if self._obj.unload_module(path) != RTC.RTC_OK:
                raise FailedToUnloadModuleError(path)
1148532
function(refPath) {
		var require = function(relModuleId) {
			var moduleId = resolveModuleId(relModuleId, refPath),
				module = getModule(moduleId);

			if (!module) {
				throw "Module not loaded";
			}
			else if (module.error) {
				throw "Error loading module";
			}

			if (!module.exports) {
				module.exports = {};
				var moduleDir = moduleId.substring(0, moduleId.lastIndexOf('/')+1),
					injects = module.injects,
					args = [];

				for (var i = 0, n = injects.length; i<n; i++) {
					if (injects[i] == 'require') {
						args.push(createRequireFunc(moduleDir));
					}
					else if (injects[i] == 'exports') {
						args.push(module.exports);
					}
					else if (injects[i] == 'module') {
						args.push(module.module);
					}
				}

				module.factory.apply(null, args);
			}
			return module.exports;
		};

		require.ensure = function(deps, cb) {
			ensureImpl(deps, cb, refPath);
		};

		if (_mainProgram != null) {
			require.main = getModule(_mainProgram).module;
		}

		return require;
	}
259197
function fileExists(file_path) {
  try {
    var stats = fs.statSync(file_path);
    if (stats.isFile()) {
      return true;
    }
  } catch (e) {
  }
  return false;
}
877749
def _EnsureFileExists(self):
        """"""
        if not os.path.exists(self._filename):
            old_umask = os.umask(0o177)
            try:
                open(self._filename, 'a+b').close()
            except OSError:
                return False
            finally:
                os.umask(old_umask)
        return True
1294101
def has_file_changed(directory, checksums, filetype='genbank'):
    """"""
    pattern = NgdConfig.get_fileending(filetype)
    filename, expected_checksum = get_name_and_checksum(checksums, pattern)
    full_filename = os.path.join(directory, filename)
    # if file doesn't exist, it has changed
    if not os.path.isfile(full_filename):
        return True

    actual_checksum = md5sum(full_filename)
    return expected_checksum != actual_checksum
1179862
def changed_path(self):
        ""
        result = None  # default
        for path in self.paths_to_modification_times:
            lastmod = self.paths_to_modification_times[path]
            mod = os.path.getmtime(path)
            if mod > lastmod:
                result = "Watch file has been modified: " + repr(path)
            self.paths_to_modification_times[path] = mod
        for folder in self.folder_paths:
            for filename in os.listdir(folder):
                subpath = os.path.join(folder, filename)
                if os.path.isfile(subpath) and subpath not in self.paths_to_modification_times:
                    result = "New file in watched folder: " + repr(subpath)
                    self.add(subpath)
        if self.check_python_modules:
            # refresh the modules
            self.add_all_modules()
        if self.check_javascript:
            self.watch_javascript()
        return result
1132747
private void checkFileReopening(FileObject fileObject, boolean addToHistory) throws FilerException {
        for(FileObject veteran : fileObjectHistory) {
            if (fileManager.isSameFile(veteran, fileObject)) {
                if (lint)
                    log.warning("proc.file.reopening", fileObject.getName());
                throw new FilerException("Attempt to reopen a file for path " + fileObject.getName());
            }
        }
        if (addToHistory)
            fileObjectHistory.add(fileObject);
    }
72319
function (options, iterationInfo, modules) {
        // filename filter
        if (options.fileNameFilter) {
            var match = iterationInfo.fileName.match(options.fileNameFilter);
            if (!match) {
                return;
            }
        }

        // Filter spec.js files
        var match = iterationInfo.fileName.match(/.spec.js/i);
        if (match) {
            return;
        }

        // relative path filter
        if (options.relativePathFilter) {
            var pathMatch = iterationInfo.relativeFullPath.match(options.relativePathFilter);
            if (!pathMatch)
                return;
        }

        //load module
        loadModule(modules, options, iterationInfo);
    }
265940
function reload(moduleName) {
    var id = require.resolve(moduleName);
    var mod = require.cache[id];
    if (mod) {
        var base = path.dirname(mod.filename);
        // expunge each module cache entry beneath this folder
        var stack = [mod];
        while (stack.length) {
            var mod = stack.pop();
            if (beneathBase(mod.filename)) {
                delete require.cache[mod.id];
            }
            stack.push.apply(stack, mod.children);
        }
    }

    // expunge each path cache entry beneath the folder
    for (var cacheKey in module.constructor._pathCache) {
        if (cacheKey.indexOf(moduleName) > 0 && beneathBase(cacheKey)) {
            delete module.constructor._pathCache[cacheKey];
        }
    }

    // re-require the module
    return require(moduleName);

    function beneathBase(file) {
        return base === undefined
            || (file.length > base.length
                && file.substr(0, base.length + 1) === base + path.sep);
    }
}
813006
def _load_all(self):
        '''
        
        '''
        with self._lock:
            for name in self.file_mapping:
                if name in self.loaded_files or name in self.missing_modules:
                    continue
                self._load_module(name)

            self.loaded = True
689050
def in_path(self, new_path, old_path=None):
        """"""
        self.path = new_path
        try:
            yield
        finally:
            self.path = old_path
74885
function ensure(files, options) {
    // Update the global array of represented modules
    unused = filterRepresented(unused, files, options)

    verbose.writeln('Unrepresented modules list currently at ', unused)

    // Only print message when all targets have been run
    if (++numRuns === getNumTargets()) {
      if (unused.length) {
        if (options.report) {
          log.writeln('\nPackages left out:')
          log.writeln(unused.join('\n'))
        }
      } else if (options.report) {
        log.ok('All modules have something copied.')
      }
    }
  }
1254266
def check_file_path(self, path):
        
        if os.path.exists(path) is not True:
            msg = "File Not Found {}".format(path)
            raise OSError(msg)
1166923
def remover(file_path):
    """"""
    if os.path.isfile(file_path):
        os.remove(file_path)
        return True
    elif os.path.isdir(file_path):
        shutil.rmtree(file_path)
        return True
    else:
        return False
1204675
def run_on_changes(paths)
      specs = Inspector.clean(paths)
      return false if specs.empty?

      specs += self.rerun_specs if options[:keep_failed]

      # RSpec reloads the files, so reload only non spec files
      (paths - specs).each { |path| Reloader.reload_file(path) }

      passed, failed_examples, passed_examples = Runner.run(specs, options)

      self.rerun_specs += failed_examples
      self.rerun_specs -= passed_examples

      run_all if passed && !self.last_run_passed && options[:all_after_pass]

      self.last_run_passed = passed

      throw :task_has_failed unless passed
    end
843438
def reparse(self, filepath):
        """"""
        #The easiest way to do this is to touch the file and then call
        #the regular parse method so that the cache becomes invalidated.
        self.tramp.touch(filepath)
        self.parse(filepath)