Handle the DefineMorphShape2 tag.
174395
def _handle_tag_definemorphshape2(self):
        """"""
        obj = _make_object("DefineMorphShape2")
        obj.CharacterId = unpack_ui16(self._src)
        obj.StartBounds = self._get_struct_rect()
        obj.EndBounds = self._get_struct_rect()
        obj.StartEdgeBounds = self._get_struct_rect()
        obj.EndEdgeBounds = self._get_struct_rect()

        bc = BitConsumer(self._src)
        bc.u_get(6)  # reserved
        obj.UsesNonScalingStrokes = bc.u_get(1)
        obj.UsesScalingStrokes = bc.u_get(1)

        obj.Offset = unpack_ui32(self._src)

        # FIXME: this tag needs more work; I'm skipping some attributes here
        self._src.read(obj.Offset)

        obj.EndEdges = self._get_struct_shape()
        return obj
981327
def handle_starttag(self, tagName, attributeList, isSelfClosing=False):
        '''
            
        '''
        tagName = tagName.lower()
        inTag = self._inTag

        if isSelfClosing is False and tagName in IMPLICIT_SELF_CLOSING_TAGS:
            isSelfClosing = True

        newTag = AdvancedTag(tagName, attributeList, isSelfClosing)
        if self.root is None:
            self.root = newTag
        elif len(inTag) > 0:
            inTag[-1].appendChild(newTag)
        else:
            raise MultipleRootNodeException()

        if self.inPreformatted is 0:
            newTag._indent = self._getIndent()

        if tagName in PREFORMATTED_TAGS:
            self.inPreformatted += 1

        if isSelfClosing is False:
            inTag.append(newTag)
            if tagName != INVISIBLE_ROOT_TAG:
                self.currentIndentLevel += 1
409642
function Morph(domHelper, contextualElement) {
    this.domHelper = domHelper;
    // context if content if current content is detached
    this.contextualElement = contextualElement;
    // inclusive range of morph
    // these should be nodeType 1, 3, or 8
    this.firstNode = null;
    this.lastNode = null;

    // flag to force text to setContent to be treated as html
    this.parseTextAsHTML = false;

    // morph list graph
    this.parentMorphList = null;
    this.previousMorph = null;
    this.nextMorph = null;
  }
586027
function processTag(item, profile) {
		if (!item.parent) { // looks like it's root element
			return item;
		}
		
		var attrs = makeAttributesString(item, profile); 
		var cursor = profile.cursor();
		var isUnary = abbrUtils.isUnary(item);
		var start = '';
		var end = '';
			
		// define opening and closing tags
		if (!item.isTextNode()) {
			var tagName = profile.tagName(item.name());
			if (isUnary) {
				start = '<' + tagName + attrs + profile.selfClosing() + '>';
				item.end = '';
			} else {
				start = '<' + tagName + attrs + '>';
				end = '</' + tagName + '>';
			}
		}
		
		var placeholder = '%s';
		// We can't just replace placeholder with new value because
		// JavaScript will treat double $ character as a single one, assuming
		// we're using RegExp literal.
		item.start = utils.replaceSubstring(item.start, start, item.start.indexOf(placeholder), placeholder);
		item.end = utils.replaceSubstring(item.end, end, item.end.indexOf(placeholder), placeholder);
		
		// should we put caret placeholder after opening tag?
		if (
				!item.children.length 
				&& !isUnary 
				&& !~item.content.indexOf(cursor)
				&& !tabStops.extract(item.content).tabstops.length
			) {
			item.start += cursor;
		}
		
		return item;
	}
1068653
def handle_starttag(self, tagName, attributeList, isSelfClosing=False):
        '''
            
        '''
        newTag = AdvancedHTMLParser.handle_starttag(self, tagName, attributeList, isSelfClosing)
        self._indexTag(newTag)

        return newTag
