code: def maybe_parenthesize(sym: str) -> str:
      """Add parentheses around a string if it contains an operator
         and is not already parenthesized.
  
      An exception is made for '*' which is common and harmless
      in the context where the symbolic size is used.
      """
      if sym.startswith("(") and sym.endswith(")"):
          return sym
      if re.match(r"^[\s\w*]+$", sym):
          return sym
      else:
          return f"({sym})"
  
imports: import re
  from analyzer import StackItem, Instruction, Uop
  from dataclasses import dataclass
  from cwriter import CWriter
label_desc: Use image node_id 1 for calling a global function with example usage: maybe_parenthesize(sym) and returns: sym, sym, str, sym, str