code: def _remove_curly_braces(text):
      """Remove everything in curly braces.
  
      Curly braces may be nested, so we keep track of depth.
  
      Args:
        text: a string
      Returns:
        a string
      """
      current_pos = 0
      depth = 0
      ret = ""
      for match in re.finditer("[{}]", text):
          if depth == 0:
              ret += text[current_pos : match.start()]
          depth += 1 if text[match.start()] == "{" else -1
          current_pos = match.end()
      if depth != 0:
          # Many articles have mismatched braces, but it still seems better to remove
          # them than not.
          pass
      else:
          ret += text[current_pos:]
      return ret
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import os
  import random
  import re
  import subprocess
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import text_encoder
  import tensorflow.compat.v1
label_desc: Use image node_id 15 for calling a global function with example usage: _remove_curly_braces(text) and returns: ret