code: def guess_locktime(redeem_script):
      '''
      str -> int
      If OP_CLTV is used, guess an appropriate lock_time
      Otherwise return 0 (no lock time)
      Fails if there's not a constant before OP_CLTV
      '''
      try:
          script_array = redeem_script.split()
          loc = script_array.index('OP_CHECKLOCKTIMEVERIFY')
          return int(script_array[loc - 1], 16)
      except ValueError:
          return f guess_locktime(redeem_script):
      '''
      str -> int
      If OP_CLTV is used, guess an appropriate lock_time
      Otherwise return 0 (no lock time)
      Fails if there's not a constant before OP_CLTV
      '''
      try:
          script_array = redeem_script.split()
          loc = script_array.index('OP_CHECKLOCKTIMEVERIFY')
          return int(script_array[loc - 1], 16)
      except ValueError:
          return 0
docs: str -> int
      If OP_CLTV is used, guess an appropriate lock_time
      Otherwise return 0 (no lock time)
      Fails if there's not a constant before OP_CLTV