class_docstr: sklearn specific Array API compatibility wrapper
  
  This wrapper makes it possible for scikit-learn maintainers to
  deal with discrepancies between different implementations of the
  Python array API standard and its evolution over time.
  
  The Python array API standard specification:
  https://data-apis.org/array-api/latest/
  
  Documentation of the NumPy implementation:
  https://numpy.org/neps/nep-0047-array-api-standard.html
class_docstr_tok: ["sklearn","specific","Array","API","compatibility","wrapper","This","wrapper","makes","it","possible","for","scikit-learn","maintainers","to","deal","with","discrepancies","between","different","implementations","of","the","Python","array","API","standard","and","its","evolution","over","time",".","The","Python","array","API","standard","specification",":","https",":","\/\/data-apis.org\/array-api\/latest\/","Documentation","of","the","NumPy","implementation",":","https",":","\/\/numpy.org\/neps\/nep-0047-array-api-standard.html"]
code: def take(self, X, indices, *, axis=0):
      # When array_api supports `take` we can use this directly
      # https://github.com/data-apis/array-api/issues/177
      if self._namespace.__name__ == "numpy.array_api":
          X_np = numpy.take(X, indices, axis=axis)
          return self._namespace.asarray(X_np)
  
      # We only support axis in (0, 1) and ndim in (1, 2) because that is all we need
      # in scikit-learn
      if axis not in {0, 1}:
          raise ValueError(
              f"Only axis in (0, 1) is supported. Got {axis}"
          )
  
      if X.ndim not in {1, 2}:
          raise ValueError(
              f"Only X.ndim in (1, 2) is supported. Got {X.ndim}"
          )
  
      if axis == 0:
          if X.ndim == 1:
              selected = [X[i] for i in indices]
          else:  # X.ndim == 2
              selected = [X[i, :] for i in indices]
      else:  # axis == 1
          selected = [X[:, i] for i in indices]
      return self._namespace.stack(selected, axis=axis)
  
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 3 for calling the _ArrayAPIWrapper obj's underlying member method code with example usage: obj.take(X, indices) and returns: self, self