def readable_bytes(num_bytes):
    """Converts number of bytes to readable units.

    Args:
        num_bytes (int): Number of bytes.

    Returns:
        num_bytes (float): Number of bytes in the appropriate unit
            (B, KB, MB, or GB).
        unit (string): The appropriate unit.
    """
    units = ['B', 'KB', 'MB', 'GB']
    idx = 0
    while int(num_bytes / 1024):
        num_bytes /= 1024
        idx += 1
        if idx == (len(units) - 1):
            break

    unit = units[idx]
    return num_bytes, unit