very similar to hydrate, TODO: dry
499347
function attach(vnode, withEl) {
	vnode.el = withEl;
	withEl._node = vnode;

	var nattrs = vnode.attrs;

	for (var key in nattrs) {
		var nval = nattrs[key];
		var isDyn = isDynAttr(vnode.tag, key);

		if (isStyleAttr(key) || isSplAttr(key)) ;
		else if (isEvAttr(key))
			{ patchEvent(vnode, key, nval); }
		else if (nval != null && isDyn)
			{ setAttr(vnode, key, nval, isDyn); }
	}

	if ((vnode.flags & LAZY_LIST) === LAZY_LIST)
		{ vnode.body.body(vnode); }

	if (isArr(vnode.body) && vnode.body.length > 0) {
		var c = withEl.firstChild;
		var i = 0;
		var v = vnode.body[i];
		do {
			if (v.type === VVIEW)
				{ v = createView(v.view, v.data, v.key, v.opts)._redraw(vnode, i, false).node; }
			else if (v.type === VMODEL)
				{ v = v.vm.node || v.vm._update(v.data, vnode, i, false, true).node; }

			{
				if (vnode.tag === "table" && v.tag === "tr") {
					devNotify("ATTACH_IMPLICIT_TBODY", [vnode, v]);
				}
			}

			attach(v, c);
		} while ((c = c.nextSibling) && (v = vnode.body[++i]));

		var vm = vnode.vm;

		vm != null && fireHook(vm.hooks, "willMount", vm, vm.data);
		fireHook(vnode.hooks, "willInsert", vnode);
		fireHook(vnode.hooks, "didInsert", vnode);
		vm != null && fireHook(vm.hooks, "didMount", vm, vm.data);
	}
}
890343
public static function hydrateRaw( $query, $bindings = [], $connection = null )
	{
		$instance = ( new static )->setConnection( $connection );

		$items = $instance->getConnection()->select( $query, $bindings );

		return static::hydrate( $items, $connection );
	}
518064
def hydrate_sources(sources_field, glob_match_error_behavior):
  
  # TODO(#5864): merge the target's selection of --glob-expansion-failure (which doesn't exist yet)
  # with the global default!
  path_globs = sources_field.path_globs.copy(glob_match_error_behavior=glob_match_error_behavior)
  snapshot = yield Get(Snapshot, PathGlobs, path_globs)
  fileset_with_spec = _eager_fileset_with_spec(
    sources_field.address.spec_path,
    sources_field.filespecs,
    snapshot)
  sources_field.validate_fn(fileset_with_spec)
  yield HydratedField(sources_field.arg, fileset_with_spec)
42251
def _serialize_items(self, serializer, kind, items):
        """"""
        if self.request and self.request.query_params.get('hydrate_{}'.format(kind), False):
            serializer = serializer(items, many=True, read_only=True)
            serializer.bind(kind, self)
            return serializer.data
        else:
            return [item.id for item in items]
571896
private void dehydrate(
			Tuple tuple,
			final Object[] fields,
			boolean[] includeProperties,
			int tableIndex,
			Serializable id,
			SharedSessionContractImplementor session) {

		if ( log.isTraceEnabled() ) {
			log.trace( "Dehydrating entity: " + MessageHelper.infoString( this, id, getFactory() ) );
		}

		for ( int propertyIndex = 0; propertyIndex < getEntityMetamodel().getPropertySpan(); propertyIndex++ ) {
			if ( isPropertyOfTable( propertyIndex, tableIndex ) ) {
				if ( includeProperties[propertyIndex] ) {
					getGridPropertyTypes()[propertyIndex].nullSafeSet(
							tuple,
							fields[propertyIndex],
							getPropertyColumnNames( propertyIndex ),
							getPropertyColumnInsertable()[propertyIndex],
							session
					);
				}
			}
		}
	}
1321527
public static function hydrate(stdClass $process)
    {
        $hydrated = new ProcessEntity();

        if (isset($process->id)) {
            $hydrated->setId($process->id);
        }

        if (isset($process->pid)) {
            $hydrated->setPid($process->pid);
        }

        if (isset($process->version)) {
            $hydrated->setVersion($process->version);
        }

        if (isset($process->name)) {
            $hydrated->setName($process->name);
        }

        if (isset($process->started_at)) {
            $hydrated->setStartedAt(new DateTime($process->started_at));
        }

        if (isset($process->finished_at)) {
            $hydrated->setFinishedAt(new DateTime($process->finished_at));
        }

        if (isset($process->finished)) {
            $hydrated->setFinished($process->finished);
        }

        if (isset($process->memory)) {
            $hydrated->setMemory($process->memory);
        }

        if (isset($process->phase)) {
            $hydrated->setPhase($process->phase);
        }

        if (isset($process->percent)) {
            $hydrated->setPercent($process->percent);
        }

        if (isset($process->weight)) {
            $hydrated->setWeight($process->weight);
        }

        return $hydrated;
    }
