code: def sorted_insert(annotations, annotation):
      # iterate in reverse order until you find the proper location to insert the new annotation
      idx = 0
      n = len(annotations)
      while idx < len(annotations) and span(annotation) < span(
          annotations[n - idx - 1]
      ):
          idx += 1
  
      # mutate annotations list in place
      annotations.insert(n - idx, annotation)
  
file_path: finetune/finetune/encoding/sequence_encoder.py
imports: import warnings
  import numpy
  from finetune.encoding.input_encoder import get_spacy
label_desc: Use image node_id 6 for calling a global function with example usage: sorted_insert(annotations, annotation) without return types