code: def guess_sequence(redeem_script):
      '''
      str -> int
      If OP_CSV is used, guess an appropriate sequence
      Otherwise, disable RBF, but leave lock_time on.
      Fails if there's not a constant before OP_CSV
      '''
      try:
          script_array = redeem_script.split()
          loc = script_array.index('OP_CHECKSEQUENCEVERIFY')
          return int(script_array[loc - 1], 16)
      except ValueError:
          return 0xFFFFFFFf guess_sequence(redeem_script):
      '''
      str -> int
      If OP_CSV is used, guess an appropriate sequence
      Otherwise, disable RBF, but leave lock_time on.
      Fails if there's not a constant before OP_CSV
      '''
      try:
          script_array = redeem_script.split()
          loc = script_array.index('OP_CHECKSEQUENCEVERIFY')
          return int(script_array[loc - 1], 16)
      except ValueError:
          return 0xFFFFFFFE
docs: str -> int
      If OP_CSV is used, guess an appropriate sequence
      Otherwise, disable RBF, but leave lock_time on.
      Fails if there's not a constant before OP_CSV