code: def select(obj_list):
      if not isinstance(obj_list, (list, tuple)):
          obj_list = [obj_list]
      previous_selection = copy.copy(bpy.context.selected_objects)
      previous_active = bpy.context.active_object
  
      for obj in bpy.context.selected_objects:
          obj.select_set(False)  # deselect everything
      for obj in obj_list:
          obj.select_set(True)  # select target objects
      if obj_list:  # set the active object to the first obj in obj_list
          bpy.context.view_layer.objects.active = obj_list[0]
  
      yield
  
      for obj in bpy.context.selected_objects:
          obj.select_set(False)  # deselect everything
      for obj in previous_selection:
          obj.select_set(True)  # re-select previous selected objects
      if obj_list:  # re-activate previous object
          bpy.context.view_layer.objects.active = previous_active
  
imports: import contextlib
  import copy
  import json
  import pathlib
  import tarfile
  import shutil
  import numpy
  import trimesh
  from kubric.safeimport.bpy import bpy
label_desc: Use image node_id 8 for calling a global function with example usage: select(obj_list) without return types