Parse the given type @returns: {} containing the type itself, memory usage and (including size and subArray if applicable)
971011
function parseType (type) {
  var size
  var ret
  if (isArray(type)) {
    size = parseTypeArray(type)
    var subArray = type.slice(0, type.lastIndexOf('['))
    subArray = parseType(subArray)
    ret = {
      isArray: true,
      name: type,
      size: size,
      memoryUsage: size === 'dynamic' ? 32 : subArray.memoryUsage * size,
      subArray: subArray
    }
    return ret
  } else {
    var rawType
    switch (type) {
      case 'address':
        rawType = 'uint160'
        break
      case 'bool':
        rawType = 'uint8'
        break
      case 'string':
        rawType = 'bytes'
        break
    }
    ret = {
      rawType: rawType,
      name: type,
      memoryUsage: 32
    }

    if ((type.startsWith('bytes') && type !== 'bytes') || type.startsWith('uint') || type.startsWith('int')) {
      ret.size = parseTypeN(type)
    } else if (type.startsWith('ufixed') || type.startsWith('fixed')) {
      ret.size = parseTypeNxM(type)
    }

    if (type.startsWith('bytes') && type !== 'bytes' && (ret.size < 1 || ret.size > 32)) {
      throw new Error('Invalid bytes<N> width: ' + ret.size)
    }
    if ((type.startsWith('uint') || type.startsWith('int')) && (ret.size % 8 || ret.size < 8 || ret.size > 256)) {
      throw new Error('Invalid int/uint<N> width: ' + ret.size)
    }
    return ret
  }
}
394469
def get_type_spec_size(ty):
    
    m = type_tag_str_re.match(ty)
    if m is None:
        raise ValueError('Type specifier %s does not have size' % ty)
    return int(m.group('size'))
919764
public Object parseArray() {
    ArrayList arr = new ArrayList();
    advance();
    if(T.isValueType()) {
      arr.add(parseValue());
      while(T.getType() == TokenType.COMMA) {
        advance();
        arr.add(parseValue());
      }
    }
    checkAndSkip(TokenType.RSQUARE, "]");
    return arr;
  }
1116327
def get(typename):
    
    dt = getPDT(typename) or getCDT(typename)

    if dt is None:
        pdt, nelems = ArrayType.parse(typename)
        if pdt and nelems:
            dt = ArrayType(pdt, nelems)

    return dt
1153929
def parse(self, declaration):
        
        declaration = declaration.strip()
        for regex, constructor in self._compiled:
            m = regex.match(declaration)
            if m:
                return constructor(*m.groups())
        raise ValueError('Unable to parse type declaration', declaration)
634812
function(node, type) {

        //split type
        var subType = type;
        var splitIndex = subType.indexOf(":");
        if (splitIndex != -1) {
            subType = subType.substr(splitIndex+1);
        }

        //split nodeName
        var nodeName = node.nodeName;
        splitIndex = nodeName.indexOf(":");
        if (splitIndex != -1) {
            nodeName = nodeName.substr(splitIndex+1);
        }

        return (subType == nodeName);
    }
748782
def _get_types(type_):
    

    return list(
        itertools.chain.from_iterable(
            map(lambda x: TYPE_MAPPINGS[x].get(type_, []), TYPE_MAPPINGS)
        )
    )
444970
public static <T> T parse(byte[] data, Type type) {
        return Holder.parser.parse(data, type);
    }
1261426
def of_type(cls, iterable, types):
    

    return cls(x for x in iterable if isinstance(x, types))
1249439
def _deserialize_value(cls, types, value):
        

        if types.main == list and value is not None:
            return cls._deserialize_list(types.sub, value)
        else:
            return cls.deserialize(types.main, value)
1306799
def _fetch_type_main(cls, cls_in, match):
        

        return cls._str_to_type(
            cls_in,
            match.group(cls._SUBMATCH_INDEX_TYPE_MAIN)
        )
789814
def parse(self, data, mimetype):
        
        encoding = mimetype.params.get('charset') or 'utf-8'

        return json.loads(data.decode(encoding))
646124
public Map<String, Object> parseObject() throws IOException {
		Type t = lexer.readNextToken();
		if (t != Type.START_OBJECT) {
			throw new IOException("Unexpected token: " + t);
		}
		
		return parseObjectInternal();
	}
1269196
def _parse_json(s):
    '''
    
    '''
    return json.loads(s, object_hook=lambda pairs: JsonDict(pairs.iteritems()))
829833
def parse_basic_type_str(old_normalizer):
    
    @functools.wraps(old_normalizer)
    def new_normalizer(type_str, data):
        try:
            abi_type = parse(type_str)
        except ParseError:
            # If type string is not parsable, do nothing
            return type_str, data

        if not isinstance(abi_type, BasicType):
            return type_str, data

        return old_normalizer(abi_type, type_str, data)

    return new_normalizer
949062
function extractTypes (elements, Types) {
  function inner (elements, res) {
    const l = elements.length
    for (let i = 0; i < l; i++) {
      const e = elements[i]
      const index = Types.indexOf(e.constructor)
      if (index > -1) {
        res[index].push(e)
      } else if (e instanceof Element) {
        inner(e.content, res)
        inner(e.endContent, res)
      }
    }
  }

  const res = Types.map(() => [])
  inner(elements, res)
  return res
}
1221262
def get_type(atype, size=None):
    
    res = TYPE_DESCRIPTOR.get(atype)
    if res is None:
        if atype[0] == 'L':
            if atype.startswith('Ljava/lang'):
                res = atype[1:-1].lstrip('java/lang/').replace('/', '.')
            else:
                res = atype[1:-1].replace('/', '.')
        elif atype[0] == '[':
            if size is None:
                res = '%s[]' % get_type(atype[1:])
            else:
                res = '{}[{}]'.format(get_type(atype[1:]), size)
        else:
            res = atype
            logger.debug('Unknown descriptor: "%s".', atype)
    return res