code: def test_to_device_warnings(dedup_between_calls) -> None:
      # Capture warning logs as elements in a queue.
      logger = logging.getLogger()
      q = queue.Queue()
      handler = handlers.QueueHandler(q)
      logger.addHandler(handler)
      try:
          warned_types = set() if dedup_between_calls else None
          to_device(["string_data", "string_data"], "cpu", warned_types)
          to_device(["string_data", "string_data"], "cpu", warned_types)
  
          assert q.qsize() == 1 if dedup_between_calls else 2
          while q.qsize():
              msg = q.get().message
              assert "not able to move data" in msg
      finally:
          # Restore logging as it was before.
          logger.removeHandler(handler)
  
imports: import logging
  import queue
  import typing
  from logging import handlers
  import numpy
  import pytest
  import torch
  import determined
  from determined.pytorch import data_length, samplers, to_device
label_desc: Use image node_id 17 for calling a global function with example usage: test_to_device_warnings(dedup_between_calls) without return types