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 |
|---|---|---|---|---|---|---|
This data source provides the Vpc Peer Connections of the current Alibaba Cloud user. | def get_peer_connections_output(ids: Optional[pulumi.Input[Optional[Sequence[str]]]] = None,
name_regex: Optional[pulumi.Input[Optional[str]]] = None,
output_file: Optional[pulumi.Input[Optional[str]]] = None,
peer_connectio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_connections(self):\r\n return users.UserConnections(self)",
"def getConnectionsBetweenSuperPeers(self):\r\n raise NotImplementedError()",
"def peer_list_all(self):\n return self.client.call('GET', self.name + 'peer-list/all')",
"def list_conns(self):\n\t\tres = []\n\t\tself.AL.a... | [
"0.6308618",
"0.57736284",
"0.568641",
"0.55183715",
"0.54638785",
"0.54638785",
"0.5443154",
"0.5430412",
"0.54221624",
"0.5418182",
"0.54057753",
"0.54030436",
"0.53774244",
"0.5342774",
"0.5322539",
"0.5296446",
"0.52925545",
"0.5288956",
"0.5268953",
"0.5262285",
"0.52562... | 0.0 | -1 |
Return the test bucket. | def test_bucket(gs_url):
u = parse.urlparse(gs_url)
assert u.netloc is not None, "Missing bucket in url."
return u.netloc | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_bucket(self):\n pass",
"def test_bucket():\n return 'test_bucket'",
"def get_bucket():\n return FileBucket(os.path.join(context.site.data_path, 'buckets'))",
"def test_get_buckets(self):\n pass",
"def bucket(self):\n return self._bucket",
"def bucket(self):\n ... | [
"0.8074077",
"0.7871429",
"0.7518401",
"0.74116904",
"0.73524314",
"0.7280735",
"0.71709573",
"0.71709573",
"0.7089255",
"0.6991994",
"0.69863546",
"0.68491507",
"0.68391454",
"0.68391454",
"0.6822143",
"0.6822143",
"0.6822143",
"0.6822143",
"0.6822143",
"0.6783358",
"0.67743... | 0.6047873 | 48 |
Required method for use with the Search class. Returns a list of the operator names in the same order as the applyOperators method. | def operatorNames(self):
return ["moveUp", "moveDown",
"moveLeft", "moveRight"] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def operartors(self) -> List[Operator]:\n return list(self.__ops.keys())",
"def operators(self):\n return self.domain.operators.keys()",
"def operators(self):\n return self._operators",
"def repair_operators(self) -> List[Tuple[str, _OperatorType]]:\n return list(self._r_ops.items... | [
"0.8365627",
"0.81175417",
"0.7953473",
"0.76170385",
"0.7324951",
"0.71785325",
"0.6979297",
"0.69682455",
"0.6872573",
"0.6767571",
"0.67205125",
"0.6708942",
"0.6661125",
"0.6661125",
"0.6470414",
"0.6460926",
"0.6449408",
"0.6442769",
"0.64336103",
"0.6411388",
"0.634492"... | 0.7330029 | 4 |
The project in which the `cluster` can be found and jobs subsequently run against. If it is not provided, the provider project is used. | def project(self) -> pulumi.Output[str]:
return pulumi.get(self, "project") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_cluster(self,cluster_name,project_id=''):\n print( f'>>>>>>{self.project_id}')\n if project_id == '':\n project_id = self.project_id\n return self.get('{}/groups/{}/clusters/{}'.format(ApiVersion.A1.value,project_id,cluster_name))",
"def get_project(arn=None):\n pass",
"def get_project... | [
"0.69352996",
"0.6739893",
"0.6423005",
"0.6373633",
"0.6373633",
"0.6373633",
"0.6373633",
"0.6373633",
"0.6373633",
"0.6373633",
"0.6373633",
"0.6373633",
"0.6373633",
"0.6373633",
"0.6373633",
"0.6373633",
"0.6373633",
"0.6373633",
"0.6373633",
"0.6373633",
"0.6373633",
... | 0.6067527 | 40 |
The Cloud Dataproc region. This essentially determines which clusters are available for this job to be submitted to. If not specified, defaults to `global`. | def region(self) -> pulumi.Output[Optional[str]]:
return pulumi.get(self, "region") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def region(self):\n return self.config.region",
"def region(self) -> Optional[str]:\n return pulumi.get(self, \"region\")",
"def region(self) -> Optional[str]:\n return pulumi.get(self, \"region\")",
"def region(self) -> Optional[str]:\n return pulumi.get(self, \"region\")",
"de... | [
"0.6496684",
"0.637264",
"0.637264",
"0.637264",
"0.637264",
"0.62863237",
"0.62863237",
"0.62863237",
"0.62863237",
"0.62863237",
"0.62863237",
"0.62863237",
"0.62863237",
"0.62863237",
"0.62863237",
"0.62863237",
"0.62863237",
"0.62863237",
"0.6268148",
"0.6268148",
"0.6268... | 0.6106103 | 34 |
The status of the job. | def status(self) -> pulumi.Output['outputs.JobStatus']:
return pulumi.get(self, "status") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def status(self):\n return self.job_proto.status",
"def status(self) -> str:\n return self._check_job_status()",
"def get_status(self):\n\t\treturn call_sdk_function('PrlJob_GetStatus', self.handle)",
"def get_status(self):\n url = \"data_request?id=jobstatus&job=%d&plugin=zwave\" % self... | [
"0.92506886",
"0.8988243",
"0.8402834",
"0.83018255",
"0.826159",
"0.826159",
"0.82123315",
"0.82123315",
"0.8207781",
"0.8207643",
"0.8196103",
"0.8196103",
"0.8196103",
"0.8196103",
"0.8196103",
"0.8196103",
"0.8196103",
"0.8196103",
"0.8196103",
"0.8196103",
"0.8196103",
... | 0.86333364 | 2 |
Constructor for the Rule9Model class | def __init__(self,
name=None,
lan_ip=None,
uplink=None,
public_port=None,
local_port=None,
allowed_ips=None,
protocol=None):
# Initialize members of the class
self.name = nam... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, rule):\n Rule.__init__(self)\n self.__rule = rule",
"def __init__(self, rule):\n Rule.__init__(self)\n self.__rule = rule",
"def __init__(self, rule):\n Rule.__init__(self)\n self.__rule = rule",
"def __init__(self, rule):\n Rule.__init__(se... | [
"0.72211367",
"0.72211367",
"0.72211367",
"0.72211367",
"0.72211367",
"0.72143865",
"0.6882214",
"0.6725234",
"0.6722852",
"0.67187047",
"0.667719",
"0.6504942",
"0.64892286",
"0.6420557",
"0.6367563",
"0.63492656",
"0.6336462",
"0.62773824",
"0.619178",
"0.619178",
"0.619178... | 0.0 | -1 |
Creates an instance of this model from a dictionary | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
# Extract variables from the dictionary
name = dictionary.get('name')
lan_ip = dictionary.get('lanIp')
uplink = dictionary.get('uplink')
public_port = di... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n # Extract variables from the dictionary\n id = dictionary.get('id')\n name = dictionary.get('name')\n mtype = dictionary.get('type')\n usage_bytes = diction... | [
"0.83190626",
"0.81680465",
"0.81680465",
"0.81198996",
"0.80894077",
"0.7979489",
"0.79510856",
"0.7923969",
"0.78998214",
"0.7894075",
"0.788929",
"0.7883757",
"0.7883385",
"0.7877541",
"0.78598565",
"0.78387827",
"0.7804587",
"0.7804587",
"0.7804587",
"0.7804587",
"0.78045... | 0.75639534 | 83 |
Id and timestamps are added automatically. The id is an UUID which identifies the current message, so it can be traced across services. | def __init__(self, source=None, event=None):
self.id = str(uuid.uuid4())
self.timestamp = datetime.datetime.now().isoformat()
self.source = source
self.type = event | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _id(self):\n pass",
"def id(self):\n return self.proto.id",
"def generate_message_id():\n return str(uuid.uuid1())",
"def __whatsmyid(self, update, context):\n user = self.User(update)\n output = f\"your ID is: {user.id}\"\n user.send_message(output)\n self.da... | [
"0.6253083",
"0.61823976",
"0.6172441",
"0.61702394",
"0.61536574",
"0.61451393",
"0.6128422",
"0.6124392",
"0.6112365",
"0.61069715",
"0.6074888",
"0.6036858",
"0.6036858",
"0.6036858",
"0.6036858",
"0.6036858",
"0.6006696",
"0.6002576",
"0.5980261",
"0.5961125",
"0.5961125"... | 0.0 | -1 |
Makes sure that our default axis is provided as a numpy array. | def test_default_axis_nxdata(self, nexus_base):
assert isinstance(nexus_base.default_axis, np.ndarray) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _chk_asarray(a, axis):\r\n if axis is None:\r\n a = ravel(a)\r\n outaxis = 0\r\n else:\r\n a = asarray(a)\r\n outaxis = axis\r\n return a, outaxis",
"def _cook_args(self, val, axes, default=None):\n if val is None:\n return default\n\n # if val is... | [
"0.6649476",
"0.6161352",
"0.5885819",
"0.5845409",
"0.5838769",
"0.5742271",
"0.571256",
"0.57047796",
"0.5691466",
"0.5663704",
"0.5622066",
"0.5607",
"0.5602555",
"0.5553784",
"0.55428004",
"0.5542131",
"0.554087",
"0.55326766",
"0.55136144",
"0.55073464",
"0.55016273",
... | 0.762145 | 0 |
Calculate the heuristic value of a game state from the point of view of the given player. | def custom_score(game, player):
if game.is_loser(player):
return float("-inf")
if game.is_winner(player):
return float("inf")
"""
#Heuristic 1: Aggressive Improved Score
own_moves = len(game.get_legal_moves(player))
opp_moves = len(game.get_legal_moves(game.get_opponent(player... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def utility(self, state, player):\n if state.isWin() or state.isLose():\n return state.getScore()\n\n # In case of cycle.\n if player == PACMAN:\n return INFINITY\n else:\n return -INFINITY",
"def calculate_utility(state, player):\n thisPlayer = pla... | [
"0.71605945",
"0.7127043",
"0.68422264",
"0.681838",
"0.67977256",
"0.659008",
"0.6583937",
"0.64494747",
"0.64484817",
"0.6436802",
"0.64358234",
"0.6432952",
"0.6418598",
"0.6413811",
"0.6405533",
"0.6400188",
"0.6355528",
"0.6340021",
"0.6338477",
"0.6310529",
"0.6307838",... | 0.58704 | 61 |
Computes proportion of transitions from distractors to target (PTDT). | def trial_ptdt(trial, omit_missing_frames=True):
frames = trial.HMM_MLE
if omit_missing_frames:
frames = frames[frames >= 0]
transitions_from_distractor_to_target = 0
transitions_from_distractor = 0
for first, second in zip(frames, frames[1:]):
if first > 0 and second != first and second >= 0:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_target_proportions_of_current_trial(individuals, target):\n ambulance_waits, ambulance_target_waits = 0, 0\n other_waits, other_target_waits = 0, 0\n for individual in individuals:\n ind_class = len(individual.data_records) - 1\n rec = individual.data_records[-1]\n if rec.node... | [
"0.6588637",
"0.6276088",
"0.6199505",
"0.5972191",
"0.59643674",
"0.5934761",
"0.58777314",
"0.5799912",
"0.5764844",
"0.57578576",
"0.5746363",
"0.5730918",
"0.5722168",
"0.57130986",
"0.570024",
"0.5686827",
"0.56829405",
"0.5679269",
"0.56771815",
"0.56744975",
"0.5667879... | 0.6060115 | 3 |
Convert from units of miles to kilometers PARAMETERS | def miles_to_kilometers(miles):
#convert miles to km:
return miles*1.60934 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def kilometers_to_miles(km):\n #convert km to miles:\n return km*0.621371",
"def meters_to_miles(meters):\n miles = meters / 1609.344\n return miles",
"def miles_to_kilometers(miles: float) -> float:\n mile = float(miles)\n kilometers = float(float(mile) * 1.60934)\n return round(kilometer... | [
"0.77802",
"0.7755616",
"0.7668557",
"0.76046497",
"0.7545439",
"0.75178707",
"0.730252",
"0.71189445",
"0.7069736",
"0.7057184",
"0.6892314",
"0.6817121",
"0.68162787",
"0.6803385",
"0.6796024",
"0.6754921",
"0.67502207",
"0.67432517",
"0.66816795",
"0.66148984",
"0.65178186... | 0.8187843 | 0 |
Plot instantaneous errors of the estimators. | def plot_insta_err(self, ax=None):
if ax is None:
ax = plt.gca()
ax.set_yscale('log')
ax.plot(list(range(1, self.max_dets)), self.errors[0], label='independent')
ax.plot(list(range(1, self.max_dets)), self.errors[1], label='correlated')
ax.set_ylabel(r'Stochastic erro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_errors(self):\n\n plt.title(\"Prediction Error\")\n plt.plot(self.errors)\n plt.ylabel(\"MSE (Mean Squared Error)\")\n plt.xlabel(\"Iteration\")\n plt.show()",
"def _plot_errors(self):\n for task_id, loss_type in self.task_ids.iteritems():\n x = np.ar... | [
"0.7790077",
"0.72863877",
"0.7281637",
"0.70972556",
"0.7033342",
"0.6921551",
"0.68822366",
"0.67254454",
"0.6659496",
"0.6598495",
"0.64792967",
"0.64692545",
"0.6452525",
"0.64518654",
"0.63924325",
"0.6387322",
"0.63829976",
"0.6356224",
"0.63293797",
"0.6315341",
"0.630... | 0.66511726 | 9 |
Plot the standard errors of means of the estimators. | def plot_err(self, expect=False, axallerr=None):
if axallerr is None:
axallerr = plt.gca()
axallerr.set_yscale('log')
axallerr.plot(list(range(1, self.max_dets)), self.stderr[0], label='independent')
axallerr.plot(list(range(1, self.max_dets)), self.stderr[1], label='correlat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_mean_std_comparison(evaluators: List):\n nr_plots = len(evaluators)\n fig, ax = plt.subplots(2, nr_plots, figsize=(4 * nr_plots, 7))\n flat_ax = ax.flatten()\n for i in range(nr_plots):\n plot_mean_std(evaluators[i].real, evaluators[i].fake, ax=ax[:, i])\n\n titles = [e.name if e is ... | [
"0.73546046",
"0.6952503",
"0.6946404",
"0.6877306",
"0.687559",
"0.667268",
"0.664603",
"0.6637823",
"0.65861094",
"0.65127766",
"0.64678663",
"0.6440814",
"0.6379075",
"0.6376709",
"0.6345226",
"0.63331795",
"0.6291048",
"0.62852615",
"0.6247711",
"0.62314653",
"0.6157446",... | 0.5859899 | 41 |
In the forward pass we receive a Tensor containing the input and return a Tensor containing the output. ctx is a context object that can be used to stash information for backward computation. You can cache arbitrary objects for use in the backward pass using the ctx.save_for_backward method. | def forward(ctx, input, n=0, n_backward=None):
ctx.save_for_backward(input)
ctx.n = n if n_backward is None else n_backward
return truncate_significand(input.clamp(min=0), n) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def backward(ctx, grad_output):\n\n ########################\n # PUT YOUR CODE HERE #\n #######################\n # Retrieve saved tensors and constants\n gamma, ivar, mean, input = ctx.saved_tensors\n eps = ctx.saved_tensors\n\n # Check which inputs need gradients\n input_needs_grad, gamm... | [
"0.69544023",
"0.6905318",
"0.68099415",
"0.67029667",
"0.66879076",
"0.66839033",
"0.6660069",
"0.65296954",
"0.6529399",
"0.6508304",
"0.64682263",
"0.6463056",
"0.6463056",
"0.6454037",
"0.6429429",
"0.63865495",
"0.63806874",
"0.6369625",
"0.6352219",
"0.6346059",
"0.6345... | 0.0 | -1 |
In the backward pass we receive a Tensor containing the gradient of the loss with respect to the output, and we need to compute the gradient of the loss with respect to the input. | def backward(ctx, grad_output):
input, = ctx.saved_tensors
grad_input = grad_output.clone()
grad_input[input < 0] = 0
return truncate_significand(grad_input, ctx.n), None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def backward(ctx, grad_output):\n\n ########################\n # PUT YOUR CODE HERE #\n #######################\n # Retrieve saved tensors and constants\n gamma, ivar, mean, input = ctx.saved_tensors\n eps = ctx.saved_tensors\n\n # Check which inputs need gradients\n input_needs_grad, gamm... | [
"0.8169892",
"0.8148178",
"0.7938269",
"0.7929291",
"0.79062223",
"0.7900967",
"0.7891459",
"0.786147",
"0.7845227",
"0.78241146",
"0.780626",
"0.77860373",
"0.77859795",
"0.7771029",
"0.7771029",
"0.7752398",
"0.7694279",
"0.769019",
"0.76733464",
"0.76733464",
"0.7646218",
... | 0.7185079 | 62 |
Roundsdown to the hour. | def hour(self):
return "%s:00:00" % self.timestamp[:13] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _hour_to_time(num: int):\n return datetime.datetime.now().replace(hour=num).strftime(\"%-I %p\")",
"def round_time(self, time):\n hour, mins, _ = time.split(\":\")\n return '{:02d}:00:00'.format(int(hour)+1 ) if int(mins) >= 30 else '{:02d}:00:00'.format(int(hour))",
"def date_hour(date):\... | [
"0.662727",
"0.65610725",
"0.6368915",
"0.6309343",
"0.6256675",
"0.6245342",
"0.6230229",
"0.61407244",
"0.61139095",
"0.60649586",
"0.605199",
"0.6042629",
"0.6042629",
"0.6036832",
"0.59720373",
"0.5928999",
"0.5926597",
"0.5924163",
"0.5913751",
"0.59117365",
"0.58819383"... | 0.6528547 | 2 |
Takes a n x m array and a color dict returns an n x m x 4 array >>> target = np.zeros((5,5,4)) | def make_slice_mask_colored(slice_mask, colors, transparancy=0.5):
slice_mask_4d = get_4d(slice_mask, transparancy=transparancy)
for key, value in viewitems(colors):
matches = (slice_mask == key)
if matches.any():
slice_mask_4d[matches, 0] = value[0]
slice_mask_4d[matche... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_to_color(arr_2d, palette=palette):\n\tarr_3d = np.zeros((arr_2d.shape[0], arr_2d.shape[1], 3), dtype=np.uint8)\n\n\t# m = arr_2d == 1\n\t# arr_3d[m] = palette[1]\n\tfor c, i in palette.items():\n\t\tm = arr_2d == c\n\t\tarr_3d[m] = i\n\n\treturn arr_3d",
"def color_from_ind(i: int) -> np.ndarray:\n ... | [
"0.6156894",
"0.61086404",
"0.60720015",
"0.60672164",
"0.59425217",
"0.5898646",
"0.58254856",
"0.5735351",
"0.56136036",
"0.5587096",
"0.556785",
"0.5549115",
"0.5528539",
"0.5522767",
"0.5509495",
"0.5509495",
"0.547309",
"0.5414421",
"0.5403653",
"0.5400485",
"0.5395043",... | 0.0 | -1 |
Loads a nifti image, returns a ndarray() | def load_nifti(fname, reorient=True):
img = nib.load(fname)
if reorient:
img = nib.as_closest_canonical(img)
return(img.get_data()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_nii(img_path):\n nimg = nib.load(img_path)\n return np.asanyarray(nimg.dataobj), nimg.affine, nimg.header",
"def load_nifti_image(filename):\n img = nib.load(filename)\n data = img.get_data()\n return data",
"def load_nii(img_path):\n nimg = nib.load(img_path)\n return... | [
"0.82157946",
"0.8188324",
"0.7924674",
"0.7165679",
"0.7078407",
"0.7006303",
"0.69545263",
"0.69052076",
"0.6899124",
"0.68090343",
"0.67680174",
"0.673109",
"0.66922367",
"0.66764534",
"0.66757",
"0.6670753",
"0.6612649",
"0.66008824",
"0.65935457",
"0.6578518",
"0.6547497... | 0.7365154 | 3 |
Maps unique values in a mask to colors Colors from 12class paired | def map_label_colors(array, ignore_vals=[0]):
colset = [(166, 206, 227),
(31, 120, 180),
(178, 223, 138),
(51, 160, 44),
(251, 154, 153),
(227, 26, 28),
(253, 191, 111),
(255, 127, 0),
(202, 178, 214),
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_color_map(self):\n unique_labels = np.unique(self.out_labels)\n color_map = {}\n for unique_label in unique_labels:\n color_map[unique_label] = self._random_color()\n\n return color_map",
"def uniqueish_color(color_data):\n # return plt.cm.gist_ncar(color_dat... | [
"0.7061136",
"0.6628387",
"0.654271",
"0.6501592",
"0.6501592",
"0.6488634",
"0.64247537",
"0.6384493",
"0.63419646",
"0.6212075",
"0.62033486",
"0.6153768",
"0.61329377",
"0.6097564",
"0.60670507",
"0.6065393",
"0.6036502",
"0.60210913",
"0.6020715",
"0.60159516",
"0.5987043... | 0.65427893 | 2 |
Creates a 4d array from a 2d slice if copylayers, duplicates slice into layers >>> s = np.ones((5,5)) >>> new_s = get_4d(s) >>> assert new_s == np.zeros((5,5,4)) >>> new_s = get_4d(s, (0,1,2)) | def get_4d(slice, copylayers=[], transparancy=0):
assert slice.ndim < 3
img = np.zeros(slice.shape)
img = img[:, :, np.newaxis]
img = np.repeat(img, 4, 2)
transparancy = 255 - (255 * transparancy)
img[:, :, -1] = transparancy
for layer in copylayers:
img[:, :, layer] = slice
retu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_4d(x):\n xsh = np.asarray(x.get_shape().as_list())\n return tf.reshape(x, [xsh[0], xsh[1], xsh[2], np.prod(xsh[3:])])",
"def cut4(image):\r\n i, j = image.shape\r\n a1 = image[:i // 2, :j // 2]\r\n a2 = image[i // 2:, :j // 2]\r\n a3 = image[:i // 2, j // 2:]\r\n a4 = image[i // 2:, j... | [
"0.580992",
"0.5560299",
"0.5378894",
"0.5298374",
"0.5279447",
"0.52607113",
"0.5240645",
"0.52167356",
"0.51848304",
"0.5180102",
"0.5138809",
"0.50719106",
"0.5038588",
"0.5025122",
"0.50200665",
"0.50013524",
"0.49843127",
"0.49803",
"0.4968998",
"0.49599096",
"0.49578133... | 0.7889935 | 0 |
create full file name from current directory | def csv_file(input_file):
current_dir = os.getcwd()
directory_name = current_dir + '\\' + 'data' + '\\'
csv_out = directory_name + input_file
return csv_out | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_full_filename(dirname, name, ext, tmstamp=False):\n fill = '_' + str_current_time() if tmstamp else ''\n fmt = '/{}{}{}' if ext.startswith('.') else '/{}{}.{}'\n return resolve(dirname) + fmt.format(name, fill, ext)",
"def filename(self):\n translator = {ord(\" \"): \"_\", ord(\",\"): Non... | [
"0.7433592",
"0.74201244",
"0.73615116",
"0.73299456",
"0.73181945",
"0.72334284",
"0.7212838",
"0.7174811",
"0.71486086",
"0.70767283",
"0.70438594",
"0.70271814",
"0.6992903",
"0.6968191",
"0.69505006",
"0.692054",
"0.6903663",
"0.68970454",
"0.6885268",
"0.6885227",
"0.688... | 0.0 | -1 |
Calculates the score of the current board and adds it to the score of the move that generates this board to create a total for this move choice. | def calculate_board_score(move: dict, board: list, player_turn: chr, current_risk: int):
black_marbles, white_marbles = Board.read_marbles(board)
black_pos_score = Evaluator.calculate_player_position_score(black_marbles)
white_pos_score = Evaluator.calculate_player_position_score(white_marbles)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _calculate_score(self):\n mul = self._check_board()\n if mul > 0:\n inc = 100 * mul + ((mul - 1) * 25)\n self.score += inc",
"def update_score(self, board):\n self._score += 1",
"def _scoring(self):\n val = 0 #score will be totaled here\n\n for c in ... | [
"0.8315933",
"0.74870396",
"0.7423775",
"0.71675783",
"0.7024712",
"0.7024712",
"0.7024712",
"0.7018758",
"0.7018758",
"0.6985459",
"0.69844913",
"0.698211",
"0.6976828",
"0.68969846",
"0.68387824",
"0.68124235",
"0.67477715",
"0.67219305",
"0.6721915",
"0.67130864",
"0.66746... | 0.75901884 | 1 |
Gets the root_volume of this DesktopDetailInfo. | def root_volume(self):
return self._root_volume | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getVolume(self):\n return self.__volume",
"def get_volume(self):\n return self.__volume",
"def get_volume(self):\n return int(self.get(COMMAND_UIC, 'GetVolume')['volume'])",
"def volume(self):\n return self._volume()",
"def volume(self):\n return self._volume()",
"d... | [
"0.7085492",
"0.7056722",
"0.7053877",
"0.7049278",
"0.7049278",
"0.69924897",
"0.6992358",
"0.6992358",
"0.6964962",
"0.69562584",
"0.68635935",
"0.67140883",
"0.6645149",
"0.66132087",
"0.66132087",
"0.66132087",
"0.66132087",
"0.66132087",
"0.65599656",
"0.65410817",
"0.65... | 0.8132008 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, DesktopDetailInfo):
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.84568954",
"0.83923674",
"0.81447554",
"0.81407183",
"0.81326675",
"0.80941343",
"0.8092415",
"0.8092415",
"0.8092415",
"0.8085536",
"0.8085536",
"0.8076502",
"0.8076502",
"0.8066026"
] | 0.0 | -1 |
Create a TestServer instance based on a Sanic Application. test_server(app, kwargs) | def test_server(loop):
servers = []
async def create_server(app, **kwargs):
server = TestServer(app, **kwargs)
await server.start_server()
servers.append(server)
return server
yield create_server
# Close Server
if servers:
for server in servers:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create(cls, application, **kwargs):\n host, port = get_free_port()\n if 'port' not in kwargs:\n kwargs['port'] = port\n if 'host' not in kwargs:\n kwargs['host'] = host\n if 'expose_tracebacks' not in kwargs:\n kwargs['expose_tracebacks'] = True\n ... | [
"0.6834083",
"0.66634876",
"0.6461442",
"0.6459448",
"0.6345231",
"0.6334865",
"0.63293743",
"0.6309406",
"0.6309406",
"0.6309406",
"0.6309406",
"0.6309406",
"0.6309406",
"0.6309406",
"0.6309406",
"0.6309406",
"0.6307033",
"0.62970513",
"0.62786776",
"0.6269869",
"0.62484163"... | 0.6894973 | 0 |
Convert a MAC address to a readable/printable string | def mac_addr(address):
return ':'.join('%02x' % compat_ord(b) for b in address) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mac_ntoa(mac):\n return '%.2x:%.2x:%.2x:%.2x:%.2x:%.2x' % tuple(map(ord, list(mac)))",
"def _mac_addr(address):\n return ':'.join('%02x' % ord(b) for b in address)",
"def mac_addr(address):\n\tprint(':'.join('%02x' % compat_ord(b) for b in address))\n\treturn ':'.join('%s' % format(compat_ord(b), '0>8... | [
"0.8275729",
"0.78203845",
"0.7803418",
"0.7801324",
"0.7395108",
"0.72631353",
"0.72443354",
"0.7216349",
"0.71774435",
"0.70426846",
"0.6996041",
"0.6983582",
"0.698355",
"0.69148487",
"0.673432",
"0.6720021",
"0.6642504",
"0.6642397",
"0.6634961",
"0.6618377",
"0.6596415",... | 0.7412299 | 5 |
Returns the total amount that a donor has donated across all donations. | def total_donation(self):
return self._total_donation | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total_donations(self):\n return sum(self.donations)",
"def total_donations(self):\n return sum(self.donations)",
"def donation_totals(donor_list, donor):\n return sum(donor_list[donor])",
"def getTotDonation(self):\n return sum(self.donationList)",
"def total_donated(self):\n ... | [
"0.83903897",
"0.83903897",
"0.81066936",
"0.79773265",
"0.77125317",
"0.6858324",
"0.67410547",
"0.67141575",
"0.66965526",
"0.665013",
"0.6595151",
"0.64820194",
"0.6480198",
"0.6478017",
"0.64620775",
"0.6447963",
"0.6372204",
"0.63655555",
"0.6331072",
"0.6324043",
"0.631... | 0.76509273 | 5 |
Returns the length of the list _donations. This is the equivalent to the number of donations. | def num_of_donations(self):
return len(self._donations) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getNumDonations(self):\n return len(self.donationList)",
"def num_donations(self):\n return len(self.donations)",
"def number_of_donations(self):\n return len(self.donations)",
"def getTotDonation(self):\n return sum(self.donationList)",
"def donation_qty(donor_list, donor):... | [
"0.8953245",
"0.89109004",
"0.8865689",
"0.762474",
"0.7606612",
"0.75773233",
"0.75773233",
"0.6671483",
"0.6666434",
"0.6666434",
"0.66417295",
"0.6581632",
"0.6579467",
"0.65463275",
"0.6544757",
"0.6520404",
"0.65122986",
"0.64736396",
"0.6451503",
"0.64283425",
"0.641104... | 0.874603 | 3 |
Returns the name of a file that will be generated with email templates. | def filename(self):
translator = {ord(" "): "_", ord(","): None}
return f'{self._full_name.translate(translator)}.txt' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_template_filename(self):\n file_name = ReportMeta.reports[self._report_key]['fileName']\n return '{}.html'.format(file_name)",
"def _get_template_filename(self):\n _format = self.cfg.get('mutations', 'format')\n if _format == 'pdf':\n tf = 'PDFTemplate.bt'\n ... | [
"0.78721046",
"0.7619341",
"0.7443601",
"0.7187887",
"0.7140058",
"0.71290576",
"0.7113886",
"0.6997978",
"0.69716",
"0.692218",
"0.69001544",
"0.68169934",
"0.6805161",
"0.68027014",
"0.67723626",
"0.67664695",
"0.6752485",
"0.67270726",
"0.6687172",
"0.66816014",
"0.6670443... | 0.66867536 | 19 |
Instantiates an object of type Donor Collection. Creates a list of Donor objects based on the the number of Donors listed in the arguments. | def __init__(self, *args: Donor):
self.donor_list = list()
for donor in args:
if isinstance(donor, Donor):
self.donor_list.append(donor)
else:
raise TypeError(
"Donor Collections must be instantiated with Donor object") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, donors=None):\n if donors is None:\n self.donor_info = {}\n else:\n for donor in donors:\n self.donor_info.update({donor.name: donor})",
"def __init__(self, donors=None):\n if donors is None:\n self.donor_inf = {}\n el... | [
"0.66461074",
"0.5870058",
"0.58644354",
"0.5826065",
"0.579891",
"0.5732586",
"0.5688405",
"0.5683072",
"0.567137",
"0.56677",
"0.5540889",
"0.5532707",
"0.54484147",
"0.5373879",
"0.5373879",
"0.53713554",
"0.5356292",
"0.53392917",
"0.53057414",
"0.5288616",
"0.5259218",
... | 0.77873236 | 0 |
Get the version of the currently running service lib. Returns string A string representing the current version. | def get_version():
return harmony.__version__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_version():\n click.echo(get_current_version_number())",
"def get_current_version(self) -> str:\n raise NotImplementedError()",
"def version():\n version_info = pbr.version.VersionInfo('ardana-service')\n return version_info.version_string_with_vcs()",
"def get_current_version(self... | [
"0.7913768",
"0.78063667",
"0.77327245",
"0.7607167",
"0.75782394",
"0.7434765",
"0.7370148",
"0.73464936",
"0.7325905",
"0.7324009",
"0.7321021",
"0.7271598",
"0.72519624",
"0.7251886",
"0.725033",
"0.71973217",
"0.71973217",
"0.71973217",
"0.71973217",
"0.71957594",
"0.7188... | 0.0 | -1 |
Node object constructor initializes internal attributes. | def __init__(self, index, supply):
self.id = index # node ID
self.supply = supply # supply value
# Initialize outgoing and incoming Arc object lists
self.out_arcs = []
self.in_arcs = [] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n self.node = None\n self.data = None",
"def __init__(self):\n self.__root = Node()",
"def __init__(self):\n self.root = Node('')",
"def __init__(self, node: Dict):\n self._node = node",
"def __init__(self):\n self.root = self.Node(None)",
"de... | [
"0.8118869",
"0.8034981",
"0.7923428",
"0.7906852",
"0.7886161",
"0.7880968",
"0.78343135",
"0.7823148",
"0.7823148",
"0.78130335",
"0.77829325",
"0.77829325",
"0.77829325",
"0.7773987",
"0.7749047",
"0.77459395",
"0.7720246",
"0.76760864",
"0.7584017",
"0.75493693",
"0.75480... | 0.0 | -1 |
Sample from a probability space of all actions | def sample(self, params, argmax_sampling=False):
means = params[:, :, 0]
log_std = params[:, :, 1]
if argmax_sampling:
return means
else:
return torch.randn_like(means) * torch.exp(log_std) + means | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def action_space_sample(self):\n return np.random.choice(self.possible_actions)",
"def __sample_policy_action(probs):\n # Subtract a tiny value from probabilities in order to avoid\n # \"ValueError: sum(pvals[:-1]) > 1.0\" in numpy.multinomial\n probs = probs - np.finfo(np.float32).ep... | [
"0.7640002",
"0.75460327",
"0.74093544",
"0.7370557",
"0.72608835",
"0.72428334",
"0.7164827",
"0.71627957",
"0.7151728",
"0.71308583",
"0.7073142",
"0.7048654",
"0.70176256",
"0.70153093",
"0.700607",
"0.6962237",
"0.69604456",
"0.6947193",
"0.6937178",
"0.6933132",
"0.69068... | 0.0 | -1 |
Sample from a probability space of all actions | def sample(self, logits, argmax_sampling=False):
if argmax_sampling:
return torch.argmax(logits, dim=-1)
else:
u = torch.rand_like(logits)
return torch.argmax(logits - torch.log(-torch.log(u)), dim=-1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def action_space_sample(self):\n return np.random.choice(self.possible_actions)",
"def __sample_policy_action(probs):\n # Subtract a tiny value from probabilities in order to avoid\n # \"ValueError: sum(pvals[:-1]) > 1.0\" in numpy.multinomial\n probs = probs - np.finfo(np.float32).ep... | [
"0.7640002",
"0.75460327",
"0.74093544",
"0.7370557",
"0.72608835",
"0.72428334",
"0.7164827",
"0.71627957",
"0.7151728",
"0.71308583",
"0.7073142",
"0.7048654",
"0.70176256",
"0.70153093",
"0.700607",
"0.6962237",
"0.69604456",
"0.6947193",
"0.6937178",
"0.6933132",
"0.69068... | 0.0 | -1 |
Sample from a probability space of all actions | def sample(self, policy_params, **kwargs):
return self.head.sample(policy_params, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def action_space_sample(self):\n return np.random.choice(self.possible_actions)",
"def __sample_policy_action(probs):\n # Subtract a tiny value from probabilities in order to avoid\n # \"ValueError: sum(pvals[:-1]) > 1.0\" in numpy.multinomial\n probs = probs - np.finfo(np.float32).ep... | [
"0.7638372",
"0.7545525",
"0.7407384",
"0.73686355",
"0.72594666",
"0.7240554",
"0.71624994",
"0.7161171",
"0.71494615",
"0.7129174",
"0.7072616",
"0.7046397",
"0.701601",
"0.70132554",
"0.70033693",
"0.69593215",
"0.69574416",
"0.69451946",
"0.69348985",
"0.693452",
"0.69088... | 0.0 | -1 |
Initialize weights to sane defaults | def reset_weights(self):
self.head.reset_weights() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _initialize_weights(self):\n pass",
"def init_weights(self):\n # Initialize weights\n self.apply(self._init_weights)\n # Tie weights if needed\n self.tie_weights()",
"def init_weights_(self):\n raise NotImplementedError",
"def init_weights(self):\n # Initi... | [
"0.9060275",
"0.86456734",
"0.86304384",
"0.86098653",
"0.8459984",
"0.84092957",
"0.8276553",
"0.8241387",
"0.82053345",
"0.8158099",
"0.81517327",
"0.81517327",
"0.81517327",
"0.8140385",
"0.8128992",
"0.8081866",
"0.8059583",
"0.8052031",
"0.79968077",
"0.7962007",
"0.7962... | 0.0 | -1 |
Free Tiles Empty space of board. | def __FreeTiles(self, grid, log=False):
x_pos, _ = np.where(grid == 0)
return len(x_pos) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset(self):\r\n # replace with your code\r\n for row in range(0, self._grid_height):\r\n for col in range(0, self._grid_width):\r\n self._grid_tile[row][col] = 0\r\n # at this step, all cells should be available\r\n self.new_tile()\r\n self.new_tile... | [
"0.70141566",
"0.7007707",
"0.6967974",
"0.6694449",
"0.66890055",
"0.66405",
"0.6615809",
"0.66137415",
"0.65786886",
"0.6578115",
"0.6564224",
"0.65593463",
"0.65543413",
"0.6550601",
"0.652474",
"0.6520409",
"0.64946926",
"0.64839774",
"0.6477979",
"0.6374725",
"0.63259786... | 0.5842253 | 43 |
The home of our site | def home(request):
content = "<h1> My personal Web </h1><h2>Portada</h2>"
return HttpResponse(content) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def home():\n\n\treturn render_template('index.html', title='Home Page',\n\t\t\t\t\t\t year=datetime.now().year)",
"def get_home(self):\n return self.home",
"def home():\r\n return render_template(\r\n 'index.html',\r\n title='Home Page',\r\n year=datetime.now().year,\r\n )"... | [
"0.8258869",
"0.8000692",
"0.7957051",
"0.7932584",
"0.7916991",
"0.79056096",
"0.7878751",
"0.7856999",
"0.7856999",
"0.7856999",
"0.7856999",
"0.7856999",
"0.7856999",
"0.7856999",
"0.7856999",
"0.7856999",
"0.7856999",
"0.7817544",
"0.7810082",
"0.77620625",
"0.77480936",
... | 0.0 | -1 |
Build the encoderdecoder network for training | def build_train_network(self):
# Inputs
vid_input = tf.placeholder(tf.float32, [None, self.num_frame, self.feat_size])
caption_input = tf.placeholder(tf.int32, [None, self.sent_len])
caption_mask = tf.placeholder(tf.float32, [None, self.sent_len])
batch_size = tf.shape(vid_input... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_model(encode_size):\n # Build the encoder\n encoder = Sequential()\n encoder.add(InputLayer((1000,4)))\n encoder.add(Conv1D(5, 11, activation=\"tanh\", padding=\"same\"))\n encoder.add(Conv1D(7, 7, activation=\"relu\", padding=\"same\"))\n encoder.add(MaxPooling1D(2))\n encoder.add(C... | [
"0.72931385",
"0.7178069",
"0.7132303",
"0.7099793",
"0.70898867",
"0.707583",
"0.7050285",
"0.7032533",
"0.701198",
"0.69798",
"0.6952787",
"0.69463664",
"0.69236386",
"0.6923493",
"0.6910246",
"0.69032055",
"0.6890553",
"0.6859875",
"0.68036914",
"0.67843723",
"0.6781403",
... | 0.6878906 | 17 |
Build the encoderdecoder network for testing | def build_test_network(self):
# Inputs
vid_input = tf.placeholder(tf.float32, [None, self.num_frame, self.feat_size])
batch_size = tf.shape(vid_input)[0]
# State variables
v_LSTM_states = (tf.zeros((batch_size, self.v_LSTM_cell.state_size[0])),
tf... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _construct_encoders_decoders(self):\n self.enc_inp = {}\n self.dec_out = {}\n if self.encode_hints:\n self.enc_hint = {}\n if self.decode_diffs:\n self.node_dec_diff = hk.Linear(1)\n self.edge_dec_diff = (hk.Linear(1), hk.Linear(1), hk.Linear(1))\n self.graph_dec_diff = (hk.Line... | [
"0.6932371",
"0.67314744",
"0.67038465",
"0.6655653",
"0.66322064",
"0.6615556",
"0.6596272",
"0.65647733",
"0.6501144",
"0.6430498",
"0.6412124",
"0.64105725",
"0.6402491",
"0.6400452",
"0.6343324",
"0.63051844",
"0.6284135",
"0.62818366",
"0.6222588",
"0.6193572",
"0.616890... | 0.60528827 | 29 |
Gets the msg of this InlineResponse20011. | def msg(self) -> str:
return self._msg | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_message(self, resp):\n return resp['message']",
"def msg(self):\n\t\treturn self.message",
"def get_message(self):\n return self.msg",
"def msg(self):\n return self._msg",
"def msg(self):\n if \"msg\" in self._json:\n return self._json[\"msg\"]\n elif \... | [
"0.7161553",
"0.7140831",
"0.712404",
"0.70614386",
"0.6943764",
"0.68082714",
"0.68082714",
"0.6716095",
"0.67123383",
"0.6702479",
"0.6677245",
"0.6656719",
"0.6656719",
"0.6595703",
"0.6554709",
"0.6554709",
"0.6554709",
"0.6554709",
"0.6554709",
"0.6554709",
"0.64959943",... | 0.6679877 | 10 |
Gets the use_time of this InlineResponse20011. | def use_time(self) -> int:
return self._use_time | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def used_time(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"used_time\")",
"def elapsed_time(self) -> 'outputs.DurationResponse':\n return pulumi.get(self, \"elapsed_time\")",
"def get_time(self):\n return self._total_time",
"def used_time(self) -> Optional[pulumi.In... | [
"0.6662584",
"0.63225305",
"0.6257486",
"0.6202751",
"0.6202751",
"0.6180353",
"0.6179408",
"0.6162775",
"0.6133969",
"0.61202204",
"0.6035207",
"0.5996303",
"0.5985699",
"0.59565675",
"0.59418225",
"0.59397465",
"0.5908312",
"0.5886813",
"0.58445615",
"0.5843626",
"0.5840421... | 0.6997372 | 0 |
Sets the use_time of this InlineResponse20011. | def use_time(self, use_time: int):
self._use_time = use_time | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def use_time(self) -> int:\n return self._use_time",
"def set_response_time(self, time):\n for task in self.tasks:\n task.response_time = time",
"def set_time(self, set_time):\n\n self._set_time = set_time",
"def set_imeastime(self, time):\n self.itime = time",
"def s... | [
"0.61085665",
"0.59688365",
"0.573547",
"0.5494479",
"0.54211134",
"0.5217842",
"0.5145579",
"0.50825775",
"0.50825775",
"0.50825775",
"0.50825775",
"0.50825775",
"0.5026665",
"0.49835518",
"0.4966888",
"0.49583775",
"0.49091044",
"0.49016345",
"0.4879092",
"0.4879092",
"0.48... | 0.7547113 | 0 |
Gets the data of this InlineResponse20011. | def data(self) -> List[InlineResponse2002]:
return self._data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def response_data(self):\n return self._response_data",
"def get_response_data(self):\r\n raise NotImplementedError",
"def get_data(self):\n return self._result",
"def get_data(self):\n return self.data",
"def get_data(self):\n return self.data",
"def get_data(self):\n ... | [
"0.72418374",
"0.71176124",
"0.65976685",
"0.65241665",
"0.65241665",
"0.65241665",
"0.6458842",
"0.64276934",
"0.64276934",
"0.64276934",
"0.64276934",
"0.64192",
"0.64192",
"0.63875514",
"0.63875514",
"0.63875514",
"0.63724923",
"0.63724923",
"0.63724923",
"0.63624746",
"0.... | 0.7286483 | 0 |
Returns the block denoted by the given block header. | def from_header(cls, header: BlockHeader, chaindb: BaseChainDB) -> BaseBlock:
if header.uncles_hash == EMPTY_UNCLE_HASH:
uncles = [] # type: List[BlockHeader]
else:
uncles = chaindb.get_block_uncles(header.uncles_hash)
transactions = chaindb.get_block_transactions(heade... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def block_header(self):\n return self._current_block[0]",
"def get_block_header_by_hash(db, block_hash):\n validate_word(block_hash)\n try:\n block = db.get(block_hash)\n except KeyError:\n raise BlockNotFound(\"No block with hash {0} found\".format(\n encode_hex(block_ha... | [
"0.76850635",
"0.7400024",
"0.7259494",
"0.7122126",
"0.70748013",
"0.70622474",
"0.7050188",
"0.6906027",
"0.68557245",
"0.675589",
"0.67319304",
"0.6723093",
"0.67115515",
"0.6695522",
"0.66080964",
"0.66052693",
"0.65731275",
"0.65230256",
"0.6518391",
"0.65109533",
"0.648... | 0.64895207 | 20 |
Make API calls to List active Cloud NetApp operations. | def ListOperations(self, location_ref, limit=None): # pylint: disable=redefined-builtin
request = self.messages.NetappProjectsLocationsOperationsListRequest(
name=location_ref)
return list_pager.YieldFromList(
self.client.projects_locations_operations,
request,
field='operations... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ListApps(self, request, context):\n context.set_code(grpc.StatusCode.UNIMPLEMENTED)\n context.set_details('Method not implemented!')\n raise NotImplementedError('Method not implemented!')",
"def ListApps(self, request, context):\n context.set_code(grpc.StatusCode.UNIMPLEMENTED)\n context.s... | [
"0.65697324",
"0.6388194",
"0.6216757",
"0.6115094",
"0.6106039",
"0.5942752",
"0.582552",
"0.5800522",
"0.58003235",
"0.56886685",
"0.5687797",
"0.5640457",
"0.5635119",
"0.559729",
"0.55863297",
"0.55861235",
"0.55861235",
"0.55861235",
"0.55861235",
"0.55861235",
"0.558612... | 0.0 | -1 |
Capacity is the static size of the array. fillValue is placed at each position. | def __init__(self, capacity, fillValue=None):
self._items = list()
for count in range(capacity):
self._items.append(fillValue) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, capacity, fillValue = None):\n \n self._items = list() \n self._fillValue = fillValue\n self._DEFAULT_CAPACITY = capacity\n self._logicalSize = 0 #as required by exercise 1\n \n \n for count in xrange(capacity):\n self._items.app... | [
"0.72282964",
"0.70699877",
"0.69121724",
"0.68195933",
"0.61590916",
"0.61244756",
"0.60732853",
"0.60367924",
"0.60198516",
"0.5992445",
"0.59423643",
"0.59087634",
"0.5897112",
"0.58933157",
"0.58625895",
"0.580344",
"0.5776647",
"0.5773054",
"0.5737078",
"0.57139087",
"0.... | 0.72747886 | 0 |
Capacity is the static size of the array. fillValue is placed at each position. | def __init__(self, capacity, fillValue=None):
self._items = list()
self._logicalSize = 0
# Track the capacity and fill value for adjustments later
self._capacity = capacity
self._fillValue = fillValue
for count in range(capacity):
self._items.append(fil... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, capacity, fillValue=None):\r\n self._items = list()\r\n for count in range(capacity):\r\n self._items.append(fillValue)",
"def __init__(self, capacity, fillValue = None):\n \n self._items = list() \n self._fillValue = fillValue\n self._DEFAU... | [
"0.72771317",
"0.72304636",
"0.6910199",
"0.68215513",
"0.61591923",
"0.6122708",
"0.6076183",
"0.603672",
"0.6018851",
"0.5990793",
"0.5941948",
"0.590826",
"0.5897927",
"0.5895004",
"0.58619547",
"0.5804683",
"0.57762814",
"0.5774063",
"0.57404035",
"0.57155216",
"0.5698121... | 0.707246 | 2 |
Inserts item at index in the array. | def insert(self, index, newItem):
if self.size() == len(self):
self.grow()
if index >= self.size():
self._items[self.size()] = newItem
else:
index = max(index, 0)
# Shift items down by one position
for i in range(self.size(), in... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def insert(self, index, item):\n if index > len(self):\n raise IndexError\n elif index == 0:\n self.insert_first(item)\n else:\n self._rest.insert(index-1, item)",
"def insert(self, index, item):\n # type: (int, Any) -> None\n return list.insert... | [
"0.8126947",
"0.78588563",
"0.7769877",
"0.7659422",
"0.7603448",
"0.7589757",
"0.75706494",
"0.7534493",
"0.7508939",
"0.74894726",
"0.7488519",
"0.7478554",
"0.7452272",
"0.7389264",
"0.73821723",
"0.7172124",
"0.71699095",
"0.71587825",
"0.7148316",
"0.70856076",
"0.686005... | 0.75391245 | 7 |
Removes and returns item at index in the array. | def pop(self, index):
if index < 0 or index >= self.size():
raise IndexError("Array index out of bounds")
itemToReturn = self._items[index]
# Shift items up by one position
for i in range(index, self.size() - 1):
self._items[i] = self._items[i + 1]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def array_pop(item):\n return item.pop()",
"def pop(self, idx=-1):\n if idx < 0: # For negative indexing, convert to positive counterpart\n idx = self._convert_negative_index(idx)\n if not 0 <= idx < self._length: # Ignore indices outside of bounds\n raise IndexError(f'inde... | [
"0.7440385",
"0.7415207",
"0.7335142",
"0.7281271",
"0.7245198",
"0.7232486",
"0.71996427",
"0.71117395",
"0.7104058",
"0.7068898",
"0.7067829",
"0.7034496",
"0.69625765",
"0.6959176",
"0.6929394",
"0.68686825",
"0.6863843",
"0.68286276",
"0.677374",
"0.6764979",
"0.6759195",... | 0.7227675 | 6 |
returns string as bold string (ANSI escape codes) >>> bstring('test') '\\x1b[1mtest\\x1b[0m' | def bstring(string):
return BTEXT + string + NTEXT | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def b(string):\n return \"\\033[94m{0}\\033[0m\".format(string)",
"def bold(string):\n return BOLD + string + RESETFORMAT",
"def bold(self, s):\n return '\\x02%s\\x02' % s",
"def bold(text):\n return '\\x1b[1;30m'+text+'\\x1b[0m' if text else '\\x1b[1;30m'+'\\x1b[0m'",
"def bold(string)... | [
"0.79048723",
"0.79003626",
"0.76547647",
"0.75108343",
"0.74617285",
"0.7136879",
"0.7099751",
"0.7039182",
"0.6957967",
"0.689799",
"0.6822125",
"0.67133474",
"0.6329511",
"0.6282693",
"0.625672",
"0.62340236",
"0.6209839",
"0.6203206",
"0.616524",
"0.616524",
"0.616089",
... | 0.7457185 | 5 |
Builds a frequency map based on the filtered list of words and uses this to produce a map of each sentence and its total score | def score_tokens(filterd_words, sentence_tokens):
word_freq = FreqDist(filterd_words)
ranking = defaultdict(int)
for i, sentence in enumerate(sentence_tokens):
for word in word_tokenize(sentence.lower()):
if word in word_freq:
ranking[i] += word_freq[word]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mapWordsFrequencies(self):\n token_stream = self._tokenize(self.readable)\n token_map = self._countTokens(token_stream)\n return token_map",
"def make_word_to_freq(self):\n\t\tword_to_freq = {}\n\t\tdocuments = self.tokenized_documents[\"train\"]\n\t\tfor document in documents:\n\t\t\tfo... | [
"0.74760115",
"0.70038915",
"0.6978138",
"0.6972351",
"0.69503844",
"0.68921274",
"0.68544656",
"0.675917",
"0.6758944",
"0.67451274",
"0.6741788",
"0.6727533",
"0.67252487",
"0.67251074",
"0.6684606",
"0.666807",
"0.6662819",
"0.6656167",
"0.66485894",
"0.6635151",
"0.663463... | 0.6783528 | 7 |
Returns the end date, which we use as the last coordinate on the xaxis of burn down charts. If we have milestone due date and that is in the past, use that. Otherwise use yesterdays date. We use yesterday not today as the history capture script only collects information at the end of each day. | def get_end_date(self, milestone):
if milestone.due and milestone.due.date() < date.today():
return milestone.due.date()
# else we take yesterday to be the end date point for the x-axis
return date.today() - timedelta(days=1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_date(self):\n return self.__end_date",
"def end_date(self) -> str:\n return pulumi.get(self, \"end_date\")",
"def end_date(self) -> str:\n return pulumi.get(self, \"end_date\")",
"def max_drawdown_date(self) -> dt.date:\n mdd_date = (self.tsdf / self.tsdf.expanding(min_per... | [
"0.65161633",
"0.6508709",
"0.6508709",
"0.6505612",
"0.64098233",
"0.64098233",
"0.64098233",
"0.6383691",
"0.625231",
"0.6222495",
"0.62106943",
"0.62106943",
"0.62079126",
"0.6138409",
"0.61244094",
"0.6040744",
"0.6030832",
"0.60183704",
"0.6015099",
"0.58924246",
"0.5857... | 0.8072955 | 0 |
Returns a list of tuples, each representing the total number of tickets closed on each day for a respective milestone. If no tickets are closed, a tuple for that date will still be alongside included a 0 value. If the metric specified is tickets, the number of tickets closed on that date will be used. If a ticket is re... | def team_effort_curve(self, db, metric, milestone_names, milestone_start, end, dates):
# Convert milestone start and end dates to timestamps based on metric
if metric == 'hours':
start_stamp = to_timestamp(datetime.combine(milestone_start,
time(hour=0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def count_tickets_closed(self, cursor, closed_statuses, metric):\n\n # Group changes by date\n closed_per_date = []\n for date, changes in groupby(cursor, itemgetter(1)):\n closed_ids = []\n effort = {}\n for change in changes:\n # Get all closed... | [
"0.7457668",
"0.55129176",
"0.5323304",
"0.52494264",
"0.52033174",
"0.50668293",
"0.4967866",
"0.48969114",
"0.48808485",
"0.48555282",
"0.48348525",
"0.48167068",
"0.47965357",
"0.4778532",
"0.47777975",
"0.4764208",
"0.47633538",
"0.47598237",
"0.47489762",
"0.46989983",
"... | 0.6013963 | 1 |
Here you can initialize layer parameters (if any) and auxiliary stuff. | def __init__(self):
# A dummy layer does nothing
self.weights = np.zeros(shape=(input.shape[1], 10))
bias = np.zeros(shape=(10,))
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _init_layers(self):\n self._init_predictor()\n if self.use_edge_fusion:\n self._init_edge_module()",
"def init_layer(layer):\n \n if layer.weight.ndimension() == 4:\n (n_out, n_in, height, width) = layer.weight.size()\n n = n_in * height * width\n \n elif ... | [
"0.77164716",
"0.7625751",
"0.7430348",
"0.72345394",
"0.71873885",
"0.71526915",
"0.7122902",
"0.7092722",
"0.70624",
"0.7043551",
"0.70294887",
"0.7027504",
"0.69964623",
"0.6966696",
"0.69462895",
"0.69171",
"0.6806229",
"0.6787281",
"0.67751384",
"0.67700154",
"0.6754543"... | 0.6827064 | 16 |
ReLU layer simply applies elementwise rectified linear unit to all inputs | def __init__(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def grad_ReLU(self):\n y = self.x\n y[y<=0] = 0\n y[y>0] = 1\n return y\n raise NotImplementedError(\"ReLU gradient not implemented\")",
"def test_relu_activation(self):\n self.assertEqual([0, 0.5], list(\n af.Relu().output(np.array([-0.5, 0.5]))))\n se... | [
"0.7054663",
"0.7046042",
"0.7000239",
"0.69755983",
"0.67649156",
"0.6718381",
"0.6670091",
"0.65911794",
"0.65745157",
"0.6546493",
"0.6541951",
"0.65171736",
"0.6513293",
"0.6480376",
"0.6466878",
"0.64472234",
"0.6436573",
"0.64180857",
"0.6395681",
"0.6395681",
"0.638660... | 0.0 | -1 |
Apply elementwise ReLU to [batch, input_units] matrix | def forward(self, input):
return np.maximum(0,input) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def relu(input, inplace=False):\n return FunctionLib.apply(\n 'Relu', input.device, [input],\n outputs=[input if inplace else None], alpha=0.)",
"def _bn_relu(input):\r\n norm = BatchNormalization(axis=3)(input)\r\n return Activation(\"relu\")(norm)",
"def _bn_relu(inputs):\n norm = B... | [
"0.7039092",
"0.6556115",
"0.6509612",
"0.6489779",
"0.64781094",
"0.6455551",
"0.6367763",
"0.6336121",
"0.6325776",
"0.63189197",
"0.6318198",
"0.6318198",
"0.630768",
"0.6283179",
"0.6278754",
"0.6278754",
"0.6260097",
"0.62559867",
"0.6237321",
"0.6201133",
"0.61804354",
... | 0.0 | -1 |
Compute crossentropy from logits[batch,n_classes] and ids of correct answers | def softmax_crossentropy_with_logits(logits,reference_answers):
logits_for_answers = logits[np.arange(len(logits)),reference_answers]
xentropy = - logits_for_answers + np.log(np.sum(np.exp(logits),axis=-1))
return xentropy | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cross_entropy(predictions, targets):\n likelihood = targets * np.log(predictions)\n return -np.sum(likelihood) / predictions.shape[0]",
"def cross_entropy(predicted, target):\n batch_size, num_classes = predicted.shape\n\n e_x = predicted.exp()\n log_e_x = e_x.log()\n a = log_sum_x_trick(pr... | [
"0.74395335",
"0.71907216",
"0.7079643",
"0.70556265",
"0.7035298",
"0.6938057",
"0.69174546",
"0.6905104",
"0.68938553",
"0.6855548",
"0.6810099",
"0.6810099",
"0.6793281",
"0.6758154",
"0.6732988",
"0.6701623",
"0.6692148",
"0.66712505",
"0.6655922",
"0.6647377",
"0.6644139... | 0.67335004 | 14 |
Yield successive nsized chunks from arr. | def chunks(arr, n):
for i in range(0, len(arr), n):
yield arr[i:i + n] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def chunks(arr, n):\n for i in range(0, len(arr), n):\n yield arr[i:i + n]",
"def iterate_array_in_chunks(arr, size: int):\n for i in range(0, len(arr), size):\n yield arr[i:i+size]",
"def chunks(array, size: int):\r\n for i in range(0, len(array), size):\r\n yield array[i:i + siz... | [
"0.8161039",
"0.7677286",
"0.745351",
"0.7183326",
"0.7093276",
"0.70845836",
"0.7019313",
"0.6975011",
"0.6964734",
"0.6955401",
"0.69519323",
"0.6951252",
"0.6947406",
"0.67946744",
"0.6771437",
"0.67693144",
"0.676101",
"0.6757156",
"0.6752805",
"0.67501146",
"0.67501146",... | 0.81750596 | 0 |
Check for all expected events | def events_verify(self, strict=False):
# As the event files are written by another process there is the
# small chance that it will not have comeplted when we run this
# check. To accomodate this we will have two passes at processing
# the events, after which we will consider it a failu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_gameHandleEvents(self):\n # this kinda gonna be reiterating the other tests??\n # the tests of all the individual methods below make this test work\n pass",
"def test_get_future_events(self):\n events = list(get_future_events())\n self.assertFalse(self.event_show1 in e... | [
"0.7175777",
"0.7173395",
"0.7111205",
"0.70590144",
"0.6995838",
"0.69023824",
"0.6785054",
"0.6785054",
"0.6782644",
"0.67633283",
"0.6728203",
"0.67257494",
"0.67062235",
"0.66566503",
"0.66494673",
"0.66440254",
"0.6617233",
"0.66010433",
"0.6580094",
"0.6578611",
"0.6545... | 0.70212454 | 4 |
max soil moisture retention... this is "S" in the model | def soil_retention(self):
return (1000 / self.runoff_curve_number) - 10 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_max_temp(self):\n self.max_temp = self.domain[1] * 2",
"def lambda_max(self):\n return const.b_wien / self.temperature",
"def max_time(self):\n return self.time[np.argmax(self.flux)]",
"def lmax(self):\n cond = (self.transmit / self.transmit.max()) > 1./100\n return... | [
"0.6350595",
"0.6325854",
"0.62378126",
"0.6214009",
"0.6201686",
"0.6143339",
"0.60928565",
"0.60859704",
"0.6084171",
"0.60312384",
"0.60232925",
"0.60231143",
"0.6015928",
"0.59785646",
"0.597221",
"0.5965331",
"0.5920437",
"0.59117895",
"0.59071505",
"0.590563",
"0.589875... | 0.6277847 | 2 |
Returns a tuple of the the raw untyped row data minus the header, as well as the headers. | def _extract_data(self):
with open(self.file_path, "rt", encoding=self._encoding) as csv_file:
raw_data = [row for row in csv.reader(csv_file)]
# If we have read in a .txt, .tsv or .uniq file then we delimit our rows
if self.file_path.suffix == ".txt":
raw_data = [row[0]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data(self) -> Tuple[List[str], List[List[str]]]:\n format = self.format\n # Check if the file contains header information. Initialize the header\n # with the optional names of columns in the format descriptor.\n has_header = format.get('header', True)\n columns = format.get('... | [
"0.67169183",
"0.6055255",
"0.5972126",
"0.5881481",
"0.5869139",
"0.5750356",
"0.5743324",
"0.5738689",
"0.57174766",
"0.56827676",
"0.56346977",
"0.5613887",
"0.5601216",
"0.5551004",
"0.55252683",
"0.55247873",
"0.54838836",
"0.54603344",
"0.5448041",
"0.5442326",
"0.54309... | 0.5124693 | 61 |
Initialize a `ClientFakeFail` instance. | def __init__(self, host="127.0.0.1", port=5037):
self._devices = [] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, client, use_stubs=True):\n super().__init__(client, use_stubs)",
"def __init__(self, client, use_stubs=True):\n super().__init__(client, use_stubs)",
"def __init__(self, client, use_stubs=True):\n super().__init__(client, use_stubs)",
"def __init__(self, client, use_st... | [
"0.6252042",
"0.6252042",
"0.6252042",
"0.6252042",
"0.6252042",
"0.6037996",
"0.598226",
"0.5914045",
"0.581158",
"0.5777614",
"0.57711583",
"0.5734638",
"0.5714898",
"0.5712648",
"0.5679568",
"0.5640237",
"0.5631758",
"0.5619043",
"0.55619675",
"0.555758",
"0.55273426",
"... | 0.0 | -1 |
Initialize a `DeviceFake` instance. | def __init__(self, host):
self.host = host | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setUpClass(cls):\n cls.device = DeviceFactory.create()",
"def __init__(self):\n mock_device = mock.Mock()\n mock_device.log = logging\n super().__init__(package='FakeClient', device=mock_device)",
"def __init__(self, fake_apple_tv):\n self.device = fake_apple_tv",
"def mock_constru... | [
"0.7010787",
"0.6802987",
"0.66851956",
"0.6211148",
"0.6154077",
"0.5992039",
"0.597975",
"0.5957031",
"0.5957031",
"0.5946327",
"0.5931647",
"0.5925377",
"0.59210163",
"0.59206986",
"0.59150237",
"0.58863",
"0.58466756",
"0.5835324",
"0.58238924",
"0.57930887",
"0.5784876",... | 0.0 | -1 |
Returns the MBus attribute 'type' for this MBus device | def get_type(self):
return self._type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_type(self, ):\n return self.attrs.get(self.AttributeNames.TYPE, None)",
"def type(self):\n return self._device.type_name",
"def type(self) -> str:\n return self._device_info[\"Type\"]",
"def Type(self):\r\n\t\treturn self._get_attribute('type')",
"def read_type(self):\n ... | [
"0.75174344",
"0.74836326",
"0.7350691",
"0.7331942",
"0.7045333",
"0.70222306",
"0.6915501",
"0.6828836",
"0.6828455",
"0.68148565",
"0.6785852",
"0.6735859",
"0.6735859",
"0.67349595",
"0.6734392",
"0.67102176",
"0.66709787",
"0.667096",
"0.6652121",
"0.6652121",
"0.6649284... | 0.6487566 | 82 |
Returns the manufacturer id for this MBus device, as a byte array | def get_manufacturer_bytes(self):
manufacturer = self._manufacturer.upper()
id = ((ord(manufacturer[0]) - 64) * 32 * 32 +
(ord(manufacturer[1]) - 64) * 32 +
(ord(manufacturer[2]) - 64))
if 0x0421 <= id <= 0x6b5a:
return self.manufacturer_encode(id, 2)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_manufacturer_id(self):\n return self._manufacturer",
"def manufacturer(self):\n return self._device.manufacturer",
"def manufacturer(self) -> int:\n return self.__manufacturer",
"def _manufacturer(self, mac_address):\n # Initialize key variables\n manufacturer = ''\... | [
"0.7338784",
"0.6838443",
"0.6773163",
"0.66519916",
"0.65635777",
"0.6525255",
"0.6466681",
"0.6337552",
"0.63287675",
"0.6199706",
"0.61118454",
"0.605574",
"0.60197824",
"0.60059637",
"0.60024834",
"0.58902586",
"0.5875714",
"0.58419347",
"0.5840034",
"0.5832063",
"0.58302... | 0.7605092 | 0 |
Von Mises probability density on the circle. | def von_mises(kappa: float, loc: float = 0) -> Callable[[X], X]:
def f(x: X) -> X:
y: X = 2 * np.pi * vonmises.pdf(x, kappa, loc=loc)
return y
return f | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def density(self):\r\n return self.count_ones() / float(self.xspan * self.yspan)",
"def probability_density(self, X):\n raise NotImplementedError",
"def test_probability_density(self):\n # Setup\n copula = GaussianMultivariate(GaussianUnivariate)\n copula.fit(self.data)\n ... | [
"0.6036236",
"0.60259455",
"0.60022193",
"0.5980571",
"0.5979559",
"0.5939682",
"0.59280634",
"0.5819851",
"0.57478416",
"0.57478416",
"0.5747516",
"0.57071406",
"0.56892794",
"0.56892794",
"0.56892794",
"0.5683779",
"0.56555283",
"0.56520396",
"0.56454194",
"0.5644091",
"0.5... | 0.0 | -1 |
Returns a function that computes the expansion coefficients of the square root of the Mises density function with respect to the Fourier basis on S1. | def sqrt_von_mises_fourier(kappa: float, loc: float = 0) -> Callable[[K], V]:
def f_hat(k: K) -> V:
y: V = iv(np.abs(k), kappa / 2) * np.exp(-1j * k * loc) / iv(0, kappa)
return y
return f_hat | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SIDFT(X,D):\n N=len(X)\n x=np.zeros(N,'complex')\n for n in range(0,N,1):\n for k in range(0,N,1):\n x[n]=x[n]+np.exp(-1j*2*np.pi*k*D/N)*X[k]*np.exp(1j*2*np.pi*k*n/N)\n return x/N",
"def secant1d(f, df, x0, x1, niter=10):\n for i in xrange(niter):\n x_new = x1 - df(x1)... | [
"0.6120573",
"0.5911645",
"0.5856037",
"0.5760028",
"0.5745698",
"0.5669311",
"0.564391",
"0.56416434",
"0.5555382",
"0.5526548",
"0.55242056",
"0.5509615",
"0.5495894",
"0.5492108",
"0.5470965",
"0.54448664",
"0.5442898",
"0.54317313",
"0.5419261",
"0.54188395",
"0.54187214"... | 0.0 | -1 |
Get training/test data after pipeline. | def __getitem__(self, idx):
if self.test_mode:
return self.prepare_test_img(idx)
while True:
data_ori, data_aug = self.prepare_train_img(idx)
if data_ori is None:
idx = self._rand_another(idx)
continue
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getTrainingData(self):\n raise NotImplementedError",
"def preproc_pipeline(data):\n # Preprocess\n data = preprocess(data)\n\n # Optional --> run a technical analysis on it and add more features\n data = generate_ta(data)\n \n # Split\n train_set, validation_set, test_set = train_... | [
"0.7361403",
"0.7221455",
"0.7014683",
"0.70048267",
"0.6994335",
"0.6973737",
"0.69049835",
"0.6826551",
"0.6772276",
"0.6733187",
"0.65659606",
"0.656477",
"0.65432006",
"0.6525267",
"0.65128535",
"0.64997685",
"0.64943963",
"0.64483935",
"0.64468014",
"0.6446229",
"0.64359... | 0.0 | -1 |
Given a Keras model consisting only of MoleculeConv, Dense, and Dropout layers, this function will reset the trainable weights to save time for CV tests. | def reset_model(model):
for layer in model.layers:
# Note: these are custom depending on the layer type
if '.MoleculeConv' in str(layer):
W_inner = layer.init_inner((layer.inner_dim, layer.inner_dim))
b_inner = np.zeros((1, layer.inner_dim))
# Inner weights
layer.W_inner.set_value((T.tile(W_inner, (la... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def freeze_keras_model(model):\n model.trainable = True\n for layer in model.layers[::-1]:\n if \"input_calibration\" not in layer.name:\n layer.trainable = False # freeze this layer",
"def reset_all_weights(model: nn.Module) -> None:\n\n @torch.no_grad()\n def weight_reset(m: nn.Module):\n ... | [
"0.70406073",
"0.6894124",
"0.6889429",
"0.65983087",
"0.65983087",
"0.65983087",
"0.6568559",
"0.64146864",
"0.6407755",
"0.6392919",
"0.6332836",
"0.6332707",
"0.63063484",
"0.6305492",
"0.6297988",
"0.62704873",
"0.6255521",
"0.62467504",
"0.62050724",
"0.62013793",
"0.617... | 0.8273535 | 0 |
Disables gradients of all parameters, except for layers that have quantizers for weights, which wasn't skipped because of single precision constraints. | def disable_all_gradients_except_weights_of_quantized_modules(
quantizers_switcher: QuantizersSwitcher,
weight_quantizers: Dict[WeightQuantizerId, WeightQuantizerInfo],
model: nn.Module,
skipped_quantized_weight_node_names: List[NNCFNodeName] = None,
) -> ParamsToRestore:
ori... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nontrainable_weights(self):\n return list(filter(lambda x: not x.requires_grad, self.get_parameters(expand=True)))",
"def freeze_layers(model: torch.nn.Module) -> None:\n for param in model.parameters():\n param.requires_grad = False",
"def restore_disabled_gradients(\n quantizers_s... | [
"0.70727277",
"0.6815069",
"0.6747365",
"0.6706207",
"0.6681788",
"0.6658052",
"0.6578048",
"0.6563424",
"0.6511154",
"0.6509334",
"0.6507968",
"0.64879656",
"0.6455429",
"0.645413",
"0.64453083",
"0.6290843",
"0.6278157",
"0.62290114",
"0.6201735",
"0.6170639",
"0.6126384",
... | 0.67481613 | 2 |
Restore requires_grad property of all parameters back, except for ones that were originally disabled | def restore_disabled_gradients(
quantizers_switcher: QuantizersSwitcher,
model: nn.Module,
weight_quantizers: Dict[WeightQuantizerId, WeightQuantizerInfo],
params_to_restore: ParamsToRestore,
):
for wq_info in weight_quantizers.values():
quantized_module = wq_info... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def freeze_params(m):\r\n for p in m.parameters():\r\n p.requires_grad = False",
"def __freeze(self):\r\n features_layer = self._model._net\r\n for param in features_layer.parameters():\r\n param.requires_grad = False",
"def freeze_params(m):\n for p in m.parameters():\n ... | [
"0.7569328",
"0.75477123",
"0.7530192",
"0.7361709",
"0.7350747",
"0.7307191",
"0.72755283",
"0.7265549",
"0.72604907",
"0.72516173",
"0.72394335",
"0.7224563",
"0.7218055",
"0.7097633",
"0.70672184",
"0.70672184",
"0.6943287",
"0.685706",
"0.6804418",
"0.6779371",
"0.6775397... | 0.7301243 | 6 |
Return complete state of sampler (including momentum) Description get_state() returns a state structure that contains the state of the internal random number generators and the momentum of the dynamic process. These are contained in fields randstate mom respectively. The momentum state is only used for a persistent mom... | def get_state():
global HMC_MOM
return dict(randstate = np.random.get_state(),
mom = HMC_MOM) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_random_state(self):\n self._validate_random_state()\n return deepcopy(self.random_state)",
"def get_state(self):\n return self.env.sim.get_state()",
"def getstate(self):\n return (self.baseseed, self.counter, self.randbits_remaining)",
"def get_state(self) -> numpy.ndarra... | [
"0.6997754",
"0.69239503",
"0.68921965",
"0.6749851",
"0.660002",
"0.6524344",
"0.6523978",
"0.64938563",
"0.648161",
"0.6472979",
"0.6471748",
"0.6439763",
"0.64197123",
"0.64197123",
"0.64197123",
"0.64197123",
"0.64197123",
"0.6384832",
"0.63607174",
"0.6352261",
"0.635089... | 0.732025 | 0 |
Take the ``dataanchor`` value from the ``dataanchor`` HTML attribute. | def get_attribute_data(self, attrs):
return {
'id': attrs['data-id'],
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extract_href_from_anchor(anchor):\n return find_text_between('href=\"','\">',anchor)",
"def getAnchor(self):\n return self.anchor",
"def parse_anchor(anchor):\n \n href = anchor.get(\"href\")\n content = anchor.text\n \n if href == None:\n href = ''\n \n if content... | [
"0.6609954",
"0.6560538",
"0.65237737",
"0.6248963",
"0.60850394",
"0.60096025",
"0.59592694",
"0.5851325",
"0.5833357",
"0.5601775",
"0.55980927",
"0.55468327",
"0.54873204",
"0.5477901",
"0.54401004",
"0.54085124",
"0.5281791",
"0.5266734",
"0.5264309",
"0.5250917",
"0.5211... | 0.48351422 | 37 |
Sets the id of this RenderTask. | def id(self, id):
self._id = id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_id(self, id_):\n\n self.id_ = id_",
"def set_id(self, id):\n self.__id = id",
"def SetId(self, id):\n self.id = int(id)",
"def set_id(self, id):\n self.data['id'] = id",
"def set_id(self, id_=None):\n if id_ is None:\n self.id = id(self)\n else:\... | [
"0.7398106",
"0.71877426",
"0.7111604",
"0.7094159",
"0.7039615",
"0.6763592",
"0.6763592",
"0.6763592",
"0.6763592",
"0.6763592",
"0.67622936",
"0.67622936",
"0.67622936",
"0.67622936",
"0.67622936",
"0.67622936",
"0.67622936",
"0.67622936",
"0.67622936",
"0.67622936",
"0.67... | 0.6668445 | 94 |
Sets the created_at of this RenderTask. | def created_at(self, created_at):
self._created_at = created_at | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def created_at(self, created_at):\n self._created_at = created_at",
"def created_at(self, created_at: \"datetime\"):\n self._attrs[\"createdAt\"] = created_at",
"def created_at(self, created_at: \"datetime\"):\n self._attrs[\"createdAt\"] = created_at",
"def created_at(self, created_at: ... | [
"0.74067676",
"0.72879493",
"0.72879493",
"0.72879493",
"0.719167",
"0.6793312",
"0.6793312",
"0.67586875",
"0.6646626",
"0.64368236",
"0.6296236",
"0.6172659",
"0.6104278",
"0.6035693",
"0.6020998",
"0.6020998",
"0.6020998",
"0.6020998",
"0.59989226",
"0.5998903",
"0.5969384... | 0.73806834 | 12 |
Sets the status of this RenderTask. | def status(self, status):
self._status = status | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setstatus(self, status):\n with self.lock:\n self.status = status",
"def set_status(self, status):\n self.status = status",
"def set_status(self, status):\n self.status = status",
"def set_status(self, status):\n self.status = status",
"def setStatus(self, status)... | [
"0.72541046",
"0.7210197",
"0.7210197",
"0.7210197",
"0.7070833",
"0.7024444",
"0.700167",
"0.69884104",
"0.69884104",
"0.69884104",
"0.69884104",
"0.69884104",
"0.69884104",
"0.69884104",
"0.68713146",
"0.68713146",
"0.6754749",
"0.6729779",
"0.6677006",
"0.64163893",
"0.640... | 0.6984805 | 29 |
Sets the status_detail of this RenderTask. | def status_detail(self, status_detail):
self._status_detail = status_detail | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def status_detail(self, status_detail):\n self._status_detail = status_detail",
"def detailed_status(self, detailed_status):\n\n self._detailed_status = detailed_status",
"def status(self, status):\n self._set_property_(self.STATUS, str(status))",
"def setStatus(self, status, details=Non... | [
"0.81375176",
"0.71437395",
"0.6554851",
"0.6469264",
"0.6366077",
"0.6366077",
"0.6366077",
"0.6312604",
"0.6312604",
"0.6267898",
"0.6267898",
"0.6267898",
"0.6267898",
"0.6267898",
"0.6267898",
"0.6267898",
"0.6247773",
"0.6247773",
"0.6247773",
"0.6247773",
"0.6247773",
... | 0.8140659 | 0 |
Sets the user_id of this RenderTask. | def user_id(self, user_id):
self._user_id = user_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def id_user(self, id_user):\n\n self._id_user = id_user",
"def user(self, user):\n self.user_id = user.get_id()",
"def userid(self, userid):\n\n self._userid = userid",
"def user_id(self, user_id):\n if user_id is None:\n raise ValueError(\"Invalid value for `user_id`, ... | [
"0.7542707",
"0.70267975",
"0.6683866",
"0.6680467",
"0.6680467",
"0.66423935",
"0.6599446",
"0.6563885",
"0.6515778",
"0.6419163",
"0.6417644",
"0.6319215",
"0.6271497",
"0.6271497",
"0.62375575",
"0.6184913",
"0.60719544",
"0.60719544",
"0.60719544",
"0.60719544",
"0.607195... | 0.740865 | 7 |
Sets the look_id of this RenderTask. | def look_id(self, look_id):
self._look_id = look_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_run(self, run_id: str):\n self.run_id = run_id",
"def set_reference_id(self, reference_id):\n self.reference_id = reference_id",
"def effect_id(self, effect_id):\n\n self._effect_id = effect_id",
"def setReferenceId(self, *args):\n return _libsbml.ReferenceGlyph_setReferen... | [
"0.5417075",
"0.5271606",
"0.524833",
"0.519497",
"0.5194393",
"0.51493704",
"0.51265246",
"0.50955206",
"0.50868255",
"0.49611458",
"0.4933036",
"0.49278972",
"0.4826455",
"0.48090032",
"0.48032862",
"0.47970185",
"0.47796115",
"0.47740558",
"0.4765303",
"0.47613588",
"0.475... | 0.79382825 | 0 |
Sets the lookml_dashboard_id of this RenderTask. | def lookml_dashboard_id(self, lookml_dashboard_id):
self._lookml_dashboard_id = lookml_dashboard_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dashboard_id(self, dashboard_id):\n\n self._dashboard_id = dashboard_id",
"def dashboard_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"dashboard_id\")",
"def branding_theme_id(self, branding_theme_id):\n\n self._branding_theme_id = branding_theme_id",
"def dashboard_sty... | [
"0.67260104",
"0.5364575",
"0.50980437",
"0.5078889",
"0.48319694",
"0.47883755",
"0.46596688",
"0.46056992",
"0.4568115",
"0.45334616",
"0.45137596",
"0.45120463",
"0.44907528",
"0.44863474",
"0.4483161",
"0.44575748",
"0.44575748",
"0.44575748",
"0.44575748",
"0.44237512",
... | 0.8620824 | 0 |
Sets the query_id of this RenderTask. | def query_id(self, query_id):
self._query_id = query_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_query(self, query):\n return self.set_param(\"query\", query)",
"def setQuery(self, query):\n libxml2mod.xmlURISetQuery(self._o, query)",
"def task_id(self, task_id):\n self._task_id = task_id",
"def task_id(self, task_id):\n\n self._task_id = task_id",
"def query(self, ... | [
"0.64248264",
"0.62554693",
"0.6194381",
"0.61755437",
"0.59815997",
"0.5968557",
"0.5968557",
"0.5968557",
"0.588548",
"0.588548",
"0.588548",
"0.57613105",
"0.5756927",
"0.5651159",
"0.5576934",
"0.5492144",
"0.528383",
"0.5280732",
"0.526251",
"0.5236137",
"0.522847",
"0... | 0.79932064 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, RenderTask):
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.808826",
"0.808826",
"0.8054592",
"0.79827315",
"0.79666996",
"0.79666996",
"0.79666996",
"0.79666996",
"0.79666996",
"0.79666996",
"0.79666996",
"0.79666996",
"0.79666996",
"0.79666996",
"0.79666996",
"0.79666996",
"0.79666996",
"0.79666996",
"0.79666996",
"0.79666996",
"... | 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 |
Generated 1 or more random normally distributed integer(s) with standard deviation equal to the square root of the mean value. | def rand(self, mean, count=1, min=0, max=numpy.inf):
a = (min-mean)/numpy.sqrt(mean)
b = (max - mean)/numpy.sqrt(mean)
return numpy.int64(numpy.round(stats.truncnorm.rvs(a, b, loc=mean, scale=numpy.sqrt(mean), size=count))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normal(mean, std):\n\n return random.gauss(mean, std)",
"def get_random_vector(self, mean, standard_deviaton):\n result = []\n for i in xrange(len(mean)):\n result.append(np.random.normal(mean[i], standard_deviaton[i]))\n return result",
"def get_standard_normal_d... | [
"0.77668214",
"0.7369951",
"0.7308405",
"0.6918158",
"0.68810624",
"0.6845413",
"0.6757505",
"0.6735592",
"0.67001826",
"0.6684146",
"0.66409117",
"0.66382176",
"0.6618452",
"0.6567505",
"0.65414387",
"0.65024096",
"0.6460474",
"0.64463437",
"0.64457",
"0.644136",
"0.64266586... | 0.7195643 | 3 |
Compute the softmax vector. | def softmax(x):
e_x = np.exp(x - np.max(x))
x = e_x / e_x.sum()
# Your code should be fast, so use a vectorized implementation using numpy,
# don't use any loops.
# With a vectorized implementation, the code should be no more than 2 lines.
#
# For numeric stability, use the identify you prov... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _softmax(self, x):\n return np.exp(x - np.max(x)) / np.sum(np.exp(x - np.max(x)))",
"def softmax(self, x):\n\n out = np.zeros(x.shape)\n for i in range(x.shape[0]):\n max_x = x[i] - np.max(x[i])\n out[i] = np.exp(max_x) / np.sum(np.exp(max_x), axis=0)\n\n ret... | [
"0.8342845",
"0.83397806",
"0.8240936",
"0.82315224",
"0.82096064",
"0.8205365",
"0.8204853",
"0.8194208",
"0.81808263",
"0.81797445",
"0.8171967",
"0.8153289",
"0.814728",
"0.8128381",
"0.81269455",
"0.8124722",
"0.81239814",
"0.81237",
"0.8110859",
"0.8106434",
"0.8104907",... | 0.7856075 | 91 |
Checks that the user is logged in. If no user is logged in, redirects to the login page and returns False. Otherwise returns True. | def require_login(self):
if users.get_current_user():
return True
else:
self.redirect(users.create_login_url(self.request.uri))
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_user_logged():\n global user\n if 'user' not in session:\n return False\n else:\n user = session.get('user')\n return user['username'] != ''",
"def logged_in():\n\n if current_user.is_authenticated:\n return True\n\n return False",
"def isLoggedIn(self):\n ... | [
"0.7975956",
"0.7870969",
"0.7678898",
"0.76661164",
"0.7663604",
"0.7601316",
"0.7499161",
"0.7486565",
"0.7308655",
"0.72972685",
"0.72252",
"0.71928376",
"0.7173832",
"0.71355855",
"0.7058426",
"0.70539814",
"0.70472884",
"0.7041792",
"0.7030704",
"0.7019598",
"0.69933254"... | 0.8251558 | 0 |
To update product in object stock.production.lot | def update_product_in_serial_number(self, cr, uid, ids, move_ids, context=None):
if context is None:
context = {}
prodlot_obj = self.pool.get('stock.production.lot')
move_sn_obj = self.pool.get('stock.move.serial.number')
picking_obj = self.pool.get('stock.pickin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def product(self, product):\n self._product = product",
"def product(self, product):\n\n self._product = product",
"def product(self, product):\n\n self._product = product",
"def create_and_assign_lot(self, cr, uid, id, name, context=None):\n obj = self.browse(cr, uid, id, context... | [
"0.6748543",
"0.66205347",
"0.66205347",
"0.6609308",
"0.6572712",
"0.65606326",
"0.6496991",
"0.6444361",
"0.64092016",
"0.6325109",
"0.63229114",
"0.6286188",
"0.6274592",
"0.6269803",
"0.6261174",
"0.62312347",
"0.6203786",
"0.6199837",
"0.6180729",
"0.61687356",
"0.616604... | 0.62296116 | 16 |
This method handles the GET requests to retrieve status on agents from the Cloud Verifier. Currently, only agents resources are available for GETing, i.e. /agents. All other GET uri's will return errors. Agents requests require a single agent_id parameter which identifies the agent to be returned. If the agent_id is no... | def get(self):
rest_params = common.get_restful_params(self.request.uri)
if rest_params is None:
common.echo_json_response(self, 405, "Not Implemented: Use /agents/ interface")
return
if "agents" not in rest_params:
common.echo_json_response(self, 400, "uri n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_GET(self):\n rest_params = common.get_restful_params(self.path)\n if rest_params is None:\n common.echo_json_response(self, 405, \"Not Implemented: Use /agents/ interface\")\n return\n\n if \"agents\" not in rest_params:\n common.echo_json_response(self,... | [
"0.80919266",
"0.62661386",
"0.6194052",
"0.61815715",
"0.6015156",
"0.5917533",
"0.58534217",
"0.5772549",
"0.56880033",
"0.5682874",
"0.5636912",
"0.54906607",
"0.5478674",
"0.54733264",
"0.54589367",
"0.54482514",
"0.53500134",
"0.5331451",
"0.5318413",
"0.5306659",
"0.530... | 0.8206516 | 0 |
This method handles the DELETE requests to remove agents from the Cloud Verifier. Currently, only agents resources are available for DELETEing, i.e. /agents. All other DELETE uri's will return errors. agents requests require a single agent_id parameter which identifies the agent to be deleted. | def delete(self):
rest_params = common.get_restful_params(self.request.uri)
if rest_params is None:
common.echo_json_response(self, 405, "Not Implemented: Use /agents/ interface")
return
if "agents" not in rest_params:
common.echo_json_response(self, 400, "ur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_DELETE(self):\n rest_params = common.get_restful_params(self.path)\n if rest_params is None:\n common.echo_json_response(self, 405, \"Not Implemented: Use /agents/ interface\")\n return\n\n if \"agents\" not in rest_params:\n common.echo_json_response(se... | [
"0.84020686",
"0.7218375",
"0.7071936",
"0.7004943",
"0.6879053",
"0.67389286",
"0.6324377",
"0.6131049",
"0.58225787",
"0.5647758",
"0.561944",
"0.5559764",
"0.5547159",
"0.54837656",
"0.5467285",
"0.54633754",
"0.54172516",
"0.5407017",
"0.5407017",
"0.5407017",
"0.5407017"... | 0.8545706 | 0 |
Checks if a jdeps class is a class we are actually interested in. | def class_is_interesting(name: str):
if name.startswith('org.chromium.'):
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def class_is(cls: Class) -> bool:\n pass",
"def predicate(cls: nodes.ClassDef) -> bool:\n if cls.name in CLASS_NAME_SKIPLIST:\n # class looks like an API model class, but it isn't.\n return False\n\n if not cls.name.endswith(\"API\") and \"schema\" not in cls.locals:\n # class d... | [
"0.72541815",
"0.69194466",
"0.67301434",
"0.66285837",
"0.65549153",
"0.65342814",
"0.65318424",
"0.64735323",
"0.6453129",
"0.64485204",
"0.64479756",
"0.6443003",
"0.6360487",
"0.6332833",
"0.6331383",
"0.63136107",
"0.6309799",
"0.63025486",
"0.62933034",
"0.62933034",
"0... | 0.65633553 | 4 |
Insert node to the left. | def insertLeft(self, node):
if self.left is None:
self.left = BinaryTree(node)
else:
t = BinaryTree(node)
t.left = self.left
self.left = t | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def insert_left(self, data: DataType) -> Node[DataType]:\n self.left_node = Node(data)\n self.left_node.right_node = self # connect the new node to this node\n return self.left_node",
"def insert_left(self, new_node):\n\n\t\tif self.left_child == None:\n\t\t\tself.left_child = BinaryTree(ne... | [
"0.83478034",
"0.805765",
"0.774586",
"0.7724896",
"0.770619",
"0.76948017",
"0.7650231",
"0.76456183",
"0.7602184",
"0.7588134",
"0.7581842",
"0.7519152",
"0.7473822",
"0.7473822",
"0.7429832",
"0.7427488",
"0.73660934",
"0.7345945",
"0.73282385",
"0.729671",
"0.72548556",
... | 0.8281054 | 1 |
Return value of left node. | def getLeft(self):
return self.left | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_left(self):\n return BinaryNode.or_none(self.left)",
"def get_left(self):\n return self.left",
"def get_left(self):\n return self.__left",
"def _left(node):\n return 2 * node + 1",
"def left(self):\n\t\treturn self._left",
"def left(self):\n return self._left",
"d... | [
"0.8286152",
"0.8106854",
"0.8065357",
"0.79744494",
"0.7966007",
"0.7913805",
"0.7913805",
"0.78358823",
"0.77298117",
"0.7605143",
"0.7592283",
"0.7559236",
"0.7539462",
"0.7489911",
"0.74820614",
"0.74358976",
"0.7406964",
"0.74010617",
"0.73951155",
"0.73813003",
"0.73776... | 0.80631876 | 3 |
Return value of right node. | def getRight(self):
return self.right | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_right(self):\n return BinaryNode.or_none(self.right)",
"def get_right(self):\n return self.right",
"def right(self) -> Optional[\"ExpressionNode\"]:\n return self.__right",
"def _right(node):\n return 2 * node + 2",
"def right(self):\n\t\treturn self._right",
"def get_righ... | [
"0.78944016",
"0.7860014",
"0.78598166",
"0.78554815",
"0.78369445",
"0.7777474",
"0.77564377",
"0.77564377",
"0.7604055",
"0.7595203",
"0.7525426",
"0.7399567",
"0.7307138",
"0.73055536",
"0.7294418",
"0.7292124",
"0.720686",
"0.71769196",
"0.70506096",
"0.7044987",
"0.69917... | 0.7716336 | 8 |
Gets the ``Book`` ``Id`` associated with this session. | def get_book_id(self):
# Implemented from template for osid.resource.ResourceLookupSession.get_bin_id
return self._catalog_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getId(self):\n return self.session.request('id/')",
"def get_id(self):\n return self._id",
"def get_id(self):\n return self._id",
"def get_id(self):\n return self._id",
"def get_id(self):\n return self._id",
"def get_id(self):\n return self._id",
"def get_i... | [
"0.6768813",
"0.6590069",
"0.6590069",
"0.6590069",
"0.6590069",
"0.6590069",
"0.6590069",
"0.64731216",
"0.64559823",
"0.64559823",
"0.64559823",
"0.64559823",
"0.64559823",
"0.64559823",
"0.64559823",
"0.64559823",
"0.64559823",
"0.64559823",
"0.64559823",
"0.64559823",
"0.... | 0.7994723 | 0 |
Gets the ``Comment`` specified by its ``Id``. | def get_comment(self, comment_id):
# Implemented from template for
# osid.resource.ResourceLookupSession.get_resource
# NOTE: This implementation currently ignores plenary view
collection = JSONClientValidated('commenting',
collection='Comment',
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(self, id):\n return get_comments(id)",
"def get_comment(self, id):\n url = \"https://api.imgur.com/3/comment/{0}\".format(id)\n json = self._send_request(url)\n return Comment(json, self)",
"def load_comment_by_id(self, id):\n comment = None\n comments = self.s... | [
"0.83484715",
"0.8136662",
"0.8068684",
"0.79116356",
"0.7902702",
"0.77302015",
"0.7716017",
"0.75899965",
"0.75780797",
"0.7328856",
"0.7309521",
"0.7245313",
"0.7245313",
"0.7192265",
"0.6979326",
"0.6899254",
"0.68909675",
"0.68231887",
"0.6676542",
"0.6676542",
"0.663338... | 0.8108485 | 2 |
Gets a ``CommentList`` corresponding to the given comment genus ``Type`` which does not include comments of genus types derived from the specified ``Type``. | def get_comments_by_genus_type(self, comment_genus_type):
# Implemented from template for
# osid.resource.ResourceLookupSession.get_resources_by_genus_type
# NOTE: This implementation currently ignores plenary view
collection = JSONClientValidated('commenting',
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_comments_by_parent_genus_type(self, comment_genus_type):\n # Implemented from template for\n # osid.resource.ResourceLookupSession.get_resources_by_parent_genus_type\n # STILL NEED TO IMPLEMENT!!!\n return objects.CommentList([])",
"def get_comments_by_record_type(self, commen... | [
"0.72845256",
"0.6812124",
"0.6446246",
"0.6372511",
"0.6253699",
"0.6168747",
"0.59064376",
"0.58352524",
"0.58034456",
"0.57616603",
"0.5747927",
"0.54431874",
"0.5357577",
"0.52255374",
"0.5130758",
"0.5081215",
"0.49531665",
"0.49333733",
"0.492237",
"0.49159527",
"0.4821... | 0.7181077 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.