Loads a zmx file into the DDE server
975729
def zLoadFile(self, fileName, append=None):
        """"""
        reply = None
        if append:
            cmd = "LoadFile,{},{}".format(fileName, append)
        else:
            cmd = "LoadFile,{}".format(fileName)
        reply = self._sendDDEcommand(cmd)
        if reply:
            return int(reply) #Note: Zemax returns -999 if update fails.
        else:
            return -998
532408
def load_data(path:PathOrStr, file:PathLikeOrBinaryStream='data_save.pkl', bs:int=64, val_bs:int=None, num_workers:int=defaults.cpus,
              dl_tfms:Optional[Collection[Callable]]=None, device:torch.device=None, collate_fn:Callable=data_collate,
              no_check:bool=False, **kwargs)->DataBunch:
    ""
    source = Path(path)/file if is_pathlike(file) else file
    ll = torch.load(source, map_location='cpu') if defaults.device == torch.device('cpu') else torch.load(source)
    return ll.databunch(path=path, bs=bs, val_bs=val_bs, num_workers=num_workers, dl_tfms=dl_tfms, device=device,
                        collate_fn=collate_fn, no_check=no_check, **kwargs)
205511
private function createDatagridFiles() {
        $db = \Cityware\Db\Factory::factory('zend');
        $tableMetadata = new \Zend\Db\Metadata\Metadata($db->getAdapter());
        $tableInfo = $tableMetadata->getTable($this->getTable(), $this->getSchema());

        $iniFile = $this->genConfigDatagridIni();
        $iniFile .= $this->genFieldsDatagridIni($tableInfo);

        $translateFile = $this->genTranslateDatagridArray($tableInfo);

        $moduleName = ucfirst($this->getModule());
        $moduleNameLower = strtolower($this->getModule());

        try {
            if (!empty($this->datagridName)) {
                file_put_contents($this->dstIniDirectory . $this->datagridName . '.ini', $iniFile);
                chmod($this->dstIniDirectory . $this->datagridName . '.ini', 0777);

                file_put_contents($this->dstTranslateDirectory . $this->datagridName . '.php', $translateFile);
                chmod($this->dstTranslateDirectory . $this->datagridName . '.php', 0777);

                $datagrid_template_phtml = file_get_contents($this->srcTemplateDirectory . 'Template_Datagrid_Index.tmpl');
                $datagridTemplatePhtml = str_replace("%moduleName%", $moduleName, str_replace("%moduleNameLower%", $moduleNameLower, $datagrid_template_phtml));
                file_put_contents($this->dstViewDirectory . $this->datagridName . '.phtml', $datagridTemplatePhtml);
                chmod($this->dstViewDirectory . $this->datagridName . '.phtml', 0644);
            } else {
                file_put_contents($this->dstIniDirectory . 'datagrid.ini', $iniFile);
                chmod($this->dstIniDirectory . 'datagrid.ini', 0777);

                file_put_contents($this->dstTranslateDirectory . 'datagrid.php', $translateFile);
                chmod($this->dstTranslateDirectory . 'datagrid.php', 0777);

                $datagrid_template_phtml = file_get_contents($this->srcTemplateDirectory . 'Template_Datagrid_Index.tmpl');
                $datagridTemplatePhtml = str_replace("%moduleName%", $moduleName, str_replace("%moduleNameLower%", $moduleNameLower, $datagrid_template_phtml));
                file_put_contents($this->dstViewDirectory . 'index.phtml', $datagridTemplatePhtml);
                chmod($this->dstViewDirectory . 'index.phtml', 0644);

                $datagrid_template_trash = file_get_contents($this->srcTemplateDirectory . 'Template_Datagrid_Trash.tmpl');
                $datagridTemplateTrash = str_replace("%moduleName%", $moduleName, str_replace("%moduleNameLower%", $moduleNameLower, $datagrid_template_trash));
                file_put_contents($this->dstViewDirectory . 'trash.phtml', $datagridTemplateTrash);
                chmod($this->dstViewDirectory . 'trash.phtml', 0644);
            }
        } catch (Exception $exc) {
            throw new Exception('Não foi possivel criar o arquivo de configuração do Datagrid! <br />' . $exc->getMessage(), 500);
        }
    }
942175
public void loadModel(String modelfile) throws IOException,
			ClassNotFoundException {
		ObjectInputStream instream = new ObjectInputStream(new GZIPInputStream(
				new FileInputStream(modelfile)));
		factory = (AlphabetFactory) instream.readObject();
		models = (Linear[]) instream.readObject();
		instream.close();
		IFeatureAlphabet features = factory.DefaultFeatureAlphabet();
		features.setStopIncrement(true);
	}
