'Reads a data file and returns an iterable that can be used
as testing or training data.'

def _read_data(self, dataset, format=None):

    if (not format):
        format_class = formats.detect(dataset)
        if (not format_class):
            raise FormatError('Could    not    automatically    detect    format    for    the    given    data    source.')
    else:
        registry = formats.get_registry()
        if (format not in registry.keys()):
            raise ValueError("'{0}'    format    not    supported.".format(format))
        format_class = registry[format]
    return format_class(dataset, **self.format_kwargs).to_iterable()
