query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
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 should remove any nonbase, nongap chars
def test_strip_bad(self): # have to turn off check to get bad data in; no longer preserves case r = self.RNA("UCAGRYU") r._data[0] = 31 r._data[2] = 55 self.assertEqual(r.strip_bad(), "CGRYU")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_strip_bad(self):\n # have to turn off check to get bad data in; no longer preserves case\n self.assertEqual(\n self.RNA(\"UCxxxAGwsnyrHBNzzzD-D\", check=False).strip_bad(),\n \"UCAGWSNYRHBND-D\",\n )\n self.assertEqual(self.RNA(\"@#^*($@!#&()!@QZX\", check...
[ "0.7429765", "0.715122", "0.69027036", "0.69027036", "0.68354553", "0.67104006", "0.66530055", "0.65649366", "0.65649366", "0.65639234", "0.65602666", "0.653047", "0.65097004", "0.6500392", "0.64983284", "0.6485774", "0.64769524", "0.6473822", "0.6450652", "0.6406869", "0.640...
0.70498705
2
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
Sequence gap_array should return array of gaps
def test_gap_array(self): r = self.RNA("-?A-?NRY-") v = r.gap_array() self.assertEqual(v, array([1, 1, 0, 1, 1, 0, 0, 0, 1])) r = self.RNA("AC") v = r.gap_array() self.assertEqual(v, array([0, 0])) r = self.RNA("-?") v = r.gap_array() self.assertEq...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_gaps( rows ):\n\n n = len(rows) - 1\n gaps = [ rows[i+1][0]-rows[i][1] for i in range(n) ]\n return gaps", "def gaps(self):\n return self.gaps_L + self.gaps_R", "def gaps(df):\n return [(round(df[i][\"o\"] - df[i - 1][\"c\"], 2)) for i in range(1, len(df))]", "def check_gaps(matches, g...
[ "0.79504603", "0.760069", "0.70001197", "0.67067593", "0.6630847", "0.6573822", "0.6479079", "0.639693", "0.63148755", "0.624939", "0.62092394", "0.6189436", "0.6144549", "0.6101163", "0.6058351", "0.60426545", "0.6035825", "0.58744615", "0.5859787", "0.5813083", "0.5718862",...
0.66945875
4
Sequence gap_indices should return positions of gaps
def test_gap_indices(self): r = self.RNA("-?A-?NRY-") v = r.gap_indices() self.assertEqual(v, array([0, 1, 3, 4, 8])) r = self.RNA("AC") v = r.gap_indices() self.assertEqual(v, array([])) # note: always returns array r = self.RNA("-?") v = r.gap_indices()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_gap_indices(self):\n self.assertEqual(self.RNA(\"\").gap_indices(), [])\n self.assertEqual(self.RNA(\"ACUGUCAGUACGHSDKCUCDNNS\").gap_indices(), [])\n self.assertEqual(self.RNA(\"GUACGUACAKDC-SDHDSK\").gap_indices(), [12])\n self.assertEqual(self.RNA(\"-DSHUHDS\").gap_indices(),...
[ "0.7196856", "0.7002886", "0.673995", "0.67167896", "0.62299633", "0.6222142", "0.6196434", "0.6072244", "0.595909", "0.5917935", "0.59169143", "0.58938193", "0.5879233", "0.58146924", "0.58074355", "0.58025324", "0.5778315", "0.5778287", "0.57337064", "0.57114375", "0.566026...
0.6828341
2
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
Shows the diff between ideal and calculated bugs.
def show_image(self): cv2.imshow('Image', self.__diff_image()) cv2.waitKey()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_diff_report():\n diff_report = render_diff_report()\n nori.core.email_loggers['report'].info(\n diff_report + '\\n\\n\\n' + ('#' * 76)\n )\n # use the output logger for the report files (for now)\n nori.core.output_logger.info('\\n\\n' + diff_report + '\\n\\n')", "def diff_report(sel...
[ "0.6148668", "0.6091224", "0.60197735", "0.60094833", "0.59882504", "0.5957773", "0.5912969", "0.58422804", "0.58252716", "0.5821757", "0.5755664", "0.5726659", "0.565676", "0.56534225", "0.5644109", "0.5562157", "0.5558325", "0.5532229", "0.55015934", "0.5494924", "0.5481694...
0.0
-1
Saves the diff between ideal and calculated bugs to a file.
def store_image(self): cv2.imwrite(self.__diff_filename(), self.__diff_image())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_changes(self):\n with open(base_dir + str(self.name) + \".txt\", mode=\"w\") as f:\n f.writelines([str(self.initial_amount)+'\\n', str(self.spent)+'\\n', \" \".join(self.allocs)+'\\n'])\n f.write(\" \".join([str(k) for k in self.alloc_amounts]) + \"\\n\")\n f.write(...
[ "0.6492748", "0.60288966", "0.59163696", "0.5770694", "0.5746305", "0.5735524", "0.56445605", "0.560694", "0.56035554", "0.5602694", "0.5589598", "0.5585308", "0.5585308", "0.55683666", "0.5552206", "0.5542636", "0.5520096", "0.5516959", "0.5509509", "0.5485996", "0.5466378",...
0.0
-1
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
Creates diff between ideal and calculated bugs.
def __diff_image(self): img = cv2.imread(self.imagefile()).copy() Reference.__draw_bugs(img, self.__true_positives, False, 1) Reference.__draw_bugs(img, self.__false_negatives, (0, 255, 0)) Reference.__draw_bugs(img, self.__false_positives, (0, 0, 255)) return img
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_diffs(i, j, correct_x, correct_y):\n return abs(i - correct_x) + abs(j - correct_y)", "def test_get_game_diff(self):\n pass", "def test_printdiff(self):\n\n # Testing different string input options\n assert printdiff(self.data(\"arange.fits\"), self.data(\"blank.fits\")) is Non...
[ "0.58142924", "0.5719681", "0.57189137", "0.5654691", "0.5569519", "0.5566099", "0.5540565", "0.55034953", "0.54460025", "0.54376423", "0.5365341", "0.5348111", "0.52813375", "0.5279248", "0.5279036", "0.52608275", "0.5226117", "0.5214298", "0.52087766", "0.5207505", "0.51935...
0.0
-1
Draws the rectangles on the given image.
def __draw_bugs(image, bugs, color=(0, 0, 0), thickness=3): for bug in bugs: rect_p1 = (bug[0], bug[1]) rect_p2 = (bug[2] + bug[0], bug[3] + bug[1]) cv2.rectangle(image, rect_p1, rect_p2, color, thickness)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_rects(img, rects, color):\n for x1, y1, x2, y2 in rects:\n cv2.rectangle(img, (x1, y1), (x2, y2), color, 2)", "def draw_rects_on_img(img, rects):\n img_copy = img.copy()\n for rect in rects:\n x, y, w, h = rect\n cv2.rectangle(img_copy, (x,y), (x+w,y+h), (0,255,0), 2)\n ...
[ "0.7897618", "0.75703055", "0.74390197", "0.73883826", "0.7315021", "0.72013146", "0.7076208", "0.7012716", "0.6962853", "0.6824808", "0.6784187", "0.66547596", "0.65187734", "0.6513448", "0.6505593", "0.64394724", "0.6428938", "0.6411683", "0.6408987", "0.64074993", "0.63959...
0.6119347
43
Were all relevant bugs found?
def recall(self): tpos, fneg = len(self.__true_positives), len(self.__false_negatives) return float(tpos) / (tpos + fneg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fix_bug(self):\n self.bugged = False\n self.error_prob = 0.0", "def is_code_good(safe_from_bugs, ready_for_change, easy_to_understand):\n pass # your code here!", "def problem_298():\n pass", "def cleanup_in_progress_bugs_without_patches(self):\n raise NotImplementedError(\"not...
[ "0.7154423", "0.66879153", "0.655269", "0.64501786", "0.64323574", "0.63040173", "0.62318504", "0.62253433", "0.6175471", "0.6175471", "0.615524", "0.6095269", "0.6059189", "0.60532117", "0.6032592", "0.59895754", "0.59823525", "0.59739506", "0.5969271", "0.595038", "0.593240...
0.0
-1
Which found bugs were relevant?
def precision(self): tpos, fpos = len(self.__true_positives), len(self.__false_positives) return float(tpos) / (tpos + fpos)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def problem_298():\n pass", "def is_code_good(safe_from_bugs, ready_for_change, easy_to_understand):\n pass # your code here!", "def fix_bug(self):\n self.bugged = False\n self.error_prob = 0.0", "def test_findBugfixes(self):\n bugfixes = self.builder._findChanges(\n sel...
[ "0.649961", "0.6457732", "0.6267208", "0.6229205", "0.60644907", "0.603652", "0.5991213", "0.5911099", "0.58519506", "0.581313", "0.57781476", "0.5760971", "0.5743393", "0.57172555", "0.5716239", "0.5692202", "0.566929", "0.56691307", "0.5648093", "0.56244344", "0.5614482", ...
0.0
-1
Which found bugs were relevant?
def compare_with(self, bugs): self.__true_positives = [] self.__false_positives = [] self.__false_negatives = [] for bug in bugs: if Reference.__has_similar_rect(bug.bounds(), self.__bugs): self.__true_positives.append(bug.bounds()) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def problem_298():\n pass", "def is_code_good(safe_from_bugs, ready_for_change, easy_to_understand):\n pass # your code here!", "def fix_bug(self):\n self.bugged = False\n self.error_prob = 0.0", "def test_findBugfixes(self):\n bugfixes = self.builder._findChanges(\n sel...
[ "0.649961", "0.6457732", "0.6267208", "0.6229205", "0.60644907", "0.603652", "0.5991213", "0.5911099", "0.58519506", "0.581313", "0.57781476", "0.5760971", "0.5743393", "0.57172555", "0.5716239", "0.5692202", "0.566929", "0.56691307", "0.5648093", "0.56244344", "0.5614482", ...
0.5522909
36
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
Returns complete path to reference file.
def imagefile(self): return os.path.join(self.__folder, self.__name + '.jpg')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_reference(self):\n return self.__file_reference", "def reffile(self):\n return os.path.join(self.__folder, self.__name + '.ref')", "def file_path(self):\n return self.lib.file_path", "def reference(self, referencing_buildfile_path=None):\r\n dirname = os.path.dirname(self.bui...
[ "0.76702243", "0.7571063", "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.6905256...
0.0
-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
attempt to dynamically bind
def render_prompt(self) -> str: # pylint: disable=no-member return '{}render: '.format(self.prompt)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _bind(self):\n\n pass", "def bound(name):", "def maybe_bind(value, args, kwargs):\n return value.bind(args, kwargs) if isinstance(value, Bind) else value", "def bind(self, *args):\r\n return self._fd.bind(*args)", "def _bind_helper(self, conn, sql, bind):\n\n return sql, bind", ...
[ "0.74233496", "0.70887095", "0.6752943", "0.64860994", "0.62201893", "0.62088025", "0.62064666", "0.6097874", "0.6022419", "0.60154915", "0.5998793", "0.5967587", "0.5964588", "0.594919", "0.59248394", "0.5924118", "0.59012055", "0.5860863", "0.584454", "0.58419025", "0.58090...
0.0
-1
Ask a yes/no question and return a boolean
def yn_acceptor(question): #Keeps asking the question until user #inputs a response that begins with either 'y' or 'n'. ender = False while not ender: #Taking only the first letter of the response allows the #user to input 'y', 'yes', 'yeah', etc. #The exception is for i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirm_yes():\r\n confirm = raw_input(\"Enter 'yes' to confirm: \")\r\n if confirm == 'yes':\r\n return True\r\n return False", "def ask(self, question):\n if self.options.yes:\n return True\n\n result = False\n while True:\n print(question + ' [y/n...
[ "0.8236246", "0.8099923", "0.797874", "0.7955741", "0.7878635", "0.7877002", "0.783655", "0.7825838", "0.7822154", "0.77732563", "0.77462125", "0.772864", "0.7676731", "0.76571167", "0.7635493", "0.762089", "0.761979", "0.7595444", "0.7535465", "0.75328535", "0.7512618", "0...
0.0
-1
Request a positive integer and return it
def posint_acceptor(question): #Keeps asking the question until user #inputs a positive integer. ender = False while not ender: try: reply = int(input(question+' (Enter a positive integer): ')) except: reply = 0 if reply > 0: return reply ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_positive_int(prompt):\n while True:\n n = get_int(prompt)\n if n > 0 and n < 9 :\n break\n return n", "def get_positive_int(prompt):\n while True:\n n = int(input(prompt), 10)\n if n > 0:\n break\n \n return n", "def _get_positive_int...
[ "0.73542404", "0.7262959", "0.7163376", "0.71538967", "0.68111783", "0.6795024", "0.6768619", "0.674803", "0.6724632", "0.65986043", "0.65419465", "0.6504386", "0.64947563", "0.64927983", "0.64779603", "0.64779603", "0.64779603", "0.64594996", "0.6375363", "0.6375307", "0.636...
0.57825553
90
Request a nonnegative integer and return it
def natnum_acceptor(question): #Keeps asking the question until user #inputs a natural number. ender = False while not ender: try: reply = int(input(question+' (Enter a natural number): ')) except: reply = -1 if reply >= 0: return reply ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_positive_int(prompt):\n while True:\n n = get_int(prompt)\n if n > 0 and n < 9 :\n break\n return n", "def give_me_an_integer():\n return 5\n pass", "def getint(self, option, argument=None):\n value = self.get(option, argument)\n if value: return int(v...
[ "0.6870003", "0.6850607", "0.67833984", "0.67311496", "0.66878545", "0.66309583", "0.66190416", "0.6585453", "0.6551168", "0.6465597", "0.6419487", "0.6382717", "0.63682604", "0.63682604", "0.63500315", "0.6333686", "0.63300604", "0.63272", "0.6303928", "0.6284434", "0.628286...
0.0
-1
Request an integer and return it
def int_acceptor(question): #Keeps asking the question until user #inputs an integer. ender = False while not ender: try: reply = int(input(question+' (Enter an integer): ')) except: reply = 'x' if type(reply) == int: return reply else:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getint(self, option, argument=None):\n value = self.get(option, argument)\n if value: return int(value)\n else: return 0", "def get_int():\n\twhile True:\n\t\ttry:\n\t\t\tX = int(raw_input())\n\t\t\tbreak\n\t\texcept:\n\t\t\tprint \"Could not convert input to integer\"\n\t\t\tcontinue\n\...
[ "0.6948292", "0.674835", "0.674039", "0.67345506", "0.6682845", "0.6682845", "0.6647959", "0.6630048", "0.661951", "0.6601815", "0.6562985", "0.65192354", "0.6493369", "0.64713186", "0.64665556", "0.6362884", "0.6350766", "0.6350387", "0.63426745", "0.63393277", "0.63366884",...
0.0
-1
Request an integer and return it
def num_acceptor(question): #Keeps asking the question until user #inputs an integer. ender = False while not ender: try: reply = float(input(question+' (Enter a number): ')) except: reply = 'x' if type(reply) == float: return reply els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getint(self, option, argument=None):\n value = self.get(option, argument)\n if value: return int(value)\n else: return 0", "def get_int():\n\twhile True:\n\t\ttry:\n\t\t\tX = int(raw_input())\n\t\t\tbreak\n\t\texcept:\n\t\t\tprint \"Could not convert input to integer\"\n\t\t\tcontinue\n\...
[ "0.6948292", "0.674835", "0.674039", "0.67345506", "0.6682845", "0.6682845", "0.6647959", "0.6630048", "0.661951", "0.6601815", "0.6562985", "0.65192354", "0.6493369", "0.64713186", "0.64665556", "0.6362884", "0.6350766", "0.6350387", "0.63426745", "0.63393277", "0.63366884",...
0.0
-1
Request 'n' entries of type 'typer' with label 'name' Store them to a list
def seq_acceptor(n, name, typer=str): lister = [] for i in range(n): accepted = False while not accepted: try: entry = typer(input('Enter the {} {}: '.format(otoodles.ordinal(i+1), name))) except: print(error_msg) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type_list():\n for type_ in orm.DataFlagType.select():\n click.echo(type_.name)", "def get_all(self, name):\n\t\tpass", "def get_recipes_by_types(self, recipe_type):\n if recipe_type not in self.recipe_list.keys():\n sys.stderr.write(UKN_TYP.format(recipe_type))\n rai...
[ "0.54615444", "0.5449319", "0.5392701", "0.53783566", "0.53158265", "0.53075415", "0.5304406", "0.5262959", "0.51724", "0.5151248", "0.51501375", "0.51285154", "0.5112244", "0.50946194", "0.5026789", "0.50250804", "0.497087", "0.49583626", "0.4929883", "0.49216703", "0.491087...
0.0
-1
Gets the core's ID.
def getId(self): return self.session.request('id/')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def core_id(self):\n return self._dll.JLINKARM_GetId()", "def get_id(self):\n pass", "def get_id(self):\n pass", "def get_id(self):\n pass", "def get_id(self):\n pass", "def getid(self):\n return self.__id", "def get_id(self):\n\n\t\treturn self.__id", "def g...
[ "0.75882643", "0.7014607", "0.7014607", "0.7014607", "0.7014607", "0.6937929", "0.6922512", "0.6889713", "0.68454695", "0.68454695", "0.68322146", "0.67785394", "0.67758083", "0.67536193", "0.67536193", "0.67536193", "0.67536193", "0.67536193", "0.67536193", "0.67536193", "0....
0.0
-1
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
Returns a URL representing a database connection.
def alchemy_url(db_config): return server.alchemy_url(db_config)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_database_url(self):\n return self.config['dbase_path']", "def get_db_connection_url():\n return os.environ[\"DATABASE_URL\"]", "def get_db_url(db_name, user=user, host=host, password=password):\n url = f'mysql+pymysql://{user}:{password}@{host}/{db_name}'\n return url", "def get_url(s...
[ "0.7792907", "0.77316606", "0.7673938", "0.7609216", "0.7441045", "0.7375902", "0.73378116", "0.7331946", "0.72860146", "0.72476286", "0.72336113", "0.7219773", "0.72162956", "0.7198117", "0.712769", "0.7099041", "0.70545846", "0.7036209", "0.7033689", "0.7031369", "0.6978747...
0.7214176
13
Returns PostgreSQL arguments for connecting via SSL.
def connect_args(db_config): return server.connect_args(db_config)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_psycopg2_connection_kwargs(_id: str) -> dict:\n return get_connection_kwargs(_id, credentials_mapping=PSYCOPG2_CONNECTION_KWARG_MAP)", "def connect(self):\n if self.dbapi.__name__ == \"psycopg2\":\n self.connection[\"sslmode\"] = \"require\"\n elif self.dbapi.__name__ == \"pg8...
[ "0.6563474", "0.61414003", "0.5906928", "0.57740694", "0.5732237", "0.5640163", "0.56157655", "0.5569681", "0.5563414", "0.55343956", "0.55179983", "0.54775465", "0.54743034", "0.54706997", "0.54381734", "0.54350734", "0.5394376", "0.5354021", "0.5347004", "0.5285429", "0.525...
0.58273315
3
Get list of proxies
def _get_proxies() -> List[str]: response = requests.get('https://free-proxy-list.net/') soup = BeautifulSoup(response.text, 'html.parser') table = soup.findAll('div', {'class': 'table-responsive'}) return [ ':'.join([x.contents[0] for x in row.findAll('td')[:2]]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_proxies():\n scrapper = Scrapper(category='ALL', print_err_trace=False)\n data = scrapper.getProxies()\n\n proxies = []\n for item in data.proxies:\n proxies.append('{}:{}'.format(item.ip, item.port))\n return proxies", "def get_all(self):\n return self.proxies", "def _init...
[ "0.84869707", "0.8098792", "0.7873329", "0.7861593", "0.77582604", "0.7730238", "0.76781523", "0.75747365", "0.75575083", "0.7437709", "0.7418911", "0.74144673", "0.72139585", "0.71982723", "0.70663404", "0.70068073", "0.6898896", "0.6778375", "0.67729187", "0.6606509", "0.65...
0.7704547
6
Return response for request. Using one of proxy addresses
def request(self, url, params=None, **kwargs): while True: while self.proxies: proxy = self.proxies[-1] try: response = requests.get(url, params=params, proxie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def return_proxy(self):\n\n check_server()\n url='{url}/proxy_return'.format(url=config.SERVER_URL)\n proxy_ret= [x.raw_data for x in self.proxy_pool]\n proxy_str=''\n\n for item in proxy_ret:\n proxy_str=proxy_str+item\n data={\n 'data':proxy_str\n ...
[ "0.7243399", "0.70299476", "0.6781197", "0.6675603", "0.6254799", "0.62156236", "0.6209551", "0.6205075", "0.618885", "0.6188454", "0.61676013", "0.6123324", "0.60963684", "0.60655093", "0.60579664", "0.60566384", "0.60423124", "0.60423124", "0.5972465", "0.5970161", "0.59602...
0.5896534
26
u""" This test do login and check one by one that all views appear.
def test_views_appear(self): """ logging.basicConfig(filename="Views.log", level=logging.INFO, filemode='w') driver = self.driver self.login() detect_and_pass_all_wizards(driver) click_menu_element(driver,"Tactical view") time.sleep(2) self.assertEqual("Status report" in driver.page_source,Tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_view_displays_all(self):\n set_up_one_user(self, 1, 0)\n login = self.client.login(username='test', password='2HJ1vRV0Z&3iD')\n response = self.client.get(reverse('index'))\n self.assertEqual(response.status_code, 200)\n self.assertEqual(str(response.context['user']), 't...
[ "0.81838894", "0.79805183", "0.7766915", "0.77403384", "0.77325433", "0.7718617", "0.7583064", "0.7565262", "0.74422586", "0.73861593", "0.7320135", "0.72993517", "0.7288242", "0.7281778", "0.7236017", "0.7223557", "0.7222939", "0.72201216", "0.720811", "0.720107", "0.7183652...
0.7224577
15
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
Calculate our movement this step, and the forces that are acting on us. Notify if, for instance, brake force overcomes motor torque
def step(self, dt_usec): # Note: doing all these calculations in a single function because function calls are expensive self.last_normal_force = self.normal_force self.last_drag_force = self.drag_force v = self.sim.pod.velocity # TESTING ONLY -- move the gap to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_forces(self):\r\n # update all the functions\r\n self.compute_gravity()\r\n self.compute_tides()\r\n self.compute_centrifugal()\r\n self.compute_coriolis()\r\n\r\n # add together the forces into the summation function\r\n self.forcing.assign(self.ftides+s...
[ "0.70023555", "0.6874296", "0.67944515", "0.671798", "0.65328234", "0.65306437", "0.64091915", "0.6389956", "0.63886654", "0.63836414", "0.6376799", "0.63551307", "0.62869245", "0.62846464", "0.62561846", "0.6208224", "0.61916655", "0.61798215", "0.61791", "0.6160368", "0.615...
0.5988206
33
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
Adds one file to the index.
def index_file(self, file_name): self.contents = [] article_text = "" article_annots = [] # for annot-only index f = open(file_name, "r") for line in f: line = line.replace("#redirect", "") # ------ Reaches the end tag for an article --------- ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_file(self, path):\n self.git_repo.index.add([path])", "def add_new_file(self, filename):\n self.load_config()\n if not self.__is_file_in_working_directory(filename):\n path = os.path.join(self.__directory.working_path,\n filename)\n ...
[ "0.79239506", "0.7568", "0.7066918", "0.70567477", "0.7009271", "0.69520044", "0.677809", "0.67565817", "0.67226416", "0.6685884", "0.6469543", "0.64252746", "0.6407727", "0.6403653", "0.6368196", "0.6353159", "0.63379145", "0.6335944", "0.6331595", "0.6298672", "0.62819374",...
0.0
-1
Build index for all files.
def index_files(self, input_dir, output_dir): self.lucene = Lucene(output_dir) self.lucene.open_writer() for path, dirs, _ in os.walk(input_dir): for dir in sorted(dirs): for _, _, files in os.walk(os.path.join(input_dir, dir)): for fn in sorted(fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_all_files(self, root_dir):\n pass", "def build_index(self, folder):\n self.__start_indexing()\n for chunk in sorted(os.listdir(folder)):\n path = folder + \"/\" + chunk\n if os.path.isdir(path):\n for dir in sorted(os.listdir(path)):\n ...
[ "0.78579605", "0.77955896", "0.7705683", "0.76759696", "0.7675346", "0.74046093", "0.7402274", "0.73710144", "0.72668785", "0.71897435", "0.7093874", "0.7086999", "0.6999817", "0.69835085", "0.69601107", "0.6950563", "0.68792796", "0.68682855", "0.6839514", "0.6839514", "0.68...
0.718925
10
Test when project gets created.
def test_log_create(self): log_count_init = LoggerHistory.objects.count() project = ProjectFactory.create(**{'creator': self.user}) log_count = LoggerHistory.objects.count() self.assertEqual(log_count, log_count_init + 2) logs = LoggerHistory.objects.all().order_by('-pk')[:2] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_project(self):\n pass", "def test_create_project(self):\n pass", "def test_create_project(self):\n pass", "def test_add_project(self):\n pass", "def test_create_project_request(self):\n pass", "def test_create_project_from_template(self):\n projec...
[ "0.8950493", "0.8950493", "0.8950493", "0.82950556", "0.80969745", "0.7729368", "0.77019465", "0.75904065", "0.7439798", "0.73150057", "0.7263649", "0.72620696", "0.72612435", "0.72278434", "0.72135997", "0.72135997", "0.72109956", "0.7174851", "0.7174851", "0.7174851", "0.71...
0.0
-1
Test when project gets deleted.
def test_log_delete(self): project_id = self.project.id project_name = self.project.name log_count_init = LoggerHistory.objects.count() self.project.delete() log_count = LoggerHistory.objects.count() self.assertEqual(log_count, log_count_init + 2) logs = LoggerH...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_project(self):\n pass", "def test_delete_project(self):\n pass", "def test_remove_project(self):\n pass", "def test_delete_project(self):\n self.assertEqual(Project.objects.count(), 1)\n self.assertEqual(Group.objects.count(), 2)\n\n delete_project(Pr...
[ "0.8945626", "0.8945626", "0.8373581", "0.8258003", "0.7921199", "0.78197724", "0.75639015", "0.7360813", "0.7317375", "0.7300423", "0.72148603", "0.72126514", "0.71026635", "0.7097451", "0.7096935", "0.70813435", "0.7003509", "0.6982068", "0.6978296", "0.69615585", "0.693842...
0.67966235
33
Test when name changes.
def test_log_update_name(self): log_count_init = LoggerHistory.objects.count() original_name = self.project.name self.project.name = '%s UPDATED' % self.project.name self.project.save() log = LoggerHistory.objects.last() log_count = LoggerHistory.objects.count() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _name_changed ( self, name ):\n self.name_last = parse_name( name )[-1]\n self.inputs_changed()", "def testOnPluginNameChanged(self, widget):\n spy_signal = QtSignalSpy(widget, widget.modelModified)\n\n # Change the name\n new_text = \"Duck season\"\n widget.txtName....
[ "0.7504753", "0.735875", "0.7353045", "0.7197629", "0.70011467", "0.69848704", "0.69739455", "0.69739455", "0.6895458", "0.6835277", "0.6829722", "0.6821252", "0.6780429", "0.6735095", "0.6729225", "0.67129445", "0.6710709", "0.6710204", "0.6692316", "0.6681438", "0.6680806",...
0.6420796
41
Test when status changes.
def test_log_update_status(self): log_count_init = LoggerHistory.objects.count() original_status = self.project.status self.project.status = 'inactive' self.project.save() log = LoggerHistory.objects.last() log_count = LoggerHistory.objects.count() self.assertN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_status(self):", "def test_get_status(self):\n pass", "def test_get_status(self):\n pass", "def StatusChanged(self, state, info):\n pass", "def refresh_status() -> None:\n ...", "def test_status_endpoint(self):\n Org(id='test1').put()\n response = self.app.g...
[ "0.75788856", "0.7452902", "0.7452902", "0.73657864", "0.72536075", "0.71586853", "0.70734364", "0.6986664", "0.69548583", "0.693313", "0.69195247", "0.6917401", "0.6881031", "0.68502706", "0.68405443", "0.6838989", "0.6825832", "0.6795321", "0.67845803", "0.67722744", "0.672...
0.69015783
12
Test when privacy changes.
def test_log_update_isprivate(self): log_count_init = LoggerHistory.objects.count() original_isprivate = self.project.isprivate self.project.isprivate = False self.project.save() log = LoggerHistory.objects.last() log_count = LoggerHistory.objects.count() self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_1_privacy(self):\n response = self.client.get(reverse('privacy-policy'), follow=True)\n self.assertEqual(response.status_code, 200)", "def test_auth_private_owned(self):\n self.do_visible(True, 'pattieblack', False, tenant='pattieblack')", "def test_anon_private_owned(self):\n ...
[ "0.68753976", "0.66549104", "0.65600914", "0.6477126", "0.6452311", "0.6429119", "0.6379788", "0.6306594", "0.62423587", "0.6230886", "0.62270856", "0.6209496", "0.6194528", "0.60645115", "0.6044948", "0.6029301", "0.60187113", "0.59665847", "0.5964287", "0.5942533", "0.59181...
0.59553504
19
Test when locker changes.
def test_log_update_islocked(self): log_count_init = LoggerHistory.objects.count() original_islocked = self.project.islocked self.project.islocked = True self.project.save() log = LoggerHistory.objects.last() log_count = LoggerHistory.objects.count() self.asser...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Locked(self) -> bool:", "def is_locked(self):\r\n pass", "def testLock(self):\n self.assertTrue(self._lock.LockIfNotInUse())\n self.assertTrue(os.path.isfile(self._lock_path))\n self._lock.Unlock()\n\n self.assertTrue(self._lock.LockIfNotInUse(timeout_secs=0))\n se...
[ "0.6649893", "0.6575162", "0.6446806", "0.64175075", "0.63689476", "0.63339204", "0.6332309", "0.62242967", "0.62209195", "0.6075972", "0.6072128", "0.6053159", "0.6033332", "0.6026208", "0.6016452", "0.60095245", "0.59997666", "0.5991469", "0.597009", "0.5959728", "0.5954999...
0.56950873
37
Test when contributing permissions changes.
def test_log_update_contributing_permissions(self): log_count_init = LoggerHistory.objects.count() original_everyone_contributes = self.project.everyone_contributes self.project.everyone_contributes = 'auth' self.project.save() log = LoggerHistory.objects.last() log_cou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_has_perm_change(self):\n perm = \"change\"\n self.assertTrue(self.story.has_perm(self.user1, perm))\n self.assertFalse(self.story.has_perm(self.user2, perm))", "def has_change_permissions_permission(self, request):\n return self.has_generic_permission(request, \"change_permis...
[ "0.7244898", "0.7059024", "0.6889541", "0.6795191", "0.67411464", "0.66908896", "0.6670814", "0.65914536", "0.6510589", "0.6506443", "0.64660573", "0.64164996", "0.6398418", "0.63891697", "0.63790697", "0.6362344", "0.6334252", "0.6317302", "0.6302169", "0.62955713", "0.62841...
0.6936095
2
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
Test when admin is added.
def test_log_add_admin(self): log_count_init = LoggerHistory.objects.count() new_admin = UserFactory.create() AdminsFactory.create(project=self.project, user=new_admin) log = LoggerHistory.objects.last() log_count = LoggerHistory.objects.count() self.assertNotEqual(log....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_admin(self):\n assert(admin)", "def test_add_admin_to_org(self):\n pass", "def test_add_permission(self):\r\n self.assertFalse(self.creator_admin.has_add_permission(self.request))", "def test_admin(self):\r\n \r\n self.assertEqual(False, self.user.isAdmin)", "def...
[ "0.8035439", "0.7834434", "0.74644655", "0.7300101", "0.7240275", "0.7237279", "0.71939147", "0.71756357", "0.7175475", "0.7165845", "0.70430684", "0.6991338", "0.6971429", "0.69710463", "0.6959589", "0.6939541", "0.69283444", "0.6912321", "0.6871333", "0.6862755", "0.6846196...
0.66989976
34
Test when admin is removed.
def test_log_remove_admin(self): existing_admin = UserFactory.create() admins_relation = AdminsFactory.create( project=self.project, user=existing_admin) log_count_init = LoggerHistory.objects.count() admins_relation.delete() log = LoggerHistory.objects.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_admin_from_org(self):\n pass", "def admins_remove(request):\n if len(models.User.admins()) > 1:\n username = request.params['remove']\n user = models.User.get_by_username(username)\n user.admin = False\n return httpexceptions.HTTPSeeOther(\n location=reque...
[ "0.75165576", "0.7325926", "0.7310297", "0.6917351", "0.6911333", "0.6902509", "0.68705064", "0.68392664", "0.6816027", "0.66974336", "0.66638494", "0.6663589", "0.665474", "0.6608606", "0.6600337", "0.6567419", "0.6553488", "0.6531432", "0.65239066", "0.6523381", "0.6523381"...
0.66158235
13
kwargs Additional keyword arguments are copied and the copy is passed up to AbstractIdentifiable; see documentation for that class for details
def __init__(self, value_module=None, value_class=None, **kwargs): kwc=kwargs.copy() AbstractIdentifiable.__init__(self, **kwc) self._template_attrs = {} self._value_module = value_module or 'coverage_model.parameter_values' self._value_class = value_class or 'NumericValue'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _copy_kwargs(self, **kwargs):\n ns = self.__dict__\n for attr, kw in {'_engine': 'engine', '_format': 'format'}.items():\n assert kw not in kwargs\n if attr in ns:\n kwargs[kw] = ns[attr]\n return super()._copy_kwargs(**kwargs)", "def kwargs (self):\n...
[ "0.65482295", "0.60475993", "0.6014898", "0.5967393", "0.5868235", "0.58557135", "0.58557135", "0.58473384", "0.58473384", "0.58473384", "0.58473384", "0.58473384", "0.58473384", "0.58473384", "0.58347636", "0.58346885", "0.5780774", "0.57688177", "0.57609373", "0.5673527", "...
0.0
-1
Return the negative of __eq__(), implemented by concrete classes
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other):\n return not (self == other) # opposite of __eq__", "def __eq__(self, other):\n return super().__ne__(other)", "def __ne__(self, other):\n return not (self == other) # opposite of __eq__", "def __eq__(self,*args):\r\n pass", "def __eq__(self,...
[ "0.7841935", "0.7838963", "0.78300256", "0.7813462", "0.7813462", "0.7813462", "0.7813462", "0.7813462", "0.7813462", "0.7813462", "0.7813462", "0.7813462", "0.7813462", "0.7813462", "0.7813462", "0.7813462", "0.7813462", "0.7813462", "0.7813462", "0.7813462", "0.7813462", ...
0.0
-1
kwargs Additional keyword arguments are copied and the copy is passed up to AbstractParameterType; see documentation for that class for details
def __init__(self, quality=None, nilValues=None, **kwargs): kwc=kwargs.copy() AbstractParameterType.__init__(self, **kwc) self._template_attrs['quality'] = quality self._template_attrs['nilValues'] = nilValues self._template_attrs['fill_value'] = -9999
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _copy_kwargs(self, **kwargs):\n ns = self.__dict__\n for attr, kw in {'_engine': 'engine', '_format': 'format'}.items():\n assert kw not in kwargs\n if attr in ns:\n kwargs[kw] = ns[attr]\n return super()._copy_kwargs(**kwargs)", "def kwargs (self):\n...
[ "0.69999015", "0.6944151", "0.6869652", "0.67030144", "0.67030144", "0.67030144", "0.67030144", "0.67030144", "0.67030144", "0.67030144", "0.6518016", "0.649408", "0.6481835", "0.6477945", "0.64504826", "0.6448473", "0.6442166", "0.6442166", "0.6442166", "0.6442166", "0.64421...
0.0
-1
kwargs Additional keyword arguments are copied and the copy is passed up to AbstractParameterType; see documentation for that class for details
def __init__(self, **kwargs): kwc=kwargs.copy() AbstractParameterType.__init__(self, **kwc) self.value_encoding = np.dtype(object).str self._template_attrs['fill_value'] = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _copy_kwargs(self, **kwargs):\n ns = self.__dict__\n for attr, kw in {'_engine': 'engine', '_format': 'format'}.items():\n assert kw not in kwargs\n if attr in ns:\n kwargs[kw] = ns[attr]\n return super()._copy_kwargs(**kwargs)", "def kwargs (self):\n...
[ "0.69994", "0.6943147", "0.68697184", "0.670463", "0.670463", "0.670463", "0.670463", "0.670463", "0.670463", "0.670463", "0.65178007", "0.64930016", "0.64822674", "0.6478056", "0.6449935", "0.6447525", "0.6441576", "0.6441576", "0.6441576", "0.6441576", "0.6441576", "0.644...
0.6009638
37
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
3
Constructor for BooleanType 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) self._template_attrs['fill_value'] = False self._gen_template_attrs()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args):\n _snap.TBool_swiginit(self, _snap.new_TBool(*args))", "def __init__(\n self,\n *,\n type: str = \"boolean\",\n default: bool = None,\n optional: bool = None,\n description: str = None,\n **kwargs,\n ):\n pass", "def _...
[ "0.70162755", "0.6917055", "0.6731281", "0.6686667", "0.6686667", "0.6686667", "0.6686667", "0.6686667", "0.6686667", "0.6686667", "0.6647876", "0.65780896", "0.6562951", "0.65045625", "0.63866645", "0.6231133", "0.6209134", "0.6206278", "0.6202772", "0.61416185", "0.6078933"...
0.6434512
14
kwargs Additional keyword arguments are copied and the copy is passed up to AbstractSimplexParameterType; see documentation for that class for details
def __init__(self, categories, key_value_encoding=None, key_fill_value=None, **kwargs): kwc=kwargs.copy() AbstractComplexParameterType.__init__(self, value_class='CategoryValue', **kwc) if not isinstance(categories, dict) or len(categories.keys()) == 0: raise TypeError('\'categories...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n AbstractSimplexParameterType.__init__(self, **kwc)", "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n AbstractSimplexParameterType.__init__(self, **kwc)", "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n Abstr...
[ "0.8007624", "0.8007624", "0.8007624", "0.8007624", "0.8007624", "0.8007624", "0.8007624", "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.0
-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
Constructor for TextType 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) self._template_attrs['fill_value'] = '' self._gen_template_attrs()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(\n self,\n type,\n text):\n self.type = type\n self.text = text", "def __init__(self, type_=None, text=None, ssml=None):\n default_attr = dict(type=str(),\n text=str(),\n ssml=str())\n ...
[ "0.70792955", "0.68592656", "0.6754969", "0.668965", "0.668965", "0.668965", "0.668965", "0.668965", "0.668965", "0.668965", "0.66057765", "0.65655494", "0.6442745", "0.6432901", "0.6358988", "0.6352433", "0.61568165", "0.6125608", "0.6125608", "0.6123871", "0.6096488", "0....
0.6726097
3
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
4
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
2
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
5
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
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
6
kwargs Additional keyword arguments are copied and the copy is passed up to AbstractComplexParameterType; see documentation for that class for details
def __init__(self, base_type=None, **kwargs): kwc=kwargs.copy() AbstractComplexParameterType.__init__(self, value_class='FunctionValue', **kwc) if base_type is not None and not isinstance(base_type, QuantityType): raise TypeError('\'base_type\' must be an instance of QuantityType') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n AbstractSimplexParameterType.__init__(self, **kwc)", "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n AbstractSimplexParameterType.__init__(self, **kwc)", "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n Abstr...
[ "0.6834107", "0.6834107", "0.6834107", "0.6834107", "0.6834107", "0.6834107", "0.6834107", "0.67959744", "0.6794273", "0.66894966", "0.668454", "0.65575635", "0.6525356", "0.6301802", "0.6269325", "0.6183789", "0.6180275", "0.61571914", "0.6133167", "0.6111065", "0.60508174",...
0.54011697
88
kwargs Additional keyword arguments are copied and the copy is passed up to AbstractComplexParameterType; see documentation for that class for details
def __init__(self, base_type=None, **kwargs): kwc=kwargs.copy() AbstractComplexParameterType.__init__(self, value_class='ConstantValue', **kwc) if base_type is not None and not isinstance(base_type, QuantityType): raise TypeError('\'base_type\' must be an instance of QuantityType') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n AbstractSimplexParameterType.__init__(self, **kwc)", "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n AbstractSimplexParameterType.__init__(self, **kwc)", "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n Abstr...
[ "0.6833108", "0.6833108", "0.6833108", "0.6833108", "0.6833108", "0.6833108", "0.6833108", "0.6797461", "0.67958695", "0.66881776", "0.6683647", "0.65575874", "0.6524232", "0.6303196", "0.6269328", "0.61838627", "0.6181491", "0.6157223", "0.6133891", "0.6111859", "0.6051581",...
0.535503
94
kwargs Additional keyword arguments are copied and the copy is passed up to AbstractComplexParameterType; see documentation for that class for details
def __init__(self, **kwargs): kwc=kwargs.copy() AbstractComplexParameterType.__init__(self, value_class='RecordValue', **kwc) self._gen_template_attrs()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n AbstractSimplexParameterType.__init__(self, **kwc)", "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n AbstractSimplexParameterType.__init__(self, **kwc)", "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n Abstr...
[ "0.6833108", "0.6833108", "0.6833108", "0.6833108", "0.6833108", "0.6833108", "0.6833108", "0.6797461", "0.67958695", "0.6683647", "0.65575874", "0.6524232", "0.6303196", "0.6269328", "0.61838627", "0.6181491", "0.6157223", "0.6133891", "0.6111859", "0.6051581", "0.6003758", ...
0.66881776
9
kwargs Additional keyword arguments are copied and the copy is passed up to AbstractComplexParameterType; see documentation for that class for details
def __init__(self, **kwargs): kwc=kwargs.copy() AbstractComplexParameterType.__init__(self, value_class='VectorValue', **kwc) self._gen_template_attrs()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n AbstractSimplexParameterType.__init__(self, **kwc)", "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n AbstractSimplexParameterType.__init__(self, **kwc)", "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n Abstr...
[ "0.6833108", "0.6833108", "0.6833108", "0.6833108", "0.6833108", "0.6833108", "0.6833108", "0.6797461", "0.67958695", "0.66881776", "0.65575874", "0.6524232", "0.6303196", "0.6269328", "0.61838627", "0.6181491", "0.6157223", "0.6133891", "0.6111859", "0.6051581", "0.6003758",...
0.6683647
10
kwargs Additional keyword arguments are copied and the copy is passed up to AbstractComplexParameterType; see documentation for that class for details
def __init__(self, **kwargs): kwc=kwargs.copy() AbstractComplexParameterType.__init__(self, value_class='ArrayValue', **kwc) self._gen_template_attrs()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n AbstractSimplexParameterType.__init__(self, **kwc)", "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n AbstractSimplexParameterType.__init__(self, **kwc)", "def __init__(self, **kwargs):\n kwc=kwargs.copy()\n Abstr...
[ "0.6834107", "0.6834107", "0.6834107", "0.6834107", "0.6834107", "0.6834107", "0.6834107", "0.67959744", "0.6794273", "0.66894966", "0.668454", "0.65575635", "0.6301802", "0.6269325", "0.6183789", "0.6180275", "0.61571914", "0.6133167", "0.6111065", "0.60508174", "0.60035187"...
0.6525356
12
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
Update second axis according with first axis.
def convert(ax_Mr): y1, y2 = ax_Mr.get_ylim() ax_lM.set_ylim(Mr2logM(y1), Mr2logM(y2)) ax_lM.figure.canvas.draw()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SwapAxis(self, axis0, axis1):\n\n axis0 = int(axis0)\n axis1 = int(axis1)\n\n self.points[:,[axis0,axis1]] = self.points[:,[axis1,axis0]]", "def second_value_axis(self, second_value_axis):\n\n self.container['second_value_axis'] = second_value_axis", "def second_category_axis(se...
[ "0.6774849", "0.66856533", "0.6600505", "0.61763877", "0.61486536", "0.6041183", "0.5995769", "0.5873503", "0.58597565", "0.5816034", "0.5609444", "0.55961585", "0.55936956", "0.55787843", "0.55628145", "0.55120254", "0.55079573", "0.54915243", "0.5486333", "0.5470706", "0.54...
0.0
-1
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
Residual block described in paper
def residual_block(layer_input, filters): d = Conv2D(filters, kernel_size=3, strides=1, padding='same')(layer_input) d = Activation('relu')(d) d = BatchNormalization(momentum=0.8)(d) d = Conv2D(filters, kernel_size=3, strides=1, padding='same')(d) d = BatchNor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compute_residuals(self):\n residuls = self.I - self.E\n return residuls", "def calculateElementResidual(self):\n import pdb\n\n for ci in range(self.nc):\n self.elementResidual[ci].fill(0.0)\n #\n self.ellamDiscretization.updateElementResidual(self.elemen...
[ "0.7339091", "0.7072034", "0.70234454", "0.6885977", "0.6880569", "0.6876191", "0.68473864", "0.6829634", "0.6631433", "0.66043603", "0.6594716", "0.6505566", "0.6351166", "0.634814", "0.6325655", "0.6318231", "0.63133407", "0.6311214", "0.62727916", "0.6271527", "0.6249097",...
0.59564304
39
Layers used during upsampling
def deconv2d(layer_input): u = UpSampling2D(size=2)(layer_input) u = Conv2D(256, kernel_size=3, strides=1, padding='same')(u) u = Activation('relu')(u) return u
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_layers(self) -> None:\n weight_nums, bias_nums = [], []\n for i in range(self.num_layers):\n if i == 0:\n weight_nums.append((self.in_channels + 2) * self.feat_channels)\n bias_nums.append(self.feat_channels)\n elif i == self.num_layers - ...
[ "0.64799726", "0.6296349", "0.6241206", "0.6225837", "0.621699", "0.6141472", "0.6064341", "0.6051473", "0.6048839", "0.60420585", "0.603786", "0.603231", "0.60159206", "0.6004133", "0.59722394", "0.5970995", "0.59384394", "0.5917395", "0.590645", "0.59026784", "0.5900371", ...
0.0
-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
Removes disk from system
def deleteDisk(positive, alias=None, async=True, disk_id=None): disk_obj = DISKS_API.find(disk_id, attribute='id') if disk_id else ( DISKS_API.find(alias) ) # TODO: add async parameter to delete method once it's supported status = DISKS_API.delete(disk_obj, positive) if not status and positi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_path_from_disk(path:str):\n try:\n shutil.rmtree(path)\n except Exception as err:\n print(err)", "def del_files_from_disk(path):\n\n shutil.rmtree(path) #,ignore_errors=True)", "def remove_device(self, path):\n pass", "def remove_disk():\n if len(disk_sprites) == 3...
[ "0.76290435", "0.750054", "0.68946475", "0.6709873", "0.6628193", "0.6580613", "0.655444", "0.6455496", "0.6453818", "0.64114", "0.6410186", "0.6397673", "0.63905734", "0.63894916", "0.63776785", "0.63529426", "0.63387614", "0.63325477", "0.63308275", "0.62943196", "0.6287192...
0.5965869
49
Attach disk to VM
def attachDisk( positive, alias, vm_name, active=True, read_only=False, disk_id=None, interface='virtio', bootable=None, ): if disk_id: name = disk_id attribute = 'id' else: name = alias attribute = 'name' disk_object = get_disk_obj(name, attribute) # This is only...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def AttachDisk(self, disk: 'AZComputeDisk') -> None:\n vm = self.compute_client.virtual_machines.get(\n self.resource_group_name, self.name)\n data_disks = vm.storage_profile.data_disks\n # ID to assign to the data disk to attach\n lun = 0 if len(data_disks) == 0 else len(data_disks) + 1\n\n ...
[ "0.7809149", "0.7383362", "0.70902497", "0.7080007", "0.7018005", "0.70001394", "0.6988195", "0.6808774", "0.6728143", "0.6680354", "0.66629916", "0.6650673", "0.66492414", "0.6565935", "0.6564377", "0.65408206", "0.65351933", "0.64182085", "0.6389221", "0.63222605", "0.62732...
0.7339946
2
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
Checks that disk is in system __author__ = 'jlibosva'
def checkDiskExists(positive, disk, attr='name'): try: DISKS_API.find(disk, attr) except EntityNotFound: return not positive return positive
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_system(self) -> bool:", "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 ...
[ "0.6060809", "0.59957", "0.5909098", "0.5909098", "0.5909098", "0.5909098", "0.5909098", "0.5909098", "0.5909098", "0.5909098", "0.5909098", "0.5909098", "0.5909098", "0.5909098", "0.5909098", "0.5909098", "0.5909098", "0.5909098", "0.5765692", "0.5739987", "0.55300945", "0...
0.503854
93
Executes an action (copy/move) on the disk
def do_disk_action( action, disk_name=None, target_domain=None, disk_id=None, wait=True, timeout=COPY_MOVE_DISK_TIMEOUT, sleep=10, positive=True, new_disk_alias=None ): sd = STORAGE_DOMAIN_API.find(target_domain) if disk_id: disk = DISKS_API.find(disk_id, attribute='id') elif...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_copy(self, src, dst):\n pass", "def _execute_action_smb(self, action):\n samba = self.guest.application(\"fileTransfer\", {})\n \n for _file in action['files']:\n samba.smbCopy(_file, self.config['applications'][action['application']]['destination'],\n ...
[ "0.63781375", "0.636461", "0.6302197", "0.6225004", "0.61390114", "0.6018071", "0.5989337", "0.59849554", "0.5962092", "0.59525555", "0.5950941", "0.58793867", "0.58712506", "0.5840862", "0.58155847", "0.579326", "0.578342", "0.5768335", "0.5738488", "0.5734673", "0.57120764"...
0.62925
3
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
Choose a random, active data storage domain from the available list of storage domains (ignoring the storage domain on which the disk is found) __author__ = "ratamir"
def get_other_storage_domain( disk, vm_name=None, storage_type=None, force_type=True, ignore_type=[], key='name' ): logger.info( "Find the storage domain type that the disk %s is found on", disk ) if vm_name: if key == 'id': disk = getVmDisk(vm_name, disk_id=disk) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def import_storage_domain(host, storage, index=0):\n if storage == ISCSI:\n assert hl_sd.import_iscsi_storage_domain(\n host,\n lun_address=config.ISCSI_DOMAINS_KWARGS[index]['lun_address'],\n lun_target=config.ISCSI_DOMAINS_KWARGS[index]['lun_target']\n )\n\n e...
[ "0.60543", "0.599114", "0.58151305", "0.5781856", "0.5569611", "0.5564876", "0.55600476", "0.5550349", "0.5522846", "0.5391871", "0.5374513", "0.5367225", "0.5300176", "0.52183235", "0.5190794", "0.51801616", "0.51656926", "0.5158847", "0.51229185", "0.5116341", "0.5104448", ...
0.5678726
4
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
gets the disks' storage domain ids
def get_disk_ids(disk_names): return [get_disk_obj(disk_name).get_id() for disk_name in disk_names]
{ "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 disk_ids(self):\n return list(self._disks)", ...
[ "0.7354078", "0.6926211", "0.64727664", "0.6223953", "0.62009495", "0.6191793", "0.60467607", "0.5985239", "0.5966033", "0.5872608", "0.5868311", "0.5849788", "0.5841288", "0.57461673", "0.5741649", "0.57394373", "0.57171726", "0.5710891", "0.57034105", "0.56439227", "0.56426...
0.6026692
7
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