code: def evaluate_model(model, train, test, validation):
      start_time = time.time()
      model.fit(train, verbose=True)
      elapsed = time.time() - start_time
  
      print("Elapsed {}".format(elapsed))
      print(model)
  
      if hasattr(test, "sequences"):
          test_mrr = sequence_mrr_score(model, test)
          val_mrr = sequence_mrr_score(model, validation)
      else:
          test_mrr = mrr_score(model, test)
          val_mrr = mrr_score(model, test.tocsr() + validation.tocsr())
  
      return test_mrr, val_mrr, elapsed
  
imports: import argparse
  import hashlib
  import json
  import os
  import shutil
  import time
  import numpy
  from sklearn.model_selection import ParameterSampler
  from spotlight.datasets.movielens import get_movielens_dataset
  from spotlight.datasets.amazon import get_amazon_dataset
  from spotlight.cross_validation import random_train_test_split, user_based_train_test_split
  from spotlight.sequence.implicit import ImplicitSequenceModel
  from spotlight.factorization.implicit import ImplicitFactorizationModel
  from spotlight.sequence.representations import LSTMNet
  from spotlight.factorization.representations import BilinearNet
  from spotlight.layers import BloomEmbedding, ScaledEmbedding
  from spotlight.evaluation import mrr_score, sequence_mrr_score
  from spotlight.torch_utils import set_seed
label_desc: Use image node_id 4 for calling a global function with example usage: evaluate_model(model, train, test, validation) and returns: test_mrr,  val_mrr,  elapsed