'Provides a block of data from a dataset.'

def _data(self, trans, dataset, chrom, low, high, start_val=0, max_vals=None, **kwargs):

    if (not chrom):
        return dataset.conversion_messages.NO_DATA
    msg = self.hda_manager.data_conversion_status(dataset)
    if msg:
        return msg
    data_sources = dataset.get_datasources(trans)
    messages_list = [data_source_dict['message'] for data_source_dict in data_sources.values()]
    return_message = self._get_highest_priority_msg(messages_list)
    if return_message:
        return return_message
    extra_info = None
    mode = kwargs.get('mode', 'Auto')
    data_provider_registry = trans.app.data_provider_registry
    indexer = None
    if (mode == 'Coverage'):
        indexer = data_provider_registry.get_data_provider(trans, original_dataset=dataset, source='index')
        return indexer.get_data(chrom, low, high, **kwargs)
    if (mode == 'Auto'):
        indexer = data_provider_registry.get_data_provider(trans, original_dataset=dataset, source='index')
        stats = indexer.get_data(chrom, low, high, stats=True)
        if ('stats' in kwargs):
            if (stats['data']['max'] == 0):
                return {'dataset_type': indexer.dataset_type, 'data': None}
            else:
                return stats
        features_per_pixel = (stats['data']['max'] * float(kwargs['resolution']))
        if (((int(high) - int(low)) > 50000) and (features_per_pixel > 1000)):
            return indexer.get_data(chrom, low, high)
    data_provider = data_provider_registry.get_data_provider(trans, original_dataset=dataset, source='data')
    if (max_vals is None):
        max_vals = data_provider.get_default_max_vals()
    region = None
    mean_depth = None
    if isinstance(data_provider, (SamDataProvider, BamDataProvider)):
        if dataset.dbkey:
            region = self.app.genomes.reference(trans, dbkey=dataset.dbkey, chrom=chrom, low=max(0, (int(low) - 1000000)), high=(int(high) + 1000000))
        if (not indexer):
            indexer = data_provider_registry.get_data_provider(trans, original_dataset=dataset, source='index')
        stats = indexer.get_data(chrom, low, high, stats=True)
        mean_depth = stats['data']['mean']
    result = data_provider.get_data(chrom, int(low), int(high), int(start_val), int(max_vals), ref_seq=region, mean_depth=mean_depth, **kwargs)
    result.update({'dataset_type': data_provider.dataset_type, 'extra_info': extra_info})
    return result
