code: def _get_floor_scale_position_kwargs(
      spawn_region: List[Tuple[int, int, int]],
  ) -> Dict[str, Tuple[float, float, float]]:
      """Constructs scale, position of the cube representing the floor.
  
      Cube's scale and position are chosen such that the cube's top surface lies
      strictly inside of spawn_region.
  
      Args:
        spawn_region: Region of the floor.
  
      Returns:
        {'scale': <XYZ multipliers for [-1, 1] cube>,
         'position': <XYZ center of floor cube>}
      """
      spawn_min, spawn_max = np.array(spawn_region)
  
      # Center of spawn position.
      position = (spawn_max + spawn_min) / 2
  
      # Set center of floor to be equal to bottom of spawn region.
      position[-1] = spawn_min[-1]
      # Default cube has coordinates [[-1, -1, -1], [1, 1, 1]], so default cube
      # length is 2. So we scale floor by 2.
      scale = (spawn_max - spawn_min) / 2
      scale[-1] = 1e-8  # Floor height is minimal.
      return dict(
          position=tuple(position),
          scale=tuple(scale),
      )
  
file_path: kubric/challenges/robust_nerf/worker.py
imports: import collections
  import json
  import logging
  from typing import Dict, List, Optional, Tuple
  import kubric
  import kubric.renderer.blender
  import kubric.simulator.pybullet
  import numpy
  import tensorflow
  import bpy
label_desc: Use image node_id 5 for calling a global function with example usage: _get_floor_scale_position_kwargs(spawn_region) and returns: dict