code: def _write(self, record: "pb.Record") -> None:
      if not self._ds:
          self.open()
      assert self._flow_control
  
      if not record.control.local:
          self._write_record(record)
  
      if self._use_flow_control:
          self._flow_control.flow(record)
      elif not self._settings._offline or record.control.always_send:
          # when flow_control is disabled we pass through all records to
          # the sender as long as we are online.  The exception is there
          # are special records that we always pass to the sender
          # (namely the exit record so we can trigger the defer shutdown
          # state machine)
          self._forward_record(record)
  
imports: import logging
  from typing import TYPE_CHECKING, Callable, Optional
  from wandb.proto import wandb_internal_pb2
  from wandb.proto import wandb_telemetry_pb2
  from ..interface.interface_queue import InterfaceQueue
  from ..lib import proto_util, telemetry, tracelog
  from .None import context, datastore, flow_control
  from .settings_static import SettingsStatic
label_desc: Use image node_id 10 for calling the WriteManager obj's underlying member method code with example usage: obj._write(record) without return types