Предизвикателства > Сляпа баба > Решения > Решението на Георги Джанаваров

Резултати
0 точки от тестове
1 точки от учител

1 точки общо

0 успешни теста
1 неуспешни теста
Код

 1import secret
 2import re
 3import inspect
 4
 5def function_check(cls, func):
 6    inst = cls()
 7
 8    if str(type(func)) == "<class 'function'>":
 9        return True
10    try: 
11        func(inst)
12    except TypeError as data: 
13        if str(data) == "Опаааааа, тука има нещо нередно.":
14            return True
15    except BaseException as data:
16        if str(data):
17            return True
18    try:
19        if func(inst,2) == 4 and func(inst,1) == 0:
20            return True  
21    except Exception:
22        pass
23    try:    
24        if func(inst,'a','b') == 'ab':
25            return True
26    except Exception:
27        pass
28    return False
29
30def methodify():
31     methods = []
32     objs = dir(secret)
33     classes = []
34     symbols = ['F','N','8','M','I','0','6','0','0','0','3','6']
35
36     for obj in objs:
37          if re.match('.*clue.*',obj):
38               att = getattr(secret,obj)
39               if inspect.isclass(att):
40                    classes.append(att)
41     while classes:
42          cls = classes[0]
43          classes.pop(0)
44          for obj in dir(cls):
45            if re.match('.*clue.*',obj):
46                att = getattr(cls,obj)
47                if inspect.isclass(att):
48                        classes.append(att)
49            if obj in symbols:
50                 att = getattr(cls,obj)
51                 if callable(att) and function_check(cls,att):
52                      methods.append(att)
53     result = []
54     for sym in symbols:
55          for meth in methods:
56               if meth.__name__ == sym:
57                    result.append(meth)
58                    break
59     return tuple(result)

