This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ZeroFile(): | |
def __init__(self, file_size): | |
self.file_size = file_size | |
self._buf = b'\0' | |
self.position = 0 | |
def tell(self): | |
return self.position |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import logging | |
from multiprocessing import Process, Pool, Manager | |
import random | |
import time | |
def init(queue): | |
global q |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import logging | |
import multiprocessing | |
def create_logger(): | |
logger = multiprocessing.get_logger() | |
logger.setLevel(logging.INFO) | |
formatter = logging.Formatter(\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from multiprocessing import Process, Pool, Manager | |
import random | |
import time | |
def percentile(values, percentile): | |
n = int(round((percentile / 100) * len(values) + 0.5)) | |
return values[n-1] |
OlderNewer