Populates the instance variables of this FeatureSet from the specified
        DB row.
355820
def populateFromRow(self, featureSetRecord):
        
        self._dbFilePath = featureSetRecord.dataurl
        self.setAttributesJson(featureSetRecord.attributes)
        self.populateFromFile(self._dbFilePath)
1171061
protected function populateFromResultset(Resultset $resultset = null, $classname = null, $id_column = null, $index_column = null)
        {
            $items = array();
            if ($resultset instanceof Resultset) {
                if (Core::isDebugMode()) {
                    $previous_time = Core::getDebugTime();
                    $populated_classnames = array();
                    $populated_classes = 0;
                }

                $query = $resultset->getQuery();
                $id_column = ($id_column) ?? $query->getTable()->getIdColumn();
                if ($index_column === null) {
                    $index_column = ($query->getIndexBy()) ? $query->getIndexBy() : $id_column;
                }
                $classnames = Core::getCachedTableEntityClasses('\\'.get_class($this));
                if ($classname === null) {
                    $classname = Core::getCachedTableEntityClass('\\'.get_class($this));
                }
                while ($row = $resultset->getNextRow()) {
                    if ($classnames) {
                        $classname = $this->getSubclassNameFromRow($row, $classnames);
                    }
                    $row_id = $row->get($id_column);
                    $is_cached = $classname::getB2DBTable()->hasCachedB2DBObject($row_id);
                    $item = $this->populateFromRow($row, $classname, $id_column, $row_id, true);
                    $items[$row->get($index_column)] = $item;
                    if (!$is_cached && Core::isDebugMode()) {
                        $populated_classnames[$classname] = $classname;
                        $populated_classes++;
                    }
                }

                if (Core::isDebugMode()) {
                    Core::objectPopulationHit($populated_classes, $populated_classnames, $previous_time);
                }
            }
            return $items;
        }
150720
def from_dict(cls, d):
        """"""
        read = lambda cls: (lambda pair: (pair[0], cls.from_dict(pair[1])))
        return cls(
            variables=map(read(Variable), d.get('variables', {}).items()),
            properties=map(read(Property), d.get('properties', {}).items()),
            roles=map(read(Role), d.get('roles', {}).items()),
            predicates=map(read(Predicate), d.get('predicates', {}).items())
        )
1100525
def _construct_instance(cls, values):
        
        # we're going to take the values, which is from the DB as a dict
        # and translate that into our local fields
        # the db_map is a db_field -> model field map
        if cls._db_map:
            values = dict((cls._db_map.get(k, k), v) for k, v in values.items())

        if cls._is_polymorphic:
            disc_key = values.get(cls._discriminator_column_name)

            if disc_key is None:
                raise PolymorphicModelException('discriminator value was not found in values')

            poly_base = cls if cls._is_polymorphic_base else cls._polymorphic_base

            klass = poly_base._get_model_by_discriminator_value(disc_key)
            if klass is None:
                poly_base._discover_polymorphic_submodels()
                klass = poly_base._get_model_by_discriminator_value(disc_key)
                if klass is None:
                    raise PolymorphicModelException(
                        'unrecognized discriminator column {0} for class {1}'.format(disc_key, poly_base.__name__)
                    )

            if not issubclass(klass, cls):
                raise PolymorphicModelException(
                    '{0} is not a subclass of {1}'.format(klass.__name__, cls.__name__)
                )

            values = dict((k, v) for k, v in values.items() if k in klass._columns.keys())

        else:
            klass = cls

        instance = klass(**values)
        instance._set_persisted(force=True)
        return instance
193128
private Object populateEntityFromDataFrame(EntityMetadata m, Map<String, Integer> columnIndexMap, Row row)
    {
        try
        {
            // create entity instance
            Object entity = KunderaCoreUtils.createNewInstance(m.getEntityClazz());
            // handle relations
            Map<String, Object> relations = new HashMap<String, Object>();
            if (entity.getClass().isAssignableFrom(EnhanceEntity.class))
            {
                relations = ((EnhanceEntity) entity).getRelations();
                entity = ((EnhanceEntity) entity).getEntity();
            }
            // get a Set of attributes
            MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                    m.getPersistenceUnit());
            EntityType entityType = metaModel.entity(m.getEntityClazz());
            Set<Attribute> attributes = ((AbstractManagedType) entityType).getAttributes();
            // iterate over attributes and find its value
            for (Attribute attribute : attributes)
            {
                String columnName = getColumnName(attribute);
                Object columnValue = row.get(columnIndexMap.get(columnName));
                if (columnValue != null)
                {
                    Object value = PropertyAccessorHelper.fromSourceToTargetClass(attribute.getJavaType(),
                            columnValue.getClass(), columnValue);

                    PropertyAccessorHelper.set(entity, (Field) attribute.getJavaMember(), value);
                }
            }
            // find the value of @Id field for EnhanceEntity
            SingularAttribute attrib = m.getIdAttribute();
            Object rowKey = PropertyAccessorHelper.getObject(entity, (Field) attrib.getJavaMember());
            if (!relations.isEmpty())
            {
                return new EnhanceEntity(entity, rowKey, relations);
            }
            return entity;
        }
        catch (PropertyAccessException e1)
        {
            throw new RuntimeException(e1);
        }
    }
