Returns true if the next and current lines can be joined together either
because they have the same tag or because the next line does not have a
tag.
421371
public boolean joinLine() {
		if (!isCurrentLine()) {
			return false;
		}
		if (!isNextLine()) {
			return false;
		}
		if (!isNextTag()) {
			return true; // no next tag -> continue block
		}
		if (!isCurrentTag()) {
			return false; // no current tag -> new block
		}
		// compare current and next tag
		return getCurrentTag().equals(getNextTag());
	}
1127825
public boolean hasNext() {
        if (currentIndex == endIndex) {
            return false;
        }
              
        // Otherwise, see if nextElement is null. If so, try to load the next
        // element to make sure it exists.
        if (nextElement == null) {
            nextElement = getNextElement();
            if (nextElement == null) {
                return false;
            }
        }
        return true;
    }
117923
private function validateOneLineSummary(): bool
    {
        $isValid = true;
        $summaryPos = $this->getSummaryPosition();
        $nextPossiblePos = $this->loadNextDocBlockContent($summaryPos);

        if ($nextPossiblePos > -1) {
            $nextToken = $this->tokens[$nextPossiblePos];

            if (($nextToken['code'] === T_DOC_COMMENT_STRING) && !$this->isNextLineEmpty($summaryPos)) {
                $isValid = false;

                $this->file->addWarning(
                    self::MESSAGE_SUMMARY_TOO_LONG,
                    $nextPossiblePos,
                    static::CODE_SUMMARY_TOO_LONG
                );
            }
        }

        return $isValid;
    }
976466
def _join_lines(txt):
    
    txt = txt or ''  # Handle NoneType input values
    val = ''
    lines = txt.split('\n')
    for line in lines:
        stripped = line.strip()
        if len(stripped) == 0:
            continue
        val += stripped + ' '
    return val.strip()
520967
def join(self, iterable):
        
        return self.__class__(super(ColorStr, self).join(iterable), keep_tags=True)
585468
def join_lines(line1, line2):
    
    if line1 == u"":
        pass
    elif line1[-1] == u'-':
        # hyphenated word at the end of the
        # line - don't add in a space and remove hyphen
        line1 = line1[:-1]
    elif line1[-1] != u' ':
        # no space at the end of this
        # line, add in a space
        line1 = line1 + u' '
    return line1 + line2
255186
def _highlight_line_difflib(self, line, next):
        

        if line['action'] == 'del':
            old, new = line, next
        else:
            old, new = next, line

        oldwords = re.split(r'(\W)', old['line'])
        newwords = re.split(r'(\W)', new['line'])

        sequence = difflib.SequenceMatcher(None, oldwords, newwords)

        oldfragments, newfragments = [], []
        for tag, i1, i2, j1, j2 in sequence.get_opcodes():
            oldfrag = ''.join(oldwords[i1:i2])
            newfrag = ''.join(newwords[j1:j2])
            if tag != 'equal':
                if oldfrag:
                    oldfrag = '<del>%s</del>' % oldfrag
                if newfrag:
                    newfrag = '<ins>%s</ins>' % newfrag
            oldfragments.append(oldfrag)
            newfragments.append(newfrag)

        old['line'] = "".join(oldfragments)
        new['line'] = "".join(newfragments)
597784
boolean matchText(
            final boolean blockMatching,
            final int markupLevel, final int markupBlockIndex) {

        checkMarkupLevel(markupLevel);

        if (this.markupSelectorItem.anyLevel() || markupLevel == 0 || (this.prev != null && this.prev.matchedMarkupLevels[markupLevel - 1])) {
            // This text has not matched yet, but might match, so we should check

            this.matchesThisLevel = this.markupSelectorItem.matchesText(markupBlockIndex, this.markupBlockMatchingCounter);

            if (matchesPreviousOrCurrentLevel(markupLevel)) {
                // This filter was already matched by a previous level (through an "open" event), so just delegate to next.

                if (this.next != null) {
                    return this.next.matchText(blockMatching, markupLevel, markupBlockIndex);
                }
                return (blockMatching? true : this.matchesThisLevel);

            } else if (this.matchesThisLevel) {
                // This filter was not matched before. So the fact that it matches now means we need to consume it,
                // therefore not delegating.

                return (this.next == null);

            }

        } else if (matchesPreviousOrCurrentLevel(markupLevel)) {
            // This filter was already matched by a previous level (through an "open" event), so just delegate to next.

            if (this.next != null) {
                return this.next.matchText(blockMatching, markupLevel, markupBlockIndex);
            }
            return blockMatching;

        }

        return false;

    }
