[RESOLVED] DataSet class takes 1 positional argument but 3 were given

[EDIT] It turns out that I accidentally made TrainDataSet a function, instead of a class. This simple fix resolved the issue. My apologies

I have recently learned how to create a custom DataSet class. The class and its init method are shown below:

def TrainDataSet(Dataset):
    def __init__(self, data, labels=None, transforms=None):
        self.data = data.values()
        self.labels = labels.values()
        self.transforms = transforms

However, when I try to define a TrainDataSet as below:

dataset = TrainDataSet(data, labels, transform)

I get the following error:

TypeError: TrainDataSet() takes 1 positional argument but 3 were given

Could someone please help me with this?

The full stack trace is below

Traceback (most recent call last):
  File "/Users/~/PythonProjects/MLProject/preprocess.py", line 39, in <module>
    dataset = TrainDataSet(data, labels, transform)
TypeError: TrainDataSet() takes 1 positional argument but 3 were given

This problem has nothing to do with pytorch, this is the basic concept of python, I think you should lay the foundation.
https://docs.python.org/3/glossary.html#term-argument

Thanks for the advice. My foundations are clear, I had just made a simple error - I accidentally defined the DataSet as a function, instead of a class. Thank you!