code: def str2boolean(string_input):
      """
      convert user input config string to boolean
  
      :param string_input: any string in TRUE_VALUE or FALSE_VALUE
      :return: True or False
      """
      if string_input.lower() in TRUE_VALUE:
          return True
      if string_input.lower() in FALSE_VALUE:
          return False
      raise argparse.ArgumentTypeError(
          "Boolean value expected, received {}".format(string_input)
      )
  
file_path: NiftyNet/niftynet/utilities/user_parameters_helper.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import argparse
  import re
  from six import string_types
  from niftynet.utilities.user_parameters_regex import match_array
label_desc: Use image node_id 1 for calling a global function with example usage: str2boolean(string_input) and returns: True, False