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
A block that has a conv layer at shortcut. Arguments
def conv_block(input_tensor, kernel_size, filters, stage, block, strides=(2, 2)): filters1, filters2, filters3 = filters if K.image_data_format() == 'channels_last': _bn_axis = 3 else: _bn_axis = 1 conv_name_base = 'res' + str(stage) + bloc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conv_block(self, output_channel, filter_, activate):\n return self.add_layer(conv_block, output_channel, filter_, activate)", "def _convolution_block(self, X, filters, f, s, stage, block):\n\n\t\tconv_layer_name = 'res' + str(stage) + block + '_branch'\n\t\tbn_layer_name = 'bn' + str(stage) + block + ...
[ "0.72210574", "0.6797653", "0.67508686", "0.673468", "0.6702727", "0.66709983", "0.66706705", "0.6638113", "0.6602907", "0.6602907", "0.65983295", "0.65591985", "0.6556552", "0.6553555", "0.6531844", "0.65101147", "0.650745", "0.6479069", "0.6421294", "0.64118993", "0.6391051...
0.60525066
66
Adds the specified vertex if it is not ``None``
def addVertex(self, v: Vertex): if v is not None: self._vertices.add(v) # Possibly need to recalculate genus/core/etc. self.invalidateCaches()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_vertex(self, vertex):\n if vertex.id not in self.vertices.keys():\n self.vertices[vertex.id] = vertex", "def add_vertex(self, vertex):\n raise NotImplementedError", "def add_vertex(self, vertex):\n if vertex not in self.graph_dict:\n self.graph_dict[vertex] = ...
[ "0.836529", "0.82328236", "0.7982915", "0.79771245", "0.79250056", "0.79250056", "0.79165614", "0.7909053", "0.7903544", "0.77899086", "0.77662134", "0.77595437", "0.7747159", "0.7673777", "0.76590025", "0.7594604", "0.7508336", "0.743557", "0.7393343", "0.7391065", "0.737499...
0.79037625
8
Return a printable representation.
def __repr__(self): return f"<{self.__class__.__name__} {self.id}>"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return self.printable()", "def __repr__(self):\n return self.pretty_print(self.__dict__)", "def __str__(self):\n return repr(self)", "def __str__(self):\r\n return repr(self)", "def pprint(self):\n return pformat(repr(self))", "def __str__(self):\n ...
[ "0.8299752", "0.792861", "0.7829399", "0.77532995", "0.77172667", "0.7689122", "0.76785725", "0.76337665", "0.7627389", "0.7627389", "0.7627389", "0.7623664", "0.76234496", "0.7608004", "0.76075625", "0.75946933", "0.7589612", "0.7574469", "0.7574469", "0.7574469", "0.7574469...
0.0
-1
Convert the data held in this object to a structure (eg, struct) that represents all the data elements. This method is used to recursively convert the object into a selfdocumenting form that can easily be used for various purposes, including diffs and queries. These structures may be primitive Python types (string, int...
def to_struct(self): return {"_class": self.__class__.__name__, "value": self.__value, "string": cuni(self)}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_struct(self):\n return parsers.to_struct(self)", "def _decode_struct(\n data_type, obj, alias_validators, strict, old_style, for_msgpack):\n if obj is None and data_type.has_default():\n return data_type.get_default()\n elif not isinstance(obj, dict):\n raise bv.Validatio...
[ "0.6316124", "0.6295645", "0.6070868", "0.6023593", "0.595269", "0.59037656", "0.5879309", "0.5826357", "0.58136225", "0.5736496", "0.5640573", "0.5639013", "0.5636972", "0.5634899", "0.56296766", "0.5616727", "0.56041676", "0.5597931", "0.5595699", "0.5590274", "0.5579969", ...
0.5717914
10
Return the Dataset instances that this Dataset depends on.
def parents(self, depth=-1): yielded = {} for dataset in self._parents: if dataset not in yielded: yielded[dataset] = True yield dataset if depth != 0: for grandparent in dataset.parents(depth=depth-1): if grandp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_datasets(self): # noqa: N805\n return vars(self)", "def _datasets(self):\n return self._flat_data._datasets", "def get_datasets(self):\n return self.ds_primary, self.ds_secondary", "def get_dependencies(self):\n raise NotImplementedError()", "def dependencies(self) -> t...
[ "0.66451526", "0.6607363", "0.6549898", "0.62919945", "0.6280101", "0.6258917", "0.6251489", "0.62448144", "0.6211976", "0.62008494", "0.61079437", "0.603137", "0.6009475", "0.59593016", "0.59317666", "0.5931611", "0.58490014", "0.5810299", "0.57987446", "0.57651484", "0.5759...
0.0
-1
Return the Dataset instances that depend on this Dataset.
def children(self, depth=-1): yielded = {} for dataset in self._children: if dataset not in yielded: yielded[dataset] = True yield dataset if depth != 0: for grandchild in dataset.children(depth=depth-1): if gran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_datasets(self): # noqa: N805\n return vars(self)", "def _datasets(self):\n return self._flat_data._datasets", "def get_datasets(self):\n return self.ds_primary, self.ds_secondary", "def get_new_sourcedatasets(self):\n previous_study_version = self.get_previous_version()\n...
[ "0.6615585", "0.66012573", "0.64325094", "0.61781037", "0.6044363", "0.6018583", "0.59772867", "0.59532636", "0.5942534", "0.5904082", "0.58985287", "0.5873762", "0.58558875", "0.58546627", "0.56940323", "0.56778985", "0.56582385", "0.5632789", "0.56263715", "0.5619078", "0.5...
0.5388536
42
Generator for the roots (dependencyless parents) of this Dataset. Yields Dataset
def roots(self): yielded = {} for dataset in self._parents: if len(dataset._parents) == 0: if dataset not in yielded: yield dataset yielded[dataset] = True else: for gp in dataset.roots(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parents(self, depth=-1):\n yielded = {}\n for dataset in self._parents:\n if dataset not in yielded:\n yielded[dataset] = True\n yield dataset\n if depth != 0:\n for grandparent in dataset.parents(depth=depth-1):\n ...
[ "0.7118727", "0.68018234", "0.64309734", "0.6305572", "0.6155723", "0.61164576", "0.59659606", "0.5961221", "0.59406525", "0.59017646", "0.58955353", "0.57990605", "0.5796816", "0.5771724", "0.5757655", "0.5731422", "0.56899214", "0.5680379", "0.5668676", "0.56474674", "0.562...
0.84444505
0
An optimizer that wraps another keras.optimizers.Optimizer, using an push_pull to average gradient values before applying gradients to model weights.
def DistributedOptimizer(optimizer, name=None, device_dense='', device_sparse='', compression=Compression.none, sparse_as_dense=False): return _impl.create_distributed_optimizer(keras, optimizer, name, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def optimizer(self):\n \n # taken from https://github.com/germain-hug/Deep-RL-Keras/blob/master/DDPG/actor.py\n # I believe this is a work around to get keras to learn **given a gradient**\n # As opposed to bunch of x_train, y_trains?\n \n #Inputs\n state_pl = self....
[ "0.67919976", "0.6599956", "0.65984094", "0.62916636", "0.61856055", "0.618376", "0.6074868", "0.59989005", "0.5941164", "0.5798076", "0.5756586", "0.5742523", "0.57375485", "0.5727795", "0.567738", "0.5671659", "0.56697285", "0.56460565", "0.5615429", "0.56062436", "0.559403...
0.0
-1
Loads a saved Keras model with a BytePS DistributedOptimizer. The DistributedOptimizer will wrap the underlying optimizer used to train the saved model, so that the optimizer state (params and weights) will be picked up for retraining. By default, all optimizers in the module `keras.optimizers` will be loaded and wrapp...
def load_model(filepath, custom_optimizers=None, custom_objects=None, compression=Compression.none): def wrap_optimizer(cls): return lambda **kwargs: DistributedOptimizer(cls(**kwargs), compression=compression) optimizer_modules = {keras.optimizers.Optimizer.__module__} return _impl.load_model(keras...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_model(exe, graph, dirname):\n assert graph is not None and dirname is not None\n graph = GraphWrapper(graph) if isinstance(graph,\n paddle.static.Program) else graph\n\n SHAPES_FILE = os.path.join(dirname, _SHAPES_FILE)\n with open(SHAPES_FILE, \"r\...
[ "0.5723864", "0.5671362", "0.5574641", "0.5541199", "0.55379105", "0.54520553", "0.5443638", "0.541206", "0.541044", "0.5323913", "0.52553", "0.5233193", "0.5231263", "0.52120584", "0.5198209", "0.51612073", "0.51596934", "0.5147301", "0.51394343", "0.5139103", "0.513555", ...
0.68604606
0
Whether the endpoint should report traffic logs in addition to threat logs.
def traffic_logs(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "traffic_logs")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def traffic_logs(self) -> pulumi.Output[bool]:\n return pulumi.get(self, \"traffic_logs\")", "def isLogEnabled(self, request, context):\n context.set_code(grpc.StatusCode.UNIMPLEMENTED)\n context.set_details('Method not implemented!')\n raise NotImplementedError('Method not implemente...
[ "0.71521205", "0.65786237", "0.616391", "0.616391", "0.6147348", "0.6114273", "0.6079082", "0.589873", "0.5874118", "0.5823015", "0.5797718", "0.5797718", "0.5797718", "0.5797718", "0.5797718", "0.5797718", "0.57815355", "0.5704543", "0.56919664", "0.56847113", "0.56828105", ...
0.7054317
1
Get an existing Endpoint resource's state with the given name, id, and optional extra properties used to qualify the lookup.
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None) -> 'Endpoint': opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = EndpointArgs.__new__(EndpointArgs) __props__.__dict__["create_time"] = N...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_endpoint(self, endpoint_id):\n raise exception.NotImplemented() # pragma: no cover", "def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n arn: Optional[pulumi.Input[str]] = None,\n db_proxy_endpoint_na...
[ "0.6171609", "0.6150179", "0.6147156", "0.5954066", "0.59240264", "0.5653437", "0.55634934", "0.5530102", "0.54628325", "0.54451877", "0.54035693", "0.537047", "0.53500986", "0.53246385", "0.5321765", "0.53151363", "0.53012663", "0.5289554", "0.52794325", "0.52762103", "0.524...
0.6816635
0
Whether the endpoint should report traffic logs in addition to threat logs.
def traffic_logs(self) -> pulumi.Output[bool]: return pulumi.get(self, "traffic_logs")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def traffic_logs(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"traffic_logs\")", "def isLogEnabled(self, request, context):\n context.set_code(grpc.StatusCode.UNIMPLEMENTED)\n context.set_details('Method not implemented!')\n raise NotImplementedError('Method not i...
[ "0.7054317", "0.65786237", "0.616391", "0.616391", "0.6147348", "0.6114273", "0.6079082", "0.589873", "0.5874118", "0.5823015", "0.5797718", "0.5797718", "0.5797718", "0.5797718", "0.5797718", "0.5797718", "0.57815355", "0.5704543", "0.56919664", "0.56847113", "0.56828105", ...
0.71521205
0
The update time timestamp.
def update_time(self) -> pulumi.Output[str]: return pulumi.get(self, "update_time")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_time(self) -> str:\n return pulumi.get(self, \"update_time\")", "def update_time(self) -> str:\n return pulumi.get(self, \"update_time\")", "def update_time(self) -> str:\n return pulumi.get(self, \"update_time\")", "def update_time(self) -> str:\n return pulumi.get(sel...
[ "0.8717642", "0.8717642", "0.8717642", "0.8717642", "0.8717642", "0.8717642", "0.8717642", "0.8717642", "0.8406034", "0.82329196", "0.81739056", "0.7998141", "0.78888774", "0.7874642", "0.7874642", "0.78073496", "0.7801909", "0.77354795", "0.7700679", "0.76856", "0.76700926",...
0.82378316
15
Outputs a representation of this value.
def __repr__(self) -> str: return f"{self.group}({self._value})"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n return str(self.value)", "def __repr__(self):\n return str(self.value)", "def __repr__(self) -> str:\n return self.value", "def __repr__(self):\n return \"{}(value={})\".format(self.__class__.__name__, self.value)", "def __repr__(self):\n return \"{}...
[ "0.8352003", "0.8352003", "0.81735635", "0.80719054", "0.80719054", "0.8045232", "0.8017444", "0.8005573", "0.8005573", "0.76491857", "0.76491857", "0.76491857", "0.76491857", "0.76491857", "0.76491857", "0.76453763", "0.7533158", "0.7533158", "0.7533158", "0.75090635", "0.75...
0.0
-1
Return the string representation of the object.
def __str__(self): return self.identifier
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_string(self):\r\n return self.__str__()", "def __str__(self):\n return str(self.__dict__['_obj'])", "def as_string(self):\n return self.__repr__()", "def __str__(self):\n return str(self.serialize())", "def __str__(self):\n return str(self.obj)", "def toS...
[ "0.84336644", "0.8287483", "0.8280721", "0.82743007", "0.82623005", "0.81171477", "0.8111347", "0.80979353", "0.80945426", "0.8077431", "0.8077431", "0.80765086", "0.8052609", "0.8022008", "0.8022008", "0.8022008", "0.8022008", "0.8022008", "0.80111617", "0.80111617", "0.8011...
0.0
-1
Checks if an item is of a URL pattern
def url_type(verifield, required): return verifield is None or urlparse(verifield) is not None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def item_url(url):\n return all(map(lambda x: str.isdigit(x), str(url.strip('/').split('/')[-1])))", "def _match(cls, url, **kwargs):\n return url.scheme.startswith('http')", "def can_handle(self, url):\n return self.url_re.match(url)", "def check_url(url):\n return 'products.json' in...
[ "0.72703564", "0.7224235", "0.71769077", "0.7128691", "0.69422466", "0.68614286", "0.68524176", "0.6848075", "0.6781484", "0.6778138", "0.67689973", "0.67457193", "0.67119414", "0.6690711", "0.66857314", "0.6674339", "0.6668768", "0.6634857", "0.662948", "0.6539451", "0.64792...
0.6114729
55
Checks if an item is of a email pattern
def email_type(verifield, required): return verifield is None or parseaddr(verifield) != ('','')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def email_checker(email):\n regex = '^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$'\n if re.search(regex, email):\n return True\n else:\n return False", "def __validate_email(self,mail):\n if re.match(r\"[\\w\\W]*@+[\\w\\W]*[.]+[\\w]{2,4}\",mail):\n return True\n ...
[ "0.7003532", "0.6799028", "0.6725833", "0.6705001", "0.6698547", "0.6641337", "0.6623422", "0.66196865", "0.66003686", "0.65643835", "0.6482806", "0.6476055", "0.6445038", "0.6432777", "0.64314324", "0.6416553", "0.6391146", "0.62866163", "0.6249066", "0.6248497", "0.6225798"...
0.61982274
21
Returns if the word is in the trie. Not a prefix.
def search(self, word): end_node = self.__find_node(word) if end_node and end_node.is_word: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_trie(self, trie, word):\n current_dict = trie\n for letter in word:\n if letter in current_dict:\n current_dict = current_dict[letter]\n else:\n return False\n else:\n if '_end_' in current_dict:\n return curr...
[ "0.8245628", "0.78835136", "0.7835158", "0.7665125", "0.7613036", "0.75825727", "0.7550113", "0.75352794", "0.7513791", "0.7497823", "0.74941593", "0.748067", "0.7478101", "0.7468905", "0.7437586", "0.7403348", "0.74025714", "0.7381358", "0.73787767", "0.73591596", "0.7351345...
0.7197423
36
converts the dict into a list.
def update_dict(self, elements, kind=None): if elements is None: return None d = [] for element in elements: if "cm" not in element.keys(): element['cm'] = {} element["cm"].update({ "kind": "volume", "cloud": se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __dic2list(self,dic):\n return [(x,dic[x]) for x in dic]", "def __dic2list(self,dic):\n\treturn map(lambda x:[x,dic[x]],dic)", "def __dict_to_list(dict):\n\n max_val = 1\n for k,v in dict.items():\n if type(v) is list:\n if len(v) > 1 and (max_val > 1 and len(...
[ "0.7982222", "0.7903365", "0.7803277", "0.76532584", "0.75887024", "0.7552022", "0.7457285", "0.73670685", "0.7323957", "0.72219306", "0.71905947", "0.71905947", "0.71449333", "0.7118657", "0.7111443", "0.7042377", "0.70315665", "0.7000643", "0.69964725", "0.69919425", "0.691...
0.0
-1
A view to render the shop page using the Buns select menu
def buns_menu(request): products = Product.objects.all() sizes = Size.objects.all() forsixs = Forsix.objects.all() categories = None if request.GET: category_name = request.GET['buns'] products = products.filter(category__name=category_name) categories = Category.objects.fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shop(request):\n return render(request, 'shop/shop.html')", "def view_shoppingbag(request):\n\n return render(request, 'shoppingbag/shoppingbag.html')", "def menu(request):\n cart = cartData(request)\n cart_items = cart['cart_items']\n # order = cart['order']\n # items = cart['items']\n ...
[ "0.7366048", "0.6977805", "0.68674845", "0.67445904", "0.67124236", "0.6709254", "0.6532081", "0.6377797", "0.63430905", "0.6276193", "0.6251603", "0.6215274", "0.61420447", "0.6125816", "0.6113203", "0.61082643", "0.60942197", "0.6087505", "0.60735357", "0.6072815", "0.60519...
0.74456507
0
A view to render the shop page using the buns select menu
def box_menu(request): products = Product.objects.all() sizes = Size.objects.all() forsixs = Forsix.objects.all() categories = None if request.GET: category_name = request.GET['box'] products = products.filter(category__name=category_name) categories = Category.objects.filt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buns_menu(request):\n\n products = Product.objects.all()\n sizes = Size.objects.all()\n forsixs = Forsix.objects.all()\n categories = None\n\n if request.GET:\n category_name = request.GET['buns']\n products = products.filter(category__name=category_name)\n categories = Cate...
[ "0.746372", "0.7273777", "0.69495416", "0.68074644", "0.66905785", "0.66501516", "0.65257674", "0.6348702", "0.6248838", "0.6244905", "0.62288827", "0.61571884", "0.6130023", "0.6108955", "0.60966384", "0.60507846", "0.60360247", "0.6033353", "0.6033353", "0.6029103", "0.6022...
0.6688951
5
Not all combinations of rotation and column are valid for each tetrimino. Given a tetrimino and the width of the grid (columns), this returns a vector that can be used to mask the output of a NN such that only valid moves are considered.
def validity_mask(tetrimino, columns): validity = np.zeros((4, columns), dtype=bool) for i, t in enumerate(tetrimino_dict[tetrimino]): l = columns - t.shape[1] + 1 validity[i, :l] = 1 return validity.flatten()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isSafe(board, row, col, n):\n\n \"\"\" veriying the row on left side \"\"\"\n for i in range(col):\n if board[row][i] == 1:\n return False\n\n \"\"\" veriying upper diagonal on left side \"\"\"\n for i,j in zip(range(row,-1,-1), range(col,-1,-1)):\n if board[i][j] == 1:\n ...
[ "0.58331674", "0.5668231", "0.5661335", "0.55861026", "0.554334", "0.55406004", "0.54272735", "0.5415442", "0.5407801", "0.5407499", "0.54062366", "0.5316515", "0.52825624", "0.52780026", "0.5275149", "0.5272418", "0.5265284", "0.5263374", "0.5260766", "0.52507895", "0.524062...
0.7234302
0
A view that displays the contact us page and sends email
def contact_us(request): if request.method == 'POST': contact_form = ContactForm(request.POST) if contact_form.is_valid(): sender_name = contact_form.cleaned_data['name'] sender_email = contact_form.cleaned_data['email'] message = ('{0} has sent you a new message...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contact(request):\n\n cust_email = request.POST.get('contact_email')\n\n if request.method == 'POST':\n contact_form = {\n 'name': request.POST.get('name'),\n 'email': request.POST.get('contact_email'),\n 'contact_as': request.POST.get('contact_as'),\n '...
[ "0.81325704", "0.8113396", "0.80105615", "0.7994356", "0.7943383", "0.7929567", "0.79093057", "0.7904322", "0.7877474", "0.7844723", "0.7825651", "0.78107107", "0.7796091", "0.7788868", "0.77810305", "0.7755936", "0.7752209", "0.77249813", "0.77235824", "0.77231896", "0.77172...
0.7459223
53
A view that displays the thank you message after using contact form
def thanks(request): if 'contacted' in request.session: return render(request, 'thanks.html') else: return redirect('contact_us')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def thank_you(request):\n return render(request, 'core/thank_you.html')", "def contact(request):\n if request.method == 'POST':\n contact_form = forms.Contact(request.POST)\n if contact_form.is_valid():\n cleaned = contact_form.cleaned_data\n\n message = f\"\"\"\n ...
[ "0.7994076", "0.7957406", "0.7854757", "0.7748189", "0.7733841", "0.7729646", "0.771613", "0.7700156", "0.76966786", "0.76301986", "0.7530754", "0.75300217", "0.7523765", "0.7522629", "0.75100625", "0.75034255", "0.7449005", "0.7408476", "0.7400147", "0.7393822", "0.73772794"...
0.70745695
32
Retur True is other is equal to self
def __eq__(self, other): return self.doc_type == other.doc_type and \ self.src == other.src and \ self.name == other.name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return self is other", "def __eq__(self, other):\n return self is other", "def __eq__(self,other):\n return self is other", "def equals(self, other): # -> bool:\n ...", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(s...
[ "0.8724709", "0.8724709", "0.8688308", "0.8569744", "0.8497247", "0.8497247", "0.8491433", "0.84432137", "0.84432137", "0.8430151", "0.84112626", "0.8382956", "0.8367396", "0.8359224", "0.8359224", "0.83473694", "0.83440596", "0.8342379", "0.833597", "0.8334725", "0.8285105",...
0.0
-1
Retur True is other is not equal to self
def __ne__(self, other): return not self.__eq__(other)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return not self.__ne__(other)", "def __ne__(self, other):\n return not self == other", "def __ne__(self, other):\n return not self == other", "def __eq__(self, other):\n return super().__ne__(other)", "def __ne__(self, other):\r\n return...
[ "0.88231885", "0.87205994", "0.87205994", "0.87111944", "0.8698622", "0.8698622", "0.86944157", "0.8684612", "0.8677197", "0.86663985", "0.86663985", "0.86663985", "0.86663985", "0.86663985", "0.86663985", "0.86663985", "0.86663985", "0.86663985", "0.86663985", "0.86663985", ...
0.0
-1
The subset of `words` that appear in the dictionary of WORDS.
def known(words): return set(w for w in words if w in WORDS)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def known(self, words):\n return set(w for w in words if w in self.word_dict)", "def words_uses_only(letters):\n\treturn {w for w in word_set if uses_only(w, letters)}", "def known(words: list[str]) -> list[str]:\n return [z for z in list(set(words)) if z in self.words]", "def exclude_words...
[ "0.7781254", "0.72921777", "0.71594346", "0.6985968", "0.69435126", "0.6784432", "0.6631742", "0.6473062", "0.6459619", "0.63382703", "0.62951654", "0.62555754", "0.62326527", "0.6213972", "0.6202675", "0.6200097", "0.61439216", "0.61179656", "0.6079707", "0.6078409", "0.6056...
0.7302534
1
Transform an image to a birdview perspective using a rectangular ROI Function to make use of M = cv2.getPerspectiveTransform(rect, dst) (source, destination) final = cv2.warpPerspective(image, M, (maxWidth, maxHeight))
def rec_transform(image, pts): ord_pts = order_points(pts) # find the dimension of the rectangular created by the given points
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rectify_perspective_transform(image,rect,maxWidth=30,maxHeight=30):\n dst = np.array([\n \t[0, 0],\n \t[maxWidth - 1, 0],\n \t[maxWidth - 1, maxHeight - 1],\n \t[0, maxHeight - 1]],\n dtype = np.float32)\n\n # calculate the perspective transform matrix and warp\n M = cv2.getPerspect...
[ "0.7538627", "0.7044298", "0.7015752", "0.7003489", "0.6980967", "0.69087595", "0.69062126", "0.6898659", "0.6868961", "0.67537177", "0.664304", "0.65182924", "0.6507057", "0.6441343", "0.6407082", "0.640562", "0.63990974", "0.6375832", "0.6361028", "0.6316719", "0.6299971", ...
0.0
-1
The mesh that rays collide with.
def getMesh(self): return self.mesh
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mesh(self):\n return self._mesh", "def mesh(self):\n return self._mesh", "def mesh(self):\n return self._mesh", "def mesh(self):\n return self._mesh", "def mesh(self):\n self._ensure_mesh()\n return self._mesh", "def get_mesh(self):\n return self.mesh"...
[ "0.7389274", "0.7389274", "0.7389274", "0.7389274", "0.7128935", "0.70633936", "0.66623974", "0.64884496", "0.6442965", "0.6442965", "0.6442965", "0.6440817", "0.63556474", "0.62677044", "0.6246868", "0.62004685", "0.6172353", "0.6152075", "0.6146", "0.6140421", "0.61213046",...
0.71433216
4
Generate a uniform sample on the surface of the unit sphere in polar coordinates
def construct_initial_sample(n): sample_normal = np.random.normal(size=(n, 3)) sample_radius = np.linalg.norm(sample_normal, axis=1, keepdims=True) sample_cartesian = sample_normal / sample_radius sample_polar = cartesian_to_polar(sample_cartesian) return np.reshape(sample_polar[:, 1:3], (-1))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rndSphere():\n sph = [0,0,0]\n \n sph[2] = random.uniform(-1.0,1.0)\n z2 = math.sqrt(1.0 - sph[2]*sph[2])\n phi = (2. * math.pi) * random.random()\n sph[0] = z2 * math.cos(phi)\n sph[1] = z2 * math.sin(phi)\n \n return sph", "def surfaceIntSphere(r: float) -> float:\n ret...
[ "0.69074756", "0.6746758", "0.67251945", "0.6630447", "0.6629558", "0.6537914", "0.6527516", "0.65077084", "0.6502065", "0.6475573", "0.647456", "0.6465042", "0.6443864", "0.6403859", "0.6253421", "0.6246497", "0.623466", "0.6230411", "0.62253004", "0.6216367", "0.6215206", ...
0.62345326
17
Extracts the build name of this slave (e.g., 'chromerelease') from the leaf subdir of its build directory.
def SlaveBuildName(chrome_dir): return os.path.basename(SlaveBaseDir(chrome_dir))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def EntryToSlaveName(entry):\n name = entry.get('slavename') or entry.get('hostname')\n if 'subdir' in entry:\n return '%s#%s' % (name, entry['subdir'])\n return name", "def GetActiveSubdir():\n subdir = os.getenv('INFRA_BUILDBOT_SLAVE_ACTIVE_SUBDIR')\n if subdir is not None:\n # Empty string in envio...
[ "0.6759791", "0.62392694", "0.62284255", "0.6199802", "0.6037837", "0.5969347", "0.5933282", "0.5900234", "0.5867603", "0.5814157", "0.5781156", "0.5739644", "0.5728978", "0.5700332", "0.56736434", "0.5657998", "0.5657352", "0.56165874", "0.5609601", "0.5560912", "0.55552495"...
0.780525
0
Construct the employee's full name
def name(self): # easy enough return "{0.first} {0.last}".format(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full_name(self) -> str:\r\n\t\tname = f'{self.last_name} {self.first_name}'\r\n\t\tif self.middle_name:\r\n\t\t\tname += ' ' + self.middle_name\r\n\t\treturn name", "def full_name(self):\n \tif self.first_name and self.last_name:\n \t\treturn \"{} {}\".format(self.first_name, self.last_name)", "def _...
[ "0.8012696", "0.79403114", "0.7886619", "0.7871668", "0.78449345", "0.78375196", "0.7833813", "0.78321594", "0.7812387", "0.7812387", "0.7812387", "0.77768403", "0.77695745", "0.77671725", "0.77671504", "0.77671504", "0.7763907", "0.7760536", "0.7756357", "0.7752324", "0.7752...
0.0
-1
Given a UTF8 string, replace all instances of gaiji hexadecimal tags to appropriate UTF8 gaiji. Returns a new string with all gaiji hex tags replace with gaiji
def replace_gaiji_hex(self, utf8_string): #print re.findall("{0x[0-9a-f]+}", utf8_string) return re.sub(r'{0x([0-9a-f]+)}', self.replace_gaiji_hex_sub_helper, utf8_string)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace_gaiji_hex_sub_helper(self, match):\n return match.group(1).decode('hex')", "def xml_replace_badchars(text, start, end, replace='\\xef\\xbf\\xbd'):\n\t# sanity\n\tif not isinstance(text,str) or not isinstance(replace,str):\n\t\traise Exception(\"Inputs must be UTF-8\")\n\t\t\n\tout = []\n\ti = ...
[ "0.635464", "0.599756", "0.5969599", "0.58418024", "0.58262277", "0.5696553", "0.5635843", "0.56328005", "0.5593065", "0.5570036", "0.5560401", "0.55585647", "0.5551232", "0.551091", "0.5508557", "0.54927015", "0.54805964", "0.5475126", "0.5442678", "0.5435451", "0.54306805",...
0.8352785
0
Get project directory in environment
def project_wd(self, cwd): # pylint: disable=no-self-use return cwd
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_project_dir():\n\n return Path(settings.PROJECT_DIR)", "def get_project_dir():\n path = Path(__file__).parent.parent\n project_dir = path.parent\n return project_dir", "def _django_project_dir():\n return _interpolate(DJANGO_PROJECT_DIR)", "def get_project_root():\n return Path(__fi...
[ "0.8305408", "0.8245427", "0.78320664", "0.7809946", "0.77648133", "0.77645797", "0.7760874", "0.77461755", "0.7732836", "0.7732836", "0.76016104", "0.757342", "0.7555465", "0.7555465", "0.7555465", "0.7555465", "0.75547266", "0.74905473", "0.74588615", "0.74344873", "0.73723...
0.6794185
63
Return boxes with a confidence >= `min_score`
def filter_boxes(self, min_score, detections): mask = detections['detection_scores'] >= min_score filtered_detections = (detections['detection_boxes'][mask], detections['detection_scores'][mask], detections['detection_classes'][mask]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_boxes(self, min_score, boxes, scores, classes):\n n = len(classes)\n idxs = []\n for i in range(n):\n if scores[i] >= min_score:\n idxs.append(i)\n \n filtered_boxes = boxes[idxs, ...]\n filtered_scores = scores[idxs, ...]\n filt...
[ "0.731818", "0.7289786", "0.7286461", "0.7249656", "0.6648593", "0.6314265", "0.63126284", "0.61920637", "0.61658907", "0.6157282", "0.6156879", "0.6114503", "0.6062773", "0.5996901", "0.59632754", "0.596031", "0.5952106", "0.5949764", "0.5941988", "0.5941988", "0.59374654", ...
0.72280055
4
Field name for user email
def email(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "email")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def displayname(self):\n return self.email", "def email(self, instance):\r\n return instance.user.email", "def get_email(obj):\r\n return obj.user.email", "def get_name(self):\n return self.user.username if self.user.username else self.user.email", "def get_short_name(self):\n ...
[ "0.75084734", "0.72425836", "0.7196023", "0.7194118", "0.71543443", "0.7150408", "0.711164", "0.70954895", "0.70849544", "0.7081209", "0.7081209", "0.7081209", "0.70411533", "0.7015164", "0.69794583", "0.6974799", "0.6960668", "0.6943114", "0.6943114", "0.6943114", "0.6943114...
0.6824959
50
Field name for user's first name
def first_name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "first_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first_name(self, instance):\r\n return instance.user.first_name", "def get_short_name(self):\n return f\"{self.first_name} {self.last_name[:1]}\" if self.first_name else self.username", "def get_first_name(self) -> str:\n return self.first_name", "def first_name(self) -> str:\n ...
[ "0.8454545", "0.7980859", "0.7959569", "0.7840849", "0.78063464", "0.7752555", "0.7743792", "0.77372175", "0.77372175", "0.77372175", "0.77010024", "0.76229495", "0.76229495", "0.7615402", "0.7606572", "0.7606572", "0.7606572", "0.7606572", "0.7606572", "0.7606572", "0.760657...
0.7539554
33
Field name for user's last name
def last_name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "last_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_name(self, instance):\r\n return instance.user.last_name", "def get_last_name(self) -> str:\n return self.last_name", "def last_name(self) -> str:\n return self._last_name", "def get_last_name(self):\n return self._last_name", "def last_name(self):\n return self....
[ "0.844729", "0.79426146", "0.77676004", "0.7766133", "0.77118003", "0.77118003", "0.77118003", "0.77118003", "0.7695878", "0.7658109", "0.7647213", "0.76449347", "0.76246995", "0.76176775", "0.7593351", "0.7579495", "0.75707805", "0.7558285", "0.7513461", "0.75054723", "0.748...
0.7667844
9
Field name for user's full name. If specified, firstname and lastname mappings are ignored
def real_name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "real_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full_name(self):\n return \"{} {}\".format(self.user.first_name, self.user.last_name)", "def get_short_name(self):\n return f\"{self.first_name} {self.last_name[:1]}\" if self.first_name else self.username", "def get_full_name(self):\n full_name = f'{self.first_name} {self.last_name}' ...
[ "0.78443134", "0.781787", "0.7770195", "0.7629923", "0.7571844", "0.75702196", "0.75702196", "0.75702196", "0.7549806", "0.7529274", "0.7522749", "0.7443381", "0.7438501", "0.7438501", "0.74336886", "0.74011165", "0.7391139", "0.73873895", "0.73783374", "0.73755383", "0.73589...
0.0
-1
The hour of day (in UTC) when backup for the service is started. New backup is only started if previous backup has already completed.
def backup_hour(self) -> Optional[pulumi.Input[int]]: return pulumi.get(self, "backup_hour")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_hour_utc(self) -> int:\n return pulumi.get(self, \"start_hour_utc\")", "def start_hour_utc(self) -> Optional[int]:\n return pulumi.get(self, \"start_hour_utc\")", "def run_hour(self) -> int:\n return self.timestamp.hour", "def getHour(self):\n return _libsbml.Date_getHou...
[ "0.7206209", "0.69283855", "0.6888936", "0.66941863", "0.6621172", "0.6621172", "0.661682", "0.65878016", "0.6570941", "0.655514", "0.6421451", "0.63937783", "0.6392776", "0.63300127", "0.6313436", "0.625133", "0.62079", "0.6182158", "0.6150579", "0.5978054", "0.5978054", "...
0.7388842
0
The minute of an hour when backup for the service is started. New backup is only started if previous backup has already completed.
def backup_minute(self) -> Optional[pulumi.Input[int]]: return pulumi.get(self, "backup_minute")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_log_backup_interval_min(self):\n return self.get_log_business_hours().min", "def get_db_backup_interval_min(self):\n return self.get_db_business_hours().min", "def backup_hour(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"backup_hour\")", "def backup_hour(self...
[ "0.72332335", "0.70085806", "0.68306875", "0.68306875", "0.68228877", "0.6483668", "0.63843936", "0.6373773", "0.6362652", "0.6322491", "0.63223374", "0.63142586", "0.6309337", "0.6289204", "0.62727165", "0.62463856", "0.619893", "0.619893", "0.6151295", "0.6146106", "0.61403...
0.7622852
0
Type of the service integration. The only supported value at the moment is `read_replica`
def integration_type(self) -> pulumi.Input[str]: return pulumi.get(self, "integration_type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replication_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"replication_type\")", "def replication_type(self) -> str:\n warnings.warn(\"\"\"The type of replication this instance uses. This can be either `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only ...
[ "0.64702743", "0.63806015", "0.5908651", "0.58883727", "0.57594246", "0.57590574", "0.572472", "0.5704973", "0.5651332", "0.56502944", "0.56321305", "0.5600003", "0.5600003", "0.5600003", "0.5600003", "0.5600003", "0.5577126", "0.5577126", "0.5577126", "0.5577126", "0.5577126...
0.6258992
2
The database that the grant refers to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
def database(self) -> pulumi.Input[str]: return pulumi.get(self, "database")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def database(self):\n return self._database", "def database(self):\n return self._database", "def database(self):\n return self._database", "def database(self):\n return self._database", "def get_database(self):\n return self.database", "def database(self):\n try...
[ "0.68673784", "0.68673784", "0.68673784", "0.68673784", "0.6856496", "0.67138535", "0.66375196", "0.66375196", "0.65626246", "0.6540633", "0.649863", "0.64821696", "0.6450298", "0.64318967", "0.64318967", "0.64167845", "0.6409969", "0.6363296", "0.6330234", "0.6264368", "0.62...
0.64009106
17
The column that the grant refers to. This property cannot be changed, doing so forces recreation of the resource.
def column(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "column")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def column(self):\n return self[\"column\"]", "def column(self): \r\n\r\n return self._column", "def col(self):\n\t\treturn self.__col", "def get_id(self):\n return self._column_id", "def get_column(self):\n return self._column_number", "def columnName(self):\n return s...
[ "0.67110234", "0.6633147", "0.6447064", "0.63537884", "0.6322696", "0.63110584", "0.63064647", "0.62142694", "0.6191528", "0.61658597", "0.61629367", "0.61116916", "0.5942712", "0.59065974", "0.5830167", "0.5820019", "0.5774288", "0.5698432", "0.56848747", "0.56618863", "0.56...
0.5578427
23
Type of the service integration. The only supported value at the moment is `read_replica`
def integration_type(self) -> pulumi.Input[str]: return pulumi.get(self, "integration_type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replication_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"replication_type\")", "def replication_type(self) -> str:\n warnings.warn(\"\"\"The type of replication this instance uses. This can be either `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only ...
[ "0.64702743", "0.63806015", "0.5908651", "0.58883727", "0.57594246", "0.57590574", "0.572472", "0.5704973", "0.5651332", "0.56502944", "0.56321305", "0.5600003", "0.5600003", "0.5600003", "0.5600003", "0.5600003", "0.5577126", "0.5577126", "0.5577126", "0.5577126", "0.5577126...
0.6258992
4
Type of the service integration. The only supported value at the moment is `read_replica`
def integration_type(self) -> pulumi.Input[str]: return pulumi.get(self, "integration_type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replication_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"replication_type\")", "def replication_type(self) -> str:\n warnings.warn(\"\"\"The type of replication this instance uses. This can be either `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only ...
[ "0.64677894", "0.63785374", "0.5907311", "0.58883977", "0.57582", "0.5757238", "0.5724441", "0.5703512", "0.5648987", "0.56488955", "0.5630416", "0.559941", "0.559941", "0.559941", "0.559941", "0.559941", "0.5575713", "0.5575713", "0.5575713", "0.5575713", "0.5575713", "0.5...
0.62595415
8
Type of the service integration. The only supported value at the moment is `read_replica`
def integration_type(self) -> pulumi.Input[str]: return pulumi.get(self, "integration_type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replication_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"replication_type\")", "def replication_type(self) -> str:\n warnings.warn(\"\"\"The type of replication this instance uses. This can be either `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only ...
[ "0.6468302", "0.63794017", "0.5908132", "0.5888363", "0.5758826", "0.5758444", "0.57253873", "0.57051533", "0.5650357", "0.56494", "0.56307817", "0.56007856", "0.56007856", "0.56007856", "0.56007856", "0.56007856", "0.55765855", "0.55765855", "0.55765855", "0.55765855", "0.55...
0.6260938
7
Type of the service integration. The only supported value at the moment is `read_replica`
def integration_type(self) -> pulumi.Input[str]: return pulumi.get(self, "integration_type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replication_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"replication_type\")", "def replication_type(self) -> str:\n warnings.warn(\"\"\"The type of replication this instance uses. This can be either `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only ...
[ "0.64702743", "0.63806015", "0.5908651", "0.58883727", "0.57594246", "0.57590574", "0.572472", "0.5704973", "0.5651332", "0.56502944", "0.56321305", "0.5600003", "0.5600003", "0.5600003", "0.5600003", "0.5600003", "0.5577126", "0.5577126", "0.5577126", "0.5577126", "0.5577126...
0.6258992
6
PostgreSQL sslmode setting (currently always "require")
def sslmode(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "sslmode")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect(self):\n if self.dbapi.__name__ == \"psycopg2\":\n self.connection[\"sslmode\"] = \"require\"\n elif self.dbapi.__name__ == \"pg8000\":\n self.connection[\"ssl_context\"] = True\n super(Redshift, self).connect()", "def test_db_ssl_enable(self):\n\n # ...
[ "0.7157088", "0.65368557", "0.6163457", "0.6148198", "0.61021876", "0.6024983", "0.59921986", "0.5959396", "0.58934605", "0.5866516", "0.58544946", "0.5825476", "0.5821656", "0.5797531", "0.578593", "0.5728554", "0.5635818", "0.5634508", "0.56090206", "0.5608604", "0.56057906...
0.6639339
1
The hour of day (in UTC) when backup for the service is started. New backup is only started if previous backup has already completed.
def backup_hour(self) -> Optional[pulumi.Input[int]]: return pulumi.get(self, "backup_hour")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_hour_utc(self) -> int:\n return pulumi.get(self, \"start_hour_utc\")", "def start_hour_utc(self) -> Optional[int]:\n return pulumi.get(self, \"start_hour_utc\")", "def run_hour(self) -> int:\n return self.timestamp.hour", "def getHour(self):\n return _libsbml.Date_getHou...
[ "0.7206209", "0.69283855", "0.6888936", "0.66941863", "0.6621172", "0.6621172", "0.661682", "0.65878016", "0.6570941", "0.655514", "0.6421451", "0.63937783", "0.6392776", "0.63300127", "0.6313436", "0.625133", "0.62079", "0.6182158", "0.6150579", "0.5978054", "0.5978054", "...
0.7388842
1
The minute of an hour when backup for the service is started. New backup is only started if previous backup has already completed.
def backup_minute(self) -> Optional[pulumi.Input[int]]: return pulumi.get(self, "backup_minute")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_log_backup_interval_min(self):\n return self.get_log_business_hours().min", "def get_db_backup_interval_min(self):\n return self.get_db_business_hours().min", "def backup_hour(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"backup_hour\")", "def backup_hour(self...
[ "0.72332335", "0.70085806", "0.68306875", "0.68306875", "0.68228877", "0.6483668", "0.63843936", "0.6373773", "0.6362652", "0.6322491", "0.63223374", "0.63142586", "0.6309337", "0.6289204", "0.62727165", "0.62463856", "0.619893", "0.619893", "0.6151295", "0.6146106", "0.61403...
0.7622852
1
Name of the PG Service from which to fork (deprecated, use servicetofork_from). This has effect only when a new service is being created.
def pg_service_to_fork_from(self) -> Optional[pulumi.Input[str]]: warnings.warn("""Usage of this field is discouraged.""", DeprecationWarning) pulumi.log.warn("""pg_service_to_fork_from is deprecated: Usage of this field is discouraged.""") return pulumi.get(self, "pg_service_to_fork_from")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _k8s_service_name(self):\n return \"{}-ssh-service\".format(self.app.name)", "def service_to_fork_from(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"service_to_fork_from\")", "def service_to_fork_from(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \...
[ "0.7364162", "0.7273612", "0.7273612", "0.7273612", "0.7273612", "0.7273612", "0.71314293", "0.71314293", "0.70166796", "0.70166796", "0.70166796", "0.6992828", "0.6992828", "0.6992828", "0.6922246", "0.67568326", "0.67568326", "0.67568326", "0.6530975", "0.6404311", "0.64043...
0.7593743
0
Type of the service integration. The only supported value at the moment is `read_replica`
def integration_type(self) -> pulumi.Input[str]: return pulumi.get(self, "integration_type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replication_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"replication_type\")", "def replication_type(self) -> str:\n warnings.warn(\"\"\"The type of replication this instance uses. This can be either `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only ...
[ "0.6468302", "0.63794017", "0.5908132", "0.5888363", "0.5758826", "0.5758444", "0.57253873", "0.57051533", "0.5650357", "0.56494", "0.56307817", "0.56007856", "0.56007856", "0.56007856", "0.56007856", "0.56007856", "0.55765855", "0.55765855", "0.55765855", "0.55765855", "0.55...
0.6260938
3
AWS CloudWatch log group name.
def log_group_name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "log_group_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_group_name(self) -> str:\n ...", "def log_group_name(self) -> str:\n return jsii.get(self, \"logGroupName\")", "def log_group_name(self) -> str:\n return jsii.get(self, \"logGroupName\")", "def log_group_name(self):\n return self._get_param(CW_LOGS_CFN_PARAM_NAME)", "def...
[ "0.89839166", "0.8669", "0.8669", "0.83098954", "0.7954681", "0.7641559", "0.74817365", "0.7299937", "0.7299937", "0.71896946", "0.71417683", "0.71349907", "0.7079716", "0.7056398", "0.7046116", "0.7035467", "0.7015961", "0.7007445", "0.7007445", "0.7007445", "0.69300073", ...
0.8024796
4
Maximum number of days of logs to keep. The default value is `3`.
def index_days_max(self) -> Optional[pulumi.Input[int]]: return pulumi.get(self, "index_days_max")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_retention_days(self) -> int:\n return pulumi.get(self, \"max_retention_days\")", "def transaction_log_retention_days(self) -> int:\n return pulumi.get(self, \"transaction_log_retention_days\")", "def snapshot_retention_limit(self) -> int:\n return pulumi.get(self, \"snapshot_retent...
[ "0.7292624", "0.654909", "0.6350981", "0.60379857", "0.6024227", "0.6024227", "0.5998351", "0.59863716", "0.5984954", "0.5961038", "0.5914266", "0.5900102", "0.5889109", "0.5853611", "0.58322835", "0.58316404", "0.5812332", "0.58107394", "0.5810271", "0.57706296", "0.57016367...
0.5710047
21
Maximum number of days of logs to keep. The default value is `3`.
def index_days_max(self) -> Optional[pulumi.Input[int]]: return pulumi.get(self, "index_days_max")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_retention_days(self) -> int:\n return pulumi.get(self, \"max_retention_days\")", "def transaction_log_retention_days(self) -> int:\n return pulumi.get(self, \"transaction_log_retention_days\")", "def snapshot_retention_limit(self) -> int:\n return pulumi.get(self, \"snapshot_retent...
[ "0.7292624", "0.654909", "0.6350981", "0.60379857", "0.6024227", "0.6024227", "0.5998351", "0.59863716", "0.5984954", "0.5961038", "0.5914266", "0.5900102", "0.5889109", "0.5853611", "0.58322835", "0.58316404", "0.5812332", "0.58107394", "0.5810271", "0.57706296", "0.57016367...
0.5710047
20
Require TLS. The default value is `true`.
def tls(self) -> pulumi.Input[bool]: return pulumi.get(self, "tls")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_tls_support(self):\n return \"STARTTLS\" in self.__capabilities", "def tls_enabled(self):\n has_cert = getattr(self.args, 'ssl_certfile', None) is not None\n has_key = getattr(self.args, 'ssl_keyfile', None) is not None\n tls = getattr(self.args, 'tls', False)\n return ...
[ "0.7455166", "0.7403972", "0.73617345", "0.7337556", "0.7337556", "0.7270407", "0.7270407", "0.7140498", "0.71231717", "0.7052118", "0.7049299", "0.7049299", "0.70163184", "0.69408035", "0.6821545", "0.68008715", "0.6768219", "0.6748609", "0.67423123", "0.6697535", "0.6630823...
0.74143785
1
Elasticsearch index retention limit. The default value is `3`.
def elasticsearch_index_days_max(self) -> Optional[pulumi.Input[int]]: return pulumi.get(self, "elasticsearch_index_days_max")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_retention_days(self) -> int:\n return pulumi.get(self, \"max_retention_days\")", "def snapshot_retention_limit(self) -> int:\n return pulumi.get(self, \"snapshot_retention_limit\")", "def snapshot_retention_limit(self) -> Optional[int]:\n return pulumi.get(self, \"snapshot_retentio...
[ "0.663615", "0.6524215", "0.6083939", "0.60606384", "0.60606384", "0.6058406", "0.59182477", "0.5682335", "0.5650161", "0.5581162", "0.55739814", "0.5552783", "0.54543114", "0.5434188", "0.5414515", "0.53621775", "0.53492886", "0.53337675", "0.5268392", "0.52624655", "0.52065...
0.5351211
16
Name of the database where to store metric datapoints. Only affects PostgreSQL destinations. Defaults to 'metrics'. Note that this must be the same for all metrics integrations that write data to the same PostgreSQL service.
def database(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "database")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def database_name(self) -> str:\n return pulumi.get(self, \"database_name\")", "def database_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"database_name\")", "def getDatabaseName(self):\n raise NotImplementedError", "def database_name(self) -> pulumi.Output[str]:\n ...
[ "0.70100254", "0.6808898", "0.6779124", "0.6774804", "0.6650719", "0.6612788", "0.6586565", "0.6487585", "0.6463842", "0.6419014", "0.6363164", "0.6280065", "0.62561363", "0.62415075", "0.61819", "0.6142592", "0.61255825", "0.60446775", "0.6041112", "0.603986", "0.60290223", ...
0.61329454
17
Name of a user that can be used to read metrics. This will be used for Grafana integration (if enabled) to prevent Grafana users from making undesired changes. Only affects PostgreSQL destinations. Defaults to 'metrics_reader'. Note that this must be the same for all metrics integrations that write data to the same Pos...
def ro_username(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "ro_username")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_name(self) -> str:\n return pulumi.get(self, \"user_name\")", "def user_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"user_name\")", "def user_name(self):\n return self._user_name", "def user_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"use...
[ "0.6581949", "0.6419348", "0.64181745", "0.6384636", "0.6384636", "0.6384636", "0.6338431", "0.62750214", "0.62684417", "0.6228879", "0.6199499", "0.6180801", "0.6179826", "0.6158505", "0.6153295", "0.6105086", "0.6076584", "0.60374653", "0.60374653", "0.60374653", "0.6014945...
0.0
-1
Returns two dicts of env variables that applies to package 'name', the first for simple values A=1, and the second for multiple A=1;2;3
def env_dicts(self, package_name): ret = {} ret_multi = {} # First process the global variables for package, pairs in self._sorted_data: for name, value in pairs.items(): if package is None: if isinstance(value, list): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(env, platform_name=None):\n\n platform_name = platform_name or PLATFORM\n\n result = {}\n for variable, value in env.items():\n\n # Platform specific values\n if isinstance(value, dict):\n value = value.get(platform_name, \"\")\n\n if not value:\n conti...
[ "0.61539966", "0.6116622", "0.61106765", "0.59940517", "0.5935743", "0.5788616", "0.57723445", "0.5764228", "0.5694254", "0.56842226", "0.5677046", "0.56711894", "0.5641415", "0.5630167", "0.5625758", "0.5582608", "0.5563945", "0.5543857", "0.5516821", "0.55124146", "0.551050...
0.71128786
0
Computation of euclidean distance matrix via quadratic expansion (sum of squared differences or L2norm of differences). While this is significantly faster than the "direct expansion" or "broadcast" approach, it only works for euclidean (p=2) distances. Additionally, it has issues with numerical stability (the diagonal ...
def euclidean_dist_quadratic_expansion(x: Tensor, y: Tensor) -> Tensor: eps = torch.tensor( torch.finfo(x.dtype).eps, device=x.device, dtype=x.dtype, ) # using einsum is slightly faster than `torch.pow(x, 2).sum(-1)` xnorm = torch.einsum("...ij,...ij->...i", x, x) ynorm = to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pairwise_euclidean_distance(x, y):\n m, n = x.size(0), y.size(0)\n dist_mat = torch.pow(x, 2).sum(1, keepdim=True).expand(m, n) + \\\n torch.pow(y, 2).sum(1, keepdim=True).expand(n, m).t() \\\n - 2 * torch.matmul(x, y.t())\n # for numerical stability\n dist_mat = dist_ma...
[ "0.6734962", "0.67068505", "0.6651598", "0.6637598", "0.6620903", "0.65539765", "0.6445796", "0.64165425", "0.63905823", "0.6367536", "0.6307174", "0.630199", "0.63001907", "0.62683684", "0.6242229", "0.62277246", "0.62157", "0.6211826", "0.62038094", "0.6200381", "0.6174164"...
0.78579414
0
Wrapper for cartesian distance computation. This currently replaces the use of ``torch.cdist``, which does not handle zeros well and produces nan's in the backward pass. Additionally, ``torch.cdist`` does not return zero for distances between same vectors (see `here
def cdist(x: Tensor, y: Optional[Tensor] = None, p: int = 2) -> Tensor: if y is None: y = x # faster if p == 2: return euclidean_dist_quadratic_expansion(x, y) return cdist_direct_expansion(x, y, p=p)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cartesian_dist(self, delta_x, delta_y):\n\n return math.sqrt(delta_x * delta_x + delta_y * delta_y)", "def cartesian_distance(x,y,z):\n\treturn math.sqrt(x**2 + y**2 + z**2)", "def euclidean_dist(self):\r\n\r\n real_cat, synth_cat = self.to_cat(self.origdst, self.synthdst)\r\n\r\n real_cat...
[ "0.67604107", "0.6411776", "0.63337934", "0.6186039", "0.61502445", "0.61215097", "0.610459", "0.6088969", "0.60447985", "0.6030009", "0.601335", "0.59262496", "0.5915078", "0.5900085", "0.5862955", "0.58498514", "0.58390343", "0.5834959", "0.58141124", "0.58141124", "0.58129...
0.64900315
1
Test exception is thrown when the jar file is missing.
def test_create_canonical_classpath_with_broken_classpath(self): a = self.make_target('a/b', JvmTarget) classpath_products = ClasspathProducts(self.pants_workdir) jar_path = 'ivy/jars/org.x/lib/x-1.0.jar' # this sets the path for the artifact without actually materializing it. resolved_jar = Resol...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_raises_if_argument_junit_jar_does_not_exist(self, junit4_hooks):\n junit_path = \"/no/jar/here/\" + _junit4_runner.JUNIT_JAR\n args = empty_args(junit_path=junit_path, hamcrest_path=HAMCREST_PATH)\n\n with pytest.raises(plug.PlugError) as exc_info:\n junit4_hooks.parse_args...
[ "0.7110956", "0.673989", "0.6660955", "0.66515625", "0.65470475", "0.6524355", "0.65017956", "0.64401406", "0.639584", "0.63760686", "0.6353104", "0.6333339", "0.6288438", "0.62816596", "0.6264847", "0.6260693", "0.6259397", "0.6221644", "0.61755407", "0.61616945", "0.6154064...
0.0
-1
Draw instancelevel prediction results on an image.
def draw_instance_predictions(self, predictions): boxes = None scores = None labels=None classes = predictions.pred_classes if predictions.has("pred_classes") else None # labels = _create_text_labels(classes, scores, ["Hv", "Hp", "CLS", "BL", "PD", "PB", "CC", "LM", "D/P"]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_instance_predictions(self, predictions):\n boxes = predictions.pred_boxes if predictions.has(\"pred_boxes\") else None\n scores = predictions.scores if predictions.has(\"scores\") else None\n classes = predictions.pred_classes.tolist() if predictions.has(\"pred_classes\") else None\n ...
[ "0.76512647", "0.7182308", "0.714739", "0.69223505", "0.6772046", "0.67289597", "0.6712855", "0.66942817", "0.6643197", "0.6624603", "0.6527798", "0.6514211", "0.64832693", "0.6480422", "0.64442396", "0.64331186", "0.6387082", "0.63819295", "0.63559633", "0.6338012", "0.63163...
0.76018286
1
Create and save a user with the given email, username and password.
def _create_user(self, username, email, password, **extra_fields): if not email: raise ValueError('The email must be set') email = self.normalize_email(email) user = self.model(email=email, **extra_fields) user.set_password(password) user.save(using=self._db) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_user(self, email, password,username, **extra_fields):\r\n if not email:\r\n raise ValueError('The given email must be set')\r\n if not username:\r\n raise ValueError('The given username must be set')\r\n email = self.normalize_email(email)\r\n user = se...
[ "0.8634042", "0.8466383", "0.8425921", "0.8409726", "0.8400576", "0.8382646", "0.8366708", "0.8317512", "0.83133936", "0.83037", "0.8280722", "0.8280173", "0.82728404", "0.82455003", "0.82204694", "0.8212281", "0.8211569", "0.8206184", "0.819836", "0.8179897", "0.81796026", ...
0.8425718
3
This function will create the addons dataset
def agg_addons_report( spark, date, main_summary, search_clients_daily, events, raw_pings, **kwargs ): addons_expanded = expand_addons(main_summary) addons_expanded_day = addons_expanded.filter( "submission_date_s3 = '{}'".format(date) ).cache() main_summary_day = main_summary.filter( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _build_datasets(self):\n self._build_datasets_sis3302()\n self._build_datasets_sis3305()", "def create_dataset():\n with open(\"/root/config.json\", \"r\") as f:\n config = json.load(f)\n\n # create environmental variables\n for (key, value) in config.items():\n os.enviro...
[ "0.65095776", "0.6119689", "0.6096211", "0.60573953", "0.6015784", "0.60155815", "0.60144776", "0.60139006", "0.6010787", "0.6002185", "0.5996023", "0.59653234", "0.59580064", "0.59429955", "0.5925098", "0.59072405", "0.589095", "0.5877079", "0.58733773", "0.58470416", "0.584...
0.0
-1
Generate an initialized Variable with weight decay
def _variable_with_weight_decay(name, shape, stddev, wd): dtype = tf.float16 if FLAGS.use_fp16 else tf.float32 var = _variable_on_cpu(name, shape, tf.truncated_normal_initializer(stddev=stddev, dtype=dtype)) if wd is not None: weight_decay = tf.multiply(tf.nn.l2_loss(var), wd, name = 'weight_loss')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _variable_with_weight_decay(name, shape, stddev, wd, fresh_init = True, init_tensor=0, verbose=False):\n if verbose:\n print(\"The name of the variable: {}\".format(name))\n dtype = tf.float16 if FLAGS.use_fp16 else tf.float32\n\n\n if fresh_init:\n var = _variable_on_cpu(\n ...
[ "0.72052807", "0.71501046", "0.71052176", "0.7084515", "0.7079666", "0.70069546", "0.69495916", "0.6915206", "0.69098544", "0.6902198", "0.6902198", "0.6892419", "0.68817425", "0.68815815", "0.6753364", "0.6737027", "0.6721758", "0.66171545", "0.6602427", "0.6597197", "0.6552...
0.68993944
11
Serves the home page
def index(): return Response( "Welcome to basic-http-server, you're ready to add some methods!\n" + str(request) + "\n", mimetype='text/plain' )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home(request):\n return render_to_response('index.html')", "def home():\n\n\treturn render_template('index.html', title='Home Page',\n\t\t\t\t\t\t year=datetime.now().year)", "def home():\n\n return render_template('home_page.html')", "def home():\n return render_template(\n 'index.html...
[ "0.7946739", "0.79428905", "0.7941149", "0.7919156", "0.78961223", "0.7886436", "0.7886244", "0.7860804", "0.78601664", "0.78595334", "0.78579766", "0.785683", "0.7849007", "0.78447515", "0.78363615", "0.782883", "0.78268045", "0.7819352", "0.7819352", "0.7819352", "0.7819352...
0.0
-1
Update the contents of this periodically sent message.
def modify_data(self, message): assert message.arbitration_id == self.can_id, "You cannot modify the can identifier" self.message = message self._tx_setup()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, msg):\n pass", "def update_message(self, message: str):\n self.message = message\n self.updated_time = datetime.now()", "def update(self, rcv_time, msg):\n raise NotImplementedError", "def update(self):\n path = os.path.expanduser('~') + '/.homeassistant'\n...
[ "0.6921687", "0.63176596", "0.6310663", "0.62900877", "0.62198925", "0.61806464", "0.61729556", "0.61615855", "0.61316526", "0.61316526", "0.61196345", "0.60961586", "0.6095437", "0.6081098", "0.60548925", "0.6049502", "0.60454667", "0.6023616", "0.59892535", "0.5979834", "0....
0.0
-1
Creates an instance of this model from a dictionary
def from_dictionary(cls, dictionary): if dictionary is None: return None # Extract variables from the dictionary force_delete = dictionary.get('forceDelete') id = dictionary.get('id') include_marked_for_removal = dictionary.get('includeMarkedF...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n # Extract variables from the dictionary\n id = dictionary.get('id')\n name = dictionary.get('name')\n mtype = dictionary.get('type')\n usage_bytes = diction...
[ "0.83181584", "0.8168118", "0.8168118", "0.8118749", "0.8089047", "0.79787344", "0.7949278", "0.79231393", "0.7898951", "0.78923255", "0.788838", "0.7882321", "0.7882212", "0.7876749", "0.78585315", "0.7836853", "0.7801407", "0.7801407", "0.7801407", "0.7801407", "0.7801407",...
0.77341646
65
r"""Return location for the pretrained on local file system. This function will download from online asset zoo when asset cannot be found or has mismatch. The root directory will be created if it doesn't exist.
def get_asset_file(name, tag=None, root=os.path.join("~", ".daisykit", "assets")): if "DAISYKIT_HOME" in os.environ: root = os.path.join(os.environ["DAISYKIT_HOME"], "assets") use_tag = isinstance(tag, str) if use_tag: file_name = "{name}-{short_hash}".format(name=name, short_hash=tag) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _local_path_from_url(url):\n filename = '{}.epub'.format(hashlib.sha224(url).hexdigest())\n return os.path.join(books_settings.LOCAL_BOOKS_PATH, filename)", "def local_path(self):\n if self.repo_path:\n return self.repo_path\n tmpdir = PurePath(tempfile.gettempdir())\n r...
[ "0.63259226", "0.6142473", "0.60702413", "0.60234725", "0.598918", "0.59554297", "0.5949218", "0.5946863", "0.59147054", "0.5910308", "0.5904152", "0.5896678", "0.5896034", "0.58891404", "0.5884838", "0.5880265", "0.58517367", "0.5845208", "0.5800728", "0.5773265", "0.5767656...
0.0
-1
Makes links out of absolute URLs. Callback for sub() within filter_url(). The first parenthesis in the regexp contains the URL, the second trailing punctuation.
def filter_url_parse_full_links(match): url = html.unescape(match.group(1)) url = html.escape(url) punctuation = match.group(2) caption = filter_url_trim(url, filter_url_length) return '<a href="' + url + '">' + caption + '</a>' + punctuation
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_url(text, filter_url_length=\"200\"):\n filter_url_length = int(filter_url_length)\n\n def filter_url_parse_full_links(match):\n \"\"\"Makes links out of absolute URLs. Callback for sub()\n within filter_url(). The first parenthesis in the\n regexp contains the URL, th...
[ "0.7446799", "0.6848276", "0.6664104", "0.6533735", "0.63987166", "0.6387145", "0.63196844", "0.62601316", "0.6252126", "0.61349005", "0.6115865", "0.61158", "0.6112209", "0.6099315", "0.60650915", "0.6051467", "0.6025388", "0.60227066", "0.60118175", "0.601181", "0.6011441",...
0.7524732
0
Return evaluation configuration dict for each round. Perform five local evaluation steps on each client (i.e., use five batches) during rounds one to three, then increase to ten local evaluation steps.
def evaluate_config(rnd: int): val_steps = 5 if rnd < 4 else 10 return {"val_steps": val_steps}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_rounds(self, epochs, rounds, sim_per_round, batch_size, **kwargs):\n\n # Make sure n_obs is fixed, otherwise not working \n assert type(self.n_obs) is int,\\\n 'Round-based training currently only works with fixed n_obs. Use online learning for varibale n_obs'\n\n losses = dic...
[ "0.597388", "0.59645087", "0.59636366", "0.5826034", "0.5757812", "0.5710854", "0.55632067", "0.5559973", "0.5521339", "0.5472419", "0.5470596", "0.5445607", "0.5434621", "0.5428688", "0.5394572", "0.53918904", "0.5375522", "0.53668666", "0.53502595", "0.53441715", "0.5329183...
0.6539965
0
A simple DAG with a BranchPythonOperator that does not follow op2. NotPreviouslySkippedDep is not met.
def test_parent_skip_branch(): with create_session() as session: session.query(DagRun).delete() session.query(TaskInstance).delete() start_date = pendulum.datetime(2020, 1, 1) dag = DAG("test_parent_skip_branch_dag", schedule_interval=None, start_date=start_date) dag.create_d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_parent_not_executed():\n start_date = pendulum.datetime(2020, 1, 1)\n dag = DAG(\"test_parent_not_executed_dag\", schedule_interval=None, start_date=start_date)\n op1 = BranchPythonOperator(task_id=\"op1\", python_callable=lambda: \"op3\", dag=dag)\n op2 = DummyOperator(task_id=\"op2\", dag=da...
[ "0.7683023", "0.7139145", "0.7025163", "0.6787235", "0.67309743", "0.618663", "0.6161201", "0.57828534", "0.5749039", "0.5690064", "0.5562018", "0.5558461", "0.5430684", "0.5427649", "0.52849185", "0.52342314", "0.5204404", "0.51838094", "0.51600677", "0.51589143", "0.5112917...
0.7779219
0
Get Docker enviromental variables.
def get_env_vars(self, ts: str, env: NoneStr = None) -> Dict[str, str]: ts_tz = ts_to_tz(ts) self.set_date_valid(ts_tz.strftime('%Y-%m-%d')) self.set_time_valid(ts_tz.strftime('%H%M%S')) self.set_env(env) env_dict = { 'ENV': self.get_env(), 'TASK_TYPE': se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def docker_environment(): # type: () -> t.Dict[str, str]\n env = common_environment()\n env.update(dict((key, os.environ[key]) for key in os.environ if key.startswith('DOCKER_') or key.startswith('CONTAINER_')))\n return env", "def get_environment_vars():\n return {env: os.environ[env] for env in\n ...
[ "0.8336494", "0.74375355", "0.73682207", "0.7299637", "0.71315664", "0.7110329", "0.70580786", "0.7006348", "0.6901801", "0.6901801", "0.6901801", "0.6901801", "0.68417066", "0.6830308", "0.68244445", "0.68130064", "0.67592776", "0.6753048", "0.66530895", "0.6595406", "0.6582...
0.0
-1
Get uppercased environment name. Default is DEV.
def get_env(self) -> str: return self.env or ENV
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_environment():\n namespace = current_app.config.get('POD_NAMESPACE').lower()\n if namespace.endswith('dev'):\n return 'DEV'\n if namespace.endswith('test'):\n return 'TEST'\n if namespace.endswith('tools'):\n return 'SANDBOX'\n return ''"...
[ "0.76004255", "0.75767934", "0.7517799", "0.74239796", "0.7400016", "0.73375064", "0.72519416", "0.7070893", "0.70257646", "0.69964087", "0.68453616", "0.67605054", "0.6568267", "0.649134", "0.64628005", "0.6397688", "0.63903356", "0.63800913", "0.63749933", "0.63639766", "0....
0.7201549
7
Remove none and blank items from dictionary.
def clean_dictionary(env_dict: Dict[str, str]): return {k: v for k, v in env_dict.items() if v is not None and len(v) > 0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_empty_values(_dict):\n return {k: v for k, v in list(_dict.items()) if v is not None}", "def _strip_all(dic):\n for k, v in dic.items():\n\n if len(v) == 0:\n dic[k] = 'NULL'\n if isinstance(v, str):\n v = v.strip().replace('\\t', '').replace('\\n', '').encode...
[ "0.775304", "0.7535502", "0.75089943", "0.74499065", "0.73003364", "0.72732013", "0.7239844", "0.7203849", "0.6999833", "0.6971191", "0.68826467", "0.6835471", "0.6786636", "0.67761534", "0.6773472", "0.6772135", "0.6748969", "0.6745138", "0.6743113", "0.67258835", "0.6695545...
0.6624823
27
Emulation of off api manager products attribute. It consist of valid products that have been filtered out from api response to ensure it suits db requirements
def emulate_off_api_manager_products(cls): cls.products = OFF_API_FILTERED_PRODUCTS
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_product(self):\n\n self.importable = False\n abcde = string.ascii_uppercase[:5]\n product_infos = self.retrieve_product_infos()\n\n if product_infos['product_code'] is not None:\n try:\n Products.objects.get(\n code=product_infos['...
[ "0.67831415", "0.66021895", "0.6602137", "0.652025", "0.6358876", "0.6332686", "0.6321527", "0.6318648", "0.63178074", "0.6240892", "0.61958265", "0.61652434", "0.6125787", "0.6124357", "0.6124357", "0.6120592", "0.60905015", "0.607166", "0.60704786", "0.6048454", "0.60441875...
0.73937684
0
Get the position of X in the matrix
def GetPosition(board): for i in range(len(board.matrix)): for j in range(len(board.matrix[i])): if board.matrix[i][j]=="X": return i,j
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findX(self):\n return self.x", "def get_position(self):\n return self._find_gnx_node(self.gnx)", "def find_position(self, element):\n for row in range(self.rows):\n for col in range(self.cols):\n if self.data[row][col] == element:\n return r...
[ "0.7002737", "0.6997586", "0.69242674", "0.69242674", "0.68373466", "0.68309766", "0.68294305", "0.6758082", "0.66949236", "0.6660032", "0.6630614", "0.65938634", "0.6574828", "0.65066135", "0.6482705", "0.64803374", "0.64783335", "0.6432948", "0.6416851", "0.64150304", "0.63...
0.81424296
0
Returns the probability of infection from the homogeneous model.
def pi_hom(dose,p,eps): return((1-np.exp(-dose*p))*(1-eps))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_probability(self):\n return 0", "def probability_meet_infected_person(self, virus: Virus, n_infected: int, event_population: int) -> _VectorisedFloat:\n return sct.binom.pmf(n_infected, event_population, self.probability_random_individual(virus))", "def predict_epistemic(self, x):\n...
[ "0.637902", "0.6228094", "0.6171466", "0.6047489", "0.6028248", "0.601556", "0.58980584", "0.5856737", "0.584454", "0.5840832", "0.5834162", "0.58281595", "0.5820537", "0.5819039", "0.57901496", "0.57727236", "0.5760897", "0.5734076", "0.569462", "0.56778795", "0.56750757", ...
0.53055346
71
Returns the probability of infection from the homogeneous model.
def pi_het(dose,p,a,b,eps): small=0.001 return((1-(quad(f_beta,0,0+small,args=(dose,p,a,b),full_output=1)[0]+quad(f_beta,0+small,1-small,args=(dose,p,a,b),full_output=1)[0]+quad(f_beta,1-small,1,args=(dose,p,a,b),full_output=1)[0]))*(1-eps))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_probability(self):\n return 0", "def probability_meet_infected_person(self, virus: Virus, n_infected: int, event_population: int) -> _VectorisedFloat:\n return sct.binom.pmf(n_infected, event_population, self.probability_random_individual(virus))", "def predict_epistemic(self, x):\n...
[ "0.63793814", "0.622858", "0.6172715", "0.60472095", "0.6026994", "0.6016497", "0.58966345", "0.58579034", "0.58454156", "0.58399844", "0.58341223", "0.5828931", "0.58223045", "0.5820874", "0.5790977", "0.57738096", "0.5761911", "0.5735048", "0.5695193", "0.5679459", "0.56742...
0.0
-1
Cumulative Density Function (cdf) of a Uniform distribution between 0 and tmax).
def ucdf(t,tmax): return t/tmax if t<tmax else 1.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cdf(self, value):\n cdf = torch.where(\n value < 1., \n self.base.cdf(value), \n torch.ones_like(value) # all of the mass\n )\n cdf = torch.where(value < 0., torch.zeros_like(cdf), cdf)\n return cdf", "def cdf(self, value):\n retu...
[ "0.73129076", "0.7255101", "0.7186487", "0.7174935", "0.7167722", "0.70780605", "0.70579857", "0.7046187", "0.70306903", "0.70285314", "0.7005609", "0.6893192", "0.68187696", "0.67317396", "0.6726005", "0.6726005", "0.66952777", "0.669111", "0.6620818", "0.6595278", "0.658365...
0.8345838
0
Probability Density Function (cdf) of a Uniform distribution between 0 and tmax).
def updf(t,tmax): return 1./tmax if t<tmax else 0.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ucdf(t,tmax):\n return t/tmax if t<tmax else 1.", "def uniform_cdf(x):\n if x <0: return 0 #uniform random is never less than 0\n elif x < 1: return x #e.g. P(x <= 0.4) = 0.4\n else: return 1 #uniform random is always less than 1", "def _normal_distribution_cdf(x, ...
[ "0.8390286", "0.7352716", "0.72865623", "0.72498304", "0.7218356", "0.7189219", "0.7145334", "0.70600545", "0.69173145", "0.6876992", "0.6859961", "0.6730696", "0.6725306", "0.66429776", "0.6621934", "0.6588559", "0.6552947", "0.6549228", "0.6497151", "0.6440601", "0.6352819"...
0.5914779
37
Probability Density Function (cdf) of a mixture of a timeindependent Uniform distribution [0,1/k] and a Gamma distribution (c,tau).
def kpdf(t,c,tau,k): return k*(1-st.gamma.cdf(t,c,loc=0,scale=tau))+(1-k*t)*st.gamma.pdf(t,c,loc=0,scale=tau)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gpdfInt(t1,t2,c,tau):\n return st.gamma.cdf(t2,c,loc=0,scale=tau)-st.gamma.cdf(t1,c,loc=0,scale=tau)", "def make_gamma(dc, C):\n Gamma = sp.zeros((3, 3))\n Gamma[0, 0] = dc[0] ** 2 * C[0, 0] + dc[1] ** 2 * C[5, 5] + dc[2] ** 2 * C[4, 4]\n Gamma[0, 0] += 2 * dc[1] * dc[2] * C[4, 5] + 2 * dc[2] * d...
[ "0.7141099", "0.6488965", "0.64289594", "0.6293411", "0.62221956", "0.6175399", "0.6161322", "0.6111622", "0.60960954", "0.60786474", "0.6075022", "0.6068992", "0.6050025", "0.6026712", "0.6023302", "0.6009027", "0.59919477", "0.59845954", "0.5981555", "0.5962784", "0.5936938...
0.7653793
0
The Highest Posterior Density (credible) interval of data at level level.
def hpd(data, level=0.95) : d = list(data) d.sort() nData = len(data) nIn = int(round(level * nData)) i = 0 r = d[i+nIn-1] - d[i] for k in range(len(d) - (nIn - 1)) : rk = d[k+nIn-1] - d[k] if rk < r : r = rk i = k assert 0 <= i <= i+nIn-1 < len(d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_max_density(self):\n max_density = str(self.density.index(min(self.density)) + 1)\n print(max_density)\n return max_density", "def get_low_high(a):\n\n return stats.pareto.cdf((10000,1000000),a)", "def last_high(self):\n return self.data.last('1D').high.iat[0]", "def fd...
[ "0.6219594", "0.6156212", "0.6064257", "0.6039184", "0.58526087", "0.58424616", "0.57718205", "0.5731661", "0.567162", "0.5660792", "0.56583244", "0.564584", "0.554909", "0.5534542", "0.5532671", "0.55323666", "0.5527317", "0.5527317", "0.5527317", "0.5527317", "0.5527317", ...
0.5489129
25
Returns the median in between the 95% HPD interval of the array.
def confint(arr): res=[[],[],[]] #r=hpd(arr) r=(sap(arr,2.5),sap(arr,97.5)) res[0]=r[0] res[1]=arr.mean(0) res[2]=r[1] return np.array(res)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def median(array):\n sorted = [x for x in array]\n sorted.sort()\n middle = len(sorted)/2 #Gets the middle element, if present\n if len(sorted) % 2 == 0: #Even, so need to average together the middle two values\n return float((sorted[middle]+sorted[middle-1]))/2\n else:\n return sorted...
[ "0.75379425", "0.7272167", "0.7263493", "0.7255109", "0.72529024", "0.72291523", "0.72034836", "0.7193159", "0.71600926", "0.7090051", "0.704163", "0.70387167", "0.702505", "0.70006466", "0.7000414", "0.6960538", "0.6947567", "0.6912141", "0.68521166", "0.6850747", "0.6807697...
0.0
-1
The Highest Posterior Density (credible) interval of data at level level.
def hpd(data, level=0.95) : d = list(data) d.sort() nData = len(data) nIn = int(round(level * nData)) i = 0 r = d[i+nIn-1] - d[i] for k in range(len(d) - (nIn - 1)) : rk = d[k+nIn-1] - d[k] if rk < r : ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_max_density(self):\n max_density = str(self.density.index(min(self.density)) + 1)\n print(max_density)\n return max_density", "def get_low_high(a):\n\n return stats.pareto.cdf((10000,1000000),a)", "def last_high(self):\n return self.data.last('1D').high.iat[0]", "def fd...
[ "0.6217027", "0.61550206", "0.6062507", "0.60367423", "0.5850257", "0.58413607", "0.57725", "0.5730007", "0.5671265", "0.5660404", "0.56565076", "0.56444967", "0.55484474", "0.55328065", "0.55326474", "0.5530003", "0.5525697", "0.5525697", "0.5525697", "0.5525697", "0.5525697...
0.5473721
26
Return True if both URL's belong to same domain
def same_domain(url1, url2): return urlparse.urlparse(url1).netloc == urlparse.urlparse(url2).netloc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_same_domain(url1, url2):\r\n url1 = urlparse(url1)\r\n url2 = urlparse(url2)\r\n return url1.netloc == url2.netloc", "def is_same_domain(url1, url2):\n return tldextract.extract(url1).domain == tldextract.extract(url2).domain", "def is_same_domain(url1, url2):\n url1 = urlparse(url1)\n ...
[ "0.8386386", "0.83714986", "0.8348104", "0.80530375", "0.7595328", "0.7548599", "0.7303652", "0.7283177", "0.72320485", "0.69416344", "0.68359864", "0.68300515", "0.6584193", "0.6579227", "0.6539408", "0.6538929", "0.6506473", "0.6500966", "0.6486522", "0.6437221", "0.641506"...
0.8476882
0
There are len(parent) vertices. The root is always at vertex 0. parent[j] is the parent of vertex j. parent[0] is ignored.
def __init__(self, parent): self.parent = parent[:] self.size = len(self.parent) self.children = {} self.data = {} for i in xrange(self.size): self.children[i] = [] self.nchildren = [1] * self.size # iya for i in xrange(1, self.size): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_root(self):\r\n self.find_parents()\r\n index = 0\r\n while len(self.vertices[index].parents)>0:\r\n index = self.vertices[index].parents[0]\r\n return index", "def generate_parent_space(self):\n\n parent_node = self.node+'_ZERO'\n parent_node = mc.ls...
[ "0.6713574", "0.645158", "0.6429755", "0.61721885", "0.6114134", "0.6093453", "0.6071002", "0.6069297", "0.60667944", "0.60667944", "0.59958315", "0.5977648", "0.5972592", "0.59379023", "0.5936338", "0.59175384", "0.59118533", "0.5908496", "0.5878821", "0.58667713", "0.584714...
0.58085936
22
Gets a value at an index. Vectorized.
def get(self, index: Union[int, np.ndarray]) -> Union[float, np.ndarray]: tree_index = self.capacity + index return self._tree[tree_index]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, index):\n return self._value_at(index)", "def __getitem__(self, index):\n return self._value_at(index)", "def get_value_by_index(self, index):\n return self['value'][index]", "def get(self, index):\n\n return self.values[index]", "def __getitem__(self, inde...
[ "0.7764518", "0.7764518", "0.77337456", "0.75785655", "0.750067", "0.73143625", "0.72458494", "0.7205571", "0.7179878", "0.71663296", "0.71062034", "0.7057174", "0.70210207", "0.697269", "0.6964194", "0.68947935", "0.68947935", "0.6890369", "0.68804115", "0.6877181", "0.68563...
0.6525849
67
generate random string to avoid name conflicts for the modified images
def random_string(len = 5): return ''.join(random.choice(string.digits) for i in range(len))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_random_file_name():\n\n def random_file_name_factory():\n length = random.randint(10, 15)\n chars = string.ascii_letters + string.digits + \"-_\"\n return f\"{''.join(random.choice(chars) for _ in range(length))}.jpg\"\n\n return random_file_name_factory", "def filename_gene...
[ "0.7829612", "0.742512", "0.7353707", "0.7203188", "0.7194872", "0.7192667", "0.7149722", "0.7145379", "0.713603", "0.71064025", "0.70761114", "0.70745766", "0.7069032", "0.7055481", "0.7054837", "0.7034252", "0.70227236", "0.6965159", "0.69060934", "0.6899044", "0.6879605", ...
0.0
-1
returns wrapped version of array, with the first element in each rwo appended to the end of the same rows. For polar plotting or angles/orientations
def wrap(array): assert array.ndim == 2, ('works on 2D arrays only; expecting ' 'self.cond_tuning, which should be 2D') return np.column_stack((array, array[..., 0]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strip_array_wrappers(arry):\n curr = arry\n if curr.ndim == 0:\n if isinstance(curr[...], np.ndarray):\n return strip_array_wrappers(curr[...])\n return curr\n\n # there is a possibility for infinite looping\n # e.g. [np.ndarray, str, dict] would stay object array\n # im...
[ "0.6279273", "0.5694872", "0.56498224", "0.56361955", "0.56182384", "0.5536571", "0.5480168", "0.5469622", "0.54538834", "0.5438826", "0.5423384", "0.5353946", "0.53471434", "0.533088", "0.52868545", "0.5267953", "0.526645", "0.52563536", "0.5234905", "0.52171737", "0.5216397...
0.64518386
0
Sets the seed for this env's random number generator(s).
def seed(self, seed=None): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_seed(cls, seed: Any) -> None:\n cls.rand = Random(seed)", "def set_seed(self, seed: int):\n self.__sim.seed(seed)", "def set_seed(self, seed):\n self.seed = seed", "def seed(self, seed=None):\n if seed is not None:\n self._rng.seed(seed)", "def set_random_seed...
[ "0.837315", "0.8116574", "0.80862194", "0.8081547", "0.80698186", "0.80698186", "0.8035685", "0.79711807", "0.7949761", "0.79067385", "0.79045385", "0.78622633", "0.7830874", "0.78281605", "0.78175986", "0.77908194", "0.7770842", "0.7770138", "0.77453065", "0.7741128", "0.772...
0.6942953
92
Uniformly randomly sample a random element of this space.
def sample(self, seed=None): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample(self):\n u = np.asarray(np.random.uniform())\n return self.invert(u)", "def sample(self):\n return gc.rand_state.uniform(low=self.bounds[0], high=self.bounds[1])", "def uniform_sample(x):\n return np.random.choice(x)", "def sample_one(self):\n # x = self.mean + self....
[ "0.7637743", "0.7470502", "0.7417337", "0.73104256", "0.7027301", "0.69600207", "0.6903716", "0.6827143", "0.6809805", "0.68025815", "0.6765496", "0.6691489", "0.66317177", "0.66290855", "0.65781707", "0.65712464", "0.6545701", "0.6541364", "0.652493", "0.6494487", "0.6455562...
0.6171192
50
Return the colors as a dict, pass False to return the colors as empty strings.
def get_colors(self, use=True): colors = { "BLACK": "\033[0;30m", "DARK_GRAY": "\033[1;30m", "RED": "\033[0;31m", "LIGHT_RED": "\033[1;31m", "GREEN": "\033[0;32m", "LIGHT_GREEN": "\033[1;32m", "BLUE": "\033[0;34m", "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getColorDict():\n scribus.statusMessage(\"Reading existing colors...\")\n colornames = scribus.getColorNames()\n scribus.progressTotal(len(colornames))\n i=0\n colordict={}\n for name in colornames:\n colordict[name]=None\n i=i+1\n scribus.progressSet(i)\n return color...
[ "0.7529635", "0.7514521", "0.72039735", "0.72039735", "0.70634633", "0.7024431", "0.6813183", "0.6764268", "0.6710563", "0.66823304", "0.6561415", "0.6544837", "0.651633", "0.6508912", "0.64820737", "0.64574164", "0.643868", "0.64377534", "0.64280605", "0.6386101", "0.636466"...
0.6754095
8
returns the z for which P(Z >= z) = probability
def normal_lower_bound(probability, mu=0, sigma=1): return inverse_normal_cdf(1 - probability, mu, sigma)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zprob(z):\r\n Z_MAX = 6.0 # maximum meaningful z-value\r\n if z == 0.0:\r\n x = 0.0\r\n else:\r\n y = 0.5 * math.fabs(z)\r\n if y >= (Z_MAX*0.5):\r\n x = 1.0\r\n elif (y < 1.0):\r\n w = y*y\r\n x = ((((((((0.000124818987 * w\r\n ...
[ "0.79242647", "0.7624886", "0.7550281", "0.7404978", "0.6840768", "0.6698161", "0.6459714", "0.64431596", "0.6393817", "0.63831145", "0.6313411", "0.6313405", "0.6290237", "0.6254836", "0.62211996", "0.6180083", "0.61527425", "0.6145629", "0.60834765", "0.6082641", "0.6079866...
0.0
-1
Calc the point 'b' where line crosses the Y axis
def calculate_y_axis_intersect(p, m): return p[1] - (m * p[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_line_to(self, point):\n\n b = ((self.x - point.x)*point.y - (self.y - point.y)*point.x)/(self.x - point.x)\n\n a = (self.y - point.y)/(self.x - point.x)\n\n return a, b", "def get_line_to(self, provided_point):\n\n \"\"\"Calculate slope\"\"\"\n a = (provided_point.y - s...
[ "0.6913221", "0.67790705", "0.6602316", "0.6504766", "0.6361854", "0.63299304", "0.6321518", "0.6268088", "0.623139", "0.6223527", "0.6216309", "0.62125814", "0.6212377", "0.6155648", "0.6145618", "0.6125405", "0.6099838", "0.6055512", "0.6041457", "0.5979832", "0.59728837", ...
0.0
-1
Converts normalization params from nested dicts to pandas DataFrame.
def _convert_normalization_params( z_score_dict_dict, frequency_dict_dict=None, min_percentile_level=None, max_percentile_level=None): normalization_dict = {} for this_key in z_score_dict_dict: this_inner_dict = z_score_dict_dict[this_key] this_standard_deviation = _get_standar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_dict_to_df(predictions: Dict[str, Dict[str, Union[List[Any], torch.Tensor, np.array]]]) ->pd.DataFrame:\n output = {}\n for of_name, preds_dict in predictions.items():\n for key, value in preds_dict.items():\n output_key = f'{of_name}_{key}'\n if not isinstance(value,...
[ "0.6753304", "0.67307097", "0.6469942", "0.63721955", "0.63175637", "0.6263311", "0.62449974", "0.61602986", "0.6148902", "0.6083451", "0.6022574", "0.6021604", "0.5947283", "0.59276456", "0.59066916", "0.58417785", "0.58347446", "0.58317554", "0.57965523", "0.5763218", "0.57...
0.6549517
2
Huber regression loss Variant of the SquaredLoss that is robust to outliers (quadratic near zero, linear in for large errors).
def huber(y_true, y_pred, epsilon=0.1): abs_r = T.abs_(y_pred - y_true) loss = 0.5 * abs_r ** 2 idx = abs_r <= epsilon loss[idx] = epsilon * abs_r[idx] - 0.5 * epsilon ** 2 return loss
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def huber_loss(y, q_value):\n error = K.abs(y - q_value)\n quadratic_part = K.clip(error, 0.0, 1.0)\n linear_part = error - quadratic_part\n loss = K.mean(0.5 * K.square(quadratic_part) + linear_part)\n return loss", "def get_loss(self, X, Y):\n return tfe.huber_loss(1.0, X - Y)", "def hu...
[ "0.7226849", "0.6722067", "0.6629518", "0.6532827", "0.62723136", "0.6252489", "0.6161152", "0.6161141", "0.61475646", "0.60539234", "0.6047933", "0.59826535", "0.5982444", "0.59808606", "0.5974761", "0.59656566", "0.5952505", "0.59520704", "0.59117746", "0.5897803", "0.58967...
0.5904634
19