  from selfdrive.car.honda.values import CAR, DBC, STEER_THRESHOLD, SPEED_FACTOR, HONDA_BOSCH
  
  GearShifter = car.CarState.GearShifter
  
  def parse_gear_shifter(gear, vals):
  
    val_to_capnp = {'P': GearShifter.park, 'R': GearShifter.reverse, 'N': GearShifter.neutral,
                    'D': GearShifter.drive, 'S': GearShifter.sport, 'L': GearShifter.low}
    try:
      return val_to_capnp[vals[gear]]
    except KeyError:
      return "unknown"
  
  
  def calc_cruise_offset(offset, speed):
    # euristic formula so that speed is controlled to ~ 0.3m/s below pid_speed
    # constraints to solve for _K0, _K1, _K2 are:
 
</s> remove def parse_gear_shifter(gear, vals):

  val_to_capnp = {'P': GearShifter.park, 'R': GearShifter.reverse, 'N': GearShifter.neutral,
                  'D': GearShifter.drive, 'B': GearShifter.brake}
  try:
    return val_to_capnp[vals[gear]]
  except KeyError:
    return GearShifter.unknown
 </s> add def parse_gear_shifter(gear):
  return {'P': GearShifter.park, 'R': GearShifter.reverse, 'N': GearShifter.neutral,
              'D': GearShifter.drive, 'B': GearShifter.brake}.get(gear, GearShifter.unknown) </s> remove   if can_gear == 0x1:
    return GearShifter.park
  elif can_gear == 0x2:
    return GearShifter.reverse
  elif can_gear == 0x3:
    return GearShifter.neutral
  elif can_gear == 0x4:
    return GearShifter.drive
  elif can_gear == 0x5:
    return GearShifter.low
  return GearShifter.unknown
 </s> add   return {0x1: GearShifter.park, 0x2: GearShifter.reverse, 0x3: GearShifter.neutral,
          0x4: GearShifter.drive, 0x5: GearShifter.low}.get(can_gear, GearShifter.unknown) </s> remove     ret.enableCamera = is_ecu_disconnected(fingerprint[0], FINGERPRINTS, ECU_FINGERPRINT, candidate, ECU.CAM) or \
 </s> add     ret.enableCamera = is_ecu_disconnected(fingerprint[0], FINGERPRINTS, ECU_FINGERPRINT, candidate, Ecu.fwdCamera) or \ </s> remove from selfdrive.car.chrysler.values import ECU, ECU_FINGERPRINT, CAR, FINGERPRINTS
 </s> add from selfdrive.car.chrysler.values import Ecu, ECU_FINGERPRINT, CAR, FINGERPRINTS </s> remove from selfdrive.car.hyundai.values import ECU, ECU_FINGERPRINT, CAR, get_hud_alerts, FEATURES, FINGERPRINTS
 </s> add from selfdrive.car.hyundai.values import Ecu, ECU_FINGERPRINT, CAR, get_hud_alerts, FEATURES, FINGERPRINTS
def parse_gear_shifter(gear):
  return {'P': GearShifter.park, 'R': GearShifter.reverse, 'N': GearShifter.neutral,
            'D': GearShifter.drive, 'S': GearShifter.sport, 'L': GearShifter.low}.get(gear, GearShifter.unknown)
  from selfdrive.car.honda.values import CAR, DBC, STEER_THRESHOLD, SPEED_FACTOR, HONDA_BOSCH
  
  GearShifter = car.CarState.GearShifter
  
def parse_gear_shifter(gear):
  return {'P': GearShifter.park, 'R': GearShifter.reverse, 'N': GearShifter.neutral,
            'D': GearShifter.drive, 'S': GearShifter.sport, 'L': GearShifter.low}.get(gear, GearShifter.unknown)
def parse_gear_shifter(gear):
  return {'P': GearShifter.park, 'R': GearShifter.reverse, 'N': GearShifter.neutral,
            'D': GearShifter.drive, 'S': GearShifter.sport, 'L': GearShifter.low}.get(gear, GearShifter.unknown)
def parse_gear_shifter(gear):
  return {'P': GearShifter.park, 'R': GearShifter.reverse, 'N': GearShifter.neutral,
            'D': GearShifter.drive, 'S': GearShifter.sport, 'L': GearShifter.low}.get(gear, GearShifter.unknown)
def parse_gear_shifter(gear):
  return {'P': GearShifter.park, 'R': GearShifter.reverse, 'N': GearShifter.neutral,
            'D': GearShifter.drive, 'S': GearShifter.sport, 'L': GearShifter.low}.get(gear, GearShifter.unknown)
def parse_gear_shifter(gear):
  return {'P': GearShifter.park, 'R': GearShifter.reverse, 'N': GearShifter.neutral,
            'D': GearShifter.drive, 'S': GearShifter.sport, 'L': GearShifter.low}.get(gear, GearShifter.unknown)
def parse_gear_shifter(gear):
  return {'P': GearShifter.park, 'R': GearShifter.reverse, 'N': GearShifter.neutral,
            'D': GearShifter.drive, 'S': GearShifter.sport, 'L': GearShifter.low}.get(gear, GearShifter.unknown)
def parse_gear_shifter(gear):
  return {'P': GearShifter.park, 'R': GearShifter.reverse, 'N': GearShifter.neutral,
            'D': GearShifter.drive, 'S': GearShifter.sport, 'L': GearShifter.low}.get(gear, GearShifter.unknown)
def parse_gear_shifter(gear):
  return {'P': GearShifter.park, 'R': GearShifter.reverse, 'N': GearShifter.neutral,
            'D': GearShifter.drive, 'S': GearShifter.sport, 'L': GearShifter.low}.get(gear, GearShifter.unknown)
  
  
  def calc_cruise_offset(offset, speed):
    # euristic formula so that speed is controlled to ~ 0.3m/s below pid_speed
    # constraints to solve for _K0, _K1, _K2 are:
keep keep keep keep replace replace replace replace replace replace replace replace keep keep keep keep keep
 Clean up ECU redundancy in selfdrive/car/* (#963)

* clean up ecu redundancy in selfdrive/car

* clean up gear parsing 
selfdrive/car/honda/carstate.py