code: def last_n_items(array, n_desired):
      
      # Unfortunately, we can't just do array.flat[-n_desired:] here because it
      # might not be a numpy.ndarray. Moreover, access to elements of the array
      # could be very expensive (e.g. if it's only available over DAP), so go out
      # of our way to get them in a single call to __getitem__ using only slices.
      if (n_desired == 0) or (array.size == 0):
          return []
  
      if n_desired < array.size:
          indexer = _get_indexer_at_least_n_items(array.shape, n_desired,
                                                  from_end=True)
          array = array[indexer]
      return np.asarray(array).flat[-n_desired:]
docs: Returns the last n_desired items of an array