region Synchronization
550922
private synchronized void synchronize() {
		personEmail = conversation.getPerson().getEmail();
		personName = conversation.getPerson().getName();
		messageCenterPendingMessage = conversation.getMessageCenterPendingMessage();
		messageCenterPendingAttachments = conversation.getMessageCenterPendingAttachments();
		hasActiveState = conversation.hasActiveState();
		messageCenterWhoCardPreviouslyDisplayed = conversation.isMessageCenterWhoCardPreviouslyDisplayed();
		unreadMessageCount = conversation.getMessageManager().getUnreadMessageCount();
	}
519533
public synchronized void synchronizeWith(UpdateSynchronizer newsync) {
    // LoggingUtil.warning("Synchronizing: " + sync + " " + newsync, new
    // Throwable());
    if(synchronizer == newsync) {
      LoggingUtil.warning("Double-synced to the same plot!", new Throwable());
      return;
    }
    if(synchronizer != null) {
      LoggingUtil.warning("Attempting to synchronize to more than one synchronizer.");
      return;
    }
    synchronizer = newsync;
    newsync.addUpdateRunner(this);
  }
781457
private void syncInternal() throws IOException {
        syncCompactor();
        fireBeforePersist();
        
        /* CALLS ORDERED: Need force _segment first and then persist
         * _addressArray. During recovery, the _addressArray can always
         * point to addresses which are valid though may not reflect the
         * most recent address update.
         */
        _segment.force();
        _addressArray.sync();
        _segmentManager.updateMeta();
        
        fireAfterPersist();
    }
1016753
private static void trySyncFileRange(int fd, long offset, long nbytes, int flags)
  {
    if (!initialized || !syncFileRangePossible || fd < 0) {
      return;
    }
    try {
      int ret_code = sync_file_range(fd, offset, nbytes, flags);
      if (ret_code != 0) {
        log.warn("failed on syncing fd [%d], offset [%d], bytes [%d], ret_code [%d], errno [%d]",
            fd, offset, nbytes, ret_code, Native.getLastError());
        return;
      }
    }
    catch (UnsupportedOperationException uoe) {
      log.warn(uoe, "sync_file_range is not supported");
      syncFileRangePossible = false;
    }
    catch (UnsatisfiedLinkError nle) {
      log.warn(nle, "sync_file_range failed on fd [%d], offset [%d], bytes [%d]", fd, offset, nbytes);
      syncFileRangePossible = false;
    }
    catch (Exception e) {
      log.warn(e, "Unknown exception: sync_file_range failed on fd [%d], offset [%d], bytes [%d]",
          fd, offset, nbytes);
      syncFileRangePossible = false;
    }
  }
1011193
public void initialize( T image , int x0 , int y0 , int regionWidth , int regionHeight ) {

		this.imageWidth = image.width;
		this.imageHeight = image.height;

		setTrackLocation(x0,y0,regionWidth,regionHeight);

		initialLearning(image);
	}
1056362
def region_from_segment(image, segment):
    """"""
    x, y, w, h = segment
    return image[y:y + h, x:x + w]
718964
private void joinSynchronization()
      throws IOException, TimeoutException, InterruptedException {
    Message sync = MessageBuilder.buildSyncHistory(persistence.getLatestZxid());
    sendMessage(this.electedLeader, sync);
    MessageTuple tuple =
      filter.getExpectedMessage(MessageType.SYNC_HISTORY_REPLY, electedLeader,
                                config.getTimeoutMs());
    Message msg = tuple.getMessage();
    // Updates the sync timeout based on leader's suggestion.
    setSyncTimeoutMs(msg.getSyncHistoryReply().getSyncTimeout());
    // Waits for the first synchronization completes.
    waitForSync(this.electedLeader);

    // Gets the last zxid in disk after first synchronization.
    Zxid lastZxid = persistence.getLatestZxid();
    LOG.debug("After first synchronization, the last zxid is {}", lastZxid);
    // Then issues the JOIN message.
    Message join = MessageBuilder.buildJoin(lastZxid);
    sendMessage(this.electedLeader, join);

    /* -- Synchronizing phase -- */
    changePhase(Phase.SYNCHRONIZING);
    waitForSync(this.electedLeader);
    waitForNewLeaderMessage();
    waitForCommitMessage();
    persistence.setProposedEpoch(persistence.getAckEpoch());
  }
144378
protected void mergeSmallRegions() {
		for( int i = 0; i < edgesNotMatched.size(); i++ ) {
			Edge e = edgesNotMatched.get(i);

			int rootA = find(e.indexA);
			int rootB = find(e.indexB);

			// see if they are already part of the same segment
			if( rootA == rootB )
				continue;

			int sizeA = regionSize.get(rootA);
			int sizeB = regionSize.get(rootB);

			// merge if one of the regions is too small
			if( sizeA < minimumSize || sizeB < minimumSize ) {
				// Point everything towards rootA
				graph.data[e.indexB] = rootA;
				graph.data[rootB] = rootA;

				// Update the size of regionA
				regionSize.data[rootA] = sizeA + sizeB;
			}
		}
	}
