Generation of the message to send to Sphinx to update attributes of a
 document.
8928
def update_message(index, attributes, values_by_doc)
      message = Message.new

      message.append_string index
      message.append_array attributes

      message.append_int values_by_doc.length
      values_by_doc.each do |key,values|
        message.append_64bit_int key # document ID
        message.append_ints *values # array of new values (integers)
      end

      message.to_s
    end
1220659
def update_metatab(self, doc, resources):
        """"""

        if not 'Documentation' in doc:

            doc.new_section("Documentation")

        ds = doc['Documentation']

        if not 'Name' in ds.args:
            ds.add_arg('Name', prepend=True)

        # This is the main output from the HTML exporter, not a resource.
        ds.new_term('Root.Documentation', 'docs/notebook.html', name="notebook.html", title='Jupyter Notebook (HTML)')

        for name, data in resources.get('outputs', {}).items():

            if name == 'documentation.html':
                ds.new_term('Root.Documentation', 'docs/' + name, name=name, title='Primary Documentation (HTML)')

            elif name == 'html_basic_body.html':
                pass
            elif name.endswith('.html'):
                ds.new_term('Root.Documentation', 'docs/' + name, name=name, title='Documentation (HTML)')
            elif name.endswith('.md'):
                ds.new_term('Root.Documentation', 'docs/' + name, name=name, title='Documentation (Markdown)')
            elif name.endswith('.pdf'):
                ds.new_term('Root.Documentation', 'docs/' + name, name=name, title='Documentation (PDF)')
            elif name.endswith('.png'):
                ds.new_term('Root.Image', 'docs/' + name, name=name, title='Image for HTML Documentation')
            else:
                pass
764145
def prepare_update_xml(options = {})
      r = ["<add#{options.to_xml_attribute_string}>\n"]
      # copy and clear pending docs
      working_docs, @pending_documents = @pending_documents, nil
      working_docs.each { |doc| r << doc.xml }
      r << "\n</add>\n"
      r.join # not sure, but I think Array#join is faster then String#<< for large buffers
    end
1132802
def document_created_message(self, request, document):
        
        messages.success(request, _("Document {} was created".format(document)))
1183812
def gen(skipdirhtml=False):
    """"""
    docs_changelog = 'docs/changelog.rst'
    check_git_unchanged(docs_changelog)
    pandoc('--from=markdown', '--to=rst', '--output=' + docs_changelog, 'CHANGELOG.md')
    if not skipdirhtml:
        sphinx_build['-b', 'dirhtml', '-W', '-E', 'docs', 'docs/_build/dirhtml'] & FG
    sphinx_build['-b', 'html', '-W', '-E', 'docs', 'docs/_build/html'] & FG
402911
def update_text(self, mapping):
        """"""
        found = False
        for node in self._page.iter("*"):
            if node.text or node.tail:
                for old, new in mapping.items():
                    if node.text and old in node.text:
                        node.text = node.text.replace(old, new)
                        found = True
                    if node.tail and old in node.tail:
                        node.tail = node.tail.replace(old, new)
                        found = True
        if not found:
            raise KeyError("Updating text failed with mapping:{}".format(mapping))
526477
def update_from_element(self, elem):
        """"""
        self._elem = elem

        for attrname in self.attributes:
            try:
                delattr(self, attrname)
            except AttributeError:
                pass

        document_url = elem.attrib.get('href')
        if document_url is not None:
            self._url = document_url

        return self
51370
def _generate_doc(ret):
    '''
    
    '''

    # Create a copy of the object that we will return.
    retc = ret.copy()

    # Set the ID of the document to be the JID.
    retc["_id"] = ret["jid"]

    # Add a timestamp field to the document
    retc["timestamp"] = time.time()

    return retc
150524
function updateDoc(doc, change, markedSpans, selAfter, estimateHeight) {
    function spansFor(n) {return markedSpans ? markedSpans[n] : null;}
    function update(line, text, spans) {
      updateLine(line, text, spans, estimateHeight);
      signalLater(line, "change", line, change);
    }

    var from = change.from, to = change.to, text = change.text;
    var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);
    var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;

    // First adjust the line structure
    if (from.ch == 0 && to.ch == 0 && lastText == "") {
      // This is a whole-line replace. Treated specially to make
      // sure line objects move the way they are supposed to.
      for (var i = 0, e = text.length - 1, added = []; i < e; ++i)
        added.push(makeLine(text[i], spansFor(i), estimateHeight));
      update(lastLine, lastLine.text, lastSpans);
      if (nlines) doc.remove(from.line, nlines);
      if (added.length) doc.insert(from.line, added);
    } else if (firstLine == lastLine) {
      if (text.length == 1) {
        update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);
      } else {
        for (var added = [], i = 1, e = text.length - 1; i < e; ++i)
          added.push(makeLine(text[i], spansFor(i), estimateHeight));
        added.push(makeLine(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));
        update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));
        doc.insert(from.line + 1, added);
      }
    } else if (text.length == 1) {
      update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));
      doc.remove(from.line + 1, nlines);
    } else {
      update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));
      update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);
      for (var i = 1, e = text.length - 1, added = []; i < e; ++i)
        added.push(makeLine(text[i], spansFor(i), estimateHeight));
      if (nlines > 1) doc.remove(from.line + 1, nlines - 1);
      doc.insert(from.line + 1, added);
    }

    signalLater(doc, "change", doc, change);
    setSelection(doc, selAfter.anchor, selAfter.head, null, true);
  }
