Enriches existing user configured data.
501013
protected function enrichCustomData()
    {
        // Check filled columns and enrich them as required
        // Note that these can be either attributes or relations

        $columns = [];

        foreach ($this->info->list->columns as $key => $column) {

            try {
                $this->enrichColumn($key, $column, $columns);

            } catch (\Exception $e) {

                // Wrap and decorate exceptions so it is easier to track the problem source
                throw (new ModelInformationEnrichmentException(
                    "Issue with list column '{$key}' (list.columns.{$key}): \n{$e->getMessage()}",
                    (int) $e->getCode(),
                    $e
                ))
                    ->setSection('list.columns')
                    ->setKey($key);
            }
        }

        $this->info->list->columns = $columns;
    }
740895
def user_parse(data):
        """"""
        yield 'id', data.get('uuid')
        yield 'username', data.get('username')
        yield 'last_name', data.get('display_name')
        links = data.get('links', {})
        yield 'picture', links.get('avatar', {}).get('href')
        yield 'link', links.get('html', {}).get('href')
1267637
def create_from_userdata(userdata):
        """"""
        memhi = userdata.get('d3')
        memlo = userdata.get('d4')
        memory = memhi << 8 | memlo
        control_flags = userdata.get('d6')
        group = userdata.get('d7')
        addrhi = userdata.get('d8')
        addrmed = userdata.get('d9')
        addrlo = userdata.get('d10')
        addr = Address(bytearray([addrhi, addrmed, addrlo]))
        data1 = userdata.get('d11')
        data2 = userdata.get('d12')
        data3 = userdata.get('d13')
        return ALDBRecord(memory, control_flags, group, addr,
                          data1, data2, data3)
577600
def generate_additional_context(self, matching_datasets):
        """"""
        top_tags = Tag.objects.filter(
            dataset__in=matching_datasets
        ).annotate(
            tag_count=Count('word')
        ).order_by('-tag_count')[:3]

        top_authors = Dataset.objects.filter(
            id__in=matching_datasets
        ).values('uploaded_by').annotate(
            author_count=Count('uploaded_by')
        ).order_by('-author_count')[:3]

        for author in top_authors:
            author['fullName'] = grab_names_from_emails([
                author['uploaded_by']
            ])[author['uploaded_by']]

        return {
            'top_tags': top_tags,
            'top_authors': top_authors
        }
333858
def addContinuousSet(self):
        
        self._openRepo()
        dataset = self._repo.getDatasetByName(self._args.datasetName)
        filePath = self._getFilePath(self._args.filePath,
                                     self._args.relativePath)
        name = getNameFromPath(self._args.filePath)
        continuousSet = continuous.FileContinuousSet(dataset, name)
        referenceSetName = self._args.referenceSetName
        if referenceSetName is None:
            raise exceptions.RepoManagerException(
                "A reference set name must be provided")
        referenceSet = self._repo.getReferenceSetByName(referenceSetName)
        continuousSet.setReferenceSet(referenceSet)
        continuousSet.populateFromFile(filePath)
        self._updateRepo(self._repo.insertContinuousSet, continuousSet)
883079
private ComposeUserData composeUserAndConfigData(UserData userData, ConfigData configData) {

        ComposeUserData result = new ComposeUserData();

        Map<String, List<ProviderInfo>> zoneData = new HashMap<String, List<ProviderInfo>>();
        if (userData == null) {
            return result;
        } else {
            result.setLocalZone(userData.getLocalZone());

            final Map<String, List<String>> listZoneData = userData.getZoneData();
            final String[] configDatas = StringUtils.split(
                configData == null ? StringUtils.EMPTY : configData.getData(), CONFIG_SEPARATOR);
            final List<String> attrData = Arrays.asList(configDatas);
            for (String key : listZoneData.keySet()) {
                final List<ProviderInfo> providerInfos = mergeProviderInfo(listZoneData.get(key), attrData);
                zoneData.put(key, providerInfos);
            }

            result.setZoneData(zoneData);

        }

        return result;
    }