42476
def hydrate_duration(months, days, seconds, nanoseconds):
    
    return Duration(months=months, days=days, seconds=seconds, nanoseconds=nanoseconds)
364469
function rehydrateAggregate(ARObject){
		return when.try(eventSink.rehydrate.bind(eventSink), ARObject, ARID, ARObject.getNextSequenceNumber());
	}
450846
def dehydrate(self):
        """"""

        # Only concerned about very specific attributes
        result = dict(limit_class=self._limit_full_name)
        for attr in self.attrs:
            # Using getattr allows the properties to come into play
            result[attr] = getattr(self, attr)

        return result
1216540
protected static function hydrate()
	{
		static::$input = array_merge($_GET, $_POST);

		if (\Input::method() == 'PUT' or \Input::method() == 'PATCH' or \Input::method() == 'DELETE')
		{
			static::$php_input === null and static::$php_input = file_get_contents('php://input');
			if (strpos(static::headers('Content-Type'), 'www-form-urlencoded') > 0 and \Config::get('security.form-double-urlencoded', false))
			{
				static::$php_input = urldecode(static::$php_input);
			}
			parse_str(static::$php_input, static::$put_patch_delete);
			static::$input = array_merge(static::$input, static::$put_patch_delete);
		}
		else
		{
			static::$put_patch_delete = array();
		}
	}
1277324
public static function hydrate(stdClass $ldap)
    {
        $hydrated = new LdapEntity();

        if (isset($ldap->id)) {
            $hydrated->setId($ldap->id);
        }

        if (isset($ldap->enabled)) {
            $hydrated->setEnabled($ldap->enabled);
        }

        if (isset($ldap->search_dn)) {
            $hydrated->setSearchDn($ldap->search_dn);
        }

        if (isset($ldap->search_password)) {
            $hydrated->setSearchPassword($ldap->search_password);
        }

        if (isset($ldap->search_query)) {
            $hydrated->setSearchQuery($ldap->search_query);
        }

        if (isset($ldap->base_dn)) {
            $hydrated->setBaseDn($ldap->base_dn);
        }

        if (isset($ldap->email_key)) {
            $hydrated->setEmailKey($ldap->email_key);
        }

        if (isset($ldap->user_dn)) {
            $hydrated->setUserDn($ldap->user_dn);
        }

        if (isset($ldap->host)) {
            $hydrated->setHost($ldap->host);
        }

        if (isset($ldap->port)) {
            $hydrated->setPort($ldap->port);
        }

        if (isset($ldap->encryption)) {
            $hydrated->setEncryption($ldap->encryption);
        }

        if (isset($ldap->protocol_version)) {
            $hydrated->setProtocolVersion($ldap->protocol_version);
        }

        if (isset($ldap->expired_accounts)) {
            $hydrated->setExpiredAccounts($ldap->expired_accounts);
        }

        if (isset($ldap->last_sync_at)) {
            $hydrated->setLastSyncAt(new DateTime($ldap->last_sync_at));
        }

        return $hydrated;
    }
261939
def limits_hydrate(db, lims):
    

    return [limits.Limit.hydrate(db, lim) for lim in lims]
1043220
@SuppressWarnings("unchecked")
    public Closure<V> dehydrate() {
        Closure<V> result = (Closure<V>) this.clone();
        result.delegate = null;
        result.owner = null;
        result.thisObject = null;
        return result;
    }
1258957
def moist_amplification_factor(Tkelvin, relative_humidity=0.8):
    ''''''
    deltaT = 0.01
    #  slope of saturation specific humidity at 1000 hPa
    dqsdTs = (qsat(Tkelvin+deltaT/2, 1000.) - qsat(Tkelvin-deltaT/2, 1000.)) / deltaT
    return const.Lhvap / const.cp * relative_humidity * dqsdTs
220591
public function hydrateRow()
    {
        $row = $this->_stmt->fetch(PDO::FETCH_ASSOC);

        if ( ! $row) {
            $this->cleanup();

            return false;
        }

        $result = array();

        $this->hydrateRowData($row, $result);

        return $result;
    }
1318817
function rehydrate(dehydratedString) {
    const { name, id, sourceCredentials, archiveCredentials, type, colour, order } = JSON.parse(dehydratedString);
    const source = new ArchiveSource(name, sourceCredentials, archiveCredentials, { id, type });
    source.type = type;
    if (colour) {
        source._colour = colour;
    }
    if (order >= 0) {
        source.order = order;
    }
    return source;
}
191066
public static function hydrate(stdClass $setting)
    {
        $hydrated = new SettingEntity();

        if (isset($setting->key)) {
            $hydrated->setKey($setting->key);
        }

        if (isset($setting->value)) {
            $hydrated->setValue($setting->value);
        }

        if (isset($setting->created_at)) {
            $hydrated->setCreatedAt(new DateTime($setting->created_at));
        }

        return $hydrated;
    }