input: Write a function in Python that trains a machine learning model to categorize a dataset of records. The function should take a list of dictionaries as input, where each dictionary contains a label and a list of features. The function should return a trained model that can predict the label for new feature sets.
  
  def categorize_records(training_data):
      import numpy as np
      from sklearn.svm import SVC 
  
      X = []
      y = []
      for data in training_data:
          X.append(data['features'])
          y.append(data['label'])
  
      clf = SVC()
      clf.fit(X, y) 
  
      return clf
  
  assert categorize_records([
    {"label": "apple", "features": [1, 1, 0]}, 
    {"label": "banana", "features": [0, 1, 1]}, 
    {"label": "lemon", "features": [0, 0, 1]}, 
    {"label": "orange", "features": [1, 0, 0]}, 
    {"label": "pear", "features": [0, 1, 0]}, 
  ]).predict([[1, 0, 1]])[0] == 'banana'
  
  assert categorize_records([
    {"label": "apple", "features": [1, 1, 0]}, 
    {"label": "banana", "features": [0, 1, 1]}, 
    {"label": "lemon", "features": [0, 0, 1]}, 
    {"label": "orange", "features": [1, 0, 0]}, 
    {"label": "pear", "features": [0, 1, 0]}, 
  ]).predict([[1, 0, 0]])[0] == 'orange'
  
  assert categorize_records([
    {"label": "apple", "features": [1, 1, 0]}, 
    {"label": "banana", "features": [0, 1, 1]}, 
    {"label": "lemon", "features": [0, 0, 1]}, 
    {"label": "orange", "features": [1, 0, 0]}, 
    {"label": "pear", "features": [0, 1, 0]}, 
  ]).predict([[0, 1, 0]])[0] == 'pear'
output: def categorize_records(training_data):
      import numpy as np
      from sklearn.svm import SVC 
  
      X = []
      y = []
      for data in training_data:
          X.append(data['features'])
          y.append(data['label'])
  
      clf = SVC()
      clf.fit(X, y) 
  
      return clf