This is the function that re-groups values for a key into sub-groups based
on a secondary key (input tag).

@param arg1
@return
485304
private SortedMap<Object, ResetableIterator> regroup(Object key,
                                                       Iterator arg1, Reporter reporter) throws IOException {
    this.numOfValues = 0;
    SortedMap<Object, ResetableIterator> retv = new TreeMap<Object, ResetableIterator>();
    TaggedMapOutput aRecord = null;
    while (arg1.hasNext()) {
      this.numOfValues += 1;
      if (this.numOfValues % 100 == 0) {
        reporter.setStatus("key: " + key.toString() + " numOfValues: "
                           + this.numOfValues);
      }
      if (this.numOfValues > this.maxNumOfValuesPerGroup) {
        continue;
      }
      aRecord = ((TaggedMapOutput) arg1.next()).clone(job);
      Text tag = aRecord.getTag();
      ResetableIterator data = retv.get(tag);
      if (data == null) {
        data = createResetableIterator();
        retv.put(tag, data);
      }
      data.add(aRecord);
    }
    if (this.numOfValues > this.largestNumOfValues) {
      this.largestNumOfValues = numOfValues;
      LOG.info("key: " + key.toString() + " this.largestNumOfValues: "
               + this.largestNumOfValues);
    }
    return retv;
  }
791105
@Override
	public String put(String key, String value) {
		return this.groupedMap.put(DEFAULT_GROUP, key, value);
	}
643740
public TBase<?, ?> newArgs(List<Object> args) {
        requireNonNull(args, "args");
        final TBase<?, ?> newArgs = newArgs();
        final int size = args.size();
        for (int i = 0; i < size; i++) {
            ThriftFieldAccess.set(newArgs, argFields[i], args.get(i));
        }
        return newArgs;
    }
713215
public static byte[] hmacSha1(byte[] input, byte[] key) {
		try {
			SecretKey secretKey = new SecretKeySpec(key, HMACSHA1_ALG);
			Mac mac = Mac.getInstance(HMACSHA1_ALG);
			mac.init(secretKey);
			return mac.doFinal(input);
		} catch (GeneralSecurityException e) {
			throw ExceptionUtil.unchecked(e);
		}
	}
202492
@Nullable
  private static Object convertPrimitiveField(Group g, int fieldIndex, boolean binaryAsString)
  {
    PrimitiveType pt = (PrimitiveType) g.getType().getFields().get(fieldIndex);
    if (pt.isRepetition(Type.Repetition.REPEATED) && g.getFieldRepetitionCount(fieldIndex) > 1) {
      List<Object> vals = new ArrayList<>();
      for (int i = 0; i < g.getFieldRepetitionCount(fieldIndex); i++) {
        vals.add(convertPrimitiveField(g, fieldIndex, i, binaryAsString));
      }
      return vals;
    }
    return convertPrimitiveField(g, fieldIndex, 0, binaryAsString);
  }
629193
public String computeArgPart(String[] keys, List<String> jsonArgs, List<String> paramNames) {
		if (keys.length == 0) {
			return "";
		} else if (Constants.Cache.USE_ALL_ARGUMENTS.equals(keys[0])) {
			return Arrays.toString(jsonArgs.toArray(new String[jsonArgs.size()]));
		} else {
			return computeSpecifiedArgPart(keys, jsonArgs, paramNames);
		}
	}
161811
public static InputMapping<?>[] createArrayMapping( Object[] arguments ){
        if( arguments == null || arguments.length == 0 ){
            return null;
        }
        List<InputMapping<?>> list = new ArrayList<>();
        for( Object argument : arguments ){
            list.add( createInputMapping( argument ) );
        }
        return list.toArray( new InputMapping<?>[arguments.length] );

    }
716510
public static String[] replaceDataReferencesInArray(final String[] args, final Map<String, Map<String, String>> data) {
        return replaceDataReferencesInArray(args, data, null, false);
    }
407405
public final <U1> Tuple1<U1> map1(Function<? super T1, ? extends U1> function) {
        return Tuple.tuple(function.apply(v1));
    }
1228738
public static String format(String formatString, Object... args) {
    // Rewrites the varargs so that objects that need special formatting are
    // replaced with formatted strings, then hands off to {@link String#format}.

    Object[] formattedArgs = new Object[args.length];
    for (int i = 0; i < args.length; ++i) {
      formattedArgs[i] = formatObject(args[i]);
    }

    return String.format(formatString, (Object[]) formattedArgs);
  }
1202481
@Override
    public List<T> subList(int arg0, int arg1) {
        while ( allResults.size() < arg1 && nextResultsAvailable() ) {
            moveNextResults();
        }
        
        return Collections.unmodifiableList(allResults.subList(arg0, arg1));
    }
145726
public static String[] removeFirst(String[] args) {
		String[] args2 = new String[args.length - 1];
		System.arraycopy(args, 1, args2, 0, args2.length);
		return args2;
	}
588769
function cloneArgs(args) {
    var newArgs = {};
    for(var key in args){
      if (key && args.hasOwnProperty(key)) {
        newArgs[key] = args[key];
      }
    }
    newArgs.isCacheableValue = args.isCacheableValue && args.isCacheableValue.bind(newArgs);
    return newArgs;
  }
451838
public Groundy arg(String key, CharSequence value) {
    mArgs.putCharSequence(key, value);
    return this;
  }
430496
static <K, V> Map<K, V> keyValuesToMap(Iterator<KeyValue<K, V>> keyValues) {
        Map<K, V> map = new HashMap<>();
        keyValues.forEachRemaining(pair -> map.put(pair.getKey(), pair.getValue()));
        return map;
    }
815201
public static String arrayAsString(final String[] arg, String separator) {

        StringBuffer result = new StringBuffer();
        for (int i = 0; i < arg.length; i++) {
            result.append(arg[i]);
            if ((i + 1) < arg.length) {
                result.append(separator);
            }
        }
        return result.toString();
    }
1118042
public Map<String, String> parseArgs(String[] args) {

        Map<String, String> result = new HashMap<String, String>();
        Set<String> allowedKeys = new HashSet<String>(
            Arrays.asList(PARAM_ADDITIONAL, PARAM_SCRIPT, PARAM_REGISTRY_PORT));
        for (String arg : args) {
            if (arg.startsWith("-")) {
                int eqPos = arg.indexOf("=");
                if (eqPos >= 0) {
                    String key = arg.substring(1, eqPos);
                    if (!allowedKeys.contains(key)) {
                        wrongUsage();
                    }
                    String val = arg.substring(eqPos + 1);
                    result.put(key, val);
                } else {
                    wrongUsage();
                }
            } else {
                wrongUsage();
            }
        }
        return result;
    }