input: Write a python function to train a perceptron model using numpy.
  assert np.allclose(train_perceptron(np.array([[1, 2], [2, 3], [3, 4]]), np.array([0, 1, 1]))[0], np.array([0.2, 0.4]), atol=0.1)
  assert np.allclose(train_perceptron(np.array([[1, 1], [2, 2], [3, 3]]), np.array([0, 1, 1]))[1], 0.01, atol=0.1)
  assert len(train_perceptron(np.array([[1, 0], [0, 1], [1, 1]]), np.array([0, 0, 1]))[0]) == 2
output: import numpy as np
  
  def train_perceptron(X, y, learning_rate=0.01, epochs=1000):
      n_samples, n_features = X.shape
      weights = np.zeros(n_features)
      bias = 0
  
      for _ in range(epochs):
          for idx, x_i in enumerate(X):
              linear_output = np.dot(x_i, weights) + bias
              y_pred = 1 if linear_output >= 0 else 0
  
              update = learning_rate * (y[idx] - y_pred)
              weights += update * x_i
              bias += update
  
      return weights, bias