Handling Undefined arguments

I only put the following code Sequential-GCN-for-Active-Learning/main.py at master · razvancaramalau/Sequential-GCN-for-Active-Learning · GitHub
in a class but the criterion argument in test() is giving me error NameError: name ‘criterion’ is not defined. Any solution for resolving this particular argument?
whereas ‘criterion’ is defined here Sequential-GCN-for-Active-Learning/train_test.py at master · razvancaramalau/Sequential-GCN-for-Active-Learning · GitHub

from train_test import train, test

class Objective:
    def __init__(self):
    self.args = parser.parse_args()
    def __call__(self, optuna_trial):
    train(models, method, criterion, optimizers, schedulers, dataloaders, args.no_of_epochs, EPOCHL)

    return acc

if __name__ == '__main__':

In the linked code the methods accept arguments such as:

def train_epoch(models, method, criterion, optimizers, dataloaders, epoch, epoch_loss):

and call these arguments inside the function:

    target_loss = criterion(scores, labels)

while you are passing optuna_trial as the only argument (besides self) to __call__.
If train or any arguments are not globally defined, the error will be raised.
This tutorial explains function arguments in Python and might be a good starter.