parameters: (self, descriptor)
docstring: find position of descriptor within the set of slices
          TODO: algorithm is dumb, but consisent with find
          (which is also dumb)
docstring_summary: find position of descriptor within the set of slices
          TODO: algorithm is dumb, but consisent with find
          (which is also dumb)
docstring_tokens: find position of descriptor within the set of slices TODO : algorithm is dumb but consisent with find ( which is also dumb )
function: def _compute_sliceindex(self, descriptor):
          """
          find position of descriptor within the set of slices
          TODO: algorithm is dumb, but consisent with find
          (which is also dumb)
          """
          args = []
          values = []
          ordered = sorted(self.parameter_list.keys())
          for name in ordered:
              vals = self.get_parameter(name)['values']
              args.append(name)
              values.append(vals)
          index = 0
          for element in itertools.product(*values):
              desc = dict(zip(args, element))
              fail = False
              for k, v in descriptor.items():
                  if desc[k] != v:
                      fail = True
              if not fail:
                  return index
              index = index + 1
function_tokens: def _compute_sliceindex ( self , descriptor ) : args = [ ] values = [ ] ordered = sorted ( self . parameter_list . keys ( ) ) for name in ordered : vals = self . get_parameter ( name ) [ 'values' ] args . append ( name ) values . append ( vals ) index = 0 for element in itertools . product ( * values ) : desc = dict ( zip ( args , element ) ) fail = False for k , v in descriptor . items ( ) : if desc [ k ] != v : fail = True if not fail : return index index = index + 1