/* Gets a value from the "multi-tag". Codes look like ?20 - a value goes until
the next value-code or until end of data
555616
public static String getMultiTagValue(String st, String tag) {
        String ret = null;
        int pos = st.indexOf("?" + tag);

        if (pos != -1) {
            // first possible endpos
            int searchpos = pos + 3;
            int endpos = -1;

            while (true) {
                // search for start of next value-code
                endpos = st.indexOf("?", searchpos);

                // check if this is REALLY a value-code
                if (endpos != -1 && endpos + 2 < st.length()) {
                    /* "?" is far enough before end to make it possible
                     * to be followed by two digits */

                    if (st.charAt(endpos + 1) >= '0' && st.charAt(endpos + 1) <= '9' &&
                        st.charAt(endpos + 2) >= '0' && st.charAt(endpos + 2) <= '9') {
                        /* the "?" must be followed by two digits, a single "?"
                         *  does NOT mark the end of value */
                        break;
                    }
                } else {
                    /* the "?" is near the end of the string, so we break out
                     * here und use the complete string as value */
                    endpos = -1;
                    break;
                }

                // start search for the next "?" after the current, wrong one
                searchpos = endpos + 1;
            }

            if (endpos == -1)
                endpos = st.length();

            ret = st.substring(pos + 3, endpos);
        }

        return ret;
    }
541128
function getTag(val) {
  const tag = Object.prototype.toString.call(val).slice(8, -1)

  if (basicTypes.includes(tag.toLowerCase())) {
    return tag.toLowerCase()
  }

  return tag
}
176328
function getValueAt(dataObject, path)
    {
        if (_.isUndefined(dataObject)) {
            return undefined;
        }
        if (!_.isString(path)) {
            return dataObject;
        }

        var tokens   = path.split('.');
        var property = tokens[0];
        var subpath  = tokens.slice(1).join('.');
        var data     = dataObject[property];

        if (tokens.length > 1 && !_.isUndefined(data))
        {
            return getValueAt(data, subpath);
        } else {
            return data;
        }
    }
495547
def get_fl_value(tag):
    
    if tag.VR == 'OB' or tag.VR == 'UN':
        value = struct.unpack('f', tag.value)[0]
        return value
    return tag.value
1185112
function readNumericString(s, minValue) {
    var length = readLength(s);
    length = (length + minValue + 1) / 2;
    s.readPadding(length);
}
943743
public static String getValueFromElement(Element element, String tagName) {
        NodeList elementNodeList = element.getElementsByTagName(tagName);
        if (elementNodeList == null) {
            return "";
        } else {
            Element tagElement = (Element) elementNodeList.item(0);
            if (tagElement == null) {
                return "";
            }

            NodeList tagNodeList = tagElement.getChildNodes();
            if (tagNodeList == null || tagNodeList.getLength() == 0) {
                return "";
            }
            return tagNodeList.item(0).getNodeValue();
        }
    }
1201093
function(str) {
    var tag = /#([a-z]+)\{|\}/,
        cstack = [],
        matches = null,
        orig = null,
        name = null,
        code = null;

    while (tag.test(str)) {
        matches = tag.exec(str);
        orig = matches[0];

        if (console.isColored()) {
            if (orig === '}') {
                cstack.pop();
            } else {
                name = matches[1];
                if (name in _ANSICODES) {
                    code = _ANSICODES[name];
                    cstack.push(code);
                }
            }

            str = str.replace(orig, _ANSICODES.reset + cstack.join(''));
        } else {
            str = str.replace(orig, '');
        }
    }
    return str;
}
230533
private Object getValuePopulatedWithTags(final String originalTag, final String stringValue)
    {
        // See if the value is a surrogate key in the tag parser's map that was placed there during preprocessing,
        // and if so, unpack the values retrieved via the key and use those to populate the field
        final Object value = constructFromString(stringValue, getLongName());

        if (TaggedArgument.class.isAssignableFrom(getUnderlyingFieldClass())) {
            // NOTE: this propagates the tag name/attributes to the field BEFORE the value is set
            TaggedArgument taggedArgument = (TaggedArgument) value;
            TaggedArgumentParser.populateArgumentTags(
                    taggedArgument,
                    getLongName(),
                    originalTag);
        } else if (originalTag != null) {
            // a tag was found for a non-taggable argument
            throw new CommandLineException(
                    String.format("The argument: \"%s/%s\" does not accept tags: \"%s\"",
                            getShortName(),
                            getFullName(),
                            originalTag));
        }
        return value;
    }
347451
public int readTag() throws IOException
    {
        if (offset == limit)
        {
            lastTag = 0;
            return 0;
        }

        final int tag = readRawVarint32();
        if (tag >>> WireFormat.TAG_TYPE_BITS == 0)
        {
            // If we actually read zero, that's not a valid tag.
            throw ProtobufException.invalidTag();
        }
        lastTag = tag;
        return tag;
    }
