original_docstring: 
      Helper function which iterates over a dataframe that contains the MNIST data, applies the defined transformations
      to the data, and creates & stores an output for each row in the input dataframe in the specified folder structure.
      :param df_X: A dataframe containing the MNIST data, where each row contains a flattend matrix of the MNIST digit
                   representation
      :param df_y: A series containing the label; the indices of df_X and df_y must be synced
                   i.e. the label specified in df_y[i] must correspond to the data in df_X[i]
      :param fname_prefix: filename prefix of the output data
      :param rootdir: root directory into which the data will be stored
      :param subdir: the sub directory into which the data will be stored
      :param xforms: a list of transforms to be applied to each image before it is stored
      :param random_state_obj: object used to derive random states for each image that is generated
      :param output_file_start_counter: output files have the format: <fname_prefix>_counter, and this value denotes the
             start value of that counter
      :param dtype: how to interpret the input data from df_X
      :return: a list of dictionaries of the paths to the files that were stored as a result of the processing, and their
              associated label.
      
docstring: Helper function which iterates over a dataframe that contains the MNIST data, applies the defined transformations
  to the data, and creates & stores an output for each row in the input dataframe in the specified folder structure.
docstring_tokens: Helper function which iterates over a dataframe that contains the MNIST data applies the defined transformations to the data and creates & stores an output for each row in the input dataframe in the specified folder structure .
code: def _df_iterate_store(df_X: pd.DataFrame, df_y: pd.Series, fname_prefix: str, rootdir: str, subdir: str,
                        xforms: Sequence[dg_transform.Transform], random_state_obj: RandomState,
                        output_file_start_counter: int = 0,
                        dtype=np.uint8) -> Sequence[Dict]:
      """
      Helper function which iterates over a dataframe that contains the MNIST data, applies the defined transformations
      to the data, and creates & stores an output for each row in the input dataframe in the specified folder structure.
      :param df_X: A dataframe containing the MNIST data, where each row contains a flattend matrix of the MNIST digit
                   representation
      :param df_y: A series containing the label; the indices of df_X and df_y must be synced
                   i.e. the label specified in df_y[i] must correspond to the data in df_X[i]
      :param fname_prefix: filename prefix of the output data
      :param rootdir: root directory into which the data will be stored
      :param subdir: the sub directory into which the data will be stored
      :param xforms: a list of transforms to be applied to each image before it is stored
      :param random_state_obj: object used to derive random states for each image that is generated
      :param output_file_start_counter: output files have the format: <fname_prefix>_counter, and this value denotes the
             start value of that counter
      :param dtype: how to interpret the input data from df_X
      :return: a list of dictionaries of the paths to the files that were stored as a result of the processing, and their
              associated label.
      """
      output_list = []
      for ii in tqdm(range(df_X.shape[0]), desc=fname_prefix):
          # setup the random state for the image from the master
          img_random_state = RandomState(random_state_obj.randint(dg_constants.RANDOM_STATE_DRAW_LIMIT))
  
          output_fname = os.path.join(subdir, fname_prefix+'_'+str(output_file_start_counter)+'.png')
          output_filename_fullpath = os.path.join(rootdir, output_fname)
          output_file_start_counter += 1
  
          X = df_X[ii, :].reshape(mnist_utils.MNIST_IMG_SHAPE).astype(dtype)
          # add a new axis to make the image compatible w/ tensors (nrows, ncols, nchan)
          X = X[:, :, np.newaxis]
          X_obj = dg_entity.GenericImageEntity(X, mask=None)
  
          # perform any "pre" modifications to the data if specified
          X_obj = dg_utils.process_xform_list(X_obj, xforms, img_random_state)
          y = df_y[ii]
  
          # write data to disk
          cv2.imwrite(output_filename_fullpath, X_obj.get_data())
  
          # append to list
          output_list.append({'file': output_fname, 'label': y})
  
      return output_list
code_tokens: def _df_iterate_store ( df_X : pd . DataFrame , df_y : pd . Series , fname_prefix : str , rootdir : str , subdir : str , xforms : Sequence [ dg_transform . Transform ] , random_state_obj : RandomState , output_file_start_counter : int = 0 , dtype = np . uint8 ) -> Sequence [ Dict ] : output_list = [ ] for ii in tqdm ( range ( df_X . shape [ 0 ] ) , desc = fname_prefix ) : img_random_state = RandomState ( random_state_obj . randint ( dg_constants . RANDOM_STATE_DRAW_LIMIT ) ) output_fname = os . path . join ( subdir , fname_prefix + '_' + str ( output_file_start_counter ) + '.png' ) output_filename_fullpath = os . path . join ( rootdir , output_fname ) output_file_start_counter += 1 X = df_X [ ii , : ] . reshape ( mnist_utils . MNIST_IMG_SHAPE ) . astype ( dtype ) X = X [ : , : , np . newaxis ] X_obj = dg_entity . GenericImageEntity ( X , mask = None ) X_obj = dg_utils . process_xform_list ( X_obj , xforms , img_random_state ) y = df_y [ ii ] cv2 . imwrite ( output_filename_fullpath , X_obj . get_data ( ) ) output_list . append ( { 'file' : output_fname , 'label' : y } ) return output_list
short_docstring: Helper function which iterates over a dataframe that contains the MNIST data, applies the defined transformations
  to the data, and creates & stores an output for each row in the input dataframe in the specified folder structure.
short_docstring_tokens: Helper function which iterates over a dataframe that contains the MNIST data applies the defined transformations to the data and creates & stores an output for each row in the input dataframe in the specified folder structure .
comment: """
      Helper function which iterates over a dataframe that contains the MNIST data, applies the defined transformations
      to the data, and creates & stores an output for each row in the input dataframe in the specified folder structure.
      :param df_X: A dataframe containing the MNIST data, where each row contains a flattend matrix of the MNIST digit
                   representation
      :param df_y: A series containing the label; the indices of df_X and df_y must be synced
                   i.e. the label specified in df_y[i] must correspond to the data in df_X[i]
      :param fname_prefix: filename prefix of the output data
      :param rootdir: root directory into which the data will be stored
      :param subdir: the sub directory into which the data will be stored
      :param xforms: a list of transforms to be applied to each image before it is stored
      :param random_state_obj: object used to derive random states for each image that is generated
      :param output_file_start_counter: output files have the format: <fname_prefix>_counter, and this value denotes the
             start value of that counter
      :param dtype: how to interpret the input data from df_X
      :return: a list of dictionaries of the paths to the files that were stored as a result of the processing, and their
              associated label.
      """$SEP$# setup the random state for the image from the master$SEP$# add a new axis to make the image compatible w/ tensors (nrows, ncols, nchan)$SEP$# perform any "pre" modifications to the data if specified$SEP$# write data to disk$SEP$# append to list