Check if a model is considered top-tier for clustering. Args: model: Model name Returns: True if top-tier, False otherwise
(model: str)
| 208 | """Check if file is in an excluded directory.""" |
| 209 | try: |
| 210 | parts = file_path.relative_to(directory).parts |
| 211 | except ValueError: |
| 212 | parts = file_path.parts |
| 213 | return any(excluded_dir in parts for excluded_dir in excluded_dirs) |
| 214 | |
| 215 | language_counts = {} |
| 216 | |
| 217 | for language, extensions in language_extensions.items(): |
| 218 | count = 0 |
| 219 | for ext in extensions: |
| 220 | # Filter out files in excluded directories |
| 221 | count += sum( |
| 222 | 1 for f in directory.rglob(f"*{ext}") if f.is_file() and not should_exclude_file(f) |
| 223 | ) |
| 224 | |
| 225 | if count > 0: |
| 226 | language_counts[language] = count |
| 227 | |
| 228 | # Sort by count descending |
| 229 | return sorted(language_counts.items(), key=lambda x: x[1], reverse=True) |
| 230 | |
| 231 | |
| 232 | def is_top_tier_model(model: str) -> bool: |
no outgoing calls
no test coverage detected