Outputs an ordered sequence of instances of TopLevel types.

    Elements start with an optional TableElement, followed by zero or more pairs of (TableHeaderElement, TableElement).
547039
def identify(file_elements):
    

    if not file_elements:
        return

    _validate_file_elements(file_elements)

    # An iterator over enumerate(the non-metadata) elements
    iterator = PeekableIterator((element_i, element) for (element_i, element) in enumerate(file_elements)
                                if element.type != elements.TYPE_METADATA)

    try:
        _, first_element = iterator.peek()
        if isinstance(first_element, TableElement):
            iterator.next()
            yield AnonymousTable(first_element)
    except KeyError:
        pass
    except StopIteration:
        return

    for element_i, element in iterator:

        if not isinstance(element, TableHeaderElement):
            continue

        # If TableHeader of a regular table, return Table following it
        if not element.is_array_of_tables:
            table_element_i, table_element = next(iterator)
            yield Table(names=element.names, table_element=table_element)

        # If TableHeader of an array of tables, do your thing
        else:
            table_element_i, table_element = next(iterator)
            yield ArrayOfTables(names=element.names, table_element=table_element)
1073167
def sequence(self):
        '''
        
        '''
        if (len(self.Points[0]) == 2):
            if (self.Sort == 'X' or self.Sort == 'x'):
                self.Points.sort(key=lambda x: x[0])
                self.order(self.Points)

            elif (self.Sort == 'Y' or self.Sort == 'y'):
                self.Points.sort(key=lambda x: x[1])
                self.order(self.Points)
            else:
                self.order(self.Points)

        if (len(self.Points[0]) == 3):
            if (self.Sort == 'X' or self.Sort == 'x'):
                self.Points.sort(key=lambda x: x[0])
                self.order(self.Points)

            elif (self.Sort == 'Y' or self.Sort == 'y'):
                self.Points.sort(key=lambda x: x[1])
                self.order(self.Points)
            elif (self.Sort == 'Z' or self.Sort == 'Z'):
                self.Points.sort(key=lambda x: x[2])
                self.order(self.Points)
            else:
                self.order(self.Points)
655969
def get_ordered_types(self):
        
        types = self.get_types()
        types_arr = np.array(types)
        poss = [self.chrPos, self.startPos, self.stopPos]
        if self.strandPos is not None:
            poss.append(self.strandPos)
        if self.otherPos:
            for o in self.otherPos:
                poss.append(o[0])
        idx_sort = np.array(poss).argsort()
        return types_arr[idx_sort].tolist()
1194753
function(type) {
			var result = [],
				spirit, el = this.spirit.element;
			while ((el = el.nextElementSibling)) {
				if (type && (spirit = el.spirit)) {
					if (spirit instanceof type) {
						result.push(spirit);
					}
				} else {
					result.push(el);
				}
			}
			return result;
		}
184687
@Override
    public <T> EntitySequence getSequence(TableDefinition tableDef, Iterable<T> collection, List<String> fields) {
        return getSequence(tableDef, collection, fields, null);
    }
503846
@Override
    public Iterator<Cell> iterator()
    {
        if (cells != null)
        {
            return cells.iterator();
        }
        else // if (pbRow != null)
        {
            assert pbRow != null;

            return ConvertibleIteratorUtils.iterateAsCell(pbRow.getCellsList().iterator(),
                    // if there is no ColumnDescription what else we could do with that?
                    pbColumnDescriptions == null ?  Collections.emptyIterator() : pbColumnDescriptions.iterator());
        }
    }
764325
protected List<ExecutableElement> getOrderedMethods(TypeElement typeElement, Comparator<ExecutableElement> comparator) {
		List<ExecutableElement> methods = ElementFilter.methodsIn(typeElement.getEnclosedElements());
		Collections.sort(methods, comparator);
		return methods;
	}
1254323
private void addFirstOfType() {
        for (Node node : nodes) {
            Node n = DOMHelper.getPreviousSiblingElement(node);
            while (n != null) {
                if (DOMHelper.getNodeName(n).equals(DOMHelper.getNodeName(node))) {
                    break;
                }
                
                n = DOMHelper.getPreviousSiblingElement(n);
            }
            
            if (n == null) {
                result.add(node);
            }
        }
    }