903493
function handleTag_code() {
    if ($this->hasParent('pre')) {
      # ignore code blocks inside <pre>
      return;
    }
    if ($this->parser->isStartTag) {
      $this->buffer();
    } else {
      $buffer = $this->unbuffer();
      # use as many backticks as needed
      preg_match_all('#`+#', $buffer, $matches);
      if (!empty($matches[0])) {
        rsort($matches[0]);

        $ticks = '`';
        while (true) {
          if (!in_array($ticks, $matches[0])) {
            break;
          }
          $ticks .= '`';
        }
      } else {
        $ticks = '`';
      }
      if ($buffer[0] == '`' || substr($buffer, -1) == '`') {
        $buffer = ' '.$buffer.' ';
      }
      $this->out($ticks.$buffer.$ticks, true);
    }
  }
659421
function handleTagToText() {
    if (!$this->keepHTML) {
      if (!$this->parser->isStartTag && $this->parser->isBlockElement) {
        $this->setLineBreaks(2);
      }
    } else {
      # dont convert to markdown inside this tag
      /** TODO: markdown extra **/
      if (!$this->parser->isEmptyTag) {
        if ($this->parser->isStartTag) {
          if (!$this->skipConversion) {
            $this->skipConversion = $this->parser->tagName.'::'.implode('/', $this->parser->openTags);
          }
        } else {
          if ($this->skipConversion == $this->parser->tagName.'::'.implode('/', $this->parser->openTags)) {
            $this->skipConversion = false;
          }
        }
      }

      if ($this->parser->isBlockElement) {
        if ($this->parser->isStartTag) {
          if (in_array($this->parent(), array('ins', 'del'))) {
            # looks like ins or del are block elements now
            $this->out("\n", true);
            $this->indent('  ');
          }
          if ($this->parser->tagName != 'pre') {
            $this->out($this->parser->node."\n".$this->indent);
            if (!$this->parser->isEmptyTag) {
              $this->indent('  ');
            } else {
              $this->setLineBreaks(1);
            }
            $this->parser->html = ltrim($this->parser->html);
          } else {
            # don't indent inside <pre> tags
            $this->out($this->parser->node);
            static $indent;
            $indent =  $this->indent;
            $this->indent = '';
          }
        } else {
          if (!$this->parser->keepWhitespace) {
            $this->output = rtrim($this->output);
          }
          if ($this->parser->tagName != 'pre') {
            $this->indent('  ');
            $this->out("\n".$this->indent.$this->parser->node);
          } else {
            # reset indentation
            $this->out($this->parser->node);
            static $indent;
            $this->indent = $indent;
          }

          if (in_array($this->parent(), array('ins', 'del'))) {
            # ins or del was block element
            $this->out("\n");
            $this->indent('  ');
          }
          if ($this->parser->tagName == 'li') {
            $this->setLineBreaks(1);
          } else {
            $this->setLineBreaks(2);
          }
        }
      } else {
        $this->out($this->parser->node);
      }
      if (in_array($this->parser->tagName, array('code', 'pre'))) {
        if ($this->parser->isStartTag) {
          $this->buffer();
        } else {
          # add stuff so cleanup just reverses this
          $this->out(str_replace('&lt;', '&amp;lt;', str_replace('&gt;', '&amp;gt;', $this->unbuffer())));
        }
      }
    }
  }
1224050
def _parse_parameter(tag, parser, parent):
    """"""
    name, modifiers, dtype, kind = _parse_common(tag)
    if "default" in tag.attrib:
        default = tag.attrib["default"]
    else:
        default = None
    if "dimension" in tag.attrib:
        dimension = tag.attrib["dimension"]
    else:
        dimension = None

    result = ValueElement(name, modifiers, dtype, kind, default, dimension, parent)
    doc = DocElement(tag, parser, result)
    result.docstring.append(doc)
    parent.add_parameter(result)
