def reverse_insort(seq, val):
    lo = 0
    hi = len(seq)
    while lo < hi:
        mid = (lo + hi) // 2
        if val > seq[mid]:
            hi = mid
        else:
            lo = mid + 1
    seq.insert(lo, val)

def reverse_insort(seq, val, lo=0, hi=None):
    if hi is None:
        hi = len(seq)
    while lo < hi:
        mid = (lo + hi) // 2
        if val > seq[mid]:
            hi = mid
        else:
            lo = mid + 1
    seq.insert(lo, val)

Add optional hi and lo params to reverse_insort
Add optional hi and lo params to reverse_insort

- def reverse_insort(seq, val):
+ def reverse_insort(seq, val, lo=0, hi=None):
-     lo = 0
+     if hi is None:
-     hi = len(seq)
+         hi = len(seq)
      while lo < hi:
          mid = (lo + hi) // 2
          if val > seq[mid]:
              hi = mid
          else:
              lo = mid + 1
      seq.insert(lo, val)
  
Add optional hi and lo params to reverse_insort
## Code Before:
def reverse_insort(seq, val):
    lo = 0
    hi = len(seq)
    while lo < hi:
        mid = (lo + hi) // 2
        if val > seq[mid]:
            hi = mid
        else:
            lo = mid + 1
    seq.insert(lo, val)

## Instruction:
Add optional hi and lo params to reverse_insort
## Code After:
def reverse_insort(seq, val, lo=0, hi=None):
    if hi is None:
        hi = len(seq)
    while lo < hi:
        mid = (lo + hi) // 2
        if val > seq[mid]:
            hi = mid
        else:
            lo = mid + 1
    seq.insert(lo, val)
