code: def _asarray_with_order(
      array, dtype=None, order=None, copy=None, *, xp=None
  ):
      """Helper to support the order kwarg only for NumPy-backed arrays
  
      Memory layout parameter `order` is not exposed in the Array API standard,
      however some input validation code in scikit-learn needs to work both
      for classes and functions that will leverage Array API only operations
      and for code that inherently relies on NumPy backed data containers with
      specific memory layout constraints (e.g. our own Cython code). The
      purpose of this helper is to make it possible to share code for data
      container validation without memory copies for both downstream use cases:
      the `order` parameter is only enforced if the input array implementation
      is NumPy based, otherwise `order` is just silently ignored.
      """
      if xp is None:
          xp, _ = get_namespace(array)
      if _is_numpy_namespace(xp):
          # Use NumPy API to support order
          if copy is True:
              array = numpy.array(array, order=order, dtype=dtype)
          else:
              array = numpy.asarray(array, order=order, dtype=dtype)
  
          # At this point array is a NumPy ndarray. We convert it to an array
          # container that is consistent with the input's namespace.
          return xp.asarray(array)
      else:
          return xp.asarray(array, dtype=dtype, copy=copy)
  
imports: import math
  from functools import wraps
  import numpy
  import scipy.special
  from .._config import get_config
  from .fixes import parse_version
label_desc: Use image node_id 11 for calling a global function with example usage: _asarray_with_order(array, dtype, order, copy) and returns: xp, xp