Update metadata files (only ladders right now).
334715
def update_metadata(session, path=DATA_PATH):
    """"""
    with open(os.path.join(path, 'games.json')) as handle:
        games = json.loads(handle.read())
     
    for key, data in get_metadata(session, games).items():
        with open(os.path.join(path, '{}.json'.format(key)), 'w') as handle:
           handle.write(json.dumps(data, indent=2))
837176
def update_metadata(self, archive_name, archive_metadata):
        '''
        
        '''

        required_metadata_keys = self.required_archive_metadata.keys()
        for key, val in archive_metadata.items():
            if key in required_metadata_keys and val is None:
                raise ValueError(
                    'Cannot remove required metadata attribute "{}"'.format(
                        key))

        self._update_metadata(archive_name, archive_metadata)
500335
def _update_metadata_for_video(self, metadata_href, video):
        '''
        
        '''
        current_metadata = self.clarify_client.get_metadata(metadata_href)
        cur_data = current_metadata.get('data')

        if cur_data.get('updated_at') != video['updated_at']:
            self.log('Updating metadata for video {0}'.format(video['id']))
            if not self.dry_run:
                metadata = self._metadata_from_video(video)
                self.clarify_client.update_metadata(metadata_href, metadata=metadata)
            self.sync_stats['updated'] += 1
1337024
public function updateSlugs()
    {
        $allRecords = $this->all();

        if ($allRecords) {
            foreach($allRecords as $record) {
                $activeRecord = $this->find($record->id);
                $activeRecord->update([
                    $this->getSlugColumn() => $this->buildSlug()
                ]);
            }
        }
    }
133842
public function updateFromCatalog(): void
    {
        $domain = $this->params['domain'];

        $localePath = ROOT . '/src/Locale/';

        $catalogFile = $localePath . $domain . '.pot';
        if (!file_exists($catalogFile)) {
            $this->abort(sprintf('Catalog File %s not found.', $catalogFile));
        }

        $poFiles = [];
        $folder = new Folder($localePath);
        $tree = $folder->tree();

        foreach ($tree[1] as $file) {
            $basename = basename($file);
            if ($domain . '.po' === $basename) {
                $poFiles[] = $file;
            }
        }
        if (empty($poFiles)) {
            $this->abort(sprintf('I could not find any matching po files in the given locale path (%s) for the domain (%s)', $localePath, $domain));
        }

        if (!$this->params['overwrite']) {
            $this->out('I will update the following .po files and their corresponding .mo file with the keys from catalog: ' . $catalogFile);
            foreach ($poFiles as $poFile) {
                $this->out('    - ' . $poFile);
            }
            $response = $this->in('Would you like to continue?', ['y', 'n'], 'n');
            if ($response !== 'y') {
                $this->abort('Aborted');
            }
        }

        foreach ($poFiles as $poFile) {
            $catalogEntries = Translations::fromPoFile($catalogFile);
            $moFile = str_replace('.po', '.mo', $poFile);
            $translationEntries = Translations::fromPoFile($poFile);

            $newTranslationEntries = $catalogEntries->mergeWith($translationEntries, Merge::REFERENCES_THEIRS);

            $newTranslationEntries->deleteHeaders();
            foreach ($translationEntries->getHeaders() as $key => $value) {
                $newTranslationEntries->setHeader($key, $value);
            }

            if ($this->params['strip-references']) {
                foreach ($newTranslationEntries as $translation) {
                    $translation->deleteReferences();
                }
            }

            $newTranslationEntries->toPoFile($poFile);
            $newTranslationEntries->toMoFile($moFile);
            $this->out('Updated ' . $poFile);
            $this->out('Updated ' . $moFile);
        }
    }
479552
def load(self, ladderName):
        """"""
        self.name = ladderName # preset value to load self.filename
        with open(self.filename, "rb") as f:
            data = f.read()
            self.__dict__.update( json.loads(data) )
104533
def update_metadata_queue(self, agent: BaseAgent):
        
        pids = {os.getpid(), *agent.get_extra_pids()}

        helper_process_request = agent.get_helper_process_request()

        self.agent_metadata_queue.put(AgentMetadata(self.index, self.name, self.team, pids, helper_process_request))
805135
def update(self, data, key):
        """"""
        og_data = self.read()
        og_data[key] = data
        self.write(og_data)
1157170
def _update_metadata(self, kwargs=None):
        '''
        '''

        # If not given metadata, use instance.list to get it for container
        if kwargs == None and hasattr(self, 'name'):
            kwargs = self._list(self.name, quiet=True, return_json=True)

        # Add acceptable arguments
        for arg in ['pid', 'name']:

           # Skip over non-iterables:
           if arg in kwargs:
               setattr(self, arg, kwargs[arg])
       
        if "image" in kwargs:
            self._image = kwargs['image']
        elif "container_image" in kwargs:
            self._image = kwargs['container_image']
938532
def do_folder_update_metadata(client, args):
    """"""
    client.update_folder_metadata(args.uri, foldername=args.foldername,
                                  description=args.description,
                                  mtime=args.mtime, privacy=args.privacy,
                                  privacy_recursive=args.recursive)
    return True
903750
def update(self, *args, **kwargs):
        """"""
        self._call_helper("Updating", self.real.update, *args, **kwargs)
772510
def update_data(self, data_np, metadata=None, astype=None):
        
        self.set_data(data_np.copy(), metadata=metadata,
                      astype=astype)
390387
def _update(self, layer=None):
        
        meta = getattr(self, ModelBase._meta_attr)
        if not layer:
            layers = self.layers
        else:
            # convert non-sequence to tuple
            layers = _listify(layer)
        for layer in layers:
            # relative path to layer files from model file
            path = os.path.abspath(os.path.join(meta.modelpath, layer))
            getattr(self, layer).load(path)
623931
def metadata(self):
        """"""
        auto = {u'records': self.size}
        auto.update(self.meta)
        return auto
485189
def update_metadata(self, key: str, msg: MaildirMessage) -> None:
        
        subpath = self._lookup(key)
        subdir, name = os.path.split(subpath)
        new_subdir = msg.get_subdir()
        new_name = key + self.colon + msg.get_info()
        if subdir != new_subdir:
            raise ValueError('Message subdir may not be updated')
        elif name != new_name:
            new_subpath = os.path.join(msg.get_subdir(), new_name)
            old_path = os.path.join(self._path, subpath)
            new_path = os.path.join(self._path, new_subpath)
            os.rename(old_path, new_path)
            self._toc[key] = new_subpath
1182775
def store_meta(self,meta):
        ""
        if self.meta is None:
            self.meta = {}
        self.meta.update(meta)
        return self
418547
def _load_metadata(self):
        """"""
        if self._schema is None:
            self._schema = self._get_schema()
            self.datashape = self._schema.datashape
            self.dtype = self._schema.dtype
            self.shape = self._schema.shape
            self.npartitions = self._schema.npartitions
            self.metadata.update(self._schema.extra_metadata)