class_docstr: Logical functions stream generator.
  
  Make a toy dataset with three labels that represent the logical
  functions: `OR`, `XOR`, `AND` (functions of the 2D input).
  
  Data is generated in 'tiles' which contain the complete set of
  logical operations results. The tiles are repeated `n_tiles` times.
  Optionally, the generated data can be shuffled.
  
  Parameters
  ----------
  n_tiles
      Number of tiles to generate.
  shuffle
      If set, generated data will be shuffled.
  seed
      Random seed for reproducibility.
  
  Examples
  --------
  >>> from river.datasets import synth
  
  >>> dataset = synth.Logical(n_tiles=2, shuffle=True, seed=42)
  
  >>> for x, y in dataset.take(5):
  ...     print(x, y)
  {'A': 1, 'B': 1} {'OR': 1, 'XOR': 0, 'AND': 1}
  {'A': 0, 'B': 0} {'OR': 0, 'XOR': 0, 'AND': 0}
  {'A': 1, 'B': 0} {'OR': 1, 'XOR': 1, 'AND': 0}
  {'A': 1, 'B': 1} {'OR': 1, 'XOR': 0, 'AND': 1}
  {'A': 1, 'B': 0} {'OR': 1, 'XOR': 1, 'AND': 0}
docstr: Make toy dataset
docstr_tok: ["Make","toy","dataset"]
code: def _make_logical(self, n_tiles: int = 1, shuffle: bool = True):
      """Make toy dataset"""
      base_pattern = np.array(
          [
              # A  B  OR  XOR  AND
              [0, 0, 0, 0, 0],
              [0, 1, 1, 1, 0],
              [1, 0, 1, 1, 0],
              [1, 1, 1, 0, 1],
          ],
          dtype=int,
      )
  
      N, E = base_pattern.shape
      D = 2
      L = E - D
  
      pattern = np.zeros((N, E))
      pattern[:, 0:L] = base_pattern[:, D:E]
      pattern[:, L:E] = base_pattern[:, 0:D]
      pattern = np.tile(pattern, (n_tiles, 1))
      if shuffle:
          self._rng.shuffle(pattern)
      # return X, Y
      return (
          np.array(pattern[:, L:E], dtype=int),
          np.array(pattern[:, 0:L], dtype=int),
      )
  
file_path: river/river/datasets/synth/logical.py
imports: from __future__ import annotations
  import itertools
  import numpy
  from river import datasets
label_desc: Use image node_id 3 for calling the Logical obj's underlying member method code with example usage: obj._make_logical(n_tiles, shuffle) and returns: np,  np