Partition the bundle based on the class label.

@param classcolumn
@return Partitioned data set.
427544
protected <O> Map<O, IntList> partition(List<? extends O> classcolumn) {
    Map<O, IntList> classes = new HashMap<>();
    Iterator<? extends O> iter = classcolumn.iterator();
    for(int i = 0; iter.hasNext(); i++) {
      O lbl = iter.next();
      IntList ids = classes.get(lbl);
      if(ids == null) {
        ids = new IntArrayList();
        classes.put(lbl, ids);
      }
      ids.add(i);
    }
    return classes;
  }
1003232
public void group(TreeTableColumn<S, ?>... treeTableColumns) {
        try {
            lock.lock();
            // init groups map
            if (groupOrder.size() == 0) {
                groups = new HashMap<>();
            }
            try {
                if (originalRoot == null) {
                    originalRoot = getRoot();
                }
                for (TreeTableColumn<S, ?> treeTableColumn : treeTableColumns) {
                    if (groupOrder.contains(treeTableColumn)) {
                        continue;
                    }
                    groups = group(treeTableColumn, groups, null, (RecursiveTreeItem<S>) originalRoot);
                }
                groupOrder.addAll(treeTableColumns);
                // update table ui
                buildGroupedRoot(groups, null, 0);
            } catch (Exception e) {
                e.printStackTrace();
            }
        } finally {
            lock.unlock();
        }
    }
441662
public PartitionAwareDataWriterBuilder<S, D> forPartition(GenericRecord partition) {
    this.partition = Optional.fromNullable(partition);
    log.debug("For partition {}", this.partition);
    return this;
  }
1246391
@Pure
	public static Collection<Class<?>> getPackageClasses(String packageName) {
		final Collection<Class<?>> classes = new ArrayList<>();

		final String[] entries = System.getProperty("java.class.path") //$NON-NLS-1$
				.split(Pattern.quote(System.getProperty("path.separator"))); //$NON-NLS-1$
		String lentry;

		for (final String path : entries) {
			lentry = path.toLowerCase();
			if (lentry.endsWith(".jar") || lentry.endsWith(".war")) { //$NON-NLS-1$ //$NON-NLS-2$
				getPackageClassesFromJar(classes, path, packageName);
			} else {
				getPackageClassesFromFileSystem(classes, path, packageName);
			}

		}

		return classes;
	}
636043
public JComponent learn() {
        JPanel pane = new JPanel(new GridLayout(1, 2));
        double[][] data = dataset[datasetIndex].toArray(new double[dataset[datasetIndex].size()][]);
        String[] labels = dataset[datasetIndex].toArray(new String[dataset[datasetIndex].size()]);
        if (labels[0] == null) {
            Attribute[] attr = dataset[datasetIndex].attributes();
            labels = new String[attr.length];
            for (int i = 0; i < labels.length; i++) {
                labels[i] = attr[i].getName();
            }
        }

        long clock = System.currentTimeMillis();
        SammonMapping sammon = new SammonMapping(data, 2);
        System.out.format("Learn Sammon's Mapping (k=2) from %d samples in %dms\n", data.length, System.currentTimeMillis()-clock);

        PlotCanvas plot = ScatterPlot.plot(sammon.getCoordinates(), labels);
        plot.setTitle("Sammon's Mapping (k = 2)");
        pane.add(plot);

        clock = System.currentTimeMillis();
        sammon = new SammonMapping(data, 3);
        System.out.format("Learn Sammon's Mapping (k=3) from %d samples in %dms\n", data.length, System.currentTimeMillis()-clock);

        plot = ScatterPlot.plot(sammon.getCoordinates(), labels);
        plot.setTitle("Sammon's Mapping (k = 3)");
        pane.add(plot);

        return pane;
    }
753809
@Override
    public DataSet filterBy(int[] labels) {
        List<DataSet> list = asList();
        List<DataSet> newList = new ArrayList<>();
        List<Integer> labelList = new ArrayList<>();
        for (int i : labels)
            labelList.add(i);
        for (DataSet d : list) {
            int outcome = d.outcome();
            if (labelList.contains(outcome)) {
                newList.add(d);
            }
        }

        return DataSet.merge(newList);
    }
