Obtain the List of secondary structure elements (SecStrucElement) of a
Structure.

@param s
Structure with SS assignments
@return List of SecStrucElement objects
337307
public static List<SecStrucElement> getSecStrucElements(Structure s) {

		List<SecStrucElement> listSSE = new ArrayList<SecStrucElement>();
		GroupIterator iter = new GroupIterator(s);

		// SecStruc information - initialize
		SecStrucType type = SecStrucType.coil;
		ResidueNumber previous = new ResidueNumber();
		ResidueNumber start = new ResidueNumber();
		String chainId = "";
		int count = 0; // counts the number of residues in SSE

		// Create a map for the IDs of the SSE in the structure
		Map<SecStrucType, Integer> ids = new TreeMap<SecStrucType, Integer>();
		for (SecStrucType t : SecStrucType.values())
			ids.put(t, 1);

		while (iter.hasNext()) {
			Group g = iter.next();

			if (g.hasAminoAtoms()) {
				Object p = g.getProperty(Group.SEC_STRUC);
				if (p == null)
					continue;
				SecStrucInfo ss = (SecStrucInfo) p;

				if (count > 0) {
					// If chain and type are equal increment counter
					if (ss.type == type && chainId == g.getChainId()) {
						previous = g.getResidueNumber();
						count++;
						continue;
					} else {
						// Save the current SSE if chain or type change
						SecStrucElement sse = new SecStrucElement(type, start,
								previous, count, ids.get(type), chainId);
						listSSE.add(sse);
						ids.put(type, ids.get(type) + 1);
						count = 0;

						// Initialize a new SSE one
						if (ss.type != SecStrucType.coil) {
							type = ss.type;
							start = g.getResidueNumber();
							previous = start;
							chainId = g.getChainId();
							count = 1;
						}
					}
				} else {
					// This is for the first residue only
					if (ss.type != SecStrucType.coil) {
						type = ss.type;
						start = g.getResidueNumber();
						previous = start;
						chainId = g.getChainId();
						count = 1;
					}
				}
			}
		}
		return listSSE;
	}
507586
public List<IntArrayList> findComponents() {
        int nodes = graph.getNodes();
        for (int start = 0; start < nodes; start++) {
            if (nodeIndex[start] == 0
                    && !ignoreSet.contains(start)
                    && !graph.isNodeRemoved(start))
                strongConnect(start);
        }

        return components;
    }
993441
public static List<INode> getNodes(List<? extends INode> ast)
	{
		List<INode> nodes = new LinkedList<>();

		nodes.addAll(ast);

		return nodes;
	}
28760
def parse_struct(s):
    
    docs = s['comment']
    code = '<span class="k">struct</span> <span class="gs">%s</span>' % s['name']
    if s['extends']:
        code += ' extends <span class="gs">%s</span>' % s['extends']
    code += ' {\n'
    namelen = 0
    typelen = 0
    for v in s["fields"]:
        tlen = len(format_type(v, includeOptional=False))
        if len(v['name']) > namelen:
            namelen = len(v['name'])
        if tlen > typelen:
          typelen = tlen

    namelen += 1
    typelen += 1

    formatstr = '    <span class="nv">%s</span><span class="kt">%s %s</span>\n'

    i = 0
    for v in s["fields"]:
        if v.has_key('comment') and v['comment']:
            if i > 0: code += "\n"
            for line in v['comment'].split("\n"):
                code += '    <span class="c1">// %s</span>\n' % line
        opt = ""
        if v.has_key('optional') and v['optional'] == True:
          opt = " [optional]"
        code += formatstr % (string.ljust(v['name'], namelen), string.ljust(format_type(v, includeOptional=False), typelen), opt)
        i += 1
    code += "}"

    return to_section(docs, code)