700968
public List<OrderingType<WebFragmentType<T>>> getAllOrdering()
   {
      List<OrderingType<WebFragmentType<T>>> list = new ArrayList<OrderingType<WebFragmentType<T>>>();
      List<Node> nodeList = childNode.get("ordering");
      for(Node node: nodeList)
      {
         OrderingType<WebFragmentType<T>>  type = new OrderingTypeImpl<WebFragmentType<T>>(this, "ordering", childNode, node);
         list.add(type);
      }
      return list;
   }
1353881
function _fnCoordsFromCell( n )
	{
		if ( _oDatatable )
		{
			return [
				$('td', n.parentNode).index(n),
				$('tr', n.parentNode.parentNode).index(n.parentNode) + _oDatatable._iDisplayStart
			];
		}
		else
		{
			return [
				$('td', n.parentNode).index(n),
				$('tr', n.parentNode.parentNode).index(n.parentNode)
			];
		}
	}
1256786
function() {
        var hierarchyList = this._getColumnHierarchyList();
        var maxRowCount = this._getHierarchyMaxRowCount(hierarchyList);
        var headerHeight = this.dimensionModel.get('headerHeight');
        var rowMarkupList = new Array(maxRowCount);
        var columnNames = new Array(maxRowCount);
        var colSpanList = [];
        var rowHeight = util.getRowHeight(maxRowCount, headerHeight) - 1;
        var rowSpan = 1;
        var height;
        var headerMarkupList;

        _.each(hierarchyList, function(hierarchy, i) {
            var length = hierarchyList[i].length;
            var curHeight = 0;

            _.each(hierarchy, function(columnModel, j) {
                var columnName = columnModel.name;
                var classNames = [
                    classNameConst.CELL,
                    classNameConst.CELL_HEAD
                ];

                if (columnModel.validation && columnModel.validation.required) {
                    classNames.push(classNameConst.CELL_REQRUIRED);
                }

                rowSpan = (length - 1 === j && (maxRowCount - length + 1) > 1) ? (maxRowCount - length + 1) : 1;
                height = rowHeight * rowSpan;

                if (j === length - 1) {
                    height = (headerHeight - curHeight) - 2;
                } else {
                    curHeight += height + 1;
                }
                if (columnNames[j] === columnName) {
                    rowMarkupList[j].pop();
                    colSpanList[j] += 1;
                } else {
                    colSpanList[j] = 1;
                }
                columnNames[j] = columnName;
                rowMarkupList[j] = rowMarkupList[j] || [];
                rowMarkupList[j].push(this.templateHeader({
                    attrColumnName: ATTR_COLUMN_NAME,
                    columnName: columnName,
                    className: classNames.join(' '),
                    height: height,
                    colspan: colSpanList[j],
                    rowspan: rowSpan,
                    title: columnModel.title,
                    btnSort: columnModel.sortable ? this.markupBtnSort : ''
                }));
            }, this);
        }, this);
        headerMarkupList = _.map(rowMarkupList, function(rowMarkup) {
            return '<tr>' + rowMarkup.join('') + '</tr>';
        });

        return headerMarkupList.join('');
    }
1102369
public SortedSet<TypeElement> implementingClasses(TypeElement typeElement) {
        SortedSet<TypeElement> result = get(implementingClasses, typeElement);
        SortedSet<TypeElement> intfcs = allSubClasses(typeElement, false);

        // If class x implements a subinterface of typeElement, then it follows
        // that class x implements typeElement.
        Iterator<TypeElement> subInterfacesIter = intfcs.iterator();
        while (subInterfacesIter.hasNext()) {
            Iterator<TypeElement> implementingClassesIter
                    = implementingClasses(subInterfacesIter.next()).iterator();
            while (implementingClassesIter.hasNext()) {
                TypeElement c = implementingClassesIter.next();
                if (!result.contains(c)) {
                    result.add(c);
                }
            }
        }
        return result;
    }
