query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
test upsert global template as staff saves
def test_upsert_global_template_as_staff_saves(self): mock_request = create_mock_request(user=self.staff_user1) template_api.upsert(self.fixture.global_template, request=mock_request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_upsert_global_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superuser1)\n template_api.upsert(self.fixture.global_template, request=mock_request)", "def test_upsert_own_template_as_staff_saves(self):\n mock_request = create_mock_request(user=self....
[ "0.817305", "0.8163642", "0.78363234", "0.76788574", "0.7538798", "0.72347766", "0.6604227", "0.64778715", "0.6405772", "0.6319687", "0.62832665", "0.6279908", "0.6232745", "0.62278795", "0.6200194", "0.61855614", "0.6185184", "0.61763513", "0.61297494", "0.6127971", "0.61237...
0.86477035
0
test upsert own template as superuser saves
def test_upsert_own_template_as_superuser_saves(self): mock_request = create_mock_request(user=self.superuser1) template_api.upsert(self.fixture.user1_template, request=mock_request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_upsert_global_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superuser1)\n template_api.upsert(self.fixture.global_template, request=mock_request)", "def test_upsert_other_users_template_as_superuser_saves(self):\n mock_request = create_mock_reques...
[ "0.83650684", "0.8313205", "0.83011836", "0.7990907", "0.77972287", "0.69682634", "0.6701379", "0.6564317", "0.64938676", "0.64082444", "0.63623893", "0.6311204", "0.6286057", "0.6261494", "0.6255452", "0.62456673", "0.6227969", "0.61704993", "0.61659986", "0.6132771", "0.611...
0.86755675
0
test upsert other users template as superuser saves
def test_upsert_other_users_template_as_superuser_saves(self): mock_request = create_mock_request(user=self.superuser1) template_api.upsert(self.fixture.user2_template, request=mock_request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_upsert_own_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superuser1)\n template_api.upsert(self.fixture.user1_template, request=mock_request)", "def test_upsert_own_template_as_user_saves(self):\n mock_request = create_mock_request(user=self.user1...
[ "0.8743067", "0.8495421", "0.82973075", "0.80561215", "0.77087814", "0.6882263", "0.67282534", "0.6710842", "0.6694126", "0.66577846", "0.66266376", "0.65471303", "0.63964623", "0.6395424", "0.6271223", "0.62125725", "0.6190717", "0.61589557", "0.6157732", "0.6142412", "0.609...
0.88003814
0
test upsert global template as superuser saves
def test_upsert_global_template_as_superuser_saves(self): mock_request = create_mock_request(user=self.superuser1) template_api.upsert(self.fixture.global_template, request=mock_request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_upsert_own_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superuser1)\n template_api.upsert(self.fixture.user1_template, request=mock_request)", "def test_upsert_other_users_template_as_superuser_saves(self):\n mock_request = create_mock_request(us...
[ "0.8367511", "0.80747837", "0.8019871", "0.7914993", "0.75762117", "0.7137918", "0.68105483", "0.6717558", "0.64962363", "0.6318845", "0.62885976", "0.62019926", "0.62019926", "0.61965513", "0.6134998", "0.61280674", "0.61277187", "0.61214155", "0.61206126", "0.6063399", "0.6...
0.8720903
0
test set display name user template as anonymous raises access control error
def test_set_display_name_user_template_as_anonymous_raises_access_control_error( self, ): mock_request = create_mock_request(user=self.anonymous_user) with self.assertRaises(AccessControlError): template_api.set_display_name( self.fixture.user1_template, "new_name", request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_display_name_user_template_as_anonymous_with_access_right_access_raises_control_error(\n self,\n ):\n mock_request = create_mock_request(user=self.anonymous_user)\n with self.assertRaises(AccessControlError):\n template_api.set_display_name(\n self.fix...
[ "0.7858779", "0.78346056", "0.7798927", "0.7767267", "0.7345611", "0.7203787", "0.7118784", "0.69429713", "0.6838001", "0.6815123", "0.65575707", "0.64346975", "0.6426258", "0.64122313", "0.6399105", "0.6327164", "0.6311326", "0.62794083", "0.62768495", "0.62200284", "0.62012...
0.79632276
0
test set display name user template as anonymous with right access raises access control error
def test_set_display_name_user_template_as_anonymous_with_access_right_access_raises_control_error( self, ): mock_request = create_mock_request(user=self.anonymous_user) with self.assertRaises(AccessControlError): template_api.set_display_name( self.fixture.user1_template, "new_name", request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_display_name_global_template_as_user_raises_access_control_error(\n self,\n ):\n mock_request = create_mock_request(user=self.user1)\n with self.assertRaises(AccessControlError):\n template_api.set_display_name(\n self.fixture.global_template, \"new_na...
[ "0.7932997", "0.7856808", "0.7826848", "0.7630959", "0.75949347", "0.7490484", "0.7073472", "0.68847364", "0.6830498", "0.6753237", "0.6647094", "0.65420926", "0.6539563", "0.6489039", "0.6448539", "0.6360224", "0.63581413", "0.63525265", "0.6342854", "0.6306662", "0.6250822"...
0.7989204
0
test set display name global template as anonymous raises access control error
def test_set_display_name_global_template_as_anonymous_raises_access_control_error( self, ): mock_request = create_mock_request(user=self.anonymous_user) with self.assertRaises(AccessControlError): template_api.set_display_name( self.fixture.global_template, "new_name", request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_display_name_global_template_as_anonymous_with_access_right_access_raises_control_error(\n self,\n ):\n mock_request = create_mock_request(user=self.anonymous_user)\n with self.assertRaises(AccessControlError):\n template_api.set_display_name(\n self.f...
[ "0.75897294", "0.7537711", "0.71880955", "0.7096142", "0.70061153", "0.6705285", "0.6676191", "0.66185564", "0.6505029", "0.6454833", "0.64344525", "0.64255494", "0.64228266", "0.637963", "0.6351018", "0.6320668", "0.6286474", "0.627791", "0.6211061", "0.6122106", "0.6110267"...
0.7648022
0
test set display name global template as anonymous with right access raises access control error
def test_set_display_name_global_template_as_anonymous_with_access_right_access_raises_control_error( self, ): mock_request = create_mock_request(user=self.anonymous_user) with self.assertRaises(AccessControlError): template_api.set_display_name( self.fixture.global_template, "new_name", request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_display_name_global_template_as_user_raises_access_control_error(\n self,\n ):\n mock_request = create_mock_request(user=self.user1)\n with self.assertRaises(AccessControlError):\n template_api.set_display_name(\n self.fixture.global_template, \"new_na...
[ "0.7787586", "0.7674045", "0.7377819", "0.7261662", "0.6899707", "0.68808687", "0.6835308", "0.66616756", "0.665786", "0.659236", "0.64996874", "0.64823717", "0.6461565", "0.64222765", "0.6356866", "0.63562834", "0.6349354", "0.62561953", "0.62519723", "0.6238655", "0.6195329...
0.781777
0
test set display name own template as user saves
def test_set_display_name_own_template_as_user_saves(self): mock_request = create_mock_request(user=self.user1) template_api.set_display_name( self.fixture.user1_template, "new_name", request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_display_name_own_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superuser1)\n template_api.set_display_name(\n self.fixture.user1_template, \"new_name\", request=mock_request\n )", "def test_set_display_name_global_template_as_superu...
[ "0.8407966", "0.80694634", "0.8063102", "0.80549467", "0.7798652", "0.66668653", "0.6442892", "0.6430442", "0.64100146", "0.6407068", "0.6372801", "0.6296744", "0.62810963", "0.6225347", "0.62165725", "0.6200509", "0.614207", "0.6102368", "0.60813653", "0.606519", "0.6063235"...
0.85820955
0
test set display name other users template as user raises access control error
def test_set_display_name_other_users_template_as_user_raises_access_control_error( self, ): mock_request = create_mock_request(user=self.user1) with self.assertRaises(AccessControlError): template_api.set_display_name( self.fixture.user2_template, "new_name", request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_display_name_global_template_as_user_raises_access_control_error(\n self,\n ):\n mock_request = create_mock_request(user=self.user1)\n with self.assertRaises(AccessControlError):\n template_api.set_display_name(\n self.fixture.global_template, \"new_na...
[ "0.781667", "0.76295245", "0.7623421", "0.7554093", "0.7485875", "0.7380692", "0.7249136", "0.72226626", "0.7183608", "0.71021247", "0.690039", "0.68378454", "0.6738137", "0.6521974", "0.65130067", "0.64845836", "0.6419813", "0.6398974", "0.62798584", "0.6274754", "0.6272008"...
0.7761642
1
test set display name global template as user raises access control error
def test_set_display_name_global_template_as_user_raises_access_control_error( self, ): mock_request = create_mock_request(user=self.user1) with self.assertRaises(AccessControlError): template_api.set_display_name( self.fixture.global_template, "new_name", request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_display_name_global_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superuser1)\n template_api.set_display_name(\n self.fixture.global_template, \"new_name\", request=mock_request\n )", "def test_set_display_name_global_template_as_an...
[ "0.7700821", "0.74678564", "0.74317616", "0.73584545", "0.71953356", "0.717542", "0.71707886", "0.7160337", "0.7133445", "0.7056015", "0.7030654", "0.6843602", "0.64356554", "0.63337344", "0.63230735", "0.6301633", "0.62698174", "0.61883277", "0.60796994", "0.6052181", "0.602...
0.8097224
0
test set display name own template as staff saves
def test_set_display_name_own_template_as_staff_saves(self): mock_request = create_mock_request(user=self.staff_user1) template_api.set_display_name( self.fixture.user1_template, "new_name", request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_display_name_global_template_as_staff_saves(self):\n mock_request = create_mock_request(user=self.staff_user1)\n template_api.set_display_name(\n self.fixture.global_template, \"new_name\", request=mock_request\n )", "def test_set_display_name_own_template_as_superuse...
[ "0.81686586", "0.8027379", "0.7915645", "0.7679664", "0.7588453", "0.6449392", "0.63916004", "0.6336983", "0.62684387", "0.6225523", "0.6145685", "0.6063135", "0.5971488", "0.59581083", "0.59342474", "0.5905373", "0.58907783", "0.58565784", "0.5822107", "0.5810158", "0.579604...
0.83784217
0
test set display name other users template as staff raises access control error
def test_set_display_name_other_users_template_as_staff_raises_access_control_error( self, ): mock_request = create_mock_request(user=self.staff_user1) with self.assertRaises(AccessControlError): template_api.set_display_name( self.fixture.user2_template, "new_name", request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_display_name_global_template_as_user_raises_access_control_error(\n self,\n ):\n mock_request = create_mock_request(user=self.user1)\n with self.assertRaises(AccessControlError):\n template_api.set_display_name(\n self.fixture.global_template, \"new_na...
[ "0.7605984", "0.75114775", "0.7504308", "0.7466337", "0.73538816", "0.73237705", "0.72009385", "0.71532315", "0.7143435", "0.70679027", "0.7065211", "0.68900466", "0.6495203", "0.6303495", "0.62762886", "0.62031066", "0.61975324", "0.611186", "0.60808223", "0.6078109", "0.605...
0.7945389
0
test set display name global template as staff saves
def test_set_display_name_global_template_as_staff_saves(self): mock_request = create_mock_request(user=self.staff_user1) template_api.set_display_name( self.fixture.global_template, "new_name", request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_display_name_global_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superuser1)\n template_api.set_display_name(\n self.fixture.global_template, \"new_name\", request=mock_request\n )", "def test_set_display_name_own_template_as_staff...
[ "0.797732", "0.7899517", "0.7656996", "0.74912006", "0.7292097", "0.63268197", "0.63199025", "0.6077075", "0.60042024", "0.5964463", "0.5939839", "0.59352934", "0.5881993", "0.58463675", "0.5831961", "0.57987887", "0.5791329", "0.57893497", "0.5787537", "0.57783663", "0.57675...
0.83542955
0
test set display name own template as superuser saves
def test_set_display_name_own_template_as_superuser_saves(self): mock_request = create_mock_request(user=self.superuser1) template_api.set_display_name( self.fixture.user1_template, "new_name", request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_display_name_global_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superuser1)\n template_api.set_display_name(\n self.fixture.global_template, \"new_name\", request=mock_request\n )", "def test_set_display_name_other_users_template_...
[ "0.8438995", "0.83652455", "0.833537", "0.8102639", "0.78686064", "0.68850815", "0.68802756", "0.6551571", "0.6550452", "0.65084565", "0.6417714", "0.6282435", "0.6254965", "0.62019694", "0.6200222", "0.6199461", "0.6178686", "0.6174682", "0.61705583", "0.6166246", "0.6165622...
0.87443316
0
test set display name other users template as superuser saves
def test_set_display_name_other_users_template_as_superuser_saves(self): mock_request = create_mock_request(user=self.superuser1) template_api.set_display_name( self.fixture.user2_template, "new_name", request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_display_name_own_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superuser1)\n template_api.set_display_name(\n self.fixture.user1_template, \"new_name\", request=mock_request\n )", "def test_set_display_name_own_template_as_user_save...
[ "0.86954796", "0.84089637", "0.8315249", "0.81048167", "0.7789354", "0.68137443", "0.67180014", "0.671064", "0.66610336", "0.64608216", "0.64309955", "0.6357091", "0.6354265", "0.62896585", "0.6275033", "0.62726456", "0.6256851", "0.6253841", "0.6180666", "0.61602503", "0.615...
0.85619307
1
test set display name global template as superuser saves
def test_set_display_name_global_template_as_superuser_saves(self): mock_request = create_mock_request(user=self.superuser1) template_api.set_display_name( self.fixture.global_template, "new_name", request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_display_name_own_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superuser1)\n template_api.set_display_name(\n self.fixture.user1_template, \"new_name\", request=mock_request\n )", "def test_set_display_name_global_template_as_staff_...
[ "0.8349105", "0.8043521", "0.803114", "0.78980434", "0.76408404", "0.6944795", "0.6716076", "0.63315207", "0.6187099", "0.6185814", "0.6185624", "0.6144165", "0.6111398", "0.6052481", "0.6048025", "0.6025103", "0.6016196", "0.60104704", "0.59897846", "0.5963223", "0.59628075"...
0.8690469
0
test get user template as anonymous raises access control error
def test_get_user_template_as_anonymous_raises_access_control_error(self): mock_request = create_mock_request(user=self.anonymous_user) with self.assertRaises(AccessControlError): template_api.get_by_id( self.fixture.user1_template.id, request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_global_template_as_anonymous_with_access_right_returns_template(\n self,\n ):\n mock_request = create_mock_request(user=self.anonymous_user)\n template = template_api.get_by_id(\n self.fixture.global_template.id, request=mock_request\n )\n self.assertEq...
[ "0.7613135", "0.7530476", "0.74307054", "0.7373814", "0.7083884", "0.70543534", "0.68818855", "0.68209565", "0.6811224", "0.6782865", "0.67101246", "0.6708908", "0.6702115", "0.6648804", "0.6645128", "0.6643842", "0.6637662", "0.66228014", "0.6600431", "0.6600431", "0.6591543...
0.771759
0
test get user template as anonymous with access right raises access control error
def test_get_user_template_as_anonymous_with_access_right_raises_access_control_error( self, ): mock_request = create_mock_request(user=self.anonymous_user) with self.assertRaises(AccessControlError): template_api.get_by_id( self.fixture.user1_template.id, request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_user_template_as_anonymous_raises_access_control_error(self):\n mock_request = create_mock_request(user=self.anonymous_user)\n with self.assertRaises(AccessControlError):\n template_api.get_by_id(\n self.fixture.user1_template.id, request=mock_request\n ...
[ "0.7802844", "0.761705", "0.74833226", "0.7385939", "0.73700815", "0.71119964", "0.7104591", "0.7072025", "0.70250964", "0.69441444", "0.69394386", "0.6929122", "0.6896489", "0.6861342", "0.6857833", "0.68518734", "0.68487626", "0.6787184", "0.67862386", "0.67814267", "0.6779...
0.7892447
0
test get global template as anonymous raises access control error
def test_get_global_template_as_anonymous_raises_access_control_error( self, ): mock_request = create_mock_request(user=self.anonymous_user) with self.assertRaises(AccessControlError): template_api.get_by_id( self.fixture.global_template.id, request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_global_template_as_anonymous_with_access_right_returns_template(\n self,\n ):\n mock_request = create_mock_request(user=self.anonymous_user)\n template = template_api.get_by_id(\n self.fixture.global_template.id, request=mock_request\n )\n self.assertEq...
[ "0.785796", "0.71265125", "0.6954985", "0.68960994", "0.6858321", "0.6774985", "0.6732087", "0.6653357", "0.6604685", "0.6559678", "0.65291065", "0.6520919", "0.6491397", "0.64557844", "0.6435501", "0.6425238", "0.6417766", "0.64098907", "0.6396767", "0.6332146", "0.63056093"...
0.71931285
1
test get global template as anonymous with access right returns template
def test_get_global_template_as_anonymous_with_access_right_returns_template( self, ): mock_request = create_mock_request(user=self.anonymous_user) template = template_api.get_by_id( self.fixture.global_template.id, request=mock_request ) self.assertEqual(template, self.fixture.global_template)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_register_template(self):\n pass", "def test_template(self):\n\t\tself.assertTemplateUsed(self.resp, 'inicio.html')", "def test_global_template_as_user_returns_template(self):\n mock_request = create_mock_request(user=self.user1)\n template = template_api.get_by_id(\n se...
[ "0.70452297", "0.6979728", "0.6953223", "0.6897253", "0.6785385", "0.67305106", "0.6662983", "0.6630868", "0.6611546", "0.6584987", "0.64204043", "0.6409127", "0.6400355", "0.63896936", "0.6384356", "0.6382421", "0.63582236", "0.63414955", "0.6315141", "0.63053435", "0.630063...
0.7544306
0
test get own template as user returns template
def test_get_own_template_as_user_returns_template(self): mock_request = create_mock_request(user=self.user1) template = template_api.get_by_id( self.fixture.user1_template.id, request=mock_request ) self.assertEqual(template, self.fixture.user1_template)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_global_template_as_user_returns_template(self):\n mock_request = create_mock_request(user=self.user1)\n template = template_api.get_by_id(\n self.fixture.global_template.id, request=mock_request\n )\n self.assertEqual(template, self.fixture.global_template)", "def ...
[ "0.7584183", "0.7570242", "0.72331774", "0.70984966", "0.7098218", "0.7063988", "0.7001504", "0.6864687", "0.68602484", "0.68589157", "0.68428886", "0.683652", "0.6823558", "0.6793858", "0.678562", "0.6754005", "0.67517126", "0.6653689", "0.6648483", "0.663962", "0.6636065", ...
0.804826
0
test global template as user returns template
def test_global_template_as_user_returns_template(self): mock_request = create_mock_request(user=self.user1) template = template_api.get_by_id( self.fixture.global_template.id, request=mock_request ) self.assertEqual(template, self.fixture.global_template)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_template(self):\n\t\tself.assertTemplateUsed(self.resp, 'inicio.html')", "def test_for_template(self):\n self.assertTemplateUsed(self.response, 'my_info_template.html')", "def test_register_template(self):\n pass", "def test_correct_template(self):\n self.assertCorrectTemplateUs...
[ "0.7413665", "0.71893036", "0.71573037", "0.7118237", "0.70851064", "0.70015204", "0.70013285", "0.69383097", "0.69311833", "0.6842954", "0.6815864", "0.6794427", "0.675918", "0.67283905", "0.67238855", "0.67194635", "0.67149615", "0.66608965", "0.66568184", "0.6656136", "0.6...
0.783242
0
test get other users template raises access control error
def test_get_other_users_template_raises_access_control_error(self): mock_request = create_mock_request(user=self.user1) with self.assertRaises(AccessControlError): template_api.get_by_id( self.fixture.user2_template.id, request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_other_users_template_as_staff_raises_access_control_error(\n self,\n ):\n mock_request = create_mock_request(user=self.staff_user1)\n with self.assertRaises(AccessControlError):\n template_api.get_by_id(\n self.fixture.user2_template.id, request=mock_r...
[ "0.77614397", "0.744975", "0.7427578", "0.74270964", "0.73795503", "0.7345958", "0.7273537", "0.71408963", "0.70783716", "0.70651674", "0.7050977", "0.7047117", "0.7017474", "0.6984865", "0.69814235", "0.6955635", "0.69546133", "0.6926745", "0.691739", "0.68871033", "0.688575...
0.7893574
0
test get any template as superuser returns template
def test_get_any_template_as_superuser_returns_template(self): mock_request = create_mock_request(user=self.superuser1) template = template_api.get_by_id( self.fixture.user1_template.id, request=mock_request ) self.assertEqual(template, self.fixture.user1_template) template = template_api.get_by_id( self.fixture.user2_template.id, request=mock_request ) self.assertEqual(template, self.fixture.user2_template) template = template_api.get_by_id( self.fixture.global_template.id, request=mock_request ) self.assertEqual(template, self.fixture.global_template)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_own_template_as_user_returns_template(self):\n mock_request = create_mock_request(user=self.user1)\n template = template_api.get_by_id(\n self.fixture.user1_template.id, request=mock_request\n )\n self.assertEqual(template, self.fixture.user1_template)", "def t...
[ "0.7339057", "0.7293115", "0.72650164", "0.7177737", "0.71384394", "0.7035053", "0.69855136", "0.6984406", "0.69122374", "0.68956125", "0.6870337", "0.6849097", "0.68091345", "0.6803988", "0.6782561", "0.6699082", "0.6676653", "0.66753626", "0.6625917", "0.6607886", "0.659822...
0.8227463
0
test get other users template as staff raises access control error
def test_get_other_users_template_as_staff_raises_access_control_error( self, ): mock_request = create_mock_request(user=self.staff_user1) with self.assertRaises(AccessControlError): template_api.get_by_id( self.fixture.user2_template.id, request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_as_staff_returns_accessible_templates(self):\n mock_request = create_mock_request(user=self.staff_user)\n templates = template_api.get_all(request=mock_request)\n self.assertEqual(templates.count(), 2)\n self.assertTrue(self.fixture.user2_template in list(templates))\n ...
[ "0.7629151", "0.7563176", "0.7399048", "0.7349483", "0.7239654", "0.72377974", "0.71758187", "0.7138686", "0.7097173", "0.70346177", "0.69860995", "0.69852465", "0.6982948", "0.6961766", "0.69112176", "0.68938357", "0.6879274", "0.68733513", "0.68609065", "0.6852134", "0.6851...
0.7947971
0
test get all accessible by id list as anonymous returns nothing
def test_get_all_accessible_by_id_list_as_anonymous_returns_nothing(self): mock_request = create_mock_request(user=self.anonymous_user) templates = template_api.get_all_accessible_by_id_list( self.template_id_list, request=mock_request ) self.assertTrue(templates.count() == 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_id_list_as_anonymous_with_access_right_returns_global(\n self,\n ):\n mock_request = create_mock_request(user=self.anonymous_user)\n templates = template_api.get_all_accessible_by_id_list(\n self.template_id_list, request=mock_request\n )\n ...
[ "0.74108243", "0.7218916", "0.7095176", "0.6977002", "0.6941707", "0.6903757", "0.6736606", "0.6606887", "0.654868", "0.6507004", "0.65024054", "0.6487888", "0.6467911", "0.6464067", "0.6455423", "0.64462674", "0.644377", "0.6441207", "0.6408167", "0.6408167", "0.6405006", ...
0.71609604
2
test get all accessible by id list as anonymous with access right returns global templates
def test_get_all_accessible_by_id_list_as_anonymous_with_access_right_returns_global( self, ): mock_request = create_mock_request(user=self.anonymous_user) templates = template_api.get_all_accessible_by_id_list( self.template_id_list, request=mock_request ) self.assertTrue(templates.count() == 1) self.assertTrue((template.user is None for template in templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_id_list_as_user_returns_accessible_templates(\n self,\n ):\n mock_request = create_mock_request(user=self.user1)\n templates = template_api.get_all_accessible_by_id_list(\n self.template_id_list, request=mock_request\n )\n self.assertT...
[ "0.75560033", "0.75290406", "0.7349411", "0.71881044", "0.70972097", "0.6940075", "0.69113445", "0.68346006", "0.6807609", "0.67567873", "0.67490506", "0.6680727", "0.66481215", "0.66181475", "0.6607167", "0.6567508", "0.65569216", "0.6528255", "0.65148836", "0.650462", "0.65...
0.752714
2
test get all accessible by id list as user returns accessible templates
def test_get_all_accessible_by_id_list_as_user_returns_accessible_templates( self, ): mock_request = create_mock_request(user=self.user1) templates = template_api.get_all_accessible_by_id_list( self.template_id_list, request=mock_request ) self.assertTrue(self.fixture.user1_template in list(templates)) self.assertTrue(self.fixture.user2_template not in list(templates)) self.assertTrue(self.fixture.global_template in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_id_list_as_superuser_returns_accessible_templates(\n self,\n ):\n mock_request = create_mock_request(user=self.superuser1)\n templates = template_api.get_all_accessible_by_id_list(\n self.template_id_list, request=mock_request\n )\n se...
[ "0.8352081", "0.80351096", "0.79949486", "0.7815422", "0.7592258", "0.7508703", "0.74799454", "0.74594754", "0.73707", "0.73137105", "0.7222853", "0.72029865", "0.7198696", "0.7193153", "0.7169572", "0.71223384", "0.7113321", "0.7107858", "0.7107429", "0.7094072", "0.7044061"...
0.8439678
0
test get all accessible by id list as staff returns accessible templates
def test_get_all_accessible_by_id_list_as_staff_returns_accessible_templates( self, ): mock_request = create_mock_request(user=self.staff_user1) templates = template_api.get_all_accessible_by_id_list( self.template_id_list, request=mock_request ) self.assertTrue(self.fixture.user1_template in list(templates)) self.assertTrue(self.fixture.user2_template not in list(templates)) self.assertTrue(self.fixture.global_template in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_id_list_as_superuser_returns_accessible_templates(\n self,\n ):\n mock_request = create_mock_request(user=self.superuser1)\n templates = template_api.get_all_accessible_by_id_list(\n self.template_id_list, request=mock_request\n )\n se...
[ "0.82006174", "0.8090239", "0.77482426", "0.75997865", "0.7364636", "0.7320834", "0.7100239", "0.709316", "0.70638084", "0.6977362", "0.6968302", "0.6900248", "0.6848204", "0.68399364", "0.6752305", "0.67282224", "0.66968644", "0.6675989", "0.6672316", "0.6604715", "0.6595715...
0.8391006
0
test get all accessible by id list as superuser returns accessible templates
def test_get_all_accessible_by_id_list_as_superuser_returns_accessible_templates( self, ): mock_request = create_mock_request(user=self.superuser1) templates = template_api.get_all_accessible_by_id_list( self.template_id_list, request=mock_request ) self.assertTrue(self.fixture.user1_template in list(templates)) self.assertTrue(self.fixture.user2_template in list(templates)) self.assertTrue(self.fixture.global_template in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_id_list_as_user_returns_accessible_templates(\n self,\n ):\n mock_request = create_mock_request(user=self.user1)\n templates = template_api.get_all_accessible_by_id_list(\n self.template_id_list, request=mock_request\n )\n self.assertT...
[ "0.8283416", "0.8071495", "0.7812368", "0.7686281", "0.7590276", "0.7461408", "0.73253256", "0.7286531", "0.72477025", "0.7221876", "0.7189584", "0.7163987", "0.71550506", "0.7076607", "0.70374113", "0.7007362", "0.6996137", "0.6994254", "0.69909936", "0.6976883", "0.6971435"...
0.848242
0
test get all accessible by hash as anonymous does not return user template
def test_get_all_accessible_by_hash_as_anonymous_does_not_return_user_template( self, ): mock_request = create_mock_request(user=self.anonymous_user) templates = template_api.get_all_accessible_by_hash( self.fixture.user1_template.hash, request=mock_request ) self.assertTrue(templates.count() == 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_as_user_returns_user_template(self):\n mock_request = create_mock_request(user=self.user1)\n templates = template_api.get_all_accessible_by_hash(\n self.fixture.user1_template.hash, request=mock_request\n )\n self.assertTrue(self.fixture.us...
[ "0.80172676", "0.7937047", "0.7907952", "0.7905969", "0.79036736", "0.7874299", "0.7779281", "0.77539563", "0.7734347", "0.77325165", "0.76254964", "0.76121986", "0.7606683", "0.75812936", "0.75789034", "0.7533555", "0.7507001", "0.7425464", "0.73729914", "0.7359555", "0.7350...
0.7916702
2
test get all accessible by hash as anonymous with access right does not return user template
def test_get_all_accessible_by_hash_as_anonymous_with_access_right_does_not_return_user_template( self, ): mock_request = create_mock_request(user=self.anonymous_user) templates = template_api.get_all_accessible_by_hash( self.fixture.user1_template.hash, request=mock_request ) self.assertTrue(templates.count() == 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_as_user_returns_user_template(self):\n mock_request = create_mock_request(user=self.user1)\n templates = template_api.get_all_accessible_by_hash(\n self.fixture.user1_template.hash, request=mock_request\n )\n self.assertTrue(self.fixture.us...
[ "0.8095653", "0.806779", "0.80041444", "0.7907132", "0.78913945", "0.7886816", "0.78815126", "0.78513587", "0.7806266", "0.78028685", "0.77374506", "0.7678337", "0.7658116", "0.7651516", "0.764455", "0.76145715", "0.76107323", "0.75198156", "0.74943686", "0.74373174", "0.7349...
0.8092452
1
test get all accessible by hash as anonymous does not return global
def test_get_all_accessible_by_hash_as_anonymous_does_not_return_global( self, ): mock_request = create_mock_request(user=self.anonymous_user) templates = template_api.get_all_accessible_by_hash( self.fixture.global_template.hash, request=mock_request ) self.assertTrue(templates.count() == 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_as_anonymous_with_access_right_returns_global(\n self,\n ):\n mock_request = create_mock_request(user=self.anonymous_user)\n templates = template_api.get_all_accessible_by_hash(\n self.fixture.global_template.hash, request=mock_request\n ...
[ "0.7186973", "0.70824915", "0.6819187", "0.6701289", "0.66058564", "0.6546757", "0.64949095", "0.6421599", "0.63181055", "0.6198875", "0.61463547", "0.61446923", "0.6063643", "0.60409874", "0.60354984", "0.6020386", "0.5990515", "0.59506804", "0.5919397", "0.5897121", "0.5814...
0.6903833
2
test get all accessible by hash as anonymous with access right returns global
def test_get_all_accessible_by_hash_as_anonymous_with_access_right_returns_global( self, ): mock_request = create_mock_request(user=self.anonymous_user) templates = template_api.get_all_accessible_by_hash( self.fixture.global_template.hash, request=mock_request ) self.assertTrue(templates.count() == 1) self.assertTrue((template.user is None for template in templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_list_as_anonymous_with_access_right_returns_global(\n self,\n ):\n mock_request = create_mock_request(user=self.anonymous_user)\n templates = template_api.get_all_accessible_by_hash_list(\n [self.fixture.global_template.hash], request=mock_requ...
[ "0.73483837", "0.689207", "0.67723614", "0.670583", "0.6545129", "0.65434605", "0.6489687", "0.6428047", "0.6337772", "0.6308074", "0.62926304", "0.6243798", "0.62265044", "0.6103865", "0.60600764", "0.59886754", "0.5965506", "0.5956311", "0.58755183", "0.5861098", "0.5853029...
0.74907875
0
test get all accessible by hash as user returns user template
def test_get_all_accessible_by_hash_as_user_returns_user_template(self): mock_request = create_mock_request(user=self.user1) templates = template_api.get_all_accessible_by_hash( self.fixture.user1_template.hash, request=mock_request ) self.assertTrue(self.fixture.user1_template in list(templates)) self.assertTrue(self.fixture.user2_template not in list(templates)) self.assertTrue(self.fixture.global_template not in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_list_as_user_returns_user_template(\n self,\n ):\n mock_request = create_mock_request(user=self.user1)\n templates = template_api.get_all_accessible_by_hash_list(\n [self.fixture.user1_template.hash], request=mock_request\n )\n se...
[ "0.8098597", "0.8081005", "0.7892589", "0.78061783", "0.7657671", "0.7553108", "0.75217694", "0.7494131", "0.74738395", "0.7454518", "0.74189186", "0.7417", "0.7356148", "0.7336483", "0.7324792", "0.7279816", "0.72666675", "0.709681", "0.70890576", "0.7072468", "0.70683414", ...
0.82444835
0
test get all accessible by hash as user returns global template
def test_get_all_accessible_by_hash_as_user_returns_global_template(self): mock_request = create_mock_request(user=self.user1) templates = template_api.get_all_accessible_by_hash( self.fixture.global_template.hash, request=mock_request ) self.assertTrue(self.fixture.user1_template not in list(templates)) self.assertTrue(self.fixture.user2_template not in list(templates)) self.assertTrue(self.fixture.global_template in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_as_superuser_returns_global_template(\n self,\n ):\n mock_request = create_mock_request(user=self.superuser1)\n templates = template_api.get_all_accessible_by_hash(\n self.fixture.global_template.hash, request=mock_request\n )\n s...
[ "0.78114414", "0.7711554", "0.7618051", "0.7576764", "0.7534922", "0.7504542", "0.7402011", "0.7372285", "0.7325458", "0.73088026", "0.72421944", "0.7232947", "0.7059146", "0.69722897", "0.6888439", "0.6876363", "0.6872592", "0.6841043", "0.6835622", "0.6817873", "0.6812515",...
0.78586036
0
test get all accessible by hash as user does not return other user template
def test_get_all_accessible_by_hash_as_user_does_not_return_other_user_template( self, ): mock_request = create_mock_request(user=self.user1) templates = template_api.get_all_accessible_by_hash( self.fixture.user2_template.hash, request=mock_request ) self.assertTrue(templates.count() == 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_as_user_returns_user_template(self):\n mock_request = create_mock_request(user=self.user1)\n templates = template_api.get_all_accessible_by_hash(\n self.fixture.user1_template.hash, request=mock_request\n )\n self.assertTrue(self.fixture.us...
[ "0.84269166", "0.8356634", "0.83093095", "0.8207403", "0.8082889", "0.8067202", "0.80068207", "0.79930574", "0.7940121", "0.7922761", "0.7897936", "0.78952146", "0.7869671", "0.78512174", "0.7787594", "0.77622443", "0.77589107", "0.7726831", "0.7599282", "0.75981784", "0.7555...
0.8051987
6
test get all accessible by hash as staff returns user template
def test_get_all_accessible_by_hash_as_staff_returns_user_template(self): mock_request = create_mock_request(user=self.staff_user1) templates = template_api.get_all_accessible_by_hash( self.fixture.user1_template.hash, request=mock_request ) self.assertTrue(self.fixture.user1_template in list(templates)) self.assertTrue(self.fixture.user2_template not in list(templates)) self.assertTrue(self.fixture.global_template not in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_list_as_staff_returns_user_template(\n self,\n ):\n mock_request = create_mock_request(user=self.staff_user1)\n templates = template_api.get_all_accessible_by_hash_list(\n [self.fixture.user1_template.hash], request=mock_request\n )\n ...
[ "0.8139061", "0.8013623", "0.7913836", "0.79138297", "0.78755826", "0.76368785", "0.7610415", "0.7501855", "0.74841386", "0.748", "0.7479454", "0.7447994", "0.7435938", "0.7394545", "0.7359369", "0.7324257", "0.7323782", "0.730924", "0.73041713", "0.727378", "0.7266767", "0...
0.8235352
0
test get all accessible by hash as staff returns global template
def test_get_all_accessible_by_hash_as_staff_returns_global_template(self): mock_request = create_mock_request(user=self.staff_user1) templates = template_api.get_all_accessible_by_hash( self.fixture.global_template.hash, request=mock_request ) self.assertTrue(self.fixture.user1_template not in list(templates)) self.assertTrue(self.fixture.user2_template not in list(templates)) self.assertTrue(self.fixture.global_template in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_as_superuser_returns_global_template(\n self,\n ):\n mock_request = create_mock_request(user=self.superuser1)\n templates = template_api.get_all_accessible_by_hash(\n self.fixture.global_template.hash, request=mock_request\n )\n s...
[ "0.7497486", "0.74746835", "0.7385293", "0.7356151", "0.73261195", "0.72790205", "0.7225152", "0.71621686", "0.7087019", "0.7080861", "0.7057837", "0.7043345", "0.6963795", "0.678838", "0.66819537", "0.6676437", "0.6665664", "0.66606534", "0.66260237", "0.65794927", "0.655635...
0.7554428
0
test get all accessible by hash as staff does not return other user template
def test_get_all_accessible_by_hash_as_staff_does_not_return_other_user_template( self, ): mock_request = create_mock_request(user=self.staff_user1) templates = template_api.get_all_accessible_by_hash( self.fixture.user2_template.hash, request=mock_request ) self.assertTrue(self.fixture.user1_template not in list(templates)) self.assertTrue(self.fixture.user2_template not in list(templates)) self.assertTrue(self.fixture.global_template not in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_as_staff_returns_user_template(self):\n mock_request = create_mock_request(user=self.staff_user1)\n templates = template_api.get_all_accessible_by_hash(\n self.fixture.user1_template.hash, request=mock_request\n )\n self.assertTrue(self.fix...
[ "0.83113414", "0.8248382", "0.8113174", "0.8065866", "0.80072796", "0.8006467", "0.7896942", "0.7854703", "0.7817707", "0.7777212", "0.77717024", "0.77562374", "0.77497375", "0.77311224", "0.7694255", "0.7679565", "0.767091", "0.7662992", "0.765241", "0.7650245", "0.75124454"...
0.7799258
9
test get all accessible by hash as superuser returns user template
def test_get_all_accessible_by_hash_as_superuser_returns_user_template( self, ): mock_request = create_mock_request(user=self.superuser1) templates = template_api.get_all_accessible_by_hash( self.fixture.user1_template.hash, request=mock_request ) self.assertTrue(self.fixture.user1_template in list(templates)) self.assertTrue(self.fixture.user2_template not in list(templates)) self.assertTrue(self.fixture.global_template not in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_list_as_superuser_returns_user_template(\n self,\n ):\n mock_request = create_mock_request(user=self.superuser1)\n templates = template_api.get_all_accessible_by_hash_list(\n [self.fixture.user1_template.hash], request=mock_request\n )\n...
[ "0.8170202", "0.80604655", "0.7951915", "0.7856463", "0.7822592", "0.7790313", "0.7743123", "0.7713884", "0.76898307", "0.7519109", "0.74388695", "0.74056834", "0.7391", "0.7362122", "0.72886634", "0.72467566", "0.72302586", "0.72219735", "0.7183007", "0.7155218", "0.7108288"...
0.8338196
0
test get all accessible by hash as superuser returns global template
def test_get_all_accessible_by_hash_as_superuser_returns_global_template( self, ): mock_request = create_mock_request(user=self.superuser1) templates = template_api.get_all_accessible_by_hash( self.fixture.global_template.hash, request=mock_request ) self.assertTrue(self.fixture.user1_template not in list(templates)) self.assertTrue(self.fixture.user2_template not in list(templates)) self.assertTrue(self.fixture.global_template in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_list_as_superuser_returns_global_template(\n self,\n ):\n mock_request = create_mock_request(user=self.superuser1)\n templates = template_api.get_all_accessible_by_hash_list(\n [self.fixture.global_template.hash], request=mock_request\n ...
[ "0.7841484", "0.779551", "0.7761922", "0.76789105", "0.7675325", "0.75503117", "0.75284576", "0.75161767", "0.7387159", "0.73823154", "0.73564553", "0.73227084", "0.72829455", "0.716237", "0.7129225", "0.7032054", "0.69710624", "0.6944363", "0.68697715", "0.68558455", "0.6848...
0.80500853
0
test get all accessible by hash as superuser returns other user template
def test_get_all_accessible_by_hash_as_superuser_returns_other_user_template( self, ): mock_request = create_mock_request(user=self.superuser1) templates = template_api.get_all_accessible_by_hash( self.fixture.user2_template.hash, request=mock_request ) self.assertTrue(self.fixture.user1_template not in list(templates)) self.assertTrue(self.fixture.user2_template in list(templates)) self.assertTrue(self.fixture.global_template not in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_as_superuser_returns_user_template(\n self,\n ):\n mock_request = create_mock_request(user=self.superuser1)\n templates = template_api.get_all_accessible_by_hash(\n self.fixture.user1_template.hash, request=mock_request\n )\n self...
[ "0.8378936", "0.8234893", "0.8140387", "0.80538225", "0.79767466", "0.7974775", "0.7905775", "0.7855361", "0.7829341", "0.77053833", "0.7695837", "0.7691782", "0.764703", "0.76229084", "0.7555069", "0.7475856", "0.7469807", "0.7433224", "0.74103886", "0.7379986", "0.7342608",...
0.804135
4
test get all accessible by hash list as anonymous does not return user template
def test_get_all_accessible_by_hash_list_as_anonymous_does_not_return_user_template( self, ): mock_request = create_mock_request(user=self.anonymous_user) templates = template_api.get_all_accessible_by_hash_list( [self.fixture.user1_template.hash], request=mock_request ) self.assertTrue(templates.count() == 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_list_as_user_returns_user_template(\n self,\n ):\n mock_request = create_mock_request(user=self.user1)\n templates = template_api.get_all_accessible_by_hash_list(\n [self.fixture.user1_template.hash], request=mock_request\n )\n se...
[ "0.8170272", "0.8069623", "0.80037946", "0.79029936", "0.78638375", "0.7856718", "0.78383523", "0.78319883", "0.7748527", "0.7714406", "0.76511997", "0.7633952", "0.76183724", "0.7606496", "0.75695086", "0.7505993", "0.74550956", "0.74511474", "0.7416829", "0.73735476", "0.72...
0.80258995
2
test get all accessible by hash list as anonymous with access right does not return user template
def test_get_all_accessible_by_hash_list_as_anonymous_with_access_right_does_not_return_user_template( self, ): mock_request = create_mock_request(user=self.anonymous_user) templates = template_api.get_all_accessible_by_hash_list( [self.fixture.user1_template.hash], request=mock_request ) self.assertTrue(templates.count() == 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_list_as_user_returns_user_template(\n self,\n ):\n mock_request = create_mock_request(user=self.user1)\n templates = template_api.get_all_accessible_by_hash_list(\n [self.fixture.user1_template.hash], request=mock_request\n )\n se...
[ "0.82188314", "0.81064343", "0.80074686", "0.7999916", "0.7974573", "0.794547", "0.7922802", "0.7900087", "0.7856008", "0.7839907", "0.7780824", "0.77454853", "0.7712532", "0.76505816", "0.76493615", "0.76412743", "0.75517875", "0.7539482", "0.7521282", "0.7480579", "0.743073...
0.81870437
1
test get all accessible by hash list as anonymous does not return global
def test_get_all_accessible_by_hash_list_as_anonymous_does_not_return_global( self, ): mock_request = create_mock_request(user=self.anonymous_user) templates = template_api.get_all_accessible_by_hash_list( [self.fixture.global_template.hash], request=mock_request ) self.assertTrue(templates.count() == 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_list_as_anonymous_with_access_right_returns_global(\n self,\n ):\n mock_request = create_mock_request(user=self.anonymous_user)\n templates = template_api.get_all_accessible_by_hash_list(\n [self.fixture.global_template.hash], request=mock_requ...
[ "0.72003764", "0.6906085", "0.682766", "0.6713539", "0.6642761", "0.6638915", "0.6523141", "0.6474281", "0.6390187", "0.6310114", "0.6268782", "0.6232631", "0.6226728", "0.6178704", "0.6056042", "0.60132897", "0.6012866", "0.5999089", "0.5983888", "0.59816855", "0.5979013", ...
0.70168906
1
test get all accessible by hash list as anonymous with access right returns global
def test_get_all_accessible_by_hash_list_as_anonymous_with_access_right_returns_global( self, ): mock_request = create_mock_request(user=self.anonymous_user) templates = template_api.get_all_accessible_by_hash_list( [self.fixture.global_template.hash], request=mock_request ) self.assertTrue(templates.count() == 1) self.assertTrue((template.user is None for template in templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_as_anonymous_with_access_right_returns_global(\n self,\n ):\n mock_request = create_mock_request(user=self.anonymous_user)\n templates = template_api.get_all_accessible_by_hash(\n self.fixture.global_template.hash, request=mock_request\n ...
[ "0.72204554", "0.6992188", "0.69133", "0.67211556", "0.6717264", "0.66367173", "0.6608304", "0.6528222", "0.6494193", "0.6466781", "0.63778913", "0.634835", "0.6266997", "0.6256954", "0.6207588", "0.6187965", "0.6110008", "0.6073582", "0.6053851", "0.60277724", "0.5977818", ...
0.7492252
0
test get all accessible by hash list as user returns user template
def test_get_all_accessible_by_hash_list_as_user_returns_user_template( self, ): mock_request = create_mock_request(user=self.user1) templates = template_api.get_all_accessible_by_hash_list( [self.fixture.user1_template.hash], request=mock_request ) self.assertTrue(self.fixture.user1_template in list(templates)) self.assertTrue(self.fixture.user2_template not in list(templates)) self.assertTrue(self.fixture.global_template not in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_list_as_superuser_returns_user_template(\n self,\n ):\n mock_request = create_mock_request(user=self.superuser1)\n templates = template_api.get_all_accessible_by_hash_list(\n [self.fixture.user1_template.hash], request=mock_request\n )\n...
[ "0.8133613", "0.8025096", "0.79555947", "0.7924744", "0.77753305", "0.77026737", "0.75754946", "0.7567176", "0.7559033", "0.75048995", "0.7476242", "0.7378073", "0.73105985", "0.73017", "0.72951525", "0.72721916", "0.7231697", "0.7122126", "0.70607495", "0.7040041", "0.702032...
0.8334091
0
test get all accessible by hash list as user returns global template
def test_get_all_accessible_by_hash_list_as_user_returns_global_template( self, ): mock_request = create_mock_request(user=self.user1) templates = template_api.get_all_accessible_by_hash_list( [self.fixture.global_template.hash], request=mock_request ) self.assertTrue(self.fixture.user1_template not in list(templates)) self.assertTrue(self.fixture.user2_template not in list(templates)) self.assertTrue(self.fixture.global_template in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_list_as_superuser_returns_global_template(\n self,\n ):\n mock_request = create_mock_request(user=self.superuser1)\n templates = template_api.get_all_accessible_by_hash_list(\n [self.fixture.global_template.hash], request=mock_request\n ...
[ "0.7817108", "0.7674833", "0.76448846", "0.7635715", "0.76171523", "0.7548915", "0.7494546", "0.74614096", "0.7423985", "0.7415341", "0.7338782", "0.7198786", "0.7194994", "0.7095257", "0.7054384", "0.7039704", "0.70117605", "0.6924233", "0.69152415", "0.68132144", "0.6760775...
0.792674
0
test get all accessible by hash list as user does not return other user template
def test_get_all_accessible_by_hash_list_as_user_does_not_return_other_user_template( self, ): mock_request = create_mock_request(user=self.user1) templates = template_api.get_all_accessible_by_hash_list( [self.fixture.user2_template.hash], request=mock_request ) self.assertTrue(templates.count() == 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_list_as_user_returns_user_template(\n self,\n ):\n mock_request = create_mock_request(user=self.user1)\n templates = template_api.get_all_accessible_by_hash_list(\n [self.fixture.user1_template.hash], request=mock_request\n )\n se...
[ "0.8485379", "0.8347401", "0.8181866", "0.81092024", "0.80731285", "0.8048656", "0.80484575", "0.7970304", "0.79620904", "0.79137564", "0.7874443", "0.77952415", "0.7767016", "0.7719269", "0.7665876", "0.76334447", "0.758448", "0.7569724", "0.7550702", "0.7447979", "0.7423274...
0.81236255
3
test get all accessible by hash list as staff returns user template
def test_get_all_accessible_by_hash_list_as_staff_returns_user_template( self, ): mock_request = create_mock_request(user=self.staff_user1) templates = template_api.get_all_accessible_by_hash_list( [self.fixture.user1_template.hash], request=mock_request ) self.assertTrue(self.fixture.user1_template in list(templates)) self.assertTrue(self.fixture.user2_template not in list(templates)) self.assertTrue(self.fixture.global_template not in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_list_as_user_returns_user_template(\n self,\n ):\n mock_request = create_mock_request(user=self.user1)\n templates = template_api.get_all_accessible_by_hash_list(\n [self.fixture.user1_template.hash], request=mock_request\n )\n se...
[ "0.81351954", "0.8133138", "0.8092263", "0.78858453", "0.7810828", "0.7779971", "0.7641144", "0.7626335", "0.7617192", "0.76108444", "0.74905986", "0.74905354", "0.747804", "0.7434959", "0.7407873", "0.732234", "0.7317942", "0.7250191", "0.71803576", "0.7138569", "0.70978194"...
0.83508813
0
test get all accessible by hash list as staff returns global template
def test_get_all_accessible_by_hash_list_as_staff_returns_global_template( self, ): mock_request = create_mock_request(user=self.staff_user1) templates = template_api.get_all_accessible_by_hash_list( [self.fixture.global_template.hash], request=mock_request ) self.assertTrue(self.fixture.user1_template not in list(templates)) self.assertTrue(self.fixture.user2_template not in list(templates)) self.assertTrue(self.fixture.global_template in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_list_as_superuser_returns_global_template(\n self,\n ):\n mock_request = create_mock_request(user=self.superuser1)\n templates = template_api.get_all_accessible_by_hash_list(\n [self.fixture.global_template.hash], request=mock_request\n ...
[ "0.7654985", "0.7619861", "0.7532686", "0.75176096", "0.7428983", "0.7404091", "0.7361139", "0.7338509", "0.7328727", "0.7255129", "0.72190326", "0.71115243", "0.69764596", "0.69752246", "0.6954954", "0.69451195", "0.6886439", "0.68627393", "0.6745489", "0.67304397", "0.66975...
0.78305656
0
test get all accessible by hash list as staff does not return other user template
def test_get_all_accessible_by_hash_list_as_staff_does_not_return_other_user_template( self, ): mock_request = create_mock_request(user=self.staff_user1) templates = template_api.get_all_accessible_by_hash_list( [self.fixture.user2_template.hash], request=mock_request ) self.assertTrue(self.fixture.user1_template not in list(templates)) self.assertTrue(self.fixture.user2_template not in list(templates)) self.assertTrue(self.fixture.global_template not in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_list_as_staff_returns_user_template(\n self,\n ):\n mock_request = create_mock_request(user=self.staff_user1)\n templates = template_api.get_all_accessible_by_hash_list(\n [self.fixture.user1_template.hash], request=mock_request\n )\n ...
[ "0.84242386", "0.8222785", "0.81769013", "0.81235266", "0.80320036", "0.7960081", "0.7905466", "0.7860168", "0.7859235", "0.7826994", "0.7805078", "0.77982324", "0.77720755", "0.7750339", "0.76392996", "0.7616756", "0.75052553", "0.7466555", "0.74498755", "0.7411773", "0.7290...
0.78833604
7
test get all accessible by hash list as superuser returns user template
def test_get_all_accessible_by_hash_list_as_superuser_returns_user_template( self, ): mock_request = create_mock_request(user=self.superuser1) templates = template_api.get_all_accessible_by_hash_list( [self.fixture.user1_template.hash], request=mock_request ) self.assertTrue(self.fixture.user1_template in list(templates)) self.assertTrue(self.fixture.user2_template not in list(templates)) self.assertTrue(self.fixture.global_template not in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_list_as_user_returns_user_template(\n self,\n ):\n mock_request = create_mock_request(user=self.user1)\n templates = template_api.get_all_accessible_by_hash_list(\n [self.fixture.user1_template.hash], request=mock_request\n )\n se...
[ "0.8227565", "0.8194535", "0.8007385", "0.7911953", "0.78929853", "0.78840536", "0.7775287", "0.7738975", "0.7630923", "0.76105887", "0.758177", "0.75368434", "0.7483725", "0.7452379", "0.7292541", "0.72641546", "0.7235065", "0.7176262", "0.71578574", "0.71336734", "0.7131445...
0.84037524
0
test get all accessible by hash list as superuser returns global template
def test_get_all_accessible_by_hash_list_as_superuser_returns_global_template( self, ): mock_request = create_mock_request(user=self.superuser1) templates = template_api.get_all_accessible_by_hash_list( [self.fixture.global_template.hash], request=mock_request ) self.assertTrue(self.fixture.user1_template not in list(templates)) self.assertTrue(self.fixture.user2_template not in list(templates)) self.assertTrue(self.fixture.global_template in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_list_as_user_returns_global_template(\n self,\n ):\n mock_request = create_mock_request(user=self.user1)\n templates = template_api.get_all_accessible_by_hash_list(\n [self.fixture.global_template.hash], request=mock_request\n )\n ...
[ "0.79852265", "0.79441637", "0.79198414", "0.7865991", "0.77729464", "0.77234817", "0.7679411", "0.76214916", "0.7617738", "0.7583023", "0.754689", "0.7470992", "0.7443684", "0.72886294", "0.7275211", "0.72666967", "0.7181501", "0.7174229", "0.7105018", "0.6970292", "0.694222...
0.81317466
0
test get all accessible by hash list as superuser returns other user template
def test_get_all_accessible_by_hash_list_as_superuser_returns_other_user_template( self, ): mock_request = create_mock_request(user=self.superuser1) templates = template_api.get_all_accessible_by_hash_list( [self.fixture.user2_template.hash], request=mock_request ) self.assertTrue(self.fixture.user1_template not in list(templates)) self.assertTrue(self.fixture.user2_template in list(templates)) self.assertTrue(self.fixture.global_template not in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_accessible_by_hash_list_as_superuser_returns_user_template(\n self,\n ):\n mock_request = create_mock_request(user=self.superuser1)\n templates = template_api.get_all_accessible_by_hash_list(\n [self.fixture.user1_template.hash], request=mock_request\n )\n...
[ "0.8454107", "0.8296815", "0.82034844", "0.8123604", "0.8019835", "0.7945642", "0.79013157", "0.78566486", "0.7834045", "0.7787974", "0.7782017", "0.77084994", "0.7705536", "0.7648244", "0.7565752", "0.74664336", "0.74580854", "0.7411578", "0.7347955", "0.7335982", "0.724704"...
0.80764586
4
test get all as anonymous returns empty list
def test_get_all_as_anonymous_returns_empty_list(self): mock_request = create_mock_request(user=self.anonymous_user) templates = template_api.get_all(request=mock_request) self.assertEqual(templates.count(), 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_return_all(self):\n self.data.return_all()", "def test_get_list(self):\n pass", "def get(self):\r\n return get_all()", "def get_all(self, name):\n\t\tpass", "def test_get_token_supply_all_using_get(self):\n pass", "def get_all(self):\n result_get = GetRest(func...
[ "0.74704874", "0.72320455", "0.69182897", "0.6892623", "0.68826604", "0.6792561", "0.67799497", "0.67619455", "0.674734", "0.6738306", "0.67311794", "0.67244023", "0.67236596", "0.6677641", "0.66675735", "0.66411066", "0.66362274", "0.66354066", "0.6620477", "0.65793043", "0....
0.6877422
5
test get all as anonymous with access right returns global templates
def test_get_all_as_anonymous_with_access_right_returns_global_templates( self, ): mock_request = create_mock_request(user=self.anonymous_user) templates = template_api.get_all(request=mock_request) self.assertEqual(templates.count(), 1) self.assertTrue((template.user is None for template in templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def T(request):\n\treturn all_templates[request.param]", "def test_get_all_as_user_returns_accessible_templates(self):\n mock_request = create_mock_request(user=self.user)\n templates = template_api.get_all(request=mock_request)\n self.assertEqual(templates.count(), 2)\n self.assertTr...
[ "0.71963495", "0.69589484", "0.695767", "0.6738414", "0.6680882", "0.6666209", "0.6632277", "0.66269696", "0.6591374", "0.65500444", "0.65330005", "0.64813143", "0.6450166", "0.6417387", "0.6408952", "0.64055634", "0.63884926", "0.6387879", "0.6307593", "0.62807924", "0.62755...
0.7641047
0
test get all as user returns accessible templates
def test_get_all_as_user_returns_accessible_templates(self): mock_request = create_mock_request(user=self.user) templates = template_api.get_all(request=mock_request) self.assertEqual(templates.count(), 2) self.assertTrue(self.fixture.user1_template in list(templates)) self.assertTrue(self.fixture.global_template in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_as_superuser_returns_all_templates(self):\n mock_request = create_mock_request(user=self.superuser)\n templates = template_api.get_all(request=mock_request)\n self.assertEqual(templates.count(), 3)\n self.assertTrue(self.fixture.user1_template in list(templates))\n ...
[ "0.7973463", "0.7884634", "0.75864184", "0.73863786", "0.7368473", "0.73545754", "0.73322153", "0.73156446", "0.7303613", "0.7301676", "0.71165544", "0.70814574", "0.7071253", "0.7070465", "0.7058631", "0.69952977", "0.6969601", "0.6948563", "0.6939556", "0.6878665", "0.68417...
0.8490938
0
test get all as staff returns accessible templates
def test_get_all_as_staff_returns_accessible_templates(self): mock_request = create_mock_request(user=self.staff_user) templates = template_api.get_all(request=mock_request) self.assertEqual(templates.count(), 2) self.assertTrue(self.fixture.user2_template in list(templates)) self.assertTrue(self.fixture.global_template in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_as_user_returns_accessible_templates(self):\n mock_request = create_mock_request(user=self.user)\n templates = template_api.get_all(request=mock_request)\n self.assertEqual(templates.count(), 2)\n self.assertTrue(self.fixture.user1_template in list(templates))\n ...
[ "0.77078307", "0.76111203", "0.7382082", "0.7332171", "0.7315884", "0.73020625", "0.7169267", "0.709241", "0.69971323", "0.69874364", "0.69600505", "0.6950572", "0.6810104", "0.6807266", "0.67712927", "0.6756902", "0.6676017", "0.66577077", "0.66072726", "0.65592235", "0.6539...
0.8453167
0
test get all as superuser returns all templates
def test_get_all_as_superuser_returns_all_templates(self): mock_request = create_mock_request(user=self.superuser) templates = template_api.get_all(request=mock_request) self.assertEqual(templates.count(), 3) self.assertTrue(self.fixture.user1_template in list(templates)) self.assertTrue(self.fixture.user2_template in list(templates)) self.assertTrue(self.fixture.global_template in list(templates))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_as_user_returns_accessible_templates(self):\n mock_request = create_mock_request(user=self.user)\n templates = template_api.get_all(request=mock_request)\n self.assertEqual(templates.count(), 2)\n self.assertTrue(self.fixture.user1_template in list(templates))\n ...
[ "0.80813885", "0.7807613", "0.73119265", "0.7304258", "0.7133047", "0.7106707", "0.7028065", "0.70258", "0.6983149", "0.69324434", "0.6922331", "0.69057953", "0.687215", "0.6858583", "0.683814", "0.6838046", "0.6819967", "0.6750605", "0.67349994", "0.6714064", "0.6704779", ...
0.84164745
0
test delete user template as anonymous raises access control error
def test_delete_user_template_as_anonymous_raises_access_control_error( self, ): mock_request = create_mock_request(user=self.anonymous_user) with self.assertRaises(AccessControlError): template_api.delete( self.fixture.user1_template, request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_user_template_as_anonymous_with_access_right_raises_access_control_error(\n self,\n ):\n mock_request = create_mock_request(user=self.anonymous_user)\n with self.assertRaises(AccessControlError):\n template_api.delete(\n self.fixture.user1_template,...
[ "0.8109796", "0.7890928", "0.785249", "0.78486097", "0.7497058", "0.7439203", "0.7439203", "0.7338107", "0.73019093", "0.72081596", "0.71589935", "0.7156079", "0.7141743", "0.71223885", "0.70870435", "0.70845276", "0.70736223", "0.70583034", "0.7051745", "0.7028054", "0.69838...
0.8186267
0
test delete user template as anonymous with access right raises access control error
def test_delete_user_template_as_anonymous_with_access_right_raises_access_control_error( self, ): mock_request = create_mock_request(user=self.anonymous_user) with self.assertRaises(AccessControlError): template_api.delete( self.fixture.user1_template, request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_user_template_as_anonymous_raises_access_control_error(\n self,\n ):\n mock_request = create_mock_request(user=self.anonymous_user)\n with self.assertRaises(AccessControlError):\n template_api.delete(\n self.fixture.user1_template, request=mock_requ...
[ "0.8130148", "0.8038917", "0.7928053", "0.7784703", "0.7748895", "0.7658275", "0.7418729", "0.7418729", "0.7411724", "0.73322123", "0.72632694", "0.72585547", "0.72350216", "0.71767664", "0.714434", "0.7127663", "0.7013489", "0.7002689", "0.6998825", "0.6979983", "0.69761485"...
0.82500076
0
test delete global template as anonymous raises access control error
def test_delete_global_template_as_anonymous_raises_access_control_error( self, ): mock_request = create_mock_request(user=self.anonymous_user) with self.assertRaises(AccessControlError): template_api.delete( self.fixture.global_template, request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_namespaced_template(self):\n pass", "def test_unshare_template_registration(self):\n pass", "def test_unregister_template(self):\n pass", "def test_delete_global_template_as_anonymous_with_access_right_raises_access_control_error(\n self,\n ):\n mock_requ...
[ "0.81480706", "0.7738205", "0.76446134", "0.760553", "0.74554205", "0.73302263", "0.7171768", "0.71101874", "0.7082718", "0.6964324", "0.69628876", "0.6946534", "0.68553317", "0.6727042", "0.66276026", "0.65248346", "0.6505133", "0.6429171", "0.6403121", "0.6380354", "0.63574...
0.76803684
2
test delete global template as anonymous with access right raises access control error
def test_delete_global_template_as_anonymous_with_access_right_raises_access_control_error( self, ): mock_request = create_mock_request(user=self.anonymous_user) with self.assertRaises(AccessControlError): template_api.delete( self.fixture.global_template, request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_namespaced_template(self):\n pass", "def test_delete_global_template_as_user_raises_access_control_error(self):\n mock_request = create_mock_request(user=self.user1)\n with self.assertRaises(AccessControlError):\n template_api.delete(\n self.fixture....
[ "0.7957372", "0.78233325", "0.7783485", "0.7648756", "0.73494995", "0.724509", "0.7238044", "0.7229371", "0.7146958", "0.70505244", "0.694791", "0.6860597", "0.6852993", "0.67819417", "0.66837376", "0.66768485", "0.6628545", "0.6627234", "0.6593351", "0.65602285", "0.6522194"...
0.78978837
1
test delete own template as user saves
def test_delete_own_template_as_user_saves(self): mock_request = create_mock_request(user=self.user1) template_api.delete(self.fixture.user1_template, request=mock_request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_own_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superuser1)\n template_api.delete(self.fixture.user1_template, request=mock_request)", "def test_delete_own_template_as_staff_saves(self):\n mock_request = create_mock_request(user=self.staf...
[ "0.8405559", "0.7938252", "0.78544295", "0.7835479", "0.76984704", "0.75773", "0.75123143", "0.7462032", "0.73763233", "0.7366287", "0.7339748", "0.72637725", "0.72637725", "0.7095875", "0.70382494", "0.6969727", "0.6962131", "0.6931763", "0.6909945", "0.68845177", "0.6865710...
0.8729449
0
test delete other users template as user raises access control error
def test_delete_other_users_template_as_user_raises_access_control_error( self, ): mock_request = create_mock_request(user=self.user1) with self.assertRaises(AccessControlError): template_api.delete( self.fixture.user2_template, request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_own_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superuser1)\n template_api.delete(self.fixture.user1_template, request=mock_request)", "def test_delete_other_users_template_as_superuser_saves(self):\n mock_request = create_mock_request(us...
[ "0.8105018", "0.8104827", "0.8100035", "0.8017625", "0.80126005", "0.7705949", "0.7705949", "0.7640928", "0.7617843", "0.7548961", "0.75398606", "0.7430284", "0.73903745", "0.72945106", "0.7280149", "0.72691876", "0.723362", "0.720127", "0.7198595", "0.71942717", "0.7187567",...
0.81878215
0
test delete global template as user raises access control error
def test_delete_global_template_as_user_raises_access_control_error(self): mock_request = create_mock_request(user=self.user1) with self.assertRaises(AccessControlError): template_api.delete( self.fixture.global_template, request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_global_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superuser1)\n template_api.delete(self.fixture.global_template, request=mock_request)", "def test_delete_namespaced_template(self):\n pass", "def test_delete_global_template_as_anonymou...
[ "0.8058154", "0.78446215", "0.7595148", "0.75532234", "0.75362784", "0.753489", "0.74993956", "0.7437848", "0.72980475", "0.7283631", "0.726282", "0.7225051", "0.7123989", "0.711558", "0.7096376", "0.7071216", "0.70578927", "0.70301336", "0.70142186", "0.69239014", "0.6853447...
0.8217039
0
test delete own template as staff saves
def test_delete_own_template_as_staff_saves(self): mock_request = create_mock_request(user=self.staff_user1) template_api.delete(self.fixture.user1_template, request=mock_request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_own_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superuser1)\n template_api.delete(self.fixture.user1_template, request=mock_request)", "def test_delete_own_template_as_user_saves(self):\n mock_request = create_mock_request(user=self.user1...
[ "0.8108582", "0.80523485", "0.80356413", "0.7905152", "0.76571864", "0.76172143", "0.7565759", "0.7552634", "0.74682933", "0.74544466", "0.73570675", "0.7341402", "0.7218155", "0.7113023", "0.7024291", "0.7003252", "0.69519466", "0.6912048", "0.69030714", "0.6814051", "0.6802...
0.8403106
0
test delete other users template as staff raises access control error
def test_delete_other_users_template_as_staff_raises_access_control_error( self, ): mock_request = create_mock_request(user=self.staff_user1) with self.assertRaises(AccessControlError): template_api.delete( self.fixture.user2_template, request=mock_request )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_own_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superuser1)\n template_api.delete(self.fixture.user1_template, request=mock_request)", "def test_delete_other_users_template_as_superuser_saves(self):\n mock_request = create_mock_request(us...
[ "0.808326", "0.802726", "0.7965073", "0.79332936", "0.7800406", "0.7799253", "0.76195556", "0.75638926", "0.75588703", "0.7483941", "0.7483941", "0.73990446", "0.73645484", "0.7327109", "0.72690487", "0.71860415", "0.7184741", "0.7150509", "0.70893085", "0.7082953", "0.706137...
0.8265562
0
test delete global template as staff saves
def test_delete_global_template_as_staff_saves(self): mock_request = create_mock_request(user=self.staff_user1) template_api.delete(self.fixture.global_template, request=mock_request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_global_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superuser1)\n template_api.delete(self.fixture.global_template, request=mock_request)", "def test_delete_own_template_as_staff_saves(self):\n mock_request = create_mock_request(user=self....
[ "0.8153071", "0.7786319", "0.7784371", "0.7716912", "0.75208735", "0.7489113", "0.7379321", "0.73716503", "0.72625434", "0.72461313", "0.71758413", "0.71681505", "0.71080875", "0.709806", "0.7042556", "0.6959074", "0.6730459", "0.67151546", "0.66676325", "0.66467226", "0.6606...
0.84990233
0
test delete own template as superuser saves
def test_delete_own_template_as_superuser_saves(self): mock_request = create_mock_request(user=self.superuser1) template_api.delete(self.fixture.user1_template, request=mock_request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_own_template_as_user_saves(self):\n mock_request = create_mock_request(user=self.user1)\n template_api.delete(self.fixture.user1_template, request=mock_request)", "def test_delete_global_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superus...
[ "0.8280397", "0.8224194", "0.8060117", "0.78996503", "0.75895417", "0.7520532", "0.7519773", "0.75025415", "0.73786604", "0.73680294", "0.721002", "0.70879525", "0.702414", "0.70129967", "0.7012797", "0.7012797", "0.6967623", "0.6949611", "0.68701947", "0.68661785", "0.679306...
0.8697194
0
test delete other users template as superuser saves
def test_delete_other_users_template_as_superuser_saves(self): mock_request = create_mock_request(user=self.superuser1) template_api.delete(self.fixture.user2_template, request=mock_request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_own_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superuser1)\n template_api.delete(self.fixture.user1_template, request=mock_request)", "def test_delete_own_template_as_user_saves(self):\n mock_request = create_mock_request(user=self.user1...
[ "0.8817737", "0.85475934", "0.8236777", "0.7992185", "0.7491608", "0.7396679", "0.7396679", "0.7336298", "0.725919", "0.72099054", "0.7088548", "0.7082489", "0.7050118", "0.70074046", "0.69393295", "0.6897725", "0.688309", "0.6881316", "0.687922", "0.68716925", "0.68648237", ...
0.86611134
1
test delete global template as superuser saves
def test_delete_global_template_as_superuser_saves(self): mock_request = create_mock_request(user=self.superuser1) template_api.delete(self.fixture.global_template, request=mock_request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_own_template_as_superuser_saves(self):\n mock_request = create_mock_request(user=self.superuser1)\n template_api.delete(self.fixture.user1_template, request=mock_request)", "def test_delete_global_template_as_staff_saves(self):\n mock_request = create_mock_request(user=self.s...
[ "0.8211604", "0.8005223", "0.7721632", "0.771418", "0.756075", "0.73948276", "0.7389841", "0.7346052", "0.7268417", "0.72225857", "0.7203136", "0.7147506", "0.70092875", "0.69376206", "0.68497753", "0.68214715", "0.670203", "0.66734916", "0.66634125", "0.66634125", "0.6585964...
0.8784708
0
Performs a chisquared statistical test on the experimental outcomes. Internally, compares a normalized table of experimental counts to the scipy.stats.chisquare default, for which all outcomes are equally likely.
def stat_test(self, counts): vals_list = list(counts.values()) # account for bitstring with zero counts numqubits = len(list(counts)[0]) numzeros = 2 ** numqubits - len(counts) vals_list.extend([0] * numzeros) chisq, pval = chisquare(vals_list) passed = bool(pval >= self._pcrit) return (chisq, pval, passed)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chisq_test(observed):\n\tn, k = observed.shape\n\trow = observed.sum(axis=0).reshape(1,-1)\n\tcol = observed.sum(axis=1).reshape(-1,1)\n\texpected = np.dot(col, row)/observed.sum()\n\t#chi2, pvalue = scipy.stats.mstats.chisquare(observed.ravel(), expected.ravel(), ddof = n+k-2)\n\tchi2 = (((observed-expected)*...
[ "0.7183224", "0.6978967", "0.69449675", "0.6802077", "0.6688565", "0.6664517", "0.6640259", "0.6618173", "0.653759", "0.6531968", "0.6528437", "0.6378333", "0.63409173", "0.6251255", "0.6220748", "0.62075675", "0.6190487", "0.6190487", "0.6168432", "0.61675185", "0.61225355",...
0.6373489
12
Creates a breakpoint, which is a renamed deep copy of the QuantumCircuit, and creates and appends an AssertUniform instruction to its end. If the statistical test passes, the assertion passes; if the test fails, the assertion fails.
def get_breakpoint_uniform(self, qubit, cbit, pcrit=0.05): clone = self.copy(Asserts._new_breakpoint_name()) assertion = AssertUniform(qubit, cbit, pcrit, False) clone.append(assertion, [assertion._qubit], [assertion._cbit]) return clone
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_breakpoint_not_uniform(self, qubit, cbit, pcrit=0.05):\n clone = self.copy(Asserts._new_breakpoint_name())\n assertion = AssertUniform(qubit, cbit, pcrit, True)\n clone.append(assertion, [assertion._qubit], [assertion._cbit])\n return clone", "def get_breakpoint_product(self, qubit0, cbit0, q...
[ "0.615157", "0.5664515", "0.5564676", "0.51173455", "0.5042951", "0.49747887", "0.49527636", "0.4948408", "0.48849374", "0.48534235", "0.48316854", "0.48037466", "0.4722693", "0.47221145", "0.4704494", "0.47041127", "0.46748686", "0.4669761", "0.46511495", "0.4641877", "0.463...
0.6336997
0
Creates a breakpoint, which is a renamed deep copy of the QuantumCircuit, and creates and appends an AssertUniform instruction to its end. If the statistical test passes, the assertion fails; if the test fails, the assertion passes.
def get_breakpoint_not_uniform(self, qubit, cbit, pcrit=0.05): clone = self.copy(Asserts._new_breakpoint_name()) assertion = AssertUniform(qubit, cbit, pcrit, True) clone.append(assertion, [assertion._qubit], [assertion._cbit]) return clone
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_breakpoint_uniform(self, qubit, cbit, pcrit=0.05):\n clone = self.copy(Asserts._new_breakpoint_name())\n assertion = AssertUniform(qubit, cbit, pcrit, False)\n clone.append(assertion, [assertion._qubit], [assertion._cbit])\n return clone", "def get_breakpoint_product(self, qubit0, cbit0, qubi...
[ "0.6328285", "0.5668417", "0.5596492", "0.5110465", "0.50538695", "0.5012597", "0.49447802", "0.49177045", "0.49040687", "0.48579818", "0.48148197", "0.481229", "0.47325182", "0.47238013", "0.47059774", "0.46966594", "0.46892297", "0.46688747", "0.46467826", "0.4646354", "0.4...
0.6174962
1
Geotransform the original map and create an inverse geotransform for the raster.
def _get_inv_gt(self): # Geotransform the original map self.in_gt = self.in_ds.GetGeoTransform() # Create an inverse geotransform for the raster. # This converts real-world coordinates to pixel offsets. self.inv_gt = gdal.InvGeoTransform(self.in_gt) if gdal.VersionInfo()[0] == '1': if self.inv_gt[0] == 1: self.inv_gt = self.inv_gt[1] else: raise RuntimeError('Inverse geotransform failed') elif self.inv_gt is None: raise RuntimeError('Inverse geotransform failed')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geo_transform(self):\n pass", "def geotransform(self):\n return self._geotransform", "def __affine_geo_transformation(x, y, gtr):\n\n # https://gdal.org/user/raster_data_model.html#affine-geotransform\n # Affine transformation rewritten for rasterio:\n gtr_x = gtr[2] + (x...
[ "0.7338185", "0.65408427", "0.6371385", "0.63351965", "0.63224435", "0.62674654", "0.62644494", "0.62108505", "0.6176385", "0.61081815", "0.6096801", "0.6054763", "0.604431", "0.5978923", "0.59416425", "0.5915392", "0.5910879", "0.58931345", "0.58687687", "0.58653194", "0.581...
0.67420596
1
get clip location in array.
def _get_clip_loc_in_array(self): # coordinates of upperleft and lowerright points of binding box box_ulx, box_uly, box_lrx, box_lry = self.clip_box[0][0], self.clip_box[0][1], \ self.clip_box[1][0], self.clip_box[1][1] # Get the offsets that correspond to the bounding box corner coordinates. offsets_ul = gdal.ApplyGeoTransform(self.inv_gt, box_ulx, box_uly) offsets_lr = gdal.ApplyGeoTransform(self.inv_gt, box_lrx, box_lry) # The offsets are returned as floating point, but we need integers. self.off_ulx, self.off_uly = map(int, offsets_ul) self.off_lrx, self.off_lry = map(int, offsets_lr) # Compute the numbers of rows and columns to extract, based on the offsets. self.row = self.off_lry - self.off_uly self.column = self.off_lrx - self.off_ulx
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clip(self):\r\n\t\treturn self._clip", "def get_marker_absolute_pos(marker_position, clip):\n marker_x = (marker_position[\"x\"] * clip.w) - marker_image.w / 2\n marker_y = (marker_position[\"y\"] * clip.h) - marker_image.h / 2\n return marker_x, marker_y", "def location_of(self, index):\n ...
[ "0.62954205", "0.61157066", "0.5843126", "0.5814552", "0.57981294", "0.5748439", "0.5678269", "0.5570744", "0.55497", "0.5545587", "0.55285585", "0.55121255", "0.5457112", "0.544028", "0.5431783", "0.5430645", "0.54257566", "0.5412553", "0.54099363", "0.5408648", "0.5408648",...
0.755718
0
Write the clipped image.
def _write_image(self): # Create an output raster with the correct number of rows and columns. gtiff_driver = gdal.GetDriverByName('GTiff') out_ds = gtiff_driver.Create(os.path.join(self.out_folder, self.out_file_name), self.column, self.row, 1) out_ds.SetProjection(self.in_ds.GetProjection()) # Convert the offsets to real-world coordinates for the georeferencing info. # We can't use the coordinates above because they don't correspond to the pixel edges. subset_ulx, subset_uly = gdal.ApplyGeoTransform(self.in_gt, self.off_ulx, self.off_uly) out_gt = list(self.in_gt) out_gt[0] = subset_ulx out_gt[3] = subset_uly out_ds.SetGeoTransform(out_gt) data = self.read_image() out_band = out_ds.GetRasterBand(1) out_band.WriteArray(data) del out_ds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def imsave_clip(outfile,img):\n img = img_as_float(img).clip(0.,1.)\n io.imsave(outfile,img)", "def clip(self):\n \n subprocess.call(['gdaltindex', self.extent, self.referenceImagePath])\n dataNames = sorted(glob.glob(self.fullPath + '/full*.tif'))\n splitAt = len(self.f...
[ "0.6488466", "0.6314085", "0.5995743", "0.5852424", "0.5842784", "0.57828283", "0.57779133", "0.5766652", "0.5743675", "0.5680707", "0.56496406", "0.5611366", "0.55957174", "0.5544845", "0.55281967", "0.5515093", "0.55149317", "0.54561883", "0.54475206", "0.5443599", "0.53590...
0.54431045
20
pretty print for confusion matrixes
def print_cm(cm, labels, hide_zeroes=False, hide_diagonal=False, hide_threshold=None): columnwidth = max([len(x) for x in labels] + [5]) # 5 is value length empty_cell = " " * columnwidth # Print header print(" " + empty_cell, end=" ") for label in labels: print("%{0}s".format(columnwidth) % label, end=" ") print() # Print rows for i, label1 in enumerate(labels): print(" %{0}s".format(columnwidth) % label1, end=" ") for j in range(len(labels)): cell = "%{0}.1f".format(columnwidth) % cm[i, j] if hide_zeroes: cell = cell if float(cm[i, j]) != 0 else empty_cell if hide_diagonal: cell = cell if i != j else empty_cell if hide_threshold: cell = cell if cm[i, j] > hide_threshold else empty_cell print(cell, end=" ") print()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printConfusion(self,conf):\n print \"y\\pred\\t \" + \"\\t\".join(map(str,range(self.param['numClasses'])))\n i = 0\n for row in conf:\n print str(i) + \"\\t\" + \"\\t\".join(map(str,row))\n i += 1", "def print_confusion_matrix(self) -> None:\n self.metric...
[ "0.7599367", "0.7587687", "0.73325896", "0.7280442", "0.7185138", "0.71834344", "0.69563955", "0.69450915", "0.68952376", "0.68589103", "0.68507034", "0.6836252", "0.6809265", "0.67691094", "0.676127", "0.67415655", "0.66952664", "0.66377604", "0.6627704", "0.6603047", "0.656...
0.6332753
63
1. Remove html like text from europarl e.g. 2. Remove line breaks 3. Reduce all whitespaces to 1 4. turn everything to lower case
def clean_text(text): regex = re.compile('[\.|\-|\,|\?|\_|\:|\"|\)|\(\)\/|\\|\>|\<]') text = text.lower() # Turn everything to lower case text = regex.sub(' ', text).strip() out = re.sub(' +', ' ', text) # Reduce whitespace down to one return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_text(text):\n text = re.sub(r'<@>\\s+|<s>\\s+|</s>\\s+|<p>\\s+|</p>\\s+|\\s+\\,|\\'s|\\'|\\;|\\(|\\)|\\-\\-\\s+|\\s+\\.', '', text)\n text = re.sub(r'\\.\\,', '. ,', text)\n text = re.sub(r'\\,', '', text)\n text = re.sub(r'\\$', '$ ', text)\n text = re.sub(r'\\%', ' %', text)\n text ...
[ "0.75689787", "0.7448742", "0.7448742", "0.7448742", "0.7448742", "0.7448742", "0.7448742", "0.7382676", "0.73550683", "0.72853446", "0.7258354", "0.7142215", "0.7113155", "0.7099025", "0.7059247", "0.7021688", "0.6980045", "0.6965775", "0.68921274", "0.68150175", "0.68010265...
0.71779156
11
Multiplication d'un polynome par un scalaire
def polymul(c,P): return [c*x for x in P]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def multiplier(self) -> global___Expression:", "def multiplicar(self):\n self.resultado = self.valor_1 * self.valor_2", "def multiplicacion(x, y):\n return x * y", "def __mul__(self,l):\r\n\t\t\r\n\t\t# multiply\r\n\t\tm = self.multiply(l)\r\n\t\t\r\n\t\treturn m", "def multiply(t):\n return m...
[ "0.7657527", "0.7508248", "0.73457736", "0.7271772", "0.7131595", "0.70944583", "0.70938784", "0.70257497", "0.6971472", "0.68435085", "0.6839794", "0.6839794", "0.6839794", "0.68307185", "0.6812296", "0.6779489", "0.675036", "0.6744017", "0.67239136", "0.6707162", "0.6699718...
0.0
-1
Construit un monome d'un degre donne et de coefficient donne
def monome(c,d): P = [0]*(d+1) P[d] = c return P
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coefficient(self) -> float:\n ...", "def ajouter_monome(self, m):\n\t\tif m.get_coefficient().est_nul():\n\t\t\treturn\n\t\t\n\t\t\n\t\tif self.chercher(m) == True:\n\t\t\tx = self.retrouver(m)\n\t\t\ta = x.get_coefficient()\n\t\t\tb = m.get_coefficient()\n\t\t\tself.supprimer(x)\n\t\t\tr = a + b\n\t\...
[ "0.68568563", "0.60315037", "0.595433", "0.5780596", "0.5771602", "0.57407546", "0.57339036", "0.57030624", "0.5617315", "0.5613024", "0.55833954", "0.5512893", "0.5500005", "0.54806095", "0.54478395", "0.54459935", "0.5435078", "0.54168224", "0.5412264", "0.54080576", "0.540...
0.0
-1
Produit de 2 polynomes
def polyproduit(A,B): C = [] for k in range(polydegre(A)+polydegre(B)+1): s = 0 for i in range(k+1): if (i <= polydegre(A)) and (k-i <= polydegre(B)): s = s + A[i]*B[k-i] C.append(s) return C
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_partie(joueur1: object,\n joueur2: object,\n tableau_invisible_joueur1: list, tableau_invisible_joueur2: list\n ):\n print(\"plateau du joueur 2 : \\n\")\n\n tour_de_jeu(joueur1, joueur2, tableau_invisible_joueur2)\n\n rafraichir_position(joueur2, joue...
[ "0.58114356", "0.58029974", "0.5786813", "0.5649218", "0.55702806", "0.5446984", "0.53780437", "0.53640664", "0.5341792", "0.5318291", "0.529414", "0.5271976", "0.52569693", "0.5247879", "0.5197618", "0.51941526", "0.51788974", "0.51754844", "0.51589465", "0.5155085", "0.5155...
0.0
-1
Creates crosswind playbook. Crosswind playbooks are outer loop control commands that change with wind speed.
def GetPlaybook(test_site): if test_site == m.kTestSiteParkerRanch: # OktoberKite playbook is from FBL results from power curve results # for BigM600_r07c_v01-circle_flap2_5. # Wind adjust params rescale the wind speeds used in the playbook lookup. # Low and high winds are generally riskier than moderate winds, so these # parameters can enable compression of the playbook (via scaling_factor # < 1) around a central "crossover" point so the kite switches to safer # entries sooner. # The intent is that at high winds we fly a higher wind speed solution # than optimized for by some margin, and at low winds we fly a lower # wind speed solution. Since these solutions are considered to be for # extreme wind cases, we are reaching the extreme solution at a slightly # less extreme wind with the hopes that our behavior will be more # conservative. # A scaling_factor of 1 will have no effect. # Wind adjust params for Oktoberkite currently set to have no effect. wind_adjust_params = {'crossover': 9.0, 'min_offset': 0., 'scaling_factor': 1.} transout_airspeed_smooth_weights = [ [0.01, 0.1, 0.01], [0.05, 0.2, 0.05], [0.10, 0.3, 0.10], [0.05, 0.2, 0.05], [0.01, 0.1, 0.01]] # Playbooks from FBL do not require additional smoothing. # All smoothing weights are singular. smoothing_params = { 'alpha_lookup': {'weights': [[1.]], 'edges': ['extend', 'continuous']}, 'beta_lookup': {'weights': [[1.]], 'edges': ['extend', 'continuous']}, 'airspeed_lookup': {'weights': [[1.]], 'edges': ['extend', 'continuous']}, 'transout_airspeed_lookup': { 'weights': transout_airspeed_smooth_weights, 'edges': ['extend', 'continuous']}, 'elevation': {'weights': [1.], 'edges': ['extend']}, 'azi_offset': {'weights': [1.], 'edges': ['extend']}, 'path_radius_target': {'weights': [1.], 'edges': ['extend']}} # Single values are a simple lookup, while multiple values represent # values for cubic spline control points, evenly spaced with loop angle. playbook_parameterized = [ {'airspeed': [31.6443, 40.6491, 47.0736, 43.9876, 32.1313, 30.7405], 'alpha': [-0.0812, -0.02, -0.0027, -0.0009, -0.0131, -0.0846], 'azi_offset': 0.0546, 'beta': [-0.0384, -0.0384, -0.0384, -0.0384, -0.0384, -0.0384], 'elevation': 0.5098, 'radius': 95.91, 'wind_speed': 4.0}, {'airspeed': [32.8133, 44.446, 51.7089, 50.5689, 39.9426, 31.3679], 'alpha': [-0.0393, -0.0055, -0.0004, -0.0004, -0.0085, -0.0507], 'azi_offset': 0.0253, 'beta': [-0.0482, -0.0482, -0.0482, -0.0482, -0.0482, -0.0482], 'elevation': 0.4891, 'radius': 90.0017, 'wind_speed': 6.0}, {'airspeed': [37.2616, 50.3141, 57.3948, 54.225, 46.1069, 34.9328], 'alpha': [-0.0026, -0.0002, 0.0, -0.0002, -0.0026, -0.0138], 'azi_offset': 0.0081, 'beta': [-0.0474, -0.0474, -0.0474, -0.0474, -0.0474, -0.0474], 'elevation': 0.4891, 'radius': 90.0003, 'wind_speed': 8.0}, {'airspeed': [49.5387, 58.2034, 63.8272, 60.2092, 52.3286, 47.11], 'alpha': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'azi_offset': 0.0045, 'beta': [-0.0521, -0.0521, -0.0521, -0.0521, -0.0521, -0.0521], 'elevation': 0.4891, 'radius': 90.0, 'wind_speed': 10.0}, {'airspeed': [50.9564, 59.2743, 67.3115, 65.8786, 57.8558, 52.2734], 'alpha': [-0.0034, -0.0029, -0.0316, -0.0174, -0.0008, -0.0021], 'azi_offset': 0.0765, 'beta': [-0.0522, -0.0522, -0.0522, -0.0522, -0.0522, -0.0522], 'elevation': 0.4891, 'radius': 90.0, 'wind_speed': 12.0}, {'airspeed': [53.1502, 62.4041, 71.581, 70.8717, 63.42, 55.079], 'alpha': [-0.001, -0.0253, -0.0545, -0.0529, -0.0065, -0.0015], 'azi_offset': 0.155, 'beta': [-0.053, -0.053, -0.053, -0.053, -0.053, -0.053], 'elevation': 0.4891, 'radius': 90.0, 'wind_speed': 14.0}, {'airspeed': [55.7261, 62.5564, 71.9207, 72.8428, 67.5872, 60.2103], 'alpha': [-0.0218, -0.0351, -0.0561, -0.0657, -0.0293, 0.0012], 'azi_offset': 0.3165, 'beta': [-0.0475, -0.0475, -0.0475, -0.0475, -0.0475, -0.0475], 'elevation': 0.548, 'radius': 91.7197, 'wind_speed': 16.0}, {'airspeed': [58.2542, 64.2707, 73.2495, 74.7305, 70.5466, 63.7057], 'alpha': [-0.0069, -0.0304, -0.0612, -0.0758, -0.0485, -0.0038], 'azi_offset': 0.3717, 'beta': [-0.0584, -0.0584, -0.0584, -0.0584, -0.0584, -0.0584], 'elevation': 0.6304, 'radius': 91.0864, 'wind_speed': 18.0}, {'airspeed': [57.3239, 61.8278, 72.2796, 75.9291, 72.9086, 65.5985], 'alpha': [0.0001, -0.0168, -0.0563, -0.0842, -0.0648, -0.0162], 'azi_offset': 0.4307, 'beta': [-0.0348, -0.0348, -0.0348, -0.0348, -0.0348, -0.0348], 'elevation': 0.7067, 'radius': 96.7637, 'wind_speed': 20.0}] else: # There is no offshore playbook for OktoberKite. assert False, ( 'Oktoberkite must be flown onshore at Parker Ranch. ' 'No offshore playbook.') # Transout airspeed commands are modified versions of the V1 Playbook airspeed # schedules. The original schedules were adjusted to make the commands both # slower and flatter at the 6 o'clock loop position to help the kite slow # down without throwing the bridle forward such that it contacts pylons. # # As this playbook was shorter, it's extended for higher wind # speeds. These airspeeds are scheduled with wind speed from 3 to 19 m/s # at a 2 m/s interval. # TODO(b/137710129): Make aligning of these airspeed schedules to the playbook # wind speeds more robust. # TODO: Trans-out airspeeds need a revision for the OktoKite. transout_airspeeds = [[35.0, 40.0, 43.5, 43.5, 41.0, 40.0], [35.0, 40.8, 44.1, 44.1, 42.0, 39.5], [35.0, 41.5, 44.8, 44.8, 43.0, 39.0], [37.5, 42.2, 45.4, 45.4, 44.0, 38.5], [40.0, 43.0, 46.0, 46.0, 45.0, 38.0], [42.0, 45.0, 48.0, 48.0, 47.0, 40.0], [44.0, 47.0, 50.0, 50.0, 49.0, 42.0], [46.0, 49.0, 52.0, 52.0, 51.0, 44.0], [48.0, 51.0, 54.0, 54.0, 53.0, 46.0]] return { 'wind_adjust_params': wind_adjust_params, 'smoothing_params': smoothing_params, 'playbook_parameterized': playbook_parameterized, 'transout_airspeeds': transout_airspeeds, }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeLoop( name, *structure ):\n return X12Loop( name, *structure )", "def make_clips(self):\n print('starting to make clips!')\n #TODO parallelize this with multiprocessing\n clip_number = 1\n \n for requested_clip in self.requested_clips:\n streamer_outpu...
[ "0.50200415", "0.4870531", "0.485949", "0.47973445", "0.4761327", "0.46400025", "0.45884845", "0.45271063", "0.45134196", "0.4504828", "0.44922403", "0.44872317", "0.44781005", "0.44695154", "0.44455543", "0.44455037", "0.44376054", "0.44123477", "0.4394828", "0.4381291", "0....
0.43432373
24
Unique class is stored as self.unique_class. Total number of classes is stored as self.total_classes_number. Total number of each class is stored in self.class_number_dict. Total number of unique words is stored as self.unique_word_number. Total number of a word in a class is stored in self.class_word_number_dict. otal number of a word in a class is stored in self.class_total_words_dict.
def __init__(self): self.unique_classes = [] self.total_classes_number = 0 self.class_number_dict = {} self.unique_word_number = 0 self.class_word_number_dict = {} self.class_total_words_dict = {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def classes(self):\n if not hasattr(self, '_unique_classes'):\n # build when we don't have\n self._unique_classes = self.data['label'].unique()\n self._unique_classes.sort()\n\n ret = self._unique_classes\n return ret", "def calc_class_weights(self):\n ...
[ "0.7139616", "0.6484298", "0.645103", "0.6282322", "0.6265374", "0.62360275", "0.6218017", "0.61864156", "0.6164485", "0.6155118", "0.6132282", "0.6087209", "0.6073724", "0.6055184", "0.6008472", "0.59811527", "0.59720916", "0.59651655", "0.5958494", "0.59583336", "0.59582025...
0.85412234
0
Given a VPG Buffer with experience data, will return a "loss" fucntion which has the appropriate gradient at the current point.
def actor_loss(self, buffer: VpgBuffer): d = buffer.get_data() weights = d["traj_rewards"] if self.method == "togo": weights = d["togo_rewards"] if self.method == "value baseline": value_est = self.value_estimator.forward(d["observations"]) weights = d["togo_rewards"] - value_est self.update_value_estimator(value_est, d["togo_rewards"]) # Create 1-hot mask in shape of actions (num steps, num actions) action_mask = F.one_hot(d["actions"].long(), self.num_actions) # Use mask to find probabilities of actions taken masked_probs = torch.sum(action_mask.float() * d["log_probs"], dim=1) return - torch.mean(weights * masked_probs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_loss(self):", "def _get_loss(self):\n raise NotImplementedError", "def get_loss(self):\n raise NotImplementedError", "def calc_loss(self, x: np.ndarray, y: np.ndarray) -> float:\n return self.descent.calc_loss(x, y)", "def calc_loss(self, guess: List[float], answer: List[fl...
[ "0.6416822", "0.6347296", "0.63182425", "0.6038801", "0.60385036", "0.6032724", "0.5993929", "0.59879273", "0.5980094", "0.59785765", "0.59736323", "0.59602606", "0.5950128", "0.5936926", "0.5921506", "0.5887945", "0.58785284", "0.58761185", "0.5872854", "0.5868268", "0.58612...
0.62161106
3
Returns list of testing scenarios.
def get(self): args = pagination_arguments.parse_args(request) page = args.get('page', 1) per_page = args.get('per_page', 10) scenarios_query = Scenario.query scenarios_page = scenarios_query.paginate(page, per_page, error_out=False) return scenarios_page
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_scenarios(self):\n pass", "def get_scenarios(experiments):\n return {exp.scenario for exp in experiments}", "def scenario(self):\n scenario = []\n for action in self.application_tree['scenario']:\n scenario.append(action)\n return scenario", "def list(se...
[ "0.7552365", "0.75321794", "0.748281", "0.7339799", "0.71612865", "0.7131704", "0.6966161", "0.69004726", "0.68141985", "0.67672294", "0.67356616", "0.6706442", "0.6704295", "0.65638316", "0.6563266", "0.6548542", "0.6482942", "0.6473726", "0.64700097", "0.6465326", "0.637405...
0.0
-1
Creates a new testing feature.
def post(self): data = request.json create_testing_scenario(data) return None, 201
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_creating_simple_feature():\n # given & when\n feature = Feature(1, \"Feature\", \"I am a feature\", \"foo.feature\", 1, tags=None)\n\n # then\n assert feature.id == 1\n assert feature.keyword == \"Feature\"\n assert feature.sentence == \"I am a feature\"\n assert feature.path == \"foo...
[ "0.7443192", "0.7332406", "0.6775309", "0.6588288", "0.6516284", "0.6390696", "0.6343215", "0.63209987", "0.6284245", "0.6267081", "0.61898476", "0.61158514", "0.6100457", "0.60711426", "0.6067756", "0.6064935", "0.6040366", "0.5992593", "0.59816027", "0.59816027", "0.5961821...
0.6048227
16
Returns a testing scenario.
def get(self, id): return Scenario.query.filter(Scenario.id == id).one()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_scenario(self):\n pass", "def test_get_scenarios(self):\n pass", "def test_create_scenario(self):\n pass", "def test_pytest_bdd_scenario(self):\n self.testdir.makefile(\n \".feature\",\n simple=_SIMPLE_SCENARIO,\n )\n py_file = self...
[ "0.74519163", "0.6740816", "0.6691831", "0.6362659", "0.6309502", "0.60029167", "0.5955433", "0.5872709", "0.57806444", "0.5776758", "0.5729049", "0.57137007", "0.5707406", "0.56670916", "0.56585", "0.562379", "0.55992806", "0.5582827", "0.5573151", "0.55685043", "0.554018", ...
0.5985149
6
Updates a testing scenario.
def put(self, id): data = request.json update_scenario(id, data) return None, 204
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_scenario(self):\n pass", "def test_update(self):\n payload = {\n 'name': 'Pecho inclinado',\n 'description': \"New description\",\n 'muscle_group': \"pecho\"\n }\n response = self.client.put(\n '/exercises/{}/'.format(sel...
[ "0.71119636", "0.63907033", "0.6312588", "0.6248452", "0.6179395", "0.61243194", "0.610072", "0.60918045", "0.60918045", "0.60918045", "0.60252446", "0.5980113", "0.59608054", "0.5916117", "0.5899539", "0.5895658", "0.58752656", "0.5818258", "0.5801083", "0.57950765", "0.5793...
0.66489846
1
Returns list of testing scenarios from a specified time period.
def get(self, year, month=None, day=None): args = pagination_arguments.parse_args(request) page = args.get('page', 1) per_page = args.get('per_page', 10) start_month = month if month else 1 end_month = month if month else 12 start_day = day if day else 1 end_day = day + 1 if day else 31 start_date = '{0:04d}-{1:02d}-{2:02d}'.format(year, start_month, start_day) end_date = '{0:04d}-{1:02d}-{2:02d}'.format(year, end_month, end_day) scenarios_query = Scenario.query.filter(Scenario.pub_date >= start_date).filter(Scenario.pub_date <= end_date) scenarios_page = scenarios_query.paginate(page, per_page, error_out=False) return scenarios_page
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_scenarios(self):\n pass", "def get_scenarios(experiments):\n return {exp.scenario for exp in experiments}", "def list_test_cases(program):\n\n return list(INFO[program].test_cases)", "def tests():\n dates, times = report_date_time()\n return render_template('tests.html',\n ...
[ "0.62741154", "0.62192297", "0.5769575", "0.57031745", "0.5677214", "0.56645775", "0.5624936", "0.55666953", "0.5566421", "0.55393904", "0.55307114", "0.55017877", "0.5470459", "0.543843", "0.5436952", "0.54222584", "0.53873485", "0.5385949", "0.5369037", "0.5338682", "0.5318...
0.0
-1
Mix an image by a constant base color. The base color should be a 1by3 arraylike object representing an RGB color in [0, 255]^3 space. For example, to mix with orange, the transformation RGBTransform().mix_with((255, 127, 0)) might be used. The factor controls the strength of the color to be added. If the factor is 1.0, all pixels will be exactly the new color; if it is 0.0, the pixels will be unchanged.
def mix_with(self, base_color, factor=1.0): base_color = _to_rgb(base_color, "base_color") operation = _embed44((1 - factor) * np.eye(3)) operation[:3, 3] = factor * base_color return self._then(operation)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mix(\n self,\n color: ColorInput,\n percent: float = util.DEF_MIX,\n *,\n in_place: bool = False,\n **interpolate_args: Any\n ) -> 'Color':\n\n # Mix really needs to be between 0 and 1 or steps will break\n domain = interpolate_args.get('domain')\n ...
[ "0.63442767", "0.5894581", "0.5830767", "0.5649231", "0.5571899", "0.5529526", "0.5451907", "0.536669", "0.53180206", "0.5242517", "0.51597506", "0.5142259", "0.5101442", "0.5004268", "0.49906832", "0.49472693", "0.48828548", "0.4848855", "0.48302355", "0.4824658", "0.4820808...
0.80262935
0
Get the underlying 3by4 matrix for this affine transform.
def get_matrix(self): return self._matrix[:3, :]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matrix(self):\n m = Matrix.identity(4, 4)\n\n m[:3, :3] = self.rotation.matrix.data\n m[:3, 3:4] = self.translation.matrix.data\n\n return m", "def getMatrix(self) -> CMatrix4:\n ...", "def affine_matrix(self) -> np.ndarray:\n return self._tf_matrix", "def affine...
[ "0.75755644", "0.7486844", "0.7422143", "0.72932684", "0.72021323", "0.70170355", "0.6829975", "0.67361176", "0.67008865", "0.6670952", "0.6618686", "0.6578109", "0.65628433", "0.655533", "0.6547585", "0.6547585", "0.64912975", "0.6482487", "0.64815784", "0.63949865", "0.6348...
0.72569865
4
Apply this transformation to a copy of the given RGB image. The image should be a PIL image with at least three channels. Specifically, the RGB and RGBA modes are both supported, but L is not. Any channels past the first three will pass through unchanged. The original image will not be modified; a new image of the same mode and dimensions will be returned.
def applied_to(self, image): # PIL.Image.convert wants the matrix as a flattened 12-tuple. # (The docs claim that they want a 16-tuple, but this is wrong; # cf. _imaging.c:767 in the PIL 1.1.7 source.) matrix = tuple(self.get_matrix().flatten()) channel_names = image.getbands() channel_count = len(channel_names) if channel_count < 3: raise ValueError("Image must have at least three channels!") elif channel_count == 3: return image.convert('RGB', matrix) else: # Probably an RGBA image. # Operate on the first three channels (assuming RGB), # and tack any others back on at the end. channels = list(image.split()) rgb = PIL.Image.merge('RGB', channels[:3]) transformed = rgb.convert('RGB', matrix) new_channels = transformed.split() channels[:3] = new_channels return PIL.Image.merge(''.join(channel_names), channels)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __enhance_image(self, img):\n\n blue = self.g.clahe.apply(img[:,:,0])\n green = self.g.clahe.apply(img[:,:,1])\n red = self.g.clahe.apply(img[:,:,2])\n img[:,:,0] = blue\n img[:,:,1] = green\n img[:,:,2] = red\n return img", "def colorize(image, newColor):\n ...
[ "0.61241204", "0.59882116", "0.59521466", "0.5738032", "0.5636173", "0.56255084", "0.5623958", "0.559346", "0.5581521", "0.5567112", "0.5559615", "0.5529105", "0.55037665", "0.5473657", "0.54565656", "0.54229414", "0.5404122", "0.53800154", "0.5358894", "0.5328545", "0.530646...
0.6715946
0
Embed a 4by4 or smaller matrix in the upperleft of I_4.
def _embed44(matrix): result = np.eye(4) r, c = matrix.shape result[:r, :c] = matrix return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_augmented_matrix(self):\r\n for row in range(self.SIZE):\r\n self.matrix[row].append(self.result[row])", "def matrix_3d_to_4x4(matrix: np.matrix) -> np.matrix:\n return np.matrix([\n [matrix.item(0, 0), matrix.item(0, 1), matrix.item(0, 2), 0],\n [matrix.item(1, 0), m...
[ "0.56006694", "0.553187", "0.5439319", "0.54256284", "0.5364134", "0.5332387", "0.53140825", "0.5310225", "0.53080255", "0.52915466", "0.5281834", "0.52639854", "0.52455604", "0.5245288", "0.51908726", "0.5160496", "0.5122607", "0.5120262", "0.5118664", "0.51174915", "0.51112...
0.67249334
0
Convert an arraylike object to a 1by3 numpy array, or fail.
def _to_rgb(thing, name="input"): thing = np.array(thing) assert thing.shape == (3, ), ( "Expected %r to be a length-3 array-like object, but found shape %s" % (name, thing.shape)) return thing
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _to_arraylike(data):\n _load_objects()\n if data is None:\n raise ValueError('Cannot convert None data.')\n return None\n if not isinstance(data, (ndarray, DataArray, DataFrame, Series, Index)):\n data = np.asarray(data)\n if not np.iterable(data):\n data = np.atleast_1d...
[ "0.73346835", "0.6645043", "0.6610088", "0.6549183", "0.6490895", "0.64297026", "0.63836485", "0.6334103", "0.63044345", "0.6172614", "0.6168119", "0.61549824", "0.61300117", "0.6112156", "0.61104345", "0.6069184", "0.6067417", "0.6027023", "0.6001594", "0.5992501", "0.594132...
0.59241664
25
This will first try to load the specified module from the pyrominfo package using the current module search path. If it can't be found, then the parent directory is added to the module search path and the import attempt is repeated.
def loadModule(mod): try: # from pyrominfo import gameboy, etc pyrominfo = __import__("pyrominfo", globals(), locals(), [mod]) except ImportError: import os parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.sys.path.insert(0, parentdir) pyrominfo = __import__("pyrominfo", globals(), locals(), [mod]) try: return getattr(pyrominfo, mod) except AttributeError: raise ImportError("testutils.loadModule() can't find module %s in pyrominfo package" % mod)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _find_module(self, name, path, parent=None):\n\n if parent is not None:\n # assert path is not None\n fullname = parent.identifier + '.' + name\n else:\n fullname = name\n\n node = self.findNode(fullname)\n if node is not None:\n self.msg(...
[ "0.6502171", "0.6038095", "0.5900002", "0.58177245", "0.57946616", "0.57328486", "0.5724542", "0.57179606", "0.5698969", "0.5637101", "0.5621891", "0.5580989", "0.5569779", "0.55592674", "0.55570364", "0.5522914", "0.5515631", "0.5507379", "0.5486642", "0.54800147", "0.547965...
0.7147778
0