input: Write a python function to create and train a neural network using TensorFlow, and return the predictions. 
  assert len(create_and_train_nn(X, y)) == len(X)
  assert create_and_train_nn([[0.5, 0.2], [0.9, 0.4]], [1, 0]).shape == (2, 1)
  assert create_and_train_nn([[0.1, 0.3], [0.7, 0.8], [0.5, 0.6]], [1, 0, 1]).shape == (3, 1)
output: import tensorflow as tf
  from tensorflow.keras.models import Sequential
  from tensorflow.keras.layers import Dense
  import numpy as np
  
  def create_and_train_nn(X, y):
      # Convert input data to numpy arrays
      X = np.array(X)
      y = np.array(y)
      
      # Define the model
      model = Sequential()
      model.add(Dense(10, input_dim=X.shape[1], activation='relu'))
      model.add(Dense(1, activation='sigmoid'))
      
      # Compile the model
      model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
      
      # Train the model
      model.fit(X, y, epochs=50, verbose=0)
      
      # Make predictions
      predictions = model.predict(X)
      
      return predictions