Implements rules from ISO 15417 Annex E. Returns the updated index point.
183044
private int reduceSubsetChanges(Mode[] mode_type, int[] mode_length, int index_point) {

        int totalLength = 0;
        int i, length;
        Mode current, last, next;

        for (i = 0; i < index_point; i++) {
            current = mode_type[i];
            length = mode_length[i];
            if (i != 0) {
                last = mode_type[i - 1];
            } else {
                last = Mode.NULL;
            }
            if (i != index_point - 1) {
                next = mode_type[i + 1];
            } else {
                next = Mode.NULL;
            }

            /* ISO 15417 Annex E Note 2 */
            /* Calculate difference between logical length and actual length in this block */
            int extraLength = 0;
            for (int j = 0; j < length - extraLength; j++) {
                if (length(inputData[totalLength + j], current) == 2) {
                    extraLength++;
                }
            }

            if (i == 0) { /* first block */
                if ((index_point == 1) && ((length == 2) && (current == Mode.ABORC))) { /* Rule 1a */
                    mode_type[i] = Mode.LATCHC;
                    current = Mode.LATCHC;
                }
                if (current == Mode.ABORC) {
                    if (length >= 4) { /* Rule 1b */
                        mode_type[i] = Mode.LATCHC;
                        current = Mode.LATCHC;
                    } else {
                        mode_type[i] = Mode.AORB;
                        current = Mode.AORB;
                    }
                }
                if (current == Mode.SHIFTA) { /* Rule 1c */
                    mode_type[i] = Mode.LATCHA;
                    current = Mode.LATCHA;
                }
                if ((current == Mode.AORB) && (next == Mode.SHIFTA)) { /* Rule 1c */
                    mode_type[i] = Mode.LATCHA;
                    current = Mode.LATCHA;
                }
                if (current == Mode.AORB) { /* Rule 1d */
                    mode_type[i] = Mode.LATCHB;
                    current = Mode.LATCHB;
                }
            } else {
                if ((current == Mode.ABORC) && (length >= 4)) { /* Rule 3 */
                    mode_type[i] = Mode.LATCHC;
                    current = Mode.LATCHC;
                }
                if (current == Mode.ABORC) {
                    mode_type[i] = Mode.AORB;
                    current = Mode.AORB;
                }
                if ((current == Mode.AORB) && (last == Mode.LATCHA)) {
                    mode_type[i] = Mode.LATCHA;
                    current = Mode.LATCHA;
                }
                if ((current == Mode.AORB) && (last == Mode.LATCHB)) {
                    mode_type[i] = Mode.LATCHB;
                    current = Mode.LATCHB;
                }
                if ((current == Mode.AORB) && (next == Mode.SHIFTA)) {
                    mode_type[i] = Mode.LATCHA;
                    current = Mode.LATCHA;
                }
                if ((current == Mode.AORB) && (next == Mode.SHIFTB)) {
                    mode_type[i] = Mode.LATCHB;
                    current = Mode.LATCHB;
                }
                if (current == Mode.AORB) {
                    mode_type[i] = Mode.LATCHB;
                    current = Mode.LATCHB;
                }
                if ((current == Mode.SHIFTA) && (length > 1)) { /* Rule 4 */
                    mode_type[i] = Mode.LATCHA;
                    current = Mode.LATCHA;
                }
                if ((current == Mode.SHIFTB) && (length > 1)) { /* Rule 5 */
                    mode_type[i] = Mode.LATCHB;
                    current = Mode.LATCHB;
                }
                if ((current == Mode.SHIFTA) && (last == Mode.LATCHA)) {
                    mode_type[i] = Mode.LATCHA;
                    current = Mode.LATCHA;
                }
                if ((current == Mode.SHIFTB) && (last == Mode.LATCHB)) {
                    mode_type[i] = Mode.LATCHB;
                    current = Mode.LATCHB;
                }
                if ((current == Mode.SHIFTA) && (next == Mode.AORB)) {
                    mode_type[i] = Mode.LATCHA;
                    current = Mode.LATCHA;
                }
                if ((current == Mode.SHIFTB) && (next == Mode.AORB)) {
                    mode_type[i] = Mode.LATCHB;
                    current = Mode.LATCHB;
                }
                if ((current == Mode.SHIFTA) && (last == Mode.LATCHC)) {
                    mode_type[i] = Mode.LATCHA;
                    current = Mode.LATCHA;
                }
                if ((current == Mode.SHIFTB) && (last == Mode.LATCHC)) {
                    mode_type[i] = Mode.LATCHB;
                    current = Mode.LATCHB;
                }
            } /* Rule 2 is implemented elsewhere, Rule 6 is implied */

            /* ISO 15417 Annex E Note 2 */
            /* Convert logical length back to actual length for this block, now that we've decided on a subset */
            mode_length[i] -= extraLength;
            totalLength += mode_length[i];
        }

        return combineSubsetBlocks(mode_type, mode_length, index_point);
    }
