Updates a description.

@private
@param {string} txt - description
@returns {string} updated description
961747
function updateDescription( txt ) {
		var ch;
		if ( txt.length === 0 ) {
			return txt;
		}
		ch = txt[ 0 ].toUpperCase();
		if ( ch !== txt[ 0 ] ) {
			txt = ch + txt.slice( 1 );
		}
		if ( txt.charCodeAt( txt.length-1 ) !== 46 ) { // .
			txt += '.';
		}
		return txt;
	}
296565
def wrap(txt, width=80, ident=0):
    '''
    
    '''
    ident = ' ' * ident
    txt = (txt or '').replace(os.linesep, ' ').strip()

    wrapper = textwrap.TextWrapper()
    wrapper.fix_sentence_endings = False
    wrapper.initial_indent = wrapper.subsequent_indent = ident

    return wrapper.wrap(txt)
246927
function updateTernFile(document) {
            var path  = document.file.fullPath;

            _postMessageByPass({
                type       : MessageIds.TERN_UPDATE_FILE_MSG,
                path       : path,
                text       : getTextFromDocument(document)
            });

            return addPendingRequest(path, OFFSET_ZERO, MessageIds.TERN_UPDATE_FILE_MSG);
        }
52208
function ( text ) {
		if ( this.logging.enabled ) console.time(  'OBJLoader2.Parser.parseText' );
		this.configure();
		this.legacyMode = true;
		this.contentRef = text;
		var length = text.length;
		this.globalCounts.totalBytes = length;
		var buffer = new Array( 128 );

		for ( var char, word = '', bufferPointer = 0, slashesCount = 0, i = 0; i < length; i++ ) {

			char = text[ i ];
			switch ( char ) {
				case ' ':
					if ( word.length > 0 ) buffer[ bufferPointer++ ] = word;
					word = '';
					break;

				case '/':
					if ( word.length > 0 ) buffer[ bufferPointer++ ] = word;
					slashesCount++;
					word = '';
					break;

				case '\n':
					if ( word.length > 0 ) buffer[ bufferPointer++ ] = word;
					word = '';
					this.globalCounts.lineByte = this.globalCounts.currentByte;
					this.globalCounts.currentByte = i;
					this.processLine( buffer, bufferPointer, slashesCount );
					bufferPointer = 0;
					slashesCount = 0;
					break;

				case '\r':
					break;

				default:
					word += char;
			}
		}
		this.finalizeParsing();
		if ( this.logging.enabled ) console.timeEnd( 'OBJLoader2.Parser.parseText' );
	}
965642
function Hydrate(text) {
						let rgx = /<<([A-Z]+)>>/g;
						return text.replace(rgx, ($0, $1)=>{
							let prop = $1.toLowerCase();
							return THS.hasOwnProperty(prop) ?
								THS[prop] : $0
						});
					}
727769
function updateDescriptions( el ) {
		var i;
		for ( i = 0; i < el.length; i++ ) {
			el[ i ].innerHTML = updateDescription( el[ i ].innerHTML );
		}
	}
1060086
def append_text(self, txt):
        
        with open(self.fullname, "a") as myfile:
            myfile.write(txt)
12868
function Doclet(comment) {

			this.comment = comment = unwrap(comment);
			this.tags = [];

			var m;
			var lastContent = 0;
			var lastTag = "description";
			while ((m = rtag.exec(comment)) != null) {
				this._addTag(lastTag, comment.slice(lastContent, m.index));
				lastTag = m[2];
				lastContent = rtag.lastIndex;
			}
			this._addTag(lastTag, comment.slice(lastContent));
		}
175045
function (data, callback) {
    if (typeof txDataQueue != "undefined" || txInProgress) {
      if (txDataQueue === undefined)
        txDataQueue = "";
      txDataQueue += data;
      return callback();
    } else {
      txDataQueue = data;
    }

    function writeChunk() {
      var chunk;
      var CHUNKSIZE = 20;
      if (txDataQueue.length <= CHUNKSIZE) {
        chunk = txDataQueue;
        txDataQueue = undefined;
      } else {
        chunk = txDataQueue.substr(0, CHUNKSIZE);
        txDataQueue = txDataQueue.substr(CHUNKSIZE);
      }
      txInProgress = true;
      console.log("BT> Sending " + JSON.stringify(chunk));
      try {
        winnus.write(chunk);
        setTimeout(function() {
          txInProgress = false;
          if (txDataQueue)
            writeChunk();
        }, 20);
      } catch (e) {
        console.log("BT> ERROR " + e);
        txDataQueue = undefined;
      }
    }
    writeChunk();
    return callback();
  }
