query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
given a filename that is formatted as tab separated values on each line return a list of lists of strings, where each line is represented as a list of separate string elements note, the header row is ignored
def readFile (filename): # some OSes need to know that the file might have some special characters f = open(filename) # convert reader to a list so we can close the file result = [ line.strip().split('\t') for line in f if len(line) > 1 ] # close the file so we do not take up extra system resources ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_to_listrows(filename):\n rows = []\n with open(filename) as infile:\n content= infile.read()\n line = content.split('\\n')\n for cells in line:\n rows.append(cells.split('\\t'))\n return rows", "def read_file(file_name):\n\twith open(file_name, 'r') as file:\n\t\...
[ "0.75940466", "0.71641564", "0.714624", "0.7075446", "0.70303386", "0.6977605", "0.68866825", "0.68565166", "0.68248296", "0.6789984", "0.67862", "0.6776981", "0.66963726", "0.6596073", "0.6565729", "0.6554463", "0.6529688", "0.65209585", "0.65147483", "0.6514277", "0.6511389...
0.65645456
15
return a dictionary in the same format as the one given, but that includes only those movies that are both top rated and top grossing
def bothTopRatedAndGrossing (movies): result = {} for (k, v) in movies.items(): # note, only movies that have all fields are in both # (7 for cast + 2 for rating + 2 for gross) if len(v) == 11: result[k] = v return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_popular(min_rating=3):\n # gets back a list of movie ids, in descending order of rating\n movie_results = Rating.objects.values('movie__m_id').annotate(rating=Avg('rating'))\\\n .order_by('-rating').filter(rating__gte=min_rating)\n movie_ids = [m['movie__m_id'] for m in movi...
[ "0.60600394", "0.60100466", "0.59889066", "0.5965885", "0.59410816", "0.58009785", "0.5769953", "0.5765136", "0.57472336", "0.57211506", "0.57006776", "0.5691581", "0.5690174", "0.56569046", "0.5649435", "0.563922", "0.5624602", "0.5588399", "0.55331194", "0.553133", "0.54960...
0.8647386
0
Test that the profile rule update command successfully updates.
def test_profile_commands(self): with DockerHost('host', start_calico=False) as host: host.calicoctl("profile add TEST_PROFILE") json_dict = {"id": "TEST_PROFILE", "inbound_rules": [ {"action": "allow", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_rule(self):\n pass", "def test_update_profile(self):\n url = self.url\n url = url + '{}/'.format(\n self.profile.pk\n )\n response = self.client.patch(url)\n self.assertEqual(response.status_code, status.HTTP_200_OK)\n\n update_data = {\...
[ "0.74306756", "0.7010874", "0.6851449", "0.67962563", "0.67912346", "0.6770156", "0.6768641", "0.6768641", "0.6768641", "0.66596955", "0.66403514", "0.64859855", "0.6479984", "0.64605707", "0.64304864", "0.6419036", "0.6388095", "0.63827556", "0.6373251", "0.63542724", "0.633...
0.68833995
2
Render the page about an article Laura has written.
def article(request, id, slug=None): article = get_object_or_404(Article, id=id) context = { 'article': article, } return render(request, 'article.html', context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_article():\n\n return render_template('article.html', api_endpoint = Parameters()[\"api.endpoint\"])", "def show_article(pagename):\n filename = pagename + \".txt\"\n fo = open(\"wiki/\" + filename)\n article = fo.read()\n fo.close\n return template(\"wiki\", head = pagename, content ...
[ "0.7165995", "0.701536", "0.680454", "0.6723936", "0.6701282", "0.6602516", "0.65989435", "0.65848255", "0.658333", "0.65502673", "0.65376294", "0.65320593", "0.6522103", "0.6514978", "0.65139306", "0.6480613", "0.64715105", "0.6468585", "0.6462723", "0.6462723", "0.6462723",...
0.6184583
51
Render the page about one of Laura's books.
def book(request, slug): book = get_object_or_404(Book, slug=slug) context = { 'book': book, } return render(request, 'book.html', context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def detail(request,book_id):\n\n #prodive all informations of book by GoogleBooksApi function\n if book_id is not None:\n book = Response.response_front(book_id)\n \n context = {\n \"title\":Response.build(book['title'][0]),\n \"desc\": Response.build(book['description'][0]),\n ...
[ "0.72311616", "0.7043035", "0.6692445", "0.6646935", "0.6646783", "0.65934765", "0.65445846", "0.65356046", "0.6495598", "0.64867973", "0.6482646", "0.64756453", "0.6473423", "0.64575976", "0.64398617", "0.64398617", "0.64348525", "0.6434059", "0.64219344", "0.64187825", "0.6...
0.6658656
3
Render the landing page for miscellaneous projects.
def miscellany(request): if request.user.is_authenticated: webpages = WebPage.objects.all() else: webpages = WebPage.objects.filter(is_public=True) externalprojects = ExternalProject.objects.all() context = { 'webpages': webpages, 'externalprojects': externalprojects, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def landing_page():\n\n return render_template('index.html')", "def view_landing_page():\n return render_template(\"index.html\")", "def index():\r\n\r\n # initializes page title\r\n page_title = 'Home'\r\n\r\n # renders the landing page\r\n return render_template('index.html', page_title=pag...
[ "0.7224329", "0.7118178", "0.70736074", "0.7009978", "0.6848887", "0.6846148", "0.6838002", "0.6837645", "0.68291247", "0.6819261", "0.680911", "0.68083894", "0.67968047", "0.6789881", "0.67862344", "0.6773436", "0.6759848", "0.6758646", "0.6743241", "0.67326874", "0.6716469"...
0.0
-1
Returns the block in which the coordinates are located.
def ReturnBlockOfCoordinates(x, y): block_x = int(x / block_size) block_y = int(y / block_size) if block_x == block_size: block_x = block_x - 1 if block_y == block_size: block_y = block_y - 1 return (block_x, block_y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getBlock(self):\n return self.block.getWorld().getWorld().getBlockAt(self.block.getChunkCoordinates().getX(), self.block.getChunkCoordinates().getY(), self.block.getChunkCoordinates().getZ())", "def get_block(self):\n return Gumtree.gumtree.getBlock()", "def get_block_loc(self):\n retu...
[ "0.7378782", "0.73693454", "0.72931457", "0.71497244", "0.70553553", "0.70520496", "0.69279844", "0.68856925", "0.685863", "0.680172", "0.6799728", "0.67142695", "0.6696879", "0.6636084", "0.66252875", "0.66065466", "0.6551689", "0.6380317", "0.6325831", "0.6306662", "0.63004...
0.7126729
4
Receive a dataset path, reads it and returns its pandas dataframe
def read_Dataset(dataset_Path): dataset = pd.read_csv(dataset_Path) return dataset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dataset(filepath):\n return pandas.read_csv(filepath, header='infer')", "def load_data(dataset_path: str):\n data = arff.loadarff(dataset_path)\n data_frame = pd.DataFrame(data[0])\n return data_frame", "def get_data(path):\n df = pd.read_csv(path)\n\n return df", "def get_dataframe...
[ "0.77965343", "0.7755436", "0.77377623", "0.7564728", "0.73512465", "0.73508394", "0.73508394", "0.73434925", "0.7342073", "0.7342073", "0.7342073", "0.718238", "0.7158557", "0.7129389", "0.71074986", "0.70586926", "0.7042302", "0.702557", "0.7020566", "0.6973511", "0.6910628...
0.7738412
2
Apply blur to an image
def blur(image, kernel_size=(7, 7)): image = cv2.blur(image, kernel_size) return image
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def blur(image):\n\n return cv2.blur(image, (5, 5))", "def blur(img):\n\n # We modify a copy of the original image, because we don't want blurred\n # pixels to affect the blurring of subsequent pixels.\n\n target = copy(img)\n\n for y in range(1, get_height(img) - 1):\n for x in range(1...
[ "0.82580453", "0.8216632", "0.8197037", "0.7958172", "0.7918379", "0.7858502", "0.7731875", "0.7684943", "0.76817644", "0.7664154", "0.75783515", "0.7532524", "0.73752075", "0.73304576", "0.73128116", "0.7305184", "0.729012", "0.7277733", "0.7267689", "0.7246837", "0.72267026...
0.8254804
2
merges the three outputs removes all empty bounding boxes (i.e. class_probability < threshold) rescales the bounding boxes
def get_bounding_boxes(outputs, width: int, height: int): # detected bounding boxes, obtained confidences and class's number boxes = [] scores = [] classes = [] # this is our threshold for keeping the bounding box probability_minimum = 0.5 # iterating through all three outputs for res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def postprocess2(scores, classes, bboxes, iou_threshold=0.2, score_threshold=0.5):\n n = len(scores)\n \n count_per_class = {cls:0 for cls in classes}\n bbox_per_class = {cls:[] for cls in classes}\n score_per_class = {cls:[] for cls in classes}\n\n for i in range(n):\n count_per_class[classe...
[ "0.73212415", "0.6796168", "0.67005265", "0.65260047", "0.6492406", "0.64909256", "0.64341664", "0.6385019", "0.63508314", "0.6333309", "0.6312225", "0.6284655", "0.6277939", "0.62609196", "0.6257292", "0.6257292", "0.62433594", "0.6236274", "0.62334824", "0.62232745", "0.621...
0.6923934
1
Calculate IoU between box1 and box2
def iou(box1, box2): # get the area of intersection xi1 = max(box1[0], box2[0]) yi1 = max(box1[1], box2[1]) xi2 = min(box1[2], box2[2]) yi2 = min(box1[3], box2[3]) inter_area = max(xi2 - xi1, 0) * max(yi2 - yi1, 0) # get the area of union box1_area = (box1[2] - box1[0]) * (box1[3] - b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _iou(box1: np.ndarray, box2: np.ndarray) -> np.ndarray:\n b1_x0, b1_y0, b1_x1, b1_y1 = box1\n b2_x0, b2_y0, b2_x1, b2_y1 = box2\n\n int_x0 = max(b1_x0, b2_x0)\n int_y0 = max(b1_y0, b2_y0)\n int_x1 = min(b1_x1, b2_x1)\n int_y1 = min(b1_y1, b2_y1)\n\n int_area = max(int_x1 - int_x0, 0) * max...
[ "0.8550899", "0.843377", "0.8428481", "0.8409999", "0.8409999", "0.8322795", "0.831642", "0.8202912", "0.8134595", "0.8101941", "0.80734116", "0.8050372", "0.80490947", "0.8027421", "0.79746044", "0.7922091", "0.79141057", "0.7896923", "0.7872056", "0.7779003", "0.77385145", ...
0.7553457
36
Visualize confusion matrix as text and graph outputs.
def plot_single_confusion_matrix(CM, labels, title, fname, cmap=plt.cm.Blues): print("Confusion Matrix") print(labels, "\n", CM) plt.figure() plt.imshow(CM, interpolation="nearest", cmap=cmap) plt.title(title, fontsize=10) plt.colorbar() ticks = np.arange(len(labels)) plt.xticks(ticks,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showConfusionMatrix(self): \r\n sn.heatmap(self.conf_matrix, annot=True)\r\n plt.plot( label=\"Accuracy\")\r\n plt.plot( label=\"Error\")\r\n plt.figtext(0,0,'Accuracy: {}\\nError: {}\\nRecall: {}\\nPrecision: {}'.format(self.accuracy,\r\n ...
[ "0.82415956", "0.8072273", "0.7847643", "0.77310205", "0.77136374", "0.76961124", "0.7640795", "0.7627085", "0.75768363", "0.75579476", "0.755644", "0.75410926", "0.7534906", "0.7518897", "0.75182146", "0.7518013", "0.7503666", "0.7459002", "0.74506694", "0.74443525", "0.7434...
0.0
-1
Computes the Euclidean norm of a vector.
def blas_dnrm2(x: 'float64[:]', incx: 'int32' = 1, ): import numpy as np from pyccel.stdlib.internal.blas import dnrm2 n = np.int32(x.shape[0]) return dnrm2 (n, x, incx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def norm(vec):\n return np.linalg.norm(vec)", "def norm(vec):\n return sqrt(sum([i**2 for i in vec]))", "def norm(vec):\n return math.sqrt(vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2])", "def norm(vector):\r\n result = 0\r\n # initial value for the result of this function\r\n for z in range(len(...
[ "0.80400723", "0.8032636", "0.79655236", "0.79605037", "0.7938723", "0.7679183", "0.764607", "0.7639803", "0.75962156", "0.7570569", "0.7558842", "0.7543319", "0.7538584", "0.75002587", "0.74841195", "0.7473806", "0.74399406", "0.7409363", "0.7329088", "0.7315887", "0.7266035...
0.0
-1
Computes the sum of magnitudes of the vector elements.
def blas_dasum(x: 'float64[:]', incx: 'int32' = 1, ): import numpy as np from pyccel.stdlib.internal.blas import dasum n = np.int32(x.shape[0]) return dasum (n, x, incx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def magnitude( vectors ):\n vectors = asarray( vectors, _aformat(vectors))\n if not (len(shape(vectors))==2 and shape(vectors)[1] in (3,4)):\n vectors = reshape( vectors, (-1,3))\n result = sum(vectors*vectors,1 ) # index 1\n sqrt( result, result )\n return result", "def magnitude(v: Vector...
[ "0.7943322", "0.7910543", "0.7874245", "0.7869303", "0.77031565", "0.7663739", "0.75879705", "0.7503576", "0.7412979", "0.7388217", "0.7383888", "0.7337655", "0.7287643", "0.71341586", "0.6975274", "0.6932175", "0.6835055", "0.67849606", "0.66509384", "0.663523", "0.6627299",...
0.0
-1
Finds the index of the element with maximum absolute value.
def blas_idamax(x: 'float64[:]', incx: 'int32' = 1, ): import numpy as np from pyccel.stdlib.internal.blas import idamax n = np.int32(x.shape[0]) i = idamax (n, x, incx) # we must substruct 1 because of the fortran indexing i = i-np.int32(1) return i
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_abs_idx(A):\n return np.unravel_index(np.argmax(np.abs(A)), A.shape)", "def get_max_index(a):\n return a.argmax()", "def get_max_index(a):\n return a.argmax()", "def get_max_index(a):\n return a.argmax()", "def find_max(list):\n return find_value_at(list, 0)", "def imax(self):\n ...
[ "0.7952367", "0.7776642", "0.7776642", "0.7776642", "0.77338874", "0.77287453", "0.76024956", "0.7483598", "0.7431856", "0.736982", "0.7324146", "0.72212034", "0.7202254", "0.7154139", "0.71283185", "0.7112289", "0.7083647", "0.7082445", "0.7070002", "0.7055544", "0.7000806",...
0.0
-1
Computes a vectorvector dot product.
def blas_ddot(x: 'float64[:]', y: 'float64[:]', incx: 'int32' = 1, incy: 'int32' = 1 ): import numpy as np from pyccel.stdlib.internal.blas import ddot n = np.int32(x.shape[0]) return ddot (n, x, incx, y, incy)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vector_dot(v1,v2):\n return (v1.x * v2.x) + (v1.y * v2.y) + (v1.z * v2.z)", "def vec_dot(v1,v2):\r\n \r\n return np.dot(v1,v2)", "def dot(vector1, vector2):\n return sum(a1 * a2 for a1, a2 in zip(vector1, vector2))", "def vdot(a, b):\n return np.vdot(a.ravel(), b.ravel())", "def vector_d...
[ "0.8535302", "0.8517884", "0.8421269", "0.8217205", "0.8214835", "0.82119024", "0.8203131", "0.8177589", "0.8144931", "0.8104594", "0.8042755", "0.8024297", "0.801789", "0.8010448", "0.8009818", "0.79805255", "0.79597074", "0.79497576", "0.7945951", "0.7929879", "0.79248065",...
0.0
-1
Computes a vectorvector dot product.
def blas_ddot(x: 'float64[:]', y: 'float64[:]', incx: 'int32' = 1, incy: 'int32' = 1 ): from pyccel.stdlib.internal.blas import ddot n = np.int32(x.shape[0]) return ddot (n, x, incx, y, incy)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vector_dot(v1,v2):\n return (v1.x * v2.x) + (v1.y * v2.y) + (v1.z * v2.z)", "def vec_dot(v1,v2):\r\n \r\n return np.dot(v1,v2)", "def dot(vector1, vector2):\n return sum(a1 * a2 for a1, a2 in zip(vector1, vector2))", "def vdot(a, b):\n return np.vdot(a.ravel(), b.ravel())", "def vector_d...
[ "0.85362506", "0.85185564", "0.8422258", "0.8217442", "0.8215834", "0.8213134", "0.8203694", "0.81785166", "0.81453496", "0.8105377", "0.8043568", "0.80252045", "0.80183405", "0.8011104", "0.8011084", "0.798106", "0.7960443", "0.795032", "0.79466933", "0.7930745", "0.79257125...
0.0
-1
Hide and show scrollbar as needed.
def autoscroll(sbar, first, last): #first, last = float(first), float(last) #if first <= 0 and last >= 1: # sbar.grid_remove() #else: # sbar.grid() sbar.set(first, last)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hide_scrollbars(self):\n # type: () -> tp.Text\n logger.debug('EyesWebElement.HideScrollbars()')\n return self.set_overflow('hidden')", "def reset_scrollbar(self):\n self.testCanvas.bind('<Configure>', self.off_configure)\n self.testFrame.bind('<Configure>', self.off_config...
[ "0.74488217", "0.6445141", "0.6360241", "0.62540764", "0.6163513", "0.6138351", "0.6096055", "0.6095595", "0.6085144", "0.6014418", "0.5979877", "0.59713477", "0.5830971", "0.5827112", "0.58212113", "0.58015853", "0.5761151", "0.57578546", "0.5735891", "0.57161564", "0.568943...
0.0
-1
Show all transactions for an account.
def view_transactions(request, id): account = get_object_or_404(Account, pk=id, user=request.user) return render(request, 'ledger/pages/view_transactions.html', { 'title': "View Transactions", 'breadcrumbs': [account], 'account': account, })
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transactions(self):\n return self._call_account_method(\n 'transactions'\n )", "def transactions(self) -> List[Transaction]:\n return self.session.get_transactions(self.account_id)", "def transactions(self):\r\n return tx.AccountTransactions(self)", "def all_transac...
[ "0.7251891", "0.7159647", "0.71557933", "0.7103357", "0.7067925", "0.70478076", "0.6915322", "0.68663853", "0.68549216", "0.68439335", "0.6819226", "0.676494", "0.67583776", "0.67536074", "0.6658718", "0.65637153", "0.65630877", "0.6529864", "0.6493824", "0.6490367", "0.64876...
0.7152499
3
Create or edit a tag.
def edit_tag(request, id=None): tag = id and get_object_or_404(Tag, pk=id, user=request.user) if request.method == 'POST': form = EditTagForm(instance=tag, data=request.POST) if form.is_valid(): tag = form.save(commit=False) tag.user = request.user tag.save() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_tag_edit(user_id, tag_id):\n\n title = request.form.get('title')\n content = request.form.get('content')\n\n tag = Tag.query.get_or_404(tag_id)\n\n tag.title = title\n tag.content = content\n\n db.session.add(tag)\n db.session.commit()\n\n return redirect(f'/users/{user_id}/tags...
[ "0.70846736", "0.6933251", "0.6877399", "0.68766123", "0.680835", "0.67536503", "0.6752099", "0.665326", "0.66121835", "0.65367997", "0.65165246", "0.64235383", "0.64102495", "0.6401257", "0.6387984", "0.6341052", "0.63310254", "0.63220966", "0.63129765", "0.6298583", "0.6287...
0.65408725
9
Evaluates the model on the specified provided data.
def eval( self, processed_data_dir: Path, output_result_dir: Path, ) -> NoReturn: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate(self, test_data):\n result = self.model.run(test_data)\n self._save_result(result)", "def evaluate(self, dataset):\n return self.model.evaluate(dataset.X_val, dataset.y_val)", "def evaluate(self, dataset):\n\t\tpass", "def evaluate(self, data: dataset.Dataset, batch_size: in...
[ "0.7726123", "0.74521244", "0.7416396", "0.7168331", "0.71417445", "0.70616573", "0.70312864", "0.7007225", "0.7004036", "0.68967515", "0.6858146", "0.6797384", "0.67482865", "0.67449546", "0.67444396", "0.6735653", "0.66611856", "0.6627011", "0.65684885", "0.6527918", "0.652...
0.0
-1
returns a list of nodes that are directly connected to the node. (Nodes can be either strings or id numbers programmer's choice.) If there are no neighbors, return an empty array.
def get_neighbors(self, node:Edge_End_Type)->List[Edge_End_Type]: neighbors = [] # ----------------------------------------- # TODO: You should write this method! # ----------------------------------------- return neighbors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def neighbors(self, node):\r\n return list(self.graph.neighbors(node))", "def neighbors(node, topology):\n return [n for n in topology[node]]", "def neighbors(self) -> List['Node']:\r\n self._load_neighbors()\r\n return [edge.source if edge.source != self else edge.target\r\n ...
[ "0.78822523", "0.7561094", "0.73846793", "0.73794687", "0.7369205", "0.7235593", "0.7220323", "0.7160723", "0.71198195", "0.71193516", "0.7075535", "0.70093334", "0.6995219", "0.6994704", "0.69647336", "0.6962063", "0.6958244", "0.6927126", "0.68998885", "0.6895447", "0.68801...
0.72793907
5
Communication ID of Container Manager.
def containerID(self): return self._container
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unique_id(self) -> str:\n return \"cid_listener\"", "def cont_to_id(self):\n return self.client.containers.get(self.container).id", "def getID(self):\r\n return self._interface.UID", "def container_id(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"container...
[ "0.6946638", "0.69405377", "0.6577476", "0.6566359", "0.6444734", "0.6340716", "0.6332664", "0.63087595", "0.62691516", "0.6249739", "0.6236498", "0.623616", "0.623616", "0.6224526", "0.6213687", "0.6172311", "0.6161505", "0.6157629", "0.61566055", "0.6154779", "0.61430717", ...
0.7071802
0
Communication ID of Relay Manager.
def relayID(self): return self._relay
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unique_id(self) -> str:\n return \"cid_listener\"", "def msg_id(self):\n return struct.unpack('<H', self.pkt.payload[0:2])[0]", "def id(self):\n return self.proto.id", "def reactornet_id(self):\n return self.__reactornet_id", "def id(self): # pylint: disable=invalid-name\n ...
[ "0.67285085", "0.6686077", "0.65843546", "0.656822", "0.6560302", "0.655132", "0.6545194", "0.6512769", "0.6497593", "0.64823115", "0.64299226", "0.63417786", "0.62935275", "0.62927604", "0.6256321", "0.6246932", "0.62315375", "0.6225695", "0.6217929", "0.6213905", "0.6207331...
0.7419524
0
Returns the CommID of the container manager where the next container should be created.
def getNextContainerLocation(self, repeat=False): try: return self._containerIter.next().containerID except (StopIteration, RuntimeError): if repeat: raise InternalError('Can not get next container location.') self._containerIter = self._m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def containerID(self):\n return self._container", "def get_next_id(self):\n con = self.c._connect()\n last_id = self.c.get_last_id(con.cursor())\n con.close()\n return last_id + 1", "def get_current_container_id():\n with open('/proc/self/cgroup', 'rt') as cgroup_file:\n ...
[ "0.6155065", "0.5958762", "0.5860657", "0.5858785", "0.58271295", "0.58187675", "0.57574224", "0.5619946", "0.5619382", "0.56084776", "0.5562231", "0.5554326", "0.55372727", "0.5524773", "0.5510233", "0.5507761", "0.54967767", "0.545403", "0.54444987", "0.5408748", "0.5392454...
0.5420013
19
Returns the list of awards for an app.
def get_award_list(actioncluster): award_queryset = (ActionClusterAward.objects .select_related('award').filter(actioncluster=actioncluster)) return [a.award for a in award_queryset]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def awards(self) -> str:\n return self._awards", "def getInAppRewards(self):\n\t\turl = \"https://habitica.com/api/v3/user/in-app-rewards\"\n\t\treturn(getUrl(url, self.credentials))", "def getMVPAwards(self):\n return self.mvpawards", "def get_awards(self):\n self.awards = imdb.get_titl...
[ "0.6946871", "0.66375536", "0.63325316", "0.6270439", "0.5776029", "0.5532828", "0.5473625", "0.543226", "0.5388789", "0.53499174", "0.5320342", "0.5309254", "0.52594495", "0.522542", "0.520576", "0.5174362", "0.5113327", "0.5103617", "0.5077845", "0.5077845", "0.5067262", ...
0.60861135
4
View for adding an ``Application``.
def actioncluster_add(request): if request.method == 'POST': form = ActionClusterForm(request.POST, request.FILES) if form.is_valid(): instance = form.save(commit=False) instance.owner = request.user instance.save() form.save_m2m() mailer.n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_app(self):\n \n pass", "def add(self, application):\n\n if (application.add() is None):\n self.__logger.debug(\"Adding application %s to list\" % application)\n self.__applicationList[application.application_name] = application\n return None\n ...
[ "0.7377317", "0.7352872", "0.7255815", "0.6959909", "0.6895584", "0.6630124", "0.65948886", "0.65651625", "0.65651625", "0.65517026", "0.6492903", "0.6487439", "0.6459186", "0.62470627", "0.6187162", "0.6182075", "0.6177893", "0.614874", "0.6147377", "0.61368114", "0.6091355"...
0.0
-1
Adds collaborators to an application.
def actioncluster_membership(request, slug): actioncluster = get_object_or_404( ActionCluster.active, slug__exact=slug) if not actioncluster.is_owned_by(request.user): raise Http404 if request.method == 'POST': form = MembershipForm(request.POST) formset = ActionClusterMember...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collaborators(self, collaborators):\n\n self._collaborators = collaborators", "def collaborators(self):\n return self._collaborators", "def collaborators(self):\r\n return RepoCollaborators(self)", "def ListCollaborators(self, request, context):\n context.set_code(grpc.StatusCode....
[ "0.72790515", "0.6617575", "0.655523", "0.6215389", "0.5901404", "0.5894921", "0.58802927", "0.5783821", "0.57140726", "0.56167364", "0.5601526", "0.54443747", "0.5400407", "0.538177", "0.53705525", "0.52563184", "0.51545435", "0.51439106", "0.51361936", "0.50950557", "0.5026...
0.0
-1
make an instance of FieldComplexAbilityPerMinUT and return it
def instance(data): return FieldComplexAbilityPerMinUT(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build(self, unit, *args, **kwargs):\n return self(self._game_data.units[unit.value].creation_ability.id, *args, **kwargs)", "def _magma_init_(self, magma):\n return \"ComplexField(%s : Bits := true)\" % self.prec()", "def copy(self) -> Self:\n return Abilities(\n name=self.n...
[ "0.58396274", "0.5592196", "0.5126128", "0.51013213", "0.50488883", "0.5014893", "0.4983797", "0.49262384", "0.49151394", "0.4796814", "0.47784594", "0.47748986", "0.47651297", "0.47526002", "0.4720797", "0.47172308", "0.4687235", "0.46872023", "0.4685694", "0.46847597", "0.4...
0.88426167
0
Sets the learning rate to the initial LR decayed by 10 every 30 epochs
def adjust_learning_rate(optimizer, epoch): lr = 0.5 * (0.1 ** (epoch // 100)) for param_group in optimizer.param_groups: param_group['lr'] = lr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_learning_rate(init_lr, optimizer, epoch, n=100):\n init_lr = init_lr * (0.1 ** (epoch // n))\n print('learning rate : ', init_lr)\n for param_group in optimizer.param_groups:\n param_group['lr'] = init_lr", "def adjust_learning_rate(start_lr, optimizer, epoch, total_epoch_num):\n #l...
[ "0.7913536", "0.7906521", "0.7849834", "0.777524", "0.77338326", "0.77306354", "0.7722718", "0.77224237", "0.771982", "0.77092624", "0.7693604", "0.76742035", "0.7665748", "0.7665748", "0.7665748", "0.7655329", "0.76419765", "0.76399755", "0.7637868", "0.7626077", "0.76247585...
0.75275576
45
Create hyphendelimited string from list of ints
def ids_to_string(idlist): if len(idlist) == 1: return "{:d}".format(idlist[0]) else: return "-".join(["{:d}".format(id) for id in idlist])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getCompactNotationFromIntegers(ints: Iterable[int]) -> str:\n return '^'.join(\n f\"{first}\" if first == last\n else f\"{first}..{last}\" if stride == 1\n else f\"{first}..{last}:{stride}\"\n for first, last, stride in getSpansFromIntegers(ints)\n )", "def hyphenize(numlist...
[ "0.6785078", "0.6782508", "0.6763799", "0.66719925", "0.64610356", "0.62901676", "0.62580216", "0.6149287", "0.61476916", "0.6067345", "0.6060236", "0.6040563", "0.6028521", "0.6025248", "0.5985584", "0.59717524", "0.5942201", "0.593364", "0.5860419", "0.579067", "0.5783558",...
0.76746315
0
Turn off the light on arduino.
def light_off(self, pin='D13'): self.light_set(pin, '0')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_off(self):\n GPIO.output(self.gpio, False) # turn off light", "def turn_off(self, **kwargs: Any) -> None:\n self._device.power_on = False\n _LOGGER.debug(\"Turn off light %s\", self._device.ip)", "def turn_off(self):\n print(\"Turning the lights off\")\n self.led.al...
[ "0.8683844", "0.8396932", "0.82261133", "0.82141066", "0.80594754", "0.8051156", "0.8019694", "0.79972017", "0.7965712", "0.79346895", "0.7881943", "0.7861334", "0.78610563", "0.7852971", "0.78426087", "0.7832532", "0.7830238", "0.78130734", "0.7616986", "0.76166636", "0.7612...
0.781177
18
Creates summary ops, placeholders for them and a summary writer.
def create_summary_objects(graph=None): test_loss = tf.placeholder(tf.float32, []) test_perplexity = tf.placeholder(tf.float32, []) tf.summary.scalar('Loss_overall', test_loss) tf.summary.scalar('Perplexity_overall', test_perplexity) # Do it for each individual bucket as well bucket_loss_placeho...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_summaries(self):\n\n # Loss summary.\n tf.summary.scalar('loss', self.loss)\n\n merged = tf.summary.merge_all()\n self.summary_op = merged\n tf.logging.info('summary op set')", "def build_summaries(self):\n\n # Loss summary.\n tf.summary.scalar('loss', self.loss)\n\n merged = tf...
[ "0.6939759", "0.6939759", "0.68392587", "0.6731722", "0.672946", "0.67249185", "0.6697802", "0.66561943", "0.6634523", "0.6482905", "0.6463107", "0.64387125", "0.64106256", "0.6384462", "0.63727385", "0.6366604", "0.63300073", "0.6259475", "0.62538075", "0.6163977", "0.612872...
0.65014774
9
Attempts to discover the date for latest release of the eAIP. If release for current month is not found then this method will return ``None``.
async def __get_current_version() -> typing.Union[None, datetime.datetime]: year, month = datetime.datetime.now().year, datetime.datetime.now().month _, month_len = calendar.monthrange(year, month) async with aiohttp.ClientSession() as session: reqs = [] for day in range(1, month_len + 1): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_release_date ():\n fname = os.path.join(\"doc\", \"changelog.txt\")\n release_date = \"unknown\"\n with open(fname) as fd:\n # the release date is on the first line\n line = fd.readline()\n mo = release_ro.search(line)\n if mo:\n release_date = mo.groups(1)\n...
[ "0.66992724", "0.63118005", "0.61192423", "0.60601276", "0.60377175", "0.60144126", "0.60024685", "0.59800243", "0.59241295", "0.59058344", "0.5892865", "0.5888002", "0.584918", "0.5842483", "0.5834521", "0.5784205", "0.5738439", "0.5732918", "0.5697884", "0.56487143", "0.563...
0.56350005
20
Parses requirements from requirements.txt.
def read_requirements(): reqs_path = os.path.join('.', 'requirements.txt') with open(reqs_path, 'r') as f: requirements = [line.rstrip() for line in f] return requirements
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_requirements_txt():\n root = os.path.dirname(os.path.abspath(__file__))\n\n requirements = []\n dependencies = []\n\n with open(os.path.join(root, 'requirements.txt'), 'r') as f:\n for line in f.readlines():\n line = line.rstrip()\n if not line or line.startswith(...
[ "0.8259474", "0.7562084", "0.7415146", "0.74128574", "0.73441166", "0.73265", "0.73209316", "0.7296043", "0.7220389", "0.72197473", "0.7208879", "0.7200629", "0.71182066", "0.7098238", "0.7093704", "0.70839036", "0.70267594", "0.70260257", "0.7016794", "0.69958186", "0.696473...
0.74432576
2
Provisioning state of the resource.
def provisioning_state(self) -> Optional[pulumi.Input[Union[str, 'ProvisioningState']]]: return pulumi.get(self, "provisioning_state")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def provisioning_state(self) -> str:\n return pulumi.get(self, \"provisioning_state\")", "def provisioning_state(self) -> str:\n return pulumi.get(self, \"provisioning_state\")", "def provisioning_state(self) -> str:\n return pulumi.get(self, \"provisioning_state\")", "def provisioning_s...
[ "0.78685683", "0.78685683", "0.78685683", "0.78685683", "0.78685683", "0.78685683", "0.78685683", "0.78685683", "0.78685683", "0.78685683", "0.78685683", "0.78685683", "0.78685683", "0.78685683", "0.78685683", "0.78685683", "0.78685683", "0.78685683", "0.78685683", "0.78685683"...
0.7355461
45
_tearDown_ Nothing to do
def tearDown(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tearDown(self):\n print('Calling \\'tearDown\\'')", "def tearDown(self) -> None:\n pass", "def tearDown(self) -> None:\n pass", "def tearDown(self) -> None:\n pass", "def tearDown(self):\n pass", "def tearDown(self) :\n pass", "def tearDown(self) :\n ...
[ "0.9103124", "0.9088719", "0.9088719", "0.9088719", "0.90838766", "0.9028942", "0.9028942", "0.9028942", "0.90283775", "0.90283775", "0.90283775", "0.90283775", "0.90283775" ]
0.9020345
62
Return the file name of the zip archive without path.
def getZipArchiveFileName(self): if self._mode == "zip": fullFile = java.io.File(self.getZipArchiveFullPath()) return fullFile.getName() return ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getArchiveName(zip_file):\n\n with ZipFile(zip_file, 'r') as f:\n names = f.namelist()\n\n return str(names[0])", "def getZipArchiveFullPath(self):\n\n if self._mode == \"zip\":\n return self._rootExportPath + \".zip\"\n\n return \"\"", "def get_archive_name(self):\n ...
[ "0.8182718", "0.7849195", "0.76937604", "0.76565015", "0.72936654", "0.69314456", "0.6664349", "0.64905214", "0.6471552", "0.641845", "0.63666093", "0.63350314", "0.6270954", "0.6240384", "0.6237877", "0.62101895", "0.6205429", "0.61886334", "0.61839175", "0.61788976", "0.617...
0.88365096
0
Return the experiment path relative to the user folder.
def getRelativeRootExperimentPath(self): return userId + "/" + \ self._rootExportPath[self._rootExportPath.rfind(self._properties['export_dir']):]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def experiment_dir(experiment_name: str) -> Path: # pragma: no cover\n return EXPERIMENTS_DIR / experiment_name", "def artiq_results_path(experiment: Optional[str] = None) -> str:\n\n path = os.path.join(shared_area_path(), \"artiqResults\")\n\n if experiment is None:\n try:\n experim...
[ "0.7746786", "0.7192384", "0.69616795", "0.6817234", "0.6762773", "0.67626286", "0.67277217", "0.66584903", "0.6632485", "0.6598605", "0.659734", "0.65944034", "0.6587815", "0.6550216", "0.6549218", "0.6532387", "0.6516663", "0.65132374", "0.647887", "0.64734834", "0.6458694"...
0.80642927
0
Return a list of datasets belonging to the plate with specified ID optionally filtered by self._specimen. If none are found, return []. If no plateCode is given, it is assumed that the plate is the passed entity with code self._entityCode.
def _getDataSetsForPlate(self, plateCode=None): if plateCode is None: plateCode = self._entityCode # Set search criteria to retrieve all wells contained in the plate searchCriteria = SearchCriteria() plateCriteria = SearchCriteria() plateCriteria.addMatchClause(Match...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getDataSetForWell(self, wellCode=None):\n\n if wellCode is None:\n wellCode = self._entityCode\n\n # Set search criteria to retrieve the dataset contained in the well\n searchCriteria = SearchCriteria()\n wellCriteria = SearchCriteria()\n wellCriteria.addMatchClau...
[ "0.5983078", "0.55935466", "0.5565028", "0.5422192", "0.5406904", "0.5192831", "0.51732206", "0.5155721", "0.50729096", "0.5011865", "0.49902618", "0.4982476", "0.4933966", "0.49273255", "0.4824782", "0.4792534", "0.47873393", "0.47484604", "0.47304428", "0.4689637", "0.46619...
0.72878444
0
Get the datasets belonging to the well with specified code. If none are found, return []. If no wellCode is given, it is assumed that the well is the passed entity with code self._entityCode.
def _getDataSetForWell(self, wellCode=None): if wellCode is None: wellCode = self._entityCode # Set search criteria to retrieve the dataset contained in the well searchCriteria = SearchCriteria() wellCriteria = SearchCriteria() wellCriteria.addMatchClause(MatchClaus...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getDataSetsForPlate(self, plateCode=None):\n if plateCode is None:\n plateCode = self._entityCode\n\n # Set search criteria to retrieve all wells contained in the plate\n searchCriteria = SearchCriteria()\n plateCriteria = SearchCriteria()\n plateCriteria.addMatch...
[ "0.67775285", "0.58260256", "0.47121978", "0.45974782", "0.43667978", "0.43231952", "0.43064877", "0.42772606", "0.42308396", "0.42138433", "0.41863385", "0.41690397", "0.41516727", "0.4150209", "0.41225675", "0.41139087", "0.41128653", "0.4100393", "0.40923426", "0.4087841", ...
0.8216326
0
Get all tubes in the experiment. If the specimen is set (self._specimen), then return only those tubes that belong to it. Returns [] if none are found.
def _getAllTubes(self): # Set search criteria to retrieve all tubes in the experiment # All tubes belong to a virtual tubeset - so the set of tubes in the # experiment is exactly the same as the set of tubes in the virtual # tubeset searchCriteria = SearchCriteria() sear...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tests(self):\n subtests = itertools.chain(*(s.get_tests() for s in self.suites.values()))\n tt = [t for t in itertools.chain(self.tests,subtests)]\n return tt", "def specimens(self):\n\t\tif self._specimens is None:\n\t\t\tself._specimens = Specimen.SpecimenByPatient(self.id, self.ho...
[ "0.5808133", "0.57740843", "0.5707311", "0.56264013", "0.55487806", "0.54665005", "0.540161", "0.5344335", "0.5328739", "0.53058827", "0.5280345", "0.52625674", "0.5222472", "0.5213676", "0.5142558", "0.513356", "0.5119797", "0.5118196", "0.51113224", "0.5109136", "0.5086711"...
0.8666613
0
Assert that the result is an Arrow structure and the content matches an array.
def assert_content_equals_array(result, expected): assert isinstance(result, (pa.Array, pa.ChunkedArray)) if isinstance(result, pa.ChunkedArray): result = pa.concat_arrays(result.iterchunks()) assert result.equals(expected)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_array() -> None:\n soup = generate_case(\"array\")\n\n tests.html_schema_doc_asserts.assert_property_names(soup, [\"fruits\", \"vegetables\", \"veggieName\", \"veggieLike\"])\n tests.html_schema_doc_asserts.assert_descriptions(\n soup,\n [\n \"A schema with an array\",\n ...
[ "0.64968175", "0.6315331", "0.6193702", "0.6162584", "0.6070652", "0.59485894", "0.58931893", "0.5851826", "0.5831171", "0.57582563", "0.57557636", "0.57482576", "0.5744734", "0.5731603", "0.5723308", "0.5687149", "0.5648692", "0.5639876", "0.5626837", "0.56135416", "0.559158...
0.69491386
0
Fix exceptions for a player name between Comunio and Comuniazo.
def check_exceptions(playername): exceptions = {'Banega': 'Ever Banega', 'Mikel': u'Mikel González', u'Isma López': u'Ismael López'} return exceptions.get(playername, playername)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name_from_player(player):\r\n return player.name.lower()", "def player_name(player: Character) -> None:\r\n global censored_words\r\n while player.name == \"\":\r\n playerName = str(input(\"please enter player one's name: \"))\r\n for i in censored_words:\r\n if playerNa...
[ "0.65403754", "0.64365023", "0.6144107", "0.6051075", "0.59795576", "0.5956214", "0.594156", "0.5924972", "0.5920313", "0.5894", "0.5862795", "0.5846365", "0.58306074", "0.5797499", "0.57891387", "0.5787647", "0.57636434", "0.5728113", "0.57109046", "0.56852686", "0.5683944",...
0.6381545
2
Returns the symmetric nodes for the node.
def sym_nodes(self): def primary(): n = self.copy() n.name = '{}_p'.format(self.name) return n def x_sym(): n = self.copy() n.name = '{}_x'.format(self.name) n[1] *= -1 return n def y_sym(): n = sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def symmetric(self):\n result = self.directed()\n result.extend([(down, up) for up, down in result])\n return Pairs(result)", "def all_pairs(self):\n return chain(self.nx_graph.edges(), nx.non_edges(self.nx_graph))", "def symmetric(k):\r\n k_ = k.copy()\r\n k_.parts = [parts.s...
[ "0.7284011", "0.6152626", "0.61061114", "0.59279776", "0.59069306", "0.58496046", "0.57166666", "0.5650836", "0.5644685", "0.5644453", "0.5630279", "0.5597891", "0.5591676", "0.55900973", "0.55558836", "0.5536972", "0.5534459", "0.55344045", "0.5524703", "0.5522037", "0.55179...
0.7318792
0
Test setup from yaml with invalid config.
async def test_setup_invalid_config( recorder_mock: Recorder, hass: HomeAssistant ) -> None: with patch( "homeassistant.components.sql.config_flow.sqlalchemy.create_engine", ): assert not await async_setup_component(hass, DOMAIN, YAML_CONFIG_INVALID) await hass.async_block_till_done(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_broken_config(broken_config):\n with pytest.raises(RuntimeError, match=\"Error reading config.yml\"):\n abcconfig.get_config(broken_config)", "def testParse_invalidYaml(self):\n config_path = GetTestFilePath('invalid/config_invalid_yaml.yaml')\n with self.assertRaises(lab_config.ConfigEr...
[ "0.76678103", "0.7456443", "0.7441922", "0.7427918", "0.7256505", "0.7010786", "0.69474906", "0.6944451", "0.6936295", "0.6922561", "0.6886546", "0.6857125", "0.68518454", "0.68090916", "0.67839324", "0.6768537", "0.6759712", "0.67434365", "0.6717547", "0.66704065", "0.663389...
0.6806269
14
Gets the enabled of this JWKS.
def enabled(self) -> bool: return self._enabled
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enabled(self):\n return self._get('enabled')", "def getEnabled(self):\n if getattr(self, 'installedversion', None) != __version__ :\n return False\n return self.getField('enabled').get(self)", "def enabled(self):\n return self.__enabled", "def enabled(self):\n ...
[ "0.7557667", "0.72976995", "0.7257846", "0.7246494", "0.7246494", "0.7246494", "0.7246494", "0.7246494", "0.7246494", "0.7246494", "0.7246494", "0.72377896", "0.71959203", "0.70751923", "0.7062059", "0.7062059", "0.7062059", "0.7062059", "0.7062059", "0.7062059", "0.7047331",...
0.6752353
56
Gets the issuer of this JWKS.
def issuer(self) -> str: return self._issuer
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def issuer(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"issuer\")", "def issuer(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"issuer\")", "def issuer(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"issuer\")", "def getIssuer(self):\n\n retur...
[ "0.82058907", "0.81614804", "0.8033258", "0.75556844", "0.75556844", "0.7448776", "0.73119324", "0.7271268", "0.72197175", "0.72197175", "0.7214744", "0.6878213", "0.68566966", "0.66182864", "0.65781546", "0.64889675", "0.6361098", "0.6274156", "0.6274156", "0.62650096", "0.6...
0.8377367
0
Sets the issuer of this JWKS.
def issuer(self, issuer: str): self._issuer = issuer
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_issuer(self, claim=ISSUER):\n if api_settings.ISSUER is not None:\n self.payload[claim] = api_settings.ISSUER", "def issuer(self, value):\n\n is_oscrypto = isinstance(value, asymmetric.Certificate)\n if not isinstance(value, x509.Certificate) and not is_oscrypto:\n ...
[ "0.7398869", "0.7303777", "0.7033179", "0.6817304", "0.66975534", "0.63538086", "0.6329032", "0.62443656", "0.60463524", "0.60463524", "0.59711975", "0.5911019", "0.59106326", "0.58634937", "0.568231", "0.5632553", "0.554732", "0.54978395", "0.546228", "0.5397148", "0.5380466...
0.8452207
0
Gets the url of this JWKS.
def url(self) -> str: return self._url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def jwks_uri(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"jwks_uri\")", "def jwks_uri(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"jwks_uri\")", "def jwks_uri(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"jwks_uri\")", "def g...
[ "0.77084965", "0.7443695", "0.7443695", "0.72643316", "0.72562456", "0.71978265", "0.7192331", "0.7192331", "0.71672666", "0.71672666", "0.7128757", "0.7128757", "0.7123297", "0.7123297", "0.7123297", "0.7100312", "0.7100312", "0.7088034", "0.7088034", "0.7088034", "0.7088034...
0.7084603
28
Sets the url of this JWKS.
def url(self, url: str): self._url = url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_url(self, url):\n self.data['url'] = url", "def set_url(self, url):\n self.url = url", "def set_url(self, url):\n if url is not None:\n self.url = url", "def url(self, url: str):\n self._url = url", "def url(self, url):\n\n self._url = url", "def url(...
[ "0.7628267", "0.7522564", "0.7391557", "0.73159444", "0.72706074", "0.72706074", "0.72706074", "0.72706074", "0.72706074", "0.72706074", "0.72706074", "0.7209406", "0.7175068", "0.68533593", "0.66119975", "0.65725887", "0.6482397", "0.64477754", "0.64247274", "0.64117825", "0...
0.7236301
12
Generate a signature string, first use the sha256 algorithm to calculate the summary of the msg hashed key, and then use the base64 algorithm to get the signature string.
def _generate_signature(self, key, msg): key = to_bytes(key) msg = to_bytes(msg) hash_obj = hmac.new(key, msg=msg, digestmod=hashlib.sha256) digest = hash_obj.digest() # abstract signature = base64.b64encode(digest) # Signature return to_unicode(signature)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_signature(msg):\n hashkey = memcache.Client().get('CURL_TEST_SERVER_HASHKEY')\n h = hmac.new(hashkey, msg, hashlib.sha1)\n signature = urllib.quote(base64.b64encode(h.digest()))\n return signature", "def create_signature(self, string_to_sign: str) -> str:\n begin_signature = hmac.n...
[ "0.7553087", "0.75419503", "0.725328", "0.71853006", "0.6886622", "0.6883063", "0.6860222", "0.68582153", "0.67972124", "0.6776143", "0.67487645", "0.67413455", "0.673321", "0.6710444", "0.6708279", "0.6637163", "0.66250867", "0.65932435", "0.6458901", "0.64328444", "0.639083...
0.8036061
0
Populates the dictionary of children nodes, initialising the weights to the weights allocated by some stochastic policy. Here we take liberty of assuming that different actions will lead to unique states. This assumption isn't necessarily true, but we make it for game playing. (And is true in this case). To populate ch...
def expand(self, policy): if self.children != {}: return actionWeights = policy(self.state) for action in actionWeights: succ = self.state.succ(self.state.player, action) self.children[action] = TreeNode(succ, actionWeights[action], self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_child(self, actions, probs):\n games = [copy(self.game) for a in actions]\n\n for action, game in zip(actions, games):\n game.move(action)\n\n self.child = {tuple(a): Node(g, self, p)\n for a, g, p in zip(actions, games, probs)}", "def _apply_tree_p...
[ "0.658746", "0.6587294", "0.6400006", "0.6400006", "0.6400006", "0.6400006", "0.635076", "0.6323806", "0.6311343", "0.61478865", "0.6084518", "0.6071882", "0.596801", "0.5962929", "0.59513974", "0.59295994", "0.590971", "0.5907116", "0.59015554", "0.58896977", "0.5841662", ...
0.72776294
0
Expansion. (Part 1). We expand the tree node 'node'. In this implementation we add all possible successors to the children map of 'node', with weights according to 'selPolicy' newAgent = 1 self.state.agent
def expand(self, node): node.expand(self.selPolicy)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expand(self, policy):\n if self.children != {}: return\n actionWeights = policy(self.state)\n for action in actionWeights:\n succ = self.state.succ(self.state.player, action)\n self.children[action] = TreeNode(succ, actionWeights[action], self)", "def expand(node):\...
[ "0.74847573", "0.6756893", "0.6734362", "0.66772944", "0.66772944", "0.66772944", "0.66772944", "0.6637463", "0.6474223", "0.64040214", "0.6388803", "0.6243243", "0.6170601", "0.6124658", "0.61200285", "0.600391", "0.59850836", "0.5982079", "0.59184724", "0.5890176", "0.58826...
0.6955037
1
Simulate. Simulates the rest of the game, stochastically, from node 'root', using policy 'simPolicy'. Returns a value of the game. (1 if the agent wins, 1 if they don't, 0 for a draw). We keep on simulating whilst "no one has one and there is a legal move left" Remember to copy the state so that we don't clobber the st...
def simulate(self, root, player, default_action): while state.winner() == None and len(state.get_actions()) > 0: actionToWeight = self.simPolicy(state) action = util.selectRandomKey(actionToWeight, default_action) state = state.succ(action) return state.utility(playe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_simulation(self, state):\n \"*** YOUR CODE HERE ***\"\n player = 0\n visited_states = [(player, state)]\n depth_limited = self.depth != -1\n depth = self.depth\n expand = True\n while not visited_states[-1][1].isWin() and not visited_states[-1][1].isLose():\...
[ "0.6664648", "0.62717783", "0.62556267", "0.6204361", "0.6173981", "0.6155401", "0.600999", "0.59432125", "0.5862531", "0.58487195", "0.5800608", "0.5793998", "0.57760435", "0.57568985", "0.57313174", "0.56989557", "0.56408614", "0.5603904", "0.5599027", "0.5539167", "0.55290...
0.6698908
0
Get the ith bit of num.
def get_bit(num, i): return num & (1 << i) != 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bit(num, i):\r\n return 1 if num & 1 << i else 0", "def _get_bit(self, num, bit, mask=1):\n return (int(num) >> bit) & mask", "def get_bit(num, position):\n\treturn (num >> position) & 0b1", "def get_bit(byte, bit_num):\n return (byte & (1 << bit_num)) >> bit_num", "def _bits(num):\r\n ...
[ "0.8679636", "0.7923837", "0.7650059", "0.7607631", "0.7519709", "0.75161844", "0.7508741", "0.7475928", "0.73240674", "0.7213853", "0.70749223", "0.7015795", "0.6972075", "0.6947019", "0.6774417", "0.6773564", "0.6765912", "0.6633677", "0.64876205", "0.6441105", "0.6415637",...
0.8158778
1
Set the ith bit of num to 1.
def set_bit(num, i): return num | (1 << i)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setbit(num,bit):\n num=shiftright(num,bit)\n num=shiftleft(num,31)\n num=shiftright(num,31 - bit)\n return num", "def _setBitOn(x, bitNum):\n _checkInt(x, minvalue=0, description='input value')\n _checkInt(bitNum, minvalue=0, description='bitnumber')\n\n return x | (1 << bitNum)", "def...
[ "0.72565776", "0.71907336", "0.704791", "0.69743407", "0.682077", "0.6757631", "0.6536882", "0.65009785", "0.6441236", "0.6297451", "0.6296036", "0.61799145", "0.61447436", "0.6136844", "0.6117797", "0.60683984", "0.6061333", "0.60045624", "0.5980012", "0.59641767", "0.590904...
0.799918
0
Set the ith bit of num to 0.
def clear_bit(num, i): return num & ~(1 << i)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_bit(num, i):\n return num | (1 << i)", "def setbit(num,bit):\n num=shiftright(num,bit)\n num=shiftleft(num,31)\n num=shiftright(num,31 - bit)\n return num", "def __setitem__(self, n, bit):\n self.num ^= (np.uint64(-bit) ^ self.num) & (UINT64_ONE << np.uint64(n))", "def update_bi...
[ "0.6936634", "0.672577", "0.66397357", "0.6634527", "0.6448497", "0.6336953", "0.6315433", "0.620187", "0.62008196", "0.6154546", "0.6107823", "0.60509044", "0.60049385", "0.5850566", "0.58501226", "0.5835069", "0.57851577", "0.57851577", "0.57173955", "0.57068175", "0.567169...
0.7857541
0
constructor creates enemy and sets movement variables
def __init__(self, xpos, ypos, filename, end): pygame.sprite.Sprite.__init__(self) self.image = pygame.image.load(filename) self.image.convert_alpha() self.rect = self.image.get_rect() self.rect.x = xpos self.rect.y = ypos self.end = end #end of enemy path ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, x, y, agent):\n self.health = Enemy.health\n self.description = \"enemy\"\n # The enemy velocity\n self.velocity = 4\n self.direction = 'w'\n self.imgPath = 'img/thief_'\n self.img = pygame.image.load(self.imgPath+'w.png')\n\n Enemy.List.ap...
[ "0.74342746", "0.72351295", "0.6839829", "0.6831793", "0.6760723", "0.66696584", "0.6643502", "0.6549634", "0.65447515", "0.64950985", "0.646445", "0.6448481", "0.6444367", "0.64145553", "0.6400351", "0.6395187", "0.6344436", "0.6336186", "0.63072187", "0.6296487", "0.6278519...
0.6109953
33
Density function for normal distribution
def density_normal_dist(x): return ONE_OVER_SQRT_OF_TWO_PI * exp(-0.5 * x * x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normal_density(mean, variance, X):\n Z = np.sqrt(2.0*np.pi*variance)\n unden = np.exp(old_div(-np.sum((X-mean)**2.0, 1),(2.0*variance)) )\n den = old_div(unden,Z)\n assert len(den) == X.shape[0]\n return den", "def density(self, arg):\n mean = - self.sigma**2 * self....
[ "0.77422917", "0.7624194", "0.7508351", "0.73220676", "0.72783756", "0.72115767", "0.72000855", "0.7108084", "0.7095021", "0.70613873", "0.7037749", "0.6989931", "0.69727415", "0.6962466", "0.69543827", "0.69372207", "0.69325054", "0.69284075", "0.68937975", "0.6863287", "0.6...
0.7734051
1
The cumulative distribution function of the standard normal distribution. The standard implementation, following Abramowitz/Stegun, (26.2.17).
def cdf_abramowitz_stegun(x): if x >= 0: # if x > 7.0: # return 1 - ONE_OVER_SQRT_OF_TWO_PI * exp(-0.5*x*x)/sqrt(1.0+x*x) result = 1.0 / (1.0 + 0.2316419 * x) ret = 1.0 - ONE_OVER_SQRT_OF_TWO_PI * exp(-0.5 * x * x) * ( result * (0.31938153 + resul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cumulative_normal_distribution(z):\n from math import exp\n\n b1 = +0.319381530\n b2 = -0.356563782\n b3 = +1.781477937\n b4 = -1.821255978\n b5 = +1.330274429\n p = +0.2316419\n c = +0.39894228\n\n if z >= 0.0:\n t = 1.0 / (1.0 + p * z)\n return 1.0 - c * exp(-z * z / ...
[ "0.79022443", "0.76215607", "0.751344", "0.7454143", "0.72840565", "0.7247091", "0.70863765", "0.70688", "0.70274377", "0.69976807", "0.6855309", "0.6815726", "0.6808881", "0.67755884", "0.67336106", "0.6614377", "0.6526609", "0.6503872", "0.6434396", "0.64221025", "0.6411013...
0.0
-1
Returns True if at least one of the digits of k is a 7, False otherwise. >>> has_seven(3) False >>> has_seven(7) True >>> has_seven(2734) True >>> has_seven(2634) False >>> has_seven(734) True >>> has_seven(7777) True
def has_seven(k): if k % 10 == 7: return True elif k < 10: return False else: return has_seven(k // 10)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_seven(k):\n\tif k % 10 == 7:\n\t\treturn True\n\telif k < 10:\n\t\treturn False\n\telse:\n\t\treturn has_seven(k // 10)", "def has_seven(k):\n if k == 0:\n return False\n else:\n if k%10 == 7:\n return True\n return has_seven(k//10)", "def has_seven(k):\n \n ...
[ "0.89327633", "0.87172836", "0.87076133", "0.6202237", "0.58169496", "0.57854986", "0.5742934", "0.5733976", "0.555436", "0.55483586", "0.5536111", "0.5534428", "0.5499917", "0.5435271", "0.5354587", "0.53304225", "0.53294647", "0.5326998", "0.5319329", "0.5300464", "0.529924...
0.8691467
4
Sets the realname of this LocationInformationV2.
def realname(self, realname): if self.local_vars_configuration.client_side_validation and realname is None: # noqa: E501 raise ValueError("Invalid value for `realname`, must not be `None`") # noqa: E501 self._realname = realname
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_res_name(self, res_name):\n assert isinstance(res_name, str)\n for atm in self.iter_alt_loc():\n atm.res_name = res_name", "def set_fullname(self, value):\n self.fullname = value", "def set_name(self, newname=\"\"):\n self.name = newname", "def lastname(self, la...
[ "0.62380207", "0.57435817", "0.5737486", "0.56660545", "0.56557965", "0.56463337", "0.56463337", "0.5616884", "0.5602817", "0.5592221", "0.5580458", "0.55644345", "0.55345184", "0.5526654", "0.5526654", "0.5512409", "0.5510714", "0.5510714", "0.5510195", "0.55081636", "0.5500...
0.6834467
0
Sets the email of this LocationInformationV2.
def email(self, email): if self.local_vars_configuration.client_side_validation and email is None: # noqa: E501 raise ValueError("Invalid value for `email`, must not be `None`") # noqa: E501 self._email = email
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setEmail(self, email):\n self.email = email\n return self", "def email(self, email):\n\n self._email = email", "def email(self, email):\n\n self._email = email", "def email(self, email):\n\n self._email = email", "def email(self, email):\n\n self._email = email...
[ "0.72835284", "0.7122701", "0.7122701", "0.7122701", "0.7122701", "0.7122701", "0.7122701", "0.7122701", "0.7122701", "0.7122701", "0.7122701", "0.6974631", "0.6938073", "0.6880657", "0.657758", "0.6546972", "0.65302944", "0.65302944", "0.6238485", "0.6238485", "0.6238485", ...
0.718855
1
Sets the room of this LocationInformationV2.
def room(self, room): if self.local_vars_configuration.client_side_validation and room is None: # noqa: E501 raise ValueError("Invalid value for `room`, must not be `None`") # noqa: E501 self._room = room
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_room(self, room):\n self.room = room\n _LOGGER.info(\"Monitoring room: %s\", room)", "def set_location(self, event=None):\n if self.lhs and self.lhs.lower() != \"here\":\n try:\n try:\n room = ArxRoom.objects.get(db_key__iexact=self.lhs)\n...
[ "0.6701673", "0.6237634", "0.6027831", "0.59761626", "0.5770612", "0.5705786", "0.5691812", "0.56652325", "0.5615437", "0.5615437", "0.5544176", "0.5441164", "0.5408112", "0.5379086", "0.5370041", "0.5365304", "0.5364913", "0.52963305", "0.52893764", "0.5274522", "0.52546054"...
0.72681797
0
Sets the department_id of this LocationInformationV2.
def department_id(self, department_id): if self.local_vars_configuration.client_side_validation and department_id is None: # noqa: E501 raise ValueError("Invalid value for `department_id`, must not be `None`") # noqa: E501 self._department_id = department_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def department(self, department: object):\n\n self._department = department", "def department(self, department):\n\n self._department = department", "def department(self, department):\n\n self._department = department", "def set_department_by_id(department_id):\n return Department.que...
[ "0.6978126", "0.6951778", "0.6951778", "0.630885", "0.6125095", "0.6053594", "0.60260737", "0.57904595", "0.5703973", "0.53005344", "0.53005344", "0.5219623", "0.5219623", "0.519277", "0.5164068", "0.5157862", "0.5072827", "0.49915794", "0.4969619", "0.4969619", "0.4923204", ...
0.7488902
0
Sets the building_id of this LocationInformationV2.
def building_id(self, building_id): if self.local_vars_configuration.client_side_validation and building_id is None: # noqa: E501 raise ValueError("Invalid value for `building_id`, must not be `None`") # noqa: E501 self._building_id = building_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_info(self, build_info):\n if build_info is None:\n raise ValueError(\"Invalid value for `build_info`, must not be `None`\")\n\n self._build_info = build_info", "def update_building(request):\n body = json.loads(request.body)\n # Will be a dict representation of a hydrated...
[ "0.54820555", "0.54060173", "0.5332278", "0.52091104", "0.50137186", "0.48733953", "0.48649073", "0.4858493", "0.4842932", "0.48022047", "0.48022047", "0.48022047", "0.4787789", "0.4786378", "0.4786378", "0.47811884", "0.47239384", "0.47181478", "0.47023252", "0.47023252", "0...
0.79254144
0
Sets the id of this LocationInformationV2.
def id(self, id): if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, id_):\n\n self.id_ = id_", "def set_id(self, id):\n self.data['id'] = id", "def set_id(self, id):\n self.__id = id", "def SetId(self, id):\n self.id = int(id)", "def id(self, id):\n \n self._id = id", "def id(self, id):\n \n self._i...
[ "0.63462037", "0.6309465", "0.62418824", "0.6215269", "0.6082461", "0.6082461", "0.6082461", "0.6082461", "0.6082461", "0.6076148", "0.6063221", "0.6033134", "0.6033134", "0.6033134", "0.6033134", "0.6033134", "0.6033134", "0.6033134", "0.6033134", "0.6033134", "0.6033134", ...
0.0
-1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, LocationInformationV2): return False return self.to_dict() == other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, LocationInformationV2): return True return self.to_dict() != other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", ...
0.0
-1
Parse the requirements from a anysnake.toml file See readme.
def parse_requirements(req_file): used_files = [str(Path(req_file).absolute())] with open(req_file) as op: p = tomlkit.loads(op.read()) if "base" in p and "global_config" in p["base"]: fn = replace_env_vars(p["base"]["global_config"]) with open(fn) as op: gconfig = tomlki...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_requirements_txt():\n root = os.path.dirname(os.path.abspath(__file__))\n\n requirements = []\n dependencies = []\n\n with open(os.path.join(root, 'requirements.txt'), 'r') as f:\n for line in f.readlines():\n line = line.rstrip()\n if not line or line.startswith(...
[ "0.72700435", "0.6650913", "0.64945734", "0.64553326", "0.64500654", "0.6373349", "0.6323971", "0.6313418", "0.63047695", "0.62422156", "0.6235307", "0.6198385", "0.61786824", "0.6161799", "0.61377764", "0.6126406", "0.61151856", "0.61144227", "0.6103514", "0.60637903", "0.60...
0.59096944
36
Constructs half aerofoil plus its boundary layer.
def _half_aerofoil(coordinates, config): coordinates = copy.deepcopy(coordinates) reversed = False if coordinates[0][0] > coordinates[1][0]: coordinates.reverse() reversed = True i = 1 while i < len(coordinates): previous_index = i - 1 first = np.array([coordinates[p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_main_shape(self):\n\n a, b = gc( self.size/2,\n self._ZERO_DEGREES - self.angle,\n self._180_DEGREES + self.angle)\n self.wafer_points = zip(a,b)\n self.wafer_polygon = gdspy.Polygon(self.wafer_points, self.WAFER_LAYER)\n self.cell.add(self.wafe...
[ "0.6122024", "0.58930445", "0.58240485", "0.5737512", "0.57267344", "0.56619126", "0.5639945", "0.5537538", "0.5420177", "0.54121906", "0.53892255", "0.5388113", "0.5336486", "0.5309874", "0.5285305", "0.52524847", "0.5241815", "0.5237818", "0.52314997", "0.52187645", "0.5201...
0.63408875
0
Center of circle that is tangential to front line segment of aerofoil top and bottom.
def circle_center(top_aerofoil_points, bottom_aerofoil_points): q = np.array(top_aerofoil_points[0].coordinates) - np.array(top_aerofoil_points[1].coordinates) r = np.array(bottom_aerofoil_points[-1].coordinates) - np.array(bottom_aerofoil_points[-2].coordinates) c = np.cross(q, [0, 0, -1]) / np...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def circle_center(self):\n return self.container.width / 2, self.container.height / 2", "def center(self):\n return self._lower + 0.5 * (self._upper - self._lower)", "def get_arc_center(self):\n # First two anchors and handles\n a1, h1, h2, a2 = self.points[:4]\n # Tangent ve...
[ "0.66437805", "0.65956134", "0.65253747", "0.6490955", "0.64780426", "0.64019585", "0.6180446", "0.6130795", "0.61270577", "0.6120322", "0.61069936", "0.60877687", "0.6049624", "0.6047337", "0.60122186", "0.6000975", "0.59973323", "0.5996697", "0.5985603", "0.59807587", "0.59...
0.7186332
0
Initializes the weights of Generator/Disriminator.
def weights_init(m): if type(m) == torch.nn.Linear: m.weight.data.normal_(0.0, 0.02) m.bias.data.fill_(0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _initialize_weights(self):\n pass", "def init_weights_(self):\n raise NotImplementedError", "def init_weight(self):\n init_bn(self.norm0)", "def init_weights(self):\n # Initialize weights\n self.apply(self._init_weights)", "def init_weights(self):\n # Initializ...
[ "0.8548159", "0.8544672", "0.8383329", "0.837582", "0.834036", "0.8284404", "0.8223901", "0.82231367", "0.8092125", "0.80828273", "0.80319935", "0.80279243", "0.7992693", "0.79805386", "0.79615676", "0.79589516", "0.7955896", "0.79444057", "0.7942662", "0.78597265", "0.784008...
0.7039173
87
Recursive tree structure creation
def create_tree(outFile, tree, path='/'): for key, foo in tree.list(): if outFile.has_node(path, key): logging.debug('Path already found:', path, key) continue logging.debug('Creating group:', path, key) outFile.create_group(path, key, key) dest = path + key +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def construct_tree():\n root = TreeNode(5)\n root.left = TreeNode(3)\n root.right = TreeNode(8)\n root.left.left = TreeNode(2)\n root.left.right = TreeNode(4)\n root.right.left = TreeNode(7)\n return root", "def create_tree(nums):\n def build_tree(tree_list, nums):\n \"\"\"...
[ "0.73438674", "0.7024179", "0.6994389", "0.6971983", "0.6967024", "0.6943969", "0.6883883", "0.68332577", "0.68097556", "0.6776686", "0.6750668", "0.6711283", "0.66412014", "0.6639463", "0.6618947", "0.65851575", "0.6566382", "0.6558982", "0.65255225", "0.65047157", "0.649030...
0.6180036
45
Create & return a command line argument parser
def create_arg_parser(): parse_desc = """A script to download National Snowfall analysis files from the National Weather Service National Operational Hydrologic Remote Sensing Center (NOHRSC) """ curr_pwd = getcwd() parser = argparse.ArgumentParser(description=parse_desc) parser.add_argu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_parser():\n p = argparse.ArgumentParser(description='such a good program')\n p.add_argument('infile')\n p.add_argument('outfile')\n return p", "def command_line_argument_parser() -> argparse.ArgumentParser:\n parser = argparse.ArgumentParser(\n description=description(),\n ep...
[ "0.8103005", "0.8035468", "0.8035468", "0.78502715", "0.78303045", "0.7802035", "0.7794798", "0.7781135", "0.77755773", "0.7745297", "0.7732356", "0.773035", "0.7728732", "0.7725143", "0.7712153", "0.7710356", "0.77023166", "0.7700522", "0.7694158", "0.7681667", "0.76567197",...
0.0
-1
Duration of this instruction.
def duration(self) -> int: return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duration(self):\n pass", "def duration(self):\n pass", "def duration(self):\n # type: () -> int\n return self._duration", "def duration(self) -> datetime.timedelta:\n return self._duration", "def duration(self) -> float:\n return self.delta_t * len(self)", "d...
[ "0.8565303", "0.8565303", "0.7677113", "0.7648929", "0.7644913", "0.7644913", "0.76360804", "0.76263916", "0.7615538", "0.7615538", "0.7615538", "0.7615538", "0.7615538", "0.7615538", "0.7615538", "0.7615538", "0.7603955", "0.75873893", "0.75765306", "0.7557823", "0.7556277",...
0.82358986
2
Automatically find fitting bounds for the given peak
def fit_bounds(i, xp, xtroughs): def _fit_min(): result = None for element in xtroughs: if element < xp: result = element else: return result def _fit_max(): result = None for element in reversed(xtroughs): if e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_local_peak(flux, x, width, figname=None):\n width = int(round(width))\n if width%2 != 1:\n width += 1\n half = int((width-1)/2)\n\n i = int(round(x))\n\n # find the peak in a narrow range\n\n i1, i2 = max(0, i-half), min(flux.size, i+half+1)\n\n if i2 - i1 <= 4:\n # 4 is...
[ "0.69108415", "0.6796118", "0.667716", "0.6675862", "0.6645398", "0.6556157", "0.6526915", "0.65212286", "0.6496725", "0.64897794", "0.64670575", "0.6455718", "0.6376237", "0.6367866", "0.6347587", "0.6343871", "0.6329771", "0.63115096", "0.6277998", "0.6243615", "0.6208873",...
0.66232353
5
Get leaderboard entries for a hole or for the overall leaderboard.
def get_leaderboard(cursor, hole='all-holes', lang='all-langs') -> List[LeaderboardEntry]: if hole == 'all-holes': return get_overall_leaderboard(cursor, lang) query = ''' WITH leaderboard AS ( SELECT hole, submitted, strokes, user, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_overall_leaderboard(cursor, lang='all-langs') -> List[LeaderboardEntry]:\n # sqlite doesn't support PostgreSQL's DISTINCT ON.\n query = '''\n WITH augmented_solutions AS (\n SELECT hole,\n user,\n strokes,\n submitted,\n ...
[ "0.6723551", "0.63411117", "0.62041557", "0.6043458", "0.5971629", "0.5777631", "0.56584746", "0.56294894", "0.5513737", "0.54970396", "0.5470578", "0.5469094", "0.5390745", "0.5352579", "0.5298824", "0.5289251", "0.52624744", "0.52424437", "0.52211654", "0.52168936", "0.5173...
0.7598418
0
Returns tensor of size (batch_size, width, height, num_classes) derived from annotation batch tensor. The function returns tensor that is of a size (batch_size, width, height, num_classes) which is derived from annotation tensor with sizes (batch_size, width, height) where value at each position represents a class. The...
def get_labels_from_annotation_batch(annotation_batch_tensor, class_labels): batch_labels = tf.map_fn(fn=lambda x: get_labels_from_annotation(annotation_tensor=x, class_labels=class_labels), elems=annotation_batch_tensor, dtype=tf.float32) retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_labels_from_annotation(annotation_tensor, class_labels):\n \n # Last value in the classes list should show\n # which number was used in the annotation to mask out\n # the ambigious regions or regions that should not be\n # used for training.\n # TODO: probably replace class_labels list wi...
[ "0.7213606", "0.6673613", "0.6457377", "0.641598", "0.620168", "0.620168", "0.6075423", "0.6069407", "0.59994864", "0.59731406", "0.5965284", "0.58607733", "0.5854119", "0.5790506", "0.5779681", "0.5740733", "0.57271117", "0.57083064", "0.56715286", "0.56654716", "0.563265", ...
0.75295556
0
Returns tensor of size (num_valid_eintries, 3). Returns tensor that contains the indices of valid entries according to the annotation tensor. This can be used to later on extract only valid entries from logits tensor and labels tensor. This function is supposed to work with a batch input like [b, w, h] where b is a bat...
def get_valid_entries_indices_from_annotation_batch(annotation_batch_tensor, class_labels): # Last value in the classes list should show # which number was used in the annotation to mask out # the ambigious regions or regions that should not be # used for training. # TODO: probably replace clas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_valid_logits_and_labels(annotation_batch_tensor,\n logits_batch_tensor,\n class_labels):\n \n \n labels_batch_tensor = get_labels_from_annotation_batch(annotation_batch_tensor=annotation_batch_tensor,\n ...
[ "0.6033061", "0.56112087", "0.5432109", "0.5287994", "0.5287868", "0.5281353", "0.5275872", "0.52695805", "0.51618373", "0.5104643", "0.50546974", "0.49728608", "0.49691576", "0.4949619", "0.4907169", "0.4903509", "0.49029946", "0.48865625", "0.48804718", "0.48798785", "0.486...
0.731145
0
Returns two tensors of size (num_valid_entries, num_classes). The function converts annotation batch tensor input of the size (batch_size, height, width) into label tensor (batch_size, height, width, num_classes) and then selects only valid entries, resulting in tensor of the size (num_valid_entries, num_classes). The ...
def get_valid_logits_and_labels(annotation_batch_tensor, logits_batch_tensor, class_labels): labels_batch_tensor = get_labels_from_annotation_batch(annotation_batch_tensor=annotation_batch_tensor, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_valid_entries_indices_from_annotation_batch(annotation_batch_tensor, class_labels):\n \n # Last value in the classes list should show\n # which number was used in the annotation to mask out\n # the ambigious regions or regions that should not be\n # used for training.\n # TODO: probably r...
[ "0.66219485", "0.6234142", "0.6030442", "0.5984013", "0.5747659", "0.5676405", "0.54304546", "0.54280484", "0.53375953", "0.53290784", "0.53284216", "0.53217727", "0.5297296", "0.52844113", "0.52818656", "0.5262105", "0.52591807", "0.5256339", "0.5229123", "0.5213748", "0.521...
0.808796
0
Return a string representing the type of vehicle this is.
def vehicle_type(self): return 'car'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vehicle_type():\n pass", "def vehicle_type(self):\n pass", "def vehicle_type(self):\n return 'truck'", "def vehicle_type(self):\n return 'truck'", "def type(self) -> str:\n return pulumi.get(self, \"type\")", "def type(self) -> str:\n return pulumi.get(self, ...
[ "0.8265945", "0.8171127", "0.78402793", "0.78402793", "0.7387936", "0.7387936", "0.7387936", "0.7387936", "0.7387936", "0.7387936", "0.7387936", "0.7387936", "0.7387936", "0.7387936", "0.7387936", "0.7387936", "0.7387936", "0.7387936", "0.7387936", "0.7387936", "0.7387936", ...
0.79946303
2
Return a string representing the type of vehicle this is.
def vehicle_type(self): return 'truck'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vehicle_type():\n pass", "def vehicle_type(self):\n pass", "def vehicle_type(self):\n return 'car'", "def vehicle_type(self):\n return 'car'", "def vehicle_type(self):\n return 'car'", "def type(self) -> str:\n return pulumi.get(self, \"type\")", "def type(...
[ "0.8264676", "0.81698346", "0.7994656", "0.7994656", "0.7994656", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0...
0.78400844
5
Return a string representing the type of vehicle this is.
def vehicle_type(self): return 'motorcycle'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vehicle_type():\n pass", "def vehicle_type(self):\n pass", "def vehicle_type(self):\n return 'car'", "def vehicle_type(self):\n return 'car'", "def vehicle_type(self):\n return 'car'", "def vehicle_type(self):\n return 'truck'", "def vehicle_type(self):\n ...
[ "0.8264676", "0.81698346", "0.7994656", "0.7994656", "0.7994656", "0.78400844", "0.78400844", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", "0.738759", ...
0.7290494
50
Returns a value for the model at a time X_unshifted, using the parameter array p. Checks whether the point lies in the peak or power component, and returns the corresponding value
def fitfunc(x_unshifted, p=default()): x = x_unshifted+p[4] xtr, ytr, gradtr = logcontinuity(p) if x < xtr: return logpeak(x, p) else: return logpowerlaw(x, p)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logpeak(x, p=default()):\n model = p[0] - p[1]*(x**2)\n return model", "def powerpupgain_fn(self, X, Xp):\n deg = self.order\n v = self.theta\n Y = v[0, 0] + v[0, 1] * X + v[0, 2] * \\\n np.power(Xp, deg) + v[0, 3] * np.multiply(X, np.power(Xp, deg))\n return(Y)",...
[ "0.6856708", "0.61907727", "0.60646963", "0.60487396", "0.6047351", "0.5978552", "0.5963249", "0.5926515", "0.59213233", "0.5820375", "0.5786426", "0.5751291", "0.57172734", "0.5699045", "0.5685604", "0.56853616", "0.56722623", "0.5663416", "0.5659367", "0.5625616", "0.560175...
0.67973435
1
Get a list of region names for a specific locale as a dictionary with country codes as keys and localized names as values.
def get_regions(locale): def json_file(name): return os.path.join(json_dir, 'regions', '%s.json' % name) filepath = json_file(locale) if not os.path.exists(filepath): filepath = json_file('en-US') if not os.path.exists(filepath): raise Exception('Unable to load region ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name_places(self):\n self.city_names = {}\n self.region_names = {}\n for city in self.cities:\n self.city_names[city] = self.lang.name(\"city\")\n for region in np.unique(self.territories):\n self.region_names[region] = self.lang.name(\"region\")", "def _deri...
[ "0.6021179", "0.5946403", "0.587645", "0.5791404", "0.57229465", "0.5710509", "0.5681929", "0.56683993", "0.56375456", "0.5622367", "0.56202906", "0.5581057", "0.5569003", "0.55125546", "0.5510719", "0.5504353", "0.5488207", "0.5452637", "0.54521763", "0.54375327", "0.539509"...
0.6560536
0
Function checks if the nonexpired posts have passed their expiration_time and if so it changes is_expired attribute from the Post object to True. To be called everytime we call a view
def update_posts_expiration(): #adds all the objects that are not expired to posts posts = Post.objects.filter(is_expired=False) #get the actual time time_now = timezone.now() #loop through all the posts and calculate the expiration date and time for post in posts: expiry_time = (post.cr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_content_expiry_date(self):\n\n if self.expire_date < datetime.now():\n self.state = 'disabled'", "def is_expired(self):\n return timeutils.utcnow_ts() > self.expire_ts", "def is_expired(self) -> bool:\n return now() > self.expires", "def is_expired(self):\n re...
[ "0.65761274", "0.65722746", "0.65688354", "0.6553991", "0.65271413", "0.64984554", "0.6462546", "0.64472", "0.6408168", "0.63606673", "0.6360424", "0.6306094", "0.6262006", "0.6256698", "0.61882085", "0.6187711", "0.61687744", "0.61245596", "0.6121317", "0.61057675", "0.60761...
0.83905196
0
Returns comments in the post in id pk
def view_comments_per_post(request, pk): update_posts_expiration() #get comments on a certain post with the post id comments = Comment.objects.filter(post = pk) serializer = ViewCommentSerializer(comments, many=True) return Response(serializer.data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_comments(id_post):\n return Comms.objects.filter(post__id=id_post)", "def load_comments_by_post_id(self, id):\n comments = self.session.query(Comment).filter(Comment.post_id == id).all()\n return comments", "def comments(self, request, pk=None):\n post = self.get_object()\n ...
[ "0.79468054", "0.77271855", "0.75282514", "0.74379164", "0.7169114", "0.7133445", "0.6911003", "0.6891745", "0.6881649", "0.686164", "0.6858323", "0.68509036", "0.6771382", "0.6647817", "0.66119033", "0.6575343", "0.65739894", "0.65737706", "0.6529696", "0.6499602", "0.648117...
0.7187883
4
Slightly smart formating of an elapsed time
def ms_format(milliseconds:float) -> str: assert milliseconds >= 0 if milliseconds < 1: return f"{milliseconds:.3f}ms" if milliseconds < 1000: return f"{milliseconds:.2f}ms" return f"{(milliseconds/1000):.3f}sec"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def elapsed_time_formatted(begin_time):\n return time.strftime(\n \"%H:%M:%S\", (time.gmtime(time.perf_counter() - begin_time))\n )", "def time_elapsed(sec):\n if sec < 60:\n return str(sec) + \" sec\"\n elif sec < (60 * 60):\n return str(sec / 60) + \" min\"\n else:\n ...
[ "0.7949765", "0.7494874", "0.7415545", "0.73499596", "0.7184429", "0.7169146", "0.7151809", "0.7084822", "0.7050253", "0.7039485", "0.7011986", "0.6967519", "0.6963163", "0.69395274", "0.69292575", "0.69104415", "0.68991274", "0.68788993", "0.68788993", "0.68741405", "0.68719...
0.0
-1
Test the api has post createtion capability
def test_api_can_create_a_post(self): self.assertEqual(self.response.status_code, status.HTTP_201_CREATED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post(self):\n pass", "def test_api_can_post(self):\n\n # check person created\n self.assertEqual(self.response.status_code, status.HTTP_201_CREATED)\n\n # check studio created\n self.assertEqual(self.response.status_code, status.HTTP_201_CREATED)\n \n # check...
[ "0.77804565", "0.7739394", "0.75027215", "0.7472452", "0.74318755", "0.74258953", "0.73453784", "0.7288661", "0.72719586", "0.7242521", "0.72313637", "0.72164464", "0.7182862", "0.717276", "0.7172274", "0.7172274", "0.71668947", "0.71532124", "0.71454006", "0.7121626", "0.711...
0.8311521
0
Test the api can get a given post
def test_api_can_get_a_post(self): post = Post.objects.get() response = self.client.get( '/posts/', kwargs={'pk':post.id}, format="json") self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertContains(response, post)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_api_can_get_a_post(self):\n post = Post.objects.get()\n response = self.client.get(\n reverse('details', kwargs={'pk': post.id}), format=\"json\")\n\n self.assertEqual(response.status_code, status.HTTP_200_OK)\n self.assertContains(response, post)", "def test_get_p...
[ "0.81779945", "0.73044646", "0.71362865", "0.70763046", "0.70626396", "0.70341855", "0.6997942", "0.6976997", "0.6907121", "0.6907121", "0.688482", "0.6873602", "0.68314016", "0.68206203", "0.68044305", "0.6786376", "0.6785179", "0.678445", "0.6768038", "0.6764411", "0.674796...
0.83255655
0
Test the api can update a given post.
def test_api_can_update_post(self): post = Post.objects.get() change_post = {'name': 'Something new'} response = self.client.put( reverse('details', kwargs={'pk': post.id}), change_post, format='json' ) self.assertEqual(response.status_code, status.HTTP_20...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_update_sucess(self):\n url = reverse(\n 'post-detail',\n args=[\n self.topic1.url_name,\n self.post1.id\n ]\n )\n payload = {\n 'title': 'Updated title',\n 'content': 'Updated content'\n }...
[ "0.8261197", "0.8161846", "0.8062909", "0.7758684", "0.76861554", "0.76745534", "0.7594633", "0.75113624", "0.7365158", "0.7330305", "0.7166737", "0.71583045", "0.7131771", "0.71042866", "0.70966524", "0.6954115", "0.69086665", "0.6907556", "0.68639857", "0.6817487", "0.67779...
0.80565536
3
Test the api can delete a post.
def test_api_can_delete_post(self): post = Post.objects.get() response = self.client.delete( reverse('details', kwargs={'pk': post.id}), format='json', follow=True) self.assertEquals(response.status_code, status.HTTP_204_NO_CONTENT)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_deleting_patient_posts(self):\n\n data = {\"post\": 1}\n result = self.client.post(\"/delete-post\", data=data)\n post = Post.query.get(1)\n\n self.assertEqual(result.status_code, 200)\n self.assertIsNone(post)", "def test_post_deletion_unauthenticated(self):\n ...
[ "0.842854", "0.82658345", "0.8157572", "0.81377745", "0.8126435", "0.8124078", "0.81226575", "0.81180465", "0.79951364", "0.7985976", "0.7892938", "0.7891186", "0.78258246", "0.76914406", "0.75515044", "0.7485088", "0.7353253", "0.7309626", "0.7290812", "0.72764397", "0.71637...
0.8618328
0
Initialize the class by configuring and connecting to the email client.
def __init__(self): self.config = configparser.ConfigParser() # Initialize the configuration if it has not been set self.config.read(absolute_config_path) if len(self.config["DEFAULT"]) == 0: print( "An email configuration has not been set. \ In order to deli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, config):\n # This generates the From address by stripping the part until the first\n # period from the mail server address and won't work always.\n self.fromaddr = config[\"mail\"][\"user\"] + \"@\" + \\\n config[\"mail\"][\"mailserver\"].partition(\"....
[ "0.7476086", "0.70168424", "0.69670826", "0.68368536", "0.6815158", "0.67970586", "0.67785645", "0.67718697", "0.67170936", "0.67114305", "0.6638677", "0.6638042", "0.65593296", "0.65573025", "0.65200716", "0.64647424", "0.646091", "0.6455088", "0.6448245", "0.64482075", "0.6...
0.7019845
1
Return a readable representation of the KindleDelivery class.
def __str__(self): return "Kindle"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return bytes_to_string(self._bytes)", "def delivery(self) -> dict:\n delivery = self._delivery\n return delivery", "def __str__(self):\n return str(self.serialize())", "def delivery(self):\n return self._delivery", "def __str__(self):\n return ...
[ "0.6172424", "0.61565113", "0.61457604", "0.60404813", "0.6038671", "0.59927285", "0.59782535", "0.59593135", "0.5941016", "0.59184897", "0.59184897", "0.59184897", "0.59184897", "0.59184897", "0.59184897", "0.59184897", "0.59184897", "0.59184897", "0.59184897", "0.59184897", ...
0.0
-1
Sets the learning rate
def adjust_learning_rate(optimizer, lr): for param_group in optimizer.param_groups: param_group['lr'] = lr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_learning_rate(self, rate):\n self.SGD.set_learning_rate(rate)", "def adjust_lr(self):\n learning_rate = self.params.base_lr * (1 - float(self.epoch) / self.params.num_epoch) ** self.params.power\n for param_group in self.opt.param_groups:\n param_group['lr'] = learning_rat...
[ "0.8623272", "0.76981455", "0.7697208", "0.7697208", "0.7636927", "0.758479", "0.7572249", "0.7514606", "0.7490861", "0.74744666", "0.74288964", "0.7413075", "0.739503", "0.73916996", "0.73894364", "0.73817927", "0.73783433", "0.7377333", "0.7363047", "0.7362884", "0.7362884"...
0.7023273
83
Generates HTTP headers with authorization for API requests.
def generate_client_headers(self): return {"clientId": self._client_id, "clientSecret": self._secret_token, }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_auth_headers(self):\n auth_headers = {**self.get_headers()}\n auth_headers['Authorization'] = 'Bearer ' + self.get_access_token()\n return auth_headers", "def generate_oauth_headers(access_token: str) -> dict:\n return {'Authorization': 'Bearer ' + access_token}", "async def...
[ "0.79296696", "0.76183313", "0.7562216", "0.75614387", "0.75614387", "0.74878716", "0.7394194", "0.73530746", "0.73394763", "0.73233664", "0.72823125", "0.7265754", "0.7230261", "0.7214097", "0.71952915", "0.71839136", "0.7163294", "0.7147513", "0.7142889", "0.71403986", "0.7...
0.0
-1
Generates HTTP headers with authorization for API requests based on user and psswd credentials.
def generate_user_headers(self): return {**self.generate_client_headers(), **{"username": self._user, "password": self._password, }}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_auth_headers(self):\n auth_headers = {**self.get_headers()}\n auth_headers['Authorization'] = 'Bearer ' + self.get_access_token()\n return auth_headers", "def _get_headers() -> dict:\n api_key = API_KEY_CRED_LOADER.load_credentials()\n api_secret = API_SECRET_CRED_LOADER.lo...
[ "0.7284302", "0.72389174", "0.7140026", "0.7112147", "0.69181734", "0.69153297", "0.69153297", "0.69138676", "0.6888497", "0.68588513", "0.6831972", "0.67976636", "0.67976636", "0.6741136", "0.6738745", "0.6738745", "0.6736263", "0.6686683", "0.66816366", "0.66312087", "0.661...
0.6656536
19
Generates HTTP headers with authorization for API requests.
def generate_headers_with_auth(self, token_type: str = 'access'): if re.search('access', token_type, re.I): bearer_token = self._access_token elif re.search('refresh', token_type, re.I): bearer_token = self._refresh_token else: raise (Exception('Please check d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_auth_headers(self):\n auth_headers = {**self.get_headers()}\n auth_headers['Authorization'] = 'Bearer ' + self.get_access_token()\n return auth_headers", "def generate_oauth_headers(access_token: str) -> dict:\n return {'Authorization': 'Bearer ' + access_token}", "async def...
[ "0.79296696", "0.76183313", "0.7562216", "0.75614387", "0.75614387", "0.74878716", "0.7394194", "0.73530746", "0.73394763", "0.73233664", "0.72823125", "0.7265754", "0.7230261", "0.7214097", "0.71839136", "0.7163294", "0.7147513", "0.7142889", "0.71403986", "0.70872337", "0.7...
0.71952915
14