Converts the given attribute to an string value.
542585
public static Optional<String> asStringValue(Attribute a) {
    class Visitor extends SimpleAnnotationValueVisitor8<String, Void> {
      @Override
      public String visitString(String s, Void unused) {
        return s;
      }
    }
    return Optional.ofNullable(a.accept(new Visitor(), null));
  }
710658
function makeAttributesString(node, profile) {
		var attrQuote = profile.attributeQuote();
		var cursor = profile.cursor();
		
		return node.attributeList().map(function(a) {
			var isBoolean = profile.isBoolean(a.name, a.value);
			var attrName = profile.attributeName(a.name);
			var attrValue = isBoolean ? attrName : a.value;
			if (isBoolean && profile.allowCompactBoolean()) {
				return ' ' + attrName;
			}
			return ' ' + attrName + '=' + attrQuote + (attrValue || cursor) + attrQuote;
		}).join('');
	}
640734
@Api
	public void getValue(String name, StringAttribute attribute) {
		attribute.setValue((String) formWidget.getValue(name));
	}
996776
function _getAttribute(attribute) {
    if (is_string(_attributes[attribute])) {
      return _attributes[attribute];
    }

    if ((line = _translator.trans(attribute)) !== attribute) {
      return line;
    } else {
      return attribute.replace('_', ' ');
    }
  }
981278
def Encode(self, attribute, value):
    """"""
    required_type = self._attribute_types.get(attribute, "bytes")

    if required_type == "integer":
      return rdf_structs.SignedVarintEncode(int(value))
    elif required_type == "unsigned_integer":
      return rdf_structs.VarintEncode(int(value))
    elif hasattr(value, "SerializeToString"):
      return value.SerializeToString()
    elif isinstance(value, bytes):
      return value
    elif isinstance(value, Text):
      return value.encode("utf-8")
    else:
      return str(value).encode("utf-8")
