# Path: clrs/_src/probing.py
# def _convert_to_str(element):
#   def name(self):
#   def location(self):
#   def type_(self):
#   def __repr__(self):
#   def tree_flatten(self):
#   def tree_unflatten(cls, meta, data):
# def initialize(spec: specs.Spec) -> ProbesDict:
# def push(probes: ProbesDict, stage: str, next_probe):
# def finalize(probes: ProbesDict):
# def split_stages(
#     probes: ProbesDict,
#     spec: specs.Spec,
# ) -> Tuple[List[DataPoint], List[DataPoint], List[DataPoint]]:
# def array(A_pos: np.ndarray) -> np.ndarray:
# def array_cat(A: np.ndarray, n: int) -> np.ndarray:
# def heap(A_pos: np.ndarray, heap_size: int) -> np.ndarray:
# def graph(A: np.ndarray) -> np.ndarray:
# def mask_one(i: int, n: int) -> np.ndarray:
# def strings_id(T_pos: np.ndarray, P_pos: np.ndarray) -> np.ndarray:
# def strings_pair(pair_probe: np.ndarray) -> np.ndarray:
# def strings_pair_cat(pair_probe: np.ndarray, nb_classes: int) -> np.ndarray:
# def strings_pi(T_pos: np.ndarray, P_pos: np.ndarray,
#                pi: np.ndarray) -> np.ndarray:
# def strings_pos(T_pos: np.ndarray, P_pos: np.ndarray) -> np.ndarray:
# def strings_pred(T_pos: np.ndarray, P_pos: np.ndarray) -> np.ndarray:
# class DataPoint:
# class ProbeError(Exception):


from absl.testing import absltest
from clrs._src import probing
import numpy as np
        [0, 0, 1],
        [0, 1, 0],
        [1, 0, 0],
        [0, 1, 0],
        [0, 1, 0]
    ])
    out = probing.array_cat(A, 3)
    np.testing.assert_array_equal(expected, out)

  def test_heap(self):
    A_pos = np.array([1, 3, 5, 0, 7, 4, 2, 6])
    expected = np.array([3, 1, 2, 1, 5, 1, 6, 3])
    out = probing.heap(A_pos, heap_size=6)
    np.testing.assert_array_equal(expected, out)

  def test_graph(self):
    G = np.array([
        [0.0, 7.0, -1.0, -3.9, 7.452],
        [0.0, 0.0, 133.0, 0.0, 9.3],
        [0.5, 0.1, 0.22, 0.55, 0.666],
        [7.0, 6.1, 0.2, 0.0, 0.0],
        [0.0, 3.0, 0.0, 1.0, 0.5]
    ])
    expected = np.array([
        [1.0, 1.0, 1.0, 1.0, 1.0],
        [0.0, 1.0, 1.0, 0.0, 1.0],
        [1.0, 1.0, 1.0, 1.0, 1.0],
        [1.0, 1.0, 1.0, 1.0, 0.0],
        [0.0, 1.0, 0.0, 1.0, 1.0]
    ])

# Path: clrs/_src/probing.py
# def _convert_to_str(element):
#   def name(self):
#   def location(self):
#   def type_(self):
#   def __repr__(self):
#   def tree_flatten(self):
#   def tree_unflatten(cls, meta, data):
# def initialize(spec: specs.Spec) -> ProbesDict:
# def push(probes: ProbesDict, stage: str, next_probe):
# def finalize(probes: ProbesDict):
# def split_stages(
#     probes: ProbesDict,
#     spec: specs.Spec,
# ) -> Tuple[List[DataPoint], List[DataPoint], List[DataPoint]]:
# def array(A_pos: np.ndarray) -> np.ndarray:
# def array_cat(A: np.ndarray, n: int) -> np.ndarray:
# def heap(A_pos: np.ndarray, heap_size: int) -> np.ndarray:
# def graph(A: np.ndarray) -> np.ndarray:
# def mask_one(i: int, n: int) -> np.ndarray:
# def strings_id(T_pos: np.ndarray, P_pos: np.ndarray) -> np.ndarray:
# def strings_pair(pair_probe: np.ndarray) -> np.ndarray:
# def strings_pair_cat(pair_probe: np.ndarray, nb_classes: int) -> np.ndarray:
# def strings_pi(T_pos: np.ndarray, P_pos: np.ndarray,
#                pi: np.ndarray) -> np.ndarray:
# def strings_pos(T_pos: np.ndarray, P_pos: np.ndarray) -> np.ndarray:
# def strings_pred(T_pos: np.ndarray, P_pos: np.ndarray) -> np.ndarray:
# class DataPoint:
# class ProbeError(Exception):


# Path: clrs/_src/probing_test.py
from absl.testing import absltest
from clrs._src import probing
import numpy as np

        [0, 0, 1],
        [0, 1, 0],
        [1, 0, 0],
        [0, 1, 0],
        [0, 1, 0]
    ])
    out = probing.array_cat(A, 3)
    np.testing.assert_array_equal(expected, out)

  def test_heap(self):
    A_pos = np.array([1, 3, 5, 0, 7, 4, 2, 6])
    expected = np.array([3, 1, 2, 1, 5, 1, 6, 3])
    out = probing.heap(A_pos, heap_size=6)
    np.testing.assert_array_equal(expected, out)

  def test_graph(self):
    G = np.array([
        [0.0, 7.0, -1.0, -3.9, 7.452],
        [0.0, 0.0, 133.0, 0.0, 9.3],
        [0.5, 0.1, 0.22, 0.55, 0.666],
        [7.0, 6.1, 0.2, 0.0, 0.0],
        [0.0, 3.0, 0.0, 1.0, 0.5]
    ])
    expected = np.array([
        [1.0, 1.0, 1.0, 1.0, 1.0],
        [0.0, 1.0, 1.0, 0.0, 1.0],
        [1.0, 1.0, 1.0, 1.0, 1.0],
        [1.0, 1.0, 1.0, 1.0, 0.0],
        [0.0, 1.0, 0.0, 1.0, 1.0]
    ])

    out = probing.graph(G)