<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def build_response( self, data: AwaitableOrValue[Optional[Dict[str, Any]]] ) -> AwaitableOrValue[ExecutionResult]: """Build response. Given a completed execution context and data, build the (data, errors) response defined by the "Response" section of the GraphQL spec. """

        if isawaitable(data):

            async def build_response_async():
                return self.build_response(await data)

            return build_response_async()
        data = cast(Optional[Dict[str, Any]], data)
        errors = self.errors
        if not errors:
            return ExecutionResult(data, None)
        # Sort the error list in order to make it deterministic, since we might have
        # been using parallel execution.
        errors.sort(key=lambda error: (error.locations, error.path, error.message))
        return ExecutionResult(data, errors)