class_docstr: Training set contains history sessions
  
  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).
  
  session_ids: numpy.array, required
      Array of session 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 `SIT`, `USIT`, SITJson`, and `USITJson` 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
  ----------
  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","sessions","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",")",".","session_ids",":","numpy.array",",","required","Array","of","session","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","`","SIT","`",",","`","USIT","`",",","SITJson","`",",","and","`","USITJson","`","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","--","--","--","--","--","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 user indices, batch of session indices, batch of mapped ids, and batch of sessions' items
  
  Parameters
  ----------
  batch_size: int, optional, default = 1
  
  shuffle: bool, optional, default: False
      If `True`, orders of triplets will be randomized. If `False`, default orders kept.
  
  Returns
  -------
  iterator : batch of user indices, batch of session indices (list of list), batch mapped ids (list of list of list), batch of sessions' items (list of list of list)
docstr_tok: ["Create","an","iterator","over","data","yielding","batch","of","user","indices",",","batch","of","session","indices",",","batch","of","mapped","ids",",","and","batch","of","sessions","'","items","Parameters","--","--","--","--","--","batch_size",":","int",",","optional",",","default","=","1","shuffle",":","bool",",","optional",",","default",":","False","If","`","True","`",",","orders","of","triplets","will","be","randomized",".","If","`","False","`",",","default","orders","kept",".","Returns","--","--","--","-","iterator",":","batch","of","user","indices",",","batch","of","session","indices","(","list","of","list",")",",","batch","mapped","ids","(","list","of","list","of","list",")",",","batch","of","sessions","'","items","(","list","of","list","of","list",")"]
code: def usi_iter(self, batch_size=1, shuffle=False):
      """Create an iterator over data yielding batch of user indices, batch of session indices, batch of mapped ids, and batch of sessions' items
  
      Parameters
      ----------
      batch_size: int, optional, default = 1
  
      shuffle: bool, optional, default: False
          If `True`, orders of triplets will be randomized. If `False`, default orders kept.
  
      Returns
      -------
      iterator : batch of user indices, batch of session indices (list of list), batch mapped ids (list of list of list), batch of sessions' items (list of list of list)
  
      """
      for user_indices in self.user_iter(batch_size, shuffle):
          batch_sids = [
              [sid for sid in self.user_session_data[uid]]
              for uid in user_indices
          ]
          batch_mapped_ids = [
              [
                  self.sessions[sid]
                  for sid in self.user_session_data[uid]
              ]
              for uid in user_indices
          ]
          batch_session_items = [
              [
                  [self.uir_tuple[1][i] for i in ids]
                  for ids in u_batch_mapped_ids
              ]
              for u_batch_mapped_ids in batch_mapped_ids
          ]
          yield user_indices, batch_sids, batch_mapped_ids, batch_session_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 15 for calling the SequentialDataset obj's underlying member method code with example usage: obj.usi_iter(batch_size, shuffle) without return types