Helper function which loads the file for the specified `name` into `app.commands`.
349954
function loadCommand(name, command, silent) {
    var resource = app.commands[name];
    var usage = app.usage || [
      name
        ? 'Cannot find commands for ' + name.magenta
        : 'Cannot find commands'
    ];

    if (resource && (!command || resource[command])) {
      return true;
    }

    if (app.cli.source) {
      if (!app.cli.sourceDir) {
        try {
          var stats = fs.statSync(app.cli.source);
          app.cli.sourceDir = stats.isDirectory();
        }
        catch (ex) {
          if (app.cli.notFoundUsage) {
            showUsage(usage)
          }

          return false;
        }
      }

      try {
        if (app.cli.sourceDir) {
          app.commands[name] = require(path.join(app.cli.source, name || ''));
        }
        else {
          app.commands = common.mixin(app.commands, require(app.cli.source));
        }
        return true;
      }
      catch (err) {
        // If that file could not be found, error message should start with
        // "Cannot find module" and contain the name of the file we tried requiring.
        if (!err.message.match(/^Cannot find module/) || (name && err.message.indexOf(name) === -1)) {
          throw err;
        }

        if (!silent) {
          if (app.cli.notFoundUsage) {
            showUsage(usage);
          }
        }

        return false;
      }
    }
  }
1170048
def load(self, name, code):
        """"""

        source = "\n".join(code)
        self._objects[name] = source
622512
def load_file(self, filename):
        """"""

        self.tree_editor.load_file(filename)
        self.project_name.configure(text=filename)
        self.currentfile = filename
        self.is_changed = False
64723
def load_datafile(name, search_path, codecs=get_codecs(), **kwargs):
    
    return munge.load_datafile(name, search_path, codecs, **kwargs)
60919
def load_module(filename):
  
  basename = os.path.basename(filename)
  path = os.path.dirname(filename)
  sys.path.append(path)
  # TODO(tlan) need to figure out how to handle errors thrown here
  return __import__(os.path.splitext(basename)[0])
341623
def load(self , filename=None, data=None):
        

        self.__load(filename=filename, data=data)
149824
def do_load(self, filename):
        """"""
        try:
            self.__session.load(filename)
        except IOError as e:
            self.logger.error(e.strerror)
195610
def load(filename, **kwargs):
    
    with open(filename, 'rb') as f:
        reader = T7Reader(f, **kwargs)
        return reader.read_obj()
1030062
def call(self, name, args=None):  # type: (str, Optional[str]) -> int
        
        if args is None:
            args = ""

        args = StringArgs(args)
        command = self.application.get_command(name)

        return command.run(args, self.io)
1296779
function (name) {
    if (!grunt.file.exists(name)) { return "{}"; }

    var raw = grunt.file.read(name);
    return JSON.parse(raw.replace(/\/\/.*\n/g, ""));
  }
464611
def load(self, path, name):
        

        filename = name + '.fgic'
        filepath = aux.joinpath(path, filename)
        with zipfile.ZipFile(filepath, 'r') as containerZip:
            #Convert the zipfile data into a str object, necessary since
            #containerZip.read() returns a bytes object.
            jsonString = io.TextIOWrapper(containerZip.open('data'),
                                          encoding='utf-8'
                                          ).read()
            infoString = io.TextIOWrapper(containerZip.open('info'),
                                          encoding='utf-8'
                                          ).read()
        self.container = json.loads(jsonString, object_hook=Fgi.jsonHook)
        self.info.update(json.loads(infoString))
        self._matrixTemplate = self.info['_matrixTemplate']
        del self.info['_matrixTemplate']
515802
def load(self, name):
        

        if self.reload:
            self._maybe_purge_cache()

        template = self.cache.get(name)
        if template:
            return template

        path = self.resolve(name)
        if not path:
            raise OSError(errno.ENOENT, "File not found: %s" % name)

        with codecs.open(path, 'r', encoding='UTF-8') as f:
            contents = f.read()
            mtime = os.fstat(f.fileno()).st_mtime

        template = self.load_string(contents, filename=path)
        template.mtime = mtime
        template.path = path

        self.cache[name] = template
        return template
1279575
def load(name, base_path=None):
    """"""
    if '/' in name:
        return load_location(name, base_path, module=True)

    return importer.import_symbol(name, base_path)
787547
def load_file(self, filename):
        """"""
        with open(filename, 'r') as sourcefile:
            self.set_string(sourcefile.read())
257232
def load_file(self, filename):
        """"""
        filename = os.path.abspath(filename)

        with open(filename) as f:
            self.load_dict(yaml.load(f))

        self._loaded_files.append(filename)
124060
function loadModule(moduleName, moduleFileName, oxModulesDirPath, options) {
    var Module;
    try {
        Module = require(path.join(oxModulesDirPath, moduleFileName));
    } catch (e) {
        if (e instanceof ModuleUnavailableError) {
            logger.warn('Loading module: ' + moduleName + '. Failed to load - ' + e.message);
            return;
        } else {
            throw e;
        }
    }

    var mod = new Module(options, ctx, resultStore, logger);

    // load external commands
    var cmdDir = path.join(oxModulesDirPath, 'module-' + moduleName, 'commands');
    if (fs.existsSync(cmdDir)) {
        var commandName = null;
        try {
            var files = fs.readdirSync(cmdDir);
            for (var fileName of files) {
                commandName = fileName.slice(0, -3);
                if (commandName.indexOf('.') !== 0) {   // ignore possible hidden files (i.e. starting with '.')
                    var cmdFunc = require(path.join(cmdDir, commandName));
                    // bind function's "this" to module's "this"
                    var fnc = cmdFunc.bind(mod._this || mod);
                    mod[commandName] = fnc;
                    // since commands have access only to _this, reference all
                    // commands on it, so commands could have access to each other.
                    // note that command defined in the main module won't be referenced.
                    mod._this[commandName] = fnc;
                }
            }
        } catch (e) {
            logger.error("Can't load command '" + commandName + ': ' + e.message);
            logger.debug(e.stack);
        }
    }

    // apply this for functions inside 'helpers' methods collection if found
    if (mod.helpers || (mod._this && mod._this.helpers)) {
        var helpers = mod.helpers || mod._this.helpers;
        for (var funcName in helpers) {
            if (typeof helpers[funcName] === 'function') {
                helpers[funcName] = helpers[funcName].bind(mod._this || mod);
            }
        }
    }

    logger.debug('Loading module: ' + moduleName);
    modules[moduleName] = sandbox[moduleName] = global.ox[moduleName] = moduleWrapper(moduleName, mod, resultStore);
}
307470
def load(self, filename):
        """"""
        content = open(filename)
        return Config(json.load(content))