text: #! /bin/env python3
  
  def NOT(val):
      return ~val
  
  def OR(a,b):
      return (a | b)
  
  def EXOR(a,b):
      return (a ^ b)
  
  def AND(a,b):
      return (a & b)
  
  def BIT(a, idx):
      mask = 1 << idx
      return bool(a & mask)
  