code: def str2bool(string):
      str2val = {"True": True, "False": False}
      if string in str2val:
          return str2val[string]
      else:
          raise ValueError(
              f"Expected one of {set(str2val.keys())}, got {string}"
          )
  
imports: import json
  import os
  import re
  import sys
  import zlib
  from typing import Callable, List, Optional, TextIO
label_desc: Use image node_id 2 for calling a global function with example usage: str2bool(string) and returns: str2val