code: def _is_optional(type_: type) -> bool:
      """
      Utility method that returns whether a type is Optional.
      """
      return get_origin(type_) is Union and type(None) in get_args(
          type_
      )
  
imports: from typing import Union, get_args, get_origin, Any
  import logging
label_desc: Use image node_id 1 for calling a global function with example usage: _is_optional(type_) and returns: unknown