def adjust_shape(placeholder, data):
if not isinstance(data, np.ndarray) and not isinstance(data, list):<EOL><INDENT>return data<EOL><DEDENT>if isinstance(data, list):<EOL><INDENT>data = np.array(data)<EOL><DEDENT>placeholder_shape = [x or -<NUM_LIT:1> for x in placeholder.shape.as_list()]<EOL>assert _check_shape(placeholder_shape, data.shape),'<STR_LIT>'.format(data.shape, placeholder_shape)<EOL>return np.reshape(data, placeholder_shape)<EOL>
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