Replaces the contents of this info object with the contents of ``mathInfo``.

            >>> font.fromMathInfo(mg)

        ``mathInfo`` must be an object following the
        `MathInfo protocol <https://github.com/typesupply/fontMath>`_.
189283
def fromMathInfo(self, mathInfo, guidelines=True):
        
        return self._fromMathInfo(mathInfo, guidelines=guidelines)
73940
def from_string(cls, value):
        """"""
        match = cls.pattern.search(value)
        if match is None:
            raise ValueError('"%s" is not a valid media type' % value)
        try:
            return cls(match.group('mime_type'), float(match.group('weight') or 1))
        except ValueError:
            return cls(value)
642343
def _replace_tex_math(node, mml_url, mc_client=None, retry=0):
    """"""

    math = node.attrib['data-math'] or node.text
    if math is None:
        return None

    eq = {}
    if mc_client:
        math_key = hashlib.md5(math.encode('utf-8')).hexdigest()
        eq = json.loads(mc_client.get(math_key) or '{}')

    if not eq:
        res = requests.post(mml_url, {'math': math.encode('utf-8'),
                                      'mathType': 'TeX',
                                      'mml': 'true'})
        if res:  # Non-error response from requests
            eq = res.json()
            if mc_client:
                mc_client.set(math_key, res.text)

    if 'components' in eq and len(eq['components']) > 0:
        for component in eq['components']:
            if component['format'] == 'mml':
                mml = etree.fromstring(component['source'])
        if node.tag.endswith('span'):
            mml.set('display', 'inline')
        elif node.tag.endswith('div'):
            mml.set('display', 'block')
        mml.tail = node.tail
        return mml
    else:
        logger.warning('Retrying math TeX conversion: '
                       '{}'.format(json.dumps(eq, indent=4)))
        retry += 1
        if retry < 2:
            return _replace_tex_math(node, mml_url, mc_client, retry)

    return None
1372616
public void setInfo(String text)
  {
    if (text != null && text.length() > 0)
    {
      String prefix = "Result for: <span class=\"" + Helper.CORPUS_FONT_FORCE + "\">";
      lblInfo.setDescription(prefix + text.replaceAll("\n", " ") + "</span>");
      lblInfo.setValue(text.length() < 50 ? prefix + StringEscapeUtils.
        escapeHtml4(text.substring(0, text.length())) : prefix + StringEscapeUtils.
        escapeHtml4(text.substring(0, 50)) + " ... </span>");
    }
  }
577235
def info_pair(label, value)
      value = content_tag(:span, "None", :class => "blank") if value.blank?
      label = content_tag(:span, "#{label}:", :class => "label")
      content_tag(:span, [label, value].join(" "), :class => "info_pair")
    end
468912
def typeinfo_to_ctypes(info, return_value=False):
    

    tag = info.tag.value
    ptr = info.is_pointer

    mapping = {
        GITypeTag.BOOLEAN: gboolean,
        GITypeTag.INT8: gint8,
        GITypeTag.UINT8: guint8,
        GITypeTag.INT16: gint16,
        GITypeTag.UINT16: guint16,
        GITypeTag.INT32: gint32,
        GITypeTag.UINT32: guint32,
        GITypeTag.INT64: gint64,
        GITypeTag.UINT64: guint64,
        GITypeTag.FLOAT: gfloat,
        GITypeTag.DOUBLE: gdouble,
        GITypeTag.VOID: None,
        GITypeTag.GTYPE: GType,
        GITypeTag.UNICHAR: gunichar,
    }

    if ptr:
        if tag == GITypeTag.INTERFACE:
            return gpointer
        elif tag in (GITypeTag.UTF8, GITypeTag.FILENAME):
            if return_value:
                # ctypes does auto conversion to str and gives us no chance
                # to free the pointer if transfer=everything
                return gpointer
            else:
                return gchar_p
        elif tag == GITypeTag.ARRAY:
            return gpointer
        elif tag == GITypeTag.ERROR:
            return GErrorPtr
        elif tag == GITypeTag.GLIST:
            return GListPtr
        elif tag == GITypeTag.GSLIST:
            return GSListPtr
        else:
            if tag in mapping:
                return ctypes.POINTER(mapping[tag])
    else:
        if tag == GITypeTag.INTERFACE:
            iface = info.get_interface()
            iface_type = iface.type.value
            if iface_type == GIInfoType.ENUM:
                return guint32
            elif iface_type == GIInfoType.OBJECT:
                return gpointer
            elif iface_type == GIInfoType.STRUCT:
                return gpointer
            elif iface_type == GIInfoType.UNION:
                return gpointer
            elif iface_type == GIInfoType.FLAGS:
                return guint
            elif iface_type == GIInfoType.CALLBACK:
                return GCallback

            raise NotImplementedError(
                "Could not convert interface: %r to ctypes type" % iface.type)
        else:
            if tag in mapping:
                return mapping[tag]

    raise NotImplementedError("Could not convert %r to ctypes type" % info.tag)
