def ensure_is_lst(z):
  """If a variable is not a list, return a list with only the variable.

  Args:
    z (object): input variable

  Returns:
    z if it is a list, otherwise [z]
  """
  if isinstance(z, list):
    return z
  else:
    return [z]