dandelion.py pylint fixes

This commit is contained in:
lakshyacis 2019-08-31 18:41:05 +05:30
parent f1b6b16940
commit b927d51eb3
No known key found for this signature in database
GPG Key ID: D2C539C8EC63E9EB

View File

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