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
Sets the player_a_rating_adjustment of this Game.
def player_a_rating_adjustment(self, player_a_rating_adjustment): self._player_a_rating_adjustment = player_a_rating_adjustment
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def player_a_rating(self, player_a_rating):\n\n self._player_a_rating = player_a_rating", "def player_b_rating_adjustment(self, player_b_rating_adjustment):\n\n self._player_b_rating_adjustment = player_b_rating_adjustment", "def player_b_rating(self, player_b_rating):\n\n self._player_b_r...
[ "0.81710166", "0.7350537", "0.6238224", "0.5933093", "0.5733358", "0.5733358", "0.5576456", "0.55176663", "0.54827565", "0.54711294", "0.54251564", "0.539781", "0.53230685", "0.5264612", "0.52562875", "0.52448636", "0.52171713", "0.5096457", "0.5096457", "0.5091329", "0.50781...
0.9040026
0
Sets the player_b_rating_adjustment of this Game.
def player_b_rating_adjustment(self, player_b_rating_adjustment): self._player_b_rating_adjustment = player_b_rating_adjustment
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def player_b_rating(self, player_b_rating):\n\n self._player_b_rating = player_b_rating", "def player_a_rating_adjustment(self, player_a_rating_adjustment):\n\n self._player_a_rating_adjustment = player_a_rating_adjustment", "def player_a_rating(self, player_a_rating):\n\n self._player_a_r...
[ "0.84605795", "0.6785584", "0.6118386", "0.5667898", "0.5614027", "0.56034553", "0.5589638", "0.54016906", "0.5335416", "0.52572376", "0.50731677", "0.505252", "0.50342023", "0.50341153", "0.5001537", "0.49912506", "0.49864346", "0.4957764", "0.49305597", "0.49127644", "0.488...
0.903613
0
Sets the match_id of this Game.
def match_id(self, match_id): self._match_id = match_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, player_id):\n pass", "def set_match_id(match_id):\n conn = get_connect()\n conn.execute(\"UPDATE match SET isSearched = 1 WHERE matchId = \" + str(match_id))\n conn.commit()\n conn.close()\n print(\"matchId \" + str(match_id) + \" has been searched\")\n return", "def a...
[ "0.6941635", "0.68668336", "0.66586006", "0.66515535", "0.6378987", "0.6378987", "0.62718457", "0.62718457", "0.62718457", "0.6133261", "0.61036193", "0.59934545", "0.5909548", "0.588252", "0.5878106", "0.58763146", "0.5867918", "0.5850785", "0.5738993", "0.570567", "0.565363...
0.84743714
0
Adds a list of cytoband objects to database
def add_cytobands(self, cytobands): LOG.debug(f"Inserting {len(cytobands)} cytoband intervals into database") result = self.cytoband_collection.insert_many(cytobands) LOG.debug(f"Number of inserted documents:{len(result.inserted_ids)}")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_db(car_list: list) -> dict:\n db = CarsDb() # pylint: disable=invalid-name\n db.create_table()\n for _cars in car_list:\n for car in _cars:\n db.add_cars(car)\n db.commit()\n db.close()", "def extend (self, db_list):\n for db in db_list:\n self.appen...
[ "0.65280896", "0.6474675", "0.6398069", "0.60381", "0.59929323", "0.59694403", "0.59540313", "0.5905814", "0.58230734", "0.58040357", "0.5773995", "0.57596177", "0.5729488", "0.57210636", "0.5661529", "0.56500214", "0.5644303", "0.56313354", "0.5625418", "0.5623507", "0.56022...
0.69417334
0
Returns a dictionary of cytobands with chromosomes as keys
def cytoband_by_chrom(self, build="37"): if "38" in str(build): build = "38" else: build = "37" match = {"$match": {"build": build}} group = { "$group": { "_id": "$chrom", "cytobands": { "$push": { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_band_maps(self):\n band_maps = []\n source_band_index = 1\n target_band_index = self.starting_target_band\n for band in self.image['bands']:\n band_maps.append({\n 'source': source_band_index,\n 'target': target_band_index\n ...
[ "0.63961923", "0.6316996", "0.6242813", "0.6224416", "0.6127217", "0.60912484", "0.60851306", "0.6077323", "0.6038242", "0.5990606", "0.59787744", "0.5711337", "0.5703827", "0.5694839", "0.5685335", "0.5667714", "0.56494695", "0.56059813", "0.5526039", "0.5510321", "0.5509816...
0.6918466
0
returns `imgaug BoundingBoxesOnImage` object which can be used to boxes on the image
def get_bounding_boxes_on_image(self, image_shape): return BoundingBoxesOnImage(self.bboxes, image_shape)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bounding_box(img):\n rows = np.any(img, axis=1)\n cols = np.any(img, axis=0)\n rmin, rmax = np.where(rows)[0][[0, -1]]\n cmin, cmax = np.where(cols)[0][[0, -1]]\n # due to python indexing, need to add 1 to max\n # else accessing will be 1px in the box, not out\n rmax += 1\n cmax += ...
[ "0.73006785", "0.7061073", "0.7016004", "0.6997015", "0.6996555", "0.6985397", "0.6981905", "0.6970928", "0.6970363", "0.68584704", "0.6788558", "0.67682064", "0.67322797", "0.6707081", "0.6704685", "0.6648175", "0.6627646", "0.6615074", "0.6561027", "0.65533084", "0.65444976...
0.7467911
0
Given a list of values, return the number of times high is broken >>> arr = np.array([11,12,9,8,13]) >>> list(high_count(arr)) [0, 1, 1, 1, 2]
def high_count(values): length = len(values) arr = np.zeros(length, dtype=np.int16) count = 0 max_val = values[0] for i in np.arange(1, length): if values[i] > max_val: max_val = values[i] count += 1 arr[i] = count return arr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def low_count(values):\n length = len(values)\n arr = np.zeros(length, dtype=np.int16)\n count = 0\n min_val = values[0]\n for i in np.arange(1, length):\n if values[i] < min_val:\n min_val = values[i]\n count += 1\n arr[i] = count\n return arr", "def last_hi...
[ "0.71308786", "0.67923504", "0.6276579", "0.6243201", "0.61764824", "0.61432064", "0.5935874", "0.590811", "0.5905983", "0.58521324", "0.5787228", "0.5758916", "0.57581323", "0.5749915", "0.57492715", "0.57201385", "0.5710379", "0.5701776", "0.57005394", "0.5690722", "0.56736...
0.79292583
0
Given a list of values, return the number of times low is broken >>> arr = np.array([13,14,12,11,9,10]) >>> list(low_count(arr)) [0, 0, 1, 2, 3, 3]
def low_count(values): length = len(values) arr = np.zeros(length, dtype=np.int16) count = 0 min_val = values[0] for i in np.arange(1, length): if values[i] < min_val: min_val = values[i] count += 1 arr[i] = count return arr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def high_count(values):\n length = len(values)\n arr = np.zeros(length, dtype=np.int16)\n count = 0\n max_val = values[0]\n for i in np.arange(1, length):\n if values[i] > max_val:\n max_val = values[i]\n count += 1\n arr[i] = count\n return arr", "async def ...
[ "0.6687898", "0.59021145", "0.5875652", "0.58746266", "0.5855694", "0.58536065", "0.5841549", "0.5823681", "0.5800267", "0.5800267", "0.5797332", "0.5706409", "0.57043064", "0.5671021", "0.5630919", "0.56085753", "0.5604887", "0.5599267", "0.5597285", "0.55907637", "0.554958"...
0.7902696
0
Given a list of values, return an array with the index of the corresponding last highs Note index starts at zero >>> arr = np.array([12,14,11,12,13,18]) >>> list(last_high(arr)) [0, 1, 1, 1, 1, 5]
def last_high(values): length = len(values) arr = np.zeros(length, dtype=np.int32) max_val = values[0] counter = 0 for i in np.arange(1, length): if values[i] > max_val: max_val = values[i] counter = i arr[i] = counter return arr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_high(self):\n return self.data.last('1D').high.iat[0]", "def binarySearch_last(arr=[], find=0):\n min = 0\n max = len(arr) - 1\n result = None\n while min <= max:\n mid = (min + max) / 2\n if arr[mid] == find:\n result = mid\n min = mid + 1 # look r...
[ "0.7242109", "0.65918887", "0.6544895", "0.6467938", "0.6450139", "0.62479717", "0.6244132", "0.6187111", "0.6116131", "0.6113819", "0.61057824", "0.6069469", "0.60632396", "0.6051137", "0.59798074", "0.5966679", "0.5830544", "0.58028775", "0.57961994", "0.57961994", "0.57731...
0.79293066
0
Internal implementation of the image downloading. Opens the URLs file and iterates over each URL.
def _download_images(self, url_file, destination_dir, log_file): logger = self.setup_log(log_file) logger.info(config.LOG_INITIAL_MESSAGE % (url_file, destination_dir)) with open(url_file) as urls: for i, l in enumerate(urls): pass bar = progressbar.ProgressB...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def downloadImages(self):\n\t\ti = 0\n\t\tfor im in self.images:\n\t\t\t# Let's get the file extension and file name and make the final file path. \n\t\t\t# We need to do this to slugify the file name and avoid errors when loading images\n\t\t\tfile_name, file_extension = os.path.splitext(im['url'])\n\t\t\tfile_na...
[ "0.78803545", "0.741669", "0.72933877", "0.7226717", "0.71155745", "0.711161", "0.7077615", "0.69910926", "0.6969075", "0.68928254", "0.68679714", "0.68267655", "0.68218905", "0.6775458", "0.6758594", "0.6738965", "0.67308867", "0.6698974", "0.66714567", "0.6645975", "0.66432...
0.7687683
1
Downloads images from URLs given by the url_file, stores them into the directory destination_dir, and logs the progress in the log_file.
def download_images(self, url_file, destination_dir, log_file): try: self._download_images(url_file, destination_dir, log_file) except IOError as error: sys.stderr.write(str(error)) sys.exit(error.errno) except Exception as error: sys.stderr.write(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _download_images(self, url_file, destination_dir, log_file):\n logger = self.setup_log(log_file)\n logger.info(config.LOG_INITIAL_MESSAGE % (url_file, destination_dir))\n\n with open(url_file) as urls:\n for i, l in enumerate(urls):\n pass\n bar = progressb...
[ "0.87778664", "0.7013445", "0.69618165", "0.6846969", "0.6748923", "0.66912276", "0.6671626", "0.66698825", "0.6666592", "0.66486555", "0.66068697", "0.6581736", "0.6539759", "0.65313685", "0.65105104", "0.65020895", "0.648967", "0.64734596", "0.64350826", "0.6407587", "0.636...
0.8535847
1
Convert from a psmeca Sm format string to a SymMT object
def psmeca2SymMT( string ): # convert first 12 columns into array mtline = NP.fromstring( string, count=12, sep =' ', dtype=float ) # get the location part c = mtline[0:3] # assume lon/lat/depth are centroid h = NP.array( [mtline[10], mtline[11], mtline[2]] ) # assume second lon/lat are hypoc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def psmeca2EigMT( string ): \n \n # convert first 12 columns into array\n mtline = NP.fromstring( string, count=12, sep =' ', dtype=float )\n \n # get the location part\n c = mtline[0:3] # assume lon/lat/depth are centroid\n h = NP.array( [mtline[10], mtline[11], mtline[2]] ) # assume second l...
[ "0.64555776", "0.6072237", "0.5941381", "0.5923099", "0.5500192", "0.54345137", "0.5423918", "0.539085", "0.5381176", "0.5208619", "0.51720643", "0.5168524", "0.51670635", "0.51506907", "0.5129304", "0.51136523", "0.5053754", "0.50467676", "0.50440377", "0.501633", "0.4981564...
0.80408126
0
Convert from a psmeca Sm format string to a EigMT object
def psmeca2EigMT( string ): # convert first 12 columns into array mtline = NP.fromstring( string, count=12, sep =' ', dtype=float ) # get the location part c = mtline[0:3] # assume lon/lat/depth are centroid h = NP.array( [mtline[10], mtline[11], mtline[2]] ) # assume second lon/lat are h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def psmeca2SymMT( string ): \n\n # convert first 12 columns into array\n mtline = NP.fromstring( string, count=12, sep =' ', dtype=float )\n \n # get the location part\n c = mtline[0:3] # assume lon/lat/depth are centroid\n h = NP.array( [mtline[10], mtline[11], mtline[2]] ) # assume second lon/l...
[ "0.6330677", "0.601451", "0.55377746", "0.5511349", "0.5498", "0.5460986", "0.53059566", "0.5282362", "0.52589643", "0.52587265", "0.5222153", "0.52134115", "0.51957136", "0.5180492", "0.512726", "0.5088043", "0.5087436", "0.5049602", "0.5042577", "0.5039193", "0.5031885", ...
0.79937345
0
From an input file or stdin, read a list of moment tensors in psmeca form Expected format lon/lat/z/mrr/mtt/mpp/mrt/mrp/mtp/exp/lon0/lat0/str/anything else if isEig is false, return list of SymMT objects, otherwise get a list of EigMT objects
def read_psmecalist( istream , isEig=False ): mtlist=[] # this will be the output list # read everything alltxt = NP.genfromtxt( istream, delimiter='\n' , dtype=str) try: istream.close() except: tmp=1 # loop through all tensors n = len(alltxt) # check for desired out...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def psmeca2EigMT( string ): \n \n # convert first 12 columns into array\n mtline = NP.fromstring( string, count=12, sep =' ', dtype=float )\n \n # get the location part\n c = mtline[0:3] # assume lon/lat/depth are centroid\n h = NP.array( [mtline[10], mtline[11], mtline[2]] ) # assume second l...
[ "0.6658475", "0.6070183", "0.60173386", "0.56104475", "0.5587364", "0.5542085", "0.5493325", "0.54809505", "0.5463508", "0.54497206", "0.5433617", "0.5410467", "0.5403503", "0.5391849", "0.53836143", "0.53776634", "0.5351196", "0.535097", "0.53310233", "0.5329605", "0.530887"...
0.77015275
0
Convert from a lon/lat/depth/strike/dip/rake/mag string to a double couple type
def sdr2dc( string ): # convert first 7 columns into array try: data = NP.fromstring( string, count=7, sep =' ', dtype=float ) except IndexError: print >> sys.stderr, "Error: Require 7 columns: lon/lat/depth/strike/dip/rake/mag" return None # get variables hypo = data[0:3 ] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert(coords):\n lat = coords[:4]\n lon = coords[4:]\n\n lat = lat[:2] + \".\" + lat[2:]\n\n if int(lon[0]) > 5:\n lon = \"-\" + lon[:2] + \".\" + lon[2:]\n else:\n lon = \"-1\" + lon[:2] + \".\" + lon[2:]\n\n return (float(lat), float(lon))", "def _parse_ra_dec(coord_str):\...
[ "0.5970741", "0.59387934", "0.59290093", "0.59290093", "0.5781259", "0.56974715", "0.56738037", "0.5610365", "0.55993795", "0.5574758", "0.55611956", "0.55337924", "0.551011", "0.55073005", "0.54503554", "0.53815985", "0.53663087", "0.5364104", "0.5358592", "0.53561544", "0.5...
0.64489216
0
Perform a full update of the orderbook, asks and bids are expected to be in ascending and descending order respectively
def updateOrderbookFull(self, asks, bids): self.asks = asks self.bids = bids
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_order():", "def update_order():", "def update(self, book_info, destroy):\n self.connect()\n is_issue = len(book_info) == 2\n\n bid = book_info[0].get()\n if is_issue:\n issue_to = book_info[1].get()\n\n if is_issue:\n extract_bid = f\"select b...
[ "0.7094027", "0.7094027", "0.6515729", "0.64941806", "0.6293617", "0.6264788", "0.6104545", "0.6064261", "0.59736687", "0.591912", "0.5854378", "0.5806818", "0.57774216", "0.5761083", "0.57600677", "0.5716418", "0.5709784", "0.56838304", "0.5666011", "0.5658304", "0.564571", ...
0.78466827
0
Voice Shuffle the playing queue. Accepts no arguments.
def on_shuffle(self, event): self.pre_check(event) shuffle(self.get_player(event.guild.id).queue) api_loop(event.channel.send_message, "Queue shuffled.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def shuffle(self, ctx: commands.Context) -> Optional[bool]:\n\n queue = self.queue[ctx.guild.id]\n\n queue.shuffle = not queue.shuffle\n if queue.shuffle:\n queue.original_queue = queue.queue\n\n play_queue = queue.queue[queue.pos + 1 :]\n shuffled_queue ...
[ "0.6754124", "0.61670613", "0.6148838", "0.6137774", "0.6137774", "0.6024911", "0.59862536", "0.59546244", "0.59360856", "0.5931226", "0.58906937", "0.5836928", "0.5814776", "0.5808147", "0.5798833", "0.5793498", "0.57764506", "0.57740307", "0.573743", "0.573743", "0.573743",...
0.6967331
0
Voice Get the information of a certain song in the queue or the amount of songs in the queue. If an integer argument is input, then this will return the relevant queue entry. If a string is input, then the string will be used to search for queue entry titles. Otherwise, if no arguments are passed, this will return the ...
def on_queued_command(self, event, index=None): self.pre_check(event) if not self.get_player(event.guild.id).queue: api_loop( event.channel.send_message, "There aren't any songs queued right now.", ) elif index is None: api_loop...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def queue(self, ctx):\n state = self.get_voice_state(ctx.message.server)\n if state.voice is None:\n await self.bot.say('**Not in a voice channel!**')\n return False\n if not state.songs:\n await self.bot.say('**Song queue is empty!**')\n retur...
[ "0.58874625", "0.57933635", "0.57293785", "0.5726627", "0.5717032", "0.568477", "0.5672505", "0.56646675", "0.56352663", "0.5583631", "0.5564733", "0.55526024", "0.545143", "0.5411789", "0.5408162", "0.53968614", "0.5395845", "0.5395595", "0.53679144", "0.53476036", "0.533948...
0.6463423
0
Voice Move an item that's already queued to the front of the queue by index. Only accepts a single integer argument (the index of the target queue item).
def on_queue_next_command(self, event, index): self.pre_check(event) self.same_channel_check(event) if 1 < index <= len(self.get_player(event.guild.id).queue): index -= 1 self.get_player(event.guild.id).queue.insert( 0, self.get_player(even...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def moveTo(self, index):\n\n await self.VoiceClient.http.setQueueSource(self.tag, {\"index\": index})\n\n return self", "def MoveItem(src_queue, trg_queue, order_func):\n score, item = heapq.heappop(src_queue)\n score = - float(order_func(- score, item))\n heapq.heappush(trg_queue, (score,...
[ "0.7173604", "0.6445944", "0.6257959", "0.6167987", "0.6000821", "0.6000821", "0.5986443", "0.5971937", "0.5970165", "0.59335166", "0.5919013", "0.5912924", "0.5876682", "0.58699167", "0.5845589", "0.58440965", "0.5759581", "0.5729532", "0.572736", "0.56740284", "0.56264627",...
0.7288909
0
View the timeline of a transaction
def get_transaction_history(self, txn_id_or_ref): response = self.get(f"{self.gateway_path}/timeline/{txn_id_or_ref}") return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def history():\n\n #Query transactions by user id\n trans = Transactions.query.filter_by(owner=session['user_id']).all()\n\n #Convert Price to US Dollars and format transaction time\n for t in trans:\n t.price = usd(t.price)\n t.transacted = t.transacted.strftime('%Y-%m-%d %H:%M:%S')\n\n ...
[ "0.66819555", "0.66066486", "0.6323791", "0.6302746", "0.6277081", "0.6261644", "0.62445635", "0.62431467", "0.62283117", "0.62170583", "0.62170583", "0.62117505", "0.621032", "0.6209831", "0.6196624", "0.6149073", "0.6040678", "0.60146815", "0.5949876", "0.5923738", "0.59084...
0.68347484
0
return the index corresponding at the first occurence of value in list
def index(liste, value): for ii in range(len(liste)): if liste[ii] == value: return ii return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index(self, value):\n self.__validate_value(value)\n for index, v in enumerate(self.__list):\n if v == value:\n return index", "def closest_value_index(val, lst):\n index = 0\n for item in lst:\n if item > val:\n return index\n index += 1...
[ "0.7666883", "0.75553674", "0.75322366", "0.73974407", "0.7306116", "0.72406524", "0.71949124", "0.71868026", "0.7173489", "0.71538794", "0.71089154", "0.7069118", "0.7064808", "0.70324296", "0.7016907", "0.70150346", "0.69772476", "0.69540596", "0.69502425", "0.69284594", "0...
0.81286085
0
Creates job_params dict for api call to launch a Plexus job. Some parameters required to launch a job are not available to the user in the Plexus UI. For example, an app id is required, but only the app name is provided in the UI. This function acts as a backend lookup of the required param value using the userprovided...
def construct_job_params(self, hook: Any) -> dict[Any, Any | None]: missing_params = self.required_params - set(self.job_params) if missing_params: raise AirflowException(f"Missing the following required job_params: {', '.join(missing_params)}") params = {} for prm in self.jo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_job_spec(\n self,\n job_id: Text,\n training_input: Dict[Text, Any],\n job_labels: Optional[Dict[Text, Text]] = None) -> Dict[Text, Any]:\n\n job_spec = {\n 'jobId': job_id,\n 'trainingInput': training_input,\n 'labels': job_labels,\n }\n return job_spe...
[ "0.623002", "0.6157073", "0.6141183", "0.6118042", "0.59162587", "0.58894557", "0.58691126", "0.5811645", "0.57410806", "0.5705661", "0.5667334", "0.5509608", "0.5486221", "0.54622126", "0.5394866", "0.5381501", "0.53673935", "0.5350924", "0.5328032", "0.52987236", "0.5291762...
0.76147777
0
method to set the name of the render_database
def set_render_database_name(self, file_name): try: self.render_database=file_name self.filepath_render_database = os.path.join(self.filepath, self.render_database) print("set render_database filename to", file_name) except: print("setting render database ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_name(self, db_name):\n\n self._db_name = db_name", "def get_db_name(self):\n\t\treturn conf.db_name", "def db_name(self):\n return self._db_name", "async def set_db_name_field(self, db_name_field):\n self.db_name_field = db_name_field", "def get_name(self) -> str:\n retur...
[ "0.7080127", "0.6651994", "0.6637986", "0.6630052", "0.6611546", "0.6575934", "0.65543795", "0.65191627", "0.6510718", "0.65007985", "0.6497756", "0.6437254", "0.6436953", "0.6349015", "0.63008165", "0.6236277", "0.61813396", "0.61277485", "0.6054977", "0.6046384", "0.6044267...
0.8418282
0
method to set the name of the object_database
def set_object_database (self, file_name): try: self.object_database=file_name self.filepath_object_database = os.path.join(self.filepath, self.object_database) print("set object_database filename to", file_name) except: print("setting object database fail...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_name(self, db_name):\n\n self._db_name = db_name", "def db_name(self):\n return self._db_name", "def get_name(self) -> str:\n return self.dbname", "def getDatabaseName(self):\n raise NotImplementedError", "def get_db_name(self):\n\t\treturn conf.db_name", "def set_objec...
[ "0.72566205", "0.7061423", "0.7017317", "0.7010737", "0.68976414", "0.68876076", "0.6882641", "0.6880423", "0.68634754", "0.68143404", "0.6771887", "0.6689018", "0.6677643", "0.6660668", "0.66574013", "0.66081303", "0.6601504", "0.65738755", "0.6570008", "0.6501405", "0.64925...
0.76832587
0
method to set the name of the output_database
def set_output_database (self, file_name): try: self.object_database=file_name self.filepath_output_database = os.path.join(self.filepath, self.output_database) print("set output_database filename to", file_name) except: print("setting object database fail...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def database_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"database_name\")", "def getDatabaseName(self):\n raise NotImplementedError", "def get_db_name(self):\n\t\treturn conf.db_name", "def get_name(self) -> str:\n return self.dbname", "def db_name(self, db_name):\n\n...
[ "0.71581715", "0.7139252", "0.70207834", "0.6973042", "0.6896915", "0.6870785", "0.6853191", "0.6820632", "0.668634", "0.6684695", "0.6680187", "0.66756105", "0.66751665", "0.66531605", "0.6643873", "0.66307545", "0.6598226", "0.65926546", "0.6548423", "0.65220237", "0.640572...
0.8193771
0
method to import excel data to the correct database
def import_excel(self, filepath_excel,database_type): if database_type == "render": try: connection = sqlite3.connect(self.filepath_render_database) pointer = connection.cursor() sql_anweisung = """ INSERT INTO render_information ( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def importXlsxIntoDb(input):\n #import global variable\n global UPLOAD_ID\n global PATIENT_NUM\n global DATABASE\n\n connection = db.create_connection(DATABASE)\n\n xlsx = pd.read_excel(input)\n\n #looping on each row\n print(\" - Importing data in DB\", end = '')\n for index, row in xls...
[ "0.76412356", "0.70799965", "0.70136434", "0.7009659", "0.67064077", "0.66789573", "0.6583739", "0.656014", "0.6531297", "0.6317989", "0.6263179", "0.6260795", "0.61410016", "0.6118086", "0.6028901", "0.60090876", "0.60072404", "0.600629", "0.5996244", "0.5956326", "0.5956222...
0.75868785
1
establish connection to frontend notebook
def connect(): if not is_notebook(): print('Python session is not running in a Notebook Kernel') return global _comm kernel = get_ipython().kernel kernel.comm_manager.register_target('tdb', handle_comm_opened) # initiate connection to frontend. _comm = Comm(target_name='tdb', d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_notebook():\n \n # Note: not using IPython Comm objects yet, since they seem rather\n # undocumented and I could not get them to work when I tried for a bit.\n # This means though, that flexx in the notebook only works on localhost.\n \n from IPython.display import display, clear_output,...
[ "0.69533813", "0.6855013", "0.67147774", "0.6329623", "0.628003", "0.62060857", "0.61278397", "0.61278397", "0.6008197", "0.5966993", "0.5948698", "0.59225404", "0.5851347", "0.5850793", "0.5850793", "0.5850793", "0.5850793", "0.5850793", "0.5850793", "0.5850793", "0.5850793"...
0.82992566
0
sends figure to frontend
def send_fig(fig, name): imgdata = BytesIO() fig.savefig(imgdata, format='png') imgdata.seek(0) # rewind the data uri = 'data:image/png;base64,' + urllib.parse.quote( base64.encodebytes(imgdata.getbuffer())) send_action("update_plot", params={"src": uri, "name": name})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_figure(self):\n\n self.draw()", "def fig_response(fig):\n img_bytes = io.BytesIO()\n fig.savefig(img_bytes)\n img_bytes.seek(0)\n return send_file(img_bytes, mimetype='image/png')", "def update_plot():\n pass", "def draw(self):\n self.figure.show()\n self.fi...
[ "0.7138022", "0.6838671", "0.6577294", "0.6567905", "0.65288734", "0.64819086", "0.6415332", "0.6354225", "0.6308796", "0.62955534", "0.62464154", "0.6243661", "0.62136626", "0.6211995", "0.6189271", "0.6188972", "0.6187396", "0.6175288", "0.61647385", "0.61150765", "0.610632...
0.71985286
0
Creates a Qt's MIME data object for data in valid QmxGraph's drag&drop format.
def create_qt_mime_data(data): from PyQt5.QtCore import QByteArray, QDataStream, QIODevice, QMimeData item_data = QByteArray() data_stream = QDataStream(item_data, QIODevice.WriteOnly) qgraph_mime = { 'version': qmxgraph.constants.QGRAPH_DD_MIME_VERSION, } qgraph_mime.update(data) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _on_drop(self, event):\n data = event.mimeData().data(constants.QGRAPH_DD_MIME_TYPE)\n if not data.isNull():\n data_stream = QDataStream(data, QIODevice.ReadOnly)\n parsed = json.loads(data_stream.readString().decode('utf8'))\n\n # Refer to `mime.py` for docs abou...
[ "0.6764802", "0.57681173", "0.57338566", "0.54429924", "0.54129314", "0.5173887", "0.49697393", "0.49251208", "0.4924302", "0.49108702", "0.48752618", "0.48632976", "0.48584068", "0.48275545", "0.47537842", "0.47520423", "0.47033548", "0.46772367", "0.46584952", "0.46547464", ...
0.7841038
0
execute the NFS call If an error code is specified in the exceptions it means that the caller wants to handle the error himself
def execute(self, ops, exceptions=[], delay=5, maxretries=3): retry_errors = [NFS4ERR_DELAY, NFS4ERR_GRACE] state_errors = [NFS4ERR_STALE_CLIENTID, NFS4ERR_BADSESSION, NFS4ERR_BADSLOT, NFS4ERR_DEADSESSION] while True: res = self.sess.compound(ops) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shellExecErrorCode(cmd):\n return subprocess.call(cmd, shell=True)", "def _runCommandRaiseIfFail (self, command, killTimeout = DEAFULT_KILL_TIMEOUT, warningTimeout = DEAFULT_WARNING_TIMEOUT, shell=False):\n (rc,outText,errText) = self._runCommand(command, killTimeout = killTimeout, warningTimeout =...
[ "0.55850905", "0.55532014", "0.5517713", "0.54477644", "0.5419037", "0.53720886", "0.53673285", "0.53601074", "0.5353408", "0.5334857", "0.5279487", "0.52709293", "0.52592814", "0.524232", "0.5225657", "0.52237153", "0.51882654", "0.5178912", "0.5161693", "0.5132047", "0.5129...
0.62338924
0
Populates a postgres DB with a `test_df` table in the `connection_test` schema to test DataConnectors against
def test_connectable_postgresql_db(sa, test_backends, test_df): if "postgresql" not in test_backends: pytest.skip("skipping fixture because postgresql not selected") url = get_sqlalchemy_url( drivername="postgresql", username="postgres", password="", host=os.getenv("GE_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_from_dataframe(self):\n self.insert()\n data = self.tbl.select()\n data.index.name = None\n tbl = Table.create(':memory:', \"Foo_2\", data, verbose=True,\n primary_key='id', autoincrement=True)\n self.check(self.idata, tbl.select())", "...
[ "0.6764111", "0.6593601", "0.65928036", "0.65928036", "0.65928036", "0.6573342", "0.65390044", "0.6480772", "0.6448915", "0.6418131", "0.63582337", "0.6346796", "0.62995", "0.6225315", "0.62085634", "0.6200947", "0.61726683", "0.6159483", "0.61411804", "0.61193913", "0.610785...
0.7746262
0
Tests the golden path for setting up a StreamlinedSQLDatasource using test_yaml_config
def test_golden_path_sql_datasource_configuration( mock_emit, caplog, empty_data_context_stats_enabled, sa, test_connectable_postgresql_db, ): context: DataContext = empty_data_context_stats_enabled with set_directory(context.root_directory): # Everything below this line (except for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pytest_configure():\n exec(open(\"script/generate_sql\").read())", "def test_export_datasources_original(app_context, fs):\n # pylint: disable=reimported, redefined-outer-name\n import superset.cli.importexport # noqa: F811\n\n # reload to define export_dashboards correctly based on the\n # f...
[ "0.65528226", "0.60728145", "0.6067507", "0.600542", "0.59881943", "0.59565294", "0.59358394", "0.5818095", "0.57616323", "0.5759329", "0.57457626", "0.57400787", "0.57036346", "0.56909466", "0.567239", "0.5665459", "0.5654157", "0.56532407", "0.56267065", "0.55962425", "0.55...
0.6693482
0
Tests the golden path for InferredAssetFilesystemDataConnector with PandasExecutionEngine using test_yaml_config
def test_golden_path_inferred_asset_pandas_datasource_configuration( mock_emit, caplog, empty_data_context_stats_enabled, test_df, tmp_path_factory ): base_directory = str( tmp_path_factory.mktemp("test_golden_path_pandas_datasource_configuration") ) create_files_in_directory( directory...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_golden_path_runtime_data_connector_pandas_datasource_configuration(\n mock_emit, caplog, empty_data_context_stats_enabled, test_df, tmp_path_factory\n):\n base_directory = str(\n tmp_path_factory.mktemp(\"test_golden_path_pandas_datasource_configuration\")\n )\n\n create_files_in_direct...
[ "0.7546321", "0.7450935", "0.73727494", "0.6266979", "0.6182107", "0.60948265", "0.6030717", "0.5940892", "0.5830706", "0.5804082", "0.5795107", "0.5780373", "0.5757029", "0.57562345", "0.57373863", "0.5730367", "0.5712738", "0.5712368", "0.56968", "0.5679923", "0.56575793", ...
0.75466603
0
Tests output of test_yaml_config() for a Datacontext configured with a Datasource with RuntimeDataConnector. Even though the test directory contains multiple files that can be readin by GX, the RuntimeDataConnector will output 0 data_assets, and return a "note" to the user. This is because the RuntimeDataConnector is n...
def test_golden_path_runtime_data_connector_pandas_datasource_configuration( mock_emit, caplog, empty_data_context_stats_enabled, test_df, tmp_path_factory ): base_directory = str( tmp_path_factory.mktemp("test_golden_path_pandas_datasource_configuration") ) create_files_in_directory( d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_golden_path_runtime_data_connector_and_inferred_data_connector_pandas_datasource_configuration(\n mock_emit, caplog, empty_data_context_stats_enabled, test_df, tmp_path_factory\n):\n base_directory = str(\n tmp_path_factory.mktemp(\"test_golden_path_pandas_datasource_configuration\")\n )\n...
[ "0.6210851", "0.60284483", "0.6026436", "0.5509853", "0.5421516", "0.5384713", "0.5326231", "0.5324207", "0.5301481", "0.5286421", "0.5233528", "0.52224165", "0.51863563", "0.5100882", "0.5086977", "0.507586", "0.5057573", "0.5057573", "0.50360197", "0.5035163", "0.5032041", ...
0.655488
0
Tests output of test_yaml_config() for a Datacontext configured with a Datasource with InferredAssetDataConnector and RuntimeDataConnector. 1. The InferredAssetDataConnector will output 4 data_assets, which correspond to the files in the test_dir_charlie folder 2. RuntimeDataConnector will output 0 data_assets, and ret...
def test_golden_path_runtime_data_connector_and_inferred_data_connector_pandas_datasource_configuration( mock_emit, caplog, empty_data_context_stats_enabled, test_df, tmp_path_factory ): base_directory = str( tmp_path_factory.mktemp("test_golden_path_pandas_datasource_configuration") ) create_f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_golden_path_runtime_data_connector_pandas_datasource_configuration(\n mock_emit, caplog, empty_data_context_stats_enabled, test_df, tmp_path_factory\n):\n base_directory = str(\n tmp_path_factory.mktemp(\"test_golden_path_pandas_datasource_configuration\")\n )\n\n create_files_in_direct...
[ "0.6569703", "0.63541687", "0.6163136", "0.5435593", "0.52773416", "0.5255355", "0.5180936", "0.510481", "0.509443", "0.5093699", "0.50851494", "0.50355923", "0.50091726", "0.50006497", "0.499144", "0.49418464", "0.49240813", "0.4921885", "0.4911996", "0.49098986", "0.4870709...
0.65214986
1
Used by flask to initialize a user
def init_user( app ): login_manager.init_app(app) app.register_blueprint(user)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init():\n create_user(app)\n get_all_user()", "def user_init(self):\n pass", "def setup_user():\n if 'auth_user' in flask.session:\n user = models.User.query.get(flask.session['auth_user'])\n if user is None:\n # old bad cookie, no good\n del flask.sessio...
[ "0.829152", "0.758554", "0.7491351", "0.73094636", "0.72450036", "0.7144329", "0.7079882", "0.6995411", "0.69382924", "0.69301695", "0.68964845", "0.68418664", "0.68159044", "0.6811671", "0.6796923", "0.6795561", "0.67746", "0.67692834", "0.6762055", "0.6730134", "0.67115355"...
0.77850324
1
Splits X in time if it is chronologically sorted.
def time_split(X, test_size=0.1): split_index = int(len(X)*(1 - test_size)) return X[:split_index], X[split_index:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_by_timegap(X, timename='time', hours=1):\n \n time = X[timename].values\n dt = np.diff(time)\n\n # print(len(time))\n \n i = [int(ii) for ii in np.where(dt>np.timedelta64(hours, 'h'))[0]] + [len(time)-1]\n i = [-1] + list(set(i))\n i.sort()\n \n # print('Split index'...
[ "0.69730914", "0.6158432", "0.6031342", "0.5992386", "0.5956518", "0.5774354", "0.5740947", "0.5668877", "0.5631412", "0.5549076", "0.55123365", "0.5393284", "0.5385934", "0.53507435", "0.530311", "0.5302109", "0.52849704", "0.5250058", "0.5211332", "0.51921046", "0.51773995"...
0.6935556
1
_Implement this method_ Write a function that takes as input an input file and and output file name. Read the input file and write to the output file the courses listed with the semester that they occur in. For example 'cs 121' in the input file would be 'cs 121 fall' in the output file.
def addSemester(inputFile, outputFile): fall_classes = ['cs 121', 'cs 223', 'cs 260', 'cs 215'] spring_classes = ['cs 122', 'cs 166', 'cs 224', 'cs 251', 'cs 261'] with open(inputFile, 'r') as f: newlist = f.readlines() for i in range(len(newlist)): newlist[i] = new...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_to_latex(codelist, unwanted_courses):\n # TODO: investigate a way to add large amounts of text outside of the\n # function\n abstract01 = \"I created this document to practice parsing html and using\\\n tools like Beautiful Soup which I've previously had little experience\\\n in. A...
[ "0.5756077", "0.56120145", "0.55398047", "0.53964037", "0.53702533", "0.537013", "0.53571147", "0.5315433", "0.5303923", "0.5292199", "0.5276437", "0.52718467", "0.5271242", "0.52504164", "0.52265584", "0.519093", "0.51793826", "0.51728696", "0.5169168", "0.51610035", "0.5160...
0.70653456
0
_Implement this method_ Write a function that takes as input an input file and stores the contents in a matrix. Each row in the matrix should be a line in the input file. Each element in a row should be an element from the line, delimited by a tab.
def storeTabDelimitedFile(inputFile): list0 = [] with open(inputFile, 'r') as f: newlist = f.readlines() #print(newlist) for i in range(len(newlist)): #newlist[i] = newlist[i].strip('\t') newlist[i] = newlist[i].strip('\n') # this makes the matrix easier to read...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MatrixToFile(self):\n # open text file\n file = open(\"intersection_matrix.txt\", 'w')\n # write opening square bracket for matrix\n file.write(\"[\")\n # use for loop to write in the matrix\n for i in range(self.rows):\n # square brackets to append in eleme...
[ "0.6438186", "0.6260845", "0.6211034", "0.61225104", "0.61192155", "0.6067222", "0.59721917", "0.5874142", "0.58524245", "0.58170664", "0.5776375", "0.5770828", "0.5763248", "0.5702263", "0.5634613", "0.5628356", "0.56093055", "0.5561605", "0.55224174", "0.5520379", "0.551776...
0.6892157
0
Prints and flushes the things passes as arguments.
def printnflush(*args): if pyscheduler.verbose: print args sys.stdout.flush()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pflush(*args, **kwargs):\n print(*args, **kwargs)\n sys.stdout.flush()", "def print_flush(msg):\n print(msg, end='')\n sys.stdout.flush()", "def output(*args):\n print(*args, end='', file=file)", "def out(*args):\r\n print(*args)", "def printwf(data):\n print data #...
[ "0.7685068", "0.7031397", "0.69741064", "0.6884889", "0.67748654", "0.6692131", "0.6624699", "0.66217965", "0.6615985", "0.6506932", "0.6432913", "0.6390469", "0.6375495", "0.6357373", "0.6350542", "0.6315522", "0.628105", "0.6269504", "0.6254084", "0.62510514", "0.62450105",...
0.7230101
1
Helper function to run tasks inside a process. It implements an infinite loop controlled by the messages received from 'pipe_end'.
def run_task(process_name, tasks, pipe_end): task_ended = False try: while not task_ended: # Blocks until it receives a message message_type, value = pipe_end.recv() if message_type == "EXECUTE": result = tasks[value].run() pipe_end.se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n while self.container.process(): pass", "def non_blocking_streamlit(process: psutil.Popen) -> None:\n while process.is_running():\n process.communicate()", "def run(self):\n while True:\n cmd, flag = self.Q['in'].get()\n if flag == 'stop':\n brea...
[ "0.6293807", "0.6225486", "0.62050015", "0.61386853", "0.61101425", "0.6040808", "0.6030226", "0.6017932", "0.59379154", "0.58778286", "0.5862268", "0.58200634", "0.58104557", "0.5759573", "0.5742945", "0.5714849", "0.56924564", "0.5676682", "0.56600606", "0.5646844", "0.5613...
0.7024238
0
Creates the process that will be in charge of executing the tasks and a pipe to communicate with the main process.
def __init__(self, process_name, target_function, tasks): self.pipe_start, self.pipe_end = multiprocessing.Pipe() printnflush ("Process started: %s"%process_name) self.process = multiprocessing.Process(group=None, target=target_function, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spawn(self):\n self._proc = subprocess.Popen(\n self._args, stdout=subprocess.PIPE, stderr=subprocess.PIPE\n )", "def spawn(self, pcls, args):\n\n childp, ownp = multiprocessing.Pipe()\n p = pcls(self._id, childp)\n p._loglevel = self._loglevel\n p.start()...
[ "0.6289883", "0.6266566", "0.6023925", "0.6001324", "0.5990925", "0.59712356", "0.5920482", "0.58967435", "0.58738995", "0.5843958", "0.5802889", "0.5784489", "0.5773565", "0.57671195", "0.57264394", "0.5718598", "0.56604475", "0.5654954", "0.5608592", "0.5602501", "0.5568197...
0.6642339
0
Sends the process an "EXECUTE" task message to run the task named 'task_name'.
def execute_task(self, task_name): self.busy = True self.pipe_start.send(("EXECUTE",task_name))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calltask(self, name, **vars):\n if name in self._tasks:\n for entry in self._tasks[name]:\n entry.execute(vars)\n else:\n raise Error(\"No such task: {0}\".format(name))", "def doTask(self, *args):\n taskId = self.task.get()\n document = self.d...
[ "0.67628795", "0.67263645", "0.6693782", "0.6614726", "0.65432596", "0.62563705", "0.62268275", "0.61100656", "0.60212255", "0.59888965", "0.5962691", "0.5941963", "0.5929463", "0.5922408", "0.5921233", "0.59052026", "0.5753579", "0.57175267", "0.56979007", "0.56960267", "0.5...
0.77790886
0
Sets the 'busy' flag in order to mark this task executor as busy (its associated process is performing a task)
def set_task_finished(self): self.busy = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_busy(self, busy):\n if busy:\n self.hjson_button.setDisabled(True)\n self.loading.setHidden(False)\n self.loading_movie.start()\n else:\n self.hjson_button.setDisabled(False)\n self.loading.setHidden(True)\n self.loading_movie....
[ "0.70856065", "0.6832197", "0.6694359", "0.62857145", "0.62733877", "0.6099452", "0.6085377", "0.60533494", "0.6050232", "0.6013056", "0.59043485", "0.57955724", "0.5726104", "0.5645821", "0.5613755", "0.55460453", "0.5537266", "0.5512436", "0.5508247", "0.5469994", "0.544543...
0.6956033
1
Sends a finalization message (forces the associated process to break the loop and end)
def finalize(self): self.busy = False self.pipe_start.send(("FINISH",None)) self.process.join() if self.process.is_alive(): self.process.terminate()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def finalize(self):\n sys.stderr.write(f\"{self._message} finished after {(time.time()-self._startTime):.1f}s \"\n \"at \"+time.strftime(\"%H:%M:%S\", time.localtime())+\" \\n\")", "def finalize(self):\n sys.stderr.write(f\"{self._message} finished after {(time.time()-self._...
[ "0.7009401", "0.7009401", "0.67796814", "0.67073065", "0.6634447", "0.65721756", "0.653", "0.653", "0.653", "0.6507717", "0.6498745", "0.64971644", "0.64605737", "0.64544594", "0.64544594", "0.6441591", "0.64370334", "0.6400482", "0.63626516", "0.6344346", "0.63207597", "0....
0.7368279
0
True if this task runner has received a message from its associated process.
def has_an_incomming_message(self): return self.pipe_start.poll(1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_waiting_for_message(self):\r\n return self.waiting_for_message", "def check_command(self):\n return self.process is not None and self.process.poll() is None", "def is_running(self):\n if self._process:\n return self._process.poll() is None\n else:\n retu...
[ "0.70353997", "0.69293225", "0.6854245", "0.6836179", "0.68009895", "0.66489863", "0.66337824", "0.6600015", "0.6596999", "0.6567547", "0.65392643", "0.65115803", "0.6506902", "0.6501797", "0.64903075", "0.64822733", "0.6465509", "0.6465509", "0.6463263", "0.64439535", "0.640...
0.718958
0
Like in the SerialScheduler, this function tries to run all the tasks, checking their dependencies. In this case some processes will be spawned so that they can share the work of executing the tasks. This run function acts as the real scheduler, telling the 'task executor' objects which task to run. This kind of dynami...
def run(self): self.function_exec('scheduling_started', {"number_of_tasks":len(self.not_completed)}) # Create processes available_workers = self.number_of_processes task_runners = [] for i in range(available_workers): process_name = "TaskExecutor"+str(i) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self):\n\n while len(self.task_order) > 0:\n # Get the task to run, set it up, and run it\n task = self.task_order[0]\n\n # In the case of a sublist, we'll run all in parallel\n if type(task) is list:\n running_jobs = []\n j...
[ "0.6703353", "0.632755", "0.6312713", "0.6186647", "0.6169463", "0.614637", "0.611018", "0.60892034", "0.606724", "0.6054457", "0.5861122", "0.5801138", "0.57111627", "0.56422794", "0.5621341", "0.5604925", "0.5578869", "0.55761963", "0.55614334", "0.5556777", "0.55550724", ...
0.75108796
0
Creates a CreateGroupMessage from a protobuf As a requirement of all objects which inherit from Serializable, this method transforms a protobuf object into an instance of this class.
def _proto2object( proto: CreateGroupMessage_PB, ) -> "CreateGroupMessage": return CreateGroupMessage( msg_id=_deserialize(blob=proto.msg_id), address=_deserialize(blob=proto.address), content=json.loads(proto.content), reply_to=_deserialize(blob=prot...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _object2proto(self) -> CreateGroupMessage_PB:\n return CreateGroupMessage_PB(\n msg_id=serialize(self.id),\n address=serialize(self.address),\n content=json.dumps(self.content),\n reply_to=serialize(self.reply_to),\n )", "def _proto2object(\n p...
[ "0.8077058", "0.7641945", "0.7594313", "0.7564539", "0.7550068", "0.7347152", "0.7319372", "0.7269308", "0.72298175", "0.70890194", "0.7041015", "0.68744355", "0.6841385", "0.6676443", "0.6657618", "0.6614466", "0.6529713", "0.65050894", "0.646013", "0.6432547", "0.6401638", ...
0.83095145
0
Creates a GetGroupMessage from a protobuf As a requirement of all objects which inherit from Serializable, this method transforms a protobuf object into an instance of this class.
def _proto2object( proto: GetGroupMessage_PB, ) -> "GetGroupMessage": return GetGroupMessage( msg_id=_deserialize(blob=proto.msg_id), address=_deserialize(blob=proto.address), content=json.loads(proto.content), reply_to=_deserialize(blob=proto.reply_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _proto2object(\n proto: CreateGroupMessage_PB,\n ) -> \"CreateGroupMessage\":\n\n return CreateGroupMessage(\n msg_id=_deserialize(blob=proto.msg_id),\n address=_deserialize(blob=proto.address),\n content=json.loads(proto.content),\n reply_to=_deseri...
[ "0.8065173", "0.8059963", "0.80385315", "0.7838053", "0.78343934", "0.7728165", "0.772733", "0.76612204", "0.75730646", "0.75216293", "0.7501986", "0.7421604", "0.7359245", "0.7337106", "0.72288305", "0.71763164", "0.70391303", "0.70110816", "0.68666184", "0.68378156", "0.645...
0.8384033
0
Creates a GetGroupsMessage from a protobuf As a requirement of all objects which inherit from Serializable, this method transforms a protobuf object into an instance of this class.
def _proto2object( proto: GetGroupsMessage_PB, ) -> "GetGroupsMessage": return GetGroupsMessage( msg_id=_deserialize(blob=proto.msg_id), address=_deserialize(blob=proto.address), content=json.loads(proto.content), reply_to=_deserialize(blob=proto.repl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _object2proto(self) -> GetGroupsMessage_PB:\n return GetGroupsMessage_PB(\n msg_id=serialize(self.id),\n address=serialize(self.address),\n content=json.dumps(self.content),\n reply_to=serialize(self.reply_to),\n )", "def _proto2object(\n proto...
[ "0.7964506", "0.7870362", "0.7740668", "0.7571255", "0.7528219", "0.750384", "0.7494732", "0.7383841", "0.73493606", "0.7295214", "0.7263857", "0.7139681", "0.7122208", "0.70240104", "0.6993496", "0.6870807", "0.68291026", "0.67293364", "0.6576462", "0.6541453", "0.63282835",...
0.8058562
0
Creates a UpdateGroupMessage from a protobuf As a requirement of all objects which inherit from Serializable, this method transforms a protobuf object into an instance of this class.
def _proto2object( proto: UpdateGroupMessage_PB, ) -> "UpdateGroupMessage": return UpdateGroupMessage( msg_id=_deserialize(blob=proto.msg_id), address=_deserialize(blob=proto.address), content=json.loads(proto.content), reply_to=_deserialize(blob=prot...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _object2proto(self) -> UpdateGroupMessage_PB:\n return UpdateGroupMessage_PB(\n msg_id=serialize(self.id),\n address=serialize(self.address),\n content=json.dumps(self.content),\n reply_to=serialize(self.reply_to),\n )", "def _proto2object(\n p...
[ "0.80309", "0.77817404", "0.75891674", "0.7585066", "0.7526722", "0.7499154", "0.7463992", "0.73389864", "0.72233707", "0.7196931", "0.71022654", "0.70876956", "0.70350796", "0.69301087", "0.68484676", "0.67432654", "0.66871005", "0.65235186", "0.64753807", "0.6466748", "0.63...
0.8248486
0
Creates a DeleteGroupMessage from a protobuf As a requirement of all objects which inherit from Serializable, this method transforms a protobuf object into an instance of this class.
def _proto2object( proto: DeleteGroupMessage_PB, ) -> "DeleteGroupMessage": return DeleteGroupMessage( msg_id=_deserialize(blob=proto.msg_id), address=_deserialize(blob=proto.address), content=json.loads(proto.content), reply_to=_deserialize(blob=prot...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _object2proto(self) -> DeleteGroupMessage_PB:\n return DeleteGroupMessage_PB(\n msg_id=serialize(self.id),\n address=serialize(self.address),\n content=json.dumps(self.content),\n reply_to=serialize(self.reply_to),\n )", "def _object2proto(self) -> De...
[ "0.8354678", "0.7887407", "0.7785718", "0.74330956", "0.72480917", "0.715022", "0.6949523", "0.6918182", "0.6893605", "0.6851132", "0.6755857", "0.6749247", "0.667964", "0.66556287", "0.66541016", "0.6589059", "0.6392503", "0.6390019", "0.6260242", "0.61250013", "0.61075175",...
0.8342417
1
Gets a new access token if the old one already expired access_token token used to access the TD Ameritrade site expire_time time in seconds since epoch when the token will expire
def get_access(access_token='',expire_time=0): #Get a new access token if it expires or is five minutes away from exp#iration if (expire_time==0) or (len(access_token)==0) or (time.time()-expire_time>=-300): #API needed to authorize account with refresh token auth_url = 'https://api.tdamer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def access_token(self):\n if self.has_expired():\n self.update()\n\n return self.token['access_token']", "def get_access_token(self):\n\n token_work = time.time() < self.expires\n\n if token_work:\n # No need update token\n return self.access_token\n\n...
[ "0.7643279", "0.7634847", "0.7390794", "0.7374576", "0.7371795", "0.73076856", "0.73074526", "0.7294325", "0.7146626", "0.7060527", "0.7053016", "0.7022221", "0.6941598", "0.6938422", "0.69234806", "0.6905834", "0.6905202", "0.68798673", "0.6875702", "0.6870887", "0.68264604"...
0.76784253
0
Get the user info and preferences for subscribing to the websocket and get the token timestamp as milliseconds access token used to get information on my account
def get_user_principals(access_token): #Make request to user info and preferences to get principals for login user_url = 'https://api.tdameritrade.com/v1/userprincipals' headers = {'Authorization': 'Bearer {}'.format(access_token)} params = {'fields':'streamerSubscriptionKeys,streamerConnectionInfo'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ws_user_data(self):\n return self.ws_request(self.ws_request(self.start_userdata_stream()['listenKey']))", "def UserToken(self) -> object:", "def get_token(self) -> None:\n context_dict = demisto.getIntegrationContext()\n cur_token = context_dict.get('token')\n refresh_token = c...
[ "0.59929764", "0.5843327", "0.5818074", "0.5717326", "0.57172483", "0.5674695", "0.5656598", "0.5551188", "0.5536643", "0.5520706", "0.55206686", "0.55195224", "0.54835796", "0.5472258", "0.54532564", "0.54329437", "0.54327536", "0.5409122", "0.5407365", "0.5407365", "0.53839...
0.58820873
1
Get orders for the account in the specified date range on TD Ameritrade access_token token used to access the TD Ameritrade site start_date beginning time period to get orders (includes start_date in returned orders) end_date ending time period to get orders (includes end_date in returned orders)
def get_orders(access_token,start_date,end_date,status): orders_url = 'https://api.tdameritrade.com/v1/orders' headers={'Authorization': 'Bearer {}'.format(access_token)} #Parameters for the order params = {'accountId':TDAuth_Info.account_num, 'fromEnteredTime': start_date, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_price_history_dates(access_token,ticker,start_date,end_date,frequencyType,frequency):\r\n \r\n price_url = 'https://api.tdameritrade.com/v1/marketdata/{}/pricehistory'.format(ticker)\r\n\r\n #The header for getting a quote needs to define the input type (json)\r\n headers = {'Authorization':'Be...
[ "0.634202", "0.59751403", "0.59119153", "0.5911235", "0.5864832", "0.57331246", "0.5706887", "0.5646497", "0.55046344", "0.5489912", "0.54788554", "0.5437924", "0.5368096", "0.5338739", "0.5332285", "0.53309786", "0.5319454", "0.5304169", "0.53006923", "0.5285335", "0.5283874...
0.80785364
0
Gets a specific order access_token used to login to TD Ameritrade site order_ID the ID of the order we are getting
def get_order_by_id(access_token,order_ID): orders_url = 'https://api.tdameritrade.com/v1/accounts/{}/orders/{}'.format(TDAuth_Info.account_num,order_ID) headers={'Authorization': 'Bearer {}'.format(access_token)} #Make the get request to TD Ameritrade orders_data_json = requests.get(url=orders_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account_order(self, orderid):\n return self.get(f'orders/{orderid}', auth=True)", "def get_order(self, order_id):\n request = OrdersGetRequest(order_id)\n response = self.client.execute(request)\n\n return response", "def GetOrder(order_id): \n\t\"\"\"Method to get order\"\"\"...
[ "0.69531524", "0.67687076", "0.656684", "0.65420085", "0.65196705", "0.64443076", "0.64358777", "0.63968205", "0.6366604", "0.6312543", "0.6238618", "0.6228013", "0.61980855", "0.6166722", "0.6139371", "0.612343", "0.6123228", "0.6099858", "0.60809356", "0.60761327", "0.60691...
0.8059914
0
Deletes orders on the TD Ameritrade Site access_token token used to access the TD Ameritrade site order_ID the ID of the order to delete
def delete_order(access_token,order_ID): orders_url = 'https://api.tdameritrade.com/v1/accounts/{}/orders/{}'.format(TDAuth_Info.account_num,order_ID) headers={'Authorization': 'Bearer {}'.format(access_token)} order_status = requests.delete(url=orders_url,headers=headers) return order_status
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_delete_order(request, id):\n\n close_old_connections()\n\n # Not marking it as served if it isn't even ready yet.\n if not request.user.is_authenticated:\n return HttpResponseForbidden(\"You're not authenticated.\")\n \n # Delete the order.\n Order.objects.get(id=id).delete()\n\n ...
[ "0.65937054", "0.6493973", "0.64761704", "0.620927", "0.6152156", "0.61286193", "0.60274494", "0.6003759", "0.5973157", "0.59723866", "0.59202516", "0.5837919", "0.58353496", "0.5781898", "0.5772327", "0.5762132", "0.5739936", "0.5728079", "0.5668074", "0.5599602", "0.5576779...
0.8097233
0
Posts an order to the TD Ameritrade website access_token token used to access the TD Ameritrade site json_request the order request in json format Returns the response to the post request
def post_order(access_token,json_request): orders_url = 'https://api.tdameritrade.com/v1/accounts/{}/orders'.format(TDAuth_Info.account_num) #The header for placing in order needs to define the input type (json) headers = {'Authorization':'Bearer {}'.format(access_token), 'Content-Type'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace_order(access_token,order_ID,json_request):\r\n orders_url = 'https://api.tdameritrade.com/v1/accounts/{}/orders/{}'.format(TDAuth_Info.account_num,order_ID)\r\n\r\n #The header for placing in order needs to define the input type (json)\r\n headers = {'Authorization':'Bearer {}'.format(access_t...
[ "0.7507134", "0.7014159", "0.6829043", "0.66372055", "0.6441789", "0.6441514", "0.642561", "0.6387601", "0.6369167", "0.63190925", "0.62325263", "0.62321603", "0.61621636", "0.61475813", "0.6122801", "0.61213946", "0.6105965", "0.6085061", "0.6072476", "0.60601467", "0.604170...
0.91650337
0
Replaces an order on the TD Ameritrade website access_token token used to access the TD Ameritrade site order_ID ID of the order to replace json_request the new order request in json format to replace the old one Returns the response to the replace order request
def replace_order(access_token,order_ID,json_request): orders_url = 'https://api.tdameritrade.com/v1/accounts/{}/orders/{}'.format(TDAuth_Info.account_num,order_ID) #The header for placing in order needs to define the input type (json) headers = {'Authorization':'Bearer {}'.format(access_token), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def update_order(request):\n # request_schema = UpdateOrderSchema(strict=True)\n # payload = request_schema.load(await request.json()).data\n return web.json_response({'result': 'ok'})", "def post_order(access_token,json_request):\r\n orders_url = 'https://api.tdameritrade.com/v1/accounts/{}/or...
[ "0.66815823", "0.6566408", "0.6400565", "0.5917457", "0.58600324", "0.5854894", "0.5815817", "0.5705267", "0.56687856", "0.56081367", "0.5593533", "0.55626035", "0.55596524", "0.55464923", "0.5544397", "0.5501006", "0.5493626", "0.5448207", "0.5365709", "0.5352007", "0.530300...
0.91279715
0
Build a request to the TD Ameritrade API session trading session, 'Normal', 'AM', 'PM', 'SEAMLESS' for extended hours and day hours duration 'DAY' or 'GOOD_TO_CANCEL' orderType 'MARKET' or 'LIMIT' orderLegCollection contains instruction ('BUY' or 'SELL'), symbol, assetType, quantity, etc orderStrategy 'SINGLE', 'TRIGGE...
def build_order_request(session,duration,orderType,orderLegCollection,orderStrategy,price=''): #Build order request based on parameters order_request = { 'session':session, 'duration':duration, 'orderType':orderType, 'orderLegCollection':...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_get_active_orders_request(self, symbol: Optional[Symbol] = None) -> Request:\n\n method = \"GET\"\n path = \"/order\"\n params: Params = {}\n if symbol is not None:\n params[\"symbol\"] = symbol\n\n url = URL(self._create_url(path))\n url = url.with_q...
[ "0.6393432", "0.6084401", "0.6051327", "0.59973747", "0.5689987", "0.5622757", "0.5583636", "0.5567413", "0.5521866", "0.5508778", "0.5501757", "0.5360733", "0.5360709", "0.5330701", "0.53168505", "0.5225455", "0.5218088", "0.5207039", "0.5206021", "0.51971817", "0.5187848", ...
0.72301
0
Get quote/price information for a stock access_token token used to access the TD Ameritrade site ticker the stock ticker symbol
def get_quote(access_token,ticker): quote_url = 'https://api.tdameritrade.com/v1/marketdata/{}/quotes'.format(ticker) #The header for getting a quote needs to define the input type (json) headers = {'Authorization':'Bearer {}'.format(access_token), 'Content-Type':'application/json'} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_multi_quotes(access_token,tickers):\r\n quote_url = 'https://api.tdameritrade.com/v1/marketdata/quotes'\r\n\r\n #The header for getting a quote needs to define the input type (json)\r\n headers = {'Authorization':'Bearer {}'.format(access_token),\r\n 'Content-Type':'application/json'...
[ "0.724852", "0.6970904", "0.6869229", "0.6441689", "0.6396739", "0.63900095", "0.6348864", "0.63472736", "0.63055825", "0.6273491", "0.62635237", "0.62429434", "0.6217562", "0.62126017", "0.618903", "0.6181409", "0.6145811", "0.6087003", "0.60634583", "0.6036593", "0.6017648"...
0.8138068
0
Gets quotes for multiple ticker symbols access_token token used to access the TD Ameritrade site
def get_multi_quotes(access_token,tickers): quote_url = 'https://api.tdameritrade.com/v1/marketdata/quotes' #The header for getting a quote needs to define the input type (json) headers = {'Authorization':'Bearer {}'.format(access_token), 'Content-Type':'application/json'} #Pass ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_quote(access_token,ticker):\r\n quote_url = 'https://api.tdameritrade.com/v1/marketdata/{}/quotes'.format(ticker)\r\n\r\n #The header for getting a quote needs to define the input type (json)\r\n headers = {'Authorization':'Bearer {}'.format(access_token),\r\n 'Content-Type':'applica...
[ "0.7891363", "0.6873732", "0.67089283", "0.65867734", "0.65348876", "0.6282515", "0.62716085", "0.6097361", "0.60793877", "0.6064195", "0.60637885", "0.6047419", "0.60030806", "0.6001138", "0.599085", "0.59795886", "0.59471214", "0.59236175", "0.59121275", "0.58546513", "0.58...
0.8782872
0
Get price history of a stock looking back from today access_token token used to access the TD Ameritrade site ticker the stock ticker symbol periodType day, month, year, or ytd (default day) period the number of periods to show (default 10 days, 1 month, 1 year, 1 ytd) frequencyType the frequency of data to return; min...
def get_price_history_lookback(access_token,ticker,periodType,period,frequencyType,frequency): price_url = 'https://api.tdameritrade.com/v1/marketdata/{}/pricehistory'.format(ticker) #The header for getting a quote needs to define the input type (json) headers = {'Authorization':'Bearer {}'.forma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_price_history_dates(access_token,ticker,start_date,end_date,frequencyType,frequency):\r\n \r\n price_url = 'https://api.tdameritrade.com/v1/marketdata/{}/pricehistory'.format(ticker)\r\n\r\n #The header for getting a quote needs to define the input type (json)\r\n headers = {'Authorization':'Be...
[ "0.78879863", "0.72872126", "0.69083875", "0.66606575", "0.6602232", "0.6473682", "0.6446148", "0.6428861", "0.6426803", "0.6383207", "0.6333592", "0.63018507", "0.62857276", "0.62840873", "0.62560195", "0.6174368", "0.61729586", "0.6156546", "0.61404", "0.61305135", "0.61067...
0.83570635
0
Sets the prev link for the node.
def setPrev(self, prev): self.prev = prev
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prev(self, prev):\n\n self._prev = prev", "def set_prev(self, p) -> None:\n self.prev = p", "def setPrev(self, prev_half_edge):\n self.prev = prev_half_edge", "def prev_page_url(self, prev_page_url):\n\n self._prev_page_url = prev_page_url", "def goToPrevHistory(self: Self, ...
[ "0.7465448", "0.7228299", "0.7093982", "0.7074755", "0.6893062", "0.68524987", "0.67959595", "0.668916", "0.6375687", "0.6178108", "0.61040765", "0.60961574", "0.6089415", "0.6055914", "0.5996824", "0.5947542", "0.59411544", "0.5934818", "0.5934224", "0.59309167", "0.5916836"...
0.7875985
0
Fills the list with information from a File, Assumes new line seperated.
def populate(self, fileName): #assuming a newline seperated with open(fileName, 'r') as inFile: for line in inFile: self.append(line.strip())#strip the \n
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fill_list_file(list, file):\n # Local Variables\n # data = data from the file\n \n data = open(file)\n for line in data:\n for word in line.split():\n list.insert(word)", "def create_from_file(self, file):\n self.value = []\n with open(file, \"r\") as f:\n ...
[ "0.7336654", "0.6782013", "0.66367686", "0.6446616", "0.63737994", "0.6366721", "0.63587606", "0.62649655", "0.6230008", "0.61351603", "0.60994554", "0.6090269", "0.6088071", "0.60788745", "0.60174197", "0.6000459", "0.59552413", "0.5948468", "0.5942839", "0.59296787", "0.592...
0.7674582
0
Open and read the cache file if it exists
def __read_cache_file_if_exists(self) -> None: if os.path.exists(self.__cache_file): self.__config.open_file(self.__cache_file, "r", self.__process_cache)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_cache(self, path):\n if self._cache:\n cache_path = os.path.join(self._cache, path)\n\n if os.path.exists(cache_path):\n with io.open(cache_path, encoding='utf-8') as f:\n text = f.read()\n\n return text\n\n msg = ('Unab...
[ "0.75952566", "0.73163617", "0.72234976", "0.71021736", "0.70085645", "0.69819254", "0.69125575", "0.69095606", "0.6903061", "0.689758", "0.6829601", "0.67801297", "0.67788893", "0.67788893", "0.6751688", "0.6725002", "0.67220324", "0.67138314", "0.6657382", "0.66273785", "0....
0.8685231
0
Given a `node` returns its target typename. For "call_method" node, return node.target which is the name of that method being called. This could potential lead to conflict but should be okay because normally it's on a tensor. For "call_function" node, return typename of node.target. For "call_module" node, return typen...
def get_node_target(submodules: Mapping[str, torch.nn.Module], node: pippy.fx.Node) -> str: assert node.op in CALLABLE_NODE_OPS, ( "Expect op types of " + ", ".join(CALLABLE_NODE_OPS) + f", but found {node.op}" ) if node.op == "call_module": assert isinstance(node.target, str) subm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _targetof(node):\r\n if node is None: return None\r\n return node.target", "def _determine_function_name_type(\n node: nodes.FunctionDef, config: argparse.Namespace\n) -> str:\n property_classes, property_names = _get_properties(config)\n if not node.is_method():\n return \"function\"\n...
[ "0.63309675", "0.6100639", "0.60816646", "0.59453785", "0.58337826", "0.571037", "0.5704307", "0.5654451", "0.56432414", "0.5600983", "0.5590909", "0.5473086", "0.5463391", "0.5450949", "0.54132587", "0.5390162", "0.53383803", "0.5285833", "0.5279004", "0.5275299", "0.5263115...
0.7547294
0
Checks if the node output produces a Tensor or not.
def is_node_output_tensor(node: pippy.fx.Node) -> bool: type_ = node.meta.get("type", None) return type_ is not None and issubclass(type_, torch.Tensor)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_tensor(x: Any) -> bool:\n if has_tensorflow and isinstance(x, _TfTensor):\n return True\n if has_pytorch and isinstance(x, _PtTensor):\n return True\n if isinstance(x, np.ndarray):\n return True\n return False", "def do_type_checking(self, node...
[ "0.7124051", "0.71176755", "0.70057577", "0.6854042", "0.6773735", "0.6654675", "0.66518706", "0.6620085", "0.65847135", "0.65643764", "0.64473575", "0.6427913", "0.6383607", "0.6345796", "0.62348086", "0.6162581", "0.607644", "0.604991", "0.5989577", "0.5882552", "0.5872916"...
0.8322501
0
Replace the graph of the given GraphModule with one that contains the same nodes as the original, but in topologically sorted order. This is used by the merge_matmul transformation below, which disturbs the topologically sorted order of its input GraphModule, so that this order is restored before further transformation...
def legalize_graph(gm: pippy.fx.GraphModule) -> pippy.fx.GraphModule: indeg = {node: 0 for node in gm.graph.nodes} new_graph = pippy.fx.Graph() # Track how many unfulfilled dependencies each node has for node in gm.graph.nodes: for user in node.users: indeg[user] += 1 queue: coll...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reset_topological_order(self):\n self._topological_order = self._input_nodes[:]\n self.sorted = False", "def transform(g):\n min_nidx = min(g.nodes)\n max_nidx = max(g.nodes)\n\n if min_nidx == 0 and max_nidx == g.number_of_nodes() - 1: # Everything already labeled as wanted\n ...
[ "0.6281253", "0.6020051", "0.5968213", "0.5939152", "0.5891148", "0.587402", "0.57739174", "0.57242393", "0.5655821", "0.56404704", "0.56368893", "0.56269574", "0.56102455", "0.5603213", "0.55983084", "0.5588909", "0.5579634", "0.5571751", "0.55631703", "0.5544777", "0.554143...
0.62657577
1
Set the progress trait from the iteration.
def _setProgress(self): self.progress = (self.iteration, self.iterationCount)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_progress(self, progress: float):", "def set_progress(self, progress: int) -> None:\n self.update(progress % len(self.frames)) # prevent IndexError if progress >= len(frames)", "def progress(self, progress):\n\n self._progress = progress", "def progress(self, progress):\n\n sel...
[ "0.7724764", "0.7345636", "0.7262811", "0.7262811", "0.7089067", "0.70505095", "0.6872752", "0.67855513", "0.6774502", "0.67634153", "0.6579046", "0.6579046", "0.6579046", "0.651001", "0.6473924", "0.6473924", "0.64663595", "0.64363086", "0.6374182", "0.63731956", "0.63265216...
0.8085796
0
Disable any regions that can't be run. Currently only looks for VectorFileEffectors whose outputFile parameter is equal to 'No output file specified'.
def _disableRegions(self): effectors = [e for e in _getElements(self.network) if _isEffector(e)] for e in effectors: if e.getParameter('outputFile') == 'No outputFile specified': _disable(self.network, e.getName())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disable_vae_slicing(self):\n self.vae.disable_slicing()", "def disable_vae_tiling(self):\n self.vae.disable_tiling()", "def primers_are_useless(self):\r\n #TODO: send a message telling these primers can be taken out.\r\n for feature in self.gt_seq_region:\r\n if featu...
[ "0.56054944", "0.54844016", "0.5445084", "0.53977", "0.5381937", "0.5360015", "0.53208935", "0.51000714", "0.5042197", "0.50409454", "0.50250703", "0.5024363", "0.5021316", "0.50164264", "0.5013679", "0.50099427", "0.5003581", "0.49923182", "0.4961914", "0.49477282", "0.49324...
0.84394544
0
Start running the network, and start the mainloop if necessary. numIterations Number of iterations to run for (optional). target Run until this condition is met (used by the Vision Framework). This is distinct from the userspecified target in the GUI, which simply tells the network when to pause. tier Tier being traine...
def start(self, numIterations=0, target=None, tier=0, stop=False, callback=None): #title() self._registerCallbacks() self.iterationCount = numIterations self.iteration = 0 self.stopTarget = target self.tier = tier self.pauseAtPhaseSetup = False if callback: callback() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train(self, iterations=1):\n for _ in range(iterations):\n self.trainer.train()\n self.test_network()", "def train(self, t_max):\n # Initialize session, model, variables.\n tf.global_variables_initializer().run()\n self.stat.load_model()\n self.target_...
[ "0.5481345", "0.53400576", "0.5291693", "0.5231653", "0.52196884", "0.5207074", "0.5196552", "0.5196552", "0.5140777", "0.5139961", "0.5114426", "0.5084966", "0.50706834", "0.5069639", "0.50587445", "0.5039778", "0.5032471", "0.50109255", "0.49990544", "0.49804333", "0.497339...
0.82238597
0
Seek to the specified iteration.
def _seek(self, iteration): # Validate it if iteration < 1: iteration = 1 # Seek to one iteration before the specified iteration, then run the # network for one iteration, so the inspectors will show the right data self.iteration = iteration - 1 self.experiment.position.iter = iteration ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seek(self, offset, whence=io.SEEK_SET):\n if offset != 0 and whence == io.SEEK_SET:\n # logging.debug('IterStream: trying to seek to offset {0}.'\n # .format(offset))\n if offset > self.curr_pos:\n self.readinto(bytearray(offset - self.curr_p...
[ "0.608975", "0.5976431", "0.5976431", "0.5976431", "0.5770309", "0.574652", "0.5727403", "0.57088655", "0.559905", "0.5595579", "0.5563567", "0.5559499", "0.554357", "0.554357", "0.55330926", "0.54994696", "0.54990864", "0.54990864", "0.54990864", "0.54990864", "0.5492508", ...
0.76999676
0
Called automatically by Traits when the iteration updates. Update the progress bar and check the conditions to see whether to stop or pause.
def _iteration_changed(self): if self.showProgressBar: try: self._setProgress() except: # may fail when switching from training to inference from dbgp.client import brk; brk(port=9011) pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _setProgress(self):\n\n self.progress = (self.iteration, self.iterationCount)", "def progress(self):\n if self.running:\n pass\n else:\n self._engine.progress()", "def update_progress(self):\n report = self.build_progress_report()\n self.conduit.set_prog...
[ "0.6636578", "0.66308147", "0.6474163", "0.6474163", "0.6268568", "0.62476134", "0.62351364", "0.61889505", "0.6155558", "0.60760725", "0.6037743", "0.6024817", "0.6013525", "0.600907", "0.5963331", "0.5963331", "0.5913053", "0.5901051", "0.5898955", "0.5889771", "0.5860249",...
0.71780443
0
Determine which FA environment (Dev/Uat/Prod) the script is running in. Returns the specified path contained in the FExtensionValue which differs for each environment. Also retrieves the list of trade filters separated by ';' in the FExtensionValue config file.
def retrieve_environment(env_config, filter_config): global path, filter_list_from_config arena_data_server = acm.FDhDatabase["ADM"].ADSNameAndPort().upper() configuration = acm.GetDefaultValueFromName( acm.GetDefaultContext(), acm.FObject, env_config) filter_list_from_config = acm.GetDefaultV...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_environment():\n # Search for the environment variable set by the hutch python setup\n env = os.getenv('CONDA_ENVNAME')\n # Otherwise look for built-in Conda environment variables\n if not env:\n env = os.getenv('CONDA_DEFAULT_ENV')\n # Check the top level PYTHONPATH to see if...
[ "0.5488771", "0.52747124", "0.52578723", "0.5231717", "0.51516294", "0.50663215", "0.506381", "0.5058923", "0.505804", "0.49744675", "0.49618024", "0.4936943", "0.48768833", "0.48471853", "0.48470667", "0.4840807", "0.48290032", "0.47938055", "0.4790978", "0.47902945", "0.478...
0.6358428
0
Add the trades already in the filter the global trades dictionary. The price is divided by 100 as per how business expects the output.
def add_trades(trdf): trade_list = trdf.Snapshot() if len(trade_list) > 0: main_dictStruct[str(trdf.Name())] = dict( (trade.Oid(), [trade.Oid(), trade.Quantity(), trade.Price() / 100, trade.TradeTime()]) for trade in trade_list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compute_taxed_lst_price2(self):\n company_id = self._context.get(\n 'company_id', self.env.user.company_id.id)\n for product in self:\n product.taxed_lst_price = product.taxes_id.filtered(\n lambda x: x.company_id.id == company_id).compute_all(\n ...
[ "0.58588636", "0.5809941", "0.55692714", "0.5566447", "0.55549794", "0.55451953", "0.55318564", "0.5514227", "0.5454263", "0.5448498", "0.54461616", "0.54408807", "0.54088545", "0.54009604", "0.5368632", "0.5354905", "0.53320706", "0.53319985", "0.5319314", "0.52945083", "0.5...
0.61422753
0
Differential voltage v1 = voltage between inverting terminal and ground v2 = voltage between noninverting terminal and ground
def vd(v2,v1): return v2-v1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def voltage_conversion(self):\r\n\t\tvoltage = ((self.data[0] * 256 + self.data[1]) / 65536.0) * 5.0\r\n\t\t\r\n\t\treturn {'v' : voltage}", "def velocity(df0, df1):\n velocity = df1 - df0\n return velocity", "def diff_v_x1(x1, x2, t=0.):\n return (omega) ** 2 * x1", "def impulse(self,v1,v2)...
[ "0.62008476", "0.613027", "0.6099671", "0.6095188", "0.60554194", "0.6046503", "0.60115767", "0.59870183", "0.59005463", "0.5894088", "0.5804491", "0.5798433", "0.5769953", "0.5750147", "0.57478386", "0.57300663", "0.57192975", "0.5658065", "0.5647973", "0.56422937", "0.56061...
0.692218
0
An amplifier with infinite openloop gain (v_o), infinite input resistance, and zero output resistance. Ideal op amp is an approximate analysis, but most modern amplifiers have such large gain and input impedances that the approximate analysis is a good one.
def idealOpAmp():
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _amp_ ( self , x ) :\n v = self.amplitude ( x )\n #\n return complex( v.real () , v.imag () )", "def app(data_pupil,data_phase,oversize=4):\n complexr=app_complex(data_pupil,data_phase,oversize)\n amp=(abs(complexr)**2)\n return amp", "def amps(self, amp: NumType):\n self._amp = am...
[ "0.6163449", "0.60998505", "0.59039474", "0.5810233", "0.57597375", "0.575317", "0.5678718", "0.56314796", "0.5603917", "0.5500167", "0.5498625", "0.5482416", "0.5466694", "0.54564613", "0.5434886", "0.54241836", "0.5395722", "0.53837705", "0.5347545", "0.53447354", "0.533397...
0.74028385
0
Updates entity's destination and returns lead time to arrive there in hours.
def set_destination(self): # TODO: consider new implementation with multiple paths possible. self.destination = self.network[self.current_node]['next'] lead_time = self.network[self.current_node]['path'].lead_time return datetime.timedelta(hours=lead_time)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def travel_time(self, origin, destination):\n assert 2 <= len(origin) <= 3, \"Origin should by (x, y) or (x, y, z)\"\n assert 2 <= len(destination) <= 3, \"Origin should by (x, y) or (x, y, z)\"\n assert len(origin) == len(destination), \"Elevation should be present in origin and destination o...
[ "0.5782541", "0.56913507", "0.547817", "0.5343863", "0.5279372", "0.5238057", "0.5227395", "0.52051044", "0.520272", "0.5185315", "0.51523775", "0.5151906", "0.51071995", "0.5073053", "0.5004269", "0.5004062", "0.49946293", "0.49642354", "0.49372905", "0.4920497", "0.49176788...
0.70615387
0
Change password form for teachers
def change_password(request): emp = models.Teacher.objects.get(user=request.user) context_dict = {} if request.method == 'POST': form = AdminPasswordChangeForm(user=request.user, data=request.POST) if form.is_valid(): form.save() update_session_auth_hash(request, form.user) context_dict["message"] = "P...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_pwd(self):\r\n if self.field_pwd.text() == \"\":\r\n self.label_chg_pwd.setText(\"Password cannot be empty\")\r\n return None\r\n self.encryptor.set_key_from_password(self.field_pwd.text())\r\n self.label_chg_pwd.setText(\"Password typed\")\r\n self.labe...
[ "0.7280924", "0.72753847", "0.72258353", "0.71798277", "0.7163031", "0.715748", "0.71463037", "0.7115237", "0.7095983", "0.70515865", "0.70478415", "0.70305073", "0.7016382", "0.69865227", "0.692954", "0.69270027", "0.69050103", "0.6901926", "0.68824595", "0.6861174", "0.6859...
0.803726
0
View to take email and mail the link to reset password.
def password_reset(request): context_dict = {} if request.method == 'POST': email = request.POST.get('email') if email: user = models.Teacher.objects.get( soft_delete=False, user__email=email ) if not user: context_dict["message"] = "Email ID does'nt exist, Enter Correct details" mail = { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_password():\n if current_user.is_authenticated:\n return redirect(url_for('main.home'))\n\n form = RequestResetForm()\n\n if form.validate_on_submit():\n user = User.query.filter_by(email=form.email.data).first()\n send_reset_email(user) # located in utils.py\n flash...
[ "0.77369666", "0.7654678", "0.76541126", "0.76050055", "0.74960506", "0.74847054", "0.7466968", "0.7450301", "0.7397794", "0.739677", "0.73547953", "0.7352869", "0.73409104", "0.7325412", "0.7316366", "0.7305401", "0.72502244", "0.72438157", "0.72168416", "0.7154242", "0.7148...
0.8057735
0
For adding Exam name like semester 1 or trimester 2.
def addExamName(request): emp = models.Teacher.objects.get(user=request.user) if not emp.exam_permit: raise Http404 context_dict = {} if request.method == "POST": name = request.POST.get('ename') duplicate_check = models.ExamName.objects.filter( name=name, ).first() if duplicate_check: context_dict...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return f\"{self.semester} | {self.school} | {self.position} | {self.class_name}\"", "def thesis(self, new_thesis):\r\n self.__thesis = 'Thesis: ' + new_thesis", "def __str__(self):\n return str(self.__student_name) + \" has grade \" + str(self.__grade_value) + \" at \"...
[ "0.5798856", "0.5777781", "0.5663284", "0.5635707", "0.5615205", "0.55926704", "0.5520119", "0.5467409", "0.5458762", "0.5406007", "0.5394709", "0.5367752", "0.53436214", "0.5338537", "0.53357697", "0.5332841", "0.5325494", "0.5315696", "0.53049135", "0.53027743", "0.52977306...
0.66135615
0
View to edit the already existing student in database by taking student_id.
def edit_student(request, student_id): emp = models.Teacher.objects.get(user=request.user) if not emp.student_permit: raise Http404 student = models.Student.objects.filter( pk=student_id, soft_delete=False ).first() if not student: raise Http404 context_dict = { "all_courses": context_helper.course_helpe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_student(request, s_id):\n user = CustomUser.objects.get(id=s_id)\n student = Student.objects.get(user_id=s_id)\n\n if request.method == 'POST':\n user_edit_form = EditUserForm(request.POST, instance=user)\n student_edit_form = EditStudentForm(request.POST, instance=student)\n\n ...
[ "0.74575925", "0.6492118", "0.64062715", "0.6391587", "0.6389621", "0.63496494", "0.6339974", "0.6285115", "0.6241227", "0.6230551", "0.62216437", "0.62023526", "0.6146335", "0.6138599", "0.6107638", "0.6090783", "0.60800827", "0.60740596", "0.60250974", "0.6019445", "0.59975...
0.7398913
1
Edit details related to the subject / Meta data of subject.
def edit_subject(request,subject_id): emp = models.Teacher.objects.get(user=request.user) if not emp.subject_permit: raise Http404 subject = models.Subject.objects.filter( pk=subject_id, soft_delete=False ).first() if not subject: raise Http404 context_dict = { "all_courses": context_helper.course_helper...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, subject: Subject) -> None:\n pass", "def update(self, subject: Subject) -> None:\n pass", "def update_by_id(self, subject_id: str, new_subject_data: any) -> any:\n pass", "def update_subject(self):\n subject = extract_subject(self.events)\n self.events.subj...
[ "0.65650016", "0.65650016", "0.6508217", "0.6415158", "0.6376233", "0.6271657", "0.60244745", "0.6020632", "0.59968424", "0.59689504", "0.59328204", "0.59253275", "0.59253275", "0.5892029", "0.5892029", "0.5892029", "0.58708006", "0.5866075", "0.585368", "0.58293235", "0.5769...
0.7351874
0
View students using data tables.
def view_students(request): context_dict = { 'title': 'All Students', } return render(request, "viewStudent.html", context_dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_all_students():\n message = ''\n global conn\n with conn:\n rows = select_all_students(conn)\n for row in rows:\n message += str(row) + \"\\n\"\n messagebox.showinfo('Student Table', message)", "def all_students(self):\n\n with sqlite3.connect(self.db_path...
[ "0.7032715", "0.62924534", "0.62218237", "0.6200149", "0.61551464", "0.6154113", "0.6104839", "0.61026675", "0.6043875", "0.6013538", "0.5988465", "0.5984755", "0.5973147", "0.59658676", "0.59630364", "0.58710605", "0.5852589", "0.5826267", "0.58052284", "0.5802828", "0.57896...
0.6582367
1
To add results of students / link results and students
def addResultMain(request): emp = models.Teacher.objects.get(user=request.user) if not emp.result_permit: raise Http404 context_dict = { "result_type": context_helper.result_type_helper(), "all_subjects": context_helper.subject_helper(), "all_exam_name": context_helper.exam_name_helper(), } if request.met...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addMultiResults(self, results, index):\n # if no return from site, seed the results with an empty list\n if results is None or len(results) == 0:\n self._results[index] = None\n else:\n self._results[index] = results", "def get_results(self, stud_name):\n sel...
[ "0.6114725", "0.59435695", "0.5933007", "0.58812654", "0.5834557", "0.57925606", "0.57653034", "0.5724111", "0.56746095", "0.5673749", "0.56612015", "0.565572", "0.5644683", "0.5600812", "0.5600812", "0.5592871", "0.55797255", "0.55652213", "0.5562192", "0.5561268", "0.553951...
0.6044379
1
View Main results of students.
def view_result_main(request): context_dict = { 'title': 'All Results Main', } return render(request, "viewResultMain.html", context_dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_students(request):\n\n\tcontext_dict = {\n\t\t'title': 'All Students',\n\t}\n\treturn render(request, \"viewStudent.html\", context_dict)", "def get_student():\n\n github = request.args.get('github')\n\n first, last, github = hackbright.get_student_by_github(github)\n\n rows = hackbright.get_gr...
[ "0.7259597", "0.69562906", "0.6889267", "0.68556446", "0.67449915", "0.6720009", "0.67108893", "0.67076385", "0.66855097", "0.6681005", "0.6644783", "0.6635739", "0.65707105", "0.6508019", "0.6491504", "0.6467003", "0.644743", "0.64383495", "0.6376366", "0.6297787", "0.627056...
0.72396094
1
Add result of attendance to the particular subject. Can also use this by taking subject ID not giving drop down for subjects.
def add_attendance(request): emp = models.Teacher.objects.get(user=request.user) if not emp.student_permit: raise Http404 context_dict = { "all_subjects": context_helper.subject_helper(), } if request.method == "POST": roll = request.POST.get('roll') subject = request.POST.get('subject_picker') attendan...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_attendance(request, attendance_id):\n\n\temp = models.Teacher.objects.get(user=request.user)\n\tif not emp.student_permit:\n\t\traise Http404\n\tattendance = models.Attendance.objects.filter(\n\t\tpk=attendance_id, soft_delete=False\n\t).first()\n\tprint(\"1\")\n\tcontext_dict = {\n\t\t\"all_subjects\": c...
[ "0.5862118", "0.57935876", "0.55824333", "0.5474855", "0.54743844", "0.5459701", "0.5446154", "0.54187894", "0.54110545", "0.53656995", "0.529508", "0.52636135", "0.52636135", "0.52636135", "0.52636135", "0.52636135", "0.5260383", "0.52456486", "0.5243062", "0.520754", "0.517...
0.66575384
0
Edit attendance of students subject wise.
def edit_attendance(request, attendance_id): emp = models.Teacher.objects.get(user=request.user) if not emp.student_permit: raise Http404 attendance = models.Attendance.objects.filter( pk=attendance_id, soft_delete=False ).first() print("1") context_dict = { "all_subjects": context_helper.subject_helper(),...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_subject(request,subject_id):\n\n\temp = models.Teacher.objects.get(user=request.user)\n\tif not emp.subject_permit:\n\t\traise Http404\n\tsubject = models.Subject.objects.filter(\n\t\tpk=subject_id, soft_delete=False\n\t).first()\n\tif not subject:\n\t\traise Http404\n\tcontext_dict = {\n\t\t\"all_courses...
[ "0.71086836", "0.6244524", "0.62197715", "0.56363916", "0.5607704", "0.55585027", "0.55038476", "0.55020773", "0.5450966", "0.539527", "0.5375184", "0.5331032", "0.52976197", "0.5293877", "0.5229473", "0.52075845", "0.519442", "0.5174884", "0.5143767", "0.51074713", "0.510747...
0.7827709
0
View attendance of students.
def view_attendance(request): context_dict = { 'title': 'All Attendance', } return render(request, "viewAttendance.html", context_dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_attendance(request, attendance_id):\n\n\temp = models.Teacher.objects.get(user=request.user)\n\tif not emp.student_permit:\n\t\traise Http404\n\tattendance = models.Attendance.objects.filter(\n\t\tpk=attendance_id, soft_delete=False\n\t).first()\n\tprint(\"1\")\n\tcontext_dict = {\n\t\t\"all_subjects\": c...
[ "0.6413403", "0.62919253", "0.62873226", "0.6202059", "0.6138102", "0.6109332", "0.60675406", "0.58709055", "0.58479583", "0.58447534", "0.5835368", "0.58113986", "0.5766857", "0.57441", "0.5713139", "0.57057875", "0.5688026", "0.5664378", "0.5640548", "0.5639207", "0.563774"...
0.7802853
0
Test if height input without inches is extracted and converted into cm
def test_height_feet_only(self): result = height_to_cm("6'") self.assertEqual(result, 183)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_inches_valid(self):\n result = inch_to_cm(\"72\\\"\")\n self.assertEqual(result, 183)", "def test_height_valid(self):\n result = height_to_cm(\"5' 10\\\"\")\n self.assertEqual(result, 178)", "def test_height_invalid_input(self):\n result = height_to_cm(\"--\")\n ...
[ "0.79813945", "0.79194003", "0.7545475", "0.7360076", "0.72949666", "0.67772716", "0.6567673", "0.6567673", "0.6567673", "0.6473662", "0.63965285", "0.63748944", "0.6205345", "0.616127", "0.6080251", "0.59634614", "0.58540994", "0.58296794", "0.57459766", "0.56851465", "0.568...
0.81370246
0
Test if valid height input with feet and inches provided is extracted and converted into cm
def test_inches_valid(self): result = inch_to_cm("72\"") self.assertEqual(result, 183)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_height_feet_only(self):\n result = height_to_cm(\"6'\")\n self.assertEqual(result, 183)", "def test_height_valid(self):\n result = height_to_cm(\"5' 10\\\"\")\n self.assertEqual(result, 178)", "def test_height_invalid_input(self):\n result = height_to_cm(\"--\")\n ...
[ "0.8042959", "0.7631555", "0.739575", "0.7370734", "0.72036153", "0.66799337", "0.66381806", "0.6505398", "0.64125216", "0.60870993", "0.5969806", "0.596189", "0.59046865", "0.59046865", "0.59046865", "0.57828355", "0.5710599", "0.5627367", "0.55650413", "0.55526185", "0.5543...
0.7818981
1
Start Hikvision event stream thread.
def start_hik(self, event): self.camdata.start_stream()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self):\n gv.logger.info(\"Videoqualityprobe healthcheck thread started\")\n thread = Thread(target=self.run, args=())\n thread.daemon = True\n self.thread = thread\n thread.start()", "def start(self):\n\t\tself.stream.start_stream()", "def start(self):\n self...
[ "0.6741748", "0.6689916", "0.6685221", "0.66381896", "0.6620423", "0.64558554", "0.64370614", "0.6398764", "0.63183093", "0.62978", "0.6290173", "0.6284828", "0.62792015", "0.623901", "0.6146902", "0.6136318", "0.61089164", "0.6103689", "0.60574526", "0.6047557", "0.6042904",...
0.7037271
0
Return attribute list for sensor/channel.
def get_attributes(self, sensor, channel): return self.camdata.fetch_attributes(sensor, channel)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sensors(self) -> List[dict]:\n return self.items_by_domain(\"sensor\")", "def listattribute(self, varName):\n fName = \"\"\n if varName in self.statVars:\n fName = self.statVars[varName][0]\n elif varName in self.timeVars:\n fName = self.timeVars[varName][0][...
[ "0.6570343", "0.64977187", "0.6259698", "0.6129214", "0.60648686", "0.6006154", "0.5944662", "0.5927698", "0.5921689", "0.5897804", "0.5869058", "0.58233976", "0.5816986", "0.57921696", "0.57769096", "0.57692206", "0.57688844", "0.5752122", "0.575147", "0.5749902", "0.5747109...
0.78213686
0
Extract sensor last update time.
def _sensor_last_update(self): return self._cam.get_attributes(self._sensor, self._channel)[3]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_update_time(self):\n return self.last_update_time", "def _get_last_meas_time(self):\n\n #if flag for whole data regeneration is set\n if self._process_type == 'full_gen':\n return datetime.datetime(1900, 1, 1, 0, 0, 0)\n \n \n res = self._db.Quer...
[ "0.7647438", "0.7511165", "0.74607396", "0.7425206", "0.7425206", "0.7414086", "0.73201466", "0.7316108", "0.7272959", "0.7233726", "0.7118026", "0.7056613", "0.7056613", "0.7056613", "0.7056613", "0.7056613", "0.7056613", "0.7056613", "0.7056613", "0.70526713", "0.7018561", ...
0.7972229
0
Return true if sensor is on.
def is_on(self): return self._sensor_state()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_on(self):\n return getattr(self.coordinator.data[0], self._sensor) is True", "def is_on(self):\n data = self.sensor_data\n if data and data[\"model\"] == \"SML\" and data[\"changed\"]:\n return data[\"state\"] == STATE_ON\n return False", "def is_on(self) -> bool:\...
[ "0.8668819", "0.83718693", "0.8321358", "0.82086754", "0.82086754", "0.82086754", "0.8072303", "0.79461884", "0.78692335", "0.78692335", "0.78290933", "0.77697575", "0.7760602", "0.76900584", "0.7629474", "0.7626312", "0.7625873", "0.757377", "0.7554073", "0.75531846", "0.752...
0.88761306
0
Process the client reports by aggregating their weights.
async def process_reports(self): await self.aggregate_weights(self.updates) # Testing the global model accuracy if Config().clients.do_test: # Compute the average accuracy from client reports self.average_accuracy = self.accuracy_averaging(self.updates) loggi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _aggregate(self, *params): \n serialized_params = np.array([self._serialize(client) for client in params])\n serialized_aggregation = self._aggregate(*serialized_params)\n aggregated_weights = self._deserialize(serialized_aggregation)\n \n return aggregated_weights", ...
[ "0.63763714", "0.6358904", "0.6236991", "0.60008013", "0.5937266", "0.57118726", "0.5572431", "0.55678767", "0.55606735", "0.54852104", "0.5456038", "0.54495156", "0.5415237", "0.53729385", "0.5338227", "0.5301329", "0.52975875", "0.5291869", "0.5262049", "0.5219562", "0.5192...
0.7276421
0
Wrap up processing the reports with any additional work.
async def wrap_up_processing_reports(self): if hasattr(Config(), 'results'): new_row = [] for item in self.recorded_items: item_value = { 'global_round': self.current_global_round, 'round': se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def processing(self):\n pass", "def do(self):\r\n self.dlCsvReport()\r\n self.dlXlsReport()", "def processReports(self):\n count = 0\n for r in self.reports:\n #need to change the next two lines so that the fields are not hard-coded\n self.currentCase = ...
[ "0.6657251", "0.6634495", "0.6463586", "0.640295", "0.63786864", "0.6316492", "0.6291937", "0.6238219", "0.6229885", "0.61629045", "0.6146104", "0.6141007", "0.6029224", "0.602065", "0.602065", "0.602065", "0.6010309", "0.6010309", "0.6010309", "0.6010309", "0.6010309", "0....
0.68476087
0
Create user and send activation emails.
def perform_create(self, serializer): user = serializer.save() signals.user_registered.send( sender=self.__class__, user=user, request=self.request ) context = get_email_context(user) to = [get_user_email(user)] if djconf.SEND_ACTIVATION_EMAIL: dj...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_activation_email(self):\n new_user = UserModel().objects.create_user(**self.user_info)\n profile = self.registration_profile.objects.create_profile(new_user)\n profile.send_activation_email(Site.objects.get_current())\n self.assertEqual(len(mail.outbox), 1)\n self.assert...
[ "0.75173324", "0.7401911", "0.7284484", "0.722946", "0.7194599", "0.7161482", "0.7149278", "0.714638", "0.7140364", "0.7098761", "0.70938045", "0.70883733", "0.7070287", "0.70686877", "0.7038679", "0.7011149", "0.70017517", "0.6978857", "0.6974424", "0.6947503", "0.69285625",...
0.7469454
1
append chart to list
def add_chart(self, chart: Chart): self.charts.append(chart)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_chart(conf, entries):\r\n serie_index = 0\r\n for serie in conf['series']:\r\n data = []\r\n for entry in entries:\r\n if entry is not None:\r\n data.append(entry.datatolist(str(serie['db'])))\r\n conf['series'][serie_index]['data'] = data\r\n ...
[ "0.65586525", "0.65164983", "0.6214184", "0.6076237", "0.59907544", "0.5842592", "0.5778565", "0.5761721", "0.5710783", "0.5676788", "0.5672405", "0.5625384", "0.561063", "0.55874395", "0.5584001", "0.55779135", "0.5530055", "0.5526744", "0.54800946", "0.5462886", "0.5395071"...
0.7315353
0