354829
public static ZMsg load(DataInputStream file)
    {
        if (file == null) {
            return null;
        }
        ZMsg rcvMsg = new ZMsg();

        try {
            int msgSize = file.readInt();
            if (msgSize > 0) {
                int msgNbr = 0;
                while (++msgNbr <= msgSize) {
                    int frameSize = file.readInt();
                    byte[] data = new byte[frameSize];
                    file.read(data);
                    rcvMsg.add(new ZFrame(data));
                }
            }
            return rcvMsg;
        }
        catch (IOException e) {
            return null;
        }
    }
142410
def load(filename):
        
        # parse a zipped file
        if zipfile.is_zipfile(filename):
            zfile = zipfile.ZipFile(filename, 'r')
            try:
                xml = ElementTree.fromstring(zfile.read('scaffold.xml'))
            except StandardError:
                logger.exception('Failed to load scaffold: {0}'.format(filename))
                zfile.close()
                return None
            zfile.close()

        # parse a standard xml file
        else:
            try:
                xml = ElementTree.parse(filename).getroot()
            except StandardError:
                logger.exception('Failed to load scaffold: {0}'.format(filename))
                return None

        # generate a scaffold
        scaffold = Scaffold()
        scaffold.setSource(filename)
        scaffold.setName(xml.get('name', 'Missing'))
        scaffold.setGroup(xml.get('group', 'Default'))
        scaffold.setLanguage(xml.get('lang', 'Python'))
        scaffold.setIcon(xml.get('icon', ''))

        # define properties
        xprops = xml.find('properties')
        if xprops is not None:
            for xprop in xprops:
                scaffold.addProperty(Property.fromXml(xprop))

        return scaffold
980254
public void loadFrom(String modelfile) throws IOException,
	ClassNotFoundException {
		ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(
				new GZIPInputStream(new FileInputStream(modelfile))));
		templets = (TempletGroup) in.readObject();
		cl = (Linear) in.readObject();
		in.close();
	}
45753
def load(path)
      ptr = CZMQ::FFI::Zconfig.load(path.to_s)
      return from_ffi_delegate(ptr) unless ptr.null?
      CZTop::HasFFIDelegate.raise_zmq_err(
        "error while reading the file %p" % path.to_s)
    end
1279303
def load_drp(self, name, entry_point='numina.pipeline.1'):
        """"""

        for drpins in self.iload(entry_point):
            if drpins.name == name:
                return drpins
        else:
            raise KeyError('{}'.format(name))
380615
def load_script(zap_helper, **options):
    """"""
    with zap_error_handler():
        if not os.path.isfile(options['file_path']):
            raise ZAPError('No file found at "{0}", cannot load script.'.format(options['file_path']))

        if not _is_valid_script_engine(zap_helper.zap, options['engine']):
            engines = zap_helper.zap.script.list_engines
            raise ZAPError('Invalid script engine provided. Valid engines are: {0}'.format(', '.join(engines)))

        console.debug('Loading script "{0}" from "{1}"'.format(options['name'], options['file_path']))
        result = zap_helper.zap.script.load(options['name'], options['script_type'], options['engine'],
                                            options['file_path'], scriptdescription=options['description'])

        if result != 'OK':
            raise ZAPError('Error loading script: {0}'.format(result))

    console.info('Script "{0}" loaded'.format(options['name']))
272168
private TemplateImpl load(String path, ParserRuleContext errCtx) {

  	path = Paths.resolvePath(currentEnvironment.path, path);
  	
    try {
      return (TemplateImpl) engine.load(path);
    }
    catch (IOException | ParseException e) {
      throw new ExecutionException("error importing " + path, e, getLocation(errCtx));
    }
  }
569823
def load(self, instance, xblock):
        

        # TODO: Get xblock from context, once the plumbing is piped through
        if djpyfs:
            return djpyfs.get_filesystem(scope_key(instance, xblock))
        else:
            # The reference implementation relies on djpyfs
            # https://github.com/edx/django-pyfs
            # For Django runtimes, you may use this reference
            # implementation. Otherwise, you will need to
            # patch pyfilesystem yourself to implement get_url.
            raise NotImplementedError("djpyfs not available")
