code: def activate_render_passes(
      normal: bool = True,
      optical_flow: bool = True,
      segmentation: bool = True,
      uv: bool = True,
      depth: bool = True,
  ):
      # We use two separate view layers
      # 1) the default view layer renders the image and uses many samples per pixel
      # 2) the aux view layer uses only 1 sample per pixel to avoid anti-aliasing
  
      # Starting in Blender 3.0 the depth-pass must be activated separately
      if depth:
          default_view_layer = bpy.context.scene.view_layers[0]
          default_view_layer.use_pass_z = True
  
      aux_view_layer = bpy.context.scene.view_layers.new("AuxOutputs")
      aux_view_layer.samples = (
          1  # only use 1 ray per pixel to disable anti-aliasing
      )
      aux_view_layer.use_pass_z = False  # no need for a separate z-pass
      aux_view_layer.material_override = add_coordinate_material()
      if hasattr(aux_view_layer, "aovs"):
          object_coords_aov = aux_view_layer.aovs.add()
      else:
          # seems that some versions of blender use this form instead
          object_coords_aov = aux_view_layer.cycles.aovs.add()
  
      object_coords_aov.name = "ObjectCoordinates"
      aux_view_layer.cycles.use_denoising = False
  
      # For optical flow, uv, and normals we use the aux view layer
      aux_view_layer.use_pass_vector = optical_flow
      aux_view_layer.use_pass_uv = uv
      aux_view_layer.use_pass_normal = normal  # surface normals
      # We use the default view layer for segmentation, so that we can get
      # anti-aliased crypto-matte
      if bpy.app.version >= (2, 93, 0):
          aux_view_layer.use_pass_cryptomatte_object = segmentation
          if segmentation:
              aux_view_layer.pass_cryptomatte_depth = 2
      else:
          aux_view_layer.cycles.use_pass_crypto_object = segmentation
          if segmentation:
              aux_view_layer.cycles.pass_crypto_depth = 2
  
imports: import contextlib
  import copy
  import functools
  import sys
  from typing import Dict, Sequence, Tuple, Union
  import numpy
  import OpenEXR
  import Imath
  import sklearn.utils
  import trimesh
  from kubric import core
  from kubric.kubric_typing import AddAssetFunction, ArrayLike
  from kubric.redirect_io import RedirectStream
  from kubric.safeimport.bpy import bpy
label_desc: Use image node_id 5 for calling a global function with example usage: activate_render_passes(normal, optical_flow, segmentation, uv, depth) without return types