(distance=2, limit=None, pkgs=None, format_uri="text", extended=False)
| 220 | |
| 221 | |
| 222 | def generate_typosquatting(distance=2, limit=None, pkgs=None, format_uri="text", extended=False): |
| 223 | if not pkgs: |
| 224 | pkgs = typos.get_popular_packages() |
| 225 | |
| 226 | f = partial(typos.damerau_levenshtein, max_distance=distance) |
| 227 | combinations = typos.generate_combinations(left=pkgs) |
| 228 | |
| 229 | formatter = TyposquattingOutputBase.from_uri(format_uri) |
| 230 | formatter.output_typosquatting(islice(typos.enumerator(combinations, f, extended=extended), 0, limit)) |
| 231 | |
| 232 | |
| 233 | def cleanup(cache_tags): |
nothing calls this directly
no test coverage detected