def METHOD_NAME(filename, group, estimator, sample=None):
    """Extract data from HDF5 file.
    Parameters
    ----------
    filename : string
        QMCPACK output containing density matrix (*.h5 file).
    group : string
        Path to estimator.
    estimator : string
        Estimator to analyse.
    sample : int
        Sample to extract. Optional. Default None (return everything).
    Returns
    -------
    numer : :class:`numpy.ndarray`
        Numerator of estimator.
    denom : :class:`numpy.ndarray`
        Denominator of estimator.
    """
    with h5py.File(filename, 'r') as fh5:
        dsets = list(fh5[group].keys())
        denom_id = [d for d in dsets if 'denominator' in d]
        numer_id = [d for d in dsets if estimator in d]
        if sample is not None:
            assert sample < len(numer_id)
            numer = from_qmcpack_complex(fh5[group][numer_id[sample]][:])
            denom = from_qmcpack_complex(fh5[group][denom_id[sample]][:])
        else:
            numer = numpy.array([from_qmcpack_complex(fh5[group][d][:]) for d in numer_id])
            denom = numpy.array([from_qmcpack_complex(fh5[group][d][:])[0] for d in denom_id])
        return numer, denom