406613
public Rule Table() {
        Var<TableNode> node = new Var<TableNode>();
        return NodeSequence(
                push(node.setAndGet(new TableNode())),
                Optional(
                        NodeSequence(
                                TableRow(), push(1, new TableHeaderNode()) && addAsChild(),
                                ZeroOrMore(TableRow(), addAsChild())
                        ),
                        addAsChild() // add the TableHeaderNode to the TableNode
                ),
                TableDivider(node),
                Optional(
                        NodeSequence(
                                TableRow(), push(1, new TableBodyNode()) && addAsChild(),
                                ZeroOrMore(TableRow(), addAsChild())
                        ),
                        addAsChild() // add the TableHeaderNode to the TableNode
                ),
                // only accept as table if we have at least one header or at least one body
                Optional(TableCaption(), addAsChild()),
                !node.get().getChildren().isEmpty()

        );
    }
955482
private static List<ClasspathElement> orderClasspathElements(
            final Collection<Entry<Integer, ClasspathElement>> classpathEltsIndexed) {
        final List<Entry<Integer, ClasspathElement>> classpathEltsIndexedOrdered = new ArrayList<>(
                classpathEltsIndexed);
        CollectionUtils.sortIfNotEmpty(classpathEltsIndexedOrdered, INDEXED_CLASSPATH_ELEMENT_COMPARATOR);
        final List<ClasspathElement> classpathEltsOrdered = new ArrayList<>(classpathEltsIndexedOrdered.size());
        for (final Entry<Integer, ClasspathElement> ent : classpathEltsIndexedOrdered) {
            classpathEltsOrdered.add(ent.getValue());
        }
        return classpathEltsOrdered;
    }
110530
private Map<Class<?>, TableCellRenderer> getDefaultTableCellRenderers() {
		if (DEFAULT_RENDERERS.isEmpty()) {
			DEFAULT_RENDERERS.put(Boolean.class, new MBooleanTableCellRenderer());
			DEFAULT_RENDERERS.put(Double.class, new MDoubleTableCellRenderer());
			DEFAULT_RENDERERS.put(Float.class, new MDoubleTableCellRenderer());
			DEFAULT_RENDERERS.put(java.math.BigDecimal.class, new MDoubleTableCellRenderer());
			DEFAULT_RENDERERS.put(Integer.class, new MIntegerTableCellRenderer());
			DEFAULT_RENDERERS.put(Long.class, new MIntegerTableCellRenderer());
			DEFAULT_RENDERERS.put(java.math.BigInteger.class, new MIntegerTableCellRenderer());
			DEFAULT_RENDERERS.put(GregorianCalendar.class, new MDateTableCellRenderer());
			DEFAULT_RENDERERS.put(Date.class, new MDateTableCellRenderer());
			DEFAULT_RENDERERS.put(java.sql.Date.class, new MDateTableCellRenderer());
			DEFAULT_RENDERERS.put(java.sql.Timestamp.class, new MDateTableCellRenderer());
			DEFAULT_RENDERERS.put(ArrayList.class, new MListTableCellRenderer()); // NOPMD
			DEFAULT_RENDERERS.put(HashMap.class, new MListTableCellRenderer()); // NOPMD
			DEFAULT_RENDERERS.put(Hashtable.class, new MListTableCellRenderer()); // NOPMD
			DEFAULT_RENDERERS.put(Object.class, new MDefaultTableCellRenderer());
			DEFAULT_RENDERERS.put(String.class, new MDefaultTableCellRenderer());
			DEFAULT_RENDERERS.put(ImageIcon.class, new MImageIconTableCellRenderer());
			DEFAULT_RENDERERS.put(Component.class, new MComponentTableCellRenderer());
		}
		return DEFAULT_RENDERERS;
	}
1053045
def earliest_class
      earliest_classes = Tableau::ClassArray.new
      @modules.each { |m| earliest_classes << m.earliest_class }

      earliest = earliest_classes.first
      earliest_classes.each { |c| earliest = c if c.time < earliest.time }
      earliest
    end
882748
private static List<TypeElement> fetchAllNestedTypes(MessageElement type) {
        List<TypeElement> ret = new ArrayList<TypeElement>();

        List<TypeElement> nestedTypes = type.nestedElements();
        ret.addAll(nestedTypes);
        for (TypeElement t : nestedTypes) {
            if (t instanceof MessageElement) {
                List<TypeElement> subNestedTypes = fetchAllNestedTypes((MessageElement) t);
                ret.addAll(subNestedTypes);
            }
        }
        return ret;
    }