Quote given document.
961222
def document_quote (document):
    """"""
    doc, query = urllib.splitquery(document)
    doc = url_quote_part(doc, '/=,')
    if query:
        return "%s?%s" % (doc, query)
    return doc
1120681
def _maybe_quote(val):
    ''''''
    assert isinstance(val, str), 'We should never set non-string values.'
    needs_quoting = False
    try:
        int(val)
        needs_quoting = True
    except Exception:
        pass
    try:
        float(val)
        needs_quoting = True
    except Exception:
        pass
    if needs_quoting:
        return '"{}"'.format(val)
    else:
        return val
642350
def process_quote(self, char):
        ''''''
        if char == self.inquote:
            # Quote is finished, switch to part processing.
            self.process_char = self.process_part
            return
        try:
            self.part.append(char)
        except:
            self.part = [ char ]
156236
def quote(self, text=None):
        
        text = text or re.sub(r'\[quote=.+?\[/quote\]', '',
                              self.text, flags=re.DOTALL
                              ).strip('\n')
        return f'[quote={self.author.id};{self.id}]{text}[/quote]'
416288
function(arr, quote){

			if(!Array.isArray(arr))
				arr = [arr.toString()];

			quote = quote === '"' ? '"' : '\'';

			return arr.map(function(n){ return '[' + quote + (n.toString()).replace(new RegExp(quote, 'g'), '\\' + quote) + quote + ']'; }).join('');
		}
1312413
function CurrentQuote() {
  const [quoteId] = useStore("quoteId")
  const [quoteLength] = useStore("quoteLengths", quoteId)

  return (
    <>
      <p>The following quote is {quoteLength} characters long:</p>
      <QuoteView quoteId={quoteId} />
    </>
  )
}
312270
def set_quoted_text(self, quoted_text):
        """"""
        self.quoted_text = quoted_text
        self.line_comment = False
        return self
1026890
def unquoted(cls, value, literal=False):
        """"""
        return cls(value, quotes=None, literal=literal)
1227851
def format_quote(sender, body):
    
    lines = wrap(body, 55).split('\n')
    for i, line in enumerate(lines):
        lines[i] = "> %s" % line
    quote = '\n'.join(lines)
    return ugettext(u"%(sender)s wrote:\n%(body)s") % {
        'sender': sender,
        'body': quote
    }
369042
function stringQuoteChar(atom) {
  var str = toString(valueOf(atom));
  var quoteChar;
  if(isQuotedString(value)) {
    quoteChar = value.charAt(0);
  }
  return quoteChar;
}
671801
def on_quote_changed(self, tiny_quote):
        """"""
        # TinyQuoteData
        data = tiny_quote
        str_log = "on_quote_changed symbol=%s open=%s high=%s close=%s low=%s" % (data.symbol, data.openPrice, data.highPrice, data.lastPrice, data.lowPrice)
        self.log(str_log)
470088
def _prepare_quote(quote, author, max_len=78):
    
    quote = quote.split(' ')
    max_len -= 6
    lines = []
    cur_line = []

    def _len(line):
        return sum(len(elt) for elt in line) + len(line) - 1
    while quote:
        if not cur_line or (_len(cur_line) + len(quote[0]) - 1 <= max_len):
            cur_line.append(quote.pop(0))
            continue
        lines.append('   | %s' % ' '.join(cur_line))
        cur_line = []
    if cur_line:
        lines.append('   | %s' % ' '.join(cur_line))
        cur_line = []
    lines.append('   | %s-- %s' % (" " * (max_len - len(author) - 5), author))
    return lines
107936
def coerce_quotes(quotes):
        """"""
        orig, quotes = quotes, str(quotes) if quotes else None
        if quotes not in [None, '"', "'"]:
            raise ValueError("{!r} is not a valid quote type".format(orig))
        return quotes
1330121
def GenQuotedState(self):
    """"""
    for i, q in enumerate(self.quot):
      label = "%s_STRING" % i
      escaped = re.escape(q)
      self._AddToken(label, escaped, "PopState", None)
      self._AddToken(label, q, "PopState", None)
      if self.ml_quote:
        self._AddToken(label, r"\n", None, None)
      else:
        self._AddToken(label, r"\n", "BadLine", None)
      self._AddToken(label, ".", "AddToField", None)
264943
static String quoteIfNeeded(String source) {
        String trimmed = source.trim();

        if (isObject(trimmed) || isArray(trimmed) || isString(trimmed)
            || isBoolean(trimmed) || isNull(trimmed)
            || isNumber(trimmed)) {
            return source;
        } else {
            return "\"" + source + "\"";
        }
    }
104673
def insert_one(self, document, **kwargs):
        
        self._arctic_lib.check_quota()
        return self._collection.insert_one(document, **kwargs)
1032055
def wrap(value):
    
    if isinstance(value, Document) or isinstance(value, DocumentList):
        return value
    elif isinstance(value, dict):
        return Document(value)
    elif isinstance(value, list):
        return DocumentList(value)
    else:
        return value