class_docstr: Unit test class for general utilities. 
class_docstr_tok: ["Unit","test","class","for","general","utilities","."]
docstr: Tests for ordering and reordering of lists. 
docstr_tok: ["Tests","for","ordering","and","reordering","of","lists","."]
code: def test_ordering_and_reordering(self):
      """Tests for ordering and reordering of lists."""
      self.report("Testing ordering and reordering of lists.")
      # Test 1
      orig_list = ["k", "i", "r", "t", "h"]
      ordering = [3, 1, 0, 4, 2]
      reordered_list = general_utils.reorder_list(orig_list, ordering)
      rereordered_list = (
          general_utils.get_original_order_from_reordered_list(
              reordered_list, ordering
          )
      )
      assert reordered_list == ["t", "i", "k", "h", "r"]
      assert rereordered_list == orig_list
      # Test 2
      N = 20
      orig_list = list(
          np.random.random(
              N,
          )
      )
      ordering = np.random.permutation(N)
      reordered_list = general_utils.reorder_list(orig_list, ordering)
      rereordered_list = (
          general_utils.get_original_order_from_reordered_list(
              reordered_list, ordering
          )
      )
      assert rereordered_list == orig_list
  
file_path: dragonfly/dragonfly/utils/unittest_general_utils.py
imports: from __future__ import absolute_import
  from __future__ import division
  import numpy
  from .None import general_utils
  from .base_test_class import BaseTestClass, execute_tests
label_desc: Use image node_id 8 for calling the GeneralUtilsTestCase obj's underlying member method code with example usage: obj.test_ordering_and_reordering() without return types