Returns an {@link LongTupleIncrementor} that increments the tuples
in lexicographical order

@return The {@link LongTupleIncrementor}.
766020
static LongTupleIncrementor lexicographicalIncrementor()
    {
        return (t, min, max) ->
            LongTuples.incrementLexicographically(t, min, max, t);
    }
1154141
@Override
    public Sequence<T> nextSequence() {
        Sequence<T> sequence = currentIterator.next();
        sequence.setSequenceId(tagger.getAndIncrement());
        return sequence;
    }
529986
public synchronized PacketBuilder withLong(final long l)
    {
        checkBuilt();
        try
        {
            dataOutputStream.writeLong(l);
        }
        catch (final IOException e)
        {
            logger.error("Unable to add long: {} : {}", e.getClass(), e.getMessage());
        }
        return this;
    }
913789
public static LongIterator of(final Supplier<? extends LongIterator> iteratorSupplier) {
        N.checkArgNotNull(iteratorSupplier, "iteratorSupplier");

        return new LongIterator() {
            private LongIterator iter = null;
            private boolean isInitialized = false;

            @Override
            public boolean hasNext() {
                if (isInitialized == false) {
                    init();
                }

                return iter.hasNext();
            }

            @Override
            public long nextLong() {
                if (isInitialized == false) {
                    init();
                }

                return iter.nextLong();
            }

            private void init() {
                if (isInitialized == false) {
                    isInitialized = true;
                    iter = iteratorSupplier.get();
                }
            }
        };
    }
29420
public Iterator<Map.Entry<T,Double>> iterator() {
        return Collections.unmodifiableSet(
            TDecorators.wrap(counts).entrySet()).iterator();
    }
1153182
public long nextLong() {
    Delta d = ranges.get();
    if (d.start <= d.stop) {
      mutex.lock();
      value = d.update(value);
      mutex.unlock();
    }
    return d.start++;
  }
64605
@Override
	public final MutableObjectIterator<T> getIterator() {
		final SingleSegmentInputView startIn = new SingleSegmentInputView(this.recordsPerSegment * this.recordSize);
		startIn.set(this.sortBuffer.get(0), 0);
		
		return new MutableObjectIterator<T>() {
			
			private final SingleSegmentInputView in = startIn;
			private final TypeComparator<T> comp = comparator;
			
			private final int numTotal = size();
			private final int numPerSegment = recordsPerSegment;
			
			private int currentTotal = 0;
			private int currentInSegment = 0;
			private int currentSegmentIndex = 0;

			@Override
			public T next(T reuse) {
				if (this.currentTotal < this.numTotal) {
					
					if (this.currentInSegment >= this.numPerSegment) {
						this.currentInSegment = 0;
						this.currentSegmentIndex++;
						this.in.set(sortBuffer.get(this.currentSegmentIndex), 0);
					}
					
					this.currentTotal++;
					this.currentInSegment++;
					
					try {
						return this.comp.readWithKeyDenormalization(reuse, this.in);
					}
					catch (IOException ioe) {
						throw new RuntimeException(ioe);
					}
				}
				else {
					return null;
				}
			}

			@Override
			public T next() {
				if (this.currentTotal < this.numTotal) {

					if (this.currentInSegment >= this.numPerSegment) {
						this.currentInSegment = 0;
						this.currentSegmentIndex++;
						this.in.set(sortBuffer.get(this.currentSegmentIndex), 0);
					}

					this.currentTotal++;
					this.currentInSegment++;

					try {
						return this.comp.readWithKeyDenormalization(serializer.createInstance(), this.in);
					}
					catch (IOException ioe) {
						throw new RuntimeException(ioe);
					}
				}
				else {
					return null;
				}
			}
		};
	}
1110137
public static <S> PAreaSizeBIGenerator<S> create()
  {
    final LongGenerator gen = new LongGenerator(0L, Long.MAX_VALUE);
    return new PAreaSizeBIGenerator<>(() -> new BigInteger(gen.next().toString()));
  }
590072
public static <S> PAreaBIGenerator<S> create()
  {
    return new PAreaBIGenerator<>(new Generator<BigInteger>()
    {
      private final Random random = new Random();

      @Override
      public BigInteger next()
      {
        return BigInteger.valueOf(Math.abs(this.random.nextLong()));
      }
    });
  }
31910
static IntTupleIncrementor colexicographicalIncrementor()
    {
        return (t, min, max) -> 
            IntTuples.incrementColexicographically(t, min, max, t);
    }
667507
public @Nonnull Iterable<Long> longs() {
        final JsonArray parent=this;
        return () -> {
            final Iterator<JsonElement> iterator = parent.iterator();
            return new Iterator<Long>() {

                @Override
                public boolean hasNext() {
                    return iterator.hasNext();
                }

                @Override
                public Long next() {
                    return iterator.next().asLong();
                }

                @Override
                public void remove() {
                    iterator.remove();
                }
            };
        };
    }
440561
public static <E> Ordering<Multiset.Entry<E>>
  byCountDescendingThenItemAscendingOrdering(Comparator<? super E> itemComparator) {
    final Ordering<Multiset.Entry<E>> byCount = byCountOrdering();
    final Ordering<Multiset.Entry<E>> byCountReversed = byCount.reverse();
    final Ordering<Multiset.Entry<E>> byElement = byElementOrdering(itemComparator);
    return byCountReversed.compound(byElement);
  }
856714
public static long min(LongTuple t)
    {
        return LongTupleFunctions.reduce(
            t, Long.MAX_VALUE, Math::min);
    }
397025
public Iterator<Pair<F, S>> getIterator() {
        return new Iterator<Pair<F, S>>() {

            Iterator<F> outerIt;
            Iterator<S> innerIt;
            F curKey;

            {
                outerIt = keySet().iterator();
            }

            private boolean hasInside() {
                if (innerIt == null || !innerIt.hasNext()) {
                    if (!outerIt.hasNext()) {
                        return false;
                    }
                    curKey = outerIt.next();
                    innerIt = getCounter(curKey).keySet().iterator();
                }
                return true;
            }

            public boolean hasNext() {
                return hasInside();
            }

            public Pair<F, S> next() {
                hasInside();
                if (curKey == null)
                    throw new RuntimeException("Outer element can't be null");

                return Pair.makePair(curKey, innerIt.next());
            }

            public void remove() {
                //
            }
        };
    }
45928
static Iterator<MutableLongTuple> wrappingIterator(
        LongTuple bounds, Iterator<? extends MutableLongTuple> delegate)
    {
        return wrappingIteratorInternal(LongTuples.copy(bounds), delegate);
    }
139603
@Override
	@SuppressWarnings("unchecked")
	public Tuple7<T0, T1, T2, T3, T4, T5, T6> copy() {
		return new Tuple7<>(this.f0,
			this.f1,
			this.f2,
			this.f3,
			this.f4,
			this.f5,
			this.f6);
	}
31011
public long[] getShapeFromTensor(OnnxProto3.TensorProto tensorProto) {
        val ret = new long[Math.max(2,tensorProto.getDimsCount())];
        int dimCount = tensorProto.getDimsCount();
        if(dimCount >= 2)
            for(int i = 0; i < ret.length; i++) {
                ret[i] = (int) tensorProto.getDims(i);
            }
        else {
            ret[0] = 1;
            for(int i = 1; i < ret.length; i++) {
                ret[i] = (int) tensorProto.getDims(i - 1);
            }
        }


        return ret;
    }