class_docstr: gowalla dataset
class_docstr_tok: ["gowalla","dataset"]
code: def __init__(self, args, path="./gowalla"):
      # train or test
      print(f"loading [{path}]")
      print(args)
      self.n_user = 0
      self.m_item = 0
      train_file = path + "/train.txt"
      test_file = path + "/test.txt"
      self.path = path
      trainUniqueUsers, trainItem, trainUser = [], [], []
      testUniqueUsers, testItem, testUser = [], [], []
      self.traindataSize = 0
      self.testDataSize = 0
  
      with open(train_file) as f:
          for l in f.readlines():
              if len(l) > 0:
                  l = l.strip("\n").split(" ")
  
                  items = [int(i) if i != "" else -1 for i in l[1:]]
                  uid = int(l[0])
                  trainUniqueUsers.append(uid)
                  trainUser.extend([uid] * len(items))
                  trainItem.extend(items)
                  self.m_item = max(self.m_item, max(items))
                  self.n_user = max(self.n_user, uid)
                  self.traindataSize += len(items)
      self.trainUniqueUsers = np.array(trainUniqueUsers)
      self.trainUser = np.array(trainUser)
      self.trainItem = np.array(trainItem)
  
      with open(test_file) as f:
          for l in f.readlines():
              if len(l) > 0:
                  l = l.strip("\n").split(" ")
                  items = [int(i) if i != "" else -1 for i in l[1:]]
                  uid = int(l[0])
                  testUniqueUsers.append(uid)
                  testUser.extend([uid] * len(items))
                  testItem.extend(items)
                  self.m_item = max(self.m_item, max(items))
                  self.n_user = max(self.n_user, uid)
                  self.testDataSize += len(items)
      self.m_item += 1
      self.n_user += 1
      self.testUniqueUsers = np.array(testUniqueUsers)
      self.testUser = np.array(testUser)
      self.testItem = np.array(testItem)
      self.UserItemNet = csr_matrix(
          (
              np.ones(len(self.trainUser)),
              (self.trainUser, self.trainItem),
          ),
          shape=(self.n_user, self.m_item),
      )
  
      self._allPos = self.getUserPosItems(list(range(self.n_user)))
      ## bipartite graph, reindex item after user
      self.trainItem += self.n_user
      print(self.trainItem, self.trainItem.shape)
      first_sub = np.stack([self.trainUser, self.trainItem])
      second_sub = np.stack([self.trainItem, self.trainUser])
      self.train_edge = np.concatenate(
          [first_sub.reshape(-1, 1), second_sub.reshape(-1, 1)], axis=-1
      )
      self.train_edge = sorted(self.train_edge, key=lambda x: x[0])
  
imports: import os
  from os.path import join
  import sys
  import paddle
  import numpy
  import pandas
  from paddle.io import Dataset, DataLoader
  from scipy.sparse import csr_matrix
  import scipy.sparse
  from time import time
label_desc: Use image node_id 1 to create a new Loader object from inherited base classes: BasicDataset with example: obj = Loader(args, path)