class_docstr: Reading instruction for a dataset.
  
  Examples::
  
    # The following lines are equivalent:
    ds = datasets.load_dataset('mnist', split='test[:33%]')
    ds = datasets.load_dataset('mnist', split=datasets.ReadInstruction.from_spec('test[:33%]'))
    ds = datasets.load_dataset('mnist', split=datasets.ReadInstruction('test', to=33, unit='%'))
    ds = datasets.load_dataset('mnist', split=datasets.ReadInstruction(
        'test', from_=0, to=33, unit='%'))
  
    # The following lines are equivalent:
    ds = datasets.load_dataset('mnist', split='test[:33%]+train[1:-1]')
    ds = datasets.load_dataset('mnist', split=datasets.ReadInstruction.from_spec(
        'test[:33%]+train[1:-1]'))
    ds = datasets.load_dataset('mnist', split=(
        datasets.ReadInstruction('test', to=33, unit='%') +
        datasets.ReadInstruction('train', from_=1, to=-1, unit='abs')))
  
    # The following lines are equivalent:
    ds = datasets.load_dataset('mnist', split='test[:33%](pct1_dropremainder)')
    ds = datasets.load_dataset('mnist', split=datasets.ReadInstruction.from_spec(
        'test[:33%](pct1_dropremainder)'))
    ds = datasets.load_dataset('mnist', split=datasets.ReadInstruction(
        'test', from_=0, to=33, unit='%', rounding="pct1_dropremainder"))
  
    # 10-fold validation:
    tests = datasets.load_dataset(
        'mnist',
        [datasets.ReadInstruction('train', from_=k, to=k+10, unit='%')
        for k in range(0, 100, 10)])
    trains = datasets.load_dataset(
        'mnist',
        [datasets.ReadInstruction('train', to=k, unit='%') + datasets.ReadInstruction('train', from_=k+10, unit='%')
        for k in range(0, 100, 10)])
class_docstr_tok: ["Reading","instruction","for","a","dataset",".","Examples",":",":","#","The","following","lines","are","equivalent",":","ds","=","datasets.load_dataset","(","'mnist","'",",","split='test","[",":33","%","]","'",")","ds","=","datasets.load_dataset","(","'mnist","'",",","split=datasets.ReadInstruction.from_spec","(","'test","[",":33","%","]","'",")",")","ds","=","datasets.load_dataset","(","'mnist","'",",","split=datasets.ReadInstruction","(","'test","'",",","to=33",",","unit=","'","%","'",")",")","ds","=","datasets.load_dataset","(","'mnist","'",",","split=datasets.ReadInstruction","(","'test","'",",","from_=0",",","to=33",",","unit=","'","%","'",")",")","#","The","following","lines","are","equivalent",":","ds","=","datasets.load_dataset","(","'mnist","'",",","split='test","[",":33","%","]","+train","[","1",":","-1","]","'",")","ds","=","datasets.load_dataset","(","'mnist","'",",","split=datasets.ReadInstruction.from_spec","(","'test","[",":33","%","]","+train","[","1",":","-1","]","'",")",")","ds","=","datasets.load_dataset","(","'mnist","'",",","split=","(","datasets.ReadInstruction","(","'test","'",",","to=33",",","unit=","'","%","'",")","+","datasets.ReadInstruction","(","'train","'",",","from_=1",",","to=-1",",","unit='abs","'",")",")",")","#","The","following","lines","are","equivalent",":","ds","=","datasets.load_dataset","(","'mnist","'",",","split='test","[",":33","%","]","(","pct1_dropremainder",")","'",")","ds","=","datasets.load_dataset","(","'mnist","'",",","split=datasets.ReadInstruction.from_spec","(","'test","[",":33","%","]","(","pct1_dropremainder",")","'",")",")","ds","=","datasets.load_dataset","(","'mnist","'",",","split=datasets.ReadInstruction","(","'test","'",",","from_=0",",","to=33",",","unit=","'","%","'",",","rounding=","''","pct1_dropremainder","''",")",")","#","10-fold","validation",":","tests","=","datasets.load_dataset","(","'mnist","'",",","[","datasets.ReadInstruction","(","'train","'",",","from_=k",",","to=k+10",",","unit=","'","%","'",")","for","k","in","range","(","0",",","100",",","10",")","]",")","trains","=","datasets.load_dataset","(","'mnist","'",",","[","datasets.ReadInstruction","(","'train","'",",","to=k",",","unit=","'","%","'",")","+","datasets.ReadInstruction","(","'train","'",",","from_=k+10",",","unit=","'","%","'",")","for","k","in","range","(","0",",","100",",","10",")","]",")"]
docstr: Returns a new ReadInstruction obj, result of appending other to self.
code: def __add__(self, other):
      """Returns a new ReadInstruction obj, result of appending other to self."""
      if not isinstance(other, ReadInstruction):
          msg = "ReadInstruction can only be added to another ReadInstruction obj."
          raise TypeError(msg)
      self_ris = self._relative_instructions
      other_ris = (
          other._relative_instructions
      )  # pylint: disable=protected-access
      if (
          self_ris[0].unit != "abs"
          and other_ris[0].unit != "abs"
          and self._relative_instructions[0].rounding
          != other_ris[0].rounding
      ):
          raise ValueError(
              "It is forbidden to sum ReadInstruction instances with different rounding values."
          )
      return self._read_instruction_from_relative_instructions(
          self_ris + other_ris
      )
  
imports: import copy
  import math
  import os
  import re
  import shutil
  from dataclasses import dataclass
  from pathlib import Path
  from typing import TYPE_CHECKING, List, Optional, Union
  import pyarrow
  import pyarrow.parquet
  from .download.download_config import DownloadConfig
  from .naming import _split_re, filenames_for_dataset_split
  from .table import InMemoryTable, MemoryMappedTable, Table, concat_tables
  from .utils import logging
  from .utils.file_utils import cached_path
label_desc: Use image node_id 6 for calling the ReadInstruction obj's underlying member method code with example usage: obj.__add__(other) and returns: self