input: Write a function to implement a basic machine learning model in Python that performs binary classification on the given data. The function should use logistic regression from the sklearn library and should return the accuracy of the model.
  assert 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
  assert binary_classification([[0.1, 0.2, 0.3], [0.2, 0.3, 0.4], [0.5, 0.1, 0.2], [0.3, 0.4, 0.5], [0.2, 0.4, 0.6]], [0, 1, 1, 0, 1]) == 0.6
  assert binary_classification([[0.1, 0.2, 0.3], [0.2, 0.3, 0.4]], [0, 1]) == 0.5
  assert binary_classification([], []) == 0.0
  assert binary_classification([[0.1, 0.2, 0.3]], [1]) == 1.0
output: def binary_classification(X, y):
      if not X or not y:
          return 0.0
      from sklearn.linear_model import LogisticRegression
      model = LogisticRegression()
      model.fit(X, y)
      return model.score(X, y)