Builds the metadata need for each property for things like feed customizations and navigation properties
976129
def build_property_metadata(props, keys=[])
    metadata = {}
    props.each do |property_element|
      prop_meta = PropertyMetadata.new(property_element)
      prop_meta.is_key = keys.include?(prop_meta.name)

      # If this is a navigation property, we need to add the association to the property metadata
      prop_meta.association = Association.new(property_element, @edmx) if prop_meta.nav_prop
      metadata[prop_meta.name] = prop_meta
    end
    metadata
  end
251500
def _init_metadata(self, **kwargs):
        """"""

        osid_objects.OsidSourceableForm._init_metadata(self)
        osid_objects.OsidObjectForm._init_metadata(self, **kwargs)
        self._copyright_registration_default = self._mdata['copyright_registration']['default_string_values'][0]
        update_display_text_defaults(self._mdata['copyright'], self._locale_map)
        self._copyright_default = dict(self._mdata['copyright']['default_string_values'][0])
        update_display_text_defaults(self._mdata['title'], self._locale_map)
        self._title_default = dict(self._mdata['title']['default_string_values'][0])
        self._distribute_verbatim_default = self._mdata['distribute_verbatim']['default_boolean_values'][0]
        self._created_date_default = self._mdata['created_date']['default_date_time_values'][0]
        self._distribute_alterations_default = self._mdata['distribute_alterations']['default_boolean_values'][0]
        update_display_text_defaults(self._mdata['principal_credit_string'], self._locale_map)
        self._principal_credit_string_default = dict(self._mdata['principal_credit_string']['default_string_values'][0])
        self._published_date_default = self._mdata['published_date']['default_date_time_values'][0]
        self._source_default = self._mdata['source']['default_id_values'][0]
        self._provider_links_default = self._mdata['provider_links']['default_id_values']
        self._public_domain_default = self._mdata['public_domain']['default_boolean_values'][0]
        self._distribute_compositions_default = self._mdata['distribute_compositions']['default_boolean_values'][0]
        self._composition_default = self._mdata['composition']['default_id_values'][0]
        self._published_default = self._mdata['published']['default_boolean_values'][0]
309134
def metadata(self):
        """"""
        self.metadata_path = os.path.join(self.path, 'metadata.rb')
        if not os.path.isfile(self.metadata_path):
            raise ValueError("Cookbook needs metadata.rb, %s"
                             % self.metadata_path)

        if not self._metadata:
            self._metadata = MetadataRb(open(self.metadata_path, 'r+'))

        return self._metadata
588156
def metadata
      {:definitions => representer_attrs.grep(Definition).map {|definition| definition.name},
       :links => representer_attrs.grep(Link).map {|link| link.options[:as] ? {link.rel => {'as' => link.options[:as]}} : link.rel}
      }
    end
1142111
protected void generateMetadata(IXmlStyleAppendable it) {
		it.appendTagWithValue("property", //$NON-NLS-1$
				Strings.concat(";", getMimeTypes()), //$NON-NLS-1$
				"name", "mimetypes"); //$NON-NLS-1$ //$NON-NLS-2$

		final StringBuilder buffer = new StringBuilder();
		for (final String fileExtension : getLanguage().getFileExtensions()) {
			if (buffer.length() > 0) {
				buffer.append(";"); //$NON-NLS-1$
			}
			buffer.append("*.").append(fileExtension); //$NON-NLS-1$
		}
		it.appendTagWithValue("property", //$NON-NLS-1$
				buffer.toString(),
				"name", "globs"); //$NON-NLS-1$ //$NON-NLS-2$

		it.appendTagWithValue("property", //$NON-NLS-1$
				"//", //$NON-NLS-1$
				"name", "line-comment-start"); //$NON-NLS-1$ //$NON-NLS-2$

		it.appendTagWithValue("property", //$NON-NLS-1$
				"/*", //$NON-NLS-1$
				"name", "block-comment-start"); //$NON-NLS-1$ //$NON-NLS-2$

		it.appendTagWithValue("property", //$NON-NLS-1$
				"*/", //$NON-NLS-1$
				"name", "block-comment-end"); //$NON-NLS-1$ //$NON-NLS-2$
	}
60028
def _CreateFeedMapping(client, feed_details):
  
  # Get the FeedMappingService.
  feed_mapping_service = client.GetService('FeedMappingService',
                                           version='v201809')

  # Create the operation.
  operation = {
      # Create the feed mapping.
      'operand': {
          'criterionType': DSA_PAGE_FEED_CRITERION_TYPE,
          'feedId': feed_details.feed_id,
          # Map the feedAttributeIds to the fieldId constants.
          'attributeFieldMappings': [
              {
                  'feedAttributeId': feed_details.url_attribute_id,
                  'fieldId': DSA_PAGE_URLS_FIELD_ID
              },
              {
                  'feedAttributeId': feed_details.label_attribute_id,
                  'fieldId': DSA_LABEL_FIELD_ID
              }
          ]
      },
      'operator': 'ADD'
  }

  # Add the feed mapping.
  feed_mapping_service.mutate([operation])
