code: def _maybe_repeat(self, x):
      
      if isinstance(x, list):
        assert len(x) == self.n
        return x
      else:
        return [x] * self.n
docs: Utility function for processing arguments that are singletons or lists.
  
      Args:
        x: either a list of self.n elements, or not a list.
  
      Returns:
        a list of self.n elements.