Return the most common detected programming language as the primary language.
(programming_language_tallies)
| 201 | |
| 202 | |
| 203 | def get_primary_language(programming_language_tallies): |
| 204 | """ |
| 205 | Return the most common detected programming language as the primary language. |
| 206 | """ |
| 207 | programming_languages_by_count = { |
| 208 | entry['count']: entry['value'] for entry in programming_language_tallies |
| 209 | } |
| 210 | primary_language = None |
| 211 | if programming_languages_by_count: |
| 212 | highest_count = max(programming_languages_by_count) |
| 213 | primary_language = programming_languages_by_count[highest_count] or None |
| 214 | return primary_language |
| 215 | |
| 216 | |
| 217 | def get_origin_info_from_top_level_packages(top_level_packages, codebase): |
no outgoing calls