706055
def from_list(cls, database, key, data, clear=False):
        
        arr = cls(database, key)
        if clear:
            arr.clear()
        arr.extend(data)
        return arr
431209
def populateFromRow(self, referenceSetRecord):
        
        self._dataUrl = referenceSetRecord.dataurl
        self._description = referenceSetRecord.description
        self._assemblyId = referenceSetRecord.assemblyid
        self._isDerived = bool(referenceSetRecord.isderived)
        self._md5checksum = referenceSetRecord.md5checksum
        species = referenceSetRecord.species
        if species is not None and species != 'null':
            self.setSpeciesFromJson(species)
        self._sourceAccessions = json.loads(
            referenceSetRecord.sourceaccessions)
        self._sourceUri = referenceSetRecord.sourceuri
596270
def populateFromRow(self, callSetRecord):
        
        self._biosampleId = callSetRecord.biosampleid
        self.setAttributesJson(callSetRecord.attributes)
1161717
def populateFromRow(self, quantificationSetRecord):
        
        self._dbFilePath = quantificationSetRecord.dataurl
        self.setAttributesJson(quantificationSetRecord.attributes)
        self._db = SqliteRnaBackend(self._dbFilePath)
        self.addRnaQuants()
583593
public static void populate(Object instance, Map<String, Object> values) {
		try {
			BeanUtilsBean beanUtilBean = new BeanUtilsBean();
			for (String key : values.keySet()) {
				Object value = values.get(key);
				beanUtilBean.setProperty(instance, key, value);
			}
		} catch (Exception e) {
			JKExceptionUtil.handle(e);
		}
	}
453325
@PostConstruct
	protected void initFeatures() throws LayerException {
		if (null == layerInfo) {
			return;
		}
		crs = geoService.getCrs2(layerInfo.getCrs());
		setFeatureSourceName(layerInfo.getFeatureInfo().getDataSourceName());
		try {
			if (null == super.getDataStore()) {
				Map<String, Object> params = new HashMap<String, Object>();
				if (null != url) {
					params.put(ShapefileDataStoreFactory.URLP.key, url);
				}
				if (null != dbtype) {
					params.put(JDBCDataStoreFactory.DBTYPE.key, dbtype);
				}
				if (null != parameters) {
					for (Parameter parameter : parameters) {
						params.put(parameter.getName(), parameter.getValue());
					}
				}
				if (null != dataSource) {
					params.put(JDBCDataStoreFactory.DATASOURCE.key, dataSource);
					// these are apparently required but not used
					params.put(JDBCDataStoreFactory.DATABASE.key, "some_database");
					params.put(JDBCDataStoreFactory.USER.key, "some_user");
					params.put(JDBCDataStoreFactory.PASSWD.key, "some_password");
					params.put(JDBCDataStoreFactory.HOST.key, "some host");
					params.put(JDBCDataStoreFactory.PORT.key, "0");
				}
				DataStore store = DataStoreFactory.create(params);
				super.setDataStore(store);
			}
			if (null == super.getDataStore()) {
				return;
			}
			this.featureModel = new GeoToolsFeatureModel(super.getDataStore(), layerInfo.getFeatureInfo()
					.getDataSourceName(), geoService.getSridFromCrs(layerInfo.getCrs()), converterService);
			featureModel.setLayerInfo(layerInfo);
			featureModelUsable = true;

		} catch (IOException ioe) {
			if (MAGIC_STRING_LIBRARY_MISSING.equals(ioe.getMessage())) {
				throw new LayerException(ioe, ExceptionCode.LAYER_MODEL_IO_EXCEPTION, url);
			} else {
				featureModelUsable = false;
				log.warn("The layer could not be correctly initialized: " + getId(), ioe);
			}
		} catch (LayerException le) {
			featureModelUsable = false;
			log.warn("The layer could not be correctly initialized: " + getId(), le);
		} catch (RuntimeException e) {
			featureModelUsable = false;
			log.warn("The layer could not be correctly initialized: " + getId(), e);
		}
	}
234543
def insertFeatureSet(self, featureSet):
        
        # TODO add support for info and sourceUri fields.
        try:
            models.Featureset.create(
                id=featureSet.getId(),
                datasetid=featureSet.getParentContainer().getId(),
                referencesetid=featureSet.getReferenceSet().getId(),
                ontologyid=featureSet.getOntology().getId(),
                name=featureSet.getLocalId(),
                dataurl=featureSet.getDataUrl(),
                attributes=json.dumps(featureSet.getAttributes()))
        except Exception as e:
            raise exceptions.RepoManagerException(e)
