> quick and dirty fix for users experiencing issues with "newer" metadata types not properly tested by mm
        > if the project has a cached .describe, let's use that to detect metadata types
344284
def get_meta_type_by_name(name):
    data = get_default_metadata_data()
    child_data = get_child_metadata_data()
    for item in data["metadataObjects"]:
        if 'xmlName' in item and item['xmlName'] == name:
            return item
    for item in child_data:
        if 'xmlName' in item and item['xmlName'] == name:
            return item
    '''
        
    '''
    try:
        if config.describe_data != None:
            project_org_describe = config.describe_data
        if config.project != None and os.path.isfile(os.path.join(config.project.location,'config','.describe')):
            project_org_describe = parse_json_from_file(os.path.join(config.project.location,'config','.describe'))
        if project_org_describe != None and 'metadataObjects' in project_org_describe:
            for item in project_org_describe["metadataObjects"]:
                if 'xmlName' in item and item['xmlName'] == name:
                    return item
    except:
        pass
618518
public function compileMetadata()
    {
        if (is_null($this->metadataCache))
        {
            $this->metadata = '{}';

            return;
        }

        $this->metadata = json_encode($this->metadataCache);
    }
196064
def refresh_table_metadata(self, keyspace, table, max_schema_agreement_wait=None):
        
        if not self.control_connection.refresh_schema(target_type=SchemaTargetType.TABLE, keyspace=keyspace, table=table,
                                                      schema_agreement_wait=max_schema_agreement_wait, force=True):
            raise DriverException("Table metadata was not refreshed. See log for details.")
1153295
def fix_for_specific_versions(self, rdf_data, to_replace):
        

        # Load the graph as is so that we can query
        g = self.parse(rdf_data)

        # Retreive the exporter name and version
        query = """
prefix nidm_spm_results_nidm: <http://purl.org/nidash/nidm#NIDM_0000168>
prefix nidm_nidmfsl: <http://purl.org/nidash/nidm#NIDM_0000167>
prefix nidm_softwareVersion: <http://purl.org/nidash/nidm#NIDM_0000122>

SELECT DISTINCT ?type ?version ?exp_act WHERE {
    {?exporter a nidm_nidmfsl: .} UNION {?exporter a nidm_spm_results_nidm: .}.
    ?exporter a ?type ;
        nidm_softwareVersion: ?version .

    ?exp_act prov:wasAssociatedWith ?exporter .

    FILTER ( ?type NOT IN (prov:SoftwareAgent, prov:Agent))
}
        """

        sd = g.query(query)
        objects = dict()
        if sd:
            for row in sd:
                argums = row.asdict()
                if (argums['type'] == NIDM_SPM_RESULTS_NIDM and
                        (argums['version'].eq('12.6903') or
                         argums['version'].eq('12.575ac2c'))):
                    warnings.warn('Applying fixes for SPM exporter ' +
                                  str(argums['version']))
                    # crypto namespace inconsistent with NIDM-Results spec
                    to_replace[('http://id.loc.gov/vocabulary/preservation/' +
                                'cryptographicHashFunctions/')] = (
                                'http://id.loc.gov/vocabulary/preservation/' +
                                'cryptographicHashFunctions#')
                    # Missing 'activity' attribute in qualified Generation
                    to_replace['a prov:Generation .'] = (
                        'a prov:Generation ; prov:activity <' +
                        str(argums['exp_act']) + '> .')

        # Avoid confusion between attribute and
        # class uncorrected p-value
        # cf. https://github.com/incf-nidash/nidm/issues/421
        to_replace[('@prefix nidm_PValueUncorrected: ' +
                    '<http://purl.org/nidash/nidm#NIDM_0000160>')] = (
                    '@prefix nidm_UncorrectedPValue: ' +
                    '<http://purl.org/nidash/nidm#NIDM_0000160>')
        to_replace['nidm_PValueUncorrected'] = 'nidm_UncorrectedPValue'

        if to_replace is not None:
            for to_rep, replacement in to_replace.items():
                rdf_data = rdf_data.replace(to_rep, replacement)

        return rdf_data
