As part of parse_line() check for type members in the statement.
978947
def _rt_parse_members(self, statement, element, mode):
        """"""
        if mode == "delete":
            self._rt_members_delete(element, statement)
        elif mode == "insert":
            self._rt_members_add(element, statement)
1056705
def check(self, inst, value):
        
        if not (self.or_none and value is None):
            if self.seq:
                self.checktype_seq(value, self.kind,
                                   unique=self.unique, inst=inst)
            else:
                self.checktype(value, self.kind, inst=inst)
365524
def _parse(self, line):
        """"""
        try:
            result = line.split(':', maxsplit=4)
            filename, line_num_txt, column_txt, message_type, text = result
        except ValueError:
            return

        try:
            self.line_num = int(line_num_txt.strip())
            self.column = int(column_txt.strip())
        except ValueError:
            return

        self.filename = filename
        self.message_type = message_type.strip()
        self.text = text.strip()
        self.valid = True
1161761
def parse_line_headers(self, line):
        
        headers = line.split(",")
        for i, v in enumerate(headers):
            if v:
                headers[i] = v
            else:
                headers[i] = str(i)
        self.headers = headers
185956
def check_type(lineno, type_list, arg):
    
    if not isinstance(type_list, list):
        type_list = [type_list]

    if arg.type_ in type_list:
        return True

    if len(type_list) == 1:
        syntax_error(lineno, "Wrong expression type '%s'. Expected '%s'" %
                     (arg.type_, type_list[0]))
    else:
        syntax_error(lineno, "Wrong expression type '%s'. Expected one of '%s'"
                     % (arg.type_, tuple(type_list)))

    return False
1072557
def parse_check_lines(server, lines)
      raise(ArgumentError, 'arg server not of type Server') if !server.is_a? Server
      lines.each do |l|
        key, value = l.gsub("\t","").split(": ")
        case key.chomp
        when "ssh"
          server.ssh_check_ok = value =~ /OK/ ? true : false
        when "PostgreSQL"
          server.pg_conn_ok = value == "OK" ? true : false
        end
      end
    end
578066
def _checkIndentationIssue(self, node, node_type, linenoDocstring):
        
        indentDocstring = node.col_offset and node.col_offset or 0
        indentDocstring += len(re.findall(r'\n( *)"""',
                                          node.as_string())[0])
        linesDocstring = node.doc.lstrip("\n").split("\n")
        for nline, lineDocstring in enumerate(linesDocstring):
            if (nline < len(linesDocstring) - 1
                and not lineDocstring.strip()):
                # It's a blank line.
                continue
            if indentDocstring != self._getLineIndent(lineDocstring):
                if node_type == "module":
                    lineno = linenoDocstring
                else:
                    lineno = linenoDocstring + nline + 1
                self.add_message('W9206', line=lineno, node=node)
196870
private static <T> void checkPreconditions(final Class<T> type, final TextParser<T> parser) {
        if(type == null) {
            throw new NullPointerException("type is null.");
        }
        
        if(parser == null) {
            throw new NullPointerException("parser is null.");
        }
    }
754428
def is_regex_type(type_):
    

    return (
        callable(type_)
        and getattr(type_, "__name__", None) == REGEX_TYPE_NAME
        and hasattr(type_, "__supertype__")
        and is_compiled_pattern(type_.__supertype__)
    )
12597
def line_join_type(self):
        """"""
        key = self._data.get(b'strokeStyleLineJoinType').enum
        return self.STROKE_STYLE_LINE_JOIN_TYPES.get(key, str(key))
386433
def parse_type_reference(lexer: Lexer) -> TypeNode:
    """"""
    start = lexer.token
    if expect_optional_token(lexer, TokenKind.BRACKET_L):
        type_ = parse_type_reference(lexer)
        expect_token(lexer, TokenKind.BRACKET_R)
        type_ = ListTypeNode(type=type_, loc=loc(lexer, start))
    else:
        type_ = parse_named_type(lexer)
    if expect_optional_token(lexer, TokenKind.BANG):
        return NonNullTypeNode(type=type_, loc=loc(lexer, start))
    return type_
335397
protected boolean parseEmptyOrCommentLine(final ParserData parserData, final String line) {
        if (isBlankLine(line)) {
            if (parserData.getCurrentLevel().getLevelType() == LevelType.BASE) {
                parserData.getContentSpec().appendChild(new TextNode("\n"));
            } else {
                parserData.getCurrentLevel().appendChild(new TextNode("\n"));
            }
            return true;
        } else {
            if (parserData.getCurrentLevel().getLevelType() == LevelType.BASE) {
                parserData.getContentSpec().appendComment(line);
            } else {
                parserData.getCurrentLevel().appendComment(line);
            }
            return true;
        }
    }
