code: def environment_var_to_bool(env_var):
      
  
      # Try to see if env_var can be converted to an int
      try:
          env_var = int(env_var)
      except ValueError:
          pass
  
      if isinstance(env_var, numbers.Number):
          return bool(env_var)
      elif is_a_string(env_var):
          env_var = env_var.lower().strip()
          if env_var in "false":
              return False
          else:
              return True
      else:
          return bool(env_var)
docs: Converts an environment variable to a boolean
  
          Returns False if the environment variable is False, 0 or a case-insenstive string "false"
          or "0".