446116
function initMetadataConversions() {
  var mdc = this.metadataConversions

  mdc['publish'] = {
    deserialize: function (dateString) {
      if (dateString)
        return new Date(Date.parse(dateString))
      else
        return dateString
    },
    serialize: function (date) {
      if (date instanceof Date) {
        return date.getFullYear() + '-' 
          + ('0' + (date.getMonth()+1)).slice(-2) + '-'
          + ('0' + date.getDate())
      } else {
        return date.toString()
      }
    }
  }

  mdc['tags'] = {
    deserialize: function (tagString) { //prob not very readable
      if (S(tagString).contains(',')) return tagString.split(',').map(function(tag){ return tag.trim() })
      //else if (S(tagString).contains(' ')) return tagString.split(' ').map(function(tag){ return tag.trim() })
      else return [tagString]
    },
    serialize: function (tagArray) {
      return tagArray.join(', ')
    }
  }
}
1249699
def refresh_user_aggregate_metadata(self, keyspace, aggregate, max_schema_agreement_wait=None):
        
        if not self.control_connection.refresh_schema(target_type=SchemaTargetType.AGGREGATE, keyspace=keyspace, aggregate=aggregate,
                                                      schema_agreement_wait=max_schema_agreement_wait, force=True):
            raise DriverException("User Aggregate metadata was not refreshed. See log for details.")
238669
def refresh_metadata
      @cloud_app = MnoEnterprise::App.find params[:id]
      result = @cloud_app.refresh_metadata! params[:metadata_url]
      if result && result[:errors].blank?
        render :show
      else
        render json: result, status: 400
      end
    end
508725
private void updateRequestMetadata() {
        // Take event level metadata, merge with top level metadata
        // event level metadata takes precedence
        try {
            JSONObject metadata = new JSONObject();
            Iterator<String> i = prefHelper_.getRequestMetadata().keys();
            while (i.hasNext()) {
                String k = i.next();
                metadata.put(k, prefHelper_.getRequestMetadata().get(k));
            }
            JSONObject originalMetadata = params_.optJSONObject(Defines.Jsonkey.Metadata.getKey());
            if (originalMetadata != null) {
                Iterator<String> postIter = originalMetadata.keys();
                while (postIter.hasNext()) {
                    String key = postIter.next();
                    // override keys from above
                    metadata.put(key, originalMetadata.get(key));
                }
            }
            // Install metadata need to be send only with Install request
            if ((this instanceof ServerRequestRegisterInstall) && prefHelper_.getInstallMetadata().length() > 0) {
                params_.putOpt(Defines.Jsonkey.InstallMetadata.getKey(), prefHelper_.getInstallMetadata());
            }
            params_.put(Defines.Jsonkey.Metadata.getKey(), metadata);
        } catch (JSONException e) {
           PrefHelper.Debug("Could not merge metadata, ignoring user metadata.");
        }
    }
75655
public void clearMetaData(Object key) {        if (key == this.key) {
            key = null;
            wmmd = null;
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "MetaData was removed.");
            }
        } else {
        }
    }
1333506
public function updateCache()
    {
        if ($this->updateAttempted) {
            return;
        }
        $this->updateAttempted = true;

        $this->metadata = $this->downloadMetadata();
        if ($this->metadata === null) {
            return;
        }

        $expires = time() + 24*60*60; // Default expires in one day

        if ($this->metadata->validUntil !== null && $this->metadata->validUntil < $expires) {
            $expires = $this->metadata->validUntil;
        }

        $metadataSerialized = serialize($this->metadata);

        $this->aggregator->addCacheItem($this->cacheId, $metadataSerialized, $expires, $this->cacheTag);
    }
547891
private void updateDetail(TrackMetadataUpdate update, WaveformDetail detail) {
        detailHotCache.put(DeckReference.getDeckReference(update.player, 0), detail);  // Main deck
        if (update.metadata.getCueList() != null) {  // Update the cache with any hot cues in this track as well
            for (CueList.Entry entry : update.metadata.getCueList().entries) {
                if (entry.hotCueNumber != 0) {
                    detailHotCache.put(DeckReference.getDeckReference(update.player, entry.hotCueNumber), detail);
                }
            }
        }
        deliverWaveformDetailUpdate(update.player, detail);
    }
