save/update with server.
497811
protected JSONObject generateChangedParam() {
    if (totallyOverwrite) {
      HashMap<String, Object> tmp = new HashMap<>();
      tmp.putAll(this.serverData);

      // createdAt, updatedAt, objectId is immutable.
      tmp.remove(KEY_CREATED_AT);
      tmp.remove(KEY_UPDATED_AT);
      tmp.remove(KEY_OBJECT_ID);
      return new JSONObject(tmp);
    }

    Map<String, Object> params = new HashMap<String, Object>();
    Set<Map.Entry<String, ObjectFieldOperation>> entries = operations.entrySet();
    for (Map.Entry<String, ObjectFieldOperation> entry: entries) {
      //{"attr":{"__op":"Add", "objects":[obj1, obj2]}}
      Map<String, Object> oneOp = entry.getValue().encode();
      params.putAll(oneOp);
    }

    if (null != this.acl) {
      AVACL serverACL = generateACLFromServerData();
      if (!this.acl.equals(serverACL)) {
        // only append acl request when modified.
        ObjectFieldOperation op = OperationBuilder.gBuilder.create(OperationBuilder.OperationType.Set, KEY_ACL, acl);
        params.putAll(op.encode());
      }
    }

    if (!needBatchMode()) {
      return new JSONObject(params);
    }

    List<Map<String, Object>> finalParams = new ArrayList<Map<String, Object>>();
    Map<String, Object> topParams = Utils.makeCompletedRequest(getObjectId(), getRequestRawEndpoint(), getRequestMethod(), params);
    if (null != topParams) {
      finalParams.add(topParams);
    }

    for (ObjectFieldOperation ops : this.operations.values()) {
      if (ops instanceof CompoundOperation) {
        List<Map<String, Object>> restParams = ((CompoundOperation)ops).encodeRestOp(this);
        if (null != restParams && !restParams.isEmpty()) {
          finalParams.addAll(restParams);
        }
      }
    }
    Map<String, Object> finalResult = new HashMap<String, Object>(1);
    finalResult.put("requests", finalParams);

    return new JSONObject(finalResult);
  }
507236
def do_save(self, fp=None):
        
        if fp is not None:
            raise NotImplementedError()
        self.update_main_table()
        self.db.commit()
1315686
def save(self):
        """"""
        if self.path:
            self._saveState(self.path)
        else:
            self.saveAs()
1040775
def save(self, with_data=False):
        
        r = self._client.request('PUT', self.url, json=self._serialize(with_data=with_data))
        return self._deserialize(r.json(), self._manager)
799037
def update(connection, force_download):
    """"""
    manager.database.update(
        connection=connection,
        force_download=force_download
    )
178758
def update(connection=None, urls=None, force_download=False):
    
    db = DbManager(connection)
    db.db_import(urls=urls, force_download=force_download)
    db.session.close()
1226813
def update(self, back=None):
        '''
        
        '''
        back = self.backends(back)
        for fsb in back:
            fstr = '{0}.update'.format(fsb)
            if fstr in self.servers:
                log.debug('Updating %s fileserver cache', fsb)
                self.servers[fstr]()
731799
def _update(self, **kwargs):
        """"""
        path = self._construct_path_to_item()
        if not kwargs:
            return
        return self._http.put(path, json.dumps(kwargs))
1151221
def update(key, value):
    '''
    
    '''
    store = load()
    store[key] = value
    dump(store)
    return True
653843
function save() {
          $.jsonCall('/apos-pages/' + action,
            data,
            function(data) {
              apos.redirect(data.slug);
            },
            function() {
              alert('Server error');
              callback('Server error');
            }
          );
        }
402000
def update(request):
    """"""
    session = yield from app.ps.session.load(request)
    session['random'] = random.random()
    return session
876136
def save(self, data):
        """"""
        if not self.is_connected:
            raise Exception("No database selected")
        if not data:
            return False
        if isinstance(data, dict):
            doc = couchdb.Document()
            doc.update(data)
            self.db.create(doc)
        elif isinstance(data, couchdb.Document):
            self.db.update(data)
        elif isinstance(data, list):
            self.db.update(data)
        return True
925776
def _save_installed(self):
        """"""
        import json
        from utility import json_serial, get_json
        #This is a little tricky because the data file doesn't just have a list
        #of installed servers. It also manages the script's database that tracks
        #the user's interactions with it.
        fulldata = get_json(self.instpath, {})
        fulldata["installed"] = self.installed
        with open(self.instpath, 'w') as f:
            json.dump(fulldata, f, default=json_serial)
1183556
public function save($appServer)
    {
        $id = $appServer->getId();
        if ($this->findAppServer($id)) {
            $this->update($appServer);
            unset($this->appServer[$id]);
        } else {
            $this->insert($appServer);
        }
    }
1174425
def set_server(self, server_pos, key, value):
        """"""
        self.servers.set_server(server_pos, key, value)
509524
def save(self):
        """"""
        try:
            response = requests.post(self._upload_url,
                                     auth=self.jss.session.auth,
                                     verify=self.jss.session.verify,
                                     files=self.resource)
        except JSSPostError as error:
            if error.status_code == 409:
                raise JSSPostError(error)
            else:
                raise JSSMethodNotAllowedError(self.__class__.__name__)

        if response.status_code == 201:
            if self.jss.verbose:
                print "POST: Success"
                print response.text.encode("utf-8")
        elif response.status_code >= 400:
            error_handler(JSSPostError, response)
246377
def save_updates(self):
        """"""

        if not self._track_changes:
            return True  # there's nothing to update

        url = self.build_url(self._endpoints.get('update_list_item').format(item_id=self.object_id))
        update = {field: value for field, value in self.fields.items()
                  if self._cc(field) in self._track_changes}

        response = self.con.patch(url, update)
        if not response:
            return False
        self._clear_tracker()
        return True