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 the list of items currently present in this item.
def getItems(self): return self.getCutPlanes() + self.getIsosurfaces()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_items(self):\n return self.item_list", "def get_items(self) -> list:\r\n return self._items", "def items(self) -> List[Item]:\n return self._items", "def get_all_items(self):\n return self.api.state['items']", "def items(self):\n return [x.item for x in self]", ...
[ "0.8302771", "0.82145596", "0.80660933", "0.7957701", "0.79011357", "0.7892576", "0.7880532", "0.7875717", "0.7802759", "0.7696309", "0.7644806", "0.762694", "0.75896615", "0.7539122", "0.735725", "0.7353106", "0.7332338", "0.732954", "0.7262226", "0.7146134", "0.7119999", ...
0.0
-1
Return 3D dataset. This method does not cache data converted to a specific mode, it computes it for each request.
def getData(self, copy=True, mode=None): if mode is None: return super(ComplexField3D, self).getData(copy=copy) else: return self._convertComplexData(self._data, mode)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def D3(self, *args):\n return _Adaptor3d.Adaptor3d_Surface_D3(self, *args)", "def get_3d_train(self, jnts=14):\n\n to_select, to_sort = dataset_indices(self.dataset_name, jnts)\n\n return self._data_train['3d'][:, to_select, :][:, to_sort, :]", "def get_dataset(self, cid, type=\"train\"):\...
[ "0.60187584", "0.59878784", "0.58777374", "0.58265644", "0.58206046", "0.5816656", "0.5816164", "0.57970816", "0.57919204", "0.5772738", "0.57650393", "0.57250017", "0.5724938", "0.5707195", "0.5686548", "0.5647479", "0.5564669", "0.55568475", "0.5537837", "0.5516145", "0.550...
0.6331602
0
Attach the view to the GUI.
def attach(self, gui): super(TraceView, self).attach(gui) self.actions.add(self.toggle_show_labels, checkable=True, checked=self.do_show_labels) self.actions.add( self.toggle_highlighted_spikes, checkable=True, checked=self.show_all_spikes) self.actions.add(self.toggle_auto_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_show_view(self):\n self.setup()", "def on_show_view(self):\n self.setup()", "def on_show_view(self):\n self.setup()", "def _add_view(self, window, view):\r\n\r\n # If no 'relative_to' is specified then the view is positioned\r\n # relative to the editor area.\r\n ...
[ "0.66884124", "0.66884124", "0.66884124", "0.66009265", "0.6581134", "0.6503647", "0.6470148", "0.6323154", "0.62344205", "0.6183854", "0.6170608", "0.6120538", "0.60880315", "0.60534596", "0.604596", "0.6022283", "0.5969684", "0.5946267", "0.5931756", "0.58913046", "0.589079...
0.6533588
5
Interval as `(tmin, tmax)`.
def interval(self): return self._interval
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_tmin_tmax(inst, tmin, tmax):\n _check_type(tmin, (None, \"numeric\"), item_name=\"tmin\")\n _check_type(tmax, (None, \"numeric\"), item_name=\"tmax\")\n\n # check positiveness for tmin, tmax\n for name, arg in ((\"tmin\", tmin), (\"tmax\", tmax)):\n if arg is None:\n contin...
[ "0.68151754", "0.66623974", "0.6629554", "0.6584883", "0.65043294", "0.6474935", "0.6412259", "0.6410299", "0.63806736", "0.63406235", "0.62529576", "0.6237908", "0.62276185", "0.6169634", "0.6162228", "0.6150554", "0.6136628", "0.6109361", "0.61021554", "0.608784", "0.604031...
0.0
-1
Attach the view to the GUI.
def attach(self, gui): ManualClusteringView.attach(self, gui) # ScalingMixin.attach(self, gui) # self.actions.add(self.toggle_show_labels, checkable=True, checked=self.do_show_labels) # self.actions.add(self.toggle_auto_scale, checkable=True, checked=self.auto_scale) self.action...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_show_view(self):\n self.setup()", "def on_show_view(self):\n self.setup()", "def on_show_view(self):\n self.setup()", "def _add_view(self, window, view):\r\n\r\n # If no 'relative_to' is specified then the view is positioned\r\n # relative to the editor area.\r\n ...
[ "0.66884124", "0.66884124", "0.66884124", "0.66009265", "0.6533588", "0.6503647", "0.6470148", "0.6323154", "0.62344205", "0.6183854", "0.6170608", "0.6120538", "0.60880315", "0.60534596", "0.604596", "0.6022283", "0.5969684", "0.5946267", "0.5931756", "0.58913046", "0.589079...
0.6581134
4
Returns a logger with the given name
def get_logger(name: str): logger = logging.getLogger(name) for handler in HANDLERS: logger.addHandler(handler) return logger
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_logger(name):\n # type: (str) -> Logger\n return logging.getLogger(name)", "def get_logger(name):\n return logging.getLogger(name)", "def get_logger(name: str) -> logging.Logger:\n \n return logging.getLogger(name)", "def get_logger(name: str) -> logging.Logger:\n try:\n...
[ "0.86943036", "0.86648834", "0.86127335", "0.83303255", "0.8310802", "0.8274421", "0.82201195", "0.82107776", "0.81484", "0.81371915", "0.81099725", "0.80877364", "0.80632704", "0.7964971", "0.79618955", "0.7960622", "0.79571754", "0.7941737", "0.79340976", "0.7931048", "0.79...
0.79965186
13
Return a logger with a default ColoredFormatter.
def setup_logger(): formatter = ColoredFormatter( ( '%(log_color)s%(levelname)-5s%(reset)s ' '%(yellow)s[%(asctime)s]%(reset)s' '%(green)s %(name)s %(purple)s %(filename)s %(purple)s %(funcName)s %(purple)s:%(lineno)d%(reset)s ' '%(bold_blue)s%(message)s%(rese...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_logger():\n log = logging.getLogger() # root logger\n log.setLevel(logging.DEBUG)\n format_str = '%(asctime)s - %(levelname)-8s - %(message)s'\n date_format = '%Y-%m-%d %H:%M:%S'\n if os.isatty(2):\n cformat = '%(log_color)s' + format_str\n colors = {'DEBUG': 'reset',\n ...
[ "0.6996591", "0.69907147", "0.6911573", "0.682854", "0.65775317", "0.65120155", "0.6396354", "0.6385912", "0.6341703", "0.6268824", "0.61986893", "0.6196991", "0.618999", "0.61819875", "0.6148457", "0.6129842", "0.6128831", "0.6113148", "0.61027133", "0.60929334", "0.60799354...
0.67095196
4
Returns ndarrays or Tensors of all data in the current split.
def get_data(self,split=None,numpy=True): if split is not None: split_ = self.split_ self.set_split(split) dataloader = DataLoader(self,batch_size=len(self),shuffle=False, drop_last=False) for i,data_item...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_data(self) -> Optional[np.ndarray]:\n if self._data_store is None:\n return None\n return self._data_store[:self._count, :]", "def full_batch(self):\n return self.X_data, self.Y_data", "def getNdArray(self):\n futures = self.client.map(_call_getNdArray, self.vecDask, pure=False...
[ "0.62569696", "0.618584", "0.6073904", "0.6042331", "0.5926986", "0.5832924", "0.5821185", "0.5761303", "0.5756968", "0.57559574", "0.57297504", "0.57242715", "0.57101953", "0.570451", "0.5688236", "0.56806684", "0.56590205", "0.564544", "0.56339717", "0.55949557", "0.5587822...
0.5634289
18
Partitions the full data into a list of ndarrays/Tensors.
def get_n_folds(self,split=None,N=5,numpy=True,perm=None): data = self.get_data(split,numpy) X = data['x'] y = data['y'] size = len(y) if perm is None: perm = np.random.permutation(size) elif len(perm) != size: raise Exc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _batchify(data: nd.NDArray, batch_size):\n # Work out how cleanly we can divide the dataset into bsz parts.\n nbatch = len(data) // batch_size\n # Trim off any extra elements that wouldn't cleanly fit (remainders).\n data = data[0: nbatch * batch_size]\n # Evenly divide the d...
[ "0.6259908", "0.62205553", "0.60901254", "0.6081688", "0.6013226", "0.6012804", "0.600478", "0.5999807", "0.59407836", "0.5916167", "0.59141505", "0.5829531", "0.5814003", "0.5805772", "0.58050174", "0.5766101", "0.5750351", "0.5743768", "0.5734869", "0.57283336", "0.57187784...
0.0
-1
Converts a string of text into a numerical vector of features based on the word embedding LTM.
def vectorize(self,text): lv_active = set() words = word_tokenize(text) for word in words: if word in self.tree: ancestors = self.tree.word_ancestors(word) lv_active.update(ancestors) return self.nl.isin(lv_ac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_vector(text, model, idf, is_tokenized=False):\n if not is_tokenized: text= text.split() # splits the text by space and returns a list of words\n vec = np.zeros(300) # creates an empty vector of 300 dimensions\n for word in text: # iterates over the sentence\n if (word in model) & (word in id...
[ "0.70021975", "0.6557391", "0.65419817", "0.65404963", "0.6515521", "0.64831823", "0.6474055", "0.64408255", "0.64127994", "0.6378021", "0.63599265", "0.63383466", "0.6331677", "0.6309186", "0.63056415", "0.6245646", "0.6237467", "0.62303", "0.62136185", "0.61973566", "0.6189...
0.0
-1
Creates a Tensor for use as an Embedding initialization from the source vocabulary and predefined word embeddings.
def get_pretrained_embeddings(source_vocab,embed_df): num_tokens = len(source_vocab) embedding_dim = embed_df.shape[1] weights = np.zeros((num_tokens,embedding_dim),dtype=np.float32) for idx in range(num_tokens): token = source_vocab.lookup_index(idx) if token in embed_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_embedding_layer(inputs_, vocab_size, embed_size):\n embedding = tf.Variable(tf.random_uniform((vocab_size, embed_size), -1, 1))\n embed = tf.nn.embedding_lookup(embedding, inputs_)\n \n return embed", "def init_word_embed(config):\n embedding_mat_val = np.load(config.wordembed_params)\n ...
[ "0.74340177", "0.7306449", "0.72952855", "0.70558393", "0.7044115", "0.68895066", "0.67812735", "0.6750932", "0.67492104", "0.67476356", "0.67427427", "0.6717155", "0.6711093", "0.6680487", "0.6676144", "0.6672202", "0.6647878", "0.6621589", "0.66202843", "0.65980107", "0.658...
0.66311824
17
Override fields on ``self.account``.
def override_account_fields(self, settled_cash=not_overridden, accrued_interest=not_overridden, buying_power=not_overridden, equity_with_loan=not_overridden, to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account(self, account):\n\n self._account = account", "def account(self, account):\n\n self._account = account", "def account(self, account):\n\n self._account = account", "def account(self, account):\n\n self._account = account", "def patch(self, account=None, user=None, ac...
[ "0.6413226", "0.6413226", "0.6413226", "0.6413226", "0.6343206", "0.6329128", "0.6322581", "0.63135093", "0.61441493", "0.60770935", "0.60361296", "0.6022793", "0.60135746", "0.60068023", "0.59981", "0.59467715", "0.58997744", "0.5875439", "0.5858766", "0.5787134", "0.5765871...
0.67399603
0
The indices of the master array which correspond to this partition's data array.
def indices(self): return tuple([slice(*r) for r in self.location])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def indices(self) -> np.ndarray:\n return self.impl.indices", "def master_ndindex(self): # itermaster_indices(self):\n return itertools_product(\n *[range(*r) for r in self.location]\n ) # TODO check", "def atom_idxs(self):\n\n return np.array([atom.atom_idxs for atom i...
[ "0.70275134", "0.6850407", "0.683511", "0.6796057", "0.6708753", "0.6668921", "0.6662458", "0.66586286", "0.6644368", "0.6611067", "0.66031367", "0.65675586", "0.65319914", "0.64623576", "0.6393266", "0.6372617", "0.6343201", "0.63220435", "0.6305004", "0.62970823", "0.628111...
0.62476814
23
Return a deep copy. ``p.copy()`` is equivalent to ``copy.deepcopy(p)``.
def copy(self): new = Partition.__new__(Partition) new.__dict__ = self.__dict__.copy() self._increment_file_counter() return new
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deepcopy(self):\n return copymod.deepcopy(self)", "def copy(self):\n\t\treturn pythoncopy.deepcopy(self)", "def copy(self):\n import copy as pcopy\n return pcopy.deepcopy(self)", "def deepcopy(self):\n return self.copy()", "def copy(self):\r\n return copy.deepcopy(self)", "...
[ "0.7977393", "0.7835692", "0.7835209", "0.7829921", "0.7808746", "0.7806165", "0.77548367", "0.77548367", "0.77548367", "0.77548367", "0.77548367", "0.77548367", "0.77548367", "0.77548367", "0.77548367", "0.77548367", "0.77548367", "0.77548367", "0.77548367", "0.77548367", "0...
0.0
-1
overload == which is useful for tests
def __eq__(self, other): return np.all([ self.__getattribute__(name) == other.__getattribute__(name) for name in self._fields ])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testEquality(self):\n pass", "def __eq__(self,*args):\r\n pass", "def __eq__(self,*args):\r\n pass", "def __eq__(self,*args):\r\n pass", "def __eq__(self,*args):\r\n pass", "def __eq__(self,*args):\r\n pass", "def __eq__(self,*args):\r\n pass", "def __eq__(self,*args):\r\n pass", ...
[ "0.8219239", "0.8051525", "0.8051525", "0.8051525", "0.8051525", "0.8051525", "0.8051525", "0.8051525", "0.8051525", "0.8051525", "0.8051525", "0.8051525", "0.8051525", "0.8051525", "0.8051525", "0.8051525", "0.8051525", "0.8051525", "0.8051525", "0.8051525", "0.8051525", "...
0.0
-1
The extended location of the cluster associated with the resource.
def extended_location(self) -> pulumi.Input['ExtendedLocationArgs']: return pulumi.get(self, "extended_location")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extended_location(self) -> pulumi.Output['outputs.ExtendedLocationResponse']:\n return pulumi.get(self, \"extended_location\")", "def extended_location(self) -> pulumi.Output['outputs.ExtendedLocationResponse']:\n return pulumi.get(self, \"extended_location\")", "def extended_location(self) -...
[ "0.67308724", "0.67308724", "0.6552111", "0.6427688", "0.64267975", "0.64260936", "0.64260936", "0.63151413", "0.6296761", "0.6123441", "0.6123441", "0.595561", "0.58933264", "0.5883953", "0.5883953", "0.5883953", "0.5883953", "0.5883953", "0.5883953", "0.5883953", "0.5883953...
0.6507004
3
The name of the resource group. The name is case insensitive.
def resource_group_name(self) -> pulumi.Input[str]: return pulumi.get(self, "resource_group_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_group_name(self) -> str:\n return pulumi.get(self, \"resource_group_name\")", "def group_name(self) -> str:\n return pulumi.get(self, \"group_name\")", "def resource_group_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"resource_group_name\")", "def resource_gr...
[ "0.8591477", "0.8364604", "0.8203347", "0.8203347", "0.8203347", "0.8203347", "0.8203347", "0.8203347", "0.8203347", "0.8203347", "0.8203347", "0.8203347", "0.8203347", "0.8203347", "0.81754756", "0.8084906", "0.8084906", "0.8084906", "0.8084906", "0.8084906", "0.8084906", ...
0.80879456
52
Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster.
def hybrid_aks_ipam_enabled(self) -> Optional[pulumi.Input[Union[str, 'HybridAksIpamEnabled']]]: return pulumi.get(self, "hybrid_aks_ipam_enabled")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def internet_advertising_disabled(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"internet_advertising_disabled\")", "def internet_advertising_disabled(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"internet_advertising_disabled\")", "def ipam_enabled(self) ...
[ "0.6013737", "0.6013737", "0.57309324", "0.56934357", "0.5477145", "0.52816826", "0.52816826", "0.5257691", "0.52326876", "0.5207934", "0.5207934", "0.5186799", "0.5176646", "0.5155211", "0.51384276", "0.51132184", "0.51126623", "0.5108996", "0.5088345", "0.5074993", "0.50374...
0.0
-1
The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV4 or DualStack.
def ipv4_connected_prefix(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "ipv4_connected_prefix")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def local_ipv4_network_cidr(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"local_ipv4_network_cidr\")", "def local_ipv4_network_cidr(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"local_ipv4_network_cidr\")", "def local_ipv4_network_cidr(self) -> Optional[pulumi.Input...
[ "0.74853224", "0.73985845", "0.73985845", "0.72560716", "0.72186995", "0.68104565", "0.68104565", "0.6797192", "0.66854614", "0.6672047", "0.65196866", "0.6441253", "0.64102024", "0.64046043", "0.6388265", "0.6357316", "0.63264906", "0.63264906", "0.63264906", "0.6296035", "0...
0.72907937
3
The name of the L3 network.
def l3_network_name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "l3_network_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def network(self) -> str:\n return pulumi.get(self, \"network\")", "def computer_network_name(self) -> str:\n return self._computer_network_name", "def network_name(self, **kwargs):\n\n return self.api_request(self._get_method_fullname(\"network_name\"), kwargs)", "def name(self) -> str:...
[ "0.6955331", "0.6824133", "0.6799091", "0.6677395", "0.66031", "0.6491807", "0.6462104", "0.64592564", "0.64398986", "0.63908404", "0.63872564", "0.638713", "0.63722634", "0.6359511", "0.6331267", "0.63089246", "0.62042356", "0.6186131", "0.61773044", "0.61605525", "0.6082077...
0.88098806
0
The geolocation where the resource lives
def location(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "location")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_location(self):\n\t\treturn self.location", "def get_location(self):\n return self.location", "def get_location(self):\n return self.location", "def get_location(self):\r\n return self.__location", "def get_location(self):\r\n return None", "def getLocation(self):\n ...
[ "0.816298", "0.7999453", "0.79540074", "0.7945644", "0.78364915", "0.77626437", "0.7730134", "0.7681095", "0.7624169", "0.76093256", "0.76093256", "0.75724584", "0.75544393", "0.7547195", "0.75165695", "0.74507827", "0.74267685", "0.7419033", "0.7419033", "0.7419033", "0.7419...
0.0
-1
Get an existing L3Network 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) -> 'L3Network': opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = L3NetworkArgs.__new__(L3NetworkArgs) __props__.__dict__["associated_res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def a_state(id):\n state = storage.get(State, id)\n if state is not None:\n return jsonify(state.to_dict())\n abort(404)", "def get_state_by_id(state_id):\n state = storage.get(State, state_id)\n if not state:\n abort(404)\n return jsonify(state.to_dict()), 200", "def get_state_...
[ "0.5696972", "0.5616301", "0.559337", "0.55891603", "0.55436486", "0.5497109", "0.54890585", "0.5482085", "0.5455767", "0.5444336", "0.54149556", "0.53990793", "0.53760177", "0.53489095", "0.534057", "0.5307886", "0.5290895", "0.529065", "0.5247792", "0.5244457", "0.5226916",...
0.6454363
0
The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.
def associated_resource_ids(self) -> pulumi.Output[Sequence[str]]: return pulumi.get(self, "associated_resource_ids")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def network_ids(self):\n return self._network_ids", "def otherResources(self):\n return self._get_list_field(\"otherResources\")", "def resource_names(self):\n return self._resource_names", "def get_ids(self):\n all_networks = []\n network_dict = {}\n for network, st...
[ "0.69101155", "0.6573186", "0.6401023", "0.6343839", "0.6258195", "0.5978847", "0.5978847", "0.5978847", "0.5819962", "0.5801385", "0.5795712", "0.5795712", "0.57860464", "0.57594633", "0.5741592", "0.5688209", "0.5666085", "0.5643691", "0.56345814", "0.5630704", "0.5611117",...
0.70806557
1
The resource ID of the Network Cloud cluster this L3 network is associated with.
def cluster_id(self) -> pulumi.Output[str]: return pulumi.get(self, "cluster_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")", "def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")", "def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")", "def cluster_id(self) -> str:\n return pulumi.get(self, \"cl...
[ "0.8012701", "0.8012701", "0.8012701", "0.8012701", "0.8012701", "0.767193", "0.724202", "0.724202", "0.71904457", "0.71904457", "0.71904457", "0.7147318", "0.71079326", "0.7104546", "0.70985615", "0.70811", "0.7055768", "0.69946766", "0.69447", "0.69314307", "0.68725604", ...
0.74517417
8
The extended location of the cluster associated with the resource.
def extended_location(self) -> pulumi.Output['outputs.ExtendedLocationResponse']: return pulumi.get(self, "extended_location")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extended_location(self) -> pulumi.Output[Optional['outputs.ExtendedLocationResponse']]:\n return pulumi.get(self, \"extended_location\")", "def extended_location(self) -> pulumi.Input['ExtendedLocationArgs']:\n return pulumi.get(self, \"extended_location\")", "def extended_location(self) -> p...
[ "0.6552111", "0.6507004", "0.6507004", "0.6427688", "0.64267975", "0.64260936", "0.64260936", "0.63151413", "0.6296761", "0.6123441", "0.6123441", "0.595561", "0.58933264", "0.5883953", "0.5883953", "0.5883953", "0.5883953", "0.5883953", "0.5883953", "0.5883953", "0.5883953",...
0.67308724
1
Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster.
def hybrid_aks_ipam_enabled(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "hybrid_aks_ipam_enabled")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def internet_advertising_disabled(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"internet_advertising_disabled\")", "def internet_advertising_disabled(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"internet_advertising_disabled\")", "def ipam_enabled(self) ...
[ "0.60128003", "0.60128003", "0.57295716", "0.56930447", "0.5477912", "0.5282392", "0.5282392", "0.52573335", "0.5233392", "0.5205244", "0.5205244", "0.5186832", "0.5175805", "0.5155281", "0.51379627", "0.51135457", "0.5112992", "0.51077884", "0.50872314", "0.5076411", "0.5037...
0.0
-1
The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV4 or DualStack.
def ipv4_connected_prefix(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "ipv4_connected_prefix")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def local_ipv4_network_cidr(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"local_ipv4_network_cidr\")", "def local_ipv4_network_cidr(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"local_ipv4_network_cidr\")", "def local_ipv4_network_cidr(self) -> Optional[pulumi.Input...
[ "0.748467", "0.7397195", "0.7397195", "0.72900414", "0.7255836", "0.68101245", "0.68101245", "0.6797655", "0.6686527", "0.66722995", "0.6519062", "0.644197", "0.64091825", "0.64038914", "0.6388208", "0.63576555", "0.6327051", "0.6327051", "0.6327051", "0.6295223", "0.6267015"...
0.7218586
5
The geolocation where the resource lives
def location(self) -> pulumi.Output[str]: return pulumi.get(self, "location")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_location(self):\n\t\treturn self.location", "def get_location(self):\n return self.location", "def get_location(self):\n return self.location", "def get_location(self):\r\n return self.__location", "def get_location(self):\r\n return None", "def getLocation(self):\n ...
[ "0.816298", "0.7999453", "0.79540074", "0.7945644", "0.78364915", "0.77626437", "0.7730134", "0.7681095", "0.7624169", "0.76093256", "0.76093256", "0.75724584", "0.75544393", "0.7547195", "0.75165695", "0.74507827", "0.74267685", "0.7419033", "0.7419033", "0.7419033", "0.7419...
0.6883943
75
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
def type(self) -> pulumi.Output[str]: return pulumi.get(self, "type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")", "def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")", "def resource_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"resource_type\")", "def ...
[ "0.7918516", "0.7918516", "0.7866337", "0.7866337", "0.7866337", "0.7866337", "0.7866337", "0.7708053", "0.75534964", "0.7282099", "0.70591027", "0.6979169", "0.69202054", "0.6868452", "0.67303157", "0.67049116", "0.6654272", "0.6646357", "0.66396123", "0.66396123", "0.663961...
0.0
-1
Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this L3 network.
def virtual_machines_associated_ids(self) -> pulumi.Output[Sequence[str]]: return pulumi.get(self, "virtual_machines_associated_ids")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _GetMachineList(self):\n machines = self._experiment.remote\n # All Label.remote is a sublist of experiment.remote.\n for l in self._experiment.labels:\n for r in l.remote:\n assert r in machines\n return machines", "def virtual_machines(self) -> Sequence['outputs.SubResourceReadOnlyR...
[ "0.5911471", "0.5848252", "0.5473489", "0.5471283", "0.54288316", "0.54288316", "0.542811", "0.5384369", "0.53598607", "0.53279454", "0.53103167", "0.53008413", "0.5270152", "0.5221629", "0.5212279", "0.5154512", "0.51520634", "0.5138587", "0.5093057", "0.50420386", "0.500422...
0.55128694
2
Load weights from a checkpoint file into the tensorflow graph.
def load_weights(self, checkpoint_path, sess=None): if sess is None: sess = tf.get_default_session() assert sess is not None saver = tf.train.Saver(self.variables_to_restore) saver.restore(sess, checkpoint_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_model_weights(sess, checkpoint_dir):\n\n init_fn = slim.assign_from_checkpoint_fn(\n checkpoint_dir, slim.get_model_variables(), ignore_missing_vars=True)\n init_fn(sess)", "def load_weights_from_checkpoint(self, path: str, key: str):\n ckpt = torch.load(path, map_location='cpu')\n ...
[ "0.76077384", "0.74392045", "0.74392045", "0.7414661", "0.7232018", "0.71317524", "0.7071087", "0.70339084", "0.700918", "0.6977498", "0.6935631", "0.691333", "0.68927085", "0.68749905", "0.68339276", "0.6816416", "0.6816042", "0.67910594", "0.6769799", "0.6769098", "0.672785...
0.77680707
2
Load weights from a checkpoint file into the tensorflow graph.
def load_weights(self, checkpoint_path, sess=None): if sess is None: sess = tf.get_default_session() assert sess is not None saver = tf.train.Saver(self.variables_to_restore) saver.restore(sess, checkpoint_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_model_weights(sess, checkpoint_dir):\n\n init_fn = slim.assign_from_checkpoint_fn(\n checkpoint_dir, slim.get_model_variables(), ignore_missing_vars=True)\n init_fn(sess)", "def load_weights_from_checkpoint(self, path: str, key: str):\n ckpt = torch.load(path, map_location='cpu')\n ...
[ "0.76077384", "0.74392045", "0.74392045", "0.7414661", "0.7232018", "0.71317524", "0.7071087", "0.70339084", "0.700918", "0.6977498", "0.6935631", "0.691333", "0.68927085", "0.68749905", "0.68339276", "0.6816416", "0.6816042", "0.67910594", "0.6769799", "0.6769098", "0.672785...
0.77680707
1
Load weights from a checkpoint file into the tensorflow graph.
def load_weights(self, checkpoint_path, sess=None): if sess is None: sess = tf.get_default_session() assert sess is not None saver = tf.train.Saver(self.variables_to_restore) saver.restore(sess, checkpoint_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_model_weights(sess, checkpoint_dir):\n\n init_fn = slim.assign_from_checkpoint_fn(\n checkpoint_dir, slim.get_model_variables(), ignore_missing_vars=True)\n init_fn(sess)", "def load_weights_from_checkpoint(self, path: str, key: str):\n ckpt = torch.load(path, map_location='cpu')\n ...
[ "0.76077384", "0.74392045", "0.74392045", "0.7414661", "0.7232018", "0.71317524", "0.7071087", "0.70339084", "0.700918", "0.6977498", "0.6935631", "0.691333", "0.68927085", "0.68749905", "0.68339276", "0.6816416", "0.6816042", "0.67910594", "0.6769799", "0.6769098", "0.672785...
0.77680707
0
Save the training checkpoint to the disk.
def save_checkpoint(self): if not self.save_ckpt: return lookup = None is_best = False checkpoint = self.create_checkpoint() # save best only or not? if self.save_best_only: if self.valid_dataloader: for item in [self.valid_metric...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_checkpoint(self):\n \n if not os.path.isdir(self.path + '/checkpoint/'):\n os.makedirs(self.path + '/checkpoint/')\n\n if self.saver == None:\n with self.graph.as_default():\n self.saver = tf.train.Saver(tf.global_variables())\n\n self.saver...
[ "0.8523187", "0.82452935", "0.8190791", "0.8153993", "0.81345206", "0.812798", "0.8117262", "0.80906636", "0.80737823", "0.79668844", "0.79027486", "0.77434766", "0.77273154", "0.7645351", "0.764001", "0.76386636", "0.7630027", "0.76060045", "0.75488526", "0.75404406", "0.750...
0.727966
43
shoot_ray shoots a ray from a given row and column if possible
def shoot_ray(self, origin_row, origin_column): # get the the square object at row x column origin = self._board.get_board_square((origin_row, origin_column)) # check that it is a valid "edge" to send a ray from origin_check = origin.is_edge() # if it's not then return false ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shoot_ray(self, row, col):\n # Uses validate method to check if row,col are legal for ray entrance location\n if not self.valid_ray(row, col):\n return False\n # creates ray object from row, col integers\n ray = Ray(row, col)\n # checks if atom is in front of entra...
[ "0.78674567", "0.6780156", "0.67677057", "0.61004895", "0.5816195", "0.5722863", "0.5721122", "0.56699514", "0.566448", "0.5559462", "0.5555234", "0.55531144", "0.55380315", "0.55212104", "0.55208117", "0.5480533", "0.54755425", "0.5391073", "0.53854626", "0.5371789", "0.5366...
0.748143
1
atoms_left returns the number of unguessed atoms still left
def atoms_left(self): return len(self._atoms)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def atoms_left(self):\n return self._atoms", "def atoms_left(self):\r\n return self._board.get_atoms()", "def num_pieces_left(self):\n return self.num_white_pieces + self.num_black_pieces", "def count_mass_left(self):\n self.mass_left_count = int(np.sum(self.array))", "def numbe...
[ "0.7521378", "0.74469197", "0.6469958", "0.6355561", "0.6071514", "0.6057757", "0.6004638", "0.59833574", "0.59616107", "0.5921324", "0.5888561", "0.5864343", "0.5864343", "0.5818085", "0.57945406", "0.57681686", "0.5768063", "0.5694106", "0.56850934", "0.56428653", "0.559667...
0.84319353
0
Gets the crosslistings of the top edges from a course
def getTopEdgesFrom(self, session, courseid): node = self.getNode(courseid) # get CourseNode if not node: return [] edges = node.getEdges() # get its Edge dict return sorted(edges.keys(), key=lambda k: edges[k], reverse=True)[:5]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assembly_courses(wall):\n courses = []\n vertices = set(wall.nodes())\n base = set(wall.nodes_where({'is_support': True}))\n\n if base:\n courses.append(list(base))\n\n seen = set()\n seen.update(base)\n\n vertices -= base\n\n while vertices:\n nbrs = s...
[ "0.59826374", "0.55603427", "0.5523582", "0.5495732", "0.5461872", "0.54479295", "0.53818995", "0.5318768", "0.52677137", "0.5246417", "0.520737", "0.5162896", "0.5158995", "0.51440036", "0.51215637", "0.5089466", "0.50795156", "0.50770104", "0.5055389", "0.5054957", "0.50231...
0.72403175
0
Loads a json value from a file and converts it to the corresponding python object.
def loadJsonValueFromFile(inputFilePath): with open(inputFilePath) as fileObj: value = json.load(fileObj) return value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(cls, file):\n with open(file, \"r\") as f:\n j = json.load(f)\n return cls(**j)", "def load_from_json_file(filename):\n with open(filename, 'r') as f:\n obj = json.loads(f.read())\n return obj", "def convert_json_to_object(file_content):\n object = json...
[ "0.7691063", "0.76900375", "0.76079774", "0.7595927", "0.75809187", "0.7557681", "0.7495783", "0.74881333", "0.74459565", "0.7439162", "0.7416306", "0.7365671", "0.73619384", "0.7338387", "0.73190105", "0.7312332", "0.7281531", "0.7272493", "0.72698015", "0.7256082", "0.72544...
0.74380505
10
Return a string for the array of numbers for this matrix
def __str__(self): return str(self.array)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self) -> str:\n\t\treturn \",\".join(\"\".join(str(n) for n in m) for m in self.matrix)", "def __str__(self):\n output = \"\"\n for i in self.values:\n st = []\n output += \"[\"\n for j in i:\n st.append(str(j))\n output += \"...
[ "0.7381142", "0.7210961", "0.7170365", "0.7031644", "0.6882609", "0.68663853", "0.6862946", "0.6755842", "0.67423487", "0.66417027", "0.65829957", "0.6536184", "0.6523809", "0.6509771", "0.64562243", "0.6420926", "0.64129996", "0.638619", "0.6340786", "0.63212585", "0.626529"...
0.66033196
10
Returns the self.guessed_by and self.metaphors_used data as a readable string.
def get_str_metadata(self): return "\n".join(["Guessed by {}".format(self.guessed_by), "{} metaphors used".format(self.metaphors_used)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_strings(self):\n return self._guessed_strings", "def __str__(self):\n d = {}\n d[\"tuner_number\"] = self.tuner_number\n d[\"output_format\"] = self.output_format\n d[\"output_source\"] = self.output_source\n return str(d)"...
[ "0.66056585", "0.6369337", "0.63330597", "0.63225114", "0.62778735", "0.62415534", "0.6170479", "0.6140569", "0.60968494", "0.60799277", "0.60438675", "0.60398", "0.60284495", "0.6009198", "0.59779775", "0.59726894", "0.597072", "0.59602815", "0.594238", "0.5917474", "0.58926...
0.80824745
0
Takes `x_axis` and returns an uniformly sampled array of values from its minimum to its maximum with few extra points
def _extended_discrete_xaxis(x_axis, n_points=100, eps=0.10): min_value = np.min(x_axis) max_value = np.max(x_axis) distance = max_value - min_value return np.linspace(min_value - eps * distance, max_value + eps * distance, num=n_points)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample(self):\n # For each row: round(random .* (max - min) + min, 0)\n random_array = prng.np_random.rand(self.num_discrete_space)\n return [int(x) for x in np.floor(np.multiply((self.high - self.low + 1.), random_array) + self.low)]", "def scale(x_range=1, y_range=1):\r\n x = rand_v...
[ "0.6698139", "0.6558226", "0.65457267", "0.64248043", "0.6340408", "0.6254296", "0.61594844", "0.6148418", "0.60947704", "0.60901093", "0.5998522", "0.5891753", "0.5868367", "0.58548534", "0.5790514", "0.5744083", "0.5735349", "0.57298034", "0.57228523", "0.5720773", "0.56946...
0.59077674
11
Name of current protocol.
def name(self): return 'Null'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def protocol(self) -> str:\n return __name__", "def protocol(self) -> str:\n return pulumi.get(self, \"protocol\")", "def protocol_name(self):\n self._protocol_name = 'kerberos'\n return self._protocol_name", "def getProtocol(self) -> str:\n ...", "def layer_protocol_name...
[ "0.8527097", "0.8032896", "0.8025242", "0.7800471", "0.7785212", "0.7730119", "0.76614213", "0.76614213", "0.75701255", "0.75649047", "0.75599545", "0.7478808", "0.7466269", "0.7439446", "0.7334409", "0.7231231", "0.71754944", "0.715286", "0.70239735", "0.70239735", "0.702397...
0.0
-1
Test case for add_or_update_case
def test_add_or_update_case(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_case(self):\n pass", "def test_update_one(self):\n pass", "def test_update_record(self):\n pass", "def test_update(self):\n pass", "def test_update(self):\n pass", "def test_update(self):\n pass", "def test_update_scenario(self):\n pass",...
[ "0.79237324", "0.7314126", "0.7272837", "0.72685695", "0.72685695", "0.72685695", "0.712033", "0.69949913", "0.6982817", "0.69368035", "0.69113", "0.68479264", "0.68319446", "0.6824832", "0.6721132", "0.6690393", "0.6686279", "0.66511667", "0.6622248", "0.6599744", "0.6579878...
0.90939504
0
Returns the presence for this channel
def presence(self, params=None, timeout=None): params = params or {} path = '/channels/%s/presence' % self.__name return self.__ably._get(path, params=params, timeout=timeout).json()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def presence(self):\n return self.slack_client.api_call(\"users.getPresence?user=\"+self.user_id)", "def isHumanPresence(self):\n\t\treturn self.humanPresence", "def online(self):\n api_call = self.presence()\n if api_call.get('ok'):\n # retrieve all users so we can find our bot...
[ "0.78225", "0.65050405", "0.63529664", "0.6173057", "0.5725983", "0.5710549", "0.5505179", "0.54912657", "0.54869306", "0.54740065", "0.5472166", "0.5465967", "0.5449083", "0.5377885", "0.5373487", "0.5356357", "0.534464", "0.53218323", "0.52983725", "0.52873003", "0.528721",...
0.80038244
0
Get an existing Assessment 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) -> 'Assessment': opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = AssessmentArgs.__new__(AssessmentArgs) __props__.__dict__["additional_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None) -> 'Assessment':\n opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))\n\n __props__ = dict()\n\n __props__[\"additional_data\"] = None\n __pr...
[ "0.6976486", "0.608855", "0.5846438", "0.5757699", "0.5648362", "0.55919707", "0.5582545", "0.55817664", "0.55264586", "0.55085826", "0.550386", "0.5496845", "0.54861027", "0.5467891", "0.54414856", "0.53757304", "0.53509825", "0.53232807", "0.5311685", "0.52735114", "0.52480...
0.6898669
1
Convert the axisangle representation to the matrix representation of the rotation
def vrrotvec2mat(r): s = np.sin(r[3]) c = np.cos(r[3]) t = 1 - c n = normalize(r[0:3]) x = n[0] y = n[1] z = n[2] m = np.array( [[t*x*x + c, t*x*y - s*z, t*x*z + s*y], [t*x*y + s*z, t*y*y + c, t*y*z - s*x], [t*x*z - s*y, t*y*z + s*x, t*z*z + c]] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def axis2rotmat(axis):\n return quat2rotmat(axis2quat(axis))", "def rotation_matrix(angle, axis):\n about_z = rotation_about_z(angle)\n z_to_axis = z_to_vector(axis)\n axis_to_z = np.linalg.inv(z_to_axis)\n return reduce(np.dot, [z_to_axis, about_z, axis_to_z])", "def angle_to_rotation_matrix(an...
[ "0.81078196", "0.78859186", "0.74368423", "0.7374491", "0.7312507", "0.7310099", "0.7273846", "0.7225561", "0.71868175", "0.71868175", "0.70643413", "0.70557725", "0.70138526", "0.7002238", "0.6987983", "0.6980551", "0.69750994", "0.6967742", "0.69532573", "0.693683", "0.6926...
0.0
-1
Generator over all subclasses of a given class, in depth first order.
def itersubclasses(cls, _seen=None): if not isinstance(cls, type): raise TypeError('itersubclasses must be called with ' 'new-style classes, not %.100r' % cls) if _seen is None: _seen = set() try: subs = cls.__subclasses__() except TypeError: # fails onl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_subclasses(cls):\n for subclass in cls.__subclasses__():\n yield subclass\n for subc in all_subclasses(subclass):\n yield subc", "def class_hierarchy(clslist):\n for cls in clslist:\n subclass_list = cls.__subclasses__()\n if subclass_list:\n ...
[ "0.7962573", "0.79427534", "0.7785052", "0.75617856", "0.7538503", "0.75220305", "0.7414212", "0.7337148", "0.7327652", "0.7236801", "0.70275396", "0.7026855", "0.7007763", "0.6963463", "0.6906831", "0.688978", "0.688137", "0.6830467", "0.68002534", "0.67773235", "0.6738663",...
0.7340427
7
Initialize the axis ranges from proviuded Plot or renderer.
def initialize_axis_ranges(self, plot, transform=None): if transform is None: def transform(x): return x elif isinstance(transform, int): ndigits = transform def transform(x): return round(x, ndigits) # Avoid UI polluting with...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_axes(self):\n mini, maxi = self._get_extremes()\n self.y_axis.min = mini\n self.y_axis.max = maxi\n self.y_axis._max_min()\n\n if not None in [s.xvalues for s in self]:\n mini, maxi = self._get_extremes('xvalues')\n self.x_axis.min = mini\n ...
[ "0.71792495", "0.7129534", "0.68548447", "0.67877525", "0.6537042", "0.64943486", "0.641954", "0.6235867", "0.6223747", "0.6188791", "0.61873025", "0.61726326", "0.6160985", "0.6133905", "0.61263645", "0.61139727", "0.61138016", "0.61124223", "0.60551167", "0.60020185", "0.60...
0.7375276
0
Peak wavelength when the curve is expressed as power density.
def lambda_max(self): return const.b_wien / self.temperature
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wavelength(energy):\r\n return 2 * np.pi * PLANCK_CONSTANT * SPEED_OF_LIGHT / energy", "def wavelength(self):\n return wavelength(energy)", "def peak(self):\n pass", "def wavelength(energy):\n return 2 * PI * PLANCK_CONSTANT * SPEED_OF_LIGHT / energy", "def peak_PSF(self):\n ...
[ "0.65199757", "0.65100896", "0.6436953", "0.6426267", "0.6408306", "0.62890404", "0.6252019", "0.624753", "0.6180097", "0.61793584", "0.6162006", "0.6152941", "0.61026114", "0.6093139", "0.6071749", "0.6033385", "0.59775233", "0.59704584", "0.5951522", "0.5938655", "0.5900657...
0.5508018
82
Performs a batched inner product over the last dimension. Replacement for deprecated `from numpy.core.umath_tests import inner1d`.
def batch_inner(a: np.ndarray, b: np.ndarray, verify: bool = True) -> np.ndarray: if verify and a.shape != b.shape: raise ValueError("All dimensions have to be equal") if a.shape[-1] == 0: return np.empty_like(a) return np.einsum("...i,...i->...", a, b) # faster than np.sum(a * b, axis=-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def batch_outer_product(a, b):\n a, b = normalize_and_check_ndim([a, b], 2)\n # This is a batchwise version of the matrix multiplication approach\n # used for outer_product(), see explanation there.\n return a[:, :, np.newaxis] * b[:, np.newaxis, :]", "def outer_product(input_sets, axis=0):\n out ...
[ "0.7076053", "0.6733254", "0.6566906", "0.6538848", "0.6200467", "0.5971671", "0.5898091", "0.5882279", "0.586811", "0.58539116", "0.5828389", "0.58158463", "0.57993835", "0.5773256", "0.57691", "0.570448", "0.5675385", "0.5650381", "0.5588937", "0.55867285", "0.5513858", "...
0.6739568
1
Performs a batched outer product over the last dimension.
def batch_outer(a: np.ndarray, b: np.ndarray, verify: bool = True) -> np.ndarray: if verify and a.shape[:-1] != b.shape[:-1]: raise ValueError("All except the last dimension have to be equal") return np.einsum("...i,...j->...ij", a, b) # slightly faster than np.multiply(a[...,:,None], b[...,None,:])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def batch_outer_product(a, b):\n a, b = normalize_and_check_ndim([a, b], 2)\n # This is a batchwise version of the matrix multiplication approach\n # used for outer_product(), see explanation there.\n return a[:, :, np.newaxis] * b[:, np.newaxis, :]", "def outer_product(x):\n return keras.backend....
[ "0.755109", "0.70560527", "0.6960709", "0.6768571", "0.65054774", "0.63410676", "0.61378115", "0.61229986", "0.60099125", "0.5946456", "0.59233963", "0.590922", "0.5882272", "0.587886", "0.5864047", "0.58254915", "0.5783885", "0.5765654", "0.5729165", "0.57191443", "0.5591057...
0.66920644
4
`probs` values ndarray `k` take the smallest `k` elements, if `reverse` is False and the largest `k` if `reverse` is True `axis` sorting and selection axis.
def batchtopk( probs: np.ndarray, k: Optional[int] = None, axis: int = -1, reverse: bool = False ) -> Tuple[np.ndarray, np.ndarray]: if k is not None and k <= 0: raise ValueError("k must be larger than 0. Use None to chose all elements.") if axis != -1: raise ValueError("Only last axis sup...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tflite_top_k_probs(probs, k):\n\n if k > 0:\n return np.flip(probs[0].argsort()[-k:])\n else:\n return np.flip(probs[0].argsort())", "def tf_top_k_probs(probs, k):\n\n if k > 0:\n return probs.argsort()[-k:][::-1]\n else:\n return probs.argsort()[:][::-1]", "def indi...
[ "0.7283214", "0.6759031", "0.58316225", "0.58071005", "0.5797564", "0.57924837", "0.5782279", "0.5650926", "0.55970734", "0.5593298", "0.558886", "0.5553999", "0.5523884", "0.548393", "0.5477123", "0.5454491", "0.5419435", "0.5367509", "0.5322573", "0.5320744", "0.5307545", ...
0.7433971
0
Replace colored pixels with a `neutral_color`. The `ratio` defines the 'colorfulness' above which level the pixel should be replace. I.e. if the `ratio` is 1 nothing will be replaced, if `ratio` is 0 only strict greys are kept unmodified.
def remove_color(img: np.ndarray, ratio: float, neutral_color: Tuple[int, int, int] = RGB_WHITE) -> None: channels = img.shape[-1] assert channels == 3, "Not a 3 channel color image" norm = np.std(np.array(RGB_YELLOW)) # this is the same for all pure colors sd = np.std(img, axis=-1) img[sd > rat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ratio_to_rgb(ratio):\n b = 0\n if round(ratio, 1) == 0.5:\n r = 255\n g = 255\n elif ratio < 0.5:\n r = int(ratio * 2 * 255.0)\n g = 255\n else:\n r = 255\n g = int((1.0 - ratio) * 2 * 255.0)\n rgb = (r, g, b)\n\n return rgb", "def set_neutral(self)...
[ "0.4983211", "0.48789826", "0.48116347", "0.4737011", "0.47265878", "0.46818957", "0.4571823", "0.45462266", "0.44600105", "0.4397929", "0.42731524", "0.427132", "0.4269558", "0.42693788", "0.42575642", "0.42499575", "0.42406985", "0.42318156", "0.4226033", "0.4211065", "0.41...
0.7399279
0
np.broadcast_shapes requires `numpy==1.20.0`, which is not available for `python < 3.7`.
def broadcast_shapes(*shapes: Tuple[int, ...]) -> Tuple[int, ...]: arrays = [np.empty(shape) for shape in shapes] return np.broadcast(*arrays).shape
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_broadcast_dims():\r\n test((1, 2, 3))\r\n test((2, 1, 3))\r\n test((2, 3, 1))\r\n test2((1, 2, 3))\r\n test2((2, 1, 3))\r\n test2((2, 3, 1))", "def broadcast_shape(*shapes, **kwargs):\n strict = kwargs.pop(\"strict\", False)\n reversed_shape = []\n for shape in shapes:\n ...
[ "0.63662064", "0.631577", "0.6181781", "0.60380113", "0.59342825", "0.5925404", "0.58053595", "0.57856745", "0.57498085", "0.56896067", "0.55596524", "0.55482703", "0.548472", "0.548077", "0.540709", "0.5397413", "0.53940207", "0.5373903", "0.53049004", "0.526517", "0.5237194...
0.6529921
0
Creates a picture grid (left to right, top to bottom).
def image_grid(images: np.ndarray, nrow: int = 8, fill_value=(0, 0, 0)) -> np.ndarray: if not images.ndim == 4: raise ValueError("Input shape must be [n, height, width, channel]") h, w = images.shape[1:3] nbatch = images.shape[0] channels = images.shape[3] rows = ceildiv(nbatch, nrow) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_grid(images, n_rows=4, n_cols=4):\n k = min(n_rows * n_cols, len(images))\n indices = [i for i in range(k)]\n return _create_grid(images, indices, n_rows, n_cols)", "def create_grid(grid):\r\n for i in range(4):\r\n grid.append([0,0,0,0])", "def generate_image_grid(sess, op):\n ...
[ "0.7382325", "0.7234491", "0.71866596", "0.708115", "0.70502263", "0.7038171", "0.6941421", "0.69232905", "0.68283314", "0.6826088", "0.68064976", "0.67884314", "0.6752977", "0.6732644", "0.67231864", "0.6684483", "0.66807157", "0.6656162", "0.66169745", "0.65663916", "0.6561...
0.0
-1
Test admin cannot create a product with a blacklisted token
def test_cannot_create_product_with_blacklisted_token(self): resp = self.admin_register() reply = self.admin_login() token = reply['token'] resp = self.client.delete( '/api/v1/logout', headers={'Authorization': 'Bearer {}'.format(token)} ) reply =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_cannot_view_a_product_with_blacklisted_token(self):\n resp = self.admin_register()\n reply = self.admin_login()\n token = reply['token']\n product = dict(\n prod_name='NY_denims',\n category='denims',\n stock=20,\n price=150\n ...
[ "0.82479733", "0.7897591", "0.7884179", "0.78223985", "0.7625364", "0.7585557", "0.7400365", "0.7375994", "0.72420007", "0.7152579", "0.7103639", "0.70389014", "0.6944365", "0.6929796", "0.68858266", "0.68301815", "0.67753994", "0.6750073", "0.6746582", "0.66715974", "0.66688...
0.8788049
0
Tests that 'admin' cannot add a product with empty fields
def test_admin_cannot_create_product_with_empty_fields(self): resp = self.admin_register() reply = self.admin_login() token = reply['token'] product = dict( prod_name='', category='', stock=20, price=150 ) resp = self.client...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_cannot_make_sale_with_missing_fields(self):\n reply = self.admin_add_product()\n\n resp = self.admin_create_user()\n reply = self.attendant_login()\n token = reply['token']\n sale = dict(products = [\n {\n \"prod_name\":\"\", \n \...
[ "0.7727357", "0.71426547", "0.71228373", "0.6888725", "0.6875848", "0.68659735", "0.68113697", "0.6800745", "0.6779112", "0.67721987", "0.6709652", "0.66885155", "0.6665036", "0.6651361", "0.6607132", "0.66057837", "0.66039413", "0.65725106", "0.6552758", "0.6544897", "0.6522...
0.8373025
0
Tests that a user cannot view a product in the Inventory with blacklisted token
def test_cannot_view_a_product_with_blacklisted_token(self): resp = self.admin_register() reply = self.admin_login() token = reply['token'] product = dict( prod_name='NY_denims', category='denims', stock=20, price=150 ) resp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_cannot_view_all_products_with_blacklisted_token(self):\n resp = self.admin_register()\n reply = self.admin_login()\n token = reply['token']\n product = dict(\n prod_name='NY_denims',\n category='denims',\n stock=20,\n price=150\n ...
[ "0.77314836", "0.7319002", "0.68258417", "0.6709656", "0.66352224", "0.6600747", "0.65926576", "0.65914124", "0.6580106", "0.6573959", "0.6558386", "0.65569514", "0.6534714", "0.6512719", "0.6504638", "0.64704", "0.6448948", "0.6437487", "0.6420581", "0.6419264", "0.63966596"...
0.79721093
0
Tests that a user can view all products in the Inventory
def test_view_all_products(self): resp = self.admin_register() reply = self.admin_login() token = reply['token'] product = dict( prod_name='NY_denims', category='denims', stock=20, price=150 ) resp = self.client.post( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_list_products_logged_in(self):\n\n # Log in seller\n self.client.login(username=\"test_seller\", password=\"secret\")\n\n # Issue a GET request\n response = self.client.get(reverse('website:products'))\n\n # Check that the response is 200\n self.assertEqual(respon...
[ "0.72330284", "0.71533865", "0.70860183", "0.6867175", "0.6790764", "0.67349434", "0.6666839", "0.6636514", "0.66316766", "0.6597527", "0.65619427", "0.6444273", "0.6425292", "0.642249", "0.6402104", "0.64012486", "0.6383176", "0.6383148", "0.6321953", "0.6320072", "0.6299333...
0.7486654
0
Tests that a user cannot view products from empty Inventory
def test_view_products_from_empty_inventory(self): resp = self.admin_register() reply = self.admin_login() token = reply['token'] resp = self.client.get( '/api/v1/products', headers={'Authorization': 'Bearer {}'.format(token)} ) reply = json.loads...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_admin_cannot_delete_product_from_empty_Inventory(self):\n resp = self.admin_register()\n reply = self.admin_login()\n token = reply['token']\n \n resp = self.client.delete(\n '/api/v1/products/1',\n content_type='application/json',\n head...
[ "0.74154675", "0.72096145", "0.7158583", "0.693217", "0.6781853", "0.6733253", "0.66969836", "0.65152705", "0.64797616", "0.64615333", "0.6445138", "0.6428424", "0.63962966", "0.6393635", "0.63872916", "0.63662773", "0.633816", "0.6332057", "0.63152456", "0.6308194", "0.63058...
0.78474796
0
Test that you cant updated a nonexistant product
def test_update_nonexistant_product(self): resp = self.admin_register() reply = self.admin_login() token = reply['token'] product_update = dict( prod_name='NY_jeans', category='denims', stock=50, price=180 ) resp = self.clie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_nonexist(self):\n promotion = PromotionFactory()\n promotion.id = '1cak41-nonexist'\n try:\n promotion.update()\n except KeyError:\n self.assertRaises(KeyError)", "def test_update_not_my_product(self):\n post_data = {\n \"categor...
[ "0.74883664", "0.74142987", "0.7132973", "0.7130076", "0.6898503", "0.6843232", "0.676572", "0.6739922", "0.67206293", "0.67113554", "0.66875863", "0.6684773", "0.668369", "0.66656035", "0.6630668", "0.6606419", "0.65949506", "0.6585263", "0.65486664", "0.65191656", "0.651270...
0.7994515
0
Test that product cannot be updated with unauthorised user
def test_unauthorized_product_update(self): resp = self.admin_create_user() reply = self.attendant_login() token = reply['token'] product_update = dict( prod_name='NY_jeans', category='denims', stock=50, price=180 ) resp = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_not_my_product(self):\n post_data = {\n \"category\": {\n \"name\": \"general\",\n \"index\": 0\n },\n \"name\": \"Producto 2 modified\",\n \"description\": \"Descripcion de producto 2 modified\",\n \"sellin...
[ "0.7472202", "0.74601954", "0.730332", "0.72697306", "0.71795666", "0.71784", "0.7131658", "0.70938385", "0.7079321", "0.6975282", "0.695774", "0.6886112", "0.68209416", "0.68174875", "0.6791423", "0.6772019", "0.6765322", "0.6752393", "0.67434675", "0.66997343", "0.6691479",...
0.80988926
0
Test that product cannot be updated with empty fields
def test_update_product_with_empty_fields(self): resp = self.admin_register() reply = self.admin_login() token = reply['token'] product = dict( prod_name='NY_denims', category='denims', stock=20, price=150 ) resp = self.clie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_product_required_fields(self):\n data = {\n 'pk': 1,\n 'name': None,\n 'description': '''\n Yogurt also spelled yoghurt, yogourt or yoghourt,\n is a food produced by bacterial fermentation of milk.\n '''\n }\n ...
[ "0.802753", "0.7568224", "0.7292608", "0.7203753", "0.7033387", "0.69645137", "0.6949159", "0.6943705", "0.69149756", "0.691329", "0.690093", "0.6899394", "0.6895893", "0.68875086", "0.6824652", "0.6816774", "0.68002254", "0.6785967", "0.6772013", "0.67623484", "0.6751942", ...
0.8045699
0
Test that a non admin cannot delete a product
def test_non_admin_cannot_delete_product(self): resp = self.admin_register() reply = self.admin_login() token = reply['token'] product = dict( prod_name='NY_denims', category='denims', stock=20, price=150 ) resp = self.clien...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_not_my_product(self):\n self._require_login(self.user1)\n response = self.client.delete('/api/1.0/products/2/')\n self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)", "def test_admin_cannot_delete_nonexistant_product(self):\n resp = self.admin_register()...
[ "0.8456681", "0.82070416", "0.8153313", "0.772525", "0.750598", "0.75052166", "0.7497598", "0.74397874", "0.73591393", "0.7334757", "0.7330903", "0.72217363", "0.72114277", "0.71953607", "0.7125004", "0.70727336", "0.70629984", "0.6935391", "0.69298255", "0.6893835", "0.68860...
0.834971
1
Test that admin cannnot delete a product from empty Inventory
def test_admin_cannot_delete_product_from_empty_Inventory(self): resp = self.admin_register() reply = self.admin_login() token = reply['token'] resp = self.client.delete( '/api/v1/products/1', content_type='application/json', headers={'Authori...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_admin_cannot_delete_nonexistant_product(self):\n resp = self.admin_register()\n reply = self.admin_login()\n token = reply['token']\n product = dict(\n prod_name='NY_denims',\n category='denims',\n stock=20,\n price=150\n )\n ...
[ "0.79532677", "0.7735564", "0.7528131", "0.7521453", "0.7518936", "0.746801", "0.7354772", "0.72263944", "0.71801", "0.71784055", "0.7171436", "0.7112214", "0.7106493", "0.70771635", "0.6879483", "0.68655676", "0.68639493", "0.68453324", "0.6812393", "0.6777014", "0.67697865"...
0.8764794
0
Test that admin cannnot delete a nonexistant product
def test_admin_cannot_delete_nonexistant_product(self): resp = self.admin_register() reply = self.admin_login() token = reply['token'] product = dict( prod_name='NY_denims', category='denims', stock=20, price=150 ) resp = se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_not_my_product(self):\n self._require_login(self.user1)\n response = self.client.delete('/api/1.0/products/2/')\n self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)", "def test_non_admin_cannot_delete_product(self):\n resp = self.admin_register()\n ...
[ "0.8434453", "0.81416374", "0.8129146", "0.79895574", "0.7884565", "0.7712441", "0.7642063", "0.75856626", "0.7577927", "0.757099", "0.7507489", "0.75073075", "0.75018024", "0.7473333", "0.7418871", "0.7409584", "0.72817427", "0.7275699", "0.72678584", "0.7262097", "0.7227959...
0.8506851
0
Test that admin cannnot delete a product with nointeger prod_id
def test_admin_cannot_delete_product_with_non_integer_prod_id(self): resp = self.admin_register() reply = self.admin_login() token = reply['token'] product = dict( prod_name='NY_denims', category='denims', stock=20, price=150 ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_03_product_delete(self):\n product = self.create_product()\n products = self.product_obj.search([])\n self.assertIn(product, products)\n product.unlink()\n self.assertNotIn(product.exists(), products)", "def test_delete_not_my_product(self):\n self._require_logi...
[ "0.8163337", "0.811003", "0.80877143", "0.80876744", "0.8045905", "0.79786986", "0.7882516", "0.7854732", "0.7846621", "0.7829516", "0.77844703", "0.77800816", "0.7772745", "0.77263916", "0.7600396", "0.7597553", "0.75532126", "0.7346543", "0.72736114", "0.7209453", "0.708175...
0.8068848
4
Adam optimizer with learning rate 0.0002 for the first 100k steps (~100 epochs) and a linearly decaying rate that goes to zero over the next 100k steps
def make_optimizer(loss, variables, name='Adam'): global_step = tf.Variable(0, trainable=False, name='global_step') starter_learning_rate = self.opt.lr end_learning_rate = 0.0 start_decay_step = self.opt.niter decay_steps = self.opt.niter_decay bet...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adam_optimizer(loss, initial_lr, decay_step, decay_rate):\n global_step = tf.train.get_or_create_global_step()\n lr = tf.train.exponential_decay(initial_lr, global_step, decay_step,\n decay_rate, staircase=True)\n\n optim = tf.train.AdamOptimizer(learning_rate=lr)\n ...
[ "0.7543031", "0.73133004", "0.724946", "0.7170338", "0.7165979", "0.7088052", "0.7046958", "0.6981401", "0.6972685", "0.69598085", "0.6947667", "0.69352144", "0.69040656", "0.6877185", "0.68620074", "0.6840973", "0.68289465", "0.6801931", "0.67928517", "0.6781422", "0.6772846...
0.68411076
15
return least common multiple of two integers
def lcm(x: int, y: int) -> int: assert isinstance(x, int) and isinstance(y, int) and x > 0 and y > 0 return int(x * y / gcd(x, y))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def least_common_multiple(number1, number2):\n return number1 * number2 // math.gcd(number1, number2)", "def lowest_common_multiple(a, b):\n # 两个数字相乘后除以最大公约数 = 两个数字的最小公倍数\n return a * b // gcd(a, b)", "def least_common_multiple2(number1, number2, number3, number4):\n return least_common_multiple((n...
[ "0.8421955", "0.8331325", "0.7644219", "0.76081353", "0.75759864", "0.75759864", "0.75638235", "0.7436232", "0.73484886", "0.7300214", "0.7295642", "0.72913396", "0.72913396", "0.72913396", "0.72913396", "0.72913396", "0.72913396", "0.72913396", "0.72913396", "0.72913396", "0...
0.71541774
27
tokenize using the nltk default (ptb + a 'punkt' sentence tokenizer)
def tokenize(self, N=None, drop_punctuation=True, lower=True): for tok in self.tokenize_generic(word_tokenize, N=N, drop_punctuation=drop_punctuation): if lower: tok = tok.lower() yield tok
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gpt2_tokenize(self, text: str):\n return self.bpe_tokenize(text)", "def preprocess(text):\n\tX = []\n\tsent_detector = nltk.data.load('tokenizers/punkt/english.pickle')\n\tfor t in text:\n\t\tsents = sent_detector.tokenize(t)\n\t\tresult = ''\n\t\tfor s in sents:\n\t\t\ttokens = word_tokenize(s)\n\t\t...
[ "0.7247982", "0.7229188", "0.7094783", "0.70895004", "0.70805717", "0.69946355", "0.6974862", "0.6922694", "0.6919841", "0.68694", "0.6835729", "0.6791642", "0.67796576", "0.6747571", "0.6684571", "0.66801494", "0.6662924", "0.6644727", "0.66325396", "0.6598598", "0.6588903",...
0.0
-1
Compute observation vector for solving the exterior orientation parameters of a single image based on their approximate values
def __ComputeObservationVector(self, groundPoints): n = groundPoints.shape[0] # number of points # Coordinates subtraction dX = groundPoints[:, 0] - self.exteriorOrientationParameters[0] dY = groundPoints[:, 1] - self.exteriorOrientationParameters[1] dZ = groundPoints[:, 2] - ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ev2vi(eV,mu): \n return cv*np.sqrt( eV*(eV+2.e0*mu*mpc2))/(eV+mu*mpc2)", "def ComputeInnerOrientation(self, imagePoints):\n # implementing observation vectors\n imagePoints = imagePoints.reshape(np.size(imagePoints), 1)\n\n fMarks = self.camera.fiducialMarks.reshape(np.size(self.c...
[ "0.60023314", "0.5932807", "0.5920514", "0.5843368", "0.58112794", "0.57958204", "0.5776637", "0.573947", "0.5736349", "0.5707544", "0.5702388", "0.5691359", "0.5680941", "0.5660144", "0.5651713", "0.5644874", "0.56244063", "0.55701184", "0.55645734", "0.5539961", "0.5539685"...
0.56527215
14
Compute observation vector for solving the exterior orientation parameters of a single image based on their approximate values
def __ComputeObservationVector_RzRyRz(self, groundPoints): n = groundPoints.shape[0] # number of points # Coordinates subtraction dX = groundPoints[:, 0] - self.exteriorOrientationParameters[0] dY = groundPoints[:, 1] - self.exteriorOrientationParameters[1] dZ = groundPoints[:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ev2vi(eV,mu): \n return cv*np.sqrt( eV*(eV+2.e0*mu*mpc2))/(eV+mu*mpc2)", "def ComputeInnerOrientation(self, imagePoints):\n # implementing observation vectors\n imagePoints = imagePoints.reshape(np.size(imagePoints), 1)\n\n fMarks = self.camera.fiducialMarks.reshape(np.size(self.c...
[ "0.600269", "0.5934908", "0.5921452", "0.58419925", "0.58109325", "0.5797084", "0.5777378", "0.57385683", "0.57354975", "0.57078993", "0.5702315", "0.5689945", "0.5679907", "0.5660313", "0.5653539", "0.5650662", "0.56459534", "0.5623185", "0.55718786", "0.55647194", "0.553900...
0.0
-1
Create a new Logger.
def __init__(self, file_path, print_too=True, override=False): self.file_path = file_path self.print_too = print_too if override: if os.path.exists(file_path): print('Overriding - deleting previous log...') os.remove(file_path) os.makedirs(os.p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_logger() -> logging.Logger:\n pass # TODO: Replace with implementation!", "def create_logger():\r\n global logger\r\n logger = logging.getLogger(logger_name)\r\n\r\n formatter = logging.Formatter(fmt='%(asctime)s %(levelname)s %(message)s')\r\n \r\n handler = logging.StreamHandler()...
[ "0.82856834", "0.7896472", "0.77731115", "0.7539057", "0.7495882", "0.7493682", "0.7396028", "0.73747236", "0.7198107", "0.71252424", "0.71039444", "0.7093442", "0.7016825", "0.69982064", "0.6978802", "0.69182163", "0.6911099", "0.6907273", "0.6900183", "0.6848638", "0.683535...
0.0
-1
Return github tag commit SHA URL as string
def get_url_tag_commit(self, git_sha): url = 'https://{}/{}/{}/commit/{}'.format( HOST_GITHUB, self.repo, self.product, git_sha ) return url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def git_url(fp: str) -> str:\n return f\"https://github.com/pantsbuild/pants/blob/release_{PANTS_SEMVER}/{fp}\"", "def github_url(self):\n return self.github.replace('.git', '')", "def repo_link(repo):\n return \"https://github.com/\" + repo", "def url_for(self: Self, commit_sha: str, path: str,...
[ "0.71973187", "0.69282585", "0.6792901", "0.6748358", "0.66634905", "0.6656634", "0.6605502", "0.6590671", "0.65770376", "0.6560338", "0.6532101", "0.65264523", "0.6505128", "0.6500491", "0.6499007", "0.64897436", "0.63229996", "0.6280397", "0.6262036", "0.6240915", "0.619329...
0.8073723
0
Gets the confidence of this PcrTestRecordResult.
def confidence(self): return self._confidence
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confidence(self) -> float:\n return self._confidence", "def confidence(self) -> float:\n return float(self.class_scores[self.class_num])", "def detection_confidence(self):\n return self._detection_confidence", "def get_medie_confidence(self):\n return self.__medie_confidence",...
[ "0.74183095", "0.695079", "0.6752761", "0.62172127", "0.6101365", "0.59268916", "0.59007055", "0.58964837", "0.58102906", "0.5795349", "0.5786901", "0.57829434", "0.5746195", "0.56174123", "0.56115687", "0.5601758", "0.55095553", "0.55019873", "0.545608", "0.5437329", "0.5400...
0.7580267
1
Sets the confidence of this PcrTestRecordResult.
def confidence(self, confidence): self._confidence = confidence
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confidence(self, confidence: float):\n\n self._confidence = confidence", "def confidence(self, confidence):\n\n self._confidence = confidence", "def confidence(self, confidence):\n\n self._confidence = confidence", "def confidence(self) -> float:\n return self._confidence", ...
[ "0.73178154", "0.72186536", "0.72186536", "0.64052767", "0.624179", "0.624179", "0.6131234", "0.6131234", "0.60332805", "0.60332805", "0.5945399", "0.59088707", "0.5768737", "0.5661176", "0.51978236", "0.5128352", "0.5126153", "0.5094373", "0.5067891", "0.50525135", "0.501097...
0.72880876
2
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, PcrTestRecordResult): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
This function returns True if userInput can be converted to a number and returns False if it cannot.
def CheckNumber(userInput): try: float(userInput) return True except(ValueError): return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_number(value_if_allowed):\n if value_if_allowed == '':\n return True\n try:\n float(value_if_allowed)\n return True\n except ValueError:\n return False", "def __checkInput(self, var):\n try:\n int(var)\n\n except:\n return Fals...
[ "0.7273646", "0.710573", "0.70342", "0.700277", "0.6989638", "0.69800496", "0.6931918", "0.68965924", "0.68937594", "0.68852633", "0.6882689", "0.68496823", "0.6842476", "0.6823968", "0.68192196", "0.68040407", "0.679756", "0.6784865", "0.67602575", "0.6758838", "0.673784", ...
0.86746126
0
Adds the required columns to the table and appends new records if given.
def extend_table(table, rows=None): try: if rows is None: rows = [] dtypes = np.dtype( [ ('_ID', np.int), ('MEAN_DEF_CNT', np.float64), ('MEDIAN_DEF_CNT', np.int32), ('MIN_DEF_CNT', np.int32), ('M...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_cols(self, source) :\n\n cols = source.get_cols()\n types = source.get_types()\n\n new_cols = []\n new_types = []\n for i in range(len(cols)) :\n if cols[i] not in self.cols :\n new_cols.append(cols[i])\n new_types.append(typ...
[ "0.6977524", "0.66601425", "0.6458155", "0.63593054", "0.6348672", "0.63241756", "0.63117015", "0.62366897", "0.62343997", "0.6218119", "0.61731595", "0.61588264", "0.60610455", "0.6052164", "0.6035236", "0.60302246", "0.5991479", "0.59869546", "0.5986548", "0.5966985", "0.58...
0.0
-1
Factory method to create a cache object from github/spilchen/baseball_id_db This is called as part of package initialization and so can be refered to via the Lookup variable. >>> from baseball_id import Lookup >>> Lookup.from_yahoo_ids([10794, 9542, 7578])
def create(cls): ssl._create_default_https_context = ssl._create_unverified_context c = lookup.Cache('https://raw.githubusercontent.com/spilchen/baseball_id_db/main/master.csv') return c
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_fake(cls):\n source = pkg_resources.open_text('baseball_id', 'sample.master.csv',\n encoding='iso-8859-1')\n c = lookup.Cache(source)\n return c", "def construct(cls, obs_lists, platform_id):\n step = 0\n LookupTable = []\n ...
[ "0.6530035", "0.5592927", "0.5449668", "0.54129845", "0.5390788", "0.5236379", "0.52326137", "0.52017933", "0.5083397", "0.50474405", "0.49929607", "0.4948093", "0.49268007", "0.48906374", "0.48458242", "0.48337904", "0.4833684", "0.48185053", "0.481795", "0.4808004", "0.4792...
0.6934165
0
Shannon Entropy Calculates the Shannon Entropy for the given data array x.
def entropy(x, bins, normalize=False, xy_probabilities=False): # calculate probabilities if xy_probabilities == False if xy_probabilities: # if x does not sum up to 1, raise an error if not np.isclose(sum(x),1,atol=0.0001): raise ValueError('Probabilities in vector x do not sum up to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ShannonEntropy(self,s):\n e = s[np.nonzero(s)]**2 * np.log(s[np.nonzero(s)]**2)\n return np.sum(e)", "def entropy(x):\n nz = np.nonzero(x)[0]\n return -np.sum(x[nz]*np.log2(x[nz]))", "def H(self, data):\n entropy = 0\n\n if not data:\n return entropy\n\n ...
[ "0.7339232", "0.6906172", "0.67469835", "0.66126776", "0.6580351", "0.6566007", "0.65266234", "0.646055", "0.6361494", "0.6340554", "0.62182045", "0.6194352", "0.6190961", "0.6157335", "0.6148306", "0.61020863", "0.6101131", "0.60966253", "0.6066495", "0.60436225", "0.6029721...
0.6537447
6
Cross Entropy Calculates the cross entropy of two discrete distributions x and y.
def cross_entropy(x, y, bins, xy_probabilities=False): # calculate probabilities if probabilities == False if xy_probabilities: # same bins for x and y -> same length of x and y if xy_probabilities == True assert len(x) == len(y) # if x does not sum up to 1, raise an error if not...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cross_entropy(x, y):\n\n if len(y.shape) == 1:\n return F.cross_entropy(x, y)\n if y.shape[1] == 1:\n y = y.squeeze(1)\n return F.cross_entropy(x, y)\n\n return torch.mean(\n torch.div(\n F.binary_cross_entropy_with_logits(x, y, reduction=\"none\"),\n ...
[ "0.7399793", "0.7246357", "0.71943384", "0.70277774", "0.6669306", "0.6637702", "0.6602384", "0.65894943", "0.65266645", "0.6473503", "0.6437216", "0.642684", "0.63894004", "0.6365542", "0.6353329", "0.63220906", "0.628778", "0.6279644", "0.62760943", "0.6269529", "0.62406224...
0.7348612
1
Method for parsing CLI arguments using argparse.
def parse_parameters(): parser = argparse.ArgumentParser( description="Get all dependent review IDs") parser.add_argument("-r", "--review-id", type=str, required=True, help="Review ID") parser.add_argument("-o", "--out-file", type=str, required=False, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_cli_arguments():\n parser = argparse.ArgumentParser('Generates a MANIFEST file used by the '\n 'HMP2 AnADAMA2 workflows.')\n parser.add_argument('-b', '--broad-data-sheet', required=True,\n help='Broad data product status spreadsheet. '\n ...
[ "0.80792505", "0.8012675", "0.78432906", "0.78108615", "0.7765357", "0.7751876", "0.77110696", "0.76705295", "0.7647746", "0.7644992", "0.7644233", "0.76380914", "0.75653404", "0.7562569", "0.75440955", "0.7535946", "0.75321084", "0.75190026", "0.75150883", "0.7505613", "0.74...
0.0
-1
Return the distance between this WordForm and the one provided.
def distance(self, wf, positions = None, features = None): dist = 0 # Iterate through positions in the WordForm. for position in range(3): if positions == None or position in positions: if self.segments[position].seg_type == wf.segments[position].\ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(self):\n return self.value * len(self.alignment.query)", "def distance(self):\n return self._distance", "def distance(self) -> int:\n return 0", "def distance(self) -> float:\n return self._dist_two_wire() # at this time we only support 2-wire meausre", "def get_di...
[ "0.7310629", "0.7117631", "0.7048731", "0.7045804", "0.6998764", "0.69940305", "0.68218845", "0.66140974", "0.66028076", "0.65679866", "0.6541728", "0.6533054", "0.65226877", "0.65203345", "0.6491885", "0.6491787", "0.6487429", "0.6487429", "0.6478075", "0.6459302", "0.644873...
0.6702924
7
Given a dictionary, converts both the keys and values of it to string and returns it.
def stringify_dict(d: dict) -> dict: return {str(key): str(value) for key, value in d.items()}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keys2string(dictionary):\r\n if not isinstance(dictionary, dict):\r\n return dictionary\r\n return dict((str(k), keys2string(v)) \r\n for k, v in dictionary.items())", "def convert_keys_to_string(dictionary):\n if not isinstance(dictionary, dict):\n return dictionary\n return...
[ "0.8282609", "0.8013096", "0.79114354", "0.7898864", "0.7838265", "0.77222395", "0.7700551", "0.75931054", "0.75236297", "0.74511623", "0.7303022", "0.727308", "0.70777315", "0.6990856", "0.69411385", "0.68564725", "0.6851728", "0.68371916", "0.6835815", "0.6810409", "0.67745...
0.72467685
12
Authorization header credentials are not valid
def bad_credentials(self, token = True): # Should not match up with anything in the database bad_creds = str(uuid.uuid4()) if token: return self.credentials(HTTP_AUTHORIZATION=("Token %s" % bad_creds)) else: return self.credentials(HTTP_AUTHORIZATION=("Basic %s"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unauthorized():\n return HttpError(401)", "def authenticate_header(self, request):\n return \"Api key authentication failed.\"", "def test_authorization_header_empty(self, get_key_secret):\r\n request = Request(self.environ)\r\n request.authorization = \"bad authorization header\"\r...
[ "0.7151656", "0.6980444", "0.69387716", "0.6932599", "0.69088596", "0.6879544", "0.6865807", "0.68371814", "0.6741195", "0.6717008", "0.67152405", "0.668238", "0.66528887", "0.66374475", "0.66084486", "0.65807706", "0.6570014", "0.6560585", "0.6551", "0.65419096", "0.65318316...
0.63877547
33
Create and return an author for testing
def create_author(user_dict, author_dict): user = User.objects.create_user(**user_dict) user.save() author_dict['user'] = user author = Author.objects.create(**author_dict) author.save() return (user, author)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample_author(first_name='testfirstname', last_name='testlastname'):\n return Author.objects.create(first_name=first_name, last_name=last_name)", "def create_author(name):\n return Author.objects.create(name=name)", "def create(self, validated_data):\n return Author.objects.get_or_create_autho...
[ "0.79695106", "0.7857562", "0.7657986", "0.746278", "0.71505", "0.7013657", "0.6913632", "0.6895028", "0.68653756", "0.6783304", "0.6783304", "0.66965", "0.6666494", "0.66540325", "0.6537066", "0.64950055", "0.64649695", "0.64644116", "0.6461421", "0.6401893", "0.63745886", ...
0.7088164
5
Returns the expression in infix form.
def infix(self): return str(self.data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def infix(self):\n return \"(\" + self.leftOperand.infix() + \" \" + str(self.operator) + \" \" + self.rightOperand.infix() + \")\"", "def calculate_infix_expression(cls, expression):\n\t\tlogger.info(f\"in the calculate infix expression {expression}\")\n\t\telements = expression.split()\n\t\tstack = []\n...
[ "0.820744", "0.74909353", "0.6935869", "0.68716174", "0.6740321", "0.670735", "0.66578454", "0.6584289", "0.6553258", "0.64778376", "0.636958", "0.6362766", "0.6355834", "0.634328", "0.6335792", "0.6330504", "0.6273808", "0.62522274", "0.62522274", "0.62522274", "0.624801", ...
0.68402994
4
Returns the expression in postfix form.
def postfix(self): return str(self.data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def infix_to_postfix(self, expr: str) -> str:\n\n # The stack that we will be performing operations on\n stack: list[str] = []\n\n # The output\n output: str = \"\"\n\n # We always need surrounding parentheses\n expr = f\"({expr})\"\n\n # The tokenized expression\n ...
[ "0.7961822", "0.78936446", "0.7821992", "0.77166677", "0.76865053", "0.7469475", "0.7190205", "0.71594596", "0.7055572", "0.696866", "0.6934861", "0.6923071", "0.6912573", "0.68213874", "0.6815801", "0.68071514", "0.6803007", "0.67953223", "0.67841136", "0.67317486", "0.66949...
0.6813625
15
Returns the expression in infix form (fully parenthesized).
def infix(self): return "(" + self.leftOperand.infix() + " " + str(self.operator) + " " + self.rightOperand.infix() + ")"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate_infix(string):\n return postfix(infix_to_postfix(string))", "def infix_to_prefix(self, expr: str) -> str:\n\n # Reverse expr\n expr = reversed(expr)\n\n # Convert expr to list\n expr = list(expr)\n\n # Reverse all parantheses\n for i, e in enumerate(expr)...
[ "0.71687776", "0.70765674", "0.70678484", "0.70356464", "0.69882065", "0.6876605", "0.6813432", "0.6722101", "0.6542399", "0.6502566", "0.648048", "0.64614725", "0.645874", "0.63886565", "0.63599867", "0.632505", "0.626854", "0.6246395", "0.62401587", "0.62371445", "0.6197802...
0.81181073
0
Publish helm chart index to github pages
def publish_pages(name, paths, git_repo, published_repo, extra_message=''): version = last_modified_commit(*paths) checkout_dir = '{}-{}'.format(name, version) check_call([ 'git', 'clone', '--no-checkout', git_remote(git_repo), checkout_dir], echo=False, ) check_call(['git', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def template(c, release=\"url-shortener\"):\n c.run(f\"helm template {release} {HELM_CHART_DIR} > ./generated-deployment.yml\")", "def index():\n return render_template(\"charts.html\")", "def main():\n \n root = Folder(name=os.getcwd(), file='meta.json',\n collection='.github/jeky...
[ "0.6303632", "0.5992799", "0.59895986", "0.56986564", "0.5615526", "0.55472004", "0.5513828", "0.53691167", "0.5364688", "0.5286044", "0.5263749", "0.52587676", "0.5251907", "0.5230299", "0.5216074", "0.52005446", "0.5190611", "0.5182666", "0.5175446", "0.51723653", "0.516488...
0.6350673
0
Close the connection to the database Closing a connection makes it unsuitable for any further database access. This applies to all objects that may retain a reference to the connection being closed. Any uncommitted changes will be lost
def detach(self): # if i don't have an existing connection to the back end, do nothing if self.connection is None: return # otherwise, close the connection status = self.postgres.disconnect(self.connection) # invalidate the member self.connection = None # and re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_db_connection(cls):\n db.close()", "def close_database(self):\n if self._conn is not None:\n self._conn.close()\n self._conn = None", "def close_connection(self):\n if self.cursor is None and self.database is None:\n # if we don't have an open con...
[ "0.84439224", "0.83842707", "0.8336061", "0.8335705", "0.83256894", "0.8237229", "0.81866556", "0.8157642", "0.8143764", "0.8094697", "0.80411196", "0.7991679", "0.7938622", "0.7927069", "0.7838937", "0.7826264", "0.780774", "0.7779079", "0.77731264", "0.7767926", "0.77654034...
0.0
-1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, ShowProjectWorkHoursResponseBodyWorkHours): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
This is the view handler for the "/" url.
async def index(request): # Note: we return a dict not a response because of the @template decorator return { 'title': request.app['name'], 'intro': "Success! you've setup a basic aiohttp app.", }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def root(self, request):\n return ''", "def index(_):\n template = loader.get_template('route/home.html')\n return HttpResponse(template.render(Context({})))", "def root(self):\n return self.app.get('/',headers=self.headers)", "def get(self):\n\n self.response.out.write(template.re...
[ "0.6833893", "0.68323773", "0.68276465", "0.6732128", "0.6723868", "0.67115694", "0.670275", "0.670275", "0.6678917", "0.6669672", "0.66280764", "0.6614279", "0.6596165", "0.6596165", "0.6596165", "0.6584849", "0.6568513", "0.6565733", "0.6544685", "0.6540552", "0.6508354", ...
0.0
-1
Draw detected bounding boxes.
def vis_detections(im, class_name, dets, thresh=0.5): im = im[:, :, (2, 1, 0)] fig, ax = plt.subplots(figsize=(12, 12)) ax.imshow(im, aspect='equal') for i, det in enumerate(dets): bbox = dets[i, :4] score = dets[i, -1] ax.add_patch( plt.Rectangle((bbox[0], bbox[1]),...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_bounding_boxes(self, bounding_boxes, output):\n for i, bb in enumerate(bounding_boxes):\n\n if bb[2] > output.shape[1] or bb[3] > output.shape[0] or bb[0] < 0 or bb[1] < 0:\n continue\n cv2.rectangle(\n np.asarray(output), (bb[0], bb[1]), (bb[2], ...
[ "0.77598673", "0.7638101", "0.7510348", "0.72977304", "0.7150563", "0.7103931", "0.7101873", "0.7083905", "0.7020769", "0.6993739", "0.6974172", "0.69637305", "0.6859061", "0.68521667", "0.68319523", "0.6830371", "0.6809837", "0.6805064", "0.67750585", "0.6774759", "0.6742592...
0.0
-1
checking if adding another owner from the current owner's token works as expected.
def test_channel_addowner_standard_input(): clear() auth_register('randemail@gmail.com', 'password1234', 'Jane', 'Citizen') register_second_result = auth_register('randemail2@gmail.com', 'password1234', 'Jane', 'Citizen') randChannel_id = channels_create(register_second_result['token'], 'Random Channel'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_channel_addowner_already_an_owner():\n clear()\n auth_register('randemail@gmail.com', 'password1234', 'Jane', 'Citizen')\n register_second_result = auth_register('randemail2@gmail.com', 'password1234', 'Jane', 'Citizen')\n randChannel_id = channels_create(register_second_result['token'], 'Rand...
[ "0.68776894", "0.67999893", "0.6754783", "0.668292", "0.6530196", "0.64863986", "0.6447112", "0.6423208", "0.62997204", "0.6244084", "0.6210982", "0.612194", "0.61106676", "0.60979927", "0.6089244", "0.5948427", "0.59481156", "0.59479606", "0.59267443", "0.5896144", "0.584883...
0.6017289
15
checking if owner of the flockr who is not the channel owner can add owner
def test_channel_addowner_owner_flockr(): clear() register_first_result = auth_register('randemail@gmail.com', 'password1234', 'Jane', 'Citizen') register_second_result = auth_register('randemail2@gmail.com', 'password1234', 'Jane', 'Citizen') register_third_result = auth_register('randemail3@gmail.com'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_channel_owner():\n\n async def check(ctx):\n if ctx.guild:\n owner = ctx.author == ctx.guild.owner\n if not owner:\n await ctx.send(\"I guess you are not this server's pogchamp. Bruh.\")\n return owner\n return True\n\n return commands.chec...
[ "0.7385676", "0.7370181", "0.7258386", "0.70770735", "0.700007", "0.69392306", "0.6930852", "0.6926534", "0.6849369", "0.6614387", "0.6608435", "0.65947664", "0.65030146", "0.6469669", "0.6452825", "0.64186174", "0.63679105", "0.6348153", "0.6341457", "0.6329557", "0.6293552"...
0.7151373
3
checking if able to remove an owner who is the last owner of the channel
def test_channel_removeowner_last_owner(): clear() register_first_result = auth_register('randemail@gmail.com', 'password1234', 'Jane', 'Citizen') register_second_result = auth_register('randemail2@gmail.com', 'password1234', 'Jane', 'Citizen') randChannel_id = channels_create(register_second_result['to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def channel_removeowner(token, channel_id, u_id):\n # Check if token is valid and raise AccessError if not\n curr_id = database.get_current_user(token)\n # gets current channel data\n curr_channel = database.get_channel_data(channel_id)\n # gets the permissions of current user from database\n use...
[ "0.73305464", "0.7195283", "0.7129515", "0.712579", "0.70183945", "0.6805983", "0.67637455", "0.66506666", "0.65761715", "0.6486065", "0.6440695", "0.6412174", "0.6344784", "0.6314831", "0.6306158", "0.62849295", "0.62610173", "0.6227882", "0.6078866", "0.607737", "0.60758984...
0.7552469
0