code: def _get_weights_of_type(weights_list, weights_type):
      if weights_type == "list":
          return weights_list
      if weights_type == "tensor":
          return ops.convert_to_tensor(weights_list, name="weights")
      return dataset_ops.Dataset.from_tensors(weights_list).repeat()
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.compat import compat
  from tensorflow.python.data.kernel_tests import checkpoint_test_base
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import options
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import random_seed
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling a global function with example usage: _get_weights_of_type(weights_list, weights_type) and returns: dataset_ops, weights_list, ops