def METHOD_NAME(
    filename, lazy=False, metadata_key=None, verbose=False, skip_array_metadata=False
):
    """
    Read the metadata from a NeXus or ``.hdf`` file.
    This method iterates through the hdf5 file and returns a dictionary of
    the entries.
    This is a convenience method to inspect a file for a value
    rather than loading the file as a signal.
    Parameters
    ----------
    %s
    %s
    metadata_key : None, str, list of str, default=None
        None will return all datasets found including linked data.
        Providing a string or list of strings will only return items
        which contain the string(s).
        For example, search_keys = ["instrument","Fe"] will return
        hdf entries with "instrument" or "Fe" in their hdf path.
    verbose : bool, default=False
        Pretty print the results to screen.
    skip_array_metadata : bool, default=False
        Whether to skip loading array metadata. This is useful as a lot of
        large array may be present in the metadata and it is redundant with
        dataset itself.
    Returns
    -------
    dict
        Metadata dictionary.
    See Also
    --------
    rsciio.utils.hdf5.list_datasets_in_file : Convenience function to list
        datasets present in a file.
    """
    search_keys = _check_search_keys(metadata_key)
    fin = h5py.File(filename, "r")
    # search for NXdata sets...
    # strip out the metadata (basically everything other than NXdata)
    stripped_metadata = _load_metadata(
        fin, lazy=lazy, skip_array_metadata=skip_array_metadata
    )
    stripped_metadata = _find_search_keys_in_dict(
        stripped_metadata, search_keys=search_keys
    )
    if verbose:
        pprint.pprint(stripped_metadata)
    fin.close()
    return stripped_metadata