code: def ensure_3d_vector(x: ArrayLike) -> np.ndarray:
      x = np.asarray(x, dtype=np.float64)
      if x.shape != (3,):
          raise ValueError(f"Expected shape=(3,), got {x.shape}")
      return x
  
imports: import itertools
  import numpy
  import pyquaternion
  import traitlets
  from typing import Optional, Union, Tuple
  from kubric.core import traits
  from kubric.core import assets
  from kubric.core import materials
  from kubric.kubric_typing import ArrayLike
label_desc: Use image node_id 1 for calling a global function with example usage: ensure_3d_vector(x) and returns: x