i want to load data by def get_data. First code is a example for getting data and transfrom if data is Gotik. however, i want to def get data and return data and labels, it wont work.
train_files = os.listdir('/content/drive/My Drive/Churches_new/Train')
data_list = []
for f in files:
    if f[-3:] == "obj":
        d = read_obj('rootdir' + f)
        if f[5:10] == "Gotik":
            d.y = torch.tensor([0])
        else:
            d.y = torch.tensor([1])
        data_list.append(transforms(d))

def get_data(rootdir):


  data=[]
  files = os.listdir('rootdir')

  for f in files:
    if f[-3:] == "obj":
        data = read_obj('rootdir ' + f)
       labels=[]
 if f[5:10] == "Gotik",
labels= "Gotik",
else labels="Romantik
         return data label


pls help