def new_metadata_path(dataset_path):
    """
    Get the path where we should write a metadata file for this dataset.

    :type dataset_path: Path
    :rtype: Path
    """
    if dataset_path.is_dir():
        return dataset_path.joinpath('ga-metadata.yaml')
    if dataset_path.is_file():
        return dataset_path.parent.joinpath('{}.ga-md.yaml'.format(
            dataset_path.name))
    raise ValueError('Unhandled path type for %r' % dataset_path)
