explode attribute QNames to [LocalPart, prefix, URI] triples,
962712
def explode_attr_qnames(ns_stack, attrs)
      Hash[attrs.map do |name, value|
             uq_name = explode_qname(ns_stack, name, true)
             local_part, prefix, uri = uq_name
             if !prefix || prefix==""
               [local_part, value]
             else
               [uq_name, value]
             end
           end]
    end
365380
private function splitFieldNameAndPrefix($rawName)
    {
        $normalizedName = '';
        $prefix = '';

        if (!empty($rawName)) {
            if (strpos($rawName, CustomField::DEFAULT_PREFIX) === 0) {
                $normalizedName = substr($rawName, strlen(CustomField::DEFAULT_PREFIX));
                $prefix = CustomField::DEFAULT_PREFIX;
            } else {
                $normalizedName = $rawName;
            }
        }

        return [$normalizedName, $prefix];
    }
681098
function parseProps(attributes, prefix) {
  prefix += '-';

  const props = {};

  for (const prop in attributes) {
    // Strip 'inline-' and store
    if (prop.indexOf(prefix) == 0) {
      let value = attributes[prop];

      if (value === 'false') {
        value = false;
      }
      if (value === 'true') {
        value = true;
      }
      props[prop.slice(prefix.length)] = value;
    }
  }

  return props;
}
1321141
function stringify(schema) {
  var result = []
  var values
  var index
  var value
  var length

  if (schema && (schema.irregular || schema.regular)) {
    return schema.irregular || schema.regular
  }

  if (schema && schema.language) {
    result = result.concat(
      schema.language,
      schema.extendedLanguageSubtags || [],
      schema.script || [],
      schema.region || [],
      schema.variants || []
    )

    values = schema.extensions || []
    index = -1
    length = values.length

    while (++index < length) {
      value = values[index]

      if (
        value.singleton &&
        value.extensions &&
        value.extensions.length !== 0
      ) {
        result = result.concat(value.singleton, value.extensions)
      }
    }
  }

  if (schema && schema.privateuse && schema.privateuse.length !== 0) {
    result = result.concat('x', schema.privateuse)
  }

  return result.join('-')
}
717069
static function preparePrefixList( &$prefixList, $mimeList )
    {
        foreach ( $mimeList as $mimeName => $mimeData )
        {
            if ( is_array( $mimeData['prefixes'] ) )
            {
                foreach ( $mimeData['prefixes'] as $prefix )
                {
                    if ( !isset( $prefixList[$prefix] ) )
                        $prefixList[$prefix] = $mimeName;
                }
            }
        }
    }
815914
def get_prefixes(self, ns_uri):
        """"""
        ni = self.__lookup_uri(ns_uri)
        return ni.prefixes.copy()
1285439
public static String getLocalPart(String qname)
  {

    int index = qname.indexOf(':');

    return (index < 0) ? qname : qname.substring(index + 1);
  }
415471
def MoveToAttributeNs(self, localName, namespaceURI):
        
        ret = libxml2mod.xmlTextReaderMoveToAttributeNs(self._o, localName, namespaceURI)
        return ret
1269817
public static function qnameNS( $localName )
	{
		if ( ! isset( self::$qnames[ $localName ] ) )
		{
			self::$qnames[ $localName ] = qname( $localName, XBRL_Constants::$standardPrefixes );
		}
		return self::$qnames[ $localName ];
	}
1059175
def qurl(url, add=None, exclude=None, remove=None):
    
    urlp = list(urlparse(url))
    qp = parse_qsl(urlp[4])

    # Add parameters
    add = add if add else {}
    for name, value in add.items():
        if isinstance(value, (list, tuple)):
            # Append mode
            value = [smart_str(v) for v in value]
            qp = [p for p in qp if p[0] != name or p[1] not in value]
            qp.extend([(name, smart_str(val)) for val in value])
        else:
            # Set mode
            qp = [p for p in qp if p[0] != name]
            qp.append((name, smart_str(value)))

    # Exclude parameters
    exclude = exclude if exclude else {}
    for name, value in exclude.items():
        if not isinstance(value, (list, tuple)):
            value = [value]
        value = [smart_str(v) for v in value]
        qp = [p for p in qp if p[0] != name or p[1] not in value]

    # Remove parameters
    remove = remove if remove else []
    for name in remove:
        qp = [p for p in qp if p[0] != name]

    urlp[4] = urlencode(qp, True)
    return urlunparse(urlp)
