def has_sub_tasks(task):
 if istask(task):
  return True
 elif isinstance(task, list):
  return any((has_sub_tasks(i) for i in task))
 else:
  return False

def has_sub_tasks ( task ) : if istask ( task ) : return True elif isinstance ( task , list ) : return any ( ( has_sub_tasks ( i ) for i in task ) ) else : return False
returns true if the task has sub tasks .