Search is not available for this dataset
id int64 0 10.8M | vector listlengths 1.54k 1.54k | ast_depth int64 3 164 | ast_data stringlengths 297 510k | full_path stringlengths 0 319 | code stringlengths 60 56.5k |
|---|---|---|---|---|---|
21,001 | [
0.003328646533191204,
0.001410135766491294,
-0.0012372189667075872,
0.004274500999599695,
-0.020155170932412148,
-0.00944816879928112,
-0.03242534026503563,
-0.08582201600074768,
0.022285504266619682,
0.015272003598511219,
-0.0073455017991364,
-0.05727001279592514,
0.03336600586771965,
-0.... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "obj", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def format_obj(self, obj, alias):
name = obj.name
city = u""
if not empty(obj.city):
city = obj.city
if not obj.sensors or (len(obj.sensors) == 0):
result = u' %s %s %s \n' %\
(self.colored('%-27s' % name[:27], 'red'),
self.... | |
21,002 | [
0.027369651943445206,
0.02235652320086956,
-0.0027344333939254284,
-0.010868106037378311,
-0.03562358766794205,
0.004111144691705704,
-0.031091518700122833,
-0.039978425949811935,
0.010285773314535618,
0.017419353127479553,
-0.011754265055060387,
-0.021204518154263496,
-0.02990153431892395,
... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "name"}}, {"_type": "Constant", "_fields": {"kind": null,... | class GaugeFormatter(IFormatter):
MANDATORY_FIELDS = ('name', 'object', 'sensors')
def start_format(self, **kwargs):
# Name = 27 Object = 10 City = 10 Sensors = 33
self.output(' Name and ID Object City Sensors ')
self.output('-----... | |
21,003 | [
-0.018225880339741707,
-0.04559190198779106,
-0.023067979142069817,
-0.01408198568969965,
0.020238887518644333,
0.01571415364742279,
-0.007920550182461739,
0.0026296046562492847,
-0.058105193078517914,
-0.005463229957967997,
-0.061369530856609344,
0.03407604619860649,
0.08153587579727173,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def _shape(self):
matrix_shape = tensor_shape.TensorShape((self._num_rows_static,
self._num_columns_static))
if self._batch_shape_arg is None:
return matrix_shape
batch_shape = tensor_shape.TensorShape(self._batch_shape_static)
return batch_shape.conca... | |
21,004 | [
0.024947116151452065,
-0.04242343828082085,
-0.008476905524730682,
0.01958860084414482,
0.01574203185737133,
-0.016775935888290405,
-0.017543025314807892,
-0.0515395887196064,
-0.007643111981451511,
0.038576871156692505,
-0.01800995133817196,
-0.03915496543049812,
0.04542509838938713,
0.03... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "x", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def _matmul(self, x, adjoint=False, adjoint_arg=False):
if self._assert_proper_shapes:
x = linalg.adjoint(x) if adjoint_arg else x
aps = linear_operator_util.assert_compatible_matrix_dimensions(self, x)
x = control_flow_ops.with_dependencies([aps], x)
if self.is_square:
# Note that adjoi... | |
21,005 | [
0.02656364254653454,
0.040759406983852386,
0.0626702606678009,
-0.037317290902137756,
-0.016961324959993362,
0.009994006715714931,
0.017709095031023026,
0.007964345626533031,
-0.029412291944026947,
-0.020118577405810356,
-0.02594643644988537,
0.010041484609246254,
0.009970268234610558,
0.0... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {... | class Migration(migrations.Migration):
dependencies = [
('hives', '0003_inspectionframe_note'),
]
operations = [
migrations.AlterField(
model_name='inspectionframe',
name='img_back',
field=filer.fields.image.FilerImageField(on_delete=django.db.models.del... | |
21,006 | [
0.020994678139686584,
-0.03626353666186333,
-0.030512265861034393,
0.014098244719207287,
0.03712877258658409,
0.0029297119472175837,
-0.009975653141736984,
0.017750047147274017,
0.022101670503616333,
-0.05025998875498772,
0.02038392424583435,
-0.05176142603158951,
-0.03506747633218765,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class AsyncMessageHandler(SentryMixin, web.RequestHandler):
@web.asynchronous
@gen.engine
def get(self):
# Compute something crazy
yield gen.Task(
self.captureMessage, "Something totally crazy was just done"
)
self.set_header('X-Sentry-ID', 'The ID')
self.... | |
21,007 | [
0.008217603899538517,
-0.03980520740151405,
0.026291251182556152,
-0.026113435626029968,
0.03739200159907341,
0.02176966518163681,
-0.01874680630862713,
-0.003854780225083232,
0.03101605549454689,
-0.010516501031816006,
0.0036229852121323347,
-0.0367315448820591,
-0.020258234813809395,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TornadoAsyncClientTestCase(testing.AsyncHTTPTestCase):
def get_app(self):
app = web.Application([
web.url(r'/an-error', AnErrorProneHandler),
web.url(r'/an-async-message', AsyncMessageHandler),
web.url(r'/send-error', SendErrorTestHandler),
web.url(r'/se... | |
21,008 | [
-0.015088473446667194,
-0.021825652569532394,
0.03506607934832573,
-0.007953613996505737,
0.007848345674574375,
-0.0040089720860123634,
-0.016059281304478645,
0.006433070171624422,
0.011772518046200275,
0.03078516386449337,
-0.008292811922729015,
-0.04940597712993622,
0.007801559753715992,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def get_app(self):
app = web.Application([
web.url(r'/an-error', AnErrorProneHandler),
web.url(r'/an-async-message', AsyncMessageHandler),
web.url(r'/send-error', SendErrorTestHandler),
web.url(r'/send-error-async', SendErrorAsyncHandler),
web.url(r'/a... | |
21,009 | [
0.003515888238325715,
-0.019855810329318047,
0.018845396116375923,
-0.017611751332879066,
0.0435887910425663,
-0.01123791839927435,
-0.04137997701764107,
0.004382377024739981,
0.0449516735970974,
0.01254793256521225,
0.020642993971705437,
-0.05127263814210892,
0.015332445502281189,
0.02441... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "send", "annotation": null, "type_comment": null}}], "kwarg": null... | def test_error_handler(self, send):
response = self.fetch('/an-error?qs=qs')
self.assertEqual(response.code, 200)
self.assertEqual(send.call_count, 1)
args, kwargs = send.call_args
assert 'user' in kwargs
assert 'request' in kwargs
assert 'exception' in kwargs
... | |
21,010 | [
0.03536381945014,
-0.013395385816693306,
0.00677025131881237,
-0.013350734487175941,
0.04907176271080971,
-0.009421421214938164,
-0.051616888493299484,
0.02084098756313324,
0.016331207007169724,
0.012223289348185062,
0.004001871682703495,
-0.06144016981124878,
0.005053967237472534,
0.00389... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "send", "annotation": null, "type_comment": null}}], "kwarg": null... | def test_error_with_custom_non_dict_data_handler(self, send):
response = self.fetch('/an-error-with-custom-non-dict-data?qs=qs')
self.assertEqual(response.code, 200)
self.assertEqual(send.call_count, 1)
args, kwargs = send.call_args
assert 'user' in kwargs
assert 'reques... | |
21,011 | [
0.000517551728989929,
-0.05360746383666992,
-0.003734847065061331,
-0.024273479357361794,
0.0630020871758461,
0.008983002975583076,
-0.04045983403921127,
-0.009751764126121998,
0.053462184965610504,
-0.02297808602452278,
0.010986624285578728,
-0.03806275129318237,
0.006071396637707949,
0.0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "send", "annotation": null, "type_comment": null}}], "kwarg": null... | def test_message_handler(self, send):
response = self.fetch('/an-async-message?qs=qs')
self.assertEqual(response.code, 200)
self.assertEqual(send.call_count, 1)
args, kwargs = send.call_args
assert 'user' in kwargs
assert 'request' in kwargs
assert 'sentry.interf... | |
21,012 | [
0.03777789697051048,
-0.016568493098020554,
0.013781776651740074,
-0.011054698377847672,
0.04831754043698311,
-0.0038005607202649117,
-0.03476347401738167,
0.0312068872153759,
0.014052857644855976,
0.019528701901435852,
0.008257138542830944,
-0.05608131363987923,
0.011038432829082012,
-0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "send", "annotation": null, "type_comment": null}}], "kwarg": null... | def test_error_with_custom_dict_data_handler(self, send):
response = self.fetch('/an-error-with-custom-dict-data?qs=qs')
self.assertEqual(response.code, 200)
self.assertEqual(send.call_count, 1)
args, kwargs = send.call_args
assert 'user' in kwargs
assert 'request' in kw... | |
21,013 | [
0.006489795632660389,
-0.025233685970306396,
-0.0006209940765984356,
0.0018973441328853369,
0.03595743328332901,
0.00959582906216383,
-0.03219392150640488,
-0.000443516590166837,
0.04883500188589096,
-0.015598180703818798,
0.021379483863711357,
-0.02965468168258667,
0.0148500120267272,
0.0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "send", "annotation": null, "type_comment": null}}], "kwarg": null... | def test_send_error_handler_async(self, send):
response = self.fetch('/send-error-async?qs=qs')
self.assertEqual(response.code, 500)
self.assertEqual(send.call_count, 1)
args, kwargs = send.call_args
assert 'user' in kwargs
assert 'request' in kwargs
assert 'exce... | |
21,014 | [
0.008390814997255802,
-0.01509888842701912,
0.017056364566087723,
-0.001413016696460545,
0.035371921956539154,
-0.00875712651759386,
-0.0349598228931427,
-0.00621584290638566,
0.04725414142012596,
-0.004905135370790958,
0.019712120294570923,
-0.03834820166230202,
0.00577512476593256,
0.023... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "send", "annotation": null, "type_comment": null}}], "kwarg": null... | def test_send_error_handler(self, send):
response = self.fetch('/send-error?qs=qs')
self.assertEqual(response.code, 500)
self.assertEqual(send.call_count, 1)
args, kwargs = send.call_args
assert 'user' in kwargs
assert 'request' in kwargs
assert 'exception' in kw... | |
21,015 | [
0.0008870926103554666,
-0.03292981907725334,
-0.010868723504245281,
-0.02537408657371998,
0.030999694019556046,
0.004881216213107109,
-0.018277345225214958,
-0.0018565686186775565,
0.04554624855518341,
-0.02638622559607029,
0.021631525829434395,
-0.0595514252781868,
-0.011963246390223503,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "send", "annotation": null, "type_comment": null}}], "kwarg": null... | def test_http_error_500(self, send):
response = self.fetch('/http-error?code=500')
self.assertEqual(response.code, 500)
self.assertEqual(send.call_count, 1)
args, kwargs = send.call_args
assert 'user' in kwargs
assert 'request' in kwargs
assert 'exception' in kwa... | |
21,016 | [
-0.003709399374201894,
-0.018146153539419174,
0.03863374516367912,
-0.015066651627421379,
-0.0025704929139465094,
0.0044124675914645195,
0.019011467695236206,
-0.0009368938044644892,
0.05293688550591469,
-0.005774065386503935,
0.013692328706383705,
-0.04056797921657562,
-0.051435310393571854... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_non_successful_responses_marks_client_as_failed(self):
client = self.get_app().sentry_client
with patch.object(client, '_failed_send') as mock_failed:
with patch.object(client, '_send_remote') as mock_send:
f = Future()
f.set_exception(HTTPError(499,... | |
21,017 | [
-0.03064132109284401,
-0.0280747152864933,
0.005631724838167429,
0.01794649474322796,
0.04919985309243202,
0.022507155314087868,
-0.0022630549501627684,
-0.0037956146989017725,
0.028430091217160225,
0.00014059260138310492,
0.0009439678979106247,
-0.06973269581794739,
0.004888889845460653,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": null}}, "targets": [{"_type": "Name", "_fields": {"id": "status_code", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}... | class HTTPException(Response, Exception):
# You should set in subclasses:
# status = 200
status_code = None
empty_body = False
def __init__(self, *, headers=None, reason=None,
body=None, text=None, content_type=None):
Response.__init__(self, status=self.status_code,
... | |
21,018 | [
0.01293034479022026,
0.005311738234013319,
0.0052671851590275764,
0.01430654525756836,
0.015801554545760155,
-0.014732277020812035,
0.0026682449970394373,
0.0011268261587247252,
0.02487061731517315,
0.059800371527671814,
0.004814226645976305,
-0.007296833209693432,
0.0034479270689189434,
-... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [{"_type": "arg", "_fields": {"arg": "he... | def __init__(self, *, headers=None, reason=None,
body=None, text=None, content_type=None):
Response.__init__(self, status=self.status_code,
headers=headers, reason=reason,
body=body, text=text, content_type=content_type)
Exception.__in... | |
21,019 | [
-0.016804572194814682,
0.014024253934621811,
0.03716631606221199,
0.013533609919250011,
-0.024102909490466118,
0.016998786479234695,
-0.030215520411729813,
-0.029561327770352364,
0.004691787529736757,
-0.00007390811515506357,
-0.014658003114163876,
-0.015782397240400314,
-0.00491155544295907... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "location", "annotation... | class _HTTPMove(HTTPRedirection):
def __init__(self, location, *, headers=None, reason=None,
body=None, text=None, content_type=None):
if not location:
raise ValueError("HTTP redirects need a location to redirect to.")
super().__init__(headers=headers, reason=reason,
... | |
21,020 | [
-0.013353298418223858,
-0.005323068704456091,
0.04157062992453575,
0.006651300936937332,
-0.02956584468483925,
-0.0020037551876157522,
-0.02824775129556656,
-0.02674715220928192,
0.008309056982398033,
0.02534794621169567,
-0.029200833290815353,
-0.00006978606688790023,
-0.00883629359304905,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "location", "annotation": null, "type_comment": null}}], "kwarg": ... | def __init__(self, location, *, headers=None, reason=None,
body=None, text=None, content_type=None):
if not location:
raise ValueError("HTTP redirects need a location to redirect to.")
super().__init__(headers=headers, reason=reason,
body=body, text=... | |
21,021 | [
0.028254179283976555,
-0.023020409047603607,
0.014914199709892273,
0.037045277655124664,
0.019861748442053795,
0.028274623677134514,
-0.024022186174988747,
0.002834106795489788,
0.00938909687101841,
0.010416428558528423,
0.012931091710925102,
-0.0451003760099411,
-0.01939152553677559,
0.01... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 405}}, "targets": [{"_type": "Name", "_fields": {"id": "status_code", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}},... | class HTTPMethodNotAllowed(HTTPClientError):
status_code = 405
def __init__(self, method, allowed_methods, *, headers=None, reason=None,
body=None, text=None, content_type=None):
allow = ','.join(sorted(allowed_methods))
super().__init__(headers=headers, reason=reason,
... | |
21,022 | [
0.05276183411478996,
0.002030865754932165,
0.015735577791929245,
0.023312827572226524,
-0.012679110281169415,
-0.007832923904061317,
-0.031703587621450424,
-0.01718827150762081,
0.01365532074123621,
0.06252393871545792,
0.031494397670030594,
-0.005996719468384981,
-0.024056607857346535,
0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "method", "annotation": null, "type_comment": null}}, {"_type": "a... | def __init__(self, method, allowed_methods, *, headers=None, reason=None,
body=None, text=None, content_type=None):
allow = ','.join(sorted(allowed_methods))
super().__init__(headers=headers, reason=reason,
body=body, text=text, content_type=content_type)
... | |
21,023 | [
0.014932737685739994,
-0.013886724598705769,
0.0194774828851223,
-0.015618056058883667,
0.015425685793161392,
-0.00014249297964852303,
-0.022591477259993553,
0.03796907141804695,
0.01370637770742178,
-0.020968353375792503,
0.02976929023861885,
-0.03991681709885597,
-0.052324697375297546,
-... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request", "annotation": {"_type": "Name", "_fields": {"id": "HTTP... | def fetch_impl(
self, request: HTTPRequest, callback: Callable[[HTTPResponse], None]
) -> None:
key = object()
self.queue.append((key, request, callback))
assert request.connect_timeout is not None
assert request.request_timeout is not None
timeout_handle = None
... | |
21,024 | [
-0.023397497832775116,
-0.013201015070080757,
0.004870535805821419,
0.02170597016811371,
-0.018524006009101868,
-0.005828673951327801,
-0.05237822234630585,
0.008226976729929447,
-0.006943544838577509,
-0.016382981091737747,
0.028625857084989548,
-0.024769647046923637,
-0.008132345974445343,... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 451}}, "targets": [{"_type": "Name", "_fields": {"id": "status_code", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}},... | class HTTPUnavailableForLegalReasons(HTTPClientError):
status_code = 451
def __init__(self, link, *, headers=None, reason=None,
body=None, text=None, content_type=None):
super().__init__(headers=headers, reason=reason,
body=body, text=text, content_type=content... | |
21,025 | [
0.0009565772488713264,
-0.0295826755464077,
-0.0008902452536858618,
-0.00959649495780468,
-0.006462831515818834,
0.01054050400853157,
0.021326784044504166,
0.0038821673952043056,
0.036598507314920425,
0.014735478907823563,
0.039592523127794266,
-0.008127415552735329,
-0.048976752907037735,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "client", "annotation": {"_type": "Subscript", "_fields": {"ctx": ... | def __init__(
self,
client: Optional[SimpleAsyncHTTPClient],
request: HTTPRequest,
release_callback: Callable[[], None],
final_callback: Callable[[HTTPResponse], None],
max_buffer_size: int,
tcp_client: TCPClient,
max_header_size: int,
max_body_siz... | |
21,026 | [
0.022026145830750465,
0.02333368919789791,
0.024962173774838448,
-0.006686296314001083,
0.0007347497157752514,
0.031000642105937004,
-0.010834772139787674,
0.05562998726963997,
-0.003093526465818286,
-0.0032777711749076843,
0.061620909720659256,
-0.012457313016057014,
-0.06066996976733208,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def _process_queue(self) -> None:
while self.queue and len(self.active) < self.max_clients:
key, request, callback = self.queue.popleft()
if key not in self.waiting:
continue
self._remove_timeout(key)
self.active[key] = (request, callback)
... | |
21,027 | [
-0.014376962557435036,
-0.005372921470552683,
0.02131013013422489,
-0.040918171405792236,
0.026915669441223145,
-0.008345900103449821,
0.012413888238370419,
0.04341456666588783,
-0.005338879767805338,
0.013730169273912907,
0.0022481733467429876,
0.012924514710903168,
-0.0045275515876710415,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs... | async def run(self) -> None:
try:
self.parsed = urllib.parse.urlsplit(_unicode(self.request.url))
if self.parsed.scheme not in ("http", "https"):
raise ValueError("Unsupported url scheme: %s" % self.request.url)
# urlsplit results have hostname and port result... | |
21,028 | [
-0.004377369768917561,
-0.0025902017951011658,
0.02377171441912651,
-0.01058003306388855,
0.05314798653125763,
0.02825154922902584,
0.014192495495080948,
-0.044569581747055054,
-0.045827750116586685,
0.010179707780480385,
0.005089853890240192,
-0.029948167502880096,
-0.015117056667804718,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "scheme", "annotation": {"_type": "Name", "_fields": {"id": "str",... | def _get_ssl_options(
self, scheme: str
) -> Union[None, Dict[str, Any], ssl.SSLContext]:
if scheme == "https":
if self.request.ssl_options is not None:
return self.request.ssl_options
# If we are using the defaults, don't construct a
# new SSLCont... | |
21,029 | [
0.10094176232814789,
0.010614908300340176,
0.01803644187748432,
-0.02639262191951275,
0.038810063153505325,
-0.00924631953239441,
0.021941926330327988,
0.025702765211462975,
0.0032601342536509037,
-0.020272916182875633,
0.004867947660386562,
0.008228222839534283,
-0.02050657756626606,
0.00... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "start_read", "annotation": {"_type": "Name", "_fields": {"id... | async def _write_body(self, start_read: bool) -> None:
if self.request.body is not None:
self.connection.write(self.request.body)
elif self.request.body_producer is not None:
fut = self.request.body_producer(self.connection.write)
if fut is not None:
a... | |
21,030 | [
0.027052775025367737,
-0.04018935188651085,
0.00438779266551137,
0.0005524330772459507,
0.03553112968802452,
-0.03282195329666138,
0.03716833144426346,
0.010349440388381481,
-0.024363089352846146,
-0.004032091237604618,
0.0035594473592936993,
0.03358208388090134,
0.015183077193796635,
0.02... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "stream", "annotation": {"_type": "Name", "_fields": {"id": "IOStr... | def _create_connection(self, stream: IOStream) -> HTTP1Connection:
stream.set_nodelay(True)
connection = HTTP1Connection(
stream,
True,
HTTP1ConnectionParameters(
no_keep_alive=True,
max_header_size=self.max_header_size,
... | |
21,031 | [
0.03634185716509819,
0.015479366295039654,
-0.008727358654141426,
-0.012475906871259212,
-0.005790322553366423,
0.011829008348286152,
0.03151321783661842,
0.004759327508509159,
0.05581813305616379,
0.010922194458544254,
0.028509758412837982,
-0.03567185252904892,
-0.0007718023844063282,
0.... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "typ", "annotation": {"_type": "Constant", "_fields": {"kind": nul... | def _handle_exception(
self,
typ: "Optional[Type[BaseException]]",
value: Optional[BaseException],
tb: Optional[TracebackType],
) -> bool:
if self.final_callback:
self._remove_timeout()
if isinstance(value, StreamClosedError):
if value.... | |
21,032 | [
0.0739540234208107,
-0.03261194005608559,
0.0003029784420505166,
-0.009409155696630478,
0.004981032572686672,
0.024560805410146713,
0.024871211498975754,
0.0013749977806583047,
0.0199047289788723,
-0.003707886440679431,
0.03051670454442501,
-0.04050787165760994,
-0.005897697526961565,
0.04... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def on_connection_close(self) -> None:
if self.final_callback is not None:
message = "Connection closed"
if self.stream.error:
raise self.stream.error
try:
raise HTTPStreamClosedError(message)
except HTTPStreamClosedError:
... | |
21,033 | [
0.030523523688316345,
0.0012725443812087178,
0.022606119513511658,
-0.02079341933131218,
0.04780849441885948,
0.0046282317489385605,
-0.0007217907113954425,
0.04313055798411369,
0.004452809225767851,
0.00940264854580164,
0.0331665575504303,
0.005631064064800739,
-0.022921880707144737,
0.00... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "first_line", "annotation": {"_type": "Subscript", "_fields":... | async def headers_received(
self,
first_line: Union[httputil.ResponseStartLine, httputil.RequestStartLine],
headers: httputil.HTTPHeaders,
) -> None:
assert isinstance(first_line, httputil.ResponseStartLine)
if self.request.expect_100_continue and first_line.code == 100:
... | |
21,034 | [
0.024678245186805725,
-0.03431527316570282,
0.026195676997303963,
-0.03886757045984268,
0.01248554140329361,
0.01890135183930397,
0.023094259202480316,
-0.026075880974531174,
-0.00023169131600297987,
0.03743000328540802,
0.0011355786118656397,
-0.007600473705679178,
-0.0013443919597193599,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestWeightstats(object):
def __init__(self):
np.random.seed(9876789)
n1, n2 = 20,20
m1, m2 = 1, 1.2
x1 = m1 + np.random.randn(n1)
x2 = m2 + np.random.randn(n2)
x1_2d = m1 + np.random.randn(n1, 3)
x2_2d = m2 + np.random.randn(n2, 3)
w1_ = 2. * np... | |
21,035 | [
0.03284136578440666,
-0.04543677717447281,
0.0281530749052763,
-0.05789224058389664,
-0.0018222527578473091,
-0.019522886723279953,
-0.010000523179769516,
-0.004702869802713394,
0.027453331276774406,
0.04963525012135506,
0.004481283947825432,
0.020036032423377037,
-0.02313823625445366,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_weightstats_1(self):
x1, x2 = self.x1, self.x2
w1, w2 = self.w1, self.w2
w1_ = 2. * np.ones(len(x1))
w2_ = 2. * np.ones(len(x2))
d1 = DescrStatsW(x1)
# print ttest_ind(x1, x2)
# print ttest_ind(x1, x2, usevar='unequal')
# #print ttest_ind(x1, x2, us... | |
21,036 | [
0.01757028140127659,
-0.04947791248559952,
0.057161979377269745,
-0.02736278437077999,
0.0010146837448701262,
-0.049899596720933914,
0.05369477719068527,
0.01691432297229767,
-0.017183734104037285,
0.03410977125167847,
-0.02398928999900818,
-0.008843707852065563,
-0.029330655932426453,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def __init__(self):
np.random.seed(9876789)
n1, n2 = 20,20
m1, m2 = 1, 1.2
x1 = m1 + np.random.randn(n1)
x2 = m2 + np.random.randn(n2)
x1_2d = m1 + np.random.randn(n1, 3)
x2_2d = m2 + np.random.randn(n2, 3)
w1_ = 2. * np.ones(n1)
w2_ = 2. * np.ones... | |
21,037 | [
0.05426491051912308,
-0.04079506918787956,
0.024289090186357498,
-0.05045769363641739,
-0.013048157095909119,
-0.008445760235190392,
0.026626434177160263,
-0.018795128911733627,
0.009198769927024841,
0.04619264602661133,
-0.001098641543649137,
0.0207830760627985,
-0.012903579510748386,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_weightstats_2(self):
x1, x2 = self.x1, self.x2
w1, w2 = self.w1, self.w2
d1 = DescrStatsW(x1)
d1w = DescrStatsW(x1, weights=w1)
d2w = DescrStatsW(x2, weights=w2)
x1r = d1w.asrepeats()
x2r = d2w.asrepeats()
# print 'random weights'
# print t... | |
21,038 | [
0.04987819865345955,
-0.024204889312386513,
0.01571933552622795,
-0.040682509541511536,
-0.008196682669222355,
-0.0004818259330932051,
0.0055426908656954765,
-0.01831916533410549,
0.014720327220857143,
0.052815042436122894,
-0.009695195592939854,
0.023530859500169754,
-0.024253033101558685,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_weightstats_3(self):
x1_2d, x2_2d = self.x1_2d, self.x2_2d
w1, w2 = self.w1, self.w2
d1w_2d = DescrStatsW(x1_2d, weights=w1)
d2w_2d = DescrStatsW(x2_2d, weights=w2)
x1r_2d = d1w_2d.asrepeats()
x2r_2d = d2w_2d.asrepeats()
assert_almost_equal(x2r_2d.mean(... | |
21,039 | [
0.04775414988398552,
-0.04071538895368576,
0.02492169663310051,
-0.02176295965909958,
0.01901460811495781,
0.02110385149717331,
0.016801005229353905,
-0.015258943662047386,
0.0006968033267185092,
0.026637861505150795,
0.012846363708376884,
-0.0005363014643080533,
0.013853677548468113,
0.01... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_weightstats_ddof_tests(self):
# explicit test that ttest and confint are independent of ddof
# one sample case
x1_2d = self.x1_2d
w1 = self.w1
d1w_d0 = DescrStatsW(x1_2d, weights=w1, ddof=0)
d1w_d1 = DescrStatsW(x1_2d, weights=w1, ddof=1)
d1w_d2 = DescrS... | |
21,040 | [
0.019140353426337242,
-0.04103594273328781,
0.007491558324545622,
-0.01943294331431389,
0.020566735416650772,
0.008521723560988903,
0.013983429409563541,
0.007107532117515802,
0.01928664930164814,
0.03608626872301102,
-0.012581429444253445,
0.006583306007087231,
-0.03201437368988991,
0.052... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class CheckWeightstats1dMixin(object):
def test_basic(self):
x1r = self.x1r
d1w = self.d1w
assert_almost_equal(x1r.mean(0), d1w.mean, 14)
assert_almost_equal(x1r.var(0, ddof=d1w.ddof), d1w.var, 14)
assert_almost_equal(x1r.std(0, ddof=d1w.ddof), d1w.std, 14)
var1 = d... | |
21,041 | [
0.026048140600323677,
-0.04781072586774826,
0.02077155001461506,
-0.02852572686970234,
0.003438488580286503,
-0.013251740485429764,
0.004935084842145443,
-0.01473159622400999,
0.007372494321316481,
0.029998887330293655,
0.01840110309422016,
-0.007539898622781038,
-0.005631487350910902,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_ttest_2sample(self):
x1, x2 = self.x1, self.x2
x1r, x2r = self.x1r, self.x2r
w1, w2 = self.w1, self.w2
#Note: stats.ttest_ind handles 2d/nd arguments
res_sp = stats.ttest_ind(x1r, x2r)
assert_almost_equal(ttest_ind(x1, x2, weights=(w1, w2))[:2],
... | |
21,042 | [
0.026121940463781357,
-0.030414622277021408,
0.035560961812734604,
0.011963410302996635,
0.007060972973704338,
0.010969508439302444,
0.013914628885686398,
-0.00856706965714693,
0.01886584609746933,
0.020243894308805466,
-0.009786581620573997,
-0.009274386800825596,
-0.023146333172917366,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_basic(self):
x1r = self.x1r
d1w = self.d1w
assert_almost_equal(x1r.mean(0), d1w.mean, 14)
assert_almost_equal(x1r.var(0, ddof=d1w.ddof), d1w.var, 14)
assert_almost_equal(x1r.std(0, ddof=d1w.ddof), d1w.std, 14)
var1 = d1w.var_ddof(ddof=1)
assert_almost_eq... | |
21,043 | [
0.008273844607174397,
-0.05769137293100357,
0.051281217485666275,
-0.02348015084862709,
0.0297478549182415,
0.01722431741654873,
0.04313795268535614,
0.025878023356199265,
0.01270159799605608,
0.040122807025909424,
-0.01004850771278143,
0.022471144795417786,
-0.014102335087954998,
0.030626... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_confint_mean(self):
#compare confint_mean with ttest
d1w = self.d1w
alpha = 0.05
low, upp = d1w.tconfint_mean()
t, p, d = d1w.ttest_mean(low)
assert_almost_equal(p, alpha * np.ones(p.shape), 8)
t, p, d = d1w.ttest_mean(upp)
assert_almost_equal(p, ... | |
21,044 | [
0.05166497081518173,
-0.005418990273028612,
0.04637936130166054,
-0.04330229386687279,
0.0030631099361926317,
0.006575992796570063,
0.029678819701075554,
-0.01614220067858696,
-0.02724694460630417,
0.004128606989979744,
-0.03486517071723938,
-0.005726076662540436,
-0.00956000480800867,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestWeightstats1d_ddof(CheckWeightstats1dMixin):
@classmethod
def setup_class(self):
np.random.seed(9876789)
n1, n2 = 20,20
m1, m2 = 1, 1.2
x1 = m1 + np.random.randn(n1, 1)
x2 = m2 + np.random.randn(n2, 1)
w1 = np.random.randint(1,4, n1)
w2 = np.ran... | |
21,045 | [
0.03681785613298416,
-0.00005331249121809378,
0.03065803460776806,
-0.07194293290376663,
-0.005342821124941111,
0.0208422914147377,
0.02478034421801567,
-0.013659752905368805,
-0.018832121044397354,
0.02291123941540718,
-0.031974636018276215,
-0.00040225445991382003,
-0.012037510983645916,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestWeightstats2d(CheckWeightstats2dMixin):
@classmethod
def setup_class(self):
np.random.seed(9876789)
n1, n2 = 20,20
m1, m2 = 1, 1.2
x1 = m1 + np.random.randn(n1, 3)
x2 = m2 + np.random.randn(n2, 3)
w1_ = 2. * np.ones(n1)
w2_ = 2. * np.ones(n2)
... | |
21,046 | [
0.03503748029470444,
-0.020766740664839745,
0.05698066204786301,
-0.04664844274520874,
-0.005428252276033163,
-0.02567710354924202,
0.04097083583474159,
0.007979338988661766,
-0.02328585833311081,
0.02667452022433281,
-0.0053930869325995445,
-0.01365694496780634,
-0.016163276508450508,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def setup_class(self):
np.random.seed(9876789)
n1, n2 = 20,20
m1, m2 = 1, 1.2
x1 = m1 + np.random.randn(n1, 1)
x2 = m2 + np.random.randn(n2, 1)
w1 = np.random.randint(1,4, n1)
w2 = np.random.randint(1,4, n2)
self.x1, self.x2 = x1, x2
self.w1, self... | |
21,047 | [
0.050081558525562286,
-0.000587471469771117,
0.04902071878314018,
-0.0527459941804409,
-0.002454736502841115,
0.026693716645240784,
0.02496676705777645,
-0.022462688386440277,
-0.030616361647844315,
0.006975645665079355,
-0.03310810402035713,
-0.0104172108694911,
-0.005378216505050659,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestWeightstats2d_ddof(CheckWeightstats2dMixin):
@classmethod
def setup_class(self):
np.random.seed(9876789)
n1, n2 = 20,20
m1, m2 = 1, 1.2
x1 = m1 + np.random.randn(n1, 3)
x2 = m2 + np.random.randn(n2, 3)
w1 = np.random.randint(1,4, n1)
w2 = np.ran... | |
21,048 | [
0.03125986456871033,
-0.019433509558439255,
0.05020218342542648,
-0.053501974791288376,
-0.010296107269823551,
-0.027254773303866386,
0.0420660525560379,
0.012153815478086472,
-0.020038051530718803,
0.032393380999565125,
-0.01042835135012865,
-0.01319916918873787,
-0.018148858100175858,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def setup_class(self):
np.random.seed(9876789)
n1, n2 = 20,20
m1, m2 = 1, 1.2
x1 = m1 + np.random.randn(n1, 3)
x2 = m2 + np.random.randn(n2, 3)
w1_ = 2. * np.ones(n1)
w2_ = 2. * np.ones(n2)
w1 = np.random.randint(1,4, n1)
w2 = np.random.randint(1,4... | |
21,049 | [
0.048114486038684845,
0.0024329398293048143,
0.029404625296592712,
-0.07393026351928711,
-0.015695227310061455,
0.02560044825077057,
0.03316095471382141,
-0.019762588664889336,
-0.01418791152536869,
0.02012147381901741,
-0.021365607157349586,
-0.006107022520154715,
-0.01721450686454773,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestWeightstats2d_nobs(CheckWeightstats2dMixin):
@classmethod
def setup_class(self):
np.random.seed(9876789)
n1, n2 = 20,30
m1, m2 = 1, 1.2
x1 = m1 + np.random.randn(n1, 3)
x2 = m2 + np.random.randn(n2, 3)
w1 = np.random.randint(1,4, n1)
w2 = np.ran... | |
21,050 | [
0.033640310168266296,
-0.020567916333675385,
0.05689433589577675,
-0.0481964610517025,
-0.005372216925024986,
-0.02665642835199833,
0.04180096462368965,
0.0066449204459786415,
-0.02339472621679306,
0.02559477649629116,
-0.00616845628246665,
-0.013954972848296165,
-0.016410844400525093,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def setup_class(self):
np.random.seed(9876789)
n1, n2 = 20,20
m1, m2 = 1, 1.2
x1 = m1 + np.random.randn(n1, 3)
x2 = m2 + np.random.randn(n2, 3)
w1 = np.random.randint(1,4, n1)
w2 = np.random.randint(1,4, n2)
self.x1, self.x2 = x1, x2
self.w1, self... | |
21,051 | [
-0.031438179314136505,
-0.014951384626328945,
0.01832425594329834,
-0.041858844459056854,
0.020879080519080162,
-0.0028159699868410826,
-0.008985932916402817,
-0.009961296804249287,
0.03204227611422539,
0.02169712819159031,
0.018550792708992958,
-0.0377056822180748,
-0.023408733308315277,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"... | def test_ttest_ind_with_uneq_var():
#from scipy
# check vs. R
a = (1, 2, 3)
b = (1.1, 2.9, 4.2)
pr = 0.53619490753126731
tr = -0.68649512735572582
t, p, df = ttest_ind(a, b, usevar='unequal')
assert_almost_equal([t,p], [tr, pr], 13)
a = (1, 2, 3, 4)
pr = 0.84354139131608286
... | |
21,052 | [
0.03352445736527443,
-0.019635021686553955,
0.057353243231773376,
-0.0500430129468441,
-0.0067715817131102085,
-0.02639377862215042,
0.04162983596324921,
0.007470542099326849,
-0.021456167101860046,
0.028266223147511482,
-0.00666898163035512,
-0.01585165597498417,
-0.019481122493743896,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def setup_class(self):
np.random.seed(9876789)
n1, n2 = 20,30
m1, m2 = 1, 1.2
x1 = m1 + np.random.randn(n1, 3)
x2 = m2 + np.random.randn(n2, 3)
w1 = np.random.randint(1,4, n1)
w2 = np.random.randint(1,4, n2)
self.x1, self.x2 = x1, x2
self.w1, self... | |
21,053 | [
0.04108550772070885,
-0.01275313924998045,
0.008634193800389767,
-0.04355427622795105,
0.020477786660194397,
0.007568724919110537,
0.02060772106051445,
0.024856600910425186,
-0.01448777411133051,
0.03996806591749191,
0.01217492762953043,
-0.016761640086770058,
-0.0001683066802797839,
0.047... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs"... | class TestZTest(object):
# all examples use the same data
# no weights used in tests
@classmethod
def setup_class(cls):
cls.x1 = np.array([7.8, 6.6, 6.5, 7.4, 7.3, 7., 6.4, 7.1, 6.7, 7.6, 6.8])
cls.x2 = np.array([4.5, 5.4, 6.1, 6.1, 5.4, 5., 4.1, 5.5])
cls.d1 = DescrStatsW(cls.x... | |
21,054 | [
0.053977999836206436,
-0.04719642922282219,
0.02951492927968502,
-0.030613157898187637,
-0.006664882879704237,
-0.006791865453124046,
0.02284318208694458,
0.011751060374081135,
0.017310848459601402,
0.028073502704501152,
0.021539034321904182,
-0.009238858707249165,
-0.04983218386769295,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test(self):
x1, x2 = self.x1, self.x2
cm = self.cm
# tc : test cases
for tc in [ztest_, ztest_smaller, ztest_larger,
ztest_mu, ztest_smaller_mu, ztest_larger_mu]:
zstat, pval = ztest(x1, x2, value=tc.null_value,
alterna... | |
21,055 | [
0.007140250410884619,
0.0065040988847613335,
-0.027398379519581795,
-0.04091111198067665,
0.04437704011797905,
-0.026981592178344727,
-0.04575902223587036,
0.0173077043145895,
0.03656773269176483,
0.009438073262572289,
-0.03215854614973068,
0.008725144900381565,
-0.03990204259753227,
0.018... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def _parse_driver_info(module):
p = module.params['driver_info']
info = p.get('power')
if not info:
raise shade.OpenStackCloudException(
"driver_info['power'] is required")
if p.get('console'):
info.update(p.get('console'))
if p.get('management'):
info.update(p.ge... | |
21,056 | [
-0.001865997677668929,
0.045606423169374466,
0.024201424792408943,
-0.01880391128361225,
-0.005418076179921627,
0.01685052551329136,
-0.019718918949365616,
-0.02014043740928173,
0.03094574809074402,
0.024818284437060356,
-0.01387932151556015,
-0.027573585510253906,
-0.027141785249114037,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def _parse_properties(module):
p = module.params['properties']
props = dict(
cpu_arch=p.get('cpu_arch') if p.get('cpu_arch') else 'x86_64',
cpus=p.get('cpus') if p.get('cpus') else 1,
memory_mb=p.get('ram') if p.get('ram') else 1,
local_gb=p.get('disk_size') if p.get('disk_size')... | |
21,057 | [
-0.012024600990116596,
0.011434436775743961,
-0.021602479740977287,
-0.048639390617609024,
0.04116397351026535,
0.0515902116894722,
0.012983618304133415,
0.0007999495137482882,
0.03127871826291084,
0.05326234549283981,
0.027295107021927834,
-0.012338126078248024,
-0.03563117980957031,
0.02... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def main():
argument_spec = openstack_full_argument_spec(
uuid=dict(required=False),
name=dict(required=False),
driver=dict(required=False),
driver_info=dict(type='dict', required=True),
nics=dict(type='list', required=True),
properties=dict(type='dict', default={}),
... | |
21,058 | [
-0.020654261112213135,
0.047620657831430435,
0.030402114614844322,
-0.0779828205704689,
-0.021173613145947456,
-0.0033208616077899933,
-0.03487653657793999,
-0.04020989313721657,
0.021093713119626045,
0.041708026081323624,
0.03725357726216316,
-0.02446950599551201,
-0.01628969982266426,
0.... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def handle_args():
parser = argparse.ArgumentParser(description='Generate layer documenation from source.')
parser.add_argument('--in_headers', required=False, default=builtin_headers, help='The input layer header files from which code will be generated.')
parser.add_argument('--in_source', required=False, ... | |
21,059 | [
-0.023022403940558434,
0.04529503732919693,
0.01803862676024437,
-0.09632361680269241,
0.03153451904654503,
0.02487478032708168,
-0.007806447334587574,
-0.03193145617842674,
-0.006086382549256086,
0.05795294791460037,
0.031005267053842545,
-0.018799424171447754,
-0.02648458443582058,
0.010... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def parse(self):
# For each header file, parse details into dicts
# TODO : Should have a global dict element to track overall list of checks
store_enum = False
for layer_name in layer_inputs:
hf = layer_inputs[layer_name]['header']
self.layer_dict[layer_name] = {}... | |
21,060 | [
-0.03881394863128662,
0.045222215354442596,
0.010866191238164902,
-0.1103336289525032,
0.028847916051745415,
0.02481863647699356,
-0.028633592650294304,
-0.02715476043522358,
0.015624168328940868,
0.053066447377204895,
0.03774233162403107,
-0.024132803082466125,
-0.0256116334348917,
0.0100... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "header_file_list", "an... | class LayerParser:
def __init__(self, header_file_list, source_file_list):
self.header_files = header_file_list
self.source_files = source_file_list
self.layer_dict = {}
self.api_dict = {}
# Parse layer header files into internal dict data structs
def parse(self):
# ... | |
21,061 | [
-0.02949439361691475,
0.05170682445168495,
-0.004844460170716047,
-0.08665047585964203,
-0.008222753182053566,
0.02442389912903309,
-0.002148851053789258,
-0.014808286912739277,
0.004511518403887749,
0.052391037344932556,
0.034283872693777084,
-0.007721812929958105,
-0.050436146557331085,
... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def parse(self):
layer_name = 'INIT'
parse_layer_details = False
detail_trigger = '| Check | '
parse_pending_work = False
pending_trigger = ' Pending Work'
parse_overview = False
overview_trigger = ' Overview'
enum_prefix = ''
with open(self.layer... | |
21,062 | [
-0.009375852532684803,
0.05711061507463455,
0.02180377021431923,
-0.06044014170765877,
0.004216821398586035,
0.02104075253009796,
-0.014335458166897297,
-0.027584196999669075,
-0.027584196999669075,
0.05923781171441078,
0.04501796141266823,
-0.007635943591594696,
-0.03447446599602699,
0.00... | 17 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "source_file", "annotat... | class LayerDoc:
def __init__(self, source_file):
self.layer_doc_filename = source_file
self.txt_color = bcolors()
# Main data struct to store info from layer doc
self.layer_doc_dict = {}
# Comprehensive list of all validation checks recorded in doc
self.enum_list = []... | |
21,063 | [
-0.004902020562440157,
0.051606472581624985,
0.027016106992959976,
-0.0406668521463871,
0.0055114286951720715,
0.009542440995573997,
-0.022652151063084602,
-0.002751255175098777,
-0.025470292195677757,
0.0750553160905838,
0.03505435213446617,
-0.011926565319299698,
-0.03612453117966652,
0.... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "layer_dict", "annotation": null, "type_comment": null}}], "kwarg"... | def validate(self, layer_dict):
# Count number of errors found and return it
errors_found = 0
# First we'll go through the doc datastructures and flag any issues
for chk in self.enum_list:
doc_layer_found = False
for real_layer in layer_dict:
if ch... | |
21,064 | [
-0.013129565864801407,
0.05004141852259636,
0.004377477336674929,
-0.08581805229187012,
-0.008118543773889542,
-0.00471861707046628,
-0.006197843234986067,
-0.020972905680537224,
-0.009941776283085346,
0.0477939136326313,
0.029699193313717842,
-0.01252182200551033,
-0.022715868428349495,
0... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "argv", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [{"_type": "Constant", "_fields": {"kind": null, "value": ... | def main(argv=None):
# Parse args
opts = handle_args()
# Create parser for layer files
layer_parser = LayerParser(opts.in_headers, opts.in_source)
# Parse files into internal data structs
layer_parser.parse()
# Generate requested types of output
if opts.print_structs: # Print details of... | |
21,065 | [
-0.012614955194294453,
0.01461279857903719,
0.07393162697553635,
-0.0172042865306139,
-0.023905625566840172,
-0.03157734498381615,
0.008813343942165375,
0.011473330669105053,
-0.016896048560738564,
0.03411175310611725,
0.0068839979358017445,
0.023951290175318718,
-0.0004884013906121254,
-0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class ImportCountriesTest(BaseTest):
def setUp(self):
self.data = [['uganda'] , ['ayoyo'] , ['hoho']]
self.write_to_csv('wb', self.data)
self.filename = 'test.csv'
file = open(self.filename, 'rb')
self.importer = FakeCommand()
self.country = LocationType.objects.crea... | |
21,066 | [
-0.0038689502980560064,
-0.010510951280593872,
0.08980324119329453,
-0.0212035421282053,
-0.03967036306858063,
-0.038798488676548004,
0.0007901377393864095,
-0.0016014669090509415,
-0.028844568878412247,
-0.0028850622475147247,
-0.009929699823260307,
-0.004989068955183029,
-0.016614083200693... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def setUp(self):
self.data = [['uganda'] , ['ayoyo'] , ['hoho']]
self.write_to_csv('wb', self.data)
self.filename = 'test.csv'
file = open(self.filename, 'rb')
self.importer = FakeCommand()
self.country = LocationType.objects.create(name='Country', slug='country')
... | |
21,067 | [
-0.014975817874073982,
-0.04411953315138817,
-0.002578908344730735,
0.021954385563731194,
0.029530111700296402,
0.05765514075756073,
0.02461232990026474,
0.021755332127213478,
0.06973883509635925,
-0.012645726092159748,
0.023289211094379425,
-0.029436439275741577,
0.0015997427981346846,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "method", "annotation":... | class TestHubProxy:
def setup_method(self, method):
self.hub = SAMPHubServer(web_profile=False, mode="multiple", pool_size=1)
self.hub.start()
self.proxy = SAMPHubProxy()
self.proxy.connect(hub=self.hub, pool_size=1)
def teardown_method(self, method):
if self.proxy.is_c... | |
21,068 | [
0.03417649865150452,
-0.009360628202557564,
0.02475171536207199,
-0.01003715954720974,
0.028181029483675957,
0.015548557043075562,
0.029417449608445168,
-0.0021258248016238213,
0.050716523081064224,
-0.014837032184004784,
0.024798372760415077,
-0.0017306954832747579,
0.03797907009720802,
-... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmp_path", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"... | def test_custom_lockfile(tmp_path):
lockfile = str(tmp_path / ".samptest")
hub = SAMPHubServer(web_profile=False, lockfile=lockfile, pool_size=1)
hub.start()
proxy = SAMPHubProxy()
proxy.connect(hub=hub, pool_size=1)
hub.stop() | |
21,069 | [
0.029471544548869133,
0.001610922859981656,
0.0030370065942406654,
-0.03185391426086426,
-0.01775480806827545,
0.00605347566306591,
-0.03242896869778633,
0.00505996635183692,
-0.01857631467282772,
0.011172488331794739,
0.013103027828037739,
0.021379705518484116,
0.007234391290694475,
-0.02... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "pkg_spec", "annotation": null, "type_comment": null}}, {"_type": ... | def get_current_name(name, pkg_spec, module):
info_cmd = 'pkg_info'
(rc, stdout, stderr) = execute_command("%s" % (info_cmd), module)
if rc != 0:
return (rc, stdout, stderr)
if pkg_spec['version']:
pattern = "^%s" % name
elif pkg_spec['flavor']:
pattern = "^%s-.*-%s\s" % (pk... | |
21,070 | [
0.00533868744969368,
-0.008654680103063583,
-0.01194002665579319,
0.026527943089604378,
0.02071729488670826,
-0.018657824024558067,
-0.043469540774822235,
0.038320865482091904,
-0.0010228398023173213,
0.044278617948293686,
0.021097315475344658,
-0.03998805582523346,
-0.013558181934058666,
... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "e", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}, "var... | def qapply_Mul(e, **options):
ip_doit = options.get('ip_doit', True)
args = list(e.args)
# If we only have 0 or 1 args, we have nothing to do and return.
if len(args) <= 1 or not isinstance(e, Mul):
return e
rhs = args.pop()
lhs = args.pop()
# Make sure we have two non-commutativ... | |
21,071 | [
-0.035526424646377563,
0.023968607187271118,
-0.03224246948957443,
-0.005464373622089624,
0.01479912269860506,
0.009484020061790943,
-0.003998321946710348,
-0.011323248036205769,
0.007953994907438755,
0.0500696524977684,
0.0348653681576252,
0.01455389242619276,
0.01914929784834385,
0.00168... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "installed_state", "annotation": null, "type_comment": null}}, {"_... | def package_present(name, installed_state, pkg_spec, module):
if module.check_mode:
install_cmd = 'pkg_add -Imn'
else:
install_cmd = 'pkg_add -Im'
if installed_state is False:
# Attempt to install the package
(rc, stdout, stderr) = execute_command("%s %s" % (install_cmd, na... | |
21,072 | [
-0.02115968056023121,
0.0011737752938643098,
-0.019467750564217567,
0.012488546781241894,
-0.014095878228545189,
-0.007084950339049101,
-0.06107861548662186,
-0.0029503002297133207,
0.01355657633394003,
0.045047592371702194,
0.044920697808265686,
-0.010273178108036518,
0.014064154587686062,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "pkg_spec", "annotation": null, "type_comment": null}}, {"_type": ... | def get_package_state(name, pkg_spec, module):
info_cmd = 'pkg_info -e'
if pkg_spec['version']:
command = "%s %s" % (info_cmd, name)
elif pkg_spec['flavor']:
command = "%s %s-*-%s" % (info_cmd, pkg_spec['stem'], pkg_spec['flavor'])
else:
command = "%s %s-*" % (info_cmd, pkg_spec... | |
21,073 | [
-0.018241463229060173,
0.06800525635480881,
0.01150519959628582,
-0.009498413652181625,
0.001824991893954575,
0.06336033344268799,
-0.04965105280280113,
0.005008510779589415,
0.02077813260257244,
0.06877189874649048,
0.05767820030450821,
-0.030101796612143517,
0.027260728180408478,
0.01113... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "installed_state", "annotation": null, "type_comment": null}}, {"_... | def package_absent(name, installed_state, module):
if module.check_mode:
remove_cmd = 'pkg_delete -In'
else:
remove_cmd = 'pkg_delete -I'
if installed_state is True:
# Attempt to remove the package.
rc, stdout, stderr = execute_command("%s %s" % (remove_cmd, name), module)
... | |
21,074 | [
0.02070968970656395,
0.004734507761895657,
-0.02724611572921276,
-0.022910507395863533,
0.011455253697931767,
0.029402917250990868,
-0.04718552157282829,
-0.004850050900131464,
-0.007504786364734173,
0.05572469159960747,
0.008110010996460915,
0.029799064621329308,
-0.029138820245862007,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "installed_state", "annotation": null, "type_comment": null}}, {"_... | def package_latest(name, installed_state, pkg_spec, module):
if module.check_mode:
upgrade_cmd = 'pkg_add -umn'
else:
upgrade_cmd = 'pkg_add -um'
pre_upgrade_name = ''
if installed_state is True:
# Fetch name of currently installed package.
pre_upgrade_name = get_curre... | |
21,075 | [
0.013788014650344849,
0.004925464279949665,
0.03392793610692024,
-0.03865901008248329,
-0.04814305901527405,
0.02948160097002983,
-0.013503273949027061,
0.06597220152616501,
-0.004123262595385313,
0.05423212796449661,
0.029196860268712044,
0.02556094154715538,
-0.044222403317689896,
-0.000... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def upgrade_packages(module):
if module.check_mode:
upgrade_cmd = 'pkg_add -Imnu'
else:
upgrade_cmd = 'pkg_add -Imu'
# Attempt to upgrade all packages.
rc, stdout, stderr = execute_command("%s" % upgrade_cmd, module)
# Try to find any occurance of a package changing version like:
... | |
21,076 | [
0.01814424991607666,
-0.0026227470953017473,
-0.012393554672598839,
-0.03489113599061966,
-0.00151291664224118,
0.00610541133210063,
-0.02958114817738533,
-0.055378660559654236,
0.014371364377439022,
0.03435368835926056,
0.027925806120038033,
-0.03211790323257446,
0.008824898861348629,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "pkg_spec", "annotation": null, "type_comment": null}}, {"_type": ... | def parse_package_name(name, pkg_spec, module):
# Do some initial matches so we can base the more advanced regex on that.
version_match = re.search("-[0-9]", name)
versionless_match = re.search("--", name)
# Stop if someone is giving us a name that both has a version and is
# version-less at the sa... | |
21,077 | [
0.008165430277585983,
0.0072044488042593,
0.006004678085446358,
-0.03391973301768303,
-0.02550968900322914,
0.05265013501048088,
-0.034012917429208755,
-0.003479917533695698,
0.016936570405960083,
0.07403633743524551,
0.022725755348801613,
-0.03678520396351814,
-0.016750197857618332,
0.008... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def main():
module = AnsibleModule(
argument_spec = dict(
name = dict(required=True),
state = dict(required=True, choices=['absent', 'installed', 'latest', 'present', 'removed']),
),
supports_check_mode = True
)
name = module.params['name']
state ... | |
21,078 | [
0.013215181417763233,
-0.04337713122367859,
0.06135472655296326,
-0.006958071142435074,
-0.011081373319029808,
0.017730196937918663,
0.017895128577947617,
0.0204825010150671,
-0.028718795627355576,
0.03719218075275421,
-0.018925953656435013,
-0.022843090817332268,
0.023750217631459236,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def __init__(self, **kwargs):
region = kwargs.pop('region', None)
if not region:
region = RegionInfo(self, self.DefaultRegionName,
self.DefaultRegionEndpoint)
if 'host' not in kwargs or kwargs['host'] is None:
kwargs['host'] = region.endpo... | |
21,079 | [
0.03641318902373314,
0.006797128356993198,
0.01836107298731804,
0.014708721078932285,
0.040164850652217865,
-0.02217894047498703,
-0.037428341805934906,
0.06744163483381271,
-0.007370912004262209,
-0.03409598395228386,
-0.0035144241992384195,
-0.019817601889371872,
-0.04144482687115669,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "action", "annotation": null, "type_comment": null}}, {"_type": "a... | def make_request(self, action, body):
headers = {
'X-Amz-Target': '%s.%s' % (self.TargetPrefix, action),
'Host': self.region.endpoint,
'Content-Type': 'application/x-amz-json-1.1',
'Content-Length': str(len(body)),
}
http_request = self.build_base_... | |
21,080 | [
0.011532546021044254,
-0.06580190360546112,
0.0329747200012207,
0.0016644119750708342,
0.008901453576982021,
0.00021285416733007878,
-0.014655431732535362,
-0.01835617423057556,
0.02077825553715229,
-0.010880920104682446,
-0.0170037429779768,
-0.050187475979328156,
0.04008113220334053,
0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"k... | def orca_context_fixture():
conf = {"spark.python.worker.reuse": "false"}
sc = init_orca_context(cores=8, conf=conf)
def to_array_(v):
return v.toArray().tolist()
def flatten_(v):
result = []
for elem in v:
result.extend(elem.toArray().tolist())
return resul... | |
21,081 | [
-0.007636879105120897,
0.008799492381513119,
-0.040112901479005814,
0.006854457315057516,
-0.013896254822611809,
0.013896254822611809,
0.04476335272192955,
0.0035704888869076967,
-0.04998684301972389,
0.008116249926388264,
0.018138965591788292,
-0.014326035976409912,
0.003752319375053048,
... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "image", "annotation": null, "type_comment": null}}], "kwarg": nul... | def _orientation(self, image):
orientation = image.orientation
if orientation == 'top_right':
image.flop()
elif orientation == 'bottom_right':
image.rotate(degree=180)
elif orientation == 'bottom_left':
image.flip()
elif orientation == 'left_to... | |
21,082 | [
-0.014360355213284492,
-0.04829372093081474,
0.023725248873233795,
-0.02304811403155327,
0.04379652813076973,
0.029027337208390236,
-0.03048381395637989,
0.02587163634598255,
0.026318799704313278,
0.04627509415149689,
0.020607875660061836,
-0.05969001725316048,
-0.029589485377073288,
0.020... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestEuler:
def test_is_eulerian(self):
assert_true(is_eulerian(nx.complete_graph(5)))
assert_true(is_eulerian(nx.complete_graph(7)))
assert_true(is_eulerian(nx.hypercube_graph(4)))
assert_true(is_eulerian(nx.hypercube_graph(6)))
assert_false(is_eulerian(nx.complete_gr... | |
21,083 | [
-0.01513632945716381,
-0.028596576303243637,
0.017250774428248405,
-0.012957420200109482,
0.03068523481488228,
0.00752948597073555,
-0.02245952934026718,
0.022756066173315048,
0.011023476719856262,
0.04881272837519646,
0.022111419588327408,
-0.03527512773871422,
-0.0022353162057697773,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_is_eulerian(self):
assert_true(is_eulerian(nx.complete_graph(5)))
assert_true(is_eulerian(nx.complete_graph(7)))
assert_true(is_eulerian(nx.hypercube_graph(4)))
assert_true(is_eulerian(nx.hypercube_graph(6)))
assert_false(is_eulerian(nx.complete_graph(4)))
asser... | |
21,084 | [
-0.008699350990355015,
-0.048402782529592514,
0.053157079964876175,
-0.0293350201100111,
0.03044772893190384,
-0.0028955689631402493,
-0.022228864952921867,
0.013997357338666916,
0.012081729248166084,
0.04997069016098976,
0.009154549799859524,
-0.028854534029960632,
-0.03765504062175751,
0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_is_eulerian2(self):
# not connected
G = nx.Graph()
G.add_nodes_from([1,2,3])
assert_false(is_eulerian(G))
# not strongly connected
G = nx.DiGraph()
G.add_nodes_from([1,2,3])
assert_false(is_eulerian(G))
G = nx.MultiDiGraph()
G.add_... | |
21,085 | [
0.008087102323770523,
-0.06376908719539642,
0.04255341365933418,
-0.04274872690439224,
0.029443154111504555,
0.029565224424004555,
-0.02424299530684948,
0.016064342111349106,
0.008026067167520523,
0.05273400619626045,
0.021520845592021942,
-0.060253486037254333,
-0.029784949496388435,
-0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_eulerian_circuit_digraph(self):
G=nx.DiGraph()
G.add_cycle([0,1,2,3])
edges=list(eulerian_circuit(G,source=0))
nodes=[u for u,v in edges]
assert_equal(nodes,[0,1,2,3])
assert_equal(edges,[(0,1),(1,2),(2,3),(3,0)])
edges=list(eulerian_circuit(G,source=1)... | |
21,086 | [
0.008995842188596725,
-0.055161044001579285,
0.04958437755703926,
-0.05084606632590294,
0.028413236141204834,
0.03320765495300293,
-0.024552468210458755,
-0.0069329808466136456,
0.011430902406573296,
0.05389935150742531,
0.035226356238126755,
-0.05702834203839302,
-0.036816082894802094,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_eulerian_circuit_cycle(self):
G=nx.cycle_graph(4)
edges=list(eulerian_circuit(G,source=0))
nodes=[u for u,v in edges]
assert_equal(nodes,[0,3,2,1])
assert_equal(edges,[(0,3),(3,2),(2,1),(1,0)])
edges=list(eulerian_circuit(G,source=1))
nodes=[u for u,v i... | |
21,087 | [
0.038791969418525696,
0.017618196085095406,
-0.035875119268894196,
-0.007526323199272156,
0.012966141104698181,
0.029211075976490974,
-0.03975005820393562,
-0.010150423273444176,
-0.008958134800195694,
-0.005011339206248522,
0.02640068158507347,
-0.019140494987368584,
0.05007613077759743,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}... | def read(cls):
unpacked = struct.unpack('I', sys.stdin.read(4))
size = unpacked[0]
if size <= 0:
raise Err("Expected non-zero size for Protobuf")
data = sys.stdin.read(size)
if len(data) != size:
raise Err("Expected %d bytes; received %d", size, len(data))... | |
21,088 | [
0.00104023446328938,
-0.037224993109703064,
0.052999112755060196,
-0.04775717854499817,
0.01815352588891983,
0.012180858291685581,
-0.006286699790507555,
0.014445520006120205,
0.009318326599895954,
0.055608004331588745,
0.030316267162561417,
-0.0478779599070549,
-0.029325854033231735,
-0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_eulerian_circuit_multigraph(self):
G=nx.MultiGraph()
G.add_cycle([0,1,2,3])
G.add_edge(1,2)
G.add_edge(1,2)
edges=list(eulerian_circuit(G,source=0))
nodes=[u for u,v in edges]
assert_equal(nodes,[0,3,2,1,2,1])
assert_equal(edges,[(0,3),(3,2),(2,1)... | |
21,089 | [
-0.005884564481675625,
0.026176560670137405,
0.028883690014481544,
-0.050563663244247437,
-0.03569739684462547,
0.015003918670117855,
0.012239434756338596,
-0.005253665614873171,
-0.051848404109478,
0.06928414851427078,
-0.00910214800387621,
-0.022482935339212418,
0.00040578257176093757,
0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "field", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "checked_models", "annotation": null, "type_comment": null}}], "k... | def field_dependencies(field, checked_models=None):
checked_models = checked_models or set()
depends = set()
arg_defs, kwarg_defs = modelsinspector.matching_details(field)
for attrname, options in arg_defs + list(kwarg_defs.values()):
if options.get("ignore_if_auto_through", False) and auto_thro... | |
21,090 | [
0.0060630799271166325,
0.0042740232311189175,
0.022304965183138847,
-0.006935207638889551,
-0.030393054708838463,
-0.008225478231906891,
0.011307792738080025,
0.041455935686826706,
-0.0229262076318264,
0.07301978766918182,
0.014013778418302536,
-0.019210703670978546,
0.002513340674340725,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def run(self):
pipeline = shellcmd.Pipeline()
pipeline.parse(self.generator.command)
namespace = self.env.get_merged_dict()
if self.generator.variables is not None:
namespace.update(self.generator.variables)
namespace.update(env=self.env, SRC=self.inputs, TGT=self.outputs)
for cmd in pipeline.pipeline:
... | |
21,091 | [
0.023801667615771294,
0.031034842133522034,
0.03569119796156883,
-0.04633753001689911,
-0.029836848378181458,
-0.014703689143061638,
0.0007169602322392166,
0.034945279359817505,
-0.01761956326663494,
0.041183892637491226,
0.036821383982896805,
-0.010725443251430988,
0.028141573071479797,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def apply_command(self):
#self.meths.remove('apply_core')
# create the task
task = self.create_task('command')
setattr(task, "dep_vars", getattr(self, "dep_vars", None))
# process the sources
inputs = []
for node in self.source:
inputs.append(node)
task.set_inputs(inputs)
task.set_outputs([self.path.find_or_... | |
21,092 | [
-0.016587063670158386,
0.010710928589105606,
-0.004338917788118124,
-0.026405414566397667,
-0.021198714151978493,
-0.0019354673568159342,
0.013909331522881985,
-0.02705005370080471,
0.019760672003030777,
-0.004977358505129814,
0.010921676643192768,
-0.008597255684435368,
-0.02428554370999336... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "match", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def repl(match):
if match.group('dollar'):
return "$"
elif match.group('subst'):
var = match.group('var')
code = match.group('code')
result = eval(var+code, namespace)
if isinstance(result, Node.Node):
if var == 'TGT':
return result.get_bld().abspath()
elif var == 'SRC':
... | |
21,093 | [
0.03176911175251007,
-0.0030567909125238657,
0.013314819894731045,
-0.02653402090072632,
-0.049147702753543854,
-0.05407203361392021,
0.01691245101392269,
-0.028040006756782532,
-0.014330762438476086,
0.0317930169403553,
0.012089712545275688,
-0.01216142624616623,
0.003179301740601659,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "bugs", "annotation": null, "type_comment": null}}], "kwarg": null... | def blame_string(self, bugs):
string = "r%s:\n" % self.revision()
string += " %s\n" % urls.view_revision_url(self.revision())
string += " Bug: %s (%s)\n" % (self.bug_id(), bugs.bug_url_for_bug_id(self.bug_id()))
author_line = "\"%s\" <%s>" % (self.author_name(), self.author_email())
... | |
21,094 | [
0.024351632222533226,
0.015237297862768173,
0.03930848836898804,
-0.03367630019783974,
-0.03140940144658089,
-0.009400618262588978,
0.017621047794818878,
-0.034283921122550964,
-0.019537394866347313,
0.017656102776527405,
0.03671440854668617,
0.003309788880869746,
0.01842731609940529,
0.00... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "revision", "annotation... | class CommitInfo(object):
def __init__(self, revision, committer_email, changelog_data, committer_list=CommitterList()):
self._revision = revision
self._committer_email = committer_email
self._bug_id = changelog_data["bug_id"]
self._author_name = changelog_data["author_name"]
... | |
21,095 | [
-0.023228086531162262,
-0.020894162356853485,
-0.005304116755723953,
0.0003570345579646528,
-0.010241474024951458,
-0.03118564933538437,
0.029496334493160248,
0.030474359169602394,
-0.0042510731145739555,
-0.01673755794763565,
-0.019038138911128044,
-0.08090931177139282,
0.016793128103017807... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Name", "_fields": {"id": "User", "ctx": {"_type": "Load", "_fields": {}}}}], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", ... | class Exposure(models.Model):
user = models.ForeignKey(User, null=True)
camera = models.ForeignKey(Camera)
film = models.ForeignKey(Film)
lens = models.ForeignKey(Lens)
f_stop = models.FloatField(null=True, choices=FS_CHOICES)
shutter_speed = models.CharField(max_length=4, choices=SS_CHOICES)
... | |
21,096 | [
-0.036637526005506516,
0.02411453053355217,
-0.016590382903814316,
-0.01838086172938347,
-0.017232056707143784,
0.0018965612398460507,
0.013123271986842155,
-0.038169264793395996,
-0.01120859943330288,
0.01757359318435192,
0.0030091414228081703,
-0.021402940154075623,
0.010018397122621536,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "master", "annotation":... | class About_Window(object):
def __init__(self, master):
top=self.top=Tk.Toplevel(master)
self.master = master
top.title("About Us")
# Info
self.label = Tk.Label(top, text="Address Book by Karmitsky K.S \n Version 1.0\n Copyright © 2017")
self.label.grid(row=1, column=0, padx=10, pady=10) | |
21,097 | [
0.025975264608860016,
0.016090672463178635,
0.018674658611416817,
-0.017399590462446213,
-0.025275669991970062,
-0.010770369321107864,
-0.013066618703305721,
0.009139862842857838,
-0.026268642395734787,
0.02014154940843582,
0.0030296952463686466,
0.002452811924740672,
-0.00660101231187582,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "master", "annotation": null, "type_comment": null}}], "kwarg": nu... | def __init__(self, master):
top=self.top=Tk.Toplevel(master)
self.master = master
top.title("About Us")
# Info
self.label = Tk.Label(top, text="Address Book by Karmitsky K.S \n Version 1.0\n Copyright © 2017")
self.label.grid(row=1, column=0, padx=10, pady=10) | |
21,098 | [
0.0547281838953495,
-0.031940583139657974,
-0.013018099591135979,
-0.003210064023733139,
0.013599053025245667,
-0.012543851509690285,
-0.012792831286787987,
0.00729155819863081,
0.008898072876036167,
0.01147086638957262,
0.004428287968039513,
-0.002498692600056529,
-0.025467101484537125,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "n", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def bytes2human(n):
# http://code.activestate.com/recipes/578019
# >>> bytes2human(10000)
# '9.8K'
# >>> bytes2human(100001221)
# '95.4M'
symbols = ('K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y')
prefix = {}
for i, s in enumerate(symbols):
prefix[s] = 1 << (i + 1) * 10
for s in reve... | |
21,099 | [
-0.006646265275776386,
0.0334235318005085,
0.024379756301641464,
0.0020257453434169292,
-0.03097544051706791,
-0.01435471884906292,
-0.039715733379125595,
0.01707594469189644,
-0.04762651026248932,
0.01103664468973875,
-0.04273032769560814,
-0.0015894892858341336,
-0.0162565428763628,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "field_name", "annotation": null, "type_comment": null}}, {"_type"... | def get_help_text(self, field_name, model_name):
searchable_fields = self.related_search_fields.get(field_name, None)
if searchable_fields:
help_kwargs = {
'model_name': model_name,
'field_list': get_text_list(searchable_fields, _('and')),
}
... | |
21,100 | [
0.04078983515501022,
-0.007952535524964333,
-0.011499938555061817,
-0.029734646901488304,
-0.01732403226196766,
-0.0028696898370981216,
-0.008953221142292023,
-0.008820855058729649,
-0.02045845426619053,
0.03377974405884743,
0.002959698671475053,
-0.03200075030326843,
0.03646941855549812,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "field_name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg... | def construct_search(field_name):
# use different lookup methods depending on the notation
if field_name.startswith('^'):
return "%s__istartswith" % field_name[1:]
elif field_name.startswith('='):
return "%s__iexact" % field_name[1:... |