810876
public void startSynchronization() throws IOException, ServiceException,
            AuthenticationException, NotFoundException, RedmineException, ParseException {

        // retrieve new issues
        final List<EditableAcraReport> listReports = retrieveUnsyncedElements();

        // update Chiliproject
        for (final EditableAcraReport report : listReports) {

            final Issue issue = getIssueForStack(report.getStacktraceMD5());

            try {
                if (null == issue) {
                    LOGGER.debug("Got a new bugreport: reportId={}", report.getId());
                    for (final AcraReportHandler handler : reportHandlers) {
                        handler.onNewReport(report);
                    }
                } else if (ChiliprojectUtils.isSynchronized(report, issue)) {
                    LOGGER.debug("Got a bugreport already synchronized: reportId={}",
                            report.getId());
                    for (final AcraReportHandler handler : reportHandlers) {
                        handler.onKnownIssueAlreadySynchronized(report, issue);
                    }
                } else {
                    LOGGER.debug(
                            "Got a new bugreport with a stacktrace similar to an existing ticket: reportId={}",
                            report.getId());
                    for (final AcraReportHandler handler : reportHandlers) {
                        handler.onKnownIssueNotSynchronized(report, issue);
                    }
                }
            } catch (final SynchronizationException e) {
                report.mergeSyncStatus(SyncStatus.FAILURE);
                LOGGER.error("Unable to synchronize ACRA report " + report.getId(), e);
            }
        }

        try {
            for (final AcraReportHandler handler : reportHandlers) {
                handler.onFinishReceivingNewReports();
            }
        } catch (final SynchronizationException e) {
            for (final EditableAcraReport report : listReports) {
                report.mergeSyncStatus(SyncStatus.FAILURE);
            }
            LOGGER.error("Unable to finalize ACRA report synchronization");
        }

        // update/set stack_trace_md5 cells
        for (final EditableAcraReport report : listReports) {
            if (SyncStatus.SUCCESS.equals(report.getStatus())) {
                report.commitStacktraceMD5();
            }
        }
    }
18416
public void sync() {

        if (isClosed) {
            return;
        }

        synchronized (fileStreamOut) {
            if (needsSync) {
                if (busyWriting) {
                    forceSync = true;

                    return;
                }

                try {
                    fileStreamOut.flush();
                    outDescriptor.sync();

                    syncCount++;
                } catch (IOException e) {
                    Error.printSystemOut("flush() or sync() error: "
                                         + e.toString());
                }

                needsSync = false;
                forceSync = false;
            }
        }
    }
952377
public boolean	sync()
    {
        if (!mNeedSync)
            return false;
        mNeedSync = false;
        for (int i = 0; i < mBones.length; ++i)
        {
            Bone 	bone = mBones[i];
            int		pid = mSkeleton.getParentBoneIndex(i);
            boolean	update;

            if (pid < 0)							        // root bone?
                continue;
            update = (mBones[pid].Changed & (WORLD_ROT | LOCAL_ROT)) != 0;
            if (!mSkeleton.isLocked(i))				        // bone not locked?
            {
                if ((bone.Changed == WORLD_ROT) ||
                    ((bone.Changed & Bone.WORLD_POS) != 0))	// world matrix changed?
                {
                    calcLocal(bone, pid);					// calculate local rotation and position
                    if (sDebug)
                    {
                        Log.d("BONE", "sync: %s %s", mSkeleton.getBoneName(i), bone.toString());
                    }
                    continue;
                }
            }
            if (update ||								    // use local pos & rot?
                (bone.Changed & (LOCAL_ROT | WORLD_ROT)) != 0)
            {
                bone.Changed = LOCAL_ROT;
                calcWorld(bone, pid);				        // update world rotation & position
                if (sDebug)
                {
                    Log.d("BONE", "sync: %s %s", mSkeleton.getBoneName(i), bone.toString());
                }
            }
        }
        for (int i = 0; i < mBones.length; ++i)
        {
            mBones[i].Changed = 0;
        }
        return true;
    }
1071877
@Override
    public R visitSynchronized(SynchronizedTree node, P p) {
        R r = scan(node.getExpression(), p);
        r = scanAndReduce(node.getBlock(), p, r);
        return r;
    }
210216
def sync_state(self):
        
        oradius = self.radius + self.width
        if oradius < self.radius:
            raise ValueError('Outer boundary < inner boundary')

        d = dict(points=self.points, radius=self.radius, color=self.color,
                 linewidth=self.linewidth, linestyle=self.linestyle,
                 alpha=self.alpha)

        # update inner object
        self.objects[0].__dict__.update(d)

        # update outer object
        d['radius'] = oradius
        self.objects[1].__dict__.update(d)
540435
def do_region(self, x, y, w, h):
        """"""
        if (x is None):
            self.logger.debug("region: full (nop)")
        else:
            self.logger.debug("region: (%d,%d,%d,%d)" % (x, y, w, h))
            self.image = self.image.crop((x, y, x + w, y + h))
            self.width = w
            self.height = h
740321
def sync(self, bForce):
        """"""

        fn = self.function_table.sync
        peError = EVRSettingsError()
        result = fn(bForce, byref(peError))
        return result, peError
805399
private void afterDataFsync(Result<Boolean> result,
                              int position,
                              FsyncType fsyncType,
                              ArrayList<SegmentFsyncCallback> listeners)
  {
    try {
      completeIndex(position);
      
      Result<Boolean> cont = result.then((v,r)->
        afterIndexFsync(r, fsyncType, listeners));

      if (fsyncType.isSchedule()) {
        _sOut.fsyncSchedule(cont);
      }
      else {
        _sOut.fsync(cont);
        
      }
    } catch (Throwable e) {
      result.fail(e);
    }
  }
1085377
public void mergedRegion(int firstRow, int lastRow, int firstCol, int lastCol) {
        mergedRegion(workbook.getSheetAt(sheetIndex), firstRow, lastRow, firstCol, lastCol);
    }