<commit_before>require 'thor'

module GithubSniffer
  module Cli
    class Application < Thor

      desc 'test NAME', 'test name'
      def test(name)
        greeting = "Test is fine, #{name}"
        puts greeting
      end

      desc 'get_user USERNAME', 'Returns github profile of user'
      def get_user(username)
        github = Github.new(user: username)
        languages = {}

        # Cyle throug repos and sum up the main language
        github.repos.list.each do |repo|
          repo_language = repo.language.to_s.downcase!

          languages[repo_language] = 0 if languages[repo_language].nil?
          languages[repo_language] += 1
        end

        p languages
      end

    end # Application
  end # Cli
end # GithubSniffer<commit_msg>Displaying return value<commit_after>require 'thor'

module GithubSniffer
  module Cli
    class Application < Thor

      desc 'test NAME', 'test name'
      def test(name)
        greeting = "Test is fine, #{name}"
        puts greeting
      end

      desc 'get_user USERNAME', 'Returns github profile of user'
      def get_user(username)
        github = Github.new(user: username)
        languages = {}

        # Cyle throug repos and sum up the main language
        github.repos.list.each do |repo|
          repo_language = repo.language.to_s.downcase!

          languages[repo_language] = 0 if languages[repo_language].nil?
          languages[repo_language] += 1
        end

        prefered_lang = languages.sort_by{ |_k, value| value }.last

        p "#{username} has #{prefered_lang[0]} as main language in #{prefered_lang[1]} repos."
      end

    end # Application
  end # Cli
end # GithubSniffer
{'fraction_non_alphanumeric': 0.0855106888361045, 'fraction_numerical': 0.0035629453681710215, 'mean_word_length': 2.356573705179283, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '3383044', 'n_tokens_mistral': 519, 'n_tokens_neox': 486, 'n_words': 151}