def METHOD_NAME(p, p_recv=None):
  two_pandas = p_recv is not None
  p.set_safety_mode(Panda.SAFETY_ALLOUTPUT)
  if two_pandas:
    p_recv.set_safety_mode(Panda.SAFETY_ALLOUTPUT)
  # enable output mode
  else:
    p.set_can_loopback(True)
  tests = [
    [500, 1000, 2000], # speeds
    [93, 87, 78], # saturation thresholds
  ]
  for i in range(len(tests[0])):
    # set bus 0 data speed to speed
    p.set_can_data_speed_kbps(0, tests[0][i])
    if p_recv is not None:
      p_recv.set_can_data_speed_kbps(0, tests[0][i])
    time.sleep(0.05)
    comp_kbps = time_many_sends(p, 0, p_recv=p_recv, msg_count=400, two_pandas=two_pandas, msg_len=64)
    # bit count from https://en.wikipedia.org/wiki/CAN_bus
    saturation_pct = (comp_kbps / tests[0][i]) * 100.0
    assert saturation_pct > tests[1][i]
    assert saturation_pct < 100