code: def clear_entities(entities):
      # eliminates entities which extend beyond our scope
      resolve_entities(entities)
      entities_list = sorted(
          list(entities.values()), key=lambda ent: ent["index"]
      )
      entities = eliminate_overlapping_entities(entities_list)
      for entity in entities:
          targets = entity["targets"]
          entity["targets"] = [t.split("morph_")[1] for t in targets]
      return entities
  
imports: import argparse
  import json
  import os
  import random
  import tarfile
  import tempfile
  from tqdm import tqdm
label_desc: Use image node_id 6 for calling a global function with example usage: clear_entities(entities) and returns: entities