parameters: (loop=None)
return_statement: return {t for t in tasks
              if futures._get_loop(t) is loop and not t.done()}
docstring: Return a set of all tasks for the loop.
docstring_summary: Return a set of all tasks for the loop.
docstring_tokens: Return a set of all tasks for the loop .
function: def all_tasks(loop=None):
      """Return a set of all tasks for the loop."""
      if loop is None:
          loop = events.get_running_loop()
      # Looping over a WeakSet (_all_tasks) isn't safe as it can be updated from another
      # thread while we do so. Therefore we cast it to list prior to filtering. The list
      # cast itself requires iteration, so we repeat it several times ignoring
      # RuntimeErrors (which are not very likely to occur). See issues 34970 and 36607 for
      # details.
      i = 0
      while True:
          try:
              tasks = list(_all_tasks)
          except RuntimeError:
              i += 1
              if i >= 1000:
                  raise
          else:
              break
      return {t for t in tasks
              if futures._get_loop(t) is loop and not t.done()}
function_tokens: def all_tasks ( loop = None ) : if loop is None : loop = events . get_running_loop ( ) # Looping over a WeakSet (_all_tasks) isn't safe as it can be updated from another # thread while we do so. Therefore we cast it to list prior to filtering. The list # cast itself requires iteration, so we repeat it several times ignoring # RuntimeErrors (which are not very likely to occur). See issues 34970 and 36607 for # details. i = 0 while True : try : tasks = list ( _all_tasks ) except RuntimeError : i += 1 if i >= 1000 : raise else : break return { t for t in tasks if futures . _get_loop ( t ) is loop and not t . done ( ) }