<commit_before>import time;
import sys;
#import pydoc;
#import sys;
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyImage
from com.android.monkeyrunner.easy import EasyMonkeyDevice, By

testCount = 10000
TAG = "AutoWlanShift"
DEBUG = 1
lteCamera='com.android.settings/com.android.settings.Settings'
OPEN_CLOSE_X = 368
OPEN_CLOSE_Y = 182

dType = sys.argv[1]
print "%s" %(dType)

""" Must copy dType to tmp
Because dType contain some non-display character
I'm so amazing about this
"""
" modify @2014.08.06 begin "
tmp = ""
ct = 0
for i in range(0,len(dType)-1):
	print "dType[%d]=%c" %(i, dType[i])
	if('\0' == dType[i]):
		break
	else:
		ct = ct + 1
	tmp = tmp + "" + dType[i]
print "ct:%d,dType:%d" %(ct, len(dType)-1)
" modify @2014.08.06 end "

if("7060S" == tmp):
	print "This is 7060S"
	OPEN_CLOSE_X = 340
	OPEN_CLOSE_Y = 260
elif("YourType" == tmp):
	""" If you want add devices, just modify bellow
	Add your device's position here.
	"""
else:
	print "Why are you goto here"

device = MonkeyRunner.waitForConnection()
#width = MonkeyDevice.getProperty(display.width);
#height = MonkeyDevice.getProperty(display.height);

def LOGD(TAG, msg):
	t = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()));
	print "%s [DEBUG] %s: %s" %(t, TAG, msg)

def doClick(keycode, action):
	TAG = "doClick"
	LOGD(TAG, "Do " + keycode + " click " + action)
	device.press(keycode, action);
	MonkeyRunner.sleep(1);


#def main():
print "start"
doClick('KEYCODE_BACK', 'DOWN_AND_UP');
doClick('KEYCODE_BACK', 'DOWN_AND_UP');
for i in range(0,testCount):
	device.startActivity(component=lteCamera);
	MonkeyRunner.sleep(2);
	LOGD(TAG, str(i)+"click open and close 1st.")
	device.touch(OPEN_CLOSE_X,OPEN_CLOSE_Y,MonkeyDevice.DOWN_AND_UP);
	t = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()));
	#imageA = device.takeSnapshot();
	#Files = "./test/time_" + t + "_count_" + str(i) + "_Open.png";
	#imageA.writeToFile(Files,'png');
	#print "%s round %04d open" %(t,i+1);
	MonkeyRunner.sleep(5);
	LOGD(TAG, str(i)+"click open and close 1st.")
	device.touch(OPEN_CLOSE_X,OPEN_CLOSE_Y,MonkeyDevice.DOWN_AND_UP);
	#t = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()));
	#imageA = device.takeSnapshot();
	#Files = "./test/time_" + t + "_count_" + str(i) + "_Close.png";
	#imageA.writeToFile(Files,'png');
	#print "%s round %04d close" %(t,i+1);
	MonkeyRunner.sleep(3);
<commit_msg>1st click and 2nd click sleep 2-seconds<commit_after>import time;
import sys;
#import pydoc;
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyImage
from com.android.monkeyrunner.easy import EasyMonkeyDevice, By

testCount = 10000
TAG = "AutoWlanShift"
DEBUG = 1
NOT_FOUND = -1
module='com.android.settings/com.android.settings.Settings'
OPEN_CLOSE_X = 368
OPEN_CLOSE_Y = 182

dType = sys.argv[1]
print "%s" %(dType)
print "dType.length=%d" %(len(dType))

# Just show all characters of get from args
for i in range(0,len(dType)):
	print "dType[%d]=%c" %(i, dType[i])

""" Modify for this just because sys.argv, which is get from shell,
which contain some special non-display character
"""
tmp = dType
if(NOT_FOUND != tmp.find("7060S")):
	print "This is 7060S"
	OPEN_CLOSE_X = 340
	OPEN_CLOSE_Y = 260
#elif("YourType" == tmp):
elif(NOT_FOUND != tmp.find("YourType")):
	""" If you want add devices, just modify bellow
	Add your device's position here.
	"""
	print "What you want to show"
else:
	print "Why are you goto here"

device = MonkeyRunner.waitForConnection()
#width = MonkeyDevice.getProperty(display.width);
#height = MonkeyDevice.getProperty(display.height);

def LOGD(TAG, msg):
	t = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()));
	print "%s [DEBUG] %s: %s" %(t, TAG, msg)

def doClick(keycode, action):
	TAG = "doClick"
	LOGD(TAG, "Do " + keycode + " click " + action)
	device.press(keycode, action);
	MonkeyRunner.sleep(1);


#def main():
print "start"
doClick('KEYCODE_BACK', 'DOWN_AND_UP');
doClick('KEYCODE_BACK', 'DOWN_AND_UP');
device.startActivity(component=module);
MonkeyRunner.sleep(2);
for i in range(0,testCount):
	MonkeyRunner.sleep(2);
	LOGD(TAG, str(i)+" click open and close 1st-click.")
	device.touch(OPEN_CLOSE_X,OPEN_CLOSE_Y,MonkeyDevice.DOWN_AND_UP);
	t = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()));
	MonkeyRunner.sleep(2);
	LOGD(TAG, str(i)+" click open and close 2nd-click.")
	device.touch(OPEN_CLOSE_X,OPEN_CLOSE_Y,MonkeyDevice.DOWN_AND_UP);


{'fraction_non_alphanumeric': 0.17142215232532015, 'fraction_numerical': 0.02269152999325994, 'mean_word_length': 5.566371681415929, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4360187', 'n_tokens_mistral': 1805, 'n_tokens_neox': 1718, 'n_words': 400}