code: def prepare_state_parts(state_or_state_part, dtype=None, name=None):
      """Calls c2t on each element or the entirety if not iterable; returns list."""
      # Don't use tf.name_scope since this function has ct2-like semantics.
      is_multipart = is_list_like(state_or_state_part)
      state_parts = (
          state_or_state_part if is_multipart else [state_or_state_part]
      )
      state_parts = [
          tf.convert_to_tensor(x, dtype=dtype, name=name)
          for x in state_parts
      ]
      return state_parts, is_multipart
  
imports: import warnings
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import broadcast_util
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math.gradient import value_and_gradient
  from tensorflow.python.util import deprecation
label_desc: Use image node_id 1 for calling a global function with example usage: prepare_state_parts(state_or_state_part, dtype, name) and returns: state_parts,  is_multipart