class_docstr: A simple polynomial class over the integers that supports evaluation and pretty-printing.
class_docstr_tok: ["A","simple","polynomial","class","over","the","integers","that","supports","evaluation","and","pretty-printing","."]
code: def from_string(cls, expr_str: str, degree: int, num_variables: int):
      expr = sympy.parse_expr(
          expr_str.replace("^", "**"),
          transformations=SYMPY_TRANSFORMATIONS,
      )
      poly = Poly(
          expr, list(sorted(expr.free_symbols, key=lambda _: _.name))
      )
      return sympy_poly_to_poly(poly, degree, num_variables)
  
imports: from collections import defaultdict
  from dataclasses import dataclass, field
  from itertools import combinations_with_replacement, product
  import math
  from math import comb
  import numpy
  import numpy.typing
  import random
  import sympy
  from sympy import Symbol, Poly, diff
  from sympy.parsing.sympy_parser import standard_transformations, implicit_multiplication_application
  from typing import List, Optional, Tuple, Dict
  from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_GENERATION
  from helm.benchmark.adaptation.adapter_spec import AdapterSpec
  from helm.benchmark.window_services.tokenizer_service import TokenizerService
  from helm.common.authentication import Authentication
  from helm.proxy.services.server_service import ServerService
  from .scenario import Scenario, Instance, Reference, TRAIN_SPLIT, TEST_SPLIT, CORRECT_TAG, Input, Output
label_desc: Use image node_id 4 for calling the Polynomial obj's underlying member method code with example usage: obj.from_string(cls, expr_str, degree, num_variables) and returns: sympy_poly_to_poly