code: def _cast_attr(value, default):
      env.require(lore.dependencies.DATEUTIL)
      import dateutil
  
      if isinstance(default, bool):
          return value.lower() in ["1", "t", "true"]
      elif isinstance(default, int):
          return int(value)
      elif isinstance(default, float):
          return float(value)
      elif isinstance(default, datetime.date):
          return dateutil.parser.parse(value).date()
      elif isinstance(default, datetime.datetime):
          return dateutil.parser.parse(value)
      elif isinstance(value, str) and default is None:
          if value.lower() in ["t", "true"]:
              return True
          elif value.lower() in ["f", "false"]:
              return False
          elif value.lower() in ["none"]:
              return None
  
          try:
              f = float(value)
              i = int(f)
              if str(i) == value:
                  return i
              elif str(f) == value:
                  return f
          except ValueError:
              pass
  
          try:
              return dateutil.parser.parse(value)
          except ValueError:
              pass
  
      return value
  
imports: from __future__ import absolute_import, unicode_literals
  import argparse
  import datetime
  import distutils.dir_util
  import glob
  from io import open
  import importlib
  import inspect
  import json
  import logging
  import os
  import platform
  import pkgutil
  import re
  import shutil
  import subprocess
  import sys
  import lore
  from lore import ansi, env, util
  from lore.util import timer, which
label_desc: Use image node_id 5 for calling a global function with example usage: _cast_attr(value, default) and returns: value, unknown, int, float, dateutil, dateutil, True, dateutil, False, i, None, f