1201308
def _handle_tag(self, tag, attrs, self_closing):
        

        if tag.lower() == 'img':
            attrs = self._image_attrs(attrs)

        # Remap the attributes
        out_attrs = []
        for key, val in attrs:
            if (key.lower() == 'href'
                    or (key.lower() == 'src' and not tag.lower() == 'img')):
                out_attrs.append((key, links.resolve(
                    val, self._search_path, self._config.get('absolute'))))
            else:
                out_attrs.append((key, val))

        self.append(
            utils.make_tag(
                tag,
                out_attrs,
                self_closing))
1123113
def handle_starttag(self, tagName, attributeList, isSelfClosing=False):
        '''
            
        '''
        tagName = tagName.lower()
        inTag = self._inTag

        if isSelfClosing is False and tagName in IMPLICIT_SELF_CLOSING_TAGS:
            isSelfClosing = True

        newTag = AdvancedTag(tagName, attributeList, isSelfClosing, ownerDocument=self)
        if self.root is None:
            self.root = newTag
        elif len(inTag) > 0:
            inTag[-1].appendChild(newTag)
        else:
            raise MultipleRootNodeException()

        if isSelfClosing is False:
            inTag.append(newTag)

        return newTag
636272
def handle_starttag(self, tag, attrs):
        """"""
        if (tag in self.newline_before_elements):
            self.text += '\n'
        if (tag in self.stroke_before_elements and not
                self.text.endswith(self.stroke_text)):
            # Put a stroke in front of every relevant element, if there is some
            # content between it and its predecessor
            self.text += self.stroke_text
        if tag == 'a':
            # If it's a link, append it to the link list
            for attr in attrs:
                if attr[0] == 'href':
                    self.links.append((len(self.links) + 1, attr[1]))
452957
private void applyDefinitionComponent(MarkupDocBuilder markupDocBuilder, String definitionName, Model model) {
        definitionComponent.apply(markupDocBuilder, DefinitionComponent.parameters(
                definitionName,
                model,
                2));
    }
798401
def fix_tag(value):
    """"""
    if sys.version_info[0] == 2:
        return bytes(value)
    else:
        if type(value) == bytes:
            return value
        elif type(value) == str:
            return value.encode('ASCII')
        return str(value).encode('ASCII')
113599
def _check_shape(var, name, shape, shape2=None):
    """
    varshape = np.shape(var)
    if shape != varshape:
        if shape2:
            if shape2 != varshape:
                print('* ERROR   :: Parameter ' + name + ' has wrong shape!' +
                      ' : ' + str(varshape) + ' instead of ' + str(shape) +
                      'or' + str(shape2) + '.')
                raise ValueError(name)
        else:
            print('* ERROR   :: Parameter ' + name + ' has wrong shape! : ' +
                  str(varshape) + ' instead of ' + str(shape) + '.')
            raise ValueError(name)
989364
def as_tag(value)
      case true
      when value.tag?
        element(value) ? value : nil
      when value.dicom_name?
        get_tag(value)
      when value.dicom_method?
        get_tag(@names_from_methods[value.to_sym])
      else
        nil
      end
    end
391388
def process_tag(self, tag):
        """"""
        try:
            if not self._is_function(tag):
                self._tag_type_processor[tag.data_type](tag)
        except KeyError as ex:
            raise Exception('Tag type {0} not recognized for tag {1}'
                            .format(
                                tag.data_type,
                                tag.name),
                            ex)
749606
def _make_tempy_tag(self, tag, attrs, void):
        """"""
        tempy_tag_cls = getattr(self.tempy_tags, tag.title(), None)
        if not tempy_tag_cls:
            unknow_maker = [self.unknown_tag_maker, self.unknown_tag_maker.Void][void]
            tempy_tag_cls = unknow_maker[tag]
        attrs = {Tag._TO_SPECIALS.get(k, k): v or True for k, v in attrs}
        tempy_tag = tempy_tag_cls(**attrs)
        if not self.current_tag:
            self.result.append(tempy_tag)
            if not void:
                self.current_tag = tempy_tag
        else:
            if not tempy_tag._void:
                self.current_tag(tempy_tag)
                self.current_tag = self.current_tag.childs[-1]