<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_dataset(h5o, path=None):
 """Find and return the relevant dataset inside the given H5 object If ``path=None`` is given, and ``h5o`` contains a single dataset, that will be returned Parameters h5o : `h5py.File`, `h5py.Group` the HDF5 object in which to search path : `str`, optional the path (relative to ``h5o``) of the desired data set Returns ------- dset : `h5py.Dataset` the recovered dataset object Raises ------ ValueError if ``path=None`` and the HDF5 object contains multiple datasets KeyError if ``path`` is given but is not found within the HDF5 object """

    # find dataset
    if isinstance(h5o, h5py.Dataset):
        return h5o
    elif path is None and len(h5o) == 1:
        path = list(h5o.keys())[0]
    elif path is None:
        raise ValueError("Please specify the HDF5 path via the "
                         "``path=`` keyword argument")
    return h5o[path]