Предизвикателства > Сляпа баба > Решения > Решението на Виктор Райков

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

1 точки общо

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

 1import importlib
 2import inspect
 3
 4def is_interesting_method(method):
 5    
 6    if len(method.__name__) != 1:
 7        return False
 8    
 9    if "self" not in inspect.signature(method).parameters:
10        return True
11    
12    try:
13        method()
14        even_test = all(method(x) == x**2 for x in range(0,10,2))
15        odd_test = all(method(x == 0 for x in range(1,10,2)))
16        if even_test and odd_test:
17            return True
18        str_test = all(method(left=a,right=b) == a + b for a, b in [("gotin", "obicham","python>"), ("sum","python","Java")])
19        if str_test:
20            return True
21        
22    except TypeError as e:
23        if str(e) == "Опаааааа, тука има нещо нередно.":
24            return True
25    except BaseException:
26        return True
27   
28
29    return False
30
31def search_module(obj, interesting_methods):
32    if inspect.isfunction(obj) and is_interesting_method(obj):
33        interesting_methods[obj.__name__] = obj
34    elif inspect.isclass(obj) or inspect.ismodule(obj):
35        for name, nested_obj in inspect.getmembers(obj):
36            if "clue" in name:
37                search_module(nested_obj, interesting_methods)
38
39def methodify():
40    secret = importlib.import_module("secret")
41    interesting_methods = {}
42    search_module(secret, interesting_methods)
43
44    faculty_number = "FN9MI0600099"
45    ordered_methods = []
46    for char in faculty_number:
47        method = interesting_methods.get(char)
48        if method:
49            ordered_methods.append(method)
50
51    return tuple(ordered_methods)

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 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_2 at 0x7fc374092dd0>, <function method_3 at 0x7fc374092e60>, <function method_4 at 0x7fc374092ef0>, <function method_5 at 0x7fc374092f80>, <function method_6 at 0x7fc374093010>, <function method_7 at 0x7fc3740930a0>, <function method_8 at 0x7fc374093130>, <function method_9 at 0x7fc3740931c0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_2 at 0x7fc374092dd0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_2 at 0x7fc374092dd0>, <function method_4 at 0x7fc374092ef0>, <function method_4 at 0x7fc374092ef0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_5 at 0x7fc374092f80>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_9 at 0x7fc3740931c0>, <function method_5 at 0x7fc374092f80>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_5 at 0x7fc374092f80>, <function method_0 at 0x7fc374092cb0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_8 at 0x7fc374093130>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_0 at 0x7fc374092cb0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_4 at 0x7fc374092ef0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_2 at 0x7fc374092dd0>, <function method_6 at 0x7fc374093010>, <function method_2 at 0x7fc374092dd0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_3 at 0x7fc374092e60>, <function method_1 at 0x7fc374092d40>, <function method_5 at 0x7fc374092f80>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_3 at 0x7fc374092e60>, <function method_1 at 0x7fc374092d40>, <function method_6 at 0x7fc374093010>, <function method_5 at 0x7fc374092f80>, <function method_0 at 0x7fc374092cb0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_3 at 0x7fc374092e60>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_4 at 0x7fc374092ef0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_3 at 0x7fc374092e60>, <function method_2 at 0x7fc374092dd0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_9 at 0x7fc3740931c0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_2 at 0x7fc374092dd0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_4 at 0x7fc374092ef0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_9 at 0x7fc3740931c0>, <function method_7 at 0x7fc3740930a0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_3 at 0x7fc374092e60>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_3 at 0x7fc374092e60>, <function method_4 at 0x7fc374092ef0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_8 at 0x7fc374093130>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_2 at 0x7fc374092dd0>, <function method_5 at 0x7fc374092f80>, <function method_5 at 0x7fc374092f80>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_0 at 0x7fc374092cb0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_1 at 0x7fc374092d40>, <function method_5 at 0x7fc374092f80>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_2 at 0x7fc374092dd0>, <function method_5 at 0x7fc374092f80>, <function method_5 at 0x7fc374092f80>, <function method_0 at 0x7fc374092cb0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_4 at 0x7fc374092ef0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_3 at 0x7fc374092e60>, <function method_0 at 0x7fc374092cb0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_3 at 0x7fc374092e60>, <function method_1 at 0x7fc374092d40>, <function method_5 at 0x7fc374092f80>, <function method_9 at 0x7fc3740931c0>, <function method_2 at 0x7fc374092dd0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_0 at 0x7fc374092cb0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_9 at 0x7fc3740931c0>, <function method_7 at 0x7fc3740930a0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_2 at 0x7fc374092dd0>, <function method_3 at 0x7fc374092e60>, <function method_7 at 0x7fc3740930a0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_5 at 0x7fc374092f80>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_1 at 0x7fc374092d40>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_8 at 0x7fc374093130>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_3 at 0x7fc374092e60>, <function method_6 at 0x7fc374093010>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_0 at 0x7fc374092cb0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_7 at 0x7fc3740930a0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_2 at 0x7fc374092dd0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_9 at 0x7fc3740931c0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_1 at 0x7fc374092d40>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_3 at 0x7fc374092e60>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_2 at 0x7fc374092dd0>, <function method_4 at 0x7fc374092ef0>, <function method_9 at 0x7fc3740931c0>, <function method_3 at 0x7fc374092e60>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_3 at 0x7fc374092e60>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_7 at 0x7fc3740930a0>, <function method_5 at 0x7fc374092f80>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_0 at 0x7fc374092cb0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_7 at 0x7fc3740930a0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_5 at 0x7fc374092f80>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_3 at 0x7fc374092e60>, <function method_9 at 0x7fc3740931c0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_3 at 0x7fc374092e60>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_4 at 0x7fc374092ef0>, <function method_9 at 0x7fc3740931c0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_2 at 0x7fc374092dd0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_8 at 0x7fc374093130>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_2 at 0x7fc374092dd0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_6 at 0x7fc374093010>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_7 at 0x7fc3740930a0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_1 at 0x7fc374092d40>, <function method_6 at 0x7fc374093010>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_5 at 0x7fc374092f80>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_6 at 0x7fc374093010>, <function method_7 at 0x7fc3740930a0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_0 at 0x7fc374092cb0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_4 at 0x7fc374092ef0>, <function method_1 at 0x7fc374092d40>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_2 at 0x7fc374092dd0>, <function method_5 at 0x7fc374092f80>, <function method_1 at 0x7fc374092d40>, <function method_3 at 0x7fc374092e60>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_7 at 0x7fc3740930a0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_4 at 0x7fc374092ef0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_1 at 0x7fc374092d40>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_4 at 0x7fc374092ef0>, <function method_6 at 0x7fc374093010>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_0 at 0x7fc374092cb0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_2 at 0x7fc374092dd0>, <function method_0 at 0x7fc374092cb0>, <function method_4 at 0x7fc374092ef0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_2 at 0x7fc374092dd0>, <function method_5 at 0x7fc374092f80>, <function method_3 at 0x7fc374092e60>, <function method_2 at 0x7fc374092dd0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_2 at 0x7fc374092dd0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_2 at 0x7fc374092dd0>, <function method_1 at 0x7fc374092d40>, <function method_6 at 0x7fc374093010>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_1 at 0x7fc374092d40>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_3 at 0x7fc374092e60>, <function method_1 at 0x7fc374092d40>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_4 at 0x7fc374092ef0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_7 at 0x7fc3740930a0>, <function method_1 at 0x7fc374092d40>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_9 at 0x7fc3740931c0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_9 at 0x7fc3740931c0>, <function method_9 at 0x7fc3740931c0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_0 at 0x7fc374092cb0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_2 at 0x7fc374092dd0>, <function method_4 at 0x7fc374092ef0>, <function method_1 at 0x7fc374092d40>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_2 at 0x7fc374092dd0>, <function method_5 at 0x7fc374092f80>, <function method_9 at 0x7fc3740931c0>, <function method_1 at 0x7fc374092d40>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_2 at 0x7fc374092dd0>, <function method_1 at 0x7fc374092d40>, <function method_3 at 0x7fc374092e60>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_2 at 0x7fc374092dd0>, <function method_5 at 0x7fc374092f80>, <function method_6 at 0x7fc374093010>, <function method_8 at 0x7fc374093130>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_2 at 0x7fc374092dd0>, <function method_1 at 0x7fc374092d40>, <function method_1 at 0x7fc374092d40>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_2 at 0x7fc374092dd0>, <function method_3 at 0x7fc374092e60>, <function method_0 at 0x7fc374092cb0>, <function method_7 at 0x7fc3740930a0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_3 at 0x7fc374092e60>, <function method_4 at 0x7fc374092ef0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_4 at 0x7fc374092ef0>, <function method_3 at 0x7fc374092e60>, <function method_0 at 0x7fc374092cb0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_5 at 0x7fc374092f80>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_7 at 0x7fc3740930a0>, <function method_8 at 0x7fc374093130>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_0 at 0x7fc374092cb0>, <function method_7 at 0x7fc3740930a0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_2 at 0x7fc374092dd0>, <function method_1 at 0x7fc374092d40>, <function method_5 at 0x7fc374092f80>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_2 at 0x7fc374092dd0>, <function method_5 at 0x7fc374092f80>, <function method_2 at 0x7fc374092dd0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_3 at 0x7fc374092e60>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_9 at 0x7fc3740931c0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_8 at 0x7fc374093130>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_4 at 0x7fc374092ef0>, <function method_0 at 0x7fc374092cb0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_7 at 0x7fc3740930a0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_3 at 0x7fc374092e60>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_5 at 0x7fc374092f80>, <function method_2 at 0x7fc374092dd0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_8 at 0x7fc374093130>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_9 at 0x7fc3740931c0>, <function method_2 at 0x7fc374092dd0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_2 at 0x7fc374092dd0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_2 at 0x7fc374092dd0>, <function method_7 at 0x7fc3740930a0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_9 at 0x7fc3740931c0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_2 at 0x7fc374092dd0>, <function method_2 at 0x7fc374092dd0>, <function method_3 at 0x7fc374092e60>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_2 at 0x7fc374092dd0>, <function method_4 at 0x7fc374092ef0>, <function method_0 at 0x7fc374092cb0>, <function method_9 at 0x7fc3740931c0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_8 at 0x7fc374093130>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_3 at 0x7fc374092e60>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_2 at 0x7fc374092dd0>, <function method_0 at 0x7fc374092cb0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_2 at 0x7fc374092dd0>, <function method_2 at 0x7fc374092dd0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_8 at 0x7fc374093130>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_2 at 0x7fc374092dd0>, <function method_4 at 0x7fc374092ef0>, <function method_2 at 0x7fc374092dd0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_1 at 0x7fc374092d40>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_3 at 0x7fc374092e60>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_3 at 0x7fc374092e60>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_2 at 0x7fc374092dd0>, <function method_5 at 0x7fc374092f80>, <function method_7 at 0x7fc3740930a0>, <function method_1 at 0x7fc374092d40>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_0 at 0x7fc374092cb0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_3 at 0x7fc374092e60>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_9 at 0x7fc3740931c0>, <function method_2 at 0x7fc374092dd0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_5 at 0x7fc374092f80>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_7 at 0x7fc3740930a0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_3 at 0x7fc374092e60>, <function method_8 at 0x7fc374093130>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_8 at 0x7fc374093130>, <function method_5 at 0x7fc374092f80>, <function method_5 at 0x7fc374092f80>, <function method_3 at 0x7fc374092e60>, <function method_6 at 0x7fc374093010>, <function method_2 at 0x7fc374092dd0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_1 at 0x7fc374092d40>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_7 at 0x7fc3740930a0>, <function method_2 at 0x7fc374092dd0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_7 at 0x7fc3740930a0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_9 at 0x7fc3740931c0>, <function method_8 at 0x7fc374093130>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_2 at 0x7fc374092dd0>, <function method_4 at 0x7fc374092ef0>, <function method_2 at 0x7fc374092dd0>, <function method_6 at 0x7fc374093010>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_7 at 0x7fc3740930a0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_3 at 0x7fc374092e60>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_1 at 0x7fc374092d40>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_0 at 0x7fc374092cb0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_7 at 0x7fc3740930a0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_9 at 0x7fc3740931c0>, <function method_2 at 0x7fc374092dd0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_2 at 0x7fc374092dd0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_2 at 0x7fc374092dd0>, <function method_0 at 0x7fc374092cb0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_0 at 0x7fc374092cb0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_7 at 0x7fc3740930a0>, <function method_1 at 0x7fc374092d40>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_2 at 0x7fc374092dd0>, <function method_5 at 0x7fc374092f80>, <function method_1 at 0x7fc374092d40>, <function method_4 at 0x7fc374092ef0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_0 at 0x7fc374092cb0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_3 at 0x7fc374092e60>, <function method_4 at 0x7fc374092ef0>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_3 at 0x7fc374092e60>, <function method_5 at 0x7fc374092f80>, <function method_6 at 0x7fc374093010>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_2 at 0x7fc374092dd0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_9 at 0x7fc3740931c0>, <function method_6 at 0x7fc374093010>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_2 at 0x7fc374092dd0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_3 at 0x7fc374092e60>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_1 at 0x7fc374092d40>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_1 at 0x7fc374092d40>, <function method_8 at 0x7fc374093130>, <function method_7 at 0x7fc3740930a0>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_2 at 0x7fc374092dd0>, <function method_5 at 0x7fc374092f80>, <function method_2 at 0x7fc374092dd0>, <function method_6 at 0x7fc374093010>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_7 at 0x7fc3740930a0>, <function method_M at 0x7fc374092b90>, <function method_I at 0x7fc374092c20>, <function method_0 at 0x7fc374092cb0>, <function method_6 at 0x7fc374093010>, <function method_0 at 0x7fc374092cb0>, <function method_0 at 0x7fc374092cb0>, <function method_2 at 0x7fc374092dd0>, <function method_1 at 0x7fc374092d40>, <function method_8 at 0x7fc374093130>), (<function method_F at 0x7fc374092a70>, <function method_N at 0x7fc374092b00>, <function method_6 at 0x7fc374093010>, <function method_2 at 0x7fc374092dd0>, <function method_4 at 0x7fc374092ef0>, <function method_8 at 0x7fc374093130>, <function method_7 at 0x7fc3740930a0>)])

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

