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
the contribution of row x_i to the gradient of the directionw variance
def directional_variance_gradient_i(x_i, w): projection_length = dot(x_i, direction(w)) return [2 * projection_length * x_ij for x_ij in x_i]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gradient(self):\n result = np.zeros(len(self.variables))\n result[self.bivariateGradInd] = (self.shape-1)/self.variable - self.rate\n return result", "def compute_gradient (w, x, y):\n (n,d) = x.shape\n g = np.zeros(d)\n for i in range(0,d):\n g[i] = (w*x-...
[ "0.7332294", "0.7314207", "0.720555", "0.7139673", "0.70523137", "0.6897457", "0.6897457", "0.682514", "0.6810973", "0.67959696", "0.67945766", "0.67893934", "0.6779183", "0.67715824", "0.67510855", "0.6737139", "0.6724511", "0.67163056", "0.6688505", "0.6656272", "0.66454065...
0.8015644
1
Sets the release_epoch of this CollectorVersion.
def release_epoch(self, release_epoch): self._release_epoch = release_epoch
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_epoch(self, epoch):\n self.epoch = epoch", "def set_epoch(self, epoch=None):\n params = {'epoch': epoch if epoch is not None else int(time.time())}\n return self._jadeRpc('set_epoch', params)", "def set_epoch(self, epoch):\r\n pass", "def setepoch(self, value):\n re...
[ "0.6811963", "0.6683413", "0.6523774", "0.6377381", "0.59769183", "0.57796484", "0.5565895", "0.55534136", "0.5510887", "0.53699446", "0.5344769", "0.53339374", "0.5237614", "0.52344424", "0.52344424", "0.5160822", "0.49955228", "0.49861106", "0.4978212", "0.49504015", "0.491...
0.8451164
0
Sets the major_version of this CollectorVersion.
def major_version(self, major_version): self._major_version = major_version
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def browser_version_major(self, browser_version_major):\n # type: (string_types) -> None\n\n if browser_version_major is not None:\n if not isinstance(browser_version_major, string_types):\n raise TypeError(\"Invalid type for `browser_version_major`, type has to be `string_t...
[ "0.6657213", "0.6617845", "0.6598632", "0.6555598", "0.6555598", "0.650386", "0.6487047", "0.6453586", "0.6437726", "0.6417039", "0.63698566", "0.63545835", "0.63488394", "0.6337582", "0.6337582", "0.6315402", "0.6315402", "0.6315402", "0.6315402", "0.6315402", "0.6315402", ...
0.8690246
1
Sets the mandatory of this CollectorVersion.
def mandatory(self, mandatory): self._mandatory = mandatory
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def required(self, required):\n\n self._required = required", "def required(self, required):\n\n self._required = required", "def required(self, required):\n\n self._required = required", "def required(self, required):\n\n self._required = required", "def set_required(self, val)...
[ "0.6443366", "0.6443366", "0.6443366", "0.6443366", "0.64089954", "0.6319373", "0.63168454", "0.62835807", "0.62778246", "0.6180539", "0.58494174", "0.57990867", "0.57870793", "0.57630116", "0.56941086", "0.5641501", "0.56404006", "0.5639135", "0.5608891", "0.5596976", "0.557...
0.74486077
1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, CollectorVersion): 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
Generate random key, givin a number of characters
def generate_randomkey(length): chars = string.letters + string.digits return ''.join([choice(chars) for i in range(length)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_random_key(self):\n self.key = ''.join(choice(ascii_letters + digits) for i in range(300))", "def gen_key():\n key = []\n chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'\n for i in xrange(20):\n key.append(random.choice(chars))\n retur...
[ "0.8658836", "0.858781", "0.85186636", "0.8459641", "0.84569067", "0.84276855", "0.84031445", "0.83553386", "0.8260222", "0.82262176", "0.82046956", "0.8191725", "0.812086", "0.80250627", "0.78993857", "0.7890747", "0.78621924", "0.77921325", "0.7791116", "0.7755063", "0.7724...
0.8498028
3
Weights are initialized using the Bengio and Glorot (2010) initialization scheme.
def __init__(self, n_x, n_z, qz_hid, px_hid, filters, seq_length=50, nonlinearity=rectify, px_nonlinearity=None, x_dist='linear', batchnorm=False, seed=1234): super(CVAE, self).__init__(n_x, qz_hid + px_hid, n_z, nonlinearity) self.x_dist = x_dist self.n_x = n_x sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_weight(self):\n init_bn(self.norm0)", "def _initialize_weights(self):\n pass", "def init_weights_(self):\n raise NotImplementedError", "def init_weights(self):\n # Initialize weights\n self.apply(self._init_weights)\n # Tie weights if needed\n self.ti...
[ "0.8310163", "0.82536477", "0.8131083", "0.7831155", "0.7764457", "0.77470034", "0.7730856", "0.77129114", "0.77019745", "0.7687238", "0.7679504", "0.7675716", "0.76729214", "0.7648854", "0.7641878", "0.7641878", "0.76319313", "0.7597613", "0.75734705", "0.7541327", "0.754132...
0.0
-1
Return a list of supported package managers.
def platforms(self) -> Any: return search_api("platforms")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPackageManager(self) -> None:\n\t\tfor pkgmgr in config.SUPPORTED_PACKAGE_MGRS:\n\t\t\tif subprocess.run([\"which\", pkgmgr]).returncode == 0:\n\t\t\t\tself.package_manager = pkgmgr\n\t\t\t\treturn\n\t\tlogger.error(\"Supported package manager not found, aborting.\")\n\t\traise ValueError(\"Package manager ...
[ "0.7700077", "0.75659144", "0.6550893", "0.61498415", "0.6098986", "0.6078767", "0.60544133", "0.59762645", "0.59596175", "0.5951968", "0.58537924", "0.5812237", "0.58035356", "0.57983994", "0.57926255", "0.5749286", "0.57395107", "0.5710506", "0.5709883", "0.5701785", "0.568...
0.0
-1
Get breakdown of SourceRank score for a given project.
def project_sourcerank(self, manager: str, package: str) -> Any: return search_api("pproject_sourcerank", manager, package)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_scores(self):\n\n\t\tscores = np.dot(self.rankings, self.weights)\n\t\tranked_indices = np.argsort(scores)\n\t\tranked_sources = self.source_names[ranked_indices]\n\t\tranked_scores = sorted(scores)\n\t\tself.scores = {source:score for source, score in zip(ranked_sources, ranked_scores)}\n\n\t\treturn self...
[ "0.6547779", "0.58060926", "0.5747817", "0.5719544", "0.5697236", "0.5689695", "0.5684404", "0.56615955", "0.5646133", "0.56278735", "0.5621147", "0.561842", "0.5550426", "0.55491066", "0.55491066", "0.55491066", "0.5544229", "0.5542248", "0.5528607", "0.5522677", "0.54917264...
0.0
-1
Computes binary cross entropy given `preds`. For brevity, let `x = `, `z = targets`. The logistic loss is loss(x, z) = sum_i (x[i] log(z[i]) + (1 x[i]) log(1 z[i]))
def binary_cross_entropy(preds, targets, name=None): eps = 1e-12 with ops.op_scope([preds, targets], name, "bce_loss") as name: preds = ops.convert_to_tensor(preds, name="preds") targets = ops.convert_to_tensor(targets, name="targets") return tf.reduce_mean(-(targets * tf.log(preds + eps...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def binary_cross_entropy(y_true, y_preds):\n return np.sum(y_true * np.log(y_preds) + (1 - y_true) * np.log(1 - y_preds))", "def cross_entropy(predictions, targets):\n likelihood = targets * np.log(predictions)\n return -np.sum(likelihood) / predictions.shape[0]", "def my_softmax_cross_entropy(preds, ...
[ "0.7797153", "0.7434251", "0.7318877", "0.7174354", "0.7057622", "0.6963065", "0.6960481", "0.6934669", "0.69108826", "0.6899169", "0.68889576", "0.68759143", "0.6864232", "0.67918164", "0.6779397", "0.67633474", "0.67586994", "0.67579633", "0.6752833", "0.67452437", "0.67382...
0.7596741
1
Add an edge to the map graph.
def add_node(self, node, parent): if node not in self.map.edges: self.map.edges[node] = [] if parent not in self.map.edges: self.map.edges[parent] = [node] else: self.map.edges[parent].append(node)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_edge(self, edge):\n if(self.has_edge(edge) == 0):\n self.__graph_dict[edge[0]].append(edge[1])", "def add_edge(self, edge):\n self[edge[0]][edge[1]] = edge\n self[edge[1]][edge[0]] = edge", "def add_edge(self, edge):\n edge = set(edge)\n (vertex1, vertex2) ...
[ "0.83392376", "0.81278765", "0.80173993", "0.7984091", "0.7835019", "0.78344554", "0.7773003", "0.77704096", "0.7701559", "0.7651814", "0.7638381", "0.7632663", "0.762848", "0.7609487", "0.7549803", "0.7545375", "0.75156766", "0.747663", "0.7461042", "0.74141073", "0.7393054"...
0.0
-1
r"""Sets up actor critic and agent for PPO.
def _setup_actor_critic_agent(self, ppo_cfg: Config) -> None: logger.add_filehandler(self.config.LOG_FILE) self.actor_critic = PointNavBaselinePolicy( observation_space=self.envs.observation_spaces[0], action_space=self.envs.action_spaces[0], hidden_size=ppo_cfg.hidd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _setup_actor_critic_agent(self, ppo_cfg: Config) -> None:\n logger.add_filehandler(self.config.LOG_FILE)\n\n self.actor_critic = RearrangementBaselinePolicy(\n observation_space=self.envs.observation_spaces[0],\n action_space=self.envs.action_spaces[0],\n hidden_s...
[ "0.8002376", "0.7379803", "0.62190187", "0.61917746", "0.61137176", "0.6070026", "0.60484576", "0.5936954", "0.5790541", "0.57671416", "0.5742905", "0.57137734", "0.5711547", "0.57044065", "0.5698852", "0.56630653", "0.5593745", "0.55782545", "0.5576158", "0.5555962", "0.5555...
0.7934495
1
r"""Load checkpoint of specified path as a dict.
def load_checkpoint(self, checkpoint_path: str, *args, **kwargs) -> Dict: return torch.load(checkpoint_path, *args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_checkpoint(checkpoint_path):\n flat_checkpoint_dict = flatten_checkpoint(\n parse_checkpoint(checkpoint_path), keep_empty_nodes=True)\n return flat_checkpoint_dict", "def load_checkpoint(path: str, use_cuda: bool = True) -> dict:\n assert os.path.isfile(path), \"Checkpoint %s not found\" % pat...
[ "0.79297304", "0.7479824", "0.74438775", "0.72753435", "0.72636914", "0.72578204", "0.7252959", "0.7251487", "0.7106286", "0.70928234", "0.69360524", "0.6928563", "0.6907461", "0.68946135", "0.68521416", "0.6832916", "0.6828849", "0.6801976", "0.6800765", "0.679697", "0.67956...
0.8017397
0
Use to get group's theme.
def get_group_theme(request): return render(request,"404.html",{})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_theme(self) -> str:\n return self.theme or self.account.theme", "def set_group_theme(request):\n\treturn render(request,\"404.html\",{})", "def themeinfo(self):\n return theme_registry.find(self.theme)", "def _get_theme_selected():\n\n try:\n theme_selected = Configuration.obj...
[ "0.7389288", "0.68351203", "0.6807705", "0.6790007", "0.63535684", "0.633798", "0.6177183", "0.6060026", "0.60186356", "0.59636354", "0.5958081", "0.5955046", "0.5907645", "0.5893277", "0.5876983", "0.584938", "0.584506", "0.57964414", "0.5794664", "0.56828433", "0.5681695", ...
0.7487923
0
This sets group type (e.g. public, private)
def set_group_type(request): return render(request,"404.html",{})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setKind(self, *args):\n return _libsbml.Group_setKind(self, *args)", "def group(self, group):\n self._group = group", "def set_group(self, group):\n self._group = group", "def set_group(self, group: str) -> None:\n self.group = group", "def group(self, group):\n\n sel...
[ "0.7137174", "0.6834552", "0.6830443", "0.6814795", "0.6670212", "0.6670212", "0.6670212", "0.66593075", "0.6599331", "0.6586782", "0.6467534", "0.63364875", "0.62207776", "0.61769044", "0.6157289", "0.6124211", "0.6078344", "0.60774916", "0.6027765", "0.6009475", "0.6008881"...
0.6038181
18
Forward to privacy setting of invite, don't send invite yet
def send_personal_group_invite(request): if request.method == "POST": invite_decision = request.POST.get('invite_dec',None) if invite_decision == '1': context = {'set_privacy':True,'target_av_url':request.session.get("personal_group_invite_target_av_url",None),\ 'tun':request.session.get("personal_group_invi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invite(self):\n pass", "async def invite(self, ctx):\n perms = discord.Permissions.text()\n perms.update(read_messages=True, manage_messages=True,\n mention_everyone=False, send_tts_messages=False)\n await ctx.send(f'Invite me here:\\n<{discord.utils.oauth_url(...
[ "0.7530421", "0.67867", "0.67555034", "0.66568404", "0.6581512", "0.6480487", "0.646819", "0.63986754", "0.6363194", "0.6356383", "0.62701565", "0.6256767", "0.6224702", "0.6204673", "0.62041575", "0.6186631", "0.6131908", "0.6121313", "0.6121313", "0.60941875", "0.60837555",...
0.66117483
4
Set privacy level of invite and send the invite
def change_personal_group_invite_privacy(request): if request.method == "POST": own_id = request.user.id target_id = request.session.get("personal_group_invite_target_id",None) group_id, already_exists = personal_group_already_exists(own_id, target_id) if already_exists: request.session["personal_group_tid_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def invite(self, ctx):\n perms = discord.Permissions.text()\n perms.update(read_messages=True, manage_messages=True,\n mention_everyone=False, send_tts_messages=False)\n await ctx.send(f'Invite me here:\\n<{discord.utils.oauth_url(self.bot.user.id, perms)}>')", "asy...
[ "0.6880561", "0.6618525", "0.6595344", "0.6565168", "0.6526548", "0.633976", "0.62297964", "0.6194656", "0.6180213", "0.61728865", "0.61652017", "0.61484355", "0.60873777", "0.6046216", "0.60355604", "0.60337967", "0.5981624", "0.5947168", "0.59104925", "0.58690494", "0.58593...
0.66122437
2
Accept or decline invite directly from invite lists
def process_personal_group_invite(request): if request.method == "POST": own_id, target_id = request.user.id, request.POST.get("tid",None) int_tid = int(target_id) own_cred, their_cred = get_user_credentials(str(own_id), target_id) own_username, own_av_url, target_username, target_av_url = own_cred[0], own_cre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invite(self):\n pass", "def accept_invite(self):\n url = API_PATH[\"accept_mod_invite\"].format(subreddit=self.subreddit)\n self.subreddit._reddit.post(url)", "def accept_invite_requests(invite_requests):\n for invite_request in invite_requests:\n accepting_user = invite_requ...
[ "0.72205186", "0.6613297", "0.660211", "0.6537609", "0.64357704", "0.6431998", "0.63082975", "0.62615", "0.61938006", "0.6102067", "0.6072006", "0.60709494", "0.6059142", "0.60496634", "0.6007082", "0.5974971", "0.59186065", "0.5867798", "0.58490855", "0.5848353", "0.5847169"...
0.0
-1
Convert class labels from scalars to onehot vectors.
def dense_to_one_hot(labels_dense, num_classes=10): num_labels = labels_dense.shape[0] index_offset = np.arange(num_labels) * num_classes labels_one_hot = np.zeros((num_labels, num_classes)) labels_one_hot.flat[index_offset + labels_dense.ravel()] = 1 return labels_one_hot
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot(labels, classes=None):\n return K.utils.to_categorical(labels, classes)", "def one_hot(labels, classes=None):\n\n one_hot_ = K.utils.to_categorical(labels, classes)\n return(one_hot_)", "def to_onehot(labels: torch.Tensor, num_classes: int) -> torch.Tensor:\n if len(labels.size()) == 1:...
[ "0.8250402", "0.807683", "0.80523187", "0.7977843", "0.7908335", "0.7900327", "0.7892233", "0.7869711", "0.7849721", "0.7849721", "0.7826951", "0.7826122", "0.77677035", "0.7765413", "0.77540547", "0.77540547", "0.77540547", "0.77489346", "0.7742955", "0.7737176", "0.77226317...
0.7622406
36
take 1D float array of rewards and compute discounted reward
def discount_rewards(r): discounted_r = np.zeros_like(r) running_add = 0 for t in reversed(xrange(0, r.size)): running_add = running_add * gamma + r[t] discounted_r[t] = running_add return discounted_r
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def discount_rewards(rewards):\r\n discounted_r = np.zeros_like(rewards)\r\n running_add = 0\r\n for t in reversed(range(0, len(rewards))): \r\n running_add = running_add * reward_discount + rewards[t]\r\n discounted_r[t] = running_add\r\n return discounted_r", "def discoun...
[ "0.8100923", "0.78397125", "0.7792625", "0.7742053", "0.75987715", "0.7583268", "0.75820553", "0.7579539", "0.7536054", "0.7519005", "0.75047183", "0.7467692", "0.7456702", "0.7433794", "0.7426565", "0.74062765", "0.73950297", "0.7370545", "0.73564714", "0.7328519", "0.720184...
0.7653779
4
Return a readable representation of an accountability.
def __repr__(self): return '<Accountability %r>' % self.id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n return 'ATMBankAccount({}, {})'.format(\n self.account_id,\n self.balance\n )", "def __str__(self):\n\n return \"\\nBasic Account\\nAccount Name: {self.name}\\nAccount Number: {self.acNum:03d}\\nAvailable Balance: £{self.balance:.2f}\".format(s...
[ "0.6149212", "0.6019905", "0.59656304", "0.5801209", "0.5736531", "0.57005835", "0.5658715", "0.55898494", "0.550982", "0.5495466", "0.54727226", "0.5426019", "0.5414906", "0.53990155", "0.5395794", "0.53868467", "0.5385145", "0.53606945", "0.53606945", "0.53493434", "0.53247...
0.80887556
0
Return a JSONencoded representation of an accountability.
def serialize(self): return { 'id': self.id, 'title': self.title, 'role_id': self.role_id }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n return '<Accountability %r>' % self.id", "def to_json(self):\n def convert(o):\n if type(o) is Card:\n return o.ident\n else:\n return o.__dict__\n\n return json.dumps(self, default=convert)", "def to_json(self):\n ...
[ "0.73477405", "0.6017155", "0.6017155", "0.5720655", "0.57166284", "0.56981266", "0.5690134", "0.563054", "0.56016636", "0.56016636", "0.56016636", "0.56016636", "0.56016636", "0.56016636", "0.56016636", "0.56016636", "0.56016636", "0.56016636", "0.56005055", "0.5565936", "0....
0.0
-1
Convert values from between 0 and max to 0 and 100
def max_normalize(val, old_max): new_max = 100.0 normalized = (val / old_max) * new_max # Cap at new_max if normalized > new_max: return new_max return normalized
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalise(values):\n max_value = max(values)\n min_value = min(values)\n factor = 32767.0 / max(max_value, abs(min_value))\n return (int(v * factor) for v in values)", "def normalizeToRange(data,max=255,min=0):\n if min: return (max-min)*normalize(data)+min\n else: return max*normalize2(dat...
[ "0.65290046", "0.64540327", "0.6265714", "0.62650007", "0.62492687", "0.62291247", "0.6222956", "0.6218654", "0.6185663", "0.61242354", "0.6109798", "0.60741264", "0.6051303", "0.60498947", "0.6043687", "0.602063", "0.6007237", "0.60048604", "0.6000098", "0.59754366", "0.5975...
0.6824671
0
Get a constant array for a column; `key` should be the column name. Find dtype and default value in `self._schema`. If not found, default to np.float64 and np.nan.
def _get_constant_array(self, key): schema_this = self._schema.get(key, {}) dtype = schema_this.get('dtype', np.float64) default = schema_this.get( 'default', self._get_default_value(dtype, key) ) return self._generate_constant_array(dtype=dtype, value=def...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_constant_array(self, dtype, value):\n dtype = np.dtype(dtype)\n # here `key` is used to cache the constant array\n # has nothing to do with column name\n key = (dtype.str, value)\n if key not in self._constant_arrays:\n self._constant_arrays[key] = np.asa...
[ "0.6059609", "0.58965236", "0.5842857", "0.5709597", "0.5574033", "0.5571309", "0.5559477", "0.5551694", "0.54089075", "0.5325778", "0.5318806", "0.52372164", "0.52185297", "0.51209575", "0.51066566", "0.5046266", "0.50072205", "0.49811873", "0.4956942", "0.4904888", "0.48800...
0.80635655
0
Sort roots based on magnitude.
def _cmplx_sort(p): indx = cupy.argsort(cupy.abs(p)) return cupy.take(p, indx, 0), indx
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getRoots(self):\n a, b, c = self.getCoefficients()[2], self.getCoefficients()[1], self.getCoefficients()[0]\n delta = b**2 - 4*a*c\n if delta >= 0:\n roots = sorted([(-b - math.sqrt(delta))/(2*a), (-b + math.sqrt(delta))/(2*a)])\n else:\n roots = sorted([(-b - ...
[ "0.57728124", "0.5739361", "0.5544463", "0.5544123", "0.5536788", "0.55002415", "0.5443262", "0.54308647", "0.542477", "0.5416572", "0.54076785", "0.5282793", "0.5252491", "0.5234423", "0.5221689", "0.5213832", "0.51912826", "0.51714677", "0.5142407", "0.51353747", "0.512889"...
0.48886505
45
Compute b(s) and a(s) from partial fraction expansion. If `M` is the degree of numerator `b` and `N` the degree of denominator
def invres(r, p, k, tol=1e-3, rtype='avg'): r = cupy.atleast_1d(r) p = cupy.atleast_1d(p) k = cupy.trim_zeros(cupy.atleast_1d(k), 'f') unique_poles, multiplicity = unique_roots(p, tol, rtype) factors, denominator = _compute_factors(unique_poles, multiplicity, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def modinverse(a: int, m: int) -> int:\n if SHOW_WORKING: print(f\"modinverse(a, m) = modinverse({a}, {m})\")\n if SHOW_WORKING: print(f\"\\tWe want to find some x & y such that {a} * x + {m} * y = 1\")\n\n if a < 0 or m <= 0:\n raise ValueError(\"a must be non-negative and m must be positive\")\n\...
[ "0.5484256", "0.54255605", "0.5325805", "0.52903396", "0.52308244", "0.5158438", "0.5132518", "0.51130104", "0.51081616", "0.5097007", "0.50961864", "0.5093071", "0.5079068", "0.50680774", "0.5065635", "0.5063032", "0.5053972", "0.5045122", "0.50399584", "0.5017229", "0.50085...
0.0
-1
Compute b(z) and a(z) from partial fraction expansion. If `M` is the degree of numerator `b` and `N` the degree of denominator
def invresz(r, p, k, tol=1e-3, rtype='avg'): r = cupy.atleast_1d(r) p = cupy.atleast_1d(p) k = cupy.trim_zeros(cupy.atleast_1d(k), 'b') unique_poles, multiplicity = unique_roots(p, tol, rtype) factors, denominator = _compute_factors(unique_poles, multiplicity, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def modinverse(a: int, m: int) -> int:\n if SHOW_WORKING: print(f\"modinverse(a, m) = modinverse({a}, {m})\")\n if SHOW_WORKING: print(f\"\\tWe want to find some x & y such that {a} * x + {m} * y = 1\")\n\n if a < 0 or m <= 0:\n raise ValueError(\"a must be non-negative and m must be positive\")\n\...
[ "0.5515423", "0.53936535", "0.53068423", "0.525928", "0.5227998", "0.51471055", "0.51015353", "0.5095448", "0.50885606", "0.50857913", "0.50821257", "0.50746995", "0.5062555", "0.5055407", "0.5047978", "0.50474066", "0.50342786", "0.50316375", "0.50286114", "0.50270814", "0.5...
0.0
-1
Compute partialfraction expansion of b(z) / a(z). If `M` is the degree of numerator `b` and `N` the degree of denominator
def residuez(b, a, tol=1e-3, rtype='avg'): if (cupy.issubdtype(b.dtype, cupy.complexfloating) or cupy.issubdtype(a.dtype, cupy.complexfloating)): b = b.astype(complex) a = a.astype(complex) else: b = b.astype(float) a = a.astype(float) b = cupy.trim_zeros(cupy.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalized_fraction(p, q=1):\r\n x, y = p, q\r\n while y:\r\n x, y = y, x % y\r\n if x != 1:\r\n p //= x\r\n q //= x\r\n if q == 1:\r\n return p\r\n return mpq((p, q))", "def to_mass_fraction(molar_ratio, massfrac_denominator, numerator_mass, denominator_mass):\n ...
[ "0.56153774", "0.5520266", "0.5425644", "0.5370385", "0.5331629", "0.53304726", "0.5318569", "0.527492", "0.52573985", "0.51983064", "0.5196371", "0.51853156", "0.51643187", "0.51220316", "0.5112274", "0.5110424", "0.50980437", "0.50808066", "0.5060445", "0.5031727", "0.50213...
0.0
-1
drop tables before each test
def drop_data(): tables = ['customers', 'products', 'rentals'] with DropDataUnitTesting.mongo: norton_db = DropDataUnitTesting.mongo.connection.UnitTestNortonDB try: for table in tables: drop_table = norton_db[table] drop_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tear_down():\n db.flush()\n for table in metadata.tables.values():\n db.execute(table.delete())", "def tearDown(self):\n\n InitializeDb('TEST_DATABASE_URI').drop_tables()", "def tearDown(self):\n drop_all_tables()\n create_all()", "def drop(self):\n c ...
[ "0.82661945", "0.82290834", "0.8172401", "0.8163837", "0.81004775", "0.80736697", "0.8017608", "0.80168587", "0.79126865", "0.7901287", "0.7901287", "0.78422683", "0.7799047", "0.7795255", "0.77750945", "0.77392906", "0.77244186", "0.77206635", "0.77062345", "0.7701906", "0.7...
0.7598089
31
test see products for rent
def test_see_products_for_rent(self): # clean up DropDataUnitTesting.drop_data() tables = ['customers', 'products', 'rentals'] mongo_drop_table = mdb.DropData(tables) result = mongo_drop_table.drop_table() print(result) # create new unittest data ImportUn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_product(self):\n self._require_login(self.user1)\n response = self.client.get('/api/1.0/products/1/')\n self.assertEqual(response.data['name'], 'Producto 1')\n self.assertEqual(response.data['description'], 'Descripcion producto 1')\n self.assertEqual(response.data['...
[ "0.6896912", "0.6849849", "0.68248427", "0.68220747", "0.6759739", "0.67237794", "0.66996324", "0.6691319", "0.6683384", "0.6661248", "0.66362154", "0.66269976", "0.6626469", "0.65715134", "0.65112185", "0.6506507", "0.65036285", "0.6422081", "0.6421522", "0.64176744", "0.640...
0.6410685
20
Adds (or updates) the "Vary" header in the given HttpResponse object. newheaders is a list of header names that should be in "Vary". Existing headers in "Vary" aren't removed.
def patch_vary_headers(response, newheaders): # Note that we need to keep the original order intact, because cache # implementations may rely on the order of the Vary contents in, say, # computing an MD5 hash. if 'Vary' in response.headers: vary_headers = cc_delim_re.split(response.headers['Vary...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_vary_on_headers_precedence(self):\n vary = self.unique()\n self.assertViewBehavior(\n {\"vary_on_headers\": vary},\n status_code=405,\n headers_exclude=\"Vary\")", "def add_headers(r):\n r.headers[\"Cache-Control\"] = \"no-cache, no-store, must-revalidat...
[ "0.6375113", "0.6213003", "0.62082714", "0.61187375", "0.6052142", "0.6052142", "0.6052142", "0.6052142", "0.6052142", "0.6052142", "0.6052142", "0.6052142", "0.6052142", "0.6052142", "0.6052142", "0.6052142", "0.6052142", "0.6052142", "0.6052142", "0.6052142", "0.6052142", ...
0.80868876
1
_getCmsswVersion_ Return a string representing the CMSSW version to be used.
def getCmsswVersion(self): if not self.crabPSet: return self.step.data.application.setup.cmsswVersion else: # CRAB3 needs to use an environment var to get the version return os.environ.get("CMSSW_VERSION", "")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getCmsswVersion(self):\n return self[\"CMSSW_VERSION\"]", "def getCmsswVersion(self):\n if not self.crabPSet:\n return self.step.data.application.setup.cmsswVersion\n\n # CRAB3 needs to use an environment var to get the version\n return os.environ.get(\"CMSSW_VERSION\",...
[ "0.87685734", "0.83527327", "0.62797135", "0.61717784", "0.606646", "0.59765613", "0.5930064", "0.5913918", "0.57868594", "0.57856375", "0.5772157", "0.5703693", "0.56726015", "0.56569654", "0.56567305", "0.5562684", "0.55530536", "0.55252683", "0.547685", "0.5475787", "0.547...
0.838685
1
Center the ship on the screen.
def center_ship(self): # Start each new ship at the bottom center self.rect.centerx = self.screen_rect.centerx self.rect.bottom = self.screen_rect.bottom # Store a decimal value for the ship' center. self.center = float(self.rect.centerx) self.bottom = float(self.rect.bo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def center_ship(self):\r\n self.center = self.screen_rect.centerx", "def center_ship(self):\r\n self.center = self.screen_rect.centerx", "def center_ship(self):\n self.center = self.screen_rect.centerx", "def center_ship(self):\n self.center = self.screen_rect.centerx", "def cen...
[ "0.90521824", "0.90521824", "0.90483487", "0.90483487", "0.90483487", "0.77428573", "0.7571409", "0.7519597", "0.7502143", "0.74013364", "0.7365447", "0.72528094", "0.7213482", "0.7202151", "0.71933264", "0.7159793", "0.712372", "0.712372", "0.7016084", "0.6983172", "0.698148...
0.86796546
5
Move the center of the unit to the position
def moveTo(self, destination: Coordinates) -> None: if self.sprite is not None and self.sprite.rect is not None: current_position = self.sprite.rect.center if current_position != destination: x, y = vectorize(current_position, destination) self.sprite.rect...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move(self, center):\n\t\t#print \"made it\"\n\t\tself.rect = self.rect.move(center)", "def __moveCenterTo(self, x, y):\n x0, y0, w, h = self.currentBox\n x2, y2 = x - (w/2), y - (h/2)\n self.__moveTo(x2, y2)", "def center(self):\n if self.pos != 0.0:\n self.pos = 0.0"...
[ "0.76555127", "0.7645165", "0.7514665", "0.7501103", "0.73941034", "0.7302718", "0.7251084", "0.72460777", "0.71894336", "0.7154995", "0.71327513", "0.70925444", "0.70719844", "0.6933244", "0.6933244", "0.69062495", "0.68923926", "0.6860572", "0.68597925", "0.6848045", "0.683...
0.0
-1
Generate ngrams of length 'length' from a file.
def read_ngrams(filename, length): ngram = deque(' ' * length) with open(filename) as file: for line in file: for char in line: ngram.popleft() ngram.append(char) if is_valid_ngram(ngram): yield ''.join(ngram)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_ngrams(seq, n):\n return", "def ngrams(word, size):\n expanded = \"^\" + word + \"$\"\n for start in range(len(expanded) - size + 1):\n yield expanded[start:start + size]", "def get_all_ngrams():\n grams = ()\n for i in range(0, 40):\n text_i = read_file(str(i))\n cu...
[ "0.6710013", "0.64994335", "0.6235464", "0.6183396", "0.6137579", "0.61105895", "0.6088907", "0.60602754", "0.60164374", "0.6015849", "0.6010033", "0.600222", "0.5966503", "0.59043103", "0.58956426", "0.58835363", "0.5855173", "0.58262324", "0.5817035", "0.5802036", "0.579672...
0.820308
0
Checks whether search stage needs to be changed.
def check_status(self, base): change = False # Trigger intensification if self.curr_i == self.I: self.curr_i = 0 base = self.search_intensification() change = True # Trigger diversification elif self.curr_d == self.D: self.curr_d = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def continue_search( self ):\n return True;", "def check_searchin(self):\r\n\r\n self.limit_panel_toggle()\r\n\r\n pth = self.m_searchin_text.GetValue()\r\n if not self.searchin_update:\r\n if isdir(pth):\r\n self.m_searchin_dir_picker.SetPath(pth)\r\n ...
[ "0.61957204", "0.6187641", "0.6164528", "0.60925114", "0.60697937", "0.6041139", "0.56433964", "0.56322736", "0.55651903", "0.5538073", "0.55365276", "0.5526487", "0.5480716", "0.5463553", "0.544533", "0.5438443", "0.5431505", "0.5428972", "0.54171354", "0.54022706", "0.54021...
0.0
-1
Replace Conv2d with a depthwise Conv2d and Pointwise Conv2d.
def SeperableConv2d(in_channels, out_channels, kernel_size=1, stride=1, padding=0): return Sequential( Conv2d(in_channels=in_channels, out_channels=in_channels, kernel_size=kernel_size, groups=in_channels, stride=stride, padding=padding), ReLU(), Conv2d(in_channels=in_channels...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def depthwise_conv2d_model():\n\n inputs = tf.keras.Input(shape=(10, 10, 3,))\n x = tf.keras.layers.Conv2D(16, (1, 1))(inputs)\n x = tf.keras.layers.SeparableConv2D(10, (2, 2))(x)\n x = tf.keras.layers.DepthwiseConv2D(3, (1, 1))(x)\n x = tf.keras.layers.Conv2D(8, (1, 1))(x)\n x = tf.keras.layers....
[ "0.7098545", "0.7073389", "0.6687289", "0.64587915", "0.64275813", "0.6383938", "0.6356002", "0.63425237", "0.6322055", "0.62884796", "0.6255259", "0.62327594", "0.6229987", "0.61835027", "0.6174464", "0.61658067", "0.616357", "0.61595774", "0.6140475", "0.6138183", "0.613505...
0.60427696
28
verify that a FQDN is valid
def chkfqdn(fqdn): if fqdn is None: return False hp = hostportion(fqdn) # not needed right now: pp = portportion(fqdn) # TODO need to augment this for IPv6 addresses return re.match('^[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$', hp) is not None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_fqdn(address):\n\n return bool(re.match(re_fqdn, address))", "def test_returns_proper_fqdn(self):\n self.mock_getaddrinfo.return_value = (\n [0, 1, 2, 3, ['take_me', 'not_me']],)\n self.mock_gethostbyaddr.return_value = ['proper_FQDN']\n return_value = sanitize_host('err...
[ "0.73212737", "0.67900455", "0.6729237", "0.6476318", "0.6476318", "0.6476318", "0.6476318", "0.6476318", "0.6476318", "0.6476318", "0.6476318", "0.6476318", "0.6476318", "0.6476318", "0.6476318", "0.6476318", "0.6476318", "0.6476318", "0.6476318", "0.64424187", "0.6429071", ...
0.76513267
0
Get the data associated with a database. Make sure the connection exists.
def dbgetinfo(refctx): wfqdn = refctx.node.properties['writerfqdn'] related = find_related_nodes('dcae.relationships.database_runson_pgaas_cluster', refctx.instance) if wfqdn == '': if len(related) != 1: raiseNonRecoverableError('Database Cluster must be specified using exactly one dcae.relationships.da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n\n \n\n try:\n db = getDatabase()\n connection = db.connect()\n\n connection.get(self)\n\n except Exception as e:\n raise e\n finally:\n db.dispose()", "def get_db(self):\n self.logger.info('in get_db()')\n ...
[ "0.75719666", "0.7532807", "0.7429401", "0.7316455", "0.73038816", "0.72757804", "0.72319925", "0.7198391", "0.70628834", "0.7057501", "0.69187593", "0.6914754", "0.69113433", "0.68861735", "0.68841106", "0.6872418", "0.6863855", "0.6863855", "0.6863855", "0.6863855", "0.6847...
0.0
-1
Get the data associated with a database. Make sure the connection exists.
def dbgetinfo_for_update(wfqdn): if not chkfqdn(wfqdn): raiseNonRecoverableError('Invalid FQDN specified for admin/read-write access, fqdn={0}'.format(safestr(wfqdn))) ret = getclusterinfo(wfqdn, True, '', '', []) waithp(hostportion(wfqdn), portportion(wfqdn)) return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n\n \n\n try:\n db = getDatabase()\n connection = db.connect()\n\n connection.get(self)\n\n except Exception as e:\n raise e\n finally:\n db.dispose()", "def get_db(self):\n self.logger.info('in get_db()')\n ...
[ "0.75719666", "0.7532807", "0.7429401", "0.7316455", "0.73038816", "0.72757804", "0.72319925", "0.7198391", "0.70628834", "0.7057501", "0.69187593", "0.6914754", "0.69113433", "0.68861735", "0.68841106", "0.6872418", "0.6863855", "0.6863855", "0.6863855", "0.6863855", "0.6847...
0.0
-1
get MAC address of a host based on its outside address. this function should be idempotent
def convert_mac_address(self, outside_address): outside_address = self._macfix__result.get(outside_address, outside_address) return super(MacFix, self).convert_mac_address(outside_address)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mac_address():\n eth0_interface = 'eth0'\n addresses = netifaces.ifaddresses(eth0_interface)[netifaces.AF_LINK][0]\n mac_address = addresses['addr']\n return mac_address", "def get_mac_address(self, result, host):\n if \"mac\" in result['scan'][host][\"addresses\"]:\n return...
[ "0.76644033", "0.763918", "0.76262796", "0.7258913", "0.7256227", "0.72244465", "0.72225285", "0.71294695", "0.7031526", "0.6966646", "0.692085", "0.69030154", "0.6844049", "0.68406874", "0.6780091", "0.67075473", "0.6700108", "0.66966856", "0.66966856", "0.66966856", "0.6696...
0.60372263
65
Returns a whether the item is in the tree.
def isin(self, item): return self.get(item) is not None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __contains__(self, item):\n if item in self._parents:\n return True\n else:\n return False", "def __contains__(self, item):\n cur_node = self.head\n while cur_node is not None:\n if item in cur_node.data_list:\n return True\n ...
[ "0.789011", "0.7801563", "0.77585655", "0.74987936", "0.74987936", "0.7277485", "0.7218274", "0.71810645", "0.7180133", "0.71608347", "0.7131446", "0.70599824", "0.70589614", "0.70567876", "0.70567876", "0.70442706", "0.703616", "0.7014619", "0.7009212", "0.7003483", "0.69963...
0.759779
3
Returns the total number of items stored.
def len(self): L,R = 0,0 if self.left is not None: L = self.left.len() if self.right is not None: R = self.right.len() return 1 + L + R
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_num_items(self):\r\n return self.num_items", "def items_count(self):\n return len(self.items)", "def items_num(self):\n\t\treturn len(self.items)", "def items_num(self):\n\t\treturn len(self.items)", "def count(self) -> int:\n if self._cached_items is not None:\n ret...
[ "0.81358486", "0.8071261", "0.7947205", "0.7947205", "0.7915217", "0.79031557", "0.78855026", "0.7786944", "0.77154243", "0.77101094", "0.7683206", "0.7677505", "0.7659131", "0.7604911", "0.75564605", "0.75360847", "0.75292194", "0.75003916", "0.75003916", "0.75003916", "0.75...
0.0
-1
Returns the maximal tree depth.
def depth(self): L, R = 0,0 if self.left: L = self.left.depth() if self.right: R = self.right.depth() return 1 + max(L, R)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_tree_depth(self):\n\n depths = np.array([leaf.tree_depth for leaf in self.leaves])\n\n return depths.max()", "def max_depth(self) -> int:\n return pulumi.get(self, \"max_depth\")", "def get_max_depth(self):\n return self.MAX_DEPTH", "def _max_depth(self):\n max_dept...
[ "0.87011653", "0.8611888", "0.8523136", "0.84680766", "0.8467897", "0.83782226", "0.8223624", "0.81667835", "0.81663245", "0.81476194", "0.8035755", "0.8033181", "0.79196703", "0.78743637", "0.7827714", "0.77843827", "0.77753097", "0.77671725", "0.77054954", "0.7683648", "0.7...
0.7910286
13
Returns the minimum item.
def max(self): if self.right is None: return self.item else: return self.right.max()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min(self):\n return self.get_first()", "def min(self):\n return min(self)", "def take_min(self):\n return self.get_first()", "def find_min(self):\n return self.min", "def find_min(self):\n return self.min", "def _get_minimum(self):\n return self._minimum", ...
[ "0.83393997", "0.81978196", "0.81584954", "0.81263995", "0.81263995", "0.8126015", "0.7871861", "0.7871861", "0.7850204", "0.7821147", "0.77934015", "0.7778979", "0.777182", "0.7730386", "0.77142054", "0.76948655", "0.76475835", "0.7640458", "0.7640458", "0.75941443", "0.7589...
0.0
-1
Deserialize datetime object into string form for JSON processing.
def dump_date(data): if data is None: return None return data.strftime("%Y-%m-%d")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize_datetime(self, obj):\r\n if isinstance(obj, datetime.datetime):\r\n return obj.isoformat()\r\n raise TypeError(\"Type not serializable\")", "def json_datetime_serializer(obj):\n\n if isinstance(obj, datetime):\n serial = obj.isoformat()\n return serial\n ...
[ "0.6995824", "0.6982557", "0.69000393", "0.6865064", "0.68128496", "0.6749708", "0.6649493", "0.66324556", "0.65954465", "0.65469813", "0.6542357", "0.6538773", "0.6487021", "0.6480456", "0.64397836", "0.63939315", "0.6364729", "0.6356435", "0.633706", "0.63110447", "0.629170...
0.0
-1
Deserialize datetime object into string form for JSON processing.
def dump_time(data): if data is None: return None return data.strftime("%H:%M:%S")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize_datetime(self, obj):\r\n if isinstance(obj, datetime.datetime):\r\n return obj.isoformat()\r\n raise TypeError(\"Type not serializable\")", "def json_datetime_serializer(obj):\n\n if isinstance(obj, datetime):\n serial = obj.isoformat()\n return serial\n ...
[ "0.6995824", "0.6982557", "0.69000393", "0.6865064", "0.68128496", "0.6749708", "0.6649493", "0.66324556", "0.65954465", "0.65469813", "0.6542357", "0.6538773", "0.6487021", "0.6480456", "0.64397836", "0.63939315", "0.6364729", "0.6356435", "0.633706", "0.63110447", "0.629170...
0.0
-1
check if integer n is a prime
def isprime(n): # make sure n is a positive integer n = abs(int(n)) # 0 and 1 are not primes if n < 2: return False # 2 is the only even prime number if n == 2: return True # all other even numbers are not primes if not n & 1: return False # range starts with ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isprime(n):\r\n\treturn is_prime(n)", "def isprime(n):\n\treturn is_prime(n)", "def is_prime(n):\n return mr_prime(n)", "def isprime(n):\n if n % 2 == 0:return False\n return all(n % i for i in range(3, int(n**0.5) + 1, 2))", "def isprime(n=936):\n if n < 3: return False\n for i in range...
[ "0.8734758", "0.8688912", "0.85895246", "0.8567669", "0.8527042", "0.8441286", "0.8434779", "0.84294003", "0.8423726", "0.84233105", "0.84122175", "0.83913106", "0.8386821", "0.83836436", "0.83806306", "0.83778167", "0.83743244", "0.8373041", "0.83705044", "0.8364172", "0.835...
0.8223359
39
Convert an numpy representation image to Image protobuf.
def make_image(tensor): height, width, channel = tensor.shape image = Image.fromarray(tensor) output = io.BytesIO() image.save(output, format='PNG') image_string = output.getvalue() output.close() return tf.Summary.Image(height=height, width=width, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_proto_to_image(image_pb: NLImage) -> np.ndarray:\n input_array = np.frombuffer(image_pb.data, dtype=np.uint8)\n dimensions = [image_pb.height, image_pb.width]\n if image_pb.color:\n dimensions.append(3)\n input_image = input_array.reshape(dimensions)\n return input_image", "def ...
[ "0.7984254", "0.76887786", "0.6840471", "0.6521327", "0.64539945", "0.64353144", "0.63886815", "0.6344107", "0.626515", "0.6237322", "0.61814183", "0.61702514", "0.61636245", "0.61325425", "0.61168885", "0.6113604", "0.6112164", "0.6100166", "0.6088356", "0.6082434", "0.60779...
0.0
-1
Test that a manifest file is deleted after use.
def test_remove_manifest_file(self): test_report_date = datetime(year=2018, month=9, day=7) self.assertTrue(os.path.isfile(self.test_manifest_path)) self.ocp_report_downloader._remove_manifest_file(test_report_date) self.assertFalse(os.path.isfile(self.test_manifest_path))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unpacker_delete_manifest_metadata_v3(config, mocker, path_map_mock):\n logger_mock = mocker.MagicMock()\n p = Unpacker(config, logger_mock)\n mock_os_remove = mocker.patch(\"os.remove\")\n mock_os_remove.side_effect = [NameError, None]\n p._delete_manifest_metadata(\"0869ea50-e437-443f-8cdb...
[ "0.74621576", "0.7278525", "0.7140968", "0.70097417", "0.69330496", "0.6803426", "0.6779063", "0.6760661", "0.6693618", "0.66678524", "0.6634478", "0.6606377", "0.65858227", "0.6585594", "0.6529245", "0.65261567", "0.65210986", "0.6418427", "0.6418427", "0.6410336", "0.639949...
0.771174
0
Get the ReviewForm view.
def post(self, request, *args, **kwargs): view = ReviewForm.as_view() return view(request, *args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_form_class(self):\n return get_review_form(review=self.get_object(), user=self.request.user)", "def get_form(self):\n return self.form", "def get_form(self):\n return self.form", "def get_view(self):\n return self.view", "def get(self, request, *args, **kwargs):\n ...
[ "0.77888393", "0.63603574", "0.63603574", "0.630275", "0.6004137", "0.5998597", "0.59868395", "0.5953391", "0.59136677", "0.5892297", "0.5843405", "0.5827286", "0.5797612", "0.5680881", "0.56562614", "0.5653852", "0.56099397", "0.55628324", "0.5436671", "0.5429443", "0.539646...
0.67291963
1
Insert the formset into the context dict.
def get_context_data(self, **kwargs): if "formset" not in kwargs: kwargs["formset"] = self.get_formset() return super().get_context_data(**kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_context_data(self, **kwargs):\n context= super(Reasignar,self).get_context_data(**kwargs)\n current_us = self.get_object().userstory_set.all()\n formset= self.UserStoryFormset(self.request.POST if self.request.method == 'POST' else None, initial=[{'userStory':us, 'flujo':us.actividad.f...
[ "0.66991395", "0.63750464", "0.6301611", "0.63015974", "0.627123", "0.6216302", "0.61852515", "0.6128482", "0.6050119", "0.5994917", "0.5979127", "0.5959795", "0.5959666", "0.592105", "0.58778465", "0.5850834", "0.583298", "0.5730383", "0.56534827", "0.56418073", "0.56412554"...
0.7167657
0
[Required] Gets the key of this Term. Unique term key that is immutable.
def key(self): return self._key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key(self) -> Key:\n return self._key", "def key(self):\n return self._key if self._key else self.factory().key", "def key(self) -> str:\n return self.__key", "def key(self):\n return self.key_for(self.id)", "def key(self):\n return key_for_name(self.name)", "def key...
[ "0.7332524", "0.71313685", "0.7079953", "0.7043272", "0.7039538", "0.7016826", "0.7011052", "0.69866437", "0.69866437", "0.69866437", "0.69866437", "0.69866437", "0.69866437", "0.69866437", "0.69866437", "0.69866437", "0.69866437", "0.69866437", "0.69866437", "0.69866437", "0...
0.6985255
68
Gets the display_name of this Term. A userfriendly display name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
def display_name(self): return self._display_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_display_name(self):\n\n return self._display_name", "def get_display_name(self):\n return DisplayText(self._display_name)", "def get_display_name(self):\n return self.display_name", "def display_name(self) -> str:\n return pulumi.get(self, \"display_name\")", "def displa...
[ "0.82097006", "0.81217587", "0.80897194", "0.80787754", "0.80787754", "0.80787754", "0.80787754", "0.80787754", "0.80787754", "0.80787754", "0.80787754", "0.80787754", "0.80787754", "0.80787754", "0.80787754", "0.8025858", "0.7992403", "0.79353786", "0.7855462", "0.78338426", ...
0.790838
20
Sets the display_name of this Term. A userfriendly display name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
def display_name(self, display_name): self._display_name = display_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_display_name(self, display_name):\n self._call('set_display_name', display_name=display_name)", "def display_name(self, display_name: str):\n\n self._display_name = display_name", "def display_name(self, display_name):\n\n self._display_name = display_name", "def display_name(sel...
[ "0.8246015", "0.8241257", "0.8108107", "0.8108107", "0.8108107", "0.8108107", "0.8108107", "0.8108107", "0.71608275", "0.71044606", "0.70674384", "0.6888478", "0.6410052", "0.6404099", "0.6349029", "0.6311359", "0.6311359", "0.6311359", "0.6311359", "0.6311359", "0.6311359", ...
0.81033057
10
Gets the description of this Term. Detailed description of the term.
def description(self): return self._description
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def description(self) -> str:\n return pulumi.get(self, \"description\")", "def description(self) -> str:\n return pulumi.get(self, \"description\")", "def description(self) -> str:\n return pulumi.get(self, \"description\")", "def description(self) -> str:\n return pulumi.get(sel...
[ "0.77679265", "0.77679265", "0.77679265", "0.77679265", "0.77679265", "0.77679265", "0.77679265", "0.77679265", "0.77679265", "0.77679265", "0.77679265", "0.77679265", "0.77679265", "0.77679265", "0.77679265", "0.77679265", "0.77679265", "0.77679265", "0.77679265", "0.77679265"...
0.7443274
63
Sets the description of this Term. Detailed description of the term.
def description(self, description): self._description = description
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_description(self, description):\n self.description = description", "def set_description(self, description):\r\n self.__description = description", "def set_description(self, description):\n self.__description = description", "def set_description(self, description):\n self....
[ "0.8188346", "0.8185382", "0.81788784", "0.81564164", "0.8051338", "0.80260354", "0.7956832", "0.7956832", "0.7956832", "0.7956832", "0.7956832", "0.7956832", "0.7956832", "0.7956832", "0.7956832", "0.7956832", "0.7956832", "0.7956832", "0.7956832", "0.7956832", "0.7956832", ...
0.79902846
8
Gets the parent_term_key of this Term. This terms parent term key. Will be null if the term has no parent term.
def parent_term_key(self): return self._parent_term_key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parent_term_key(self, parent_term_key):\n self._parent_term_key = parent_term_key", "def _get_parent_key(self):\n parent_kind = metadata_api.GetParentKind(self)\n if parent_kind:\n parent_key_field = metadata_api.GetParentKeyField(self)\n parent_key_name = getattr(self, parent_key_fiel...
[ "0.71410054", "0.7094069", "0.69838196", "0.68126494", "0.68126494", "0.66740334", "0.6641247", "0.6560866", "0.6560866", "0.6528717", "0.63521004", "0.6249405", "0.623587", "0.6205079", "0.61585826", "0.6074486", "0.60679847", "0.6055437", "0.6039494", "0.6036079", "0.597530...
0.8667523
0
Gets the lifecycle_state of this Term. The current state of the term.
def lifecycle_state(self): return self._lifecycle_state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lifecycle_state(self) -> str:\n return self._lifecycle_state", "def get_state(self):\n return self._env.get_state()", "def get_state(self):\n return self._state", "def get_state(self):\n return self._state", "def get_state(self):\n return self._state", "def get_stat...
[ "0.7671233", "0.668295", "0.6591934", "0.6591934", "0.6591934", "0.6591934", "0.6591934", "0.6590977", "0.6590977", "0.6474199", "0.6474199", "0.6465325", "0.6465325", "0.6465325", "0.64575666", "0.6411576", "0.6404834", "0.64017004", "0.6396448", "0.63837606", "0.63764775", ...
0.8074865
2
Gets the time_created of this Term. The date and time the term was created, in the format defined by `RFC3339`__.
def time_created(self): return self._time_created
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_created(self) -> str:\n return pulumi.get(self, \"time_created\")", "def time_created(self) -> str:\n return pulumi.get(self, \"time_created\")", "def time_created(self) -> str:\n return pulumi.get(self, \"time_created\")", "def created_date_time(self) -> str:\n return pu...
[ "0.7964188", "0.7964188", "0.7964188", "0.78565437", "0.78013456", "0.78013456", "0.78013456", "0.7741784", "0.7741784", "0.7682474", "0.76464796", "0.76464796", "0.76410985", "0.76410985", "0.76410985", "0.7628568", "0.7628568", "0.7628568", "0.7628568", "0.7628568", "0.7628...
0.7700165
11
Sets the time_updated of this Term. The last time that any change was made to the term. An `RFC3339`__ formatted datetime string.
def time_updated(self, time_updated): self._time_updated = time_updated
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_time(self, update_time):\n\n self._update_time = update_time", "def updated(self, updated: datetime):\n\n self._updated = updated", "def last_updated(self, last_updated: str):\n\n self._last_updated = last_updated", "def last_updated(self, value):\n self._last_updated =...
[ "0.6913702", "0.6691308", "0.65553766", "0.6489852", "0.64716643", "0.64716643", "0.64716643", "0.64716643", "0.64716643", "0.64716643", "0.64716643", "0.64716643", "0.6298312", "0.6298312", "0.6298312", "0.6298312", "0.62923396", "0.6288948", "0.62791955", "0.62791955", "0.6...
0.7461716
0
Gets the created_by_id of this Term. OCID of the user who created the term.
def created_by_id(self): return self._created_by_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def created_by_id(self) -> str:\n return self.__created_by_id", "def created_by(self):\n return self._created_by", "def created_by_user_id(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"created_by_user_id\")", "def created_by(self) -> str:\n return pulumi.get(se...
[ "0.77948695", "0.7693318", "0.75393707", "0.7522049", "0.73582613", "0.73582613", "0.73582613", "0.73582613", "0.73582613", "0.73582613", "0.73291194", "0.7267242", "0.72267574", "0.7126764", "0.7030593", "0.70190275", "0.6977566", "0.6933664", "0.6933664", "0.6933664", "0.69...
0.79766804
0
Sets the created_by_id of this Term. OCID of the user who created the term.
def created_by_id(self, created_by_id): self._created_by_id = created_by_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def created_by_id(self, created_by_id):\n\n self._created_by_id = created_by_id", "def created_by(self, created_by):\n\n self._created_by = created_by", "def created_by(self, created_by):\n\n self._created_by = created_by", "def created_by(self, created_by):\n\n self._created_by =...
[ "0.75911325", "0.74667054", "0.74667054", "0.74667054", "0.74667054", "0.74667054", "0.74667054", "0.7167381", "0.7167381", "0.7167381", "0.7167381", "0.6883834", "0.6460262", "0.6424327", "0.6416534", "0.63138765", "0.6058588", "0.59626096", "0.5941305", "0.5941305", "0.5941...
0.7574243
1
Gets the updated_by_id of this Term. OCID of the user who modified the term.
def updated_by_id(self): return self._updated_by_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updated_by(self):\n return self._updated_by", "def updated_by(self) -> \"str\":\n return self._attrs.get(\"updatedBy\")", "def updated_by(self) -> \"str\":\n return self._attrs.get(\"updatedBy\")", "def updated_by(self) -> \"str\":\n return self._attrs.get(\"updatedBy\")", "...
[ "0.74846137", "0.7006226", "0.7006226", "0.7006226", "0.6915335", "0.6731218", "0.63889545", "0.6355616", "0.6250721", "0.62379515", "0.6196608", "0.6196608", "0.6196608", "0.61218727", "0.61218727", "0.60810435", "0.5993734", "0.5993734", "0.5993734", "0.5993734", "0.5993734...
0.7173748
1
Gets the owner of this Term. OCID of the user who is the owner of this business terminology.
def owner(self): return self._owner
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def owner(self) -> None:\n return self.bot.get_user(self.bot.config.owner_ids[0])", "def owner(self):\n return Organization.objects.get(id=self.owner_id)", "def owner(self):\n answer = self._call('owner')\n return answer.owner", "def get_owner(self):\n return self.__owner",...
[ "0.7556434", "0.743154", "0.733809", "0.7324358", "0.71914345", "0.71914345", "0.7179779", "0.7179779", "0.717366", "0.71500343", "0.71484184", "0.71426773", "0.71321195", "0.7128744", "0.71114475", "0.70196396", "0.69978535", "0.6989034", "0.697058", "0.6948455", "0.68906206...
0.69539374
19
Sets the owner of this Term. OCID of the user who is the owner of this business terminology.
def owner(self, owner): self._owner = owner
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_owner(self, owner):\n self.__owner = owner", "def set_owner(self, owner):\n self.settings[\"owner\"] = owner", "def owner(self, owner: str):\n\n self._owner = owner", "def owner(self, owner):\n\n self._owner = owner", "def owner(self, owner):\n\n self._owner = own...
[ "0.7715584", "0.7384513", "0.73508155", "0.7187921", "0.7187921", "0.7187921", "0.7187921", "0.70076317", "0.6978455", "0.69491476", "0.6865002", "0.67733216", "0.6649601", "0.6608705", "0.64676404", "0.6424307", "0.63199425", "0.6306262", "0.6288295", "0.6221478", "0.6166", ...
0.7184966
9
Gets the workflow_status of this Term. Status of the approval process workflow for this business term in the glossary.
def workflow_status(self): return self._workflow_status
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def workflow_state(self):\n return self.getattr('workflow_state')", "def get_workflow_state(self):\n state = self._gdb_interface.get_workflow_state()\n return state", "def get_workflow_state(self):\n return self._read_transaction(tx.get_workflow_state)", "def status(self):\n ...
[ "0.6162083", "0.5915684", "0.5770852", "0.5646916", "0.5621852", "0.5616675", "0.5593007", "0.558141", "0.5546673", "0.5538404", "0.5538404", "0.55203754", "0.54769593", "0.54704934", "0.54563254", "0.5452553", "0.54372764", "0.5437175", "0.54279935", "0.54254794", "0.5421783...
0.7515343
0
Sets the workflow_status of this Term. Status of the approval process workflow for this business term in the glossary.
def workflow_status(self, workflow_status): self._workflow_status = workflow_status
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_workflow_state(self, state):\n self._write_transaction(tx.set_workflow_state, state=state)", "def set_workflow_state(self, state):\n self._gdb_interface.set_workflow_state(state)", "def status(self, status: str):\n allowed_values = [\"done\", \"late\", \"in progress\", \"to do\"] ...
[ "0.56723666", "0.56122667", "0.55986696", "0.55860347", "0.5555593", "0.5522393", "0.5522393", "0.5522393", "0.5498449", "0.5459374", "0.5340593", "0.5331991", "0.53227514", "0.5289939", "0.5283743", "0.5277834", "0.5274989", "0.5217116", "0.5188418", "0.51858085", "0.5185808...
0.76120436
0
Gets the uri of this Term. URI to the term instance in the API.
def uri(self): return self._uri
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uri(self) -> str:\n return self._uri", "def get_uri(self):\n return self.__uri", "def get_uri(self):\n return self.url", "def uri(self) -> Optional[str]:\n return pulumi.get(self, \"uri\")", "def uri(self) -> Optional[str]: # noqa: D401\n return self._uri", "def ge...
[ "0.7598259", "0.7474034", "0.73258746", "0.7310683", "0.7299224", "0.7298299", "0.70824987", "0.70824987", "0.70824987", "0.70480794", "0.70380646", "0.7013252", "0.6973867", "0.69352645", "0.69327855", "0.6921582", "0.6921582", "0.6921582", "0.6921582", "0.6921582", "0.68710...
0.73854715
6
Gets the associated_object_count of this Term. The number of objects tagged with this term
def associated_object_count(self): return self._associated_object_count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count(self):\n return len(self.objects)", "def size(self) -> int:\n return sum(ob.size for ob in self.objects.ravel())", "def GetNumberOfObjects(self) -> \"unsigned long long\":\n return _itkLabelStatisticsImageFilterPython.itkLabelStatisticsImageFilterIF3IUS3_GetNumberOfObjects(self)"...
[ "0.68090314", "0.66882753", "0.667381", "0.6654624", "0.66395074", "0.6585512", "0.6571615", "0.6567628", "0.6561222", "0.65610355", "0.65364814", "0.6529807", "0.651313", "0.6511915", "0.65100354", "0.6479104", "0.6466027", "0.64655393", "0.6461946", "0.6453435", "0.6453154"...
0.81625235
0
Test that a list GET call works for the Metrics Map.
def test_list_cost_model_metrics_maps(self): url = reverse("metrics") client = APIClient() response = client.get(url, **self.headers) self.assertEqual(response.status_code, status.HTTP_200_OK) data = response.data.get("data", []) db_source_types = list(SOURCE_TYPE_MAP.k...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_list(self):\n pass", "def test_list(self):\n response = self.client.get('/weather-observations/', format=\"json\")\n self.assertEqual(response.status_code, 200)", "def test_metrics(client):\n response = client.get(\"/metrics\")\n assert response.status_code == 200", "d...
[ "0.7009869", "0.67153865", "0.6648557", "0.65684295", "0.65625834", "0.65127766", "0.6464829", "0.63599974", "0.63400924", "0.6328973", "0.6304419", "0.6286308", "0.6281482", "0.6169306", "0.61551625", "0.6133198", "0.6108097", "0.6103529", "0.6095171", "0.608374", "0.6081402...
0.63630855
7
Test that DELETE call does not work for the Metrics Map.
def test_delete_cost_model_metrics_maps_source_filter(self): url = reverse("metrics") client = APIClient() params = {"source_type": Provider.PROVIDER_OCP} url = url + "?" + urlencode(params, quote_via=quote_plus) response = client.delete(url, **self.headers) self.assertE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_derived_metric(self):\n pass", "def test_delete_mapping_issue_passes(self):\n response = self.client.delete(\n self.url, headers={\"Authorization\": self.test_user_token}\n )\n response_json = response.get_json()\n self.assertEqual(response.status_cod...
[ "0.70598286", "0.69608516", "0.6892653", "0.6881731", "0.68733084", "0.68306714", "0.6798032", "0.6777361", "0.6754268", "0.66391754", "0.6599307", "0.65273756", "0.6510652", "0.6505809", "0.6505026", "0.64809024", "0.646502", "0.64645994", "0.6432229", "0.63939005", "0.63762...
0.61769164
56
Test that the API returns a 500 error when there is invalid cost model metric map.
def test_invalid_json_500_response(self): url = reverse("metrics") client = APIClient() MOCK_COST_MODEL_METRIC_MAP = [{"Invalid": "Invalid"}] with patch("api.metrics.constants.COST_MODEL_METRIC_MAP", MOCK_COST_MODEL_METRIC_MAP): response = client.get(url, **self.headers) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_catch_value_error(self):\n url = reverse(\"metrics\")\n offset = len(COST_MODEL_METRIC_MAP)\n client = APIClient()\n data = client.get(url + \"?limit=&offset=\" + str(offset), **self.headers).data[\"data\"]\n self.assertEqual([], data)", "def test_error_on_invalid_metr...
[ "0.7006198", "0.6950682", "0.67470175", "0.6705281", "0.6589234", "0.65836054", "0.65640986", "0.6556384", "0.6532338", "0.6458934", "0.6412123", "0.6394487", "0.63938963", "0.63857895", "0.6311072", "0.62909955", "0.62816525", "0.6246843", "0.62201166", "0.61711156", "0.6155...
0.8488533
0
Takes a datetime.datetime object and returns the ISO 8601 Timestamp equivalent.
def CreateTimeStamp(inDateTime): inDateHour = inDateTime.strftime('%I') iso8601TimeStamp = (str(inDateTime.year).zfill(4) + '-' + str(inDateTime.month).zfill(2) + '-' + str(inDateTime.day).zfill(2) + ' ' + str(inDateHour).zfill(2) + ":" + str(inDateTime....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iso_from_datetime(py_datetime: datetime) -> ISOTimestamp:\n base_ts = py_datetime.isoformat(sep=' ', timespec='seconds')\n decimals = f\".{py_datetime.microsecond:06}\".rstrip('0.')\n\n return ISOTimestamp(f\"{base_ts[:19]}{decimals}{base_ts[19:]}\")", "def iso8601_from_timestamp(timestamp):\r\n ...
[ "0.81764245", "0.7080849", "0.7054037", "0.69672513", "0.6896633", "0.6885523", "0.68230313", "0.6798335", "0.6686449", "0.66820216", "0.6659611", "0.6657515", "0.66567415", "0.66478807", "0.6595075", "0.65681183", "0.6550632", "0.652665", "0.64908576", "0.64154655", "0.64120...
0.5892241
61
Constructs separate parameter groups for weights, biases, and other parameters.
def _get_param_groups(self, model: nn.Module) -> List[Dict[str, Any]]: param_groups = [ {"params": [], "weight_decay": 0.1, "lr": 1e-2}, {"params": [], "weight_decay": 0.01, "lr": 1e-3}, {"params": []}, ] for param_name, param in model.named_parameters(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _setup_param_groups(self, model, config):\n encoder_opts = config['optimizer']['encoder']\n decoder_opts = config['optimizer']['decoder']\n\n encoder_weight_params = []\n encoder_bias_params = []\n decoder_weight_params = []\n decoder_bias_params = []\n\n for na...
[ "0.66972655", "0.6659896", "0.6571508", "0.6415272", "0.638307", "0.63800496", "0.6226303", "0.6171896", "0.6093157", "0.6072624", "0.6064728", "0.60579014", "0.59992486", "0.5995308", "0.5948032", "0.5915764", "0.58890176", "0.5876733", "0.58764523", "0.5858592", "0.58416045...
0.6565048
3
Constructs an Adam optimizer with three parameter groups, one for weights, one for biases, and one for everything else, each with different weight decay and learning rates.
def _get_optim( self, model: nn.Module, optim_class: Type[torch.optim.Optimizer], multi_tensor: bool, ) -> torch.optim.Optimizer: param_groups = self._get_param_groups(model) return optim_class(param_groups, lr=5e-3, foreach=multi_tensor)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self,\n weight_decay,\n learning_rate=0.001,\n beta1=0.9,\n beta2=0.999,\n epsilon=1e-8,\n use_locking=False,\n name=\"AdamW\"):\n super(AdamWOptimizer, self).__init__(\n weight_decay,\n ...
[ "0.695622", "0.68494725", "0.68094134", "0.6589892", "0.6526377", "0.6524142", "0.6480255", "0.64627427", "0.6448276", "0.64104766", "0.6407642", "0.6388201", "0.6371128", "0.6332637", "0.63216114", "0.6299495", "0.62368846", "0.61902857", "0.6160888", "0.6129959", "0.6128208...
0.0
-1
Checks that two FSDP instances have the same model parameters.
def _check_fsdp_parameter_parity(self, fsdp1: FSDP, fsdp2: FSDP) -> None: with FSDP.summon_full_params(fsdp1), FSDP.summon_full_params(fsdp2): for (n1, p1), (n2, p2) in zip( fsdp1.named_parameters(), fsdp2.named_parameters(), ): self.assert...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert_wrappers_equal(first, second):\n assert first.sk_params == second.sk_params\n assert first.history_ == second.history_\n if not first.model_ or not second.model_:\n assert first.model_ == second.model_\n else:\n assert_models_equal(first.model, second.model)", "def test_same_...
[ "0.6725201", "0.6711404", "0.6505338", "0.6474141", "0.6455063", "0.6375143", "0.63582176", "0.6314766", "0.62439966", "0.621517", "0.62130624", "0.6161677", "0.6122047", "0.6036851", "0.6030104", "0.60120046", "0.60104835", "0.6003998", "0.60008264", "0.59980756", "0.5953998...
0.70316845
0
This assumes that the model is ``nn.Linear(7, 1, bias=False)`` (i.e. with a single 1D weight parameter) to be able to directly compare the baseline and test models. On rank 1, the baseline includes 1 element of padding.
def _check_param_grad_parity( _baseline_model: nn.Module, _test_model: nn.Module, ): self.assertEqual(len(list(_baseline_model.parameters())), 1) self.assertEqual(len(list(_test_model.parameters())), 1) for flat_param, orig_param in zip( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_bn_fold_with_linear_layer(self):\n inputs = tf.keras.Input(shape=(1, 1, 4,))\n bn = tf.keras.layers.BatchNormalization(fused=True)(inputs, training=False)\n x = tf.keras.layers.Flatten()(bn)\n dense = tf.keras.layers.Dense(2, activation=tf.nn.relu, name=\"linear_layer\")(x)\n ...
[ "0.60861534", "0.5569028", "0.5562657", "0.55509716", "0.55291367", "0.5519786", "0.54845756", "0.5482668", "0.547775", "0.546957", "0.5457487", "0.5403956", "0.5403167", "0.53848606", "0.53707105", "0.5356435", "0.5324631", "0.5284455", "0.5263199", "0.52405226", "0.5186361"...
0.5309338
17
Tests that dtypes are as expected when using ``no_sync()`` with ``use_orig_params=True`` and parameter mixed precision.
def test_no_sync_mixed_precision(self): self.run_subtests( { "sharding_strategy": [ ShardingStrategy.FULL_SHARD, ShardingStrategy.SHARD_GRAD_OP, ShardingStrategy.NO_SHARD, ] }, self._t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_pandas_dtypes():\n assert pd.DataFrame([1, 2]).dtypes.values[0] == np.dtype('int64') == np.int64\n assert pd.DataFrame([1, 2, None]).dtypes.values[0] == np.dtype('float64') == np.float64\n\n assert pd.DataFrame([1.0, 2.0]).dtypes.values[0] == np.dtype('float64') == np.float64\n assert pd.DataF...
[ "0.65226084", "0.64779156", "0.6442192", "0.6378447", "0.637416", "0.62536955", "0.60955393", "0.6036265", "0.59727865", "0.59608454", "0.592285", "0.58906466", "0.58270216", "0.58202636", "0.5810281", "0.5785311", "0.5754981", "0.57372314", "0.5732511", "0.57200664", "0.5697...
0.6421945
3
Helper function for dict comparison. Recursively orders a jsonlike dict or list of dicts.
def ordered(obj): if isinstance(obj, dict): return sorted((k, ordered(v)) for k, v in obj.items()) if isinstance(obj, list): return sorted(ordered(x) for x in obj) else: return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_match_ordered(self):\n first = dict(\n a=1,\n b=2,\n )\n\n second = OrderedDict(\n b=2,\n a=1,\n )\n\n check_keys_match_recursive(first, second, [])", "def canonicalize(json_obj):\n if isinstance(json_obj, collections.Muta...
[ "0.66737545", "0.65648377", "0.6531442", "0.65226024", "0.65075547", "0.6462174", "0.64458007", "0.64157945", "0.6391645", "0.63329893", "0.6279553", "0.6140222", "0.606853", "0.6033286", "0.5979329", "0.59495306", "0.59491986", "0.59375465", "0.5902965", "0.5857033", "0.5853...
0.71513325
0
Method that returns a webpage suitable for an Iframe in the guides. XeoGL Version
def render_model1(request, company, region, cityID, prID, ispizza, seal): # this method returns the pizzabox labelling model. # either with or without a seal. # render with the babylon viewer. additional_path = "" # Need to set some way to generate the model name.. additional_path += "ispizza" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iframe(src, width=400, height=300):\n return TAG.iframe(_src=src, _width=width, _height=height)", "def get_clubs_html():\n url = 'https://ocwp.apps.pennlabs.org'\n return get_html(url)", "def show_trailer(self):\r\n webbrowser.open(self.trailer_youtube_url)", "def get_help_page(appname, b...
[ "0.6073214", "0.5903742", "0.5628554", "0.56145006", "0.5598045", "0.5535761", "0.5497611", "0.54037017", "0.5354226", "0.53121626", "0.53121626", "0.53121626", "0.5311463", "0.53037983", "0.529392", "0.529392", "0.529392", "0.52934885", "0.52762014", "0.52694017", "0.5265711...
0.0
-1
Returns the activation of an array
def activate(X, method='tanh'): if method == 'tanh': # hyperbolic tangent return np.tanh(X) if method == 'relu': # rectified linear return np.maximum(X, [0]) else: # sigmoid return (1 / (1 + np.exp(-X)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def activation(x):\n # return np.tanh(x)\n return np.maximum(0,x)", "def activation_function(self, x: np.array) -> np.array:\r\n\t\treturn self._activation_function(x)", "def activation(self):\n return self.__activation", "def activation_function(self, X):\n return self.net_input(X)", "def ...
[ "0.70780134", "0.69657516", "0.6741216", "0.6656511", "0.6656511", "0.63693285", "0.634781", "0.63375866", "0.6276203", "0.6265574", "0.61586326", "0.6124087", "0.6113026", "0.6077652", "0.6077652", "0.60700697", "0.60535944", "0.6021872", "0.6017524", "0.60162455", "0.600722...
0.6196136
10
Check if the keypoints are within the rectangle
def in_rect(keypoints, tl, br): x = keypoints[:, 0] y = keypoints[:, 1] C1 = x > tl[0] C2 = y > tl[1] C3 = x < br[0] C4 = y < br[1] result = C1 & C2 & C3 & C4 return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inside_rectangle(self, x, y):\n if (self.pos.x - self.width < x < self.pos.x + self.width and\n self.pos.y - self.height < y < self.pos.y + self.height):\n return True", "def inside(point, rectangle):\n\n ll = rectangle.getP1() # assume p1 is ll (lower left)\n ur = rectang...
[ "0.72516793", "0.7142906", "0.70730245", "0.7007214", "0.698744", "0.6984534", "0.69611967", "0.68671304", "0.6842509", "0.6759539", "0.6754164", "0.6735493", "0.67297757", "0.6706319", "0.66019124", "0.65844727", "0.658075", "0.65672255", "0.65388477", "0.6538134", "0.653188...
0.7725725
0
Insert a child at a specific index of the child list. It does not update the parent of the child.
def insertChild(self, index, child): self.__initChild() self.__child.insert(index, child)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Insert(self, child, index):\r\n \r\n self._children.insert(index, child)", "def add_child(self, child: \"AbstractNode\", index: int = None) -> None:\n if index is None:\n self._children.append(child)\n else:\n self._children.insert(index, child)", "def inse...
[ "0.8847942", "0.74408275", "0.7171943", "0.7134534", "0.7111537", "0.7085709", "0.70514834", "0.7042886", "0.70150644", "0.7000083", "0.6983597", "0.69618535", "0.6937307", "0.6933729", "0.6928319", "0.691106", "0.6872321", "0.6824834", "0.6817622", "0.67972004", "0.67968297"...
0.87544537
1
The collation of the database.
def collation(self) -> Optional[str]: return pulumi.get(self, "collation")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collation(self) -> str:\n return pulumi.get(self, \"collation\")", "def collation(self) -> str:\n return pulumi.get(self, \"collation\")", "def collation(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"collation\")", "def collation(self) -> Optional[pulumi.Input[str]]:\n ...
[ "0.8898168", "0.8898168", "0.85401684", "0.81631994", "0.81631994", "0.8077734", "0.7570827", "0.7125354", "0.69427735", "0.6822599", "0.6437845", "0.6327915", "0.6148803", "0.6098762", "0.6083355", "0.59087133", "0.58801705", "0.57696706", "0.5762165", "0.57210124", "0.53695...
0.867527
2
The creation date of the database (ISO8601 format).
def creation_date(self) -> str: return pulumi.get(self, "creation_date")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def creation_datetime(self) -> datetime:\n return utc_to_local(self._db_data.creation_datetime)", "def creation_date_time(self) -> Optional[str]:\n return pulumi.get(self, \"creation_date_time\")", "def get_creation_time(self):\n return self.get_attr('date_created')", "def created_date_t...
[ "0.8173095", "0.8053759", "0.8005365", "0.79930115", "0.7989035", "0.7989035", "0.7989035", "0.7937897", "0.7937897", "0.7937897", "0.7831622", "0.7826861", "0.78067887", "0.7716699", "0.77032447", "0.77032447", "0.7669416", "0.7626967", "0.7626967", "0.7619635", "0.7619635",...
0.8402115
0
The current service level objective name of the database.
def current_service_objective_name(self) -> str: return pulumi.get(self, "current_service_objective_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name(self) -> str:\n return self.dbname", "def database_name(self) -> str:\n return pulumi.get(self, \"database_name\")", "def database_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"database_name\")", "def db_name(self):\n return self._db_name", "def getD...
[ "0.7349525", "0.7303808", "0.7296945", "0.7200006", "0.71794564", "0.7135177", "0.70904243", "0.6967363", "0.6834094", "0.68120563", "0.6748159", "0.6678087", "0.6656643", "0.66329896", "0.6626928", "0.6612891", "0.6553475", "0.6416998", "0.6359906", "0.6359906", "0.6349738",...
0.81737393
0
The ID of the database.
def database_id(self) -> str: return pulumi.get(self, "database_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def database_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"database_id\")", "def database_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"database_id\")", "def database_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"database_id\")", "def get...
[ "0.83791196", "0.8170174", "0.80398446", "0.7688328", "0.7618641", "0.7560588", "0.75560576", "0.7478112", "0.7461554", "0.7461554", "0.7441238", "0.7407154", "0.7407154", "0.7407154", "0.7407154", "0.7407154", "0.7407154", "0.74067235", "0.7405202", "0.7376028", "0.7376028",...
0.884176
0
The default secondary region for this database.
def default_secondary_location(self) -> str: return pulumi.get(self, "default_secondary_location")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_region(self):\n try:\n return self._default_region\n except AttributeError:\n return None", "def region(self):\n return self.config.region", "def preferred_data_center_region(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"preferred_da...
[ "0.778631", "0.69549465", "0.68442124", "0.68435967", "0.6822702", "0.6822702", "0.6822702", "0.6822702", "0.67015", "0.6690629", "0.6690629", "0.6690629", "0.6690629", "0.6690629", "0.6690629", "0.6601553", "0.6593004", "0.65910083", "0.6548941", "0.6548941", "0.652745", "...
0.7106201
1
Failover Group resource identifier that this database belongs to.
def failover_group_id(self) -> str: return pulumi.get(self, "failover_group_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_group_id(self) -> str:\n return pulumi.get(self, \"resource_group_id\")", "def resource_group_id(self) -> str:\n return pulumi.get(self, \"resource_group_id\")", "def resource_group_id(self) -> str:\n return pulumi.get(self, \"resource_group_id\")", "def resource_group_id(se...
[ "0.74158144", "0.74158144", "0.74158144", "0.74158144", "0.74158144", "0.6953311", "0.6938417", "0.6938417", "0.6938417", "0.6921648", "0.6921648", "0.69151986", "0.691161", "0.69051534", "0.69051534", "0.69051534", "0.69051534", "0.69051534", "0.6897474", "0.68535906", "0.68...
0.8364643
0
Kind of database. This is metadata used for the Azure portal experience.
def kind(self) -> str: return pulumi.get(self, "kind")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDatabaseName(self):\n raise NotImplementedError", "def db_metadata(self):\n return self.metadata", "def database(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"database\")", "def dbinfo(self):\n data = self._http_get(\"dbInfo\")\n return data.json()", "de...
[ "0.653277", "0.6483857", "0.63954824", "0.6348741", "0.63385594", "0.63174653", "0.62650114", "0.6132941", "0.61205024", "0.60756594", "0.60756594", "0.60756594", "0.60756594", "0.60455567", "0.60455567", "0.6041563", "0.6033092", "0.60200477", "0.6002529", "0.5993689", "0.59...
0.58937657
43
The name and tier of the SKU.
def sku(self) -> Optional['outputs.SkuResponse']: return pulumi.get(self, "sku")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sku_name(self) -> str:\n return pulumi.get(self, \"sku_name\")", "def sku_name(self) -> str:\n return pulumi.get(self, \"sku_name\")", "def sku_name(self) -> str:\n return pulumi.get(self, \"sku_name\")", "def tier(self) -> str:\n return pulumi.get(self, \"tier\")", "def tie...
[ "0.7710088", "0.7710088", "0.7710088", "0.73983854", "0.73983854", "0.73983854", "0.72822964", "0.70517504", "0.7043147", "0.7043147", "0.6984175", "0.6978023", "0.6978023", "0.6978023", "0.6978023", "0.6860508", "0.68567514", "0.68383133", "0.6759363", "0.6699772", "0.669977...
0.61048174
48
The status of the database.
def status(self) -> str: return pulumi.get(self, "status")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status(self):\n return self.rpc.call(MsfRpcMethod.DbStatus)", "def status(self):\n return self._dbattr('status')", "def status(self):\n return self._query_status()['status']", "def status(self):\n return self.status", "def status(self):\n pass", "def status(self):\n...
[ "0.88614845", "0.84258467", "0.7835993", "0.7661296", "0.7653794", "0.7653794", "0.7625117", "0.75945616", "0.75830305", "0.75830305", "0.75632966", "0.75632966", "0.75632966", "0.75632966", "0.75632966", "0.75632966", "0.75632966", "0.75632966", "0.75632966", "0.75632966", "...
0.7323819
59
Function to collect predicates for a given subject
def collect_predicates(subject, row, structure_row, files, stc, prefixes): related_predicates = set() for related_row in stc.iterrows(): if ( related_row[1]["File"] == row.File ) and ( related_row[1]["Sheet"] == row.Sheet ) and ( related_row[1]["Indexe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predicates(\n self,\n subject: Optional[\"_SubjectType\"] = None,\n object: Optional[\"_ObjectType\"] = None,\n ) -> Generator[\"_PredicateType\", None, None]:\n for t, c in self.triples((subject, None, object)):\n yield t[1]", "def predicates(\n self,\n ...
[ "0.7256225", "0.7256225", "0.67554575", "0.67554575", "0.66778994", "0.66778994", "0.6389159", "0.63170636", "0.6265276", "0.6265276", "0.6175801", "0.6175801", "0.58999044", "0.57853705", "0.5782773", "0.5584673", "0.5576469", "0.55681396", "0.55681396", "0.5358143", "0.5346...
0.62788606
8
returns the total supply of BTC (based on what bitcoind says the current block height is)
def get_btc_supply(normalize=False, at_block_index=None): block_count = config.CURRENT_BLOCK_INDEX if at_block_index is None else at_block_index blocks_remaining = block_count total_supply = 0 reward = 50.0 while blocks_remaining > 0: if blocks_remaining >= 210000: blocks_remain...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_total_supply() -> int:\n return total_supply", "def q_totalbc(abe, page, chain):\n if chain is None:\n return 'Shows the amount of currency ever mined.\\n' \\\n 'This differs from the amount in circulation when' \\\n ' coins are destroyed, as happens fre...
[ "0.72471553", "0.6978236", "0.6650895", "0.65374655", "0.6452504", "0.63773227", "0.6178094", "0.6121078", "0.6081714", "0.60594887", "0.60565513", "0.60446024", "0.60281193", "0.6013505", "0.5983058", "0.59635496", "0.5951646", "0.5947423", "0.59287244", "0.59217453", "0.591...
0.6853406
2
Function to get AAD token for given resource. Supports managed identity or service principal auth.
def _get_aad_token(self, resource: str) -> str: aad_token = self.oauth_tokens.get(resource) if aad_token and self._is_oauth_token_valid(aad_token): return aad_token["access_token"] self.log.info("Existing AAD token is expired, or going to expire soon. Refreshing...") try: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _a_get_aad_token(self, resource: str) -> str:\n aad_token = self.oauth_tokens.get(resource)\n if aad_token and self._is_oauth_token_valid(aad_token):\n return aad_token[\"access_token\"]\n\n self.log.info(\"Existing AAD token is expired, or going to expire soon. Refreshing...
[ "0.6660928", "0.63540584", "0.6064646", "0.59505117", "0.59505117", "0.575896", "0.5705762", "0.56768453", "0.5632065", "0.5627883", "0.56179637", "0.56153786", "0.56135553", "0.5612888", "0.56065696", "0.5564779", "0.5512757", "0.5507207", "0.5496103", "0.5447734", "0.544015...
0.63826174
1
Async version of `_get_aad_token()`.
async def _a_get_aad_token(self, resource: str) -> str: aad_token = self.oauth_tokens.get(resource) if aad_token and self._is_oauth_token_valid(aad_token): return aad_token["access_token"] self.log.info("Existing AAD token is expired, or going to expire soon. Refreshing...") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def acquire_token_func():\n\tconf = get_conf_from_json()\n\ttenant_name = conf['tenant_name']\n\tauthority_url = f'https://login.microsoftonline.com/{tenant_name}'\n\tapp = msal.ConfidentialClientApplication(\n\t\tauthority=authority_url,\n\t\tclient_id=conf['client_id'],\n\t\tclient_credential=conf['client_secret...
[ "0.66531694", "0.663363", "0.6622454", "0.65063345", "0.637022", "0.63280404", "0.6302673", "0.6189855", "0.6141223", "0.60787266", "0.60174453", "0.6010609", "0.5984784", "0.59559727", "0.5924693", "0.5924693", "0.58600867", "0.57954675", "0.5790458", "0.57788044", "0.577689...
0.6904673
0
Check if a solution is available, according to the module. It is used in the cases of optimal and efficient solution. For the optimal solution it is applied only to the module chosen by the fantaplayer while for the efficient solution it is applied to all the modules following the order of the players in the bench. A s...
def find_solution(list_of_tuples, module, n_of_players_with_vote): def calculate(candidate, roles_of_module): """This function applies the deploy_players function to look for the solution, if it exists. If all the players are deployed it returns True, otherwise False. """ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def look_for_solution(module, n_of_players_with_vote):\n\n try_optimal_solution(module, n_of_players_with_vote)\n if not final_field:\n try_efficient_solution(module, n_of_players_with_vote)\n if not final_field:\n try_adapted_solution(n_of_players_with_vote)", "def try...
[ "0.819134", "0.7798657", "0.7776841", "0.6801624", "0.6525803", "0.5733148", "0.57084846", "0.5697338", "0.5688677", "0.56604964", "0.5525516", "0.5522767", "0.5483413", "0.54822654", "0.54788893", "0.5473544", "0.5463981", "0.5426654", "0.54142267", "0.5388427", "0.5387596",...
0.74566
3
Ensures correct output from _get_xentropy_components_one_time. In this case, doing neighbourhoodbased evaluation.
def test_get_xentropy_components_one_time_neigh(self): this_numerator, this_denominator = ( learning_curves._get_xentropy_components_one_time( actual_target_matrix=ACTUAL_TARGET_MATRIX, probability_matrix=PROBABILITY_MATRIX, eval_mask_matrix=MASK_MATR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entropy(self):\n\n \"\"\"Gets the first neighbours, which are the first 2*r+1 cells.\"\"\"\n current_neighbours = []\n amount = [0] * self.k ** (2 * self.r + 1)\n for i in range(2 * self.r + 1):\n current_neighbours.append(self.config[self.t, i % self.width])\n\n \"\"\"Calculates the rule...
[ "0.6206713", "0.5822384", "0.5724554", "0.5705255", "0.56678903", "0.5656953", "0.5593066", "0.5587563", "0.5585027", "0.5571584", "0.5567998", "0.55672807", "0.5561256", "0.5559216", "0.5553132", "0.549577", "0.5485566", "0.5463477", "0.5410064", "0.5406289", "0.5354231", ...
0.7917998
0