parameters: (obj: Iterable[T] | T)
return_statement: return obj
docstring: If obj is Iterable but not list-like, consume into list.
docstring_summary: If obj is Iterable but not list-like, consume into list.
docstring_tokens: If obj is Iterable but not list - like consume into list .
function: def maybe_iterable_to_list(obj: Iterable[T] | T) -> Collection[T] | T:
      """
      If obj is Iterable but not list-like, consume into list.
      """
      if isinstance(obj, abc.Iterable) and not isinstance(obj, abc.Sized):
          return list(obj)
      obj = cast(Collection, obj)
      return obj
function_tokens: def maybe_iterable_to_list ( obj : Iterable [ T ] | T ) -> Collection [ T ] | T : if isinstance ( obj , abc . Iterable ) and not isinstance ( obj , abc . Sized ) : return list ( obj ) obj = cast ( Collection , obj ) return obj