query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Convert bmp to dicom using img2dcm from dcmtl
def img2dcm_from_bmp(file_name): name = update_destination_file_name(file_name) os.system('img2dcm -i BMP '+file_name+'.bmp '+name+'.dcm ') print("DONE\t "+name+".dcm")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_dicom(file_name):\n\tpath = get_testdata_file(\"CT_small.dcm\")\n\tds = pydicom.dcmread(path)\n\timg = Image.open(file_name+\".bmp\")\n\tnpa = np.asarray(img)\n\tds.PixelData = img.tobytes()\n\tname = update_destination_file_name(file_name)\n\tds.save_as(name+'.dcm')\n\tprint(\"DONE\\t \"+name+\".dc...
[ "0.687955", "0.65860426", "0.61202544", "0.6060835", "0.5739059", "0.5736856", "0.5576306", "0.5576306", "0.5564061", "0.5511846", "0.55104375", "0.55052906", "0.54379535", "0.54345644", "0.54176265", "0.53791124", "0.53653896", "0.5362479", "0.532078", "0.53178036", "0.52917...
0.80045134
0
Get name of bmp files in DIR
def get_file_names(DIR): return sorted(glob.glob(DIR+"*.bmp"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_images_name(folder):\n onlyfiles = [f for f in os.listdir(folder) if os.path.isfile(os.path.join(folder, f))]\n for f in onlyfiles:\n yield f", "def get_file_names(image_path):\n image_filename = []\n for filename in glob.glob(image_path):\n name = os.pat...
[ "0.6813418", "0.6575166", "0.6507314", "0.64919734", "0.61937845", "0.617483", "0.6102902", "0.609273", "0.6068926", "0.6065499", "0.6035004", "0.59730935", "0.58905023", "0.5877417", "0.5874521", "0.5871658", "0.5854602", "0.58270043", "0.5801679", "0.5763564", "0.57602686",...
0.76513433
0
read in feature file and label file for the project
def read_data(feature_file, label_file):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_features_from_file(self):\n f_list = []\n f = open(\"verifiability_features.txt\", \"r\")\n for line in f:\n f_list.append(line)\n self.features = f_list", "def get_features_from_file(self):\n f_list = []\n f = open(\"verifiability_features.txt\", \"r\...
[ "0.6289605", "0.6289605", "0.6234473", "0.62101746", "0.61855817", "0.61508", "0.6148404", "0.61229885", "0.6119996", "0.60538256", "0.5989055", "0.59452003", "0.59027886", "0.5900451", "0.5857968", "0.58088446", "0.58088446", "0.58035123", "0.5795874", "0.57958484", "0.57944...
0.768852
0
get a list of column names that need to drop
def get_cols_drop():
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dropped_column_name_list(self):\n column_list = []\n new_tbl_columns = [col.name for col in self._new_table.column_list]\n for col in self._old_table.column_list:\n if col.name not in new_tbl_columns:\n column_list.append(col.name)\n return column_list", ...
[ "0.7794753", "0.7418328", "0.72996503", "0.7294319", "0.68891555", "0.6888857", "0.6740933", "0.66976076", "0.6678599", "0.6669146", "0.6647702", "0.6634417", "0.6625967", "0.6615026", "0.6609468", "0.65986055", "0.659607", "0.6557459", "0.6551219", "0.6546874", "0.654451", ...
0.84051156
0
evaluation the random forest model by comparing the predicted results with the true results
def evaluate_random_forest(y_test, y_pred):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict_random_forest(X_test, model):", "def test(self, dataset): \n predictions = np.zeros(len(dataset), int)\n \n accuracy = self.random_forest.score(dataset[:,:-1], dataset[:,-1]) # Predict and compute accuracy.\n predictions = self.predict(dataset[:,:-1]) # Predict and return...
[ "0.74515873", "0.7425715", "0.7238714", "0.7189786", "0.6981638", "0.6931996", "0.6848818", "0.67984885", "0.6693853", "0.6642865", "0.6641004", "0.6601602", "0.65982354", "0.65507704", "0.65249264", "0.65202737", "0.6518642", "0.6506447", "0.6488916", "0.6485356", "0.6473324...
0.8294316
0
Computation of distance from subspace as described in Yogatama et al. (2015).
def distance_from_subspace(sentence_repr, bases): summed_projections = np.sum([projection_onto_base(sentence_repr, base) for base in bases], axis=0) distance = np.linalg.norm(sentence_repr - summed_projections) return distance
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_subspace_distance(S1, S2):\n assert S1.shape == S2.shape\n intmat = np.matmul(S1, S1.T) - np.matmul(S2, S2.T)\n # We need to compute the second norm of the above matrix. This is equivalent\n # to the square root of largest eigenvalue of the matrix itself.\n eigenvals, _ = np.linalg.eig(i...
[ "0.7648331", "0.68849045", "0.67311585", "0.6552708", "0.64682204", "0.64632094", "0.6460576", "0.64484066", "0.6408249", "0.6382397", "0.6378878", "0.6371266", "0.6363397", "0.63620496", "0.63439596", "0.6333577", "0.63095784", "0.62799", "0.62727815", "0.6254308", "0.623434...
0.70335627
1
Imprime vacio y termina el programa con error
def finalize_error(): print('') exit(-1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def abort(self):\n print(\"abort\")", "def aborting(self):\n \n pass", "def abort(self):\n raise NotImplementedError", "def error(error_no):\n print('--] Encountered unrecoverable ERROR [%s] ... leaving' % error_no)\n write_termination_message(error_no)\n sys.exit(0)", "def...
[ "0.7384083", "0.6959696", "0.69511443", "0.69211197", "0.6890762", "0.68743277", "0.6873989", "0.68302286", "0.68148625", "0.67887473", "0.6732864", "0.6679454", "0.6677051", "0.66740054", "0.66646206", "0.6664125", "0.6654273", "0.6634228", "0.66255873", "0.66206735", "0.658...
0.7369485
1
make_tile_figure(height=256, width=256, dpi=256) create a transparent figure with a specified width, height, and dpi with no x/y ticks and axis turned off
def make_tile_figure(height=256, width=256, dpi=256): fig = plt.figure(dpi=dpi, facecolor='none', edgecolor='none') fig.set_alpha(0) fig.set_figheight(height/dpi) fig.set_figwidth(width/dpi) figax = fig.add_axes([0., 0., 1., 1.], xticks=[], yticks=[]) figax.set_axis_off() return fig, f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_figure(result_obj, dpi) -> Figure:\n # plot the data\n # set the figure size to tall_fig_size\n figure = Figure(figsize=result_obj.tall_fig_size)\n ax = figure.subplots()\n # call creating heat map\n result_obj.create_heat_map(ax=ax)\n return figure", "...
[ "0.60319024", "0.6012113", "0.59856886", "0.5983031", "0.59797186", "0.5703482", "0.5686803", "0.56445754", "0.5578058", "0.55520177", "0.54680514", "0.5467298", "0.5455847", "0.5432181", "0.542042", "0.5399962", "0.5378965", "0.5374919", "0.5365407", "0.5341097", "0.5333594"...
0.8971096
0
Create a writer for a tif file.
def _make_writer(directory: str, label: str, dtype: np.dtype, image_spec: ImageSpec ) -> BatchWriter: crs = rs.crs.CRS(**image_spec.crs) params = { "driver": "GTiff", "width": image_spec.width, "height": image_spec.heigh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tiffwrite(filename, im):\n tf.imwrite(filename, im)", "def write(self, tofile=None):\n if tofile is None:\n tofile = self._filename[:-4]+\"_tifinity.tiff\"\n\n with open(tofile, 'wb') as out_file:\n self._tiff.tofile(out_file) # numpy.tofile()", "def create_te...
[ "0.6505649", "0.641169", "0.5946132", "0.59388936", "0.5671712", "0.5597131", "0.5591579", "0.556272", "0.5557073", "0.54608333", "0.54226744", "0.53613424", "0.5260942", "0.52609015", "0.52535945", "0.5242172", "0.5226679", "0.5225135", "0.5224667", "0.5212293", "0.521092", ...
0.68826437
0
Remap value with (a,b) > (c, d) It is usually used for normalization.
def remap(self, value, from1, to1, from2, to2): return from2 + (value - from1) * (to2 - from2) / (to1 - from1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mapVal(inputPos, in_min, in_max, out_min, out_max):\n \n \n scale = ((out_max - out_min) / (in_max - in_min))\n return float(((inputPos - in_min) * scale) + out_min)", "def c_map(val):\n return int(remap(val, -1, 1, 0, 255))", "def math_map(val, src, dst):\n return ((val - src[0]) / (src[1] ...
[ "0.5912974", "0.579229", "0.57712096", "0.5703201", "0.5640411", "0.5546222", "0.5474037", "0.5418135", "0.53797334", "0.5377813", "0.5371607", "0.53473985", "0.52956396", "0.52687603", "0.52555084", "0.52521247", "0.52271044", "0.5226879", "0.5175903", "0.5164355", "0.514975...
0.63637227
0
Test parsing of default RFH2 only.
def test_parse_default_rfh2(self): rfh2 = pymqi.RFH2() try: rfh2.unpack(self.single_rfh2_message[0:36]) self.assertEqual(len(rfh2.get()), 8, "Number of attributes incorrect. Should be 8? But is %s" % str(len(rfh2.get()))) self.assertEqual(rfh2["StrucId"], CMQC.MQRFH...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_parse_rfh2(self):\n\n rfh2 = pymqi.RFH2()\n try:\n rfh2.unpack(self.single_rfh2_message)\n self.assertEqual(len(rfh2.get()), 14, \"Number of attributes incorrect. Should be %i? But is %s\" % (14, str(len(rfh2.get()))))\n self.assertEqual(rfh2[\"StrucId\"], C...
[ "0.71470827", "0.6727499", "0.6438465", "0.61016786", "0.6075536", "0.5982623", "0.5897896", "0.56751096", "0.560763", "0.5586277", "0.5474474", "0.5457264", "0.54263794", "0.5386807", "0.53705835", "0.5354744", "0.53139037", "0.5300126", "0.52504265", "0.52373266", "0.523364...
0.7758395
0
Test the creation of a brand new RFH2. Compare the resulting byte array against identical known correct message.
def test_rfh2_create(self): rfh2 = pymqi.RFH2() new_rfh2 = pymqi.RFH2() try: rfh2.unpack(self.single_rfh2_message) new_rfh2["StrucId"] = CMQC.MQRFH_STRUC_ID new_rfh2["Version"] = CMQC.MQRFH_VERSION_2 new_rfh2["StrucLength"] = 188 new_r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_rfh2_pack(self):\n\n rfh2 = pymqi.RFH2()\n try:\n rfh2.unpack(self.single_rfh2_message)\n self.assertEqual(len(rfh2.get()), 14, \"Number of attributes incorrect. Should be 12? But is %s\" % str(len(rfh2.get())))\n self.assertEqual(rfh2[\"StrucId\"], CMQC.MQR...
[ "0.787577", "0.74000674", "0.7355015", "0.72261983", "0.7010021", "0.6389317", "0.6166607", "0.6154984", "0.61484414", "0.6082196", "0.6014005", "0.59859174", "0.5983922", "0.59553874", "0.5954831", "0.5954048", "0.5932265", "0.58775616", "0.58687717", "0.5868589", "0.5850305...
0.8258976
0
Test exception that occurs if StrucId is incorrect.
def test_incorrect_strucid_exception(self): rfh2 = pymqi.RFH2() try: rfh2.unpack(self.single_rfh2_message[116:]) except pymqi.PYIFError as e: self.assertEqual(str(e), "PYMQI Error: RFH2 - StrucId not MQRFH_STRUC_ID. Value: {0}".format(b'ame>'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testIdNonUniqueIdOnInit(self):\n\n cdl_convert.config.HALT_ON_ERROR = True\n\n self.assertRaises(\n ValueError,\n cdl_convert.ColorCorrection,\n 'uniqueId',\n 'file'\n )\n\n cdl_convert.config.HALT_ON_ERROR = False\n\n try:\n ...
[ "0.655885", "0.6551604", "0.65069973", "0.6470638", "0.6455571", "0.6311512", "0.63031745", "0.62980914", "0.6233814", "0.6203228", "0.617211", "0.615754", "0.6150864", "0.6129383", "0.61292565", "0.61287606", "0.61018896", "0.61001426", "0.60925776", "0.6091522", "0.6077896"...
0.74511755
0
Test exception occurs when buffer is too short for default RFH2.
def test_buffer_too_short_for_default_rfh2_exception(self): rfh2 = pymqi.RFH2() try: rfh2.unpack(self.single_rfh2_message[0:32]) except pymqi.PYIFError as e: self.assertEqual(str(e), 'PYMQI Error: RFH2 - Buffer too short. Should be 36+ bytes ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_buffer_too_short_for_complete_rfh2_exception(self):\n\n rfh2 = pymqi.RFH2()\n try:\n rfh2.unpack(self.single_rfh2_message[0:188])\n except pymqi.PYIFError as e:\n self.assertEqual(str(e),\n \"PYMQI Error: RFH2 - Buffer too short. Expec...
[ "0.8512267", "0.71947026", "0.6882153", "0.6208942", "0.6143953", "0.6075595", "0.6072385", "0.6056711", "0.60445094", "0.6037062", "0.6028127", "0.59900546", "0.5972865", "0.59561193", "0.5873312", "0.58719254", "0.58611166", "0.5791776", "0.5779709", "0.5763708", "0.5759461...
0.8819146
0
Test exception occurs when buffer is too short for complete RFH2.
def test_buffer_too_short_for_complete_rfh2_exception(self): rfh2 = pymqi.RFH2() try: rfh2.unpack(self.single_rfh2_message[0:188]) except pymqi.PYIFError as e: self.assertEqual(str(e), "PYMQI Error: RFH2 - Buffer too short. Expected: 284 Buff...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_buffer_too_short_for_default_rfh2_exception(self):\n\n rfh2 = pymqi.RFH2()\n try:\n rfh2.unpack(self.single_rfh2_message[0:32])\n except pymqi.PYIFError as e:\n self.assertEqual(str(e),\n 'PYMQI Error: RFH2 - Buffer too short. Should b...
[ "0.8688607", "0.7216291", "0.67554337", "0.6246366", "0.6185392", "0.61617976", "0.61092323", "0.6096538", "0.6092042", "0.6006821", "0.5971894", "0.5948517", "0.59402996", "0.5899095", "0.58840287", "0.588189", "0.5867684", "0.58050007", "0.5803597", "0.5762995", "0.57488", ...
0.8719886
0
Test exception when parsing a message that contains not well formed XML folder.
def test_folder_not_well_formed_exception_on_parse(self): rfh2 = pymqi.RFH2() try: rfh2.unpack(self.single_rfh2_message_not_well_formed) except pymqi.PYIFError as e: self.assertEqual(str(e).count("XML Folder not well formed"), 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_folder_not_well_formed_exception_on_add(self):\n\n rfh2 = pymqi.RFH2()\n try:\n rfh2.add_folder(b\"<a><b>c</a>\")\n except pymqi.PYIFError as e:\n # Don't depend on the actual XML library getting used (lxml or\n # minidom produce different error messag...
[ "0.7709766", "0.6950972", "0.6747707", "0.6739094", "0.67374736", "0.6724542", "0.6555633", "0.65370715", "0.63875806", "0.63484967", "0.63258076", "0.6320103", "0.6242067", "0.6227198", "0.6213647", "0.6180834", "0.6148769", "0.60313195", "0.59814227", "0.5950527", "0.592596...
0.82294416
0
Test exception when adding a not well formed XML folder.
def test_folder_not_well_formed_exception_on_add(self): rfh2 = pymqi.RFH2() try: rfh2.add_folder(b"<a><b>c</a>") except pymqi.PYIFError as e: # Don't depend on the actual XML library getting used (lxml or # minidom produce different error messages) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_folder_not_well_formed_exception_on_parse(self):\n\n rfh2 = pymqi.RFH2()\n try:\n rfh2.unpack(self.single_rfh2_message_not_well_formed)\n except pymqi.PYIFError as e:\n self.assertEqual(str(e).count(\"XML Folder not well formed\"), 1)", "def test_invalid_xml(se...
[ "0.7010106", "0.6419764", "0.6391039", "0.63640094", "0.6260662", "0.6204656", "0.6193087", "0.6178771", "0.6176275", "0.6162124", "0.61191636", "0.6098839", "0.60950637", "0.60247046", "0.6018194", "0.5995569", "0.5967294", "0.59546566", "0.59328324", "0.5878035", "0.5877828...
0.840095
0
Test that pack() creates numeric fields with correct encoding. Big endian Test.
def test_encoding_on_pack_big_endian(self): try: rfh2 = pymqi.RFH2() self.assertEqual(rfh2.pack(encoding=CMQC.MQENC_FLOAT_S390)[4:8], b"\x00\x00\x00\x02") self.assertEqual(rfh2.pack(encoding=CMQC.MQENC_INTEGER_NORMAL)[4:8], b"\x00\x00\x00\x02") self.assertEqual(r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_encoding_on_pack_small_endian(self):\n\n try:\n rfh2 = pymqi.RFH2()\n self.assertEqual(rfh2.pack()[4:8], b\"\\x02\\x00\\x00\\x00\")\n self.assertEqual(rfh2.pack(encoding=CMQC.MQENC_NATIVE)[4:8], b\"\\x02\\x00\\x00\\x00\")\n self.assertEqual(rfh2.pack(enco...
[ "0.68892866", "0.6516848", "0.6319659", "0.6146586", "0.611312", "0.6071793", "0.5986474", "0.59739196", "0.5886744", "0.58804154", "0.58688307", "0.58342576", "0.5821807", "0.5817026", "0.5805906", "0.57977444", "0.5788095", "0.5787894", "0.57809687", "0.5778733", "0.5751096...
0.69137496
0
Test that pack() creates numeric fields with correct encoding. Small endian Test.
def test_encoding_on_pack_small_endian(self): try: rfh2 = pymqi.RFH2() self.assertEqual(rfh2.pack()[4:8], b"\x02\x00\x00\x00") self.assertEqual(rfh2.pack(encoding=CMQC.MQENC_NATIVE)[4:8], b"\x02\x00\x00\x00") self.assertEqual(rfh2.pack(encoding=CMQC.MQENC_INTEGER...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_encoding_on_pack_big_endian(self):\n\n try:\n rfh2 = pymqi.RFH2()\n self.assertEqual(rfh2.pack(encoding=CMQC.MQENC_FLOAT_S390)[4:8], b\"\\x00\\x00\\x00\\x02\")\n self.assertEqual(rfh2.pack(encoding=CMQC.MQENC_INTEGER_NORMAL)[4:8], b\"\\x00\\x00\\x00\\x02\")\n ...
[ "0.66680545", "0.6510406", "0.63438505", "0.6132471", "0.61096203", "0.60551935", "0.59740627", "0.5942304", "0.59104306", "0.58712906", "0.5858064", "0.58453864", "0.5820478", "0.5765677", "0.57370245", "0.5718671", "0.57074964", "0.5695498", "0.56810033", "0.5661837", "0.56...
0.69024265
0
Convert a tagname ("w.YYYY.NN" or "w.YYYY.N") into a key for sorting. "w_2017_1" > 201701 "w_2017_01" > 201701 "w_2017_10" > 201710 etc.
def tag_key(tagname: str) -> int: return int(tagname.split("_")[1]) * 100 + int(tagname.split("_")[2])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_row_list_sorting_key(x):\n name, count = x\n if '_' not in name:\n return name\n s = name.split('_')\n end = s[-1]\n start = '_'.join(s[:-1])\n if is_int(end):\n return (start, in...
[ "0.57477456", "0.57241935", "0.5705405", "0.5693895", "0.55253285", "0.5523377", "0.551383", "0.5493199", "0.5489519", "0.54492855", "0.541948", "0.5399415", "0.53318167", "0.532423", "0.527034", "0.52513754", "0.5224657", "0.51989686", "0.5172043", "0.5171714", "0.51681113",...
0.6589938
0
Infer a release date from a version number.
def infer_release_date(tagname: str) -> Optional[datetime]: if tagname in RELEASE_DATES: return RELEASE_DATES[tagname] elif tagname[0] == "w" and tagname < "w_2020_43": # Weeklies used to be reliably produced on Saturdays, but that changed # in October of 2020. return datetime.st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def needs_revision(self, text):\n match = re.search(\"rev: ([\\\\d]+)-([\\\\d]+)-([\\\\d]+)$\", text)\n\n if match is None:\n return\n\n month, day, year = match.groups()\n return date(int(year), int(month), int(day))", "def create_date_to_version(release_info):\n # Comb...
[ "0.63451815", "0.63275576", "0.6183602", "0.6182205", "0.6032317", "0.5992137", "0.5973601", "0.58885676", "0.5822706", "0.5729662", "0.572475", "0.5678374", "0.5626042", "0.56251943", "0.5614573", "0.56109214", "0.5548936", "0.551132", "0.55056673", "0.548209", "0.547741", ...
0.65208346
0
Given a version string from the EUPS tag file, find something that looks like a Git ref.
def git_ref_from_eups_version(version: str) -> str: return version.split("+")[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_ref(url_path):\n ref = url_path.lstrip('/')\n if not ref:\n ref = os.environ.get('DEFAULT_GIT_REF', 'HEAD').strip()\n return ref", "def read_gitref():\n\n gitref = module.directory.joinpath('.gitref')\n if gitref.is_file():\n with gitref.open('r') as fp:\n return fp.read().str...
[ "0.6576188", "0.6437483", "0.62298375", "0.60598385", "0.587648", "0.5865167", "0.58643156", "0.57807785", "0.5768465", "0.5718856", "0.5705551", "0.569722", "0.5687006", "0.5681806", "0.56651723", "0.56416386", "0.5604301", "0.5565085", "0.55489296", "0.55382705", "0.5524342...
0.7259927
0
Initialize the instance of Force LammpsParser
def __init__(self, node): super(LAMMPSBaseParser, self).__init__(node)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n\n self.prim_parser = parser.Parser()", "def __init__(self, *args, **kw):\n self.parser = Parser(*args, **kw)", "def __init__(self, *args):\n this = _libsbml.new_L3ParserSettings(*args)\n try: self.this.append(this)\n except: self.this = this", "def __i...
[ "0.65952563", "0.625513", "0.6220574", "0.61228436", "0.6021803", "0.5996512", "0.595963", "0.59566456", "0.59554344", "0.59403914", "0.5933911", "0.5928316", "0.5886195", "0.587883", "0.5871364", "0.58050764", "0.5782081", "0.5763408", "0.5759916", "0.5753893", "0.57400143",...
0.69289714
0
add warning and errors to the output data
def add_warnings_and_errors(self, output_data): # add the dictionary with warnings and errors warnings = self.retrieved.get_object_content(self.node.get_option("scheduler_stderr")) # for some reason, errors may be in the stdout, but not the log.lammps stdout = self.retrieved.get_object_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collect_errors_and_warnings(self) -> str:\n # Complete error message\n message = \"----------------ERRORS----------------\\n\"\n if self.errors == \"\":\n message = \"YOUR FILE IS VALIDATED!\\n\"\n logger.info(message)\n else:\n for error in self.err...
[ "0.65842885", "0.61462384", "0.6120558", "0.60246485", "0.6002042", "0.5989353", "0.59412444", "0.5916804", "0.59151214", "0.5886084", "0.5882666", "0.58749855", "0.5861361", "0.5850587", "0.5810748", "0.5787767", "0.5787767", "0.5787767", "0.5787767", "0.5787767", "0.5787767...
0.7546388
0
Processes a rule. Returns `True` if the rule is valid. When the rule is not a callable, tries importing it, assuming it is a function defined in a specific module of the application. Anonymous rules don't contain an user, so we extract it when calling the rule for validation.
def process_rule(rule, **kwargs): if not callable(rule): rule = import_string(rule) request = kwargs.pop('request') user = kwargs.pop('user', None) return rule(request, user) if user.is_authenticated else rule(request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execution_rule(f):\n return _ExecutionRuleFunction(f)", "def has_rule(self):\n # Someday I'll have a real implementation, but for now I just:\n return False", "def check_rule(self, lineno, line, eol):\n raise FileCheckerError(\"abstract RuleChecker.check_rule method called\")", "d...
[ "0.5610687", "0.55463415", "0.5398152", "0.531792", "0.5274009", "0.5199434", "0.5092668", "0.5076623", "0.50548536", "0.5053655", "0.50532705", "0.50422084", "0.50095063", "0.4963159", "0.49430367", "0.49430367", "0.49402726", "0.49402726", "0.49402726", "0.49402726", "0.494...
0.6991713
0
Processes all rules. If a default age is defined, sets the session expiry to the default age value. Rules will always override the default age.
def process_rules(**kwargs): request = kwargs.get('request') key = get_settings_key(kwargs['user']) default_age = getattr(settings, 'EXPIRY_{}_SESSION_AGE'.format(key), None) if default_age: request.session.set_expiry(default_age) rules = getattr(settings, 'EXPIRY_{}_SESSION_RULES'.format(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ExpireRules(self):\n rules = self.Get(self.Schema.RULES)\n new_rules = self.Schema.RULES()\n now = time.time() * 1e6\n expired_session_ids = set()\n for rule in rules:\n if rule.expires > now:\n new_rules.Append(rule)\n else:\n for action in rule.actions:\n if ac...
[ "0.50609094", "0.48135412", "0.4787447", "0.47269455", "0.4725102", "0.4708332", "0.47033462", "0.4690444", "0.46802887", "0.46769994", "0.46318033", "0.4629554", "0.45825407", "0.45706207", "0.45702064", "0.45683527", "0.45595807", "0.45558882", "0.45545784", "0.45531562", "...
0.7670289
0
Approximate ice melting pressure. Approximate the pressure at which ice at the given temperature will melt.
def liqpressure(temp): tau = temp/_TTP pres = 1. for (a,b) in _C_PMELT: pres += a * (1 - tau**b) pres *= _PTPE return pres
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interpolate_temperature(temperature):\n return min(1.0, max(0.0, (10 + temperature) / 45))", "def volumetric_heat_capacity(temperature):\n a = -2.4083\n b = 7.6006\n c = -8.2982\n d = 7.3301\n e = -4.2386\n f = 1.4294\n g = -0.24396\n h = 0.015236\n ...
[ "0.65544456", "0.63986015", "0.62649477", "0.62571263", "0.6200489", "0.6196679", "0.61895245", "0.6169396", "0.6169396", "0.61389476", "0.6134515", "0.61203176", "0.60592824", "0.6037133", "0.60208577", "0.60058457", "0.59984225", "0.59346646", "0.59078324", "0.5904415", "0....
0.69159836
0
Open the manual in a browser.
def open_manual() -> None: path = os.path.abspath( os.path.join("docs", "_build", "html", "index.html")) webbrowser.open("file:{}".format(pathname2url(path)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_in_browser(self):\n webbrowser.open(self.url)", "def _open_browser(self, single_doc_html):\n url = os.path.join(\"file://\", DOC_PATH, \"build\", \"html\", single_doc_html)\n webbrowser.open(url, new=2)", "def _open_browser(self, single_doc_html):\n url = os.path.join(\n ...
[ "0.7433816", "0.7352811", "0.73442435", "0.73061067", "0.7230955", "0.7013308", "0.6984234", "0.6982259", "0.6967149", "0.69596386", "0.6930381", "0.68684727", "0.6858726", "0.68558747", "0.67257833", "0.6705721", "0.6699542", "0.6688857", "0.6664168", "0.6647107", "0.664138"...
0.8556528
0
Return total number of cookies
def get_total_cookies(self): return self._total_cookies
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stored_cookie_messages_count(storage, response):\n # Get a list of cookies, excluding ones with a max-age of 0 (because\n # they have been marked for deletion).\n cookie = response.cookies.get(storage.cookie_name)\n if not cookie or cookie['max-age'] == 0:\n return 0\n data = storage._dec...
[ "0.74132633", "0.6598871", "0.6472773", "0.64043957", "0.624381", "0.62436706", "0.62436706", "0.62436706", "0.62436706", "0.61837775", "0.6155279", "0.613574", "0.613082", "0.6045822", "0.60158277", "0.59769815", "0.59728", "0.59685266", "0.5945824", "0.59324086", "0.5916609...
0.8546981
0
Always buy the most expensive item you can afford in the time left.
def strategy_expensive(cookies, cps, history, time_left, build_info): max_item = None max_cost = 0.0 info = build_info for item in info.build_items(): if (info.get_cost(item) >= max_cost and info.get_cost(item) <= (time_left * cps + cookies)): max_item = item max_cost = i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strategy_expensive(cookies, cps, history, time_left, build_info):\n # Select the most expensive item you can afford\n _selected_item = None\n _max = 0\n _available = cookies + ( time_left * cps )\n _item_list = build_info.build_items()\n for _item in _item_list:\n _item_cost = build_in...
[ "0.74640775", "0.6997921", "0.68483776", "0.6752557", "0.67267394", "0.66846585", "0.6644899", "0.6641537", "0.6531228", "0.6500213", "0.64841187", "0.6477358", "0.6465258", "0.64575446", "0.6455645", "0.6394826", "0.638382", "0.6354508", "0.63537717", "0.6339756", "0.6328227...
0.7019484
1
Returns the elements matching `selector` with strip()ped text equal to `text`.
def _find_with_text(self, selector, text): stripped = text.strip() elements = self.selenium.find_elements_by_css_selector(selector) return [e for e in elements if e.text.strip() == stripped]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ExtractText(self, selector):\n xpaths = map(self.tree.xpath, selector)\n elements = list(chain.from_iterable(xpaths))\n paragraphs = [e.text_content() for e in elements]\n paragraphs = [s.strip() for s in paragraphs if s and not s == ' ']\n\n return paragraphs", "def get_elements(self, css=Non...
[ "0.65104663", "0.6116433", "0.59125775", "0.5903657", "0.5771027", "0.5628334", "0.5559847", "0.5469084", "0.5453914", "0.5446368", "0.54350215", "0.5317224", "0.5218052", "0.52121854", "0.52026844", "0.5096568", "0.50862926", "0.5084641", "0.50642085", "0.505375", "0.5050455...
0.81290793
0
Tests that the options menu autoopens for brand new pages, when you're admin and there are no items.
def test_options_menu_autoopen(self): self.login() page = Page.objects.create(owner=self.user) path = page.get_absolute_url() self.selenium.get('%s%s' % (self.live_server_url, path)) dropdown_menu_btn = self._get_one('.page-options-dropdown .dropdown-toggle') show_opts_bt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_anon_page_admin(self):\n self._make_quick_page()\n\n dropdown_menu_btn = self._get_one('.dropdown-toggle')\n show_opts_btn = self._get_one('.options-btn')\n options_menu = self._get_one('.pageOptions')\n\n self.assertTrue(dropdown_menu_btn.is_displayed())\n dropdo...
[ "0.70893687", "0.6755155", "0.6622082", "0.64848495", "0.60606444", "0.6039129", "0.6028699", "0.6010374", "0.5989254", "0.5964461", "0.59444", "0.5916524", "0.5888133", "0.58783525", "0.5871318", "0.5805402", "0.5803815", "0.57926065", "0.57029414", "0.56999516", "0.5693253"...
0.76828927
0
Makes sure that the creator of an anonymous page (i.e. quick page) can set the admin options for that page, and that these options are correctly propagated to other users.
def test_anon_page_admin(self): self._make_quick_page() dropdown_menu_btn = self._get_one('.dropdown-toggle') show_opts_btn = self._get_one('.options-btn') options_menu = self._get_one('.pageOptions') self.assertTrue(dropdown_menu_btn.is_displayed()) dropdown_menu_btn.c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def admin_only():\n return 'Super-seekrit admin page.'", "def set_main_user_options(self):\n if self.user:\n self.template_values[self._tp_logoutLink] = True\n self.template_values[self._tp_userName] = self.user.username\n else:\n self.template_values[self._tp_lo...
[ "0.60113853", "0.589839", "0.5891344", "0.5891344", "0.5891344", "0.5891344", "0.5891344", "0.5837993", "0.5770133", "0.56898016", "0.5682634", "0.56806123", "0.5677221", "0.5621111", "0.5578521", "0.55629647", "0.5524499", "0.5507416", "0.54981744", "0.54981744", "0.5494439"...
0.7569566
0
load repository configs from the specified json file
def _load_repo_configs(path): with open(path) as f: return json.loads(f.read())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_config(self):\r\n with open('config.json', 'r') as f:\r\n self.config = json.load(f)", "def config_from_json(self, filename):\n with open(filename, 'r') as f:\n config = json.load(f)\n config = self._process_config_imports(config)\n self.config.update(co...
[ "0.71348774", "0.70421135", "0.6929282", "0.6852286", "0.6843114", "0.682918", "0.6777017", "0.6767798", "0.67261606", "0.67133105", "0.6707989", "0.6699518", "0.6675554", "0.6648495", "0.66465116", "0.66225946", "0.65959436", "0.6592455", "0.6591371", "0.65746266", "0.655294...
0.7956849
1
Sets the mboost of this Publication.
def mboost(self, mboost): self._mboost = mboost
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_boost(self, boost):\r\n self._boost = float(boost)\r\n return self", "def search_boost(self, search_boost):\n\n self._search_boost = search_boost", "def setMLE(self, mle):\n self._mle = mle", "def bias(self, value):\n self.mbmod.bias = value", "def set_gain_boost(...
[ "0.7802077", "0.67604756", "0.5968198", "0.5613297", "0.5546939", "0.55280375", "0.5501137", "0.5470156", "0.5450144", "0.5397172", "0.52325666", "0.52157605", "0.5183667", "0.5175594", "0.5136462", "0.51205", "0.510761", "0.51011765", "0.5097459", "0.50443226", "0.5025509", ...
0.8382951
0
Sets the pmid of this Publication.
def pmid(self, pmid): self._pmid = pmid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mid(self, mid):\n\n self._mid = mid", "def set_pid(self, kp=None, ki=None, kd=None):\n if kp is not None:\n self.k_p = kp\n if ki is not None:\n self.k_i = ki\n if kd is not None:\n self.k_d = kd\n\n self.reset_sum()", "def pid(self, pid):...
[ "0.64601755", "0.6295589", "0.62318575", "0.62318575", "0.61486214", "0.61322916", "0.5798742", "0.5683031", "0.5676941", "0.56131643", "0.55427146", "0.55277747", "0.55277747", "0.5411092", "0.54087585", "0.5285532", "0.5265903", "0.52623296", "0.5245304", "0.521699", "0.519...
0.83832806
0
Sets the doi of this Publication.
def doi(self, doi): self._doi = doi
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_doi(self):\n\n return self._dois", "def doi(self):\n return LiteratureReader(self.record).doi", "def setDominance(self, dom):\n\t\tself.dominance = dom", "def dob(self, dob):\n\n self._dob = dob", "def __init__(self, doi='', reference=''):\n\n self.doi = doi\n sel...
[ "0.612489", "0.59809", "0.56742495", "0.5658844", "0.56332713", "0.55885947", "0.5507517", "0.5330586", "0.5330442", "0.52845186", "0.5157032", "0.5117355", "0.5090091", "0.5089838", "0.50802445", "0.5038019", "0.50251794", "0.50149214", "0.50097466", "0.49331677", "0.490115"...
0.7935173
0
Sets the journal_name of this Publication.
def journal_name(self, journal_name): self._journal_name = journal_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def journal_iso_abbreviation(self, journal_iso_abbreviation):\n\n self._journal_iso_abbreviation = journal_iso_abbreviation", "def archive_name(self, archive_name):\n\n self._archive_name = archive_name", "def set_archive_name(self, archive_name):\n self._basket.set_archive_name(archive_na...
[ "0.6408077", "0.6168033", "0.6107733", "0.60907996", "0.6050696", "0.6050696", "0.6050696", "0.59526277", "0.5830123", "0.5753452", "0.5753452", "0.57079756", "0.5674655", "0.5664289", "0.5664289", "0.56537396", "0.56533635", "0.5646587", "0.5646587", "0.56399703", "0.5603891...
0.88384
0
Sets the journal_iso_abbreviation of this Publication.
def journal_iso_abbreviation(self, journal_iso_abbreviation): self._journal_iso_abbreviation = journal_iso_abbreviation
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def abbreviation(self, abbreviation):\n self._abbreviation = abbreviation", "def add_journal_abbrev(b):\n if 'journal' in b:\n if 'journal_abbrev' not in b:\n # Create one abbrev\n journal, abbrev = identify_some_journals(b)\n b['journal_abbrev'] = abbrev\n b['journal'] = journal",...
[ "0.6889175", "0.5890393", "0.5847157", "0.54266214", "0.5234471", "0.50942034", "0.50169617", "0.49710736", "0.48891544", "0.4859657", "0.48544276", "0.48470113", "0.48457843", "0.48267466", "0.47714788", "0.46048647", "0.46048647", "0.46048647", "0.45982903", "0.45655596", "...
0.8710755
0
Sets the purpose of this Publication.
def purpose(self, purpose): self._purpose = purpose
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def purpose(self):\n return self._purpose", "def purpose(self) -> str:\n return pulumi.get(self, \"purpose\")", "def purpose(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"purpose\")", "def event_purpose_name(self, event_purpose_name):\n\n self._event_purpose_na...
[ "0.64459795", "0.639075", "0.61010134", "0.6095832", "0.60293466", "0.56437147", "0.5607187", "0.52514887", "0.5235577", "0.5234589", "0.51124793", "0.5091262", "0.5091262", "0.5091262", "0.50704545", "0.50602275", "0.5048317", "0.50066423", "0.49932855", "0.4975551", "0.4943...
0.7915272
0
Sets the background of this Publication.
def background(self, background): self._background = background
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetBackground(*args, **kwargs):\n return _gdi_.PseudoDC_SetBackground(*args, **kwargs)", "def SetBackground(*args, **kwargs):\n return _gdi_.DC_SetBackground(*args, **kwargs)", "def setBackground(self, color = None):", "def setBackground(self, brush):\n self.format.setBackground(brus...
[ "0.73936987", "0.73862416", "0.73027503", "0.6868663", "0.68261576", "0.6823222", "0.6809117", "0.6744284", "0.67193997", "0.66941476", "0.6689455", "0.668099", "0.6638695", "0.66263926", "0.66098356", "0.6566061", "0.6506216", "0.64410996", "0.6368925", "0.6262327", "0.62050...
0.7782577
0
Sets the methods of this Publication.
def methods(self, methods): self._methods = methods
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, methods=None):\n methods = methods or {}\n for name, method in methods.items():\n setattr(self, name, method)", "def Methods(self):\n pass", "def setMethod(self, method):\n\t\tself.method = method", "def authentication_methods(self, authentication_methods):\...
[ "0.66979945", "0.626157", "0.61122", "0.6061199", "0.5932513", "0.59213537", "0.58848435", "0.578204", "0.5779279", "0.56719136", "0.565349", "0.559687", "0.55541444", "0.5520658", "0.54472095", "0.5432812", "0.5409823", "0.5402598", "0.5380674", "0.5367611", "0.5296568", "...
0.727042
0
Sets the conclusion of this Publication.
def conclusion(self, conclusion): self._conclusion = conclusion
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conclusion(self) -> ExpressionNode:\n return self.__conclusion", "def conclusion_function(self):\n pass", "def add_inclusion(self, inclusion):\n self.inclusion_entries.add(inclusion)\n return self", "def setIncludeConfidence(self, b):\n return self._set(includeConfidenc...
[ "0.58858013", "0.5487552", "0.53644097", "0.52748466", "0.52748466", "0.5172756", "0.5154618", "0.5154618", "0.505102", "0.49883157", "0.48824987", "0.47619435", "0.47473696", "0.4727532", "0.46906888", "0.4654397", "0.46235895", "0.46076193", "0.46076193", "0.45952684", "0.4...
0.7493759
0
Sets the conflicts of this Publication.
def conflicts(self, conflicts): self._conflicts = conflicts
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setConflictList(self, conflict_list):\n return\n # if conflict_list is None or conflict_list == []:\n # self.resetConflictList()\n # else:\n # self.conflict_list = conflict_list ", "def refine_conflict(self):\n self._raise_not_supported()", "def conflicts(self):\r\n params ...
[ "0.6816807", "0.63415027", "0.6328622", "0.5831339", "0.57711446", "0.5678352", "0.5591467", "0.5544077", "0.5463442", "0.54168266", "0.54168266", "0.54168266", "0.54168266", "0.53949803", "0.53910136", "0.5367838", "0.5362276", "0.5353773", "0.5281564", "0.52745295", "0.5165...
0.8128952
0
Sets the citation of this Publication.
def citation(self, citation): self._citation = citation
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def citation_date(self, citation_date):\n\n self._citation_date = citation_date", "def pubchem(self, pubchem):\n\n self._pubchem = pubchem", "def cidade(self, cidade):\n self._cidade = cidade", "def set_cite(self, value):\n return self._set_one_attribute(self.AttributeNames.CITE, ...
[ "0.68507504", "0.6", "0.57756525", "0.571414", "0.5516147", "0.5138177", "0.5092435", "0.5092435", "0.5092435", "0.5092435", "0.5092435", "0.5092435", "0.5092435", "0.5092435", "0.5092435", "0.50919425", "0.5042359", "0.50287807", "0.50279677", "0.5005527", "0.5005527", "0....
0.8340678
0
Sets the citation_date of this Publication.
def citation_date(self, citation_date): self._citation_date = citation_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def citation(self, citation):\n\n self._citation = citation", "def set_date(self, date):\n self.date = date\n return", "def set_date(self, date):\n self.date = date", "def date(self, date):\n\n self._date = date", "def date(self, date):\n\n self._date = date", "d...
[ "0.729193", "0.69661516", "0.695235", "0.683335", "0.683335", "0.683335", "0.683335", "0.683335", "0.68091226", "0.6729778", "0.67153424", "0.662696", "0.66199", "0.6614161", "0.6614161", "0.6501503", "0.6489376", "0.64564455", "0.63287586", "0.6328287", "0.63121736", "0.63...
0.88924646
0
Sets the link of this Publication.
def link(self, link): self._link = link
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def link(self, link):\n\n self._set_field(\"link\", link)", "def link(self, link):\n\n self.container['link'] = link", "def setLink(self, link):\n if type(link)==Member or link==None:\n self.link = link\n return True\n else:\n return False", "def l...
[ "0.79749763", "0.7530729", "0.7481008", "0.7103886", "0.70704424", "0.69596153", "0.6916594", "0.6916594", "0.6916594", "0.6916594", "0.648602", "0.6483644", "0.64774674", "0.64596295", "0.6421415", "0.6291913", "0.6280753", "0.62561846", "0.62420154", "0.6211051", "0.6189356...
0.813185
1
Sets the chemicals of this Publication.
def chemicals(self, chemicals): self._chemicals = chemicals
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setChemicalFormula(self, *args):\n return _libsbml.FbcSpeciesPlugin_setChemicalFormula(self, *args)", "def pubchem(self, pubchem):\n\n self._pubchem = pubchem", "def set_cosmo(self,astropycosmo):\n if \"astropy\" not in astropycosmo.__module__:\n raise ValueError(\"'astropyc...
[ "0.6592653", "0.5461243", "0.5379636", "0.52524793", "0.5217507", "0.5189434", "0.51816124", "0.515109", "0.51046973", "0.5088227", "0.50585663", "0.5011785", "0.50007176", "0.4972145", "0.49512392", "0.4888486", "0.47861183", "0.47491392", "0.4715971", "0.4698725", "0.468550...
0.81727797
0
Sets the keywords of this Publication.
def keywords(self, keywords): self._keywords = keywords
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keywords(self, keywords):\n self._keywords = keywords", "def setKeywords(self,value):\n self.PDFreactorConfiguration.in1[\"keywords\"] = value", "def SetupKeywords(self):\n kwlist = u\" \".join(self._keywords)\n self.SetKeyWords(0, kwlist)", "def set_keywords(self):\n\n ...
[ "0.8147256", "0.7658762", "0.7555273", "0.7453942", "0.6974924", "0.69661695", "0.6765341", "0.6646825", "0.65429056", "0.64041835", "0.63493943", "0.6315526", "0.6275398", "0.62187284", "0.62146777", "0.61799324", "0.61769855", "0.6121589", "0.60810685", "0.6007837", "0.5941...
0.8118509
1
Sets the extended_keywords of this Publication.
def extended_keywords(self, extended_keywords): self._extended_keywords = extended_keywords
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_keywords(self):\n\n if len(self.get_keywords()) == 0 and len(self.get_files()) > 0:\n self.keywords = self.files[0].get_parent()[\"title\"].split(\" \")\n for keyword in self.keywords:\n if str(keyword) in str(self.text):\n self.keywords = []",...
[ "0.613023", "0.6115287", "0.60959166", "0.6089307", "0.6050769", "0.5820818", "0.5731696", "0.5457425", "0.54115665", "0.53268534", "0.52279794", "0.5132353", "0.500878", "0.495174", "0.49476868", "0.49077067", "0.4896132", "0.4864686", "0.48572958", "0.48120114", "0.48012924...
0.87584704
0
Sets the publication_type of this Publication.
def publication_type(self, publication_type): self._publication_type = publication_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setDistributionType(self, distribution_type):\n self._distribution_type = distribution_type", "def set_type(self, type):\n self._type = type", "def set_type(self, type):\n self.type = type", "def set_type(self, type):\n self.type = type", "def membership_type(self, membershi...
[ "0.71468675", "0.66209954", "0.654961", "0.654961", "0.64959747", "0.6219027", "0.6219027", "0.6219027", "0.6194358", "0.61815953", "0.61815953", "0.6154818", "0.6146462", "0.61333877", "0.6132584", "0.61233485", "0.61233485", "0.61178285", "0.61178285", "0.61178285", "0.6117...
0.90298676
0
Sets the authors of this Publication.
def authors(self, authors): self._authors = authors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addSetAuthor(self,val):\n self.bookAuthor = val", "def authors(self):\n raise BookInfoNotImplementedError('authors', self.__class__.__name__)", "def set_author (self, author):\n self.author = author", "def set_author(self, author):\n self.author = author\n self.opf.auth...
[ "0.725506", "0.72316134", "0.7045506", "0.6892445", "0.6848359", "0.68373984", "0.67948055", "0.6719935", "0.6719935", "0.6717329", "0.6672453", "0.66543674", "0.66414213", "0.6536985", "0.6475794", "0.6392466", "0.63749707", "0.6310121", "0.630487", "0.6256534", "0.6224558",...
0.8317624
0
Sets the molecular_alterations of this Publication.
def molecular_alterations(self, molecular_alterations): self._molecular_alterations = molecular_alterations
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setImmunity(self, immune):\n self._immune = immune", "def setReaction(self, *args):\n return _libsbml.GeneAssociation_setReaction(self, *args)", "def set_moderator(self, moderators):\n self.set_group(self._gp_moderator_name, moderators)", "def manifestations_reproductive_organs(self,...
[ "0.5755824", "0.48902705", "0.48241803", "0.48172125", "0.48109674", "0.47542772", "0.4658356", "0.46530634", "0.45592216", "0.4534165", "0.4490094", "0.44890296", "0.44867045", "0.4463182", "0.44289944", "0.44220865", "0.44141468", "0.43880856", "0.43760118", "0.43632725", "...
0.86210513
0
Writes field values to the output.
def _WriteFieldValues(self, output_mediator, field_values): return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _WriteFieldValues(self, output_mediator, field_values):", "def _WriteFieldValues(self, output_mediator, field_values):\n if self._event_counter != 0:\n self.WriteText(', ')\n\n json_string = json.dumps(field_values, sort_keys=True)\n output_text = '\"event_{0:d}\": {1:s}\\n'.format(\n se...
[ "0.85339165", "0.75360596", "0.6836044", "0.6643259", "0.6608523", "0.65411335", "0.65070635", "0.65070635", "0.64722645", "0.64722645", "0.64080256", "0.6394916", "0.6373456", "0.63333994", "0.6278277", "0.6278277", "0.6266416", "0.62370265", "0.6236556", "0.6235685", "0.622...
0.8284956
1
Tests the RegisterOutput and DeregisterOutput functions.
def testRegistration(self): # pylint: disable=protected-access number_of_parsers = len(manager.OutputManager._output_classes) manager.OutputManager.RegisterOutput(TestOutput) with self.assertRaises(KeyError): manager.OutputManager.RegisterOutput(TestOutput) self.assertEqual( len(man...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testGetOutputClass(self):\n manager.OutputManager.RegisterOutput(TestOutput)\n\n output_class = manager.OutputManager.GetOutputClass('test_output')\n self.assertEqual(output_class, TestOutput)\n\n with self.assertRaises(ValueError):\n _ = manager.OutputManager.GetOutputClass(1)\n\n with sel...
[ "0.70004165", "0.6896971", "0.6818848", "0.67098594", "0.6170298", "0.60725737", "0.5968327", "0.5891343", "0.5696411", "0.56727475", "0.5653276", "0.5636194", "0.56343514", "0.56317496", "0.5601879", "0.56005484", "0.55969363", "0.5569692", "0.55619335", "0.55437595", "0.553...
0.7706916
0
Tests the GetOutputClass function.
def testGetOutputClass(self): manager.OutputManager.RegisterOutput(TestOutput) output_class = manager.OutputManager.GetOutputClass('test_output') self.assertEqual(output_class, TestOutput) with self.assertRaises(ValueError): _ = manager.OutputManager.GetOutputClass(1) with self.assertRaises...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testHasOutputClass(self):\n manager.OutputManager.RegisterOutput(TestOutput)\n\n self.assertTrue(manager.OutputManager.HasOutputClass('test_output'))\n self.assertFalse(manager.OutputManager.HasOutputClass('bogus'))\n self.assertFalse(manager.OutputManager.HasOutputClass(1))\n\n manager.OutputMa...
[ "0.8293767", "0.8033301", "0.6971202", "0.66998005", "0.6345287", "0.6345287", "0.6345287", "0.6345287", "0.6345287", "0.6345287", "0.61049056", "0.6019943", "0.5976824", "0.58712506", "0.586236", "0.5850202", "0.58154154", "0.58154154", "0.58154154", "0.58154154", "0.5815415...
0.85075384
0
Tests the GetDisabledOutputClasses function.
def testGetDisabledOutputClasses(self): manager.OutputManager.RegisterOutput(TestOutput, disabled=True) names = [] output_classes = [] for name, output_class in manager.OutputManager.GetDisabledOutputClasses(): names.append(name) output_classes.append(output_class) self.assertIn('test...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testGetOutputClasses(self):\n manager.OutputManager.RegisterOutput(TestOutput)\n\n names = []\n output_classes = []\n\n for name, output_class in manager.OutputManager.GetOutputClasses():\n names.append(name)\n output_classes.append(output_class)\n\n self.assertIn('test_output', names)...
[ "0.6706411", "0.61553234", "0.5986369", "0.5797958", "0.57070965", "0.57070965", "0.5692036", "0.5659793", "0.55731004", "0.5529009", "0.5365029", "0.53437954", "0.5285717", "0.5250538", "0.522525", "0.52070993", "0.5181341", "0.51516294", "0.5150663", "0.51188475", "0.511884...
0.87879515
0
Tests the GetOutputClasses function.
def testGetOutputClasses(self): manager.OutputManager.RegisterOutput(TestOutput) names = [] output_classes = [] for name, output_class in manager.OutputManager.GetOutputClasses(): names.append(name) output_classes.append(output_class) self.assertIn('test_output', names) self.asser...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testHasOutputClass(self):\n manager.OutputManager.RegisterOutput(TestOutput)\n\n self.assertTrue(manager.OutputManager.HasOutputClass('test_output'))\n self.assertFalse(manager.OutputManager.HasOutputClass('bogus'))\n self.assertFalse(manager.OutputManager.HasOutputClass(1))\n\n manager.OutputMa...
[ "0.752798", "0.7388555", "0.7258925", "0.6912157", "0.64257425", "0.6196892", "0.61033857", "0.60282755", "0.5977359", "0.59739506", "0.59739506", "0.597154", "0.5948762", "0.5920865", "0.5862636", "0.58562934", "0.5842455", "0.580713", "0.57864785", "0.5785787", "0.5785787",...
0.85917693
0
Tests the HasOutputClass function.
def testHasOutputClass(self): manager.OutputManager.RegisterOutput(TestOutput) self.assertTrue(manager.OutputManager.HasOutputClass('test_output')) self.assertFalse(manager.OutputManager.HasOutputClass('bogus')) self.assertFalse(manager.OutputManager.HasOutputClass(1)) manager.OutputManager.Deregi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testGetOutputClass(self):\n manager.OutputManager.RegisterOutput(TestOutput)\n\n output_class = manager.OutputManager.GetOutputClass('test_output')\n self.assertEqual(output_class, TestOutput)\n\n with self.assertRaises(ValueError):\n _ = manager.OutputManager.GetOutputClass(1)\n\n with sel...
[ "0.80089474", "0.7919648", "0.69929737", "0.66549736", "0.6647188", "0.6572023", "0.6071139", "0.6053263", "0.5898978", "0.58872765", "0.58094376", "0.57822925", "0.57521784", "0.572112", "0.572112", "0.572112", "0.572112", "0.572112", "0.572112", "0.5714961", "0.56892365", ...
0.8717429
0
Tests the NewOutputModule function.
def testNewOutputModule(self): manager.OutputManager.RegisterOutput(TestOutput) output_module = manager.OutputManager.NewOutputModule('test_output') self.assertIsInstance(output_module, TestOutput) with self.assertRaises(ValueError): manager.OutputManager.NewOutputModule(1) with self.assert...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _createModuleObj(self):\n ModuleOutputSolnDomain.__init__(self)", "def testHasOutputClass(self):\n manager.OutputManager.RegisterOutput(TestOutput)\n\n self.assertTrue(manager.OutputManager.HasOutputClass('test_output'))\n self.assertFalse(manager.OutputManager.HasOutputClass('bogus'))\n s...
[ "0.6333066", "0.6227317", "0.61978894", "0.6173591", "0.60499346", "0.60102004", "0.60056", "0.59695756", "0.5965606", "0.5897929", "0.582885", "0.58213204", "0.58156085", "0.578383", "0.57659787", "0.57659787", "0.5741999", "0.56763685", "0.567007", "0.5652021", "0.5629907",...
0.8688554
0
Run the simulation for as many timesteps as specified by the configuration. This will automatically start at the last completed timestep and proceed untill all the specified timesteps are completed.
def run(self): last = self.system.last_timestep start = last.timestep + 1 if last else 0 del last end = self.system.cg_steps logging.info("running timesteps {} to {}".format(start, end)) for _ in range(start, end): self.system.begin_timestep(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self, steps = 1000):\n for step in range(steps):\n if self.is_done():\n return\n self.step()", "def execute_timesteps(self, num_timesteps, max_timesteps_per_episode=0, update_spec=None, deterministic=False):\n pass", "def run(self, steps=1000):\n ...
[ "0.68369347", "0.6826555", "0.6804007", "0.6804007", "0.6764498", "0.6755697", "0.67227155", "0.64020586", "0.6377968", "0.6373724", "0.630428", "0.62823457", "0.615803", "0.6156906", "0.6145371", "0.61430925", "0.6106993", "0.61052084", "0.6104093", "0.6104093", "0.6091223",...
0.71478415
0
Performs a timestep on the atomistic scale using system.universe object as the starting state. This entails vacuum minimizing, optionally solvating and solvent minimizing, equilibriating and finally running a series of MD runs to populate the cg_positions, cg_forces and cg_velocities state variables, and saving these v...
def atomistic_step(self): # first minimize in vacuum, in either case, # fixes problems with langevin bond deformation. self.system.minimize() if self.system.should_solvate: with self.system.solvate() as sol: with self.system.minimize(**sol) as mn: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method_compute_timestep(self):\n\n myg = self.cc_data.grid\n\n cfl = self.rp.get_param(\"driver.cfl\")\n\n u = self.cc_data.get_var(\"x-velocity\")\n v = self.cc_data.get_var(\"y-velocity\")\n\n # the timestep is min(dx/|u|, dy|v|)\n xtmp = ytmp = 1.e33\n if not...
[ "0.6524394", "0.6177675", "0.61612016", "0.59929496", "0.5893698", "0.5711051", "0.5592193", "0.5578783", "0.5563007", "0.55499583", "0.55368036", "0.5519254", "0.5504861", "0.5496873", "0.54738367", "0.5467854", "0.5459295", "0.54552984", "0.54397774", "0.54131395", "0.53856...
0.6680126
0
[p]fancysay pingrole rolename this is the text to ping 1) Converts a role to mentionable 2) Posts the message + ping in the current channel 3) Sets the role to unmentionable 4) Deletes the input message The role must be unmentionable before this command for safety.
async def pingrole(self, ctx, role: discord.Role, *, text): if role.mentionable: await ctx.send(inline('Error: role is already mentionable')) return try: await role.edit(mentionable=True) except Exception as ex: await ctx.send(inline('Error: faile...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def fullnuke(ctx):\r\n await ctx.message.delete()\r\n roles = ctx.guild.roles\r\n roles.pop(0)\r\n for role in roles:\r\n if ctx.guild.roles[-1] > role:\r\n try:\r\n await role.delete()\r\n except:\r\n print(\r\n f\"{Fo...
[ "0.6242212", "0.6063368", "0.597188", "0.59528655", "0.5927311", "0.59199274", "0.580419", "0.57516474", "0.57096374", "0.5671513", "0.5644061", "0.55980384", "0.5577396", "0.5573525", "0.5561749", "0.5556118", "0.5554161", "0.5531287", "0.5524703", "0.5514572", "0.55107164",...
0.7363451
0
Speak the provided text as emojis, deleting the original request
async def emoji(self, ctx, *, text): await ctx.message.delete() new_msg = "" for char in text: if char.isalpha(): new_msg += char_to_emoji(char) + ' ' elif char == ' ': new_msg += ' ' elif char.isspace(): new_ms...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def textemote(self, ctx, *, msg):\n try:\n await ctx.message.delete()\n except discord.Forbidden:\n pass\n\n if msg != None:\n out = msg.lower()\n text = out.replace(' ', ' ').replace('10', '\\u200B:keycap_ten:')\\\n .re...
[ "0.6661488", "0.6646172", "0.6616491", "0.64896107", "0.6306223", "0.619836", "0.61665314", "0.60888517", "0.60843855", "0.60478836", "0.6027056", "0.60116553", "0.59717035", "0.5926828", "0.5926828", "0.59185565", "0.59050673", "0.5894445", "0.5892837", "0.58630925", "0.5855...
0.6749536
0
[title] [description] [image_url] [footer_text] You must specify a title. You can omit any of description, image, or footer. To omit an item use empty quotes. For the text fields, wrap your text in quotes. The bot will automatically delete your 'say' command if it can
async def title_description_image_footer(self, ctx, title, description, image, footer): embed = discord.Embed() if len(title): embed.title = title if len(description): embed.description = description if len(image): embed.set_image(url=image) i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help(bot, update):\n update.message.reply_text('INLINE Bot usage: \\n@cw_guildBot {itemName} {quantity} {\"w\" (optional, to withdraw)}. \\n\\nItem Name does not have to be full, 3 characters is enough.\\n\\\nSTANDARD Bot usage: \\nForward a list of items. Should support all inventories.\\n\\n\\\nRECIPE Bot...
[ "0.6719178", "0.6536742", "0.64336723", "0.6386392", "0.6377084", "0.6357246", "0.63069266", "0.628961", "0.62284493", "0.6174926", "0.6159291", "0.61266047", "0.6115538", "0.60681325", "0.60424", "0.5982124", "0.5970109", "0.59630936", "0.59225506", "0.5918371", "0.5864173",...
0.7016734
0
Limit the number of threads that tensorflow uses
def set_tf_threads(max_threads): logging.debug( f"Setting maximum number of threads for tensorflow " f"to: {max_threads}" ) # If statements are for testing. If tf is initialised, then setting these # parameters throws an error if tf.config.threading.get_inter_op_parallelism_threads(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def limit_mem():\n config = tf.compat.v1.ConfigProto()\n config.gpu_options.allow_growth = True\n tf.compat.v1.Session(config=config)", "def set_threadpool_size(nthreads):\n os.environ[\"OMP_THREAD_LIMIT\"] = \"0\" if nthreads is None else str(nthreads)", "def _nthreads_update(self):\n s...
[ "0.6850594", "0.6647036", "0.6522619", "0.63601977", "0.6346548", "0.6208902", "0.6208902", "0.6081324", "0.60729384", "0.60635835", "0.59945875", "0.59539783", "0.5943012", "0.5850685", "0.5842391", "0.5842391", "0.58177173", "0.58068174", "0.5804839", "0.57714105", "0.57663...
0.7105044
0
Set up command line options parsing for this command. This is a thin veneer over the standard python argparse system.
def setup_options_parser(self, argparser): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _configure_args(self, parser: ArgumentParser) -> ArgumentParser:\n pass", "def _parse_options(self, force_args=None):\r\n argv = sys.argv[1:] if force_args is None else force_args\r\n if argv and argv[0] in self._commands:\r\n self._command = argv.pop(0)\r\n else:\r\n self._command ...
[ "0.7511237", "0.74874425", "0.7414216", "0.7414216", "0.7410737", "0.74078274", "0.7377962", "0.73778355", "0.73614526", "0.7301722", "0.72967714", "0.7287651", "0.72554857", "0.7248063", "0.7229328", "0.7228236", "0.7184791", "0.7183107", "0.7167001", "0.71243024", "0.711141...
0.7847416
0
Add a predefined argument encapsulated an a CommandOption to an argument parser.
def add_option(self, argparser, option): if not isinstance(option, CommandOption): raise TypeError('Command option object must be an instance of CommandOption') option.add_to_parser(argparser)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_cmd_argument(self, parser, option, additional_args=None):\n call_args_iterable = []\n call_args_kw = {}\n\n if option in self.cmd_flags:\n call_args_iterable.append(self.cmd_flags[option])\n\n call_args_iterable.append(\"--\" + option.replace(\"_\", \"-\"))\n\n ...
[ "0.7840151", "0.76651084", "0.76448435", "0.7616392", "0.7594879", "0.7594879", "0.7594879", "0.7319586", "0.7264867", "0.7068795", "0.69799566", "0.69693106", "0.6962119", "0.6951967", "0.69393355", "0.68275636", "0.6813189", "0.67957664", "0.6787062", "0.67858386", "0.67848...
0.7875648
0
Add a noun to the application
def register_noun(self, noun): if not isinstance(noun, Noun): raise TypeError('register_noun requires a Noun argument') self.nouns[noun.name] = noun
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_nouns(self):\n pass", "def _register(self, noun):\n self.noun = noun", "def en_noun(t, label):\r\n s = label\r\n p = []\r\n is_uncountable = False\r\n \r\n # http://en.wiktionary.org/wiki/Template:en-noun\r\n head = t.arg(\"head\", label)\r\n p1 = t.arg(0)\r\n p2 = t....
[ "0.6998894", "0.6710522", "0.62055665", "0.5977623", "0.590643", "0.5904603", "0.5883224", "0.5838455", "0.57936335", "0.5783604", "0.56860274", "0.56185114", "0.5598344", "0.5575392", "0.55735624", "0.55385315", "0.55344594", "0.5510231", "0.5492999", "0.5461928", "0.545635"...
0.70893073
0
This method should overridden by applications to register the collection of nouns that they can manipulate.
def register_nouns(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _register(self, noun):\n self.noun = noun", "def register_noun(self, noun):\n if not isinstance(noun, Noun):\n raise TypeError('register_noun requires a Noun argument')\n self.nouns[noun.name] = noun", "def __init__(self):\n self._pronunciations = nltk.corpus.cmudict.dict()", "def __...
[ "0.7389275", "0.6601898", "0.60385823", "0.60385823", "0.57393056", "0.5673045", "0.5672765", "0.56336576", "0.5458025", "0.5398592", "0.534882", "0.5304194", "0.5287477", "0.52781624", "0.52525514", "0.5235023", "0.5222616", "0.51812667", "0.51586586", "0.5156525", "0.515652...
0.8067556
0
Work through the names and try each until an import works. Then return the imported file
def ImportTemplate(template_names): for file in template_names: try: return __import__(file) except ImportError: pass raise ImportError, 'No files matching %s' % template_names
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(path):\n try:\n print(\"Finding imports in '\" + path + \"':----------------------------------------------------------------------\")\n\n file = open(path)\n contents = file.read()\n wordArray = re.split(\" |\\n\", contents)\n\n currentList = list()\n nextPaths...
[ "0.6533865", "0.6324782", "0.6206031", "0.61587733", "0.6121556", "0.6116239", "0.609888", "0.60503715", "0.60235745", "0.60233784", "0.60171545", "0.5986509", "0.58965015", "0.58458287", "0.58213013", "0.5819519", "0.58107376", "0.5781196", "0.5765856", "0.5757625", "0.57109...
0.6416258
1
Mark all the occurrences of the selected element in the current editor. Does nothing if multiple lines are selected
def mark_selected(): (buffer, start, end) = get_selection_or_word() selection = buffer.get_chars(start, end) if selection != "": for m in buffer.file().search(selection, regexp=False): GPS.Locations.add("Local occurrences", m.file(), m.line(), m.column(), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_all(self, value=None):\n self.my_text.tag_add(SEL, \"1.0\", END)\n self.my_text.mark_set(INSERT, \"1.0\")\n self.my_text.see(INSERT)\n return \"break\"", "def setSelected(self,selected,flag=True):\n for s in selected:\n for i in self.input.findItems(s,QtCo...
[ "0.63191754", "0.61410964", "0.5956378", "0.5935511", "0.5911054", "0.5823281", "0.57763577", "0.57737356", "0.57064486", "0.567662", "0.56497586", "0.562902", "0.56011814", "0.55592614", "0.5529379", "0.5493877", "0.54735076", "0.5469762", "0.54574424", "0.5418509", "0.54027...
0.69987833
0
Given list (haystack), return index (0based) of needle in the list. Return None if needle is not in haystack. Do this with recursion. You MAY NOT USE A `for` OR `while` LOOP. >>> recursive_index("hey", ["hey", "there", "you"]) 0 >>> recursive_index("you", ["hey", "there", "you"]) 2 >>> recursive_index("porcupine", ["he...
def recursive_index(needle, haystack): def _recursive_index(needle, haystack, idx): if idx == len(haystack): return None if haystack[idx] == needle: return idx return _recursive_index(needle, haystack, idx + 1) return _recursive_index(needle, haystack, 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sublist_index(haystack, needle):\n try:\n for i in xrange(len(haystack)):\n if haystack[i:i+len(needle)] == needle:\n return i\n except IndexError:\n pass\n raise ValueError", "def recursive_search(needle, haystack, idx=0):\n\t# def _recursive_haystack(needle,...
[ "0.79988295", "0.798666", "0.6921343", "0.685409", "0.67765623", "0.66359234", "0.660139", "0.6568466", "0.6548577", "0.65209126", "0.65097624", "0.64091104", "0.6402255", "0.6356822", "0.635582", "0.6350336", "0.634753", "0.6303125", "0.6276631", "0.6260524", "0.62434167", ...
0.84310704
0
Get all device service environment variables belong to a device.
def get_all(self, uuid): # TODO: pine client for python device = self.device.get(uuid) query = '$expand=service_install($select=id&$expand=service($select=service_name))&$filter=service_install/any(d:d/device%20eq%20{device_id})'.format(device_id=device['id']) return self.base_request...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all(self, app_id):\n\n # TODO: pine client for python\n raw_query = '$expand=service&$filter=service/any(a:a/application%20eq%20{app_id})'.format(app_id=app_id)\n\n return self.base_request.request(\n 'service_environment_variable', 'GET', raw_query=raw_query,\n e...
[ "0.698396", "0.69057393", "0.67378324", "0.6524972", "0.65161204", "0.6436856", "0.64141154", "0.63695323", "0.6192777", "0.6178902", "0.61769253", "0.61769253", "0.61769253", "0.61769253", "0.61713564", "0.61617917", "0.61110985", "0.61005086", "0.6096511", "0.6073729", "0.6...
0.7255477
0
Create a device service environment variable.
def create(self, uuid, service_name, env_var_name, value): if not _is_valid_env_var_name(env_var_name): raise exceptions.InvalidParameter('env_var_name', env_var_name) device = self.device.get(uuid) services = self.service.get_all_by_application(device['belongs_to__application']['_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(self, app_id, service_name, env_var_name, value):\n\n if not _is_valid_env_var_name(env_var_name):\n raise exceptions.InvalidParameter('env_var_name', env_var_name)\n\n services = self.service.get_all_by_application(app_id)\n service_id = [i['id'] for i in services if i['...
[ "0.7080881", "0.58210903", "0.5781449", "0.5696847", "0.5630744", "0.55711883", "0.55197793", "0.55196947", "0.55170393", "0.5501449", "0.54916847", "0.54884464", "0.5443055", "0.5418768", "0.53341264", "0.5324137", "0.5318922", "0.53102875", "0.5290861", "0.52609044", "0.525...
0.73206615
0
Update a device service environment variable.
def update(self, var_id, value): params = { 'filter': 'id', 'eq': var_id } data = { 'value': value } return self.base_request.request( 'device_service_environment_variable', 'PATCH', params=params, data=data, endpoint=s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, var_id, value):\n\n params = {\n 'filter': 'id',\n 'eq': var_id\n }\n\n data = {\n 'value': value\n }\n return self.base_request.request(\n 'service_environment_variable', 'PATCH', params=params, data=data,\n ...
[ "0.6606159", "0.599133", "0.59818316", "0.58955914", "0.58414686", "0.5768071", "0.57426864", "0.57382643", "0.57327825", "0.57294923", "0.5686313", "0.56348914", "0.55821264", "0.55476487", "0.5529867", "0.5512303", "0.55068636", "0.550018", "0.5485609", "0.54825914", "0.539...
0.70265156
0
Remove a device service environment variable.
def remove(self, var_id): params = { 'filter': 'id', 'eq': var_id } return self.base_request.request( 'device_service_environment_variable', 'DELETE', params=params, endpoint=self.settings.get('pine_endpoint') )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove(self, var_id):\n\n params = {\n 'filter': 'id',\n 'eq': var_id\n }\n return self.base_request.request(\n 'service_environment_variable', 'DELETE', params=params,\n endpoint=self.settings.get('pine_endpoint')\n )", "def remove_from...
[ "0.6979745", "0.6737759", "0.6572298", "0.64809257", "0.6384845", "0.62839663", "0.6221949", "0.618343", "0.60965306", "0.6090989", "0.5994688", "0.59494185", "0.5899823", "0.589644", "0.58443296", "0.58338284", "0.58264995", "0.58099055", "0.57169294", "0.56838775", "0.56732...
0.72912127
0
Get all service environment variables by application.
def get_all(self, app_id): # TODO: pine client for python raw_query = '$expand=service&$filter=service/any(a:a/application%20eq%20{app_id})'.format(app_id=app_id) return self.base_request.request( 'service_environment_variable', 'GET', raw_query=raw_query, endpoint=self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_env_vars():\n env_vars = []\n leapp_vars = {k: v for (k, v) in os.environ.items() if k.startswith('LEAPP_') and k not in ENV_IGNORE}\n for k, v in leapp_vars.items():\n if k in ENV_MAPPING:\n env_vars.append(EnvVar(name=ENV_MAPPING.get(k), value=v))\n continue\n ...
[ "0.7233255", "0.7197941", "0.7095429", "0.70275605", "0.6895473", "0.6891972", "0.68501776", "0.681335", "0.67990285", "0.6788304", "0.6781381", "0.6687076", "0.66203666", "0.6556492", "0.6516397", "0.64852554", "0.64672554", "0.6442972", "0.64406425", "0.64251894", "0.642518...
0.7795718
0
Create a service environment variable for application.
def create(self, app_id, service_name, env_var_name, value): if not _is_valid_env_var_name(env_var_name): raise exceptions.InvalidParameter('env_var_name', env_var_name) services = self.service.get_all_by_application(app_id) service_id = [i['id'] for i in services if i['service_nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(self, uuid, service_name, env_var_name, value):\n\n if not _is_valid_env_var_name(env_var_name):\n raise exceptions.InvalidParameter('env_var_name', env_var_name)\n\n device = self.device.get(uuid)\n services = self.service.get_all_by_application(device['belongs_to__appli...
[ "0.6884571", "0.6270155", "0.6261813", "0.6115298", "0.61134404", "0.60932976", "0.6023313", "0.5950902", "0.5937343", "0.5906065", "0.5808611", "0.57617074", "0.57569134", "0.5748051", "0.5744858", "0.5697486", "0.5694638", "0.56873965", "0.5679055", "0.56673265", "0.5663867...
0.74748325
0
Remove service environment variable.
def remove(self, var_id): params = { 'filter': 'id', 'eq': var_id } return self.base_request.request( 'service_environment_variable', 'DELETE', params=params, endpoint=self.settings.get('pine_endpoint') )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove(self, var_id):\n\n params = {\n 'filter': 'id',\n 'eq': var_id\n }\n return self.base_request.request(\n 'device_service_environment_variable', 'DELETE', params=params,\n endpoint=self.settings.get('pine_endpoint')\n )", "def unse...
[ "0.6977199", "0.6918208", "0.6851269", "0.6726585", "0.6677691", "0.6677637", "0.66718024", "0.66209507", "0.65889", "0.6585265", "0.65642446", "0.64869845", "0.6343105", "0.63220453", "0.6312625", "0.6278392", "0.6269831", "0.62206256", "0.61970735", "0.619252", "0.6170912",...
0.7006552
0
Helper to get index of mask symbol
def mask(self): return self.mask_index
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mask_index(self) -> int:\n return self._mask_index", "def get_mask_offset(mask):\n # use ctypes to truncate the result to a uint32\n cmask = ctypes.c_uint32(mask).value\n return _bruijn32lookup[ctypes.c_uint32((mask & -mask) * 0x077cb531).value >> 27]", "def masked_indices(mask):\n\treturn ...
[ "0.72293586", "0.6837368", "0.6762879", "0.67113274", "0.6692028", "0.6592247", "0.64968973", "0.6492754", "0.6403551", "0.639479", "0.63687974", "0.6277145", "0.62549794", "0.6074687", "0.5991651", "0.59873", "0.59430873", "0.59256536", "0.59164894", "0.5886499", "0.586483",...
0.7232013
0
Helper to get index of sep symbol
def sep(self): return self.sep_index
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sep_token(self):\r\n if self._sep_token is None:\r\n logger.error(\"Using sep_token, but it is not set yet.\")\r\n return self._sep_token", "def bert_segment(tokenized_text):\n segment1 = [1 if token==\"[SEP]\" else 0 for token in tokenized_text]\n \n try:\n index_sep...
[ "0.6764064", "0.6350212", "0.6325993", "0.6168787", "0.6099411", "0.60260916", "0.60068893", "0.595629", "0.5856122", "0.5838009", "0.5816947", "0.5810747", "0.5802137", "0.5796213", "0.5729994", "0.57297814", "0.5729535", "0.5718788", "0.5706098", "0.5674636", "0.5607406", ...
0.8004647
0
Pull all posts (or comments) sequentially. Note that if iterating chronologically and both max and last are unset, then this command will run forever (as it will iterate through all post IDs to infinity). To prevent this, either specify a max, last post, or iterate reverse chronologically. Posts will be pulled in paral...
def all( first=None, last=None, max: int = None, rev=False, type: str = None, workers: int = None, ): for post in client.all( first=first, last=last, max=max, order="down" if rev else "up", type=type, workers=workers, ): print(json....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iter_all_posts(self, limit=None): # new\n feed = self.get_feed(limit=999999)\n posts = feed[\"threads\"]\n if limit:\n posts = posts[:limit]\n for post in posts:\n yield post", "def generatePosts(self,**kwargs):\n oldestTimeSoFar = None\n while...
[ "0.6920313", "0.6454344", "0.6331133", "0.61324865", "0.61295", "0.6045683", "0.59445524", "0.5884818", "0.5801078", "0.57502604", "0.5562261", "0.55193686", "0.55052656", "0.55019283", "0.5424425", "0.5421811", "0.541817", "0.53748715", "0.53735995", "0.5349646", "0.5344782"...
0.6618107
1
cmd here is the folder name result = sequence_pattern_mining.multi_node_find_common_block_list (cmd) common_block_list = result[0] private_block_list = result[1] sequence_pattern_mining.multi_node_block_report_split(common_block_list, private_block_list, cmd) this is for generate files don't have critical path sequence...
def main (cmd): ################################################################# #step 1: generate common block list report from block list folder ################################################################# #step 2: folder read learning list record_sequences = sequence_pattern_mining.multi_file_folder_sequence_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __createScanSeparationCommands(self):\n \n scanList = self.__selectionScanList\n if scanList is None:\n self.__selectMS()\n scanList = self.__getScanList()\n\n # Make sure we have enough scans to create the needed number of\n # subMSs. If not change the ...
[ "0.5825766", "0.548982", "0.542967", "0.53923863", "0.5365777", "0.5346966", "0.5337053", "0.53367096", "0.5276408", "0.5123727", "0.5113483", "0.50874764", "0.5075888", "0.507028", "0.5039172", "0.5028466", "0.5020005", "0.50110745", "0.50096345", "0.5008478", "0.4970839", ...
0.7609724
0
computes the efficiency under each flavour assumption and then matches it
def efficiency_(self, pt, eta, flav): eff_l = self.eff_["UDSG"](pt, eta) eff_c = self.eff_["C"](pt, eta) eff_b = self.eff_["B"](pt, eta) return self.match_flav_(eff_l, eff_c, eff_b, flav)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def PredictMatch(yourName, tgtName, teamModels, db):\n\n teamTgtPipe, teamYourPipe = QueryTeamData(tgtName, yourName, db)\n featureCoefTgt, probTgt = PredictOp(teamTgtPipe, teamYourPipe, tgtName, teamModels)\n featureCoefYour, probYour = PredictOp(teamYourPipe, teamTgtPipe, yourName, teamModels)\n odds...
[ "0.6128501", "0.6039652", "0.58141357", "0.57357275", "0.57351625", "0.5678702", "0.5660845", "0.56430316", "0.5613134", "0.55779845", "0.5566902", "0.55442697", "0.55323637", "0.55307174", "0.552211", "0.5501799", "0.54899967", "0.54777837", "0.5466284", "0.542433", "0.54204...
0.7130797
0
Initalizes the Brancher based on the given node class and path. The node class provided may be a class, the name of a registered class, or a callable that resolves to a class. The path provided will be used to instantiate the node with, and determines the resource_path as returned by Pyramid utility functions. By defau...
def __init__(self, node_cls, path, predicate=None): self._node_cls = node_cls self._path = path self._predicate = predicate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_instantiate_branch_node(self):\n try:\n BranchNode('my_name')\n except Exception:\n message = \"BranchNode instantiation failed\"\n self.fail(message)", "def __init__(self, klass = BSTNode):\n self.root = None\n self.klass = klass", "def __i...
[ "0.5479607", "0.4982799", "0.4982799", "0.4836217", "0.4812751", "0.4788734", "0.47619587", "0.47556716", "0.47324947", "0.4719775", "0.47058964", "0.4684831", "0.46767572", "0.46720916", "0.46431345", "0.46337295", "0.46296218", "0.4602868", "0.4583876", "0.45826542", "0.456...
0.6080518
0
Returns a resolved and instantiated node, with the given parent.
def __call__(self, parent): if self._predicate is not None and not self._predicate(parent): raise KeyError(parent) return self.node_cls(self._path, parent)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_node(self, name, parent):\n\n try:\n node = self.map[name]\n return node\n except:\n node = Node(name,parent=parent.name)\n parent.children.add(node)\n\n node.parent = parent.name\n\n self.map[name] = node\n\n ret...
[ "0.7156331", "0.65806234", "0.6384379", "0.6285393", "0.62222946", "0.61602956", "0.6068568", "0.6056505", "0.5990497", "0.5971292", "0.5910996", "0.587202", "0.5843894", "0.58336693", "0.5818131", "0.5790982", "0.578617", "0.5758865", "0.5758865", "0.5758865", "0.57246095", ...
0.66556
1
Returns a newly instantiated child resource. The resource class can be either the class itself, the name of a Node subclass, or a function returning the resource class. Additional named parameters are passed verbatim to the new instance.
def _child(self, resource_class, path, **attrs): resource_class = resolve_resource(resource_class) return resource_class(path, self, **attrs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def child(self, *ns, **kwargs):\n cls = kwargs.get('cls')\n if not cls:\n cls = self.__class__\n return cls(self.db, self.path + ns, self.serializer)", "def new(self, *args, label = None, **kwargs):\n\n\t\tif (label is None):\n\t\t\tlabel = self.getUnique(self.child_uniqueName)\n\...
[ "0.6635146", "0.6230453", "0.6053202", "0.58591676", "0.58034587", "0.57910943", "0.5782905", "0.5729254", "0.5678438", "0.5671725", "0.56612444", "0.5628244", "0.5517565", "0.550926", "0.5501725", "0.5477254", "0.54654866", "0.54433084", "0.54392594", "0.54271096", "0.541716...
0.7955053
0
Initialize the Root resource and have the request stored.
def __init__(self, request): super(Root, self).__init__(None, None, request=request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, root):\n self._root = root\n if not self.get_resources():\n raise Exception('Your application has no Resource.')", "def __init__(__self__, *,\n root: str):\n pulumi.set(__self__, \"root\", root)", "def __init__(self):\n super(Resource, s...
[ "0.7050567", "0.67712176", "0.66220516", "0.6596281", "0.6596281", "0.6596281", "0.64516664", "0.6373841", "0.63502556", "0.63427985", "0.6333107", "0.6333107", "0.6333107", "0.6333107", "0.6289209", "0.6278197", "0.6270498", "0.62674856", "0.6264869", "0.6254503", "0.6254503...
0.7778276
0
Create an iterator over the tfrecord dataset. Since the tfrecords file stores each example as bytes, we can define an iterator over `datum_bytes_view`, which is a memoryview object referencing the bytes.
def tfrecord_iterator( data_path: str, index_path: typing.Optional[str] = None, shard: typing.Optional[typing.Tuple[int, int]] = None, compression_type: typing.Optional[str] = None, ) -> typing.Iterable[memoryview]: if compression_type == "gzip": file = gzip.open(data_path, "rb") elif co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dataset_tfrecords(self, device_idx = 0):\n tf_records = os.path.join(self._data_dir, self._data_file)\n f_metadata = open(tf_records + '.metadata', 'r', encoding= 'utf-8')\n metadata = json.load(f_metadata)\n img_shape = metadata['img_shape']\n dtype = 'tf.' + metadata['d_type']\n f_metad...
[ "0.69094145", "0.67570007", "0.6682144", "0.6191846", "0.6187676", "0.601417", "0.6000778", "0.5937987", "0.58323973", "0.58146876", "0.5810697", "0.57928514", "0.57801765", "0.5763684", "0.5757522", "0.5757522", "0.5714924", "0.56926906", "0.56676704", "0.56664306", "0.56468...
0.6886264
1
Create an iterator over the (decoded) sequence examples contained within the dataset. Decodes raw bytes of both the context and features (contained within the dataset) into its respective format.
def sequence_loader( data_path: str, index_path: typing.Union[str, None], context_description: typing.Union[ typing.List[str], typing.Dict[str, str], None ] = None, features_description: typing.Union[ typing.List[str], typing.Dict[str, str], None ] = None, shard: typing.Optio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def batch_generator(data_frame_encoded):\n labels = data_frame_encoded[-1]\n # data = np.delete(data_frame_encoded, -1, axis=0)\n data = data_frame_encoded[:-1]\n\n num_features = len(data)\n num_batches = len(data[0])\n for i in range(num_batches):\n batch_compiled = []\n for j in ...
[ "0.6044404", "0.59755707", "0.5899801", "0.57593995", "0.57008106", "0.56998354", "0.5697429", "0.56441075", "0.56270367", "0.55541223", "0.55492157", "0.5544441", "0.55442137", "0.55414355", "0.5475469", "0.547185", "0.54378474", "0.54376274", "0.54367304", "0.54286814", "0....
0.68487793
0
Invites a user (with user id u_id) to join a channel with ID channel_id. Once invited the user is added to the channel immediately.
def channel_invite(token, channel_id, u_id): authorised_u_id = get_id_from_token(token) channel = channels.get(channel_id) user_to_invite = users.get(u_id) if user_to_invite is None: raise ValueError("u_id does not exist.") if channel is None: raise ValueError("channel_id does not ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def channel_invite(token, channel_id, u_id):\n\n if database.get_current_user(token) not in database.get_channel_data(channel_id)['member_ids']:\n raise error.AccessError(description=\"\"\"Authorised user is not\n a member of channel with that channel_id.\"\"\")\n if u_i...
[ "0.7468389", "0.7090754", "0.70301825", "0.6934161", "0.67781514", "0.66453516", "0.65499234", "0.6341358", "0.6325097", "0.63246214", "0.6277067", "0.62748826", "0.62020797", "0.6170533", "0.6148888", "0.6144115", "0.61437047", "0.61008435", "0.60604703", "0.6031113", "0.597...
0.76299024
0
Given a Channel with ID channel_id that the authorised user is part of, provide basic details about the channel.
def channel_details(token, channel_id): authorised_u_id = get_id_from_token(token) channel = channels.get(channel_id) if channel is None: raise ValueError("channel_id does not exist.") if authorised_u_id not in channel["all_members"]: raise AccessError("The authorised user is not a membe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_channel(self, channel_id):\n uri = 'channels/' + channel_id\n return self.make_request(uri)", "def get_channel(channel_id):\r\n if channel_id[0] == 'C':\r\n type = \"channel\"\r\n elif channel_id[0] == 'G':\r\n type = \"group\"\r\n elif channel_id[0] == 'D':\r\n return...
[ "0.7609575", "0.74058217", "0.728915", "0.7203651", "0.7149683", "0.6848519", "0.660643", "0.64049673", "0.6400629", "0.6316773", "0.6303422", "0.624225", "0.62405163", "0.62110144", "0.6168201", "0.6115033", "0.61144984", "0.6086483", "0.607149", "0.60645163", "0.6056379", ...
0.7680852
0
Given a Channel with ID channel_id that the authorised user is part of, return up to 50 messages between index "start" and "start + 50". Message with index 0 is the most recent message in the channel. This function returns a new index "end" which is the value of "start + 50", or, if this function has returned the least...
def channel_messages(token, channel_id, start=0): auth_u_id = get_id_from_token(token) channel = channels.get(channel_id) if channel is None: raise ValueError("channel_id does not exist.") if auth_u_id not in channel["all_members"]: raise AccessError("The authorised user is not a member ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def channel_messages(token, channel_id, start):\n # Check if token is valid and raise AccessError if not\n curr_id = database.get_current_user(token)\n\n # check if user is a member of channel with channel_ID and return AccessError if not\n if is_user_channel_member(channel_id, curr_id) is False:\n ...
[ "0.78263974", "0.62706405", "0.5857934", "0.55596393", "0.5540831", "0.5310063", "0.5270172", "0.5115406", "0.5032543", "0.49978992", "0.49759844", "0.4972112", "0.49583548", "0.49524242", "0.49343896", "0.49156797", "0.49072897", "0.4892488", "0.4882593", "0.48823035", "0.48...
0.7094033
1
Make user with user id u_id an owner of this channel.
def channel_addowner(token, channel_id, u_id): auth_u_id = get_id_from_token(token) channel = channels.get(channel_id) if channel is None: raise ValueError("channel_id does not exist.") if u_id in channel["owners"]: raise ValueError("user is already an owner") user = users.get(auth_u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def channel_addowner(token, channel_id, u_id):\n # Check if token is valid and raise AccessError if not\n curr_id = database.get_current_user(token)\n # gets current channel data\n curr_channel = database.get_channel_data(channel_id)\n # gets the permissions of current user from database\n user_p...
[ "0.70757926", "0.66383916", "0.62191343", "0.62124354", "0.61835265", "0.6022658", "0.6004127", "0.59890777", "0.59763783", "0.58852845", "0.5843609", "0.5758281", "0.5756693", "0.57209295", "0.57168055", "0.56534123", "0.56359696", "0.56195617", "0.5602514", "0.557859", "0.5...
0.7193164
0
Remove user with user id u_id an owner of this channel.
def channel_removeowner(token, channel_id, u_id): auth_u_id = get_id_from_token(token) channel = channels.get(channel_id) if channel is None: raise ValueError("channel_id does not exist.") if u_id not in channel["owners"]: raise ValueError("user is not an owner") user = users.get(aut...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def channel_removeowner(token, channel_id, u_id):\n # Check if token is valid and raise AccessError if not\n curr_id = database.get_current_user(token)\n # gets current channel data\n curr_channel = database.get_channel_data(channel_id)\n # gets the permissions of current user from database\n use...
[ "0.76164097", "0.6929122", "0.67075187", "0.6642432", "0.65694135", "0.64286476", "0.64085627", "0.6403723", "0.6347358", "0.62856716", "0.6185172", "0.6165116", "0.6142113", "0.6141271", "0.6099282", "0.6092048", "0.60905784", "0.60726494", "0.6026507", "0.59890443", "0.5973...
0.7573506
1
Provide a list of all channels (and their associated details).
def channels_listall(token): channels_results = channels.list() channels_list = [] for channel in channels_results: channels_list.append( {"channel_id": channel["channel_id"], "name": channel["name"]} ) return {"channels": channels_list}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _channels_list(self):\n result = self.slack.api_call(\"channels.list\")\n\n if not result.get(\"ok\"):\n logging.error(result['error'])\n return None\n\n return result['channels']", "async def list_channel(self, ctx: MyContext):\n channels = self.db_get_chann...
[ "0.79754615", "0.7814258", "0.7767914", "0.7748087", "0.77039653", "0.7626012", "0.75495464", "0.7494919", "0.74907523", "0.7489729", "0.7471811", "0.7470754", "0.74436677", "0.74315417", "0.74263823", "0.7425489", "0.7419675", "0.73452306", "0.7272016", "0.7260493", "0.72176...
0.7876283
1
Creates a new channel with that name that is either a public or private channel.
def channels_create(token, name, is_public): auth_u_id = get_id_from_token(token) if len(name) > 20: raise ValueError("") channel_payload = { "name": name, "all_members": [auth_u_id], "owners": [auth_u_id], "is_public": is_public, "is_standup_active": False, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def create_channel(self, name: str) -> Channel:\n async with self.session.post(\n \"https://chat-gateway.veld.dev/api/v1/channels\",\n json={\"name\": name},\n headers={\"Authorization\": f\"Bearer {self.token}\"},\n ) as req:\n if req.status != 200:\...
[ "0.78153706", "0.7582131", "0.74050355", "0.7132342", "0.7032659", "0.69989395", "0.68656874", "0.68048215", "0.68005085", "0.6673997", "0.66442436", "0.6565384", "0.65186876", "0.649319", "0.64929056", "0.6409701", "0.6382764", "0.6369702", "0.63172764", "0.6258845", "0.6253...
0.7810719
1
Initializes new instance of the LinksComponent class
def __init__(self, source=None): super().__init__(self.COMPONENT_NAME) self.__links = {} self.__source = source
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, link):\n self.__link = link", "def __init__(self, name, links):\n self.name = name\n self.links = links", "def __init__(self, links: Sequence[Link]) -> None:\n self._links = [] # type: Sequence[Link]\n self._optimization_mask = [False] * len(links)\n\n ...
[ "0.719031", "0.7073813", "0.69251436", "0.6613829", "0.66023636", "0.64799714", "0.6467385", "0.6434091", "0.64286304", "0.6361647", "0.6361647", "0.63607186", "0.63348085", "0.6307935", "0.6307935", "0.6307935", "0.6307935", "0.6307935", "0.6307935", "0.6307935", "0.6307935"...
0.71773696
1
Returns count of links
def count(self): return len(self.__links)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_links(self):\n return self._num_links", "def len(self):\n start = self.head\n count = 0\n while start:\n count+=1\n start = start.getLink()\n return count", "def find_link(self):\n links = self.driver.find_elements_by_tag_name(\"a\")\n ...
[ "0.83188295", "0.785304", "0.7777075", "0.77655935", "0.7709568", "0.76815367", "0.7665212", "0.76635534", "0.7625359", "0.74393237", "0.73509204", "0.7336454", "0.73275125", "0.7205426", "0.7166634", "0.6974105", "0.69616115", "0.6946381", "0.6782554", "0.6758381", "0.673290...
0.8691984
0