user.py
def load(self):
		"""Load the user from the corresponding file of do nothing"""
		assert self.id is not None

		self.create_files()
		f = open(User.user_fname if type(self.id) is int else User.author_fname, "r")
		lines = f.readlines()
		for i in range(1, len(lines)):
			l = lines[i][:-1]
			items = l.split('\t')
			if items[0] == str(self.id):
				self.nb_click = int(items[1])
				self.vec = np.asarray([float(x) for x in items[2][1:-1].split(', ')])
				self.localisation = items[3]
				self.gender = items[4]
				self.emotion = items[5]
				self.topic_vector = np.asarray([]) if items[6] == '[]' else np.asarray(
					[float(x) for x in items[6][1:-1].split(', ')])
				if type(id) is str:
					self.centrality = float(items[7])
				f.close()
				return
Load the user from the corresponding file of do nothing
Load the user from the corresponding file of do nothing
Load the user from the corresponding file of do nothing
def load(self):
		assert self.id is not None
		self.create_files()
		f = open(User.user_fname if type(self.id) is int else User.author_fname, "r")
		lines = f.readlines()
		for i in range(1, len(lines)):
			l = lines[i][:-1]
			items = l.split('\t')
			if items[0] == str(self.id):
				self.nb_click = int(items[1])
				self.vec = np.asarray([float(x) for x in items[2][1:-1].split(', ')])
				self.localisation = items[3]
				self.gender = items[4]
				self.emotion = items[5]
				self.topic_vector = np.asarray([]) if items[6] == '[]' else np.asarray(
					[float(x) for x in items[6][1:-1].split(', ')])
				if type(id) is str:
					self.centrality = float(items[7])
				f.close()
				return
def load ( self ) : assert self . id is not None self . create_files ( ) f = open ( User . user_fname if type ( self . id ) is int else User . author_fname , "r" ) lines = f . readlines ( ) for i in range ( 1 , len ( lines ) ) : l = lines [ i ] [ : - 1 ] items = l . split ( '\t' ) if items [ 0 ] == str ( self . id ) : self . nb_click = int ( items [ 1 ] ) self . vec = np . asarray ( [ float ( x ) for x in items [ 2 ] [ 1 : - 1 ] . split ( ', ' ) ] ) self . localisation = items [ 3 ] self . gender = items [ 4 ] self . emotion = items [ 5 ] self . topic_vector = np . asarray ( [ ] ) if items [ 6 ] == '[]' else np . asarray ( [ float ( x ) for x in items [ 6 ] [ 1 : - 1 ] . split ( ', ' ) ] ) if type ( id ) is str : self . centrality = float ( items [ 7 ] ) f . close ( ) return
Load the user from the corresponding file of do nothing
Load the user from the corresponding file of do nothing
"""Load the user from the corresponding file of do nothing"""
self