code: def adjust_shape(placeholder, data):
      """
      adjust shape of the data to the shape of the placeholder if possible.
      If shape is incompatible, AssertionError is thrown
  
      Parameters:
          placeholder     tensorflow input placeholder
  
          data            input data to be (potentially) reshaped to be fed into placeholder
  
      Returns:
          reshaped data
      """
  
      if not isinstance(data, np.ndarray) and not isinstance(
          data, list
      ):
          return data
      if isinstance(data, list):
          data = np.array(data)
  
      placeholder_shape = [x or -1 for x in placeholder.shape.as_list()]
  
      assert _check_shape(
          placeholder_shape, data.shape
      ), "Shape of data {} is not compatible with shape of the placeholder {}".format(
          data.shape, placeholder_shape
      )
  
      return np.reshape(data, placeholder_shape)
  
imports: import numpy
  import tensorflow
  import copy
  import os
  import functools
  import collections
  import multiprocessing
label_desc: Use image node_id 25 for calling a global function with example usage: adjust_shape(placeholder, data) and returns: np, data