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
1,201
[ -0.012388193048536777, -0.0045485179871320724, 0.023663882166147232, -0.0048556155525147915, 0.016629613935947418, 0.03819596394896507, -0.0071617430076003075, 0.05381736904382706, 0.009966179728507996, -0.0037894658744335175, 0.03061703033745289, -0.03372276946902275, 0.011084477417171001, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Global", "_fields": {"names": ["CLIENT"]}}, {"_type": "If", "_...
def client(): global CLIENT if CLIENT is None: try: CLIENT = Elasticsearch( settings.ELASTIC_URI, request_timeout=settings.ELASTIC_TIMEOUT, retry_on_timeout=True, **settings.ELASTIC_KWARGS ) logging.getLo...
1,202
[ 0.05141131952404976, 0.0015883090673014522, 0.030601974576711655, -0.015420734882354736, -0.0106508182361722, -0.0021288329735398293, 0.04632873088121414, 0.012307316064834595, -0.005032694432884455, 0.027209147810935974, 0.006436393596231937, -0.023856235668063164, -0.0021920327562838793, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "m1", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "m2", "annotation": null, "type_comment": null}}, {"_type": "arg", "...
def univariant(m1, m2, condition_constraints, P=5.0e9, T=2000.0): composition = m1.formula assemblage = burnman.Composite([m1, m2]) assemblage.set_state(P, T) equality_constraints = [condition_constraints, ("phase_fraction", (m1, 0.0))] sols, prm = equilibrate( composition, assemblage, equal...
1,203
[ 0.009891398251056671, 0.02122422680258751, 0.01144065335392952, -0.024833479896187782, 0.019533099606633186, 0.027421247214078903, -0.04417363181710243, 0.03196118772029877, 0.021190177649259567, 0.037182122468948364, 0.043515339493751526, -0.028647031635046005, 0.08190054446458817, 0.0096...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "func", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def requires_search(func): def wrapped(*args, **kwargs): if client() is not None: try: return func(*args, **kwargs) except ConnectionError as e: raise exceptions.SearchUnavailableError(str(e)) except NotFoundError as e: rais...
1,204
[ 0.012404772453010082, 0.017249174416065216, 0.010409366339445114, -0.030463194474577904, 0.006219014525413513, 0.029110752046108246, -0.05964045971632004, 0.037624482065439224, 0.008447217755019665, 0.0176260843873024, 0.03622769936919212, -0.045672621577978134, 0.06349824368953705, 0.0010...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment"...
def wrapped(*args, **kwargs): if client() is not None: try: return func(*args, **kwargs) except ConnectionError as e: raise exceptions.SearchUnavailableError(str(e)) except NotFoundError as e: raise exceptions.IndexNotFoundError...
1,205
[ 0.000012428496120264754, 0.02934928983449936, 0.056509967893362045, -0.00016243605932686478, -0.023571353405714035, -0.0006743661360815167, 0.00001857328061305452, 0.012672064825892448, -0.019533364102244377, -0.0030996219720691442, 0.027510855346918106, -0.05537188798189163, 0.0338359437882...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "count_query", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "clean", "annotation": null, "type_comment": null}}], "kwar...
def get_counts(count_query, clean=True): count_query['aggregations'] = { 'counts': { 'terms': { 'field': '_type', } } } res = client().search(index=INDEX, doc_type=None, search_type='count', body=count_query) counts = {x['key']: x['doc_count'] for...
1,206
[ -0.014902465976774693, 0.03809668496251106, 0.04711035639047623, -0.006631339434534311, -0.058578550815582275, -0.011911659501492977, -0.018625503405928612, 0.018367676064372063, -0.049585506319999695, -0.030444344505667686, 0.010060453787446022, -0.05870230868458748, 0.00832784827798605, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "query", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "doc_type", "annotation": null, "type_comment": null}}], "kwarg":...
def get_aggregations(query, doc_type): query['aggregations'] = { 'licenses': { 'terms': { 'field': 'license.id' } } } res = client().search(index=INDEX, doc_type=doc_type, search_type='count', body=query) ret = { doc_type: { it...
1,207
[ 0.0011258214944973588, 0.0069352928549051285, 0.0055476524867117405, -0.01904878206551075, -0.01345167588442564, -0.04626631736755371, -0.016279319301247597, -0.007360021583735943, -0.024459706619381905, 0.053853247314691544, 0.0030196451116353273, -0.02438988909125328, 0.0032901912927627563...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "results", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":...
def format_results(results): ret = [] for result in results: if result.get('category') == 'user': result['url'] = '/profile/' + result['id'] elif result.get('category') == 'file': parent_info = load_parent(result.get('parent_id')) result['parent_url'] = parent...
1,208
[ 0.054742004722356796, 0.011855034157633781, -0.020245695486664772, 0.007174445781856775, -0.012450858019292355, -0.009084764868021011, -0.018255524337291718, -0.014594592154026031, -0.024103188887238503, 0.0665847510099411, 0.02383291907608509, 0.0019487097160890698, 0.022506138309836388, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "result", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parent_id", "annotation": null, "type_comment": null}}], "kwarg...
def format_result(result, parent_id=None): parent_info = load_parent(parent_id) formatted_result = { 'contributors': result['contributors'], 'groups': result.get('groups'), 'wiki_link': result['url'] + 'wiki/', # TODO: Remove unescape_entities when mako html safe comes in ...
1,209
[ 0.05452336370944977, 0.009443052113056183, -0.016801685094833374, 0.02176639437675476, -0.01633426919579506, -0.01700381003320217, -0.025366755202412605, -0.007061760872602463, -0.03799960017204285, 0.04166312515735626, 0.006332213990390301, -0.008211350068449974, 0.004813114181160927, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "result", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def format_preprint_result(result): parent_info = None formatted_result = { 'contributors': result['contributors'], # TODO: Remove unescape_entities when mako html safe comes in 'title': unescape_entities(result['title']), 'url': result['url'], 'is_component': False, ...
1,210
[ -0.005515689961612225, 0.008605965413153172, -0.020977705717086792, -0.02074367366731167, 0.022041482850909233, -0.01189303956925869, -0.03887045383453369, 0.006260334514081478, -0.03410472720861435, -0.023466946557164192, -0.01136115100234747, -0.016286443918943405, -0.012786613777279854, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def get_doctype_from_node(node): if isinstance(node, Preprint): return 'preprint' if isinstance(node, OSFGroup): return 'group' if node.is_registration: return 'registration' elif node.parent_node is None: # ElasticSearch categorizes top-level projects differently than ch...
1,211
[ 0.02169407717883587, 0.002789870137348771, -0.05027366802096367, -0.04072355851531029, 0.01801551692187786, -0.007115421816706657, -0.00886038038879633, -0.024405837059020996, -0.008105803281068802, 0.04508595168590546, 0.02652808465063572, 0.006791189778596163, 0.004521564580500126, -0.04...
15
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "category", "annotation": null, "type_comment": null}}], "kwarg": ...
def serialize_node(node, category): elastic_document = {} parent_id = node.parent_id try: normalized_title = six.u(node.title) except TypeError: normalized_title = node.title normalized_title = unicodedata.normalize('NFKD', normalized_title).encode('ascii', 'ignore') elastic_doc...
1,212
[ 0.026864787563681602, 0.0037214013282209635, -0.033934466540813446, -0.03985205292701721, 0.021418513730168343, -0.013105093501508236, -0.04186822101473808, 0.0003101167967543006, -0.032939475029706955, -0.015422377735376358, 0.015618757344782352, -0.01925833337008953, 0.025961438193917274, ...
15
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "preprint", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "category", "annotation": null, "type_comment": null}}], "kwar...
def serialize_preprint(preprint, category): elastic_document = {} try: normalized_title = six.u(preprint.title) except TypeError: normalized_title = preprint.title normalized_title = unicodedata.normalize('NFKD', normalized_title).encode('ascii', 'ignore') elastic_document = { ...
1,213
[ 0.005226396955549717, 0.03041801042854786, 0.007898028939962387, 0.001761157182045281, -0.00019075805903412402, 0.06835898756980896, 0.037984464317560196, 0.03004838526248932, -0.005957494489848614, -0.014219713397324085, 0.012610754929482937, 0.00795238558202982, 0.03028755448758602, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "group", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "index", "annotation": null, "type_comment": null}}, {"_type": "a...
def update_group(group, index=None, bulk=False, async_update=False, deleted_id=None): index = index or INDEX if deleted_id: delete_group_doc(deleted_id, index=index) else: category = 'group' elastic_document = serialize_group(group, category) if bulk: return elas...
1,214
[ 0.001057166955433786, 0.0024416446685791016, -0.024807358160614967, -0.01114407554268837, 0.017870232462882996, 0.016703704372048378, -0.003716760315001011, 0.003648506011813879, 0.020029552280902863, -0.0037260677199810743, 0.02328094281256199, -0.010244359262287617, 0.03901667520403862, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "group", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "category", "annotation": null, "type_comment": null}}], "kwarg":...
def serialize_group(group, category): elastic_document = {} try: normalized_title = six.u(group.name) except TypeError: normalized_title = group.name normalized_title = unicodedata.normalize('NFKD', normalized_title).encode('ascii', 'ignore') elastic_document = { 'id': group...
1,215
[ 0.04940853267908096, 0.020662160590291023, 0.03534020110964775, 0.02060570754110813, -0.06666087359189987, 0.039021000266075134, 0.022028347477316856, -0.002725316444411874, -0.008693914860486984, 0.025065572932362556, 0.03852420300245285, -0.03619829937815666, -0.01613455079495907, 0.0337...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cgms", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "actions", "annotation": null, "type_comment": null}}, {"_type": "...
def bulk_update_cgm(cgms, actions=None, op='update', index=None): index = index or INDEX if not actions and cgms: actions = ({ '_op_type': op, '_index': index, '_id': cgm._id, '_type': 'collectionSubmission', 'doc': serialize_cgm(cgm), ...
1,216
[ 0.045081909745931625, 0.012014572508633137, 0.009769457392394543, -0.0018939148867502809, -0.056345973163843155, -0.0016694033984094858, -0.03312506899237633, -0.04513322561979294, 0.011045966297388077, -0.00010954958997899666, 0.04302923381328583, -0.05706441029906273, 0.051265597343444824,...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cgm", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def serialize_cgm(cgm): obj = cgm.guid.referent contributors = [] if hasattr(obj, '_contributors'): contributors = obj._contributors.filter(contributor__visible=True).order_by('contributor___order').values('fullname', 'guids___id', 'is_active') return { 'id': cgm._id, 'abstract'...
1,217
[ 0.0626903772354126, -0.03145634010434151, -0.036813922226428986, -0.031434111297130585, 0.010692932642996311, -0.03045596368610859, -0.005443725734949112, 0.001112920930609107, 0.0019465695368126035, 0.03983728960156441, 0.03656938672065735, 0.022286206483840942, 0.03003358095884323, -0.07...
15
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def serialize_contributors(node): return { 'contributors': [ { 'fullname': x['user__fullname'], 'url': '/{}/'.format(x['user__guids___id']) } for x in node.contributor_set.filter(visible=True, user__is_active=True).order_by('_order').values...
1,218
[ 0.000834811246022582, -0.008861273527145386, 0.0016075108433142304, -0.0017228611977770925, -0.040437694638967514, -0.00793847069144249, 0.014173305593430996, 0.046495068818330765, -0.012966563925147057, -0.00041185994632542133, 0.03076009638607502, -0.033078934997320175, -0.0014596256660297...
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": "user_id", "annotation": null, "type_comment": null}}], "kwarg": n...
def update_contributors_async(self, user_id): OSFUser = apps.get_model('osf.OSFUser') user = OSFUser.objects.get(id=user_id) # If search updated so group member names are displayed on project search results, # then update nodes that the user has group membership as well p = Paginator(user.visible_co...
1,219
[ 0.0002591789816506207, 0.02512764371931553, -0.0032240645959973335, -0.06492836773395538, -0.03209735453128815, -0.008058728650212288, -0.011921875178813934, 0.024141795933246613, -0.03737049177289009, -0.0072161732241511345, 0.03182223439216614, 0.00296613946557045, 0.03523831069469452, -...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "file_", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "index", "annotation": null, "type_comment": null}}, {"_type": "a...
def update_file(file_, index=None, delete=False): index = index or INDEX target = file_.target # TODO: Can remove 'not file_.name' if we remove all base file nodes with name=None file_node_is_qa = bool( set(settings.DO_NOT_INDEX_LIST['tags']).intersection(file_.tags.all().values_list('name', fl...
1,220
[ -0.0030092657543718815, 0.02113705687224865, -0.02885454148054123, 0.005192096810787916, 0.003600673284381628, 0.005072279367595911, 0.021653195843100548, 0.04790247231721878, 0.0005576128023676574, 0.02341051958501339, 0.010715996846556664, -0.010654551908373833, 0.00978203397244215, -0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "user", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "index", "annotation": null, "type_comment": null}}], "kwarg": nul...
def update_user(user, index=None): index = index or INDEX if not user.is_active: try: client().delete(index=index, doc_type='user', id=user._id, refresh=True, ignore=[404]) # update files in their quickfiles node if the user has been marked as spam if user.spam_statu...
1,221
[ 0.0012933968100696802, 0.03437366709113121, 0.0075411610305309296, -0.007962062954902649, -0.019127659499645233, 0.053080420941114426, 0.044522080570459366, 0.011311741545796394, -0.024342166259884834, 0.007044263184070587, 0.0646786093711853, -0.029930811375379562, 0.0006368335452862084, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "institution", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "index", "annotation": null, "type_comment": null}}], "kwar...
def update_institution(institution, index=None): index = index or INDEX id_ = institution._id if institution.is_deleted: client().delete(index=index, doc_type='institution', id=id_, refresh=True, ignore=[404]) else: institution_doc = { 'id': id_, 'url': '/institut...
1,222
[ 0.04786229133605957, -0.006103561259806156, 0.025356879457831383, 0.008978597819805145, -0.05957452952861786, 0.022799983620643616, 0.039802759885787964, -0.004371469374746084, -0.03492462635040283, -0.005237515550106764, 0.04684895649552345, -0.08017110079526901, 0.0017851149896159768, 0....
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": "cgm_id", "annotation": null, "type_comment": null}}, {"_type": "a...
def update_cgm_async(self, cgm_id, collection_id=None, op='update', index=None): CollectionSubmission = apps.get_model('osf.CollectionSubmission') if collection_id: try: cgm = CollectionSubmission.objects.get( guid___id=cgm_id, collection_id=collection_id, ...
1,223
[ 0.012830386869609356, -0.016991905868053436, 0.007642899174243212, -0.05418043211102486, 0.035067420452833176, 0.05072210729122162, 0.030986595898866653, 0.010490253567695618, -0.005789813119918108, 0.011885111220180988, 0.03737296909093857, -0.08636591583490372, 0.016127323731780052, -0.0...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "sessions"}}, "targets": [{"_type": "Name", "_fields": {"id": "COLLECTION_NAME", "ctx": {"_type": "Store", "_fields": {}}}}], "type_commen...
class Session(object): COLLECTION_NAME = 'sessions' def __init__(self, player_name, server_name, login, logout=None, session_length=None, _id=None): self.player_name = player_name self.server_name = server_name self.login = login self.logout = logout self.session_length ...
1,224
[ 0.0022466382943093777, 0.011345854960381985, -0.0031678262166678905, -0.05102453753352165, -0.019160710275173187, 0.023306718096137047, -0.019574251025915146, 0.043686844408512115, -0.029965780675411224, -0.011473097838461399, 0.04559548944234848, -0.0197439081966877, -0.007761836983263493, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "elastic_document_id", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}},...
def delete_doc(elastic_document_id, node, index=None, category=None): index = index or INDEX if not category: if isinstance(node, Preprint): category = 'preprint' elif node.is_registration: category = 'registration' else: category = node.project_or_com...
1,225
[ 0.013397985137999058, -0.05584518983960152, 0.044601041823625565, -0.007847706787288189, -0.055889371782541275, -0.009846911765635014, 0.013265441171824932, 0.017087126150727272, -0.0037360829301178455, 0.008388928137719631, -0.005837456788867712, -0.027038967236876488, 0.03004329837858677, ...
13
{"_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": "alpha"}}, {"_type": "Constant", "_fields": {"kind": null...
class BeniniDistribution(SingleContinuousDistribution): _argnames = ('alpha', 'beta', 'sigma') @property def set(self): return Interval(self.sigma, oo) def pdf(self, x): alpha, beta, sigma = self.alpha, self.beta, self.sigma return (exp(-alpha*log(x/sigma) - beta*log(x/sigma)**...
1,226
[ 0.009628446772694588, 0.015381519682705402, 0.011758103966712952, -0.045208707451820374, 0.048688147217035294, 0.023360231891274452, 0.01592143252491951, 0.02610778994858265, -0.03172288462519646, 0.018189067021012306, 0.025099951773881912, -0.06752511113882065, -0.014109724201261997, 0.00...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "quantity", "annotation": null, "type_comment": null}}, {"_type": "...
def get_latest(cls, quantity, server, player): if server == 'all' and player == 'all': all_sessions = [cls(**session) for session in Database.find_sorted(Session.COLLECTION_NAME, {}, 'login')] elif server != 'all' and player == 'all': all_sessions = [cls(**session) for session in...
1,227
[ 0.030415646731853485, -0.05664347857236862, 0.050901416689157486, -0.008062629029154778, -0.025429122149944305, 0.012919634580612183, 0.042979102581739426, 0.04084201902151108, 0.00414464483037591, 0.02767413854598999, 0.010615255683660507, -0.05072872340679169, 0.043475594371557236, -0.00...
11
{"_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": "alpha"}}, {"_type": "Constant", "_fields": {"kind": null...
class BetaPrimeDistribution(SingleContinuousDistribution): _argnames = ('alpha', 'beta') set = Interval(0, oo) def pdf(self, x): alpha, beta = self.alpha, self.beta return x**(alpha - 1)*(1 + x)**(-alpha - beta)/beta_fn(alpha, beta)
1,228
[ 0.018028872087597847, -0.05500052496790886, 0.05047253519296646, 0.0061221313662827015, -0.03314986079931259, -0.006205213721841574, 0.03931872919201851, 0.01155883353203535, 0.001751220435835421, 0.03308755159378052, -0.011392668820917606, -0.051843393594026566, 0.027853362262248993, -0.0...
10
{"_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": "alpha"}}, {"_type": "Constant", "_fields": {"kind": null...
class BetaDistribution(SingleContinuousDistribution): _argnames = ('alpha', 'beta') set = Interval(0, 1) @staticmethod def check(alpha, beta): _value_check(alpha > 0, "Alpha must be positive") _value_check(beta > 0, "Beta must be positive") def pdf(self, x): alpha, beta = ...
1,229
[ 0.02765481173992157, -0.04041511192917824, 0.028351236134767532, -0.003529863664880395, 0.0005353064625523984, -0.007677523419260979, 0.028306305408477783, 0.026419218629598618, 0.01619749702513218, 0.013715079054236412, -0.03659600764513016, -0.041875358670949936, 0.03641628473997116, 0.0...
12
{"_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": "k"}}]}}, "targets": [{"_type": "Name", "_fields": {"id":...
class ChiSquaredDistribution(SingleContinuousDistribution): _argnames = ('k',) set = Interval(0, oo) def pdf(self, x): k = self.k return 1/(2**(k/2)*gamma(k/2))*x**(k/2 - 1)*exp(-x/2)
1,230
[ 0.029698939993977547, -0.05442524701356888, 0.02953926846385002, -0.006706212181597948, -0.006997042801231146, -0.01832803152501583, 0.023494552820920944, 0.027463534846901894, -0.012557039968669415, 0.020289713516831398, -0.049270130693912506, -0.012967624701559544, 0.022125938907265663, ...
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": "k"}}, {"_type": "Constant", "_fields": {"kind": null, "v...
class ChiNoncentralDistribution(SingleContinuousDistribution): _argnames = ('k', 'l') set = Interval(0, oo) def pdf(self, x): k, l = self.k, self.l return exp(-(x**2+l**2)/2)*x**k*l / (l*x)**(k/2) * besseli(k/2-1, l*x)
1,231
[ 0.019813599064946175, -0.060262758284807205, 0.05671534314751625, 0.010047397576272488, -0.015433409251272678, 0.009760793298482895, 0.03190508484840393, 0.030066486448049545, -0.004071954172104597, 0.04293667525053024, -0.01799663156270981, -0.05961383879184723, 0.039237845689058304, 0.00...
12
{"_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": "d1"}}, {"_type": "Constant", "_fields": {"kind": null, "...
class FDistributionDistribution(SingleContinuousDistribution): _argnames = ('d1', 'd2') set = Interval(0, oo) def pdf(self, x): d1, d2 = self.d1, self.d2 return (sqrt((d1*x)**d1*d2**d2 / (d1*x+d2)**(d1+d2)) / (x * beta_fn(d1/2, d2/2)))
1,232
[ 0.031023288145661354, -0.038619525730609894, 0.02693791687488556, 0.006340836640447378, -0.00022075898596085608, 0.008059033192694187, 0.020341744646430016, 0.017681997269392014, 0.003936425317078829, 0.016618099063634872, 0.006963217165321112, -0.048556338995695114, 0.056684527546167374, ...
11
{"_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": "rate"}}]}}, "targets": [{"_type": "Name", "_fields": {"i...
class ExponentialDistribution(SingleContinuousDistribution): _argnames = ('rate',) set = Interval(0, oo) @staticmethod def check(rate): _value_check(rate > 0, "Rate must be positive.") def pdf(self, x): return self.rate * exp(-self.rate*x) def sample(self): return ra...
1,233
[ 0.028395527973771095, -0.04309225454926491, 0.03340783715248108, -0.010041629895567894, -0.011907070875167847, 0.012961696833372116, 0.04043867811560631, 0.02001521922647953, 0.0062823970802128315, 0.039463434368371964, 0.006917441263794899, -0.06740535795688629, 0.05583849176764488, 0.031...
12
{"_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": "a"}}, {"_type": "Constant", "_fields": {"kind": null, "v...
class FrechetDistribution(SingleContinuousDistribution): _argnames = ('a', 's', 'm') set = Interval(0, oo) def __new__(cls, a, s=1, m=0): a, s, m = list(map(sympify, (a, s, m))) return Basic.__new__(cls, a, s, m) def pdf(self, x): a, s, m = self.a, self.s, self.m retur...
1,234
[ 0.01784147135913372, -0.0058652497828006744, 0.026238713413476944, -0.002799081150442362, 0.0027590179815888405, -0.01352533046156168, 0.025020793080329895, 0.011452728882431984, 0.023674670606851578, 0.022798622027039528, -0.030383918434381485, -0.034101780503988266, 0.04021275043487549, ...
11
{"_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": "k"}}, {"_type": "Constant", "_fields": {"kind": null, "v...
class GammaDistribution(SingleContinuousDistribution): _argnames = ('k', 'theta') set = Interval(0, oo) @staticmethod def check(k, theta): _value_check(k > 0, "k must be positive") _value_check(theta > 0, "Theta must be positive") def pdf(self, x): k, theta = self.k, self....
1,235
[ 0.027996553108096123, -0.018085205927491188, 0.03857448697090149, 0.011594200506806374, -0.03055361472070217, -0.03448755666613579, 0.050223324447870255, 0.010441337712109089, 0.021418128162622452, 0.016937805339694023, -0.019232604652643204, -0.022215843200683594, 0.019473012536764145, 0....
11
{"_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": "a"}}, {"_type": "Constant", "_fields": {"kind": null, "v...
class GammaInverseDistribution(SingleContinuousDistribution): _argnames = ('a', 'b') set = Interval(0, oo) @staticmethod def check(a, b): _value_check(a > 0, "alpha must be positive") _value_check(b > 0, "beta must be positive") def pdf(self, x): a, b = self.a, self.b ...
1,236
[ 0.01394724566489458, -0.03129570186138153, 0.044969022274017334, -0.007966593839228153, -0.010209337808191776, -0.006032012403011322, 0.02556614577770233, 0.016172869130969048, 0.006517084315419197, 0.06565020978450775, -0.022941049188375473, -0.0737309381365776, 0.012315120548009872, 0.01...
10
{"_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": "a"}}, {"_type": "Constant", "_fields": {"kind": null, "v...
class KumaraswamyDistribution(SingleContinuousDistribution): _argnames = ('a', 'b') set = Interval(0, oo) @staticmethod def check(a, b): _value_check(a > 0, "a must be positive") _value_check(b > 0, "b must be positive") def pdf(self, x): a, b = self.a, self.b retu...
1,237
[ 0.013551529496908188, -0.042621057480573654, 0.0383247509598732, -0.005047089885920286, -0.016907349228858948, 0.001897000358439982, 0.011820183135569096, 0.024302979931235313, -0.0005340323550626636, 0.010329300537705421, -0.013530154712498188, -0.057925306260585785, 0.0036016288213431835, ...
12
{"_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": "a"}}]}}, "targets": [{"_type": "Name", "_fields": {"id":...
class MaxwellDistribution(SingleContinuousDistribution): _argnames = ('a',) set = Interval(0, oo) def pdf(self, x): a = self.a return sqrt(2/pi)*x**2*exp(-x**2/(2*a**2))/a**3
1,238
[ 0.03750806301832199, -0.026010416448116302, 0.012934855185449123, -0.008105641230940819, -0.0018944989424198866, -0.008894597180187702, 0.0247842688113451, 0.014593170024454594, 0.0042839800007641315, 0.014080599881708622, -0.027477772906422615, -0.030754201114177704, 0.031075812876224518, ...
13
{"_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": "mean"}}, {"_type": "Constant", "_fields": {"kind": null,...
class LogNormalDistribution(SingleContinuousDistribution): _argnames = ('mean', 'std') set = Interval(0, oo) def pdf(self, x): mean, std = self.mean, self.std return exp(-(log(x) - mean)**2 / (2*std**2)) / (x*sqrt(2*pi)*std) def sample(self): return random.lognormvariate(self....
1,239
[ 0.06257607042789459, -0.03254932165145874, 0.030209841206669807, 0.024127185344696045, 0.004602677654474974, 0.00436110096052289, 0.01970251277089119, 0.005574071779847145, -0.001866500242613256, 0.019549937918782234, -0.0214418675750494, -0.030718423426151276, 0.017495261505246162, 0.0380...
13
{"_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": "mean"}}, {"_type": "Constant", "_fields": {"kind": null,...
class NormalDistribution(SingleContinuousDistribution): _argnames = ('mean', 'std') @staticmethod def check(mean, std): _value_check(std > 0, "Standard deviation must be positive") def pdf(self, x): return exp(-(x - self.mean)**2 / (2*self.std**2)) / (sqrt(2*pi)*self.std) def samp...
1,240
[ 0.02332037314772606, -0.0199409332126379, 0.021127093583345413, -0.007889090105891228, -0.01689719967544079, -0.014726300723850727, 0.005941995419561863, -0.0033430717885494232, -0.0009511668467894197, 0.018553348258137703, -0.00027590832905843854, -0.03207110986113548, 0.022447537630796432,...
11
{"_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": "mu"}}, {"_type": "Constant", "_fields": {"kind": null, "...
class NakagamiDistribution(SingleContinuousDistribution): _argnames = ('mu', 'omega') set = Interval(0, oo) def pdf(self, x): mu, omega = self.mu, self.omega return 2*mu**mu/(gamma(mu)*omega**mu)*x**(2*mu - 1)*exp(-mu/omega*x**2)
1,241
[ 0.007806478533893824, -0.04047555848956108, 0.06303132325410843, 0.02216571755707264, -0.027860378846526146, -0.008129659108817577, 0.02830614522099495, 0.018298696726560593, 0.01290492806583643, 0.02465086430311203, -0.02234402485191822, -0.05077275633811951, 0.022711781784892082, 0.00863...
11
{"_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": "a"}}, {"_type": "Constant", "_fields": {"kind": null, "v...
class QuadraticUDistribution(SingleContinuousDistribution): _argnames = ('a', 'b') @property def set(self): return Interval(self.a, self.b) def pdf(self, x): a, b = self.a, self.b alpha = 12 / (b-a)**3 beta = (a+b) / 2 return Piecewise( (alpha ...
1,242
[ 0.03728127479553223, -0.01949051395058632, 0.023082662373781204, -0.0028357566334307194, -0.009156009182333946, 0.015853039920330048, 0.0349922738969326, -0.0029065797571092844, -0.0001108381402445957, -0.013971979729831219, 0.006793350912630558, -0.034539006650447845, 0.03802916780114174, ...
9
{"_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": "xm"}}, {"_type": "Constant", "_fields": {"kind": null, "...
class ParetoDistribution(SingleContinuousDistribution): _argnames = ('xm', 'alpha') @property def set(self): return Interval(self.xm, oo) @staticmethod def check(xm, alpha): _value_check(xm > 0, "Xm must be positive") _value_check(alpha > 0, "Alpha must be positive") d...
1,243
[ 0.043032415211200714, -0.033519987016916275, 0.02521548606455326, -0.005527346860617399, -0.022907482460141182, -0.006233768537640572, -0.0024104623589664698, 0.015088308602571487, -0.009307513013482094, 0.010504655539989471, -0.040357720106840134, -0.025193916633725166, 0.03694963827729225,...
11
{"_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": "sigma"}}]}}, "targets": [{"_type": "Name", "_fields": {"...
class RayleighDistribution(SingleContinuousDistribution): _argnames = ('sigma',) set = Interval(0, oo) def pdf(self, x): sigma = self.sigma return x/sigma**2*exp(-x**2/(2*sigma**2))
1,244
[ 0.01736723817884922, -0.03279520571231842, 0.016225222498178482, 0.013208581134676933, -0.004115561489015818, -0.01251906342804432, 0.022473981603980064, 0.029476899653673172, 0.03949645906686783, 0.03667374327778816, -0.0350792333483696, -0.04203905910253525, 0.027817746624350548, 0.01546...
14
{"_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": "mu"}}, {"_type": "Constant", "_fields": {"kind": null, "...
class RaisedCosineDistribution(SingleContinuousDistribution): _argnames = ('mu', 's') @property def set(self): return Interval(self.mu - self.s, self.mu + self.s) @staticmethod def check(mu, s): _value_check(s > 0, "s must be positive") def pdf(self, x): mu, s = self.m...
1,245
[ -0.00541526498273015, -0.043163593858480453, 0.03285958990454674, -0.009511390700936317, 0.007093911990523338, -0.0004858310567215085, 0.03274635970592499, 0.01864911988377571, 0.009969974867999554, 0.010332314297556877, -0.03489774465560913, -0.018298102542757988, 0.0297117717564106, 0.00...
11
{"_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": "n"}}]}}, "targets": [{"_type": "Name", "_fields": {"id":...
class UniformSumDistribution(SingleContinuousDistribution): _argnames = ('n',) @property def set(self): return Interval(0, self.n) def pdf(self, x): n = self.n k = Dummy("k") return 1/factorial( n - 1)*Sum((-1)**k*binomial(n, k)*(x - k)**(n - 1), (k, 0, floo...
1,246
[ 0.030795054510235786, -0.04205763712525368, 0.06373754143714905, -0.002525799907743931, 0.0006842790171504021, 0.0021674190647900105, 0.02654588595032692, 0.033445075154304504, 0.000771732535213232, 0.026454506441950798, -0.01659688912332058, -0.03609509393572807, 0.05318314954638481, 0.01...
11
{"_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": "a"}}, {"_type": "Constant", "_fields": {"kind": null, "v...
class TriangularDistribution(SingleContinuousDistribution): _argnames = ('a', 'b', 'c') def pdf(self, x): a, b, c = self.a, self.b, self.c return Piecewise( (2*(x - a)/((b - a)*(c - a)), And(a <= x, x < c)), (2/(b - a), Eq(x, c)), (2*(b - x)/((b - a)*(b - c))...
1,247
[ 0.0073645091615617275, -0.045397959649562836, 0.06072142347693443, 0.0018700239015743136, -0.037758246064186096, -0.012340230867266655, 0.03848478943109512, 0.00014130101772025228, -0.0009260677616111934, 0.033222854137420654, -0.010573409497737885, -0.035182319581508636, 0.01308879069983959...
12
{"_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": "alpha"}}, {"_type": "Constant", "_fields": {"kind": null...
class WeibullDistribution(SingleContinuousDistribution): _argnames = ('alpha', 'beta') set = Interval(0, oo) @staticmethod def check(alpha, beta): _value_check(alpha > 0, "Alpha must be positive") _value_check(beta > 0, "Beta must be positive") def pdf(self, x): alpha, bet...
1,248
[ -0.013323799706995487, -0.019630923867225647, 0.015869174152612686, -0.008790554478764534, -0.03176087513566017, 0.013763045892119408, 0.025679005309939384, 0.042910970747470856, 0.026625074446201324, 0.0383157804608345, -0.01502447109669447, -0.025926785543560982, 0.031175214797258377, 0....
11
{"_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": "mu"}}, {"_type": "Constant", "_fields": {"kind": null, "...
class VonMisesDistribution(SingleContinuousDistribution): _argnames = ('mu', 'k') set = Interval(0, 2*pi) @staticmethod def check(mu, k): _value_check(k > 0, "k must be positive") def pdf(self, x): mu, k = self.mu, self.k return exp(k*cos(x-mu)) / (2*pi*besseli(0, k))
1,249
[ 0.0519510954618454, 0.026257125660777092, 0.029096366837620735, -0.0127413934096694, -0.027266111224889755, -0.006722668651491404, 0.00658774608746171, -0.012776589952409267, 0.0007321754819713533, -0.04169697314500809, -0.01446605660021305, -0.049839261919260025, 0.012471547350287437, -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}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": n...
class CythonSpecial(six.with_metaclass(_CythonSpecialMeta)): def setup(self, name, args, N, api): self.py_func = getattr(cython_special, '_bench_{}_py'.format(name)) self.cy_func = getattr(cython_special, '_bench_{}_cy'.format(name)) m = re.match('^(.*)_[dDl]+$', name) self.np_func =...
1,250
[ 0.011870220303535461, 0.04206639528274536, -0.05135432258248329, -0.033153317868709564, -0.010355205275118351, -0.011797333136200905, -0.02884255349636078, -0.01677449606359005, 0.0391092523932457, -0.024635912850499153, 0.00046107734669931233, 0.004469554405659437, 0.0503547228872776, -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": "args", "annotation": null, "type_comment": null}}], "kwarg": null...
def get_time_func(name, args): @with_attributes(params=[(name,), (args,)] + params, param_names=['name', 'argument'] + param_names) def func(self, name, args, N, api): if api == 'python': self.py_func(N, *args) eli...
1,251
[ 0.042395852506160736, 0.009360446594655514, 0.02137218974530697, -0.015185831114649773, -0.019679343327879906, -0.017326783388853073, 0.01696581020951271, -0.021023662760853767, 0.023973697796463966, -0.020986320450901985, 0.003964497707784176, -0.024882357567548752, 0.02386167086660862, -...
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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg...
def setup(self, name, args, N, api): self.py_func = getattr(cython_special, '_bench_{}_py'.format(name)) self.cy_func = getattr(cython_special, '_bench_{}_cy'.format(name)) m = re.match('^(.*)_[dDl]+$', name) self.np_func = getattr(special, m.group(1)) self.obj = [] for ...
1,252
[ 0.012673664838075638, -0.029102489352226257, 0.04764359071850777, -0.03903019428253174, 0.03041679598391056, 0.030299445614218712, 0.019808469340205193, 0.00821441225707531, 0.02877391315996647, -0.029125958681106567, 0.041752684861421585, 0.02466670610010624, 0.002059470396488905, 0.03105...
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": "sr", "annotation": null, "type_comment": null}}], "kwarg": null, ...
def test_competing_locks(self, sr): lock1 = self.get_lock(sr, 'foo') lock2 = self.get_lock(sr, 'foo') assert lock1.acquire(blocking=False) assert not lock2.acquire(blocking=False) lock1.release() assert lock2.acquire(blocking=False) assert not lock1.acquire(blocki...
1,253
[ 0.026666363701224327, 0.015850882977247238, 0.019787009805440903, -0.03307291120290756, 0.011725635267794132, -0.010472694411873817, 0.031725406646728516, 0.03699721395969391, 0.03950309753417969, -0.012103881686925888, 0.04146524891257286, 0.00976939219981432, 0.007718588225543499, 0.0190...
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": "sr", "annotation": null, "type_comment": null}}], "kwarg": null, ...
def test_releasing_lock_no_longer_owned_raises_error(self, sr): lock = self.get_lock(sr, 'foo') lock.acquire(blocking=False) # manually change the token sr.set('foo', 'a') with pytest.raises(LockError): lock.release() # even though we errored, the token is sti...
1,254
[ 0.0025579845532774925, -0.031502529978752136, 0.03257041051983833, -0.03333650156855583, -0.0007269144989550114, 0.027347074821591377, 0.05947640538215637, 0.009042177349328995, 0.04851900413632393, -0.0013558913487941027, 0.034566886723041534, 0.039720579981803894, -0.019384386017918587, ...
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": "sr", "annotation": null, "type_comment": null}}], "kwarg": null, ...
def test_blocking_timeout(self, sr): lock1 = self.get_lock(sr, 'foo') assert lock1.acquire(blocking=False) lock2 = self.get_lock(sr, 'foo', blocking_timeout=0.2) start = time.time() assert not lock2.acquire() assert (time.time() - start) > 0.2 lock1.release()
1,255
[ 0.0035085275303572416, 0.011912674643099308, 0.011994268745183945, -0.044666703790426254, 0.04513294994831085, 0.044037263840436935, 0.023242536932229996, 0.00819433480501175, -0.016819950193166733, -0.021622320637106895, -0.02052663452923298, -0.005831032991409302, 0.007932069711387157, 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": "sr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def test_lua_compatible_server(self, sr, monkeypatch): @classmethod def mock_register(cls, redis): return monkeypatch.setattr(LuaLock, 'register_scripts', mock_register) try: lock = sr.lock('foo') assert type(lock) == LuaLock assert sr._use...
1,256
[ 0.003465684363618493, 0.015002613887190819, -0.0003040389565285295, -0.05070722475647926, 0.04029865562915802, 0.043591633439064026, -0.0035117401275783777, -0.018214993178844452, -0.011128186248242855, -0.04389099404215813, -0.00855482928454876, -0.009677434340119362, 0.024110110476613045, ...
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": "sr", "annotation": nul...
class TestLockClassSelection(object): def test_lock_class_argument(self, sr): lock = sr.lock('foo', lock_class=Lock) assert type(lock) == Lock lock = sr.lock('foo', lock_class=LuaLock) assert type(lock) == LuaLock def test_cached_lualock_flag(self, sr): try: ...
1,257
[ -0.027708902955055237, 0.013770339079201221, 0.011210930533707142, -0.03929232805967331, 0.04914545267820358, 0.03410141542553902, 0.01554870791733265, 0.02927098236978054, -0.007816409692168236, -0.024428533390164375, -0.020583411678671837, -0.012046042829751968, 0.020739620551466942, 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": "sr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def test_lua_unavailable(self, sr, monkeypatch): @classmethod def mock_register(cls, redis): raise ResponseError() monkeypatch.setattr(LuaLock, 'register_scripts', mock_register) try: lock = sr.lock('foo') assert type(lock) == Lock assert s...
1,258
[ 0.00460795545950532, 0.05682503059506416, -0.030261199921369553, -0.03219791501760483, -0.03618139028549194, -0.003840421326458454, 0.030151158571243286, -0.0183878056704998, -0.0041237762197852135, 0.011873394250869751, 0.0076368264853954315, 0.012962797656655312, 0.025859570130705833, -0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "CreateSnapshot", "value": {"_type": "Name", "_fields": {"id": "project_forms", "ctx": {"_type": "Load", "_fiel...
class CreateView(forms.ModalFormView): form_class = project_forms.CreateSnapshot form_id = "create_snapshot_form" modal_id = "create_snapshot_modal" modal_header = _("Create Snapshot") submit_label = _("Create Snapshot") submit_url = "horizon:project:images:snapshots:create" template_name = ...
1,259
[ 0.03033163584768772, -0.007508760783821344, -0.0025605913251638412, 0.0117352195084095, 0.0164016243070364, 0.006876027677208185, 0.022936569526791573, 0.014523198828101158, -0.048799529671669006, 0.04551722854375839, -0.026574784889817238, -0.018586531281471252, -0.02766229398548603, -0.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 BackgroundLayer( cocos.layer.Layer ): def __init__(self): super( BackgroundLayer, self ).__init__() self.img = pyglet.resource.image('background_image.png') def draw( self ): glPushMatrix() self.transform() self.img.blit(0,0) glPopMatrix()
1,260
[ -0.01255499105900526, 0.01572229526937008, -0.03474689647555351, -0.052961498498916626, 0.01888960227370262, 0.0091851856559515, -0.04022996872663498, 0.04010535404086113, -0.0056284572929143906, -0.04095689207315445, -0.02361459843814373, -0.023219982162117958, -0.008385570719838142, -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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def get_object(self): try: return api.nova.server_get(self.request, self.kwargs["instance_id"]) except Exception: redirect = reverse('horizon:project:instances:index') exceptions.handle(self.request, ...
1,261
[ 0.0069150738418102264, -0.0036629638634622097, 0.006243819836527109, 0.02196620963513851, 0.014038468711078167, -0.010144037194550037, -0.032266486436128616, 0.013216760940849781, 0.03039160557091236, 0.04379354044795036, 0.011596492491662502, -0.02019548788666725, -0.027729736641049385, 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_wchar_parm(self): try: c_wchar except NameError: return f = dll._testfunc_i_bhilfd f.argtypes = [c_byte, c_wchar, c_int, c_long, c_float, c_double] result = f(1, u"x", 3, 4, 5.0, 6.0) self.assertEqual(result, 139) self.assertEqual(...
1,262
[ 0.03467033803462982, -0.019843393936753273, -0.00013214901264291257, -0.008420469239354134, 0.018348343670368195, -0.01281295157968998, -0.028121771290898323, -0.0021051173098385334, 0.04364063963294029, 0.07546915113925934, -0.007203423883765936, -0.03590591624379158, -0.024019651114940643,...
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_intresult(self): f = dll._testfunc_i_bhilfd f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double] f.restype = c_int result = f(1, 2, 3, 4, 5.0, 6.0) self.assertEqual(result, 21) self.assertEqual(type(result), int) result = f(-1, -2, -3, -4, -5...
1,263
[ 0.014917443506419659, -0.019695598632097244, 0.005984123796224594, 0.010939458385109901, 0.02823454886674881, -0.025056732818484306, -0.023593565449118614, -0.012768417596817017, 0.024759527295827866, 0.08975614607334137, 0.006338484585285187, -0.013179932720959187, -0.024782389402389526, ...
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_floatresult(self): f = dll._testfunc_f_bhilfd f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double] f.restype = c_float result = f(1, 2, 3, 4, 5.0, 6.0) self.assertEqual(result, 21) self.assertEqual(type(result), float) result = f(-1, -2, -3, ...
1,264
[ 0.029086891561746597, -0.02662569284439087, 0.029111752286553383, 0.017365122213959694, 0.009515391662716866, 0.023729434236884117, -0.029260916635394096, 0.010385512374341488, 0.024326087906956673, 0.05882015824317932, 0.003946618642657995, -0.03642076626420021, -0.011547744274139404, 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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_doubleresult(self): f = dll._testfunc_d_bhilfd f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double] f.restype = c_double result = f(1, 2, 3, 4, 5.0, 6.0) self.assertEqual(result, 21) self.assertEqual(type(result), float) result = f(-1, -2, -3...
1,265
[ 0.043667834252119064, -0.019950861111283302, 0.021833917126059532, 0.016315847635269165, 0.010052897967398167, 0.027459248900413513, -0.056491684168577194, -0.020975815132260323, -0.000998138915747404, 0.05930434912443161, 0.017340801656246185, -0.022870788350701332, -0.020749371498823166, ...
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_longlongresult(self): try: c_longlong except NameError: return f = dll._testfunc_q_bhilfd f.restype = c_longlong f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double] result = f(1, 2, 3, 4, 5.0, 6.0) self.assertEqual(res...
1,266
[ 0.028050828725099564, -0.025118468329310417, 0.026428671553730965, 0.008547516539692879, 0.005861599929630756, 0.0216620285063982, -0.03468919172883034, -0.011068098247051239, 0.022785060107707977, 0.06753162294626236, -0.002047972520813346, -0.04235076159238815, -0.016333868727087975, -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_longdoubleresult(self): f = dll._testfunc_D_bhilfD f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_longdouble] f.restype = c_longdouble result = f(1, 2, 3, 4, 5.0, 6.0) self.assertEqual(result, 21) self.assertEqual(type(result), float) result = ...
1,267
[ 0.009129635989665985, 0.012694541364908218, -0.006161779630929232, -0.005272002425044775, -0.020659061148762703, -0.010329530574381351, -0.01728544384241104, 0.023221155628561974, 0.04379906505346298, 0.013251014053821564, 0.023302309215068817, -0.012961184605956078, 0.011755493469536304, ...
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_pointers(self): f = dll._testfunc_p_p f.restype = POINTER(c_int) f.argtypes = [POINTER(c_int)] # This only works if the value c_int(42) passed to the # function is still alive while the pointer (the result) is # used. v = c_int(42) self.assertE...
1,268
[ 0.03019442781805992, -0.02531241625547409, -0.011580315418541431, 0.0030541489832103252, 0.02633046731352806, -0.010024318471550941, -0.008393125608563423, -0.014599758200347424, 0.03653410077095032, 0.02593712881207466, -0.010030102916061878, -0.01308425236493349, -0.00519147515296936, -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_stringresult(self): f = dll._testfunc_p_p f.argtypes = None f.restype = c_char_p result = f("123") self.assertEqual(result, "123") result = f(None) self.assertEqual(result, None)
1,269
[ 0.005976027809083462, -0.012732059694826603, 0.00871204026043415, 0.024312112480401993, -0.025776119902729988, 0.009126042947173119, -0.016860079020261765, -0.006924032233655453, 0.07147233188152313, 0.029304135590791702, 0.016248075291514397, -0.056256260722875595, 0.011652054265141487, -...
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_callbacks(self): f = dll._testfunc_callback_i_if f.restype = c_int f.argtypes = None MyCallback = CFUNCTYPE(c_int, c_int) def callback(value): #print "called back with", value return value cb = MyCallback(callback) result = f(-1...
1,270
[ -0.00723212119191885, -0.023283902555704117, 0.02744174189865589, -0.0008370802388526499, 0.002300986321642995, -0.013405882753431797, -0.012927100993692875, -0.016845550388097763, 0.034925851970911026, 0.05624423176050186, 0.027063755318522453, -0.04455188289284706, -0.00509335333481431, ...
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_shorts(self): f = dll._testfunc_callback_i_if args = [] expected = [262144, 131072, 65536, 32768, 16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1] def callback(v): args.append(v) return v CallBack = CFUN...
1,271
[ 0.04000253602862358, -0.017626263201236725, 0.031759873032569885, 0.02017590031027794, -0.024029463529586792, 0.025705937296152115, -0.0306189376860857, -0.025100544095039368, 0.03988611325621605, 0.026753732934594154, 0.040235377848148346, -0.038419198244810104, -0.011787708848714828, 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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_longlong_callbacks(self): f = dll._testfunc_callback_q_qf f.restype = c_longlong MyCallback = CFUNCTYPE(c_longlong, c_longlong) f.argtypes = [c_longlong, MyCallback] def callback(value): self.assertTrue(isinstance(value, (int, long))) return v...
1,272
[ 0.03740366920828819, -0.020087558776140213, 0.00011286295193713158, -0.013344423845410347, -0.010207448154687881, 0.011434960179030895, -0.010818475857377052, -0.004075341392308474, 0.0881190299987793, 0.03426123782992363, 0.007086838595569134, -0.050671715289354324, 0.041048016399145126, ...
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_callbacks_2(self): # Can also use simple datatypes as argument type specifiers # for the callback function. # In this case the call receives an instance of that type f = dll._testfunc_callback_i_if f.restype = c_int MyCallback = CFUNCTYPE(c_int, c_int) ...
1,273
[ -0.035971760749816895, 0.016293387860059738, 0.02677673101425171, -0.0031923672650009394, -0.00926449615508318, -0.01610393077135086, -0.04145340994000435, -0.00006463281169999391, 0.039306219667196274, 0.025690505281090736, 0.03316777944564819, -0.006656291428953409, 0.018617406487464905, ...
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_byval(self): # without prototype ptin = POINT(1, 2) ptout = POINT() # EXPORT int _testfunc_byval(point in, point *pout) result = dll._testfunc_byval(ptin, byref(ptout)) got = result, ptout.x, ptout.y expected = 3, 1, 2 self.assertEqual(got, expec...
1,274
[ 0.016697613522410393, 0.016538238152861595, 0.0320221483707428, -0.0035767466761171818, 0.02341589145362377, 0.06551545858383179, -0.0012834299122914672, 0.01735963486135006, 0.011125613003969193, 0.005559741519391537, 0.004811904393136501, -0.05820871517062187, 0.014797371812164783, 0.015...
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_struct_return_2H(self): class S2H(Structure): _fields_ = [("x", c_short), ("y", c_short)] dll.ret_2h_func.restype = S2H dll.ret_2h_func.argtypes = [S2H] inp = S2H(99, 88) s2h = dll.ret_2h_func(inp) self.assertEqual((s2h.x, s2h....
1,275
[ 0.019580578431487083, 0.025058336555957794, 0.02215128019452095, -0.008871323429048061, -0.008895348757505417, 0.03901700675487518, -0.018211139366030693, 0.01893189735710621, 0.016565410420298576, 0.004312532488256693, 0.010030542500317097, -0.06107218563556671, 0.015472261235117912, -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_struct_return_8H(self): class S8I(Structure): _fields_ = [("a", c_int), ("b", c_int), ("c", c_int), ("d", c_int), ("e", c_int), ("f", c_int), ("g",...
1,276
[ 0.024752464145421982, -0.02789110504090786, 0.0404694490134716, 0.02594134397804737, -0.008512374944984913, -0.008892816491425037, -0.02584623359143734, 0.019057733938097954, 0.04667539522051811, 0.008078434504568577, 0.025442015379667282, -0.041325438767671585, 0.01509876549243927, 0.0153...
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_sf1651235(self): # see http://www.python.org/sf/1651235 proto = CFUNCTYPE(c_int, RECT, POINT) def callback(*args): return 0 callback = proto(callback) self.assertRaises(ArgumentError, lambda: callback((1, 2, 3, 4), POINT()))
1,277
[ 0.026630301028490067, 0.013174867257475853, 0.037923045456409454, -0.006219192408025265, 0.0017842184752225876, 0.048911843448877335, -0.008668291382491589, -0.008522164076566696, 0.015244035050272942, -0.0002654043200891465, -0.004866050090640783, -0.037642478942871094, 0.024035073816776276...
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_struct_return_2H_stdcall(self): class S2H(Structure): _fields_ = [("x", c_short), ("y", c_short)] windll.s_ret_2h_func.restype = S2H windll.s_ret_2h_func.argtypes = [S2H] s2h = windll.s_ret_2h_func(S2H(99, 88)) ...
1,278
[ 0.024144714698195457, 0.017980612814426422, 0.030987106263637543, -0.012792295776307583, -0.02620338276028633, 0.02496580220758915, -0.020348675549030304, 0.0028782666195183992, 0.020610472187399864, -0.00017208240751642734, -0.0008567863260395825, -0.04312491416931152, 0.018266208469867706,...
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_struct_return_8H_stdcall(self): class S8I(Structure): _fields_ = [("a", c_int), ("b", c_int), ("c", c_int), ("d", c_int), ("e", c_int), ("f", c...
1,279
[ 0.002971373964101076, 0.04457060620188713, 0.05766071379184723, -0.03868139907717705, -0.02212468907237053, -0.006782629527151585, -0.05051335692405701, -0.04443676397204399, -0.02422606572508812, -0.00011701039329636842, -0.0029412584844976664, -0.03493371978402138, -0.003379603149369359, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Name", "_fields": {"id": "IViewView", "ctx": {"_type": "Load", "_fields": {}}}}], "func": {"_type": "Name", "_fields": {"id": "implements", "ctx": ...
class Report(BrowserView): implements(IViewView) template = ViewPageTemplateFile( "templates/qualitycontrol_referenceanalysisqc.pt") # if unsuccessful we return here: default_template = ViewPageTemplateFile("templates/qualitycontrol.pt") def __init__(self, context, request, report=None): ...
1,280
[ 0.015936169773340225, 0.0010104087414219975, 0.016396909952163696, -0.037672240287065506, -0.0022190033923834562, 0.021898683160543442, -0.003591058775782585, 0.03488070145249367, 0.0006254710024222732, 0.023660335689783096, 0.06032978743314743, -0.011281345039606094, 0.01089513674378395, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "While", "_fields": {"body": [{"_type": "Assign", "_fields": {"...
def server_thread_func(): while True: client = None raw_client = None try: client, addr = server.accept() if certfile: client = ssl.wrap_socket(client, server_side = True, ssl_version = ssl.PROTOCOL_TLSv1, certfile = ...
1,281
[ 0.024871913716197014, 0.040665511041879654, 0.057086583226919174, -0.04704703390598297, -0.01165495440363884, 0.011468048207461834, -0.053081441670656204, -0.026206960901618004, -0.029077310115098953, 0.0033526350744068623, -0.008057004772126675, -0.04653971642255783, -0.0033860113471746445,...
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 __call__(self): header = _("Reference analysis QC") subheader = _("Reference analysis quality control graphs ") MinimumResults = self.context.bika_setup.getMinimumResults() warning_icon = "<img src='" + self.portal_url + "/++resource++bika.lims.images/warning.png' height='9' width...
1,282
[ 0.011944487690925598, 0.02803550846874714, -0.020340699702501297, -0.051450006663799286, -0.03088238090276718, -0.009221392683684826, -0.03781389817595482, -0.0400831438601017, 0.02285750024020672, -0.03603975847363472, 0.03329603374004364, -0.04154783859848976, 0.04979964345693588, -0.038...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "sale.quote.template"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comme...
class sale_quote_template(osv.osv): _name = "sale.quote.template" _description = "Sale Quotation Template" _columns = { 'name': fields.char('Quotation Template', required=True), 'website_description': fields.html('Description', translate=True), 'quote_line': fields.one2many('sale.quo...
1,283
[ 0.007885887287557125, -0.03909716382622719, -0.033825140446424484, 0.00780835747718811, -0.010776640847325325, -0.040824972093105316, -0.010920625180006027, 0.0031704145949333906, 0.03515422344207764, -0.009813056327402592, 0.04541030526161194, -0.06060614436864853, 0.01110337395220995, -0...
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def on_change_product_id(self, cr, uid, ids, product, context=None): vals = {} product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context) name = product_obj.name if product_obj.description_sale: name += '\n' + product_obj.description_sale ...
1,284
[ 0.005276464391499758, 0.024728145450353622, 0.01365602109581232, -0.025356007739901543, -0.016976451501250267, -0.01040200050920248, -0.019934652373194695, -0.034653209149837494, 0.02396746352314949, -0.01587769016623497, 0.04870768263936043, -0.04168044775724411, 0.015599981881678104, -0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "sale.quote.line"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment":...
class sale_quote_line(osv.osv): _name = "sale.quote.line" _description = "Quotation Template Lines" _columns = { 'quote_id': fields.many2one('sale.quote.template', 'Quotation Template Reference', required=True, ondelete='cascade', select=True), 'name': fields.text('Description', required=Tru...
1,285
[ 0.007142673246562481, 0.015149709768593311, -0.003229679772630334, -0.029107999056577682, 0.0009322561090812087, -0.03737784922122955, -0.025814076885581017, -0.0559266060590744, 0.014740888960659504, -0.004134924616664648, 0.03920001909136772, -0.047633394598960876, 0.015675336122512817, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "sale.order.line"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_commen...
class sale_order_line(osv.osv): _inherit = "sale.order.line" _description = "Sales Order Line" _columns = { 'website_description': fields.html('Line Description'), 'option_line_id': fields.one2many('sale.order.option', 'line_id', 'Optional Products Lines'), } def _inject_quote_descr...
1,286
[ -0.012148941867053509, 0.012390769086778164, -0.0270155631005764, 0.0001274811220355332, -0.00639690738171339, -0.030262958258390427, -0.007663622032850981, 0.023249967023730278, 0.01957649365067482, 0.017964312806725502, 0.030493268743157387, -0.034500692039728165, -0.008636688813567162, ...
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _get_total(self, cr, uid, ids, name, arg, context=None): res = {} for order in self.browse(cr, uid, ids, context=context): total = 0.0 for line in order.order_line: total += line.price_subtotal + line.price_unit * ((line.discount or 0.0) / 100.0) * line.produc...
1,287
[ 0.022966109216213226, -0.01156532857567072, -0.03044125996530056, 0.00628218287602067, -0.004198895767331123, -0.02125011570751667, -0.027408888563513756, 0.0018394043436273932, -0.0025387306232005358, -0.03836303949356079, 0.04388713091611862, -0.05147981643676758, -0.006405593361705542, ...
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def action_quotation_send(self, cr, uid, ids, context=None): action = super(sale_order, self).action_quotation_send(cr, uid, ids, context=context) ir_model_data = self.pool.get('ir.model.data') quote_template_id = self.read(cr, uid, ids, ['template_id'], context=context)[0]['template_id'] ...
1,288
[ -0.0014147271867841482, 0.0065131415612995625, 0.0029096349608153105, -0.011317817494273186, -0.003762326203286648, 0.0020399827044457197, 0.007641839794814587, -0.007956394925713539, 0.003941190894693136, 0.020908664911985397, 0.04781237989664078, -0.03226965665817261, 0.02718743309378624, ...
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def onchange_template_id(self, cr, uid, ids, template_id, partner=False, fiscal_position=False, context=None): if not template_id: return True if context is None: context = {} context = dict(context, lang=self.pool.get('res.partner').browse(cr, uid, partner, context).lan...
1,289
[ -0.0003189345297869295, -0.042144060134887695, -0.02350384183228016, 0.005477077327668667, -0.007675061002373695, -0.03884296119213104, -0.0031773101072758436, 0.013545519672334194, 0.03087630309164524, -0.007339449133723974, 0.046391479671001434, -0.059375811368227005, 0.001730327378027141,...
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def on_change_product_id(self, cr, uid, ids, product, context=None): vals = {} product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context) vals.update({ 'price_unit': product_obj.list_price, 'website_description': product_obj.product_tmpl_id.q...
1,290
[ 0.027610305696725845, 0.014553689397871494, -0.024872800335288048, -0.02103387750685215, -0.05111435428261757, 0.005881358869373798, -0.040592070668935776, -0.04354344308376312, 0.0288507379591465, -0.040955644100904465, 0.040549296885728836, -0.0532958023250103, 0.021825186908245087, 0.00...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "sale.quote.option"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment...
class sale_quote_option(osv.osv): _name = "sale.quote.option" _description = "Quote Option" _columns = { 'template_id': fields.many2one('sale.quote.template', 'Quotation Template Reference', ondelete='cascade', select=True, required=True), 'name': fields.text('Description', required=True, tr...
1,291
[ 0.004213263280689716, -0.04067377373576164, -0.02660779096186161, 0.008508178405463696, -0.015002264641225338, -0.03444641828536987, -0.0016099128406494856, 0.010778115130960941, 0.03178999572992325, -0.008883779868483543, 0.0509946383535862, -0.06000905856490135, 0.00798560306429863, 0.00...
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def on_change_product_id(self, cr, uid, ids, product, context=None): vals = {} if not product: return vals product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context) vals.update({ 'price_unit': product_obj.list_price, 'web...
1,292
[ 0.013142162002623081, 0.005725326482206583, -0.010344005189836025, -0.032454028725624084, -0.0442429855465889, -0.008033232763409615, -0.031811829656362534, -0.06426586210727692, 0.030527429655194283, -0.02336002141237259, 0.029403580352663994, -0.08192635327577591, 0.009856621734797955, 0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "sale.order.option"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment...
class sale_order_option(osv.osv): _name = "sale.order.option" _description = "Sale Options" _columns = { 'order_id': fields.many2one('sale.order', 'Sale Order Reference', ondelete='cascade', select=True), 'line_id': fields.many2one('sale.order.line', on_delete="set null"), 'name': fi...
1,293
[ 0.00781005946919322, -0.03632793202996254, -0.036930423229932785, 0.0012907517375424504, -0.019703663885593414, -0.015687061473727226, 0.028116213157773018, 0.042442094534635544, 0.001345143304206431, -0.006889588199555874, 0.05971348285675049, -0.04726201668381691, -0.0046581425704061985, ...
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 _onchange_product_id(self): product = self.product_id.with_context(lang=self.order_id.partner_id.lang) self.price_unit = product.list_price self.website_description = product.quote_description or product.website_description self.name = product.name if product.description_sale...
1,294
[ 0.02554182894527912, -0.0031900068279355764, 0.033794473856687546, -0.031725868582725525, -0.02632572129368782, -0.011246679350733757, -0.0020019197836518288, -0.029483065009117126, 0.013924977742135525, 0.01639641635119915, -0.0004991189925931394, -0.05491602048277855, 0.030245183035731316,...
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 TelecomsMinutesTestsClient(TestClient): def __init__(self): TestClient.__init__(self, debug=True) def load_configuration(self, arguments): super(TelecomsMinutesTestsClient, self).load_configuration(arguments) self.configuration.brain_configuration._aiml_files = BrainFileConfigura...
1,295
[ 0.011445439420640469, 0.028764059767127037, 0.02111647091805935, -0.03795776516199112, -0.012005778029561043, 0.0025772990193217993, -0.058814823627471924, -0.06441821157932281, -0.0030170094687491655, 0.009671032428741455, 0.017090333625674248, 0.014350899495184422, -0.037189893424510956, ...
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": "plotly_name", "annotat...
class FontValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__( self, plotly_name="font", parent_name="indicator.legendgrouptitle", **kwargs ): super(FontValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, data_class...
1,296
[ -0.006215792614966631, -0.013874642550945282, 0.055214688181877136, -0.015577923506498337, -0.025147050619125366, -0.02104261703789234, 0.008717486634850502, 0.00937395915389061, 0.033947333693504333, 0.013945612125098705, 0.003968407865613699, -0.06822586059570312, -0.009592783637344837, ...
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 TelecomsMinutesAIMLTests(unittest.TestCase): def setUp (self): TelecomsMinutesAIMLTests.test_client = TelecomsMinutesTestsClient() def test_balance(self): response = TelecomsMinutesAIMLTests.test_client.bot.ask_question("testif", "HOW MANY MINUTES DO I HAVE LEFT") self.assertIsNo...
1,297
[ 0.011699456721544266, 0.02476511336863041, 0.00911343190819025, -0.053650520741939545, -0.008782724849879742, 0.003054978558793664, -0.05993938446044922, -0.04302450641989708, 0.0003710294549819082, 0.03144432231783867, 0.023247111588716507, 0.020926738157868385, -0.04493285343050957, -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": "plotly_name", "annotation": null, "type_comment": null}}, {"_type...
def __init__( self, plotly_name="font", parent_name="indicator.legendgrouptitle", **kwargs ): super(FontValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, data_class_str=kwargs.pop("data_class_str", "Font"), data_docs=kwargs.p...
1,298
[ -0.02035994455218315, -0.01909801736474037, 0.030520401895046234, -0.008852997794747353, 0.0047777569852769375, 0.03356463462114334, -0.0032865372486412525, 0.018070263788104057, 0.015312238596379757, 0.010570257902145386, 0.009295322932302952, 0.008911540731787682, 0.006491764914244413, 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 RealNVPTest(test_util.VectorDistributionTestHelpers, test.TestCase): @property def _real_nvp_kwargs(self): return { "shift_and_log_scale_fn": real_nvp_default_template( hidden_layers=[3], shift_only=False), "is_constant_jacobian": False, } def testBijector(self): x_...
1,299
[ -0.009144463576376438, -0.031848181039094925, 0.06760348379611969, 0.01165067683905363, -0.006233401130884886, 0.02404678985476494, 0.035318322479724884, 0.02332705818116665, 0.01047468464821577, 0.007300148252397776, 0.017427818849682808, 0.025486256927251816, 0.018134698271751404, 0.0146...
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 testMutuallyConsistent(self): dims = 4 with self.test_session() as sess: nvp = RealNVP( num_masked=3, validate_args=True, **self._real_nvp_kwargs) dist = transformed_distribution_lib.TransformedDistribution( distribution=normal_lib.Normal(loc=0., scale=1.)...
1,300
[ -0.027629444375634193, -0.01518265064805746, 0.0012443407904356718, -0.02422994002699852, 0.0003995434381067753, 0.023132888600230217, -0.011654479429125786, 0.031232107430696487, 0.045073918998241425, 0.011911812238395214, 0.019232260063290596, 0.022726573050022125, -0.012826021760702133, ...
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 testBijector(self): x_ = np.arange(3 * 4 * 2).astype(np.float32).reshape(3, 4 * 2) with self.test_session() as sess: nvp = RealNVP( num_masked=4, validate_args=True, **self._real_nvp_kwargs) x = constant_op.constant(x_) forward_x = nvp.forward(x) # Use i...