1097348
public synchronized boolean hasNext()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "hasNext");

    if(next == null)
    {
      synchronized(index)
      {
        next = (Index.Entry) cursor.next();
        if(filter != null)
        {
          while(next != null && !filter.matches(next.type))
          {
            next = (Index.Entry) cursor.next();
          }
        }
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "hasNext", new Boolean(next != null));

    return (next != null);
  }
768274
def has_multiline_items(maybe_list: Optional[Sequence[str]]):
    """"""
    return maybe_list and any(is_multiline(item) for item in maybe_list)
759947
def should_expand(self, tag):
        """"""
        return self.indentation is not None and tag and (
            not self.previous_indent or (
                tag.serializer == 'list'
                and tag.subtype.serializer in ('array', 'list', 'compound')
            ) or (
                tag.serializer == 'compound'
            )
        )
645370
def _in_multi_line(self, line):
        """"""

        # we are only looking for explicitly joined lines here, not
        # implicit ones (i.e. brackets, braces etc.).  this is just to
        # guard against the possibility of modifying the space inside of
        # a literal multiline string with unfortunately placed
        # whitespace

        current_state = (self.backslashed or self.triplequoted)

        if re.search(r"\\$", line):
            self.backslashed = True
        else:
            self.backslashed = False

        triples = len(re.findall(r"\"\"\"|\'\'\'", line))
        if triples == 1 or triples % 2 != 0:
            self.triplequoted = not self.triplequoted

        return current_state
60785
public boolean nextLine() throws IOException {
    while(reader.readLine(buf.delete(0, buf.length()))) {
      ++lineNumber;
      if(lengthWithoutLinefeed(buf) > 0) {
        return true;
      }
    }
    return false;
  }
843363
def check_multiline_sequence(node, sequence, index)
      return unless sequence.members.size > 1
      return unless sequence.members[2..-1].any? { |member| member == "\n" }

      add_lint(node.line + index, MESSAGE)
    end
576489
def __has_next_page(self, current_page_num=0):
        
        try:
            next_page = self.robot.get_elements(
                self.base.get('next_page'),
                multiple=True
            )
            log.debug('<Site> has {} next page elems'.format(len(next_page)))
            if not next_page:
                return False
            for i, ele in enumerate(next_page):
                if ele.get_attribute('innerText') == 'Next':
                    log.debug('<Site> {} is the right link'.format(i))
                    self.next_page = ele
                    break
            return True
        except Exception as _:
            self.next_page = None
            return False
267111
boolean matchComment(
            final boolean blockMatching,
            final int markupLevel, final int markupBlockIndex) {

        checkMarkupLevel(markupLevel);

        if (this.markupSelectorItem.anyLevel() || markupLevel == 0 || (this.prev != null && this.prev.matchedMarkupLevels[markupLevel - 1])) {
            // This text has not matched yet, but might match, so we should check

            this.matchesThisLevel = this.markupSelectorItem.matchesComment(markupBlockIndex, this.markupBlockMatchingCounter);

            if (matchesPreviousOrCurrentLevel(markupLevel)) {
                // This filter was already matched by a previous level (through an "open" event), so just delegate to next.

                if (this.next != null) {
                    return this.next.matchComment(blockMatching, markupLevel, markupBlockIndex);
                }
                return (blockMatching? true : this.matchesThisLevel);

            } else if (this.matchesThisLevel) {
                // This filter was not matched before. So the fact that it matches now means we need to consume it,
                // therefore not delegating.

                return (this.next == null);

            }

        } else if (matchesPreviousOrCurrentLevel(markupLevel)) {
            // This filter was already matched by a previous level (through an "open" event), so just delegate to next.

            if (this.next != null) {
                return this.next.matchComment(blockMatching, markupLevel, markupBlockIndex);
            }
            return blockMatching;

        }

        return false;

    }
832118
public function hasNextSibling(): bool
    {
        try
        {
            $this->nextSibling();

            // sibling found, return true;
            return true;
        }
        catch (ParentNotFoundException $e)
        {
            // no parent, no next sibling
            return false;
        }
        catch (ChildNotFoundException $e)
        {
            // no sibling found
            return false;
        }
    }