def updateDiscriptiveData(ori,data,GoT,nameFile,dyad,section):
	start = 0
	end = 0
	i = 0
	(x,y) = data.shape

	####test###
	# data[x-7][2] = 2
	# data[x-6][2] = 2
	# data[x-5][2] = 2

	count = 0
	while i < x:
		if i == x-1 or data[i+1][1] != data[start][1] :
			end = i
			line = []
			line.append(int(nameFile))
			line.append(dyad)
			line.append(section)
			line.append(count)
			line.append(data[start][0])
			#"end-1" is because to prevent out of bound for "end = x"
			#+1 at the is because we want to take into acount of the last number. Ex, from 0 to 20, there is 21 #
			line.append(data[end][0])  
			line.append(end-start+1)
			line.append(data[start][1])
			
			#get the actions of either gaze or talk of the line action		
			action1 = data[start:end+1,[0,2]]
			action2 = data[start:end+1,[0,3]]

			if GoT == 0:
				line = ATS.updateDiscriptiveData(line,action1,1)
			else:
				line = ATS.updateDiscriptiveData(line,action1,0)
			line = ATS.updateDiscriptiveData(line,action2,1)
			start = end + 1
			count = count + 1
			ori.append(line)
		i = i + 1

	return ori
def updateDiscriptiveDataForBothTalks(ori,data,GoT,nameFile,dyad,section):
	#
	start = 0
	end = 0
	i = 0
	(x,y) = data.shape


	count = 0
	while i < x:
		# let i == x-1 first because it will check this first and skip the second one if it reach the end
		# you i+1 because we are counting forward
		if i == x-1 or data[i+1][1] != data[start][1] :
			end = i
			line = []
			line.append(int(nameFile))
			line.append(dyad)
			line.append(section)
			line.append(count)
			line.append(data[start][0])
			#"end-1" is because to prevent out of bound for "end = x"
			#+1 at the is because we want to take into acount of the last number. Ex, from 0 to 20, there is 21 #
			line.append(data[end][0])  
			line.append(end-start+1)
			line.append(data[start][1])
			
			#get the actions of either gaze or talk of the line action		
			gazeAction = data[start:end+1,[0,2]]
			if GoT == 0:
				line = updateDiscriptiveDataSound(line,gazeAction)
			else :
				line = ATS.updateDiscriptiveData(line,gazeAction,0)	
			count = count + 1
			start = end +1
			ori.append(line)
			
		i = i + 1
	
	# for i in ori:
	# 	print (i)	
	return ori