73832
function updateTextContent(nextContent) {
      var prevChildren = this._renderedChildren;
      // Remove any rendered children.
      ReactChildReconciler.unmountChildren(prevChildren, false);
      for (var name in prevChildren) {
        if (prevChildren.hasOwnProperty(name)) {
           true ?  false ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
        }
      }
      // Set new text content.
      var updates = [makeTextContent(nextContent)];
      processQueue(this, updates);
    }
751616
def completedefault(self, text, line, *_):
        
        tokens = line.split()
        try:
            before = tokens[-2]
            complete = before.lower() in ("from", "update", "table", "into")
            if tokens[0].lower() == "dump":
                complete = True
            if complete:
                return [
                    t + " "
                    for t in self.engine.cached_descriptions
                    if t.startswith(text)
                ]
        except KeyError:
            pass
471239
async def update_description(self, **params):
		
		if params.get("message"):
			params = json.loads(params.get("message", "{}"))
		
		if not params:
			return {"error":400, "reason":"Missed required fields"}

		# Check if required fields exists
		cid = params.get("cid")
		description = params.get("description")
		txid = params.get("txid")
		coinid = params.get("coinid")

		try:
			coinid = coinid.replace("TEST", "")
		except:
			pass

		# Check if required fileds 
		if not all([cid, description, txid, coinid]):
			return {"error":400, "reason":"Missed required fields"}

		# Try to find offer with account id and cid
		database = client[coinid]
		collection = database[settings.CONTENT]
		content = await collection.find_one({"cid":int(cid)})
		if not content:
			return {"error":404, 
					"reason":"Content with cid %s not found" % cid }

		# Update offer
		await collection.find_one_and_update(
							{"cid":int(cid)}, {"$set":{"description":description}})
		await collection.find_one_and_update(
							{"cid":int(cid)}, {"$set":{"confirmed":None}})
		await collection.find_one_and_update(
							{"cid":int(cid)}, {"$set":{"txid":txid}})

		# Get updated offer
		updated = await collection.find_one({"cid":int(cid)})

		return {i:updated[i] for i in updated if i != "_id"}
608070
function text (options) {
  var opts = options || {}

  var defaultCharset = opts.defaultCharset || 'utf-8'
  var inflate = opts.inflate !== false
  var limit = typeof opts.limit !== 'number'
    ? bytes.parse(opts.limit || '100kb')
    : opts.limit
  var type = opts.type || 'text/plain'
  var verify = opts.verify || false

  if (verify !== false && typeof verify !== 'function') {
    throw new TypeError('option verify must be function')
  }

  // create the appropriate type checking function
  var shouldParse = typeof type !== 'function'
    ? typeChecker(type)
    : type

  function parse (buf) {
    return buf
  }

  return function textParser (req, res, next) {
    if (req._body) {
      debug('body already parsed')
      next()
      return
    }

    req.body = req.body || {}

    // skip requests without bodies
    if (!typeis.hasBody(req)) {
      debug('skip empty body')
      next()
      return
    }

    debug('content-type %j', req.headers['content-type'])

    // determine if request should be parsed
    if (!shouldParse(req)) {
      debug('skip parsing')
      next()
      return
    }

    // get charset
    var charset = getCharset(req) || defaultCharset

    // read
    read(req, res, next, parse, debug, {
      encoding: charset,
      inflate: inflate,
      limit: limit,
      verify: verify
    })
  }
}
955916
function (nextText, transaction) {
    if (nextText !== this._currentElement) {
      this._currentElement = nextText;
      var nextStringText = '' + nextText;
      if (nextStringText !== this._stringText) {
        // TODO: Save this as pending props and use performUpdateIfNecessary
        // and/or updateComponent to do the actual update for consistency with
        // other component types?
        this._stringText = nextStringText;
        var commentNodes = this.getHostNode();
        DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
      }
    }
  }
823953
function(slide) {
		var d = {
			title: "",
			description: "",
			date: slide.getFormattedDate()
		};
		
		if (slide.data.text) {
			if (slide.data.text.headline) {
				d.title = slide.data.text.headline;
			}
		}

		this._update(d);
	}
1186806
function update (data) {
    this.bind()
    this.length = data.length
    this.byteLength = this.length * data.BYTES_PER_ELEMENT
    this.gl.bufferData(this.type, data, this.usage)
  }
77587
def update_text(self):
        
        self.write()
        try:
            newtext = self.text_queue.get_nowait()
            self._text = newtext
        except Empty:
            pass