Prints the tag definitions for a structure.
484051
def PrintTags(self, file):
        """"""
        print >>file, '/* Tag definition for %s */' % self._name
        print >>file, 'enum %s_ {' % self._name.lower()
        for entry in self._entries:
            print >>file, '  %s=%d,' % (self.EntryTagName(entry),
                                        entry.Tag())
        print >>file, '  %s_MAX_TAGS' % (self._name.upper())
        print >>file, '};\n'
844894
def printBasicInfo(onto):
    
    rdfGraph = onto.rdfGraph

    print("_" * 50, "\n")
    print("TRIPLES = %s" % len(rdfGraph))
    print("_" * 50)
    print("\nNAMESPACES:\n")
    for x in onto.ontologyNamespaces:
        print("%s : %s" % (x[0], x[1]))

    print("_" * 50, "\n")
    print("ONTOLOGY METADATA:\n")
    for x, y in onto.ontologyAnnotations():
        print(
            "%s: \n	 %s" % (uri2niceString(x, onto.ontologyNamespaces), uri2niceString(y, onto.ontologyNamespaces)))
    print("_" * 50, "\n")

    print("CLASS TAXONOMY:\n")
    onto.printClassTree()
    print("_" * 50, "\n")
567788
def print_build_info(self):
        """"""
        if self.static_extension:
            build_type = "static extension"
        else:
            build_type = "dynamic extension"
        print("Build type: %s" % build_type)
        print("Include path: %s" % " ".join(self.include_dirs))
        print("Library path: %s" % " ".join(self.library_dirs))
        print("Linked dynamic libraries: %s" % " ".join(self.libraries))
        print("Linked static libraries: %s" % " ".join(self.extra_objects))
        print("Extra compiler options: %s" % " ".join(self.extra_compile_args))
        print("Extra linker options: %s" % " ".join(self.extra_link_args))
105764
def tag(self, tokens):
        """"""
        # Combine output from individual taggers
        tags = [None] * len(tokens)
        just_tokens = [t[0] for t in tokens]
        for tagger in self.taggers:
            tag_gen = tagger.tag(tokens) if isinstance(tagger, CrfCemTagger) else tagger.tag(just_tokens)
            for i, (token, newtag) in enumerate(tag_gen):
                if newtag == 'I-CM' and not (i == 0 or tag_gen[i - 1][1] not in {'B-CM', 'I-CM'}):
                    tags[i] = 'I-CM'  # Always overwrite I-CM
                elif newtag == 'B-CM' and tags[i] is None:
                    tags[i] = 'B-CM'  # Only overwrite B-CM over None
        # Postprocess the combined output
        for i, tag in enumerate(tags):
            token, pos = tokens[i]
            lex = self.lexicon[token]
            nexttag = tags[i+1] if i < len(tags) - 1 else None
            # Trim disallowed first tokens
            if tag == 'B-CM' and lex.lower in STRIP_START:
                tags[i] = None
                if nexttag == 'I-CM':
                    tags[i+1] = 'B-CM'
            # Trim disallowed final tokens
            if nexttag is None and lex.lower in STRIP_END:
                tags[i] = None
        # Filter certain entities
        for i, tag in enumerate(tags):
            token, pos = tokens[i]
            if tag == 'B-CM':
                entity_tokens = [self.lexicon[token].lower]
                end_i = i + 1
                for j, subsequent in enumerate(tags[i+1:]):
                    if subsequent == 'I-CM':
                        end_i += 1
                        entity_tokens.append(self.lexicon[tokens[i+j+1][0]].lower)
                    else:
                        break

                # Fix combined '1H NMR' on end  # TODO: Also 13C, etc.?
                if len(entity_tokens) > 2 and entity_tokens[-1] == 'nmr' and entity_tokens[-2] == '1h':
                    tags[end_i-2] = 'B-CM'
                    tags[end_i-1] = None
                    entity_tokens = entity_tokens[:-2]

                entity = ' '.join(entity_tokens)
                if any(e in STOP_TOKENS for e in entity_tokens) or self._in_stoplist(entity):
                    tags[i:end_i] = [None] * (end_i - i)
                else:
                    bl = bracket_level(entity)
                    # Try and add on brackets in neighbouring tokens if they form part of the name
                    # TODO: Check bracket type matches before adding on
                    if bl == 1 and len(tokens) > end_i and bracket_level(tokens[end_i][0]) == -1:
                        #print('BLADJUST: %s - %s' % (entity, tokens[end_i][0]))
                        tags[end_i] = 'I-CM'
                    elif bl == -1 and i > 0 and bracket_level(tokens[i-1][0]) == 1:
                        #print('BLADJUST: %s - %s' % (tokens[i-1][0], entity))
                        tags[i-1] = 'B-CM'
                        tags[i] = 'I-CM'
                    elif not bracket_level(entity) == 0:
                        # Filter entities that overall don't have balanced brackets
                        tags[i:end_i] = [None] * (end_i - i)
                    else:
                        # Remove bracketed alphanumeric from end
                        if len(entity_tokens) >= 4 and entity_tokens[-1] == ')' and entity_tokens[-3] == '(':
                            if re.match('^(\d{1,2}[A-Za-z]?|I|II|III|IV|V|VI|VII|VIII|IX)$', entity_tokens[-2]):
                                log.debug('Removing %s from end of CEM', entity_tokens[-2])
                                tags[end_i-3:end_i] = [None, None, None]
        tokentags = list(six.moves.zip(tokens, tags))
        return tokentags
