def resolve(var_name, scope):
    """ Finds the given symbol (a function or a variable) in the scope. Reports
    error if not found.

    Args:
        var_name (str): Name of the symbol to be found.
        scope (dict): Local variables.

    Returns:
        Found variable or a function.
    """
    variable = scope.get(var_name)
    fail_msg = "'{}' is not defined in the current scope".format(var_name)
    assert variable is not None, fail_msg
    return variable