74966
def _get_index(self):
        
        contour = self.contour
        if contour is None:
            return None
        return contour.points.index(self)
568785
def update(self):
        
        if not self._remap:
            return

        with self._remap_lock:
            if not self._remap:
                return

            self._rules.sort(key=lambda x: x.match_compare_key())
            for rules in itervalues(self._rules_by_endpoint):
                rules.sort(key=lambda x: x.build_compare_key())
            self._remap = False
550973
def _get_index(self):
        
        glyph = self.glyph
        if glyph is not None:
            parent = glyph
        else:
            parent = self.font
        if parent is None:
            return None
        return parent.guidelines.index(self)
596933
def _increment_index(self, di=1):
        
        if self._last_event is None:
            return

        if not hasattr(self._last_event, 'ind'):
            return

        event = self._last_event
        xy = pick_info.get_xy(event.artist)

        if xy is not None:
            x, y = xy
            i = (event.ind[0] + di) % len(x)
            event.ind = [i]
            event.mouseevent.xdata = x[i]
            event.mouseevent.ydata = y[i]

            self.update(event, self._last_annotation)
115299
def update_changes(changes,newtext,change):
  ""
  # the criteria for a new version are:
  # 1. mode change (modes are adding to end, deleting from end, internal edits)
  # 2. length changed by more than 256 chars (why power of 2? why not)
  # 3. time delta > COMPACTION_TIME_THRESH
  if not changes: return [change] # todo(awinter): needs test case
  if change.utc-changes[-1].utc>COMPACTION_TIME_THRESH:
    changes.append(change)
    return changes
  base=reduce(apply_change,changes[:-1],'')
  final=apply_change(base,changes[-1])
  prev_mode=detect_change_mode(base,changes[-1])
  cur_mode=detect_change_mode(final,change)
  if prev_mode==cur_mode and abs(len(newtext)-len(final)<COMPACTION_LEN_THRESH):
    changes[-1]=mkchange(base,newtext,change.version,change.utc)
  else: changes.append(change)
  return changes
1085147
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CPInstance updateCPInstance(CPInstance cpInstance) {
		return cpInstancePersistence.update(cpInstance);
	}
