class_docstr: Training set contains history baskets
  
  Parameters
  ----------
  num_users: int, required
      Number of users.
  
  num_items: int, required
      Number of items.
  
  uid_map: :obj:`OrderDict`, required
      The dictionary containing mapping from user original ids to mapped integer indices.
  
  iid_map: :obj:`OrderDict`, required
      The dictionary containing mapping from item original ids to mapped integer indices.
  
  uir_tuple: tuple, required
      Tuple of 3 numpy arrays (user_indices, item_indices, rating_values).
  
  basket_indices: numpy.array, required
      Array of basket indices corresponding to observation in `uir_tuple`.
  
  timestamps: numpy.array, optional, default: None
      Numpy array of timestamps corresponding to feedback in `uir_tuple`.
      This is only available when input data is in `UBIT` and `UBITJson` formats.
  
  extra_data: numpy.array, optional, default: None
      Array of json object corresponding to observations in `uir_tuple`.
  
  seed: int, optional, default: None
      Random seed for reproducing data sampling.
  
  Attributes
  ----------
  ubi_tuple: tuple
      Tuple (user_indices, baskets).
  
  timestamps: numpy.array
      Numpy array of timestamps corresponding to feedback in `ubi_tuple`.
      This is only available when input data is in `UTB` format.
class_docstr_tok: ["Training","set","contains","history","baskets","Parameters","--","--","--","--","--","num_users",":","int",",","required","Number","of","users",".","num_items",":","int",",","required","Number","of","items",".","uid_map",":",":","obj",":","`","OrderDict","`",",","required","The","dictionary","containing","mapping","from","user","original","ids","to","mapped","integer","indices",".","iid_map",":",":","obj",":","`","OrderDict","`",",","required","The","dictionary","containing","mapping","from","item","original","ids","to","mapped","integer","indices",".","uir_tuple",":","tuple",",","required","Tuple","of","3","numpy","arrays","(","user_indices",",","item_indices",",","rating_values",")",".","basket_indices",":","numpy.array",",","required","Array","of","basket","indices","corresponding","to","observation","in","`","uir_tuple","`",".","timestamps",":","numpy.array",",","optional",",","default",":","None","Numpy","array","of","timestamps","corresponding","to","feedback","in","`","uir_tuple","`",".","This","is","only","available","when","input","data","is","in","`","UBIT","`","and","`","UBITJson","`","formats",".","extra_data",":","numpy.array",",","optional",",","default",":","None","Array","of","json","object","corresponding","to","observations","in","`","uir_tuple","`",".","seed",":","int",",","optional",",","default",":","None","Random","seed","for","reproducing","data","sampling",".","Attributes","--","--","--","--","--","ubi_tuple",":","tuple","Tuple","(","user_indices",",","baskets",")",".","timestamps",":","numpy.array","Numpy","array","of","timestamps","corresponding","to","feedback","in","`","ubi_tuple","`",".","This","is","only","available","when","input","data","is","in","`","UTB","`","format","."]
docstr: Create an iterator over data yielding batch of users, basket ids, and batch of the corresponding items
  
  Parameters
  ----------
  batch_size: int, optional, default = 1
  
  shuffle: bool, optional, default: False
      If `True`, orders of users will be randomized. If `False`, default orders kept.
  
  Returns
  -------
  iterator : batch of user indices, batch of baskets corresponding to user indices, and batch of items correponding to baskets
docstr_tok: ["Create","an","iterator","over","data","yielding","batch","of","users",",","basket","ids",",","and","batch","of","the","corresponding","items","Parameters","--","--","--","--","--","batch_size",":","int",",","optional",",","default","=","1","shuffle",":","bool",",","optional",",","default",":","False","If","`","True","`",",","orders","of","users","will","be","randomized",".","If","`","False","`",",","default","orders","kept",".","Returns","--","--","--","-","iterator",":","batch","of","user","indices",",","batch","of","baskets","corresponding","to","user","indices",",","and","batch","of","items","correponding","to","baskets"]
code: def ubi_iter(self, batch_size=1, shuffle=False):
      """Create an iterator over data yielding batch of users, basket ids, and batch of the corresponding items
  
      Parameters
      ----------
      batch_size: int, optional, default = 1
  
      shuffle: bool, optional, default: False
          If `True`, orders of users will be randomized. If `False`, default orders kept.
  
      Returns
      -------
      iterator : batch of user indices, batch of baskets corresponding to user indices, and batch of items correponding to baskets
  
      """
      _, item_indices, _ = self.uir_tuple
      for batch_users, batch_baskets in self.ub_iter(
          batch_size, shuffle
      ):
          batch_basket_items = [
              [item_indices[self.baskets[bid]] for bid in user_baskets]
              for user_baskets in batch_baskets
          ]
          yield batch_users, batch_baskets, batch_basket_items
  
imports: import copy
  import os
  import pickle
  import warnings
  from collections import Counter, OrderedDict, defaultdict
  import numpy
  from scipy.sparse import csc_matrix, csr_matrix, dok_matrix
  from ..utils import estimate_batches, get_rng, validate_format
label_desc: Use image node_id 11 for calling the BasketDataset obj's underlying member method code with example usage: obj.ubi_iter(batch_size, shuffle) without return types