function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def __init__(
self,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
value: Optional[List["JobResponse"]] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
properties: Optional["RouteProperties"] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
lock_duration_as_iso8601: Optional[datetime.timedelta] = None,
ttl_as_iso8601: Optional[datetime.timedelta] = None,
max_delivery_count: Optional[int] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
value: Optional[str] = None,
localized_value: Optional[str] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
display: Optional["OperationDisplay"] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
name: str,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
message: Optional[str] = None,
severity: Optional[Union[str, "RouteErrorSeverity"]] = None,
location: Optional["RouteErrorRange"] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
line: Optional[int] = None,
column: Optional[int] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
start: Optional["RouteErrorPosition"] = None,
end: Optional["RouteErrorPosition"] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
name: str,
source: Union[str, "RoutingSource"],
endpoint_names: List[str],
is_enabled: bool,
condition: Optional[str] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
service_bus_queues: Optional[List["RoutingServiceBusQueueEndpointProperties"]] = None,
service_bus_topics: Optional[List["RoutingServiceBusTopicEndpointProperties"]] = None,
event_hubs: Optional[List["RoutingEventHubProperties"]] = None,
storage_con... | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
connection_string: str,
name: str,
subscription_id: Optional[str] = None,
resource_group: Optional[str] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
body: Optional[str] = None,
app_properties: Optional[Dict[str, str]] = None,
system_properties: Optional[Dict[str, str]] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
endpoints: Optional["RoutingEndpoints"] = None,
routes: Optional[List["RouteProperties"]] = None,
fallback_route: Optional["FallbackRouteProperties"] = None,
enrichments: Optional[List["EnrichmentProperties"]] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
connection_string: str,
name: str,
subscription_id: Optional[str] = None,
resource_group: Optional[str] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
connection_string: str,
name: str,
subscription_id: Optional[str] = None,
resource_group: Optional[str] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
connection_string: str,
name: str,
container_name: str,
subscription_id: Optional[str] = None,
resource_group: Optional[str] = None,
file_name_format: Optional[str] = None,
batch_frequency_in_seconds: Optional[int] = None,
... | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
tags: Optional[Any] = None,
properties: Optional["RoutingTwinProperties"] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
desired: Optional[Any] = None,
reported: Optional[Any] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
key_name: str,
rights: Union[str, "AccessRights"],
primary_key: Optional[str] = None,
secondary_key: Optional[str] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
value: Optional[List["SharedAccessSignatureAuthorizationRule"]] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
connection_string: str,
container_name: str,
sas_ttl_as_iso8601: Optional[datetime.timedelta] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
tags: Optional[Dict[str, str]] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
routing_source: Optional[Union[str, "RoutingSource"]] = None,
message: Optional["RoutingMessage"] = None,
twin: Optional["RoutingTwin"] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
routes: Optional[List["MatchedRoute"]] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
route: "RouteProperties",
message: Optional["RoutingMessage"] = None,
twin: Optional["RoutingTwin"] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
result: Optional[Union[str, "TestResultStatus"]] = None,
details: Optional["TestRouteResultDetails"] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
compilation_errors: Optional[List["RouteCompilationError"]] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
id: Optional[str] = None,
type: Optional[str] = None,
unit: Optional[str] = None,
current_value: Optional[int] = None,
limit: Optional[int] = None,
name: Optional["Name"] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(
self,
*,
value: Optional[List["UserSubscriptionQuota"]] = None,
**kwargs | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(self, msg, code):
super(CustomException, self).__init__(msg)
self.code = code | ininex/geofire-python | [
6,
5,
6,
3,
1486450134
] |
def test_call_api_call(self):
settings = _CallSettings()
my_callable = api_callable.create_api_call(
lambda _req, _timeout: 42, settings)
self.assertEqual(my_callable(None), 42) | ininex/geofire-python | [
6,
5,
6,
3,
1486450134
] |
def test_call_kwargs(self):
settings = _CallSettings(kwargs={'key': 'value'})
my_callable = api_callable.create_api_call(
lambda _req, _timeout, **kwargs: kwargs['key'], settings)
self.assertEqual(my_callable(None), 'value')
self.assertEqual(my_callable(None, CallOptions(key=... | ininex/geofire-python | [
6,
5,
6,
3,
1486450134
] |
def test_retry(self, mock_exc_to_code, mock_time):
mock_exc_to_code.side_effect = lambda e: e.code
to_attempt = 3
retry = RetryOptions(
[_FAKE_STATUS_CODE_1],
BackoffSettings(0, 0, 0, 0, 0, 0, 1))
# Succeeds on the to_attempt'th call, and never again afterward
... | ininex/geofire-python | [
6,
5,
6,
3,
1486450134
] |
def __init__(self, page_token=0):
self.page_token = page_token | ininex/geofire-python | [
6,
5,
6,
3,
1486450134
] |
def __init__(self, nums=(), next_page_token=0):
self.nums = nums
self.next_page_token = next_page_token | ininex/geofire-python | [
6,
5,
6,
3,
1486450134
] |
def grpc_return_value(request, *dummy_args, **dummy_kwargs):
start = int(request.page_token)
if start > 0 and start < page_size * pages_to_stream:
return PageStreamingResponse(
nums=list(range(start,
start + page_size)),
... | ininex/geofire-python | [
6,
5,
6,
3,
1486450134
] |
def test_bundling_page_streaming_error(self):
settings = _CallSettings(
page_descriptor=object(), bundle_descriptor=object(),
bundler=object())
with self.assertRaises(ValueError):
api_callable.create_api_call(lambda _req, _timeout: 42, settings) | ininex/geofire-python | [
6,
5,
6,
3,
1486450134
] |
def __init__(self, elements=None):
self.elements = elements | ininex/geofire-python | [
6,
5,
6,
3,
1486450134
] |
def my_func(request, dummy_timeout):
return len(request.elements) | ininex/geofire-python | [
6,
5,
6,
3,
1486450134
] |
def test_construct_settings(self):
defaults = api_callable.construct_settings(
_SERVICE_NAME, _A_CONFIG, dict(), _RETRY_DICT,
bundle_descriptors=_BUNDLE_DESCRIPTORS,
page_descriptors=_PAGE_DESCRIPTORS,
kwargs={'key1': 'value1'})
settings = defaults['bundli... | ininex/geofire-python | [
6,
5,
6,
3,
1486450134
] |
def test_construct_settings_override2(self):
_override = {
'interfaces': {
_SERVICE_NAME: {
'retry_codes': {
'bar_retry': [],
'baz_retry': ['code_a']
},
'retry_params': {
... | ininex/geofire-python | [
6,
5,
6,
3,
1486450134
] |
def test_catch_error(self):
def abortion_error_func(*dummy_args, **dummy_kwargs):
raise CustomException(None, None)
def other_error_func(*dummy_args, **dummy_kwargs):
raise AnotherException
gax_error_callable = api_callable.create_api_call(
abortion_error_fu... | ininex/geofire-python | [
6,
5,
6,
3,
1486450134
] |
def value_error_func(*dummy_args, **dummy_kwargs):
raise invalid_attribute_exc | ininex/geofire-python | [
6,
5,
6,
3,
1486450134
] |
def creating_document_object_with_string_should_automatically_parse(self):
html = '<html></html>'
with patch('structominer.Document.parse') as mocked_parse:
doc = Document(html)
mocked_parse.assert_called_with(html) | aGHz/structominer | [
17,
3,
17,
7,
1393007493
] |
def document_should_store_fields_in_order(self):
class Doc(Document):
three = Mock(Field, _field_counter=3)
two = Mock(Field, _field_counter=2)
one = Mock(Field, _field_counter=1)
doc = Doc()
self.assertEquals([field._field_counter for field in doc._fields.va... | aGHz/structominer | [
17,
3,
17,
7,
1393007493
] |
def initialize(cls):
"""
Initialize pypm if not already initialized.
"""
if cls.initialized:
return
pypm.Initialize()
cls._gatherDeviceInfo()
cls.initialized = True | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def _gatherDeviceInfo(cls):
for devno in range(pypm.CountDevices()):
info = pypm.GetDeviceInfo(devno)
insouts = {'output': None, 'input': None}
m = cls.deviceMap.setdefault(info[1], insouts)
if info[3]:
cls.outputs.append(devno)
m[... | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def getInput(cls, dev):
"""
Get an input with devive number 'dev' - dev may also be string matching
the target device. If the input was previously loaded this will return
the cached device.
"""
no = dev
if isinstance(dev, basestring):
no = cls.deviceMa... | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def getOutput(cls, dev):
"""
Get output with devive number 'dev' - dev may also be string matching
the target device. If the output was previously loaded this will return
the cached device.
"""
no = dev
if isinstance(dev, basestring):
no = cls.deviceMa... | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def printDeviceSummary(cls, printer=None):
"""
Print device summary - inputs followed by outputs.
"""
if printer is None:
def printer(line):
print line
printer('Inputs:')
for devno in cls.inputs:
printer('... %d %r' % (devno, cls.in... | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def _add_global(name, arity, v):
globals()[name] = v
FUNCTIONS[v] = name
FUNCTION_ARITY[v] = arity
__all__.append(name) | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def debug_event(event):
print event | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def __init__(self, midiInput, handlers, clock=None):
self.clock = getClock(clock)
self.midiInput = midiInput
self.handlers = handlers | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def __call__(self):
"""
Call all our handlers with buffered events (max of 32 per call
are processed).
"""
for message in self.midiInput.Read(32):
for call in self.handlers:
call(message) | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def __call__(self, message):
"""
Parse method and call method on self based on midi function. For
example, if function is NOTEON_CHAN1, this will call our method
noteon(), etc. If a message has a channel as part of it's function,
this will be the first argument. After the firs... | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def noteoff(self, channel, note, velocity, timestamp):
pass | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def playnote(cls, note, velocity):
pass | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def stopnote(cls, note):
pass | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def __init__(self, instrs):
self.instrs = instrs | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def noteoff(self, channel, note, velocity, timestamp):
"""
Immediately stop instrument at channel with given note. The velocity
and timestamp arguments are ignored. This is a noop if no instrument
is mapped to the given channel.
"""
self.instrs.get(channel, _DummyInstrume... | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def __init__(self, callback, sustain=False):
"""
callback: handler to receive chords
sustain: if True, only call our callback with noteon events
"""
self.callback = callback
self.sustain = sustain
self._chord = [] | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def noteoff(self, channel, note, velocity, timestamp):
"""
Remove note from chord.
If the attribute `sustain` is `True` then we do not
call callback with the updated chord.
Note that channel, velocity and timestamp arguments are ignored.
"""
debug('noteoff channe... | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def __init__(self, noteonCallback, noteoffCallback):
self.noteonCallback = noteonCallback
self.noteoffCallback = noteoffCallback | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def noteoff(self, channel, note, velocity, timestamp):
"""
Call noteoffCallback with the note.
"""
self.noteoffCallback(note) | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def __init__(self, midiOut, clock=None):
self.clock = getClock(clock)
self.midiOut = midiOut
self._started = False | djfroofy/beatlounge | [
9,
3,
9,
11,
1330403825
] |
def socketpair(family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0):
with contextlib.closing(socket.socket(family, type, proto)) as l:
l.bind(("localhost", 0))
l.listen(5)
c = socket.socket(family, type, proto)
try:
c.connect(l.getsockname())
... | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def make_socketpair(self):
rd, wr = socketpair()
self.addCleanup(rd.close)
self.addCleanup(wr.close)
return rd, wr | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test_unregister(self):
s, rd, wr = self.test_register()
s.unregister(rd)
s.unregister(wr)
self.assertNotIn(rd, s.socket_map)
self.assertNotIn(wr, s.socket_map) | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test_modify(self):
s, rd, wr = self.test_register()
s.modify(rd, s.WRITE)
s.modify(wr, s.READ) | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test_close(self):
s, rd, wr = self.test_register()
s.close()
self.assertEqual(s.socket_map, {}) | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def close(self):
1 / 0 | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test_close_w_handler_ebadf_exc(self):
# Simulate an exception when close()ing a socket handler.
# Exception should be ignored (and not logged).
class Handler(AsyncChat):
def close(self):
raise OSError(errno.EBADF, "")
s = self.ioloop_class()
self... | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test_select_eintr(self):
# EINTR is supposed to be ignored
with mock.patch('pyftpdlib.ioloop.select.select',
side_effect=select.error()) as m:
m.side_effect.errno = errno.EINTR
s, rd, wr = self.test_register()
s.poll(0)
# ...but jus... | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test_eintr_on_poll(self):
# EINTR is supposed to be ignored
with mock.patch(self.poller_mock, return_vaue=mock.Mock()) as m:
if not PY3:
m.return_value.poll.side_effect = select.error
m.return_value.poll.side_effect.errno = errno.EINTR
else:
... | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test_enoent_ebadf_on_unregister(self):
# ENOENT and EBADF are supposed to be ignored
for errnum in (errno.EBADF, errno.ENOENT):
with mock.patch(self.poller_mock, return_vaue=mock.Mock()) as m:
m.return_value.unregister.side_effect = \
EnvironmentError(... | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def setUp(self):
self.ioloop = IOLoop.instance()
for task in self.ioloop.sched._tasks:
if not task.cancelled:
task.cancel()
del self.ioloop.sched._tasks[:] | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test_interface(self):
def fun():
return 0
self.assertRaises(AssertionError, self.ioloop.call_later, -1, fun)
x = self.ioloop.call_later(3, fun)
self.assertEqual(x.cancelled, False)
x.cancel()
self.assertEqual(x.cancelled, True)
self.assertRaises(A... | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def fun(x):
l.append(x) | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test_reset(self):
def fun(x):
l.append(x)
l = []
self.ioloop.call_later(0.01, fun, 0.01)
self.ioloop.call_later(0.02, fun, 0.02)
self.ioloop.call_later(0.03, fun, 0.03)
x = self.ioloop.call_later(0.04, fun, 0.04)
se... | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def fun(x):
l.append(x) | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test_errback(self):
l = []
self.ioloop.call_later(
0.0, lambda: 1 // 0, _errback=lambda: l.append(True))
self.scheduler()
self.assertEqual(l, [True]) | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test__lt__(self):
a = self.ioloop.call_later(0.01, lambda: 0, 0.01)
b = self.ioloop.call_later(0.02, lambda: 0, 0.02)
self.assertTrue(a < b) | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def setUp(self):
self.ioloop = IOLoop.instance()
for task in self.ioloop.sched._tasks:
if not task.cancelled:
task.cancel()
del self.ioloop.sched._tasks[:] | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test_interface(self):
def fun():
return 0
self.assertRaises(AssertionError, self.ioloop.call_every, -1, fun)
x = self.ioloop.call_every(3, fun)
self.assertEqual(x.cancelled, False)
x.cancel()
self.assertEqual(x.cancelled, True)
self.assertRaises(A... | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def fun():
l1.append(None) | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test_multi_0_timeout(self):
# make sure a 0 timeout callback is called as many times
# as the number of loops
def fun():
l.append(None)
l = []
self.ioloop.call_every(0, fun)
for x in range(100):
self.ioloop.sched.poll()
self.assertEqua... | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test_low_and_high_timeouts(self):
# make sure a callback with a lower timeout is called more
# frequently than another with a greater timeout
def fun():
l1.append(None)
l1 = []
self.ioloop.call_every(0.001, fun)
self.scheduler(... | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def fun():
l.append(None) | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test_errback(self):
l = []
self.ioloop.call_every(
0.0, lambda: 1 // 0, _errback=lambda: l.append(True))
self.scheduler()
self.assertTrue(l) | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def get_connected_handler(self):
s = socket.socket()
self.addCleanup(s.close)
ac = AsyncChat(sock=s)
self.addCleanup(ac.close)
return ac | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test_send_disconnect(self):
ac = self.get_connected_handler()
for errnum in pyftpdlib.ioloop._ERRNOS_DISCONNECTED:
with mock.patch("pyftpdlib.ioloop.socket.socket.send",
side_effect=socket.error(errnum, "")) as send:
with mock.patch.object(ac, ... | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test_recv_disconnect(self):
ac = self.get_connected_handler()
for errnum in pyftpdlib.ioloop._ERRNOS_DISCONNECTED:
with mock.patch("pyftpdlib.ioloop.socket.socket.recv",
side_effect=socket.error(errnum, "")) as send:
with mock.patch.object(ac, ... | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test_bind_af_unspecified_err(self):
ac = Acceptor()
with mock.patch.object(
ac, "bind",
side_effect=socket.error(errno.EBADF, "")) as m:
self.assertRaises(socket.error,
ac.bind_af_unspecified, ("localhost", 0))
ass... | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def test_handle_accept_typeerror(self):
# https://github.com/giampaolo/pyftpdlib/issues/91
ac = Acceptor()
with mock.patch.object(ac, "accept", side_effect=TypeError) as m:
ac.handle_accept()
assert m.called
self.assertIsNone(ac.socket) | aliyun/oss-ftp | [
61,
20,
61,
15,
1450580546
] |
def lru_cache(maxsize=None): # pylint: disable=unused-argument
"""
Identity implementation of ``lru_cache`` for fallback.
"""
return lambda func: func | Phyks/Flatisfy | [
16,
6,
16,
4,
1492106528
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.