class_docstr: A writable datasource that logs node IDs of write tasks, for testing.
class_docstr_tok: ["A","writable","datasource","that","logs","node","IDs","of","write","tasks",",","for","testing","."]
code: def write(
      self,
      blocks: Iterable[Block],
      ctx: TaskContext,
      **write_args,
  ) -> WriteResult:
      data_sink = self.data_sink
  
      def write(b):
          node_id = ray.get_runtime_context().get_node_id()
          return data_sink.write.remote(node_id, b)
  
      tasks = []
      for b in blocks:
          tasks.append(write(b))
      ray.get(tasks)
      return "ok"
  
imports: import os
  from typing import Iterable, List
  import pandas
  import pyarrow
  import pyarrow.parquet
  import pytest
  import torchvision
  from fsspec.implementations.http import HTTPFileSystem
  from fsspec.implementations.local import LocalFileSystem
  import ray
  from ray._private.test_utils import wait_for_condition
  from ray.data._internal.execution.interfaces import TaskContext
  from ray.data.block import Block, BlockAccessor
  from ray.data.datasource import Datasource, DummyOutputDatasource, WriteResult
  from ray.data.datasource.file_meta_provider import _handle_read_os_error
  from ray.data.tests.conftest import *
  from ray.data.tests.mock_http_server import *
  from ray.data.tests.util import extract_values
  from ray.tests.conftest import *
  from ray.types import ObjectRef
label_desc: Use image node_id 2 for calling the NodeLoggerOutputDatasource obj's underlying member method code with example usage: obj.write(blocks, ctx) and returns: str, data_sink