code: def test_invert_permutation(permutation_generator):
      """
      Tests whether the inversion of the permutation is correctly calculated.
      """
  
      result = invert_permutation(permutation_generator)
      np.testing.assert_allclose(
          np.array(permutation_generator)[result],
          np.array(np.arange(result.shape[0])),
      )
  
imports: import inspect
  import os
  import pytest
  import time
  from itertools import product
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  from alibi.utils.distributed import DistributedExplainer, PoolCollection, ResourceError, invert_permutation, concatenate_minibatches
label_desc: Use image node_id 8 for calling a global function with example usage: test_invert_permutation(permutation_generator) without return types