class_docstr: Synthetic Reasoning benchmark inspired by
  "LIME: Learning Inductive Bias for Primitives of Mathematical Reasoning"
      https://arxiv.org/abs/2101.06223
class_docstr_tok: ["Synthetic","Reasoning","benchmark","inspired","by","''","LIME",":","Learning","Inductive","Bias","for","Primitives","of","Mathematical","Reasoning","''","https",":","\/\/arxiv.org\/abs\/2101.06223"]
docstr: For each of the rule symbol, we sample a random substitution string composed of randomly sampled tokens.
  
  :param rule_symbols: A list of rule symbols.
  :param tokens: Tokens used to construct the substitution.
  :return: We return a substitution dictionary, and its string representation.
docstr_tok: ["For","each","of","the","rule","symbol",",","we","sample","a","random","substitution","string","composed","of","randomly","sampled","tokens",".",":","param","rule_symbols",":","A","list","of","rule","symbols",".",":","param","tokens",":","Tokens","used","to","construct","the","substitution",".",":","return",":","We","return","a","substitution","dictionary",",","and","its","string","representation","."]
code: def gen_subst(
      self, rule_symbols: List[str], tokens: List[str]
  ) -> Tuple[Dict[str, str], str]:
      """
      For each of the rule symbol, we sample a random substitution string composed of randomly sampled tokens.
  
      :param rule_symbols: A list of rule symbols.
      :param tokens: Tokens used to construct the substitution.
      :return: We return a substitution dictionary, and its string representation.
      """
      substitute_dict = {}
      substitute_str = []
      for char in rule_symbols:
          subst_len = self.rng.randint(1, 3)
          subst = " ".join(self.rng.choice(tokens, size=subst_len))
          substitute_dict.update({char: subst})
          substitute_str.append(char)
          substitute_str.append("by")
          substitute_str.append('"')
          substitute_str.append(subst)
          substitute_str.append('"')
          substitute_str.append(",")
      substitute_dict_str = " ".join(substitute_str[:-1])
      return substitute_dict, substitute_dict_str
  
file_path: H2O/h2o_hf/helm/src/helm/benchmark/scenarios/synthetic_reasoning_scenario.py
imports: import numpy
  from typing import List, Dict, Tuple
  from .scenario import Scenario, Instance, Reference, TRAIN_SPLIT, VALID_SPLIT, TEST_SPLIT, CORRECT_TAG, Input, Output
label_desc: Use image node_id 2 for calling the SyntheticReasoningScenario obj's underlying member method code with example usage: obj.gen_subst(rule_symbols, tokens) and returns: substitute_dict,  substitute_dict_str