def humanize_speed(speed):
 if ((speed >= 1000000000) and ((speed % 1000000000) == 0)):
  return '{} Tbps'.format((speed / 1000000000))
 elif ((speed >= 1000000) and ((speed % 1000000) == 0)):
  return '{} Gbps'.format((speed / 1000000))
 elif ((speed >= 1000) and ((speed % 1000) == 0)):
  return '{} Mbps'.format((speed / 1000))
 elif (speed >= 1000):
  return '{} Mbps'.format((float(speed) / 1000))
 else:
  return '{} Kbps'.format(speed)

def humanize_speed ( speed ) : if ( ( speed >= 1000000000 ) and ( ( speed % 1000000000 ) == 0 ) ) : return '{} Tbps' . format ( ( speed / 1000000000 ) ) elif ( ( speed >= 1000000 ) and ( ( speed % 1000000 ) == 0 ) ) : return '{} Gbps' . format ( ( speed / 1000000 ) ) elif ( ( speed >= 1000 ) and ( ( speed % 1000 ) == 0 ) ) : return '{} Mbps' . format ( ( speed / 1000 ) ) elif ( speed >= 1000 ) : return '{} Mbps' . format ( ( float ( speed ) / 1000 ) ) else : return '{} Kbps' . format ( speed )
humanize speeds given in kbps .