FAILED (failures=1)

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

f1import importlibf1import importlib
2import inspect2import inspect
33
4def is_interesting_method(method):4def is_interesting_method(method):
5    5    
6    if len(method.__name__) != 1:6    if len(method.__name__) != 1:
7        return False7        return False
8    8    
n9    if "self" in inspect.signature(method).parameters:n9    if "self" not in inspect.signature(method).parameters:
10        return False10        return True
11    11    
12    try:12    try:
13        method()13        method()
14        even_test = all(method(x) == x**2 for x in range(0,10,2))14        even_test = all(method(x) == x**2 for x in range(0,10,2))
15        odd_test = all(method(x == 0 for x in range(1,10,2)))15        odd_test = all(method(x == 0 for x in range(1,10,2)))
16        if even_test and odd_test:16        if even_test and odd_test:
17            return True17            return True
18        str_test = all(method(left=a,right=b) == a + b for a, b in [("gotin", "obicham","python>"), ("sum","python","Java")])18        str_test = all(method(left=a,right=b) == a + b for a, b in [("gotin", "obicham","python>"), ("sum","python","Java")])
19        if str_test:19        if str_test:
20            return True20            return True
21        21        
22    except TypeError as e:22    except TypeError as e:
23        if str(e) == "Опаааааа, тука има нещо нередно.":23        if str(e) == "Опаааааа, тука има нещо нередно.":
24            return True24            return True
25    except BaseException:25    except BaseException:
26        return True26        return True
27   27   
2828
29    return False29    return False
3030
t31def search_module(module, interesting_methods):t31def search_module(obj, interesting_methods):
32    for name, obj in inspect.getmembers(module):
33        if "clue" in name:
34            if inspect.isfunction(obj) and is_interesting_method(obj):32    if inspect.isfunction(obj) and is_interesting_method(obj):
35                interesting_methods[obj.__name__] = obj33        interesting_methods[obj.__name__] = obj
36            elif inspect.isclass(obj) or inspect.ismodule(obj):34    elif inspect.isclass(obj) or inspect.ismodule(obj):
35        for name, nested_obj in inspect.getmembers(obj):
36            if "clue" in name:
37                search_module(obj, interesting_methods)37                search_module(nested_obj, interesting_methods)
3838
39def methodify():39def methodify():
40    secret = importlib.import_module("secret")40    secret = importlib.import_module("secret")
41    interesting_methods = {}41    interesting_methods = {}
42    search_module(secret, interesting_methods)42    search_module(secret, interesting_methods)
4343
44    faculty_number = "FN9MI0600099"44    faculty_number = "FN9MI0600099"
45    ordered_methods = []45    ordered_methods = []
46    for char in faculty_number:46    for char in faculty_number:
47        method = interesting_methods.get(char)47        method = interesting_methods.get(char)
48        if method:48        if method:
49            ordered_methods.append(method)49            ordered_methods.append(method)
5050
51    return tuple(ordered_methods)51    return tuple(ordered_methods)
5252
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op