MCPcopy Create free account
hub / github.com/secdev/scapy / RandNumExpo

Class RandNumExpo

scapy/volatile.py:325–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323
324
325class RandNumExpo(RandNum):
326 def __init__(self, lambd, base=0):
327 # type: (float, int) -> None
328 self.lambd = lambd
329 self.base = base
330
331 def _command_args(self):
332 # type: () -> str
333 ret = "lambd=%r" % self.lambd
334 if self.base != 0:
335 ret += ", base=%r" % self.base
336 return ret
337
338 def _fix(self):
339 # type: () -> int
340 return self.base + int(round(random.expovariate(self.lambd)))
341
342
343class RandEnum(RandNum):

Callers 5

__init__Method · 0.90
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
_fixMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…