976121
function (callback) {

    var self = this;

    var warnings = null;


    async.series([
      // load domain files...
      function (callback) {
        debug('load domain files..');
        self.structureLoader(self.options.domainPath, self.validatorExtension, self.options.useLoaderExtensions, function (err, tree, warns) {
          if (err) {
            return callback(err);
          }
          warnings = warns;

          if (!tree || _.isEmpty(tree)) return callback(new Error('No structure loaded for ' + self.options.domainPath + '!'));

          self.tree = attachLookupFunctions(tree);
          callback(null);
        });
      },

      // prepare infrastructure...
      function (callback) {
        debug('prepare infrastructure...');
        async.parallel([

          // prepare eventStore...
          function (callback) {
            debug('prepare eventStore...');

            self.eventStore.on('connect', function () {
              self.emit('connect');
            });

            self.eventStore.on('disconnect', function () {
              self.emit('disconnect');
            });

            self.eventStore.init(callback);
          },

          // prepare aggregateLock...
          function (callback) {
            debug('prepare aggregateLock...');

            self.aggregateLock.on('connect', function () {
              self.emit('connect');
            });

            self.aggregateLock.on('disconnect', function () {
              self.emit('disconnect');
            });

            self.aggregateLock.connect(callback);
          },

          // prepare commandBumper...
          function (callback) {
            if (!self.commandBumper) {
              return callback(null);
            }
            debug('prepare commandBumper...');

            self.commandBumper.on('connect', function () {
              self.emit('connect');
            });

            self.commandBumper.on('disconnect', function () {
              self.emit('disconnect');
            });

            self.commandBumper.connect(callback);
          }
        ], callback);
      },

      // inject all needed dependencies...
      function (callback) {
        debug('inject all needed dependencies...');

        self.commandDispatcher = new CommandDispatcher(self.tree, self.definitions.command, self.commandBumper);
        self.tree.defineOptions({
            retryOnConcurrencyTimeout: self.options.retryOnConcurrencyTimeout,
            snapshotThreshold: self.options.snapshotThreshold,
            snapshotThresholdMs: self.options.snapshotThresholdMs
          })
          .defineCommand(self.definitions.command)
          .defineEvent(self.definitions.event)
          .idGenerator(self.getNewId)
          .useEventStore(self.eventStore)
          .useAggregateLock(self.aggregateLock);

        if (self.getNewAggregateId) {
          self.tree.aggregateIdGenerator(self.getNewAggregateId);
        }

        callback(null);
      }
    ], function (err) {
      if (err) {
        debug(err);
      } else {
        debug('domain inited');
      }
      if (callback) callback(err, warnings);
    });
  }
183617
def eye(root=None, zodb_uri=None, port=8080):
    
    if root is not None:
        root_factory = lambda request: Node(root)
    elif zodb_uri is not None:
        if '://' not in zodb_uri:
            # treat it as a file://
            zodb_uri = 'file://' + os.path.abspath(zodb_uri)        
    
        from repoze.zodbconn.finder import PersistentApplicationFinder
        finder = PersistentApplicationFinder(zodb_uri, appmaker=lambda root: Node(root))
        root_factory = lambda request: finder(request.environ)
    else:
        raise RuntimeError("Must specify root object or ZODB URI.")
    
    app = Eye(root_factory)
    
    if 'DEBUG' in os.environ:
        from repoze.debug.pdbpm import PostMortemDebug
        app = PostMortemDebug(app)
    
    serve(app, host='127.0.0.1', port=port)
18527
private synchronized void loadStrings(String tzCanonicalID) {
        if (tzCanonicalID == null || tzCanonicalID.length() == 0) {
            return;
        }
        loadTimeZoneNames(tzCanonicalID);

        Set<String> mzIDs = getAvailableMetaZoneIDs(tzCanonicalID);
        for (String mzID : mzIDs) {
            loadMetaZoneNames(mzID);
        }
    }
1086550
@Override
	public ServerResponse readObject(ZooPC pc) {
		long oid = pc.jdoZooGetOid();
		FilePos oie = oidIndex.findOid(oid);
		if (oie == null) {
			return new ServerResponse(RESULT.OBJECT_NOT_FOUND,
					"ERROR OID not found: " + Util.oidToString(oid));
//			throw DBLogger.newObjectNotFoundException(
//					"ERROR OID not found: " + Util.oidToString(oid));
		}
		
		try {
	        final DataDeSerializer dds = ddsPool.get();
            dds.readObject(pc, oie.getPage(), oie.getOffs());
	        ddsPool.offer(dds);
		} catch (RuntimeException e) {
			if (DBLogger.isUser(e)) {
				throw e;
			}
			throw DBLogger.newFatal("ERROR reading object: " + Util.oidToString(oid), e);
		}
		return new ServerResponse(RESULT.SUCCESS);
	}
779865
def _load_db():
    """"""
    from os import path
    from pyci.utility import get_json
    global datapath, db
    datapath = path.abspath(path.expanduser(settings.datafile))
    vms("Deserializing DB from {}".format(datapath))
    db = get_json(datapath, {"installed": [], "enabled": True, "cron": False})