code: def ensure_hashable_or_mutable_sequence(
      value: t.Union[T, t.MutableSequence[T]],
      message: str = (
          "Provided value is neither hashable nor mutable "
          "sequence of hashable items. Got {type}"
      ),
  ) -> t.List[T]:
      """Validate that provided value is either hashable or mutable sequence of hashable values."""
      if isinstance(value, Hashable):
          return [value]
  
      if isinstance(value, t.MutableSequence):
          if len(value) > 0 and not isinstance(value[0], Hashable):
              raise errors.DeepchecksValueError(
                  message.format(
                      type=f"MutableSequence[{type(value).__name__}]"
                  )
              )
          return list(value)
  
      raise errors.DeepchecksValueError(
          message.format(type=type(value).__name__)
      )
  
file_path: deepchecks/deepchecks/utils/validation.py
imports: import typing
  import numpy
  import pandas
  from typing_extensions import TypeGuard
  from deepchecks.core import errors
  from deepchecks.utils.typing import Hashable
label_desc: Use image node_id 1 for calling a global function with example usage: ensure_hashable_or_mutable_sequence(value, message) and returns: list, list