549962
def populateFromRow(self, readGroupRecord):
        
        self._sampleName = readGroupRecord.samplename
        self._biosampleId = readGroupRecord.biosampleid
        self._description = readGroupRecord.description
        self._predictedInsertSize = readGroupRecord.predictedinsertsize
        stats = protocol.fromJson(readGroupRecord.stats, protocol.ReadStats)
        self._numAlignedReads = stats.aligned_read_count
        self._numUnalignedReads = stats.unaligned_read_count
        experiment = protocol.fromJson(
            readGroupRecord.experiment, protocol.Experiment)
        self._instrumentModel = experiment.instrument_model
        self._sequencingCenter = experiment.sequencing_center
        self._experimentDescription = experiment.description
        self._library = experiment.library
        self._platformUnit = experiment.platform_unit
        self._runTime = experiment.run_time
139735
def populate_obj(self, obj, keys=None):
        """"""
        keys = keys or self.keys()
        for key in keys:
            key = key.upper()
            value = self.get(key, empty)
            if value is not empty:
                setattr(obj, key, value)
285882
public static void populate(WritableColumnVector col, InternalRow row, int fieldIdx) {
    int capacity = col.capacity;
    DataType t = col.dataType();

    if (row.isNullAt(fieldIdx)) {
      col.putNulls(0, capacity);
    } else {
      if (t == DataTypes.BooleanType) {
        col.putBooleans(0, capacity, row.getBoolean(fieldIdx));
      } else if (t == DataTypes.ByteType) {
        col.putBytes(0, capacity, row.getByte(fieldIdx));
      } else if (t == DataTypes.ShortType) {
        col.putShorts(0, capacity, row.getShort(fieldIdx));
      } else if (t == DataTypes.IntegerType) {
        col.putInts(0, capacity, row.getInt(fieldIdx));
      } else if (t == DataTypes.LongType) {
        col.putLongs(0, capacity, row.getLong(fieldIdx));
      } else if (t == DataTypes.FloatType) {
        col.putFloats(0, capacity, row.getFloat(fieldIdx));
      } else if (t == DataTypes.DoubleType) {
        col.putDoubles(0, capacity, row.getDouble(fieldIdx));
      } else if (t == DataTypes.StringType) {
        UTF8String v = row.getUTF8String(fieldIdx);
        byte[] bytes = v.getBytes();
        for (int i = 0; i < capacity; i++) {
          col.putByteArray(i, bytes);
        }
      } else if (t instanceof DecimalType) {
        DecimalType dt = (DecimalType)t;
        Decimal d = row.getDecimal(fieldIdx, dt.precision(), dt.scale());
        if (dt.precision() <= Decimal.MAX_INT_DIGITS()) {
          col.putInts(0, capacity, (int)d.toUnscaledLong());
        } else if (dt.precision() <= Decimal.MAX_LONG_DIGITS()) {
          col.putLongs(0, capacity, d.toUnscaledLong());
        } else {
          final BigInteger integer = d.toJavaBigDecimal().unscaledValue();
          byte[] bytes = integer.toByteArray();
          for (int i = 0; i < capacity; i++) {
            col.putByteArray(i, bytes, 0, bytes.length);
          }
        }
      } else if (t instanceof CalendarIntervalType) {
        CalendarInterval c = (CalendarInterval)row.get(fieldIdx, t);
        col.getChild(0).putInts(0, capacity, c.months);
        col.getChild(1).putLongs(0, capacity, c.microseconds);
      } else if (t instanceof DateType) {
        col.putInts(0, capacity, row.getInt(fieldIdx));
      } else if (t instanceof TimestampType) {
        col.putLongs(0, capacity, row.getLong(fieldIdx));
      }
    }
  }
1178824
protected function populateFromRow(Row $row = null, $classname = null, $id_column = null, $row_id = null, $from_resultset = false)
        {
            $item = null;
            if ($row instanceof Row) {
                if (!$from_resultset && Core::isDebugMode()) {
                    $previous_time = Core::getDebugTime();
                }
                if ($classname === null) {
                    $classnames = Core::getCachedTableEntityClasses('\\'.get_class($this));
                    if ($classnames) {
                        $classname = $this->getSubclassNameFromRow($row, $classnames);
                    } else {
                        $classname = Core::getCachedTableEntityClass('\\'.get_class($this));
                    }
                    if (!$classname) {
                        throw new Exception("Classname '{$classname}' or subclasses for table '{$this->getB2DBName()}' is not valid");
                    }
                }

                $id_column = ($id_column) ?? $row->getQuery()->getTable()->getIdColumn();
                $row_id = ($row_id !== null) ? $row_id : $row->get($id_column);
                $is_cached = $classname::getB2DBTable()->hasCachedB2DBObject($row_id);
                $item = $classname::getB2DBCachedObjectIfAvailable($row_id, $classname, $row);
                if (!$from_resultset && !$is_cached && Core::isDebugMode()) {
                    Core::objectPopulationHit(1, array($classname), $previous_time);
                }
            }
            return $item;
        }
1184000
def dataset(db=nil)
      db ||= self.class.default_db
      builder = Database::DatasetBuilder.new(db, self)
      builder.select(@columns)
      builder.filter(@filters)
      builder.order(@order)
      builder.limit(@limit) if @limit
      builder.dataset
    end