code: def handle_soft_device_variable(*args, fn, **kwargs):
      (
          args,
          kwargs,
          device_shifting_dev,
      ) = _shift_native_arrays_on_default_device(*args, **kwargs)
      # since there is no context manager for device in Paddle,
      # we need to manually set the device
      # then set it back to prev default device after the function call
      prev_def_dev = paddle.get_device()
      paddle.device.set_device(ivy.as_ivy_dev(device_shifting_dev))
      ret = fn(*args, **kwargs)
      paddle.device.set_device(ivy.as_ivy_dev(prev_def_dev))
      return ret
  
imports: import os
  import paddle
  from typing import Optional, Union
  import time
  import ivy
  from ivy.functional.ivy.device import _shift_native_arrays_on_default_device, Profiler
  from paddle.device import core
label_desc: Use image node_id 10 for calling a global function with example usage: handle_soft_device_variable() and returns: ret