code: def is_weakly_typed(x: Any) -> bool:
      try:
          return x.aval.weak_type
      except AttributeError:
          return type(x) in _weak_types
  
imports: from __future__ import annotations
  import abc
  import builtins
  import functools
  from typing import cast, overload, Any, Literal, Union
  import warnings
  import ml_dtypes
  import numpy
  from jax._src import config
  from jax._src.typing import DType, DTypeLike
  from jax._src.util import set_module
  from jax._src import traceback_util
label_desc: Use image node_id 20 for calling a global function with example usage: is_weakly_typed(x) and returns: x, unknown