code: def test_read_instruction_spec():
      assert (
          ReadInstruction("train", to=10, unit="abs").to_spec()
          == "train[:10]"
      )
      assert (
          ReadInstruction("train", from_=-80, to=10, unit="%").to_spec()
          == "train[-80%:10%]"
      )
  
      spec_train_test = "train+test"
      assert (
          ReadInstruction.from_spec(spec_train_test).to_spec()
          == spec_train_test
      )
  
      spec_train_abs = "train[2:10]"
      assert (
          ReadInstruction.from_spec(spec_train_abs).to_spec()
          == spec_train_abs
      )
  
      spec_train_pct = "train[15%:-20%]"
      assert (
          ReadInstruction.from_spec(spec_train_pct).to_spec()
          == spec_train_pct
      )
  
      spec_train_pct_rounding = "train[:10%](closest)"
      assert (
          ReadInstruction.from_spec(spec_train_pct_rounding).to_spec()
          == "train[:10%]"
      )
  
      spec_train_pct_rounding = "train[:10%](pct1_dropremainder)"
      assert (
          ReadInstruction.from_spec(spec_train_pct_rounding).to_spec()
          == spec_train_pct_rounding
      )
  
      spec_train_test_pct_rounding = "train[:10%](pct1_dropremainder)+test[-10%:](pct1_dropremainder)"
      assert (
          ReadInstruction.from_spec(
              spec_train_test_pct_rounding
          ).to_spec()
          == spec_train_test_pct_rounding
      )
  
imports: import os
  import tempfile
  from pathlib import Path
  from unittest import TestCase
  import pyarrow
  import pytest
  from datasets.arrow_dataset import Dataset
  from datasets.arrow_reader import ArrowReader, BaseReader, FileInstructions, ReadInstruction, make_file_instructions
  from datasets.info import DatasetInfo
  from datasets.splits import NamedSplit, Split, SplitDict, SplitInfo
  from .utils import assert_arrow_memory_doesnt_increase, assert_arrow_memory_increases
label_desc: Use image node_id 3 for calling a global function with example usage: test_read_instruction_spec() without return types