parameters: (self, parQueries, ownQueries)
return_statement: return allQueries
docstring: Assembles iterable objects with all of the controls parameter
          combinations (including both the parent control values and its own
          control values). Uses map to apply the my_list customized list
          initializer and itertools.chain.from_iterable to chain together each
          layer's list of parameters to obtain a final list with all
          of the chained combinations.
  
          parQueries (parent control queries):
              [[{'Ctrl1' : a}, {'Ctrl1' : b}, {'Ctrl1' : c}, ...],
               [{'Ctrl2' : a}, {'Ctrl2' : b}, {'Ctrl2' : c}, ...], ...]
  
          ownQueries (parameter's own control values):
              [{'param' : a}, {'param' : b}, {'param' : c}, ...]
  
          output (all of the combinations)**:
  
              [[{'Ctrl1' : a}, {'Ctrl2' : a}, {'param' : a}],
               [{'Ctrl1' : a}, {'Ctrl2' : a}, {'param' : b}],
               [{'Ctrl1' : a}, {'Ctrl2' : a}, {'param' : c}], ...]
  
          Note(**): The elements of the output list are itertool objects which
          need to be evaluated by initializing a list (or any other iterable).
  
          Warning: this function assumes ownQueries and parQueries contain
          at least one element.  The caller should ensure this is always true.
  
          Note: See itertools docs for more information.
          (https://docs.python.org/3/library/itertools.html#itertools.product)
docstring_summary: Assembles iterable objects with all of the controls parameter
          combinations (including both the parent control values and its own
          control values). Uses map to apply the my_list customized list
          initializer and itertools.chain.from_iterable to chain together each
          layer's list of parameters to obtain a final list with all
          of the chained combinations.
docstring_tokens: Assembles iterable objects with all of the controls parameter combinations ( including both the parent control values and its own control values ) . Uses map to apply the my_list customized list initializer and itertools . chain . from_iterable to chain together each layer s list of parameters to obtain a final list with all of the chained combinations .
function: def __traverseQueryTree(self, parQueries, ownQueries):
          '''
          Assembles iterable objects with all of the controls parameter
          combinations (including both the parent control values and its own
          control values). Uses map to apply the my_list customized list
          initializer and itertools.chain.from_iterable to chain together each
          layer's list of parameters to obtain a final list with all
          of the chained combinations.
  
          parQueries (parent control queries):
              [[{'Ctrl1' : a}, {'Ctrl1' : b}, {'Ctrl1' : c}, ...],
               [{'Ctrl2' : a}, {'Ctrl2' : b}, {'Ctrl2' : c}, ...], ...]
  
          ownQueries (parameter's own control values):
              [{'param' : a}, {'param' : b}, {'param' : c}, ...]
  
          output (all of the combinations)**:
  
              [[{'Ctrl1' : a}, {'Ctrl2' : a}, {'param' : a}],
               [{'Ctrl1' : a}, {'Ctrl2' : a}, {'param' : b}],
               [{'Ctrl1' : a}, {'Ctrl2' : a}, {'param' : c}], ...]
  
          Note(**): The elements of the output list are itertool objects which
          need to be evaluated by initializing a list (or any other iterable).
  
          Warning: this function assumes ownQueries and parQueries contain
          at least one element.  The caller should ensure this is always true.
  
          Note: See itertools docs for more information.
          (https://docs.python.org/3/library/itertools.html#itertools.product)'''
  
          def my_list(iterable_var):
              '''
              This is a customized list initializer which gives special
              treatment to dict types (e.g. queries). All iterables are
              initialized with list() while dictionaries are appended to a list.
              The intention is to be able to pass this function to map() and
              obtain a list of lists which is very simple to chain
              together with itertools.chain.from_iterable().'''
              if isinstance(iterable_var, dict):
                  return [iterable_var]
              else:
                  return list(iterable_var)
  
          # Compute the combinations between parent controls. it.product gives
          # the inner product between the two lists and returns sets which are
          # then converted back to lists. The resulting list-elements are
          # concatenated into a single list.
          current = map(my_list, parQueries.pop(0))
          for nextQuery in parQueries:
              current = map(
                  my_list, it.product(current, map(my_list, nextQuery)))
              current = map(it.chain.from_iterable, current)
              # Force it.chain evaluation to avoid recursive referencing to a
              # single generator when doing the last product (ln. 170), as gens
              # evaluate only once.
              current = map(my_list, current)
  
          # Compute the combinations of the parent controls with the
          # parameter's own control values
          allQueries = map(
              my_list, it.product(current, map(my_list, ownQueries)))
          allQueries = map(it.chain.from_iterable, allQueries)
  
          return allQueries
function_tokens: def __traverseQueryTree ( self , parQueries , ownQueries ) : def my_list ( iterable_var ) : '''
              This is a customized list initializer which gives special
              treatment to dict types (e.g. queries). All iterables are
              initialized with list() while dictionaries are appended to a list.
              The intention is to be able to pass this function to map() and
              obtain a list of lists which is very simple to chain
              together with itertools.chain.from_iterable().''' if isinstance ( iterable_var , dict ) : return [ iterable_var ] else : return list ( iterable_var ) # Compute the combinations between parent controls. it.product gives # the inner product between the two lists and returns sets which are # then converted back to lists. The resulting list-elements are # concatenated into a single list. current = map ( my_list , parQueries . pop ( 0 ) ) for nextQuery in parQueries : current = map ( my_list , it . product ( current , map ( my_list , nextQuery ) ) ) current = map ( it . chain . from_iterable , current ) # Force it.chain evaluation to avoid recursive referencing to a # single generator when doing the last product (ln. 170), as gens # evaluate only once. current = map ( my_list , current ) # Compute the combinations of the parent controls with the # parameter's own control values allQueries = map ( my_list , it . product ( current , map ( my_list , ownQueries ) ) ) allQueries = map ( it . chain . from_iterable , allQueries ) return allQueries