:param attrs:  Current Attribute list
    :param extraAttrMap:  Additional attributes to be added
    :return: new_attr
165874
def _add_extra_attributes(attrs, extra_attr_map):
    
    for attr in extra_attr_map:
        if attr not in attrs:
            attrs[attr] = extra_attr_map[attr]
    return attrs
553522
def _combine_attribute(attr_1, attr_2, len_1, len_2):
        
        if isinstance(attr_1, list) or isinstance(attr_2, list):
            attribute = np.concatenate((attr_1, attr_2), axis=0)
            attribute_changes = True
        else:
            if isinstance(attr_1, list) and isinstance(attr_2, list) and np.allclose(attr_1, attr_2):
                attribute = attr_1
                attribute_changes = False
            else:
                attribute = [attr_1.copy()] * len_1 if type(attr_1) != list else attr_1.copy()
                attribute.extend([attr_2.copy()] * len_2 if type(attr_2 != list) else attr_2.copy())
                attribute_changes = True
        return attribute, attribute_changes
423088
def add_edge_attributes(self, edge, attrs):
        
        for attr in attrs:
            self.add_edge_attribute(edge, attr)
882456
def attr(cls, iterable, attr_name):
    

    return cls(getattr(x, attr_name) for x in iterable)
921174
def update_attributes(self, attributes):
        
        attribute_update = self._post_object(self.update_api.attributes.update, attributes)
        return ExistAttributeResponse(attribute_update)
669970
def assign(self, attrs):
        
        for k, v in attrs.items():
            setattr(self, k, v)
167425
def _original_attr(self, attr_name):
        
        try:
            return getattr(
                getattr(self.obj.__class__, attr_name), '_doubles_target_method', None
            )
        except AttributeError:
            return None
982722
def _add_standard_attributes(cls):
        
        setattr(
            cls.context.new_class,
            cls.context.new_meta['state_attribute_name'],
            cls.context.state_value)
        setattr(
            cls.context.new_class,
            cls.context.state_name,
            utils.state_property)

        setattr(cls.context.new_class, 'is_', utils.is_)
        setattr(cls.context.new_class, 'can_be_', utils.can_be_)
        setattr(cls.context.new_class, 'set_', utils.set_)
598322
def update_attributes(self, id, old_attrs, new_attrs):
        
        update = dict()
        set_value = {'attributes.' + k: v for k, v in new_attrs.items() if v is not None}
        if set_value:
            update['$set'] = set_value
        unset_value = {'attributes.' + k: v for k, v in new_attrs.items() if v is None}
        if unset_value:
            update['$unset'] = unset_value

        if update:
            response = self.get_db().alerts.update_one({'_id': {'$regex': '^' + id}}, update=update)
            return response.matched_count > 0
832335
def _add_attribute_values(self, value, att_mappings, indices):
        
        for i in indices:
            att_mappings[i].append(value)
1255248
def update_attribute(attr,**kwargs):
    

    log.debug("Updating attribute: %s", attr.name)
    attr_i = _get_attr(attr.id)
    attr_i.name = attr.name
    attr_i.dimension_id = attr.dimension_id
    attr_i.description = attr.description

    #Make sure an update hasn't caused an inconsistency.
    #check_sion(attr_i.id)

    db.DBSession.flush()
    return JSONObject(attr_i)
977058
def _add_repr(cls, ns=None, attrs=None):
    
    if attrs is None:
        attrs = cls.__attrs_attrs__

    cls.__repr__ = _make_repr(attrs, ns)
    return cls
242921
def add_attributes(attrs,**kwargs):
    

    #Check to see if any of the attributs being added are already there.
    #If they are there already, don't add a new one. If an attribute
    #with the same name is there already but with a different dimension,
    #add a new attribute.

    # All existing attributes
    all_attrs = db.DBSession.query(Attr).all()
    attr_dict = {}
    for attr in all_attrs:
        attr_dict[(attr.name.lower(), attr.dimension_id)] = JSONObject(attr)

    attrs_to_add = []
    existing_attrs = []
    for potential_new_attr in attrs:
        if potential_new_attr is not None:
            # If the attrinute is None we cannot manage it
            log.debug("Adding attribute: %s", potential_new_attr)

            if attr_dict.get((potential_new_attr.name.lower(), potential_new_attr.dimension_id)) is None:
                attrs_to_add.append(JSONObject(potential_new_attr))
            else:
                existing_attrs.append(attr_dict.get((potential_new_attr.name.lower(), potential_new_attr.dimension_id)))

    new_attrs = []
    for attr in attrs_to_add:
        attr_i = Attr()
        attr_i.name = attr.name
        attr_i.dimension_id = attr.dimension_id
        attr_i.description = attr.description
        db.DBSession.add(attr_i)
        new_attrs.append(attr_i)

    db.DBSession.flush()
    

    new_attrs = new_attrs + existing_attrs

    return [JSONObject(a) for a in new_attrs]
991667
private void addAttributeInternal(EntityType entityType, Attribute attr) {
    if (!isPersisted(attr)) {
      return;
    }

    if (isMultipleReferenceType(attr)) {
      createJunctionTable(entityType, attr);

      if (attr.getDefaultValue() != null && !attr.isNillable()) {
        @SuppressWarnings("unchecked")
        Iterable<Entity> defaultRefEntities =
            (Iterable<Entity>) AttributeUtils.getDefaultTypedValue(attr);
        if (!Iterables.isEmpty(defaultRefEntities)) {
          createJunctionTableRows(entityType, attr, defaultRefEntities);
        }
      }
    } else {
      createColumn(entityType, attr);
    }
  }
37517
def define_attribute(self, name, atype, data=None):
        
        self.attributes.append(name)
        assert atype in TYPES, "Unknown type '%s'. Must be one of: %s" % (atype, ', '.join(TYPES),)
        self.attribute_types[name] = atype
        self.attribute_data[name] = data
773085
def copy_with_new_atts(self, **attributes):
        """"""
        return FmtStr(*[Chunk(bfs.s, bfs.atts.extend(attributes))
                        for bfs in self.chunks])
164369
def attributes!(object, *attrs)
      attrs.each do |attr|
        method_missing attr, object.send(attr)
      end
    end