def _get_param_dict(resolver: cirq.ParamResolverOrSimilarType) -> dict[str | sympy.Expr, Any]:
    """Converts a `cirq.ParamResolverOrSimilarType` to a dictionary.

    Args:
        resolver: A parameters resolver that provides values for parameter
            references in the original `cirq.Circuit`.
    Returns:
        A dictionary representation of the `resolver`.
    """
    param_dict: dict[str | sympy.Expr, Any] = {}
    if isinstance(resolver, cirq.ParamResolver):
        param_dict = dict(resolver.param_dict)
    elif isinstance(resolver, dict):
        param_dict = resolver
    return param_dict
Converts a `cirq.ParamResolverOrSimilarType` to a dictionary.

    Args:
        resolver: A parameters resolver that provides values for parameter
            references in the original `cirq.Circuit`.
    Returns:
        A dictionary representation of the `resolver`.
    
cirq-rigetti/cirq_rigetti/circuit_sweep_executors.py