def value_of(
        self, value: cirq.TParamKey | cirq.TParamValComplex, recursive: bool = False
    ) -> cirq.TParamValComplex:
        """Resolves a symbol or expression to a new symbol unique to that value.

        - If value is a float, returns it.
        - If value is a str, treat it as a symbol with that name and continue.
        - Otherwise return a symbol unique to the given value.  Return
            `param_dict[value]` if it exists or create a new symbol and add it
            to `param_dict`.

        Args:
            value: The sympy.Symbol, sympy expression, name, or float to resolve
                to a unique symbol or float.
            recursive: Unused argument from ParamResolver.

        Returns:
            The unique symbol or value of the parameter as resolved by this
            resolver.
        """
        if isinstance(value, numbers.Complex):
            return value
        if isinstance(value, str):
            value = sympy.Symbol(value)
        out = self.param_dict.get(value, None)
        if out is not None:
            return out
        # Create a new symbol
        symbol = self._next_symbol(value)
        self._param_dict[value] = symbol
        self._taken_symbols.add(symbol)
        return symbol
Resolves a symbol or expression to a new symbol unique to that value.

        - If value is a float, returns it.
        - If value is a str, treat it as a symbol with that name and continue.
        - Otherwise return a symbol unique to the given value.  Return
            `param_dict[value]` if it exists or create a new symbol and add it
            to `param_dict`.

        Args:
            value: The sympy.Symbol, sympy expression, name, or float to resolve
                to a unique symbol or float.
            recursive: Unused argument from ParamResolver.

        Returns:
            The unique symbol or value of the parameter as resolved by this
            resolver.
        
cirq-core/cirq/study/flatten_expressions.py