Discovers the end line of the node when there are no lines.

 @return [Integer] the end line of the node
334914
def nontrivial_end_line
      if (last_child = children.last)
        last_child.line_numbers.end - 1
      elsif successor
        successor.line_numbers.begin - 1
      else
        @document.source_lines.count
      end
    end
960437
function(){
          var part = this.get();
          // Allow empty nodes when they are alone on a line, needed
          // for the FF cursor bug workaround (see select.js,
          // insertNewlineAtCursor).
          while (part && isSpan(part) && part.currentText == "") {
            // Leave empty nodes that are alone on a line alone in
            // Opera, since that browsers doesn't deal well with
            // having 2 BRs in a row.
            if (window.opera && surroundedByBRs(part)) {
              this.next();
              part = this.get();
            }
            else {
              var old = part;
              this.remove();
              part = this.get();
              // Adjust selection information, if any. See select.js for details.
              select.snapshotMove(old.firstChild, part && (part.firstChild || part), 0);
            }
          }
          
          return part;
        }
1371939
def send_line(self, line, ending=None):
        
        if ending is None:
            ending = self.LINE_ENDING
        return self.send(line + ending)
1134193
def node_on_single_line?(node)
      return if node.source_range.start_pos.line != node.source_range.end_pos.line

      # The Sass parser reports an incorrect source range if the trailing curly
      # brace is on the next line, e.g.
      #
      #   p {
      #   }
      #
      # Since we don't want to count this as a single line node, check if the
      # last character on the first line is an opening curly brace.
      engine.lines[node.line - 1].strip[-1] != '{'
    end
100249
def _detect_line_ending(self):
        
        candidate_value = '\n'
        candidate_count = 0
        for line_ending in UniversalCsvReader.line_endings:
            count = self._sample.count(line_ending)
            if count > candidate_count:
                candidate_value = line_ending
                candidate_count = count

        self._formatting_parameters['line_terminator'] = candidate_value
140658
def is_end_node(node):
    
    return (isinstance(node, ast.Expr) and
            isinstance(node.value, ast.Name) and
            node.value.id == 'end')
778251
def _handle_end_node(self):
        
        self._result.append(Node(result=self._result, **self._curr))
        self._curr = {}
1288223
def node_for_line(line)
      find(-> { HamlLint::Tree::NullNode.new }) { |node| node.line_numbers.cover?(line) }
    end
558382
def _find_end_token(self, end_token, operation):
        
        ibuffer, icache = operation.state
        length = operation.buffered[ibuffer][2]
        result = None

        for i in range(len(operation.buffered) - ibuffer - 1):
            linenum, statement, charlength = operation.buffered[i + ibuffer + 1]
            length += charlength
            
            if end_token in statement.lower():
                #We already have the absolute char index for the start of the
                #instance; we just need to update the end.
                result = (i + ibuffer + 1, length)
                break        

        #If we didn't find a terminating statement, the full length of the operation
        #is a good estimate for the extent of the instance.
        if result is None:
            result = (None, length)

        return result
897812
def get_line(exception)
      # SyntaxErrors have weird line reporting
      # when there's trailing whitespace
      if exception.is_a?(::SyntaxError)
        return (exception.message.scan(/:(\d+)/).first || ["??"]).first
      end
      (exception.backtrace[0].scan(/:(\d+)/).first || ["??"]).first
    end
323308
def following_non_gem_lines
      all_lines[(index+1)..(-1)].
          reject {|x| x.strip.empty? || x.match(GemBench::TRASH_REGEX) }.
          map(&:strip).
          inject([]) do |following_lines, next_line|
            break following_lines if next_line.match(GEM_REGEX)
            following_lines << next_line
      end
    end
889986
def determine_end_offset(block, tokens, source, expected_matcher)
      lines = source.lines
      last_line_number = lines.length
      end_offset = nil
      tokens.reverse_each do |token|
        # Break once we're through with the last line.
        break if token[0][0] != last_line_number

        # Look for expected match to block opener
        next if token[1] != expected_matcher
        next if token[1] == :on_kw && token[2] != END_STR

        # Raise if we've already found something that looks like a block end.
        raise AmbiguousSourceError.from_proc(block) if end_offset
        # Ending offset is the position of the ending token, plus the length of
        # that token.
        end_offset = token[0][1] + token[2].length
      end
      raise AmbiguousSourceError.from_proc(block) unless end_offset
      determine_end_offset_relative_to_source(end_offset, lines.last.length)
    end
956746
public int find() {
        for (int node = root; node != NIL; ) {
            final int cmp = compare(node);
            if (cmp < 0) {
                node = left(node);
            } else if (cmp > 0) {
                node = right(node);
            } else {
                return node;
            }
        }
        return NIL;
    }
119996
def _newline_end_of_file(relative_path, contents, linter_options):
    """
    del relative_path
    del linter_options
    last_line = len(contents) - 1
    if not len(contents) or not contents[last_line].endswith("\n"):
        if len(contents):
            last_line_replacement = contents[last_line] + "\n"
        else:
            last_line_replacement = "\n"
        return LinterFailure(r"No \n at end of file",
                             last_line + 1,
                             last_line_replacement)
1043904
def end_of_line(event):
    "  "
    buff = event.current_buffer
    buff.cursor_position += buff.document.get_end_of_line_position()
1000442
def find_cell_end(self, lines):
        """"""

        if self.metadata and 'cell_type' in self.metadata:
            self.cell_type = self.metadata.pop('cell_type')
        else:
            self.cell_type = 'code'

        next_cell = len(lines)
        for i, line in enumerate(lines):
            if i > 0 and (self.start_code_re.match(line) or self.alternative_start_code_re.match(line)):
                next_cell = i
                break

        if last_two_lines_blank(lines[:next_cell]):
            return next_cell - 2, next_cell, False
        if next_cell > 0 and _BLANK_LINE.match(lines[next_cell - 1]):
            return next_cell - 1, next_cell, False
        return next_cell, next_cell, False
1155211
def empty_line_count_at_the_end(self):
        
        count = 0
        for line in self.lines[::-1]:
            if not line or line.isspace():
                count += 1
            else:
                break

        return count