code: def is_locked(device):
      q = Queue()
      device_id = (
          -1
          if (device.type() == C.device.DeviceKind.CPU)
          else device.id()
      )
      p = Process(target=is_locked_cross_process, args=(q, device_id))
      p.start()
      p.join()
      assert p.exitcode == 0
      return q.get()
  
imports: import numpy
  import pytest
  import cntk
  from multiprocessing import Process, Queue
label_desc: Use image node_id 2 for calling a global function with example usage: is_locked(device) and returns: q