<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_variable_values( schema: GraphQLSchema, var_def_nodes: List[VariableDefinitionNode], inputs: Dict[str, Any], ) -> CoercedVariableValues: """Get coerced variable values based on provided definitions. Prepares a dict of variable values of the correct type based on the provided variable definitions and arbitrary input. If the input cannot be parsed to match the variable definitions, a GraphQLError will be thrown. """

    errors: List[GraphQLError] = []
    coerced_values: Dict[str, Any] = {}
    for var_def_node in var_def_nodes:
        var_name = var_def_node.variable.name.value
        var_type = type_from_ast(schema, var_def_node.type)
        if not is_input_type(var_type):
            # Must use input types for variables. This should be caught during
            # validation, however is checked again here for safety.
            errors.append(
                GraphQLError(
                    f"Variable '${var_name}' expected value of type"
                    f" '{print_ast(var_def_node.type)}'"
                    " which cannot be used as an input type.",
                    var_def_node.type,
                )
            )
        else:
            var_type = cast(GraphQLInputType, var_type)
            has_value = var_name in inputs
            value = inputs[var_name] if has_value else INVALID
            if not has_value and var_def_node.default_value:
                # If no value was provided to a variable with a default value, use the
                # default value.
                coerced_values[var_name] = value_from_ast(
                    var_def_node.default_value, var_type
                )
            elif (not has_value or value is None) and is_non_null_type(var_type):
                errors.append(
                    GraphQLError(
                        f"Variable '${var_name}' of non-null type"
                        f" '{var_type}' must not be null."
                        if has_value
                        else f"Variable '${var_name}' of required type"
                        f" '{var_type}' was not provided.",
                        var_def_node,
                    )
                )
            elif has_value:
                if value is None:
                    # If the explicit value `None` was provided, an entry in the
                    # coerced values must exist as the value `None`.
                    coerced_values[var_name] = None
                else:
                    # Otherwise, a non-null value was provided, coerce it to the
                    # expected type or report an error if coercion fails.
                    coerced = coerce_value(value, var_type, var_def_node)
                    coercion_errors = coerced.errors
                    if coercion_errors:
                        for error in coercion_errors:
                            error.message = (
                                f"Variable '${var_name}' got invalid"
                                f" value {inspect(value)}; {error.message}"
                            )
                        errors.extend(coercion_errors)
                    else:
                        coerced_values[var_name] = coerced.value
    return (
        CoercedVariableValues(errors, None)
        if errors
        else CoercedVariableValues(None, coerced_values)
    )