<commit_before>
package net.imagej.ops.create;

import net.imagej.ops.Op;
import net.imagej.ops.OpService;
import net.imagej.ops.OutputOp;
import net.imagej.ops.create.CreateOps.CreateImgFactory;
import net.imagej.ops.create.CreateOps.CreateType;
import net.imglib2.Dimensions;
import net.imglib2.FinalInterval;
import net.imglib2.img.ImgFactory;
import net.imglib2.img.array.ArrayImgFactory;
import net.imglib2.img.cell.CellImgFactory;
import net.imglib2.type.NativeType;
import net.imglib2.util.Intervals;

import org.scijava.ItemIO;
import org.scijava.plugin.Parameter;
import org.scijava.plugin.Plugin;

/**
 * Default implementation of the {@link CreateFactory} interface.
 *
 * @author <NAME>, University of Konstanz.
 * @author <NAME>, University of Konstanz.
 * @param <T>
 */
@Plugin(type = Op.class)
public class DefaultCreateImgFactory<T extends NativeType<T>> implements
	CreateImgFactory, OutputOp<ImgFactory<T>>
{

	@Parameter(type = ItemIO.OUTPUT)
	private ImgFactory<T> output;

	@Parameter
	private OpService ops;

	@Parameter(required = false)
	private Dimensions dims;

	@Parameter(required = false)
	private T outType;

	@SuppressWarnings("unchecked")
	@Override
	public void run() {

		if (dims == null) {
			dims = new FinalInterval(10, 10);
		}

		if (outType == null) {
			outType = (T) ops.run(CreateType.class);
		}

		output =
			Intervals.numElements(dims) > Integer.MAX_VALUE ? new CellImgFactory<T>()
				: new ArrayImgFactory<T>();
	}

	@Override
	public ImgFactory<T> getOutput() {
		return output;
	}

	@Override
	public void setOutput(final ImgFactory<T> output) {<commit_msg>CreateImgFactory: don't create dummy interval<commit_after>
package net.imagej.ops.create;

import net.imagej.ops.Op;
import net.imagej.ops.OpService;
import net.imagej.ops.OutputOp;
import net.imagej.ops.create.CreateOps.CreateImgFactory;
import net.imagej.ops.create.CreateOps.CreateType;
import net.imglib2.Dimensions;
import net.imglib2.img.ImgFactory;
import net.imglib2.img.array.ArrayImgFactory;
import net.imglib2.img.cell.CellImgFactory;
import net.imglib2.type.NativeType;
import net.imglib2.util.Intervals;

import org.scijava.ItemIO;
import org.scijava.plugin.Parameter;
import org.scijava.plugin.Plugin;

/**
 * Default implementation of the {@link CreateFactory} interface.
 *
 * @author <NAME>, University of Konstanz.
 * @author <NAME>, University of Konstanz.
 * @param <T>
 */
@Plugin(type = Op.class)
public class DefaultCreateImgFactory<T extends NativeType<T>> implements
	CreateImgFactory, OutputOp<ImgFactory<T>>
{

	@Parameter(type = ItemIO.OUTPUT)
	private ImgFactory<T> output;

	@Parameter
	private OpService ops;

	@Parameter(required = false)
	private Dimensions dims;

	@Parameter(required = false)
	private T outType;

	@SuppressWarnings("unchecked")
	@Override
	public void run() {

		if (outType == null) {
			outType = (T) ops.run(CreateType.class);
		}

		output =
			(dims == null || Intervals.numElements(dims) <= Integer.MAX_VALUE)
				? new ArrayImgFactory<T>() : new CellImgFactory<T>();
	}

	@Override
	public ImgFactory<T> getOutput() {
		return output;
	}

	@Override
	public void setOutput(final ImgFactory<T> output) {
{'fraction_non_alphanumeric': 0.12322722975102426, 'fraction_numerical': 0.005357705641348881, 'mean_word_length': 5.034220532319392, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1693392', 'n_tokens_mistral': 1126, 'n_tokens_neox': 1085, 'n_words': 233}