code: def load_digits(n_class=10, return_X_y=False):
      """Load and return the digits dataset (classification).
  
      Each datapoint is a 8x8 image of a digit.
  
      =================   ==============
      Classes                         10
      Samples per class             ~180
      Samples total                 1797
      Dimensionality                  64
      Features             integers 0-16
      =================   ==============
  
      Read more in the :ref:`User Guide <datasets>`.
  
      Parameters
      ----------
      n_class : integer, between 0 and 10, optional (default=10)
          The number of classes to return.
  
      return_X_y : boolean, default=False.
          If True, returns ``(data, target)`` instead of a Bunch object.
          See below for more information about the `data` and `target` object.
  
          .. versionadded:: 0.18
  
      Returns
      -------
      data : Bunch
          Dictionary-like object, the interesting attributes are:
          'data', the data to learn, 'images', the images corresponding
          to each sample, 'target', the classification labels for each
          sample, 'target_names', the meaning of the labels, and 'DESCR',
          the full description of the dataset.
  
      (data, target) : tuple if ``return_X_y`` is True
  
          .. versionadded:: 0.18
  
      Examples
      --------
      To load the data and visualize the images::
  
          >>> from sklearn.datasets import load_digits
          >>> digits = load_digits()
          >>> print(digits.data.shape)
          (1797, 64)
          >>> import matplotlib.pyplot as plt #doctest: +SKIP
          >>> plt.gray() #doctest: +SKIP
          >>> plt.matshow(digits.images[0]) #doctest: +SKIP
          >>> plt.show() #doctest: +SKIP
      """
      module_path = datasets_dir()
      data = np.loadtxt(
          join(module_path, "data", "digits.csv.gz"), delimiter=","
      )
      with open(join(module_path, "descr", "digits.rst")) as f:
          descr = f.read()
      target = data[:, -1].astype(np.int)
      flat_data = data[:, :-1]
      images = flat_data.view()
      images.shape = (-1, 8, 8)
  
      if n_class < 10:
          idx = target < n_class
          flat_data, target = flat_data[idx], target[idx]
          images = images[idx]
  
      if return_X_y:
          return flat_data, target
  
      return Bunch(
          data=flat_data,
          target=target,
          target_names=np.arange(10),
          images=images,
          DESCR=descr,
      )
  
imports: import os
  import csv
  import sys
  import shutil
  from os import environ
  from os.path import dirname
  from os.path import join
  from os.path import exists
  from os.path import expanduser
  from os.path import isdir
  from os.path import splitext
  from os import listdir
  from os import makedirs
  import numpy
  from ..utils import check_random_state
label_desc: Use image node_id 7 for calling a global function with example usage: load_digits(n_class, return_X_y) and returns: Bunch, flat_data,  target