code: def _convert_to_compatible_tensor(value, target, error_prefix):
      """Converts `value` into a tensor that can be feed into `tensor_info`.
  
      Args:
        value: A value to convert into Tensor or CompositeTensor.
        target: An object returned by `parse_tensor_info_map`.
        error_prefix: A string to prefix on raised TypeErrors.
  
      Raises:
        TypeError: If it fails to convert.
  
      Returns:
        A Tensor or CompositeTensor compatible with tensor_info.
      """
      if tf_utils.is_composite_tensor(value):
          tensor = value
      else:
          try:
              tensor = tf.compat.v1.convert_to_tensor_or_indexed_slices(
                  value, target.dtype
              )
          except TypeError as e:
              raise TypeError("%s: %s" % (error_prefix, e))
      tensor_type_spec = _get_type_spec(tensor)
      target_type_spec = _get_type_spec(target)
      if not ParsedTensorInfo.from_type_spec(
          tensor_type_spec
      ).is_supported_type:
          raise ValueError(
              "%s: Passed argument of type %s, which is not supported by this "
              "version of tensorflow_hub."
              % (error_prefix, tensor_type_spec.value_type.__name__)
          )
  
      if not tensor_type_spec.is_compatible_with(target_type_spec):
          if tensor_type_spec.value_type != target_type_spec.value_type:
              got = tensor_type_spec.value_type.__name__
              expected = target_type_spec.value_type.__name__
          else:
              got = str(tensor_type_spec)
              expected = str(target_type_spec)
          raise TypeError(
              "%s: Got %s. Expected %s." % (error_prefix, got, expected)
          )
      return tensor
  
imports: import tensorflow
  from tensorflow_hub import tf_utils
label_desc: Use image node_id 4 for calling a global function with example usage: _convert_to_compatible_tensor(value, target, error_prefix) and returns: tensor