<commit_before>angular.module('psResponsive', [])
    .value('psResponsiveConfig', {
        sizes: [{
            name: 'tiny',
            minWidth: 0
        }, {
            name: 'small',
            minWidth: 768
        }, {
            name: 'medium',
            minWidth: 992
        }, {
            name: 'large',
            minWidth: 1200
        }]
    })
    .factory('psResponsive', ['$window', '$filter', '$rootScope', 'psResponsiveConfig',
        function($window, $filter, $rootScope, psResponsiveConfig) {


            var opRegEx = /[<>]=?\s\w+/
            var forEach = angular.forEach,
                filter = angular.filter,
                sizes = psResponsiveConfig.sizes;

            sizes = $filter('orderBy')(sizes, '-minWidth')

            var getHeight = function() {
                return $window.innerHeight
            },

                getWidth = function() {
                    return $window.innerWidth
                },

                getLabel = function() {
                    var cWidth = getWidth(),
                        returnVal = false;
                    for (var i = 0; i < sizes.length; i++) {
                        if (parseInt(cWidth) >= parseInt(sizes[i].minWidth)) {
                            return sizes[i].name
                        }
                    }
                },
                getWidthFromLabel = function(label) {
                    return $filter('filter')(sizes, {
                        name: label
                    })[0]["minWidth"];
                },

                getTest = function(test) {
                    var thingy = test.split(' ')[0],
                        against = test.split(' ')[1];

                    if (isNaN(against)) {
                        return eval('(' + getWidth() + ' ' + thingy + ' ' + getWidthFromLabel(against) + ')');
                    } else {
                        return eval('(' + getWidth() + thingy + parseInt(against) + ')');
                    }
                }

            angular.element($window).on('resize', function() {
                $rootScope.$digest();
            })

            return function(onwha) {
                if (!onwha) {
                    return getLabel()
                } else if (onwha == 'width') {
                    return getWidth();
                } else if (onwha == 'height') {
                    return getHeight();
                } else if (opRegEx.test(onwha)) {
                    return getTest(onwha);
                } else {
                    return (getLabel() == onwha)
                }
                return false;
            }
        }
    ])
<commit_msg>added "orientation" to return . . . wait for it . . . orientation<commit_after>angular.module('psResponsive', [])
    .value('psResponsiveConfig', {
        sizes: [{
            name: 'tiny',
            minWidth: 0
        }, {
            name: 'small',
            minWidth: 768
        }, {
            name: 'medium',
            minWidth: 992
        }, {
            name: 'large',
            minWidth: 1200
        }]
    })
    .factory('psResponsive', ['$window', '$filter', '$rootScope', 'psResponsiveConfig',
        function($window, $filter, $rootScope, psResponsiveConfig) {


            var opRegEx = /[<>]=?\s\w+/,
                forEach = angular.forEach,
                filter = angular.filter,
                sizes = psResponsiveConfig.sizes;
            
            sizes = $filter('orderBy')(sizes, '-minWidth');

                var getHeight = function() {
                    return $window.innerHeight;
            },

                getWidth = function() {
                    return $window.innerWidth;
                },

                getLabel = function() {
                    var cWidth = getWidth(),
                        returnVal = false;
                    for (var i = 0; i < sizes.length; i++) {
                        if (parseInt(cWidth) >= parseInt(sizes[i].minWidth)) {
                            return sizes[i].name;
                        }
                    }
                },
                getWidthFromLabel = function(label) {
                    return $filter('filter')(sizes, {
                        name: label
                    })[0]["minWidth"];
                },

                getTest = function(test) {
                    var thingy = test.split(' ')[0],
                        against = test.split(' ')[1];

                    if (isNaN(against)) {
                        return eval('(' + getWidth() + ' ' + thingy +  ' ' + getWidthFromLabel(against) + ')');
                    } else {
                        return eval('(' + getWidth() + thingy + parseInt(against) + ')');
                    }
                },

                getOrientation = function(){
                    if(getHeight() > getWidth()) return 'portrait';
                    else return 'landscape';
                };

            angular.element($window).on('resize', function() {
                $rootScope.$digest();
            });

            return function(onwha) {
                if (!onwha) {
                    return getLabel();
                } else if (onwha == 'width') {
                    return getWidth();
                } else if (onwha == 'height') {
                    return getHeight();
                } else if (onwha == 'orientation') {
                    return getOrientation();
                } else if (opRegEx.test(onwha)) {
                    return getTest(onwha);
                } else {
                    return (getLabel() == onwha);
                }
                return false;
            };
        }
    ]);

{'fraction_non_alphanumeric': 0.12797619047619047, 'fraction_numerical': 0.005252100840336135, 'mean_word_length': 1.0287642045454546, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '716782', 'n_tokens_mistral': 1513, 'n_tokens_neox': 1376, 'n_words': 281}