<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def resolve_parameters( val: Any, param_resolver: 'cirq.ParamResolverOrSimilarType') -> Any: """Resolves symbol parameters in the effect using the param resolver. This function will use the `_resolve_parameters_` magic method of `val` to resolve any Symbols with concrete values from the given parameter resolver. Args: val: The object to resolve (e.g. the gate, operation, etc) param_resolver: the object to use for resolving all symbols Returns: a gate or operation of the same type, but with all Symbols replaced with floats according to the given ParamResolver. If `val` has no `_resolve_parameters_` method or if it returns NotImplemented, `val` itself is returned. """

    if not param_resolver:
        return val

    # Ensure its a dictionary wrapped in a ParamResolver.
    from cirq import ParamResolver  # HACK: break cycle.
    param_resolver = ParamResolver(param_resolver)
    if isinstance(val, sympy.Basic):
        return param_resolver.value_of(val)

    getter = getattr(val, '_resolve_parameters_', None)
    result = NotImplemented if getter is None else getter(param_resolver)

    if result is not NotImplemented:
        return result
    else:
        return val