code: def elementwise_unary_scalar_wrapper(fn: Callable) -> Callable:
      """
      Allows unary operators that accept tensors to work with Python numbers.
      """
      sig = inspect.signature(fn)
  
      @wraps(fn)
      def _fn(*args, **kwargs):
          if len(args) > 0 and isinstance(args[0], Number):
              dtype = utils.type_to_dtype(type(args[0]))
              args_ = list(args)
              args_[0] = torch.tensor(args[0], dtype=dtype)
              result = fn(*args_, **kwargs)
              assert isinstance(result, torch.Tensor)
              return result.item()
  
          return fn(*args, **kwargs)
  
      _fn.__signature__ = sig  # type: ignore[attr-defined]
      return _fn
  
imports: import inspect
  import warnings
  from functools import wraps
  from itertools import chain
  from typing import Callable, NamedTuple, Optional, overload, Sequence, Tuple
  import torch
  import torch._prims_common
  from torch._prims_common import CustomOutParamAnnotation, ELEMENTWISE_TYPE_PROMOTION_KIND, Number, NumberType, ShapeType, TensorLike, TensorLikeType
  from torch.utils import _pytree
  from torch.utils._pytree import tree_flatten, tree_unflatten
label_desc: Use image node_id 14 for calling a global function with example usage: elementwise_unary_scalar_wrapper(fn) and returns: _fn, fn, result