sync the account's data in realtime
960420
function(token,options){
      options = options||{};
      options.token = token;
      var obj = {
        type:"rest"
        ,args:{ 
          url: '/v1/sync',
          data: options,
          method: 'get' 
        }
      };

      var s = through();

      repipe(s,function(err,last,done){
        o.log('repipe got error? ',err,' should i repipe?');
        if(err && err.code != 'E_MDM') return done(err);

        getConnection(function(err,con){
          if(err) return done(err);
          var dbstream = con.mdm.createReadStream(obj);

          var noendstream = dbstream.pipe(through(function(data){
            this.queue(data);
          },function(){
            if(options.tail || options.tail == undefined) {
              // repipe resumes the stream on error events!

              var error = new Error("never end bro!");
              error.code = "E_MDM";

              this.emit("error",error);
            } else {
              this.queue(null);
            }
          }));

          dbstream.on('error',function(err){
            noendstream.emit("error",err)
          });

          done(false,noendstream);
        });
      });

      s.on('data',function(d){
        // on reconnect start sync from where i left off.
        obj.args.data.start = d.time;
      })
      return s;
    }
1116549
function updateAccount() {

  account.middleName = 'Make it so.';

  return account.save(function(err, savedAccount) {
    if (err) throw err;
    account = savedAccount;
    console.log('Updated account:');
    console.log(account);
    return authenticateAccount(); //next quickstart step
  });

}
521057
def sync_resources():
    """"""
    print("Syncing resources with Lastuser...")
    resources = manager.app.lastuser.sync_resources()['results']

    for rname, resource in six.iteritems(resources):
        if resource['status'] == 'error':
            print("Error for %s: %s" % (rname, resource['error']))
        else:
            print("Resource %s %s..." % (rname, resource['status']))
            for aname, action in six.iteritems(resource['actions']):
                if action['status'] == 'error':
                    print("\tError for %s/%s: %s" % (rname, aname, action['error']))
                else:
                    print("\tAction %s/%s %s..." % (rname, aname, resource['status']))
    print("Resources synced...")
49308
def sync(self):
        """"""
        for i in range(4):
            self.elk.send(ps_encode(i))
        self.get_descriptions(TextDescriptions.LIGHT.value)
497125
def sync(filename, connection=None):
    
    c = connection or connect()
    rev = c.ls(filename)
    if rev:
        rev[0].sync()
1256415
public void syncCurrentToBase()
    {
        BaseTable table = this.getCurrentTable();
        if (table != null)
        {
            Record recCurrent = table.getRecord();
            Record recBase = (Record)m_record;
            this.syncRecordToBase(recBase, recCurrent, false);
        }
    }
1301901
def sync(self, recursive=False):
        
        self.syncTree(recursive=recursive)
        self.syncView(recursive=recursive)
1165039
private void sync(ImmutableMember member) {
    LOGGER.trace("{} - Synchronizing membership with {}", localMember.id(), member);
    bootstrapService.getMessagingService().sendAndReceive(
        member.address(), MEMBERSHIP_SYNC, SERIALIZER.encode(localMember.copy()), false, config.getProbeTimeout())
        .whenCompleteAsync((response, error) -> {
          if (error == null) {
            Collection<ImmutableMember> members = SERIALIZER.decode(response);
            members.forEach(this::updateState);
          } else {
            LOGGER.debug("{} - Failed to synchronize membership with {}", localMember.id(), member);
          }
        }, swimScheduler);
  }
1093185
function() {
      var authData = this.get('authData');
      if (!authData) {
        return;
      }

      var self = this;
      Parse._objectEach(this.get('authData'), function(value, key) {
        self._synchronizeAuthData(key);
      });
    }
1187368
def sync(self):
        """"""
        self.elk.send(cp_encode())
        self.get_descriptions(TextDescriptions.SETTING.value)
1041774
def sync(self):
        """"""
        if self.writeback and self.cache:
            super(_TimeoutMixin, self).__delitem__(self._INDEX)
            super(_TimeoutMixin, self).sync()
            self.writeback = False
            super(_TimeoutMixin, self).__setitem__(self._INDEX, self._index)
            self.writeback = True
        if hasattr(self.dict, 'sync'):
            self.dict.sync()
844544
def sync
      begin
        @f.flush
        @f.fsync
      rescue IOError => e
        PEROBS.log.fatal "Cannot sync flat file database: #{e.message}"
      end
      @index.sync
      @space_list.sync
    end
1282321
def sync_accounts(self, accounts_data, clear = False, password=None, cb = None):
        

        # Map common values into the accounts records

        all_accounts = self.accounts

        kmap = Account.prop_map()

        for account_id, values in accounts_data.items():

            if not isinstance(values, dict):
                continue

            d = {}

            a = self.library.find_or_new_account(account_id)
            a.secret_password = password or self.password

            for k, v in values.items():
                if k in ('id',):
                    continue
                try:
                    if kmap[k] == 'secret' and v:
                        a.encrypt_secret(v)
                    else:
                        setattr(a, kmap[k], v)
                except KeyError:
                    d[k] = v

            a.data = d

            if values.get('service') == 's3':
                a.url = 's3://{}'.format(a.account_id)

            if cb:
                cb('Loaded account: {}'.format(a.account_id))

            self.database.session.commit()
1159367
function (account) {
	
	// get all local accounts & perform login
	var onDone = function (err, data) {
		if (err) {
			LOG.warn(err.toString());
		}
		else {
			for (var server in data.accounts) {
				LOG.warn('local server: ' + server);

				var user_list = data.accounts[server];
				for (var uid in user_list) {
					var token = user_list[uid];
					LOG.warn('local uid: ' + uid + ' token: ' + token);
					l_send_remote_login(server, uid, token);	
				}
			}
		}
	};
	SR.User.getUser(account, onDone);
}
740321
def sync(self, bForce):
        """"""

        fn = self.function_table.sync
        peError = EVRSettingsError()
        result = fn(bForce, byref(peError))
        return result, peError
393357
def force_sync(self):
        
        try:
            self.send(self.get_resource_endpoint(), "put")
        except Exception as e:
            raise CartoException(e)
681493
def synchronize(self, graph_data=None):
        
        profile = graph_data or self.graph.get('me')

        self.facebook_username = profile.get('username')
        self.first_name = profile.get('first_name')
        self.middle_name = profile.get('middle_name')
        self.last_name = profile.get('last_name')
        self.birthday = datetime.strptime(profile['birthday'], '%m/%d/%Y') if profile.has_key('birthday') else None
        self.email = profile.get('email')
        self.locale = profile.get('locale')
        self.gender = profile.get('gender')
        self.extra_data = profile
        self.save()