def get_region(self, view=None, can_select_entire_buffer=False):

        value = ''

        view, window = self.get_view_and_window(view)

        # If there is no view then all bets are off:
        #
        if view is not None:

            # Get the selection:
            #
            selection = view.sel()

            # If there is no selection then optionally use the entire buffer:
            #
            if can_select_entire_buffer is True:
                if len(selection) == 1 and selection[0].empty():
                    selection = [sublime.Region(0, view.size())]

            if selection is not None:

                # For each region in the selection, either use it directly,
                # or expand it to take in the 'word' that the cursor is on:
                #
                for region in selection:
                    if region.empty():
                        region = view.expand_by_class(
                            region,
                            sublime.CLASS_WORD_START | sublime.CLASS_WORD_END,
                            ' ():'
                        )
                    value = value + ' ' + view.substr(region)

        return value
Returns a squared range based on the `range_string` parameter,
dataset/ETHPy150Open markbirbeck/sublime-text-shell-command/SublimeHelper.py/TextCommand.get_region--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/openpyxl-2.3.0-b2/openpyxl/worksheet/worksheet.py/Worksheet.iter_rows