MCPcopy Index your code
hub / github.com/secdev/scapy / __init__

Method __init__

scapy/volatile.py:967–981  ·  view source on GitHub ↗
(self, mn, mx)

Source from the content-addressed store, hash-verified

965 return {sign * 2**i for i in range(end_n)}
966
967 def __init__(self, mn, mx):
968 # type: (int, int) -> None
969 self._mn = mn
970 self._mx = mx
971 sing = {0, mn, mx, int((mn + mx) / 2)}
972 sing |= self.make_power_of_two(mn)
973 sing |= self.make_power_of_two(mx)
974 for i in sing.copy():
975 sing.add(i + 1)
976 sing.add(i - 1)
977 for i in sing.copy():
978 if not mn <= i <= mx:
979 sing.remove(i)
980 super(RandSingNum, self).__init__(*sing)
981 self._choice.sort()
982
983 def _command_args(self):
984 # type: () -> str

Callers

nothing calls this directly

Calls 5

make_power_of_twoMethod · 0.95
copyMethod · 0.45
addMethod · 0.45
removeMethod · 0.45
__init__Method · 0.45

Tested by

no test coverage detected