input: Write a function to implement a basic machine learning model in Python that performs binary classification on the given data. The function should train a logistic regression model using the sklearn library and output the accuracy of the model on the provided data.
  
  assert accuracy_score([1, 0, 0, 1, 0], binary_classification([[0.3, 0.2, 0.6], [0.3, 0.1, 0.4], [0.2, 0.3, 0.4], [0.7, 0.4, 0.2], [0.5, 0.2, 0.1]], [1, 0, 0, 1, 0]))==1.0
output: from sklearn.linear_model import LogisticRegression
  from sklearn.metrics import accuracy_score
  
  def binary_classification(X, y):
      model = LogisticRegression()
      model.fit(X, y)
      predictions = model.predict(X)
      return accuracy_score(y, predictions)