# 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
# Copyright 2021 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

"""Unit tests for `probing.py`."""




# pylint: disable=invalid-name


class ProbingTest(absltest.TestCase):

  def test_array(self):
    A_pos = np.array([1, 2, 0, 4, 3])
    expected = np.array([2, 1, 1, 4, 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

# Copyright 2021 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

"""Unit tests for `probing.py`."""




# pylint: disable=invalid-name


class ProbingTest(absltest.TestCase):

  def test_array(self):
    A_pos = np.array([1, 2, 0, 4, 3])
    expected = np.array([2, 1, 1, 4, 0])

    out = probing.array(A_pos)