docstr: If any item in to_remove overlaps with input span it is removed from the span
  creating between 0 and to_remove + 1 spans as output.
  
  For example
  {"start" 0, "end": 10} - [{"start": 0, "end": 2}, {"start": 5, "end": 6}]
  = [{"start": 2, "end": 5}, {"start": 6, "end": 10}]
docstr_tok: ["If","any","item","in","to_remove","overlaps","with","input","span","it","is","removed","from","the","span","creating","between","0","and","to_remove","+","1","spans","as","output",".","For","example","{","``","start","''","0",",","``","end","''",":","10","}","-","[","{","``","start","''",":","0",",","``","end","''",":","2","}",",","{","``","start","''",":","5",",","``","end","''",":","6","}","]","=","[","{","``","start","''",":","2",",","``","end","''",":","5","}",",","{","``","start","''",":","6",",","``","end","''",":","10","}","]"]
code: def subtract_spans(
      self, input_span: Span, to_remove: t.List[t.Dict[str, t.Any]]
  ) -> t.List[Span]:
      """
      If any item in to_remove overlaps with input span it is removed from the span
      creating between 0 and to_remove + 1 spans as output.
  
      For example
      {"start" 0, "end": 10} - [{"start": 0, "end": 2}, {"start": 5, "end": 6}]
      = [{"start": 2, "end": 5}, {"start": 6, "end": 10}]
      """
      output = [input_span]
  
      for remove_span in to_remove:
          new_output = []
  
          for span in output:
              if (
                  remove_span["end"] <= span["start"]
                  or remove_span["start"] >= span["end"]
              ):
                  new_output.append(span)
              else:
                  if remove_span["start"] > span["start"]:
                      new_output.append(
                          {**span, "end": remove_span["start"]}
                      )
                  if remove_span["end"] < span["end"]:
                      new_output.append(
                          {**span, "start": remove_span["end"]}
                      )
  
          output = new_output
  
      return output
  
imports: import copy
  import functools
  import os
  import tempfile
  import typing
  import sys
  from finetune.base_models import TableRoBERTa
  from finetune.util.metrics import sequences_overlap
  from finetune.scheduler import Scheduler
  from finetune.encoding.input_encoder import BaseEncoder
  from finetune import SequenceLabeler
label_desc: Use image node_id 6 for calling the TableETL obj's underlying member method code with example usage: obj.subtract_spans(input_span, to_remove) and returns: output