parameters: (*promises)
return_statement: return retpromise
docstring: This creates a Promise which awaits the resolution of all promises
          passed as arguments. Anything which is not a *promise* is
          considered to be immediately resolved and the face value taken as the
          resolution value
  
          If any of the promises is rejected, the promise will also be rejected
          with the value of the rejected promise.
docstring_summary: This creates a Promise which awaits the resolution of all promises
          passed as arguments. Anything which is not a *promise* is
          considered to be immediately resolved and the face value taken as the
          resolution value
docstring_tokens: This creates a Promise which awaits the resolution of all promises passed as arguments . Anything which is not a * promise * is considered to be immediately resolved and the face value taken as the resolution value
function: def all(*promises):
          '''This creates a Promise which awaits the resolution of all promises
          passed as arguments. Anything which is not a *promise* is
          considered to be immediately resolved and the face value taken as the
          resolution value
  
          If any of the promises is rejected, the promise will also be rejected
          with the value of the rejected promise.
          '''
          if not promises:
              return Promise.resolve([])
  
          count = [None] * len(promises)
          results = count[:]  # copy
  
          # Promise that does nothing to start with
          retpromise = Promise()
  
          def thener(result, i):
              results[i] = result
              count.pop()
              if not count:  # all have delivered
                  retpromise._resolve(results)
  
          def catcher(error):
              retpromise._reject(error)
  
          for i, promise in enumerate(promises):
              if isinstance(promise, Promise):
                  promise \
                      .then(lambda x, i=i: thener(x, i)) \
                      .catch(catcher)
              else:
                  count.pop()
                  results[i] = promise
  
          if not count:  # no promises in iterable, resolve immediately
              return Promise.resolve(results)
  
          return retpromise
function_tokens: def all ( * promises ) : if not promises : return Promise . resolve ( [ ] ) count = [ None ] * len ( promises ) results = count [ : ] # copy # Promise that does nothing to start with retpromise = Promise ( ) def thener ( result , i ) : results [ i ] = result count . pop ( ) if not count : # all have delivered retpromise . _resolve ( results ) def catcher ( error ) : retpromise . _reject ( error ) for i , promise in enumerate ( promises ) : if isinstance ( promise , Promise ) : promise . then ( lambda x , i = i : thener ( x , i ) ) . catch ( catcher ) else : count . pop ( ) results [ i ] = promise if not count : # no promises in iterable, resolve immediately return Promise . resolve ( results ) return retpromise