def human_readable_size(size_in_bytes_):
    """
    from http://stackoverflow.com/questions/1392413/calculating-a-directory-size-using-python
    get size from bytes to human readable format
    :param size_in_bytes_: siz in bytes
    :return: human readable string
    """
    byte_label = "B"
    kbyte_label = "KB"
    mbyte_label = "MB"
    gbyte_label = "GB"
    tbyte_label = "TB"

    units = [byte_label, kbyte_label, mbyte_label, gbyte_label, tbyte_label]
    human_fmt = "%0.1f %s"
    human_radix = 1024.
    for u in units[:-1]:
        if size_in_bytes_ < human_radix:
            return human_fmt % (size_in_bytes_, u)
        size_in_bytes_ /= human_radix
    return human_fmt % (size_in_bytes_, units[-1])