def convert_bytes(value, unit):
    """Convert bytes to something else"""
    if unit == 'Bps':
        return value
    if unit == 'bps':
        return value * 8
    multiple_unit = unit[0]
    data_unit = unit[1:]
    if data_unit == 'bps':
        value *= 8
    for single_unit in ['k', 'M', 'G', 'T']:
        value = value / 1000
        if single_unit == multiple_unit:
            return value
    raise Exception('Cannot parse %s' % unit)
