parameters: (self, head, tail, chars, lines)
docstring: Replace the text between the given indices.
  
          Args:
              head: Starting index of text to replace.
              tail: Ending index of text to replace.
              chars: Expected to be string of current text
                  between head and tail.
              lines: List of new lines to insert between head
                  and tail.
docstring_summary: Replace the text between the given indices.
docstring_tokens: Replace the text between the given indices .
function: def set_region(self, head, tail, chars, lines):
          """Replace the text between the given indices.
  
          Args:
              head: Starting index of text to replace.
              tail: Ending index of text to replace.
              chars: Expected to be string of current text
                  between head and tail.
              lines: List of new lines to insert between head
                  and tail.
          """
          text = self.editwin.text
          newchars = "\n".join(lines)
          if newchars == chars:
              text.bell()
              return
          text.tag_remove("sel", "1.0", "end")
          text.mark_set("insert", head)
          text.undo_block_start()
          text.delete(head, tail)
          text.insert(head, newchars)
          text.undo_block_stop()
          text.tag_add("sel", head, "insert")
function_tokens: def set_region ( self , head , tail , chars , lines ) : text = self . editwin . text newchars = "\n" . join ( lines ) if newchars == chars : text . bell ( ) return text . tag_remove ( "sel" , "1.0" , "end" ) text . mark_set ( "insert" , head ) text . undo_block_start ( ) text . delete ( head , tail ) text . insert ( head , newchars ) text . undo_block_stop ( ) text . tag_add ( "sel" , head , "insert" )