388575
def update_tags(self, image_id, new_tags):
        
        # Do not add :param list in the docstring above until this is solved:
        # https://github.com/sphinx-doc/sphinx/issues/2549
        old_image = self.get(image_id)

        old_tags = frozenset(old_image.tags)
        new_tags = frozenset(new_tags)

        to_add = list(new_tags - old_tags)
        to_remove = list(old_tags - new_tags)

        add_response, remove_response = None, None

        if to_add:
            add_response = self._post('/images/%s/tag' % image_id,
                                      {'tags': to_add}, 'image')

        if to_remove:
            remove_response = self._post('/images/%s/untag' % image_id,
                                         {'tags': to_remove}, 'image')

        return remove_response or add_response or self.get(image_id)
534233
def to_xml_updates
      doc = Nokogiri::XML::Document.new
      root = doc.create_element("Updates")
      self.class.elements.each do |name, field|
        value = read_attribute(name)
        # Create or update existing fields
        if changes.include?(name.to_s)
          field.to_xml_updates(value) do |field_uri_xml, element_xml|
            # Exchange does not like updating to nil, so delete those.
            if element_xml.text.present?
              set_item_field = doc.create_element("SetItemField")
              set_item_field << field_uri_xml
              element_wrapper = doc.create_element(tag_name)
              element_wrapper << element_xml
              set_item_field << element_wrapper
              root << set_item_field
            else
              delete_item_field = doc.create_element("DeleteItemField")
              delete_item_field << field_uri_xml
              root << delete_item_field
            end
          end
        end
        # Delete removed phone numbers, etc
        if changes.include?(name.to_s) && value.is_a?(Array)
          old_values, new_values = changes[name.to_s]
          deleted_values = old_values - new_values
          field.to_xml_updates(deleted_values) do |field_uri_xml, _|
            delete_item_field = doc.create_element("DeleteItemField")
            delete_item_field << field_uri_xml
            root << delete_item_field
          end
        end
      end
      root
    end
109496
public static function sendDocument($chat_id = null, $document, $caption = '', $inline_keyboard = '', $reply_keyboard = '', $disable_notification = false, $reply_to_message_id = '')
    {
        self::initialize();
        $chat_id = $chat_id ? $chat_id : self::$channel_username;
        $params = compact('chat_id','document', 'caption', 'disable_notification', 'reply_to_message_id');
        if($inline_keyboard) {
            $params['reply_markup'] = self::inlineKeyboard($inline_keyboard);
        }
        if($reply_keyboard) {
            $params['reply_markup'] = self::replyKeyboard($reply_keyboard);
        }
        $result = self::sendRequest('sendDocument', $params);
        return $result? $result : false;
    }
851855
def update(self, document_id, update_spec, namespace, timestamp):
        
        document = self.doc_dict[document_id].doc
        updated = self.apply_update(document, update_spec)
        if "_id" in updated:
            updated.pop("_id")
        updated[self.unique_key] = document_id
        self.upsert(updated, namespace, timestamp)
        return updated
780024
def update(self, data):
        
        data = values.of({'Data': serialize.object(data), })

        payload = self._version.update(
            'POST',
            self._uri,
            data=data,
        )

        return DocumentInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            sid=self._solution['sid'],
        )
754565
def send_patch_document(self, event):
        
        msg = self.protocol.create('PATCH-DOC', [event])
        return self._socket.send_message(msg)
796481
protected void updateText() 
    {
        super.updateText();
        _exampleInfo[3].setText("[PageUp] Next model");
        _exampleInfo[4].setText("[PageDown] Previous model");
        _exampleInfo[5].setText("[1] Generate polygon type A ");
        _exampleInfo[6].setText("[2] Generate polygon type B ");
    }
382101
def trigger(self, attr, old, new, hint=None, setter=None):
        ''' 

        '''
        def invoke():
            callbacks = self._callbacks.get(attr)
            if callbacks:
                for callback in callbacks:
                    callback(attr, old, new)
        if hasattr(self, '_document') and self._document is not None:
            self._document._notify_change(self, attr, old, new, hint, setter, invoke)
        else:
            invoke()