code: def step(self, loss, acc, model):
      if self.best_loss is None:
          self.best_acc = acc
          self.best_loss = loss
          self.save_checkpoint(model)
      elif (loss > self.best_loss) and (acc < self.best_acc):
          self.counter += 1
          print(
              f"EarlyStopping counter: {self.counter} out of {self.patience}"
          )
          if self.counter >= self.patience:
              self.early_stop = True
      else:
          if (loss <= self.best_loss) and (acc >= self.best_acc):
              self.save_checkpoint(model)
          self.best_loss = np.min((loss, self.best_loss))
          self.best_acc = np.max((acc, self.best_acc))
          self.counter = 0
      return self.early_stop
  
imports: import sys
  import datetime
  import dgl
  import errno
  import numpy
  import os
  import pickle
  import random
  import torch
  from dgl.data.utils import download, get_download_dir, _get_dgl_url
  import os.path
  from pprint import pprint
  from scipy import sparse
  from scipy import io
label_desc: Use image node_id 2 for calling the EarlyStopping obj's underlying member method code with example usage: obj.step(loss, acc, model) and returns: self