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
Azimuth in DD (decimal degrees) format validation.
def validate_azm_dd(a): if REGEX_AZM_DD.match(a): is_valid = VALID else: is_valid = NOT_VALID return is_valid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkAltAz ( rawAltAz ):\n #-- 1 --\n # [ if rawAltAz contains either a '+' or a '-' ->\n # m := a re.match instance describing the first matching\n # character\n # else ->\n # sys.stderr +:= error message\n # stop execution ]\n m = SIGN_PAT.search ( rawAl...
[ "0.65725535", "0.5832522", "0.5805457", "0.57412726", "0.5735171", "0.5672594", "0.56711775", "0.5633739", "0.56279016", "0.55926555", "0.5545153", "0.5520772", "0.5499564", "0.54983383", "0.5493291", "0.54628223", "0.53977174", "0.5384473", "0.5372744", "0.5369902", "0.53441...
0.62599325
1
Magnetic variation validation. Format decimal degrees with E or W prefix (easter or western magnetic variation)
def validate_magvar(mv): result = VALID mag_var = None try: mag_var = float(mv) if (mag_var > 360) or (mag_var < -360): result = NOT_VALID except ValueError: try: prefix = mv[0] if REGEX_MAGVAR_DD.match(mv[1:]): # Check if there are only number...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testCalspecMags(self):\n std = MKIDStd.MKIDStd()\n bFilter = std.filters['B']\n vFilter = std.filters['V']\n\n # BD17\n bd17Flux = std.load(\"bd17\")\n B = std.getVegaMag(bd17Flux, bFilter)\n V = std.getVegaMag(bd17Flux, vFilter)\n self.assertAlmostEqual(...
[ "0.6224968", "0.60714537", "0.6064959", "0.60200757", "0.60145694", "0.5896334", "0.5814267", "0.5782454", "0.5778193", "0.5773811", "0.56517756", "0.55824465", "0.5580473", "0.555041", "0.555041", "0.5545234", "0.55397755", "0.55223715", "0.54866207", "0.5440148", "0.5432536...
0.66408545
0
Creates temprary layer name, from current datie
def tmp_layer_name(): curr_time = datetime.datetime.now() tmp_lyr_name = str(curr_time).replace('-', '') tmp_lyr_name = tmp_lyr_name.replace(':','') tmp_lyr_name = tmp_lyr_name.replace(' ', '_') tmp_lyr_name = tmp_lyr_name[:15] return tmp_lyr_name + '_tmp_memory'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_layer_name(self, layer):\n label = '{}-{}'.format(layer.label, layer.rank)\n if label not in self.naming_map:\n self.naming_map[label] = {}\n\n if layer not in self.naming_map[label].keys():\n self.naming_map[label][layer] = len(self.naming_map[label]) + 1\n ...
[ "0.65522903", "0.6454748", "0.64497757", "0.6411795", "0.64012676", "0.63176304", "0.62226367", "0.61490446", "0.6055188", "0.59703803", "0.5958316", "0.5849348", "0.5835588", "0.58297", "0.58277553", "0.5794272", "0.5777519", "0.57633513", "0.5748867", "0.572543", "0.5639063...
0.72437567
0
Select output csv file
def select_output_file(self): output_file = QFileDialog.getSaveFileName(self.dlg, "Select output file ", "", '*.csv') self.dlg.leOutCsv.setText(output_file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_csv(self):\n outputfile = tkinter.filedialog.asksaveasfilename(\n defaultextension=\".csv\",\n filetypes=((\"comma seperated values\", \"*.csv\"),\n (\"All Files\", \"*.*\")))\n if outputfile:\n tabledata = self.tabs.window.aistracker....
[ "0.7275462", "0.6781139", "0.66611564", "0.6605735", "0.65933424", "0.6562594", "0.6442843", "0.64320594", "0.6408648", "0.63245755", "0.62903845", "0.62317413", "0.62267977", "0.6220033", "0.6213078", "0.620042", "0.6174863", "0.61640847", "0.6160434", "0.61497813", "0.61496...
0.7275964
0
Asks the Azure Face API to detect faces from a file. It more specifically asks for the emotion_attribute. It also asks Azure to use 'recognition_02' model which is a little bit more accurate than 'recognition_01' (default).
def request(): return face_client.face.detect_with_stream(image=open("frame.png", 'rb'), return_face_attributes=[emotion_attribute], recognition_model='recognition_02')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def detect_face(face_file, max_results=4):\n image_content = face_file.read()\n batch_request = [{\n 'image': {\n 'content': base64.b64encode(image_content).decode('utf-8')\n },\n 'features': [{\n 'type': 'FACE_DETECTION',\n 'maxResults': max_re...
[ "0.70216525", "0.66169727", "0.6613031", "0.6373871", "0.6334004", "0.62129205", "0.619253", "0.613904", "0.6095122", "0.6089204", "0.59748024", "0.5890032", "0.58845556", "0.5798849", "0.5774772", "0.5732005", "0.56989664", "0.56987834", "0.5698466", "0.5687578", "0.5671011"...
0.7085617
0
Looks into the response of Azure and compiles an easytoread dictionary of emotion values for the first detected face.
def get_emotion(detected_faces): result = {} for face in detected_faces: emotions = face.face_attributes.emotion result[face.face_id] = {'anger': emotions.anger, 'contempt': emotions.contempt, 'disgust': emotions.disgust, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request():\n return face_client.face.detect_with_stream(image=open(\"frame.png\", 'rb'),\n return_face_attributes=[emotion_attribute],\n recognition_model='recognition_02')", "def predict(self, face):\r\n # ...
[ "0.6500252", "0.60568655", "0.5718272", "0.570259", "0.56329", "0.5624102", "0.5542544", "0.55339795", "0.552066", "0.5511222", "0.55075353", "0.5460417", "0.54255056", "0.5361626", "0.53300476", "0.5326978", "0.5318767", "0.5302779", "0.52869296", "0.5283752", "0.5283752", ...
0.67391
0
Returns the ship count of all Fleet objects in this set
def ship_count(self): return sum(f.ship_count for f in self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_active_ships_count(self):\n active_ship_count = 0\n for row_index in range(self.rows):\n for column_index in range(self.columns):\n cell = self.grid[row_index][column_index]\n if cell.has_active_ship():\n active_ship_count += 1\n\n ...
[ "0.7439754", "0.7292249", "0.6891802", "0.6331213", "0.6320823", "0.6243501", "0.61365724", "0.6089166", "0.6058078", "0.60143656", "0.60038716", "0.6002114", "0.60006964", "0.5988058", "0.5968548", "0.59447414", "0.5932767", "0.5919404", "0.5915653", "0.5890712", "0.5857965"...
0.88019377
0
Returns an iterator that yields tuples of (turns_to_wait, Attacks) for all Subfleets that arrive in this many turns in ascending order (use reverse=True for descending).
def arrivals(self, reverse=False): turn_getter = attrgetter("turns_to_wait") for k, attacks in groupby(sorted(self, key=turn_getter, reverse=reverse), turn_getter): yield (k, Attacks(attacks))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def available_moves(self):\n\n heaps = range(len(self.heaps))\n return [(h, take) for h in range(len(self.heaps))\n for take in range(1, self.heaps[h] + 1)]", "def _get_children(self) -> Sequence[\"HallwayState\"]:\n if self.cur_pos < self.end_pos:\n if se...
[ "0.5195459", "0.5156163", "0.5128677", "0.51036954", "0.5094777", "0.50646555", "0.5048493", "0.5037157", "0.5025919", "0.49986604", "0.4967178", "0.49644658", "0.4949757", "0.4949631", "0.49480528", "0.4945935", "0.4902823", "0.49011064", "0.4890652", "0.4874848", "0.4856353...
0.7062301
0
draw sky on screen
def draw_sky(self): win.blit(self.sky, (0, 0))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw(self):\n\n surf = self.get_oxygen_surface()\n surf.set_alpha(255)\n self.screen.blit(surf, self.pos)", "def draw():\n screen.fill((0, 0, 0))\n alien.draw()", "def draw():", "def draw_environment():\n rect(screen, LIGHT_GRAY, (0, 0, 800, 450)) # grey sky\n rect(screen,...
[ "0.7317279", "0.7185691", "0.7096785", "0.706331", "0.7061475", "0.6913213", "0.68679565", "0.680892", "0.67900133", "0.6760028", "0.67510056", "0.67199045", "0.6709187", "0.66909724", "0.6651719", "0.6638934", "0.66279453", "0.66244906", "0.65821725", "0.6575303", "0.6527863...
0.853518
0
draw ground on screen
def draw_ground(self): win.blit(self.ground, (0, 400))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_ground():\n for i in range(3):\n groundturtle.forward(1450)\n groundturtle.left(90)\n groundturtle.forward(25)\n groundturtle.left(90)\n groundturtle.forward(1450)\n groundturtle.right(90)\n groundturtle.forward(25)\n ...
[ "0.7634187", "0.72167027", "0.71854854", "0.71728796", "0.7116057", "0.7026043", "0.70170915", "0.698256", "0.69724965", "0.6947137", "0.69152075", "0.6908207", "0.690745", "0.6899846", "0.68936545", "0.686858", "0.68661445", "0.6832472", "0.678626", "0.67738503", "0.6763737"...
0.8539729
0
show user's current score
def scorer(self, current_score): text = self.field.render("Score: " + str(current_score // 2), True, BLACK_COLOUR) win.blit(text, (0, 0))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disp_score():", "def print_scores(self):\n print(\"scores: \", self.get_scores())", "def update_score(self, engine, *args):\n #pdb.set_trace()\n self.score_label.text = \"Gold: {}/{}\".format(str(engine.score),\n str(engine.win_score)...
[ "0.77043575", "0.72004783", "0.71493894", "0.706976", "0.70139277", "0.700324", "0.6931816", "0.6891288", "0.6878507", "0.68636274", "0.6858917", "0.68321425", "0.68244326", "0.67983705", "0.6768852", "0.6762979", "0.6762979", "0.6762979", "0.6751136", "0.6742192", "0.6715541...
0.73849154
1
Override the replay prefix
def set_replay_path(self, replay_folder, replay_prefix): self.replay_prefix = replay_prefix self.replay_folder = replay_folder
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_prefix(self) -> str:", "def prefix(self, prefix):\n\n self._prefix = prefix", "def prefix(self, prefix):\n\n self._prefix = prefix", "def replay():\n roku_master.replay()", "def pause_review(self, prefix: Nibbles) -> None:\n self._active_prefixes.add(prefix)", "def tes...
[ "0.63496584", "0.6304424", "0.6304424", "0.62225986", "0.62107915", "0.6182443", "0.61162794", "0.59398854", "0.5909899", "0.5886368", "0.5860298", "0.58344734", "0.5813779", "0.57819796", "0.57819796", "0.57819796", "0.5765664", "0.57609695", "0.5745051", "0.5745051", "0.572...
0.666854
0
Gets the items of this InlineResponse200.
def items(self) -> List[InlineResponse200Items]: return self._items
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_items_from_response(self, response):\n raise NotImplementedError", "def get_items(self):\n return self.items", "def get_items(self):\n return self.item_list", "def get_items(self):\n return (item for item in self.items)", "def get_items():\n return requester.perform_r...
[ "0.7298296", "0.682365", "0.6715298", "0.6598859", "0.6588794", "0.65261364", "0.64762795", "0.6466019", "0.64575994", "0.6452882", "0.6352481", "0.63157487", "0.63157487", "0.6306265", "0.62805", "0.62279594", "0.60577524", "0.60419965", "0.60099256", "0.60069144", "0.600654...
0.8648576
0
Sets the items of this InlineResponse200.
def items(self, items: List[InlineResponse200Items]): if items is None: raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 self._items = items
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, items: List[InlineResponse200Items]=None): # noqa: E501\n self.swagger_types = {\n 'items': List[InlineResponse200Items]\n }\n\n self.attribute_map = {\n 'items': 'items'\n }\n self._items = items", "def items(self) -> List[InlineRespon...
[ "0.7157411", "0.64879584", "0.5950706", "0.5830931", "0.5624914", "0.55170625", "0.5450405", "0.54015255", "0.54010475", "0.5339431", "0.53360486", "0.53321445", "0.5307274", "0.5307274", "0.5305917", "0.52636474", "0.52428657", "0.5224288", "0.52015966", "0.5196767", "0.5181...
0.6958488
1
shifts data so as to minimize distance in latitude. Lets B be stationary while index shifting A and C forward so that A[t] > A[t t_BA] B[t] > B[t] C[t] > C[t t_BC]
def shifter(self): #self.BA_shift = self.timeshift_latitude(self.latB, self.latA) #self.BC_shift = self.timeshift_latitude(self.latB, self.latC) self.shifted = True #changing boolean to True when function is called. secondsA = self.secondsA secondsB = self.secondsB sec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def minimizeTimes(self):\n from copy import deepcopy as dcp\n tmin = self.get_tmin()\n for t in self.srcData: \n old = dcp(self.srcData[t])\n new_t = t - tmin\n self.outData[new_t] = old", "def topsort_lat(lat, random_shift=False, max_state=None):\n\n ...
[ "0.54937327", "0.5475339", "0.53958184", "0.5358197", "0.51967794", "0.5139213", "0.51332134", "0.512268", "0.5112759", "0.5105039", "0.5103316", "0.50753844", "0.5063595", "0.50197667", "0.5012734", "0.49768087", "0.4920332", "0.4919076", "0.4918012", "0.49093962", "0.490306...
0.64903045
0
plots an example of index shifting
def index_shift_plot(): file = "Data/matfiles/20131221.mat" object = MatReader(file) thing = object.shifted == False assert thing, "shifter must be commented out" start = 1920 #index of 16 minutes stop = 3120 #index of 26 minutes NeA = object.NeA[start:stop] NeB = object.NeB[st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refractive_index(self):\n wd = np.arange(80,820,10)\n nd = self.boundary.imat.refractive_index(wd) \n\n plt.plot(wd, nd)\n\n return wd, nd", "def plotOfSlice(self,index=0):\n\t\tj=index;\n\t\t[n,m]=_np.shape(self._data)\n\t\ty=_np.zeros(n);\n\t\tfor i in range(0,n):\n\t\t\t\ty[i]...
[ "0.62381613", "0.6047222", "0.58126885", "0.576814", "0.57115436", "0.5666652", "0.56549144", "0.5643994", "0.56199855", "0.56148964", "0.5598178", "0.5544485", "0.5536026", "0.55217725", "0.5493668", "0.54794174", "0.5448919", "0.5438047", "0.5414845", "0.5381245", "0.535502...
0.6937431
0
Generate markdown for checklist
def _markdown(checklist): checklist = json.load(open(checklist), object_pairs_hook=OrderedDict) mdFile = MdUtils(file_name='Ikigai-Checklist', title='PDP 2019 Checklist') mdFile.new_paragraph(checklist['overview']) sections = sorted(checklist['checklist'].values(), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checklist_line(line, day, checklist):\n\n output_lines = f'<b>Checklist items due before class on {day}</b>'\n output_lines += f'<ul class=\"checklist\" id=\"check-list-{day}\">'\n for item in line[2:].split(' | '):\n item = item.strip()\n item_without_markdown_link = re.sub(r\"\\[(.+)\\]\\(.+\...
[ "0.6669581", "0.6598202", "0.65573514", "0.65129644", "0.6231226", "0.62290126", "0.6188656", "0.6103123", "0.60594684", "0.6040152", "0.60326", "0.5967212", "0.5893543", "0.57857776", "0.5730832", "0.56839097", "0.5666371", "0.5651796", "0.565042", "0.5640402", "0.56363374",...
0.8231156
0
beam search for better preds (not alignment) with MAP. We add length penalty to overcome poor precision, one error predict within the boundry will bring two edit errors.
def beam_search_MAP(logits, beam_size=20, lp=50.0): inf = 1e10 distribution = tf.nn.softmax(logits) B, T, V = distribution.shape aligns = tf.zeros([B * beam_size, 0], tf.int32) scores = tf.constant([0.0] + [-inf]*(beam_size-1), dtype=tf.float32) # [beam_size] scores = tf.tile(scores, multiples=[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def beam_search(X, u, w, b, relLabels):\n\n candidate_paths = [[] for _ in range(10)] # contains the candidate label sets\n candidate_vals =[[] for _ in range(10)] # contains the label values (-1/1) for each candidate set\n candidate_scores = [0. for _ in range(10)]\n min_score = -1000\n\n iter = 0\...
[ "0.60872704", "0.580832", "0.57483256", "0.5723475", "0.5720976", "0.5689994", "0.56269765", "0.56127894", "0.5611332", "0.5581564", "0.5544426", "0.55419797", "0.55245256", "0.54159904", "0.5393713", "0.5388387", "0.5363377", "0.5335509", "0.53137904", "0.52877265", "0.52820...
0.68497777
0
Start a Clipper instance.
def start(self): with hide("output", "warnings", "running"): self._execute_standard("rm -f docker-compose.yml") self._execute_append( "docker-compose.yml", yaml.dump( DOCKER_COMPOSE_DICT, default_flow_style=False)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self):\n self.p.start()", "def start(self):\n control_process = mp.Process(target = self._start, args = [])\n control_process.start()", "def run(self):\n self.process.start()", "def start():\n global running\n # os.system('python3 /Users/bowenwaugh/Documents/GA/GA_...
[ "0.6104004", "0.5790243", "0.56691045", "0.5641376", "0.5600039", "0.5569598", "0.5557139", "0.5544228", "0.5495919", "0.5495538", "0.5490122", "0.5458819", "0.54459316", "0.5409652", "0.5348426", "0.5348426", "0.53407854", "0.53407854", "0.53407854", "0.53407854", "0.531293"...
0.6762592
0
List the names of all applications registered with Clipper. Returns str The string describing each registered application. If no applications are found, an empty string is returned.
def list_apps(self): with hide("output", "running"): result = local(("redis-cli -h {host} -p 6379 -n {db} keys \"*\"" .format(host=self.host, db=REDIS_APPLICATION_DB_NUM)), capture=True) if len(re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_apps(self) -> list:\n apps = self.app.list_apps()\n app_list = [app[\"title\"] for app in apps]\n return app_list", "def ls():\n cfgmgr = ConfigManager()\n apps = cfgmgr['apps']\n for i in apps:\n print(fc(\"- {g}{appname}{rst}\", appname=i))", "def get_app_list(se...
[ "0.7535104", "0.7332687", "0.72032297", "0.7056077", "0.7032159", "0.7025359", "0.6980595", "0.6800879", "0.67648196", "0.6708339", "0.6688796", "0.6655295", "0.66490656", "0.66431016", "0.6637069", "0.6617001", "0.6543629", "0.6511506", "0.6457436", "0.64264077", "0.64050114...
0.8137001
0
Gets detailed information about a registered application.
def get_app_info(self, name): with hide("output", "running"): result = local("redis-cli -h {host} -p 6379 -n {db} hgetall {name}".format( host=self.host, name=name, db=REDIS_APPLICATION_DB_NUM), capture=True) if len(result.stdout) > 0: splits = result.std...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAppInfo(self):\n data = self._client.Application.find(self.app_id)\n return data", "def android_app_info(self) -> 'outputs.AndroidAppInfoResponse':\n return pulumi.get(self, \"android_app_info\")", "def get_app_details(self, app_id):\n app_data = AppData.objects.get(uid=app_i...
[ "0.7732737", "0.6940945", "0.6844895", "0.67889345", "0.6697233", "0.664308", "0.66361076", "0.6622556", "0.66064054", "0.66047084", "0.6589803", "0.65076977", "0.64865416", "0.6436909", "0.6332687", "0.62825936", "0.6240869", "0.6210926", "0.6195001", "0.61817044", "0.617755...
0.7246406
1
Create a new container for an existing model. Starts a new container for a model that has already been added to Clipper. Note that models are uniquely identified by both name and version, so this method will fail if you have not already called `Clipper.add_model()` for the specified name and version.
def add_container(self, model_name, model_version): with hide("warnings", "output", "running"): # Look up model info in Redis model_key = "{mn}:{mv}".format(mn=model_name, mv=model_version) result = local("redis-cli -h {host} -p 6379 -n {db} hgetall {key}".format( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_model(ModelName=None, PrimaryContainer=None, Containers=None, ExecutionRoleArn=None, Tags=None, VpcConfig=None, EnableNetworkIsolation=None):\n pass", "def createNewModel(self, modelName):\n try:\n storage = FileSystemStorage(join(settings.MEDIA_ROOT, 'models'))\n\n fol...
[ "0.62423486", "0.59782505", "0.580102", "0.57813376", "0.5492073", "0.5476516", "0.54686433", "0.54077226", "0.5275172", "0.52743244", "0.52491695", "0.5195662", "0.5185085", "0.51352257", "0.5109263", "0.5091158", "0.5048849", "0.5037702", "0.5011328", "0.5009769", "0.498163...
0.737132
0
Fetches metrics from the running Clipper instance. Returns str The JSON string containing the current set of metrics for this instance. On error, the string will be an error message (not JSON formatted).
def inspect_instance(self): url = "http://%s:1337/metrics" % self.host r = requests.get(url) try: s = r.json() except TypeError: s = r.text return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def metrics(self):\r\n url = '{0}/{1}'.format(self.get_url(), 'metrics')\r\n\r\n return http.Request('GET', url), parsers.parse_json", "def metrics(self) -> pulumi.Output['outputs.RuntimeMetricsResponse']:\n return pulumi.get(self, \"metrics\")", "def get_prom_metrics(self):\n base_...
[ "0.6661778", "0.6530863", "0.62208194", "0.6195161", "0.6111613", "0.6066885", "0.58400106", "0.5813678", "0.58036125", "0.5755982", "0.5711879", "0.5672189", "0.5664587", "0.56643957", "0.56643957", "0.5648688", "0.56091595", "0.5596024", "0.55851555", "0.5569048", "0.556768...
0.697125
0
Cleans up all Docker artifacts. This will stop and remove all Docker containers and images from the host and destroy the Docker network Clipper uses.
def cleanup(self): with hide("output", "warnings", "running"): self.stop_all() self._execute_standard("rm -rf {model_repo}".format(model_repo=MODEL_REPO)) self._execute_root("docker rmi --force $(docker images -q)", warn_only=True) self._execute_root("docker netwo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup():\n cmd='docker rmi --force $(docker images -a -q)'\n bash_command(\"Deleting all images\", cmd)", "def clean(all):\n docker_clean(all)", "def destroy_all(self) -> None:\n try:\n containers = self.docker.containers.list(\n all=True,\n filte...
[ "0.7861326", "0.7753446", "0.74676013", "0.73080105", "0.7184034", "0.7155834", "0.7131024", "0.695112", "0.6933661", "0.6863181", "0.6823708", "0.67930967", "0.6702913", "0.66411686", "0.66257644", "0.65616155", "0.65316635", "0.6490241", "0.6471442", "0.6443562", "0.6398095...
0.8082461
0
Puts the provided container on the host.
def _put_container_on_host(self, container_name): with hide("output", "warnings", "running"): # first see if container is already present on host host_result = self._execute_root( "docker images -q {cn}".format(cn=container_name)) if len(host_result.stdout) > ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put_container(self, account, container):\n \n pass", "def put_container(self, container):\n if self.onest.create_bucket(container):\n LOG.debug('put_container, create success. '\n 'Container: %s.', container)\n else:\n # If return false, ...
[ "0.777786", "0.70849335", "0.6411199", "0.62735075", "0.62369967", "0.6106427", "0.60992134", "0.60992134", "0.59490246", "0.58224803", "0.573343", "0.57095087", "0.5694259", "0.5600121", "0.55540144", "0.5498277", "0.5437863", "0.54335755", "0.5419815", "0.5414302", "0.53570...
0.7162493
1
Get the info dictionary that contains additional metadata about the model. Arguments
def info(model: str = None) -> dict: model_instance = get_model(model) log.debug("Get info for " + str(model_instance)) return model_instance.info()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model_info():\n pass", "def get_model_meta_info(model_name):\n return dict(dict(model_meta_info)[model_name])", "def info(self):\n meta = {\n \"name\": self.name,\n \"description\": self.description,\n \"version\": self.version,\n \"labels\": self.la...
[ "0.74650854", "0.73257154", "0.72857666", "0.72088987", "0.71202224", "0.7080812", "0.7052952", "0.7009202", "0.6969219", "0.6927327", "0.68372357", "0.68372357", "0.6695758", "0.66955394", "0.6636088", "0.66226965", "0.66111636", "0.65891314", "0.65803796", "0.6525537", "0.6...
0.7487704
0
Extend author datafield by CDS authority id and Beard tag. Extends the author datafield by the MARC subfields
def extend_author_field(author_field, cds_id): cds_authority_id = "AUTHOR|(CDS){0}".format(cds_id) if cds_authority_id not in field_get_subfield_values(author_field, '0'): field_add_subfield(author_field, "0", cds_authority_id) field_add_subfield(author_field, "9", "#BEARD#") return True...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_record(record_id, authors):\n record = get_record(record_id)\n record_author = record_get_field_instances(record, \"100\")\n record_coauthors = record_get_field_instances(record, \"700\")\n\n if len(record_author) > 1:\n print (\"Oops: several '100' (main author) fields have been foun...
[ "0.59337986", "0.5925962", "0.59027773", "0.5860587", "0.57954335", "0.57940024", "0.5690788", "0.561277", "0.5400082", "0.5397839", "0.53956693", "0.5353431", "0.52892834", "0.52811795", "0.5277077", "0.5275605", "0.5230356", "0.51902807", "0.51870674", "0.51870674", "0.5156...
0.7661265
0
Update authors in CDS record.
def update_record(record_id, authors): record = get_record(record_id) record_author = record_get_field_instances(record, "100") record_coauthors = record_get_field_instances(record, "700") if len(record_author) > 1: print ("Oops: several '100' (main author) fields have been found in " ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateAuthors(self,event=None):\r\n self.popAuthors()\r\n self.primeAuthor.updateVals(self.authorList)\r\n self.coAuthor.updateVals(self.authorList)\r\n self.correspond.updateVals(self.authorList)", "def authors(self, authors):\n\n self._authors = authors", "def update_au...
[ "0.731476", "0.6796486", "0.6614002", "0.6487669", "0.6476942", "0.64210784", "0.6345062", "0.6321634", "0.6265239", "0.6230697", "0.61914086", "0.61902046", "0.61164945", "0.6104606", "0.6094158", "0.6070964", "0.6070964", "0.605973", "0.6028583", "0.60037154", "0.59922695",...
0.7023796
1
indexes of target nodes in the integral graph
def target_nodes_indexes(self) -> _TargetNodes: return self.__target_nodes_indexes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_sampled_nodes_indexes(self) -> torch.LongTensor:\n all_sampled_nodes_indexes: _typing.Any = self.__all_sampled_nodes_indexes\n return all_sampled_nodes_indexes", "def eligible_edges_with_indexes(self):\n return enumerate(self.edges)", "def reference_nodes_idx(self) -> Dict[str, tor...
[ "0.6612173", "0.6522753", "0.65165037", "0.64686227", "0.6402145", "0.6356008", "0.63395274", "0.632982", "0.6309057", "0.62649596", "0.62639195", "0.62190074", "0.6187654", "0.61834425", "0.614431", "0.6137135", "0.6136961", "0.6086665", "0.6084775", "0.6081723", "0.6038501"...
0.7760791
0
indexes of all sampled nodes in the integral graph
def all_sampled_nodes_indexes(self) -> torch.LongTensor: all_sampled_nodes_indexes: _typing.Any = self.__all_sampled_nodes_indexes return all_sampled_nodes_indexes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getLandmarkindices(self):\n return self.subsetnodes_indices", "def all_node_ids(self):\n return [i for i in range(0, self.n_inputs + self.n_hidden + self.n_outputs)]", "def getVertexNumbers(self):\n return self.vertexIndex.keys()", "def input_node_ids(self):\n return [i for i ...
[ "0.6573811", "0.6432765", "0.6346587", "0.6314584", "0.6272244", "0.62536925", "0.6206393", "0.61999273", "0.6198595", "0.61503786", "0.61315864", "0.6097065", "0.60742855", "0.6071434", "0.6031599", "0.60140324", "0.6012557", "0.60074216", "0.59971064", "0.5995", "0.5981299"...
0.7695562
0
Sample edges for one specific layer, expected to be implemented in subclass.
def _sample_edges_for_layer( self, __current_layer_target_nodes_indexes: torch.LongTensor, __top_layer_target_nodes_indexes: torch.LongTensor, layer_argument: _typing.Any, *args, **kwargs ) -> _typing.Tuple[torch.LongTensor, _typing.Optional[torch.Tensor]]: ra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __filterEdges(self):", "def test_edges(self):\n return self._test_edges", "def sample_edge_uniform(adj_list, degrees, n_triplets, sample_size):\n all_edges = np.arange(n_triplets)\n return np.random.choice(all_edges, sample_size, replace=False)", "def sample_edge_neighborhood(adj_list, degre...
[ "0.5996003", "0.58144414", "0.57052094", "0.56026417", "0.55999064", "0.55881745", "0.55750936", "0.5531893", "0.55224186", "0.5510966", "0.55064124", "0.5459333", "0.5412571", "0.5396114", "0.53951234", "0.53936285", "0.53936285", "0.5372117", "0.5318894", "0.5314331", "0.52...
0.6477802
0
Initializes the class by setting up the root based on the given name and tags
def __init__(self, xml_file, root_name, tags=[]): self.xml_file = xml_file self.tree = ET.ElementTree(ET.Element(root_name)) self.root = self.tree.getroot() for tag in tags: self.root.set(tag[0], tag[1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, name: str) -> None:\n\t\t# Set variables to blank values\n\t\tself.name = name\n\t\tself.has_subfile = False\n\t\tself.root_nodes: List[RootNode] = []\n\t\tself.root_names: Set[str] = set()\n\t\tself.node_names: Set[str] = set()\n\t\tself.subnode_names: Dict[str, Set[str]] = {}", "def _setup(s...
[ "0.6723491", "0.67032516", "0.65701365", "0.6407076", "0.6393281", "0.6339078", "0.6339078", "0.6282168", "0.6281084", "0.6245782", "0.6195248", "0.6186578", "0.6186554", "0.6166327", "0.61432064", "0.6107229", "0.6097506", "0.6090887", "0.6090887", "0.6085682", "0.6081844", ...
0.7406777
0
Init required project's objects using defined configuration. Returns an object dict that is added to project object. This method is called in server load step.
def init_objects(config_dict): # only testing purposes obj_list = dict() obj_list['input_cfg'] = config_dict return obj_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init():\n defaults = _project_defaults()\n\n if Project.prompt:\n defaults['name'] = prompt(\"Enter the project's name:\", defaults['name'])\n defaults['package'] = prompt(\"Enter the project's package:\", defaults['package'])\n defaults['author'] = prompt(\"Enter the project's autho...
[ "0.6469144", "0.64588916", "0.62322617", "0.6208262", "0.61827815", "0.6177319", "0.6113617", "0.6104447", "0.6062008", "0.6061132", "0.604619", "0.6014433", "0.60107535", "0.6006592", "0.5994414", "0.5987781", "0.59561527", "0.59465915", "0.5927197", "0.58842665", "0.5858934...
0.6459655
1
SetActualXDimensionIsOddInput(itkHalfHermitianToRealInverseFFTImageFilterICF2IF2 self, itkSimpleDataObjectDecoratorB _arg)
def SetActualXDimensionIsOddInput(self, _arg: 'itkSimpleDataObjectDecoratorB') -> "void": return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_SetActualXDimensionIsOddInput(self, _arg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetActualXDimensionIsOddInput(self, _arg: 'itkSimpleDataObjectDecoratorB') -> \"void\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_SetActualXDimensionIsOddInput(self, _arg)", "def SetActualXDimensionIsOdd(self, *args) -> \"void\":\n ...
[ "0.8969456", "0.86000365", "0.8532017", "0.8177083", "0.7982844", "0.76595676", "0.71240073", "0.6296384", "0.61453384", "0.5576631", "0.5311787", "0.51991284", "0.51852775", "0.51783836", "0.51714885", "0.51295906", "0.50509685", "0.4981996", "0.49758014", "0.4968456", "0.49...
0.9319235
0
GetActualXDimensionIsOddInput(itkHalfHermitianToRealInverseFFTImageFilterICF2IF2 self) > itkSimpleDataObjectDecoratorB
def GetActualXDimensionIsOddInput(self) -> "itkSimpleDataObjectDecoratorB const *": return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_GetActualXDimensionIsOddInput(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetActualXDimensionIsOddInput(self) -> \"itkSimpleDataObjectDecoratorB const *\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_GetActualXDimensionIsOddInput(self)", "def SetActualXDimensionIsOddInput(self, _arg: 'itkSimpleDataObjectDeco...
[ "0.8846005", "0.84832937", "0.8194069", "0.80633116", "0.7708489", "0.7641021", "0.71924984", "0.5695571", "0.56210387", "0.5349565", "0.5323007", "0.52913964", "0.5235574", "0.5194547", "0.5194547", "0.51583934", "0.51583934", "0.5149409", "0.51164955", "0.51159143", "0.5115...
0.9107605
0
GetActualXDimensionIsOdd(itkHalfHermitianToRealInverseFFTImageFilterICF2IF2 self) > bool const &
def GetActualXDimensionIsOdd(self) -> "bool const &": return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_GetActualXDimensionIsOdd(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetActualXDimensionIsOdd(self) -> \"bool const &\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_GetActualXDimensionIsOdd(self)", "def GetActualXDimensionIsOddInput(self) -> \"itkSimpleDataObjectDecoratorB const *\":\n return _it...
[ "0.8801514", "0.8127065", "0.81071246", "0.7921351", "0.7688207", "0.7573678", "0.73435515", "0.5987669", "0.57538724", "0.5639284", "0.5608152", "0.5573267", "0.5572946", "0.5502984", "0.5374126", "0.53627056", "0.53548497", "0.53279", "0.53225464", "0.5297045", "0.5288904",...
0.9140366
0
GetSizeGreatestPrimeFactor(itkHalfHermitianToRealInverseFFTImageFilterICF2IF2 self) > unsigned long long
def GetSizeGreatestPrimeFactor(self) -> "unsigned long long": return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_GetSizeGreatestPrimeFactor(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetSizeGreatestPrimeFactor(self) -> \"unsigned long long\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_GetSizeGreatestPrimeFactor(self)", "def _get_max_image_bytes(self):\n raise NotImplementedError(\"Abstract method not implem...
[ "0.8544165", "0.5794391", "0.57624966", "0.57615536", "0.5714787", "0.5714787", "0.56717813", "0.5517006", "0.55071205", "0.55050975", "0.5497939", "0.5494971", "0.54841167", "0.5444231", "0.54136324", "0.5411584", "0.53939754", "0.53831863", "0.53828776", "0.5376495", "0.535...
0.8905682
0
cast(itkLightObject obj) > itkHalfHermitianToRealInverseFFTImageFilterICF2IF2
def cast(obj: 'itkLightObject') -> "itkHalfHermitianToRealInverseFFTImageFilterICF2IF2 *": return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_cast(obj: 'itkLightObject') -> \"itkHalfHermitianToRealInverseFFTImageFilterICF2IF2 *\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkHa...
[ "0.8758252", "0.8369405", "0.82023007", "0.7600542", "0.75206214", "0.7492559", "0.74633193", "0.7455476", "0.7385218", "0.7378154", "0.7370113", "0.7342949", "0.7299217", "0.72991484", "0.72808546", "0.7278873", "0.72355413", "0.7199508", "0.71967554", "0.71873283", "0.71853...
0.87814647
0
New() > itkHalfHermitianToRealInverseFFTImageFilterICF2IF2 Create a new object of the class itkHalfHermitianToRealInverseFFTImageFilterICF2IF2 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new ob...
def New(*args, **kargs): obj = itkHalfHermitianToRealInverseFFTImageFilterICF2IF2.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkSquaredDifferenceImageFilterIF2IF2IF2.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkHalfHermitianToRealInverseFFTImageFilterICF3IF3.__New_orig__()\n impor...
[ "0.7311116", "0.72815", "0.72209346", "0.7205358", "0.7124789", "0.7123721", "0.71095455", "0.71008086", "0.705505", "0.7032606", "0.70307887", "0.7022936", "0.70089126", "0.697373", "0.69708544", "0.69626844", "0.6954855", "0.69405806", "0.69339013", "0.6925278", "0.69092274...
0.8440965
0
itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_cast(itkLightObject obj) > itkHalfHermitianToRealInverseFFTImageFilterICF2IF2
def itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_cast(obj: 'itkLightObject') -> "itkHalfHermitianToRealInverseFFTImageFilterICF2IF2 *": return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkHalfHermitianToRealInverseFFTImageFilterICF2IF2 *\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 *...
[ "0.9269122", "0.84515977", "0.8448534", "0.79274684", "0.7901587", "0.78621644", "0.7820546", "0.77878016", "0.7710905", "0.7688822", "0.7686142", "0.76826346", "0.7652696", "0.7630173", "0.7629605", "0.7621622", "0.76134014", "0.76103306", "0.76072913", "0.75988936", "0.7579...
0.94871765
0
SetActualXDimensionIsOddInput(itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 self, itkSimpleDataObjectDecoratorB _arg)
def SetActualXDimensionIsOddInput(self, _arg: 'itkSimpleDataObjectDecoratorB') -> "void": return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_SetActualXDimensionIsOddInput(self, _arg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetActualXDimensionIsOddInput(self, _arg: 'itkSimpleDataObjectDecoratorB') -> \"void\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_SetActualXDimensionIsOddInput(self, _arg)", "def GetActualXDimensionIsOddInput(self) -> \"itkSimpleData...
[ "0.9123958", "0.8442863", "0.8440207", "0.8404514", "0.83800495", "0.7514097", "0.75077826", "0.6148815", "0.5708541", "0.57080245", "0.5218581", "0.52097803", "0.49215868", "0.49215868", "0.49037904", "0.4875511", "0.48751906", "0.48587048", "0.48545232", "0.48149854", "0.48...
0.9243138
0
GetActualXDimensionIsOddInput(itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 self) > itkSimpleDataObjectDecoratorB
def GetActualXDimensionIsOddInput(self) -> "itkSimpleDataObjectDecoratorB const *": return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_GetActualXDimensionIsOddInput(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetActualXDimensionIsOddInput(self) -> \"itkSimpleDataObjectDecoratorB const *\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_GetActualXDimensionIsOddInput(self)", "def SetActualXDimensionIsOddInput(self, _arg: 'itkSimpleDataObjectDeco...
[ "0.90282", "0.8347846", "0.83297914", "0.7968715", "0.7855654", "0.7544492", "0.74166435", "0.55355155", "0.54117465", "0.530732", "0.5280623", "0.52173626", "0.52097636", "0.5165985", "0.51651883", "0.51651883", "0.51383734", "0.51095897", "0.51095897", "0.5096448", "0.50003...
0.8998347
1
GetActualXDimensionIsOdd(itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 self) > bool const &
def GetActualXDimensionIsOdd(self) -> "bool const &": return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_GetActualXDimensionIsOdd(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetActualXDimensionIsOdd(self) -> \"bool const &\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_GetActualXDimensionIsOdd(self)", "def GetActualXDimensionIsOddInput(self) -> \"itkSimpleDataObjectDecoratorB const *\":\n return _it...
[ "0.90134573", "0.8116078", "0.8011804", "0.8007661", "0.78912485", "0.7518797", "0.7378851", "0.5830744", "0.5698672", "0.55729944", "0.5495327", "0.54534477", "0.5449673", "0.54046744", "0.5294553", "0.5243625", "0.52380204", "0.51997244", "0.5157646", "0.51447916", "0.51310...
0.9105638
0
GetSizeGreatestPrimeFactor(itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 self) > unsigned long long
def GetSizeGreatestPrimeFactor(self) -> "unsigned long long": return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_GetSizeGreatestPrimeFactor(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetSizeGreatestPrimeFactor(self) -> \"unsigned long long\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_GetSizeGreatestPrimeFactor(self)", "def _get_max_image_bytes(self):\n raise NotImplementedError(\"Abstract method not implem...
[ "0.87134635", "0.58126163", "0.57935023", "0.56478095", "0.5621576", "0.55769056", "0.55031663", "0.5494461", "0.5490276", "0.5477918", "0.5459333", "0.5459333", "0.54508764", "0.5442352", "0.5436269", "0.540579", "0.54017246", "0.5392374", "0.53905743", "0.5386647", "0.53861...
0.8878656
0
cast(itkLightObject obj) > itkHalfHermitianToRealInverseFFTImageFilterICF3IF3
def cast(obj: 'itkLightObject') -> "itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 *": return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_cast(obj: 'itkLightObject') -> \"itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 *\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkHa...
[ "0.8754373", "0.84519255", "0.8329674", "0.74115735", "0.73911655", "0.7372709", "0.73513615", "0.73473054", "0.7336441", "0.73128325", "0.72939885", "0.72838974", "0.72707695", "0.72588015", "0.72561187", "0.72537726", "0.72531945", "0.72531515", "0.7238233", "0.72148824", "...
0.88050354
0
New() > itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 Create a new object of the class itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new ob...
def New(*args, **kargs): obj = itkHalfHermitianToRealInverseFFTImageFilterICF3IF3.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkHuangThresholdImageFilterIF3ISS3.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkCosImageFilterIF3IF3.__New_orig__()\n import itkTemplate\n itkTempla...
[ "0.74215084", "0.7370187", "0.736912", "0.73665327", "0.73401374", "0.7301532", "0.7293052", "0.72928876", "0.7292436", "0.72576916", "0.7249076", "0.7237967", "0.720986", "0.7209201", "0.71870464", "0.7181294", "0.7172013", "0.7157828", "0.7155288", "0.7106769", "0.7103403",...
0.83887285
0
itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_cast(itkLightObject obj) > itkHalfHermitianToRealInverseFFTImageFilterICF3IF3
def itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_cast(obj: 'itkLightObject') -> "itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 *": return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 *\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_cast(obj)", "def itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_cast(obj: 'itkLightObject') -> \"i...
[ "0.91791695", "0.8398635", "0.8379627", "0.78276956", "0.77661604", "0.77512765", "0.774406", "0.77390754", "0.76507497", "0.7648699", "0.7641291", "0.7640236", "0.76136947", "0.760601", "0.76036775", "0.75992405", "0.75864094", "0.7560299", "0.7546588", "0.75093377", "0.7489...
0.9441769
0
Procedural interface for HalfHermitianToRealInverseFFTImageFilter
def half_hermitian_to_real_inverse_fft_image_filter(*args, **kwargs): import itk instance = itk.HalfHermitianToRealInverseFFTImageFilter.New(*args, **kwargs) return instance.__internal_call__()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_cast(obj: 'itkLightObject') -> \"itkHalfHermitianToRealInverseFFTImageFilterICF2IF2 *\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkHa...
[ "0.7376454", "0.71049654", "0.70379233", "0.68949634", "0.6755386", "0.65881103", "0.63375324", "0.625885", "0.623645", "0.6208561", "0.61968803", "0.6196119", "0.610591", "0.605326", "0.6052592", "0.60317117", "0.5980117", "0.5919756", "0.5919756", "0.5908526", "0.58952224",...
0.82497996
0
Creates a MutateOperation for the sitelink campaign extension setting that will be removed.
def create_sitelink_campaign_extension_setting_mutate_operation( client, customer_id, campaign_id ): extension_type_enum = client.enums.ExtensionTypeEnum # Construct the campaign extension setting resource name, in format: # customers/{customer_id}/campaignExtensionSettings/{campaign_id}~{extension_type...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(client, customer_id, campaign_id):\n # Initialize an array of MutateOperations\n mutate_operations = []\n sitelink_campaign_extension_setting_mutate_operation = create_sitelink_campaign_extension_setting_mutate_operation(\n client, customer_id, campaign_id\n )\n mutate_operations.app...
[ "0.57828265", "0.54131603", "0.48680517", "0.48680517", "0.48087773", "0.47320238", "0.46879244", "0.46765333", "0.466588", "0.46614406", "0.46451315", "0.4598959", "0.45877948", "0.45646876", "0.45513937", "0.45418844", "0.45409346", "0.4482612", "0.44797063", "0.4463183", "...
0.6482961
0
Gets all sitelink extension feed items associated to the specified campaign extension setting.
def get_all_sitelink_extension_feed_items( client, ga_service, customer_id, campaign_id ): campaign_resource_name = client.get_service( "CampaignService" ).campaign_path(customer_id, campaign_id) extension_type_enum = client.enums.ExtensionTypeEnum extension_type_name = extension_type_enum.S...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_entries(self):\n entries = []\n rss_list = self.__data_adapter.fetch_rss()\n for rss in rss_list:\n rss_href = rss.get('url', None)\n if rss_href is not None:\n feed = feedparser.parse(rss_href)\n [entries.append(FeedDocument(entry....
[ "0.55385774", "0.53972065", "0.5338791", "0.5298385", "0.52451897", "0.5244143", "0.51899904", "0.51251996", "0.5124382", "0.5122065", "0.5023741", "0.50200367", "0.5009792", "0.49959934", "0.49743348", "0.49121657", "0.48833185", "0.48079076", "0.48065683", "0.47998428", "0....
0.8327138
0
Creates MutateOperations for the sitelink extension feed items that will be removed.
def create_extension_feed_item_mutate_operations( client, extension_feed_item_resource_names ): mutate_operations = [] # Create a MutateOperation for each extension feed item to remove. for resource_name in extension_feed_item_resource_names: mutate_operation = client.get_type("MutateOperation")...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_remove_yield(self, affiliate_items_url_factory, affiliate_network_factory):\n network = affiliate_network_factory(name='Network')\n\n with mock.patch('chiton.rack.affiliates.bulk.create_affiliate') as create_affiliate:\n affiliate = ValidatingAffiliate()\n affiliate.val...
[ "0.5504989", "0.54735047", "0.53347915", "0.52744806", "0.5200508", "0.50634307", "0.50577694", "0.50577694", "0.5010065", "0.49496794", "0.4918461", "0.49112594", "0.49083838", "0.49023283", "0.49006012", "0.48826176", "0.48780647", "0.4877376", "0.4854148", "0.48365226", "0...
0.7286365
0
Event handler for when a new player enters the game.
def handle_new_user_event(name, sid, methods=['GET', "POST"]): game.add_player(name, sid) print(f"there are {len(game.players)} players in the game") for player in game.players: print(player.name + " is in the game")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_client_enter(self, game) -> None:\n pass", "def handle_events(self):\n\n for event in pygame.event.get():\n if event.type == pygame.QUIT:\n sys.exit()\n if self.state == FIRST_ENTER:\n if event.type == pygame.KEYDOWN and event.key == pygame...
[ "0.73703206", "0.6564488", "0.64533114", "0.64027756", "0.6338999", "0.63058937", "0.629707", "0.6246762", "0.6230514", "0.6219869", "0.61946213", "0.6177849", "0.617491", "0.61737484", "0.6160792", "0.61495346", "0.61304504", "0.61037457", "0.6088835", "0.60847485", "0.60835...
0.65749884
1
Event handler for when a new round starts, whether by all players having been entered and the "Start Game" button gets clicked, or by continuing after a prior round has ended. Creates and shuffles the deck, deals out the cards, and determines the trump card. Note that the trump is passed to each player as part of the o...
def handle_game_start_event(methods=["GET", "POST"]): if not game.round_already_started: game.round_already_started = True print("start the round") game.start_round() for player in game.ordered_players: hand_dict = { "trump": [game.trump_value, game.trump]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def beginRound(self):\n\t\tself.gameState = Table.PRE_FLOP\n\t\tfor p in self.getPlayers():\n\t\t\tif p.money <= 0:\n\t\t\t\tprint p.name\n\t\t\t\tself.playerRemoveList.append(p)\n\t\tself.removeFromPlayerList()\n\t\tif len(self.getPlayers()) == 1:\n\t\t\tself.isGameEnd = True\n\t\telse:\n\t\t\tself.roundNo += 1\n...
[ "0.71307325", "0.6843485", "0.6780641", "0.66546196", "0.6519484", "0.65184325", "0.6504133", "0.6440025", "0.64300364", "0.6407379", "0.6402357", "0.6399686", "0.63804615", "0.63598305", "0.631902", "0.6294538", "0.6265746", "0.6260989", "0.62533665", "0.6244803", "0.6237576...
0.6857728
1
Event handler for when a new bid must be requested. Creates an input field where the player whose turn it is can input their bid and submit it. When all bids have been collected, this function instead switches the game state to "playing" and sends a message to the player whose turn it is that they may now start playing...
def handle_start_bidding_event(methods=["GET", "POST"]): if game.active_player_index == len(game.ordered_players): game.active_player_index = 0 active_player = game.ordered_players[game.active_player_index] game.state = "playing" socketio.emit("your turn", room=active_player.sid) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bid(command):\n env_banner()\n\n game = Game.read()\n if game is None:\n game = Game.init_game()\n\n command = command.lower().strip()\n\n if command not in ['start', 'pause', 'resume']:\n click.echo('Valid options are start, pause or resume.')\n ...
[ "0.6610059", "0.6388831", "0.63772714", "0.63008505", "0.6248338", "0.61771005", "0.6061648", "0.60147685", "0.5865799", "0.5846793", "0.5810716", "0.5787701", "0.5722459", "0.560185", "0.5557072", "0.5485424", "0.54785204", "0.5419658", "0.5318205", "0.5303232", "0.5240301",...
0.69479686
0
Event handler for when a player submits their bid. Takes the user input and assigns it to player.bid, then bounces a quick emit back to the client so the client can again bounce the "request bid" function to the next client.
def handle_bid(bid, sid, methods=["GET", "POST"]): game.set_player_bid(bid, sid) game.active_player_index += 1 socketio.emit("get next bid") bid_dict = {} for player in game.ordered_players: print(f"{player.name}'s bid is {player.bid}") bid_dict[player.name.title()]=player.bid so...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_start_bidding_event(methods=[\"GET\", \"POST\"]):\n if game.active_player_index == len(game.ordered_players):\n game.active_player_index = 0\n active_player = game.ordered_players[game.active_player_index]\n game.state = \"playing\"\n socketio.emit(\"your turn\", room=acti...
[ "0.6900256", "0.64509535", "0.6288491", "0.6142698", "0.61269826", "0.59916043", "0.59418434", "0.5737381", "0.5708696", "0.5684553", "0.5658267", "0.5652931", "0.5651575", "0.5596769", "0.55754954", "0.55639243", "0.55026704", "0.5463158", "0.53897315", "0.53704005", "0.5363...
0.7031884
0
Event handler for when a player clicks on a card in their hand. First, checks to make sure that the game state is "playing" and that it is the respective client's turn. If not, it refuses to play the card. If it is, then the card is added to the current trick on the table amd passes priority to the next player in line....
def handle_card_click_event(index, sid, methods=["GET", "POST"]): if game.state == "playing": print(index) active_player = game.ordered_players[game.active_player_index] print(active_player.hand) if active_player.sid == sid: game.play_card(int(index), active_player) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hit(self, hand):\n if hand == \"player\":\n self.player_hand.append(self.cards_list[self.top_card_int])\n self.calculate_value(\"player\")\n elif hand == \"dealer\":\n self.dealer_hand.append(self.cards_list[self.top_card_int])\n self.calculate_value(\"...
[ "0.6828019", "0.66834337", "0.6655729", "0.66178566", "0.6582696", "0.6566157", "0.64809275", "0.64504397", "0.6402687", "0.63628477", "0.63552636", "0.6353695", "0.6352674", "0.6339642", "0.6332877", "0.6318542", "0.62739736", "0.6272104", "0.62683296", "0.62102437", "0.6199...
0.682233
1
Enqueue(val),enqueue(val2), dequeue = val, dequeue = val2.
def test_values_dequeue_two_values_in_correct_order(): queue = Queue('ab') assert queue.dequeue() == 'a' assert queue.dequeue() == 'b'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_the_queue_dequeue_multi_values_phase_two(the_queue):\n the_queue.enqueue(2)\n the_queue.enqueue(3)\n the_queue.enqueue(4)\n the_queue.enqueue(5)\n the_queue.dequeue()\n assert (the_queue.dequeue(),\n the_queue._new_dll.tail.data) == (3, 4)", "def enqueue(self, val):\n ...
[ "0.72554654", "0.69427395", "0.6906065", "0.6764085", "0.6579386", "0.65090865", "0.65050536", "0.6447959", "0.64349025", "0.63768375", "0.63478684", "0.6281892", "0.62638295", "0.6238328", "0.6197534", "0.61510164", "0.60696894", "0.6068618", "0.6031984", "0.5993058", "0.598...
0.69951135
1
Peak empty returns none.
def test_peak_empty_queue_returns_none(): queue = Queue() assert queue.peak() is None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def peak(self):\n pass", "def detect_peak(data):\n nonlocal last, ascent_dist, ascent_start\n if data > last:\n if ascent_start is None:\n ascent_start = last\n ascent_dist += 1\n else:\n if ascent_dist:\n peak = last\n ...
[ "0.7312167", "0.69030046", "0.6676074", "0.6622437", "0.6607863", "0.6598427", "0.64396054", "0.64075404", "0.62937284", "0.62708354", "0.62581694", "0.6185751", "0.61741555", "0.6110209", "0.60893977", "0.60679144", "0.6043656", "0.60037297", "0.59912175", "0.5986642", "0.59...
0.7288681
1
Size of new queue is 0.
def test_size_of_new_queue(): queue = Queue() assert queue.size() == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_size_empty(the_queue):\n assert the_queue.size() == 0", "def test_new_queue_is_empty(self):\n queue = Queue_()\n self.assertTrue(queue.empty())\n self.assertEqual(queue.size(), 0)", "def test_size(self):\n queue = Queue()\n self.assertEqual(queue.size(), 0)\n queue.enq...
[ "0.749195", "0.7395883", "0.727389", "0.7206155", "0.7155715", "0.7155715", "0.70977354", "0.7025954", "0.7025954", "0.69922", "0.69795096", "0.6951921", "0.6944076", "0.6941982", "0.694079", "0.6927224", "0.692247", "0.69112027", "0.69060826", "0.68897873", "0.68897873", "...
0.80333865
0
Enqueue, dequeue size is 0.
def test_size_decrements_with_dequeue(): queue = Queue() queue.enqueue('val') assert queue.size() == 1 queue.dequeue() assert queue.size() == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enqueue(self,data): # total: O(n)\n # if pass capacity, double capacity and the array\n while self._size >= self._capacity: #O(n)\n self.doubleCapacity() #O(n)\n if self._size != 0: # O(1)\n self._end = (self._end+1)% self._capacity # O(1)\n self._queue[self._e...
[ "0.7157864", "0.703711", "0.70193213", "0.7013603", "0.7013603", "0.6990167", "0.6934225", "0.686834", "0.6846222", "0.683892", "0.68176216", "0.6813882", "0.680555", "0.67895997", "0.67571425", "0.6747387", "0.67188746", "0.66940105", "0.6679827", "0.66734767", "0.664942", ...
0.7311963
0
Creates a 2d or 3d axis.
def _create_axis(axis_type, variation="Linear", title=None): if axis_type not in ["3d", "2d"]: return None default_style = { "background": "rgb(230, 230, 230)", "gridcolor": "rgb(255, 255, 255)", "zerolinecolor": "rgb(255, 255, 255)", } if axis_type == "3d": re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_open3d_axis(axis_vector=None, origin=None, scale=1.0):\n if origin is None:\n origin = np.zeros(3)\n if axis_vector is None:\n axis_vector = np.array([0, 0, 1], dtype=np.float)\n axis_vector = axis_vector * scale\n axis_point = origin + axis_vector\n points = np.stack([origin,...
[ "0.6377895", "0.611665", "0.59663534", "0.5831629", "0.57575595", "0.5707427", "0.5611563", "0.55929464", "0.5588371", "0.5561071", "0.55527145", "0.55161554", "0.54822254", "0.54538625", "0.5445956", "0.54423445", "0.5383929", "0.53753966", "0.53407836", "0.531003", "0.53094...
0.67882353
0
This method is called automatically when Cinema 4D Create the Layout (display) of the Dialog.
def CreateLayout(self): # Defines the title of the Dialog self.SetTitle("A Custom Dialog with a Top Menu") # Flushes all the already existing menu to create our one. The content will be on the left. self.MenuFlushAll() # Creates a Sub menu begin to insert new menu entry ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_layout( self ):", "def _init_ui(self):\n\n hlayout = QtWidgets.QHBoxLayout()\n\n label = QtWidgets.QLabel('Kies een normtraject:')\n\n hlayout.addWidget(label)\n\n self.section_combobox = QtWidgets.QComboBox()\n self.section_combobox.setFixedWidth(60)\n self.s...
[ "0.6830704", "0.6582636", "0.6569698", "0.65478736", "0.6520507", "0.6498965", "0.64796984", "0.6454324", "0.6438737", "0.6431905", "0.6370083", "0.6368099", "0.6312776", "0.63090515", "0.62615967", "0.6222714", "0.6211797", "0.6191078", "0.6169073", "0.6165413", "0.616442", ...
0.709687
0
Adds a stamp over the plot signalling it is a placeholder plot
def make_placeholder(fig: Figure) -> None: fig.add_artist(FancyBboxPatch( xy = (0.35, 0.45), width = 0.3, height = 0.1, boxstyle = 'Round, pad=0.015', linewidth = 3, edgecolor = 'red', facecolor = 'lightpink', alpha = 0.5 )) fig.text( x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_blank(self):\n self.figure_bmp.SetBitmap(self.controller.plot_blank())", "def createBlankPlot(self):\n\n fig = plt.figure(figsize=(8,6),dpi=80)\n fig.set_facecolor('#ededed')\n \n # Format plot\n ax = plt.subplot(111)\n \n fig.canvas.dr...
[ "0.6603313", "0.61756814", "0.6072145", "0.6055725", "0.602782", "0.59950686", "0.5900304", "0.5885722", "0.5854338", "0.5785014", "0.5785014", "0.5734856", "0.572567", "0.57251096", "0.5723055", "0.5715933", "0.5715183", "0.5704", "0.5690976", "0.5655721", "0.5644146", "0....
0.62764513
1
Tag common incidents using a regex
def tag_incident(incident): try: return re.findall(regex, incident)[0] except TypeError: return pd.np.nan except IndexError: return pd.np.nan
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_tags(self):\n nolf = self.unixtext.replace(\"\\n\", \" \")\n res = EMERGENCY_RE.findall(nolf)\n if res:\n # TODO: this can be based off the IBW Tags too\n self.is_emergency = True\n match = WINDHAIL.match(nolf)\n if match:\n gdict = ma...
[ "0.52708447", "0.5163899", "0.51446724", "0.5110537", "0.5087893", "0.5036303", "0.5027366", "0.502397", "0.50166464", "0.49869832", "0.4966351", "0.49521333", "0.49241787", "0.4894549", "0.4828666", "0.48126188", "0.48103958", "0.48088047", "0.47784507", "0.47735015", "0.475...
0.545593
0
!Allows subclasses to override variables in the scope before parsing. The default implementation does nothing. scope The global scope in which to override variables.
def override(self,scope):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def beginScope():", "def scope(self):\n return 'global' if self.parent is None else 'local'", "def scope(self): # noqa: ANN201", "def scope_global(self):\n self.raw['scope'] = 'GLOBAL'\n return self", "def scope(self, name):\r\n raise NotImplementedError", "def __init__(self, nam...
[ "0.5940736", "0.582645", "0.5746078", "0.5648204", "0.5605894", "0.56055665", "0.5571537", "0.5530811", "0.55072176", "0.5491784", "0.54825747", "0.54637235", "0.54503393", "0.53918594", "0.5380209", "0.5379051", "0.5374612", "0.5317445", "0.5314528", "0.5310974", "0.5304187"...
0.7037989
0
Solve parabolic partial differential equation with Crank Nicolson finite difference method
def crank_nicolson_fd(main_args, boundary_left_args, boundary_right_args, initial_func, min_x, max_x, max_t, step_x, step_t, boundary_approximation_func='first_order_two_points', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solve_differential_equation(f_derivatives, initial, oldest=120):\n bunch = solve_ivp(f_derivatives, t_span=(0, oldest), y0=initial, vectorized=True, dense_output=True)\n return bunch.sol", "def work_dos():\n #potential = 2x**2+x**2y+y**2\n x1,y1 = (2, -3)\n x2,y2 = (-1, 2)\n p1 = (2*(x1**2)...
[ "0.6431365", "0.6242809", "0.60729045", "0.60094076", "0.5977395", "0.58910745", "0.5847757", "0.5833228", "0.5826886", "0.5806057", "0.58032686", "0.57971686", "0.57969683", "0.57910645", "0.5788869", "0.5775308", "0.5765414", "0.57204235", "0.56981325", "0.5682662", "0.5675...
0.6265
1
This method builds the mimeData if the selection is correct
def mimeData(self, indices): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_mime(self, mime, def_mime='unk'):\n self.mime = def_mime\n if mime:\n self.mime = self.MIME_RE.split(mime, 1)[0]", "def build_post_data(self, file_):\n\n filemask = {\n 'uuid': str(uuid.uuid4()),\n 'filename': file_.filename,\n 'filesize':...
[ "0.60108477", "0.5680776", "0.56193733", "0.5298136", "0.5222251", "0.5179363", "0.50925857", "0.4962017", "0.49526304", "0.49443462", "0.49148428", "0.48848096", "0.48705718", "0.48466402", "0.48276138", "0.48247182", "0.4824222", "0.48028073", "0.47541302", "0.47510785", "0...
0.612524
0
The next function (isModelDirty) is a workaround. It should not be necessary but it is currently because we set tooltips in the treeview and that triggers emitDataChanged which triggers the rebuild or repopulate of the property editor. The proper fix will be to use columns in the treeview where each column has its own ...
def isModelDirty(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isDirty(self):\n\t#@DEBUG christophe have to fix denoising optionnal issue prior to set isDirty() to True\n return False", "def _modelUpdated(self, *args, **kwargs):\n topLeft = self.index(column=0)\n bottomRight = self.index(column=1)\n model = self.model()\n if model is n...
[ "0.58494514", "0.57748735", "0.5706154", "0.57018065", "0.5463952", "0.5334079", "0.5326089", "0.53073055", "0.52202743", "0.5202958", "0.5202958", "0.51957154", "0.5162258", "0.5160728", "0.51254827", "0.5123745", "0.505808", "0.505808", "0.5051105", "0.50360453", "0.5002459...
0.66525507
0
Posts a ticker message with details about the crypto
async def ticker(ctx, crypto: str, currency="USD"): info = getTicker(crypto, currency.lower()) currency = currency.upper() if info: if currency in info["prices"]: em = discord.Embed(title='{} ({}-{})'.format(info["name"], info["symbol"], currency), descrip...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def crypto(self, ctx, ticker: str):\n ticker = ticker.upper()\n api_endpoint = \"https://min-api.cryptocompare.com/data/pricemultifull\"\\\n f\"?tsyms=USD&fsyms={ticker}\"\n api_json = await self.bot.aiojson(api_endpoint)\n if \"Message\" in api_json:\n ...
[ "0.6873399", "0.620606", "0.5890276", "0.5863005", "0.5817372", "0.58143044", "0.5677197", "0.5675489", "0.5656747", "0.5605821", "0.5585458", "0.5579567", "0.53901786", "0.53835154", "0.5364867", "0.5361006", "0.5358236", "0.5357463", "0.53430057", "0.5317439", "0.53008544",...
0.6571176
1
Posts an error message in case of an error with the ticker method.
async def ticker_error(ctx, error): print(error) if isinstance(error, commands.UserInputError): await ctx.send("Invalid input.") else: await ctx.send("Oops, something bad happened..")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error(self, msg, *args, **kwargs):\n pass", "def error(self, *args, **kwargs):\n\n message = self.get_message(*args, **kwargs)\n self.logger.error(message)", "def on_error(data):\n print('Market Data Error', data)", "def error(self, *args, **kwargs):\n self.msg(logging.ERROR, *...
[ "0.6577208", "0.64844203", "0.64791065", "0.6470918", "0.6456576", "0.6378036", "0.63485813", "0.6337225", "0.6325072", "0.63216925", "0.6306876", "0.6291794", "0.6276781", "0.6269892", "0.6268414", "0.6248454", "0.62467206", "0.62421304", "0.62101525", "0.6194302", "0.617253...
0.7260296
0
Posts an error message in case of an error with the convert method.
async def convert_error(ctx, error): print(error) if isinstance(error, commands.UserInputError): await ctx.send("Invalid input.") else: await ctx.send("Oops, something bad happened..")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _error(msg):\n\n error(None, msg)", "def error(self, msg, *args, **kwargs):\n pass", "def error(self, message=None, show_help=True):", "def sendErrorMessage(msg): #@NoSelf", "def error(self, error):\n pass", "def error(self, *args, **kwargs):", "def handle_validation_error(sel...
[ "0.60691553", "0.60344666", "0.6002406", "0.6001901", "0.5961509", "0.59537053", "0.5941145", "0.59021723", "0.5863523", "0.58317477", "0.5790797", "0.5720247", "0.57159305", "0.5714528", "0.5691131", "0.5669286", "0.5664704", "0.56534857", "0.56486344", "0.5642917", "0.56346...
0.6336882
0
Benchmark fully interacting system versus alchemicallymodified system.
def run_benchmark(): import argparse parser = argparse.ArgumentParser(description='Benchmark alchemically modified system against unmodified system.') parser.add_argument('--platform', dest='platform_name', action='store', default=None, help='platform name to benchmark (default: None)') options = parser...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def faster(self):\n self.run_command('faster')", "def slower(self):\n self.run_command('slower')", "def speed():\r\n\r\n algo = ['logistic_sgd', 'logistic_cg', 'mlp', 'convolutional_mlp',\r\n 'dA', 'SdA', 'DBN', 'rbm', 'rnnrbm']\r\n to_exec = [True] * len(algo)\r\n# to_exec = [False] ...
[ "0.679934", "0.6775366", "0.6487424", "0.6471152", "0.6418339", "0.6378135", "0.6274181", "0.6261773", "0.6100292", "0.60983396", "0.6038468", "0.6008453", "0.59768164", "0.5960427", "0.5952964", "0.59192204", "0.5903947", "0.59022474", "0.5896368", "0.58835787", "0.588011", ...
0.7757142
0
This function takes a level (a numpy array) and places the object at random. It also takes an optional parameter called ideal_position to force the algorithm to place said object on said place if it is empty. If that place isn't empty, the algorithm will select an empty position at random. This algorithm modifies the l...
def position_object(level, object_string, placeable_positions=None, ideal_position=None): if ideal_position: if level[ideal_position] == EMPTY: level[ideal_position] = object_string return if placeable_positions == set([]): raise ValueError(f"There are no placeable posit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dispatch_items_randomly(self, level):\n for item in self.list:\n item.position = Item.define_random_position(item, level)", "def get_rand_tree(position):\n max_width = random.randint(50, 100)\n min_width = random.randint(5, 10)\n itter_width = random.randint(5, 20)\n itter_heigh...
[ "0.62657046", "0.58841485", "0.5780916", "0.57509255", "0.57381296", "0.5687422", "0.5588331", "0.55675876", "0.5532268", "0.55043423", "0.54832673", "0.5475558", "0.54514307", "0.5417708", "0.54086894", "0.5363276", "0.5360702", "0.5359083", "0.5353122", "0.535133", "0.53221...
0.6344606
0
This function adds an enemy at random in any of the floor tiles in place.
def add_enemies(level, amount): floor_tiles = get_positions(level, EMPTY) random.shuffle(floor_tiles) for _ in range(min(len(floor_tiles), amount)): pos = floor_tiles.pop() enemy = random.choice([ENEMY1, ENEMY2, ENEMY3]) level[pos] = enemy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spawn_enemies():\n\n enemy_num = random.randint(1,5)\n spawn_box = spawn_boxes[random.randint(0, 3)]\n\n if spawn_box.y <= 0: start = [0, 128]\n elif spawn_box.y >= 640: start = [0, -128]\n elif spawn_box.x <= 0: start = [128, 0]\n elif spawn_box.x >= 640: start = [-128, 0]\n\n x = spawn_b...
[ "0.7069509", "0.6875109", "0.6687566", "0.6642939", "0.6589674", "0.63269234", "0.63249", "0.6316438", "0.6237066", "0.62076664", "0.61932665", "0.61864245", "0.6169646", "0.6110832", "0.60748166", "0.5997652", "0.59964746", "0.59939605", "0.59848565", "0.59831464", "0.597755...
0.7756488
0
This function removes an enemy at random replacing them for floor tiles in place.
def remove_enemies(level, amount): enemy_pos = get_positions(level, ENEMY1) enemy_pos += get_positions(level, ENEMY2) enemy_pos += get_positions(level, ENEMY3) random.shuffle(enemy_pos) for _ in range(min(len(enemy_pos), amount)): pos = enemy_pos.pop() level[pos] = EMPTY
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def take_remove_tile_turn(self, remove_tile_fxn):\n tilesAroundOpponents = []\n for player in self.board.players:\n if not player == self.player:\n x, y = player.x, player.y\n nearbyTiles = self.board.get_removable_tiles_around(x, y)\n tilesArou...
[ "0.6756282", "0.6578938", "0.6368028", "0.6353323", "0.6288392", "0.6196521", "0.61859804", "0.6107032", "0.6084591", "0.60444194", "0.60030633", "0.597222", "0.5966598", "0.5921707", "0.589264", "0.58556813", "0.58181703", "0.5778161", "0.57766193", "0.57622844", "0.5743479"...
0.71985275
0
This function takes a level and adds walls in a row or in a column if mazelike is True, or at random if mazelike is False.
def add_walls(level, amount): placeable_pos = list(get_placeable_positions_inc_path(level)) random.shuffle(placeable_pos) for _ in range(min(len(placeable_pos), amount)): pos = placeable_pos.pop() level[pos] = WALL assert is_solvable(level), "Level isn't solvable. There's a bug in ad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate(self, level):\n # TODO The dungeon's instances are spawned and loaded here.\n # fill map with \"blocked\" tiles\n level.maze = [[Tile(x, y, True) for y in range(level.height)] for x in range(level.width)]\n\n for r in range(level.max_rooms):\n # random width and ...
[ "0.6876265", "0.6516054", "0.6429965", "0.63483196", "0.621235", "0.60248286", "0.6014611", "0.6001514", "0.5975719", "0.59756225", "0.59673595", "0.59558344", "0.59392995", "0.5887236", "0.5887092", "0.587867", "0.58472425", "0.5824042", "0.58144677", "0.5728708", "0.5718844...
0.70530474
0
This function removes {amount} walls in the inner part of the level.
def remove_walls(level, amount): height, width = level.shape inner_level = level[1:height-1, 1:width-1] wall_pos = [(x+1, y+1) for (x,y) in get_positions(inner_level, WALL)] random.shuffle(wall_pos) for _ in range(min(len(wall_pos), amount)): pos = wall_pos.pop() level[pos] = EMPTY
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _remove_walls(current: GridCell, choice: GridCell):\n if choice.x > current.x:\n current.walls[1] = False\n choice.walls[0] = False\n elif choice.x < current.x:\n current.walls[0] = False\n choice.walls[1] = False\n elif choice.y > current.y:\n ...
[ "0.6669705", "0.62802994", "0.61957467", "0.60948914", "0.59552044", "0.58271617", "0.58098435", "0.5787096", "0.57141244", "0.5677796", "0.5673484", "0.54642314", "0.5412543", "0.54086787", "0.5403356", "0.5378274", "0.537228", "0.5346544", "0.5341223", "0.5317386", "0.53164...
0.8167338
0
Test the correctness of a GPTree against a dataset.
def eval_tree(tree: GPTree, dataset: Iterable) -> list: results = [] for data in zip(*dataset): try: output = tree.compute_tree(data[0]) results.append( 0 if output == data[1] else 1 ) # right or wrong, but no error. except Exception: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test(self, dataset) -> None:\n raise NotImplementedError()", "def test_Tree():", "def test(tree, data, name, print_result=True):\n correctness = 0\n\n for test_dict in data:\n current_tree = tree\n while type(current_tree) is not TreeLeaf:\n try:\n curre...
[ "0.6213084", "0.6166914", "0.615361", "0.61207813", "0.5985466", "0.58801496", "0.58662474", "0.58526355", "0.5805036", "0.57705605", "0.5722015", "0.56628764", "0.56300074", "0.5613361", "0.5591549", "0.55806154", "0.55714977", "0.5570216", "0.5565086", "0.5548838", "0.55313...
0.6924719
0
Mutate (a copy) of the tree num_mutation times, and return the percentage of successful mutations.
def mutate_compare( tree: GPTree, num_mutation: int, dataset: tuple ) -> tuple[float, float]: corrected, wrong_answers = 0, 0 for j in range(num_mutation): tree_copy = deepcopy(tree) tree_copy.mutation() eval_result = eval_tree(tree_copy, dataset) if list_equal(eval_result, [...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate ( self, mutation ) :\n\t\tif isinstance( mutation , Mutation ):\n\t\t\tmutation = mutation.to_int()\n\n\t\tassert type( mutation ) is int , 'mutation must work out to a int or have an internal representaiton of int'\n\n\n\t\tfor phenotype, region in self.phenotypes.items():\n\n\t\t\tif mutation > regi...
[ "0.5752211", "0.5665256", "0.56194353", "0.56189704", "0.55831844", "0.5554643", "0.55110043", "0.54711574", "0.546658", "0.5309369", "0.52780664", "0.5274613", "0.52594477", "0.5250121", "0.5200165", "0.51973754", "0.514616", "0.51334417", "0.51302975", "0.5127141", "0.50880...
0.71331596
0
Returns the object associated with the selected option. If there is none selected, it will return the default. If there is none selected and no default, then it will return None.
def getSelected(self): selected = self.defaultChoice if self.tableSelected is not None: selected = self.tableSelected.getString(self.defaultChoice) return self.map.get(selected)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_item(self, option):\n selected_item = None\n items = [item for item in self.items if item.id == option]\n if len(items) > 0:\n selected_item = items[0]\n return selected_item", "def selected(self):\n return self._choices[self._selected][0]", "def selected_o...
[ "0.7156055", "0.68458813", "0.675694", "0.6539312", "0.6476181", "0.64479786", "0.6434399", "0.64323425", "0.63644886", "0.6284368", "0.6248488", "0.62412125", "0.6223481", "0.61877", "0.6180245", "0.6166791", "0.6160753", "0.614588", "0.61024815", "0.60922366", "0.60900766",...
0.73067707
0
Alias for self.get_me() but lazy and with caching.
async def me(self) -> types.User: if not hasattr(self, '_me'): setattr(self, '_me', await self.get_me()) return getattr(self, '_me')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMe(self):\n return self('getMe')", "def me(self):\r\n return Member(self, 'me')", "def me():\n return current_user.get()", "def get_me(self):\n return self._api_call('get', '/me')", "def me(self):\n return User(self, ResourcePath(\"me\", None))", "async def get_me(self) ...
[ "0.74499834", "0.6551658", "0.6282139", "0.6246415", "0.61712277", "0.6143197", "0.6129853", "0.6117795", "0.6093259", "0.5974101", "0.5957396", "0.59498155", "0.59403694", "0.59009767", "0.5900434", "0.58857435", "0.58728683", "0.58081734", "0.5733064", "0.5696561", "0.56942...
0.70557714
1
Download file by file_id to destination
async def download_file_by_id(self, file_id: base.String, destination=None, timeout: base.Integer = 30, chunk_size: base.Integer = 65536, seek: base.Boolean = True): file = await self.get_file(file_id) return await self.download_file(fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _download_file(self, file_id, file_name, path):\n request = self.service.files().get_media(fileId=file_id)\n fh = io.FileIO(path + file_name, 'wb')\n downloader = MediaIoBaseDownload(fh, request)\n done = False\n print('Start download ' + file_name)\n while not done:\n...
[ "0.7663905", "0.751212", "0.7483206", "0.74830407", "0.7481888", "0.7381274", "0.73347574", "0.72252023", "0.71731603", "0.7148918", "0.71000427", "0.7078511", "0.70491886", "0.7038326", "0.6999377", "0.698364", "0.68519497", "0.68437755", "0.6835958", "0.6823059", "0.6821894...
0.7592607
1
Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success. Requires no parameters.
async def delete_webhook(self) -> base.Boolean: payload = generate_payload(**locals()) result = await self.request(api.Methods.DELETE_WEBHOOK, payload) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def on_shutdown():\n # Remove webhook.\n await bot.delete_webhook()", "def delete (self, webhook_id: str) -> NoReturn:\r\n try:\r\n return self.api(\r\n method=\"DELETE\",\r\n endpoint=f\"all/{config('TWITTER_ENV_NAME')}/webhooks/{webhook_id}.json\",\r\...
[ "0.6497652", "0.6384995", "0.6074761", "0.600638", "0.58422136", "0.5825405", "0.5794588", "0.5749265", "0.57441294", "0.56677645", "0.5614371", "0.5531468", "0.5475864", "0.5461781", "0.5430949", "0.54267085", "0.54267085", "0.5416139", "0.5374666", "0.53592205", "0.53320056...
0.71436477
0
Use this method to get current webhook status. Requires no parameters. If the bot is using getUpdates, will return an object with the url field empty.
async def get_webhook_info(self) -> types.WebhookInfo: payload = generate_payload(**locals()) result = await self.request(api.Methods.GET_WEBHOOK_INFO, payload) return types.WebhookInfo(**result)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_status(self):\n r = requests.get(self.base_url + '/status')\n return r.json()", "def webhook(self) -> Optional[pulumi.Input['WebhookArgs']]:\n return pulumi.get(self, \"webhook\")", "def __get_status_api(self):\r\n try:\r\n return Call_shelly_api(url=self.__api_ad...
[ "0.63750786", "0.62557083", "0.62087816", "0.6191062", "0.6176805", "0.61665905", "0.6119854", "0.61036825", "0.60876465", "0.6077727", "0.600287", "0.5995869", "0.59853315", "0.5968422", "0.5968422", "0.5968422", "0.59592545", "0.59138614", "0.5902295", "0.58840424", "0.5882...
0.6399687
0
Use this method to edit live location messages sent by the bot or via the bot (for inline bots). A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation.
async def edit_message_live_location(self, latitude: base.Float, longitude: base.Float, chat_id: typing.Union[base.Integer, base.String, None] = None, message_id: typing.Union[base.Integer, None] = None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def send_location(self, chat_id: typing.Union[base.Integer, base.String], latitude: base.Float,\n longitude: base.Float, live_period: typing.Union[base.Integer, None] = None,\n disable_notification: typing.Union[base.Boolean, None] = None,\n ...
[ "0.61447716", "0.60086536", "0.60046154", "0.5799428", "0.5798248", "0.57214075", "0.5505844", "0.54993886", "0.541418", "0.53947383", "0.53667855", "0.53470784", "0.53172225", "0.53044945", "0.5118792", "0.51045984", "0.5075171", "0.5071682", "0.5016867", "0.5007397", "0.499...
0.7712768
0
Use this method to send information about a venue.
async def send_venue(self, chat_id: typing.Union[base.Integer, base.String], latitude: base.Float, longitude: base.Float, title: base.String, address: base.String, foursquare_id: typing.Union[base.String, None] = None, disable_notification: typi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_venue(self, bot, update, lat, lon, title, address, **kwargs):\n\n return bot.sendVenue(update.message.chat_id, lat, lon, title, address,\n reply_markup=ReplyKeyboardMarkup(self.keyboard),\n resize_keyboard=True,\n *...
[ "0.7467282", "0.5998742", "0.58837694", "0.571061", "0.5702564", "0.56717736", "0.56640244", "0.55833757", "0.55801505", "0.5444701", "0.54058254", "0.54040605", "0.536096", "0.53144175", "0.5308406", "0.5304428", "0.5302464", "0.52628136", "0.52257055", "0.52144784", "0.5205...
0.64537096
1
Use this method to get a list of administrators in a chat.
async def get_chat_administrators(self, chat_id: typing.Union[base.Integer, base.String] ) -> typing.List[types.ChatMember]: payload = generate_payload(**locals()) result = await self.request(api.Methods.GET_CHAT_ADMINISTRATORS, payload) return [types.ChatM...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_administrators(self, *args, **kwargs):\n return self.bot.get_chat_administrators(self.id, *args, **kwargs)", "def get_users_admins_list(self, session):\n\n users = session.query(User.chat_id).all()\n return users", "def get_admin_ids(bot, chat_id):\r\n return [admin.user.id for ...
[ "0.7990867", "0.76068026", "0.7120013", "0.70987684", "0.70987684", "0.70987684", "0.6546187", "0.64803773", "0.6477549", "0.64150256", "0.6410623", "0.63776743", "0.63714683", "0.6349768", "0.62950855", "0.6253433", "0.62402964", "0.62132955", "0.61402994", "0.6135424", "0.6...
0.7943072
1
Use this method to get the number of members in a chat.
async def get_chat_members_count(self, chat_id: typing.Union[base.Integer, base.String]) -> base.Integer: payload = generate_payload(**locals()) result = await self.request(api.Methods.GET_CHAT_MEMBERS_COUNT, payload) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_members_count(self, *args, **kwargs):\n return self.bot.get_chat_members_count(self.id, *args, **kwargs)", "async def membercount(ctx, *args):\n if ctx.message.channel.is_private:\n await bot.delete_message(ctx.message)\n return\n\n g = ctx.message.server\n\n gid = g.id\n ...
[ "0.8535938", "0.7045512", "0.70038784", "0.6915813", "0.68333334", "0.6814858", "0.67744184", "0.6622566", "0.6590299", "0.6495557", "0.6487808", "0.64398223", "0.6420605", "0.6212519", "0.60859007", "0.60826516", "0.6045725", "0.60334086", "0.60332364", "0.59774727", "0.5962...
0.8165247
1
Use this method to get information about a member of a chat.
async def get_chat_member(self, chat_id: typing.Union[base.Integer, base.String], user_id: base.Integer) -> types.ChatMember: payload = generate_payload(**locals()) result = await self.request(api.Methods.GET_CHAT_MEMBER, payload) return types.ChatMember(**result)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_member(self, *args, **kwargs):\n return self.bot.get_chat_member(self.id, *args, **kwargs)", "async def info(self, ctx, *, member: disnake.Member = None):\n\n member = member or ctx.author\n\n e = disnake.Embed(description=\"\")\n\n if member.bot:\n e.description = ...
[ "0.7791598", "0.65381616", "0.64937776", "0.6429221", "0.6413647", "0.6332956", "0.6253612", "0.6214306", "0.6191999", "0.6103144", "0.60794836", "0.6031736", "0.60148335", "0.6008614", "0.5965616", "0.5965616", "0.5965616", "0.5965616", "0.59613687", "0.5944673", "0.5944432"...
0.75161666
1
Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method.
async def set_chat_sticker_set(self, chat_id: typing.Union[base.Integer, base.String], sticker_set_name: base.String) -> base.Boolean: payload = generate_payload(**locals()) result = await self.request(api.Methods.SET_CHAT_STICKER_SET, payload) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sticker_set(bot: Bot, name: str, admin_id: int, sticker_set_prefix: str) -> StickerSet:\n try:\n return bot.get_sticker_set(name)\n except BadRequest as exc:\n if \"invalid\" in str(exc):\n with open(STICKER_SET_LOGO, \"rb\") as sticker:\n bot.create_new_sticke...
[ "0.55621624", "0.5498391", "0.53408676", "0.52049744", "0.5155158", "0.5061027", "0.5038071", "0.5007471", "0.49839172", "0.49656403", "0.4964829", "0.4957087", "0.49349207", "0.49333778", "0.4929602", "0.49242908", "0.49116626", "0.49009898", "0.4844444", "0.48191205", "0.47...
0.6461369
0
Use this method to edit captions of messages sent by the bot or via the bot (for inline bots).
async def edit_message_caption(self, chat_id: typing.Union[base.Integer, base.String, None] = None, message_id: typing.Union[base.Integer, None] = None, inline_message_id: typing.Union[base.String, None] = None, cap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conversation_description(update: Update, context: CallbackContext) -> int:\n chat_id = update.effective_chat.id\n file_id = temp_storage.get(chat_id, \"\")\n description = update.message.text\n\n p = Photo(file_id, chat_id, description)\n add_photo(p)\n\n temp_storage.pop(chat_id, None)\n ...
[ "0.6712417", "0.6051512", "0.6018036", "0.60103804", "0.60097617", "0.59812504", "0.59785295", "0.5978493", "0.59233737", "0.5919862", "0.5917148", "0.5903646", "0.59011906", "0.5859225", "0.5845261", "0.5826212", "0.582165", "0.57945436", "0.57735056", "0.5752771", "0.575277...
0.6285354
1
Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
async def edit_message_reply_markup(self, chat_id: typing.Union[base.Integer, base.String, None] = None, message_id: typing.Union[base.Integer, None] = None, inline_message_id: typing.Union[base.Strin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reply_message(self, update, message, keyboard: List[List[str]] = None, inline_keyboard=False):\n if keyboard is not None:\n if not inline_keyboard:\n update.message.reply_text(message,\n reply_markup=ReplyKeyboardMarkup(\n ...
[ "0.65210825", "0.64386755", "0.62289554", "0.62098664", "0.6208879", "0.62044144", "0.61214274", "0.6058788", "0.60558766", "0.604259", "0.6006311", "0.5990347", "0.59826857", "0.59826857", "0.59826857", "0.59826857", "0.59573996", "0.5929008", "0.592541", "0.59105664", "0.58...
0.6937969
0
Use this method to get a sticker set.
async def get_sticker_set(self, name: base.String) -> types.StickerSet: payload = generate_payload(**locals()) result = await self.request(api.Methods.GET_STICKER_SET, payload) return types.StickerSet(**result)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sticker_set(bot: Bot, name: str, admin_id: int, sticker_set_prefix: str) -> StickerSet:\n try:\n return bot.get_sticker_set(name)\n except BadRequest as exc:\n if \"invalid\" in str(exc):\n with open(STICKER_SET_LOGO, \"rb\") as sticker:\n bot.create_new_sticke...
[ "0.74767673", "0.730071", "0.65737146", "0.609914", "0.5899323", "0.584576", "0.5708728", "0.5630611", "0.5577954", "0.55621547", "0.5537053", "0.55129313", "0.5512399", "0.5468756", "0.54597294", "0.54515886", "0.5433279", "0.5400197", "0.53024924", "0.5262992", "0.5247267",...
0.816935
0
Use this method to upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times).
async def upload_sticker_file(self, user_id: base.Integer, png_sticker: base.InputFile) -> types.File: payload = generate_payload(**locals(), exclude=['png_sticker']) result = await self.send_file('png_sticker', api.Methods.UPLOAD_STICKER_FILE, png_sticker, payload) return types.File(**result)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_upload_image_to_serivce(self):\n url = image_upload_url(self.service_id)\n with tempfile.NamedTemporaryFile(suffix='.jpg') as ntf:\n img = Image.new('RGB', (10, 10))\n img.save(ntf, format='JPEG')\n ntf.seek(0)\n res = self.client.post(url, {'image...
[ "0.60989136", "0.60354024", "0.57841253", "0.5716377", "0.564847", "0.55834883", "0.55747676", "0.5573079", "0.5571249", "0.55512714", "0.5531908", "0.5524271", "0.55130595", "0.54837316", "0.5478993", "0.5464416", "0.54550964", "0.5447844", "0.5437544", "0.5398548", "0.53983...
0.77327746
0
Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set.
async def create_new_sticker_set(self, user_id: base.Integer, name: base.String, title: base.String, png_sticker: typing.Union[base.InputFile, base.String], emojis: base.String, contains_masks: typing.Union[base.Boolean, None] = None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_or_create(session, name, chat, user):\n name = name.lower()\n sticker_set = session.query(StickerSet).get(name)\n if not sticker_set:\n # Create a task for adding a sticker.\n # This task will be processed by a job, since adding a sticker can take quite a while\n ...
[ "0.6126132", "0.6081491", "0.6063581", "0.5805446", "0.56008524", "0.5516832", "0.53947544", "0.5390292", "0.537911", "0.5359913", "0.5275231", "0.5241288", "0.5193254", "0.5166913", "0.5152117", "0.513813", "0.5116448", "0.510349", "0.50846744", "0.5074969", "0.5071933", "...
0.7162943
0
Use this method to delete a sticker from a set created by the bot. The following methods and objects allow your bot to work in inline mode.
async def delete_sticker_from_set(self, sticker: base.String) -> base.Boolean: payload = generate_payload(**locals()) result = await self.request(api.Methods.DELETE_STICKER_FROM_SET, payload) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_sticker_set(context: CCT) -> None:\n bot = context.bot\n admin_id = cast(int, context.bot_data[ADMIN_KEY])\n sticker_set_prefix = cast(str, context.bot_data[STICKER_SET_NAME_KEY])\n\n sticker_set = get_sticker_set(\n bot, build_sticker_set_name(bot, sticker_set_prefix), admin_id, stick...
[ "0.68418777", "0.5678615", "0.5613526", "0.5577408", "0.54829514", "0.5386825", "0.53562564", "0.5326483", "0.52805626", "0.5252555", "0.5252049", "0.5235838", "0.5230914", "0.52285314", "0.5212259", "0.519053", "0.518183", "0.518183", "0.518183", "0.518183", "0.51652455", ...
0.7008481
0
If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot.
async def answer_shipping_query(self, shipping_query_id: base.String, ok: base.Boolean, shipping_options: typing.Union[typing.List[types.ShippingOption], None] = None, error_message: typing.Union[base.String, None] = None) -> base.Boolean: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _assemble_and_send_request(self):\r\n # Fire off the query.\r\n response = self.client.service.processShipment(WebAuthenticationDetail=self.WebAuthenticationDetail,\r\n ClientDetail=self.ClientDetail,\r\n TransactionDet...
[ "0.60649186", "0.60223025", "0.57076615", "0.5564417", "0.5513518", "0.54623425", "0.5378201", "0.5326703", "0.52991426", "0.52991426", "0.52991426", "0.52568734", "0.51945746", "0.5156792", "0.5143426", "0.5109757", "0.50229204", "0.4990119", "0.49679393", "0.496416", "0.496...
0.632263
0
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such precheckout queries.
async def answer_pre_checkout_query(self, pre_checkout_query_id: base.String, ok: base.Boolean, error_message: typing.Union[base.String, None] = None) -> base.Boolean: payload = generate_payload(**locals()) result = await self.request(api.Methods.ANSWER_PRE_CHECKO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def webhook_payment_successful(self, event):\n\n intent = event.data.object\n p_id = intent.id\n pack = intent.metadata.pack\n save_detail = intent.metadata.save_detail\n\n billing_details = intent.charges.data[0].billing_details\n shipping_details = intent.shipping\n ...
[ "0.6260118", "0.6211977", "0.58263457", "0.58254206", "0.5741798", "0.5719997", "0.56042004", "0.56010264", "0.55716336", "0.548527", "0.54411465", "0.5427429", "0.54274267", "0.5387689", "0.5368422", "0.53410625", "0.531948", "0.53180856", "0.5281035", "0.52600944", "0.52417...
0.6384015
0
Parses all messages found in `buffer`.
def parse_messages(buffer): messages = [] message, expected = parse_message(buffer) while message: messages.append(message) message, expected = parse_message(buffer) return messages, expected
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(self, buffer, ignore_binary = False):\n self._buffer = buffer\n self._index = 0\n self._keep_binary = not ignore_binary\n return self._parse()", "def process_messages(self):\n pass", "def parse(self, buffer, ignore_binary = False):\n if buffer == \"\":\n ...
[ "0.6308243", "0.61712545", "0.6151684", "0.6139022", "0.61054057", "0.60950094", "0.6041251", "0.5966716", "0.5920718", "0.588217", "0.58744967", "0.57379323", "0.56501997", "0.5636574", "0.56351095", "0.56131524", "0.55846614", "0.5568359", "0.55157125", "0.5508778", "0.5504...
0.7935604
0
Discard unexpected bytes until a message start or the buffer end is found.
def _discard_until_message_start(buffer): discarded_bytes = bytearray() for index, c in enumerate(buffer): if c not in {MESSAGE_START_BYTE, MESSAGE_FAILURE_BYTE}: discarded_bytes.append(c) else: break if discarded_bytes: buffer[:len(discarded_bytes)] = [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def skip(self):\r\n length = self.next_byte()\r\n while length != b\"\\x00\" and length:\r\n self.next_bytes(parse_int(length, 'big'))\r\n length = self.next_byte()", "def _discard_excess_bytes(self):\n discard_len = min(self._discard, len(self._buffer))\n del se...
[ "0.6518637", "0.6509923", "0.5996722", "0.5991392", "0.59583664", "0.59583664", "0.59414077", "0.58899826", "0.5845345", "0.58346933", "0.5820699", "0.5807118", "0.5782911", "0.5689225", "0.566917", "0.5615318", "0.56149256", "0.5603645", "0.5601141", "0.55972356", "0.5556584...
0.8094288
0