def prettyMemory(k, field=None, isBytes=False):
    if isBytes:
        k /= 1024
    if k < 1024:
        return padStr("%gK" % k, field)
    if k < (1024 * 1024):
        return padStr("%.1fM" % (k / 1024.0), field)
    if k < (1024 * 1024 * 1024):
        return padStr("%.1fG" % (k / 1024.0 / 1024.0), field)
    if k < (1024 * 1024 * 1024 * 1024):
        return padStr("%.1fT" % (k / 1024.0 / 1024.0 / 1024.0), field)
    if k < (1024 * 1024 * 1024 * 1024 * 1024):
        return padStr("%.1fP" % (k / 1024.0 / 1024.0 / 1024.0 / 1024.0), field)
direct products of the generators gens1 and gens2
dataset/ETHPy150Open BD2KGenomics/toil/src/toil/utils/toilStats.py/prettyMemory--crossover with--dataset/ETHPy150Open sympy/sympy/sympy/combinatorics/tensor_can.py/perm_af_direct_product