607381
public String[] tagSeged(String[] src) {
		if(src==null || src.length==0)
			return null;
		String[] target=null;
		try {
			Instance inst = new Instance(src);
			doProcess(inst);
			int[] pred = (int[]) getClassifier().classify(inst).getLabel(0);
			target = labels.lookupString(pred);			
		} catch (Exception e) {
			e.printStackTrace();
		}		
		return target;
	}
1017864
private void printChildDeclaration(NodeDefinitionData nodeDefinition, OutputStreamWriter out) throws IOException,
      RepositoryException
   {
      out.write("\r\n  ");
      out.write("+ " + qNameToString(nodeDefinition.getName()) + " ");

      InternalQName[] requiredTypes = nodeDefinition.getRequiredPrimaryTypes();
      if (requiredTypes != null && requiredTypes.length > 0)
      {
         /** if there is only 1 element and it is NT_BASE then avoid printing it */
         if (requiredTypes.length > 1 || !requiredTypes[0].equals(Constants.NT_BASE))
         {
            out.write("(" + qNameToString(requiredTypes[0]));
            for (int i = 1; i < requiredTypes.length; i++)
            {
               out.write(", " + qNameToString(requiredTypes[i]));
            }
            out.write(")");
         }
      }

      if (nodeDefinition.getDefaultPrimaryType() != null)
      {
         out.write("\r\n    = " + qNameToString(nodeDefinition.getDefaultPrimaryType()));
      }

      StringBuilder attributes = new StringBuilder();

      if (nodeDefinition.isAutoCreated())
      {
         attributes.append("autocreated ");
      }
      if (nodeDefinition.isMandatory())
      {
         attributes.append("mandatory ");
      }
      if (nodeDefinition.isProtected())
      {
         attributes.append("protected ");
      }
      if (nodeDefinition.isAllowsSameNameSiblings())
      {
         attributes.append("sns ");
      }

      if (nodeDefinition.getOnParentVersion() != OnParentVersionAction.COPY)
      {
         attributes.append("\r\n    " + OnParentVersionAction.nameFromValue(nodeDefinition.getOnParentVersion()) + " ");
      }

      if (attributes.length() > 0)
      {
         out.write("\r\n    ");
         out.write(attributes.toString());
      }

   }
113265
def view_all_tags(ctx, param, value):
    
    # To make sure this function executed only when the flag was called
    if not value or ctx.resilient_parsing:
        return
    avail_tags = dict()
    print("\nMultiQC Available module tag groups:\n")
    for mod_dict in filter(lambda mod:isinstance(mod, dict), config.module_order):
        mod_key, mod_val = list(mod_dict.items())[0]
        tags = list(mod_val.get('module_tag', []))
        for t in tags:
            if t not in avail_tags:
                avail_tags[t] = []
            avail_tags[t].append(mod_key)
    for t in sorted(avail_tags.keys(), key=lambda s: s.lower()):
        print (" - {}:".format(t))
        for ttgs in avail_tags[t]:
            print ("   - {}".format(ttgs))
    ctx.exit()
577136
private function generateStructures(): void
    {
        $this->printer->writeln('Generating structures.');
        $this->generator->setChildNamespace('Structure');

        /** @var Struct $structure */
        foreach ($this->wsdl->getStructures() as $name => $structure) {
            $this->printer->writeln(" |\-Generating structure $name");
            $this->generate($structure);
        }
    }