214105
function (node, attribute) {
    switch (attribute.name) {
      case 'style':
        return this._getStyleAttribute(attribute.value);
      default:
        var tagName = jsxTagName(node.tagName);
        var name =
          (ELEMENT_ATTRIBUTE_MAPPING[tagName] &&
            ELEMENT_ATTRIBUTE_MAPPING[tagName][attribute.name]) ||
          ATTRIBUTE_MAPPING[attribute.name] ||
          attribute.name;
        var result = name;

        // Numeric values should be output as {123} not "123"
        if (isNumeric(attribute.value)) {
          result += '={' + attribute.value + '}';
        } else if (attribute.value.length > 0) {
          result += '="' + attribute.value.replace(/"/gm, '&quot;') + '"';
        }
        return result;
    }
  }
687142
public JcString stringAtttribute(String name) {
		if (this.delegate != null)
			return this.delegate.stringAtttribute(name);
		JcString ret = checkField_getJcVal(name, JcString.class);
		QueryRecorder.recordInvocationReplace(this, ret, "stringAtttribute");
		return ret;
	}
609539
def _attributeStr(self, name):
        
        return "{}={}".format(
            _encodeAttr(name),
            ",".join([_encodeAttr(v) for v in self.attributes[name]]))
738651
public void setStringAttribute(String name, String value) {
		ensureAttributes();
		Attribute attribute = new StringAttribute(value);
		attribute.setEditable(isEditable(name));
		getAllAttributes().put(name, attribute);

	}
869897
private static int convertAttributeToInt(final String attribute) {
        if (attribute == null) {
            return 0;
        }

        try {
            return Integer.parseInt(attribute);
        } catch (final Exception ignore) {
            return 0;
        }
    }
1309008
public static String encodeXmlAttribute(String str) {
    if (str == null) return null;
    int len = str.length();
    if (len == 0) return str;
    StringBuffer encoded = new StringBuffer();
    for (int i = 0; i < len; i++) {
      char c = str.charAt(i);
      if (c == '<') encoded.append("&lt;");
      else if (c == '\"') encoded.append("&quot;");
      else if (c == '>') encoded.append("&gt;");
      else if (c == '\'') encoded.append("&apos;");
      else if (c == '&') encoded.append("&amp;");
      else encoded.append(c);
    }
    return encoded.toString();
  }
1356870
def _convert_attribute_to_tag(key, attr):
    """"""
    if isinstance(attr, bool):
        return jaeger.Tag(
            key=key,
            vBool=attr,
            vType=jaeger.TagType.BOOL)
    if isinstance(attr, str):
        return jaeger.Tag(
            key=key,
            vStr=attr,
            vType=jaeger.TagType.STRING)
    if isinstance(attr, int):
        return jaeger.Tag(
            key=key,
            vLong=attr,
            vType=jaeger.TagType.LONG)
    if isinstance(attr, float):
        return jaeger.Tag(
            key=key,
            vDouble=attr,
            vType=jaeger.TagType.DOUBLE)
    logging.warn('Could not serialize attribute \
            {}:{} to tag'.format(key, attr))
    return None
828515
private String readAttributeAsString(Attribute attribute) throws UnsupportedKerasConfigurationException {
        synchronized (Hdf5Archive.LOCK_OBJECT) {
            VarLenType vl = attribute.getVarLenType();
            int bufferSizeMult = 1;
            String s = null;
            /* TODO: find a less hacky way to do this.
             * Reading variable length strings (from attributes) is a giant
             * pain. There does not appear to be any way to determine the
             * length of the string in advance, so we use a hack: choose a
             * buffer size and read the config, increase buffer and repeat
             * until the buffer ends with \u0000
             */
            while (true) {
                byte[] attrBuffer = new byte[bufferSizeMult * 2000];
                BytePointer attrPointer = new BytePointer(attrBuffer);
                attribute.read(vl, attrPointer);
                attrPointer.get(attrBuffer);
                s = new String(attrBuffer);

                if (s.endsWith("\u0000")) {
                    s = s.replace("\u0000", "");
                    break;
                }

                bufferSizeMult++;
                if (bufferSizeMult > 1000) {
                    throw new UnsupportedKerasConfigurationException("Could not read abnormally long HDF5 attribute");
                }
            }
            vl.deallocate();
            return s;
        }
    }
397236
function attributesToString(obj, prevObj, level) {
            var attrs = '',
                prefix,
                tab;
            level = level || 1;
            tab = getTabs(level, true);
            _.forEach(obj, function (v, k) {
                if(excludeAttrs.indexOf(k) === -1){
                    var prev = prevObj && prevObj[k] !== undefined ? prevObj[k] : undefined;
                    prefix = attrs.length ? ',\n' : '';
                    if(_.isPlainObject(v)){
                        var subAttr = attributesToString(v, prev, level +1);
                        if(subAttr && subAttr.length)
                            attrs += (prefix + tab + k + ': {\n' + subAttr + '\n' + tab + '}');
                    } else {
                        if(prev !== v){
                            var val = k === 'type' ? 'types.' + v : v;
                            if(_.isArray(val))
                                val = arrayToString(val);
                            if(_.isFunction(val)){
                                val = funcToString(val.toString(), 2);
                            }
                            attrs += (prefix + tab + k + ': ' + val);
                        }
                    }
                }
            });

            return attrs;
        }
801787
private String getValue(String attribute)
    {
        Check.notNull(attribute);

        if (root.hasAttribute(attribute))
        {
            return root.getAttribute(attribute);
        }
        throw new LionEngineException(ERROR_ATTRIBUTE + attribute);
    }
29736
public String getAttributeValue(String name) {
        Attr att = node.getAttributeNode(name);
        if (att == null) return null;
        return att.getNodeValue();
    }
672210
private Object convertStringToSingleValue(String rawValue, ExtendedAttributeDefinition attrDef, EvaluationContext context,
                                              boolean ignoreWarnings) throws ConfigEvaluatorException {
        String value = processString(rawValue, attrDef, context, ignoreWarnings);
        return evaluateString(value, attrDef, context);
    }