code: def combined_static_and_dynamic_shape(tensor):
      """Returns a list containing static and dynamic values for the dimensions.
  
      Returns a list of static and dynamic values for shape dimensions. This is
      useful to preserve static shapes when available in reshape operation.
  
      Args:
        tensor: A tensor of any type.
  
      Returns:
        A list of size tensor.shape.ndims containing integers or a scalar tensor.
      """
      static_tensor_shape = tensor.shape.as_list()
      dynamic_tensor_shape = tf.shape(tensor)
      combined_shape = []
      for index, dim in enumerate(static_tensor_shape):
          if dim is not None:
              combined_shape.append(dim)
          else:
              combined_shape.append(dynamic_tensor_shape[index])
      return combined_shape
  
label_desc: Use image node_id 2 for calling a global function with example usage: combined_static_and_dynamic_shape(tensor) and returns: combined_shape