1277209
function explode(sources) {
		var json,
			res = [];
		sources.forEach(function(source) {
			switch (path.extname(source)) {
				case '.json':
					json = grunt.file.readJSON(source);
					res.push.apply(
						res,
						json.map(function(filepath) {
							return path.dirname(source) + '/' + filepath;
						})
					);
					break;
				case '.js':
					res.push(source);
					break;
			}
		});
		return res;
	}
1276024
def __extend_uri(prefixes, short):
    
    for prefix in prefixes:
        if short.startswith(prefix):
            return short.replace(prefix + ':', prefixes[prefix])
    return short
752231
function explode ( filepaths ) {
		var json, res = [];
		filepaths.filter ( existence ).forEach ( function ( filepath ) {
			switch ( path.extname ( filepath )) {
				case ".json" :
					json = grunt.file.readJSON ( filepath );
					res.push.apply ( res, json.map ( function ( localpath ) {
						return path.dirname ( filepath ) + "/" + localpath;
					}));
					break;
				case ".js" :
					res.push ( filepath );
					break;
			}
		});
		return res;
	}
270
def to_local_name(acs, attr):
    
    for aconv in acs:
        lattr = aconv.from_format(attr)
        if lattr:
            return lattr

    return attr.friendly_name
1067382
def buffer_attributes_to_hash(attributes)
      '{' + attributes.inject([]) do |extend_map, (key, attribute)|
        extend_map << (
          ":\"#{key}\" => " + if key == :class
                                '[' + attribute.map do |exp|
                                  exp[@value]
                                end.join(', ') + ']'
                              else
                                attribute[@value]
                              end
        )
      end.join(', ') + '}'
    end
216806
function parseAttrs(str, pcex) {
  var
    list = [],
    match,
    k, v, t, e,
    DQ = '"'

  HTML_ATTR.lastIndex = 0

  str = str.replace(/\s+/g, ' ')

  while (match = HTML_ATTR.exec(str)) {

    // all attribute names are converted to lower case
    k = match[1].toLowerCase()
    v = match[2]

    if (!v) {
      list.push(k)          // boolean attribute without explicit value
    }
    else {
      // attribute values must be enclosed in double quotes
      if (v[0] !== DQ)
        v = DQ + (v[0] === "'" ? v.slice(1, -1) : v) + DQ

      if (k === 'type' && SPEC_TYPES.test(v)) {
        t = v
      }
      else {
        if (/\u0001\d/.test(v)) {
          // renames special attributes with expressiones in their value.
          if (k === 'value') e = 1
          else if (BOOL_ATTRS.test(k)) k = '__' + k
          else if (~RIOT_ATTRS.indexOf(k)) k = 'riot-' + k
        }
        // join the key-value pair, with no spaces between the parts
        list.push(k + '=' + v)
      }
    }
  }
  // update() will evaluate `type` after the value, avoiding warnings
  if (t) {
    if (e) t = DQ + pcex._bp[0] + "'" + v.slice(1, -1) + "'" + pcex._bp[1] + DQ
    list.push('type=' + t)
  }
  return list.join(' ')     // returns the attribute list
}
693174
function glob(str, prefix) {
        var globArr = str.split(',');
        var group = [];
        var s_reg;
        globArr.forEach(function(g) {
            if (g.length > 0) {
                s_reg = fis.util.glob(g, undefined, {nocase: true}).toString();
                //replace
                // '/^' => ''
                // '$/i' => ''
                s_reg = s_reg.substr(2, s_reg.length - 5);
                group.push(s_reg);
            }
        });
        prefix = prefix || '';
        if (prefix) {
            s_reg = fis.util.glob(prefix, undefined, {nocase: true}).toString();
            // '/^' => '', '%/i' => ''
            prefix = s_reg.substr(2, s_reg.length - 5);
        }
        return new RegExp('^'+ prefix + '(' + group.join('|') + ')$', 'i');
    }