544512
public @CheckForNull
    ClassStats getClassStats(@DottedClassName String className) {
        if (hasClassStats) {
            return null;
        }
        String packageName;
        int lastDot = className.lastIndexOf('.');
        if (lastDot < 0) {
            packageName = "";
        } else {
            packageName = className.substring(0, lastDot);
        }
        PackageStats stat = getPackageStats(packageName);
        return stat.getClassStatsOrNull(className);
    }
482683
static Partition createListPartition(SqlgGraph sqlgGraph, AbstractLabel abstractLabel, String name, String in) {
        Preconditions.checkArgument(!abstractLabel.getSchema().isSqlgSchema(), "createListPartition may not be called for \"%s\"", Topology.SQLG_SCHEMA);
        Partition partition = new Partition(sqlgGraph, abstractLabel, name, in, PartitionType.NONE, null);
        partition.createListPartitionOnDb();
        if (abstractLabel instanceof VertexLabel) {
            TopologyManager.addVertexLabelPartition(
                    sqlgGraph,
                    abstractLabel.getSchema().getName(),
                    abstractLabel.getName(),
                    name,
                    in,
                    PartitionType.NONE,
                    null);
        } else {
            TopologyManager.addEdgeLabelPartition(sqlgGraph, abstractLabel, name, in, PartitionType.NONE, null);
        }
        partition.committed = false;
        return partition;
    }
1310738
private List<SchemaColumn> findPartitioningColumns() {
        if (m_partitioningColumns != null) {
            return m_partitioningColumns;
        }

        m_partitioningColumns = new ArrayList<>();
        assert(getScanPartitioning() != null);

        if (getScanPartitioning().getCountOfPartitionedTables() > 0) {
            for (StmtTableScan tableScan : m_subqueryStmt.allScans()) {
                List<SchemaColumn> scols = tableScan.getPartitioningColumns();
                if (scols != null) {
                    addPartitioningColumns(scols);
                }
            }
        }
        return m_partitioningColumns;
    }
716686
public static Class<?>[] desc2classArray(String desc)
			throws ClassNotFoundException {
		Class<?>[] ret = desc2classArray(getClassLoader(), desc);
		return ret;
	}
607779
ClassFields get(final Class<?> cls) {
        ClassFields classFields = classToClassFields.get(cls);
        if (classFields == null) {
            classToClassFields.put(cls,
                    classFields = new ClassFields(cls, resolveTypes, onlySerializePublicFields, this));
        }
        return classFields;
    }
299670
public Stream partitionBy(Fields fields) {
        projectionValidation(fields);
        return partition(Grouping.fields(fields.toList()));
    }
286782
public Map<String, Class<?>> getEntityNameToClassMap()
    {
        if (entityNameToClassMap == null)
        {
            entityNameToClassMap = new HashMap<String, Class<?>>();
        }
        return entityNameToClassMap;
    }
640292
public Map<String, Class<?>> scan(String classNamePattern) throws IOException {
        final Map<String, Class<?>> scannedClasses = new LinkedHashMap<>();
        scan(classNamePattern, scannedClasses);
        return scannedClasses;
    }
836895
def partitionBy(*cols):
        
        sc = SparkContext._active_spark_context
        jspec = sc._jvm.org.apache.spark.sql.expressions.Window.partitionBy(_to_java_cols(cols))
        return WindowSpec(jspec)
1364923
private SortedSet<ClassDoc> get(Map<ClassDoc, SortedSet<ClassDoc>> map, ClassDoc cd) {
        SortedSet<ClassDoc> aset = map.get(cd);
        if (aset == null) {
            return new TreeSet<>(comparator);
        }
        return aset;
    }
757400
def as_partition(self, partition=0, **kwargs):
        

        assert isinstance(self._name, Name), "Wrong type: {}".format(type(self._name))
        assert isinstance(self._on, DatasetNumber), "Wrong type: {}".format(type(self._on))

        name = self._name.as_partition(**kwargs)
        on = self._on.as_partition(partition)

        return PartitionIdentity(name, on)