Build and return a ModelManager object and fill the associated model library
760653
def make_library(**kwargs):
    
    library_yaml = kwargs.pop('library', 'models/library.yaml')
    comp_yaml = kwargs.pop('comp', 'config/binning.yaml')
    basedir = kwargs.pop('basedir', os.path.abspath('.'))

    model_man = kwargs.get('ModelManager', ModelManager(basedir=basedir))

    model_comp_dict = model_man.make_library(library_yaml, library_yaml, comp_yaml)

    return dict(model_comp_dict=model_comp_dict,
                ModelManager=model_man)
1276480
def get_model(model:nn.Module):
    ""
    return model.module if isinstance(model, (DistributedDataParallel, nn.DataParallel)) else model
169271
function(model, options) {
            model = this._prepareModel(model, options);
            this.add(model, options);
            return model;
        }
1238077
def find_model(self, constructor, constraints=None, *, columns=None, table_name=None,
                 order_by=None):
    """"""
    return self._find_model(constructor, table_name or constructor.table_name, constraints,
                            columns=columns, order_by=order_by)
107657
def register_model(self, model_cls):
        """"""
        if not getattr(model_cls, '_database_'):
            raise ModelAttributeError('_database_ missing '
                                      'on %s!' % model_cls.__name__)
        if not getattr(model_cls, '_collection_'):
            raise ModelAttributeError('_collection_ missing '
                                      'on %s!' % model_cls.__name__)

        model_cls._mongo_client_ = self.client

        logging.info('Registering Model ' + model_cls.__name__)
        return model_cls
338635
function(models, out)
  {
    var target = out || this.cloneEmpty();

    for (var i = 0; i < this.length; i++)
    {
      var a = this[ i ];
      var key = a.$key();
      var exists = false;

      if ( models instanceof ModelCollection )
      {
        exists = models.has( key );
      }
      else
      {
        for (var k = 0; k < models.length && !exists; k++)
        {
          var modelKey = this.buildKeyFromInput( models[ k ] );

          exists = (key === modelKey);
        }
      }

      if (!exists)
      {
        target.push( a );
      }
    }

    return target;
  }
1192870
def load_model_from_link(name, **overrides):
    """"""
    path = get_data_path() / name / "__init__.py"
    try:
        cls = import_file(name, path)
    except AttributeError:
        raise IOError(Errors.E051.format(name=name))
    return cls.load(**overrides)
13435
def as_manager(cls, obj):
        
        if isinstance(obj, cls): return obj
        if obj is None: return cls.from_user_config()

        if is_string(obj):
            if os.path.exists(obj):
                return cls.from_file(obj)
            else:
                return cls.from_string(obj)

        elif isinstance(obj, collections.abc.Mapping):
            return cls.from_dict(obj)
        else:
            raise TypeError("Don't know how to convert type %s to TaskManager" % type(obj))
286152
async def create(self, model_, **data):
        
        inst = model_(**data)
        query = model_.insert(**dict(inst.__data__))

        pk = await self.execute(query)
        if inst._pk is None:
            inst._pk = pk
        return inst
280188
def create(backbone: ModelFactory, vmin: float, vmax: float, atoms: int,
           input_block: typing.Optional[ModelFactory]=None):
    
    if input_block is None:
        input_block = IdentityFactory()

    return QDistributionalModelFactory(
        input_block=input_block, backbone=backbone,
        vmin=vmin,
        vmax=vmax,
        atoms=atoms
    )
387101
def create(cls, data, **kwargs):
        """"""
        with db.session.begin_nested():
            model = cls.dbmodel(**kwargs)
            model.data = data
            obj = cls(model)
            db.session.add(obj.model)
        return obj
959226
def create(model_config, epochs, optimizer, model, source, storage, scheduler=None, callbacks=None, max_grad_norm=None):
    
    return SimpleTrainCommand(
        epochs=epochs,
        model_config=model_config,
        model_factory=model,
        optimizer_factory=optimizer,
        scheduler_factory=scheduler,
        source=source,
        storage=storage,
        callbacks=callbacks,
        max_grad_norm=max_grad_norm
    )
667469
def build_model(self):
        ''''''
        if self.model_config['model-type']:
            return self.build_red()
        elif self.model_config['model-type']:
            return self.buidl_hred()
        else:
            raise Error("Unrecognized model type '{}'".format(self.model_config['model-type']))
681084
def _get_model(self, appname, modelname):
        
        app = self._get_app(appname)
        models = app.get_models()
        model = None
        for mod in models:
            if mod.__name__ == modelname:
                model = mod
                return model
        msg = "Model " + modelname + " not found"
553974
private Object makeModelObject(String formName) {
		Object object = null;
		Class modelClass = null;
		try {
			modelClass = (Class) modelFactory.getModelClasses(formName);
			if (modelClass == null) {
				throw new Exception(" not found the model in config xml, formName=" + formName);
			}
			object = modelClass.newInstance();
			// inject
			modelProxyInjection.injectProperties(object);
		} catch (Exception e) {
			Debug.logError("[JdonFramework]--> call Model: " + modelClass + " error:" + e, module);
		}
		return object;
	}
1135008
def create(self, **kwargs):
        
        obj = self.model(**kwargs)
        obj.save(force_insert=True, using=self._using)
        return obj
489841
def create_model_class(cls, name, table_name, attrs, validations=None, *, otherattrs=None,
                         other_bases=None):
    """"""
    members = dict(table_name=table_name, attrs=attrs, validations=validations or [])
    if otherattrs:
      members.update(otherattrs)
    return type(name, other_bases or (), members)