class_docstr: Reader class for reading data with different types of format.
  
  Parameters
  ----------
  user_set: set, default = None
      Set of users to be retained when reading data.
      If `None`, all users will be included.
  
  item_set: set, default = None
      Set of items to be retained when reading data.
      If `None`, all items will be included.
  
  min_user_freq: int, default = 1
      The minimum frequency of a user to be retained.
      If `min_user_freq = 1`, all users will be included.
  
  min_item_freq: int, default = 1
      The minimum frequency of an item to be retained.
      If `min_item_freq = 1`, all items will be included.
  
  num_top_freq_user: int, default = 0
      The number of top popular users to be retained.
      If `num_top_freq_user = 0`, all users will be included.
  
  num_top_freq_item: int, default = 0
      The number of top popular items to be retained.
      If `num_top_freq_item = 0`, all items will be included.
  
  min_basket_size: int, default = 1
      The minimum number of items of a basket to be retained.
      If `min_basket_size = 1`, all items will be included.
  
  max_basket_size: int, default = -1
      The maximum number of items of a basket to be retained.
      If `min_basket_size = -1`, all items will be included.
  
  min_basket_sequence: int, default = 1
      The minimum number of baskets of a user to be retained.
      If `min_basket_sequence = 1`, all baskets will be included.
  
  min_sequence_size: int, default = 1
      The minimum number of items of a sequence to be retained.
      If `min_sequence_size = 1`, all sequences will be included.
  
  max_sequence_size: int, default = -1
      The maximum number of items of a sequence to be retained.
      If `min_sequence_size = -1`, all sequences will be included.
  
  bin_threshold: float, default = None
      The rating threshold to binarize rating values (turn explicit feedback to implicit feedback).
      For example, if `bin_threshold = 3.0`, all rating values >= 3.0 will be set to 1.0,
      and the rest (< 3.0) will be discarded.
  
  encoding: str, default = `utf-8`
      Encoding used to decode the file.
  
  errors: int, default = None
      Optional string that specifies how encoding errors are to be handled.
      Pass 'strict' to raise a ValueError exception if there is an encoding error
      (None has the same effect), or pass 'ignore' to ignore errors.
code: def __init__(
      self,
      user_set=None,
      item_set=None,
      min_user_freq=1,
      min_item_freq=1,
      num_top_freq_user=0,
      num_top_freq_item=0,
      min_basket_size=1,
      max_basket_size=-1,
      min_basket_sequence=1,
      min_sequence_size=1,
      max_sequence_size=-1,
      bin_threshold=None,
      encoding="utf-8",
      errors=None,
  ):
      self.user_set = (
          user_set
          if (user_set is None or isinstance(user_set, set))
          else set(user_set)
      )
      self.item_set = (
          item_set
          if (item_set is None or isinstance(item_set, set))
          else set(item_set)
      )
      self.min_uf = min_user_freq
      self.min_if = min_item_freq
      self.num_top_freq_user = num_top_freq_user
      self.num_top_freq_item = num_top_freq_item
      self.min_basket_size = min_basket_size
      self.max_basket_size = max_basket_size
      self.min_basket_sequence = min_basket_sequence
      self.min_sequence_size = min_sequence_size
      self.max_sequence_size = max_sequence_size
      self.bin_threshold = bin_threshold
      self.encoding = encoding
      self.errors = errors
  
imports: import ast
  import itertools
  from collections import Counter
label_desc: Use image node_id 1 to create a new Reader object  with example: obj = Reader(user_set, item_set, min_user_freq, min_item_freq, num_top_freq_user, num_top_freq_item, min_basket_size, max_basket_size, min_basket_sequence, min_sequence_size, max_sequence_size, bin_threshold, encoding, errors)