code: def convert_to_bool(text):
      
      # handle "1" and "0"
      try:
          return bool(int(text))
      except:
          pass
  
      text = str(text).lower()
      if text == "true":
          return True
      if text == "yes":
          return True
      if text == "false":
          return False
      if text == "no":
          return False
  
      raise ValueError
docs: Convert a few common variations of "true" and "false" to boolean
  
      :param text: string to test
      :return: boolean
      :raises: ValueError