Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.112
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
src /
Python-3.10.14 /
Doc /
includes /
Delete
Unzip
Name
Size
Permission
Date
Action
sqlite3
[ DIR ]
drwxr-xr-x
2024-03-19 22:46
custom.c
987
B
-rw-r--r--
2024-03-19 22:46
custom2.c
3.38
KB
-rw-r--r--
2024-03-19 22:46
custom3.c
4.52
KB
-rw-r--r--
2024-03-19 22:46
custom4.c
4.81
KB
-rw-r--r--
2024-03-19 22:46
dbpickle.py
2.8
KB
-rw-r--r--
2024-03-19 22:46
email-alternative.py
1.68
KB
-rw-r--r--
2024-03-19 22:46
email-dir.py
3
KB
-rw-r--r--
2024-03-19 22:46
email-headers.py
950
B
-rw-r--r--
2024-03-19 22:46
email-mime.py
930
B
-rw-r--r--
2024-03-19 22:46
email-read-alternative.py
2.84
KB
-rw-r--r--
2024-03-19 22:46
email-simple.py
585
B
-rw-r--r--
2024-03-19 22:46
email-unpack.py
1.55
KB
-rw-r--r--
2024-03-19 22:46
minidom-example.py
1.54
KB
-rw-r--r--
2024-03-19 22:46
mp_newtype.py
1.89
KB
-rw-r--r--
2024-03-19 22:46
mp_pool.py
3.8
KB
-rw-r--r--
2024-03-19 22:46
mp_workers.py
1.55
KB
-rw-r--r--
2024-03-19 22:46
run-func.c
1.94
KB
-rw-r--r--
2024-03-19 22:46
setup.py
329
B
-rw-r--r--
2024-03-19 22:46
sublist.c
1.55
KB
-rw-r--r--
2024-03-19 22:46
test.py
3.56
KB
-rw-r--r--
2024-03-19 22:46
turtle-star.py
155
B
-rw-r--r--
2024-03-19 22:46
typestruct.h
2.42
KB
-rw-r--r--
2024-03-19 22:46
tzinfo_examples.py
5.72
KB
-rw-r--r--
2024-03-19 22:46
Save
Rename
import multiprocessing import time import random import sys # # Functions used by test code # def calculate(func, args): result = func(*args) return '%s says that %s%s = %s' % ( multiprocessing.current_process().name, func.__name__, args, result ) def calculatestar(args): return calculate(*args) def mul(a, b): time.sleep(0.5 * random.random()) return a * b def plus(a, b): time.sleep(0.5 * random.random()) return a + b def f(x): return 1.0 / (x - 5.0) def pow3(x): return x ** 3 def noop(x): pass # # Test code # def test(): PROCESSES = 4 print('Creating pool with %d processes\n' % PROCESSES) with multiprocessing.Pool(PROCESSES) as pool: # # Tests # TASKS = [(mul, (i, 7)) for i in range(10)] + \ [(plus, (i, 8)) for i in range(10)] results = [pool.apply_async(calculate, t) for t in TASKS] imap_it = pool.imap(calculatestar, TASKS) imap_unordered_it = pool.imap_unordered(calculatestar, TASKS) print('Ordered results using pool.apply_async():') for r in results: print('\t', r.get()) print() print('Ordered results using pool.imap():') for x in imap_it: print('\t', x) print() print('Unordered results using pool.imap_unordered():') for x in imap_unordered_it: print('\t', x) print() print('Ordered results using pool.map() --- will block till complete:') for x in pool.map(calculatestar, TASKS): print('\t', x) print() # # Test error handling # print('Testing error handling:') try: print(pool.apply(f, (5,))) except ZeroDivisionError: print('\tGot ZeroDivisionError as expected from pool.apply()') else: raise AssertionError('expected ZeroDivisionError') try: print(pool.map(f, list(range(10)))) except ZeroDivisionError: print('\tGot ZeroDivisionError as expected from pool.map()') else: raise AssertionError('expected ZeroDivisionError') try: print(list(pool.imap(f, list(range(10))))) except ZeroDivisionError: print('\tGot ZeroDivisionError as expected from list(pool.imap())') else: raise AssertionError('expected ZeroDivisionError') it = pool.imap(f, list(range(10))) for i in range(10): try: x = next(it) except ZeroDivisionError: if i == 5: pass except StopIteration: break else: if i == 5: raise AssertionError('expected ZeroDivisionError') assert i == 9 print('\tGot ZeroDivisionError as expected from IMapIterator.next()') print() # # Testing timeouts # print('Testing ApplyResult.get() with timeout:', end=' ') res = pool.apply_async(calculate, TASKS[0]) while 1: sys.stdout.flush() try: sys.stdout.write('\n\t%s' % res.get(0.02)) break except multiprocessing.TimeoutError: sys.stdout.write('.') print() print() print('Testing IMapIterator.next() with timeout:', end=' ') it = pool.imap(calculatestar, TASKS) while 1: sys.stdout.flush() try: sys.stdout.write('\n\t%s' % it.next(0.02)) except StopIteration: break except multiprocessing.TimeoutError: sys.stdout.write('.') print() print() if __name__ == '__main__': multiprocessing.freeze_support() test()