776409
def tags(self):
     """"""
     if self._tags: return self._tags
     tags = {}
     if not tags: return {}
     for m in [[y.group(1),y.group(2),y.group(3)] for y in [re.match('([^:]{2,2}):([^:]):(.+)$',x) for x in self.entries.optional_fields.split("\t")]]:
        if m[1] == 'i': m[2] = int(m[2])
        elif m[1] == 'f': m[2] = float(m[2])
        tags[m[0]] = TAGDatum(m[1],m[2])
     self._tags = tags
     return self._tags
1303200
def tag_details(tag, nodenames):
    
    details = {}

    details['type'] = tag.name
    details['ordinal'] = tag_ordinal(tag)

    # Ordinal value
    if tag_details_sibling_ordinal(tag):
        details['sibling_ordinal'] = tag_details_sibling_ordinal(tag)

    # Asset name
    if tag_details_asset(tag):
        details['asset'] = tag_details_asset(tag)

    object_id_tag = first(raw_parser.object_id(tag, pub_id_type= "doi"))
    if object_id_tag:
        details['component_doi'] = extract_component_doi(tag, nodenames)

    return details
474641
private function printActiveFormattingElements() {
        if (!$this->a_formatting) {
            return;
        }
        $names = array();
        foreach ($this->a_formatting as $node) {
            if ($node === self::MARKER) {
                $names[] = 'MARKER';
            } else {
                $names[] = $node->tagName;
            }
        }
        echo "  -> active formatting [" . implode(', ', $names) . "]\n";
    }
1173116
private static function printStructureLine($key, $value, Structure $structure, $maxKeyLength, $maxValueLength)
    {
        $result    = '';
        $insertTab = ($structure->getTab()) ? true : false;
        $border    = $structure->getBorder();

        if ($border) {
            $keyLength        = Util::getVisibleStringLength($key);
            $missingKeyLength = $maxKeyLength - $keyLength;
            $fillingKeySpace  = Util::buildPatternLine(' ', $missingKeyLength);

            $valueLength        = Util::getVisibleStringLength($value);
            $missingValueLength = $maxValueLength - $valueLength;
            $fillingValueSpace  = Util::buildPatternLine(' ', $missingValueLength);

            $result .= ($insertTab ? $structure->getTab() : '');
            $result .= $border->getColumnCharacter() . ' ' . $key . $fillingKeySpace . ' ';
            $result .= $structure->getKeyToValueCharacter() . ' ' . $value . $fillingValueSpace . ' ';
            $result .= $border->getColumnCharacter() . PHP_EOL;
        } else {
            $keyLength        = Util::getVisibleStringLength($key);
            $missingKeyLength = $maxKeyLength - $keyLength;
            $fillingKeySpace  = Util::buildPatternLine(' ', $missingKeyLength);

            $result .= ($insertTab ? $structure->getTab() : '');
            $result .= $key . $fillingKeySpace . ' ';
            $result .= $structure->getKeyToValueCharacter() . ' ' . $value;
            $result .= PHP_EOL;
        }

        return $result;
    }
1138040
def tag_name(cls, tag):
        """"""
        while isinstance(tag, etree._Element):
            tag = tag.tag
        return tag.split('}')[-1]
876717
def _create_tags(ctx):
    ""

    for (tag, info) in _TAGS.items():
        class_name = tag.title()
        quote_, compact, self_closing, docs = info

        def __init__(self, *childs, **attrs):
            TagBase.__init__(self, childs, attrs)

        cls = type(class_name, (TagBase,), {
            "__doc__": docs,
            "__init__": __init__
        })

        cls.QUOTE = quote_
        cls.COMPACT = compact
        cls.SELF_CLOSING = self_closing

        ctx[class_name] = cls