412948
function spellingFix(content, fontType){
  if (!content) {
    if (!globalOptions.isSilentMode()) console.warn('Content must be specified on knayi.spellingFix.');
    return '';
  }

	if (content === '' || !mmCharacterRange.test(content))
		return content;

	if (!fontType)
		fontType = fontDetect(content);

	content = content.trim().replace(/\u200B/g, '');

	switch (fontType) {
		case 'zawgyi':
			for (var i = 0; i < library.spellingFix.zawgyi.length; i++) {
				var rule = library.spellingFix.zawgyi[i];
				content = content.replace(rule[0], rule[1]);
			}
			return content;
		case 'unicode':
		default:
			for (var i = 0; i < library.spellingFix.unicode.length; i++) {
				var rule = library.spellingFix.unicode[i];
				content = content.replace(rule[0], rule[1]);
			}
			return content;
	}
}
310147
def _interpolate(self, factor, minInfo, maxInfo, round=True, suppressError=True):
        
        minInfo = minInfo._toMathInfo()
        maxInfo = maxInfo._toMathInfo()
        result = interpolate(minInfo, maxInfo, factor)
        if result is None and not suppressError:
            raise FontPartsError(("Info from font '%s' and font '%s' could not be "
                                  "interpolated.")
                                 % (minInfo.font.name, maxInfo.font.name))
        if round:
            result = result.round()
        self._fromMathInfo(result)
517436
def make_tensor_value_info(
        name,  # type: Text
        elem_type,  # type: int
        shape,  # type: Optional[Sequence[Union[Text, int]]]
        doc_string="",  # type: Text
        shape_denotation=None,  # type: Optional[List[Text]]
):  # type: (...) -> ValueInfoProto
    """"""
    value_info_proto = ValueInfoProto()
    value_info_proto.name = name
    if doc_string:
        value_info_proto.doc_string = doc_string

    tensor_type_proto = value_info_proto.type.tensor_type
    tensor_type_proto.elem_type = elem_type

    tensor_shape_proto = tensor_type_proto.shape

    if shape is not None:
        # You might think this is a no-op (extending a normal Python
        # list by [] certainly is), but protobuf lists work a little
        # differently; if a field is never set, it is omitted from the
        # resulting protobuf; a list that is explicitly set to be
        # empty will get an (empty) entry in the protobuf. This
        # difference is visible to our consumers, so make sure we emit
        # an empty shape!
        tensor_shape_proto.dim.extend([])

        if shape_denotation:
            if len(shape_denotation) != len(shape):
                raise ValueError(
                    'Invalid shape_denotation. '
                    'Must be of the same length as shape.')

        for i, d in enumerate(shape):
            dim = tensor_shape_proto.dim.add()
            if d is None:
                pass
            elif isinstance(d, integer_types):
                dim.dim_value = d
            elif isinstance(d, text_type):
                dim.dim_param = d
            else:
                raise ValueError(
                    'Invalid item in shape: {}. '
                    'Needs to of integer_types or text_type.'.format(d))

            if shape_denotation:
                dim.denotation = shape_denotation[i]

    return value_info_proto
292301
function ToUpgradeResInfo(str){
    let ls = str.split(',');
    if(ls.length >= 4){
        return {type:parseInt(ls[0]), id: parseInt(ls[1]), num:parseInt(ls[2]), step:parseInt(ls[3])};
    }
    else if(ls.length >= 3){
        return {type:parseInt(ls[0]), id: parseInt(ls[1]), num:parseInt(ls[2])};
    }
}
806655
function (info) { return Object.keys(info).reduce(function (escaped, key) {
      var ref = info.__dangerouslyDisableSanitizers;
      var isDisabled = ref && ref.indexOf(key) > -1;
      var val = info[key];
      escaped[key] = val;
      if (key === '__dangerouslyDisableSanitizers') {
        return escaped
      }
      if (!isDisabled) {
        if (typeof val === 'string') {
          escaped[key] = escapeHTML(val);
        } else if (index$2$1(val)) {
          escaped[key] = escape(val);
        } else if (isArray(val)) {
          escaped[key] = val.map(escape);
        } else {
          escaped[key] = val;
        }
      } else {
        escaped[key] = val;
      }

      return escaped
    }, {}); }
160407
public void append(SimpleTypeInformation<?> meta, Object data) {
    this.meta.add(meta);
    this.contents.add(data);
  }
1013511
def build_from_info(cls, info):
        
        terms = []
        for term_info in info['terms']:
            terms.append(SplineTerm.build_from_info(term_info))
        return cls(*terms)
74587
function getMetaInfo(expr, grammarInterval) {
  var metaInfo = {};
  if (expr.source && grammarInterval) {
    var adjusted = expr.source.relativeTo(grammarInterval);
    metaInfo.sourceInterval = [adjusted.startIdx, adjusted.endIdx];
  }
  return metaInfo;
}
1190479
def put(type, info)
    path, info = type_info(type, :path), force_case(info)
    ida = type == :client ? 'client_id' : 'id'
    raise ArgumentError, "info must include #{ida}" unless id = info[ida]
   hdrs = headers
    if info && info['meta'] && (etag = info['meta']['version'])
      hdrs.merge!('if-match' => etag)
    end
    reply = json_parse_reply(@key_style,
        *json_put(@target, "#{path}/#{URI.encode(id)}", info, hdrs))

    # hide client endpoints that are not quite scim compatible
    type == :client && !reply ? get(type, info['client_id']): reply
  end
832750
def replace_content(content, project_vars):
    

    for k, v in project_vars.items():
        content = content.replace(f'__{k}__', v)

    return content
1012512
function _regExpOrGTFO(expr){
  var exp;

  if(typeof expr === 'string'){
    exp = new RegExp('^'+expr+'$');
  } else if (expr instanceof RegExp){
    exp = expr;
  } else {
    throw new Error('Needle must be either a string or a RegExp');
  }

  return exp;
}