22774
def get_mapping(self, meta_fields=True):
        '''
        
        '''
        return {'properties': dict((name, field.json()) for name, field in iteritems(self.fields) if meta_fields or name not in AbstractField.meta_fields)}
1178387
function createMetaData (options = {}) {
  const metadata = {
    name: options.name, // The proejcts name
    namespace: options.namespace // The current namespace from the config, not required and should be picked up anyway, but...
  };

  // Add labels to the metadata
  // Labels here should be project name and version
  if (options.labels) {
    metadata.labels = labels(options.labels);
  }

  return metadata;
}
600859
def _init_metadata(self):
        """"""

        # pylint: disable=attribute-defined-outside-init
        # this method is called from descendent __init__
        self._mdata.update(default_mdata.get_osid_form_mdata())
        update_display_text_defaults(self._mdata['journal_comment'], self._locale_map)
        for element_name in self._mdata:
            self._mdata[element_name].update(
                {'element_id': Id(self._authority,
                                  self._namespace,
                                  element_name)})
        self._journal_comment_default = self._mdata['journal_comment']['default_string_values'][0]
        self._validation_messages = {}
168915
def set_meta_all(self, props):
        
        delta_props = self.get_meta()
        for key in delta_props.keys():
            if key not in props:
                delta_props[key] = None
        delta_props.update(props)
        self.set_meta(delta_props)
744720
def determine_metadata(self, request, view):
        """"""
        metadata = super(
            DynamicMetadata,
            self).determine_metadata(
            request,
            view)
        metadata['features'] = getattr(view, 'features', [])
        if hasattr(view, 'get_serializer'):
            serializer = view.get_serializer(dynamic=False)
            if hasattr(serializer, 'get_name'):
                metadata['resource_name'] = serializer.get_name()
            if hasattr(serializer, 'get_plural_name'):
                metadata['resource_name_plural'] = serializer.get_plural_name()
        metadata['properties'] = self.get_serializer_info(serializer)
        return metadata
1334818
@Override
	public PropertyDocument build() {
		prepareBuild();
		return factory.getPropertyDocument(
				(PropertyIdValue) this.entityIdValue, this.labels,
				this.descriptions, this.aliases, getStatementGroups(),
				this.datatype, this.revisionId);
	}
197156
protected void buildMeta() {
    if(haslabels) {
      meta = new BundleMeta(2);
      meta.add(getTypeInformation(mindim, maxdim));
      meta.add(TypeUtil.LABELLIST);
    }
    else {
      meta = new BundleMeta(1);
      meta.add(getTypeInformation(mindim, maxdim));
    }
  }
247326
function (metadata) {
    if (typeof metadata === 'string') {
        return getJsonPropertyDecorator({ name: metadata, required: false, access: exports.AccessType.BOTH });
    }
    else {
        return getJsonPropertyDecorator(metadata);
    }
}
341395
def build_metadata_class(specfile):
    """"""
    with open(specfile) as f:
        spec = json.load(f)
        name = os.path.basename(specfile).split('.')[0]
        spec['name'] = name

        env = get_jinja_env()

        metadata_template = env.get_template('metadata.py.jinja2')
        with open('pycanvas/meta/{}.py'.format(name), 'w') as t:
            t.write(metadata_template.render(spec=spec))
119869
def _build_resource_from_properties(obj, filter_fields):
    
    partial = {}
    for filter_field in filter_fields:
        api_field = obj._PROPERTY_TO_API_FIELD.get(filter_field)
        if api_field is None and filter_field not in obj._properties:
            raise ValueError("No property %s" % filter_field)
        elif api_field is not None:
            partial[api_field] = obj._properties.get(api_field)
        else:
            # allows properties that are not defined in the library
            # and properties that have the same name as API resource key
            partial[filter_field] = obj._properties[filter_field]

    return partial
609982
private function populate_properties()
    {
        global $wp;

        $this->is_mobile = (bool)\wp_is_mobile();
        $this->scheme = \is_ssl() ? 'https' : 'http';

        $this->matched_query = $wp->matched_query;
        $this->matched_rule = $wp->matched_rule;

        $this->url = Theme_Utils::get_current_url();

        $this->path = \rtrim(\parse_url($this->url, PHP_URL_PATH), '/');
    }