64129
def modify_meta(uid, data_dic, extinfo=None):
        '''
        
        '''
        if extinfo is None:
            extinfo = {}
        title = data_dic['title'].strip()
        if len(title) < 2:
            return False

        cur_info = MPost.get_by_uid(uid)
        if cur_info:
            # ToDo: should not do this. Not for 's'
            if DB_CFG['kind'] == 's':
                entry = TabPost.update(
                    title=title,
                    user_name=data_dic['user_name'],
                    keywords='',
                    time_update=tools.timestamp(),
                    date=datetime.now(),
                    cnt_md=data_dic['cnt_md'],
                    memo=data_dic['memo'] if 'memo' in data_dic else '',
                    logo=data_dic['logo'],
                    order=data_dic['order'],
                    cnt_html=tools.markdown2html(data_dic['cnt_md']),
                    valid=data_dic['valid']
                ).where(TabPost.uid == uid)
                entry.execute()
            else:
                cur_extinfo = cur_info.extinfo
                # Update the extinfo, Not replace
                for key in extinfo:
                    cur_extinfo[key] = extinfo[key]

                entry = TabPost.update(
                    title=title,
                    user_name=data_dic['user_name'],
                    keywords='',
                    time_update=tools.timestamp(),
                    date=datetime.now(),
                    cnt_md=data_dic['cnt_md'],
                    memo=data_dic['memo'] if 'memo' in data_dic else '',
                    logo=data_dic['logo'],
                    order=data_dic['order'] if 'order' in data_dic else '',
                    cnt_html=tools.markdown2html(data_dic['cnt_md']),
                    extinfo=cur_extinfo,
                    valid=data_dic['valid']
                ).where(TabPost.uid == uid)
                entry.execute()
        else:
            return MPost.add_meta(uid, data_dic, extinfo)
        return uid
25918
function validateMetadata(metadataPath, cb) {
  validateJSonStructure(metadataPath, function(err, metadataObject) {
    if (err) {
      cb(err, null);
    } else {
      cb(null, metadataObject.files);
    }
  });
}
132111
private void updateMeta() {
    meta = new BundleMeta();
    BundleMeta origmeta = source.getMeta();
    for(int i = 0; i < origmeta.size(); i++) {
      SimpleTypeInformation<?> type = origmeta.get(i);
      if(column < 0) {
        // Test whether this type matches
        if(TypeUtil.NUMBER_VECTOR_VARIABLE_LENGTH.isAssignableFromType(type)) {
          if(type instanceof VectorFieldTypeInformation) {
            @SuppressWarnings("unchecked")
            final VectorFieldTypeInformation<V> castType = (VectorFieldTypeInformation<V>) type;
            if(dim != -1 && castType.mindim() > dim) {
              throw new AbortException("Would filter all vectors: minimum dimensionality " + castType.mindim() + " > desired dimensionality " + dim);
            }
            if(dim != -1 && castType.maxdim() < dim) {
              throw new AbortException("Would filter all vectors: maximum dimensionality " + castType.maxdim() + " < desired dimensionality " + dim);
            }
            if(dim == -1) {
              dim = castType.mindim();
            }
            if(castType.mindim() == castType.maxdim()) {
              meta.add(castType);
              column = i;
              continue;
            }
          }
          @SuppressWarnings("unchecked")
          final VectorTypeInformation<V> castType = (VectorTypeInformation<V>) type;
          if(dim != -1) {
            meta.add(new VectorFieldTypeInformation<>(FilterUtil.guessFactory(castType), dim, dim, castType.getSerializer()));
          }
          else {
            LOG.warning("No dimensionality yet for column " + i);
            meta.add(castType);
          }
          column = i;
          continue;
        }
      }
      meta.add(type);
    }
  }
713217
function(cb) {
        var flvmeta = self._outputs.some(function(output) {
          // Remove flvmeta flag on non-file output
          if (output.flags.flvmeta && !output.isFile) {
            self.logger.warn('Updating flv metadata is only supported for files');
            output.flags.flvmeta = false;
          }

          return output.flags.flvmeta;
        });

        if (flvmeta) {
          self._getFlvtoolPath(function(err) {
            cb(err);
          });
        } else {
          cb();
        }
      }
598715
private function loadCacheMetaData()
    {
        if (isset($this->metaData)) {
            return;
        }

        $metaFile = $this->cacheDirectory . '/cache.meta';
        $this->metaData = array();

        if (file_exists($metaFile)) {
            $this->metaData = unserialize(file_get_contents($metaFile));
        }
    }
855485
private void updateMeta(BundleMeta meta) {
    int cols = meta.size();
    densecols = BitsUtil.zero(cols);
    for(int i = 0; i < cols; i++) {
      if(TypeUtil.SPARSE_VECTOR_VARIABLE_LENGTH.isAssignableFromType(meta.get(i))) {
        throw new AbortException("Filtering sparse vectors is not yet supported by this filter. Please contribute.");
      }
      // TODO: only check for double and float?
      if(TypeUtil.NUMBER_VECTOR_VARIABLE_LENGTH.isAssignableFromType(meta.get(i))) {
        BitsUtil.setI(densecols, i);
        continue;
      }
      if(TypeUtil.DOUBLE_VECTOR_FIELD.isAssignableFromType(meta.get(i))) {
        BitsUtil.setI(densecols, i);
        continue;
      }
    }
  }