Return JSLINT loaded from the specified file. File name is assumed to be relative to this script's directory.
540367
function requireJslint(jslintFileName) {
    /*jslint stupid: true */// JSLint doesn't like "*Sync" functions, but in this require-like function async would be overkill
    var jslintCode = bufferToScript(
        fs.readFileSync(
            path.join(__dirname, jslintFileName)
        )
    );
    /*jslint stupid: false */

    var sandbox = {};
    vm.runInNewContext(jslintCode, sandbox, jslintFileName);
    return sandbox.JSLINT;
}
835954
function parseFile(fs, file, type) {
    var filepath = file.getPath();
    var parser = file.getParser();

    if (!parser) {
        return Promise.reject(
            error.FileNotParsableError({
                filename: filepath
            })
        );
    }

    return fs.readAsString(filepath)
    .then(function(content) {
        if (type === 'readme') {
            return parser.parseReadme(content);
        } else if (type === 'glossary') {
            return parser.parseGlossary(content);
        } else if (type === 'summary') {
            return parser.parseSummary(content);
        } else if (type === 'langs') {
            return parser.parseLanguages(content);
        } else {
            throw new Error('Parsing invalid type "' + type + '"');
        }
    })
    .then(function(result) {
        return [
            file,
            result
        ];
    });
}
869616
function _loadFileAndScan(fullPath, selector) {
            var oneFileResult = new $.Deferred();

            DocumentManager.getDocumentForPath(fullPath)
                .done(function (doc) {
                    // Find all matching rules for the given CSS file's content, and add them to the
                    // overall search result
                    var oneCSSFileMatches = _findAllMatchingSelectorsInText(doc.getText(), selector, doc.getLanguage().getMode());
                    _addSelectorsToResults(resultSelectors, oneCSSFileMatches, doc, 0);

                    oneFileResult.resolve();
                })
                .fail(function (error) {
                    console.warn("Unable to read " + fullPath + " during CSS rule search:", error);
                    oneFileResult.resolve();  // still resolve, so the overall result doesn't reject
                });

            return oneFileResult.promise();
        }
251861
function loadConfigFile(configPath) {
	logger.debug('Loading configuration file at:', configPath);

	function loadConfig() {
		return fs.readFileSync(configPath, { encoding: 'utf8' });
	}

	function parseConfig(content, extension) {
		switch (extension) {
		case '.js':
			return require(configPath);

		case '.yaml':
			return jsYaml.safeLoad(content, { filename: configPath });

		case '.json':
			try {
				return JSON.parse(content);
			} catch (error) {
				// Try to provide more specific syntax errors
				lintJson(content);

				// If no syntax errors are found, throw a generic error
				throw new Error('There was a problem loading a configuration file: ' + configPath);
			}

		case '.json5':
			return JSON5.parse(content);

		default:
			throw new Error(`Configuration file is an unsupported type [${supportedTypes.join(', ')}]: ` + configPath);
		}
	}

	var extension = path.extname(configPath);
	var content;

	try {
		content = loadConfig();
	} catch (error) {
		throw new ConfigurationError('Failed to read configuration file', configPath, error);
	}

	try {
		return parseConfig(content, extension);
	} catch (error) {
		throw new ConfigurationError('Failed to parse configuration file', configPath, error);
	}
}
868470
function do_load(file, name) {
		var name = name || file;
		if(!file) throw new Error("file not defined");
		var c = do_compile(file, name);
		dust.loadSource(c);
		if(_debug) console.log("[dustfs] [" + name + "] Template loaded: " + file);
		return c;
	}
1309666
function readFile(file) {
    try {
        file = require(path.relative(__dirname, file));
    } catch (err) {
        return err;
    }

    return file;
}
1035460
function loadScript(sPath, sFilename) {
		return new Promise(function (resolve, reject) {
			var script = document.createElement('script');
			script.async = true;
			script.src = sPath + sFilename;
			script.addEventListener('load', resolve);
			script.addEventListener('error', function () {
				return reject('Error loading script: ' + sFilename);
			});
			script.addEventListener('abort', function () {
				return reject(sFilename + ' Script loading aborted.');
			});
			document.head.appendChild(script);
		});
	}