803277
def _handle_tag_defineedittext(self):
        """"""
        obj = _make_object("DefineEditText")
        obj.CharacterID = unpack_ui16(self._src)
        obj.Bounds = self._get_struct_rect()

        bc = BitConsumer(self._src)
        obj.HasText = bc.u_get(1)
        obj.WordWrap = bc.u_get(1)
        obj.Multiline = bc.u_get(1)
        obj.Password = bc.u_get(1)
        obj.ReadOnly = bc.u_get(1)
        obj.HasTextColor = bc.u_get(1)
        obj.HasMaxLength = bc.u_get(1)
        obj.HasFont = bc.u_get(1)
        obj.HasFontClass = bc.u_get(1)
        obj.AutoSize = bc.u_get(1)
        obj.HasLayout = bc.u_get(1)
        obj.NoSelect = bc.u_get(1)
        obj.Border = bc.u_get(1)
        obj.WasStatic = bc.u_get(1)
        obj.HTML = bc.u_get(1)
        obj.UseOutlines = bc.u_get(1)

        if obj.HasFont:
            obj.FontID = unpack_ui16(self._src)
        if obj.HasFontClass:
            obj.FontClass = self._get_struct_string()
        if obj.HasFont:
            obj.FontHeight = unpack_ui16(self._src)
        if obj.HasTextColor:
            obj.TextColor = self._get_struct_rgba()
        if obj.HasMaxLength:
            obj.MaxLength = unpack_ui16(self._src)
        if obj.HasLayout:
            obj.Align = unpack_ui8(self._src)
            obj.LeftMargin = unpack_ui16(self._src)
            obj.RightMargin = unpack_ui16(self._src)
            obj.Indent = unpack_ui16(self._src)
            obj.Leading = unpack_ui16(self._src)

        obj.VariableName = self._get_struct_string()
        if obj.HasText:
            obj.InitialText = self._get_struct_string()
        return obj
263829
private void printInlineTags(Tag[] tags, ClassDoc classDoc) {
        for (Tag tag : tags) {
            if ((tag instanceof SeeTag) && tag.name().equals("@link")) {
                SeeTag seeTag = (SeeTag) tag;
                boolean sameClass = seeTag.referencedClass() == classDoc;
                String fullClassName = seeTag.referencedClassName();
                String memberName = seeTag.referencedMemberName();

                String className = fullClassName.substring(fullClassName.lastIndexOf('.') + 1);
                List<String> nameParts = new ArrayList<>();
                if (!sameClass) {
                    nameParts.add(className);
                }
                if (memberName != null) {
                    nameParts.add(memberName);
                }
                String name = Strings.join(nameParts, ".");

                if (fullClassName.lastIndexOf('.') >= 0) {
                    String packageName = fullClassName.substring(0, fullClassName.lastIndexOf('.'));
                    String urlPrefix = "";
                    if (!sameClass && packageName.startsWith("com.qspin.") && !packageName.equals(
                          "com.qspin.qtaste.testapi.api")) {
                        String javaDocDir = packageName.startsWith("com.qspin.qtaste.") ? QTaste_JAVADOC_URL_PREFIX :
                              SUT_JAVADOC_URL_PREFIX;
                        urlPrefix = javaDocDir + packageName.replace('.', '/') + "/";
                    }
                    String url =
                          (sameClass ? "" : urlPrefix + className + ".html") + (memberName != null ? "#" + memberName : "");

                    mOut.print("<A HREF=\"" + url + "\">" + name + "</A>");
                } else {
                    mOut.print(name);
                }
            } else {
                mOut.print(tag.text());
            }
        }
    }
1169837
private void initCustomTaglets() {

        moduleTags = new ArrayList<>();
        packageTags = new ArrayList<>();
        typeTags = new ArrayList<>();
        fieldTags = new ArrayList<>();
        constructorTags = new ArrayList<>();
        methodTags = new ArrayList<>();
        inlineTags = new ArrayList<>();
        overviewTags = new ArrayList<>();

        for (Taglet current : customTags.values()) {
            if (current.inModule() && !current.isInlineTag()) {
                moduleTags.add(current);
            }
            if (current.inPackage() && !current.isInlineTag()) {
                packageTags.add(current);
            }
            if (current.inType() && !current.isInlineTag()) {
                typeTags.add(current);
            }
            if (current.inField() && !current.isInlineTag()) {
                fieldTags.add(current);
            }
            if (current.inConstructor() && !current.isInlineTag()) {
                constructorTags.add(current);
            }
            if (current.inMethod() && !current.isInlineTag()) {
                methodTags.add(current);
            }
            if (current.isInlineTag()) {
                inlineTags.add(current);
            }
            if (current.inOverview() && !current.isInlineTag()) {
                overviewTags.add(current);
            }
        }

        //Init the serialized form tags
        serializedFormTags = new ArrayList<>();
        serializedFormTags.add(customTags.get(SERIAL_DATA.tagName));
        serializedFormTags.add(customTags.get(THROWS.tagName));
        if (!nosince)
            serializedFormTags.add(customTags.get(SINCE.tagName));
        serializedFormTags.add(customTags.get(SEE.tagName));
    }