Returns a SoyMsgRawTextPart representing the specified raw text string.
423026
public static SoyMsgRawTextPart of(String rawText) {
    int utf8Length = Utf8.encodedLength(rawText);

    // Determine whether UTF8 or UTF16 uses less memory, and choose between one of the two internal
    // implementations. char[] is preferred if the sizes are equal because it is faster to turn
    // back into a String. In a realistic application with 1 million messages in memory, using
    // UTF-8 saves about 35M, and dynamicaly switching encodings saves another 10M.

    // IMPORTANT! This choice is deterministic, so that for any particular input string the choice
    // of implementation class is the same. This ensures operations like equals() and hashCode()
    // do not have to decode the contents.

    if (utf8Length < rawText.length() * BYTES_PER_CHAR) {
      return new Utf8SoyMsgRawTextPart(rawText);
    } else {
      return new CharArraySoyMsgRawTextPart(rawText);
    }
  }
32385
def _text_to_graphiz(self, text):
        """"""
        dot = Source(text, format='svg')
        return dot.pipe().decode('utf-8')
1230011
public static String toCell(String text)
	{
		return new StringBuilder("\"")
				.append(format(text))
				.append("\"").toString();
	}
78961
public static String readTextAsString(DataInput in) throws IOException {
    int bufLen = (int)readVLong(in);
    byte[] buf = new byte[bufLen];
    in.readFully(buf);

    return new String(buf, StandardCharsets.UTF_8);
  }
1115872
public QRSCT text(String text) {
		if (text != null && text.length() <= 140) {
			this.reference = ""; //$NON-NLS-1$
			this.text = checkValidSigns(text);
			return this;
		}
		throw new IllegalArgumentException("supplied text [" + text //$NON-NLS-1$
				+ "] not valid: has to be not null and of max length 140"); //$NON-NLS-1$
	}
946556
@Pure
	public static String toHTML(String text) {
		if (text == null) {
			return null;
		}
		final Map<Character, String> transTbl = getJavaToHTMLTranslationTable();
		assert transTbl != null;
		if (transTbl.isEmpty()) {
			return text;
		}
		final StringBuilder patternStr = new StringBuilder();
		for (final Character c : transTbl.keySet()) {
			if (patternStr.length() > 0) {
				patternStr.append("|"); //$NON-NLS-1$
			}
			patternStr.append(Pattern.quote(c.toString()));
		}
		final Pattern pattern = Pattern.compile(patternStr.toString());
		final Matcher matcher = pattern.matcher(text);
		final StringBuilder result = new StringBuilder();
		String character;
		String entity;
		int lastIndex = 0;
		while (matcher.find()) {
			final int idx = matcher.start();
			result.append(text.substring(lastIndex, idx));
			lastIndex = matcher.end();
			character = matcher.group();
			if (character.length() == 1) {
				entity = transTbl.get(Character.valueOf(character.charAt(0)));
				if (entity != null) {
					entity = "&" + entity + ";"; //$NON-NLS-1$ //$NON-NLS-2$
				} else {
					entity = character;
				}
			} else {
				entity = character;
			}
			result.append(entity);
		}
		if (lastIndex < text.length()) {
			result.append(text.substring(lastIndex));
		}
		return result.toString();
	}
563322
def from_yang(self, text: str) -> Optional[QualName]:
        """"""
        try:
            return self.sctx.schema_data.translate_pname(text, self.sctx.text_mid)
        except (ModuleNotRegistered, UnknownPrefix):
            raise InvalidArgument(text)
824693
function runSpanGamut(text) {

        text = doCodeSpans(text);
        text = escapeSpecialCharsWithinTagAttributes(text);
        text = encodeBackslashEscapes(text);

        text = doImages(text);
        text = doAnchors(text);

        text = doAutoLinks(text);
        text = encodeAmpsAndAngles(text);
        text = doItalicsAndBold(text);

        text = text.replace(/  +\n/g," <br />\n");

        return text;
    }
612497
public static String getAt(GString text, Range range) {
        return getAt(text.toString(), range);
    }
672068
public DateTimeFormatterBuilder appendLiteral(String text) {
        if (text == null) {
            throw new IllegalArgumentException("Literal must not be null");
        }
        switch (text.length()) {
            case 0:
                return this;
            case 1:
                return append0(new CharacterLiteral(text.charAt(0)));
            default:
                return append0(new StringLiteral(text));
        }
    }
861516
private void  extractRawText(TextContainer parent, StringBuilder str)
   {
      Iterator<SvgObject>  iter = parent.children.iterator();
      boolean              isFirstChild = true;

      while (iter.hasNext())
      {
         SvgObject  child = iter.next();

         if (child instanceof TextContainer) {
            extractRawText((TextContainer) child, str);
         } else if (child instanceof TextSequence) {
            str.append(textXMLSpaceTransform(((TextSequence) child).text, isFirstChild, !iter.hasNext() /*isLastChild*/));
         }
         isFirstChild = false;
      }
   }
1042394
def fmt_content(text, width = 0, align = '<', padding = None, padding_left = None, padding_right = None, padding_char = ' '):
        
        if padding_left is None:
            padding_left = padding
        if padding_right is None:
            padding_right = padding
        if padding_left is not None:
            text = '{}{}'.format(str(padding_char)[0] * int(padding_left), text)
        if padding_right is not None:
            text = '{}{}'.format(text, str(padding_char)[0] * int(padding_right))
        if width:
            strptrn = '{:' + ('{}{}{}'.format(str(padding_char)[0], str(TEXT_ALIGNMENT[align]), str(width))) + 's}'
            text = strptrn.format(text)
        return text
1159822
def raw_comment(self):
        """"""
        r = conf.lib.clang_Cursor_getRawCommentText(self)
        if not r:
            return None
        return str(r)
802637
def format(self, text, width=78, indent=4):
        """"""
        return textwrap.fill(
            text,
            width=width,
            initial_indent=' ' * indent,
            subsequent_indent=' ' * indent,
        )
807126
def text(self,text):
        
        if text:
            text = utfstr(text)
            text = text.strip()
            text = re.sub('\s+',' ',text)
            if text:
                self.dirty = True
                self.escpos.text(text)
852941
public String getRawBodyAsString() {
        if (raw == null) {
            return null;
        }
        return raw.toString(Charsets.UTF_8.displayName());
    }
130364
public static Content content(String somePlainText) {
		Content c = null;
		try {
			c = new Content("text/plain; charset=UTF-8", somePlainText.getBytes("UTF-8"));
		} catch (UnsupportedEncodingException e) { /* UTF-8 is never unsupported */
		}
		return c;
	}