code: def mnist(missingness="mcar", thr=0.2):
      """Loads corrupted MNIST
  
      Parameters
      ----------
      missingness: ('mcar', 'mar', 'mnar')
          Type of missigness you want in your dataset
      th: float between [0,1]
          Percentage of missing data in generated data
  
      Returns
      -------
      numpy.ndarray
      """
      from sklearn.datasets import fetch_mldata
  
      dataset = fetch_mldata("MNIST original")
      corruptor = Corruptor(dataset.data, thr=thr)
      data = getattr(corruptor, missingness)()
      return {"X": data, "Y": dataset.target}
  
file_path: impyute/impyute/dataset/base.py
imports: import itertools
  import math
  import random
  import string
  import numpy
  from impyute.dataset.corrupt import Corruptor
  from impyute.ops import error
label_desc: Use image node_id 4 for calling a global function with example usage: mnist(missingness, thr) and returns: dict