code: def wrap_nested(x, dim):
      if dim == 0:
          return x
      return wrap_nested([x], dim - 1)
  
imports: from unittest import TestCase
  import numpy
  import pytest
  import scipy.stats
  import torch
  import pyro.distributions
  from tests.common import assert_equal
label_desc: Use image node_id 1 for calling a global function with example usage: wrap_nested(x, dim) and returns: wrap_nested, x