dandelion.py pylint fixes
This commit is contained in:
parent
f1b6b16940
commit
b927d51eb3
|
@ -1,3 +1,7 @@
|
||||||
|
"""
|
||||||
|
src/network/dandelion.py
|
||||||
|
========================
|
||||||
|
"""
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from random import choice, sample, expovariate
|
from random import choice, sample, expovariate
|
||||||
from threading import RLock
|
from threading import RLock
|
||||||
|
@ -22,7 +26,7 @@ Stem = namedtuple('Stem', ['child', 'stream', 'timeout'])
|
||||||
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
class Dandelion():
|
class Dandelion(): # pylint: disable=old-style-class
|
||||||
"""Dandelion class for tracking stem/fluff stages."""
|
"""Dandelion class for tracking stem/fluff stages."""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# currently assignable child stems
|
# currently assignable child stems
|
||||||
|
@ -35,7 +39,8 @@ class Dandelion():
|
||||||
self.refresh = time() + REASSIGN_INTERVAL
|
self.refresh = time() + REASSIGN_INTERVAL
|
||||||
self.lock = RLock()
|
self.lock = RLock()
|
||||||
|
|
||||||
def poissonTimeout(self, start=None, average=0):
|
@staticmethod
|
||||||
|
def poissonTimeout(start=None, average=0):
|
||||||
"""Generate deadline using Poisson distribution"""
|
"""Generate deadline using Poisson distribution"""
|
||||||
if start is None:
|
if start is None:
|
||||||
start = time()
|
start = time()
|
||||||
|
|
Reference in New Issue
Block a user