class_docstr: Utility functions used to preprocess, save, load, partition, etc. the Criteo
  dataset in a binary (numpy) format.
class_docstr_tok: ["Utility","functions","used","to","preprocess",",","save",",","load",",","partition",",","etc",".","the","Criteo","dataset","in","a","binary","(","numpy",")","format","."]
docstr: Load part of an npy file.
  
  NOTE: Assumes npy represents a numpy array of ndim 2.
  
  Args:
      fname (str): path string to npy file.
      start_row (int): starting row from the npy file.
      num_rows (int): number of rows to get from the npy file.
      path_manager_key (str): Path manager key used to load from different
          filesystems.
  
  Returns:
      output (np.ndarray): numpy array with the desired range of data from the
          supplied npy file.
docstr_tok: ["Load","part","of","an","npy","file",".","NOTE",":","Assumes","npy","represents","a","numpy","array","of","ndim","2",".","Args",":","fname","(","str",")",":","path","string","to","npy","file",".","start_row","(","int",")",":","starting","row","from","the","npy","file",".","num_rows","(","int",")",":","number","of","rows","to","get","from","the","npy","file",".","path_manager_key","(","str",")",":","Path","manager","key","used","to","load","from","different","filesystems",".","Returns",":","output","(","np.ndarray",")",":","numpy","array","with","the","desired","range","of","data","from","the","supplied","npy","file","."]
code: def load_npy_range(
      fname: str,
      start_row: int,
      num_rows: int,
      path_manager_key: str = PATH_MANAGER_KEY,
      mmap_mode: bool = False,
  ) -> np.ndarray:
      """
      Load part of an npy file.
  
      NOTE: Assumes npy represents a numpy array of ndim 2.
  
      Args:
          fname (str): path string to npy file.
          start_row (int): starting row from the npy file.
          num_rows (int): number of rows to get from the npy file.
          path_manager_key (str): Path manager key used to load from different
              filesystems.
  
      Returns:
          output (np.ndarray): numpy array with the desired range of data from the
              supplied npy file.
      """
      path_manager = PathManagerFactory().get(path_manager_key)
      with path_manager.open(fname, "rb") as fin:
          np.lib.format.read_magic(fin)
          shape, _order, dtype = np.lib.format.read_array_header_1_0(
              fin
          )
          if len(shape) == 2:
              total_rows, row_size = shape
          else:
              raise ValueError(
                  "Cannot load range for npy with ndim != 2."
              )
  
          if not (0 <= start_row < total_rows):
              raise ValueError(
                  f"start_row ({start_row}) is out of bounds. It must be between 0 "
                  f"and {total_rows - 1}, inclusive."
              )
          if not (start_row + num_rows <= total_rows):
              raise ValueError(
                  f"num_rows ({num_rows}) exceeds number of available rows "
                  f"({total_rows}) for the given start_row ({start_row})."
              )
          if mmap_mode:
              data = np.load(fname, mmap_mode="r")
              data = data[start_row : start_row + num_rows]
          else:
              offset = start_row * row_size * dtype.itemsize
              fin.seek(offset, os.SEEK_CUR)
              num_entries = num_rows * row_size
              data = np.fromfile(fin, dtype=dtype, count=num_entries)
          return data.reshape((num_rows, row_size))
  
imports: import os
  import shutil
  import time
  from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple, Union
  import numpy
  import torch
  import torch.utils.data.datapipes
  from iopath.common.file_io import PathManager, PathManagerFactory
  from pyre_extensions import none_throws
  from torch.utils.data import IterableDataset, IterDataPipe
  from torchrec.datasets.utils import Batch, LoadFiles, PATH_MANAGER_KEY, ReadLinesFromCSV, safe_cast
  from torchrec.sparse.jagged_tensor import KeyedJaggedTensor
label_desc: Use image node_id 4 for calling the BinaryCriteoUtils obj's underlying member method code with example usage: obj.load_npy_range(fname, start_row, num_rows, path_manager_key, mmap_mode) and returns: data