function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def do_exit(self, _):
"""Quit. | rsc-dev/loophole | [
146,
16,
146,
4,
1453282427
] |
def do_EOF(self, _):
"""Quit. handles EOF"""
self.do_exit(_) | rsc-dev/loophole | [
146,
16,
146,
4,
1453282427
] |
def do_list(self, _):
"""List available Polar devices. | rsc-dev/loophole | [
146,
16,
146,
4,
1453282427
] |
def do_connect(self, dev_no):
"""Connect Polar device. Run 'list' to see available devices. | rsc-dev/loophole | [
146,
16,
146,
4,
1453282427
] |
def do_disconnect(self, _):
"""Disconnect Polar device.
"""
self.device.close()
self.device = None
self.prompt = LoopholeCli.__PROMPT.format('no device')
print '[+] Device disconnected.'
print | rsc-dev/loophole | [
146,
16,
146,
4,
1453282427
] |
def do_get(self, line):
"""Read file from device and store in under local_path. | rsc-dev/loophole | [
146,
16,
146,
4,
1453282427
] |
def do_delete(self, line):
"""Delete file from device. | rsc-dev/loophole | [
146,
16,
146,
4,
1453282427
] |
def do_dump(self, path):
"""Dump device memory. Path is local folder to store dump. | rsc-dev/loophole | [
146,
16,
146,
4,
1453282427
] |
def do_info(self, _):
"""Print connected device info. | rsc-dev/loophole | [
146,
16,
146,
4,
1453282427
] |
def do_fuzz(self, _):
import polar
num = _.strip()
if len(num) > 0:
num = int(num)
resp = self.device.send_raw([0x01, num] + [0x00] * 62)
print 'req: {} '.format(num),
if resp:
print 'err code: {}'.format(polar.PFTP_ERROR[resp[0]])... | rsc-dev/loophole | [
146,
16,
146,
4,
1453282427
] |
def do_put_file(self, line):
path, filename = line.split()
self.device.put_file(path.strip(), filename.strip()) | rsc-dev/loophole | [
146,
16,
146,
4,
1453282427
] |
def do_walk(self, path):
"""Walk file system. Default device_path is device root folder. | rsc-dev/loophole | [
146,
16,
146,
4,
1453282427
] |
def main():
cli = LoopholeCli()
cli.cmdloop(__INTRO.format(__version__)) | rsc-dev/loophole | [
146,
16,
146,
4,
1453282427
] |
def run(self, edit):
self.view.window().show_input_panel(
"Working directory that contains pawncc.exe",
"C:\\Pawno\\",
self.onPawnPathDone,
None,
None
) | Southclaw/pawn-sublime-language | [
30,
12,
30,
1,
1392238875
] |
def fix_missing_gene_symbols(de_novos, build='grch37'):
""" adds gene symbols to variants lacking them. | jeremymcrae/denovoFilter | [
6,
2,
6,
1,
1436451739
] |
def open_url(url, headers):
""" open url with python libraries | jeremymcrae/denovoFilter | [
6,
2,
6,
1,
1436451739
] |
def rate_limit_requests(rate_limit=0.0667):
""" limit ensembl requests to one per 0.067 s
""" | jeremymcrae/denovoFilter | [
6,
2,
6,
1,
1436451739
] |
def get_gene_id(chrom, start_pos, end_pos, build="grch37", verbose=False, attempts=0):
"""find the hgnc symbol overlapping a variant position | jeremymcrae/denovoFilter | [
6,
2,
6,
1,
1436451739
] |
def current_additions():
"""
Proxy to the currently added requirements
"""
rv = _additional_ctx_stack.top
if rv is None:
return None
return rv[1] | justanr/flask-allows | [
106,
16,
106,
14,
1440088981
] |
def check(self, other):
if not isinstance(other, Additional):
return NotImplemented
return f(self, other) | justanr/flask-allows | [
106,
16,
106,
14,
1440088981
] |
def __init__(self, *requirements):
self._requirements = set(requirements) | justanr/flask-allows | [
106,
16,
106,
14,
1440088981
] |
def remove(self, requirement, *requirements):
self._requirements.difference_update((requirement,) + requirements) | justanr/flask-allows | [
106,
16,
106,
14,
1440088981
] |
def __add__(self, other):
requirements = self._requirements | other._requirements
return Additional(*requirements) | justanr/flask-allows | [
106,
16,
106,
14,
1440088981
] |
def __iadd__(self, other):
if len(other._requirements) > 0:
self._requirements.add(*other._requirements)
return self | justanr/flask-allows | [
106,
16,
106,
14,
1440088981
] |
def __sub__(self, other):
requirements = self._requirements - other._requirements
return Additional(*requirements) | justanr/flask-allows | [
106,
16,
106,
14,
1440088981
] |
def __isub__(self, other):
if len(other._requirements) > 0:
self.remove(*other._requirements)
return self | justanr/flask-allows | [
106,
16,
106,
14,
1440088981
] |
def __eq__(self, other):
return self._requirements == other._requirements | justanr/flask-allows | [
106,
16,
106,
14,
1440088981
] |
def __ne__(self, other):
return not self == other | justanr/flask-allows | [
106,
16,
106,
14,
1440088981
] |
def is_added(self, requirement):
return requirement in self._requirements | justanr/flask-allows | [
106,
16,
106,
14,
1440088981
] |
def __len__(self):
return len(self._requirements) | justanr/flask-allows | [
106,
16,
106,
14,
1440088981
] |
def __repr__(self):
return "Additional({!r})".format(self._requirements) | justanr/flask-allows | [
106,
16,
106,
14,
1440088981
] |
def push(self, additional, use_parent=False):
"""
Binds an additional to the current context, optionally use the
current additionals in conjunction with this additional
If ``use_parent`` is true, a new additional is created from the
parent and child additionals rather than manip... | justanr/flask-allows | [
106,
16,
106,
14,
1440088981
] |
def current(self):
"""
Returns the current additional context if set otherwise None
"""
try:
return _additional_ctx_stack.top[1]
except TypeError:
return None | justanr/flask-allows | [
106,
16,
106,
14,
1440088981
] |
def row_to_concept(row):
concept = {'uri': row['c']['value'],
'pref': row['pref']['value'],
'ysapref': row['ysapref']['value'],
'allarspref': row['allarspref']['value']}
if 'alts' in row:
concept['alts'] = row['alts']['value']
return concept | osma/annif | [
14,
1,
14,
5,
1487323466
] |
def search_finna(params):
r = requests.get(FINNA_API_SEARCH, params=params, headers={'User-agent': 'annif 0.1'})
return r.json() | osma/annif | [
14,
1,
14,
5,
1487323466
] |
def generate_text(concept, lang):
# start with pref- and altlabels
labels = [concept['pref']]
if lang == 'fi':
# we can use the YSA label too
labels.append(concept['ysapref'])
if lang == 'sv':
# we can use the Allars label too
labels.append(concept['allarspref'])
if '... | osma/annif | [
14,
1,
14,
5,
1487323466
] |
def setUp(self):
"""Prepare to run test."""
super(TaskPrologEnd2End, self).setUp()
self.script = os.path.join(os.path.dirname(self.script), 'mytaskprolog.py') | hpcugent/vsc-mympirun | [
6,
9,
6,
38,
1358903732
] |
def testFIPS180_1_Appendix_A(self):
""" APPENDIX A. A SAMPLE MESSAGE AND ITS MESSAGE DIGEST """
hashAlg = SHA1()
message = 'abc'
message_digest = 0xA9993E36L, 0x4706816AL, 0xBA3E2571L, 0x7850C26CL, 0x9CD0D89DL
md_string = _toBString(message_digest)
asse... | dknlght/dkodi | [
14,
22,
14,
9,
1437005334
] |
def testFIPS180_1_Appendix_B(self):
""" APPENDIX B. A SECOND SAMPLE MESSAGE AND ITS MESSAGE DIGEST """
hashAlg = SHA1()
message = 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq'
message_digest = 0x84983E44L, 0x1C3BD26EL, 0xBAAE4AA1L, 0xF95129E5L, 0xE54670F1L
... | dknlght/dkodi | [
14,
22,
14,
9,
1437005334
] |
def testFIPS180_1_Appendix_C(self):
""" APPENDIX C. A THIRD SAMPLE MESSAGE AND ITS MESSAGE DIGEST
Let the message be the binary-coded form of the ASCII string which consists
of 1,000,000 repetitions of "a". """
hashAlg = SHA1()
message = 1000000*'a'
message... | dknlght/dkodi | [
14,
22,
14,
9,
1437005334
] |
def _toBlock(binaryString):
""" Convert binary string to blocks of 5 words of uint32() """
return [uint32(word) for word in struct.unpack('!IIIII', binaryString)] | dknlght/dkodi | [
14,
22,
14,
9,
1437005334
] |
def _toBString(block):
""" Convert block (5 words of 32 bits to binary string """
return ''.join([struct.pack('!I',word) for word in block]) | dknlght/dkodi | [
14,
22,
14,
9,
1437005334
] |
def __init__(self, parent):
self.parent=parent | johm/infoshopkeeper | [
8,
3,
8,
3,
1323614202
] |
def Borrow(self, id):
borrower = self.parent.membersList.get(id)
print borrower
for i in self.parent.orderbox.items:
# Check if this work on sqlobject 0.7... I got
# lots of problem on 0.6.1, and itemID __isn't__
# defined in emprunt, which is plain weirdness
... | johm/infoshopkeeper | [
8,
3,
8,
3,
1323614202
] |
def OnCancel(self,event):
self.EndModal(1) | johm/infoshopkeeper | [
8,
3,
8,
3,
1323614202
] |
def __init__(self, file):
self.file = file
self.major = 0
self.minor = 0
self.revision = 0
self.build = 1
self.touch() | mickem/nscp | [
217,
88,
217,
271,
1335593133
] |
def read(self):
try:
f = open(self.file, 'r')
lines = f.readlines()
f.close()
for line in lines:
self.readline(line)
except IOError as e:
print 'File not found: %s (%s)'%(self.file, e)
sys.exit(1) | mickem/nscp | [
217,
88,
217,
271,
1335593133
] |
def readline(self, line):
line = line.strip('\r\n\t ')
if len(line) == 0:
return
try:
m = re.search('(.*)=(.*)$', line)
if not m:
print 'Failed to parse line: %s'%(line.strip('\n\t '))
return
self.set(m.group(1), m.group(2))
except IndexError as e:
print 'Failed to parse line: %s (%s)'%(l... | mickem/nscp | [
217,
88,
217,
271,
1335593133
] |
def touch(self):
today = date.today()
self.date = today.isoformat() | mickem/nscp | [
217,
88,
217,
271,
1335593133
] |
def version(self):
return '%d.%d.%d.%d'%(self.major, self.minor, self.revision, self.build) | mickem/nscp | [
217,
88,
217,
271,
1335593133
] |
def __str__(self):
return 'version: %s, date %s'%(self.version(), self.date) | mickem/nscp | [
217,
88,
217,
271,
1335593133
] |
def increment(self, key):
if key == 'build':
self.build += 1
elif key == 'revision':
self.revision += 1
self.build = 0
elif key == 'minor':
self.minor += 1
self.revision = 0
self.build = 0
elif key == 'major':
self.major += 1
self.minor = 0
self.revision = 0
self.build = 0 | mickem/nscp | [
217,
88,
217,
271,
1335593133
] |
def print_version(self):
print '%d.%d.%d.%d'%(self.major, self.minor, self.revision, self.build) | mickem/nscp | [
217,
88,
217,
271,
1335593133
] |
def write_hpp(self, file):
d = os.path.dirname(file)
if not os.path.exists(d):
os.makedirs(d)
f = open(file, 'w')
(ignored, filename) = os.path.split(file)
name = filename.upper().replace('.', '_')
f.write('#ifndef %s\n'%name)
f.write('#define %s\n'%name) | mickem/nscp | [
217,
88,
217,
271,
1335593133
] |
def setup_action_groups (self):
self.actionGroup = Gtk.ActionGroup(name='RecipeEmailerActionGroup')
self.actionGroup.add_actions([
('EmailRecipes',None,_('Email recipes'),
None,_('Email all selected recipes (or all recipes if no recipes are selected'),self.email_selected... | thinkle/gourmet | [
341,
141,
341,
274,
1355706416
] |
def get_selected_recs (self):
recs = self.rg.get_selected_recs_from_rec_tree()
if not recs:
recs = self.rd.fetch_all(self.rd.recipe_table, deleted=False, sort_by=[('title',1)])
return recs | thinkle/gourmet | [
341,
141,
341,
274,
1355706416
] |
def base_app(request):
"""Flask application fixture."""
instance_path = tempfile.mkdtemp()
os.environ.update(
APP_INSTANCE_PATH=instance_path
)
app = create_app(
# CELERY_ALWAYS_EAGER=True,
# CELERY_CACHE_BACKEND="memory",
# CELERY_EAGER_PROPAGATES_EXCEPTIONS=True,
... | CERNDocumentServer/cds | [
16,
30,
16,
126,
1399296999
] |
def db(base_app):
"""Initialize database."""
# Init
if not database_exists(str(_db.engine.url)):
create_database(str(_db.engine.url))
_db.create_all()
yield _db
# Teardown
_db.session.remove()
_db.drop_all() | CERNDocumentServer/cds | [
16,
30,
16,
126,
1399296999
] |
def es(base_app):
"""Provide elasticsearch access."""
try:
list(current_search.create())
except RequestError:
list(current_search.delete())
list(current_search.create())
current_search_client.indices.refresh()
yield current_search_client
list(current_search.delete(ignor... | CERNDocumentServer/cds | [
16,
30,
16,
126,
1399296999
] |
def app(base_app, es, db):
"""Application with ES and DB."""
yield base_app | CERNDocumentServer/cds | [
16,
30,
16,
126,
1399296999
] |
def env_browser(request):
"""Fixture for a webdriver instance of the browser."""
if request.param is None:
request.param = "Firefox"
# Create instance of webdriver.`request.param`()
browser = getattr(webdriver, request.param)()
yield browser
# Quit the webdriver instance
browser.q... | CERNDocumentServer/cds | [
16,
30,
16,
126,
1399296999
] |
def isStockObject(obj):
"""Is this a stock windows object."""
return (obj & 0x80000000) != 0 | veusz/veusz | [
634,
96,
634,
303,
1296746008
] |
def __init__(self, style=pyemf.PS_SOLID, width=1, color=0,
styleentries=[]):
"""Create pen.
styleentries is a list of dash and space lengths."""
pyemf._EMR._EXTCREATEPEN.__init__(self)
self.style = style
self.penwidth = width
self.color = pyemf._normaliz... | veusz/veusz | [
634,
96,
634,
303,
1296746008
] |
def __init__(self, width_in, height_in, dpi=75):
qt.QPaintEngine.__init__(
self,
qt.QPaintEngine.Antialiasing |
qt.QPaintEngine.PainterPaths |
qt.QPaintEngine.PrimitiveTransform |
qt.QPaintEngine.PaintOutsidePaintEvent |
qt.QPaintEngine.Pat... | veusz/veusz | [
634,
96,
634,
303,
1296746008
] |
def drawLines(self, lines):
"""Draw lines to emf output."""
for line in lines:
self.emf.Polyline(
[ (int(line.x1()*scale), int(line.y1()*scale)),
(int(line.x2()*scale), int(line.y2()*scale)) ] ) | veusz/veusz | [
634,
96,
634,
303,
1296746008
] |
def drawEllipse(self, rect):
"""Draw an ellipse."""
# print "ellipse"
args = (
int(rect.left()*scale), int(rect.top()*scale),
int(rect.right()*scale), int(rect.bottom()*scale),
int(rect.left()*scale), int(rect.top()*scale),
int(rect.left()*scale)... | veusz/veusz | [
634,
96,
634,
303,
1296746008
] |
def drawPixmap(self, r, pixmap, sr):
"""Draw pixmap to display."""
# convert pixmap to BMP format
bytearr = qt.QByteArray()
buf = qt.QBuffer(bytearr)
buf.open(qt.QIODevice.WriteOnly)
pixmap.save(buf, "BMP")
# chop off bmp header to get DIB
bmp = bytes(bu... | veusz/veusz | [
634,
96,
634,
303,
1296746008
] |
def drawPath(self, path):
"""Draw a path on the output."""
# print "path"
self._createPath(path)
self.emf.StrokeAndFillPath() | veusz/veusz | [
634,
96,
634,
303,
1296746008
] |
def end(self):
return True | veusz/veusz | [
634,
96,
634,
303,
1296746008
] |
def _updatePen(self, pen):
"""Update the pen to the currently selected one."""
# line style
style = {
qt.Qt.NoPen: pyemf.PS_NULL,
qt.Qt.SolidLine: pyemf.PS_SOLID,
qt.Qt.DashLine: pyemf.PS_DASH,
qt.Qt.DotLine: pyemf.PS_DOT,
qt.Qt.DashDo... | veusz/veusz | [
634,
96,
634,
303,
1296746008
] |
def _updateClipPath(self, path, operation):
"""Update clipping path."""
# print "clip"
if operation != qt.Qt.NoClip:
self._createPath(path)
clipmode = {
qt.Qt.ReplaceClip: pyemf.RGN_COPY,
qt.Qt.IntersectClip: pyemf.RGN_AND,
}[... | veusz/veusz | [
634,
96,
634,
303,
1296746008
] |
def updateState(self, state):
"""Examine what has changed in state and call apropriate function."""
ss = state.state()
if ss & qt.QPaintEngine.DirtyPen:
self._updatePen(state.pen())
if ss & qt.QPaintEngine.DirtyBrush:
self._updateBrush(state.brush())
if ss... | veusz/veusz | [
634,
96,
634,
303,
1296746008
] |
def __init__(self, width_in, height_in, dpi=75):
qt.QPaintDevice.__init__(self)
self.engine = EMFPaintEngine(width_in, height_in, dpi=dpi) | veusz/veusz | [
634,
96,
634,
303,
1296746008
] |
def __init__(self, parent, name, address, length_bytes, device_info=None):
"""
:param parent: Parent object who owns this TenGbe instance
:param name: Unique name of the instance
:param address:
:param length_bytes:
:param device_info: Information about this device
... | ska-sa/casperfpga | [
6,
40,
6,
5,
1402594479
] |
def mac(self):
return self.get_gbe_core_details()['mac'] | ska-sa/casperfpga | [
6,
40,
6,
5,
1402594479
] |
def ip_address(self):
return self.get_gbe_core_details()['ip'] | ska-sa/casperfpga | [
6,
40,
6,
5,
1402594479
] |
def port(self):
return self.get_gbe_core_details()['fabric_port'] | ska-sa/casperfpga | [
6,
40,
6,
5,
1402594479
] |
def post_create_update(self, raw_device_info):
"""
Update the device with information not available at creation.
:param raw_device_info: info about this block that may be useful
"""
super(TenGbe, self).post_create_update(raw_device_info)
self.snaps = {'tx': None, 'rx': N... | ska-sa/casperfpga | [
6,
40,
6,
5,
1402594479
] |
def read_rxsnap(self):
"""
Read the RX snapshot embedded in this TenGBE yellow block
"""
return self.snaps['rx'].read(timeout=10)['data'] | ska-sa/casperfpga | [
6,
40,
6,
5,
1402594479
] |
def dhcp_start(self):
"""
Configure this interface, then start a DHCP client on ALL interfaces.
"""
#if self.mac is None:
# TODO get MAC from EEPROM serial number and assign here
# self.mac = '0'
reply, _ = self.parent.transport.katcprequest(
n... | ska-sa/casperfpga | [
6,
40,
6,
5,
1402594479
] |
def tap_stop(self):
"""
Stop a TAP driver.
"""
if not self.tap_running():
return
LOGGER.info('%s: stopping tap driver.' % self.fullname)
reply, _ = self.parent.transport.katcprequest(
name='tap-stop', request_timeout=-1,
require_ok=True... | ska-sa/casperfpga | [
6,
40,
6,
5,
1402594479
] |
def handle_inform(msg):
uninforms.append(msg) | ska-sa/casperfpga | [
6,
40,
6,
5,
1402594479
] |
def tap_running(self):
"""
Determine if an instance if tap is already running on for this
ten GBE interface.
"""
tapinfo = self.tap_info()
if tapinfo['name'] == '':
return False
return True | ska-sa/casperfpga | [
6,
40,
6,
5,
1402594479
] |
def multicast_receive(self, ip_str, group_size):
"""
Send a request to KATCP to have this tap instance send a multicast
group join request.
:param ip_str: A dotted decimal string representation of the base
mcast IP address.
:param group_size: An integer for how many ... | ska-sa/casperfpga | [
6,
40,
6,
5,
1402594479
] |
def _fabric_enable_disable(self, target_val):
"""
:param target_val:
"""
if self.memmap_compliant:
word_bytes = list(
struct.unpack('>4B', self.parent.read(self.name, 4, OFFSET_FLAGS)))
if word_bytes[0] == target_val:
return
... | ska-sa/casperfpga | [
6,
40,
6,
5,
1402594479
] |
def fabric_disable(self):
"""
Enable the core fabric
"""
self._fabric_enable_disable(0) | ska-sa/casperfpga | [
6,
40,
6,
5,
1402594479
] |
def write_val(val):
word_bytes[2] = val
word_packed = struct.pack('>4B', *word_bytes)
if val == 0:
self.parent.write(self.name, word_packed, OFFSET_FLAGS)
else:
self.parent.blindwrite(self.name, word_packed, OFFSET_F... | ska-sa/casperfpga | [
6,
40,
6,
5,
1402594479
] |
def write_val(val):
word_bytes[0] = val
word_packed = struct.pack('>4B', *word_bytes)
if val == 0:
self.parent.write(self.name, word_packed, 0x20)
else:
self.parent.blindwrite(self.name, word_packed, 0x20) | ska-sa/casperfpga | [
6,
40,
6,
5,
1402594479
] |
def get_gbe_core_details(self, read_arp=False, read_cpu=False):
"""
Get 10GbE core details.
assemble struct for header stuff...
.. code-block:: python
\"\"\"
0x00 - 0x07: MAC address
0x08 - 0x0b: Not used
0x0c - 0x0f: Gateway addr
... | ska-sa/casperfpga | [
6,
40,
6,
5,
1402594479
] |
def get_cpu_details(self, port_dump=None):
"""
Read details of the CPU buffers.
:param port_dump:
"""
#TODO Not memmap compliant
if port_dump is None:
port_dump = self.parent.read(self.name, 16384)
port_dump = list(struct.unpack('>16384B', port_du... | ska-sa/casperfpga | [
6,
40,
6,
5,
1402594479
] |
def guess_payload(p):
LDPTypes = {
0x0001: LDPNotification,
0x0100: LDPHello,
0x0200: LDPInit,
0x0201: LDPKeepAlive,
0x0300: LDPAddress,
0x0301: LDPAddressWM,
0x0400: LDPLabelMM,
0x0401: LDPLabelReqM,
0x0404: LDPLabelARM,
0x0402: LDPLab... | phaethon/scapy | [
847,
200,
847,
72,
1422527787
] |
def m2i(self, pkt, x):
nbr = struct.unpack("!H",x[2:4])[0]
used = 0
x=x[4:]
list=[]
while x:
#if x[0] == 1:
# list.append('Wildcard')
#else:
#mask=ord(x[8*i+3])
#add=inet_ntoa(x[8*i+4:8*i+8])
mask=ord(x[3])... | phaethon/scapy | [
847,
200,
847,
72,
1422527787
] |
def size(self, s):
"""Get the size of this field"""
l = 4 + struct.unpack("!H",s[2:4])[0]
return l | phaethon/scapy | [
847,
200,
847,
72,
1422527787
] |
def m2i(self, pkt, x):
return struct.unpack("!I",x[4:8])[0] | phaethon/scapy | [
847,
200,
847,
72,
1422527787
] |
def size(self, s):
"""Get the size of this field"""
l = 4 + struct.unpack("!H",s[2:4])[0]
return l | phaethon/scapy | [
847,
200,
847,
72,
1422527787
] |
def m2i(self, pkt, x):
nbr = struct.unpack("!H",x[2:4])[0] - 2
nbr /= 4
x=x[6:]
list=[]
for i in range(0,nbr):
add = x[4*i:4*i+4]
list.append(inet_ntoa(add))
return list | phaethon/scapy | [
847,
200,
847,
72,
1422527787
] |
def size(self, s):
"""Get the size of this field"""
l = 4 + struct.unpack("!H",s[2:4])[0]
return l | phaethon/scapy | [
847,
200,
847,
72,
1422527787
] |
def m2i(self, pkt, x):
l = []
statuscode = struct.unpack("!I",x[4:8])[0]
l.append( (statuscode & 2**31) >> 31)
l.append( (statuscode & 2**30) >> 30)
l.append( statuscode & 0x3FFFFFFF )
l.append( struct.unpack("!I", x[8:12])[0] )
l.append( struct.unpack("!H", x[12:... | phaethon/scapy | [
847,
200,
847,
72,
1422527787
] |
def getfield(self, pkt, s):
l = 14
return s[l:],self.m2i(pkt, s[:l]) | phaethon/scapy | [
847,
200,
847,
72,
1422527787
] |
def m2i(self, pkt, x):
list = []
v = struct.unpack("!H",x[4:6])[0]
list.append(v)
flags = struct.unpack("B",x[6])[0]
v = ( flags & 0x80 ) >> 7
list.append(v)
v = ( flags & 0x40 ) >> 7
list.append(v)
return list | phaethon/scapy | [
847,
200,
847,
72,
1422527787
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.