input: Write a python function to train a linear regression model using input and label datasets, and predict on test data.
  assert type(train_and_predict('input.csv', 'labels.csv')) == np.ndarray
output: def train_and_predict(input_file, label_file):
      import numpy as np
      import pandas as pd
      from sklearn.linear_model import LinearRegression
      from sklearn.model_selection import train_test_split
  
      # Load datasets
      input_data = pd.read_csv(input_file)
      label_data = pd.read_csv(label_file)
  
      # Assuming label_data has one column with the labels
      X = input_data.values
      y = label_data.values.ravel()
  
      # Split data into training and testing sets
      X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
  
      # Train the linear regression model
      model = LinearRegression()
      model.fit(X_train, y_train)
  
      # Predict on the test data
      predictions = model.predict(X_test)
  
      return predictions