code: def _fix_sqrt(string: str) -> str:
      """Source: https://github.com/hendrycks/math
  
      Reformat square roots.
  
      Example:
      >>> _fix_sqrt("\\sqrt3")
      \sqrt{3}
      """
      if "\\sqrt" not in string:
          return string
      splits = string.split("\\sqrt")
      new_string = splits[0]
      for split in splits[1:]:
          if split[0] != "{":
              a = split[0]
              new_substr = "\\sqrt{" + a + "}" + split[1:]
          else:
              new_substr = "\\sqrt" + split
          new_string += new_substr
      return new_string
  
file_path: H2O/h2o_hf/helm/src/helm/benchmark/scenarios/math_scenario.py
imports: import collections
  import typing
  from typing import Dict, List, Optional
  from datasets import load_dataset, DatasetDict
  from .scenario import Scenario, Instance, Reference, TRAIN_SPLIT, TEST_SPLIT, CORRECT_TAG, Input, Output
label_desc: Use image node_id 6 for calling a global function with example usage: _fix_sqrt(string) and returns: new_string, string