code: def accuracy(model, dataset_loader):
      total_correct = 0
      for x, y in dataset_loader:
          x = x.to(device)
          y = one_hot(np.array(y.numpy()), 10)
  
          target_class = np.argmax(y, axis=1)
          predicted_class = np.argmax(
              model(x).cpu().detach().numpy(), axis=1
          )
          total_correct += np.sum(predicted_class == target_class)
      return total_correct / len(dataset_loader.dataset)
  
imports: import os
  import argparse
  import logging
  import time
  import numpy
  import torch
  import torch.nn
  from torch.utils.data import DataLoader
  import torchvision.datasets
  import torchvision.transforms
label_desc: Use image node_id 8 for calling a global function with example usage: accuracy(model, dataset_loader) and returns: unknown