code: def to_int(value=None, hexstr=None, text=None):
      
      assert_one_val(value, hexstr=hexstr, text=text)
  
      if hexstr is not None:
          return int(hexstr, 16)
      elif text is not None:
          return int(text)
      elif isinstance(value, bytes):
          return big_endian_to_int(value)
      elif isinstance(value, str):
          raise TypeError("Pass in strings with keyword hexstr or text")
      else:
          return int(value)
docs: Converts value to it's integer representation.
  
      Values are converted this way:
  
       * value:
         * bytes: big-endian integer
         * bool: True => 1, False => 0
       * hexstr: interpret hex as integer
       * text: interpret as string of digits, like '12' => 12