def rest(args, method, url, bytes):
	if args['--proxy'] != None:
		proxy = parse_dict(args['--proxy'])
	else:
		proxy = None

	if args['--cookie'] != None:
		cookies = parse_dict(args['--cookie'])
	else:
		cookies = None

	if args['--params'] != None:
		params = parse_dict(args['--params'])
	else:
		params = None

	if args['--HEADER'] != None:
		headers = parse_dict(args['--HEADER'])
	else:
		headers = None

	if args['--auth'] != None:
		auth = parse_dict(args['--auth'])
		try:
			if auth.has_key('user') and auth.has_key('password'):
				user = auth['user']
				password = auth['password']
				auth = HTTPBasicAuth(user,password)
			else:
				colors.print_warning("res warning: Authorization keys invalid (correct format=> \"{'user':'<username>', 'password':'<password>'}\")")
				auth = None
		except AttributeError, e:
			colors.print_error('res error: ' + str(e))
	else:
		auth = None

	if args['--data'] != None:
		data = parse_dict(args['--data'])
	else:
		data = None

	r = requests.request(
		method, 
		url,
		params=params, 
		data=data, 
		headers=headers, 
		auth=auth,
		cookies=cookies,
		proxies=proxy
	)
	
	if bytes == True:
		print r.content
	else:
		print r.text
dataset/ETHPy150Open jawerty/res/build/scripts-2.7/res.py/rest/original