990254
public static MmtfSummaryDataBean getStructureInfo(Structure structure) {
		MmtfSummaryDataBean mmtfSummaryDataBean = new MmtfSummaryDataBean();
		// Get all the atoms
		List<Atom> theseAtoms = new ArrayList<>();
		List<Chain> allChains = new ArrayList<>();
		Map<String, Integer> chainIdToIndexMap = new LinkedHashMap<>();
		int chainCounter = 0;
		int bondCount = 0;
		mmtfSummaryDataBean.setAllAtoms(theseAtoms);
		mmtfSummaryDataBean.setAllChains(allChains);
		mmtfSummaryDataBean.setChainIdToIndexMap(chainIdToIndexMap);
		for (int i=0; i<structure.nrModels(); i++){
			List<Chain> chains = structure.getModel(i);
			allChains.addAll(chains);
			for (Chain chain : chains) {
				String idOne = chain.getId();
				if (!chainIdToIndexMap.containsKey(idOne)) {
					chainIdToIndexMap.put(idOne, chainCounter);
				}
				chainCounter++;
				for (Group g : chain.getAtomGroups()) {
					for(Atom atom: getAtomsForGroup(g)){
						theseAtoms.add(atom);
						// If both atoms are in the group
						if (atom.getBonds()!=null){
							bondCount+=atom.getBonds().size();
						}
					}
				}
			}
		}
		// Assumes all bonds are referenced twice
		mmtfSummaryDataBean.setNumBonds(bondCount/2);
		return mmtfSummaryDataBean;

	}
1270568
public static ArrayList<Element> getChildElements(Node node) {
        ArrayList<Element> childElements = new ArrayList<>();
        NodeList childNodes = node.getChildNodes();
        for (int i = 0; i < childNodes.getLength(); i++) {
            if (childNodes.item(i) instanceof Element) {
                childElements.add((Element) childNodes.item(i));
            }
        }
        return childElements;
    }
823968
public Atom[] getAlignmentAtoms(Structure s) {
		String[] atomNames = params.getUsedAtomNames();
		return StructureTools.getAtomArray(s, atomNames);
	}
335383
public static StructObjectInspector getStandardStructObjectInspector(List<String> structFieldNames,
        List<ObjectInspector> structFieldObjectInspectors,
        XmlProcessor xmlProcessor) {
        return new XmlStructObjectInspector(structFieldNames, structFieldObjectInspectors, xmlProcessor);
    }
324044
public java.util.List<ReservedNode> getReservedNodes() {
        if (reservedNodes == null) {
            reservedNodes = new com.amazonaws.internal.SdkInternalList<ReservedNode>();
        }
        return reservedNodes;
    }
1228285
function findAttachmentParts(struct, attachments) {
        attachments = attachments || [];
        for (let i = 0, len = struct.length, r; i < len; ++i) {
            if (Array.isArray(struct[i])) {
                findAttachmentParts(struct[i], attachments);
            } else {
                if (struct[i].disposition && ['INLINE', 'ATTACHMENT'].indexOf(toUpper(struct[i].disposition.type)) > -1) {
                    attachments.push(struct[i]);
                }
            }
        }
        return attachments;
    }
662457
@Nonnull
  public ICommonsList <String> getHeaders (@Nullable final String sName)
  {
    return new CommonsArrayList <> (m_aHeaders.get (_unifyHeaderName (sName)));
  }
299915
public static final Atom[] getAllAtomArray(Structure s, int model) {
		List<Atom> atoms = new ArrayList<Atom>();

		AtomIterator iter = new AtomIterator(s,model);
		while (iter.hasNext()) {
			Atom a = iter.next();
			atoms.add(a);
		}
		return atoms.toArray(new Atom[atoms.size()]);

	}
