Protcted create attribute
169480
protected function createAttribute($condition, $key, $value = NULL)
    {
        return ! empty($condition) ? ' ' . $key . '="' . trim($value ?? $condition) . '"' : '';
    }
168170
def make_attrgetter(environment, attribute, postprocess=None):
    
    if attribute is None:
        attribute = []
    elif isinstance(attribute, string_types):
        attribute = [int(x) if x.isdigit() else x for x in attribute.split('.')]
    else:
        attribute = [attribute]

    def attrgetter(item):
        for part in attribute:
            item = environment.getitem(item, part)

        if postprocess is not None:
            item = postprocess(item)

        return item

    return attrgetter
1094205
function _gpfDefClassAttrBuild (member, attribute, newPrototype) {
    /*jshint validthis:true*/
    var attributeEntityDefinition = _gpfDefineEntitiesFindByConstructor(attribute.constructor);
    if (!attributeEntityDefinition._singleton) {
        attribute._memberName = member;
        attribute._ClassConstructor = newPrototype.constructor;
    }
    attribute._build(member, this, newPrototype); //eslint-disable-line no-invalid-this
}
38711
def stage_tc_create_attribute(self, attribute_type, attribute_value, resource):
        
        attribute_data = {'type': str(attribute_type), 'value': str(attribute_value)}
        # handle default description and source
        if attribute_type in ['Description', 'Source']:
            attribute_data['displayed'] = True

        attrib_resource = resource.attributes()
        attrib_resource.body = json.dumps(attribute_data)
        attrib_resource.http_method = 'POST'

        # add the attribute
        a_response = attrib_resource.request()
        if a_response.get('status') != 'Success':
            self.log.warning(
                '[stage] Failed adding attribute type "{}":"{}" ({}).'.format(
                    attribute_type, attribute_value, a_response.get('response').text
                )
            )
650518
def __makeattr(self, name):
        """"""
        # print "makeattr", self.__name__, name
        target = None
        if '__onfirstaccess__' in self.__map__:
            target = self.__map__.pop('__onfirstaccess__')
            importobj(*target)()
        try:
            modpath, attrname = self.__map__[name]
        except KeyError:
            if target is not None and name != '__onfirstaccess__':
                # retry, onfirstaccess might have set attrs
                return getattr(self, name)
            raise AttributeError(name)
        else:
            result = importobj(modpath, attrname)
            setattr(self, name, result)
            try:
                del self.__map__[name]
            except KeyError:
                pass  # in a recursive-import situation a double-del can happen
            return result
1089339
def make_fileitem_fileattributes(attributes, condition='contains', negate=False, preserve_case=False):
    
    document = 'FileItem'
    search = 'FileItem/FileAttributes'
    content_type = 'string'
    content = attributes
    ii_node = ioc_api.make_indicatoritem_node(condition, document, search, content_type, content,
                                              negate=negate, preserve_case=preserve_case)
    return ii_node
1341347
def _gen_param_code(name, doc, defaultValueStr):
    
    # TODO: How to correctly inherit instance attributes?
    template = '''
    def set$Name(self, value):
        """
        Sets the value of :py:attr:`$name`.
        """
        return self._set($name=value)

    def get$Name(self):
        """
        Gets the value of $name or its default value.
        """
        return self.getOrDefault(self.$name)'''

    Name = name[0].upper() + name[1:]
    return template \
        .replace("$name", name) \
        .replace("$Name", Name) \
        .replace("$doc", doc) \
        .replace("$defaultValueStr", str(defaultValueStr))
248921
private void addAttribute(Field field, int begin, int end) {
        FieldPosition pos = new FieldPosition(field);
        pos.setBeginIndex(begin);
        pos.setEndIndex(end);
        attributes.add(pos);
    }
1252854
def create(obj: PersistedObject, obj_type: Type[Any], arg_name: str):
        

        return MissingMandatoryAttributeFiles('Multifile object ' + str(obj) + ' cannot be built from constructor of '
                                              'type ' + get_pretty_type_str(obj_type) +
                                              ', mandatory constructor argument \'' + arg_name + '\'was not found on '
                                              'filesystem')
400762
public CodeAttribute createCode()
  {
    CodeAttribute code = new CodeAttribute();
    
    for (int i = 0; i < _attributes.size(); i++) {
      Attribute attr = _attributes.get(i);

      if (attr instanceof CodeAttribute)
        return (CodeAttribute) attr;
    }

    return null;
  }
1071646
public WasAttributedTo newWasAttributedTo(QualifiedName id, 
                                              QualifiedName entity,
					      QualifiedName agent,
					      Collection<Attribute> attributes) {
	WasAttributedTo res = of.createWasAttributedTo();
	res.setId(id);
	res.setEntity(entity);
	res.setAgent(agent);
        setAttributes(res, attributes);
	return res;
    }
701696
def create_identity(attributes, start=nil)
      start ||= START_OF_TIME
      create(attributes.merge(START_COLUMN=>start || START_OF_TIME))
    end
1211664
def CreateReply(self, **attributes):
        
        return CoAPacket(CoAACK, self.id,
            self.secret, self.authenticator, dict=self.dict,
            **attributes)
1234434
def create_attributes(klass, attributes, previous_object=None):
        

        return {
            'name': attributes.get(
                'name',
                previous_object.name if previous_object is not None else ''
            ),
            'description': attributes.get(
                'description',
                previous_object.description if previous_object is not None else ''
            ),
            'environments': attributes.get(
                'environments',
                [e.to_json() for e in previous_object.environments] if previous_object is not None else []  # Will default to master if empty
            )
        }
710658
function makeAttributesString(node, profile) {
		var attrQuote = profile.attributeQuote();
		var cursor = profile.cursor();
		
		return node.attributeList().map(function(a) {
			var isBoolean = profile.isBoolean(a.name, a.value);
			var attrName = profile.attributeName(a.name);
			var attrValue = isBoolean ? attrName : a.value;
			if (isBoolean && profile.allowCompactBoolean()) {
				return ' ' + attrName;
			}
			return ' ' + attrName + '=' + attrQuote + (attrValue || cursor) + attrQuote;
		}).join('');
	}
363093
def create_create():
    
    create = upkey("create").setResultsName("action")
    hash_key = Group(upkey("hash") + upkey("key"))
    range_key = Group(upkey("range") + upkey("key"))

    local_index = Group(
        index
        + Suppress("(")
        + primitive
        + Optional(Suppress(",") + include_vars)
        + Suppress(")")
    )
    index_type = (
        (hash_key | range_key | local_index)
        .setName("index specification")
        .setResultsName("index")
    )

    attr_declaration = (
        Group(var.setResultsName("name") + type_ + Optional(index_type))
        .setName("attr")
        .setResultsName("attr")
    )
    attrs_declaration = (
        Suppress("(")
        + Group(delimitedList(attr_declaration))
        .setName("attrs")
        .setResultsName("attrs")
        + Optional(Suppress(",") + throughput)
        + Suppress(")")
    )

    global_index = _global_index()
    global_indexes = Group(OneOrMore(global_index)).setResultsName("global_indexes")

    return (
        create
        + table_key
        + Optional(if_not_exists)
        + table
        + attrs_declaration
        + Optional(global_indexes)
    )
1353193
function (attr, expr, context, data) {
                var val = this.exprEvaluator(expr, context, data);
                if (val || typeof val === 'string' || typeof val === 'number') {
                    return " " + attr + '=' + this.generateAttribute(val + '');
                } else {
                    //else if undefined, null, false then don't render attribute.
                    return '';
                }
            }