def __init__(
        self,
        param_dict: resolver.ParamResolverOrSimilarType | None = None,
        *,  # Force keyword args
        get_param_name: Callable[[sympy.Expr], str] | None = None,
    ):
        """Initializes a new _ParamFlattener.

        Args:
            param_dict: A default initial mapping from some parameter names,
                symbols, or expressions to other symbols or values.  Only sympy
                expressions and symbols not specified in `param_dict` will be
                flattened.
            get_param_name: A callback function that returns a new parameter
                name for a given sympy expression or symbol.  If this function
                returns the same value for two different expressions, `'_#'` is
                appended to the name to avoid name collision where `#` is the
                number of previous collisions.  By default, returns the
                expression string surrounded by angle brackets e.g. `'<x+1>'`.
        """
        if hasattr(self, '_taken_symbols'):
            # Has already been initialized
            return
        if isinstance(param_dict, resolver.ParamResolver):
            params = param_dict.param_dict
        else:
            params = param_dict if param_dict else {}
        # TODO: Support complex values for typing below.
        symbol_params: resolver.ParamDictType = {
            _ensure_not_str(param): _ensure_not_str(val) for param, val in params.items()
        }
        super().__init__(symbol_params)
        if get_param_name is None:
            get_param_name = self.default_get_param_name
        self.get_param_name = get_param_name
        self._taken_symbols = set(self.param_dict.values())
Initializes a new _ParamFlattener.

        Args:
            param_dict: A default initial mapping from some parameter names,
                symbols, or expressions to other symbols or values.  Only sympy
                expressions and symbols not specified in `param_dict` will be
                flattened.
            get_param_name: A callback function that returns a new parameter
                name for a given sympy expression or symbol.  If this function
                returns the same value for two different expressions, `'_#'` is
                appended to the name to avoid name collision where `#` is the
                number of previous collisions.  By default, returns the
                expression string surrounded by angle brackets e.g. `'<x+1>'`.
        
cirq-core/cirq/study/flatten_expressions.py