code: def expand_dim(idx, dims):
      res = [0] * len(dims)
      for i, d in enumerate(dims[::-1]):
          res[i] = idx % d
          idx //= d
          if idx == 0:
              break
          assert idx == 0
      return res[::-1]
  
imports: import random
  import time
  from collections import OrderedDict
  import numpy
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: expand_dim(idx, dims) and returns: res