789082
private void parseValue(byte[] data, CookieData token) {

        int start = -1;
        int stop = -1;
        int pos = this.bytePosition;
        int num_quotes = 0;

        // cycle through each byte until we hit a delimiter or end of data
        for (; pos < data.length; pos++) {
            byte b = data[pos];

            // check for delimiter
            if (';' == b) {
                break;
            }

            // check for quotes
            if ('"' == b) {
                num_quotes++;
            }

            // Commas should not be treated as delimiters when they are
            // part of the Expires attribute
            if (',' == b) {
                // Port="80,8080" is valid
                if (CookieData.cookiePort.equals(token)) {
                    if (2 <= num_quotes) {
                        // this comma is after the quoted port string
                        break;
                    }
                } else if (!CookieData.cookieExpires.equals(token)) {
                    break;
                }
            }

            // ignore white space
            if (' ' != b && '\t' != b) {
                if (-1 == start) {
                    start = pos;
                }
                stop = pos;
            }
        }

        // save where we stopped
        this.bytePosition = pos + 1;

        // check the output parameters
        if (-1 == start) {
            this.value = new byte[0];
            return;
        }
        if (-1 == stop) {
            this.value = new byte[0];
            return;
        }

        // filter out any surrounding quotes
        if ('"' == data[start] && '"' == data[stop]) {
            start++;
            stop--;
        }

        // Retrieve the cookie attribute value
        int len = stop - start + 1;
        if (0 <= len) {
            this.value = new byte[len];
            if (0 < len) {
                System.arraycopy(data, start, this.value, 0, len);
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "value: " + GenericUtils.nullOutPasswords(this.value, (byte) '&'));
                }
            }
        }
    }
256730
public static long current(Context context, String tag) {
        Long appRxValue = sReceivedBytes.get(tag);
        Long appTxValue = sSendBytes.get(tag);
        if (appRxValue == null || appTxValue == null) {
            if (DEBUG) {
                LogUtils.w(TAG, "current() appRxValue or appTxValue is null.");
            }
            return 0;
        }
        final int uid = getUid(context);
        long appRxValue2 = TrafficStats.getUidRxBytes(uid);
        long appTxValue2 = TrafficStats.getUidTxBytes(uid);
        long rxValue = appRxValue2 - appRxValue;
        long txValue = appTxValue2 - appTxValue;
        if (DEBUG) {
            LogUtils.v(TAG, "current() rxValue=" + rxValue / 1000 + " txValue=" + txValue / 1000 + " uid=" + uid);
        }
        return rxValue;

    }
850657
def get_ss_value(tag):
    
    # data is int formatted as string so convert te string first and cast to int
    if tag.VR == 'OB' or tag.VR == 'UN':
        value = struct.unpack('h', tag.value)[0]
        return value
    return tag.value
628485
function decodeTag(s, tag) {
	var nextTag = new type.UInt8().read(s).value;
	if (tag.tagNumber > 30) {
		nextTagNumber = new type.UInt8().read(s).value;
	}
	else {
		nextTagNumber = nextTag & 0x1F;
	}
	
	return ((nextTag & 0xE0) === (tag.tagClass | tag.tagFormat)) && (nextTagNumber === tag.tagNumber);
}
1154644
function getValue(entry, tagName) {
  var parsed = entry.parsed,
      result = parsed.description,
      tag = getTag(entry, tagName);

  if (tagName == 'alias') {
    result = _.get(tag, 'name') ;

    // Doctrine can't parse alias tags containing multiple values so extract
    // them from the error message.
    var error = _.first(_.get(tag, 'errors'));
    if (error) {
      result += error.replace(/^[^']*'|'[^']*$/g, '');
    }
  }
  else if (tagName == 'type') {
    result = _.get(tag, 'type.name');
  }
  else if (tagName != 'description') {
    result = _.get(tag, 'name') || _.get(tag, 'description');
  }
  return tagName == 'example'
    ? _.toString(result)
    : util.format(result);
}
635922
def tagged(self, tag, offset=0, count=25):
        ''''''
        return json.loads(self.client('tag', 'get', tag, offset, count))
848329
function (char) {
                var
                    newState,
                    tagsOpened = 0 < this._openedTags.length;
                if ("#" === char) {
                    this._hLevel = 1;
                    newState = this._parseTitle;
                } else if ("*" === char || "0" <= char && "9" >= char ) {
                    if (char !== "*") {
                        this._numericList = 1;
                    } else {
                        this._numericList = 0;
                    }
                    newState = this._parseList;
                    tagsOpened = false; // Wait for disambiguation
                } else if (" " !== char && "\t" !== char && "\n" !== char) {
                    if (tagsOpened) {
                        this._output(" ");
                        tagsOpened = false; // Avoid closing below
                    } else {
                        this._openTag("p");
                    }
                    newState = this._parseContent(char);
                    if (!newState) {
                        newState = this._parseContent;
                    }
                }
                if (tagsOpened) {
                    this._closeTags();
                }
                return newState;
            }
1206610
protected String getValue(Element base, String tag) {

	    Element element = null;
		String result = "";
		try {
			// ZAP: Removed unnecessary cast.
			element = getElement(base, tag);
			result = getText(element);
		} catch (Exception e) {
		}
		return result;
	    
	}