code: def rotation_sampler(axis=None):
      def _sampler(obj: objects.PhysicalObject, rng):
          obj.quaternion = random_rotation(axis=axis, rng=rng)
  
      return _sampler
  
file_path: kubric/kubric/randomness.py
imports: import numpy
  import pyquaternion
  from typing import Optional, Tuple
  from kubric.core import color
  from kubric.core import objects
label_desc: Use image node_id 4 for calling a global function with example usage: rotation_sampler(axis) and returns: _sampler