568523
def parse(self, line):
        """"""
        tokens = []

        self.idx = -1   # Bogus value to ensure idx = 0 after first iteration
        self.characters = iter(line)
        self.update_chars()

        while self.char != '\n':
            # Update namelist group status
            if self.char in ('&', '$'):
                self.group_token = self.char

            if self.group_token and (
                    (self.group_token, self.char) in (('&', '/'), ('$', '$'))):
                self.group_token = False

            word = ''
            if self.char in self.whitespace:
                while self.char in self.whitespace:
                    word += self.char
                    self.update_chars()

            elif self.char in ('!', '#') or self.group_token is None:
                # Abort the iteration and build the comment token
                word = line[self.idx:-1]
                self.char = '\n'

            elif self.char in '"\'' or self.prior_delim:
                word = self.parse_string()

            elif self.char.isalpha():
                word = self.parse_name(line)

            elif self.char in ('+', '-'):
                # Lookahead to check for IEEE value
                self.characters, lookahead = itertools.tee(self.characters)
                ieee_val = ''.join(itertools.takewhile(str.isalpha, lookahead))
                if ieee_val.lower() in ('inf', 'infinity', 'nan'):
                    word = self.char + ieee_val
                    self.characters = lookahead
                    self.prior_char = ieee_val[-1]
                    self.char = next(lookahead, '\n')
                else:
                    word = self.parse_numeric()

            elif self.char.isdigit():
                word = self.parse_numeric()

            elif self.char == '.':
                self.update_chars()
                if self.char.isdigit():
                    frac = self.parse_numeric()
                    word = '.' + frac
                else:
                    word = '.'
                    while self.char.isalpha():
                        word += self.char
                        self.update_chars()
                    if self.char == '.':
                        word += self.char
                        self.update_chars()

            elif self.char in Tokenizer.punctuation:
                word = self.char
                self.update_chars()

            else:
                # This should never happen
                raise ValueError

            tokens.append(word)

        return tokens
1276494
def is_string_type(type_):
    

    string_types = _get_types(Types.STRING)
    if is_typing_type(type_):
        return type_ in string_types or is_regex_type(type_)
    return type_ in string_types
503479
private <T> void checkFormat(Collection<T> c) {
		Class<?> type = null;
		List<Class<?>> typeList = new ArrayList<Class<?>>();
		Iterator<T> it = c.iterator();
		while (it.hasNext()) {
			Object o = it.next();

			// check the input types for 1-dimension
			if (type != null && !type.equals(o.getClass())) {
				throw new RuntimeException("elements of input list should have the same type");
			}
			else {
				type = o.getClass();
			}

			// check the input types for 2-dimension array
			if (typeList.size() == 0 && o.getClass().isArray()) {
				for (Object s : (Object[]) o) {
					typeList.add(s.getClass());
				}
			}
			else if (o.getClass().isArray()) {
				int index = 0;
				if (((Object[]) o).length != typeList.size()) {
					throw new RuntimeException("elements of input list should have the same size");
				}
				for (Object s : (Object[]) o) {
					if (!s.getClass().equals(typeList.get(index++))) {
						throw new RuntimeException("elements of input list should have the same type");
					}
				}
			}

			// check the input types for 2-dimension collection
			if (typeList.size() == 0 && o instanceof Collection) {
				@SuppressWarnings("unchecked")
				Iterator<Object> tmpIt = ((Collection<Object>) o).iterator();
				while (tmpIt.hasNext()) {
					Object s = tmpIt.next();
					typeList.add(s.getClass());
				}
			}
			else if (o instanceof Collection) {
				int index = 0;
				@SuppressWarnings("unchecked")
				Iterator<Object> tmpIt = ((Collection<Object>) o).iterator();
				while (tmpIt.hasNext()) {
					Object s = tmpIt.next();
					if (!s.getClass().equals(typeList.get(index++))) {
						throw new RuntimeException("elements of input list should have the same type");
					}
				}

				if (index != typeList.size()) {
					throw new RuntimeException("elements of input list should have the same size");
				}
			}
		}
	}
181419
private Type parseBracketedType(EnclosingScope scope) {
		int start = index;
		match(LeftBrace);
		Type type = parseType(scope);
		match(RightBrace);
		return type;
	}
227742
def _is_in_comment_type(token_type):
    """"""
    return token_type in [TokenType.Comment,
                          TokenType.Newline,
                          TokenType.Whitespace,
                          TokenType.RST,
                          TokenType.BeginRSTComment,
                          TokenType.BeginInlineRST,
                          TokenType.EndInlineRST]