code: def check_tensorflow_casting(x1, x2):
      """Check whether the two arguments provided in the function have the same
      dtype, unless one of them is an array_like or scalar, where it gets casted
      to the other input's dtype.
  
      Parameters
      ----------
      x1
          First argument which can be tensor, array_like or scalar
      x2
          Second argument which can be tensor, array_like or scalar
  
      Returns
      -------
      x1
          First tensor promoted accordingly.
      x2
          Second tensor promoted accordingly.
      """
      if hasattr(x1, "dtype") and not hasattr(x2, "dtype"):
          x1 = ivy.asarray(x1)
          x2 = ivy.asarray(x2, dtype=x1.dtype)
      else:
          x1 = ivy.asarray(x1)
          if not hasattr(x2, "dtype"):
              x2 = ivy.asarray(x2, dtype=x1.dtype)
          ivy.utils.assertions.check_same_dtype(x1, x2)
      return x1, x2
  
imports: import sys
  import ivy
  from ivy.utils.exceptions import handle_exceptions
  from ivy.functional.frontends import set_frontend_to_specific_version
  from numbers import Number
  from typing import Union, Tuple, Iterable
  from .dtypes import DType
  from .None import dtypes
  from .dtypes import as_dtype, cast
  from .None import ragged
  from .ragged import *
  from .None import tensor
  from .tensor import EagerTensor, Tensor
  from .tensorarray import TensorArray
  from .None import variable
  from .variable import Variable, IndexedSlices
  from .None import keras
  from .None import compat
  from .None import image
  from .None import linalg
  from .linalg import matmul, tensordot, eig, eye, norm
  from .None import math
  from .math import *
  from .None import nest
  from .None import nn
  from .None import quantization
  from .None import random
  from .None import general_functions
  from .general_functions import *
  from .None import raw_ops
  from .None import sets
  from .None import signal
  from .None import sparse
label_desc: Use image node_id 1 for calling a global function with example usage: check_tensorflow_casting(x1, x2) and returns: x1,  x2