code: def boolean(value):
      """
      Parse the string ``"true"`` or ``"false"`` as a boolean (case insensitive).
  
      Also accepts ``"1"`` and ``"0"`` as ``True``/``False`` (respectively).
  
      If the input is from the request JSON body, the type is already a native python boolean,
      and will be passed through without further parsing.
  
      :raises ValueError: if the boolean value is invalid
      """
      if isinstance(value, bool):
          return value
  
      if value is None:
          raise ValueError("boolean type must be non-null")
      elif not value:
          return False
      value = str(value).lower()
      if value in (
          "true",
          "1",
          "on",
      ):
          return True
      if value in (
          "false",
          "0",
      ):
          return False
      raise ValueError(
          "Invalid literal for boolean(): {0}".format(value)
      )
  
imports: from __future__ import unicode_literals
  import re
  import socket
  from datetime import datetime, time, timedelta
  from email.utils import parsedate_tz, mktime_tz
  from six.moves.urllib.parse import urlparse
  import aniso8601
  import pytz
label_desc: Use image node_id 12 for calling a global function with example usage: boolean(value) and returns: value, True, False, False