# Path: surprise/builtin_datasets.py
# BUILTIN_DATASETS = {
#     'ml-100k':
#         BuiltinDataset(
#             url='http://files.grouplens.org/datasets/movielens/ml-100k.zip',
#             path=join(get_dataset_dir(), 'ml-100k/ml-100k/u.data'),
#             reader_params=dict(line_format='user item rating timestamp',
#                                rating_scale=(1, 5),
#                                sep='\t')
#         ),
#     'ml-1m':
#         BuiltinDataset(
#             url='http://files.grouplens.org/datasets/movielens/ml-1m.zip',
#             path=join(get_dataset_dir(), 'ml-1m/ml-1m/ratings.dat'),
#             reader_params=dict(line_format='user item rating timestamp',
#                                rating_scale=(1, 5),
#                                sep='::')
#         ),
#     'jester':
#         BuiltinDataset(
#             url='http://eigentaste.berkeley.edu/dataset/archive/jester_dataset_2.zip',
#             path=join(get_dataset_dir(), 'jester/jester_ratings.dat'),
#             reader_params=dict(line_format='user item rating',
#                                rating_scale=(-10, 10))
#         )
# }


from .builtin_datasets import BUILTIN_DATASETS
    are useful if you want to use a custom dataset that has the same format as
    a built-in one (see the ``name`` parameter).


    Args:
        name(:obj:`string`, optional): If specified, a Reader for one of the
            built-in datasets is returned and any other parameter is ignored.
            Accepted values are 'ml-100k', 'ml-1m', and 'jester'. Default
            is ``None``.
        line_format(:obj:`string`): The fields names, in the order at which
            they are encountered on a line. Please note that ``line_format`` is
            always space-separated (use the ``sep`` parameter). Default is
            ``'user item rating'``.
        sep(char): the separator between fields. Example : ``';'``.
        rating_scale(:obj:`tuple`, optional): The rating scale used for every
            rating.  Default is ``(1, 5)``.
        skip_lines(:obj:`int`, optional): Number of lines to skip at the
            beginning of the file. Default is ``0``.

    """

    def __init__(self, name=None, line_format='user item rating', sep=None,
                 rating_scale=(1, 5), skip_lines=0):

        if name:
            try:
                self.__init__(**BUILTIN_DATASETS[name].reader_params)
            except KeyError:
                raise ValueError('unknown reader ' + name +
                                 '. Accepted values are ' +

# Path: surprise/builtin_datasets.py
# BUILTIN_DATASETS = {
#     'ml-100k':
#         BuiltinDataset(
#             url='http://files.grouplens.org/datasets/movielens/ml-100k.zip',
#             path=join(get_dataset_dir(), 'ml-100k/ml-100k/u.data'),
#             reader_params=dict(line_format='user item rating timestamp',
#                                rating_scale=(1, 5),
#                                sep='\t')
#         ),
#     'ml-1m':
#         BuiltinDataset(
#             url='http://files.grouplens.org/datasets/movielens/ml-1m.zip',
#             path=join(get_dataset_dir(), 'ml-1m/ml-1m/ratings.dat'),
#             reader_params=dict(line_format='user item rating timestamp',
#                                rating_scale=(1, 5),
#                                sep='::')
#         ),
#     'jester':
#         BuiltinDataset(
#             url='http://eigentaste.berkeley.edu/dataset/archive/jester_dataset_2.zip',
#             path=join(get_dataset_dir(), 'jester/jester_ratings.dat'),
#             reader_params=dict(line_format='user item rating',
#                                rating_scale=(-10, 10))
#         )
# }


# Path: surprise/reader.py
from .builtin_datasets import BUILTIN_DATASETS

    are useful if you want to use a custom dataset that has the same format as
    a built-in one (see the ``name`` parameter).


    Args:
        name(:obj:`string`, optional): If specified, a Reader for one of the
            built-in datasets is returned and any other parameter is ignored.
            Accepted values are 'ml-100k', 'ml-1m', and 'jester'. Default
            is ``None``.
        line_format(:obj:`string`): The fields names, in the order at which
            they are encountered on a line. Please note that ``line_format`` is
            always space-separated (use the ``sep`` parameter). Default is
            ``'user item rating'``.
        sep(char): the separator between fields. Example : ``';'``.
        rating_scale(:obj:`tuple`, optional): The rating scale used for every
            rating.  Default is ``(1, 5)``.
        skip_lines(:obj:`int`, optional): Number of lines to skip at the
            beginning of the file. Default is ``0``.

    """

    def __init__(self, name=None, line_format='user item rating', sep=None,
                 rating_scale=(1, 5), skip_lines=0):

        if name:
            try:
                self.__init__(**BUILTIN_DATASETS[name].reader_params)
            except KeyError:
                raise ValueError('unknown reader ' + name +
                                 '. Accepted values are ' +

                                 ', '.join(BUILTIN_DATASETS.keys()) + '.')