<commit_before>function DatasetListController($scope, $location, rest, $rootScope, $sce, $routeParams, DatasetListService) {
    $rootScope.isDatasetView = true;
    $scope.params = {
        sort: 'ASC',
        //condition: 'AND',
        include: ['files', 'tags', 'categories'].join(),
        limit: 10,
        skip: 0,
        'categories.slug': $routeParams['categories.slug'],
    };
    $scope.modelName = "Dataset";
    $rootScope.header = "Datasets List";
    $scope.downloads = [];
    $scope.datasets = [];
    $scope.resultDatasetsSearch = [];
    $scope.showLoading = true;
    $scope.url_api = $rootScope.url;

    DatasetListService.getDatasetsCount(null, function(result) {
        $scope.countDatasets = result.data.count;
    });

    $scope.loadResults = function(limit) {
        $scope.showLoading = true;
        if (limit) {
            $scope.params.skip += limit;
        } else {
            $scope.params.skip = 0;
        }
        DatasetListService.getDatasets($scope.params, function(datasets) {
            $scope.datasets = datasets.map(function(dataset) {
                if ($scope.downloads.length) {
                    var downloadsCount = $scope.downloads
                        .filter(function(download) {
                            return download.dataset === dataset.id;
                        })
                        .map(function(download) {
                            return download.downloads;
                        });
                    dataset.downloads = downloadsCount.length ? downloadsCount[0] : 0;
                }

                dataset.additional_info = [];
                angular.forEach(dataset.optionals, function(val, key) {
                    dataset.additional_info.push({
                        clave: key,
                        valor: val
                    });
                });

                dataset.fileTypes = [];
                $scope.filesResults = rest().get({
                    type: 'files',
                    params: 'include=tags&dataset=' + dataset.id
                }, function(result) {
                    $scope.files = result.data;
                    $scope.files.forEach(function(element) {
                        rest().findOne({
                            id: element.type.id,
                            type: 'filetypes'
                        }, function(resultFileType) {
                            var resultFileTypeName = resultFileType.name;
                            if (dataset.fileTypes.indexOf(resultFileTypeName) === -1) {
                                dataset.fileTypes.push(resultFileTypeName);
                            }
                        });
                    });
                });

                return dataset;
            });
            $scope.showLoading = false;
            $scope.count = $scope.datasets.length;
        });
    };

    DatasetListService.getDownloadResults($scope.params, function(downloads) {
        $scope.downloads = downloads;
        $scope.loadResults(0);
    });

    $scope.view = function(model) {
        var url = '/datasets/' + model.id + "/view";
        $location.path(url);
    };
    $scope.getHtml = function(html) {
        return $sce.trustAsHtml(html);
    };

    $scope.paging = function(event, page, pageSize, total) {
        var skip = (page - 1) * $scope.params.limit;
        $scope.loadResults(skip);
    };

    function downloadsDesc(a, b) {
        // sort DESC
        if (a.downloads < b.downloads) {
            return 1;
        }
        if (a.downloads > b.downloads) {
            return -1;
        }
        // a must be equal to b
        return 0;
    }
}<commit_msg>Includes 'AND' condition on datasets list<commit_after>function DatasetListController($scope, $location, rest, $rootScope, $sce, $routeParams, DatasetListService) {
    $rootScope.isDatasetView = true;
    $scope.params = {
        sort: 'ASC',
        condition: 'AND',
        include: ['files', 'tags', 'categories'].join(),
        limit: 10,
        skip: 0,
        'categories.slug': $routeParams['categories.slug'],
    };
    $scope.modelName = "Dataset";
    $rootScope.header = "Datasets List";
    $scope.downloads = [];
    $scope.datasets = [];
    $scope.resultDatasetsSearch = [];
    $scope.showLoading = true;
    $scope.url_api = $rootScope.url;

    DatasetListService.getDatasetsCount(null, function(result) {
        $scope.countDatasets = result.data.count;
    });

    $scope.loadResults = function(limit) {
        $scope.showLoading = true;
        if (limit) {
            $scope.params.skip += limit;
        } else {
            $scope.params.skip = 0;
        }
        DatasetListService.getDatasets($scope.params, function(datasets) {
            $scope.datasets = datasets.map(function(dataset) {
                if ($scope.downloads.length) {
                    var downloadsCount = $scope.downloads
                        .filter(function(download) {
                            return download.dataset === dataset.id;
                        })
                        .map(function(download) {
                            return download.downloads;
                        });
                    dataset.downloads = downloadsCount.length ? downloadsCount[0] : 0;
                }

                dataset.additional_info = [];
                angular.forEach(dataset.optionals, function(val, key) {
                    dataset.additional_info.push({
                        clave: key,
                        valor: val
                    });
                });

                dataset.fileTypes = [];
                $scope.filesResults = rest().get({
                    type: 'files',
                    params: 'include=tags&dataset=' + dataset.id
                }, function(result) {
                    $scope.files = result.data;
                    $scope.files.forEach(function(element) {
                        rest().findOne({
                            id: element.type.id,
                            type: 'filetypes'
                        }, function(resultFileType) {
                            var resultFileTypeName = resultFileType.name;
                            if (dataset.fileTypes.indexOf(resultFileTypeName) === -1) {
                                dataset.fileTypes.push(resultFileTypeName);
                            }
                        });
                    });
                });

                return dataset;
            });
            $scope.showLoading = false;
            $scope.count = $scope.datasets.length;
        });
    };

    DatasetListService.getDownloadResults($scope.params, function(downloads) {
        $scope.downloads = downloads;
        $scope.loadResults(0);
    });

    $scope.view = function(model) {
        var url = '/datasets/' + model.id + "/view";
        $location.path(url);
    };
    $scope.getHtml = function(html) {
        return $sce.trustAsHtml(html);
    };

    $scope.paging = function(event, page, pageSize, total) {
        var skip = (page - 1) * $scope.params.limit;
        $scope.loadResults(skip);
    };

    function downloadsDesc(a, b) {
        // sort DESC
        if (a.downloads < b.downloads) {
            return 1;
        }
        if (a.downloads > b.downloads) {
            return -1;
        }
        // a must be equal to b
        return 0;
    }
}
{'fraction_non_alphanumeric': 0.12169454937938479, 'fraction_numerical': 0.0032379924446842958, 'mean_word_length': 1.3866709594333548, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 42, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5549778', 'n_tokens_mistral': 2005, 'n_tokens_neox': 1904, 'n_words': 331}