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 |
|---|---|---|---|---|---|
10,501 | [
0.018987145274877548,
-0.026726271957159042,
0.008931172080338001,
-0.007195064332336187,
0.013742145150899887,
-0.0025628977455198765,
0.025063520297408104,
0.050053685903549194,
-0.0006911571254022419,
0.005856305826455355,
-0.012158864177763462,
-0.007005559746176004,
-0.0087783457711339,... | 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):
# Set up some ignored users
self.ignored_usernames = ['deanj', 'r1cky', 'mythmon']
for username in self.ignored_usernames:
twitter_account(username=username, ignored=True, save=True)
# Now a few normal users
self.normal_usernames = ['willkg', 'marcel... | |
10,502 | [
0.04016711190342903,
-0.03202318400144577,
0.00503590377047658,
-0.005014883354306221,
0.048551276326179504,
0.01221589557826519,
-0.004564444534480572,
0.05054521933197975,
0.0016516082687303424,
0.027819089591503143,
0.0012041726149618626,
-0.020119590684771538,
-0.012245924212038517,
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_single_unignore_account(self):
data = {'usernames': self.ignored_usernames[:1]}
self.client.post(reverse('customercare.api.unignore'),
data=json.dumps(data),
content_type='application/json')
num_ignored = TwitterAccount.objects.filter(i... | |
10,503 | [
0.046744588762521744,
-0.028568847104907036,
0.002404625993221998,
0.013491522520780563,
0.04979420825839043,
0.00667866924777627,
-0.010545589029788971,
0.05655216798186302,
0.0032082011457532644,
0.012003307230770588,
-0.011033527553081512,
-0.010423603467643261,
-0.026665883138775826,
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_ignore_account(self):
data = {'username': 'rehan'}
res = self.client.post(reverse('customercare.api.ignore'),
data=json.dumps(data),
content_type='application/json')
eq_(res.status_code, 200)
user = TwitterAccount.obj... | |
10,504 | [
0.036011386662721634,
-0.03396950289607048,
0.053320981562137604,
-0.0013820413732901216,
0.0023754287976771593,
0.002772783860564232,
-0.03686990588903427,
0.014722438529133797,
-0.006450492888689041,
-0.005444053560495377,
0.012564539909362793,
-0.05109347403049469,
0.007773076184093952,
... | 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 MyDeployment:
def __init__(self):
self.num_requests = 0
self.my_counter = metrics.Counter(
"my_counter",
description=("The number of odd-numbered requests to this deployment."),
tag_keys=("deployment",),
)
self.my_counter.set_default_tags({"d... | |
10,505 | [
0.03071153536438942,
-0.02100318670272827,
0.013118111528456211,
-0.0029672624077647924,
0.0443742610514164,
0.01642131805419922,
-0.006085477769374847,
0.04435058310627937,
-0.0026638763956725597,
0.038051996380090714,
0.00037738250102847815,
-0.03038003109395504,
-0.013520653359591961,
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_multiple_unignore_account(self):
data = {'usernames': self.ignored_usernames[1:]}
self.client.post(reverse('customercare.api.unignore'),
data=json.dumps(data),
content_type='application/json')
num_ignored = TwitterAccount.objects.filter... | |
10,506 | [
0.0014992448268458247,
-0.02232678048312664,
0.04459725320339203,
-0.01728706620633602,
0.012733022682368755,
0.004078931175172329,
-0.04406231269240379,
-0.03522169217467308,
0.024114612489938736,
0.022847644984722137,
0.013612860813736916,
-0.04245748743414879,
-0.04113420844078064,
0.03... | 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 TestUsfirstTeamDetailsParser(unittest2.TestCase):
def test_parse_team_not_found(self):
with open('test_data/usfirst_html/usfirst_team_details_team_not_found.html', 'r') as f:
team, _ = UsfirstTeamDetailsParser.parse(f.read())
self.assertEqual(team, None)
def test_parse_frc254... | |
10,507 | [
0.0006323451525531709,
-0.01101628690958023,
0.010643942281603813,
-0.014367395080626011,
0.01045776903629303,
-0.009924930520355701,
-0.04326910153031349,
-0.011934311129152775,
0.013378754258155823,
0.009969868697226048,
0.04532342031598091,
-0.032663676887750626,
-0.0443476177752018,
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_parse_frc254_2014(self):
with open('test_data/usfirst_html/usfirst_team_details_frc254_2014.html', 'r') as f:
team, _ = UsfirstTeamDetailsParser.parse(f.read())
self.assertEqual(team["address"], u"San Jose, CA, USA")
self.assertEqual(team["name"], "NASA Ames Research Center ... | |
10,508 | [
-0.009995847940444946,
-0.0207578856498003,
0.003067711601033807,
-0.01809389889240265,
0.03472613915801048,
-0.0053220815025269985,
-0.045523542910814285,
-0.018954390659928322,
0.01126301009207964,
0.02282070927321911,
0.02200736664235592,
-0.0359048955142498,
-0.03701292723417282,
0.016... | 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_parse_frc842_2014(self):
with open('test_data/usfirst_html/usfirst_team_details_frc842_2014.html', 'r') as f:
team, _ = UsfirstTeamDetailsParser.parse(f.read())
self.assertEqual(team["address"], u"Phoenix, AZ, USA")
self.assertEqual(team["name"], "The Boeing Company/DLR Grou... | |
10,509 | [
0.001548255211673677,
-0.005963201634585857,
0.015470456331968307,
-0.011696583591401577,
0.02281257137656212,
-0.003323305631056428,
-0.0435204841196537,
-0.020248275250196457,
0.015059201046824455,
0.015010817907750607,
0.03478735685348511,
-0.03892410174012184,
-0.04833459109067917,
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_parse_frc254_2014(self):
with open('test_data/usfirst_html/usfirst_team_details_frc999_2014.html', 'r') as f:
team, _ = UsfirstTeamDetailsParser.parse(f.read())
self.assertEqual(team["address"], u"Cheshire, CT, USA")
self.assertEqual(team["name"], "Sikorsky Aircraft & Cheshi... | |
10,510 | [
-0.006027218420058489,
-0.018034933134913445,
0.011020698584616184,
-0.021492406725883484,
0.0180582944303751,
-0.020406104624271393,
-0.056767985224723816,
-0.020779887214303017,
0.02779996022582054,
0.006056420039385557,
0.03807893767952919,
-0.04436312988400459,
-0.05424496531486511,
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_parse_frc1114_2013(self):
with open('test_data/usfirst_html/usfirst_team_details_frc1114_2013.html', 'r') as f:
team, _ = UsfirstTeamDetailsParser.parse(f.read())
self.assertEqual(team["address"], u"St. Catharines, ON, Canada")
self.assertEqual(team["name"], "Innovation Fir... | |
10,511 | [
-0.006369131151586771,
-0.015405522659420967,
0.01294159609824419,
-0.013324341736733913,
0.022677693516016006,
0.009490902535617352,
-0.046958137303590775,
-0.018359841778874397,
0.034494973719120026,
0.0144127756357193,
0.02435220777988434,
-0.038322433829307556,
-0.05095304921269417,
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_parse_frc177_2013(self):
with open('test_data/usfirst_html/usfirst_team_details_frc177_2013.html', 'r') as f:
team, _ = UsfirstTeamDetailsParser.parse(f.read())
self.assertEqual(team["address"], u"South Windsor, CT, USA")
self.assertEqual(team["name"], "UTC Power/Ensign Bic... | |
10,512 | [
0.008141512051224709,
-0.01877819374203682,
0.023147666826844215,
-0.007825222797691822,
0.019703630357980728,
0.0023267739452421665,
-0.04732619971036911,
-0.01722017675638199,
0.007795937359333038,
0.01739589311182499,
0.022843092679977417,
-0.029356300830841064,
-0.04788849130272865,
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_parse_frc1309_2004(self):
with open('test_data/usfirst_html/usfirst_team_details_frc1309_2004.html', 'r') as f:
team, _ = UsfirstTeamDetailsParser.parse(f.read())
self.assertEqual(team["address"], u"Toronto, ON, Canada")
self.assertEqual(team["name"], "Toronto District Scho... | |
10,513 | [
-0.014955200254917145,
-0.014123015105724335,
0.009787213057279587,
-0.02414541132748127,
0.02911439724266529,
-0.003720708889886737,
-0.044310808181762695,
-0.029476216062903404,
0.042164016515016556,
0.007809267845004797,
0.018199512735009193,
-0.035530660301446915,
-0.05644381791353226,
... | 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_parse_frc4590_2013(self):
with open('test_data/usfirst_html/usfirst_team_details_frc4590_2013.html', 'r') as f:
team, _ = UsfirstTeamDetailsParser.parse(f.read())
self.assertEqual(team["address"], u"Kfar Hayarok, TA, Israel")
self.assertEqual(team["name"], "Hakfar Hayarok")... | |
10,514 | [
-0.014058469794690609,
0.004612935706973076,
-0.009659180417656898,
-0.006559817120432854,
0.004513635765761137,
0.02041366882622242,
0.0025321494322270155,
0.043523482978343964,
0.042777229100465775,
-0.022062649950385094,
0.0021168950479477644,
-0.022917231544852257,
0.03403883054852486,
... | 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": "ryu_event", "annotation": null, "type_comment": null}}], "kwarg":... | def handler_connect_or_disconnect(self, ryu_event):
ryu_dp = ryu_event.dp
dp_id = ryu_dp.id
if dp_id not in self.watchers:
self.logger.info('no watcher configured for %s', dpid_log(dp_id))
return
if ryu_event.enter: # DP is connecting
self.logger.info... | |
10,515 | [
0.004455693997442722,
0.012153039686381817,
0.01937422715127468,
-0.019740017130970955,
-0.00004087046909262426,
0.00443992717191577,
-0.023587113246321678,
-0.03120562434196472,
0.02388983592391014,
0.00887985434383154,
0.011055671609938145,
-0.047174226492643356,
-0.008179808966815472,
-... | 10 | {"_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, *args, **kwargs):
super(Gauge, self).__init__(*args, **kwargs)
sysprefix = get_sys_prefix()
self.config_file = os.getenv(
'GAUGE_CONFIG', sysprefix + '/etc/ryu/faucet/gauge.yaml')
self.exc_logfile = os.getenv(
'GAUGE_EXCEPTION_LOG',
... | |
10,516 | [
0.045444682240486145,
0.03335995227098465,
0.03653346374630928,
-0.02983100712299347,
-0.023737864568829536,
0.005049056373536587,
-0.012763862498104572,
-0.014395046979188919,
0.042245782911777496,
-0.026581330224871635,
0.014014226384460926,
-0.027876123785972595,
0.039097659289836884,
-... | 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": "ryu_event", "annotation": null, "type_comment": null}}], "kwarg":... | def reload_config(self, ryu_event):
self.config_file = os.getenv('GAUGE_CONFIG', self.config_file)
new_confs = watcher_parser(self.config_file, self.logname)
new_watchers = {}
for conf in new_confs:
watcher = watcher_factory(conf)(conf, self.logname)
new_watchers... | |
10,517 | [
0.03998865932226181,
-0.0651082918047905,
0.013438441790640354,
-0.004593063611537218,
0.022607672959566116,
-0.0033004723954945803,
0.009219920262694359,
0.04208383709192276,
-0.003483518958091736,
0.0207490436732769,
-0.010335097089409828,
-0.047986388206481934,
-0.023069513961672783,
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 BaseFavoriteDrinksFormSet(BaseFormSet):
def clean(self):
seen_drinks = []
for drink in self.cleaned_data:
if drink['name'] in seen_drinks:
raise ValidationError('You may only specify a drink once.')
seen_drinks.append(drink['name']) | |
10,518 | [
0.01481765229254961,
-0.026398034766316414,
0.016019728034734726,
-0.001150748459622264,
0.03277736157178879,
-0.007343366742134094,
0.0018715468468144536,
0.0020024660043418407,
-0.006266260053962469,
0.037395231425762177,
0.009557087905704975,
-0.05127264931797981,
-0.012746751308441162,
... | 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_basic_formset(self):
# A FormSet constructor takes the same arguments as Form. Let's create a FormSet
# for adding data. By default, it displays 1 blank form. It can display more,
# but we'll look at how to do so later.
formset = self.make_choiceformset()
self.assertHTML... | |
10,519 | [
0.05650191381573677,
-0.042995765805244446,
0.011689845472574234,
-0.014697167091071606,
0.008480051532387733,
0.0017165553290396929,
-0.0002387619751971215,
0.044567909091711044,
-0.02529723197221756,
0.061075422912836075,
0.00598784489557147,
-0.03670718893408775,
-0.03163344785571098,
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 clean(self):
seen_drinks = []
for drink in self.cleaned_data:
if drink['name'] in seen_drinks:
raise ValidationError('You may only specify a drink once.')
seen_drinks.append(drink['name']) | |
10,520 | [
0.017522448673844337,
-0.011936946772038937,
0.02210633084177971,
-0.016473693773150444,
0.009503601118922234,
0.006168797146528959,
0.04864335432648659,
0.007665334735065699,
0.03235819935798645,
0.0016114289173856378,
0.04400055110454559,
-0.01916038990020752,
-0.0039475588127970695,
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_formset_has_changed(self):
# FormSet instances has_changed method will be True if any data is
# passed to his forms, even if the formset didn't validate
blank_formset = self.make_choiceformset([('', '')])
self.assertFalse(blank_formset.has_changed())
# invalid formset t... | |
10,521 | [
0.03668634220957756,
-0.031241245567798615,
0.006483069155365229,
-0.0007160870009101927,
0.023413918912410736,
-0.028291817754507065,
0.01560927927494049,
0.019783852621912956,
0.004807000048458576,
0.04181380942463875,
0.0071466900408267975,
-0.048370614647865295,
-0.01698189787566662,
-... | 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_formset_initial_data(self):
# We can also prefill a FormSet with existing data by providing an ``initial``
# argument to the constructor. ``initial`` should be a list of dicts. By default,
# an extra blank form is included.
initial = [{'choice': 'Calexico', 'votes': 100}]
... | |
10,522 | [
0.056368738412857056,
0.031071677803993225,
0.004539564251899719,
0.009238062426447868,
0.042303040623664856,
-0.011158520355820656,
0.03141603618860245,
0.017959589138627052,
0.01874101534485817,
0.06574586778879166,
0.01118500903248787,
-0.017337094992399216,
-0.029959136620163918,
0.045... | 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_second_form_partially_filled(self):
# But the second form was blank! Shouldn't we get some errors? No. If we display
# a form as blank, it's ok for it to be submitted as blank. If we fill out even
# one of the fields of a blank form though, it will be validated. We may want to
#... | |
10,523 | [
0.02215847559273243,
-0.020450249314308167,
0.04252392053604126,
-0.011945465579628944,
0.02883388288319111,
-0.016767265275120735,
0.04024628549814224,
0.0044038305059075356,
-0.004497722256928682,
0.04545576870441437,
0.009576967917382717,
-0.044050417840480804,
-0.00612114230170846,
-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_displaying_more_than_one_blank_form(self):
# Displaying more than 1 blank form ###########################################
# We can also display more than 1 empty form at a time. To do so, pass a
# extra argument to formset_factory.
ChoiceFormSet = formset_factory(Choice, extra=... | |
10,524 | [
0.002403784776106477,
-0.013610415160655975,
0.035861216485500336,
-0.004602991975843906,
0.014260249212384224,
-0.03899005055427551,
0.040747009217739105,
0.011672946624457836,
0.018652647733688354,
0.045608729124069214,
-0.005048248451203108,
-0.05054265633225441,
-0.022852500900626183,
... | 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_min_num_displaying_more_than_one_blank_form_with_zero_extra(self):
# We can also display more than 1 empty form passing min_num argument
ChoiceFormSet = formset_factory(Choice, extra=0, min_num=3)
formset = ChoiceFormSet(auto_id=False, prefix='choices')
form_output = []
... | |
10,525 | [
0.012878037057816982,
0.0012897253036499023,
0.04862670972943306,
0.001834440277889371,
0.024183273315429688,
-0.029871368780732155,
0.043021395802497864,
0.018672561272978783,
0.008674049749970436,
0.040277864784002304,
-0.00782852154225111,
-0.037439730018377304,
-0.018802642822265625,
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_min_num_displaying_more_than_one_blank_form(self):
# We can also display more than 1 empty form passing min_num argument
# to formset_factory. It will (essentially) increment the extra argument
ChoiceFormSet = formset_factory(Choice, extra=1, min_num=1)
formset = ChoiceFormSet(... | |
10,526 | [
0.06134193763136864,
-0.0156776811927557,
0.04319283366203308,
0.004426378291100264,
0.028769874945282936,
-0.02651391178369522,
0.0256520826369524,
0.01580442115664482,
0.003738816361874342,
0.06727334856987,
-0.007686752825975418,
-0.03011331334710121,
0.02584219165146351,
0.018491297960... | 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_single_form_completed(self):
# We can just fill out one of the forms.
data = {
'choices-TOTAL_FORMS': '3', # the number of forms rendered
'choices-INITIAL_FORMS': '0', # the number of forms with initial data
'choices-MIN_NUM_FORMS': '0', # min number of f... | |
10,527 | [
0.04180603846907616,
0.01696716621518135,
0.024960145354270935,
-0.007248805370181799,
-0.009993980638682842,
0.008621392771601677,
0.015445743687450886,
0.003748431568965316,
0.01825706660747528,
0.007166119292378426,
0.020693548023700714,
-0.018709084019064903,
-0.016526173800230026,
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_formset_validate_max_flag(self):
# If validate_max is set and max_num is less than TOTAL_FORMS in the
# data, then throw an exception. MAX_NUM_FORMS in the data is
# irrelevant here (it's output as a hint for the client but its
# value in the returned data is not checked)
... | |
10,528 | [
0.013160747475922108,
0.006342194974422455,
0.018300972878932953,
-0.004929741378873587,
-0.009216954000294209,
-0.007167511619627476,
0.028891606256365776,
0.010479854419827461,
0.020959708839654922,
0.02439391054213047,
0.014002680778503418,
-0.020040228962898254,
-0.00564150745049119,
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_formset_validate_min_flag(self):
# If validate_min is set and min_num is more than TOTAL_FORMS in the
# data, then throw an exception. MIN_NUM_FORMS in the data is
# irrelevant here (it's output as a hint for the client but its
# value in the returned data is not checked)
... | |
10,529 | [
0.05886396765708923,
0.006920321844518185,
0.04105254262685776,
-0.0008491824846714735,
0.03666311874985695,
0.010656408034265041,
0.026666391640901566,
0.010707153007388115,
0.006232095416635275,
0.05196267366409302,
-0.005328204017132521,
-0.02892453595995903,
-0.011848910711705685,
0.02... | 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_second_form_partially_filled_2(self):
# And once again, if we try to partially complete a form, validation will fail.
data = {
'choices-TOTAL_FORMS': '3', # the number of forms rendered
'choices-INITIAL_FORMS': '0', # the number of forms with initial data
... | |
10,530 | [
0.030905606225132942,
-0.03546091169118881,
0.030880440026521683,
0.0026158399414271116,
0.031081778928637505,
-0.026828482747077942,
0.024613749235868454,
0.010633240453898907,
0.017214523628354073,
0.04708826541900635,
-0.016245577484369278,
-0.05320395156741142,
-0.020901553332805634,
-... | 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_more_initial_data(self):
# The extra argument also works when the formset is pre-filled with initial
# data.
initial = [{'choice': 'Calexico', 'votes': 100}]
ChoiceFormSet = formset_factory(Choice, extra=3)
formset = ChoiceFormSet(initial=initial, auto_id=False, prefix='... | |
10,531 | [
0.05796565115451813,
0.012712196446955204,
-0.0008512631175108254,
-0.013485235162079334,
0.02314208634197712,
0.025031737983226776,
0.017559027299284935,
0.04397732764482498,
0.03958450257778168,
0.03627147898077965,
0.02726496197283268,
-0.05929085984826088,
-0.014896337874233723,
0.0131... | 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_formset_with_deletion(self):
# FormSets with deletion ######################################################
# We can easily add deletion ability to a FormSet with an argument to
# formset_factory. This will add a boolean field to each form instance. When
# that boolean field is... | |
10,532 | [
0.050745364278554916,
0.00308492174372077,
0.030189355835318565,
-0.03215981274843216,
0.04366631433367729,
-0.018719347193837166,
-0.011390947736799717,
-0.05278880149126053,
-0.04086874797940254,
0.03931184485554695,
-0.0018594672437757254,
-0.02729448676109314,
0.0021377031225711107,
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_empty_ordered_fields(self):
# Ordering fields are allowed to be left blank, and if they *are* left blank,
# they will be sorted below everything else.
data = {
'choices-TOTAL_FORMS': '4', # the number of forms rendered
'choices-INITIAL_FORMS': '3', # the numbe... | |
10,533 | [
0.03857923299074173,
-0.03143582120537758,
0.023402489721775055,
-0.0333118699491024,
0.021562520414590836,
0.008231759071350098,
-0.002002319786697626,
-0.011797452345490456,
-0.012627242133021355,
0.021382130682468414,
-0.0025194354820996523,
-0.04694928973913193,
-0.014082381501793861,
... | 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_formsets_with_ordering(self):
# FormSets with ordering ######################################################
# We can also add ordering ability to a FormSet with an argument to
# formset_factory. This will add an integer field to each form instance. When
# form validation succe... | |
10,534 | [
0.05093931779265404,
-0.012389608658850193,
0.010420568287372589,
-0.03147906810045242,
0.018258370459079742,
0.02958674356341362,
0.013195125386118889,
0.026441393420100212,
-0.010535642504692078,
0.027822278439998627,
0.009595873765647411,
-0.06464588642120361,
-0.007607654202729464,
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_formset_with_ordering_and_deletion(self):
# FormSets with ordering + deletion ###########################################
# Let's try throwing ordering and deletion into the same form.
ChoiceFormSet = formset_factory(Choice, can_order=True, can_delete=True)
initial = [
... | |
10,535 | [
0.022723786532878876,
-0.016632990911602974,
0.028871502727270126,
-0.029668429866433144,
0.014151135459542274,
-0.016075143590569496,
0.017304686829447746,
-0.022587168961763382,
-0.033835217356681824,
0.023315787315368652,
0.008327879942953587,
-0.024681948125362396,
-0.0032987059094011784... | 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_ordering_blank_fieldsets(self):
# Ordering should work with blank fieldsets.
data = {
'choices-TOTAL_FORMS': '3', # the number of forms rendered
'choices-INITIAL_FORMS': '0', # the number of forms with initial data
'choices-MIN_NUM_FORMS': '0', # min numb... | |
10,536 | [
0.0723845511674881,
0.01994788646697998,
-0.0011247714282944798,
-0.0017796752508729696,
0.017685869708657265,
0.016765538603067398,
-0.02563619427382946,
0.03725675493478775,
-0.0033043192233890295,
0.0054831737652421,
0.023218940943479538,
-0.040738485753536224,
0.013871487230062485,
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_invalid_deleted_form_with_ordering(self):
# Should be able to get ordered forms from a valid formset even if a
# deleted form would have been invalid.
class Person(Form):
name = CharField()
PeopleForm = formset_factory(form=Person, can_delete=True, can_order=True)
... | |
10,537 | [
0.04147770628333092,
-0.030631674453616142,
0.014852111227810383,
-0.03189403936266899,
0.019180219620466232,
0.004585734102874994,
0.026664240285754204,
0.03617062047123909,
0.032641153782606125,
0.02161478064954281,
0.020777497440576553,
-0.02854490652680397,
-0.031198449432849884,
0.028... | 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_clean_hook(self):
# FormSet clean hook ##########################################################
# FormSets have a hook for doing extra validation that shouldn't be tied to any
# particular form. It follows the same pattern as the clean hook on Forms.
# We start out with a som... | |
10,538 | [
0.05323806032538414,
0.002818085951730609,
0.03563196584582329,
-0.007840020582079887,
0.013556445017457008,
-0.0203964002430439,
-0.0003254457260482013,
0.025977011770009995,
0.0087968735024333,
0.026372099295258522,
0.0031329214107245207,
0.0005019619129598141,
-0.04906494542956352,
-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_max_num_with_initial_data(self):
# max_num with initial data
# When not passed, max_num will take a high default value, leaving the
# number of forms only controlled by the value of the initial and extra
# parameters.
initial = [
{'name': 'Fernet and Coke'}... | |
10,539 | [
0.06587180495262146,
-0.015402456745505333,
0.059451863169670105,
-0.008665568195283413,
0.004629503935575485,
0.0004539307556115091,
-0.004970057401806116,
0.02277998998761177,
-0.009697343222796917,
0.014336963184177876,
0.0017297418089583516,
-0.007903537712991238,
-0.02724427543580532,
... | 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_limiting_max_forms(self):
# Limiting the maximum number of forms ########################################
# Base case for max_num.
# When not passed, max_num will take a high default value, leaving the
# number of forms only controlled by the value of the extra parameter.
... | |
10,540 | [
0.03823316842317581,
-0.03215673193335533,
0.036754388362169266,
-0.002614750759676099,
0.0020501259714365005,
-0.00750816660001874,
0.023552922531962395,
0.0054815663024783134,
-0.006325142923742533,
0.038932230323553085,
-0.010909358970820904,
0.010391785763204098,
-0.028768980875611305,
... | 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_more_initial_than_max_num(self):
# More initial forms than max_num now results in all initial forms
# being displayed (but no extra forms). This behavior was changed
# from max_num taking precedence in the patch for #20084
initial = [
{'name': 'Gin Tonic'},
... | |
10,541 | [
0.03493381291627884,
0.0031609886791557074,
0.016918063163757324,
0.007855305448174477,
-0.003008341882377863,
-0.022447649389505386,
0.011210104450583458,
0.014983395114541054,
0.0032072972971946,
0.025507446378469467,
-0.0053272005170583725,
0.016863180324435234,
-0.023764871060848236,
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_max_num_zero(self):
# If max_num is 0 then no form is rendered at all, regardless of extra,
# unless initial data is present. (This changed in the patch for bug
# 20084 -- previously max_num=0 trumped initial data)
LimitedFavoriteDrinkFormSet = formset_factory(FavoriteDrinkForm... | |
10,542 | [
0.02302481234073639,
-0.008900617249310017,
0.057189833372831345,
-0.028877273201942444,
0.021035488694906235,
-0.004033192526549101,
0.028594916686415672,
0.030853761360049248,
-0.030289050191640854,
0.043559759855270386,
0.00925356149673462,
-0.02700345776975155,
-0.014695323072373867,
-... | 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_regression_12878(self):
# Regression test for #12878 #################################################
data = {
'drinks-TOTAL_FORMS': '2', # the number of forms rendered
'drinks-INITIAL_FORMS': '0', # the number of forms with initial data
'drinks-MIN_NUM_F... | |
10,543 | [
0.04667036980390549,
-0.00008779927156865597,
0.05525607988238335,
-0.02624407410621643,
0.019708683714270592,
0.02134893834590912,
0.0356755368411541,
0.015608048066496849,
-0.014787920750677586,
0.023322369903326035,
-0.009348169900476933,
-0.018709154799580574,
0.010168297216296196,
-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_regression_6926(self):
# Regression test for #6926 ##################################################
# Make sure the management form has the correct prefix.
formset = FavoriteDrinksFormSet()
self.assertEqual(formset.management_form.prefix, 'form')
data = {
... | |
10,544 | [
0.033493995666503906,
-0.003954668063670397,
0.037331074476242065,
-0.035152602940797806,
-0.0005736279999837279,
0.02093065157532692,
0.027329912409186363,
0.02140100486576557,
-0.02140100486576557,
0.020423168316483498,
0.003967045806348324,
-0.062333982437849045,
-0.011195609346032143,
... | 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 test_formset_iteration(self):
# Regression tests for #16455 -- formset instances are iterable
ChoiceFormset = formset_factory(Choice, extra=3)
formset = ChoiceFormset()
# confirm iterated formset yields formset.forms
forms = list(formset)
self.assertEqual(forms, form... | |
10,545 | [
0.03787362575531006,
0.008971644565463066,
0.04922134801745415,
0.011617052368819714,
0.025807691738009453,
-0.009635988622903824,
0.0199662484228611,
-0.008528747595846653,
0.008115776814520359,
0.03825667127966881,
-0.01274823397397995,
-0.035288069397211075,
-0.01469937153160572,
0.0260... | 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_formset_calls_forms_is_valid(self):
# Regression tests for #18574 -- make sure formsets call
# is_valid() on each form.
class AnotherChoice(Choice):
def is_valid(self):
self.is_valid_called = True
return super(AnotherChoice, self).is_valid()
... | |
10,546 | [
0.03875735029578209,
0.016413254663348198,
0.06694033741950989,
0.0021407343447208405,
0.005634872708469629,
-0.020206233486533165,
0.022436046972870827,
0.055630359798669815,
-0.011781223118305206,
0.04261929169297218,
0.005525680724531412,
-0.008936489000916481,
-0.008062954060733318,
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_non_form_errors_run_full_clean(self):
# Regression test for #11160
# If non_form_errors() is called without calling is_valid() first,
# it should ensure that full_clean() is called.
class BaseCustomFormSet(BaseFormSet):
def clean(self):
raise Validati... | |
10,547 | [
0.06597203761339188,
0.05032330006361008,
0.03453186899423599,
-0.0008427844732068479,
-0.0068611870519816875,
0.021130554378032684,
0.034317824989557266,
0.03691009432077408,
0.008359470404684544,
0.04475824534893036,
0.03583989292383194,
-0.0304888803511858,
-0.00005782995140179992,
0.02... | 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_validate_max_ignores_forms_marked_for_deletion(self):
class CheckForm(Form):
field = IntegerField()
data = {
'check-TOTAL_FORMS': '2',
'check-INITIAL_FORMS': '0',
'check-MAX_NUM_FORMS': '1',
'check-0-field': '200',
'check-... | |
10,548 | [
-0.013574370183050632,
-0.04416919872164726,
0.02275158278644085,
0.005342051852494478,
0.044268008321523666,
0.001648933975957334,
-0.016847535967826843,
-0.023245645686984062,
0.02769220992922783,
0.011888382025063038,
-0.006200485862791538,
-0.06783479452133179,
0.018305020406842232,
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 FormsetAsFooTests(TestCase):
def test_as_table(self):
formset = ChoiceFormSet(data, auto_id=False, prefix='choices')
self.assertHTMLEqual(formset.as_table(), """<input type="hidden" name="choices-TOTAL_FORMS" value="1" /><input type="hidden" name="choices-INITIAL_FORMS" value="0" /><input type... | |
10,549 | [
0.04261672869324684,
-0.008441523648798466,
0.06269199401140213,
0.00465868366882205,
0.020536238327622414,
-0.012838030233979225,
0.010867380537092686,
0.021043306216597557,
0.009962726384401321,
0.04960043355822563,
0.003653191728517413,
-0.04844800755381584,
-0.002604483626782894,
0.002... | 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_formset_total_error_count_with_non_form_errors(self):
data = {
'choices-TOTAL_FORMS': '2', # the number of forms rendered
'choices-INITIAL_FORMS': '0', # the number of forms with initial data
'choices-MAX_NUM_FORMS': '2', # max number of forms - should be ignored
... | |
10,550 | [
0.050721537321805954,
0.03828268498182297,
0.07685520499944687,
0.0039943209849298,
0.026592576876282692,
0.0032546319998800755,
0.001125384122133255,
-0.003828268265351653,
0.02190687321126461,
0.029635868966579437,
-0.004148297011852264,
-0.02096490189433098,
0.017124556005001068,
0.0097... | 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 TestIsBoundBehavior(TestCase):
def test_no_data_raises_validation_error(self):
with self.assertRaises(ValidationError):
ArticleFormSet({}).is_valid()
def test_with_management_data_attrs_work_fine(self):
data = {
'form-TOTAL_FORMS': '1',
'form-INITIAL_FO... | |
10,551 | [
0.054745469242334366,
0.03082449920475483,
0.02580375038087368,
-0.03975563868880272,
0.02778308466076851,
0.03758319839835167,
0.022786473855376244,
-0.0009232866577804089,
0.03058311715722084,
0.010482019744813442,
0.03813837841153145,
-0.051510948687791824,
0.01667950488626957,
-0.02843... | 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_with_management_data_attrs_work_fine(self):
data = {
'form-TOTAL_FORMS': '1',
'form-INITIAL_FORMS': '0',
}
formset = ArticleFormSet(data)
self.assertEqual(0, formset.initial_form_count())
self.assertEqual(1, formset.total_form_count())
sel... | |
10,552 | [
0.024902936071157455,
0.013191347010433674,
0.0535748265683651,
-0.0043665505945682526,
0.009498275816440582,
-0.008429561741650105,
0.009308562614023685,
0.007114220876246691,
0.027445083484053612,
0.028153343126177788,
0.0020109531469643116,
-0.048617005348205566,
0.016214100643992424,
-... | 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_empty_forms_are_unbound(self):
data = {
'form-TOTAL_FORMS': '1',
'form-INITIAL_FORMS': '0',
'form-0-title': 'Test',
'form-0-pub_date': '1904-06-16',
}
unbound_formset = ArticleFormSet()
bound_formset = ArticleFormSet(data)
... | |
10,553 | [
0.02669513039290905,
0.030759019777178764,
0.023336946964263916,
0.0069110458716750145,
-0.002317877020686865,
0.01129128597676754,
0.008541468530893326,
0.03372785076498985,
0.006181005854159594,
0.0420016348361969,
0.018044156953692436,
-0.04370506480336189,
0.020416786894202232,
0.01615... | 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_form_errors_are_caught_by_formset(self):
data = {
'form-TOTAL_FORMS': '2',
'form-INITIAL_FORMS': '0',
'form-0-title': 'Test',
'form-0-pub_date': '1904-06-16',
'form-1-title': 'Test',
'form-1-pub_date': '', # <-- this date is missi... | |
10,554 | [
0.0357518307864666,
0.03958010673522949,
0.06933430582284927,
-0.029796738177537918,
-0.02883966825902462,
0.009506882168352604,
0.0569562204182148,
-0.02584085427224636,
-0.05410628020763397,
-0.028520645573735237,
-0.0037059825845062733,
-0.020226050168275833,
0.055935345590114594,
-0.00... | 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": "db_name", "annotation": null, "type_comment": null}}, {"_type": "... | def _fill_constraint_cache(self, db_name, table_name):
schema = self._get_schema_name()
ifsc_tables = ["constraint_column_usage", "key_column_usage"]
self._constraint_cache.setdefault(db_name, {})
self._constraint_cache[db_name][table_name] = {}
for ifsc_table in ifsc_tables:
... | |
10,555 | [
0.027941076084971428,
0.03647386655211449,
0.10886924713850021,
-0.019827306270599365,
0.020760580897331238,
0.020208235830068588,
0.046206578612327576,
-0.042016368359327316,
-0.05660591274499893,
0.015494249761104584,
-0.010742172598838806,
-0.0113707035779953,
0.032455071806907654,
0.01... | 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": "table_name", "annotation": null, "type_comment": null}}, {"_type"... | def _find_foreign_constraints(self, table_name, column_name=None):
constraints = self._constraints_affecting_columns(
table_name, [column_name], "FOREIGN KEY")
primary_key_columns = self._find_primary_key_columns(table_name)
if len(primary_key_columns) > 1:
... | |
10,556 | [
0.06831564754247665,
0.041571736335754395,
0.010417402721941471,
-0.0077320002019405365,
-0.03432910144329071,
0.01038070023059845,
0.02510453201830387,
-0.03383973613381386,
-0.007884928025305271,
0.03401101380586624,
-0.021544387564063072,
0.026303483173251152,
-0.019807133823633194,
-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": "verbosity", "annotation": null, "type_comment": null}}, {"_type":... | def send_pending_create_signals(self, verbosity=0, interactive=False):
# Group app_labels together
signals = SortedDict()
for (app_label, model_names) in self.pending_create_signals:
try:
signals[app_label].extend(model_names)
except KeyError:
... | |
10,557 | [
0.015810959041118622,
0.040996089577674866,
0.06218340992927551,
-0.012460011057555676,
-0.018918009474873543,
0.014358174987137318,
0.0046817827969789505,
-0.01750764064490795,
-0.0488644540309906,
0.009215106256306171,
0.00845159962773323,
-0.018727131187915802,
0.0778777226805687,
0.017... | 10 | {"_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": "Subscript", "_fields"... | def _lookup():
table = self._constraint_cache[db_name][table_name]
if table is INVALID:
raise INVALID
elif column_name is None:
return list(table.items())
else:
return table[column_name] | |
10,558 | [
-0.008179591037333012,
0.019314656034111977,
0.04641345515847206,
-0.023477299138903618,
-0.01966848224401474,
0.001728797098621726,
0.030657855793833733,
-0.05482199043035507,
-0.013382893055677414,
-0.00014057045336812735,
0.025350486859679222,
-0.06610275059938431,
0.03958672285079956,
... | 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 MockOptions(object):
def __init__(self):
self.db_table = db_table
self.db_tablespace = db_tablespace or settings.DEFAULT_TABLESPACE
self.object_name = model_name
self.module_name = model_name.lower()
if pk_field_type == m... | |
10,559 | [
0.039581529796123505,
0.03443304821848869,
0.0687837153673172,
0.003969479352235794,
0.00833024363964796,
0.04390625283122063,
0.05473865941166878,
0.006955598946660757,
-0.02302401140332222,
0.02438320964574814,
0.01711355336010456,
-0.032703157514333725,
0.05996951460838318,
-0.063758797... | 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 __init__(self):
self.db_table = db_table
self.db_tablespace = db_tablespace or settings.DEFAULT_TABLESPACE
self.object_name = model_name
self.module_name = model_name.lower()
if pk_field_type == models.AutoField:
pk... | |
10,560 | [
-0.011165283620357513,
0.009485905058681965,
-0.010540531948208809,
-0.02142496407032013,
-0.005874956492334604,
0.003381682327017188,
-0.017355481162667274,
-0.016896948218345642,
-0.013755995780229568,
-0.009944438934326172,
-0.009950170293450356,
-0.029116857796907425,
0.03060709126293659... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "preview"}}, {"_type": "Constant", "_fields": {"kind": nul... | class ImageAdmin(ThumbnailAdminMixin, admin.ModelAdmin):
list_display = ['preview', 'title', 'alt_text', 'is_ok_for_web', 'date_created', 'date_modified']
list_display_links = ['alt_text', 'title', 'preview']
date_hierarchy = 'date_modified'
filter_horizontal = ['categories', ]
list_filter = ['categ... | |
10,561 | [
0.021303605288267136,
0.02770335227251053,
0.011010782793164253,
-0.03466013818979263,
-0.03282810002565384,
0.020028607919812202,
-0.018691716715693474,
0.015213324688374996,
-0.010899375192821026,
-0.012062965892255306,
0.015634197741746902,
-0.051495060324668884,
0.03225868567824364,
-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": "obj", "annotation": null, "type_comment": null}}], "kwarg": null,... | def derivatives(self, obj):
repurpose_configs_qs = ImageRepurposeConfig.objects.all()
if not repurpose_configs_qs:
add_url = reverse('admin:%s_%s_add' % (
ImageRepurposeConfig._meta.app_label,
ImageRepurposeConfig._meta.model_name
))
re... | |
10,562 | [
0.015946725383400917,
0.0013929110718891025,
0.06945278495550156,
-0.008584501221776009,
0.01849408820271492,
0.016997655853629112,
0.004195153713226318,
-0.003912430722266436,
-0.016106650233268738,
-0.0035354667343199253,
0.004340799059718847,
-0.054968226701021194,
-0.010634957812726498,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "CharField", "value": {"_type": "Name", "_fields": {"id": "mo... | class Group(models.Model):
name = models.CharField(max_length=128)
members = models.ManyToManyField(Person, through='Membership')
custom_members = models.ManyToManyField(Person, through='CustomMembership', related_name="custom")
nodefaultsnonulls = models.ManyToManyField(Person, through='TestNoDefaultsO... | |
10,563 | [
-0.01724494807422161,
0.00454299570992589,
0.049090687185525894,
-0.023196930065751076,
0.01781380921602249,
0.04563537985086441,
-0.01090318989008665,
0.006304888054728508,
-0.0189199298620224,
0.0020845106337219477,
0.004011004231870174,
-0.07020179182291031,
0.01969948224723339,
-0.0224... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Name", "_fields": {"id": "Person", "ctx": {"_type": "Load", "_fields": {}}}}], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load"... | class Membership(models.Model):
person = models.ForeignKey(Person)
group = models.ForeignKey(Group)
date_joined = models.DateTimeField(default=datetime.now)
invite_reason = models.CharField(max_length=64, null=True)
class Meta:
ordering = ('date_joined', 'invite_reason', 'group')
def _... | |
10,564 | [
0.005174301099032164,
0.012116238474845886,
0.022568820044398308,
-0.004096207674592733,
0.032112956047058105,
0.040278010070323944,
0.026005584746599197,
0.030514970421791077,
-0.012422701343894005,
-0.006928255315870047,
0.01425053458660841,
-0.03600941598415375,
-0.013298310339450836,
-... | 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 ClonableDictTest(tests.support.TestCase):
def test_clone(self):
g = dnf.persistor.ClonableDict({})
g['base'] = ['pepper', 'tour']
g_c = g.clone()
self.assertEqual(g, g_c)
g_c['base'].append('magical')
self.assertNotEqual(g, g_c) | |
10,565 | [
0.008628655225038528,
-0.009081932716071606,
0.06898555159568787,
0.0001361026952508837,
0.021156588569283485,
0.013237886130809784,
0.023220911622047424,
0.01458133477717638,
-0.02149518020451069,
0.0059472182765603065,
-0.01630706526339054,
-0.059199124574661255,
0.015171141363680363,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Name", "_fields": {"id": "Person", "ctx": {"_type": "Load", "_fields": {}}}}], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load"... | class CustomMembership(models.Model):
person = models.ForeignKey(Person, db_column="custom_person_column", related_name="custom_person_related_name")
group = models.ForeignKey(Group)
weird_fk = models.ForeignKey(Membership, null=True)
date_joined = models.DateTimeField(default=datetime.now)
def __s... | |
10,566 | [
0.002223347779363394,
-0.005182385910302401,
0.0758868008852005,
-0.013828377239406109,
0.021380597725510597,
0.03414124622941017,
-0.003188534639775753,
0.061146948486566544,
-0.024740034714341164,
0.01772167719900608,
0.05031341686844826,
-0.014778914861381054,
0.012767159380018711,
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_prune_db(self):
prst = self.prst
grp = prst.group('pepper')
prst._prune_db()
self.assertEmpty(prst.db['GROUPS'])
grp = prst.group('pepper')
grp.pkg_types = dnf.comps.MANDATORY
prst._prune_db()
self.assertLength(prst.db['GROUPS'], 1) | |
10,567 | [
0.0157161857932806,
-0.01765596866607666,
0.06545112282037735,
-0.026140861213207245,
0.003397915977984667,
0.04621165990829468,
-0.004080798011273146,
0.05280955508351326,
-0.01989925280213356,
0.0014680316671729088,
0.05774477869272232,
0.011618893593549728,
-0.0047669792547822,
0.012450... | 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_saving(self):
prst = self.prst
grp = prst.group('pepper')
grp.full_list.extend(['pepper', 'tour'])
grp.pkg_types = dnf.comps.DEFAULT | dnf.comps.OPTIONAL
prst.commit()
self.assertTrue(prst.save())
prst = dnf.persistor.GroupPersistor(self.persistdir)
... | |
10,568 | [
0.012082046829164028,
0.0028231581673026085,
0.07728228718042374,
-0.03452013432979584,
0.020618420094251633,
0.059781379997730255,
-0.0012669089483097196,
0.019668448716402054,
-0.02235780842602253,
0.03706231340765953,
0.028418900445103645,
-0.008148357272148132,
-0.005134535487741232,
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_added_removed(self):
prst1 = dnf.persistor.GroupPersistor(tests.support.NONEXISTENT_FILE)
prst1.db = prst1._empty_db()
prst2 = dnf.persistor.GroupPersistor(tests.support.NONEXISTENT_FILE)
prst2.db = prst1._empty_db()
prst1.group('kite').full_list.extend(('the', 'show'))... | |
10,569 | [
0.0020933635532855988,
-0.007353808730840683,
0.07198081165552139,
-0.021183913573622704,
0.035990405827760696,
0.07554030418395996,
-0.01370651088654995,
0.0075700972229242325,
-0.010085223242640495,
0.0359656848013401,
0.015955911949276924,
-0.024310827255249023,
-0.007693690713495016,
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 GroupDiffTest(tests.support.TestCase):
def test_added_removed(self):
prst1 = dnf.persistor.GroupPersistor(tests.support.NONEXISTENT_FILE)
prst1.db = prst1._empty_db()
prst2 = dnf.persistor.GroupPersistor(tests.support.NONEXISTENT_FILE)
prst2.db = prst1._empty_db()
prst... | |
10,570 | [
0.007893831469118595,
0.005707346368581057,
0.05382480472326279,
-0.01591784507036209,
-0.007716308813542128,
0.04570611193776131,
0.00919566210359335,
0.009266671724617481,
-0.02757515199482441,
0.010018182918429375,
0.019918017089366913,
0.015456287190318108,
-0.01788242720067501,
-0.046... | 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 RepoPersistorTest(tests.support.TestCase):
def setUp(self):
self.persistdir = tempfile.mkdtemp(prefix="dnf-repoprst-test-")
self.prst = dnf.persistor.RepoPersistor(self.persistdir)
def tearDown(self):
dnf.util.rm_rf(self.persistdir)
def test_expired_repos(self):
self.... | |
10,571 | [
0.01586880534887314,
-0.010639882646501064,
0.01480167731642723,
-0.024795006960630417,
0.021631289273500443,
0.082306869328022,
-0.005351327359676361,
0.009440934285521507,
-0.005454901605844498,
0.04697869345545769,
0.024732235819101334,
-0.027494210749864578,
-0.041103217750787735,
-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_diff_dcts(self):
dct1 = {'stop' : [1, 2, 3],
'the' : {'show' : [1, 2]}}
dct2 = {'stop' : [1, 2],
'the' : {'show' : [2]},
'three' : 8}
added, removed = dnf.persistor._diff_dcts(dct1, dct2)
self.assertEqual(added, {'three': 8})
... | |
10,572 | [
0.019098060205578804,
0.03321497514843941,
-0.026558754965662956,
-0.03786551207304001,
-0.03347945958375931,
-0.04348583146929741,
-0.0014987513422966003,
0.023737575858831406,
-0.005785621237009764,
0.03325905650854111,
0.03786551207304001,
-0.002144812373444438,
-0.03345742076635361,
-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": "metafield", "annotation": null, "type_comment": null}}, {"_type":... | def getFormattedValue(self, metafield, maskitem, mask, node, language, html=True):
value = node.get(metafield.getName()).replace(";", "; ")
if html:
value = esc(value)
# replace variables
value = replace_attribute_variables(value, node.id, node.get, r'<(.+?)>', "<", ... | |
10,573 | [
0.03474658355116844,
0.03725520521402359,
-0.0018085717456415296,
-0.018077466636896133,
-0.016129985451698303,
-0.020729120820760727,
0.03980783373117447,
-0.002151031279936433,
-0.04519916698336601,
0.026780616492033005,
0.05690605938434601,
0.001981864683330059,
-0.011420821771025658,
-... | 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", "annotation": null, "type_comment": null}}, {"_type": "ar... | def getEditorHTML(self, field, value="", width=400, lock=0, language=None, required=None):
return tal.getTAL("metadata/watermark.html", {"lock": lock,
"value": value,
"width": width,
... | |
10,574 | [
0.03977663815021515,
-0.006234830245375633,
0.034312814474105835,
-0.03858673945069313,
0.007370091509073973,
0.007133326027542353,
0.015893656760454178,
-0.002009473042562604,
0.004805129952728748,
0.0093977777287364,
-0.0002468206803314388,
-0.04055371508002281,
0.022085990756750107,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg... | def loadConfig():
_loadConfigsByPrecedent()
if 'GIRDER_PORT' in os.environ:
port = int(os.environ['GIRDER_PORT'])
cherrypy.config['server.socket_port'] = port
if 'GIRDER_MONGO_URI' in os.environ:
if 'database' not in cherrypy.config:
cherrypy.config['database'] = {}
... | |
10,575 | [
0.03483912721276283,
0.06862185895442963,
-0.035521384328603745,
-0.03514724224805832,
-0.032308172434568405,
-0.030701568350195885,
0.08768104016780853,
-0.024209121242165565,
-0.036929916590452194,
0.03501519560813904,
0.07363975048065186,
0.015075680799782276,
-0.030371444299817085,
-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": "node", "annotation": null, "type_comment": null}}, {"_type": "arg... | def event_metafield_changed(self, node, field):
if "image" in node.type:
items = node.attrs.items()
# check if there is an original file and modify it in case
for f in node.getFiles():
if f.type == "original":
path, ext = splitfilename(f.ab... | |
10,576 | [
0.0389414057135582,
0.02509605698287487,
0.008677871897816658,
-0.000010390825082140509,
-0.03231308236718178,
-0.0199285801500082,
0.019328979775309563,
0.0028699119575321674,
-0.014085189439356327,
0.014183306135237217,
-0.026404280215501785,
0.02686215750873089,
0.0005699623143300414,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "WeightBased", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}}}],... | class WeightBasedCreateView(generic.CreateView):
model = WeightBased
form_class = WeightBasedForm
template_name = "dashboard/shipping/weight_based_form.html"
def get_success_url(self):
msg = render_to_string(
'dashboard/shipping/messages/method_created.html',
{'method': ... | |
10,577 | [
0.01724986732006073,
0.023494362831115723,
0.002091186586767435,
0.00022679893299937248,
-0.031709637492895126,
0.01124894991517067,
0.00761739956215024,
0.028365954756736755,
-0.010988762602210045,
-0.009798544459044933,
-0.0145483473315835,
0.004179604817181826,
0.0032357340678572655,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "WeightBand", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}}}], ... | class WeightBasedDetailView(generic.CreateView):
model = WeightBand
form_class = WeightBandForm
template_name = "dashboard/shipping/weight_based_detail.html"
def dispatch(self, request, *args, **kwargs):
self.method = shortcuts.get_object_or_404(
WeightBased, pk=kwargs['pk'])
... | |
10,578 | [
0.02700020559132099,
0.02113107405602932,
-0.0004184371209703386,
0.014843505807220936,
-0.03955331817269325,
0.011694216169416904,
0.03433386608958244,
0.00145627127494663,
-0.0136652747169137,
0.019457325339317322,
-0.032814279198646545,
0.019611487165093422,
-0.02424732968211174,
-0.007... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "WeightBased", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}}}],... | class WeightBasedUpdateView(generic.UpdateView):
model = WeightBased
form_class = WeightBasedForm
template_name = "dashboard/shipping/weight_based_form.html"
context_object_name = "method"
def get_success_url(self):
msg = render_to_string(
'dashboard/shipping/messages/method_upd... | |
10,579 | [
0.019902199506759644,
0.010624067857861519,
-0.007799808401614428,
-0.005990517791360617,
-0.03130955621600151,
0.011429422535002232,
0.019769812002778053,
-0.002940097590908408,
-0.027646847069263458,
-0.021435683593153954,
-0.011484583839774132,
-0.00042336303158663213,
0.00128732691518962... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "WeightBand", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}}}], ... | class WeightBandUpdateView(generic.UpdateView):
model = WeightBand
form_class = WeightBandForm
template_name = "dashboard/shipping/weight_band_form.html"
context_object_name = "band"
def dispatch(self, request, *args, **kwargs):
self.method = shortcuts.get_object_or_404(
WeightB... | |
10,580 | [
0.034163109958171844,
0.03755171597003937,
-0.0302417054772377,
-0.007347306702286005,
-0.04526665434241295,
0.019969329237937927,
-0.0033166774082928896,
0.021258704364299774,
0.009435880929231644,
0.01757173053920269,
-0.012179798446595669,
-0.006478843279182911,
-0.02883511409163475,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "WeightBased", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}}}],... | class WeightBasedDeleteView(generic.DeleteView):
model = WeightBased
template_name = "dashboard/shipping/weight_based_delete.html"
context_object_name = "method"
def get_success_url(self):
msg = render_to_string(
'dashboard/shipping/messages/method_deleted.html',
{'metho... | |
10,581 | [
0.025195110589265823,
0.025393150746822357,
-0.030498187988996506,
-0.01808767020702362,
-0.04394291341304779,
0.027241526171565056,
-0.02919992431998253,
0.01771359331905842,
0.0016462089261040092,
-0.014897022396326065,
0.013037645258009434,
-0.02636134810745716,
-0.0068488894030451775,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "WeightBased", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}}}],... | class WeightBandDeleteView(generic.DeleteView):
model = WeightBased
template_name = "dashboard/shipping/weight_band_delete.html"
context_object_name = "band"
def dispatch(self, request, *args, **kwargs):
self.method = shortcuts.get_object_or_404(
WeightBased, pk=kwargs['method_pk'])... | |
10,582 | [
0.012382649816572666,
0.026365241035819054,
0.05538954213261604,
-0.04495611786842346,
-0.029925676062703133,
0.006371600087732077,
-0.024359680712223053,
0.014478348195552826,
0.038804225623607635,
0.021295001730322838,
-0.002240763744339347,
-0.05196431279182434,
0.013588239438831806,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": true}}, "targets": [{"_type": "Name", "_fields": {"id": "BM_compatible", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null... | class FixExec(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
exec_stmt< 'exec' a=any 'in' b=any [',' c=any] >
|
exec_stmt< 'exec' (not atom<'(' [any] ')'>) a=any >
"""
def transform(self, node, results):
assert results
syms = self.syms
a = results["a"]
... | |
10,583 | [
0.007831784896552563,
-0.05331823602318764,
-0.0008919830434024334,
-0.042761653661727905,
0.02237652987241745,
-0.0030834642238914967,
0.02336152456700802,
0.029849648475646973,
0.022697722539305687,
0.008324283175170422,
-0.027965309098362923,
-0.005441565066576004,
0.015031888149678707,
... | 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 TestDriverConfigurator(unittest.TestCase):
def setUp(self):
self.configurator = HandlerConfigurator
self.configured_driver = self.configurator.get_vt_am_driver()
def test_should_get_vt_am_driver_instance(self):
self.assertTrue(isinstance(self.configured_driver, VTAMDriver)) | |
10,584 | [
0.05333956331014633,
-0.011582942679524422,
0.0446133017539978,
-0.040886227041482925,
-0.007476466242223978,
-0.026223424822092056,
0.007794494740664959,
0.008212953805923462,
0.033766843378543854,
0.041131723672151566,
-0.004332444630563259,
-0.024036280810832977,
-0.011504830792546272,
... | 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": "node", "annotation": null, "type_comment": null}}, {"_type": "arg... | def transform(self, node, results):
assert results
syms = self.syms
a = results["a"]
b = results.get("b")
c = results.get("c")
args = [a.clone()]
args[0].prefix = ""
if b is not None:
args.extend([Comma(), b.clone()])
if c is not None:
... | |
10,585 | [
0.03165731951594353,
0.01946190558373928,
0.050945576280355453,
-0.03018799237906933,
-0.016389675438404083,
-0.018233012408018112,
0.009497195482254028,
-0.01130713988095522,
-0.033233508467674255,
0.01940847560763359,
0.011273745447397232,
-0.05823878198862076,
-0.023469161242246628,
0.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}}, {"_type": "arg", "_fields": {"arg": "orm", "annotation": nu... | class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Team'
db.create_table('teams_team', (
('is_visible', self.gf('django.db.models.fields.BooleanField')(default=True, blank=True)),
('description', self.gf('django.db.models.fields.TextField... | |
10,586 | [
0.04678109660744667,
0.013630549423396587,
0.06728067994117737,
-0.03027152828872204,
-0.02039206773042679,
-0.0030104280449450016,
0.024847978726029396,
0.01186252012848854,
-0.024334294721484184,
0.009001418948173523,
0.014634025283157825,
-0.041739825159311295,
0.007753047160804272,
-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": "orm", "annotation": null, "type_comment": null}}], "kwarg": null,... | def forwards(self, orm):
# Adding model 'Team'
db.create_table('teams_team', (
('is_visible', self.gf('django.db.models.fields.BooleanField')(default=True, blank=True)),
('description', self.gf('django.db.models.fields.TextField')(blank=True)),
('created', se... | |
10,587 | [
0.08684088289737701,
0.04472305625677109,
0.06595336645841599,
-0.034782059490680695,
-0.05311005562543869,
0.03759296238422394,
0.011523556895554066,
0.03311379998922348,
-0.01675114966928959,
0.0200990941375494,
0.03900983929634094,
-0.0866580605506897,
-0.018625084310770035,
0.026555027... | 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": "orm", "annotation": null, "type_comment": null}}], "kwarg": null,... | def backwards(self, orm):
# Deleting model 'Team'
db.delete_table('teams_team')
# Removing M2M table for field videos on 'Team'
db.delete_table('teams_team_videos')
# Deleting model 'TeamMember'
db.delete_table('teams_teammember')
# Removing unique con... | |
10,588 | [
-0.004788033664226532,
0.013616904616355896,
0.006419910117983818,
0.038686834275722504,
0.0005122030270285904,
-0.021471431478857994,
-0.008894624188542366,
-0.042392924427986145,
-0.017849024385213852,
0.0286923348903656,
-0.014740687794983387,
-0.04339715838432312,
-0.012839820235967636,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Name", "_fields": {"id": "USStateField", "ctx": {"_type": "Load", "_fields": {}}}}, "keywords": [{"_type": "keyword", "_fields": {"arg... | class USPlace(models.Model):
state = USStateField(blank=True)
state_req = USStateField()
state_default = USStateField(default="CA", blank=True)
postal_code = USPostalCodeField(blank=True)
name = models.CharField(max_length=20)
class Meta:
app_label = 'localflavor' | |
10,589 | [
-0.015470551326870918,
0.03988361731171608,
0.045875102281570435,
0.0091213658452034,
0.02792300470173359,
0.01856689713895321,
-0.008461855351924896,
-0.001611049985513091,
0.010188878513872623,
0.005178275052458048,
-0.019695889204740524,
-0.03241661936044693,
0.03474167361855507,
-0.000... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "StringProperty", "value": {"_type": "Name", "_fields": {"id"... | class User(model.Base):
name = ndb.StringProperty(required=True)
username = ndb.StringProperty(required=True)
email = ndb.StringProperty(default='')
auth_ids = ndb.StringProperty(repeated=True)
active = ndb.BooleanProperty(default=True)
admin = ndb.BooleanProperty(default=False)
permissions = ndb.StringPr... | |
10,590 | [
-0.0137788662686944,
0.03677332401275635,
0.056540098041296005,
0.042516373097896576,
0.01669491082429886,
0.037997614592313766,
-0.0126547422260046,
0.02237118035554886,
-0.03216552734375,
0.007857738062739372,
0.00021042543812654912,
-0.039578069001436234,
0.03870993107557297,
-0.0026113... | 10 | {"_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": "admin", "annotation": null, "type_comment": null}}, {"_type": "arg... | def get_dbs(
cls, admin=None, active=None, verified=None, permissions=None, **kwargs
):
return super(User, cls).get_dbs(
admin=admin or util.param('admin', bool),
active=active or util.param('active', bool),
verified=verified or util.param('verified', bool),
permissions=per... | |
10,591 | [
-0.0226352047175169,
0.010956467129290104,
-0.02590378187596798,
-0.06865236908197403,
-0.026834163814783096,
0.027030033990740776,
0.010356616228818893,
-0.03248990327119827,
0.0070207081735134125,
0.012082718312740326,
0.03104536421597004,
-0.06894617527723312,
-0.009915908798575401,
-0.... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "BASE_URL", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "base_url", "ctx": {"_type": "Store", "_fields": {}}}}],... | class Vidics_Scraper(scraper.Scraper):
base_url = BASE_URL
def __init__(self, timeout=scraper.DEFAULT_TIMEOUT):
self.timeout = timeout
self.base_url = kodi.get_setting('%s-base_url' % (self.get_name()))
@classmethod
def provides(cls):
return frozenset([VIDEO_TYPES.TVSHOW, VIDEO... | |
10,592 | [
-0.06172072887420654,
-0.007632576860487461,
-0.009418423287570477,
-0.058231551200151443,
-0.015453757718205452,
-0.039842639118433,
0.004974436014890671,
-0.039748337119817734,
0.002593307988718152,
0.005030428059399128,
0.028832869604229927,
-0.0242120660841465,
0.013803470879793167,
-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": "video", "annotation": null, "type_comment": null}}], "kwarg": nul... | def get_sources(self, video):
source_url = self.get_url(video)
hosters = []
if source_url and source_url != FORCE_NO_MATCH:
url = urlparse.urljoin(self.base_url, source_url)
html = self._http_get(url, cache_limit=.5)
match = re.search('Links:(.*?)Show All Lin... | |
10,593 | [
-0.05479317158460617,
-0.025104353204369545,
-0.017930107191205025,
-0.019880708307027817,
-0.014745226129889488,
-0.008959542959928513,
-0.03374430537223816,
0.017191743478178978,
0.034339405596256256,
0.046638112515211105,
-0.005526704713702202,
0.004490791819989681,
-0.015494609251618385,... | 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": "link", "annotation": null, "type_comment": null}}], "kwarg": null... | def resolve_link(self, link):
url = urlparse.urljoin(self.base_url, link)
request = urllib2.Request(url)
request.add_header('User-Agent', USER_AGENT)
request.add_unredirected_header('Host', request.get_host())
request.add_unredirected_header('Referer', url)
response = url... | |
10,594 | [
0.0045866710133850574,
0.007537144236266613,
0.00016520728240720928,
-0.02229246310889721,
-0.02179628610610962,
-0.0036061336286365986,
0.03463778644800186,
-0.021477317437529564,
-0.021229229867458344,
0.028329266235232353,
0.007826579734683037,
0.03640983998775482,
-0.0110517218708992,
... | 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": "_inf", "annotation": null, "type_comment": null}}, {"_type": "arg... | def __init__(self, _inf=None, _tzinfos=None):
if _inf:
self._tzinfos = _tzinfos
self._utcoffset, self._dst, self._tzname = _inf
else:
_tzinfos = {}
self._tzinfos = _tzinfos
self._utcoffset, self._dst, self._tzname = self._transition_info[0]
... | |
10,595 | [
-0.013830876909196377,
0.02512160874903202,
-0.05459160357713699,
-0.04279499500989914,
-0.011925768107175827,
-0.00860528089106083,
-0.0014920664252713323,
0.01471346989274025,
0.022947415709495544,
0.04301026090979576,
0.003594951704144478,
-0.06255646795034409,
-0.003893634071573615,
-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": "video_type", "annotation": null, "type_comment": null}}, {"_type"... | def search(self, video_type, title, year):
if video_type == VIDEO_TYPES.MOVIE:
search_url = urlparse.urljoin(self.base_url, '/Category-Movies/Genre-Any/Letter-Any/ByPopularity/1/Search-')
else:
search_url = urlparse.urljoin(self.base_url, '/Category-TvShows/Genre-Any/Letter-Any/B... | |
10,596 | [
0.028203845024108887,
-0.019307492300868034,
0.01948782242834568,
-0.022998275235295296,
-0.031017016619443893,
-0.0014666961506009102,
0.01727575622498989,
0.007435668259859085,
-0.018610209226608276,
0.01931951381266117,
-0.00038188949110917747,
0.024813612923026085,
0.006056132726371288,
... | 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 __repr__(self):
if self._dst:
dst = 'DST'
else:
dst = 'STD'
if self._utcoffset > _notime:
return '<DstTzInfo %r %s+%s %s>' % (
self.zone, self._tzname, self._utcoffset, dst
)
else:
return '<DstTzInfo ... | |
10,597 | [
0.021172957494854927,
0.0039846329018473625,
0.012856690213084221,
-0.02931278385221958,
-0.07603444159030914,
-0.0014490243047475815,
-0.045310128480196,
0.04594532027840614,
0.0028377645649015903,
0.006440108176320791,
0.032582830637693405,
-0.07203511148691177,
0.03479422628879547,
0.00... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "feature", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "known", "annotation": null, "type_comment": null}}], "kwarg": ... | def extract_experiment_refs(feature, known):
experiment = embl.experiment(feature)
if not experiment:
return []
match = re.search(r"PMID:([\d, ]+)", experiment)
if not match:
return []
found = []
pmids = match.group(1).split(",")
for pmid in pmids:
pmid = pmid.strip... | |
10,598 | [
0.0032263195607811213,
0.03233885392546654,
-0.011521797627210617,
-0.01683955080807209,
-0.062126919627189636,
-0.04226100444793701,
-0.0042801424860954285,
0.012181112542748451,
-0.0017536695813760161,
0.007836119271814823,
0.004763820208609104,
-0.021476373076438904,
0.006025705952197313,... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "feature", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def rna_type(feature):
if feature.type == "ncRNA":
rna_type = embl.qualifier_value(feature, "ncRNA_class", r"^(.+)$")
if rna_type is None:
return "ncRNA"
return rna_type
if feature.type == "misc_RNA":
prod = product(feature) or ""
if prod.startswith("gene:"):
... | |
10,599 | [
0.015124979428946972,
0.03486359119415283,
0.00689771817997098,
-0.018079521134495735,
-0.04004540294408798,
-0.03959085792303085,
-0.0029488597065210342,
-0.010153395123779774,
-0.012715891934931278,
0.017443157732486725,
0.015318161807954311,
-0.02413633093237877,
-0.003474427154287696,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "feature", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def note_data(feature):
data = {}
text = []
onts = set()
for note in feature.qualifiers.get("note", []):
for ontology in ONTOLOGIES:
if note.startswith(ontology + ":"):
onts.add(note)
break
else:
text.append(note)
if text:
... | |
10,600 | [
0.056928131729364395,
0.01639697514474392,
0.033335186541080475,
-0.009606929495930672,
-0.025561075657606125,
0.0014115174999460578,
0.014453447423875332,
-0.02310091443359852,
-0.033901020884513855,
0.020935971289873123,
0.05638689547777176,
-0.040518857538700104,
0.04305282235145569,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "record", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "feature", "annotation": null, "type_comment": null}}], "kwarg":... | def exons(record, feature):
data = []
chrom = chromosome(record)
if not chrom:
return embl.exons(feature)
for exon in embl.exons(feature):
data.append(attr.evolve(exon, chromosome=chrom))
return data |