nodes: 0, module; 1, function_definition; 2, function_name:parallel_progbar; 3, parameters; 4, block; 5, identifier:mapper; 6, identifier:iterable; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, dictionary_splat_pattern; 14, expression_statement; 15, expression_statement; 16, return_statement; 17, identifier:nprocs; 18, None; 19, identifier:starmap; 20, False; 21, identifier:flatmap; 22, False; 23, identifier:shuffle; 24, False; 25, identifier:verbose; 26, True; 27, identifier:verbose_flatmap; 28, None; 29, identifier:kwargs; 30, comment:"""Performs a parallel mapping of the given iterable, reporting a progress bar as values get returned
  
      :param mapper: The mapping function to apply to elements of the iterable
      :param iterable: The iterable to map
      :param nprocs: The number of processes (defaults to the number of cpu's)
      :param starmap: If true, the iterable is expected to contain tuples and the mapper function gets each element of a
          tuple as an argument
      :param flatmap: If true, flatten out the returned values if the mapper function returns a list of objects
      :param shuffle: If true, randomly sort the elements before processing them. This might help provide more uniform
          runtimes if processing different objects takes different amounts of time.
      :param verbose: Whether or not to print the progress bar
      :param verbose_flatmap: If performing a flatmap, whether or not to report each object as it's returned
      :param kwargs: Any other keyword arguments to pass to the progress bar (see ``progbar``)
      :return: A list of the returned objects, in the same order as provided
      """; 31, assignment; 32, list_comprehension; 33, identifier:results; 34, call; 35, identifier:x; 36, for_in_clause; 37, identifier:_parallel_progbar_launch; 38, argument_list; 39, pattern_list; 40, call; 41, identifier:mapper; 42, identifier:iterable; 43, identifier:nprocs; 44, identifier:starmap; 45, identifier:flatmap; 46, identifier:shuffle; 47, identifier:verbose; 48, identifier:verbose_flatmap; 49, dictionary_splat; 50, identifier:i; 51, identifier:x; 52, identifier:sorted; 53, argument_list; 54, identifier:kwargs; 55, identifier:results; 56, keyword_argument; 57, identifier:key; 58, lambda; 59, lambda_parameters; 60, subscript; 61, identifier:p; 62, identifier:p; 63, integer:0
code: def parallel_progbar(mapper, iterable, nprocs=None, starmap=False, flatmap=False, shuffle=False,
                       verbose=True, verbose_flatmap=None, **kwargs):
      """Performs a parallel mapping of the given iterable, reporting a progress bar as values get returned
  
      :param mapper: The mapping function to apply to elements of the iterable
      :param iterable: The iterable to map
      :param nprocs: The number of processes (defaults to the number of cpu's)
      :param starmap: If true, the iterable is expected to contain tuples and the mapper function gets each element of a
          tuple as an argument
      :param flatmap: If true, flatten out the returned values if the mapper function returns a list of objects
      :param shuffle: If true, randomly sort the elements before processing them. This might help provide more uniform
          runtimes if processing different objects takes different amounts of time.
      :param verbose: Whether or not to print the progress bar
      :param verbose_flatmap: If performing a flatmap, whether or not to report each object as it's returned
      :param kwargs: Any other keyword arguments to pass to the progress bar (see ``progbar``)
      :return: A list of the returned objects, in the same order as provided
      """
  
      results = _parallel_progbar_launch(mapper, iterable, nprocs, starmap, flatmap, shuffle, verbose, verbose_flatmap, **kwargs)
      return [x for i, x in sorted(results, key=lambda p: p[0])]