Def get_data, rootdir

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])
            d.y = torch.tensor([1])
def get_data(rootdir):

  files = os.listdir('rootdir')

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

pls help

What is currently not working?
Do you get any errors are unexpected results?