code: def _fix_a_slash_b(string: str) -> str:
      """Source: https://github.com/hendrycks/math
      Reformat fractions formatted as a/b to \\frac{a}{b}.
      Example:
      >>> _fix_a_slash_b("2/3")
      \frac{2}{3}
      """
      if len(string.split("/")) != 2:
          return string
      a_str = string.split("/")[0]
      b_str = string.split("/")[1]
      try:
          a = int(a_str)
          b = int(b_str)
          if not string == "{}/{}".format(a, b):
              raise AssertionError
          new_string = "\\frac{" + str(a) + "}{" + str(b) + "}"
          return new_string
      except Exception:
          return string
  
file_path: autogen/autogen/math_utils.py
imports: from typing import Optional
  from autogen import oai, DEFAULT_MODEL
label_desc: Use image node_id 5 for calling a global function with example usage: _fix_a_slash_b(string) and returns: string, new_string, string