code: def _rel_to_abs_instr(rel_instr, name2len):
      """Returns _AbsoluteInstruction instance for given RelativeInstruction.
  
      Args:
          rel_instr: RelativeInstruction instance.
          name2len: dict {split_name: num_examples}.
      """
      pct_to_abs = (
          _pct_to_abs_closest
          if rel_instr.rounding == "closest"
          else _pct_to_abs_pct1
      )
      split = rel_instr.splitname
      if split not in name2len:
          raise ValueError(
              f'Unknown split "{split}". Should be one of {list(name2len)}.'
          )
      num_examples = name2len[split]
      from_ = rel_instr.from_
      to = rel_instr.to
      if rel_instr.unit == "%":
          from_ = (
              0 if from_ is None else pct_to_abs(from_, num_examples)
          )
          to = (
              num_examples
              if to is None
              else pct_to_abs(to, num_examples)
          )
      else:
          from_ = 0 if from_ is None else from_
          to = num_examples if to is None else to
      if abs(from_) > num_examples or abs(to) > num_examples:
          msg = f'Requested slice [{from_ or ""}:{to or ""}] incompatible with {num_examples} examples.'
          raise ValueError(msg)
      if from_ < 0:
          from_ = num_examples + from_
      elif from_ == 0:
          from_ = None
      if to < 0:
          to = num_examples + to
      elif to == num_examples:
          to = None
      return _AbsoluteInstruction(split, from_, to)
  
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 5 for calling a global function with example usage: _rel_to_abs_instr(rel_instr, name2len) and returns: _AbsoluteInstruction