datalad_next.utils.ensure_list

datalad_next.utils.ensure_list(s: Any, copy: bool = False, iterate: bool = True) list[source]

Given not a list, would place it into a list. If None - empty list is returned

Parameters:
  • s (list or anything)

  • copy (bool, optional) -- If list is passed, it would generate a shallow copy of the list

  • iterate (bool, optional) -- If it is not a list, but something iterable (but not a str) iterate over it.