F
======================================================================
FAIL: test_metodify (test.TestMethodify)
Test metodify function.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 12, in test_metodify
self.assertIn(methodify(), _RESULTS.keys())
AssertionError: () not found in dict_keys([(<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_2 at 0x7fe57b212dd0>, <function method_3 at 0x7fe57b212e60>, <function method_4 at 0x7fe57b212ef0>, <function method_5 at 0x7fe57b212f80>, <function method_6 at 0x7fe57b213010>, <function method_7 at 0x7fe57b2130a0>, <function method_8 at 0x7fe57b213130>, <function method_9 at 0x7fe57b2131c0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_2 at 0x7fe57b212dd0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_2 at 0x7fe57b212dd0>, <function method_4 at 0x7fe57b212ef0>, <function method_4 at 0x7fe57b212ef0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_5 at 0x7fe57b212f80>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_9 at 0x7fe57b2131c0>, <function method_5 at 0x7fe57b212f80>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_5 at 0x7fe57b212f80>, <function method_0 at 0x7fe57b212cb0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_8 at 0x7fe57b213130>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_0 at 0x7fe57b212cb0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_4 at 0x7fe57b212ef0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_2 at 0x7fe57b212dd0>, <function method_6 at 0x7fe57b213010>, <function method_2 at 0x7fe57b212dd0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_3 at 0x7fe57b212e60>, <function method_1 at 0x7fe57b212d40>, <function method_5 at 0x7fe57b212f80>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_3 at 0x7fe57b212e60>, <function method_1 at 0x7fe57b212d40>, <function method_6 at 0x7fe57b213010>, <function method_5 at 0x7fe57b212f80>, <function method_0 at 0x7fe57b212cb0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_3 at 0x7fe57b212e60>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_4 at 0x7fe57b212ef0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_3 at 0x7fe57b212e60>, <function method_2 at 0x7fe57b212dd0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_9 at 0x7fe57b2131c0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_2 at 0x7fe57b212dd0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_4 at 0x7fe57b212ef0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_9 at 0x7fe57b2131c0>, <function method_7 at 0x7fe57b2130a0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_3 at 0x7fe57b212e60>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_3 at 0x7fe57b212e60>, <function method_4 at 0x7fe57b212ef0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_8 at 0x7fe57b213130>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_2 at 0x7fe57b212dd0>, <function method_5 at 0x7fe57b212f80>, <function method_5 at 0x7fe57b212f80>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_0 at 0x7fe57b212cb0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_1 at 0x7fe57b212d40>, <function method_5 at 0x7fe57b212f80>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_2 at 0x7fe57b212dd0>, <function method_5 at 0x7fe57b212f80>, <function method_5 at 0x7fe57b212f80>, <function method_0 at 0x7fe57b212cb0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_4 at 0x7fe57b212ef0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_3 at 0x7fe57b212e60>, <function method_0 at 0x7fe57b212cb0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_3 at 0x7fe57b212e60>, <function method_1 at 0x7fe57b212d40>, <function method_5 at 0x7fe57b212f80>, <function method_9 at 0x7fe57b2131c0>, <function method_2 at 0x7fe57b212dd0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_0 at 0x7fe57b212cb0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_9 at 0x7fe57b2131c0>, <function method_7 at 0x7fe57b2130a0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_2 at 0x7fe57b212dd0>, <function method_3 at 0x7fe57b212e60>, <function method_7 at 0x7fe57b2130a0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_5 at 0x7fe57b212f80>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_1 at 0x7fe57b212d40>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_8 at 0x7fe57b213130>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_3 at 0x7fe57b212e60>, <function method_6 at 0x7fe57b213010>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_0 at 0x7fe57b212cb0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_7 at 0x7fe57b2130a0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_2 at 0x7fe57b212dd0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_9 at 0x7fe57b2131c0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_1 at 0x7fe57b212d40>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_3 at 0x7fe57b212e60>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_2 at 0x7fe57b212dd0>, <function method_4 at 0x7fe57b212ef0>, <function method_9 at 0x7fe57b2131c0>, <function method_3 at 0x7fe57b212e60>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_3 at 0x7fe57b212e60>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_7 at 0x7fe57b2130a0>, <function method_5 at 0x7fe57b212f80>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_0 at 0x7fe57b212cb0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_7 at 0x7fe57b2130a0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_5 at 0x7fe57b212f80>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_3 at 0x7fe57b212e60>, <function method_9 at 0x7fe57b2131c0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_3 at 0x7fe57b212e60>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_4 at 0x7fe57b212ef0>, <function method_9 at 0x7fe57b2131c0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_2 at 0x7fe57b212dd0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_8 at 0x7fe57b213130>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_2 at 0x7fe57b212dd0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_6 at 0x7fe57b213010>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_7 at 0x7fe57b2130a0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_1 at 0x7fe57b212d40>, <function method_6 at 0x7fe57b213010>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_5 at 0x7fe57b212f80>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_6 at 0x7fe57b213010>, <function method_7 at 0x7fe57b2130a0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_0 at 0x7fe57b212cb0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_4 at 0x7fe57b212ef0>, <function method_1 at 0x7fe57b212d40>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_2 at 0x7fe57b212dd0>, <function method_5 at 0x7fe57b212f80>, <function method_1 at 0x7fe57b212d40>, <function method_3 at 0x7fe57b212e60>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_7 at 0x7fe57b2130a0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_4 at 0x7fe57b212ef0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_1 at 0x7fe57b212d40>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_4 at 0x7fe57b212ef0>, <function method_6 at 0x7fe57b213010>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_0 at 0x7fe57b212cb0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_2 at 0x7fe57b212dd0>, <function method_0 at 0x7fe57b212cb0>, <function method_4 at 0x7fe57b212ef0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_2 at 0x7fe57b212dd0>, <function method_5 at 0x7fe57b212f80>, <function method_3 at 0x7fe57b212e60>, <function method_2 at 0x7fe57b212dd0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_2 at 0x7fe57b212dd0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_2 at 0x7fe57b212dd0>, <function method_1 at 0x7fe57b212d40>, <function method_6 at 0x7fe57b213010>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_1 at 0x7fe57b212d40>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_3 at 0x7fe57b212e60>, <function method_1 at 0x7fe57b212d40>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_4 at 0x7fe57b212ef0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_7 at 0x7fe57b2130a0>, <function method_1 at 0x7fe57b212d40>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_9 at 0x7fe57b2131c0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_9 at 0x7fe57b2131c0>, <function method_9 at 0x7fe57b2131c0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_0 at 0x7fe57b212cb0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_2 at 0x7fe57b212dd0>, <function method_4 at 0x7fe57b212ef0>, <function method_1 at 0x7fe57b212d40>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_2 at 0x7fe57b212dd0>, <function method_5 at 0x7fe57b212f80>, <function method_9 at 0x7fe57b2131c0>, <function method_1 at 0x7fe57b212d40>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_2 at 0x7fe57b212dd0>, <function method_1 at 0x7fe57b212d40>, <function method_3 at 0x7fe57b212e60>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_2 at 0x7fe57b212dd0>, <function method_5 at 0x7fe57b212f80>, <function method_6 at 0x7fe57b213010>, <function method_8 at 0x7fe57b213130>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_2 at 0x7fe57b212dd0>, <function method_1 at 0x7fe57b212d40>, <function method_1 at 0x7fe57b212d40>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_2 at 0x7fe57b212dd0>, <function method_3 at 0x7fe57b212e60>, <function method_0 at 0x7fe57b212cb0>, <function method_7 at 0x7fe57b2130a0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_3 at 0x7fe57b212e60>, <function method_4 at 0x7fe57b212ef0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_4 at 0x7fe57b212ef0>, <function method_3 at 0x7fe57b212e60>, <function method_0 at 0x7fe57b212cb0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_5 at 0x7fe57b212f80>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_7 at 0x7fe57b2130a0>, <function method_8 at 0x7fe57b213130>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_0 at 0x7fe57b212cb0>, <function method_7 at 0x7fe57b2130a0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_2 at 0x7fe57b212dd0>, <function method_1 at 0x7fe57b212d40>, <function method_5 at 0x7fe57b212f80>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_2 at 0x7fe57b212dd0>, <function method_5 at 0x7fe57b212f80>, <function method_2 at 0x7fe57b212dd0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_3 at 0x7fe57b212e60>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_9 at 0x7fe57b2131c0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_8 at 0x7fe57b213130>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_4 at 0x7fe57b212ef0>, <function method_0 at 0x7fe57b212cb0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_7 at 0x7fe57b2130a0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_3 at 0x7fe57b212e60>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_5 at 0x7fe57b212f80>, <function method_2 at 0x7fe57b212dd0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_8 at 0x7fe57b213130>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_9 at 0x7fe57b2131c0>, <function method_2 at 0x7fe57b212dd0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_2 at 0x7fe57b212dd0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_2 at 0x7fe57b212dd0>, <function method_7 at 0x7fe57b2130a0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_9 at 0x7fe57b2131c0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_2 at 0x7fe57b212dd0>, <function method_2 at 0x7fe57b212dd0>, <function method_3 at 0x7fe57b212e60>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_2 at 0x7fe57b212dd0>, <function method_4 at 0x7fe57b212ef0>, <function method_0 at 0x7fe57b212cb0>, <function method_9 at 0x7fe57b2131c0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_8 at 0x7fe57b213130>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_3 at 0x7fe57b212e60>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_2 at 0x7fe57b212dd0>, <function method_0 at 0x7fe57b212cb0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_2 at 0x7fe57b212dd0>, <function method_2 at 0x7fe57b212dd0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_8 at 0x7fe57b213130>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_2 at 0x7fe57b212dd0>, <function method_4 at 0x7fe57b212ef0>, <function method_2 at 0x7fe57b212dd0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_1 at 0x7fe57b212d40>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_3 at 0x7fe57b212e60>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_3 at 0x7fe57b212e60>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_2 at 0x7fe57b212dd0>, <function method_5 at 0x7fe57b212f80>, <function method_7 at 0x7fe57b2130a0>, <function method_1 at 0x7fe57b212d40>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_0 at 0x7fe57b212cb0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_3 at 0x7fe57b212e60>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_9 at 0x7fe57b2131c0>, <function method_2 at 0x7fe57b212dd0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_5 at 0x7fe57b212f80>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_7 at 0x7fe57b2130a0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_3 at 0x7fe57b212e60>, <function method_8 at 0x7fe57b213130>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_8 at 0x7fe57b213130>, <function method_5 at 0x7fe57b212f80>, <function method_5 at 0x7fe57b212f80>, <function method_3 at 0x7fe57b212e60>, <function method_6 at 0x7fe57b213010>, <function method_2 at 0x7fe57b212dd0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_1 at 0x7fe57b212d40>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_7 at 0x7fe57b2130a0>, <function method_2 at 0x7fe57b212dd0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_7 at 0x7fe57b2130a0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_9 at 0x7fe57b2131c0>, <function method_8 at 0x7fe57b213130>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_2 at 0x7fe57b212dd0>, <function method_4 at 0x7fe57b212ef0>, <function method_2 at 0x7fe57b212dd0>, <function method_6 at 0x7fe57b213010>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_7 at 0x7fe57b2130a0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_3 at 0x7fe57b212e60>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_1 at 0x7fe57b212d40>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_0 at 0x7fe57b212cb0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_7 at 0x7fe57b2130a0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_9 at 0x7fe57b2131c0>, <function method_2 at 0x7fe57b212dd0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_2 at 0x7fe57b212dd0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_2 at 0x7fe57b212dd0>, <function method_0 at 0x7fe57b212cb0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_0 at 0x7fe57b212cb0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_7 at 0x7fe57b2130a0>, <function method_1 at 0x7fe57b212d40>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_2 at 0x7fe57b212dd0>, <function method_5 at 0x7fe57b212f80>, <function method_1 at 0x7fe57b212d40>, <function method_4 at 0x7fe57b212ef0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_0 at 0x7fe57b212cb0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_3 at 0x7fe57b212e60>, <function method_4 at 0x7fe57b212ef0>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_3 at 0x7fe57b212e60>, <function method_5 at 0x7fe57b212f80>, <function method_6 at 0x7fe57b213010>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_2 at 0x7fe57b212dd0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_9 at 0x7fe57b2131c0>, <function method_6 at 0x7fe57b213010>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_2 at 0x7fe57b212dd0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_3 at 0x7fe57b212e60>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_1 at 0x7fe57b212d40>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_1 at 0x7fe57b212d40>, <function method_8 at 0x7fe57b213130>, <function method_7 at 0x7fe57b2130a0>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_2 at 0x7fe57b212dd0>, <function method_5 at 0x7fe57b212f80>, <function method_2 at 0x7fe57b212dd0>, <function method_6 at 0x7fe57b213010>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_7 at 0x7fe57b2130a0>, <function method_M at 0x7fe57b212b90>, <function method_I at 0x7fe57b212c20>, <function method_0 at 0x7fe57b212cb0>, <function method_6 at 0x7fe57b213010>, <function method_0 at 0x7fe57b212cb0>, <function method_0 at 0x7fe57b212cb0>, <function method_2 at 0x7fe57b212dd0>, <function method_1 at 0x7fe57b212d40>, <function method_8 at 0x7fe57b213130>), (<function method_F at 0x7fe57b212a70>, <function method_N at 0x7fe57b212b00>, <function method_6 at 0x7fe57b213010>, <function method_2 at 0x7fe57b212dd0>, <function method_4 at 0x7fe57b212ef0>, <function method_8 at 0x7fe57b213130>, <function method_7 at 0x7fe57b2130a0>)])

