code: def arma_to_np(obj):
      """
      This function replaces the JSON representation of armadillo vector to
      numpy array in the given dictionary.
      """
      if isinstance(obj, OrderedDict):
          for key in obj.keys():
              if isinstance(obj[key], OrderedDict):
                  # if "vec_state" is present in dictionary, then
                  # it must be armadillo vector.
                  if "vec_state" in obj[key].keys():
                      n_rows = int(obj[key]["n_rows"])
                      n_cols = int(obj[key]["n_cols"])
                      # implicit transpose
                      obj[key] = (
                          np.array(obj[key]["elem"])
                          .reshape(n_cols, n_rows)
                          .astype(type(obj[key]["elem"][0]))
                      )
                  else:
                      arma_to_np(obj[key])
              else:
                  arma_to_np(obj[key])
      elif isinstance(obj, list):
          for i in range(len(obj)):
              arma_to_np(obj[i])
      else:
          # we cannot recurse further if we do not have a
          # dictionary or list object, so just pass.
          pass
  
file_path: mlpack/src/mlpack/bindings/python/mlpack/preprocess_json_params.py
imports: import numpy
  import json
  import pprint
  from copy import deepcopy
  from collections import OrderedDict
label_desc: Use image node_id 4 for calling a global function with example usage: arma_to_np(obj) without return types