Search is not available for this dataset
id
int64
0
10.8M
vector
listlengths
1.54k
1.54k
ast_depth
int64
3
164
ast_data
stringlengths
297
510k
full_path
stringlengths
0
319
code
stringlengths
60
56.5k
1,701
[ 0.01607048325240612, 0.006236777640879154, 0.028817489743232727, -0.008555849082767963, -0.01339908130466938, -0.044635556638240814, 0.004283183254301548, 0.037820324301719666, 0.0026451090816408396, 0.005069354083389044, -0.012589246034622192, 0.052376311272382736, 0.0176270492374897, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def restore_wallet_existent_name(self): node = self.nodes[3] backup_file = os.path.join(self.nodes[0].datadir, 'wallet.bak') wallet_name = "res0" wallet_file = os.path.join(node.datadir, self.chain, 'wallets', wallet_name) error_message = "Failed to create database path '{}'. Dat...
1,702
[ 0.028899438679218292, -0.026698315516114235, 0.06416918337345123, -0.021700473502278328, -0.006279671564698219, -0.030867500230669975, 0.003664220916107297, 0.016870953142642975, 0.01890375465154648, 0.02276219241321087, 0.011698316782712936, 0.04720759391784668, -0.0297021996229887, -0.06...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def run_test(self): self.log.info("Generating initial blockchain") self.generate(self.nodes[0], 1) self.generate(self.nodes[1], 1) self.generate(self.nodes[2], 1) self.generate(self.nodes[3], COINBASE_MATURITY) assert_equal(self.nodes[0].getbalance(), 50) assert_...
1,703
[ -0.007350791711360216, 0.0015449040802195668, -0.03839170187711716, 0.024477249011397362, 0.01529827993363142, 0.011997406370937824, -0.01261314656585455, 0.0005022723926231265, 0.06017746776342392, 0.030494995415210724, 0.04867519065737724, -0.02159533090889454, 0.0070714871399104595, -0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def get_state(self): status = {} state = {} response = self.emulator._run_telnet('power display') for line in response: if ':' in line: field, value = line.split(':') value = value.strip() if value == 'true': ...
1,704
[ 0.01727544702589512, -0.014875450171530247, -0.02848297730088234, 0.008077346719801426, 0.003096221946179867, 0.0310641061514616, -0.010471682995557785, -0.00897168554365635, 0.038671642541885376, -0.009837721474468708, 0.01605280674993992, -0.039735790342092514, 0.024792417883872986, -0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "emulator", "annotation...
class EmulatorBattery(object): def __init__(self, emulator): self.emulator = emulator def get_state(self): status = {} state = {} response = self.emulator._run_telnet('power display') for line in response: if ':' in line: field, value = line...
1,705
[ 0.03200305625796318, 0.045734863728284836, -0.008522799238562584, 0.002171838656067848, 0.009725751355290413, 0.022061681374907494, -0.014980154111981392, -0.0921960398554802, -0.013164377771317959, -0.02323058620095253, 0.005963690113276243, -0.046574659645557404, -0.004587672185152769, -...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class InfCadRecebido(conscad_101.InfCadRecebido): def __init__(self): super(InfCadRecebido, self).__init__() self.indCredNFe = TagInteiro(nome='indCredNFe', codigo='GR12a' , tamanho=[1, 1, 1], raiz='//infCad') self.indCredCTe = TagInteiro(nome='indCredCTe', codigo='GR12b' , tamanho=[1, 1, 1]...
1,706
[ 0.05498172715306282, 0.03713877126574516, 0.01757054403424263, 0.009330094791948795, 0.015561508014798164, 0.03886404260993004, -0.013938389718532562, -0.061428800225257874, -0.01728678122162819, -0.03952237218618393, -0.015606909990310669, -0.039068352431058884, 0.03302989900112152, 0.005...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class InfConsRecebido(conscad_101.InfConsRecebido): def __init__(self): super(InfConsRecebido, self).__init__() def get_xml(self): return super(InfConsRecebido, self).get_xml() def set_xml(self, arquivo): super(InfConsRecebido, self).set_xml(arquivo) if self._le_xml(arquiv...
1,707
[ 0.04455766826868057, 0.03588910028338432, 0.03535374999046326, -0.03356238454580307, 0.027817655354738235, 0.04021308943629265, 0.058394428342580795, -0.002568654716014862, -0.02633514627814293, 0.03883352875709534, 0.012879307381808758, 0.000323655636748299, -0.006671295966953039, -0.0294...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class Register(): def __init__(self): pass def write(self, path, data): with open(path, 'w') as csvfile: writer = csv.DictWriter(csvfile, fieldnames=formatter.COLS) writer.writeheader() DATE = formatter.DATE for row in data: row[D...
1,708
[ 0.05574173852801323, 0.021079128608107567, 0.057073451578617096, -0.06057395786046982, 0.040636297315359116, -0.011966400779783726, 0.009759560227394104, -0.0053886850364506245, -0.03226552531123161, 0.01512446440756321, -0.007134181447327137, -0.004970146343111992, -0.011690545827150345, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}, {"_type": "arg...
def write(self, path, data): with open(path, 'w') as csvfile: writer = csv.DictWriter(csvfile, fieldnames=formatter.COLS) writer.writeheader() DATE = formatter.DATE for row in data: row[DATE] = datetime.strftime(row[DATE], '%Y-%m-%d %H:%M:%S') ...
1,709
[ -0.023277603089809418, -0.028699370101094246, -0.012492120265960693, -0.013908512890338898, 0.032484155148267746, -0.041446905583143234, -0.025866582989692688, 0.028467174619436264, 0.018819449469447136, 0.0003437582345213741, 0.009258797392249107, -0.038544461131095886, -0.04281685873866081...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "MockRequest", "annotat...
class RequestTestCasePy2(TestCase): @patch('pybutton.request.urlopen') @patch('pybutton.request.Request') def test_get_request(self, MockRequest, mock_url_open): if sys.version_info[0] == 2: url = 'http://usebutton.com/api' method = 'GET' headers = {'a': 1, 'b': ...
1,710
[ -0.030431784689426422, -0.028741128742694855, -0.004098646808415651, -0.04457613453269005, 0.007101939991116524, -0.04093289375305176, -0.021204618737101555, 0.01267991028726101, 0.03162238746881485, 0.001264270395040512, 0.015323045663535595, -0.036646727472543716, -0.029407866299152374, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "MockRequest", "annotation": null, "type_comment": null}}, {"_type...
def test_get_request(self, MockRequest, mock_url_open): if sys.version_info[0] == 2: url = 'http://usebutton.com/api' method = 'GET' headers = {'a': 1, 'b': 2} instance = MockRequest.return_value mock_response = Mock() mock_response.read....
1,711
[ -0.04021225497126579, -0.03185058385133743, -0.01301895547658205, -0.015413109213113785, 0.01030915416777134, -0.05603034421801567, -0.01611587032675743, 0.012280460447072983, 0.03692476078867912, 0.024513276293873787, 0.015901468694210052, -0.04335681349039078, -0.04223715886473656, 0.017...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "MockRequest", "annotation": null, "type_comment": null}}, {"_type...
def test_post_request(self, MockRequest, mock_url_open): if sys.version_info[0] == 2: url = 'http://usebutton.com/api' method = 'POST' headers = {} instance = MockRequest.return_value mock_response = Mock() mock_response.read.return_value...
1,712
[ -0.011543713510036469, -0.010151085443794727, 0.00874727126210928, -0.009703654795885086, 0.026510274037718773, -0.03912781924009323, -0.01722608506679535, -0.0056963530369102955, 0.02114110440015793, 0.023557230830192566, 0.02628655731678009, -0.04055960103869438, -0.048009321093559265, 0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "MockRequest", "annotation": null, "type_comment": null}}, {"_type...
def test_post_request_with_data(self, MockRequest, mock_url_open): if sys.version_info[0] == 2: url = 'http://usebutton.com/api' method = 'POST' headers = {} data = {'a': {'b': 'c'}} instance = MockRequest.return_value mock_response = Moc...
1,713
[ -0.030271679162979126, -0.03718024864792824, -0.005729912780225277, -0.02141423709690571, 0.034869611263275146, -0.04345864802598953, -0.026583995670080185, 0.025183608755469322, 0.018975231796503067, -0.0038889888674020767, 0.013828812167048454, -0.026513975113630295, -0.025860462337732315,...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "MockRequest", "annotat...
class RequestTestCasePy3(TestCase): @patch('pybutton.request.urlopen') @patch('pybutton.request.Request') def test_get_request(self, MockRequest, mock_url_open): if sys.version_info[0] == 3: url = 'http://usebutton.com/api' method = 'GET' headers = {'a': 1, 'b': ...
1,714
[ -0.026567496359348297, 0.015114370733499527, 0.007803615182638168, -0.014680184423923492, 0.03820837661623955, -0.05585745722055435, -0.00420984486117959, 0.0005229302332736552, 0.019726131111383438, -0.006847232114523649, 0.017719486728310585, -0.04848802834749222, -0.05036558955907822, 0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "MockRequest", "annotation": null, "type_comment": null}}, {"_type...
def test_raises_with_invalid_response_data(self, MockRequest, mock_url_open): if sys.version_info[0] == 2: url = 'http://usebutton.com/api' method = 'GET' headers = {} mock_response = Mock() mock_response...
1,715
[ -0.04089481756091118, -0.029193632304668427, -0.006616036407649517, -0.016934679821133614, 0.01771792396903038, -0.06379876285791397, -0.015902221202850342, 0.008912364952266216, 0.03405923768877983, 0.014549346640706062, 0.01511897798627615, -0.0418679416179657, -0.04473983496427536, 0.01...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "MockRequest", "annotation": null, "type_comment": null}}, {"_type...
def test_post_request(self, MockRequest, mock_url_open): if sys.version_info[0] == 3: url = 'http://usebutton.com/api' method = 'POST' headers = {} instance = MockRequest.return_value mock_response = Mock() mock_response.read.return_value...
1,716
[ -0.033688124269247055, -0.025814203545451164, -0.0031206896528601646, -0.04686633497476578, 0.01578320562839508, -0.04816293716430664, -0.021712221205234528, 0.012117352336645126, 0.03366455063223839, -0.008080199360847473, 0.014356940984725952, -0.03392387181520462, -0.028902478516101837, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "MockRequest", "annotation": null, "type_comment": null}}, {"_type...
def test_get_request(self, MockRequest, mock_url_open): if sys.version_info[0] == 3: url = 'http://usebutton.com/api' method = 'GET' headers = {'a': 1, 'b': 2} instance = MockRequest.return_value mock_response = Mock() mock_response.read....
1,717
[ -0.014940948225557804, -0.009637695737183094, 0.00766647607088089, -0.011362512595951557, 0.029209889471530914, -0.04229161888360977, -0.020440202206373215, -0.006216061767190695, 0.024998648092150688, 0.017673775553703308, 0.02459544502198696, -0.03680356591939926, -0.049504492431879044, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "MockRequest", "annotation": null, "type_comment": null}}, {"_type...
def test_post_request_with_data(self, MockRequest, mock_url_open): if sys.version_info[0] == 3: url = 'http://usebutton.com/api' method = 'POST' headers = {} data = {'a': {'b': 'c'}} instance = MockRequest.return_value mock_response = Moc...
1,718
[ -0.033798255026340485, 0.008815908804535866, 0.010777626186609268, -0.021980684250593185, 0.0375562459230423, -0.060884132981300354, -0.004602944478392601, -0.000847172224894166, 0.026164105162024498, -0.010511730797588825, 0.017820898443460464, -0.045781273394823074, -0.04311050474643707, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "MockRequest", "annotation": null, "type_comment": null}}, {"_type...
def test_raises_with_invalid_response_data(self, MockRequest, mock_url_open): if sys.version_info[0] == 3: url = 'http://usebutton.com/api' method = 'GET' headers = {} mock_response = Mock() mock_response...
1,719
[ 0.007097412832081318, -0.030111609026789665, -0.022827273234725, 0.0022331643849611282, 0.020969372242689133, -0.01899818331003189, 0.008943986147642136, 0.05161342769861221, 0.017593426629900932, 0.0027684441301971674, 0.00932349730283022, -0.014228811487555504, 0.025172308087348938, -0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_query_dict(self): url = 'https://api.usebutton.com:/test/url?cursor=test_cursor' result = query_dict(url) self.assertEqual(result.get('cursor'), ['test_cursor']) self.assertEqual(result.get('random_key'), None) no_query_url = 'https://api.usebutton.com:/test/url' ...
1,720
[ -0.011014601215720177, -0.04745421186089516, 0.008848686702549458, -0.012342449277639389, 0.05507300794124603, -0.03330501914024353, -0.028581367805600166, 0.0017917774384841323, 0.04375365376472473, 0.03617839515209198, -0.012103000655770302, 0.01587974652647972, -0.015106983482837677, -0...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_request_url(self): path = request_url( True, 'api.usebutton.com', 443, '/v1/api/btnorder-XXX' ) self.assertEqual( path, 'https://api.usebutton.com:443/v1/api/btnorder-XXX' ) path = request_url(Fals...
1,721
[ 0.03504743427038193, 0.008300024084746838, 0.06572370231151581, -0.020398804917931557, -0.013035460375249386, -0.011220643296837807, 0.0021416794043034315, 0.015871519222855568, 0.002657178556546569, -0.005470470059663057, 0.03913240134716034, 0.007057622075080872, 0.009815623983740807, -0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def setUp(self): self.backends = list(resolver.backends) resolver.backends = [] resolver.load_backends(('dbindexer.backends.BaseResolver', 'dbindexer.backends.FKNullFix', # 'dbindexer.backends.InMemoryJOINResolver', 'dbindexer.back...
1,722
[ -0.006252256687730551, 0.0002954671799670905, 0.04118213802576065, -0.03000040538609028, -0.002117752330377698, 0.015221752226352692, -0.006467289756983519, 0.0002885437570512295, 0.01737208478152752, 0.02768065221607685, 0.051425542682409286, -0.025660641491413116, 0.009357207454741001, -...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestIndexed(TestCase): def setUp(self): self.backends = list(resolver.backends) resolver.backends = [] resolver.load_backends(('dbindexer.backends.BaseResolver', 'dbindexer.backends.FKNullFix', # 'dbindexer.backends.InMemoryJOINResolver', ...
1,723
[ -0.011993993073701859, -0.016863973811268806, 0.049982380121946335, -0.0450044609606266, 0.006698604207485914, 0.017905274406075478, 0.01688937097787857, 0.0024286408443003893, 0.00991139467805624, 0.026515042409300804, 0.03324539586901665, -0.040839262306690216, 0.023962588980793953, -0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_joins(self): self.assertEqual(2, len(Indexed.objects.all().filter( foreignkey__fk__name_fi2__iexact='juuBi', foreignkey__title__iexact='biJuu'))) self.assertEqual(0, len(Indexed.objects.all().filter( foreignkey__fk__name_fi2__iexact='juuBi', ...
1,724
[ 0.018333571031689644, 0.006462041288614273, 0.02467440813779831, -0.056493423879146576, -0.021982422098517418, 0.04376071318984032, 0.002481475006788969, 0.013766125775873661, 0.0030460264533758163, 0.007973890751600266, 0.044066913425922394, -0.0119416993111372, 0.0458785779774189, -0.039...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def register_indexex(self): register_index(Indexed, { 'name': ('iexact', 'endswith', 'istartswith', 'iendswith', 'contains', 'icontains', re.compile('^i+', re.I), re.compile('^I+'), re.compile('^i\d*i$', re.I)), 'published': ('month', 'day', 'yea...
1,725
[ 0.004651940893381834, 0.04540134593844414, 0.003930690232664347, -0.004085422493517399, 0.02256091497838497, 0.013197137042880058, -0.020943716168403625, -0.00582490861415863, 0.04887532815337181, 0.02607482671737671, 0.031086144968867302, -0.012218832038342953, -0.022241467610001564, 0.02...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "x", "annotation": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "ndarray", "value": {"_type": "Name", "_fields": {"...
def _check(x: np.ndarray, name: str) -> np.ndarray: if np.issubdtype(x.dtype, np.integer): return x y = x.astype(np.int64, casting="unsafe") if np.any(y != x): raise ValueError( f"{name} must have an integral dtype. Found data with " f"dtyp...
1,726
[ 0.017924653366208076, -0.024944845587015152, 0.0027706597466021776, -0.010108602233231068, 0.01652299053966999, -0.028840994462370872, -0.01273375004529953, 0.019991513341665268, 0.003129984252154827, 0.002939928323030472, 0.05578142777085304, -0.0003168218245264143, -0.009918546304106712, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_iexact(self): self.assertEqual(1, len(Indexed.objects.filter(name__iexact='itaChi'))) self.assertEqual(1, Indexed.objects.filter(name__iexact='itaChi').count()) self.assertEqual(2, ForeignIndexed.objects.filter(title__iexact='BIJUU').count()) self.assertEqual(1, Foreign...
1,727
[ -0.0038629197515547276, -0.0012452041264623404, 0.01574094593524933, -0.011534522287547588, -0.010726984590291977, -0.022418193519115448, -0.007737892679870129, 0.011040357872843742, 0.02359936758875847, -0.006207187660038471, 0.02605813555419445, 0.026588458567857742, 0.005703983828425407, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "count", "annotation": {"_type": "Name", "_fields": {"id": "int", "ctx": {"_type": "Load", "_fields": {}}}}, "type_comment": null}}, {"_type": "arg", "_fi...
def func_factory(count: int, nobs: int) -> Callable[[float], float]: if hasattr(stats, "binomtest"): def func(qi): return stats.binomtest(count, nobs, p=qi).pvalue - alpha else: # Remove after min SciPy >= 1.7 def func(qi): ...
1,728
[ 0.016900204122066498, -0.019568657502532005, 0.003690742887556553, -0.0524795837700367, -0.018679173663258553, 0.0014608546625822783, -0.039236146956682205, -0.004360944498330355, 0.045610785484313965, 0.018123244866728783, 0.021471166983246803, -0.005781649146229029, -0.03394865617156029, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TagsTests(fit_common.unittest.TestCase): def setUp(self): self.__client = config.api_client def __get_data(self): return loads(self.__client.last_response.data) def __create_tag_rule(self, id): Api().nodes_get_catalog_source_by_id(identifier=id, source='dmi') updated_...
1,729
[ 0.03753020241856575, -0.021079691126942635, -0.009416422806680202, -0.039133477956056595, -0.04132387042045593, -0.0388399213552475, -0.03588176518678665, 0.04168517142534256, 0.02908477932214737, -0.0010408591479063034, 0.0209667831659317, -0.029671894386410713, -0.021678095683455467, -0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_tags_start_clean(self): # """ Clean up any pre-existing test tags""" logs.info("Deleting any tags created from previous script runs") all_tags = [] Api().get_all_tags() rsp = self.__client.last_response all_tags = self.__get_data() if all_tags: ...
1,730
[ 0.0052254293113946915, -0.00917738489806652, -0.027263108640909195, -0.01858196221292019, -0.06366175413131714, -0.018522173166275024, -0.025636889040470123, -0.031017765402793884, -0.011389522813260555, 0.01925158128142357, -0.001393049256876111, -0.033074457198381424, -0.006875564809888601...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "id", "annotation": null, "type_comment": null}}], "kwarg": null, ...
def __create_tag_rule(self, id): Api().nodes_get_catalog_source_by_id(identifier=id, source='dmi') updated_catalog = self.__get_data() return { "name": id, "rules": [ { "equals": updated_catalog["data"]["System Information"]["Manufactur...
1,731
[ -0.005489078350365162, -0.023203300312161446, 0.012003717012703419, -0.03657054528594017, -0.016560466960072517, -0.001373726292513311, -0.02960139885544777, 0.01487062405794859, 0.050485532730817795, 0.01798226684331894, 0.013903333805501461, -0.022865332663059235, -0.04328330233693123, 0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_tags(self): # """ Testing GET:/api/2.0/tags """ Api().nodes_get_all() nodes = self.__get_data() tagsArray = [] for n in nodes: if n.get('type') == 'compute': tagsWithRules = self.__create_tag_rule(n.get('id')) self.assertNotEqu...
1,732
[ -0.0028532056603580713, -0.012141764163970947, -0.006119840778410435, -0.020660582929849625, 0.004656518809497356, -0.0252409428358078, -0.003957496955990791, 0.015340400859713554, 0.06414680927991867, 0.020366830751299858, 0.009905981831252575, -0.009013845585286617, -0.044693876057863235, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_tag_create(self): # """ Testing POST:/api/2.0/tags/ """ Api().nodes_get_all() nodes = self.__get_data() for node in nodes: if node.get('type') == 'compute': tagsWithRules = self.__create_tag_rule(node.get('id')) self.assertNotEqual(len...
1,733
[ -0.0151234595105052, -0.03095683827996254, 0.010019560344517231, -0.02473965659737587, 0.0010305949253961444, -0.0008860561647452414, -0.03556056693196297, 0.037625789642333984, 0.041089341044425964, -0.011767471209168434, 0.008266272023320198, -0.0014198410790413618, -0.03594779595732689, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_tags_tagname(self): # """ Testing GET:/api/2.0/tags/:tagName """ Api().nodes_get_all() nodes = self.__get_data() for node in nodes: if node.get('type') == 'compute': Api().get_tag(tag_name=node.get("id")) rsp = self.__client.last_respo...
1,734
[ 0.00022038316819816828, -0.016170721501111984, -0.004232988227158785, -0.038540035486221313, -0.0009705694974400103, -0.002370690694078803, -0.01858491078019142, 0.017780181020498276, 0.0390620231628418, 0.0028546161483973265, 0.0023530193138867617, 0.004249299876391888, -0.03629984334111214...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_nodes_tagname(self): # """ Testing GET:/api/2.0/tags/:tagName/nodes """ Api().nodes_get_all() nodes = self.__get_data() for node in nodes: Api().get_nodes_by_tag(tag_name=node.get('id')) nodesWithTags = self.__get_data() for tagged_node in nod...
1,735
[ 0.03672102093696594, 0.00003054156695725396, -0.019722124561667442, -0.03625296428799629, -0.02967892400920391, 0.018871115520596504, -0.019115779548883438, 0.0450609065592289, 0.048932995647192, 0.010462086647748947, 0.036018937826156616, -0.009983394294977188, -0.03227449953556061, 0.005...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_tags_del(self): # """ Testing DELETE:api/2.0/tags/:tagName """ logs.info("Deleting tag that was created in Testing POST:/api/2.0/tags/") Api().nodes_get_all() nodes = self.__get_data() for node in nodes: if node.get('type') == 'compute': Api()...
1,736
[ 0.013795239850878716, -0.021028419956564903, 0.002237065928056836, -0.03626532480120659, 0.024172740057110786, 0.020320015028119087, -0.013670957647264004, -0.009401890449225903, 0.02357618883252144, -0.0011138723930343986, 0.04347364604473114, -0.03795555233955383, 0.009190612472593784, -...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def test_firewall_vip64_creation(mocker): schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema') set_method_result = {'status': 'success', 'http_method': 'POST', 'http_status': 200} set_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios...
1,737
[ 0.01986490748822689, -0.006104778964072466, -0.021034911274909973, -0.033187855035066605, 0.004897032864391804, 0.045164670795202255, -0.025211699306964874, 0.0034030762035399675, 0.031476881355047226, 0.0017990384949371219, 0.053845345973968506, -0.04836016520857811, 0.0018493612296879292, ...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def test_firewall_vip64_removal(mocker): schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema') delete_method_result = {'status': 'success', 'http_method': 'POST', 'http_status': 200} delete_method_mock = mocker.patch('ansible.module_utils.network.fortios.fo...
1,738
[ 0.012125138193368912, -0.017431044951081276, 0.015676820650696754, -0.0382717028260231, 0.017295153811573982, 0.02680748887360096, -0.004719106014817953, -0.012149845249950886, 0.023793190717697144, -0.0008717066375538707, 0.03903763368725777, -0.046301595866680145, 0.003808022243902087, -...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def test_firewall_vip64_creation_fails(mocker): schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema') set_method_result = {'status': 'error', 'http_method': 'POST', 'http_status': 500} set_method_mock = mocker.patch('ansible.module_utils.network.fortios.for...
1,739
[ 0.02230520360171795, 0.0023347302339971066, -0.002536079613491893, -0.036937613040208817, 0.005450265482068062, 0.0493813119828701, -0.007377685979008675, 0.013402796350419521, 0.02683018520474434, 0.0005971314385533333, 0.054496508091688156, -0.053070154041051865, -0.0039255437441170216, ...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def test_firewall_vip64_deletion_fails(mocker): schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema') delete_method_result = {'status': 'error', 'http_method': 'POST', 'http_status': 500} delete_method_mock = mocker.patch('ansible.module_utils.network.forti...
1,740
[ 0.012584598734974861, -0.02175794169306755, -0.00332182296551764, -0.019573204219341278, 0.024006560444831848, 0.03832872956991196, -0.014386049471795559, -0.00688000675290823, 0.02749447338283062, -0.0017056283541023731, 0.046224445104599, -0.05616436153650284, 0.009984633885324001, -0.02...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def test_firewall_vip64_idempotent(mocker): schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema') set_method_result = {'status': 'error', 'http_method': 'DELETE', 'http_status': 404} set_method_mock = mocker.patch('ansible.module_utils.network.fortios.forti...
1,741
[ 0.033389847725629807, 0.06832042336463928, -0.0027072848752141, -0.03103472851216793, 0.0037912994157522917, -0.008226403966546059, -0.0063995374366641045, -0.033279795199632645, -0.0007813708507455885, 0.05863582715392113, 0.018169622868299484, 0.003978387918323278, 0.01124733779579401, -...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "module", "annotation":...
class VmAttributeDefManager(PyVmomi): def __init__(self, module): super(VmAttributeDefManager, self).__init__(module) def remove_custom_def(self, field): changed = False f = dict() for x in self.custom_field_mgr: if x.name == field and x.managedObjectType == vim.Virt...
1,742
[ 0.0016101469518616796, -0.01210717298090458, -0.007651934400200844, -0.032445210963487625, 0.02841787599027157, 0.029902955517172813, -0.0145109873265028, -0.02322009764611721, 0.0198472049087286, -0.0033791849855333567, 0.04787493124604225, -0.04447687044739723, 0.01012496929615736, -0.00...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def test_firewall_vip64_filter_foreign_attributes(mocker): schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema') set_method_result = {'status': 'success', 'http_method': 'POST', 'http_status': 200} set_method_mock = mocker.patch('ansible.module_utils.networ...
1,743
[ 0.05108598619699478, 0.03649669140577316, -0.007757892832159996, -0.02838110364973545, -0.013275789096951485, -0.005333184730261564, -0.02081671915948391, 0.002357273595407605, 0.018013792112469673, 0.04679363965988159, 0.04747384786605835, -0.010226579383015633, -0.0014139243867248297, -0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "field", "annotation": null, "type_comment": null}}], "kwarg": nul...
def remove_custom_def(self, field): changed = False f = dict() for x in self.custom_field_mgr: if x.name == field and x.managedObjectType == vim.VirtualMachine: changed = True if not self.module.check_mode: self.content.customFields...
1,744
[ 0.03536151349544525, 0.038753680884838104, -0.005378049332648516, -0.017570937052369118, -0.015655217692255974, -0.011280786246061325, -0.00994466245174408, -0.02279341034591198, 0.008321791887283325, 0.04739272594451904, 0.028528369963169098, -0.0016442249761894345, 0.017863787710666656, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "field", "annotation": null, "type_comment": null}}], "kwarg": nul...
def add_custom_def(self, field): changed = False found = False f = dict() for x in self.custom_field_mgr: if x.name == field: found = True f[x.name] = (x.key, x.managedObjectType) if not found: changed = True if not...
1,745
[ 0.006657018326222897, -0.03494015336036682, 0.050509974360466, 0.010200073011219501, -0.0026235764380544424, -0.009703554213047028, -0.01635444350540638, 0.023281175643205643, 0.009354152716696262, 0.02716750092804432, 0.018573449924588203, -0.0058080339804291725, -0.03155647590756416, -0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestDetSmallCase(unittest.TestCase): def setUp(self): self.x = numpy.random.uniform(.5, 1, (2, 2)).astype(numpy.float32) def check_by_definition(self, x): ans = F.det(chainer.Variable(x)).data y = x[0, 0] * x[1, 1] - x[0, 1] * x[1, 0] testing.assert_allclose(ans, y) ...
1,746
[ 0.010544149205088615, 0.04242010787129402, -0.020771728828549385, -0.018409645184874535, -0.015804046764969826, 0.047192979604005814, -0.003196119097992778, -0.00041853939183056355, 0.046413734555244446, 0.06638187170028687, 0.023340800777077675, -0.04780176281929016, 0.03852388635277748, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def main(): argument_spec = vmware_argument_spec() argument_spec.update( attribute_key=dict(type='str'), state=dict(type='str', default='present', choices=['absent', 'present']), ) module = AnsibleModule( argument_spec=argument_spec, supports_check_mode=True, requ...
1,747
[ 0.004230613820254803, -0.035637542605400085, 0.060758303850889206, 0.03080938383936882, -0.006292141508311033, 0.0076545425690710545, 0.0024081035517156124, 0.046034812927246094, 0.0023797200992703438, -0.008843655698001385, -0.007552959956228733, 0.03112010657787323, -0.007576861884444952, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestDetGPUCPUConsistency(unittest.TestCase): def setUp(self): self.x = numpy.random.uniform(.5, 1, self.shape).astype(numpy.float32) @attr.gpu @condition.retry(3) def test_answer_gpu_cpu(self): x = cuda.to_gpu(self.x) y = F.det(chainer.Variable(x)) gpu = cuda.to_c...
1,748
[ -0.005766835995018482, -0.032857831567525864, 0.06285015493631363, 0.03371748328208923, -0.02540750987827778, -0.011987377889454365, 0.0009089034865610301, 0.03538903221487999, -0.014232026413083076, -0.033526450395584106, -0.004501236602663994, 0.03887540102005005, -0.014996161684393883, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestBatchDetGPUCPUConsistency(unittest.TestCase): def setUp(self): self.x = numpy.random.uniform(.5, 1, self.shape).astype(numpy.float32) @attr.gpu @condition.retry(3) def test_answer_gpu_cpu(self): x = cuda.to_gpu(self.x) y = F.batch_det(chainer.Variable(x)) gpu ...
1,749
[ 0.002041878644376993, -0.017567861825227737, 0.06652553379535675, -0.0034288151655346155, 0.03404514119029045, 0.003894090885296464, -0.014224989339709282, -0.005695922765880823, -0.029872477054595947, 0.011960845440626144, -0.008499431423842907, -0.007112494669854641, -0.0024330660235136747...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class DetFunctionRaiseTest(unittest.TestCase): def test_invalid_ndim(self): with self.assertRaises(type_check.InvalidType): F.batch_det(chainer.Variable(numpy.zeros((2, 2)))) def test_invalid_shape(self): with self.assertRaises(type_check.InvalidType): F.batch_det(chain...
1,750
[ 0.03679277375340462, 0.02111819200217724, 0.0700138509273529, -0.0023156856186687946, 0.01801985315978527, -0.024808228015899658, 0.030251838266849518, 0.04759392887353897, -0.022721152752637863, -0.01650295779109001, -0.02648649550974369, 0.01100555807352066, -0.006874439772218466, 0.0090...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {...
class Migration(migrations.Migration): dependencies = [ ('custom_user', '0001_initial_django17'), ] operations = [ migrations.AlterField( model_name='emailuser', name='groups', field=models.ManyToManyField(to='auth.Group', verbose_name='groups', blank=Tr...
1,751
[ 0.04358932003378868, -0.029184170067310333, 0.06443829834461212, -0.006960655562579632, 0.020618055015802383, -0.009715227410197258, 0.03336276113986969, -0.010754377581179142, 0.009687736630439758, 0.01797894388437271, -0.0019257264211773872, -0.03331877663731575, -0.015570755116641521, 0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class SelectElementHandlingTests(unittest.TestCase): def testShouldBeAbleToChangeTheSelectedOptionInASelect(self): self._loadPage("formPage") selectBox = self.driver.find_element(by=By.XPATH, value="//select[@name='selectomatic']") options = selectBox.find_elements(by=By.TAG_NAME, value="op...
1,752
[ 0.06325866281986237, -0.02720401994884014, 0.010970113798975945, -0.005633537657558918, 0.01612909510731697, -0.009106825105845928, 0.03051135689020157, -0.009397963993251324, 0.047001466155052185, 0.00020452508761081845, 0.02943996526300907, -0.028485029935836792, -0.01842327043414116, 0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testShouldBeAbleToChangeTheSelectedOptionInASelect(self): self._loadPage("formPage") selectBox = self.driver.find_element(by=By.XPATH, value="//select[@name='selectomatic']") options = selectBox.find_elements(by=By.TAG_NAME, value="option") one = options[0] two = options[1] ...
1,753
[ 0.026009900495409966, -0.0072777243331074715, 0.0069411820732057095, -0.046082235872745514, -0.037860993295907974, 0.027404148131608963, 0.06504879146814346, 0.002710366388782859, 0.008702018298208714, -0.022656498476862907, 0.03483211249113083, -0.02174302749335766, 0.005543930921703577, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def reset_playing(): path = xbmc.translatePath(ADDON.getAddonInfo('profile')) if not os.path.exists(path): os.mkdir(path) proc_file = os.path.join(path, 'proc') f = open(proc_file, 'w') f.write('') f.close()
1,754
[ 0.06659641116857529, -0.028357619419693947, 0.044465288519859314, 0.007309362757951021, 0.017957570031285286, -0.0031104269437491894, 0.03936678171157837, 0.012227389961481094, 0.006655129604041576, 0.025695567950606346, -0.00012654616148211062, -0.04078804701566696, -0.006203934084624052, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testShouldBeAbleToSelectMoreThanOneOptionFromASelectWhichAllowsMultipleChoices(self): self._loadPage("formPage") multiSelect = self.driver.find_element(by=By.ID, value="multi") options = multiSelect.find_elements(by=By.TAG_NAME, value="option") for option in options: if ...
1,755
[ 0.03749549388885498, 0.007664693985134363, 0.05493030697107315, -0.05507224425673485, 0.016050910577178, -0.01793159916996956, 0.031936224550008774, -0.007753405719995499, 0.019694006070494652, 0.02340807020664215, 0.023715604096651077, 0.04771508648991585, -0.029570579528808594, 0.0235381...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _flush(self): if self._date_line is None or not self._changes_buffer.getvalue(): return to_file = self.to_file print >> to_file, self._date_line print >> to_file s = self._changes_buffer.getvalue() to_file.write(s) self._changes_buffer.truncate(0)
1,756
[ 0.053402211517095566, 0.029513034969568253, 0.030246581882238388, -0.026921169832348824, -0.016272515058517456, -0.03533250465989113, -0.019451217725872993, -0.03657953441143036, 0.0026056196074932814, 0.031640321016311646, 0.022202018648386, 0.0017299479804933071, -0.007353807333856821, 0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "revno", "annotation": null, "type_comment": null}}, {"_type": "ar...
def show(self, revno, rev, delta, tags=None): to_file = self.to_file if tags is not None: self._flush() print >> to_file, u"=== %s ===" % ', '.join(tags) date_str = time.strftime("%Y-%m-%d", time.localtime(rev.timestamp)) if hasattr(rev, "get_apparent_authors"): ...
1,757
[ -0.024164076894521713, 0.0056160371750593185, -0.0007579796365462244, -0.034705910831689835, -0.01703350618481636, 0.01044485904276371, 0.01045056339353323, -0.03532199189066887, 0.016029521822929382, 0.013439699076116085, 0.012253171764314175, -0.04050163924694061, 0.04143717139959335, -0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client_manager", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parsed_args", "annotation": null, "type_comment": null}...
def _get_attrs_network(client_manager, parsed_args): attrs = {} if parsed_args.name is not None: attrs['name'] = parsed_args.name if parsed_args.enable: attrs['admin_state_up'] = True if parsed_args.disable: attrs['admin_state_up'] = False if parsed_args.share: attrs[...
1,758
[ 0.0399734303355217, 0.032960548996925354, 0.03546515107154846, -0.035966068506240845, -0.014501639641821384, 0.0146143464371562, 0.011045290157198906, -0.04337969049811363, 0.01748211495578289, 0.037869565188884735, 0.008371628820896149, 0.04285372421145439, -0.01972373202443123, 0.0586076...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "revno", "annotation": null, "type_comment": null}}, {"_type": "ar...
def _show_changes(self, revno, rev, delta): to_file = self._changes_buffer output_standalone_message = True shortlog, paragraphs = self._split_message(rev.message) shortlog = u"[%s] %s" % (revno, shortlog) bugs_text = rev.properties.get('bugs', '') if bugs_text: ...
1,759
[ -0.011127383448183537, 0.013313702307641506, -0.008592993952333927, -0.033588819205760956, -0.02480003423988819, -0.0036900928243994713, -0.0043481639586389065, -0.025561438873410225, 0.054995160549879074, -0.010219136252999306, 0.013368087820708752, -0.044531289488077164, 0.0462063774466514...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client_manager", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parsed_args", "annotation": null, "type_comment": null}...
def _get_attrs_compute(client_manager, parsed_args): attrs = {} if parsed_args.name is not None: attrs['name'] = parsed_args.name if parsed_args.share: attrs['share_subnet'] = True if parsed_args.no_share: attrs['share_subnet'] = False if parsed_args.subnet is not None: ...
1,760
[ -0.04720325395464897, 0.010332410223782063, 0.05487753078341484, -0.023687371984124184, -0.029560983180999756, 0.0050188289023935795, -0.002388834021985531, -0.005460957530885935, -0.02012890763580799, 0.039486099034547806, -0.04066510871052742, -0.01707420125603676, -0.015059166587889194, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "parser", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def _add_additional_network_options(parser): # Add additional network options parser.add_argument( '--provider-network-type', metavar='<provider-network-type>', help=_("The physical mechanism by which the virtual network " "is implemented. For example: " "f...
1,761
[ -0.019577061757445335, 0.02142486535012722, -0.00869554840028286, -0.03970967233181, 0.013490177690982819, -0.02301904931664467, 0.0010348608484491706, -0.009722107090055943, -0.026014182716608047, 0.04282557964324951, -0.0076387980952858925, 0.0021361461840569973, 0.024142224341630936, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "Create new network"}}], "func": {"_type": "Name", "_fields": {"id": "_", "ctx": {"_type": "Load", ...
class CreateNetwork(common.NetworkAndComputeShowOne): _description = _("Create new network") def update_parser_common(self, parser): parser.add_argument( 'name', metavar='<name>', help=_("New network name") ) share_group = parser.add_mutually_exclusiv...
1,762
[ 0.011100854724645615, -0.013997187837958336, 0.0016087814001366496, -0.022644059732556343, -0.031722746789455414, 0.007862227968871593, 0.01044786348938942, 0.010047643445432186, 0.01468177605420351, 0.001833905465900898, -0.009189275093376637, -0.021264351904392242, 0.005350317340344191, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parser", "annotation": null, "type_comment": null}}], "kwarg": nu...
def update_parser_common(self, parser): parser.add_argument( 'name', metavar='<name>', help=_("New network name") ) share_group = parser.add_mutually_exclusive_group() share_group.add_argument( '--share', action='store_true', ...
1,763
[ -0.028717665001749992, -0.010419152677059174, 0.015458743087947369, -0.01010917779058218, 0.012678968720138073, 0.007154418155550957, 0.009169254451990128, 0.013098934665322304, 0.02097829431295395, 0.06091504544019699, -0.017698559910058975, -0.01087911520153284, -0.014248841442167759, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parser", "annotation": null, "type_comment": null}}], "kwarg": nu...
def update_parser_compute(self, parser): parser.add_argument( '--subnet', metavar='<subnet>', required=True, help=self.enhance_help_nova_network( _("IPv4 subnet for fixed IPs (in CIDR notation)")) ) return parser
1,764
[ -0.031027816236019135, 0.015040289610624313, 0.012695297598838806, -0.02532128617167473, -0.00011136542889289558, 0.012221679091453552, -0.005599677562713623, -0.002586132613942027, -0.011852025054395199, 0.05581772327423096, -0.011141596361994743, 0.0140814995393157, 0.018898550420999527, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parser", "annotation": null, "type_comment": null}}], "kwarg": nu...
def update_parser_network(self, parser): admin_group = parser.add_mutually_exclusive_group() admin_group.add_argument( '--enable', action='store_true', default=True, help=self.enhance_help_neutron(_("Enable network (default)")) ) admin_grou...
1,765
[ -0.016464926302433014, 0.018823698163032532, -0.02851441688835621, -0.027143308892846107, -0.004851169418543577, -0.021263808012008667, 0.010492469184100628, -0.03297633305191994, -0.01398995891213417, 0.0369037464261055, 0.005667443852871656, 0.004380576778203249, 0.04657122492790222, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "a...
def take_action_network(self, client, parsed_args): attrs = _get_attrs_network(self.app.client_manager, parsed_args) if parsed_args.transparent_vlan: attrs['vlan_transparent'] = True if parsed_args.no_transparent_vlan: attrs['vlan_transparent'] = False with common...
1,766
[ 0.028174806386232376, 0.04512915760278702, -0.01991124637424946, -0.03287435322999954, -0.013660171069204807, 0.011040566489100456, -0.009415961802005768, 0.058688145130872726, 0.014031188562512398, 0.012918137013912201, -0.002571822376921773, -0.05536023527383804, 0.0019520553760230541, -...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "Delete network(s)"}}], "func": {"_type": "Name", "_fields": {"id": "_", "ctx": {"_type": "Load", "...
class DeleteNetwork(common.NetworkAndComputeDelete): _description = _("Delete network(s)") # Used by base class to find resources in parsed_args. resource = 'network' r = None def update_parser_common(self, parser): parser.add_argument( 'network', metavar="<network>...
1,767
[ -0.04558504372835159, 0.017793461680412292, -0.014689021743834019, -0.041727323085069656, -0.014597714878618717, 0.0012775853974744678, -0.05026453360915184, -0.001368892379105091, -0.005215915385633707, 0.05583426356315613, -0.0008724103681743145, -0.025794241577386856, 0.020818008109927177...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "List networks"}}], "func": {"_type": "Name", "_fields": {"id": "_", "ctx": {"_type": "Load", "_fie...
class ListNetwork(common.NetworkAndComputeLister): _description = _("List networks") def update_parser_network(self, parser): router_ext_group = parser.add_mutually_exclusive_group() router_ext_group.add_argument( '--external', action='store_true', help=self....
1,768
[ -0.057894542813301086, -0.0021806983277201653, 0.010004008188843727, -0.04624075070023537, -0.01229732483625412, 0.01628722809255123, -0.031380996108055115, 0.018147621303796768, 0.004203438758850098, 0.07717712223529816, -0.013912007212638855, -0.0050926837138831615, 0.008711093105375767, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parser", "annotation": null, "type_comment": null}}], "kwarg": nu...
def update_parser_network(self, parser): router_ext_group = parser.add_mutually_exclusive_group() router_ext_group.add_argument( '--external', action='store_true', help=self.enhance_help_neutron(_("List external networks")) ) router_ext_group.add_argum...
1,769
[ -0.009252678602933884, 0.01110882218927145, 0.012269613333046436, -0.01397434901446104, -0.021533507853746414, -0.007379712536931038, -0.026490699499845505, -0.01846049539744854, 0.005021681077778339, 0.029653433710336685, 0.014624840579926968, -0.028599189594388008, 0.04062206298112869, -...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "a...
def take_action_network(self, client, parsed_args): identity_client = self.app.client_manager.identity if parsed_args.long: columns = ( 'id', 'name', 'status', 'project_id', 'is_admin_state_up', '...
1,770
[ -0.02137286216020584, 0.002990041859447956, -0.03212406113743782, -0.04194694012403488, -0.002620334504172206, 0.02094108797609806, 0.003481185995042324, -0.0029333713464438915, -0.004954617936164141, 0.01569502055644989, 0.00899171456694603, -0.031735461205244064, 0.03328985348343849, 0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "Set network properties"}}], "func": {"_type": "Name", "_fields": {"id": "_", "ctx": {"_type": "Loa...
class SetNetwork(command.Command): _description = _("Set network properties") def get_parser(self, prog_name): parser = super(SetNetwork, self).get_parser(prog_name) parser.add_argument( 'network', metavar="<network>", help=_("Network to modify (name or ID)")...
1,771
[ -0.02122338116168976, -0.013057982549071312, -0.03519109636545181, -0.04801609739661217, -0.027513844892382622, 0.018139168620109558, 0.011637913063168526, 0.0039024173747748137, 0.003993945196270943, 0.029954589903354645, 0.011255159974098206, -0.01692989096045494, 0.026493171229958534, 0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "prog_name", "annotation": null, "type_comment": null}}], "kwarg":...
def get_parser(self, prog_name): parser = super(SetNetwork, self).get_parser(prog_name) parser.add_argument( 'network', metavar="<network>", help=_("Network to modify (name or ID)") ) parser.add_argument( '--name', metavar='<nam...
1,772
[ -0.00543821370229125, 0.020440082997083664, -0.013381056487560272, -0.01988733746111393, -0.03261200711131096, 0.003872100031003356, 0.0034719351679086685, -0.021568605676293373, -0.019484292715787888, 0.01848244108259678, 0.021511027589440346, -0.024781441316008568, 0.010715209878981113, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parsed_args", "annotation": null, "type_comment": null}}], "kwarg...
def take_action(self, parsed_args): client = self.app.client_manager.network obj = client.find_network(parsed_args.network, ignore_missing=False) attrs = _get_attrs_network(self.app.client_manager, parsed_args) if attrs: with common.check_missing_extension_if_error( ...
1,773
[ -0.01179906353354454, 0.005025417543947697, -0.031693316996097565, -0.010157505981624126, -0.002526042750105262, -0.015479234047234058, -0.016676325350999832, -0.012024259194731712, 0.0005763228982686996, 0.026620488613843918, -0.026620488613843918, -0.05485290661454201, 0.009707115590572357...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "Show network details"}}], "func": {"_type": "Name", "_fields": {"id": "_", "ctx": {"_type": "Load"...
class ShowNetwork(common.NetworkAndComputeShowOne): _description = _("Show network details") def update_parser_common(self, parser): parser.add_argument( 'network', metavar="<network>", help=_("Network to display (name or ID)") ) return parser de...
1,774
[ -0.023847801610827446, -0.0005958637921139598, -0.05257115140557289, -0.0238054059445858, -0.0364818349480629, 0.0014613402308896184, -0.003079016227275133, 0.03031320497393608, 0.018283315002918243, -0.0004696692049037665, 0.006534297484904528, -0.050875309854745865, 0.03198784962296486, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "Unset network properties"}}], "func": {"_type": "Name", "_fields": {"id": "_", "ctx": {"_type": "L...
class UnsetNetwork(command.Command): _description = _("Unset network properties") def get_parser(self, prog_name): parser = super(UnsetNetwork, self).get_parser(prog_name) parser.add_argument( 'network', metavar="<network>", help=_("Network to modify (name or...
1,775
[ -0.021878987550735474, -0.014241671189665794, -0.04945024847984314, -0.04090084880590439, -0.026637200266122818, 0.019175706431269646, 0.0014354308368638158, 0.014681229367852211, 0.016307592391967773, -0.005307659972459078, 0.009587853215634823, -0.021878987550735474, 0.025582261383533478, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "prog_name", "annotation": null, "type_comment": null}}], "kwarg":...
def get_parser(self, prog_name): parser = super(UnsetNetwork, self).get_parser(prog_name) parser.add_argument( 'network', metavar="<network>", help=_("Network to modify (name or ID)") ) _tag.add_tag_option_to_parser_for_unset(parser, _('network')) ...
1,776
[ -0.014584413729608059, -0.053345534950494766, -0.08181298524141312, -0.008370050229132175, 0.011737667955458164, 0.034429118037223816, -0.006137005519121885, -0.006559891626238823, 0.004631118383258581, 0.027167852967977524, 0.040122609585523605, -0.019421817734837532, 0.02475430816411972, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "url", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def coerce_url(url): url = url.strip() if url.startswith("feed://"): return "http://{0}".format(url[7:]) for proto in ["http://", "https://"]: if url.startswith(proto): return url return "http://{0}".format(url)
1,777
[ -0.024475662037730217, -0.01032705046236515, -0.030837565660476685, -0.027524074539542198, 0.056108467280864716, 0.0028716931119561195, 0.002019849605858326, 0.045770369470119476, 0.05217645689845085, 0.011171991005539894, 0.015330423600971699, -0.027303174138069153, -0.043826453387737274, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "url", "annotation": null, "type_comment": null}}], "kwarg": null,...
def get_feed(self, url): try: r = requests.get(url, headers={"User-Agent": self.user_agent}, timeout=self.timeout) except Exception as e: logging.warn("Error while getting '{0}'".format(url)) logging.warn("{0}".format(e)) return None return r.text
1,778
[ -0.01935753971338272, 0.00519180903211236, -0.00097991107031703, -0.02069847099483013, 0.020675549283623695, 0.03419946879148483, -0.026130961254239082, 0.001676163636147976, 0.01360414456576109, 0.0533621720969677, 0.014807544648647308, -0.07238734513521194, -0.005486928857862949, -0.0069...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "user_agent", "annotati...
class FeedFinder(object): def __init__(self, user_agent=None, timeout=None): if user_agent is None: user_agent = "feedfinder2/{0}".format(__version__) self.user_agent = user_agent self.timeout = timeout def get_feed(self, url): try: r = requests.get(url,...
1,779
[ -0.02583429403603077, -0.01599091663956642, -0.028054239228367805, 0.0027093684766441584, 0.01991850882768631, 0.02440718747675419, -0.0371047779917717, 0.030835267156362534, 0.023565560579299927, 0.04674080014228821, 0.030591316521167755, -0.041032373905181885, -0.011325374245643616, 0.02...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "url", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def url_feed_prob(url): if "comments" in url: return -2 if "georss" in url: return -1 kw = ["atom", "rss", "rdf", ".xml", "feed"] for p, t in zip(range(len(kw), 0, -1), kw): if t in url: return p return 0
1,780
[ -0.030243048444390297, -0.004147649742662907, -0.018810778856277466, -0.05134027823805809, 0.017551571130752563, 0.010537570342421532, -0.015497076325118542, -0.02401329018175602, 0.007014001253992319, 0.07276888191699982, 0.029889587312936783, -0.04365249350667, -0.0028207881841808558, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "url", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "check_all", "annotation": null, "type_comment": null}}, {"_type": ...
def find_feeds(url, check_all=False, user_agent=None, timeout=None): finder = FeedFinder(user_agent=user_agent, timeout=timeout) # Format the URL properly. url = coerce_url(url) # Download the requested URL. text = finder.get_feed(url) if text is None: return [] # Check if it is a...
1,781
[ 0.043750885874032974, -0.03344907984137535, 0.030926618725061417, -0.030672254040837288, -0.0013248209143057466, 0.006830776575952768, 0.0009094895794987679, -0.024737056344747543, 0.013905320316553116, -0.009655294939875603, -0.01544211246073246, -0.04074089229106903, 0.059012822806835175, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "SerializerMethodField", "value": {"_type": "Name", "_fields"...
class InformationPackageSerializer(CoreInformationPackageSerializer): profiles = serializers.SerializerMethodField() workarea = serializers.SerializerMethodField() def get_profiles(self, obj): profiles = getattr(obj, 'profiles', obj.profileip_set) return ProfileIPSerializer(profiles, many=T...
1,782
[ 0.06338534504175186, -0.01921394094824791, -0.013842301443219185, -0.028944872319698334, -0.0031325954478234053, -0.005402629729360342, -0.015598414465785027, -0.039460889995098114, 0.0010523764649406075, -0.011466383934020996, -0.015464123338460922, -0.06999659538269043, 0.05884011089801788...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "obj", "annotation": nu...
class InformationPackageReadSerializer(InformationPackageSerializer): def to_representation(self, obj): data = super().to_representation(obj) profiles = data['profiles'] data['profiles'] = {} for ptype in profile_types: data['profile_%s' % ptype.lower().replace(' ', '_')...
1,783
[ 0.032500214874744415, -0.01398190762847662, 0.062274329364299774, -0.017059417441487312, 0.018241437152028084, -0.0030269285198301077, -0.01648438163101673, 0.01051571499556303, 0.0017317652236670256, 0.01794327050447464, -0.02726099267601967, -0.004445884842425585, -0.04574735462665558, 0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class VGG16Test(test.TestCase): def test_with_top(self): model = keras.applications.VGG16(weights=None) self.assertEqual(model.output_shape, (None, 1000)) def test_no_top(self): model = keras.applications.VGG16(weights=None, include_top=False) self.assertEqual(model.output_shape, (None, None, None...
1,784
[ 0.04473694786429405, -0.015408641658723354, -0.00596154248341918, -0.014810794964432716, -0.003595537506043911, -0.011731322854757309, -0.004822250455617905, -0.02137582376599312, -0.018285071477293968, -0.003099212422966957, -0.005411636549979448, -0.049226436764001846, 0.04764721915125847,...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "obj", "annotation": null, "type_comment": null}}], "kwarg": null,...
def to_representation(self, obj): data = super().to_representation(obj) profiles = data['profiles'] data['profiles'] = {} for ptype in profile_types: data['profile_%s' % ptype.lower().replace(' ', '_')] = None for p in profiles: data['profile_%s' % p['pr...
1,785
[ 0.06580911576747894, 0.0156757403165102, 0.048870209604501724, -0.024476518854498863, 0.02116328477859497, 0.03621779382228851, -0.01614166423678398, -0.024000242352485657, -0.040152259171009064, -0.0027204761281609535, -0.03611425682902336, -0.05222485959529877, 0.017839696258306503, 0.06...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "options", "a...
class Command(MigrateCommand): def handle(self, *args, **options): engine = get_engine_from_db_alias(options['database']) # Call regular migrate if engine is different from ours if engine != 'django_cassandra_engine': return super(Command, self).handle(**options) else: ...
1,786
[ 0.057056132704019547, 0.012875408865511417, 0.06669481843709946, -0.025301555171608925, 0.014529505744576454, 0.03132573515176773, -0.008893323130905628, -0.01086394488811493, -0.05399299040436745, -0.0014192559756338596, -0.022728515788912773, -0.04917364567518234, 0.01574455201625824, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}, "...
def handle(self, *args, **options): engine = get_engine_from_db_alias(options['database']) # Call regular migrate if engine is different from ours if engine != 'django_cassandra_engine': return super(Command, self).handle(**options) else: self.stdout.write("Migra...
1,787
[ -0.035566363483667374, 0.0305582657456398, 0.020475588738918304, -0.03749426081776619, 0.00888605136424303, -0.01513509452342987, 0.053050391376018524, 0.011567378416657448, -0.01875820942223072, 0.006265663076192141, -0.01106878463178873, 0.01566692814230919, -0.030979299917817116, -0.000...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_svn_not_installed(self): self.setupStep(svn.SVN(repourl='http://svn.local/app/trunk')) self.expectCommands( ExpectShell(workdir='wkdir', command=['svn', '--version']) + 1, ) self.expectException(WorkerSetupError) return sel...
1,788
[ -0.0067051914520561695, 0.03639788180589676, 0.02048438973724842, -0.016010232269763947, 0.0019211673643440008, -0.0015780477551743388, 0.04404022917151451, -0.005060635972768068, -0.015502354130148888, 0.014946107752621174, 0.03185117244720459, -0.013785244897007942, -0.008192546665668488, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_corrupt_xml(self): self.setupStep(svn.SVN(repourl='http://svn.local/app/trunk')) self.expectCommands( ExpectShell(workdir='wkdir', command=['svn', '--version']) + 0, Expect('stat', dict(file='wkdir/.buildbot-patched', ...
1,789
[ 0.026013892143964767, 0.019426580518484116, 0.04682979732751846, -0.049824029207229614, -0.00400927709415555, -0.00572197837755084, 0.011348141357302666, 0.010024690069258213, 0.0022441772744059563, 0.025798307731747627, 0.011599656194448471, -0.046614211052656174, -0.044961392879486084, 0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_revision_noninteger(self): svnTestStep = svn.SVN(repourl='http://svn.local/app/trunk') self.setupStep(svnTestStep) self.expectCommands( ExpectShell(workdir='wkdir', command=['svn', '--version']) + 0, Expect('stat', dict(file='w...
1,790
[ 0.015963323414325714, 0.026703212410211563, 0.030983880162239075, -0.043290797621011734, -0.010408647358417511, 0.02249898575246334, 0.06145815551280975, 0.024843160063028336, -0.012376990169286728, 0.017351992428302765, 0.026601292192935944, 0.023429011926054955, -0.044692207127809525, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_mode_incremental(self): self.setupStep( svn.SVN(repourl='http://svn.local/app/trunk', mode='incremental', username='user', password='pass', extra_args=['--random'])) self.expectCommands( ExpectShell(workdir='wkdir', ...
1,791
[ 0.032292403280735016, 0.02591855451464653, 0.01801075041294098, -0.035809922963380814, -0.0198091808706522, 0.009825248271226883, 0.04710300639271736, 0.0015116402646526694, -0.014162639155983925, 0.0048200576566159725, 0.01299233641475439, 0.004334084689617157, -0.04477562755346298, -0.01...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_mode_incremental_repourl_renderable(self): self.setupStep( svn.SVN(repourl=ConstantRenderable('http://svn.local/trunk'), mode='incremental')) self.expectCommands( ExpectShell(workdir='wkdir', command=['svn', '--version']) ...
1,792
[ 0.011138799600303173, 0.025098668411374092, 0.03319501504302025, -0.048932284116744995, -0.03144923970103264, 0.029956476762890816, 0.0717538595199585, 0.02616131491959095, -0.011556267738342285, 0.017128828912973404, 0.03238537907600403, 0.016888469457626343, -0.04435278847813606, -0.0172...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_mode_incremental_timeout(self): self.setupStep( svn.SVN(repourl='http://svn.local/app/trunk', mode='incremental', username='user', timeout=1, password='pass', extra_args=['--random'])) self.expectCommands( Expec...
1,793
[ 0.02440240979194641, 0.016984380781650543, 0.027372147887945175, -0.04059064760804176, -0.015783846378326416, 0.0077402773313224316, 0.05383441969752312, 0.0021435830276459455, -0.024478232488036156, 0.022431008517742157, 0.008871305733919144, 0.01976456120610237, -0.037861015647649765, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_mode_incremental_repourl_canonical(self): self.setupStep( svn.SVN(repourl='http://svn.local/trunk/test app', mode='incremental')) self.expectCommands( ExpectShell(workdir='wkdir', command=['svn', '--version']) + 0, ...
1,794
[ 0.020511632785201073, 0.034121185541152954, 0.019759150221943855, -0.035340726375579834, -0.021809017285704613, 0.024442706257104874, 0.06710067391395569, 0.009464412927627563, -0.0061658150516450405, 0.00815405510365963, 0.014608538709580898, 0.014141480438411236, -0.048833515495061874, -...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_mode_incremental_repourl_not_updatable(self): self.setupStep( svn.SVN(repourl=ConstantRenderable('http://svn.local/trunk/app'), mode='incremental',)) self.expectCommands( ExpectShell(workdir='wkdir', command=['svn', '--version'...
1,795
[ 0.022430073469877243, 0.042305298149585724, 0.024158352985978127, -0.04556147754192352, -0.012799293734133244, 0.017357945442199707, 0.06657636165618896, -0.0027928007766604424, -0.02526044473052025, 0.013049769215285778, 0.012386009097099304, 0.014577669091522694, -0.042605869472026825, 0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_mode_incremental_repourl_not_updatable_svninfo_mismatch(self): self.setupStep( svn.SVN(repourl=ConstantRenderable('http://svn.local/trunk/app'), mode='incremental')) self.expectCommands( ExpectShell(workdir='wkdir', command=['s...
1,796
[ 0.007116734515875578, 0.023269392549991608, 0.017442606389522552, -0.04165586456656456, -0.019053468480706215, 0.028139730915427208, 0.065340556204319, 0.028290750458836555, -0.010174853727221489, 0.0011420754017308354, 0.015617802739143372, 0.009337960742413998, -0.04656395688652992, -0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_mode_incremental_retry(self): self.setupStep( svn.SVN(repourl=ConstantRenderable('http://svn.local/trunk/app'), mode='incremental', retry=(0, 1))) self.expectCommands( ExpectShell(workdir='wkdir', command=['svn', '--version']) ...
1,797
[ -0.007436805870383978, 0.049081675708293915, 0.05248632654547691, -0.030542470514774323, -0.004684504121541977, -0.0006570109981112182, 0.08285483717918396, 0.02526153065264225, -0.017495442181825638, 0.031735341995954514, 0.01911078952252865, 0.03643226996064186, -0.024752074852585793, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_mode_incremental_win32path(self): self.setupStep( svn.SVN(repourl='http://svn.local/app/trunk', mode='incremental', username='user', password='pass', extra_args=['--random'])) self.build.path_module = namedModule("ntpath") self.expectC...
1,798
[ 0.03399692475795746, 0.02936539053916931, 0.03142654523253441, -0.04866749420762062, -0.029850367456674576, 0.02152087725698948, 0.04633960500359535, 0.012560917995870113, -0.021872486919164658, 0.011390909552574158, 0.01936272904276848, 0.009117577224969864, -0.05058315768837929, -0.00882...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_mode_incremental_given_revision(self): self.setupStep( svn.SVN(repourl='http://svn.local/app/trunk', mode='incremental'), dict( revision='100', )) self.expectCommands( ExpectShell(workdir='wkdir', co...
1,799
[ 0.014984790235757828, 0.04274268448352814, 0.013319812715053558, -0.03225581720471382, -0.015469372272491455, 0.03613247722387314, 0.0485825277864933, 0.0145623330026865, -0.015059340745210648, 0.02770819328725338, 0.03377168998122215, 0.017444979399442673, -0.02447764202952385, -0.0060262...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_mode_full_clobber(self): self.setupStep( svn.SVN(repourl='http://svn.local/app/trunk', mode='full', method='clobber')) self.expectCommands( ExpectShell(workdir='wkdir', command=['svn', '--version']) + 0, ...
1,800
[ 0.029797399416565895, 0.04262281954288483, 0.0240838211029768, -0.035004712641239166, -0.023854795843362808, 0.03857268765568733, 0.035824380815029144, 0.00984206236898899, -0.02468651905655861, 0.01918991096317768, 0.02936345711350441, 0.0056472825817763805, -0.03269034996628761, -0.00180...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_mode_full_clobber_given_revision(self): self.setupStep( svn.SVN(repourl='http://svn.local/app/trunk', mode='full', method='clobber'), dict( revision='100', )) self.expectCommands( ExpectShell(workdir='wkdir', ...