----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (failures=1)

Дискусия
История

f1import secretf1import secret
2import re2import re
3import inspect3import inspect
44
5def function_check(cls, func):5def function_check(cls, func):
6    inst = cls()6    inst = cls()
77
8    if str(type(func)) == "<class 'function'>":8    if str(type(func)) == "<class 'function'>":
9        return True9        return True
10    try: 10    try: 
11        func(inst)11        func(inst)
12    except TypeError as data: 12    except TypeError as data: 
13        if str(data) == "Опаааааа, тука има нещо нередно.":13        if str(data) == "Опаааааа, тука има нещо нередно.":
14            return True14            return True
15    except BaseException as data:15    except BaseException as data:
16        if str(data):16        if str(data):
17            return True17            return True
18    try:18    try:
19        if func(inst,2) == 4 and func(inst,1) == 0:19        if func(inst,2) == 4 and func(inst,1) == 0:
20            return True  20            return True  
nn21    except Exception:
22        pass
23    try:    
21        if func(inst,'a','b') == 'ab':24        if func(inst,'a','b') == 'ab':
22            return True25            return True
23    except Exception:26    except Exception:
t24         return Falset27        pass
25    return False28    return False
2629
27def methodify():30def methodify():
28     methods = []31     methods = []
29     objs = dir(secret)32     objs = dir(secret)
30     classes = []33     classes = []
31     symbols = ['F','N','8','M','I','0','6','0','0','0','3','6']34     symbols = ['F','N','8','M','I','0','6','0','0','0','3','6']
3235
33     for obj in objs:36     for obj in objs:
34          if re.match('.*clue.*',obj):37          if re.match('.*clue.*',obj):
35               att = getattr(secret,obj)38               att = getattr(secret,obj)
36               if inspect.isclass(att):39               if inspect.isclass(att):
37                    classes.append(att)40                    classes.append(att)
38     while classes:41     while classes:
39          cls = classes[0]42          cls = classes[0]
40          classes.pop(0)43          classes.pop(0)
41          for obj in dir(cls):44          for obj in dir(cls):
42            if re.match('.*clue.*',obj):45            if re.match('.*clue.*',obj):
43                att = getattr(cls,obj)46                att = getattr(cls,obj)
44                if inspect.isclass(att):47                if inspect.isclass(att):
45                        classes.append(att)48                        classes.append(att)
46            if obj in symbols:49            if obj in symbols:
47                 att = getattr(cls,obj)50                 att = getattr(cls,obj)
48                 if callable(att) and function_check(cls,att):51                 if callable(att) and function_check(cls,att):
49                      methods.append(att)52                      methods.append(att)
50     result = []53     result = []
51     for sym in symbols:54     for sym in symbols:
52          for meth in methods:55          for meth in methods:
53               if meth.__name__ == sym:56               if meth.__name__ == sym:
54                    result.append(meth)57                    result.append(meth)
55                    break58                    break
56     return tuple(result)59     return tuple(result)
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op

