code: def _safe_save(group, array, name):
      """Safe saving of arrays with specific names
  
      Parameters
      ----------
      group : HDF5 group
      array : array
      name : string
      """
  
      if array is not None:
          ds = group.create_dataset(
              name, shape=array.shape, dtype=array.dtype, chunks=True
          )
          ds[:] = array
  
file_path: dipy/dipy/io/peaks.py
imports: import os
  import numpy
  from dipy.direction.peaks import PeaksAndMetrics, reshape_peaks_for_visualization
  from dipy.core.sphere import Sphere
  from dipy.io.image import save_nifti
  import h5py
label_desc: Use image node_id 1 for calling a global function with example usage: _safe_save(group, array, name) without return types