1006498
def discussions_for(user, only_open=True):
    '''
    
    '''
    # Only fetch required fields for discussion filtering (id and slug)
    # Greatly improve performances and memory usage
    datasets = Dataset.objects.owned_by(user.id, *user.organizations).only('id', 'slug')
    reuses = Reuse.objects.owned_by(user.id, *user.organizations).only('id', 'slug')

    qs = Discussion.objects(subject__in=list(datasets) + list(reuses))
    if only_open:
        qs = qs(closed__exists=False)
    return qs
366706
def new_data(self, mem, addr, data):
        """"""
        done = False
        if mem.id == self.id:
            if addr == LocoMemory.MEM_LOCO_INFO:
                self.nr_of_anchors = data[0]
                if self.nr_of_anchors == 0:
                    done = True
                else:
                    self.anchor_data = \
                        [AnchorData() for _ in range(self.nr_of_anchors)]
                    self._request_page(0)
            else:
                page = int((addr - LocoMemory.MEM_LOCO_ANCHOR_BASE) /
                           LocoMemory.MEM_LOCO_ANCHOR_PAGE_SIZE)

                self.anchor_data[page].set_from_mem_data(data)

                next_page = page + 1
                if next_page < self.nr_of_anchors:
                    self._request_page(next_page)
                else:
                    done = True

        if done:
            self.valid = True
            if self._update_finished_cb:
                self._update_finished_cb(self)
                self._update_finished_cb = None
980459
def _merge_data(self, data: AnyMapping, *additional: AnyMapping) -> dict:
        
        """
        return defaults(
            dict(data) if not isinstance(data, dict) else data,
            *(dict(item) for item in additional))
215517
protected function rebuildEstimatedData()
    {
        $this->estimatedData = array();
        foreach ($this->serverData as $key => $value)
        {
            $this->estimatedData[$key] = $value;
        }
        $this->applyOperations($this->operationSet, $this->estimatedData);
    }
236744
def enhance(self):
        
        self.update({'os_default_templates':
                     SubDict(self.api, self.objName,
                             self.payloadObj, self.key,
                             SubItemOsDefaultTemplate)})
        self.update({'config_templates':
                     SubDict(self.api, self.objName,
                             self.payloadObj, self.key,
                             SubItemConfigTemplate)})
        self.update({'ptables':
                     SubDict(self.api, self.objName,
                             self.payloadObj, self.key,
                             SubItemPTable)})
        self.update({'media':
                     SubDict(self.api, self.objName,
                             self.payloadObj, self.key,
                             SubItemMedia)})
        self.update({'architectures':
                     SubDict(self.api, self.objName,
                             self.payloadObj, self.key,
                             SubItemArchitecture)})
182066
def generate_additional_context(self, matching_datasets):
        """"""
        related_tags = Tag.objects.filter(
            dataset__in=matching_datasets
        ).distinct().annotate(
            Count('word')
        ).order_by('-word__count')[:5]

        return {
            'related_tags': related_tags
        }
78186
def add_data(self, request, pk=None):
        """"""
        # add data to entity
        resp = super().add_data(request, pk)

        # add data to collections in which entity is
        entity = self.get_object()
        for collection in entity.collections.all():
            collection.data.add(*request.data['ids'])

        return resp
162079
def extend(self, values):
        """"""
        if self.asserted:
            raise RuntimeError("Fact already asserted")

        self._multifield.extend(values)
629936
function addSiteData(site) {
  return (req, res, next) => {
    res.locals.url = uriToUrl(req.hostname + req.originalUrl, site.protocol, site.port);
    res.locals.site = site;

    next();
  };
}
1070586
public function augmentDatabase() {
		$defaultThemes = array('blackcandymobile', 'jquerymobile');
		$currentTheme = $this->owner->getField('MobileTheme');
		if(!$currentTheme || in_array($currentTheme, $defaultThemes)) {
			$this->copyDefaultTheme($currentTheme);
		}
	}
736628
protected function performEnrichment()
    {
        if ( ! count($this->info->form->fields)) {
            $this->fillDataForEmpty();
        } else {
            $this->enrichCustomData();
        }
    }