f1import secretf1import secret
2import re2import re
3import inspect3import inspect
44
5def function_check(cls, func):5def function_check(cls, func):
6    inst = cls()6    inst = cls()
77
8    if str(type(func)) == "<class 'function'>":8    if str(type(func)) == "<class 'function'>":
9        return True9        return True
n10 n
11    try: 10    try: 
12        func(inst)11        func(inst)
13    except TypeError as data: 12    except TypeError as data: 
14        if str(data) == "Опаааааа, тука има нещо нередно.":13        if str(data) == "Опаааааа, тука има нещо нередно.":
15            return True14            return True
16    except BaseException as data:15    except BaseException as data:
17        if str(data):16        if str(data):
18            return True17            return True
n19    n
20    try:18    try:
21        if func(inst,2) == 4 and func(inst,1) == 0:19        if func(inst,2) == 4 and func(inst,1) == 0:
n22            return Truen20            return True  
23        
24        if func(inst,'a','b') == 'ab':21        if func(inst,'a','b') == 'ab':
25            return True22            return True
26    except Exception:23    except Exception:
27         return False24         return False
n28    n
29    return False25    return False
n30 n
31 
3226
33def methodify():27def methodify():
34     methods = []28     methods = []
35     objs = dir(secret)29     objs = dir(secret)
36     classes = []30     classes = []
37     symbols = ['F','N','8','M','I','0','6','0','0','0','3','6']31     symbols = ['F','N','8','M','I','0','6','0','0','0','3','6']
3832
39     for obj in objs:33     for obj in objs:
40          if re.match('.*clue.*',obj):34          if re.match('.*clue.*',obj):
41               att = getattr(secret,obj)35               att = getattr(secret,obj)
42               if inspect.isclass(att):36               if inspect.isclass(att):
43                    classes.append(att)37                    classes.append(att)
n44 n
45     while classes:38     while classes:
46          cls = classes[0]39          cls = classes[0]
47          classes.pop(0)40          classes.pop(0)
48          for obj in dir(cls):41          for obj in dir(cls):
49            if re.match('.*clue.*',obj):42            if re.match('.*clue.*',obj):
50                att = getattr(cls,obj)43                att = getattr(cls,obj)
51                if inspect.isclass(att):44                if inspect.isclass(att):
52                        classes.append(att)45                        classes.append(att)
53            if obj in symbols:46            if obj in symbols:
54                 att = getattr(cls,obj)47                 att = getattr(cls,obj)
55                 if callable(att) and function_check(cls,att):48                 if callable(att) and function_check(cls,att):
56                      methods.append(att)49                      methods.append(att)
n57     n
58     result = []50     result = []
59     for sym in symbols:51     for sym in symbols:
60          for meth in methods:52          for meth in methods:
61               if meth.__name__ == sym:53               if meth.__name__ == sym:
62                    result.append(meth)54                    result.append(meth)
63                    break55                    break
n64     n
65     return tuple(result)56     return tuple(result)
t66 t
67print(methodify())
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op