781717
private void processOperandValue(int index, FieldType type, GraphicalIndicatorCriteria criteria)
   {
      boolean valueFlag = (MPPUtility.getInt(m_data, m_dataOffset) == 1);
      m_dataOffset += 4;

      if (valueFlag == false)
      {
         int fieldID = MPPUtility.getInt(m_data, m_dataOffset);
         criteria.setRightValue(index, FieldTypeHelper.getInstance(fieldID));
         m_dataOffset += 4;
      }
      else
      {
         //int dataTypeValue = MPPUtility.getShort(m_data, m_dataOffset);
         m_dataOffset += 2;

         switch (type.getDataType())
         {
            case DURATION: // 0x03
            {
               Duration value = MPPUtility.getAdjustedDuration(m_properties, MPPUtility.getInt(m_data, m_dataOffset), MPPUtility.getDurationTimeUnits(MPPUtility.getShort(m_data, m_dataOffset + 4)));
               m_dataOffset += 6;
               criteria.setRightValue(index, value);
               break;
            }

            case NUMERIC: // 0x05
            {
               Double value = Double.valueOf(MPPUtility.getDouble(m_data, m_dataOffset));
               m_dataOffset += 8;
               criteria.setRightValue(index, value);
               break;
            }

            case CURRENCY: // 0x06
            {
               Double value = Double.valueOf(MPPUtility.getDouble(m_data, m_dataOffset) / 100);
               m_dataOffset += 8;
               criteria.setRightValue(index, value);
               break;
            }

            case STRING: // 0x08
            {
               String value = MPPUtility.getUnicodeString(m_data, m_dataOffset);
               m_dataOffset += ((value.length() + 1) * 2);
               criteria.setRightValue(index, value);
               break;
            }

            case BOOLEAN: // 0x0B
            {
               int value = MPPUtility.getShort(m_data, m_dataOffset);
               m_dataOffset += 2;
               criteria.setRightValue(index, value == 1 ? Boolean.TRUE : Boolean.FALSE);
               break;
            }

            case DATE: // 0x13
            {
               Date value = MPPUtility.getTimestamp(m_data, m_dataOffset);
               m_dataOffset += 4;
               criteria.setRightValue(index, value);
               break;
            }

            default:
            {
               break;
            }
         }
      }
   }
809173
def get_index(self):
        '''  '''
        ifreq = struct.pack('16si', self.name, 0)
        res = fcntl.ioctl(sockfd, SIOCGIFINDEX, ifreq)
        return struct.unpack("16si", res)[1]
1095967
def itemFromIndex(self, index):
        
        sourceIndex = self.mapToSource(index)
        return self.sourceModel().itemFromIndex(sourceIndex)
424157
public void updateIndex() {

        if (!isEnabled()) {
            return;
        }

        final IndexWriterConfig indexWriterConfig = new IndexWriterConfig(new StandardAnalyzer());
        indexWriterConfig
                .setCommitOnClose(true)
                .setOpenMode(IndexWriterConfig.OpenMode.CREATE_OR_APPEND);

        try (IndexWriter indexWriter = new IndexWriter(directory, indexWriterConfig)) {
            final List<IPortletDefinition> portlets = portletRegistry.getAllPortletDefinitions();
            portlets.forEach(portlet -> indexPortlet(portlet, indexWriter));
        } catch (Exception e) {
            logger.error("Unable to update index", e);
        }
    }
241080
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CPOptionValue updateCPOptionValue(CPOptionValue cpOptionValue) {
		return cpOptionValuePersistence.update(cpOptionValue);
	}
328785
def _get_target_index(self):
        """"""
        return (self.index + self.source_window * (not self.overlapping) +
                self.offset)
38325
def upgrade(self, using=None, **kwargs):
        
        return self._get_connection(using).indices.upgrade(index=self._name, **kwargs)
1176180
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CommerceDiscountRule updateCommerceDiscountRule(
		CommerceDiscountRule commerceDiscountRule) {
		return commerceDiscountRulePersistence.update(commerceDiscountRule);
	}
778521
def handle_rule_versions(self, filename, rule_type, rule):
        
        if 'versions' in rule:
            versions = rule.pop('versions')
            for version_key_suffix in versions:
                version = versions[version_key_suffix]
                version['key_suffix'] = version_key_suffix
                tmp_rule = dict(rule, **version)
                self.rules[filename].append(Rule(filename, rule_type, tmp_rule))
        else:
            self.rules[filename].append(Rule(filename, rule_type, rule))
257124
def update(self, argv):
        """"""

        if len(argv) == 0: 
            error("Command requires an index name", 2)
        name = argv[0]

        if name not in self.service.indexes:
            error("Index '%s' does not exist" % name, 2)
        index = self.service.indexes[name]

        # Read index metadata and construct command line parser rules that 
        # correspond to each editable field.

        # Request editable fields
        fields = self.service.indexes.itemmeta().fields.optional

        # Build parser rules
        rules = dict([(field, {'flags': ["--%s" % field]}) for field in fields])

        # Parse the argument vector
        opts = cmdline(argv, rules)

        # Execute the edit request
        index.update(**opts.kwargs)