class_docstr: Iterate over SQLite database.
  Gen batches from SQLite data.
  Get document ids and document.
  
  Args:
      load_path: a path to local DB file
      batch_size: a number of samples in a single batch
      shuffle: whether to shuffle data during batching
      seed: random seed for data shuffling
  
  Attributes:
      connect: a DB connection
      db_name: a DB name
      doc_ids: DB document ids
      doc2index: a dictionary of document indices and their titles
      batch_size: a number of samples in a single batch
      shuffle: whether to shuffle data during batching
      random: an instance of :class:`Random` class.
class_docstr_tok: ["Iterate","over","SQLite","database",".","Gen","batches","from","SQLite","data",".","Get","document","ids","and","document",".","Args",":","load_path",":","a","path","to","local","DB","file","batch_size",":","a","number","of","samples","in","a","single","batch","shuffle",":","whether","to","shuffle","data","during","batching","seed",":","random","seed","for","data","shuffling","Attributes",":","connect",":","a","DB","connection","db_name",":","a","DB","name","doc_ids",":","DB","document","ids","doc2index",":","a","dictionary","of","document","indices","and","their","titles","batch_size",":","a","number","of","samples","in","a","single","batch","shuffle",":","whether","to","shuffle","data","during","batching","random",":","an","instance","of",":","class",":","`","Random","`","class","."]
code: def __init__(
      self,
      load_path: Union[str, Path],
      batch_size: Optional[int] = None,
      shuffle: Optional[bool] = None,
      seed: Optional[int] = None,
      **kwargs,
  ) -> None:
      load_path = str(expand_path(load_path))
      logger.info("Connecting to database, path: {}".format(load_path))
      try:
          self.connect = sqlite3.connect(
              load_path, check_same_thread=False
          )
      except sqlite3.OperationalError as e:
          e.args = e.args + (
              "Check that DB path exists and is a valid DB file",
          )
          raise e
      try:
          self.db_name = self.get_db_name()
      except TypeError as e:
          e.args = e.args + (
              "Check that DB path was created correctly and is not empty. "
              "Check that a correct dataset_format is passed to the ODQAReader config",
          )
          raise e
      self.doc_ids = self.get_doc_ids()
      self.doc2index = self.map_doc2idx()
      self.batch_size = batch_size
      self.shuffle = shuffle
      self.random = Random(seed)
  
file_path: DeepPavlov/deeppavlov/dataset_iterators/sqlite_iterator.py
imports: import sqlite3
  from logging import getLogger
  from pathlib import Path
  from random import Random
  from typing import List, Any, Dict, Optional, Union, Generator, Tuple
  from deeppavlov.core.commands.utils import expand_path
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.data.data_fitting_iterator import DataFittingIterator
label_desc: Use image node_id 1 to create a new SQLiteDataIterator object from inherited base classes: DataFittingIterator with example: obj = SQLiteDataIterator(load_path, batch_size, shuffle, seed)