query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Sequence matrix_distance should look up distances from a matrix
def test_matrix_distance(self): # note that the score matrix must contain 'diagonal' elements m[i][i] # to avoid failure when the sequences match. m = {"U": {"U": 0, "C": 1, "A": 5}, "C": {"C": 0, "A": 2, "G": 4}} self.assertEqual(self.RNA("UUUCCC").matrix_distance("UCACGG", m), 14) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __build_distance_matrix(self):\n for i in range(0, len(self.__corpus)):\n doc_i = self.__corpus[i]\n for j in range(i + 1, len(self.__corpus)):\n doc_j = self.__corpus[j]\n distance = doc_i.calc_distance(doc_j)\n self.__distance_matrix.a...
[ "0.6737727", "0.6700531", "0.65607816", "0.6550453", "0.6502882", "0.6492697", "0.6485367", "0.6467", "0.64162374", "0.6375636", "0.6326314", "0.63200414", "0.63023067", "0.6289097", "0.6281347", "0.62686527", "0.6267945", "0.62410456", "0.6240649", "0.62321705", "0.62179285"...
0.7115163
0
Sequence frac_diff should return difference between sequences
def test_frac_diff(self): s1 = self.RNA("ACGU") s2 = self.RNA("AACG") s3 = self.RNA("GG") s4 = self.RNA("A") e = self.RNA("") self.assertEqual(s1.frac_diff(e), 0) self.assertEqual(s1.frac_diff(s2), 0.75) self.assertEqual(s1.frac_diff(s3), 1) self.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_frac_diffNonGaps(self):\n s1 = self.RNA(\"AAAA\")\n s2 = self.RNA(\"AGGG\")\n s3 = self.RNA(\"GGGG\")\n s4 = self.RNA(\"AG--GA-G\")\n s5 = self.RNA(\"CU--CU-C\")\n s6 = self.RNA(\"AC--GC-G\")\n s7 = self.RNA(\"--------\")\n s8 = self.RNA(\"AAAA----\"...
[ "0.6682282", "0.65871775", "0.6406857", "0.63614774", "0.633233", "0.60608715", "0.5996062", "0.5925066", "0.5844651", "0.58167034", "0.57268333", "0.56967485", "0.56595033", "0.56105644", "0.5590587", "0.5588716", "0.55883276", "0.55557704", "0.554874", "0.5516476", "0.54867...
0.69646966
0
Sequence frac_same_gaps should return similarity in gap positions
def test_frac_same_gaps(self): s1 = self.RNA("AAAA") s2 = self.RNA("GGGG") s3 = self.RNA("----") s4 = self.RNA("A-A-") s5 = self.RNA("-G-G") s6 = self.RNA("UU--") s7 = self.RNA("-") s8 = self.RNA("GGG") e = self.RNA("") self.assertEqual(s1....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_frac_same_non_gaps(self):\n s1 = self.RNA(\"AAAA\")\n s2 = self.RNA(\"AGGG\")\n s3 = self.RNA(\"GGGG\")\n s4 = self.RNA(\"AG--GA-G\")\n s5 = self.RNA(\"CU--CU-C\")\n s6 = self.RNA(\"AC--GC-G\")\n s7 = self.RNA(\"--------\")\n s8 = self.RNA(\"AAAA----...
[ "0.7100668", "0.68241644", "0.6488444", "0.6251183", "0.622191", "0.62168777", "0.6174029", "0.6057268", "0.59166205", "0.58478665", "0.5809226", "0.57599026", "0.57473063", "0.57302", "0.57302", "0.57115066", "0.5697203", "0.5636952", "0.5636567", "0.5633265", "0.56134945", ...
0.73995185
0
Sequence frac_diff_gaps should return difference in gap positions
def test_frac_diffGaps(self): s1 = self.RNA("AAAA") s2 = self.RNA("GGGG") s3 = self.RNA("----") s4 = self.RNA("A-A-") s5 = self.RNA("-G-G") s6 = self.RNA("UU--") s7 = self.RNA("-") s8 = self.RNA("GGG") e = self.RNA("") self.assertEqual(s1.f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_frac_diffNonGaps(self):\n s1 = self.RNA(\"AAAA\")\n s2 = self.RNA(\"AGGG\")\n s3 = self.RNA(\"GGGG\")\n s4 = self.RNA(\"AG--GA-G\")\n s5 = self.RNA(\"CU--CU-C\")\n s6 = self.RNA(\"AC--GC-G\")\n s7 = self.RNA(\"--------\")\n s8 = self.RNA(\"AAAA----\"...
[ "0.7225307", "0.67301106", "0.66909367", "0.6637069", "0.63543224", "0.63248473", "0.625972", "0.6218654", "0.621057", "0.61792654", "0.6112803", "0.6037798", "0.5851911", "0.58475983", "0.58424854", "0.5677977", "0.5675696", "0.56663543", "0.5583191", "0.5574306", "0.5514928...
0.73904467
0
Sequence frac_same_non_gaps should return similarities at nongaps
def test_frac_same_non_gaps(self): s1 = self.RNA("AAAA") s2 = self.RNA("AGGG") s3 = self.RNA("GGGG") s4 = self.RNA("AG--GA-G") s5 = self.RNA("CU--CU-C") s6 = self.RNA("AC--GC-G") s7 = self.RNA("--------") s8 = self.RNA("AAAA----") s9 = self.RNA("A-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_frac_same_gaps(self):\n s1 = self.RNA(\"AAAA\")\n s2 = self.RNA(\"GGGG\")\n s3 = self.RNA(\"----\")\n s4 = self.RNA(\"A-A-\")\n s5 = self.RNA(\"-G-G\")\n s6 = self.RNA(\"UU--\")\n s7 = self.RNA(\"-\")\n s8 = self.RNA(\"GGG\")\n e = self.RNA(\"...
[ "0.73611933", "0.6853093", "0.6707912", "0.64544857", "0.61881554", "0.6067325", "0.6048163", "0.59375685", "0.59336567", "0.5676094", "0.55943984", "0.5567829", "0.5493283", "0.5493283", "0.54437655", "0.54295635", "0.54226124", "0.5417089", "0.53966296", "0.53905", "0.53888...
0.7459763
0
Sequence frac_diff_non_gaps should return differences at nongaps
def test_frac_diffNonGaps(self): s1 = self.RNA("AAAA") s2 = self.RNA("AGGG") s3 = self.RNA("GGGG") s4 = self.RNA("AG--GA-G") s5 = self.RNA("CU--CU-C") s6 = self.RNA("AC--GC-G") s7 = self.RNA("--------") s8 = self.RNA("AAAA----") s9 = self.RNA("A-GG...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_frac_diffGaps(self):\n s1 = self.RNA(\"AAAA\")\n s2 = self.RNA(\"GGGG\")\n s3 = self.RNA(\"----\")\n s4 = self.RNA(\"A-A-\")\n s5 = self.RNA(\"-G-G\")\n s6 = self.RNA(\"UU--\")\n s7 = self.RNA(\"-\")\n s8 = self.RNA(\"GGG\")\n e = self.RNA(\"\...
[ "0.7439105", "0.6938618", "0.67893827", "0.6030237", "0.603009", "0.5993497", "0.57819146", "0.57747155", "0.57746786", "0.567172", "0.56545997", "0.5574829", "0.5558459", "0.55300987", "0.5500124", "0.54575205", "0.5447627", "0.5424767", "0.5401605", "0.5380952", "0.5379418"...
0.7880588
0
Sequence frac_similar should return the fraction similarity
def test_frac_similar(self): transitions = dict.fromkeys( [ ("A", "A"), ("A", "G"), ("G", "A"), ("G", "G"), ("U", "U"), ("U", "C"), ("C", "U"), ("C", "C"), ] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_frac_same(self):\n s1 = self.RNA(\"ACGU\")\n s2 = self.RNA(\"AACG\")\n s3 = self.RNA(\"GG\")\n s4 = self.RNA(\"A\")\n e = self.RNA(\"\")\n self.assertEqual(s1.frac_same(e), 0)\n self.assertEqual(s1.frac_same(s2), 0.25)\n self.assertEqual(s1.frac_same...
[ "0.7017269", "0.6662179", "0.6660259", "0.6638686", "0.6638686", "0.6472042", "0.60609144", "0.6037269", "0.60179865", "0.6010803", "0.6006697", "0.58934134", "0.58387834", "0.58198506", "0.5782344", "0.5776492", "0.57633436", "0.57590544", "0.5711294", "0.5676241", "0.565773...
0.79655254
0
with_termini_unknown should reset termini to unknown char
def test_with_termini_unknown(self): s1 = self.RNA("-?--AC--?-") s2 = self.RNA("AC") self.assertEqual(s1.with_termini_unknown(), "????AC????") self.assertEqual(s2.with_termini_unknown(), "AC")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_term_chars_default(self, instrument):\n assert instrument.term_chars == b'\\r'", "def strip_other_charcter():\n pass", "def test_term_chars_default(self, instrument):\n assert instrument.term_chars is None", "def set_terminator (self, term):\r\n self.terminator = term", "de...
[ "0.63693273", "0.63148445", "0.5928961", "0.57174045", "0.55202454", "0.5488006", "0.54239345", "0.53940064", "0.53883356", "0.53773767", "0.5307043", "0.52910495", "0.52059764", "0.5167487", "0.51656246", "0.51492214", "0.51492214", "0.51466554", "0.5135072", "0.5101027", "0...
0.7095066
0
gap degen character should be treated consistently
def test_consistent_gap_degen_handling(self): # the degen character '?' can be a gap, so when we strip either gaps or # degen characters it should be gone too raw_seq = "---??-??TC-GGCG-GCA-G-GC-?-C-TAN-GCGC-CCTC-AGGA?-???-??--" raw_ungapped = re.sub("[-?]", "", raw_seq) raw_no_a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_is_gap(self):\n r = self.RNA(\"ACGUCAGUACGUCAGNRCGAUcaguaguacYRNRYRN\")\n for char in \"qwertyuiopasdfghjklzxcvbnmQWERTYUIOASDFGHJKLZXCVBNM\":\n assert not r.is_gap(char)\n assert r.is_gap(\"-\")\n # only works on a single literal that's a gap, not on a sequence.\n ...
[ "0.69210255", "0.64609724", "0.63262624", "0.63087875", "0.6294152", "0.6294152", "0.6140576", "0.6091902", "0.60851234", "0.5905722", "0.5901116", "0.5892332", "0.5745669", "0.5726817", "0.5707481", "0.5671575", "0.5660184", "0.565967", "0.56095153", "0.5588575", "0.5571344"...
0.7278505
0
DnaSequence should behave as expected
def test_DnaSequence(self): x = DnaSequence("tcag") # note: no longer preserves case self.assertEqual(x, "TCAG") x = DnaSequence("aaa") + DnaSequence("ccc") # note: doesn't preserve case self.assertEqual(x, "AAACCC") assert x.moltype is DNA self.assertRai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ModelDnaCodonSequence(self):\n d = ArrayDnaCodonSequence(\"UUUCGU\")\n self.assertEqual(str(d), \"TTTCGT\")\n self.assertEqual(d._data, array([0, 28]))\n self.assertEqual(str(d.to_rna()), \"UUUCGU\")\n self.assertEqual(str(d.to_dna()), \"TTTCGT\")", "def translate_DNA(...
[ "0.73271704", "0.68954426", "0.6802941", "0.6800046", "0.67086923", "0.6665731", "0.6584737", "0.65618503", "0.6433904", "0.6413777", "0.6383003", "0.6311124", "0.61830586", "0.6149528", "0.61370975", "0.6119347", "0.61098856", "0.61098856", "0.61098856", "0.61098856", "0.610...
0.6965354
1
Sequence to_fasta() should return Fastaformat string
def test_to_fasta(self): even = "TCAGAT" odd = even + "AAA" even_dna = self.SequenceClass(even, name="even") odd_dna = self.SequenceClass(odd, name="odd") self.assertEqual(even_dna.to_fasta(), ">even\nTCAGAT\n") # set line wrap to small number so we can test that it works...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_to_fasta(self):\n even = \"TCAGAT\"\n odd = even + \"AAA\"\n even_dna = self.SEQ(even, name=\"even\")\n odd_dna = self.SEQ(odd, name=\"odd\")\n self.assertEqual(even_dna.to_fasta(), \">even\\nTCAGAT\\n\")\n # set line wrap to small number so we can test that it wo...
[ "0.74317557", "0.7302847", "0.70808065", "0.6741352", "0.67153966", "0.67040503", "0.6695643", "0.66434294", "0.66212684", "0.6602914", "0.6531266", "0.65176135", "0.65008026", "0.6492443", "0.648414", "0.64614666", "0.638201", "0.6333177", "0.6327045", "0.62993723", "0.62658...
0.74931866
0
Sequence to_phylip() should return oneline phylip string
def test_to_phylip(self): s = self.SequenceClass("ACG", name="xyz") self.assertEqual(s.to_phylip(), "xyz" + " " * 27 + "ACG")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _toPhylip(seq, width=None, name=None):\n\n if name is None:\n name = seq.name\n\n output = '%-10s%s' % (name[:10], seq.seq)\n\n if width:\n output = textwrap.fill(output, width)\n\n return output", "def __str__(self):\n A, b = self.A, self.b\n A_rows = str(A).split('\\...
[ "0.67031217", "0.590137", "0.5797911", "0.5694089", "0.56807077", "0.5645143", "0.55652755", "0.556261", "0.5523871", "0.5515493", "0.5506121", "0.550052", "0.5490149", "0.54742414", "0.5463294", "0.5462326", "0.54445654", "0.54246205", "0.5416303", "0.54102886", "0.54089516"...
0.73432875
0
gapped sequence nongaps() should return correct array
def test_nongaps(self): sc = self.SequenceClass self.assertEqual(sc("TC").nongaps(), array([1, 1])) self.assertEqual(sc("T-").nongaps(), array([1, 0]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_gaps(self):\n sc = self.SequenceClass\n self.assertEqual(sc(\"TC\").gaps(), array([0, 0]))\n self.assertEqual(sc(\"T-\").gaps(), array([0, 1]))", "def findGaps(sequence):\n patt = re.compile(r\"[Nn]+\")\n for match in patt.finditer(sequence):\n yield (match.start(), mat...
[ "0.61690015", "0.6166339", "0.5894974", "0.58692527", "0.58428276", "0.57104343", "0.5640709", "0.554734", "0.5539277", "0.55391294", "0.55129206", "0.5431471", "0.5401227", "0.5352029", "0.53116506", "0.5305194", "0.5293791", "0.5287529", "0.5271896", "0.5259445", "0.5253917...
0.7228265
0
gapped sequence regap() should return correct sequence
def test_regap(self): sc = self.SequenceClass self.assertEqual(str(sc("TC").regap(sc("A---A-"))), "T---C-")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_gaps(self):\n sc = self.SequenceClass\n self.assertEqual(sc(\"TC\").gaps(), array([0, 0]))\n self.assertEqual(sc(\"T-\").gaps(), array([0, 1]))", "def group(seq):\n pass # replace with your solution", "def check_gapped(sequence):\n w_regexp = re.compile('n|N')\n regexp_ob...
[ "0.61801946", "0.6072817", "0.5821261", "0.57876194", "0.5663991", "0.5558589", "0.55302256", "0.55173", "0.5506784", "0.5503168", "0.54316753", "0.53699327", "0.5357166", "0.5355198", "0.53514254", "0.5329967", "0.53242975", "0.5302287", "0.52581125", "0.52402294", "0.522924...
0.6927464
0
Regular sequence should convert to model sequence
def test_regular_to_model(self): r = RNA.make_seq("AAA", name="x") s = RNA.make_array_seq(r) self.assertEqual(str(s), "AAA") self.assertEqual(s.moltype, RNA) self.assertEqual(s.name, "x")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_model_to_regular(self):\n r = RNA.make_array_seq(\"AAA\", name=\"x\")\n s = RNA.make_seq(r)\n self.assertEqual(str(s), \"AAA\")\n self.assertEqual(s.moltype, RNA)\n self.assertEqual(s.name, \"x\")", "def test_model_to_model(self):\n r = RNA.make_array_seq(\"AAA\...
[ "0.732975", "0.70638686", "0.6560123", "0.65202504", "0.628081", "0.6274271", "0.62084633", "0.617465", "0.59855276", "0.58972305", "0.5821316", "0.58064896", "0.57611835", "0.5760904", "0.57509965", "0.5748884", "0.5734916", "0.5701258", "0.56332576", "0.5625062", "0.5587976...
0.74114156
0
Model sequence should convert to regular sequence
def test_model_to_regular(self): r = RNA.make_array_seq("AAA", name="x") s = RNA.make_seq(r) self.assertEqual(str(s), "AAA") self.assertEqual(s.moltype, RNA) self.assertEqual(s.name, "x")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_regular_to_model(self):\n r = RNA.make_seq(\"AAA\", name=\"x\")\n s = RNA.make_array_seq(r)\n self.assertEqual(str(s), \"AAA\")\n self.assertEqual(s.moltype, RNA)\n self.assertEqual(s.name, \"x\")", "def test_model_to_model(self):\n r = RNA.make_array_seq(\"AAA\...
[ "0.6850945", "0.66729575", "0.6485937", "0.6349795", "0.6317251", "0.61167735", "0.60555464", "0.6052192", "0.5994143", "0.5922497", "0.59025365", "0.58883065", "0.58029574", "0.5746057", "0.5729786", "0.57184625", "0.5694364", "0.5694364", "0.5694364", "0.5694364", "0.569436...
0.6829134
1
Regular sequence should convert to regular sequence
def test_regular_to_regular(self): r = RNA.make_seq("AAA", name="x") s = RNA.make_seq(r) self.assertEqual(str(s), "AAA") self.assertEqual(s.moltype, RNA) self.assertEqual(s.name, "x")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode(self, seq):", "def test_model_to_regular(self):\n r = RNA.make_array_seq(\"AAA\", name=\"x\")\n s = RNA.make_seq(r)\n self.assertEqual(str(s), \"AAA\")\n self.assertEqual(s.moltype, RNA)\n self.assertEqual(s.name, \"x\")", "def test_regular_to_model(self):\n ...
[ "0.6617936", "0.6383945", "0.6319407", "0.62932134", "0.62242186", "0.6218362", "0.61613417", "0.61074924", "0.60580015", "0.5998588", "0.5887306", "0.586777", "0.58568335", "0.5827881", "0.57606894", "0.5693285", "0.56801903", "0.56508076", "0.5638858", "0.56294554", "0.5623...
0.6652918
0
Model sequence should convert to model sequence
def test_model_to_model(self): r = RNA.make_array_seq("AAA", name="x") s = RNA.make_array_seq(r) self.assertEqual(str(s), "AAA") self.assertEqual(s.moltype, RNA) self.assertEqual(s.name, "x")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_regular_to_model(self):\n r = RNA.make_seq(\"AAA\", name=\"x\")\n s = RNA.make_array_seq(r)\n self.assertEqual(str(s), \"AAA\")\n self.assertEqual(s.moltype, RNA)\n self.assertEqual(s.name, \"x\")", "def test_model_to_regular(self):\n r = RNA.make_array_seq(\"AA...
[ "0.6928161", "0.6812833", "0.65000093", "0.60420865", "0.60281956", "0.59811866", "0.5976736", "0.58936715", "0.5847981", "0.5823246", "0.5763527", "0.57178855", "0.5535258", "0.55170923", "0.54954267", "0.548045", "0.5480217", "0.5442175", "0.54339", "0.54253", "0.54149", ...
0.7089526
0
ArrayDnaCodonSequence should behave as expected
def test_ModelDnaCodonSequence(self): d = ArrayDnaCodonSequence("UUUCGU") self.assertEqual(str(d), "TTTCGT") self.assertEqual(d._data, array([0, 28])) self.assertEqual(str(d.to_rna()), "UUUCGU") self.assertEqual(str(d.to_dna()), "TTTCGT")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ModelRnaCodonSequence(self):\n r = ArrayRnaCodonSequence(\"UUUCGU\")\n self.assertEqual(str(r), \"UUUCGU\")\n self.assertEqual(r._data, array([0, 28]))\n self.assertEqual(str(r.to_rna()), \"UUUCGU\")\n self.assertEqual(str(r.to_dna()), \"TTTCGT\")", "def initialize_dna...
[ "0.7328825", "0.64691025", "0.64041036", "0.6317699", "0.6250591", "0.6247037", "0.62177837", "0.610478", "0.6104387", "0.6039625", "0.6023548", "0.6010523", "0.6005684", "0.600158", "0.59115016", "0.5885456", "0.5826384", "0.5823113", "0.58168215", "0.5790888", "0.57801914",...
0.8081281
0
ArrayRnaCodonSequence should behave as expected
def test_ModelRnaCodonSequence(self): r = ArrayRnaCodonSequence("UUUCGU") self.assertEqual(str(r), "UUUCGU") self.assertEqual(r._data, array([0, 28])) self.assertEqual(str(r.to_rna()), "UUUCGU") self.assertEqual(str(r.to_dna()), "TTTCGT")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ModelDnaCodonSequence(self):\n d = ArrayDnaCodonSequence(\"UUUCGU\")\n self.assertEqual(str(d), \"TTTCGT\")\n self.assertEqual(d._data, array([0, 28]))\n self.assertEqual(str(d.to_rna()), \"UUUCGU\")\n self.assertEqual(str(d.to_dna()), \"TTTCGT\")", "def codons(self, f...
[ "0.6889651", "0.616433", "0.59501624", "0.59163433", "0.5860934", "0.58542854", "0.5838475", "0.57773006", "0.57502055", "0.57311475", "0.56619555", "0.56219095", "0.55677223", "0.55440766", "0.5522619", "0.55077183", "0.550424", "0.5498697", "0.5479186", "0.54653597", "0.546...
0.80256546
0
ArraySequence distance should work with function of indices
def test_distance_indices(self): s1 = self.RNA("AUGC") s2 = self.RNA("AAGC") def f(x, y): if x == 2 or y == 2: return 10 return 0 self.assertEqual(s1.distance(s2, f, use_indices=True), 20)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_distance_array(self):\n s1 = Source([[10, 10], [10, 20]], values=[1.0, 2.0])\n assert(s1.distance([20, 25]) == sqrt(200))\n assert(s1.distance(array([20, 25])) == sqrt(200))", "def _nb_vector_tcrdist(indices, seqs_mat, seqs_L, distance_matrix=tcr_nb_distance_matrix, dist_weight=3, g...
[ "0.6781516", "0.62706697", "0.6230655", "0.6199052", "0.6007264", "0.5988063", "0.5955639", "0.5908289", "0.588692", "0.58559555", "0.579329", "0.5787277", "0.57607883", "0.57606375", "0.5740236", "0.5734664", "0.5719815", "0.5713297", "0.56995946", "0.5692462", "0.5658256", ...
0.64148456
1
Sequence strip_bad_and_gaps should remove gaps and bad chars
def test_strip_bad_and_gaps(self): # have to turn off check to get bad data in; no longer preserves case r = self.RNA("ACG--GRN?") self.assertEqual(r.strip_bad_and_gaps(), "ACGGRN") r._data[0] = 99 self.assertEqual(r.strip_bad_and_gaps(), "CGGRN")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_strip_bad_and_gaps(self):\n # have to turn off check to get bad data in; no longer preserves case\n self.assertEqual(\n self.RNA(\"UxxCAGwsnyrHBNz#!D-D\", check=False).strip_bad_and_gaps(),\n \"UCAGWSNYRHBNDD\",\n )\n self.assertEqual(\n self.RN...
[ "0.76906425", "0.6872599", "0.686638", "0.6582646", "0.6464975", "0.6438769", "0.63625026", "0.6273571", "0.6273571", "0.6253653", "0.6191777", "0.6101316", "0.60952926", "0.6083035", "0.602748", "0.60102254", "0.59808695", "0.5978832", "0.5978832", "0.59764034", "0.59651965"...
0.7566995
1
abseq array seq should count characters
def test_count_ab(self): AB = get_moltype("ab") seq = AB.make_array_seq("aaba-", alphabet=AB.alphabet.with_gap_motif()) c = seq.counts() self.assertEqual(c.to_dict(), {"a": 3, "b": 1}) c = seq.counts(allow_gap=True) self.assertEqual(c.to_dict(), {"a": 3, "b": 1, "-": 1})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_seqeunce_helper(i, text, dsl, char_count, char_to_n, extra, length = seq_length):\n\n seq_int = [] # Sequence mapped to integers\n output_seq = np.zeros((length, char_count)) # Output sequence which will become one item in input array \n\n # Get the next sequence and map its characters to inte...
[ "0.65561444", "0.6134673", "0.60102427", "0.59734315", "0.59293884", "0.5833849", "0.5833849", "0.58157563", "0.58157563", "0.5804842", "0.5782722", "0.5716325", "0.57094294", "0.5637024", "0.56230783", "0.5609562", "0.5594264", "0.55887735", "0.55783176", "0.5576027", "0.557...
0.63717175
1
Loads .refFiles within folder and returns Benchmark objects.
def load_from_folder(folder): refs = [] for input_file in os.listdir(folder): if input_file.endswith(".ref"): refs.append(Reference(folder, input_file)) return refs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, benchmark_dir):\n self.__benchmark_dir = benchmark_dir\n self.__load_configs()\n self.__load_results()", "def process(self, args):\n for benchmark_file in args.benchmark_files:\n self.process_individual_file(benchmark_file)\n self.total_files +...
[ "0.57945746", "0.573893", "0.56740427", "0.56193376", "0.54738635", "0.54364634", "0.5314725", "0.5297583", "0.52758354", "0.52714825", "0.5262658", "0.52590454", "0.5200991", "0.5175383", "0.51303047", "0.5125099", "0.5123298", "0.51226366", "0.5115385", "0.5082754", "0.5074...
0.66932875
0
Creates a filename for the diff image.
def __diff_filename(self): diff_dir = os.path.join(self.__folder, Reference.DIFF_OUT) if not os.path.exists(diff_dir): os.makedirs(diff_dir) return os.path.join(diff_dir, self.__name +'.jpg')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_image_filename():\n now = datetime.now().strftime('%a-%w-%b-%H:%M:%S')\n return 'CCTV_{0}.jpg'.format(now)", "def create_file_name(self):\n # create a unique id for the file name\n index = self.helpers.alpha_uuid()\n\n filename = self.form['FieldStorage'][self.image_cid].f...
[ "0.7496504", "0.70392674", "0.6811171", "0.68030304", "0.6780318", "0.6759815", "0.6705021", "0.6657758", "0.66381377", "0.663154", "0.6581436", "0.656019", "0.6552397", "0.64273417", "0.64220864", "0.64080304", "0.6396402", "0.6372434", "0.6313289", "0.6312673", "0.62726647"...
0.80227315
0
Returns complete path to reference file.
def reffile(self): return os.path.join(self.__folder, self.__name + '.ref')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_reference(self):\n return self.__file_reference", "def file_path(self):\n return self.lib.file_path", "def reference(self, referencing_buildfile_path=None):\r\n dirname = os.path.dirname(self.buildfile.relpath)\r\n if referencing_buildfile_path and dirname == os.path.dirname(refere...
[ "0.76702243", "0.7521929", "0.7433961", "0.7375567", "0.73540425", "0.7257237", "0.7222851", "0.7154171", "0.7140519", "0.70815873", "0.707913", "0.69877857", "0.6966572", "0.69569427", "0.6941436", "0.6937595", "0.69299084", "0.6917151", "0.69130236", "0.69052565", "0.689622...
0.7571063
1
Loads the positions where bugs where found.
def __load_bugs(self): bugs = [] with open(self.reffile(), 'rb') as reffile: reader = csv.reader(reffile, delimiter=';', quotechar='\n') for line in reader: bugs.append(tuple(map(int, line))) return bugs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSimbadPositions(identifier):\n\treturn base.caches.getSesame(\"simbad\").getPositionFor(identifier)", "def find_excited_locations(self):\n return np.asarray(np.where(self._grid == 8)).T", "def _find_pickup_locations(self):\n if self._pickup_locations is None:\n maze_str = self._env.observ...
[ "0.56719327", "0.55538607", "0.5547954", "0.5500129", "0.54332054", "0.5379162", "0.5337847", "0.53154814", "0.52816904", "0.52486926", "0.52087176", "0.5208394", "0.5205178", "0.5172711", "0.51594424", "0.5153587", "0.5099652", "0.5093775", "0.5068396", "0.5058991", "0.50521...
0.6171006
0
Returns true if the list contains a similar rect.
def __has_similar_rect(rect, rect_list): for i in reversed(range(len(rect_list))): if Reference.__is_similar(rect_list[i], rect): del(rect_list[i]) return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __is_similar(rect, another):\n area1 = rect[2]*rect[3]\n area2 = another[2]*another[3]\n intersect_width = min(rect[0]+rect[2], another[0]+another[2]) - max(rect[0],another[0])\n if not intersect_width > 0:\n return False\n intersect_height = min(rect[1]+rect[3], a...
[ "0.6806085", "0.65448457", "0.6458573", "0.6406005", "0.6380805", "0.6235643", "0.6211002", "0.6206766", "0.615934", "0.6149881", "0.61256045", "0.6114601", "0.6105064", "0.60557085", "0.60360897", "0.60351527", "0.60016364", "0.5986043", "0.59527403", "0.5941617", "0.5937699...
0.8229332
0
Returns true if the rects are of similar size and position.
def __is_similar(rect, another): area1 = rect[2]*rect[3] area2 = another[2]*another[3] intersect_width = min(rect[0]+rect[2], another[0]+another[2]) - max(rect[0],another[0]) if not intersect_width > 0: return False intersect_height = min(rect[1]+rect[3], another[1]+a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def issquare(self):\r\n if self.width == self.height:\r\n return True\r\n else:\r\n return False", "def is_square (self):\n return self.width == self.height", "def rectIsSimilar(rect1, rect2, similarity):\n x1, y1, w1, h1 = rect1\n x2, y2, w2, h2 = rect2\n\n ...
[ "0.69476604", "0.68666345", "0.68315774", "0.67185247", "0.6648864", "0.65498066", "0.65251964", "0.6512791", "0.6401279", "0.6394241", "0.63913405", "0.6323339", "0.6255712", "0.62301314", "0.6203733", "0.6200238", "0.6200238", "0.6144445", "0.6120417", "0.6112837", "0.61006...
0.75187314
0
Builds the obj on signal, or returns the signal if obj is None.
def build_or_passthrough(model, obj, signal): return signal if obj is None else model.build(obj, signal)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __get__(self, obj, cls):\n if obj is None:\n msg = 'Signals can only be accessed through an instance'\n raise AttributeError(msg)\n instances = self._instances\n if obj in instances:\n res = instances[obj]\n else:\n res = instances[obj] = ...
[ "0.6035896", "0.59348387", "0.55138874", "0.53285486", "0.53285486", "0.5293422", "0.51871073", "0.51645017", "0.5118689", "0.5080994", "0.50475734", "0.501795", "0.49606928", "0.49454436", "0.4915813", "0.48942703", "0.48796424", "0.48708183", "0.4843524", "0.48375458", "0.4...
0.72735953
0
bind methods to the shell
def bind(self, shell): shell.render_prompt = types.MethodType(self.render_prompt.__func__, shell)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shell(self, cmd):\n raise NotImplementedError", "def shell():\n pass", "def _command(self, *cmd, handler=None):", "def shell(self, **options):\n pass", "def get_shell(self, shell):", "def commands():", "def commands():\n pass", "def commands():\n pass", "def commands():\n...
[ "0.7021964", "0.69798553", "0.68439513", "0.68174416", "0.66994655", "0.6641779", "0.66141284", "0.66141284", "0.66141284", "0.66141284", "0.65619034", "0.6286182", "0.6272943", "0.6262935", "0.62542933", "0.62212807", "0.61768734", "0.6073992", "0.6073585", "0.6052224", "0.5...
0.7553567
0
Simply returns the original position, default = [0,0,0] Inputs pose [x,y,theta] in [m,m,degrees] Returns pose [x,y,theta] in [m,m,degrees].
def get_goal_pose(self,pose=[0,0,0]): return pose
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initial_pose(self):\n return self._initial_pose", "def get_pose(self):\n return self._model.get_pose()", "def getPose(self):\n\t\treturn self.__subs['pose'].getData()", "def get_current_position(self) -> np.ndarray:\n pose_world = forward_kinematics(self.body, eef_link=self.DoF - 1)\...
[ "0.6909737", "0.6768237", "0.67472076", "0.6660814", "0.6647101", "0.658427", "0.6541245", "0.6519557", "0.6519502", "0.6515536", "0.6484813", "0.6447546", "0.64341164", "0.6431541", "0.63714004", "0.6367724", "0.63557184", "0.6349324", "0.6282474", "0.6237291", "0.6213221", ...
0.7092843
0
Set the range of physical values that should map onto the MLP
def set_physical_minmax(self, min, max): # This allows you to set the min and the max of the quantity that you want the MLP to measure. # Once you set this, you can pass in a physical number to get_mlp_value() and it will be mapped to an MLP value and returned pass # Maybe we s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_mapping(self, value_min, value_min_raw, value_max, value_max_raw):\n assert value_min <= value_max\n # prevent division by zero.\n if value_min == value_max:\n value_max += 1.\n if value_min_raw == value_max_raw:\n value_max_raw += 1.\n self.value_mi...
[ "0.693925", "0.6680546", "0.66189826", "0.65850914", "0.6456573", "0.6456573", "0.6417098", "0.6364023", "0.63490635", "0.6339034", "0.6289142", "0.6263453", "0.62625813", "0.62568754", "0.6235019", "0.6200884", "0.61912847", "0.61842424", "0.6182446", "0.6177519", "0.6176896...
0.79315037
0
Get the torque on the motor from the brakes
def get_motor_load_torque(self): # Start with the brake normal # change to 17deg (tan 17?) # change to torque using the pitch of the thread on the ball screw # (^ make sure to take friction into account) # That should give us the torque acting on the motor. If this torque is grea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_torque(self):\n return self.node.sdo[0x6077].phys # rate torque(mN.m) /1000", "def mTorque(self):\n pass", "def aTorque(self):\n pass", "def motor_torques(self):\n raise NotImplementedError('Not yet implemented!')", "def gTorque(self):\n pass", "def joints_torque(...
[ "0.70026714", "0.67918426", "0.6789097", "0.67424893", "0.6490259", "0.6446426", "0.6392001", "0.6252369", "0.615059", "0.61473376", "0.61432093", "0.61259156", "0.6105141", "0.61044025", "0.5916003", "0.58762723", "0.583563", "0.5775201", "0.57536286", "0.5740155", "0.574015...
0.8009619
0
Get all my daily_schedule
def get_my_schedules(): schedules = DailyScheduleModel.get_daily_schedules_by_user(g.user.get('id')) user_schedules = daily_schedule_schema.dump(schedules, many=True) return custom_response(user_schedules, 200)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSchedules(self) :\n return self.schedules", "def get_schedules():\n path = config.get('schedule', 'paths', './schedule.json')\n with open(path) as schedule_file:\n return json.load(schedule_file)", "def all_schedules(self):\n return self._all_schedules", "def get_schedules():\n ...
[ "0.7289857", "0.71636593", "0.7133032", "0.71146274", "0.70769674", "0.6985168", "0.6768955", "0.66982865", "0.6636281", "0.6565948", "0.65510726", "0.6524397", "0.64645636", "0.6455582", "0.6405482", "0.63976073", "0.63691497", "0.6340968", "0.6331203", "0.6315706", "0.62717...
0.75095713
0
Adds field to document contents. Field value can be a list, where each item is added separately (i.e., the field is multivalued).
def __add_to_contents(self, field_name, field_value, field_type): if type(field_value) is list: for fv in field_value: self.__add_to_contents(field_name, fv, field_type) else: if len(field_value) > 0: # ignore empty fields self.contents.append({'f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __add_to_contents(self, field_name, field_value, field_type):\n self.contents.append({'field_name': field_name,\n 'field_value': field_value,\n 'field_type': field_type})", "def append(dest, field, value):\n if isinstance(dest[fi...
[ "0.7012308", "0.6697444", "0.63506097", "0.62795776", "0.6221397", "0.60970956", "0.6074363", "0.6061657", "0.6061657", "0.6061657", "0.5992678", "0.59347403", "0.5931987", "0.59300864", "0.59300864", "0.58972836", "0.58769643", "0.5775113", "0.57599974", "0.57518005", "0.572...
0.7746347
0
Test when geographic extent changes.
def test_log_update_geographic_extent(self): log_count_init = LoggerHistory.objects.count() original_geographic_extent = self.project.geographic_extent self.project.geographic_extent = GEOSGeometry( '{"type": "Polygon","coordinates":' '[[[-0.505,51.682],[-0.53,51.327],' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_extent(self):\n if self.lower_left.x > self.upper_right.x:\n dlx = self.lower_left.x\n self.lower_left.x = self.upper_right.x\n self.upper_right.y = dlx\n\n if self.lower_left.y > self.upper_right.y:\n dly = self.lower_left.y\n self.low...
[ "0.5910318", "0.5763293", "0.556814", "0.5436953", "0.5405711", "0.53909826", "0.53579795", "0.53464943", "0.5327532", "0.53197294", "0.52521455", "0.5181637", "0.5171861", "0.51245767", "0.5123446", "0.51189536", "0.50938094", "0.5072819", "0.50627923", "0.5045673", "0.50408...
0.6644449
0
Test when multiple model fields changes.
def test_log_update_multiple_fields(self): log_count_init = LoggerHistory.objects.count() original_isprivate = self.project.isprivate original_islocked = self.project.islocked self.project.isprivate = False self.project.islocked = True self.project.save() log_cou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_fields_updated_with_computed(self):\n pass", "def _validate_fields(self, change_fields):\n pass", "def _field_was_changed(self):\n field_map = self._field_map\n for field in field_map.itervalues():\n if field.was_changed():\n return True\n r...
[ "0.69400656", "0.6714582", "0.64557713", "0.62088406", "0.6202799", "0.61854094", "0.6156362", "0.61393243", "0.6132215", "0.61121684", "0.6104089", "0.60721403", "0.6061349", "0.6043818", "0.6033619", "0.6031339", "0.6025014", "0.60222876", "0.6019186", "0.60170436", "0.6014...
0.693425
1
kwargs Additional keyword arguments are copied and the copy is passed up to AbstractSimplexParameterType; see documentation for that class for details
def __init__(self, **kwargs): kwc=kwargs.copy() AbstractSimplexParameterType.__init__(self, **kwc)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n AbstractSimplexParameterType.__init__(self, **kwc)\n\n self._template_attrs['fill_value'] = False\n\n self._gen_template_attrs()", "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n AbstractSimplexParameterType.__init...
[ "0.69261605", "0.6647647", "0.6435878", "0.6260152", "0.61408424", "0.6130079", "0.6130027", "0.6129116", "0.6115548", "0.6056017", "0.60557586", "0.60557586", "0.60557586", "0.60557586", "0.60557586", "0.60557586", "0.60557586", "0.6039004", "0.59231293", "0.59231293", "0.58...
0.80070865
1
ParameterType for Quantities (float, int, etc) value_encoding The intrinsic type of the Quantity kwargs Additional keyword arguments are copied and the copy is passed up to AbstractSimplexParameterType; see documentation for that class for details
def __init__(self, value_encoding=None, uom=None, constraint=None, **kwargs): kwc=kwargs.copy() AbstractSimplexParameterType.__init__(self, value_class='NumericValue', **kwc) if value_encoding is None: self._value_encoding = np.dtype('float32').str else: try: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, base_type=None, **kwargs):\n kwc=kwargs.copy()\n AbstractComplexParameterType.__init__(self, value_class='FunctionValue', **kwc)\n if base_type is not None and not isinstance(base_type, QuantityType):\n raise TypeError('\\'base_type\\' must be an instance of Quant...
[ "0.6628984", "0.64694905", "0.63277125", "0.63277125", "0.63277125", "0.63277125", "0.63277125", "0.63277125", "0.63277125", "0.6248839", "0.58616287", "0.5837818", "0.58370155", "0.5768371", "0.5614411", "0.5582864", "0.5551495", "0.55346626", "0.551115", "0.55017114", "0.54...
0.71359324
0
kwargs Additional keyword arguments are copied and the copy is passed up to AbstractSimplexParameterType; see documentation for that class for details
def __init__(self, **kwargs): kwc=kwargs.copy() AbstractSimplexParameterType.__init__(self, **kwc)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n AbstractSimplexParameterType.__init__(self, **kwc)\n\n self._template_attrs['fill_value'] = False\n\n self._gen_template_attrs()", "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n AbstractSimplexParameterType.__init...
[ "0.6926334", "0.66476643", "0.64352614", "0.6260937", "0.61402684", "0.613057", "0.6130397", "0.61296386", "0.6116005", "0.60568196", "0.6056564", "0.6056564", "0.6056564", "0.6056564", "0.6056564", "0.6056564", "0.6056564", "0.6040087", "0.592367", "0.592367", "0.5854392", ...
0.8007624
0
Given an order, updates the order with prevailing tax rules onto the order's credit attribute. Then it returns
def apply_tax(order_obj): tax_rule = taxes.get() all_credits = order_obj.credits other_credit = filter(lambda x: x["coll_name"] != taxes.TaxRule.coll_name(), all_credits) if tax_rule is not None: order_obj.credits = other_credit + [{ "obj_id": tax...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_order(self, order):\n order.order_id = self.order_id\n order.average_price = self.avg_execution_price\n order.symbol = self.symbol\n order.side = self.side\n order.type = self.order_type\n order.amount = self.original_amount\n order.price = self.price\n ...
[ "0.61190176", "0.5793169", "0.560548", "0.5537112", "0.5497742", "0.54355586", "0.54355586", "0.5407957", "0.54025096", "0.5350767", "0.5334678", "0.5318417", "0.5301097", "0.529851", "0.5259051", "0.52478224", "0.52440584", "0.5229148", "0.5221458", "0.5206095", "0.5195599",...
0.7710866
0
Given an order, updates the order with prevailing discount rules onto the order's debit attribute
def apply_discounts(order_obj): all_dedits = order_obj.debits other_debit = filter(lambda x: x["coll_name"] != discounts.Discount.coll_name(), all_dedits) all_discounts = discounts.get_all() valid_discounts = [] for item_dic in order_obj.items: for d in all_discounts: item_obj = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_discount_rate(self, order_value, discount_rate):\r\n if float(discount_rate) == 0:\r\n self.discount_rate = float(RetailCustomer.discount_rate)\r\n else:\r\n self.discount_rate = float(discount_rate)", "def apply_discount(self, product):\n pass", "def redeem(s...
[ "0.6252258", "0.618614", "0.6119923", "0.5988139", "0.59648347", "0.5937784", "0.5921841", "0.5921826", "0.5836305", "0.5754859", "0.5699986", "0.5638767", "0.5624367", "0.55587643", "0.554168", "0.5500832", "0.5458696", "0.5417213", "0.5393511", "0.53718966", "0.53718966", ...
0.64523685
0
Builds a pretrained VGG19 model that outputs image features extracted at the third block of the model
def build_vgg(self): vgg = VGG19(weights="imagenet") # Set outputs to outputs of last conv. layer in block 3 # See architecture at: https://github.com/keras-team/keras/blob/master/keras/applications/vgg19.py vgg.outputs = [vgg.layers[9].output] img = Input(shape=self.hr_shape) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_vgg():\n input_shape = (256, 256, 3)\n\n vgg = keras.applications.VGG19(include_top = False , input_shape = input_shape , weights=\"imagenet\")\n features = vgg.get_layer(index = 9).output\n\n model = keras.Model(inputs=[vgg.inputs], outputs=[features])\n return model", "def build_vgg(s...
[ "0.79228604", "0.7664166", "0.7466115", "0.72785217", "0.7189622", "0.71872103", "0.7153017", "0.7121094", "0.699137", "0.6904944", "0.6891368", "0.68058294", "0.6782009", "0.6762118", "0.67149067", "0.67085296", "0.6690299", "0.66350603", "0.66326374", "0.6616833", "0.660080...
0.788697
1
Returns given vm's/templates's disks collection href or list of disk objects
def getObjDisks(name, get_href=True, is_template=False): response = get_disk_attachments( name, 'template' if is_template else 'vm', get_href ) if get_href: return response return get_disk_list_from_disk_attachments(response)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_vdisks(client, resource_group_name, vm_name):\n virtual_machine = client.get(resource_group_name, vm_name)\n return virtual_machine.disks", "def get_disk_attachments(name, object_type='vm', get_href=False):\n api = get_api(object_type, \"%ss\" % object_type)\n obj = api.find(name)\n retur...
[ "0.6487518", "0.6178933", "0.60788083", "0.59857213", "0.5928848", "0.5895868", "0.58672506", "0.5854115", "0.58504194", "0.57318586", "0.5724269", "0.5638056", "0.5616229", "0.5597307", "0.55598325", "0.55260617", "0.55246115", "0.54903316", "0.5446013", "0.5396282", "0.5378...
0.7348018
0
Returns a Disk object from a disk attached to a vm
def getVmDisk(vmName, alias=None, disk_id=None): value = None if disk_id: prop = "id" value = disk_id elif alias: prop = "name" value = alias else: logger.error("No disk identifier or name was provided") return None return get_disk_obj_from_disk_attach...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_vdisk(client, resource_group_name, vm_name, disk_name):\n virtual_machine = client.get(resource_group_name, vm_name)\n for disk in virtual_machine.disks:\n if disk.virtual_disk_name == disk_name:\n return disk\n return None", "def get_disk_obj_from_disk_attachment(disk_attachm...
[ "0.7119601", "0.7092368", "0.70414054", "0.6679714", "0.6640973", "0.650309", "0.6392032", "0.6355302", "0.629178", "0.6273012", "0.6256461", "0.6222913", "0.62218547", "0.6218388", "0.618372", "0.61645603", "0.61220926", "0.6121833", "0.609453", "0.6032805", "0.60152584", ...
0.769929
0
Returns disk from template collection
def getTemplateDisk(template_name, alias): template_disks = getObjDisks( template_name, get_href=False, is_template=True ) for template_disk in template_disks: if alias == template_disk.get_alias(): return template_disk raise EntityNotFound( "Didn't find disk %s for t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def template_storage_and_column():\r\n root = join(dirname(__file__), \"app\", \"templates\")\r\n storage = FileSystemStorage(location=root, base_url=\"/baseurl/\")\r\n column = tables.FileColumn(attrs={\"span\": {\"class\": \"span\"},\r\n \"a\": {\"class\": \"a\"}}...
[ "0.56004196", "0.5590748", "0.5581125", "0.5569269", "0.5568401", "0.5486315", "0.5423215", "0.5413344", "0.5405264", "0.5395757", "0.53775305", "0.5358232", "0.535637", "0.5337047", "0.5311859", "0.52786845", "0.5273297", "0.5271104", "0.5260368", "0.5256782", "0.5250343", ...
0.5808441
0
Returns disk object from disks' collection __author__ = "ratamir"
def get_disk_obj(disk_alias, attribute='name'): return DISKS_API.find(disk_alias, attribute=attribute)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disk(self):\n return self.__disk", "def getDisk(self, item):\n return self.disks[item]", "def _getDisk(self):\n try:\n disk = self.parents[0]\n except IndexError:\n disk = None\n return disk", "def GetDisk(self, disk_name: str) -> 'AZComputeDisk':\n ...
[ "0.7052868", "0.682129", "0.6661143", "0.66152626", "0.6550657", "0.6482319", "0.64641225", "0.64555496", "0.63855463", "0.63251585", "0.62917346", "0.6245236", "0.62283444", "0.61439914", "0.6135759", "0.6087165", "0.60854214", "0.60216755", "0.5937269", "0.59311324", "0.592...
0.6881587
1
Prepare or update disk object according to its kwargs __author__ = jlibosva
def _prepareDiskObject(**kwargs): storage_domain_name = kwargs.pop('storagedomain', None) # Tuple (lun_address, lun_target, lun_id, lun_port) lun = (kwargs.pop('lun_address', None), kwargs.pop('lun_target', None), kwargs.pop('lun_id', None), kwargs.pop('lun_port', 3260)) # Tuple (username, p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, _id, disks, description=None, tags=None, modifiedBy=None, createdBy=None, dateModified=None, dateCreated=None, domains=None):\n pass", "def __init__(__self__, *,\n create_option: pulumi.Input[Union[str, 'DiskCreateOption']],\n gallery_image_reference: Opt...
[ "0.57172906", "0.56479627", "0.549607", "0.5475961", "0.54032505", "0.539175", "0.5331734", "0.53218746", "0.52937764", "0.52769303", "0.5270235", "0.52216846", "0.5219496", "0.51791817", "0.51659566", "0.51659566", "0.5165272", "0.51422894", "0.51333195", "0.5112877", "0.509...
0.66322654
0
Detach disk from VM
def detachDisk(positive, alias, vmName): logger.info("Detaching disk %s from vm %s", alias, vmName) disk_attachment = get_disk_attachment(vmName, alias, attr='name') return DISK_ATTACHMENTS_API.delete(disk_attachment, positive)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disk_detach(vmdk_path, vm):\n\n device = findDeviceByPath(vmdk_path, vm)\n\n if not device:\n # Could happen if the disk attached to a different VM - attach fails\n # and docker will insist to sending \"unmount/detach\" which also fails.\n msg = \"*** Detach failed: disk={0} not foun...
[ "0.77460337", "0.7383604", "0.7272938", "0.70957154", "0.7014271", "0.69647926", "0.6918265", "0.6742025", "0.67416346", "0.6706193", "0.66873896", "0.6683356", "0.66481096", "0.6553151", "0.65065736", "0.6481779", "0.64740014", "0.6471214", "0.64225125", "0.64092827", "0.638...
0.78766763
0
Get all disks interfaces/formats/allocation policies permutations possible
def get_all_disk_permutation( block=True, shared=False, interfaces=(VIRTIO, VIRTIO_SCSI) ): permutations = [] for disk_format in [FORMAT_COW, FORMAT_RAW]: for interface in interfaces: for sparse in [True, False]: if disk_format is FORMAT_RAW and sparse and block: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _LookupDiskMods(self):\n return [(op, self._LookupDiskIndex(idx), params)\n for op, idx, params in self.op.disks]", "def get_all_disk():\n\t\tdisks = []\n\t\tdisks_lines = linux.exe_shell(\"lsblk -o NAME,VENDOR|grep -P '^sd.*[A-Z]'\")\n\t\tfor line in disks_lines.splitlines():\n\t\t\tdisk_t = l...
[ "0.56328917", "0.53854275", "0.53334033", "0.53093815", "0.5276727", "0.5263089", "0.52455497", "0.5224897", "0.5166511", "0.5132029", "0.51318884", "0.5120451", "0.5088118", "0.5072572", "0.504253", "0.5033381", "0.50171", "0.50147575", "0.5010506", "0.49924254", "0.49893463...
0.682289
0
Check if disk is in vm disks collection
def check_disk_visibility(disk, disks_list): is_visible = disk in [disk_obj.get_alias() for disk_obj in disks_list] return is_visible
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_partition(disk): #TODO: Could change to use \"Whole\" attrib. Good idea?\n\n return \"s\" in disk.split(\"disk\")[1]", "def show_vdisk(client, resource_group_name, vm_name, disk_name):\n virtual_machine = client.get(resource_group_name, vm_name)\n for disk in virtual_machine.disks:\n if di...
[ "0.642015", "0.6173205", "0.6010352", "0.59365094", "0.5920557", "0.588467", "0.5883323", "0.5865767", "0.58631855", "0.5849528", "0.581248", "0.57283443", "0.563945", "0.5629074", "0.5617215", "0.55904806", "0.5552183", "0.5539992", "0.55187285", "0.5498951", "0.54850733", ...
0.71183264
0
Gets the disk storage domain name __author__ = "ratamir"
def get_disk_storage_domain_name(disk_name, vm_name=None, template_name=None): if vm_name and template_name: logger.error( "Only one of the parameters vm_name or template_name " "should be provided" ) return None logger.info("Get disk %s storage domain", disk_nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_disk_name():\n return \"%s.dat.disk\" % getpass.getuser()", "def bucket_domain_name(self) -> str:\n ...", "def GetDataDiskName(cls, instance):\n name = cls.DATA_DISK_NAME_FMT.format(instance=instance)\n return cls._FormalizeName(name)", "def get_disk_file_name():\n return \...
[ "0.6967801", "0.65831107", "0.6512975", "0.6477021", "0.63847244", "0.63788724", "0.6315478", "0.6300419", "0.6270765", "0.6270765", "0.6262309", "0.61498886", "0.61498886", "0.61498886", "0.61462027", "0.6126907", "0.61219066", "0.61219066", "0.61067355", "0.61029404", "0.60...
0.6622522
1
Export a disk to glance repository
def export_disk_to_glance( positive, disk, target_domain, async=False, attr='id' ): storage_domain = STORAGE_DOMAIN_API.find(target_domain) disk = DISKS_API.find(disk, attribute=attr) if not DISKS_API.syncAction( disk, 'export', storage_domain=storage_domain, positive=positive, async...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, export_path: str):", "def export_to_gsas():\n # Get workflow\n work_flow = my_data.get()\n\n output_file_name = '/tmp/acceptance_test.gda'\n\n # Clear the file if it exists.\n if os.path.exists(output_file_name):\n os.remove(output_file_name)\n\n status = work_flow.export_...
[ "0.61116695", "0.59267706", "0.5841884", "0.5634184", "0.5515597", "0.5503389", "0.54823846", "0.54743654", "0.5460788", "0.53573567", "0.53079253", "0.5305249", "0.52523184", "0.5226656", "0.52151257", "0.5214028", "0.5204235", "0.5194055", "0.51850533", "0.5168795", "0.5163...
0.6461685
0
Get list of disk objects from API
def get_all_disks(): return DISKS_API.get(abs_link=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getObjDisks(name, get_href=True, is_template=False):\n response = get_disk_attachments(\n name, 'template' if is_template else 'vm', get_href\n )\n if get_href:\n return response\n return get_disk_list_from_disk_attachments(response)", "def fs_get_disk_list(self):\n\t\treturn Job(SD...
[ "0.7016373", "0.69284606", "0.68586487", "0.66986144", "0.6593451", "0.6314186", "0.6287725", "0.619246", "0.61885196", "0.61516696", "0.6150911", "0.61330783", "0.6132069", "0.61276704", "0.6107391", "0.6061154", "0.60491234", "0.6045728", "0.60329306", "0.6027059", "0.60234...
0.71823597
0
Creates a disk attachment object
def prepare_disk_attachment_object(disk_id=None, **kwargs): disk = kwargs.pop("disk", None) disk_obj = disk if disk else prepare_ds_object("Disk", id=disk_id) return prepare_ds_object("DiskAttachment", disk=disk_obj, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_attachment1():\n \n attachment = Attachment()\n attachment.file_content = (\"TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNl\"\n \"Y3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12\")\n attachment.file_type = \"application/pdf\"\n attachment.file_name = \"balance_001.pdf\"...
[ "0.6559428", "0.6483205", "0.6458923", "0.6397481", "0.6285788", "0.6222577", "0.6217149", "0.6192481", "0.61305714", "0.59841096", "0.5957176", "0.5932291", "0.59042203", "0.5887022", "0.58844835", "0.5867121", "0.5867092", "0.580685", "0.58006567", "0.5778685", "0.5754964",...
0.7236901
0
Samples a disk and waits until disk is found in the specific storage domain or until timeout is reached
def wait_for_disk_storage_domain( disk, storage_domain, key='id', timeout=600, interval=5 ): disk_name = get_disk_obj(disk, key).get_name() if key == 'id' else disk for sample in TimeoutingSampler( timeout, interval, get_disk_storage_domain_name, disk_name ): if sample == storage_domain:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_least_busy_host_gets_volume(self):\n volume1 = self.start_service('volume', host='host1')\n volume2 = self.start_service('volume', host='host2')\n volume_id1 = self._create_volume()\n volume1.create_volume(self.context, volume_id1)\n volume_id2 = self._create_volume()\n ...
[ "0.5733526", "0.55582863", "0.54887253", "0.5453938", "0.5273251", "0.5197576", "0.51590496", "0.51475734", "0.5147147", "0.51260424", "0.5120247", "0.5102149", "0.50740266", "0.5062461", "0.5061822", "0.5061822", "0.50525355", "0.50219655", "0.4995126", "0.49904713", "0.4987...
0.68130606
0
Return disk obj from disk attachment obj
def get_disk_obj_from_disk_attachment(disk_attachment): return get_disk_obj(disk_attachment.get_id(), 'id')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_disk_attachment(name, disk, attr='id', object_type='vm'):\n disk_list = get_disk_attachments(name, object_type=object_type)\n disk_id = None\n if attr == 'name' or attr == 'alias':\n for disk_obj in disk_list:\n disk_obj_alias = get_disk_obj(\n disk_obj.get_id(), a...
[ "0.74053216", "0.6793077", "0.6505615", "0.62658155", "0.6190773", "0.61779624", "0.59081876", "0.59013236", "0.5899676", "0.58538806", "0.58369386", "0.5775959", "0.576744", "0.57462335", "0.56462747", "0.56462747", "0.5566617", "0.55492383", "0.5525881", "0.55177563", "0.55...
0.8071707
0
Return disk obj list from disk attachments list
def get_disk_list_from_disk_attachments(disk_attachments): return [ get_disk_obj_from_disk_attachment(disk_attachment) for disk_attachment in disk_attachments ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_disk_attachments(name, object_type='vm', get_href=False):\n api = get_api(object_type, \"%ss\" % object_type)\n obj = api.find(name)\n return DISK_ATTACHMENTS_API.getElemFromLink(obj, get_href=get_href)", "def getObjDisks(name, get_href=True, is_template=False):\n response = get_disk_attachme...
[ "0.6690214", "0.6335851", "0.6259155", "0.59162986", "0.58995736", "0.58648187", "0.58527523", "0.582788", "0.58202004", "0.5820131", "0.5785615", "0.57774895", "0.5740484", "0.5735309", "0.5713783", "0.56764907", "0.563066", "0.56279755", "0.5622251", "0.5558199", "0.5538795...
0.77885747
0
Get disk attachments objects or hrefs from a vm or template
def get_disk_attachments(name, object_type='vm', get_href=False): api = get_api(object_type, "%ss" % object_type) obj = api.find(name) return DISK_ATTACHMENTS_API.getElemFromLink(obj, get_href=get_href)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getObjDisks(name, get_href=True, is_template=False):\n response = get_disk_attachments(\n name, 'template' if is_template else 'vm', get_href\n )\n if get_href:\n return response\n return get_disk_list_from_disk_attachments(response)", "def get_disk_attachment(name, disk, attr='id',...
[ "0.69518954", "0.6364521", "0.62688756", "0.6195739", "0.6097033", "0.59367794", "0.57009", "0.5675643", "0.56053907", "0.55326456", "0.55198544", "0.55018055", "0.5492309", "0.54542166", "0.5448821", "0.54335314", "0.53960615", "0.537463", "0.5373918", "0.53636795", "0.53573...
0.78496575
0
Returns a disk attachment object
def get_disk_attachment(name, disk, attr='id', object_type='vm'): disk_list = get_disk_attachments(name, object_type=object_type) disk_id = None if attr == 'name' or attr == 'alias': for disk_obj in disk_list: disk_obj_alias = get_disk_obj( disk_obj.get_id(), attribute='i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_disk_obj_from_disk_attachment(disk_attachment):\n return get_disk_obj(disk_attachment.get_id(), 'id')", "def prepare_disk_attachment_object(disk_id=None, **kwargs):\n disk = kwargs.pop(\"disk\", None)\n disk_obj = disk if disk else prepare_ds_object(\"Disk\", id=disk_id)\n return prepare_ds_o...
[ "0.779783", "0.72560024", "0.6928796", "0.6578346", "0.6403104", "0.63818413", "0.6339139", "0.63055414", "0.6187242", "0.6176985", "0.61555827", "0.61421245", "0.6115087", "0.6013763", "0.6011736", "0.6002136", "0.591897", "0.5893593", "0.58661467", "0.58532095", "0.5836235"...
0.75038487
1
Get all disks in the system except the OVF store disks
def get_non_ovf_disks(): return [ d.get_id() for d in get_all_disks() if ( d.get_alias() != ENUMS['ovf_disk_alias'] ) ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_disks():\n return DISKS_API.get(abs_link=False)", "def get_all_disk():\n\t\tdisks = []\n\t\tdisks_lines = linux.exe_shell(\"lsblk -o NAME,VENDOR|grep -P '^sd.*[A-Z]'\")\n\t\tfor line in disks_lines.splitlines():\n\t\t\tdisk_t = line.split()\n\t\t\tif len(disk_t) > 1 and \"LSI\" not in disk_t[1]:\n...
[ "0.73597276", "0.7200828", "0.69137365", "0.6862478", "0.6828824", "0.6764747", "0.6552665", "0.65480185", "0.65238166", "0.6423896", "0.63987154", "0.6374826", "0.63124114", "0.6271041", "0.62678945", "0.6261637", "0.62305725", "0.61843395", "0.6136389", "0.6070867", "0.6056...
0.7961894
0
Get the qcow_version info from disk name or id
def get_qcow_version_disk(disk_name, attribute='name'): return get_disk_obj(disk_name, attribute).get_qcow_version()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fetch_disk_info(resource_group_name, disk_name):\n show_disk_command = 'az disk show -g {g} -n {name} --query [sku.name,location,osType,hyperVGeneration] -o json'.format(g=resource_group_name, name=disk_name)\n disk_info = loads(_call_az_command(show_disk_command))\n # Note that disk_info will always...
[ "0.59442717", "0.5840063", "0.57724935", "0.5763192", "0.56448805", "0.5523646", "0.54851925", "0.54775894", "0.54669577", "0.54666495", "0.5381811", "0.53117114", "0.52990836", "0.52868456", "0.5284956", "0.52782893", "0.5276385", "0.5264113", "0.52572054", "0.52468705", "0....
0.7662928
0
Return the disks contained in a snapshot
def get_snapshot_disks_by_snapshot_obj(snapshot): return DISKS_API.getElemFromLink(snapshot)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_disks():\n\n if system() != \"Windows\":\n raise OSError(\"For use with Windows platforms.\")\n\n logicaldisks=run(\n [\"wmic\", \"logicaldisk\", \"get\", \"name\"],\n capture_output=True\n )\n\n return findall(\"[A-Z]:\", str(logicaldisks.stdout...
[ "0.6811599", "0.68013054", "0.672062", "0.657291", "0.65141135", "0.64920574", "0.6439014", "0.64347744", "0.64077145", "0.6335327", "0.63346064", "0.63235974", "0.631117", "0.62916005", "0.627171", "0.6241496", "0.6225746", "0.6225603", "0.62238884", "0.6167665", "0.61405224...
0.79499185
0
Returns all disksnapshots objects list in the given storage domain
def get_storage_domain_diskssnapshots_objects(storagedomain, get_href=False): from art.rhevm_api.tests_lib.low_level.storagedomains import ( get_storage_domain_obj ) storage_domain_object = get_storage_domain_obj(storagedomain) return DISK_SNAPSHOT_API.getElemFromLink( storage_domain_obj...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_storage_domains(cohesity_client):\n storage_domain_list = cohesity_client.view_boxes.get_view_boxes()\n for domain in storage_domain_list:\n exported_res_dict[\"Storage Domains\"].append(domain.name)\n return storage_domain_list", "def get_snapshots(FIELDS='all'):\n snapinfostr = fork_...
[ "0.6704098", "0.6653081", "0.6420554", "0.6378387", "0.62653655", "0.61300075", "0.6005906", "0.59770525", "0.5968691", "0.59580076", "0.5947921", "0.5879047", "0.5876216", "0.5772094", "0.57576305", "0.57467604", "0.57035834", "0.5662695", "0.5657524", "0.56540245", "0.56525...
0.7705549
0
Check if certain disk is attached to VM as Read Only
def get_read_only(vm_name, disk_id): return get_disk_attachment(vm_name, disk_id).get_read_only()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_mounted_system(self):\n res = self.su_cmd('touch /system/.dwarf_check')\n if res == '':\n res = self._do_adb_command('shell ls -la /system')\n if '.dwarf_check' in res:\n res = self.su_cmd('rm /system/.dwarf_check')\n if res == '':\n ...
[ "0.68377024", "0.6680292", "0.6422407", "0.6302423", "0.5968654", "0.59454435", "0.59246737", "0.5899567", "0.58853364", "0.5862699", "0.5862699", "0.58550006", "0.58550006", "0.5846145", "0.58454525", "0.5780733", "0.57160926", "0.56951934", "0.5689234", "0.5687709", "0.5667...
0.7584012
0
Wait for an event of successful/failed sparsify event starting from the last start sparsify event in the system.
def wait_for_sparsify_event(disk_id, success=True): import art.rhevm_api.tests_lib.low_level.events as ll_events disk_name = get_disk_obj(disk_alias=disk_id, attribute='id').get_name() start_sparsify_query = "\"Started to sparsify %s\"" % disk_name finished_sparsify_query = ( "%s sparsified succ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def waitUntilSuccess():", "def wait_for_event(self, event):\n\n\t\tif event == 5:\n\t\t\toutcome = self.wait_for_saccade_start()\n\t\telif event == 6:\n\t\t\toutcome = self.wait_for_saccade_end()\n\t\telif event == 7:\n\t\t\toutcome = self.wait_for_fixation_start()\n\t\telif event == 8:\n\t\t\toutcome = self.wai...
[ "0.61228937", "0.57435817", "0.5658563", "0.55395555", "0.55395555", "0.55395555", "0.55395555", "0.5474974", "0.54738116", "0.5424017", "0.5409089", "0.52819955", "0.52727515", "0.52532136", "0.52388525", "0.52307796", "0.5214139", "0.52131623", "0.5210483", "0.52062255", "0...
0.7065584
0
Invoke sparsify action on disk.
def sparsify_disk(disk_id, storage_domain_name, wait=True): if not do_disk_action( 'sparsify', disk_id=disk_id, target_domain=storage_domain_name, wait=wait ): return False return wait_for_sparsify_event(disk_id) if wait else True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sparsify_model(path_to_model, sparsified_model_dump_path):\n sparsity_levels = [sl / 10 for sl in range(0, 10)]\n sparsity_levels += [0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.0]\n\n norms = [\"L1\", \"L2\"]\n sparse_block_shapes = [(1, 1), (1, 4)]\n\n device = torch.device('cuda')...
[ "0.54346603", "0.51681167", "0.51676154", "0.47499394", "0.46290654", "0.45078585", "0.44578275", "0.44389233", "0.44310507", "0.44083863", "0.44033685", "0.43932283", "0.43796688", "0.43533888", "0.43257746", "0.43140608", "0.42917594", "0.427881", "0.426788", "0.4243454", "...
0.5380593
1
Refresh the routing table
def refresh(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _refresh_table(self):\n self._column_selected()\n self._table_selected()\n self._column_selection_change()\n self.refresh_column_list()\n self.refresh_table_list()\n self.refresh_table()", "def refresh(self) -> None:\n pass", "def refresh(self) -> None:\n ...
[ "0.62884986", "0.62584835", "0.62584835", "0.62584835", "0.62575024", "0.62315863", "0.62027854", "0.6158251", "0.6158251", "0.61570215", "0.61530703", "0.6113206", "0.6086956", "0.6081516", "0.60719234", "0.6031992", "0.5962185", "0.5955436", "0.59503174", "0.59503174", "0.5...
0.638114
1
Attempt to add the given node to the routing table.
def addNode(self, node: dht.node.Node): bucket = self._findBucket(node) if bucket == None: raise Exception("Found no bucket for given id") if not node in bucket: # We do not have this node on our routing table yet; # attempt to add it. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_node(self, node):", "def _add_node(self, node: int) -> None:\r\n self.nodes.add(node)", "def add_node (self, node):\n self.network.add_node(node.id)\n self.network.node[node.id] = node", "def add(self, nodeLoc):\n self.table[self.getHashIndex(nodeLoc)] = True", "def add_node(sel...
[ "0.7356876", "0.71309835", "0.7125489", "0.7123913", "0.7108166", "0.7067707", "0.70652515", "0.7004943", "0.70035964", "0.6994578", "0.6977097", "0.69619924", "0.69286156", "0.69099814", "0.68835133", "0.688126", "0.6873235", "0.6852162", "0.68456715", "0.6845571", "0.684557...
0.7837554
0
Find the appropriate bucket for the given node
def _findBucket(self, node): for bucket in buckets: if bucket.inRange(node): return bucket #if bucket.low <= node and node <= bucket.high: # return bucket return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, node):\n j = self._hash_function(node)\n bucket = self._T[j]\n if bucket is None:\n raise KeyError(node)\n return bucket[node]", "def findBucket(conn, bucketName):\n for cand in conn.get_all_buckets():\n if cand.name == bucketName:\n ...
[ "0.69149685", "0.6786792", "0.6786792", "0.65305567", "0.64101285", "0.64010876", "0.6354371", "0.62193334", "0.6108624", "0.60978067", "0.59703565", "0.59660417", "0.59175164", "0.58907247", "0.57858413", "0.57837915", "0.5781839", "0.57607853", "0.57242984", "0.5691928", "0...
0.86419946
0
Find the K nodes in the routing table closest to the given target ID.
def findClosestNodes(self, target: hash.hash.Hash): # TODO: make more efficient # See: http://stackoverflow.com/questions/30654398/implementing-find-node-on-torrent-kademlia-routing-table nodes = [] for bucket in self.buckets: nodes = nodes + bucket.nodes ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nearest_neighbor(data_set, target):\n \n tree = KDT(data_set)\n k = tree.k\n p = KDTNode(target)\n \n def KDsearch(current, target, neighbor, distance):\n \"\"\"The actual nearest neighbor search algorithm.\n Inputs:\n current (KDTNode): the node to examine.\n ...
[ "0.65448064", "0.63752544", "0.6327887", "0.6252531", "0.62341696", "0.6202399", "0.6175748", "0.6170855", "0.61633563", "0.6134241", "0.6043866", "0.60149163", "0.6012577", "0.601178", "0.59670776", "0.596042", "0.5876144", "0.5814865", "0.5796329", "0.5743522", "0.57418907"...
0.7600108
0
Remove the given bucket from the routing table, split the bucket in two buckets each spanning halve the original bucket's ID space, redistribute the nodes to the appropriate buckets and add the buckets to the routing table.
def _splitBucket(self, bucket): idx = self.buckets.index(bucket) self.buckets.pop(idx) middle = int(bucket.low + (bucket.high - bucket.low)/2) bucketLow = Bucket(bucket.low, middle, bucket.refreshed) bucketHigh = Bucket(middle+1, bucket.high, refreshed.refreshed) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_group_bucket():\n pass", "def delete_bucket_replication(Bucket=None):\n pass", "def delete_bucket(Bucket=None):\n pass", "def remove(self, key: int) -> None:\n hashKey = key % 1000\n prev = node = self.bucket[hashKey]\n if not node: return\n if node.pair[0]...
[ "0.65343845", "0.62422407", "0.5784059", "0.55969435", "0.5557828", "0.5495421", "0.5392276", "0.5360948", "0.53419083", "0.5333039", "0.52992237", "0.529006", "0.528266", "0.52823454", "0.5254394", "0.5252794", "0.5247381", "0.5245212", "0.5236542", "0.5232374", "0.5227516",...
0.70319253
0
Creates a call status class based on the monitoring backend
def create_call_status(job, internal_storage): monitoring_backend = job.config['lithops']['monitoring'] Status = getattr(lithops.worker.status, '{}CallStatus' .format(monitoring_backend.capitalize())) return Status(job, internal_storage)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def createStatus(self, *args, **kwargs):\n\n return await self._makeApiCall(self.funcinfo[\"createStatus\"], *args, **kwargs)", "def status_api(config: dict, **kwargs):\n cfg = Config.from_dict(config)\n return status(cfg=cfg, **kwargs)", "def __init__(self: \"Status\") -> None:\n rai...
[ "0.6328769", "0.61205095", "0.5998343", "0.59102756", "0.589642", "0.5886395", "0.5878291", "0.5816793", "0.5735519", "0.57342607", "0.5676877", "0.56198055", "0.5617202", "0.56133866", "0.55926067", "0.5591889", "0.5588031", "0.5572215", "0.55713326", "0.55615175", "0.555670...
0.7931719
0
Sends the init event
def send_init_event(self): self.status['type'] = '__init__' self._send()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _initialize(self):\n self.send_init_command()", "def onInit(self):\n pass", "def on_start(self):\n self.init()", "def onInit(*args):", "def onInit(*args):", "def onInit(*args):", "def onInit(*args):", "def do_init(self):\n\n pass", "def init():\n pass", "def on_in...
[ "0.7990824", "0.752718", "0.7522999", "0.7409211", "0.7409211", "0.7409211", "0.7409211", "0.7294225", "0.7091037", "0.70493495", "0.7023764", "0.69746894", "0.6971314", "0.6968194", "0.6942409", "0.6934815", "0.69088274", "0.6777505", "0.67478627", "0.6718694", "0.6697049", ...
0.84639376
0
Sends the finish event
def send_finish_event(self): self.status['type'] = '__end__' self._send()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __finish(self):\n self.finished.emit()", "def notify_finish_event(self):\n self.notify(self._finish_event_type())", "def finish(self):\r\n self.start_finish()\r\n self.wait_finish()", "def finished(self):\n\t\telog(\"finished\")", "def finish():\n pass", "def finish...
[ "0.8138743", "0.8032189", "0.795691", "0.79205817", "0.79074085", "0.78841597", "0.78116596", "0.7794982", "0.7794982", "0.7794982", "0.7794982", "0.77801937", "0.77801937", "0.7775521", "0.7747547", "0.7747547", "0.76819074", "0.76054335", "0.7594948", "0.7494719", "0.747283...
0.85653186
0
5x5conv filter preserves fmap dimensions if stride=1 exactly halves fmap dimensions if stride=2 requires padding=2, dilation=1, kernel_size=5 becomes depthwise convolution when in_planes = out_planes = groups
def conv5x5(in_planes, out_planes, stride=1, groups=1): return nn.Conv2d(in_planes, out_planes, kernel_size=5, stride=stride, groups=groups, padding=2, dilation=1, bias=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conv5x5(in_planes, out_planes, stride=1, groups=1, dilation=1):\n\n return nn.Conv2d(in_planes, out_planes, kernel_size=5, stride=stride,\n padding=2, groups=groups, bias=False, dilation=dilation)", "def conv5x5(in_planes, out_planes, stride=1):\n return nn.Conv2d(in_planes, out_pla...
[ "0.8039668", "0.7764517", "0.73641586", "0.6590056", "0.65151554", "0.6472721", "0.6244569", "0.6239202", "0.61814755", "0.6160284", "0.6126702", "0.61187077", "0.6105487", "0.6101732", "0.60931444", "0.6072241", "0.6063233", "0.60537577", "0.60482925", "0.6038803", "0.603043...
0.80006856
1
build a stack of blocks
def _make_stack(self, block, num_layers, inplanes, outplanes, kernel_size=3, SE=False, expansion=3, stride=1): norm_layer = self._norm_layer act_layer = self._act_layer downsample = None # if stride > 1 # or if block input planes != block output planes (only...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _make_stack(self, block, planes, blocks, stride=1, dilate=False):\n\n norm_layer = self._norm_layer\n downsample = None\n previous_dilation = self.dilation\n\n # use dilation instead of striding if true\n if dilate:\n self.dilation *= stride\n stride = 1...
[ "0.6453076", "0.6413551", "0.6280478", "0.6205604", "0.6200286", "0.61282814", "0.6105402", "0.6089504", "0.6055599", "0.59682417", "0.5961837", "0.5952528", "0.5947952", "0.59477377", "0.59387773", "0.5916841", "0.5901226", "0.5894852", "0.5885826", "0.5881532", "0.58651316"...
0.6464052
0
mnasneta1 w.t. 3x3MBconv3 block only
def mnasneta1_3x3mbconv3(pretrained=False, progress=False, **kwargs): return _mnasnet('mnasneta1', MBConv, layers=[2, 3, 4, 2, 3, 1], expansions=[3, 3, 3, 3, 3, 3], kernel_sizes=[3, 3, 3, 3, 3, 3], SE=[False, False, False, False, False, False], dropout=0, pretrained=pretraine...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mnasneta1_3x3mbconv3se(pretrained=False, progress=False, **kwargs):\n return _mnasnet('mnasneta1', MBConv, layers=[2, 3, 4, 2, 3, 1], expansions=[3, 3, 3, 3, 3, 3],\n kernel_sizes=[3, 3, 3, 3, 3, 3], SE=[True, True, True, True, True, True],\n dropout=0, pretrained=pretr...
[ "0.65041816", "0.6349424", "0.6302337", "0.6283698", "0.6271896", "0.6270381", "0.62482214", "0.6165075", "0.61650103", "0.6118518", "0.6074425", "0.60461146", "0.5950486", "0.5944868", "0.592626", "0.5922896", "0.5890219", "0.5874022", "0.5871335", "0.5861999", "0.5842724", ...
0.6551719
0
mnasneta1 w.t. 3x3MBconv3SE block only
def mnasneta1_3x3mbconv3se(pretrained=False, progress=False, **kwargs): return _mnasnet('mnasneta1', MBConv, layers=[2, 3, 4, 2, 3, 1], expansions=[3, 3, 3, 3, 3, 3], kernel_sizes=[3, 3, 3, 3, 3, 3], SE=[True, True, True, True, True, True], dropout=0, pretrained=pretrained, p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inception_block_1a(X):\n\n X_3x3 = Conv2D(96, (1, 1), data_format='channels_first', name='inception_3a_3x3_conv1')(X)\n X_3x3 = BatchNormalization(axis=1, epsilon=0.00001, name='inception_3a_3x3_bn1')(X_3x3)\n X_3x3 = Activation('relu')(X_3x3)\n X_3x3 = ZeroPadding2D(padding=(1, 1), data_format='ch...
[ "0.6229205", "0.6224902", "0.6176674", "0.61410236", "0.61265373", "0.6025587", "0.6011592", "0.59494674", "0.5935188", "0.58263266", "0.581069", "0.57841295", "0.5780811", "0.5777833", "0.5774311", "0.5756034", "0.57487005", "0.5735444", "0.5735444", "0.57328737", "0.572618"...
0.645728
0
mnasneta1 w.t. 5x5MBconv3 block only
def mnasneta1_5x5mbconv3(pretrained=False, progress=False, **kwargs): return _mnasnet('mnasneta1', MBConv, layers=[2, 3, 4, 2, 3, 1], expansions=[3, 3, 3, 3, 3, 3], kernel_sizes=[5, 5, 5, 5, 5, 5], SE=[False, False, False, False, False, False], dropout=0, pretrained=pretraine...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mnasneta1_5x5mbconv3se(pretrained=False, progress=False, **kwargs):\n return _mnasnet('mnasneta1', MBConv, layers=[2, 3, 4, 2, 3, 1], expansions=[3, 3, 3, 3, 3, 3],\n kernel_sizes=[5, 5, 5, 5, 5, 5], SE=[True, True, True, True, True, True],\n dropout=0, pretrained=pretr...
[ "0.6580992", "0.6524809", "0.64358896", "0.6420319", "0.639647", "0.6387695", "0.6360615", "0.63517386", "0.62656593", "0.61908257", "0.6137714", "0.61336964", "0.61318547", "0.6123348", "0.61172646", "0.60345227", "0.6031906", "0.6017946", "0.6014714", "0.6014486", "0.600384...
0.66056234
0
mnasneta1 w.t. 5x5MBconv3SE block only
def mnasneta1_5x5mbconv3se(pretrained=False, progress=False, **kwargs): return _mnasnet('mnasneta1', MBConv, layers=[2, 3, 4, 2, 3, 1], expansions=[3, 3, 3, 3, 3, 3], kernel_sizes=[5, 5, 5, 5, 5, 5], SE=[True, True, True, True, True, True], dropout=0, pretrained=pretrained, p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Unet4(shape, nb_filters=32, exp=1, kernel_size=3, initialization=\"glorot_uniform\", activation=\"relu\", sigma_noise=0, output_channels=1, drop=0.0, regularization=None):\n \n \n input_layer = Input(shape=shape)\n\n conv1 = ConvBlock(input_layer, nb_filters=nb_filters, kernel_size=kernel_size, ini...
[ "0.6417066", "0.63162094", "0.62862533", "0.6282772", "0.62645257", "0.62633777", "0.6236479", "0.6060194", "0.59885466", "0.5915113", "0.5875557", "0.5869749", "0.5859015", "0.58565146", "0.58363396", "0.5828402", "0.5815745", "0.5803984", "0.5789562", "0.57847863", "0.57744...
0.66267586
0
mnasneta1 w.t. 3x3MBconv6 block only
def mnasneta1_3x3mbconv6(pretrained=False, progress=False, **kwargs): return _mnasnet('mnasneta1', MBConv, layers=[2, 3, 4, 2, 3, 1], expansions=[6, 6, 6, 6, 6, 6], kernel_sizes=[3, 3, 3, 3, 3, 3], SE=[False, False, False, False, False, False], dropout=0, pretrained=pretraine...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mnasneta1_3x3mbconv6se(pretrained=False, progress=False, **kwargs):\n return _mnasnet('mnasneta1', MBConv, layers=[2, 3, 4, 2, 3, 1], expansions=[6, 6, 6, 6, 6, 6],\n kernel_sizes=[3, 3, 3, 3, 3, 3], SE=[True, True, True, True, True, True],\n dropout=0, pretrained=pretr...
[ "0.6497341", "0.62858516", "0.6241714", "0.62130415", "0.62099636", "0.61729336", "0.6155735", "0.6155116", "0.61449134", "0.61261827", "0.60924345", "0.60896015", "0.60837203", "0.60367846", "0.60332847", "0.59898615", "0.59516066", "0.59444976", "0.58755845", "0.5873228", "...
0.6507609
0
mnasneta1 w.t. 3x3MBconv6SE block only
def mnasneta1_3x3mbconv6se(pretrained=False, progress=False, **kwargs): return _mnasnet('mnasneta1', MBConv, layers=[2, 3, 4, 2, 3, 1], expansions=[6, 6, 6, 6, 6, 6], kernel_sizes=[3, 3, 3, 3, 3, 3], SE=[True, True, True, True, True, True], dropout=0, pretrained=pretrained, p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Unet4(shape, nb_filters=32, exp=1, kernel_size=3, initialization=\"glorot_uniform\", activation=\"relu\", sigma_noise=0, output_channels=1, drop=0.0, regularization=None):\n \n \n input_layer = Input(shape=shape)\n\n conv1 = ConvBlock(input_layer, nb_filters=nb_filters, kernel_size=kernel_size, ini...
[ "0.62559426", "0.61565256", "0.61362463", "0.6130783", "0.6099492", "0.60563445", "0.60303664", "0.60301816", "0.59409606", "0.5915859", "0.58603007", "0.58568764", "0.5853717", "0.5841832", "0.5811412", "0.5799647", "0.5791486", "0.5767362", "0.57564116", "0.5756015", "0.573...
0.6361786
0
mnasneta1 w.t. 5x5MBconv6 block only
def mnasneta1_5x5mbconv6(pretrained=False, progress=False, **kwargs): return _mnasnet('mnasneta1', MBConv, layers=[2, 3, 4, 2, 3, 1], expansions=[6, 6, 6, 6, 6, 6], kernel_sizes=[5, 5, 5, 5, 5, 5], SE=[False, False, False, False, False, False], dropout=0, pretrained=pretraine...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mnasneta1_5x5mbconv6se(pretrained=False, progress=False, **kwargs):\n return _mnasnet('mnasneta1', MBConv, layers=[2, 3, 4, 2, 3, 1], expansions=[6, 6, 6, 6, 6, 6],\n kernel_sizes=[5, 5, 5, 5, 5, 5], SE=[True, True, True, True, True, True],\n dropout=0, pretrained=pretr...
[ "0.6570107", "0.6452104", "0.6403361", "0.6281001", "0.6181994", "0.61439276", "0.6123263", "0.6106863", "0.6076191", "0.6075117", "0.60421383", "0.59789044", "0.5971289", "0.5951675", "0.59458995", "0.5943738", "0.5920389", "0.5881937", "0.5872571", "0.58522433", "0.5844439"...
0.6571941
0
mnasneta1 w.t. 5x5MBconv6SE block only
def mnasneta1_5x5mbconv6se(pretrained=False, progress=False, **kwargs): return _mnasnet('mnasneta1', MBConv, layers=[2, 3, 4, 2, 3, 1], expansions=[6, 6, 6, 6, 6, 6], kernel_sizes=[5, 5, 5, 5, 5, 5], SE=[True, True, True, True, True, True], dropout=0, pretrained=pretrained, p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Unet4(shape, nb_filters=32, exp=1, kernel_size=3, initialization=\"glorot_uniform\", activation=\"relu\", sigma_noise=0, output_channels=1, drop=0.0, regularization=None):\n \n \n input_layer = Input(shape=shape)\n\n conv1 = ConvBlock(input_layer, nb_filters=nb_filters, kernel_size=kernel_size, ini...
[ "0.6385848", "0.6249216", "0.6237148", "0.61455214", "0.60191464", "0.5987267", "0.59708", "0.5924136", "0.5916637", "0.5866943", "0.58421737", "0.5832506", "0.57936084", "0.57807344", "0.5772715", "0.57676303", "0.5728045", "0.5723477", "0.57012206", "0.5695109", "0.56872606...
0.6513848
0
Load ImageNet pretrained model into MobileNetv2 backbone, only happen when no checkpoint is loaded
def load_model(self): if self.ckpt_flag: LOG('Skip Loading Pre-trained Model......') else: if self.params.pre_trained_from is not None and os.path.exists(self.params.pre_trained_from): try: LOG('Loading Pre-trained Model at %s' % self.params.pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_model():\r\n model = MobileNetV2(weights=\"imagenet\")\r\n print(\"Model loaded\")\r\n return model", "def load_model(self):\n self.pred_net.load((self.save_path / \"iqn_pred_net\").absolute().as_posix())\n self.target_net.load((self.save_path / \"iqn_target_net\").absolute().as_posix())"...
[ "0.8060752", "0.7502474", "0.70105195", "0.70047826", "0.69656646", "0.69574654", "0.6884236", "0.6866858", "0.68493474", "0.6838054", "0.68307084", "0.6810942", "0.6784349", "0.6778722", "0.6778722", "0.6765091", "0.6763571", "0.67604506", "0.67532", "0.6735666", "0.67249376...
0.7511762
1
Plot train/val loss curve
def plot_curve(self): x1 = np.arange(self.init_epoch, self.params.num_epoch+1, dtype=np.int).tolist() x2 = np.linspace(self.init_epoch, self.epoch, num=(self.epoch-self.init_epoch)//self.params.val_every+1, dtype=np.int64) plt.plot(x1, self.train_loss, label='train_loss'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_loss():\n df = pd.read_csv('data/loss.csv', encoding='utf-8')\n loss = df['loss'].values\n val_loss = df['val_loss'].values\n x = [i for i in range(1, len(loss) + 1)]\n\n plt.plot(x, loss, label='Train loss')\n plt.plot(x, val_loss, label='Val loss')\n\n plt.xlabel('Epochs')\n plt....
[ "0.8248865", "0.80044657", "0.7913672", "0.7894027", "0.7888984", "0.7629496", "0.76258636", "0.7564437", "0.75305593", "0.7529871", "0.7517523", "0.75074285", "0.7466194", "0.74021125", "0.73700374", "0.7361953", "0.7360696", "0.7335114", "0.7294053", "0.727845", "0.72673714...
0.8301858
0
Start a stopped node.
def ex_start_node(self, node): # NOTE: This method is here for backward compatibility reasons after # this method was promoted to be part of the standard compute API in # Libcloud v2.7.0 return self.start_node(node=node)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_node(self, **kwargs):\n # project_name, node_name\n\n try:\n if kwargs['project_name'] in self.data:\n project_name = kwargs['project_name']\n project_id = self.data[project_name]['project_id']\n if kwargs['node_name'] in self.data[pro...
[ "0.6175125", "0.58125246", "0.5782543", "0.5709254", "0.5606345", "0.5585785", "0.5553387", "0.54930484", "0.5489367", "0.5465326", "0.5459416", "0.54412687", "0.5434321", "0.5397947", "0.53963757", "0.5390883", "0.5380287", "0.5379175", "0.53741014", "0.5371947", "0.5304699"...
0.6000319
1
Suspend a running node.
def ex_suspend_node(self, node): domain = self._get_domain_for_node(node=node) return domain.suspend() == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def suspendVirtualMachine(self,node,vmid):\n post_data = None\n data = self.connect('post',\"nodes/%s/qemu/%s/status/suspend\" % (node,vmid), post_data)\n return data", "def suspend(self):\n\t\treturn Job(SDK.PrlVm_Suspend(self.handle)[0])", "def suspend(host=None,time=10):\r\n if host:...
[ "0.6543371", "0.6413404", "0.63032746", "0.61525834", "0.6133355", "0.60711706", "0.6034479", "0.5965572", "0.5920459", "0.58596003", "0.58546805", "0.56954277", "0.5682778", "0.5622784", "0.56010187", "0.55234486", "0.5516325", "0.5430145", "0.54232126", "0.5413509", "0.5355...
0.6554416
0
Retrieve Node object for a domain with a provided uuid.
def ex_get_node_by_uuid(self, uuid): domain = self._get_domain_for_uuid(uuid=uuid) node = self._to_node(domain=domain) return node
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_node(uuid, **fields):\n try:\n with session_for_read() as session:\n res = session.query(model.Node).filter_by(\n uuid=uuid, **fields).one()\n return model.Node(uuid=res.uuid, version_id=res.version_id,\n state=res.state, started_a...
[ "0.73299086", "0.70159495", "0.70025486", "0.6854524", "0.6605886", "0.5908822", "0.58769524", "0.58602464", "0.5852138", "0.57863677", "0.5778645", "0.5746345", "0.573596", "0.57004017", "0.56440103", "0.56256723", "0.5552938", "0.5542634", "0.5524711", "0.5483632", "0.54819...
0.85098386
0
Retrieve Node object for a domain with a provided name.
def ex_get_node_by_name(self, name): domain = self._get_domain_for_name(name=name) node = self._to_node(domain=domain) return node
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_domain_for_name(self, name):\n domain = self.connection.lookupByName(name)\n return domain", "def get_node(self, name):\n\n assert name in self.nodes\n return self.nodes[name]", "def get_node_by_name(self, name):\n\n for node in self.nodes:\n if node.name ...
[ "0.7113652", "0.6740635", "0.6728727", "0.6652932", "0.6599187", "0.65716195", "0.6494387", "0.6490278", "0.6489191", "0.6455513", "0.6446057", "0.64404565", "0.64146894", "0.6349402", "0.6293593", "0.62350583", "0.62033457", "0.61973226", "0.6163783", "0.6153157", "0.6134103...
0.841673
0
Return a system hostname on which the hypervisor is running.
def ex_get_hypervisor_hostname(self): hostname = self.connection.getHostname() return hostname
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hostname():\n return socket.gethostname()", "def get_hostname():\n\thostname = socket.gethostname()\n\n\treturn hostname", "def hostname(self) -> str:\n _args: list[Arg] = []\n _ctx = self._select(\"hostname\", _args)\n return _ctx.execute_sync(str)", "def get_hostname():\n hos...
[ "0.8208617", "0.8037137", "0.8012449", "0.79964304", "0.7980484", "0.79791266", "0.79482585", "0.7933461", "0.7856743", "0.7811493", "0.77951044", "0.77097285", "0.76754904", "0.7673008", "0.7661361", "0.7646124", "0.7639138", "0.76167923", "0.7588144", "0.75737196", "0.75471...
0.87602705
0
Retrieve hypervisor system information.
def ex_get_hypervisor_sysinfo(self): xml = self.connection.getSysinfo() etree = ET.XML(xml) attributes = ["bios", "system", "processor", "memory_device"] sysinfo = {} for attribute in attributes: element = etree.find(attribute) entries = self._get_entrie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_hypervisor_info(self):\n try:\n req = Request(self.compute_url +\n \"/os-hypervisors/detail\" )\n self._upgrade_to_authenticated_request(req)\n resp = urlopen(req)\n content = resp.read().decode('utf-8')\n encoded = json...
[ "0.7540559", "0.72924674", "0.7231328", "0.72079253", "0.7133061", "0.6733231", "0.6650252", "0.6599447", "0.6597166", "0.6572756", "0.6566554", "0.65332323", "0.6496247", "0.6453271", "0.640171", "0.6376914", "0.6345654", "0.6250193", "0.6224385", "0.62230563", "0.61986095",...
0.799808
0
Retrieve IP addresses for the provided domain.
def _get_ip_addresses_for_domain(self, domain): result = [] if platform.system() != "Linux": # Only Linux is supported atm return result if "///" not in self._uri: # Only local libvirtd is supported atm return result mac_addresses = self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getIPs(self, domain = \"localhost\"):\n # convert 'domain' to string, in case of erroneous type being passed\n domain = str(domain)\n\n # Kind warning for those who entered an IP address instead of a domain\n try: \n inet_aton(domain)\n print(\"Warning: an IP a...
[ "0.83984834", "0.77371424", "0.6798919", "0.6587187", "0.6285699", "0.61892295", "0.60301226", "0.6003413", "0.5995572", "0.598294", "0.5933315", "0.5922509", "0.59050184", "0.5893697", "0.5892688", "0.5844683", "0.584002", "0.58137757", "0.57702386", "0.57578325", "0.5728746...
0.79961646
1
Parses network interface MAC addresses from the provided domain.
def _get_mac_addresses_for_domain(self, domain): xml = domain.XMLDesc() etree = ET.XML(xml) elems = etree.findall("devices/interface[@type='network']/mac") result = [] for elem in elems: mac_address = elem.get("address") result.append(mac_address) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_mac_addr_table(self, cmd_output, mac_regex):\n lines = ensure_string(cmd_output).split(\"\\n\")\n\n arp_table = defaultdict(list)\n for line in lines:\n match = mac_regex.match(line)\n\n if not match:\n continue\n\n groups = match.grou...
[ "0.5997182", "0.5887761", "0.55770844", "0.54802185", "0.5151093", "0.5078019", "0.5072644", "0.5054249", "0.5025796", "0.5004441", "0.4980744", "0.4979718", "0.4964348", "0.49386275", "0.4900247", "0.48874563", "0.48327222", "0.4825868", "0.4825868", "0.4825868", "0.4825868"...
0.76599824
0
Return libvirt domain object for the provided node.
def _get_domain_for_node(self, node): domain = self.connection.lookupByUUIDString(node.uuid) return domain
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_domain(self, name=None, domain_id=None):\n try:\n if name != None:\n domain = self.conn.lookupByName(name)\n elif domain_id != None:\n domain = self.conn.lookupByNamtoprettyxmle(domain_id)\n \n self.logger.debug('Get libv...
[ "0.6646178", "0.6326023", "0.60190666", "0.5995111", "0.591567", "0.5859711", "0.58435315", "0.57714146", "0.5689236", "0.5660096", "0.564347", "0.5614556", "0.5580412", "0.5555476", "0.55462366", "0.54826355", "0.5459767", "0.5392127", "0.5384954", "0.535872", "0.53121495", ...
0.80289376
0
Return libvirt domain object for the provided uuid.
def _get_domain_for_uuid(self, uuid): domain = self.connection.lookupByUUIDString(uuid) return domain
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ex_get_node_by_uuid(self, uuid):\n domain = self._get_domain_for_uuid(uuid=uuid)\n node = self._to_node(domain=domain)\n return node", "def _get_domain(self, name=None, domain_id=None):\n try:\n if name != None:\n domain = self.conn.lookupByName(name)\n ...
[ "0.65978694", "0.6287508", "0.62544394", "0.61970353", "0.60169226", "0.57897735", "0.57860833", "0.57860833", "0.5771408", "0.5730028", "0.5638017", "0.5603881", "0.55803794", "0.55803794", "0.55660874", "0.55613136", "0.55560535", "0.5535921", "0.54868644", "0.5468099", "0....
0.8054554
0
Return libvirt domain object for the provided name.
def _get_domain_for_name(self, name): domain = self.connection.lookupByName(name) return domain
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_domain(self, name=None, domain_id=None):\n try:\n if name != None:\n domain = self.conn.lookupByName(name)\n elif domain_id != None:\n domain = self.conn.lookupByNamtoprettyxmle(domain_id)\n \n self.logger.debug('Get libv...
[ "0.7728729", "0.6781407", "0.6676108", "0.66732156", "0.64450073", "0.6421315", "0.6407042", "0.6315708", "0.62968487", "0.62832683", "0.62424284", "0.6150704", "0.60960394", "0.6010242", "0.5997326", "0.5948612", "0.58892924", "0.5876968", "0.5854081", "0.5805325", "0.576580...
0.7796097
0
Sets up the regexp for parsing out IP addresses from the 'arp an' command and pass it along to the parser function.
def _parse_ip_table_arp(self, arp_output): arp_regex = re.compile(r".*?\((.*?)\) at (.*?)\s+") return self._parse_mac_addr_table(arp_output, arp_regex)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def callback(self, pkt):\n if ARP in pkt:\n self.parse_ip(pkt.sprintf(\"%ARP.psrc%\"))\n if TCP in pkt or UDP in pkt:\n self.parse_ip(pkt.sprintf(\"%IP.src%\"))\n self.parse_ip(pkt.sprintf(\"%IP.dst%\"))", "def arp_parse(data):\n\t# Iteratize pkt\n\tpkt = packet.Pac...
[ "0.6047332", "0.5977841", "0.58359456", "0.55522436", "0.549954", "0.54692423", "0.5399935", "0.53717846", "0.5354695", "0.5282927", "0.52803683", "0.5258503", "0.5195545", "0.51795524", "0.51735955", "0.5168112", "0.5160153", "0.5160032", "0.5127986", "0.5110216", "0.5108020...
0.67209846
0