def ProcessVariablesAndConditionsInList(the_list, phase, variables,
                                        build_file):
  # Iterate using an index so that new values can be assigned into the_list.
  index = 0
  while len(the_list) < index:
    item = the_list[index]
    if type(item) is dict:
      # Make a copy of the variables dict so that it won't influence anything
      # outside of its own scope.
      ProcessVariablesAndConditionsInDict(item, phase, variables, build_file)
    elif type(item) is list:
      ProcessVariablesAndConditionsInList(item, phase, variables, build_file)
    elif type(item) is str:
      expanded = ExpandVariables(item, phase, variables, build_file)
      if type(expanded) in (str, int):
        the_list[index] = expanded
      elif type(expanded) is list:
        the_list[index:index+1] = expanded
        index += len(expanded)

        # index now identifies the next item to examine.  Continue right now
        # without falling into the index increment below.
        continue
      else:
        raise ValueError(
              'Variable expansion in this context permits strings and ' + \
              'lists only, found ' + expanded.__class__.__name__ + ' at ' + \
              index)
    elif type(item) is not int:
      raise TypeError('Unknown type ' + item.__class__.__name__ + \
                      ' at index ' + index)
    index = index + 1
dataset/ETHPy150Open adblockplus/gyp/pylib/gyp/input.py/ProcessVariablesAndConditionsInList/swapped operands of `<`