tools/traffic_annotation/scripts/update_annotations_doc.py
def _clear_destination_contents(self, doc):
    """Will clear the contents of the destination document from the end of the
    "Introduction" section onwards.

    Return: Integer of where to start writing, i.e. the index.
    """
    print("Overwriting the destination document.")
    first_index = generator_utils.find_first_index(doc)
    last_index = generator_utils.find_last_index(doc)

    if self.verbose:
      print("First index, last index", first_index, last_index)

    if first_index >= last_index:
      print("Nothing to overwrite.")
      return first_index

    req = [{
        "deleteContentRange": {
            "range": {
                "startIndex": first_index,
                "endIndex": last_index
            }
        }
    }]
    self._perform_requests(req)
    return first_index
Will clear the contents of the destination document from the end of the
    "Introduction" section onwards.

    Return: Integer of where to start writing, i.e. the index.
    
Will clear the contents of the destination document from the end of the
"Introduction" section onwards.

Integer of where to start writing, i.e. the index.
Will clear the contents of the destination document from the end of the " Introduction " section onwards . Integer of where to start writing i . e . the index .
def _clear_destination_contents(self, doc):
    print("Overwriting the destination document.")
    first_index = generator_utils.find_first_index(doc)
    last_index = generator_utils.find_last_index(doc)
    if self.verbose:
      print("First index, last index", first_index, last_index)
    if first_index >= last_index:
      print("Nothing to overwrite.")
      return first_index
    req = [{
        "deleteContentRange": {
            "range": {
                "startIndex": first_index,
                "endIndex": last_index
            }
        }
    }]
    self._perform_requests(req)
    return first_index
def _clear_destination_contents ( self , doc ) : print ( "Overwriting the destination document." ) first_index = generator_utils . find_first_index ( doc ) last_index = generator_utils . find_last_index ( doc ) if self . verbose : print ( "First index, last index" , first_index , last_index ) if first_index >= last_index : print ( "Nothing to overwrite." ) return first_index req = [ { "deleteContentRange" : { "range" : { "startIndex" : first_index , "endIndex" : last_index } } } ] self . _perform_requests ( req ) return first_index
Will clear the contents of the destination document from the end of the
"Introduction" section onwards.
Will clear the contents of the destination document from the end of the " Introduction " section onwards .
"""Will clear the contents of the destination document from the end of the
    "Introduction" section onwards.

    Return: Integer of where to start writing, i.e. the index.
    """
self
doc