Add alt tag to model.
548534
public function getAltAttribute()
    {
        $data = unserialize($this->attributes['data']);

        return $data === false ? null : (isset($data['alt']) ? $data['alt'] : null);
    }
1335427
def add_alternate_formats(self, filename):
        """"""
        with open(filename, "r") as infile:
            xtree = etree.parse(infile)
        self.alt_territory = {}  # country_code to XAlternateTerritory
        xterritories = xtree.find(TOP_XPATH)
        for xterritory in xterritories:
            if xterritory.tag == TERRITORY_TAG:
                terrobj = XAlternateTerritory(xterritory)
                id = str(terrobj.country_code)
                if id in self.alt_territory:
                    raise Exception("Duplicate entry for %s" % id)
                self.alt_territory[id] = terrobj
            else:
                raise Exception("Unexpected element %s found" % xterritory.tag)
288992
def _add_source(model):
    
    ignored_keys = {"author_tags", "original_xml", "additional_info"}

    # convert all values to source strings
    source = "Aleph"
    for key, val in model.get_mapping().iteritems():
        if key in ignored_keys:
            continue

        if type(val) in [list, tuple]:
            ss_val = [
                SourceString(item, source).to_dict()
                for item in val
            ]
        else:
            ss_val = [SourceString(val, source).to_dict()]

        setattr(model, key, ss_val)

    return model
993843
function startTag(tag, attr) {
    let attrStr = "";
    if (attr) {
        attrStr = " " + Object.keys(attr).map(function(k) { 
            return k + ' = "' + attr[k] + '"';
        }).join(" ");
    }
    return "<" + tag + attrStr + ">";
}
370680
def add_tag(
            self,
            tag):
        

        if tag.replace("@", "") in self.tags:
            return

        self.refresh
        oldContent = self.to_string(indentLevel=1)
        self.tags += [tag.replace("@", "")]
        newContent = self.to_string(indentLevel=1)

        # ADD DIRECTLY TO CONTENT IF THE PROJECT IS BEING ADDED SPECIFICALLY TO
        # THIS OBJECT
        self.parent._update_document_tree(
            oldContent=oldContent,
            newContent=newContent
        )

        self.refresh
        return None
567730
protected void setAltAttributeFromTitle(Tag tag, String internalUri) {

        boolean hasAltAttrib = (tag.getAttribute("alt") != null);
        if (!hasAltAttrib) {
            String value = null;
            if ((internalUri != null) && (m_rootCms != null)) {
                // internal image: try to read the "alt" text from the "Title" property
                try {
                    value = m_rootCms.readPropertyObject(
                        internalUri,
                        CmsPropertyDefinition.PROPERTY_TITLE,
                        false).getValue();
                } catch (CmsException e) {
                    // property can't be read, ignore
                }
            }
            // some editors add a "/" at the end of the tag, we must make sure to insert before that
            @SuppressWarnings("unchecked")
            Vector<Attribute> attrs = tag.getAttributesEx();
            // first element is always the tag name
            attrs.add(1, new Attribute(" "));
            attrs.add(2, new Attribute("alt", value == null ? "" : value, '"'));
        }
    }
279994
def new_tag(self, label, cfrom=-1, cto=-1, tagtype='', **kwargs):
        '''  '''
        tag_obj = Tag(label, cfrom, cto, tagtype=tagtype, **kwargs)
        return self.add_tag(tag_obj)
1086579
def onTagAdd(self, name, func):
        '''
        

        '''
        # TODO allow name wild cards
        if '*' in name:
            self.ontagaddglobs.add(name, func)
        else:
            self.ontagadds[name].append(func)
1319275
def apply_modification(self):
        """"""
        self.__changing_model = True

        if self.adding_model: self.model.add(self.adding_model)
        elif self.editing_model and self.editing_iter:
            # notifies the currencies model
            path = self.model.get_path(self.editing_iter)
            self.model.row_changed(path, self.editing_iter)            
            pass            
        
        self.view.remove_currency_view()
        self.adding_model = None
        self.editing_model = None
        self.editing_iter = None
        self.curreny = None

        self.unselect()
        self.__changing_model = False
        return
531430
def append_tag(self, field_number, wire_type):
        """"""
        self._stream.append_var_uint32(wire_format.pack_tag(field_number, wire_type))
1279330
public static function img($src, $alt = '', array $attributes = [])
    {
        $attributes = array_merge([
            'src' => $src,
            'alt' => $alt
        ], $attributes);

        return self::tag('img', $attributes);
    }
1243678
def attached_to_model(self):
        """"""
        try:
            if not bool(self._model):
                return False
        except AttributeError:
            return False
        else:
            try:
                return not bool(self._instance)
            except AttributeError:
                return True
511264
def tag_start(self, tag, attrs=None):
        
        """
        return '<%s %s>' % (tag, self.build_attr(attrs)) if attrs else '<%s>' % tag
199181
def end_tag(self, alt=None):
        """"""
        if alt:
            name = alt
        else:
            name = self.name
        return "</" + name + ">"
1273157
def add_tag_command(opts)
      AgentTagManager.instance.add_tags(opts[:tag], opts) do |raw_response|
        reply = @serializer.dump(raw_response) rescue raw_response
        CommandIO.instance.reply(opts[:conn], reply)
      end
    end
931586
def add_model(self, model_type: str, model_uuid: str, meta: dict,
                  template_model: Template, update_default: bool=False):
        """"""
        if update_default or model_type not in self.meta:
            self.meta[model_type] = meta["default"]
        model_meta = meta["model"]
        self.models.setdefault(model_type, {})[model_uuid] = model_meta
        model_directory = os.path.join(self.cached_repo, model_type)
        os.makedirs(model_directory, exist_ok=True)
        model = os.path.join(model_directory, model_uuid + ".md")
        if os.path.exists(model):
            os.remove(model)
        links = {}
        for m_type, items in self.models.items():
            for uuid in items:
                if uuid in model_meta["dependencies"]:
                    links[uuid] = os.path.join("/", m_type, "%s.md" % uuid)
        with open(model, "w") as fout:
            fout.write(template_model.render(model_type=model_type, model_uuid=model_uuid,
                                             meta=model_meta, links=links))
        git.add(self.cached_repo, [model])
        self._log.info("Added %s", model)
782571
def add_tag(self, name, value):
        

        self.tags.append(Tag(name, value))