code: def run(net, train_dataloader, test_dataloader, num_epochs, ctx, lr):
      """
      Train a test sentiment model
      """
  
      # Define trainer
      trainer = mx.gluon.Trainer(
          net.collect_params(), "adam", {"learning_rate": lr}
      )
      # Define loss and evaluation metrics
      loss = gluon.loss.SoftmaxCrossEntropyLoss()
      metrics = mx.gluon.metric.CompositeEvalMetric()
      acc = mx.gluon.metric.Accuracy()
      nested_metrics = mx.gluon.metric.CompositeEvalMetric()
      metrics.add([acc, mx.gluon.metric.Loss()])
      nested_metrics.add([metrics, mx.gluon.metric.Accuracy()])
  
      # Define estimator
      est = estimator.Estimator(
          net=net,
          loss=loss,
          train_metrics=nested_metrics,
          trainer=trainer,
          context=ctx,
      )
      # Begin training
      est.fit(
          train_data=train_dataloader,
          val_data=test_dataloader,
          epochs=num_epochs,
      )
      return acc
  
imports: import collections
  import os
  import random
  import sys
  import tarfile
  import mxnet
  from mxnet import nd, gluon
  from mxnet.contrib import text
  from mxnet.gluon import nn, rnn
  from mxnet.gluon.contrib.estimator import estimator
  import pytest
label_desc: Use image node_id 6 for calling a global function with example usage: run(net, train_dataloader, test_dataloader, num_epochs, ctx, lr) and returns: acc