code: def arraylikes():
      """
      Generator for functions converting an array into various array-likes.
      If full is True (default) it includes array-likes not capable of handling
      all dtypes.
      """
  
      # base array:
      def ndarray(a):
          return a
  
      yield param(ndarray, id="ndarray")
  
      # subclass:
      class MyArr(np.ndarray):
          pass
  
      def subclass(a):
          return a.view(MyArr)
  
      yield subclass
  
      class _SequenceLike:
          # Older NumPy versions, sometimes cared whether a protocol array was
          # also _SequenceLike.  This shouldn't matter, but keep it for now
          # for __array__ and not the others.
          def __len__(self):
              raise TypeError
  
          def __getitem__(self):
              raise TypeError
  
      # Array-interface
      class ArrayDunder(_SequenceLike):
          def __init__(self, a):
              self.a = a
  
          def __array__(self, dtype=None):
              return self.a
  
      yield param(ArrayDunder, id="__array__")
  
      # memory-view
      yield param(memoryview, id="memoryview")
  
      # Array-interface
      class ArrayInterface:
          def __init__(self, a):
              self.a = a  # need to hold on to keep interface valid
              self.__array_interface__ = a.__array_interface__
  
      yield param(ArrayInterface, id="__array_interface__")
  
      # Array-Struct
      class ArrayStruct:
          def __init__(self, a):
              self.a = a  # need to hold on to keep struct valid
              self.__array_struct__ = a.__array_struct__
  
      yield param(ArrayStruct, id="__array_struct__")
  
imports: from itertools import permutations, product
  import pytest
  from pytest import param
  import numpy
  import numpy._core._multiarray_umath
  from numpy._core._rational_tests import rational
  from numpy.testing import assert_array_equal, assert_warns, IS_PYPY
label_desc: Use image node_id 1 for calling a global function with example usage: arraylikes() and returns: a, a, self