code: def is_interactive_env():
      """
      Return whether the current process is running under the interactive mode.
      Check also https://stackoverflow.com/a/64523765
      """
      return hasattr(sys, "ps1")
  
imports: import contextlib
  import logging
  import math
  import sys
  import warnings
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  from lightning.pytorch.accelerators import find_usable_cuda_devices
  from torch import nn
  from autogluon.common.utils.resource_utils import ResourceManager
  from ..constants import DDP_STRATEGIES, OBJECT_DETECTION, OCR
label_desc: Use image node_id 1 for calling a global function with example usage: is_interactive_env() and returns: hasattr