code: def _broadcast_to(arr: ArrayLike, shape: DimSize | Shape) -> Array:
      check_arraylike("broadcast_to", arr)
      arr = arr if isinstance(arr, Array) else lax.asarray(arr)
      if not isinstance(shape, tuple) and np.ndim(shape) == 0:
          shape = (shape,)
      # check that shape is concrete
      shape = core.canonicalize_shape(shape)  # type: ignore[arg-type]
      arr_shape = np.shape(arr)
      if core.definitely_equal_shape(arr_shape, shape):
          return arr
      else:
          nlead = len(shape) - len(arr_shape)
          shape_tail = shape[nlead:]
          compatible = all(
              core.definitely_equal_one_of_dim(arr_d, [1, shape_d])
              for arr_d, shape_d in safe_zip(arr_shape, shape_tail)
          )
          if nlead < 0 or not compatible:
              msg = "Incompatible shapes for broadcasting: {} and requested shape {}"
              raise ValueError(msg.format(arr_shape, shape))
          (diff,) = np.where(
              tuple(
                  not core.definitely_equal(arr_d, shape_d)
                  for arr_d, shape_d in safe_zip(arr_shape, shape_tail)
              )
          )
          new_dims = tuple(range(nlead)) + tuple(nlead + diff)
          kept_dims = tuple(np.delete(np.arange(len(shape)), new_dims))
          return lax.broadcast_in_dim(
              lax.squeeze(arr, tuple(diff)), shape, kept_dims
          )
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  from functools import partial
  import re
  import textwrap
  from typing import Any, Callable, NamedTuple, TypeVar
  import warnings
  from jax._src import api
  from jax._src import config
  from jax._src import core
  from jax._src import dtypes
  from jax._src.lax import lax
  from jax._src.util import safe_zip, safe_map
  from jax._src.typing import Array, ArrayLike, DimSize, DType, DTypeLike, Shape
  import numpy
label_desc: Use image node_id 21 for calling a global function with example usage: _broadcast_to(arr, shape) and returns: arr, lax