f1import secretf1import secret
2import re2import re
3import inspect3import inspect
44
5def function_check(cls, func):5def function_check(cls, func):
6    inst = cls()6    inst = cls()
77
8    if str(type(func)) == "<class 'function'>":8    if str(type(func)) == "<class 'function'>":
9        return True9        return True
1010
11    try: 11    try: 
12        func(inst)12        func(inst)
13    except TypeError as data: 13    except TypeError as data: 
14        if str(data) == "Опаааааа, тука има нещо нередно.":14        if str(data) == "Опаааааа, тука има нещо нередно.":
15            return True15            return True
16    except BaseException as data:16    except BaseException as data:
nn17        if str(data):
17            return True18            return True
18    19    
19    try:20    try:
20        if func(inst,2) == 4 and func(inst,1) == 0:21        if func(inst,2) == 4 and func(inst,1) == 0:
21            return True22            return True
22        23        
23        if func(inst,'a','b') == 'ab':24        if func(inst,'a','b') == 'ab':
24            return True25            return True
25    except Exception:26    except Exception:
26         return False27         return False
27    28    
28    return False29    return False
2930
3031
3132
32def methodify():33def methodify():
33     methods = []34     methods = []
34     objs = dir(secret)35     objs = dir(secret)
35     classes = []36     classes = []
36     symbols = ['F','N','8','M','I','0','6','0','0','0','3','6']37     symbols = ['F','N','8','M','I','0','6','0','0','0','3','6']
3738
38     for obj in objs:39     for obj in objs:
39          if re.match('.*clue.*',obj):40          if re.match('.*clue.*',obj):
40               att = getattr(secret,obj)41               att = getattr(secret,obj)
41               if inspect.isclass(att):42               if inspect.isclass(att):
42                    classes.append(att)43                    classes.append(att)
4344
44     while classes:45     while classes:
45          cls = classes[0]46          cls = classes[0]
46          classes.pop(0)47          classes.pop(0)
47          for obj in dir(cls):48          for obj in dir(cls):
48            if re.match('.*clue.*',obj):49            if re.match('.*clue.*',obj):
49                att = getattr(cls,obj)50                att = getattr(cls,obj)
50                if inspect.isclass(att):51                if inspect.isclass(att):
51                        classes.append(att)52                        classes.append(att)
52            if obj in symbols:53            if obj in symbols:
53                 att = getattr(cls,obj)54                 att = getattr(cls,obj)
54                 if callable(att) and function_check(cls,att):55                 if callable(att) and function_check(cls,att):
55                      methods.append(att)56                      methods.append(att)
56     57     
57     result = []58     result = []
58     for sym in symbols:59     for sym in symbols:
59          for meth in methods:60          for meth in methods:
60               if meth.__name__ == sym:61               if meth.__name__ == sym:
61                    result.append(meth)62                    result.append(meth)
62                    break63                    break
63     64     
64     return tuple(result)65     return tuple(result)
tt66 
67print(methodify())
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op