import json import os import pandas as pd import requests import time from collections import defaultdict # Common mistakes need to be maintained mistakes = { '1': ['7', 'I', 'L', 'T'], '7': ['1', 'I', 'L', 'T'], 'I': ['1', '7', 'L', 'T'], 'L': ['1', '7', 'I', 'T'], 'T': ['1', '7', 'I', 'L'], '0': ['O'], 'O': ['0'], '5': ['S'], 'S': ['5'], 'F': ['H'], 'H': ['F'], } def permutate(word): if len(word) == 0: return [''] change = [] res = permutate(word[1:]) if word[0] in mistakes: for m in mistakes[word[0]]: change.extend([m + r for r in res]) return [word[0] + r for r in res] + change def call(url): while True: try: res = requests.get(url) time.sleep(1) break except Exception as e: print(e) return res