1062754
function load(file) {

    let contents = null;

    file = path.resolve(file);

    // handle .env files
    if (constants.REGEX.envfile.test(file)) {
        contents = util.parse(fs.readFileSync(file, 'utf8'));

    // handle .js/.json files
    } else {
        contents = require(file);
    }

    return env(contents);

}
715601
def load_from_file(filename):
    '''
    
    '''
    t = None
    with open(filename, 'rU') as infile:
        tdata = infile.read()
        t = Topology.unserialize(tdata)
    return t
1301514
def read_file(path, verbose=False):
    
    for filehandle in filehandles(path, verbose=verbose):
        return CTfile.load(filehandle)
140512
def load(self, file, name=None):
        """"""
        if name is None:
            name = self.format_from_extension(op.splitext(file)[1])
        file_format = self.file_type(name)
        if file_format == 'text':
            return _read_text(file)
        elif file_format == 'json':
            return _read_json(file)
        else:
            load_function = self._formats[name].get('load', None)
            if load_function is None:
                raise IOError("The format must declare a file type or "
                              "load/save functions.")
            return load_function(file)
497875
function(filename, options) {
    var input = readFile(filename),
        result = CSSLint.verify(input, gatherRules(options)),
        formatId = options.format || "text",
        messages = result.messages || [],
        exitCode = 0;

    if (!input) {
        print("csslint: Could not read file data in " + filename + ". Is the file empty?");
        exitCode = 1;
    } else {
        print(CSSLint.getFormatter(formatId).formatResults(result, filename, formatId));

        if (messages.length > 0 && pluckByType(messages, 'error').length > 0) {
            exitCode = 1;
        }
    }
    
    return exitCode;
}
168587
def load_re_from_file(filepath):
    """"""
    regexp = None
    with open(filepath,'r') as mlfile:
        flagstr = ""
        for line in mlfile:
            cleanline = re.sub("//.*$", "", line)
            if re.search("^\s*$", cleanline):
                continue
            if re.search ("^#.*$", cleanline):
                flagstr = cleanline[1:]
                continue
            if regexp is not None:
                raise Exception("Regular expression file format error")
            else:
                regexp = cleanline.rstrip('\n')
    flags = 0
    if "i" in flagstr:
        flags |= re.I
    from pydsl.grammar.definition import RegularExpression
    return RegularExpression(regexp, flags)
615641
function loadFileAsString(path, replaceWhiteSpaces){

	var file = new java.io.File(path);
	var fr = new java.io.FileReader(file);
	var br = new java.io.BufferedReader(fr);

	var line;
	var lines = "";

	while((line = br.readLine()) != null){

		if(replaceWhiteSpaces){

			lines = lines + line.replace(" ", "");

		}else{

			lines = lines + line;
		}
	}

	return lines;
}
827859
function obtainConfig(file) {
  let json;
  try {
    const jsonFile = fs.readFileSync(file);
    json = JSON.parse(jsonFile);
  } catch (err) {
    throw Error(`fail to load/parse your '${file}': ${err.message}`);
  }
  return json;
}
1163683
def load(filepath):
        '''
        
        '''

        try:
            with open(filepath, "r") as fh:
                source = fh.read()
        except Exception as e:
            return None, e
        return source, None
184719
function getNodeFromScriptFile(scriptfile) {
    if (fs.existsSync(scriptfile)) {
        try {
            return SourceNode.fromStringWithSourceMap(
                getScriptFromFile(scriptfile),
                new SourceMapConsumer(getMapFromScriptFile(scriptfile))
            );
        } catch (error) {
            console.error('getNodeFromScriptFile() error: ' + error);
            return new SourceNode();
        }
    } else {
        return new SourceNode();
    }
}