509157
private List<PostConstructInfo> processPostConstruct(TypeElement type) {
        List<PostConstructInfo> postConstructs = new ArrayList<>();

        ElementFilter.methodsIn(type.getEnclosedElements()).stream()
                .filter(method -> MoreElements.isAnnotationPresent(method, PostConstruct.class))
                .forEach(method -> {

                    // verify method
                    if (method.getModifiers().contains(Modifier.PRIVATE)) {
                        abortWithError(method, "@%s method must not be private", PostConstruct.class.getSimpleName());
                    }
                    if (method.getModifiers().contains(Modifier.STATIC)) {
                        abortWithError(method, "@%s method must not be static", PostConstruct.class.getSimpleName());
                    }
                    if (!method.getReturnType().equals(typeUtils.getNoType(TypeKind.VOID))) {
                        abortWithError(method, "@%s method must return void", PostConstruct.class.getSimpleName());
                    }
                    if (!method.getParameters().isEmpty()) {
                        abortWithError(method, "@%s method must not have parameters",
                                PostConstruct.class.getSimpleName());
                    }

                    postConstructs.add(new PostConstructInfo(method.getSimpleName().toString()));
                });

        if (postConstructs.size() > 1) {
            warning(type, "%d methods annotated with @%s found. Order is not guaranteed!", postConstructs.size(),
                    PostConstruct.class.getSimpleName());
        }
        return postConstructs;
    }
358686
private SectionContainer buildSectionStructure(List<SectionContent> scl)
	{
		SectionContainer result = new SectionContainer(0);

		for (SectionContent sContent : scl)
		{
			int contentLevel = sContent.getLevel();
			SectionContainer sContainer = result;

			// get the right SectionContainer or create it
			for (int containerLevel = result.getLevel() + 1; containerLevel < contentLevel; containerLevel++)
			{
				int containerSubSections = sContainer.nrOfSubSections();
				if (containerSubSections != 0)
				{
					Section temp = sContainer
							.getSubSection(containerSubSections - 1);
					if (temp.getClass() == SectionContainer.class)
					{
						sContainer = (SectionContainer) temp;
					}
					else
					{
						SectionContainer sct = new SectionContainer(temp
								.getTitleElement(), containerLevel);
						sct.addSection(temp);
						if (calculateSrcSpans)
						{
							sct.setSrcSpan(temp.getSrcSpan());
						}
						temp.setTitleElement(null);
						temp.setLevel(containerLevel + 1);
						sContainer.removeSection(temp);
						sContainer.addSection(sct);
						sContainer = sct;
					}
				}
				else
				{
					sContainer = new SectionContainer(null, containerLevel);
				}
			}

			sContainer.addSection(sContent);
		}

		if (calculateSrcSpans)
		{
			result.setSrcSpan(new SrcSpan(0, -1));
		}

		return result;
	}
1140344
private static Span[] getConstituencySpans(final Parse parse) {

    final Stack<Parse> stack = new Stack<Parse>();

    if (parse.getChildCount() > 0) {
      for (final Parse child : parse.getChildren()) {
        stack.push(child);
      }
    }
    final List<Span> consts = new ArrayList<Span>();

    while (!stack.isEmpty()) {

      final Parse constSpan = stack.pop();

      if (!constSpan.isPosTag()) {
        final Span span = constSpan.getSpan();
        consts
            .add(new Span(span.getStart(), span.getEnd(), constSpan.getType()));

        for (final Parse child : constSpan.getChildren()) {
          stack.push(child);
        }
      }
    }

    return consts.toArray(new Span[consts.size()]);
  }
412500
public static List<Node> findLhsNodesInNode(Node assigningParent) {
    checkArgument(
        isNameDeclaration(assigningParent)
            || assigningParent.isParamList()
            || isAssignmentOp(assigningParent)
            || assigningParent.isCatch()
            || assigningParent.isDestructuringLhs()
            || assigningParent.isDefaultValue()
            || assigningParent.isImport()
            // enhanced for loops assign to loop variables
            || isEnhancedFor(assigningParent),
        assigningParent);
    ArrayList<Node> lhsNodes = new ArrayList<>();
    getLhsNodesHelper(assigningParent, lhsNodes);
    return lhsNodes;
  }
969363
public List<AstNode> getStatements() {
        List<AstNode> stmts = new ArrayList<AstNode>();
        Node n = getFirstChild();
        while (n != null) {
            stmts.add((AstNode)n);
            n = n.getNext();
        }
        return stmts;
    }