Best Python code snippet using pyresttest_python
euler061.py
Source:euler061.py  
...29            return False30    if str(l[0])[:2] != last_two_digits:31        return False32    return True33def iterlists(lists: Dict[int, List[int]]) -> Generator:34    for p, l in lists.items():35        for e in l:36            yield p, e37if __name__ == '__main__':38    n_3 = 139    P_3 = triangle(n_3)40    n_4 = 141    P_4 = square(n_4)42    n_5 = 143    P_5 = pentagonal(n_5)44    n_6 = 145    P_6 = exagonal(n_6)46    n_7 = 147    P_7 = heptagonal(n_7)48    n_8 = 149    P_8 = octagonal(n_8)50    P_3s = []51    while P_3 < 1000:52        n_3 += 153        P_3 = triangle(n_3)54    P_3s.append(P_3)55    while P_3 < 10000:56        n_3 += 157        P_3 = triangle(n_3)58        if P_3 < 10000:59            P_3s.append(P_3)60    P_4s = []61    while P_4 < 1000:62        n_4 += 163        P_4 = square(n_4)64    P_4s.append(P_4)65    while P_4 < 10000:66        n_4 += 167        P_4 = square(n_4)68        if P_4 < 10000:69            P_4s.append(P_4)70    P_5s = []71    while P_5 < 1000:72        n_5 += 173        P_5 = pentagonal(n_5)74    P_5s.append(P_5)75    while P_5 < 10000:76        n_5 += 177        P_5 = pentagonal(n_5)78        if P_5 < 10000:79            P_5s.append(P_5)80    P_6s = []81    while P_6 < 1000:82        n_6 += 183        P_6 = exagonal(n_6)84    P_6s.append(P_6)85    while P_6 < 10000:86        n_6 += 187        P_6 = exagonal(n_6)88        if P_6 < 10000:89            P_6s.append(P_6)90    P_7s = []91    while P_7 < 1000:92        n_7 += 193        P_7 = heptagonal(n_7)94    P_7s.append(P_7)95    while P_7 < 10000:96        n_7 += 197        P_7 = heptagonal(n_7)98        if P_7 < 10000:99            P_7s.append(P_7)100    P_8s = []101    while P_8 < 1000:102        n_8 += 1103        P_8 = octagonal(n_8)104    P_8s.append(P_8)105    while P_8 < 10000:106        n_8 += 1107        P_8 = octagonal(n_8)108        if P_8 < 10000:109            P_8s.append(P_8)110    P = {111        3: P_3s,112        4: P_4s,113        5: P_5s,114        6: P_6s,115        7: P_7s,116        8: P_8s,117    }118    missing_p = {4, 5, 6, 7, 8}119    for a in P_3s:120        for b_id, b in iterlists({p: P[p] for p in missing_p}):121            if not is_linkable(a, b):122                continue123            missing_p.remove(b_id)124            for c_id, c in iterlists({p: P[p] for p in missing_p}):125                if not is_linkable(b, c):126                    continue127                missing_p.remove(c_id)128                for d_id, d in iterlists({p: P[p] for p in missing_p}):129                    if not is_linkable(c, d):130                        continue131                    missing_p.remove(d_id)132                    for e_id, e in iterlists({p: P[p] for p in missing_p}):133                        if not is_linkable(d, e):134                            continue135                        missing_p.remove(e_id)136                        for f_id, f in iterlists({p: P[p] for p in missing_p}):137                            if not is_linkable(e, f) or not is_linkable(f, a):138                                continue139                            print(f"Found! The sum is {sum([a, b, c, d, e, f])}.")140                            print(f"3: {a}.")141                            print(f"{b_id}: {b}.")142                            print(f"{c_id}: {c}.")143                            print(f"{d_id}: {d}.")144                            print(f"{e_id}: {e}.")145                            print(f"{f_id}: {f}.")146                        missing_p.add(e_id)147                    missing_p.add(d_id)148                missing_p.add(c_id)...compat.py
Source:compat.py  
...22    def iterkeys(d, **kwargs):23        return d.iterkeys(**kwargs)24    def iteritems(d, **kwargs):25        return d.iteritems(**kwargs)26    def iterlists(d, **kwargs):27        return d.iterlists(**kwargs)28    def unquote(*args, **kwargs): # noqa F81129        return unquote_core(*args, **kwargs)30else:31    import io32    import queue  # noqa F40133    from urllib import parse as urlparse  # noqa F40134    from urllib.error import HTTPError  # noqa F40135    StringIO = io.StringIO36    BytesIO = io.BytesIO37    string_types = (str,)38    integer_types = (int,)39    class_types = (type,)40    text_type = str41    binary_type = bytes42    list_type = list43    dict_type = dict44    def b(s):45        return s.encode("latin-1")46    def iterkeys(d, **kwargs):47        return iter(d.keys(**kwargs))48    def iteritems(d, **kwargs):49        return iter(d.items(**kwargs))50    def iterlists(d, **kwargs):51        return iter(d.lists(**kwargs))52    def unquote(*args, **kwargs):53        return urlparse.unquote(*args, **kwargs)54def multidict_to_dict(d):...py2to3.py
Source:py2to3.py  
...29    def itervalues(d, **kw):30        return iter(d.values(**kw))31    def iteritems(d, **kw):32        return iter(d.items(**kw))33    def iterlists(d, **kw):34        return iter(d.lists(**kw))35else:36    def iterkeys(d, **kw):37        return iter(d.iterkeys(**kw))38    def itervalues(d, **kw):39        return iter(d.itervalues(**kw))40    def iteritems(d, **kw):41        return iter(d.iteritems(**kw))42    def iterlists(d, **kw):43        return iter(d.iterlists(**kw))44def with_metaclass(meta, *bases):45    class metaclass(meta):46        def __new__(cls, name, this_bases, d):47            return meta(name, bases, d)...Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
