def hr_size(size):
    """Returns human readable size
       input size in bytes
    """
    units = ["B", "kB", "MB", "GB", "TB", "PB"]
    i = 0  # index
    while (size > 1024 and i < len(units)):
        i += 1
        size /= 1024.0
    return f"{size:.2f} {units[i]}"