code: def generator(
      self,
      table,
      orient="row",
      encoded=False,
      stratify=False,
      chunksize=None,
  ):
      if not self.loaded:
          self._split_data()
  
      if orient == "column":
          if encoded:
              for encoder in self.encoders:
                  transformed = encoder.transform(
                      self.read_column(table, encoder.source_column)
                  )
                  encoded = {}
                  if hasattr(encoder, "sequence_length"):
                      for i in range(encoder.sequence_length):
                          encoded[
                              encoder.sequence_name(i)
                          ] = transformed[:, i]
                  else:
                      encoded[encoder.name] = transformed
                  yield Observations(
                      x=pandas.DataFrame(encoded), y=None
                  )
  
          else:
              for column in self.columns:
                  yield self.read_column(table, column)
  
      elif orient == "row":
          if stratify:
              if not self.stratify:
                  raise ValueError(
                      "Can't stratify a generator for a pipeline with no stratify"
                  )
  
              if chunksize is None:
                  chunksize = 1
              min, max = self.connection.execute(
                  """
                          SELECT min({stratify}), max({stratify})
                          FROM (
                              SELECT {stratify}
                              FROM {table}
                              ORDER BY {stratify} ASC
                              LIMIT :chunksize
                          )
                      """.format(
                      stratify=self.quote(self.stratify),
                      table=self.quote(table),
                  ),
                  {"chunksize": chunksize},
              ).fetchone()
              while min and max:
                  dataframe = pandas.read_sql(
                      """
                              SELECT * FROM {table} WHERE {stratify} BETWEEN :min AND :max
                          """.format(
                          stratify=self.quote(self.stratify),
                          table=self.quote(table),
                      ),
                      self.connection,
                      parse_dates=self.datetime_columns,
                      params={"min": min, "max": max},
                  )
                  if encoded:
                      dataframe = Observations(
                          x=self.encode_x(dataframe),
                          y=self.encode_y(dataframe),
                      )
                  yield dataframe
  
                  min, max = self.connection.execute(
                      """
                              SELECT min({stratify}), max({stratify})
                              FROM (
                                  SELECT {stratify}
                                  FROM {table}
                                  WHERE {stratify} > :max
                                  ORDER BY {stratify} ASC
                                  LIMIT :chunksize
                              )
                          """.format(
                          stratify=self.quote(self.stratify),
                          table=self.quote(table),
                      ),
                      {"max": max, "chunksize": chunksize},
                  ).fetchone()
  
          else:
              if chunksize is None:
                  chunksize = self.chunksize
              for dataframe in pandas.read_sql(
                  "SELECT * FROM {name}".format(name=self.quote(table)),
                  self.connection,
                  chunksize=chunksize,
                  parse_dates=self.datetime_columns,
              ):
                  if encoded:
                      dataframe = Observations(
                          x=self.encode_x(dataframe),
                          y=self.encode_y(dataframe),
                      )
                  yield dataframe
      else:
          raise ValueError(
              'orient "%s" not in "[row, column]"' % orient
          )
  
imports: from __future__ import absolute_import
  from abc import ABCMeta
  import codecs
  import hashlib
  import io
  import logging
  import os
  import pickle
  import sqlite3
  import types
  import threading
  import lore
  from lore.env import require
  from lore.util import timer, timed
  from lore.pipelines import Observations
  import pandas
label_desc: Use image node_id 16 for calling the Base obj's underlying member method code with example usage: obj.generator(table, orient, encoded, stratify, chunksize) without return types