code: def invert_permutation(p: list) -> np.ndarray:
      """
      Inverts a permutation.
  
      Parameters
      -----------
      p
          Some permutation of `0, 1, ..., len(p)-1`. Returns an array `s`, where `s[i]` gives the index of `i` in `p`.
  
      Returns
      -------
      s
          `s[i]` gives the index of `i` in `p`.
      """
  
      s = np.empty_like(p)
      s[p] = np.arange(len(p))
      return s
  
imports: import copy
  import logging
  from functools import partial
  from typing import Any, Callable, Dict, Generator, List, Optional, Tuple, Union
  import numpy
  from scipy import sparse
  import ray
label_desc: Use image node_id 5 for calling a global function with example usage: invert_permutation(p) and returns: s