code: def _is_scalar(x):
      return (
          isinstance(x, int)
          or isinstance(x, float)
          or (isinstance(x, torch.Tensor) and x.numel() == 1)
      )
  
imports: import math
  import trampoline
  import warnings
  import numpy
  import torch
  from .None import brownian_base
  from ..settings import LEVY_AREA_APPROXIMATIONS
  from ..types import Scalar, Optional, Tuple, Union, Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: _is_scalar(x) and returns: unknown