def expand_bt_sub_tasks(task):
	files = task['base'].get_files(task) # XXX: a dirty trick to cache requests
	not_ready = []
	single_file = False
	if len(files) == 1 and files[0]['name'] == task['name']:
		single_file = True
	if task in 'files':
		ordered_files = []
		for t in task['files']:
			assert isinstance(t, dict)
			if t['status_text'] != 'completed':
				not_ready.append(t)
			else:
				ordered_files.append(t)
		files = ordered_files
	return files, not_ready, single_file


##################################################
# simple helpers
##################################################
dataset/ETHPy150Open iambus/xunlei-lixian/lixian_query.py/expand_bt_sub_tasks/swapped operands of `in`