<commit_before>﻿using System.Linq;
using static System.Console;

namespace FirstConsoleApp
{
    public class PersonHelper
    {
        public (double average, int studentCount, bool belowAverage) 
            GetAverageAndCount(int[] scores, int threshold)
        {
            var result = (average:0D, studentCount:0, belowAverage:true);
            result = (((double)scores.Sum()/scores.Length), scores.Length, result.average.CheckIfBelowAverage(threshold));

            return result;
        }

        /// <summary>
        /// Without Pattern Matching
        /// </summary>
        /// <param name="person"></param>
        public void PrintData(object person)
        {
            switch (person)
            {
                case Student _:
                    var studentObject = (Student) person;
                    WriteLine($"\nStudent {studentObject.Name} {studentObject.LastName} is enrolled for courses {string.Join<int>(", ", studentObject.CourseCodes)}");
                    break;
                case Professor _:
                    var professorObject = (Professor)person;
                    WriteLine($"\nProfessor {professorObject.Name} {professorObject.LastName} teaches {string.Join<string>(", ", professorObject.TeachesSubject)}");
                    break;
            }
        }

        public void PrintDataWithPatternMatching(object person)
        {
            if (person is null)
            {
                WriteLine($" Object {nameof(person)} is null");
            }

            if (person is Student studentObject)
            {
                WriteLine($"\nStudent {studentObject.Name} {studentObject.LastName} is enrolled for courses {string.Join<int>(", ", studentObject.CourseCodes)}");
            }
            if (person is Professor professorObject)
            {
                WriteLine($"\nProfessor {professorObject.Name} {professorObject.LastName} teaches {string.Join<string>(", ", professorObject.TeachesSubject)}");
            }
        }

    }

}<commit_msg>Removed the redundant type<commit_after>﻿using System.Linq;
using static System.Console;

namespace FirstConsoleApp
{
    public class PersonHelper
    {
        public (double average, int studentCount, bool belowAverage) 
            GetAverageAndCount(int[] scores, int threshold)
        {
            var result = (average:0D, studentCount:0, belowAverage:true);
            result = (((double)scores.Sum()/scores.Length), scores.Length, result.average.CheckIfBelowAverage(threshold));

            return result;
        }

        /// <summary>
        /// Without Pattern Matching
        /// </summary>
        /// <param name="person"></param>
        public void PrintData(object person)
        {
            switch (person)
            {
                case Student _:
                    var studentObject = (Student) person;
                    WriteLine($"\nStudent {studentObject.Name} {studentObject.LastName} is enrolled for courses {string.Join(", ", studentObject.CourseCodes)}");
                    break;
                case Professor _:
                    var professorObject = (Professor)person;
                    WriteLine($"\nProfessor {professorObject.Name} {professorObject.LastName} teaches {string.Join<string>(", ", professorObject.TeachesSubject)}");
                    break;
            }
        }

        /// <summary>
        /// Pattern Matching with "is" keyword
        /// </summary>
        /// <param name="person"></param>
        public void PrintDataWithPatternMatching(object person)
        {
            if (person is null)
            {
                WriteLine($" Object {nameof(person)} is null");
            }

            if (person is Student studentObject)
            {
                WriteLine($"\nStudent {studentObject.Name} {studentObject.LastName} is enrolled for courses {string.Join(", ", studentObject.CourseCodes)}");
            }
            if (person is Professor professorObject)
            {
                WriteLine($"\nProfessor {professorObject.Name} {professorObject.LastName} teaches {string.Join<string>(", ", professorObject.TeachesSubject)}");
            }
        }

    }

}
{'fraction_non_alphanumeric': 0.11200951248513674, 'fraction_numerical': 0.0009512485136741974, 'mean_word_length': 1.8749145591250855, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '2264278', 'n_tokens_mistral': 1085, 'n_tokens_neox': 993, 'n_words': 234}