code: def _new_like_order_and_strides(
      a, dtype, order, shape=None, *, get_memptr=True
  ):
      """
      Determine order and strides as in NumPy's PyArray_NewLikeArray.
  
      (see: numpy/core/src/multiarray/ctors.c)
      """
      order = order.upper()
      if order not in ["C", "F", "K", "A"]:
          raise ValueError("order not understood: {}".format(order))
  
      if numpy.isscalar(shape):
          shape = (shape,)
  
      # Fallback to c_contiguous if keep order and number of dimensions
      # of new shape mismatch
      if order == "K" and shape is not None and len(shape) != a.ndim:
          return "C", None, None
  
      order = chr(
          _update_order_char(
              a.flags.c_contiguous, a.flags.f_contiguous, ord(order)
          )
      )
  
      if order == "K":
          strides = _get_strides_for_order_K(
              a, numpy.dtype(dtype), shape
          )
          order = "C"
          memptr = (
              cupy.empty(a.size, dtype=dtype).data
              if get_memptr
              else None
          )
          return order, strides, memptr
      else:
          return order, None, None
  
file_path: cupy/cupy/_creation/basic.py
imports: from typing import Any, Optional
  import numpy
  import cupy
  from cupy._core.internal import _get_strides_for_order_K, _update_order_char
  from cupy.typing._types import _OrderKACF, _OrderCF, _ShapeLike, DTypeLike, NDArray
label_desc: Use image node_id 2 for calling a global function with example usage: _new_like_order_and_strides(a, dtype, order, shape) and returns: str,  None,  None, order,  strides,  memptr, order,  None,  None