code: def _as_strided(x, shape=None, strides=None):
      """
      Create a view into the array with the given shape and strides.
      .. warning:: This function has to be used with extreme care, see notes.
  
      Parameters
      ----------
      x : ndarray
          Array to create a new.
      shape : sequence of int, optional
          The shape of the new array. Defaults to ``x.shape``.
      strides : sequence of int, optional
          The strides of the new array. Defaults to ``x.strides``.
  
      Returns
      -------
      view : ndarray
  
      Notes
      -----
      ``as_strided`` creates a view into the array given the exact strides
      and shape. This means it manipulates the internal data structure of
      ndarray and, if done incorrectly, the array elements can point to
      invalid memory and can corrupt results or crash your program.
      """
      shape = x.shape if shape is None else tuple(shape)
      strides = x.strides if strides is None else tuple(strides)
  
      return cupy.ndarray(
          shape=shape, dtype=x.dtype, memptr=x.data, strides=strides
      )
  
file_path: cupy/cupyx/scipy/signal/_arraytools.py
imports: import cupy
label_desc: Use image node_id 8 for calling a global function with example usage: _as_strided(x, shape, strides) and returns: cupy