code: def _calculate_bin_centers(boundaries: torch.Tensor):
      step = boundaries[1] - boundaries[0]
      bin_centers = boundaries + step / 2
      bin_centers = torch.cat(
          [bin_centers, (bin_centers[-1] + step).unsqueeze(-1)], dim=0
      )
      return bin_centers
  
imports: from typing import Dict, Optional, Tuple
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: _calculate_bin_centers(boundaries) and returns: bin_centers