function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def b64_decode(data):
"""Decodes standard unpadded base64 encoded string."""
mod = len(data) % 4
if mod:
data += '=' * (4 - mod)
return base64.b64decode(data) | luci/luci-py | [
70,
40,
70,
82,
1427740754
] |
def save_paired_items(request, user, formset, Model,
item_name, counterpart_name):
"""
Handle saving skills or links to the database.
"""
paired_items = []
for form in formset:
if form.is_valid():
item = form.cleaned_data.get(item_name, None)
co... | nlhkabu/connect | [
47,
25,
47,
18,
1433260168
] |
def save_links(request, user, formset):
"""Wrapper function to save paired link anchors and URLs."""
save_paired_items(request, user, formset, UserLink, 'anchor', 'url') | nlhkabu/connect | [
47,
25,
47,
18,
1433260168
] |
def __init__(self, *args, **kwargs):
"""
Initialize the endpoint
"""
super(AutomationActions, self).__init__(*args, **kwargs)
self.endpoint = 'automations'
self.workflow_id = None | charlesthk/python-mailchimp | [
460,
138,
460,
34,
1441895803
] |
def pause(self, workflow_id):
"""
Pause all emails in a specific Automation workflow.
:param workflow_id: The unique id for the Automation workflow.
:type workflow_id: :py:class:`str`
"""
self.workflow_id = workflow_id
return self._mc_client._post(url=self._build... | charlesthk/python-mailchimp | [
460,
138,
460,
34,
1441895803
] |
def from_tree(tree):
pass | N-Parsons/exercism-python | [
1,
1,
1,
3,
1506170251
] |
def set_value(self):
pass | N-Parsons/exercism-python | [
1,
1,
1,
3,
1506170251
] |
def set_left(self):
pass | N-Parsons/exercism-python | [
1,
1,
1,
3,
1506170251
] |
def set_right(self):
pass | N-Parsons/exercism-python | [
1,
1,
1,
3,
1506170251
] |
def __init__(self, input_capture_file_path, capture_cmd, wireshark_pipe):
self.input_capture_file_path = input_capture_file_path
self.capture_cmd = capture_cmd
self.wireshark_pipe = wireshark_pipe
self.process = None
self.pipe = None
QtCore.QThread.__init__(self) | GNS3/gns3-legacy | [
13,
10,
13,
1,
1380163967
] |
def run(self):
try:
in_file = open(self.input_capture_file_path, 'rb')
except IOError, e:
debug("Cannot open capture file: %s") % unicode(e)
self.exit()
return
try:
self.process = subprocess.Popen(self.capture_cmd.strip())
exce... | GNS3/gns3-legacy | [
13,
10,
13,
1,
1380163967
] |
def PathToTestFile( *args ):
dir_of_current_script = os.path.dirname( os.path.abspath( __file__ ) )
return os.path.join( dir_of_current_script, 'testdata', *args ) | puremourning/ycmd-1 | [
3,
2,
3,
1,
1423398207
] |
def tearDownModule():
global shared_app, shared_filepaths
for filepath in shared_filepaths.get( shared_app, [] ):
StopCompleterServer( shared_app, 'cs', filepath ) | puremourning/ycmd-1 | [
3,
2,
3,
1,
1423398207
] |
def Wrapper( test_case_instance, *args, **kwargs ):
ClearCompletionsCache()
with IgnoreExtraConfOutsideTestsFolder():
return test( test_case_instance, shared_app, *args, **kwargs ) | puremourning/ycmd-1 | [
3,
2,
3,
1,
1423398207
] |
def IsolatedYcmd( custom_options = {} ):
def Decorator( test ):
@functools.wraps( test )
def Wrapper( test_case_instance, *args, **kwargs ):
with IsolatedApp( custom_options ) as app:
try:
test( test_case_instance, app, *args, **kwargs )
finally:
global shared_filepat... | puremourning/ycmd-1 | [
3,
2,
3,
1,
1423398207
] |
def ReadFile( filepath, fileposition ):
with open( filepath, encoding = 'utf8' ) as f:
if fileposition:
f.seek( fileposition )
return f.read(), f.tell() | puremourning/ycmd-1 | [
3,
2,
3,
1,
1423398207
] |
def WrapOmniSharpServer( app, filepath ):
global shared_filepaths
global shared_log_indexes
if filepath not in shared_filepaths.setdefault( app, [] ):
GetDiagnostics( app, filepath )
shared_filepaths[ app ].append( filepath )
WaitUntilCsCompleterIsReady( app, filepath )
logfiles = []
response = ... | puremourning/ycmd-1 | [
3,
2,
3,
1,
1423398207
] |
def __init__(self, fileOrPath):
self._resources = OrderedDict()
if hasattr(fileOrPath, 'read'):
self.file = fileOrPath
else:
try:
# try reading from the resource fork (only works on OS X)
self.file = self.openResourceFork(fileOrPath)
self._readFile()
return
except (ResourceError, IOError)... | MitchTalmadge/Emoji-Tools | [
103,
16,
103,
14,
1431903482
] |
def openResourceFork(path):
with open(path + '/..namedfork/rsrc', 'rb') as resfork:
data = resfork.read()
infile = BytesIO(data)
infile.name = path
return infile | MitchTalmadge/Emoji-Tools | [
103,
16,
103,
14,
1431903482
] |
def openDataFork(path):
with open(path, 'rb') as datafork:
data = datafork.read()
infile = BytesIO(data)
infile.name = path
return infile | MitchTalmadge/Emoji-Tools | [
103,
16,
103,
14,
1431903482
] |
def _read(self, numBytes, offset=None):
if offset is not None:
try:
self.file.seek(offset)
except OverflowError:
raise ResourceError("Failed to seek offset ('offset' is too large)")
if self.file.tell() != offset:
raise ResourceError('Failed to seek offset (reached EOF)')
try:
data = self.fil... | MitchTalmadge/Emoji-Tools | [
103,
16,
103,
14,
1431903482
] |
def _readTypeList(self):
absTypeListOffset = self.absTypeListOffset
numTypesData = self._read(2, absTypeListOffset)
self.numTypes, = struct.unpack('>H', numTypesData)
absTypeListOffset2 = absTypeListOffset + 2
for i in range(self.numTypes + 1):
resTypeItemOffset = absTypeListOffset2 + ResourceTypeItemSize ... | MitchTalmadge/Emoji-Tools | [
103,
16,
103,
14,
1431903482
] |
def __getitem__(self, resType):
return self._resources[resType] | MitchTalmadge/Emoji-Tools | [
103,
16,
103,
14,
1431903482
] |
def __setitem__(self, resType, resources):
self._resources[resType] = resources | MitchTalmadge/Emoji-Tools | [
103,
16,
103,
14,
1431903482
] |
def __iter__(self):
return iter(self._resources) | MitchTalmadge/Emoji-Tools | [
103,
16,
103,
14,
1431903482
] |
def types(self):
return list(self._resources.keys()) | MitchTalmadge/Emoji-Tools | [
103,
16,
103,
14,
1431903482
] |
def getIndices(self, resType):
numRes = self.countResources(resType)
if numRes:
return list(range(1, numRes+1))
else:
return [] | MitchTalmadge/Emoji-Tools | [
103,
16,
103,
14,
1431903482
] |
def getIndResource(self, resType, index):
"""Return resource of given type located at an index ranging from 1
to the number of resources for that type, or None if not found.
"""
if index < 1:
return None
try:
res = self[resType][index-1]
except (KeyError, IndexError):
return None
return res | MitchTalmadge/Emoji-Tools | [
103,
16,
103,
14,
1431903482
] |
def close(self):
if not self.file.closed:
self.file.close() | MitchTalmadge/Emoji-Tools | [
103,
16,
103,
14,
1431903482
] |
def __init__(self, resType=None, resData=None, resID=None, resName=None,
resAttr=None):
self.type = resType
self.data = resData
self.id = resID
self.name = resName
self.attr = resAttr | MitchTalmadge/Emoji-Tools | [
103,
16,
103,
14,
1431903482
] |
def __init__(self, model=None):
super(ContainerStatus, self).__init__()
self._name = None
self._state = None
self._last_state = None
self._ready = None
self._restart_count = None
self._image = None
self._image_id = None
self._container_id = None
... | mnubo/kubernetes-py | [
122,
48,
122,
12,
1452712930
] |
def name(self):
return self._name | mnubo/kubernetes-py | [
122,
48,
122,
12,
1452712930
] |
def name(self, name=None):
if not is_valid_string(name):
raise SyntaxError("ContainerStatus: name: [ {0} ] is invalid".format(name))
self._name = name | mnubo/kubernetes-py | [
122,
48,
122,
12,
1452712930
] |
def state(self):
return self._state | mnubo/kubernetes-py | [
122,
48,
122,
12,
1452712930
] |
def state(self, state=None):
if not isinstance(state, ContainerState):
raise SyntaxError("ContainerStatus: state: [ {0} ] is invalid".format(state))
self._state = state | mnubo/kubernetes-py | [
122,
48,
122,
12,
1452712930
] |
def last_state(self):
return self._last_state | mnubo/kubernetes-py | [
122,
48,
122,
12,
1452712930
] |
def last_state(self, state=None):
if not isinstance(state, ContainerState):
raise SyntaxError("ContainerStatus: last_state: [ {0} ] is invalid".format(state))
self._last_state = state | mnubo/kubernetes-py | [
122,
48,
122,
12,
1452712930
] |
def ready(self):
return self._ready | mnubo/kubernetes-py | [
122,
48,
122,
12,
1452712930
] |
def ready(self, ready=None):
if not isinstance(ready, bool):
raise SyntaxError("ContainerStatus: ready: [ {0} ] is invalid".format(ready))
self._ready = ready | mnubo/kubernetes-py | [
122,
48,
122,
12,
1452712930
] |
def restart_count(self):
return self._restart_count | mnubo/kubernetes-py | [
122,
48,
122,
12,
1452712930
] |
def restart_count(self, count=None):
if not isinstance(count, int):
raise SyntaxError("ContainerStatus: restart_count: [ {0} ] is invalid".format(count))
self._restart_count = count | mnubo/kubernetes-py | [
122,
48,
122,
12,
1452712930
] |
def image(self):
return self._image | mnubo/kubernetes-py | [
122,
48,
122,
12,
1452712930
] |
def image(self, image=None):
if not is_valid_string(image):
raise SyntaxError("ContainerStatus: image: [ {0} ] is invalid".format(image))
self._image = image | mnubo/kubernetes-py | [
122,
48,
122,
12,
1452712930
] |
def image_id(self):
return self._image_id | mnubo/kubernetes-py | [
122,
48,
122,
12,
1452712930
] |
def image_id(self, iid=None):
if not is_valid_string(iid):
raise SyntaxError("ContainerStatus: image_id: [ {0} ] is invalid".format(iid))
self._image_id = iid | mnubo/kubernetes-py | [
122,
48,
122,
12,
1452712930
] |
def container_id(self):
return self._container_id | mnubo/kubernetes-py | [
122,
48,
122,
12,
1452712930
] |
def container_id(self, cid=None):
if not is_valid_string(cid):
raise SyntaxError("ContainerStatus: container_id: [ {0} ] is invalid".format(cid))
self._container_id = cid | mnubo/kubernetes-py | [
122,
48,
122,
12,
1452712930
] |
def test_SmokeTest(self):
"ipc - Should be derived from object."
self.failUnless(isinstance(ipc(),object), "IPC objects should also be instances of object.") | sparkslabs/kamaelia_ | [
13,
3,
13,
2,
1348148442
] |
def test___init__SmokeTest_NoArguments(self):
"newComponent.__init__ - Should work without problems."
nc=newComponent()
self.failUnless(isinstance(nc, ipc), "newComponent should be derived from ipc class")
self.failUnless(len(nc.components())==0, "There should be no components in the message if ... | sparkslabs/kamaelia_ | [
13,
3,
13,
2,
1348148442
] |
def test_components(self):
"newComponent.components - Returns a tuple of components that need to be added to the run queue/activated. Same test as for __init__ as they are counterparts."
nc=newComponent("ba","da","bing")
self.failUnless(nc.components()==("ba","da","bing"), "components returned somethi... | sparkslabs/kamaelia_ | [
13,
3,
13,
2,
1348148442
] |
def test___init__SmokeTest_NoArguments(self):
"shutdownMicroprocess.__init__ - Should work without problems."
sm=shutdownMicroprocess()
self.failUnless(isinstance(sm,ipc), "shutdownMicroprocess should be derived from ipc")
self.failUnless(sm.microprocesses()==(), "Microprocess tuple not empty as... | sparkslabs/kamaelia_ | [
13,
3,
13,
2,
1348148442
] |
def test_microprocesses(self):
"shutdownMicroprocess.microprocesses- Returns the list of microprocesses that need to be shutdown. This is essentially the counterpart to the __init__ test."
sm=shutdownMicroprocess("ba","da","bing")
self.failUnless(sm.microprocesses()==("ba","da","bing"), "Returned tupl... | sparkslabs/kamaelia_ | [
13,
3,
13,
2,
1348148442
] |
def test_SmokeTest_NoArguments(self):
"notify.__init__ - Called without arguments fails."
self.failUnlessRaises(TypeError, notify) | sparkslabs/kamaelia_ | [
13,
3,
13,
2,
1348148442
] |
def test_SmokeTest_NoArguments(self):
"status.__init__ - Called without arguments fails."
self.failUnlessRaises(TypeError, status) | sparkslabs/kamaelia_ | [
13,
3,
13,
2,
1348148442
] |
def test_status(self):
"status.status - Returns the status message stored inside the status object. Counterpart to __init__ test."
s=status("Status message.")
self.failUnless(s.status() == "Status message.", "Status message not stored properly.") | sparkslabs/kamaelia_ | [
13,
3,
13,
2,
1348148442
] |
def test_SmokeTest_NoArguments(self):
"wouldblock.__init__ - Called without arguments fails."
self.failUnlessRaises(TypeError, wouldblock) | sparkslabs/kamaelia_ | [
13,
3,
13,
2,
1348148442
] |
def test_SmokeTest_NoArguments(self):
"producerFinished.__init__ - Called without arguments defaults to a caller of None, message of None. Checks producerFinished is a subclass of ipc"
pf=producerFinished()
self.failUnless(isinstance(pf, ipc), "producerFinished should be an derived from ipc.")
... | sparkslabs/kamaelia_ | [
13,
3,
13,
2,
1348148442
] |
def test_SmokeTest_NoArguments(self):
"errorInformation.__init__ - Called without arguments fails - must include caller."
self.failUnlessRaises(TypeError, errorInformation) | sparkslabs/kamaelia_ | [
13,
3,
13,
2,
1348148442
] |
def test_SmokeTest_MinSensibleArguments(self):
"errorInformation.__init__ - An exception & message (any object) in addition to the caller to provide a more meaningful errorInformation message where appropriate. ttbw "
ei=errorInformation("caller", "exception", "message")
self.failUnless(ei.caller == "... | sparkslabs/kamaelia_ | [
13,
3,
13,
2,
1348148442
] |
def test_gamma():
t = np.linspace(0, 30, 5000)
# make up some numbers
pk_t = 5.0
fwhm = 6.0
# get the estimated parameters
shape, scale, coef = gamma_params(pk_t, fwhm)
# get distribution function
g_exp = gamma_expr(pk_t, fwhm)
# make matching standard distribution
gf = gamma(sha... | alexis-roche/nipy | [
1,
1,
1,
1,
1272833701
] |
def test_spm_hrf_octave():
# Test SPM hrf against output from SPM code running in Octave
my_path = dirname(__file__)
hrfs_path = pjoin(my_path, 'spm_hrfs.mat')
# mat file resulting from make_hrfs.m
hrfs_mat = sio.loadmat(hrfs_path, squeeze_me=True)
params = hrfs_mat['params']
hrfs = hrfs_mat... | alexis-roche/nipy | [
1,
1,
1,
1,
1272833701
] |
def setUp(self):
if os.path.exists(TESTFN):
mode = 'r+b'
else:
mode = 'w+b'
with self.open(TESTFN, mode) as f:
current_size = os.fstat(f.fileno())[stat.ST_SIZE]
if current_size == size+1:
return
if current_size == 0:
... | brython-dev/brython | [
5954,
494,
5954,
33,
1410764301
] |
def tearDownClass(cls):
with cls.open(TESTFN, 'wb'):
pass
if not os.stat(TESTFN)[stat.ST_SIZE] == 0:
raise cls.failureException('File was not truncated by opening '
'with mode "wb"')
unlink(TESTFN2) | brython-dev/brython | [
5954,
494,
5954,
33,
1410764301
] |
def test_large_read(self, _size):
# bpo-24658: Test that a read greater than 2GB does not fail.
with self.open(TESTFN, "rb") as f:
self.assertEqual(len(f.read()), size + 1)
self.assertEqual(f.tell(), size + 1) | brython-dev/brython | [
5954,
494,
5954,
33,
1410764301
] |
def test_seek_read(self):
with self.open(TESTFN, 'rb') as f:
self.assertEqual(f.tell(), 0)
self.assertEqual(f.read(1), b'z')
self.assertEqual(f.tell(), 1)
f.seek(0)
self.assertEqual(f.tell(), 0)
f.seek(0, 0)
self.assertEqual(f.t... | brython-dev/brython | [
5954,
494,
5954,
33,
1410764301
] |
def test_truncate(self):
with self.open(TESTFN, 'r+b') as f:
if not hasattr(f, 'truncate'):
raise unittest.SkipTest("open().truncate() not available "
"on this system")
f.seek(0, 2)
# else we've lost track of the true si... | brython-dev/brython | [
5954,
494,
5954,
33,
1410764301
] |
def skip_no_disk_space(path, required):
def decorator(fun):
def wrapper(*args, **kwargs):
if shutil.disk_usage(os.path.realpath(path)).free < required:
hsize = int(required / 1024 / 1024)
raise unittest.SkipTest(
f"required {hsize} MiB of free ... | brython-dev/brython | [
5954,
494,
5954,
33,
1410764301
] |
def test_it(self):
# Internally shutil.copyfile() can use "fast copy" methods like
# os.sendfile().
size = os.path.getsize(TESTFN)
shutil.copyfile(TESTFN, TESTFN2)
self.assertEqual(os.path.getsize(TESTFN2), size)
with open(TESTFN2, 'rb') as f:
self.assertEqual... | brython-dev/brython | [
5954,
494,
5954,
33,
1410764301
] |
def setUp(self):
super().setUp()
self.thread = None | brython-dev/brython | [
5954,
494,
5954,
33,
1410764301
] |
def tcp_server(self, sock):
def run(sock):
with sock:
conn, _ = sock.accept()
conn.settimeout(self.timeout)
with conn, open(TESTFN2, 'wb') as f:
event.wait(self.timeout)
while True:
chunk ... | brython-dev/brython | [
5954,
494,
5954,
33,
1410764301
] |
def test_it(self):
port = socket_helper.find_unused_port()
with socket.create_server(("", port)) as sock:
self.tcp_server(sock)
with socket.create_connection(("127.0.0.1", port)) as client:
with open(TESTFN, 'rb') as f:
client.sendfile(f)
... | brython-dev/brython | [
5954,
494,
5954,
33,
1410764301
] |
def tearDownModule():
unlink(TESTFN)
unlink(TESTFN2) | brython-dev/brython | [
5954,
494,
5954,
33,
1410764301
] |
def __init__(self, name: str) -> None:
"""Initialize the sensor."""
self._attr_name = name | home-assistant/home-assistant | [
58698,
22318,
58698,
2794,
1379402988
] |
def test():
# Presence of comments should not affect contents of tags. (In old pyxl, this led to differences
# in whitespace handling.)
assert str(get_frag1()) == str(get_frag2()) | dropbox/pyxl | [
519,
58,
519,
2,
1361664830
] |
def InitializeMacNowFunction(plat):
"""Sets a monotonic clock for the Mac platform.
Args:
plat: Platform that is being run on. Unused in GetMacNowFunction. Passed
for consistency between initilaizers.
"""
del plat # Unused
global _CLOCK # pylint: disable=global-statement
global _NOW_FUNCT... | cricketclubucd/davisdragons | [
3,
1,
3,
12,
1499574730
] |
def InitializeLinuxNowFunction(plat):
"""Sets a monotonic clock for linux platforms.
Args:
plat: Platform that is being run on.
"""
global _CLOCK # pylint: disable=global-statement
global _NOW_FUNCTION # pylint: disable=global-statement
_CLOCK = _LINUX_CLOCK
clock_monotonic = GetClockGetTimeClo... | cricketclubucd/davisdragons | [
3,
1,
3,
12,
1499574730
] |
def InitializeWinNowFunction(plat):
"""Sets a monotonic clock for windows platforms.
Args:
plat: Platform that is being run on.
"""
global _CLOCK # pylint: disable=global-statement
global _NOW_FUNCTION # pylint: disable=global-statement
if IsQPCUsable():
_CLOCK = _WIN_HIRES
qpc_return = ... | cricketclubucd/davisdragons | [
3,
1,
3,
12,
1499574730
] |
def Now():
return _NOW_FUNCTION() * 1e6 # convert from seconds to microseconds | cricketclubucd/davisdragons | [
3,
1,
3,
12,
1499574730
] |
def find_ntoskrnl(version_modules):
for entry in version_modules:
e_type = entry[0]
if e_type == 'r':
e_data = entry[1]
if e_data['pdb'] in NT_KRNL_PDB:
return (e_data['pdb'], e_data['guid'])
raise RuntimeError('Cannot find {} with version_modules '
... | libvmi/libvmi | [
609,
225,
609,
85,
1357164372
] |
def format_config(domain, config, old_format=False):
if not old_format:
formatted_config = """ | libvmi/libvmi | [
609,
225,
609,
85,
1357164372
] |
def main(args):
# delete rekall's BasicConfig
# we want to configure the root logger
for handler in logging.root.handlers[:]:
logging.root.removeHandler(handler)
debug = args['--debug']
# configure root logger
log_level = logging.INFO
if debug:
log_level = logging.DEBUG
l... | libvmi/libvmi | [
609,
225,
609,
85,
1357164372
] |
def conv_block(
data,
name,
channels,
kernel_size=(3, 3),
strides=(1, 1),
padding=(1, 1),
epsilon=1e-5,
layout="NCHW", | dmlc/tvm | [
9142,
2938,
9142,
595,
1476310828
] |
def separable_conv_block(
data,
name,
depthwise_channels,
pointwise_channels,
kernel_size=(3, 3),
downsample=False,
padding=(1, 1),
epsilon=1e-5,
layout="NCHW",
dtype="float32", | dmlc/tvm | [
9142,
2938,
9142,
595,
1476310828
] |
def mobile_net(
num_classes=1000,
data_shape=(1, 3, 224, 224),
dtype="float32",
alpha=1.0,
is_shallow=False,
layout="NCHW", | dmlc/tvm | [
9142,
2938,
9142,
595,
1476310828
] |
def get_workload(
batch_size=1, num_classes=1000, image_shape=(3, 224, 224), dtype="float32", layout="NCHW" | dmlc/tvm | [
9142,
2938,
9142,
595,
1476310828
] |
def ready(self):
# To override the settings before loading social_django.
if settings.FEATURES.get('ENABLE_THIRD_PARTY_AUTH', False):
self._enable_third_party_auth() | edx/edx-platform | [
6290,
3437,
6290,
280,
1369945238
] |
def __init__(self, stringbinding):
match = DCERPCStringBinding.parser.match(stringbinding)
self.__uuid = match.group(1)
self.__ps = match.group(2)
self.__na = match.group(3)
options = match.group(4)
if options:
options = options.split(',')
self.__e... | pwnieexpress/pwn_plug_sources | [
124,
97,
124,
24,
1321552607
] |
def get_protocol_sequence(self):
return self.__ps | pwnieexpress/pwn_plug_sources | [
124,
97,
124,
24,
1321552607
] |
def get_endpoint(self):
return self.__endpoint | pwnieexpress/pwn_plug_sources | [
124,
97,
124,
24,
1321552607
] |
def __str__(self):
return DCERPCStringBindingCompose(self.__uuid, self.__ps, self.__na, self.__endpoint, self.__options) | pwnieexpress/pwn_plug_sources | [
124,
97,
124,
24,
1321552607
] |
def DCERPCTransportFactory(stringbinding):
sb = DCERPCStringBinding(stringbinding)
na = sb.get_network_address()
ps = sb.get_protocol_sequence()
if 'ncadg_ip_udp' == ps:
port = sb.get_endpoint()
if port:
return UDPTransport(na, int(port))
else:
return UDP... | pwnieexpress/pwn_plug_sources | [
124,
97,
124,
24,
1321552607
] |
def __init__(self, dstip, dstport):
self.__dstip = dstip
self.__dstport = dstport
self._max_send_frag = None
self._max_recv_frag = None
self.set_credentials('','','','') | pwnieexpress/pwn_plug_sources | [
124,
97,
124,
24,
1321552607
] |
def send(self,data=0, forceWriteAndx = 0, forceRecv = 0):
raise RuntimeError, 'virtual function' | pwnieexpress/pwn_plug_sources | [
124,
97,
124,
24,
1321552607
] |
def disconnect(self):
raise RuntimeError, 'virtual function' | pwnieexpress/pwn_plug_sources | [
124,
97,
124,
24,
1321552607
] |
def get_dip(self):
return self.__dstip | pwnieexpress/pwn_plug_sources | [
124,
97,
124,
24,
1321552607
] |
def get_dport(self):
return self.__dstport | pwnieexpress/pwn_plug_sources | [
124,
97,
124,
24,
1321552607
] |
def get_addr(self):
return (self.get_dip(), self.get_dport()) | pwnieexpress/pwn_plug_sources | [
124,
97,
124,
24,
1321552607
] |
def set_max_fragment_size(self, send_fragment_size):
# -1 is default fragment size: 0 (don't fragment)
# 0 is don't fragment
# other values are max fragment size
if send_fragment_size == -1:
self.set_default_max_fragment_size()
else:
self._max_send_fra... | pwnieexpress/pwn_plug_sources | [
124,
97,
124,
24,
1321552607
] |
def get_credentials(self):
return (
self._username,
self._password,
self._nt_hash,
self._lm_hash) | pwnieexpress/pwn_plug_sources | [
124,
97,
124,
24,
1321552607
] |
def __init__(self,dstip, dstport = 135):
DCERPCTransport.__init__(self, dstip, dstport)
self.__socket = 0 | pwnieexpress/pwn_plug_sources | [
124,
97,
124,
24,
1321552607
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.