code: def complete_leaf_value(return_type: GraphQLLeafType, result: Any) -> Any:
          
          serialized_result = return_type.serialize(result)
          if is_invalid(serialized_result):
              raise TypeError(
                  f"Expected a value of type '{inspect(return_type)}'"
                  f" but received: {inspect(result)}"
              )
          return serialized_result
docs: Complete a leaf value.
  
          Complete a Scalar or Enum by serializing to a valid value, returning null if
          serialization is not possible.