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
Returns a queryset. This will be filtered if the user passes either a search letter/term.
def get_queryset(self): search_val = False qs = super().get_queryset() if 'search' in self.request.GET: search_val = self.request.GET.get('search', False) if search_val == "0-9": # find all rows that start with non-alpha character qs = Tag....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self):\n queryset = self.model._default_manager.all()\n query = self.request.QUERY_PARAMS.get('q', None)\n query_eq = self.request.QUERY_PARAMS.get('eq', None)\n if query is not None:\n if query_eq:\n queryset = queryset.filter(username=query)\...
[ "0.7929124", "0.79081964", "0.7606818", "0.74383324", "0.7409619", "0.7393785", "0.73567355", "0.73283905", "0.7314933", "0.71809655", "0.7164751", "0.7151495", "0.71195304", "0.70399356", "0.70378953", "0.7036717", "0.6987812", "0.69867533", "0.69798654", "0.6976785", "0.696...
0.77179694
2
Returns the name of the user who made the comment.
def getUsernameForCommentID(self, in_commentID): comment = UserComment.objects.get(commentID=in_commentID) username = comment.user.username return username
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getUsernameOfPostAuthor(self, in_commentID):\n comment = UserComment.objects.get(commentID=in_commentID)\n post = comment.postID\n username = post.user.username\n return username", "def get_user_name(self):\n return self.__user_name", "def get_user_name(self):\n \n...
[ "0.7309639", "0.72282225", "0.7212912", "0.7207129", "0.71686834", "0.7165257", "0.70380306", "0.70380306", "0.7010226", "0.7008383", "0.7008383", "0.6976298", "0.6976298", "0.6976298", "0.6965276", "0.6924207", "0.69196975", "0.69196975", "0.6727939", "0.6723556", "0.6723556...
0.72961694
1
Returns the name of the user who made the post being commented upon.
def getUsernameOfPostAuthor(self, in_commentID): comment = UserComment.objects.get(commentID=in_commentID) post = comment.postID username = post.user.username return username
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getUsernameForCommentID(self, in_commentID):\n comment = UserComment.objects.get(commentID=in_commentID)\n username = comment.user.username\n return username", "def last_posted_user_name(ticket):\n\n last_post = ticket.posts.all().order_by('created_at').last()\n return last_post.us...
[ "0.7248331", "0.72034806", "0.7170519", "0.7016525", "0.6954443", "0.6882176", "0.6872034", "0.68387276", "0.6838325", "0.6808131", "0.66901225", "0.6628063", "0.6628063", "0.6628063", "0.6600561", "0.6600561", "0.6585362", "0.6573589", "0.655761", "0.655761", "0.6557213", ...
0.79912055
0
Returns the name of the user who made the post.
def getUsernameForPostID(self, in_postID): post = UserPost.objects.get(postID=in_postID) username = post.user.username return username
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name(self):\n return self.user.username if self.user.username else self.user.email", "def get_user_name(self):\r\n return self.name", "def get_user_name(self):\n \n return self.__name", "def get_user_name(self):\n return self.__user_name", "def get_user_name(self)...
[ "0.76667595", "0.7611662", "0.76099217", "0.7573614", "0.75268936", "0.75088084", "0.7460755", "0.7448474", "0.7345277", "0.7345277", "0.7345277", "0.7327648", "0.7327648", "0.73177123", "0.7304473", "0.7304473", "0.73034465", "0.73034465", "0.7175538", "0.7175538", "0.715844...
0.72649485
18
Testing that actual powers of 2 give True
def test_positive_case(): assert check_power_of_2(65536)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _power_of_two(value):\n return (value & (value - 1)) == 0", "def isPower2(num):\n\treturn ((num & (num - 1)) == 0) and num > 0", "def is_power_of_2(value):\n if value == 1:\n return False\n else:\n return bool(value and not value & (value - 1))", "def isPower2(num):\n return...
[ "0.8047305", "0.7950639", "0.79440045", "0.79344684", "0.79252404", "0.7896687", "0.77689236", "0.77370113", "0.7731144", "0.7686795", "0.76858675", "0.75746775", "0.7529742", "0.7481281", "0.7329123", "0.73136324", "0.72238535", "0.689045", "0.65802604", "0.6554705", "0.6493...
0.7958943
1
Testing that null is not power of 2
def test_null_case(): assert not check_power_of_2(0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isPowerOf2(n):\n return ((n & (n - 1)) == 0) and n != 0", "def test_positive_case():\n assert check_power_of_2(65536)", "def _power_of_two(value):\n return (value & (value - 1)) == 0", "def isPowerOfTwo(i):\n return (i != 0) and ((i & (i - 1)) == 0)", "def is_power_of_2(N): \n return ...
[ "0.71528816", "0.7121933", "0.7047556", "0.6944011", "0.6939012", "0.693411", "0.69279903", "0.6888891", "0.6867192", "0.68410635", "0.67387605", "0.66434515", "0.6565956", "0.6389617", "0.6385864", "0.63266987", "0.6312315", "0.6300545", "0.6263478", "0.61996114", "0.6137808...
0.8223132
0
Initialize which pretrained BERT model to use. BertForSequenceClassification is a model from Huggingface's transformer library that contains the pretrained BERT model with a single linear classification layer.
def get_model(self): if self.bert_model_name == "bert-base": model_path = "bert-base-uncased" elif self.bert_model_name == "finbert-domain": get_model("finbert-domain") model_path = str(Path.cwd()/'model/finbert-domain') elif self.bert_model_name == "finbert-t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n super(BertModel, self).__init__()\n\n self.model = RobertaForSequenceClassification.from_pretrained('roberta-base', num_labels=3)", "def load_model(self, pre_trained_name, num_labels):\n model = BertForSequenceClassification.from_pretrained(\n pre_trained_nam...
[ "0.7463787", "0.6651097", "0.66231143", "0.6288911", "0.62827265", "0.6239012", "0.61868596", "0.6055315", "0.60374826", "0.596494", "0.59178144", "0.5893", "0.5809988", "0.57837826", "0.5771573", "0.5685253", "0.5663666", "0.56320536", "0.5579183", "0.5557488", "0.55456823",...
0.67011374
1
Creates train and validation DataLoaders with input_ids, token_type_ids, att_masks, and labels
def get_dataloader(self, dataset, type): # Create input data input_id, token_type_id, \ att_mask, label = self.get_input_data(dataset) # Convert all inputs to torch tensors input_ids = torch.tensor(input_id) token_type_ids = torch.tensor(token_type_id) att_masks ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getloader():\r\n train_transforms = transforms.Compose([transforms.Resize((500, 500)),\r\n transforms.RandomHorizontalFlip(),\r\n transforms.ToTensor(),\r\n ])\r\n val_transforms =...
[ "0.7138147", "0.71093935", "0.69891506", "0.68825364", "0.68514746", "0.68067044", "0.68058276", "0.6742791", "0.6721126", "0.66412264", "0.6631485", "0.6627457", "0.65757835", "0.65746605", "0.65592605", "0.6559065", "0.6533655", "0.6493394", "0.6484982", "0.64564717", "0.64...
0.0
-1
Validates the model and returns the average loss and accuracy.
def validate(self, model, validation_dataloader): # Set model to evaluation mode model.eval() # Cumulated Training loss and accuracy total_loss = 0 eval_accuracy = 0 # Track the number of steps num_steps = 0 # For each batch of the validation data ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate(self):\n\n self.out(\"\\n\")\n\n # init test mode\n self._model.eval()\n cum_acc, cum_loss, cum_elapsed = [], [], []\n\n with torch.no_grad():\n for batch_num, batch in enumerate(self._test_loader):\n acc, loss, elapsed = self._batch_iterati...
[ "0.7178474", "0.69398564", "0.69366556", "0.69200736", "0.6907233", "0.6883903", "0.68628067", "0.6862434", "0.6788941", "0.67734843", "0.67701405", "0.67242837", "0.66841793", "0.6682927", "0.6679572", "0.6664279", "0.6637569", "0.663163", "0.65927565", "0.65874237", "0.6584...
0.67819256
9
Creates train and validation DataLoaders with input_ids, token_type_ids, att_masks, and labels
def get_dataloader(self, dataset, type): # Create input parameters pos_input_id, pos_type_id, pos_att_mask, pos_label, \ neg_input_id, neg_type_id, neg_att_mask, \ neg_label = self.get_input_data(dataset) # Convert all inputs and into torch tensors pos_input_ids = torch....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getloader():\r\n train_transforms = transforms.Compose([transforms.Resize((500, 500)),\r\n transforms.RandomHorizontalFlip(),\r\n transforms.ToTensor(),\r\n ])\r\n val_transforms =...
[ "0.713771", "0.7107952", "0.6988127", "0.6881447", "0.68501556", "0.68060404", "0.68058944", "0.6740981", "0.67193353", "0.6639553", "0.66304624", "0.66260695", "0.65736574", "0.65727717", "0.6558551", "0.65581495", "0.6533557", "0.64931035", "0.64843136", "0.6454997", "0.643...
0.0
-1
Validates the model and returns the average loss and accuracy.
def validate(self, model, validation_dataloader): # Set model in evaluation mode model.eval() # Tracking variables total_loss = 0 num_steps = 0 eval_accuracy = 0 # Evaluate data for one epoch for batch in tqdm(validation_dataloader): # Add bat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate(self):\n\n self.out(\"\\n\")\n\n # init test mode\n self._model.eval()\n cum_acc, cum_loss, cum_elapsed = [], [], []\n\n with torch.no_grad():\n for batch_num, batch in enumerate(self._test_loader):\n acc, loss, elapsed = self._batch_iterati...
[ "0.7178949", "0.693979", "0.69368404", "0.6920179", "0.69074255", "0.68843246", "0.6862976", "0.68620795", "0.67891073", "0.6782682", "0.6772952", "0.6768988", "0.6724749", "0.6683917", "0.66815746", "0.6679147", "0.6664421", "0.66374505", "0.6630616", "0.6592076", "0.6588089...
0.6333594
46
Cross entropy (with softmax).
def ce(labels, logits): return tf.reduce_mean( tf.nn.softmax_cross_entropy_with_logits_v2( labels=labels, logits=logits))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax_cross_entropy(x, t, use_cudnn=True, normalize=True):\n return SoftmaxCrossEntropy(use_cudnn)(x, t)", "def cross_entropy_with_logits_loss(input, soft_target):\n return torch.sum(- soft_target * torch.nn.functional.log_softmax(input, 1), 1)", "def softmax_entropy(t,y):\n return np.sum(np.mul...
[ "0.79453266", "0.7580908", "0.7447735", "0.7403813", "0.740105", "0.738195", "0.73522234", "0.73311955", "0.7147784", "0.71126795", "0.70657307", "0.70604134", "0.70575136", "0.7028522", "0.70042014", "0.70014966", "0.69782346", "0.6960123", "0.6922477", "0.6894344", "0.68913...
0.6884593
21
Compute a mask to keep only local maximum, in 2d and 3d. . We apply a multidimensional maximum filter. . A pixel which has the same value in the original and filtered images is a local maximum. Several connected pixels can have the same value. In such a case, the local maximum is not unique. In order to make the detect...
def local_maximum_detection(image, min_distance): # check parameters stack.check_array( image, ndim=[2, 3], dtype=[np.uint8, np.uint16, np.float32, np.float64]) stack.check_parameter(min_distance=(int, float, tuple, list)) # compute the kernel size (centered around our pixel bec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_3d(self):\n img = np.zeros((8, 8, 8), dtype=np.uint8)\n local_maxima = np.zeros((8, 8, 8), dtype=np.uint64)\n\n # first maximum: only one pixel\n img[1, 1:3, 1:3] = 100\n img[2, 2, 2] = 200\n img[3, 1:3, 1:3] = 100\n local_maxima[2, 2, 2] = 1\n\n # s...
[ "0.7144674", "0.7120949", "0.6814544", "0.6803865", "0.67911816", "0.6757598", "0.66601056", "0.66072536", "0.658936", "0.6538594", "0.65357137", "0.6434997", "0.64266896", "0.62613076", "0.62576616", "0.623865", "0.6236678", "0.6221611", "0.6213641", "0.6199602", "0.6185132"...
0.6601751
8
Attach a text label above each bar in rects, displaying its height.
def autolabel(rects): for rect in rects: height = rect.get_height() ax.annotate('{}'.format(round(height,2)), xy=(rect.get_x() + rect.get_width() / 2, height), xytext=(0, 3), # 3 points vertical offset textcoo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def label_bar(rects, ax):\n for rect in rects:\n height = rect.get_height()\n ax.text(\n rect.get_x() + rect.get_width() / 2.0,\n height + 0.5,\n \"%.1f\" % height,\n fontsize=6,\n ha=\"center\",\n va=\"bottom\",\n )", "def...
[ "0.8158133", "0.787091", "0.78405195", "0.78232163", "0.781932", "0.77936053", "0.7782255", "0.76988506", "0.7693066", "0.76687187", "0.7665557", "0.76619285", "0.76451", "0.76451", "0.76393753", "0.76155615", "0.7583222", "0.75509757", "0.7543855", "0.7517322", "0.749351", ...
0.7332529
58
Attach a text label above each bar in rects, displaying its height.
def autolabel(rects): for rect in rects: height = rect.get_height() ax.annotate('{}'.format(round(height, 2)), xy=(rect.get_x() + rect.get_width() / 2, height), xytext=(0, 5), # 3 points vertical offset textco...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def label_bar(rects, ax):\n for rect in rects:\n height = rect.get_height()\n ax.text(\n rect.get_x() + rect.get_width() / 2.0,\n height + 0.5,\n \"%.1f\" % height,\n fontsize=6,\n ha=\"center\",\n va=\"bottom\",\n )", "def...
[ "0.8155161", "0.7871952", "0.78378445", "0.78210276", "0.7816673", "0.7790905", "0.77797055", "0.76959795", "0.76901263", "0.7665792", "0.7662798", "0.765923", "0.76422954", "0.76422954", "0.7636461", "0.7612755", "0.7580371", "0.7548318", "0.75409913", "0.75137097", "0.74905...
0.7362821
44
Compute IoU between detect box and gt boxes
def iou(pred_box, gt_box, h, w): # Transpose the coordinates from y_min, x_min, y_max, x_max # In absolute coordinates to x_min, y_min, x_max, y_max # in pixel coordinates def _swap(box): return tf.stack([box[1] * w, box[0] * h, box[3] * w, box[2] * h]) pred_box = _swap(pred_box) gt_bo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def IoU(box, boxes):\n box_area = (box[2] - box[0]) * (box[3] - box[1])\n area = (boxes[:, 2] - boxes[:, 0]) * (boxes[:, 3] - boxes[:, 1])\n xx1 = np.maximum(box[0], boxes[:, 0])\n yy1 = np.maximum(box[1], boxes[:, 1])\n xx2 = np.minimum(box[2], boxes[:, 2])\n yy2 = np.minimum(box[3], boxes[:, 3]...
[ "0.79435503", "0.7786221", "0.77633446", "0.7727373", "0.76980746", "0.76643336", "0.76481813", "0.7566376", "0.74751157", "0.72954595", "0.72954595", "0.7255609", "0.72351044", "0.72351044", "0.7230486", "0.7216808", "0.7180399", "0.7175275", "0.7170528", "0.71404004", "0.71...
0.6524765
63
Convert a numeric label vector to a onehot matrix
def one_hot_encode(Y, classes): onehot = np.zeros((classes, Y.shape[0])) for ex, label in enumerate(Y): onehot[label][ex] = 1 return onehot
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_one_hot(labels):\n numbers = np.max(labels) + 1\n return np.eye(numbers)[labels]", "def _convert_label_to_one_hot(label, num_classes):\n one_hot = np.zeros(num_classes, dtype=np.float32)\n one_hot[label] = 1\n return one_hot", "def one_hot_label(classes, label):\n m = label.s...
[ "0.83643854", "0.83030105", "0.8246984", "0.82128376", "0.8170112", "0.8137122", "0.8112707", "0.8034222", "0.8033576", "0.7993711", "0.79879886", "0.79751724", "0.79593587", "0.7948464", "0.79430014", "0.79034793", "0.7888191", "0.7880206", "0.7839143", "0.7823175", "0.78228...
0.0
-1
ignores an empty line
def emptyline(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def emptyline(self):\r\n pass", "def handle_empty_line(self, line):\n if self.comment_lines and self.allow_blank_lines:\n self.trailing_empty_lines.append(line)\n else:\n self.output_normal_line(line)", "def emptyline(self):\n return False", "def emptyline(se...
[ "0.83839935", "0.8051715", "0.79919696", "0.76471204", "0.7608467", "0.74594533", "0.74499017", "0.74499017", "0.70997816", "0.70730335", "0.7046972", "0.7043504", "0.7033896", "0.7003889", "0.69809955", "0.69765645", "0.69654226", "0.6932323", "0.6798761", "0.67785513", "0.6...
0.8383423
6
Set up the initial values. The incoming digits are genuine (onebased), not zerobased.
def set_initial_values(self, initial_values: List[List[Optional[int]]]) -> None: assert len(initial_values) == self.n for r in range(self.n): row = initial_values[r] assert len(row) == self.n for c in range(self.n): value = r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_initial_amounts(self):\n logging.info('enter')\n for var in self._variables_ordered_for_init.values():\n var.set_all_initial_amounts()\n logging.info('exit')", "def __init__(self):\n\n self.numerals = tuple(zip(\n ('M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'X...
[ "0.6317175", "0.63159394", "0.6065484", "0.60341275", "0.60341275", "0.60341275", "0.5980617", "0.5954072", "0.59460604", "0.59258497", "0.5919793", "0.58985054", "0.5883001", "0.58535767", "0.5850246", "0.5826588", "0.5789701", "0.578534", "0.5785206", "0.5753602", "0.574878...
0.6547779
0
Copies another's attributes to self. Used by guessing.
def _assign_from_other(self, other: "CommonPossibilities") -> None: # no need to copy initial_values_zb self.possible = deepcopy(other.possible) self.working = deepcopy(other.working)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_attributes(self, other):\n self.__dict__.update(other.__dict__)", "def copy( self, other ):\n self.contig = other.contig\n self.source = other.source\n self.feature = other.feature\n self.start = other.start\n self.end = other.end\n self.score = other.sco...
[ "0.84343386", "0.73736984", "0.7354733", "0.7146104", "0.7096828", "0.6876608", "0.6817029", "0.6758541", "0.6751893", "0.672014", "0.66837406", "0.6643069", "0.66201067", "0.6616426", "0.6564702", "0.6552548", "0.6552274", "0.6519224", "0.6437168", "0.6421399", "0.6384111", ...
0.6615087
14
Create a new room
def __init__(self, name, description, entrances, item=None, npc=None): self.name = name self.description = description self.entrances = entrances self.npc = npc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_new_room():\n group_get = _group_get(request.values)\n creator = group_get('creator', 'username', 'user_name')\n room_name = group_get('room_name', 'roomname', 'name')\n if all((creator, room_name)):\n description = group_get('description', 'room_description', 'roomdescription')\n ...
[ "0.7960122", "0.77285224", "0.7711403", "0.765843", "0.7524301", "0.7510555", "0.7433865", "0.7374837", "0.71266013", "0.7054582", "0.6905654", "0.6845872", "0.68430334", "0.68123704", "0.67994106", "0.6659109", "0.6631466", "0.66296005", "0.66275567", "0.6609306", "0.6603296...
0.0
-1
Check if a list of observations is returned properly.
def test_read_observations(self, repository: Repository): obslist = repository.read_observations() # Make sure there are at least 3 observations (more may be added in the future. # This test should be future-proof.) self.assertGreaterEqual(len(obslist), 3) # Check if the data r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_null_checks(mylist):\r\n if \"\" in mylist:\r\n print(\"Encountered some null data points. Skipping...\")\r\n return(True)\r\n return(False)", "def data_notnull_checks(mylist):\r\n if \"\" not in mylist:\r\n print(\"Encountered some unwanted data. Skipping...\")\r\n ...
[ "0.6416135", "0.62154716", "0.5830029", "0.5786705", "0.57617986", "0.5731648", "0.568314", "0.56618655", "0.55886286", "0.5587335", "0.555491", "0.5524285", "0.5514095", "0.5494702", "0.5484452", "0.54633796", "0.5459498", "0.5445178", "0.54272455", "0.54111165", "0.5410568"...
0.6454262
0
Encode the string with the caesar cipher shift and return the encoded string
def encode(self, inp): if not inp: return encoded = [] for i in range(len(inp)): if inp[i].isupper(): encoded.append(self.encoder[ord(inp[i]) - ord('A')]) else: encoded.append(inp[i]) return ''.join(encoded)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encrypt_caesar(plaintext: str, shift: int = 3) -> str:\n ciphertext = \"\"\n for sign in plaintext:\n key = ord(sign)\n if sign.isupper():\n start = ord(\"A\")\n elif sign.isslower():\n start = ord('a')\n else:\n ciphertext+=chr(key)\n ...
[ "0.8083526", "0.8004553", "0.79902524", "0.79316896", "0.73201984", "0.72754514", "0.72331595", "0.7175586", "0.7149487", "0.7140478", "0.7094397", "0.70743364", "0.70698935", "0.7025791", "0.70239645", "0.70179486", "0.69551104", "0.69344395", "0.69162685", "0.69126207", "0....
0.6065584
72
Get a specific model.
def retrieve(self, request, pk=None): model = registry.models.get(pk) if model is None: raise Http404 serializer = ModelSerializer(model) return Response(serializer.data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_model(self, model_name=None):\n if model_name is None:\n for model in self._models.values():\n return model\n return self._models[model_name]", "def model_get(self, model):\r\n owner_slug, model_slug = self.split_model_string(model)\r\n\r\n model_get_...
[ "0.8194665", "0.80777586", "0.7954706", "0.7787503", "0.7762685", "0.77328825", "0.7728312", "0.7728312", "0.7709096", "0.7699154", "0.7673589", "0.76078194", "0.7534817", "0.752732", "0.7491009", "0.74550563", "0.74345285", "0.74063784", "0.73677343", "0.7357258", "0.7333876...
0.6523982
82
Update the user profile.
def update_user_profile(sender, instance, created, **kwargs): if created: Profile.objects.create(user=instance) instance.profile.save()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def profile_update():\n db = flask.current_app.container.get('db')\n gh_api = flask.current_app.container.get(\n 'gh_api', token=flask.session['github_token']\n )\n\n user_data = gh_api.get('/user').data\n gh_user = flask_login.current_user.github_user\n gh_user.update_from_dict(user_data)...
[ "0.7980145", "0.7790653", "0.77889", "0.7686031", "0.7658756", "0.7471084", "0.7446476", "0.74233264", "0.7390258", "0.73832846", "0.72622657", "0.7198574", "0.71698475", "0.7132889", "0.71178955", "0.71112555", "0.70979327", "0.70945317", "0.7061511", "0.7044303", "0.7036170...
0.75137633
5
Unsigned, big endian 64bit integer
def Int64ub(): return FormatField(">", "Q")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uint64_t(n):\n return int(n).to_bytes(8, byteorder='little', signed=False)", "def read_uint64(self):\n return unpack(\"<Q\", self._file.read(8))[0]", "def u64(s):\r\n return struct.unpack('<Q', s)[0]", "def u64(addr: int) -> int:\n return readtype(pwndbg.gdblib.typeinfo.uint64, addr)", ...
[ "0.789997", "0.74585706", "0.741471", "0.72949", "0.72122216", "0.716768", "0.69478166", "0.68639666", "0.68583685", "0.67333806", "0.67114437", "0.6663971", "0.65902895", "0.6550564", "0.6538115", "0.6534856", "0.65140736", "0.6492559", "0.6482861", "0.6481052", "0.647196", ...
0.6223187
34
Signed, big endian 32bit integer
def Int32sb(): return FormatField(">", "l")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def int32_t(n):\n return int(n).to_bytes(4, byteorder='little', signed=True)", "def uint32_pack(n):\n return struct.pack('<L', n)", "def u32(s):\r\n return struct.unpack('<I', s)[0]", "def _to_signed32(n):\n n = n & 0xffffffff\n return (n ^ 0x80000000) - 0x80000000", "def uint32_t(n)...
[ "0.77547413", "0.7264958", "0.7211796", "0.7135338", "0.71310705", "0.6950216", "0.6875078", "0.6844767", "0.6776834", "0.67479634", "0.6729679", "0.6719974", "0.66879386", "0.6673147", "0.6651937", "0.6610258", "0.6576049", "0.65641344", "0.6563357", "0.6515008", "0.64693785...
0.6053567
58
Unsigned, little endian 64bit integer
def Int64ul(): return FormatField("<", "Q")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uint64_t(n):\n return int(n).to_bytes(8, byteorder='little', signed=False)", "def read_uint64(self):\n return unpack(\"<Q\", self._file.read(8))[0]", "def u64(s):\r\n return struct.unpack('<Q', s)[0]", "def u64(addr: int) -> int:\n return readtype(pwndbg.gdblib.typeinfo.uint64, addr)", ...
[ "0.78351516", "0.7425189", "0.73193187", "0.7241887", "0.72157085", "0.7029234", "0.6941004", "0.6856988", "0.6855048", "0.6699332", "0.66766334", "0.6675048", "0.66611135", "0.66066027", "0.65583485", "0.6554037", "0.65481764", "0.654498", "0.65426487", "0.6541383", "0.65226...
0.58076864
71
Signed, little endian 32bit integer
def Int32sl(): return FormatField("<", "l")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def int32_t(n):\n return int(n).to_bytes(4, byteorder='little', signed=True)", "def uint32_pack(n):\n return struct.pack('<L', n)", "def _to_signed32(n):\n n = n & 0xffffffff\n return (n ^ 0x80000000) - 0x80000000", "def u32(s):\r\n return struct.unpack('<I', s)[0]", "def uint32_t(n)...
[ "0.77758706", "0.730988", "0.73083514", "0.7278496", "0.7130014", "0.70382166", "0.700783", "0.69611", "0.6957666", "0.68677115", "0.67785674", "0.66820186", "0.6672967", "0.66696656", "0.66533166", "0.6624287", "0.66119254", "0.6611603", "0.66068006", "0.6545387", "0.6531993...
0.6246114
35
Signed, little endian 64bit integer
def Int64sl(): return FormatField("<", "q")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def int64_t(n):\n return int(n).to_bytes(8, byteorder='little', signed=True)", "def uint64_t(n):\n return int(n).to_bytes(8, byteorder='little', signed=False)", "def p64(i):\r\n l=struct.pack('<Q', i)\r\n if sys.version_info[0]==3:\r\n return Latin1_decode(l)\r\n return l", "def u64(s):...
[ "0.7518554", "0.7123301", "0.6984423", "0.69186467", "0.68069935", "0.68023044", "0.67774963", "0.6755121", "0.67189413", "0.6645528", "0.66173625", "0.6617154", "0.66161907", "0.66091806", "0.6598646", "0.6575159", "0.64704776", "0.6470128", "0.6412698", "0.6405404", "0.6362...
0.5861196
54
Signed, native endianity 32bit integer
def Int32sn(): return FormatField("=", "l")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def int32_t(n):\n return int(n).to_bytes(4, byteorder='little', signed=True)", "def _to_signed32(n):\n n = n & 0xffffffff\n return (n ^ 0x80000000) - 0x80000000", "def u32(s):\r\n return struct.unpack('<I', s)[0]", "def p32(i):\r\n l=struct.pack('<I', i)\r\n if sys.version_info[0]==...
[ "0.776532", "0.72914016", "0.72819954", "0.71205044", "0.7110375", "0.7083663", "0.690053", "0.6899972", "0.6862216", "0.67340344", "0.66988796", "0.66706437", "0.6637712", "0.66336906", "0.6596571", "0.65701777", "0.6534134", "0.6482929", "0.6477213", "0.64732414", "0.645367...
0.5537143
99
Big endian, 32bit IEEE floating point number
def Float32b(): return FormatField(">", "f")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ggml_fp16_to_fp32(x: np.float16) -> float:\n ...", "def ibm2ieee(big_endian_bytes):\n a, b, c, d = four_bytes(big_endian_bytes)\n\n if a == b == c == d == 0:\n return 0.0\n\n sign = -1 if (a & 0x80) else 1\n exponent_16_biased = a & 0x7f\n mantissa = ((b << 16) | (c << 8) | d) / _F24...
[ "0.68618435", "0.6852885", "0.6768532", "0.656122", "0.65506613", "0.6514415", "0.6460491", "0.6426003", "0.6391799", "0.63822216", "0.6367326", "0.6363366", "0.63607186", "0.6347329", "0.6334244", "0.6316749", "0.6291629", "0.6280148", "0.6277295", "0.6258733", "0.62431866",...
0.6797074
2
Little endian, 32bit IEEE floating point number
def Float32l(): return FormatField("<", "f")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ggml_fp16_to_fp32(x: np.float16) -> float:\n ...", "def read_float32(self):\n return float(unpack('<f', self._file.read(4))[0])", "def Float32b():\n return FormatField(\">\", \"f\")", "def ts_float32(val):\n return np.float64(val)", "def u32_to_float32(data: int) -> float:\n d = stru...
[ "0.700417", "0.6912754", "0.6793007", "0.66914254", "0.6656284", "0.66462606", "0.66385245", "0.655882", "0.65463406", "0.6545143", "0.6538117", "0.6442609", "0.6356784", "0.6348349", "0.63058573", "0.6259426", "0.62433946", "0.62403697", "0.6216885", "0.62007135", "0.6164726...
0.7143367
0
Native endianity, 32bit IEEE floating point number
def Float32n(): return FormatField("=", "f")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ggml_fp16_to_fp32(x: np.float16) -> float:\n ...", "def ggml_fp32_to_fp16(x: float) -> np.float16:\n ...", "def read_float32(self):\n return float(unpack('<f', self._file.read(4))[0])", "def ibm2ieee(big_endian_bytes):\n a, b, c, d = four_bytes(big_endian_bytes)\n\n if a == b == c == d...
[ "0.68712205", "0.6575477", "0.6348668", "0.632547", "0.63219595", "0.63065416", "0.6242976", "0.6223065", "0.62217784", "0.6181903", "0.6134316", "0.6087382", "0.60785574", "0.60456556", "0.5944504", "0.5928587", "0.59133005", "0.58765036", "0.58705074", "0.58412445", "0.5819...
0.5925509
16
Big endian, 64bit IEEE floating point number
def Float64b(): return FormatField(">", "d")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ibm2ieee(big_endian_bytes):\n a, b, c, d = four_bytes(big_endian_bytes)\n\n if a == b == c == d == 0:\n return 0.0\n\n sign = -1 if (a & 0x80) else 1\n exponent_16_biased = a & 0x7f\n mantissa = ((b << 16) | (c << 8) | d) / _F24\n\n value = sign * mantissa * pow(16, exponent_16_biased ...
[ "0.69147944", "0.6798843", "0.66856855", "0.66350955", "0.657836", "0.63627297", "0.6351663", "0.63295555", "0.63170874", "0.6277461", "0.6260673", "0.6198141", "0.61526215", "0.6149554", "0.61389405", "0.6072203", "0.6040043", "0.60193527", "0.59830374", "0.59659004", "0.596...
0.67932564
2
Little endian, 64bit IEEE floating point number
def Float64l(): return FormatField("<", "d")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def u64_to_float64(data: int) -> float:\n d = struct.pack(\">Q\", data & 0xffff_ffff_ffff_ffff)\n return struct.unpack(\">d\", d)[0]", "def float64_to_u64(data: float) -> int:\n d = struct.pack(\">d\", data)\n return struct.unpack(\">Q\", d)[0]", "def read_float64(self):\n return float(unpac...
[ "0.67765313", "0.6736861", "0.66394573", "0.65654606", "0.6557661", "0.64788693", "0.6312057", "0.6310358", "0.6216586", "0.6190166", "0.61573476", "0.6117145", "0.608256", "0.60749555", "0.6070347", "0.60698086", "0.60664093", "0.6062103", "0.60538185", "0.6039914", "0.60387...
0.64722997
6
Native endianity, 64bit IEEE floating point number
def Float64n(): return FormatField("=", "d")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ibm2ieee(big_endian_bytes):\n a, b, c, d = four_bytes(big_endian_bytes)\n\n if a == b == c == d == 0:\n return 0.0\n\n sign = -1 if (a & 0x80) else 1\n exponent_16_biased = a & 0x7f\n mantissa = ((b << 16) | (c << 8) | d) / _F24\n\n value = sign * mantissa * pow(16, exponent_16_biased ...
[ "0.6530421", "0.62939525", "0.61481225", "0.60683376", "0.606263", "0.605123", "0.6032816", "0.5984121", "0.5972824", "0.59715354", "0.59658253", "0.59417236", "0.59343225", "0.58437675", "0.58080035", "0.5778736", "0.57738817", "0.57630897", "0.5721954", "0.57170963", "0.571...
0.5326525
48
A 3byte bigendian unsigned integer, as used in ancient file formats.
def Int24ub(): return BytesInteger(3, signed=False, swapped=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Int24ul():\n return BytesInteger(3, signed=False, swapped=True)", "def _fread3(fobj):\n b1, b2, b3 = np.fromfile(fobj, \">u1\", 3)\n return (b1 << 16) + (b2 << 8) + b3", "def uint32_t(n):\n return int(n).to_bytes(4, byteorder='little', signed=False)", "def readUByte(self) -> int:\n\n s...
[ "0.6861968", "0.67406887", "0.6577787", "0.64837444", "0.6481434", "0.6466438", "0.6407827", "0.6399622", "0.6368135", "0.627368", "0.62467015", "0.624194", "0.62246996", "0.61679983", "0.6143792", "0.6100607", "0.6039354", "0.6017516", "0.599589", "0.5982463", "0.5973596", ...
0.7183188
0
A 3byte bigendian signed integer, as used in ancient file formats.
def Int24sb(): return BytesInteger(3, signed=True, swapped=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Int24ub():\n return BytesInteger(3, signed=False, swapped=False)", "def Int24ul():\n return BytesInteger(3, signed=False, swapped=True)", "def int32_t(n):\n return int(n).to_bytes(4, byteorder='little', signed=True)", "def _fread3(fobj):\n b1, b2, b3 = np.fromfile(fobj, \">u1\", 3)\n retur...
[ "0.7104707", "0.67690885", "0.6737171", "0.66560775", "0.6633421", "0.6568239", "0.65055394", "0.64874417", "0.6363494", "0.6341695", "0.6315677", "0.6290673", "0.62875104", "0.6184684", "0.6118802", "0.6105029", "0.6098462", "0.60673857", "0.6066826", "0.6053397", "0.6045168...
0.67703265
1
A 3byte littleendian signed integer, as used in ancient file formats.
def Int24sl(): return BytesInteger(3, signed=True, swapped=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def int32_t(n):\n return int(n).to_bytes(4, byteorder='little', signed=True)", "def read_int32(self):\n return unpack(\"<i\", self._file.read(4))[0]", "def p32(i):\r\n l=struct.pack('<I', i)\r\n if sys.version_info[0]==3:\r\n return Latin1_decode(l)\r\n return l", "def Int24ul():\n ...
[ "0.71387565", "0.7032595", "0.6939859", "0.6923461", "0.6894212", "0.6764889", "0.6751335", "0.66675127", "0.66558075", "0.6643525", "0.6621458", "0.66119385", "0.6568192", "0.6554647", "0.6465481", "0.63472784", "0.6291043", "0.6288294", "0.62025076", "0.61918414", "0.618307...
0.6904169
4
Rotate a point counterclockwise by a given angle around a given origin. The angle should be given in degrees.
def rotate(point, angle): ox, oy = 0, 0 px, py = point qx = ox + np.cos(np.deg2rad(angle)) * (px - ox) - \ np.sin(np.deg2rad(angle)) * (py - oy) qy = oy + np.sin(np.deg2rad(angle)) * (px - ox) + \ np.cos(np.deg2rad(angle)) * (py - oy) return qx, qy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotate(self,origin, point, angle):\n \n x1, y1 = origin\n x2, y2 = point\n final_x = x1 + math.cos(angle) * (x2 - x1) - math.sin(angle) * (y2 - y1)\n final_y = y1 + math.sin(angle) * (x2 - x1) + math.cos(angle) * (y2 - y1)\n final_y = abs(width - final_y)\n \n ...
[ "0.7520647", "0.7515793", "0.7499641", "0.7491217", "0.74327123", "0.7413196", "0.7413196", "0.73878783", "0.7369804", "0.731472", "0.7228472", "0.71816474", "0.7177181", "0.696315", "0.6902952", "0.6902952", "0.6824922", "0.6818679", "0.68158835", "0.67640704", "0.6749894", ...
0.66308624
26
Encode a ``db.Model`` instance or collection to a JSON string.
def to_json(thing, strategy=None, context={}): if not isinstance(strategy, (ModelStrategy, SerializationStrategy, types.NoneType)): raise ValueError("Serialization strategy must be a ModelStrategy, SerializationStrategy or dict") if isinstance(strategy, ModelStrategy): strategy = SerializationSt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize(self) -> str:\n # Here we use MyPy ignore because to_dict() method returns a general\n # dictionary representation of domain object (CollectionDict) which\n # does not contain properties like created_on and last_updated but\n # MyPy expects collection_dict, a dictionary wh...
[ "0.68827605", "0.685795", "0.68396217", "0.68230337", "0.6794327", "0.6754379", "0.6744895", "0.67409855", "0.6699109", "0.6673397", "0.6655318", "0.6646099", "0.6646099", "0.6646099", "0.6646099", "0.6646099", "0.6646099", "0.6646099", "0.6646099", "0.6646099", "0.6627117", ...
0.0
-1
Splits the ciphertext into the number of threads specified by the cipher's key_length.
def split_ciphertext(self, ciphertext): threads = {} # Creates a thread for each # letter in the key for i in range(self.key_length): threads[i] = '' index = 0 pattern = re.compile(r'^[a-zA-Z]$') # Adds only letters from the # ciphertext to th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_substrings(ciphertext, keylength):\n\n substring_list = [''] * keylength\n substring_index = 0\n offset = 0\n\n # split the ciphertext into substrings\n for letter in ciphertext:\n # offset the letter by which key iteration it is on\n new_letter_value = ord(letter) - offset\n...
[ "0.6010629", "0.5755844", "0.57013154", "0.5685736", "0.52462983", "0.52279437", "0.5223169", "0.5135581", "0.5045106", "0.50354886", "0.49824134", "0.4930256", "0.49058783", "0.48734722", "0.48691672", "0.48073235", "0.48039398", "0.4772939", "0.47691795", "0.4759007", "0.47...
0.72206795
0
Factory function that returns a copy of an example of Block object for tests and POCs.
def get_example() -> Block: return deepcopy(_BLOCK)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def obtain_block_object(block_data):\n return Block(\n block_data['index'],\n block_data['proof_no'],\n block_data['prev_hash'],\n block_data['data'],\n timestamp=block_data['timestamp']\n )", "def block():\n # grab the component class\n ...
[ "0.63591826", "0.63291687", "0.62436557", "0.62210244", "0.6194369", "0.6193981", "0.6042119", "0.6017704", "0.5870881", "0.58701026", "0.58428174", "0.5829108", "0.58133674", "0.58122003", "0.57727194", "0.57499284", "0.57159394", "0.57074225", "0.5703616", "0.56712025", "0....
0.8439765
0
Create and save a User. With a given email and password.
def _create_user(self, email, password, **extra_fields): if not email: raise ValueError('The given email must be set') email = self.normalize_email(email) user = self.model( email=email, **extra_fields ) user.set_password(password) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_user(self, email, password, **extra_fields):\n if not email:\n raise ValueError('User must have an email address')\n email = self.normalize_email(email)\n user = self.model(email=email, **extra_fields)\n user.set_password(password)\n user.save(using=self....
[ "0.8555917", "0.8534104", "0.85152215", "0.84661984", "0.84661984", "0.84661984", "0.84661984", "0.8464599", "0.8464117", "0.8452491", "0.8451274", "0.84479505", "0.8447937", "0.8447826", "0.8441785", "0.8441785", "0.8441462", "0.8439586", "0.8438299", "0.84345144", "0.843451...
0.8359348
54
Save the user. Sets the is_superuser field to false first before, saving the user.
def create_user(self, email, password=None, **extra_fields): extra_fields.setdefault('is_staff', True) extra_fields.setdefault('is_superuser', False) return self._create_user(email, password, **extra_fields)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, commit=True):\n user = super(EditUserForm, self).save(commit=False)\n # make an admin if checked\n if self.cleaned_data[\"is_admin\"]:\n user.is_superuser = True\n # commit\n if commit:\n user.save()\n return user", "def save(self, co...
[ "0.79472494", "0.75391525", "0.7516951", "0.7367138", "0.7367138", "0.725343", "0.7096255", "0.7058202", "0.7004303", "0.7003399", "0.70024914", "0.6924147", "0.69141847", "0.68864596", "0.6829138", "0.6827167", "0.6772086", "0.67595506", "0.67290837", "0.67170954", "0.667233...
0.0
-1
Save the superuser. Sets the is_superuser field to true first before, saving the user.
def create_superuser(self, email, password, **extra_fields): extra_fields.setdefault('is_staff', True) extra_fields.setdefault('is_superuser', True) if extra_fields.get('is_superuser') is not True: raise ValueError( 'Superuser must have is_superuser=True.' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, commit=True):\n user = super(EditUserForm, self).save(commit=False)\n # make an admin if checked\n if self.cleaned_data[\"is_admin\"]:\n user.is_superuser = True\n # commit\n if commit:\n user.save()\n return user", "def save(self, co...
[ "0.7583252", "0.70261115", "0.68174213", "0.674774", "0.66769165", "0.6614828", "0.65218586", "0.6499039", "0.6493398", "0.6493398", "0.64744276", "0.647003", "0.64480746", "0.6394682", "0.6361035", "0.6340421", "0.6289417", "0.6285179", "0.62728286", "0.6268129", "0.62663716...
0.0
-1
Returns a dataframe with differential expression with respect to strain_base.
def dataframe_diff_expression(time='T2', strain_base='WT'): df_out = None if time == 'T1': scen=['WT_T1', 'pkt_T1', 'goret_T1', 'Saccha_T1', 'gap_T1'] elif time == 'T2': scen=['WT_T2', 'pkt_T2', 'goret_T2', 'Saccha_T2', 'gap_T2'] scen.remove(strain_base+'_'+time) wd_data = '/Use...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def construct_data(self):\n self.final = pd.DataFrame()\n self.final['c+'] = self.match1\n self.final['c-'] = self.match2\n self.final['xmcd'] = self.final['c+'] - self.final['c-']\n self.final['temperature'] = self.plus.groupby('#Ecrbk')['Temperature'].agg('first')\n self...
[ "0.55476516", "0.5291711", "0.52826124", "0.5279402", "0.52058876", "0.5202182", "0.519138", "0.51544905", "0.5133602", "0.5114241", "0.51080287", "0.5039081", "0.5022777", "0.5015822", "0.49884585", "0.49716094", "0.49697328", "0.49645936", "0.4953346", "0.4948363", "0.49403...
0.62415266
0
Return the filter params for a specific event of a given channel.
def get_filter_args_for_specific_event_from_channel( token_network_address: TokenNetworkAddress, channel_identifier: ChannelID, event_name: str, contract_manager: ContractManager, from_block: BlockIdentifier = GENESIS_BLOCK_NUMBER, to_block: BlockIdentifier = BLOCK_ID_LATEST, ) -> FilterParams: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_filter_args_for_specific_event_from_channel(\n token_network_address: TokenNetworkAddress,\n channel_identifier: ChannelID,\n event_name: str,\n contract_manager: ContractManager,\n from_block: BlockSpecification = GENESIS_BLOCK_NUMBER,\n to_block: BlockSpecification = \"latest\",\n) -> D...
[ "0.71452796", "0.7049428", "0.6985713", "0.67844117", "0.67415524", "0.5985219", "0.5877379", "0.5649384", "0.5515246", "0.5467012", "0.54291594", "0.53991234", "0.53461254", "0.53253305", "0.5312929", "0.5303651", "0.5303536", "0.5296885", "0.5180446", "0.5142509", "0.511274...
0.69543487
3
Parses a date_string returned from the server to a datetime object. This parser is a weakparser is the sense that it handles only a single format of date_string. It is expected that the server format will never change. The implementation depends only on the standard lib to avoid an external dependency
def parse_datetime(date_string: str) -> datetime: try: # Datetime ending with a Z means "UTC". Here we parse the date as local machine # timezone and then move it to the appropriate UTC timezone. # See https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC) # Taken fr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_date(date_string):\n if _dateutil_parse:\n return _dateutil_parse(date_string)\n else:\n try:\n date_fmt = \"%a, %d %b %Y %H:%M:%S %z\"\n return datetime.datetime.strptime(date_string, date_fmt)\n except ValueError:\n date_fmt = \"%a, %d %b %Y %...
[ "0.7864939", "0.7773595", "0.7671434", "0.7593262", "0.7563987", "0.7529438", "0.74732715", "0.74558645", "0.7399304", "0.73799646", "0.7375337", "0.7354286", "0.7350977", "0.73236406", "0.7287217", "0.72850865", "0.72676253", "0.72613966", "0.7256154", "0.7237792", "0.720945...
0.68028486
58
Method to return a related staff. The default behaviour should be to find related staff via the relationship from StaffPage > SchoolPage. This also needs to offer the option to manually add related staff to the school page, this helps solve issues of custom ordering that's needed with large (>25) staff items.
def get_related_staff(self): from rca.people.models import StaffPage related_staff = self.related_staff.select_related("image") if related_staff: return related_staff # For any automatially related staff, adjust the list so we don't have # to make edits to the temp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cdh_staff(self):\n return self.filter(cdh_staff=True)", "def fetch_staff(self, obj, user):\n members = models.Membership(conference=obj).fetch()\n return [member.staff for member in members]", "def _goto_staff_page(self):\n self.courseware_page.visit()\n staff_page = Staf...
[ "0.5978139", "0.5976206", "0.5781959", "0.5679644", "0.5542773", "0.5542773", "0.55373955", "0.5484194", "0.5253463", "0.5251118", "0.5241437", "0.5231457", "0.5224025", "0.51138306", "0.5004238", "0.4982564", "0.49681696", "0.49402216", "0.48849177", "0.48393413", "0.4835108...
0.788787
0
Parses ISO formated date string to datatime object.
def parse_date(date_str): return datetime.strptime(date_str, '%Y-%m-%d').date()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def datetime_from_isoformat(dt_str):\n dt = parser.isoparse(dt_str)\n return dt", "def parse_iso_date(string):\n\ttry:\n\t\t# Split into date[, time, timezone]\n\t\tmatch = re.fullmatch(r'([\\d-]+)(?:T([\\d:.]+)(.*))?', string)\n\t\tassert match, 'Bad format'\n\t\tdatepart, timepart, tzpart = match.groups(...
[ "0.80384153", "0.78278035", "0.76934916", "0.7579901", "0.74867606", "0.7483747", "0.73748714", "0.7274611", "0.7256313", "0.7229163", "0.7216562", "0.72147167", "0.7187188", "0.7159828", "0.71492773", "0.7102398", "0.70907915", "0.7083885", "0.7058119", "0.6986697", "0.69668...
0.67508733
44
Parses ISO formated datetime string to datatime object.
def parse_datetime(date_str): return datetime.strptime(date_str, '%Y-%m-%d %H:%M')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def datetime_from_isoformat(dt_str):\n dt = parser.isoparse(dt_str)\n return dt", "def datetime_from_iso(iso_string):\n try:\n assert datetime_regex.datetime.datetime.match(iso_string).groups()[0]\n except (ValueError, AssertionError, IndexError, AttributeError):\n raise TypeError(\"Str...
[ "0.83494264", "0.7981338", "0.7843893", "0.7798705", "0.7738778", "0.7720548", "0.7658041", "0.76404524", "0.760533", "0.75538707", "0.75368524", "0.7492415", "0.7380826", "0.73534733", "0.73050284", "0.73022664", "0.724514", "0.7175319", "0.71641994", "0.7162291", "0.7147675...
0.71008617
25
A ideia aqui e criar uma lista de listas para ser nossa matriz a primeira linha eh composta por letras do alfabeto, as outras duas sao compostas pelos simbulos. O tipo de objeto e char.
def cria_matriz_inicial(): # Crio a lista de chars escolhidos chars_escolhidos = [] # Crio a matriz chave chave = [] # Crio uma lista contendo o alfabeto alfabeto = list(string.ascii_uppercase) # Jogo a lista contendo o alfabeto para a chave # isto e, para a primeira linha da matriz ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _criar_tabela():\n\n alfabeto = list(string.ascii_lowercase)\n tabela = []\n\n for x in range(len(string.ascii_lowercase)):\n linha = alfabeto[:] # [:] slice, faz com que a passagem do objeto seja por copia\n tabela.append(linha)\n\n alfabeto.append(alfabeto[0])\n del(alfab...
[ "0.6427342", "0.6276493", "0.5783889", "0.5782096", "0.5673868", "0.565529", "0.56312084", "0.5511712", "0.54095477", "0.5375402", "0.5334771", "0.52952045", "0.5283277", "0.528282", "0.5280951", "0.527884", "0.52744335", "0.5262235", "0.52480894", "0.52416676", "0.5222621", ...
0.6693857
0
Return true if the input statement contains 'what' and 'is' and 'temperature'.
def can_process(self, statement): subject = ['disciplina', 'matéria', 'aula'] question = ['qual', 'quando', 'onde', 'quem'] if any(x in statement.text.split() for x in question): if any(x in statement.text.split() for x in subject): return True retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_process(self, statement):\r\n set1 = ['sweet', 'room']\r\n set2 = ['delux', 'room']\r\n set3 = ['condo', 'room']\r\n\r\n if all(x in statement.text.split() for x in set1):\r\n return True\r\n elif all(x in statement.text.split() for x in set2):\r\n r...
[ "0.6684128", "0.58001626", "0.5754288", "0.5744932", "0.5715755", "0.5605202", "0.56001776", "0.5500728", "0.5500488", "0.54905844", "0.54852235", "0.5482833", "0.54326993", "0.5429416", "0.5396839", "0.5389886", "0.537791", "0.53658926", "0.53527486", "0.5346283", "0.5343764...
0.61620116
1
Initialize from list of dict
def from_effect_dict(cls, effects: dict, rand: str = '$shift'): lines = [] for term, entry in effects.items(): if isinstance(entry, int): parent, rand_ = entry, rand elif isinstance(entry, str): parent, rand_ = -1, entry else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_items(*items):\n return from_dict(dict(items))", "def _from_list(\n cls,\n list_of_dct_or_obj: List[Union[dict, 'AttrsClass', None]],\n ) -> List[Union['AttrsClass', None]]:\n if isinstance(list_of_dct_or_obj, list):\n return [cls.from_dict(item) for item in list_of...
[ "0.6876342", "0.6593386", "0.65437657", "0.6360719", "0.63071275", "0.62600845", "0.62308824", "0.6195987", "0.61762196", "0.61072874", "0.60953516", "0.60851914", "0.60851914", "0.60851914", "0.60851914", "0.60851914", "0.60851914", "0.60851914", "0.60851914", "0.60851914", ...
0.0
-1
Test find with cache files that are not valid JSON objects
def test_prefixes_load_cache_file_invalid_json(mock_prefixes_cache_invalid_json_data) -> None: with pytest.raises(NetworkError): Prefixes(cache_directory=mock_prefixes_cache_invalid_json_data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_no_cache_corrupt_files(self, load_mock):\n load_mock.side_effect = ValueError\n with patch.object(\n self.storage, \"all_json_files\", return_value=[\"the_dude.json\"]\n ):\n with patch.object(self.storage, \"content\", return_value=\"dude\"):\n ok...
[ "0.7230436", "0.7011839", "0.6851395", "0.66390085", "0.6556651", "0.6411121", "0.6405507", "0.63634115", "0.6274369", "0.61961806", "0.6193368", "0.6125475", "0.61120266", "0.60980254", "0.6081284", "0.6070877", "0.60541433", "0.6045511", "0.60333294", "0.59628457", "0.59169...
0.69157195
2
Test find with cache files that are not valid address objects
def test_prefixes_load_cache_file_invalid_address_data(mock_prefixes_cache_invalid_address_data) -> None: with pytest.raises(NetworkError): Prefixes(cache_directory=mock_prefixes_cache_invalid_address_data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_list_broken_fail(self):\n assert not self.z.contents_cache\n assert self.z.package_contents()\n assert self.z.contents_cache # Spelling check!\n self.z.broken_files.add(\"foo\")\n self.z.contents_cache = \"foo\"\n assert self.z.package_contents() != \"foo\"",...
[ "0.63048965", "0.62089694", "0.619546", "0.5992135", "0.5911898", "0.58575696", "0.5850406", "0.5845712", "0.58293664", "0.5818645", "0.5814964", "0.5804826", "0.5749289", "0.57100356", "0.5678466", "0.5656727", "0.56411344", "0.56060916", "0.560149", "0.5571997", "0.55605614...
0.68606347
0
The quaternion representing of an Euler rotation. For example, if axis=2 the computed quaternion(s) will have
def euler(axis, angle): # Either angle or axis or both can be vectors. angle = np.asarray(angle) shape = np.broadcast(axis, angle).shape + (4,) c, s = np.cos(angle/2), np.sin(angle/2) q = np.zeros(shape) q[..., 0] = c q[..., axis+1] = s if len(shape) == 1: return quat(*q) ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def euler_from_quaternion(q):\n trans_quat = to_transquat(q)\n eul = trans.euler_from_quaternion(trans_quat)\n return eul", "def euler_from_quaternion(self, quaternion):\n x = quaternion.x\n y = quaternion.y\n z = quaternion.z\n w = quaternion.w\n\n sinr_cosp = 2 * (w ...
[ "0.7877236", "0.76133597", "0.7608523", "0.7573004", "0.756956", "0.7528782", "0.7507752", "0.7437607", "0.73668754", "0.7345292", "0.73390764", "0.73262554", "0.7290675", "0.7285363", "0.7272147", "0.7256717", "0.7210896", "0.7210896", "0.7210219", "0.7204601", "0.7202324", ...
0.7229904
16
Decomposes the rotation encoded by q into the product of Euler
def decompose_iso(q): if isinstance(q, quat): a,b,c,d = q.a, q.b, q.c, q.d else: a,b,c,d = np.transpose(q) psi = np.arctan2(a*b+c*d, a*c-b*d) phi = np.arctan2(c*d-a*b, a*c+b*d) # There are many ways to get theta; this is probably the most # expensive but the most robust. t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def euler_from_quaternion(q):\n trans_quat = to_transquat(q)\n eul = trans.euler_from_quaternion(trans_quat)\n return eul", "def euler(self):\n return tf.taitbryan.quat2euler((self._qw, self._qx, self._qy, self._qz))[::-1]", "def q_to_rot(q):\n a, b, c, d = q[0], q[1], q[2], q[3]\n return...
[ "0.73668176", "0.665357", "0.6533348", "0.6517943", "0.6451022", "0.6423241", "0.639725", "0.6369422", "0.6254819", "0.61617523", "0.6061903", "0.604235", "0.6027297", "0.59281266", "0.59280944", "0.5918914", "0.5918437", "0.5902111", "0.5890283", "0.5890283", "0.5867871", ...
0.630071
8
Like decompose_iso, but returns (xi, eta, gamma) assuming that the input quaternion(s) were constructed as rotation_xieta(xi, eta, gamma).
def decompose_xieta(q): theta, phi, psi = decompose_iso(q) xi = -np.sin(theta) * np.sin(phi) eta = -np.sin(theta) * np.cos(phi) gamma = psi + phi return (xi, eta, gamma)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decompose_iso(q):\n\n if isinstance(q, quat):\n a,b,c,d = q.a, q.b, q.c, q.d\n else:\n a,b,c,d = np.transpose(q)\n\n psi = np.arctan2(a*b+c*d, a*c-b*d)\n phi = np.arctan2(c*d-a*b, a*c+b*d)\n\n # There are many ways to get theta; this is probably the most\n # expensive but the mo...
[ "0.7745419", "0.60979915", "0.5622861", "0.56217647", "0.56011087", "0.56011087", "0.55894244", "0.55520153", "0.55520153", "0.53142375", "0.5274199", "0.519533", "0.5164827", "0.51265574", "0.5121664", "0.5091485", "0.5091485", "0.50799125", "0.5074462", "0.5074462", "0.5069...
0.79909164
0
Get length of KNX/IP body.
def calculated_length(self): return self.cemi.calculated_length()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_body_length(self):\n return self.__body_length", "def calculated_length(self) -> int:\n return TunnellingAck.BODY_LENGTH", "def size(self):\n return len(self.body)", "def get_length(self, key):\n data = self._content[key]\n if isinstance(data, bytes) and data[0] == ...
[ "0.758873", "0.7564792", "0.7000656", "0.69916254", "0.69593817", "0.6948038", "0.68284035", "0.6788896", "0.6776778", "0.6776778", "0.6776778", "0.6747772", "0.6745681", "0.6732186", "0.6723802", "0.67235976", "0.6656827", "0.66167694", "0.65983933", "0.6585974", "0.6583807"...
0.0
-1
Return the last 8 digits of an int
def last_8(some_int): return some_int%(10**8) #raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_ten():\r\n val = 28433 * pow(2, 7830457) + 1\r\n return str(val)[-10:]", "def reverse_5_digit_int(number):\r\n reminder = 0\r\n reverse = 0\r\n while number > 0:\r\n reminder = number%10\r\n number = number//10\r\n reverse = (reverse*10) + reminder\r\n return rever...
[ "0.72126675", "0.68851286", "0.6557457", "0.64866954", "0.6485897", "0.6394562", "0.6357777", "0.6338208", "0.6266439", "0.6191209", "0.6172545", "0.6110021", "0.6109993", "0.60638785", "0.600801", "0.60061127", "0.59958917", "0.598825", "0.59825575", "0.5977712", "0.5959429"...
0.7850027
0
Send request with auto refresh token feature.
def request(self, method, url, withhold_token=False, auth=None, **kwargs): if self.default_timeout: kwargs.setdefault('timeout', self.default_timeout) if not withhold_token and auth is None: auth = self.token_auth return super().request( method, url, auth=auth...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def client_request_refresh_token():\n\n test_session_services.clear_current_request()\n test_session_services.inject_new_request()\n payload = DTO(sub=300, auth='test')\n access_token = token_services.generate_refresh_token(payload)\n refresh_token = token_services.generate_refresh_token(payload)\n ...
[ "0.73062414", "0.70128983", "0.68650675", "0.68620193", "0.6804122", "0.67762196", "0.67417276", "0.671721", "0.6688831", "0.66763574", "0.6652642", "0.6618604", "0.65802824", "0.6541226", "0.6506736", "0.64825076", "0.6480499", "0.6452795", "0.6422934", "0.6388861", "0.63888...
0.5854427
68
Affiche le(s) sprite(s) de coup
def frapperP1(): global joueur1 global sprite_a_chargerP1, imagesGaucheP1, imagesDroiteP1, imagesFrappeGaucheP1, imagesFrappeDroiteP1 global en_cours_attaqueP1 global vie_p2, jeu_actif, point_p1 # On récupère la direction du personnage avant le coup if (sprite_a_chargerP1 in imagesGauche...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, posx, posy):\n pygame.sprite.Sprite.__init__(self)\n self.bola = pygame.image.load(\"imagenes/BalonChile.png\")\n self.rect = self.bola.get_rect()\n self.rect.centerx = ancho/2\n self.rect.centery = alto-45\n self.veloci = [2,2]\n self.puntos = 0\n ...
[ "0.69994086", "0.6560177", "0.63398415", "0.6308217", "0.62568104", "0.6256166", "0.6253542", "0.62506473", "0.62385553", "0.62268835", "0.6212585", "0.6210992", "0.6208873", "0.6201663", "0.62005496", "0.61807334", "0.61766416", "0.61762536", "0.61698836", "0.61576456", "0.6...
0.6610101
1
Affiche le(s) sprite(s) de coup
def frapperP2(): global joueur2 global sprite_a_chargerP2, imagesGaucheP2, imagesDroiteP2, imagesFrappeGaucheP2, imagesFrappeDroiteP2 global en_cours_attaqueP2 global vie_p1, jeu_actif, point_p2 # On récupère la direction du personnage avant le coup if (sprite_a_chargerP2 in imagesGauche...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, posx, posy):\n pygame.sprite.Sprite.__init__(self)\n self.bola = pygame.image.load(\"imagenes/BalonChile.png\")\n self.rect = self.bola.get_rect()\n self.rect.centerx = ancho/2\n self.rect.centery = alto-45\n self.veloci = [2,2]\n self.puntos = 0\n ...
[ "0.70004", "0.6609892", "0.63407326", "0.63102883", "0.62573665", "0.6257295", "0.62551165", "0.6252425", "0.62395287", "0.62274253", "0.621453", "0.6211526", "0.6210704", "0.62023115", "0.6199357", "0.61824495", "0.61773527", "0.61768097", "0.61716056", "0.6159099", "0.61571...
0.65598726
2
Returns the radius of the Cozmo robot's front wheel in millimeters.
def get_front_wheel_radius(): # #### # I found this by using the drive straight method. I specified different values in mm to determine # how many mm it was to get 1 full rotation of the front wheel. That told me the circumference of the # front wheel so the radius was just that number (85mm) divided ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def radius(self):\n return max(self.x/2.0, max(self.y/2.0, self.z/2.0))", "def getCircumference(self):\n return 2 * math.pi * self.radius", "def magnitude(self):\n return self.__radius", "def rotor_radius(self):\n return self.rotor_diameter / 2.0", "def get_radius(self):\n ...
[ "0.649598", "0.6446837", "0.6397204", "0.638126", "0.6349222", "0.62363064", "0.62319905", "0.620805", "0.6188582", "0.6174971", "0.61316586", "0.6124458", "0.6124458", "0.6099607", "0.60910416", "0.60906625", "0.6073874", "0.6073874", "0.6073874", "0.6073874", "0.6073874", ...
0.846428
0
Returns the distance between the wheels of the Cozmo robot in millimeters.
def get_distance_between_wheels(): # #### # I first did this empirically by spinning cozmo about one wheel creating an arch. I set one wheel speed to # 0 the other to 85 and played around with duration until I had cozmo do one exact circle. I then used the speed # and duration to calculate a circumfe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance_cm(self):\n GPIO.output(self.GPIO_TRIGGER, True)\n time.sleep(0.00001)\n GPIO.output(self.GPIO_TRIGGER, False)\n start = time.time()\n stop = time.time()\n\n while GPIO.input(self.GPIO_ECHO) == 0:\n start = time.time()\n\n while GPIO.input(se...
[ "0.65854335", "0.63547575", "0.6274038", "0.6230455", "0.62115246", "0.61565155", "0.6146095", "0.61357087", "0.61273474", "0.6107933", "0.6092399", "0.60537636", "0.60537636", "0.60133076", "0.5976506", "0.596262", "0.5905635", "0.5884098", "0.5878035", "0.5878035", "0.58664...
0.7307714
0
simplePreprocessor(width, height = 1, interpolation = cv2.INTER_AREA) returns a function f(img), that resizes an image img to a width X height resolution, using the interpolation algorithm provided if height is not provided, the new size will be the square width X width
def simplePreprocessor(width, height = -1, interpolation = cv2.INTER_AREA): if height == -1: height = width return lambda img: cv2.resize(img, (width, height), interpolation)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resize(img, f):\n newDim = (int(img.shape[0]), int(f*img.shape[0]))\n return cv2.resize(img, newDim, interpolation = cv2.INTER_AREA)", "def resize_function(image):\n image = cv2.resize(image, (64, 64), interpolation = cv2.INTER_AREA)\n return image", "def resize(img, height=800):\n rat = heig...
[ "0.69788426", "0.6650095", "0.6266494", "0.62370557", "0.6201009", "0.6123469", "0.6063772", "0.6049556", "0.60322285", "0.59981745", "0.5995571", "0.5995571", "0.59458715", "0.5923247", "0.5908324", "0.5851926", "0.5797288", "0.5792091", "0.5792091", "0.57846487", "0.5776767...
0.9041213
0
Extracts the needed fields from input samples and stores them in the replay buffer. Then samples from the replay buffer to train the agent by gradient updates (with the number of updates determined by replay ratio, sampler batch size, and training batch size). If using prioritized replay, updates the priorities for sam...
def optimize_agent(self, itr, samples=None, sampler_itr=None): itr = itr if sampler_itr is None else sampler_itr # Async uses sampler_itr.= if samples is not None: samples_to_buffer = self.samples_to_buffer(samples) self.replay_buffer.append_samples(samples_to_buffer) op...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train(self, samples):\n \n # Unpack data from replay buffer and convert to tensors\n obs = torch.tensor([exp[0] for exp in samples], \n dtype=torch.float, device=device)\n act = torch.tensor([exp[1] for exp in samples],\n dtype=torch.float, device=device)\n ...
[ "0.7156752", "0.6976968", "0.66787", "0.66545117", "0.6607179", "0.6539656", "0.64539653", "0.64310163", "0.63920707", "0.6329385", "0.63147825", "0.62504476", "0.6230319", "0.6158199", "0.6139879", "0.6112196", "0.61041886", "0.60694873", "0.60438883", "0.6030148", "0.602402...
0.5838727
33
Computes the Distributional Qlearning loss, based on projecting the discounted rewards + target Qdistribution into the current Qdomain, with crossentropy loss. Returns loss and KLdivergenceerrors for use in prioritization.
def loss(self, samples): if self.model.noisy: self.model.head.reset_noise() # start = time.time() log_pred_ps, pred_rew, spr_loss\ = self.agent(samples.all_observation.to(self.agent.device), samples.all_action.to(self.agent.device), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_loss_q(self, data):\n view,feature, action, reward, log_pi, q = data['view'], data['feature'],data['action'], data['reward'], data['old_policy'], data['old_qvalue']\n q = self.ac.eval_qvalue(view,feature)\n vals = torch.sum(q * torch.exp(log_pi), dim=1)\n loss_q = torch.mea...
[ "0.66264075", "0.64492905", "0.6427523", "0.6386334", "0.6251832", "0.6243721", "0.61882174", "0.6183424", "0.60845876", "0.6043141", "0.60183823", "0.6017107", "0.60093397", "0.59958166", "0.5977722", "0.5970539", "0.5961935", "0.5943061", "0.59332526", "0.58675516", "0.5860...
0.5974879
15
Return hello template at application root URL.
def hello(name=None): return render_template('home.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hello():\n return render_template('index.html')", "def hello():\n return render_template(\"index.html\")", "def hello_world():\n return render_template(\"index.html\")", "def say_hello():\n\n return render_template(\"welcome.html\")", "def say_hello():\n\n return render_template(\"hello....
[ "0.80375856", "0.8023643", "0.7797049", "0.7775746", "0.7580602", "0.74113405", "0.740482", "0.7387153", "0.7280508", "0.72350556", "0.7217066", "0.719457", "0.7189518", "0.716588", "0.7132201", "0.70782316", "0.7075495", "0.7075495", "0.7075495", "0.70549434", "0.70549434", ...
0.7529084
5
Return hello template at application root URL.
def player(name, opponent): token = channel.create_channel(name) userHistory = displayUser(name) leaderBoard = displayWinners() templateValues = { "token": channel.create_channel(name), "opponent": str(opponent), "p1Name": name, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hello():\n return render_template('index.html')", "def hello():\n return render_template(\"index.html\")", "def hello_world():\n return render_template(\"index.html\")", "def say_hello():\n\n return render_template(\"welcome.html\")", "def say_hello():\n\n return render_template(\"hello....
[ "0.8035958", "0.80220443", "0.7795442", "0.7773016", "0.7578174", "0.7528639", "0.7410278", "0.7403139", "0.7385546", "0.7280451", "0.7237149", "0.721754", "0.7195686", "0.7188452", "0.7167375", "0.7131669", "0.70803136", "0.70759004", "0.70759004", "0.70759004", "0.7055376",...
0.0
-1
Test the parallax factor.
def testParallaxFactor(self): data = np.zeros(600, dtype=list(zip(['fieldRA', 'fieldDec', 'observationStartMJD'], [float, float, float]))) data['fieldRA'] = data['fieldRA'] + .1 data['fieldDec'] = data['fieldDec'] - .1 data['observationStartMJD'] =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def TestReflectivityUV(self):\n\t\ttest = rnd.uniform(0.,1.)\n\n\t\tif test > self.lxsc.PLXSC().ReflectivityUV():\n\t\t\treturn False\n\t\telse:\n\t\t\treturn True", "def test_density(self):\n assert self.solution.density[0] == pytest.approx(2.0)", "def test_bullet_speed_is_3(self):\n assert self...
[ "0.5563867", "0.5411419", "0.53334373", "0.5192476", "0.5183435", "0.5118165", "0.5101514", "0.51006573", "0.5070004", "0.5059298", "0.50150687", "0.5011445", "0.50046587", "0.50025177", "0.5001315", "0.49985188", "0.49686", "0.4936643", "0.49307036", "0.49274838", "0.4920692...
0.0
-1
List of Configuration Diagnostics validator results.
def validator_results(self) -> Optional[Sequence['outputs.ConfigDiagnosticsValidatorResultResponse']]: return pulumi.get(self, "validator_results")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_validation_results(self) -> Dict[str, List[List[float]]]:\n return self._logger.validation_results", "def diagnostics(self):\n return [fn(self.y_test, self.y_pred) for fn in self.evaluator.diagnostics]", "def results(self):\n return self._report.get('results', [])", "def get_vali...
[ "0.65652835", "0.62088126", "0.60824335", "0.5834752", "0.5704745", "0.5634849", "0.5626965", "0.5614832", "0.5606605", "0.55690837", "0.55630153", "0.55613655", "0.5555986", "0.55526733", "0.55514365", "0.5540576", "0.55236894", "0.5516057", "0.5492818", "0.5492053", "0.5466...
0.74040407
0
List of resource config validation issues.
def issues(self) -> Optional[Sequence['outputs.ConfigDiagnosticsValidatorResultIssueResponse']]: return pulumi.get(self, "issues")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validation_issues(self) -> List[ValidationIssue]:\n return self._validation_issues", "def validate(self):\n self._errors = []\n for resource in self.resources:\n resource.validate()\n for error in resource.errors:\n self._errors.append(error)", "def...
[ "0.72189856", "0.67298573", "0.643964", "0.63245153", "0.6257267", "0.61935085", "0.6135101", "0.6116753", "0.6096758", "0.60854447", "0.6042186", "0.602484", "0.6021056", "0.5977692", "0.593157", "0.5924089", "0.5900949", "0.5900949", "0.5900949", "0.5856026", "0.58555716", ...
0.6999221
1
A flag to determine whether or not ChannelBinding is enabled or disabled.
def channel_binding(self) -> Optional[str]: return pulumi.get(self, "channel_binding")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_enabled():\n return _ENABLED", "def is_enabled():\n return bool(lib.serialboxLoggingIsEnabled)", "def isLoopbackEnabled(self):\n if DPxIsAudMicLoopback() == 0:\n enable = False\n else:\n enable = True\n return enable", "def isEnabled(self):\n ...
[ "0.6719183", "0.6468333", "0.6369139", "0.63680315", "0.6333551", "0.632457", "0.632457", "0.62706083", "0.62706083", "0.62706083", "0.62706083", "0.62706083", "0.62706083", "0.62706083", "0.62706083", "0.62706083", "0.62706083", "0.62706083", "0.62706083", "0.62706083", "0.6...
0.0
-1
A flag to determine whether or not KerberosArmoring is enabled or disabled.
def kerberos_armoring(self) -> Optional[str]: return pulumi.get(self, "kerberos_armoring")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_test_bearer_enabled():\n\n return get(PROPERTY_TEST_BEARER_ENABLED).lower() in [\"true\", \"1\"]", "def is_enabled():\n return _ENABLED", "def is_enabled():\n return bool(lib.serialboxLoggingIsEnabled)", "def auth_enabled(self) -> bool:\n return pulumi.get(self, \"auth_enabled\")"...
[ "0.6230028", "0.6106795", "0.6033439", "0.6008269", "0.6008269", "0.6008269", "0.6008269", "0.5842272", "0.58379084", "0.5800741", "0.5800172", "0.5800172", "0.57998216", "0.5799102", "0.5799102", "0.5799102", "0.5799102", "0.5729768", "0.5711931", "0.56996626", "0.56996626",...
0.6722633
0
A flag to determine whether or not KerberosRc4Encryption is enabled or disabled.
def kerberos_rc4_encryption(self) -> Optional[str]: return pulumi.get(self, "kerberos_rc4_encryption")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enable_pkce(self) -> bool:\n return pulumi.get(self, \"enable_pkce\")", "def is_enabled():\n return _ENABLED", "def enabled(self):\n return self.has_config(self.key_switch)", "def enable_ipv4(self) -> Optional[bool]:\n return pulumi.get(self, \"enable_ipv4\")", "def GetAuthentic...
[ "0.6148915", "0.58912194", "0.5885789", "0.5837071", "0.58159214", "0.5723478", "0.5723478", "0.5723478", "0.5723478", "0.5643859", "0.56193244", "0.5556433", "0.55563563", "0.55563563", "0.55560434", "0.555552", "0.555552", "0.555552", "0.555552", "0.5516635", "0.54843944", ...
0.70198864
0
A flag to determine whether or not LdapSigning is enabled or disabled.
def ldap_signing(self) -> Optional[str]: return pulumi.get(self, "ldap_signing")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def auth_enabled(self) -> bool:\n return pulumi.get(self, \"auth_enabled\")", "def auth_enabled(self) -> bool:\n return pulumi.get(self, \"auth_enabled\")", "def auth_enabled(self) -> bool:\n return pulumi.get(self, \"auth_enabled\")", "def auth_enabled(self) -> bool:\n return pul...
[ "0.6009497", "0.6009497", "0.6009497", "0.6009497", "0.600855", "0.5916142", "0.5916072", "0.5915604", "0.5915604", "0.5914346", "0.5914346", "0.5914346", "0.5914346", "0.5800172", "0.5781356", "0.5679429", "0.5665719", "0.5651919", "0.56039655", "0.55949444", "0.55930924", ...
0.65207255
0
A flag to determine whether or not NtlmV1 is enabled or disabled.
def ntlm_v1(self) -> Optional[str]: return pulumi.get(self, "ntlm_v1")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_enabled():\n return _ENABLED", "def isCountDownEnabled(self):\n if DPxIsMicSchedCountdown() !=0:\n enable = True\n else:\n enable = False \n return enable", "def check_enable(self):\n return self.is_enable == \"yes\"", "def get(self) -> bool:\n ...
[ "0.65513575", "0.63634974", "0.6325478", "0.62232894", "0.621426", "0.62131685", "0.6196012", "0.613805", "0.6114343", "0.6108929", "0.6108929", "0.6108929", "0.6108929", "0.6108929", "0.6108929", "0.6108929", "0.6108929", "0.6108929", "0.6108929", "0.6108929", "0.6108929", ...
0.0
-1
A flag to determine whether or not SyncOnPremPasswords is enabled or disabled.
def sync_on_prem_passwords(self) -> Optional[str]: return pulumi.get(self, "sync_on_prem_passwords")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_enable(self):\n return self.is_enable == \"yes\"", "def is_enabled():\n return _ENABLED", "def password_set(self) -> Optional[bool]:\n return pulumi.get(self, \"password_set\")", "def password_set(self) -> Optional[bool]:\n return pulumi.get(self, \"password_set\")", "def ...
[ "0.66495717", "0.6441325", "0.6401988", "0.6401988", "0.6401988", "0.6260569", "0.6257427", "0.6257427", "0.62447435", "0.61184984", "0.609771", "0.6062718", "0.6051583", "0.6044317", "0.60276985", "0.60083306", "0.59955263", "0.59955263", "0.59955263", "0.59955263", "0.59955...
0.6570658
1
A flag to determine whether or not TlsV1 is enabled or disabled.
def tls_v1(self) -> Optional[str]: return pulumi.get(self, "tls_v1")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_enabled():\n return _ENABLED", "def check_enable(self):\n return self.is_enable == \"yes\"", "def enabled(self) -> bool:\n return pulumi.get(self, \"enabled\")", "def enabled(self) -> bool:\n return pulumi.get(self, \"enabled\")", "def enabled(self) -> bool:\n return p...
[ "0.6953679", "0.671139", "0.65992147", "0.65992147", "0.65992147", "0.65992147", "0.65992147", "0.65992147", "0.65992147", "0.65992147", "0.65992147", "0.65992147", "0.65992147", "0.65992147", "0.65992147", "0.65992147", "0.65992147", "0.65992147", "0.65992147", "0.65992147", ...
0.0
-1
A flag to determine whether or not Secure LDAP is enabled or disabled.
def ldaps(self) -> Optional[str]: return pulumi.get(self, "ldaps")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def domainAuthModeEnabled(self):\n return getattr(self, '_domain_auth_mode', None)", "def ldap(self):\n\t\tresult = from_ldap(options)\n\t\treturn result and 0 or 1", "def sso_login_enabled():\n\n return str2bool(InvenTreeSetting.get_setting('LOGIN_ENABLE_SSO'))", "def is_enabled():\n return _EN...
[ "0.6351317", "0.6249688", "0.61676896", "0.60678387", "0.6036357", "0.6036357", "0.6036357", "0.6036357", "0.6035797", "0.5974422", "0.59529305", "0.59185976", "0.5915941", "0.59157723", "0.59157723", "0.59157497", "0.591496", "0.591496", "0.591496", "0.591496", "0.583444", ...
0.0
-1
The name of the virtual network that Domain Services will be deployed on. The id of the subnet that Domain Services will be deployed on. /virtualNetwork/vnetName/subnets/subnetName.
def subnet_id(self) -> Optional[str]: return pulumi.get(self, "subnet_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vnet_subnet_id(self) -> str:\n return pulumi.get(self, \"vnet_subnet_id\")", "def subnet_name(self) -> str:\n return pulumi.get(self, \"subnet_name\")", "def virtual_network_subnet_id(self) -> str:\n return pulumi.get(self, \"virtual_network_subnet_id\")", "def virtual_network_subnet...
[ "0.73209274", "0.7187613", "0.71595615", "0.71595615", "0.71595615", "0.71595615", "0.71595615", "0.7158787", "0.7158787", "0.7158653", "0.7158653", "0.7158653", "0.7158653", "0.7158653", "0.70435125", "0.70435125", "0.7043458", "0.7043458", "0.70434076", "0.70434076", "0.704...
0.65441823
50
The timestamp of resource creation (UTC).
def created_at(self) -> Optional[str]: return pulumi.get(self, "created_at")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def creation_timestamp(self) -> str:\n return pulumi.get(self, \"creation_timestamp\")", "def creation_timestamp(self) -> str:\n return pulumi.get(self, \"creation_timestamp\")", "def creation_timestamp(self) -> str:\n return pulumi.get(self, \"creation_timestamp\")", "def creation_times...
[ "0.8456499", "0.8456499", "0.8456499", "0.8456499", "0.8456499", "0.8456499", "0.8396415", "0.8396415", "0.8396415", "0.82780874", "0.821663", "0.8189799", "0.8143677", "0.8143677", "0.8143677", "0.8143677", "0.81160647", "0.8072614", "0.8044445", "0.8022312", "0.8022312", ...
0.0
-1
The type of identity that created the resource.
def created_by_type(self) -> Optional[str]: return pulumi.get(self, "created_by_type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_type(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"identity_type\")", "def identity_type(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"identity_type\")", "def get_typeid(self):\n return self.type", "def identity_type(self) -> Optional[pulumi.Input['CmkIde...
[ "0.7502523", "0.7502523", "0.7015587", "0.7010109", "0.6984494", "0.6983151", "0.6875768", "0.68718797", "0.68634343", "0.68093", "0.6762926", "0.67471176", "0.6707432", "0.66406256", "0.6635466", "0.6635392", "0.65355694", "0.65355694", "0.65355694", "0.65355694", "0.6535569...
0.6752191
19
Represent the business as a dict
def business_as_dict(self): business = {b.name: getattr(self, b.name) for b in self.__table__.columns} business['author'] = self.author.first_name + ' ' + self.author.last_name business['category_name'] = self.category_relationship.name business['location_name'] = self.location_relation...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_dict(self) -> Dict[str, Any]:\n return {\n \"id\": self.id,\n \"division\": self.division,\n \"type\": self.type,\n \"district\": self.district,\n \"township\": self.township,\n \"street_address\": self.street_address\n }", "d...
[ "0.7207439", "0.70558023", "0.6997754", "0.6988655", "0.6988655", "0.6988655", "0.6988655", "0.6988655", "0.6988655", "0.6988655", "0.6988655", "0.6988655", "0.6988655", "0.6988655", "0.6988655", "0.6988655", "0.6988655", "0.6988655", "0.6988655", "0.6988655", "0.6988655", ...
0.7717534
0
Computes BLEU score from its sufficient statistics with smoothing. Smoothing methods (citing "A Systematic Comparison of Smoothing Techniques for SentenceLevel BLEU",
def compute_bleu(correct: List[int], total: List[int], sys_len: int, ref_len: int, smooth_method: str = 'none', smooth_value=None, effective_order: bool = False, max_ngram_o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bleu_fn(hypothesis, reference):\n reference_tokens = to_tokens(reference)\n hypothesis_tokens = to_tokens(hypothesis)\n bleu_score = sentence_bleu([reference_tokens], hypothesis_tokens,\n smoothing_function=bleu_smoothing_function)\n return bleu_score", "def calculate_BLEU(...
[ "0.6885428", "0.6510981", "0.62428904", "0.6147521", "0.5995497", "0.59860045", "0.589743", "0.58869326", "0.5839248", "0.5813284", "0.5790778", "0.57709", "0.5743012", "0.5738975", "0.57207644", "0.57018155", "0.56602526", "0.5646278", "0.56444347", "0.56058913", "0.55713725...
0.6966719
0
Given a sentence, lowercases (optionally) and tokenizes it
def _preprocess_segment(self, sent: str) -> str: if self.lowercase: sent = sent.lower() return self.tokenizer(sent.rstrip())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenize(sentence):\n \n return kWORDS.findall(sentence.lower())", "def tokenize(self, sentence):\r\n raise NotImplementedError()", "def tokenize_sentence(self, sentence):\n return self.tokenizer.tokenize(sentence)", "def _tokenize_sentence_generic(sentence):\n # strip left and rig...
[ "0.75683975", "0.7502415", "0.73086524", "0.7276975", "0.72147", "0.7177312", "0.71239316", "0.7091441", "0.70485973", "0.702734", "0.7026703", "0.6955794", "0.69210076", "0.6879533", "0.68723726", "0.6863789", "0.6813177", "0.6803978", "0.6797479", "0.6785377", "0.6751382", ...
0.6356098
50
Tests for exceptions raised by class ``CutAxes``.
def test_cut_axes_exception(): from nilearn.plotting.displays import CutAxes axes = CutAxes(None, "foo", 2) assert axes.direction == "foo" assert axes.coord == 2 with pytest.raises(ValueError, match="Invalid value for direction"): axes.transform_to_2d(None, np.eye(4))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_base_axes_exceptions():\n axes = BaseAxes(None, \"foo\", 3)\n # Constructor doesn't raise for invalid direction\n assert axes.direction == \"foo\"\n assert axes.coord == 3\n with pytest.raises(\n NotImplementedError, match=\"'transform_to_2d' needs to be\"\n ):\n axes.trans...
[ "0.68753874", "0.6558933", "0.6207911", "0.61619526", "0.6156669", "0.60684645", "0.60313743", "0.58439815", "0.58404464", "0.58123076", "0.5790816", "0.5773256", "0.5770962", "0.5757186", "0.57519186", "0.57333434", "0.57307297", "0.57063794", "0.56979406", "0.5690394", "0.5...
0.7838221
0
Tests that a ValueError is raised when an invalid direction is given to function ``_get_index_from_direction``.
def test_get_index_from_direction_exception(): from nilearn.plotting.displays._axes import _get_index_from_direction with pytest.raises(ValueError, match="foo is not a valid direction."): _get_index_from_direction("foo")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ensure_validity(self, direction, valid_directions):\n if direction in valid_directions:\n return direction\n else:\n return self.__direction", "def check_valid_index(index:int,message:str):\n if index<0:\n raise Exception(message)", "def test_out_of_range_raise...
[ "0.6376015", "0.62666684", "0.62344694", "0.6122619", "0.6098975", "0.6098646", "0.60616064", "0.60134363", "0.5999463", "0.5929933", "0.59093153", "0.58419114", "0.5820189", "0.57938915", "0.57886606", "0.5771509", "0.5763421", "0.5759208", "0.57542264", "0.57432455", "0.573...
0.84312093
0
Build a network that maps state > action values.
def forward(self, state): x=F.relu(self.conv1(state)) x=F.relu(self.conv2(x)) x=F.relu(self.conv3(x)) x=x.reshape(x.size(0),-1) x=F.relu(self.dense4(x)) x=self.dense5(x) return x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _network_template(self, state):\n weights_initializer = slim.variance_scaling_initializer(\n factor=1.0 / np.sqrt(3.0), mode='FAN_IN', uniform=True)\n\n net = tf.cast(state, tf.float32)\n net = tf.subtract(net, tf.reduce_min(net))\n net = tf.div(net, tf.reduce_max(net))\n net = slim.conv2...
[ "0.63946366", "0.63886064", "0.63507026", "0.6328887", "0.6328887", "0.63190526", "0.62626165", "0.6228537", "0.6205531", "0.61980116", "0.61628056", "0.6102542", "0.6077717", "0.6031706", "0.60232824", "0.59831923", "0.59382755", "0.5907368", "0.5839515", "0.5820617", "0.582...
0.0
-1
set the speed of display
def display_difficulty(self): if self.difficulty == "easy": self.display = 3 if self.difficulty == "medium": self.display = 2 if self.difficulty == "hard": self.display = 1 return self.display
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_speed(self, speed):\r\n self.speed = speed", "def set_speed(self, speed) :\n self.speed = speed", "def set_speed(self,speed):\n if(not self.stopped):\n self.stop_spindle(self.io)\n self.spindle.set_speed(speed,self.io)", "def setSpeed(self, speed):\n pass...
[ "0.8170852", "0.7959244", "0.7851642", "0.7849911", "0.779049", "0.7784766", "0.7757029", "0.76931643", "0.768228", "0.76125056", "0.74990124", "0.74789584", "0.74487615", "0.7363801", "0.73205924", "0.72831285", "0.72560525", "0.7169555", "0.7166833", "0.71110743", "0.707105...
0.0
-1
Verify that list of pods are returned for a node_name 1. Call list_of_pods_in_a_node method via a ocp_pods instance 2. Verify len of list is not zero.
def test_list_of_pods_in_a_node(self, setup_params): pods_api_obj = setup_params["pods_api_obj"] nodes_api_obj = setup_params["nodes_api_obj"] node_name_list = [] pod_exists = False api_response = nodes_api_obj.get_worker_nodes() for item in api_response.items: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_list_nodes(self):\n list_nodes = self.run_cloud(\"-f list_nodes {}\".format(self.PROVIDER))\n self.assertIn(\"state:\", [i.strip() for i in list_nodes])\n\n self.assertIn(\"name:\", [i.strip() for i in list_nodes])", "def _pod_ls(args: dict, cluster: Cluster):\n pods = cluster.pods...
[ "0.61480254", "0.5949683", "0.59472", "0.58666307", "0.57815516", "0.5600424", "0.5548051", "0.5516188", "0.5474614", "0.5435084", "0.54234666", "0.54226893", "0.5407383", "0.53711313", "0.5370842", "0.5367459", "0.5358064", "0.5289941", "0.52177674", "0.51997215", "0.5192500...
0.8049486
0
Return a client instance.
def client(self) -> Redis: if self.__client__ is None: raise RuntimeError("Redis Plugin should be started") return self.__client__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def client(self):\n if self._client is None:\n self._client = self._client_builder()\n return self._client", "def client(self):\n if self._client is None:\n self._client = self._init_client()\n return self._client", "def client(self) -> Client:\n return ...
[ "0.8550371", "0.8477248", "0.8172433", "0.80163056", "0.79923975", "0.79900736", "0.79900736", "0.78239256", "0.77914625", "0.7767607", "0.770219", "0.76035976", "0.7599162", "0.7524196", "0.7521304", "0.7492986", "0.7423065", "0.7401552", "0.7352647", "0.7317729", "0.7316996...
0.6881106
51
Wraps a function to create a new scope for harvested values. Harvested values live in one dynamic name scope (for a particular tag), and in strict mode, values with the same name cannot be collected or injected more than once. nest(f, scope=) will take all tagged values in `f` and put them into a nested dictionary with...
def nest(f, *, scope): def wrapped(*args, **kwargs): fun = lu.wrap_init(f, kwargs) flat_args, in_tree = tree_util.tree_flatten(args) flat_fun, out_tree = api_util.flatten_fun_nokwargs(fun, in_tree) out_flat = nest_p.bind(flat_fun, *flat_args, scope=scope, mode='strict', nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nested_scope(f):\n def helper(scope, *args, **kwargs):\n tokens, scope = f(stack_scope(scope), *args, **kwargs)\n return tokens, unstack_scope(scope)\n return helper", "def scope_wrapper(func, *args, **kwargs):\n\n def scoped_func(*args, **kwargs):\n with tf.name_scope(\"deepdri...
[ "0.64840937", "0.5407449", "0.5278468", "0.51779157", "0.5145705", "0.5121821", "0.50769615", "0.50518596", "0.5000992", "0.49601725", "0.49451545", "0.4900278", "0.4866645", "0.485677", "0.4851968", "0.48021516", "0.47997758", "0.47836858", "0.47613752", "0.47484562", "0.468...
0.7002551
0
Compute softmax values for each sets of scores in x.
def softmax(inp, axis): return np.exp(inp - logsumexp(inp, axis=axis, keepdims=True))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compute_softmax(scores):\n if not scores:\n return []\n\n max_score = None\n for score in scores:\n if max_score is None or score > max_score:\n max_score = score\n\n exp_scores = []\n total_sum = 0.0\n for score in scores:\n x = math.exp(score - max_score)\n ...
[ "0.76584643", "0.76584643", "0.75839716", "0.7520069", "0.7448017", "0.7338574", "0.7290132", "0.726931", "0.72287184", "0.7208339", "0.7208301", "0.71756643", "0.71672153", "0.71650755", "0.715882", "0.7149386", "0.71357757", "0.7134225", "0.7134225", "0.71285176", "0.712851...
0.0
-1
Uses generate_df_city to create one large dataframe that encompasses all data for a particular ACS series. If a filename is given, then csv is created Argument(s)
def generate_csv( group: str, start_year: str = "2011", end_year: str = "2019", cities: list = [PALM_SPRINGS], filename: str = None, ): dfs = [] for city in cities: # generate the df for all cities in list of cities df = generate_df_city(group, start_year, end_year, str(city)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_csv_subject(subject: str, start_year: str = \"2011\", end_year: str = \"2019\", cities: list = [PALM_SPRINGS], filename = None):\n dfs = []\n for city in cities: \n df = generate_df_city_subject(subject, start_year, end_year, str(city))\n dfs.append(df)\n final_df = pd.concat(df...
[ "0.67566204", "0.6386203", "0.6294029", "0.6046536", "0.6024261", "0.6009874", "0.59872913", "0.5968227", "0.5925736", "0.58610094", "0.5842754", "0.5833591", "0.5831762", "0.5818277", "0.58135235", "0.57925797", "0.579152", "0.5787416", "0.5786982", "0.57843435", "0.5778597"...
0.70475763
0
Generates a dataframe for subject data for a given city, given the start and end year. Argument(s)
def generate_df_city_subject(subject: str, start_year: str = "2011", end_year: str = "2019", city: str = PALM_SPRINGS): dfs = [] for year in range(int(start_year), int(end_year)+1): df = year_df_subject(subject, str(year), city) dfs.append(df) final_df = pd.concat(dfs) cityName = ci...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_df_city(\n group: str,\n start_year: str = \"2011\",\n end_year: str = \"2019\",\n city: str = PALM_SPRINGS,\n):\n\n dfs = []\n\n cityName = city_from_geoid(city)\n\n # Use year_df function to get get all the dfs from the start to the end year\n for year in range(\n int(...
[ "0.74321276", "0.7355783", "0.6953969", "0.65836394", "0.6538117", "0.63144", "0.62596226", "0.62400705", "0.62144446", "0.61882526", "0.6187939", "0.6180239", "0.61501867", "0.61387223", "0.6127248", "0.61170787", "0.6094445", "0.6081148", "0.606872", "0.60606754", "0.605734...
0.8669934
0