code: def _fix_fracs(string):
      substrs = string.split("\\frac")
      new_str = substrs[0]
      if len(substrs) > 1:
          substrs = substrs[1:]
          for substr in substrs:
              new_str += "\\frac"
              if substr[0] == "{":
                  new_str += substr
              else:
                  try:
                      assert len(substr) >= 2
                  except:
                      return string
                  a = substr[0]
                  b = substr[1]
                  if b != "{":
                      if len(substr) > 2:
                          post_substr = substr[2:]
                          new_str += (
                              "{" + a + "}{" + b + "}" + post_substr
                          )
                      else:
                          new_str += "{" + a + "}{" + b + "}"
                  else:
                      if len(substr) > 2:
                          post_substr = substr[2:]
                          new_str += "{" + a + "}" + b + post_substr
                      else:
                          new_str += "{" + a + "}" + b
      string = new_str
      return string
  
imports: import difflib
  import re
  import string
  from collections import Counter
  import jieba
  from fuzzywuzzy import fuzz
  from rouge import Rouge
label_desc: Use image node_id 1 for calling a global function with example usage: _fix_fracs(string) and returns: string, string