Return a coefficient array as a string of base 10 digits.
765850
function coeffToString(a) {
        var s, z,
            i = 1,
            j = a.length,
            r = a[0] + '';

        for ( ; i < j; ) {
            s = a[i++] + '';
            z = LOG_BASE - s.length;
            for ( ; z--; s = '0' + s );
            r += s;
        }

        // Determine trailing zeros.
        for ( j = r.length; r.charCodeAt(--j) === 48; );
        return r.slice( 0, j + 1 || 1 );
    }
572136
def recursive_index_encode(int_array, max=32767, min=-32768):
    """"""
    out_arr = []
    for curr in int_array:
        if curr >= 0 :
            while curr >= max:
                out_arr.append(max)
                curr -=  max
        else:
            while curr <= min:
                out_arr.append(min)
                curr += int(math.fabs(min))
        out_arr.append(curr)
    return out_arr
1060815
function encode_numeric(str) {
    var len = str.length;
    var bits = [];

    for (var i = 0; i < len; i += 3) {
        var s = str.substr(i, 3);
        var b = Math.ceil(s.length * 10 / 3);
        pushBits(bits, b, parseInt(s, 10));
    }

    var res = {};

    var d = [0, 0, 0, 1];
    pushBits(d, 14, len);
    res.data27 = d.concat(bits);

    if (len < 4096) {
        var d = [0, 0, 0, 1];
        pushBits(d, 12, len);
        res.data10 = d.concat(bits);
    }

    if (len < 1024) {
        var d = [0, 0, 0, 1];
        pushBits(d, 10, len);
        res.data1 = d.concat(bits);
    }

    return res;
}
1108594
def digit(m: Union[int, pd.Series], n: int) -> Union[int, pd.Series]:
        """"""
        return (m // (10 ** n)) % 10
444982
def str_to_int_array(string, base=16):
    

    int_strings = string.split()
    return [int(int_str, base) for int_str in int_strings]
312633
function getBase10Exponent(x) {
    var e = x.e * LOG_BASE,
      w = x.d[0];

    // Add the number of digits of the first word of the digits array.
    for (; w >= 10; w /= 10) e++;
    return e;
  }
95952
private int[] maxIntegerDigits(double[][] values) {
    int[] digits = new int[values[0].length];
    for(int j = 0; j < values[0].length; j++) {
      for(double[] value : values) {
        digits[j] = Math.max(digits[j], integerDigits(value[j]));
      }
    }
    return digits;
  }
1333568
function decCoefficientToBinaryString (x) {
  // Convert to string
  const a = x.d // array with digits
  let r = a[0] + ''

  for (let i = 1; i < a.length; ++i) {
    let s = a[i] + ''
    for (let z = 7 - s.length; z--;) {
      s = '0' + s
    }

    r += s
  }

  let j = r.length
  while (r.charAt(j) === '0') {
    j--
  }

  let xe = x.e
  let str = r.slice(0, j + 1 || 1)
  const strL = str.length
  if (xe > 0) {
    if (++xe > strL) {
      // Append zeros.
      xe -= strL
      while (xe--) {
        str += '0'
      }
    } else if (xe < strL) {
      str = str.slice(0, xe) + '.' + str.slice(xe)
    }
  }

  // Convert from base 10 (decimal) to base 2
  const arr = [0]
  for (let i = 0; i < str.length;) {
    let arrL = arr.length
    while (arrL--) {
      arr[arrL] *= 10
    }

    arr[0] += parseInt(str.charAt(i++)) // convert to int
    for (let j = 0; j < arr.length; ++j) {
      if (arr[j] > 1) {
        if (arr[j + 1] === null || arr[j + 1] === undefined) {
          arr[j + 1] = 0
        }

        arr[j + 1] += arr[j] >> 1
        arr[j] &= 1
      }
    }
  }

  return arr.reverse()
}
220482
private static String arrayToString(int[] x) {
    StringBuilder sb = new StringBuilder("(");
    for (int j = 0; j < x.length; j++) {
      sb.append(x[j]);
      if (j != x.length - 1) {
        sb.append(", ");
      }
    }
    sb.append(")");
    return sb.toString();
  }
35169
def millify(n, precision=0, drop_nulls=True, prefixes=[]):
    """"""
    millnames = ['', 'k', 'M', 'B', 'T', 'P', 'E', 'Z', 'Y']
    if prefixes:
        millnames = ['']
        millnames.extend(prefixes)
    n = float(n)
    millidx = max(0, min(len(millnames) - 1,
                         int(math.floor(0 if n == 0 else math.log10(abs(n)) / 3))))
    result = '{:.{precision}f}'.format(n / 10**(3 * millidx), precision=precision)
    if drop_nulls:
        result = remove_exponent(Decimal(result))
    return '{0}{dx}'.format(result, dx=millnames[millidx])
280861
def _format_str(format_int):
    """"""
    for dictionary in _formats, _subtypes, _endians:
        for k, v in dictionary.items():
            if v == format_int:
                return k
    else:
        return 'n/a'
993300
def _get_decimal128(data, position, dummy0, dummy1, dummy2):
    """"""
    end = position + 16
    return Decimal128.from_bid(data[position:end]), end
193149
def NumbersToWords(number):
    

    units = [
        'one',
        'two',
        'three',
        'four',
        'five',
        'six',
        'seven',
        'eight',
        'nine']
    tens = [
        'ten',
        'twenty',
        'thirty',
        'forty',
        'fifty',
        'sixty',
        'seventy',
        'eighty',
        'ninety']
    output = ""
    if number != 0:
        str_val = str(number)
        if 4 > len(str_val) > 2:
            output += units[int(str_val[0]) - 1]
            output += "hundred"
            if str_val[1] != 0:
                output += "and" + tens[int(str_val[1]) - 1]
                if str_val[2] != 0:
                    output += units[int(str_val[2]) - 1]
        if 3 > len(str_val) > 1:
            output += tens[int(str_val[0]) - 1]
            if str_val[1] != 0:
                output += units[int(str_val[1]) - 1]
        if 2 > len(str_val) == 1:
            output += units[int(str_val[0]) - 1]
    else:
        output = "zero"
    return output
956367
def run_length_encode(in_array):
    """"""
    if(len(in_array)==0):
        return []
    curr_ans = in_array[0]
    out_array = [curr_ans]
    counter = 1
    for in_int in in_array[1:]:
        if in_int == curr_ans:
            counter+=1
        else:
            out_array.append(counter)
            out_array.append(in_int)
            curr_ans = in_int
            counter = 1
    # Add the final counter
    out_array.append(counter)
    return out_array
517005
def to_positive_multiple_of_10(string):
    """"""
    try:
        value = int(string)
    except ValueError:
        msg = '"%r" is not a positive multiple of 10 (greater zero).' % string
        raise argparse.ArgumentTypeError(msg)
    if value <= 0 or value % 10 != 0:
        msg = '"%r" is not a positive multiple of 10 (greater zero).' % string
        raise argparse.ArgumentTypeError(msg)
    return value
1151734
def to_quotient
      if @special
        y = 0
        case @special
        when :nan
          x = 0
        when :inf
          x = @sign
        end
        return [x, y]
      end

      n = @digits.size
      a = 0
      b = a

      repeat = @repeat
      repeat = nil if repeat && repeat >= n

      for i in 0...n
        a *= @radix
        a += @digits[i]
        if repeat && i < repeat
          b *= @radix
          b += @digits[i]
        end
      end

      x = a
      x -= b if repeat

      y = @radix**(n - @point)
      y -= @radix**(repeat - @point) if repeat

      d = Numerals.gcd(x, y)
      x /= d
      y /= d

      x = -x if @sign < 0

      [x.to_i, y.to_i]
    end
434100
protected static function toBase10(
        /*# string */ $input,
        /*# string */ $fromBase
    )/*# string */ {
        $len = strlen($fromBase);
        $res = '0';
        foreach (str_split($input) as $char) {
            $res = bcadd((int) strpos($fromBase, $char), bcmul($res, $len));
        }
        return $res;
    }