class_docstr: Return struct for functions wrapped in ``text_object``.
  Both `start` and `end` are relative to the current cursor position.
class_docstr_tok: ["Return","struct","for","functions","wrapped","in","``","text_object","``",".","Both","`","start","`","and","`","end","`","are","relative","to","the","current","cursor","position","."]
docstr: Return a (start, end) tuple with start <= end that indicates the range
  operators should operate on.
  `buffer` is used to get start and end of line positions.
docstr_tok: ["Return","a","(","start",",","end",")","tuple","with","start","<","=","end","that","indicates","the","range","operators","should","operate","on",".","`","buffer","`","is","used","to","get","start","and","end","of","line","positions","."]
code: def operator_range(self, document):
      """
      Return a (start, end) tuple with start <= end that indicates the range
      operators should operate on.
      `buffer` is used to get start and end of line positions.
      """
      start, end = self.sorted()
      doc = document
  
      if (
          self.type == TextObjectType.EXCLUSIVE
          and doc.translate_index_to_position(
              end + doc.cursor_position
          )[1]
          == 0
      ):
          # If the motion is exclusive and the end of motion is on the first
          # column, the end position becomes end of previous line.
          end -= 1
      if self.type == TextObjectType.INCLUSIVE:
          end += 1
      if self.type == TextObjectType.LINEWISE:
          # Select whole lines
          row, col = doc.translate_index_to_position(
              start + doc.cursor_position
          )
          start = (
              doc.translate_row_col_to_index(row, 0)
              - doc.cursor_position
          )
          row, col = doc.translate_index_to_position(
              end + doc.cursor_position
          )
          end = (
              doc.translate_row_col_to_index(row, len(doc.lines[row]))
              - doc.cursor_position
          )
      return start, end
  
imports: from __future__ import unicode_literals
  from prompt_toolkit.buffer import ClipboardData, indent, unindent, reshape_text
  from prompt_toolkit.document import Document
  from prompt_toolkit.enums import IncrementalSearchDirection, SEARCH_BUFFER, SYSTEM_BUFFER
  from prompt_toolkit.filters import Filter, Condition, HasArg, Always, IsReadOnly
  from prompt_toolkit.filters.cli import ViNavigationMode, ViInsertMode, ViInsertMultipleMode, ViReplaceMode, ViSelectionMode, ViWaitingForTextObjectMode, ViDigraphMode, ViMode
  from prompt_toolkit.key_binding.digraphs import DIGRAPHS
  from prompt_toolkit.key_binding.vi_state import CharacterFind, InputMode
  from prompt_toolkit.keys import Keys
  from prompt_toolkit.layout.utils import find_window_for_buffer_name
  from prompt_toolkit.selection import SelectionType, SelectionState, PasteMode
  from .scroll import scroll_forward, scroll_backward, scroll_half_page_up, scroll_half_page_down, scroll_one_line_up, scroll_one_line_down, scroll_page_up, scroll_page_down
  from .named_commands import get_by_name
  from ..registry import Registry, ConditionalRegistry, BaseRegistry
  import prompt_toolkit.filters
  from six.moves import range
  import codecs
  import six
  import string
label_desc: Use image node_id 4 for calling the TextObject obj's underlying member method code with example usage: obj.operator_range(document) and returns: start,  end