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 |
|---|---|---|---|---|---|---|
Extract Pytorch tensors from nifti images. | def cli() -> None:
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _extract(self, images):\n if (images.ndim != 4 or images.shape[0] <= 0 or\n images.shape[0] > self.batch_size or images.shape[1] not in [1, 3]):\n raise ValueError(f'Input images should be with shape [batch_size, '\n f'channel, height, width], where '\n ... | [
"0.6757566",
"0.64020675",
"0.6265425",
"0.6083146",
"0.60794044",
"0.60552996",
"0.6045613",
"0.6037987",
"0.5963121",
"0.5944206",
"0.58701",
"0.5844615",
"0.57813996",
"0.5765604",
"0.57654303",
"0.5755759",
"0.5753248",
"0.5702996",
"0.569438",
"0.56833714",
"0.5641909",
... | 0.0 | -1 |
forms a homogeneous transformation matrix T from a displacement and rotation matrix | def Tform(xyz, R):
xyz = sp.Matrix([xyz[0], xyz[1], xyz[2]]
) # enforce orientation and type
T = sp.Matrix(R).row_join(xyz).col_join(sp.Matrix([[0, 0, 0, 1]]))
return T | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transformation_matrix(self):\n t = np.array([[0.0], [0.0], [0.0]])\n Rt = np.hstack([self.rotation_matrix, t])\n return np.vstack([Rt, np.array([0.0, 0.0, 0.0, 1.0])])",
"def rotation_to_transformation_matrix(R):\n R = Matrix(R)\n T = R.col_insert(3, Matrix([0., 0., 0.]))\n T = ... | [
"0.7319099",
"0.71811473",
"0.70296973",
"0.6958759",
"0.6917301",
"0.6900195",
"0.6900195",
"0.68931794",
"0.6870407",
"0.68359077",
"0.68193424",
"0.67923737",
"0.67744255",
"0.6760395",
"0.6760395",
"0.6748414",
"0.6739706",
"0.6674545",
"0.66485125",
"0.6583638",
"0.65280... | 0.6449778 | 27 |
Seperates a homogeneous transformation matrix T into its rotation matrix R and translational xyz components | def T2Rxyz(T):
R = T[:3, :3]
xyz = T[:3, 3]
return R, xyz | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transform_from_rot_trans(R, t):\n R = R.reshape(3, 3)\n t = t.reshape(3, 1)\n return np.hstack([R, t])",
"def transform_from_rot_trans(R, t):\n R = R.reshape(3, 3)\n t = t.reshape(3, 1)\n return np.vstack((np.hstack([R, t]), [0, 0, 0, 1]))",
"def transform_from_rot_trans(R, t):\n R = R... | [
"0.75455093",
"0.74925435",
"0.74925435",
"0.7439962",
"0.72949016",
"0.7097317",
"0.703932",
"0.6944894",
"0.68973315",
"0.6775246",
"0.6670417",
"0.66351736",
"0.66133493",
"0.6577561",
"0.6577561",
"0.65703404",
"0.65616655",
"0.6556143",
"0.6554086",
"0.655131",
"0.655131... | 0.6571008 | 15 |
Converts a [roll,pitch,yaw] array into a quaternion | def toQuat(roll_pitch_yaw):
cos_r = np.cos(roll_pitch_yaw[0] * 0.5)
sin_r = np.sin(roll_pitch_yaw[0] * 0.5)
cos_p = np.cos(roll_pitch_yaw[1] * 0.5)
sin_p = np.sin(roll_pitch_yaw[1] * 0.5)
cos_y = np.cos(roll_pitch_yaw[2] * 0.5)
sin_y = np.sin(roll_pitch_yaw[2] * 0.5)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_quaternion(roll = 0.0, pitch = 0.0, yaw = 0.0):\n\tt0 = math.cos(math.radians(yaw * 0.5))\n\tt1 = math.sin(math.radians(yaw * 0.5))\n\tt2 = math.cos(math.radians(roll * 0.5))\n\tt3 = math.sin(math.radians(roll * 0.5))\n\tt4 = math.cos(math.radians(pitch * 0.5))\n\tt5 = math.sin(math.radians(pitch * 0.5))\n\... | [
"0.797938",
"0.7977931",
"0.7977931",
"0.79496217",
"0.7901976",
"0.76958114",
"0.7646835",
"0.74208754",
"0.73583305",
"0.7281046",
"0.72075653",
"0.69544077",
"0.68551344",
"0.68171227",
"0.6809837",
"0.6802918",
"0.67941284",
"0.66225517",
"0.6616821",
"0.66159487",
"0.660... | 0.781466 | 5 |
Conjugates a 4 element array quaternion | def QuatConj(wxyz):
return np.array([wxyz[0], -wxyz[1], -wxyz[2], -wxyz[3]]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_quaternion_invert():\n q = np.array([0.58183503, -0.75119889, -0.24622332, 0.19116072])\n q_inv = pr.q_conj(q)\n q_q_inv = pr.concatenate_quaternions(q, q_inv)\n assert_array_almost_equal(pr.q_id, q_q_inv)",
"def quaternion_to_conjugate(q):\r\n # q = [s,v] | The conjugate, q* = [s, -v]\r\... | [
"0.6969201",
"0.6924322",
"0.684257",
"0.67741805",
"0.6753368",
"0.65372896",
"0.6536622",
"0.6417103",
"0.63652927",
"0.62697023",
"0.6257381",
"0.62403965",
"0.62026644",
"0.6202659",
"0.6183924",
"0.61827147",
"0.6132615",
"0.61132616",
"0.6084177",
"0.6084177",
"0.605431... | 0.60628814 | 20 |
Returns the magnitude of a 4 element array quaternion | def QuatMag(wxyz):
return np.sqrt(np.sum(np.square(wxyz))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mag(q):\n magnitude = np.sqrt((q[0,0]**2)+(q[0,1]**2)+(q[0,2]**2)+(q[0,3]**2))\n return magnitude",
"def magnitude(v):\n if len(v.arr) != 4 or v[3] != 0.0:\n raise ValueError(\"Only use this function with vectors.\")\n return np.sqrt(np.sum(np.square(v.arr)))",
"def mag4(a):\n return ... | [
"0.7105162",
"0.6847898",
"0.6671371",
"0.6315317",
"0.6303935",
"0.6267857",
"0.6245538",
"0.6231791",
"0.62047255",
"0.6130598",
"0.612997",
"0.61050993",
"0.60453784",
"0.60320747",
"0.6004972",
"0.60031796",
"0.5985464",
"0.5969238",
"0.59627527",
"0.5942201",
"0.58837044... | 0.67758495 | 2 |
Sums the rotational transformations from a kinematic chain's base joint to the specified joint | def W_joint_chain(self, joint_name):
if self.joint_syms[joint_name].get("W") is None:
# go up the parent chain of transformations
parent_joint_name = self.global_syms["Jname2parentJname"].get(
joint_name)
if parent_joint_name is None:
self.join... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _joint_angle_control(self):\n\n error = self.target_pos - self.robot_arm_pos\n return self._pd_control(error) + self.torque",
"def T_joint_chain(self, joint_name):\n if self.joint_syms[joint_name].get(\"T_joint\") is None:\n # go up the parent chain of transformations\n ... | [
"0.59704846",
"0.585645",
"0.5632928",
"0.56261355",
"0.54665786",
"0.5412059",
"0.5375454",
"0.5372441",
"0.53531575",
"0.53518873",
"0.5349758",
"0.5322505",
"0.53024715",
"0.5209359",
"0.51984733",
"0.5166083",
"0.5146646",
"0.5120463",
"0.50912195",
"0.50893116",
"0.50766... | 0.5302185 | 13 |
for a random walk, calculate the 3/4 occurrence probability for negative sampling | def frequency(walks):
P_m = {}
for walk in walks:
for item in walk:
try:
P_m[item] += 1
except:
P_m[item] = 1
for key, value in P_m.items():
P_m[key] = value**0.75
return P_m | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prob1(n):\n#raise NotImplementedError(\"Problem 1 Incomplete\")\n if n == 0 :\n raise ValueError(\"Sampling 0 points is not defined.\")\n total = 0\n for i in xrange(n) :\n if np.random.normal() > 3 :\n total += 1\n return float(total)/n",
"def prob4():\n\n\n N = 50000... | [
"0.6929794",
"0.68902445",
"0.68043786",
"0.6697435",
"0.6626235",
"0.65411836",
"0.645649",
"0.6452058",
"0.6406078",
"0.6372602",
"0.63093907",
"0.62959766",
"0.6171657",
"0.6153702",
"0.61108536",
"0.6087997",
"0.6085982",
"0.6028521",
"0.6016851",
"0.59720534",
"0.5958252... | 0.0 | -1 |
This function prints and plots the confusion matrix. | def plot_confusion_matrix(y_true, y_pred,
labels=None,
normalize=False,
title=None,
cmap='YlGn'):
import pandas as pd
from sklearn.metrics import confusion_matrix
from sklearn.utils.multiclass import uniq... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_confusion_matrix(self):\r\n interp = ClassificationInterpretation.from_learner(self.learn)\r\n interp.plot_confusion_matrix()",
"def showConfusionMatrix(self): \r\n sn.heatmap(self.conf_matrix, annot=True)\r\n plt.plot( label=\"Accuracy\")\r\n plt.plot( label=\"Error\"... | [
"0.80894613",
"0.80770946",
"0.79976976",
"0.7946727",
"0.7921785",
"0.78448296",
"0.7833224",
"0.7781221",
"0.7775631",
"0.77574563",
"0.77061635",
"0.77016985",
"0.7692213",
"0.76785815",
"0.76588994",
"0.7641414",
"0.7622791",
"0.7611233",
"0.7610989",
"0.7598244",
"0.7587... | 0.0 | -1 |
Sets the promotional_price of this AdResult. | def promotional_price(self, promotional_price):
self._promotional_price = promotional_price | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_price(self, _price):\n self.price = _price\n return self.price",
"def set_price(self, price):\n assert isinstance(price, float), 'Price must be a float'\n self._price = price",
"def price(self, price: float):\n\n self._price = price",
"def price(self, price):\n\n ... | [
"0.57552093",
"0.56229794",
"0.5583131",
"0.5542211",
"0.5542211",
"0.5542211",
"0.5542211",
"0.55160224",
"0.5413412",
"0.5350816",
"0.53497815",
"0.53002095",
"0.52420515",
"0.52304184",
"0.5227471",
"0.5099097",
"0.507691",
"0.50145364",
"0.48905024",
"0.48905024",
"0.4889... | 0.85411763 | 0 |
Sets the categories of this AdResult. | def categories(self, categories):
self._categories = categories | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def categories(self, categories):\n self._categories = categories",
"def categories(self, categories: List[str]):\n\n self._categories = categories",
"def setCategories(self, categories):\n vocabulary = dict(self.getCategoryVocabulary())\n self.categories = OrderedDict()\n fo... | [
"0.72091866",
"0.6943635",
"0.6635459",
"0.66053724",
"0.62296677",
"0.60006255",
"0.5814384",
"0.5802793",
"0.57435435",
"0.5625827",
"0.56140864",
"0.558028",
"0.5417082",
"0.5403294",
"0.5403294",
"0.5403294",
"0.5403294",
"0.5403294",
"0.53753597",
"0.5339538",
"0.5318521... | 0.71471965 | 4 |
Sets the currency of this AdResult. | def currency(self, currency):
self._currency = currency | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def currency(self, currency: str):\n\n self._currency = currency",
"def currency(self, currency):\n if currency is None:\n raise ValueError(\"Invalid value for `currency`, must not be `None`\")\n\n self._currency = currency",
"def card_currency(self, card_currency):\n\n s... | [
"0.7406318",
"0.72238207",
"0.71002454",
"0.70705146",
"0.6791242",
"0.6727964",
"0.6722",
"0.66269183",
"0.65915567",
"0.65545934",
"0.6534683",
"0.6534683",
"0.6534683",
"0.6534683",
"0.6534683",
"0.6517695",
"0.64423347",
"0.6171665",
"0.6171665",
"0.6171665",
"0.6162198",... | 0.75517786 | 2 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, AdResult):
return False
return self.to_dict() == other.to_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):
if not isinstance(other, AdResult):
return True
return self.to_dict() != other.to_dict() | {
"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.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
... | 0.0 | -1 |
The maximum number of replicas for each service. | def max_replicas(self) -> Optional[pulumi.Input[int]]:
return pulumi.get(self, "max_replicas") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max_replica_count(self) -> Optional[int]:\n return pulumi.get(self, \"max_replica_count\")",
"def max_replica_count(self) -> Optional[int]:\n return pulumi.get(self, \"max_replica_count\")",
"def replicas(self) -> int:\n return pulumi.get(self, \"replicas\")",
"def replicas(self) -> ... | [
"0.7824905",
"0.7824905",
"0.72362834",
"0.72362834",
"0.72362834",
"0.72362834",
"0.72362834",
"0.7197382",
"0.7152217",
"0.7085084",
"0.6909602",
"0.6799525",
"0.6799525",
"0.679206",
"0.679206",
"0.679206",
"0.679206",
"0.679206",
"0.67850333",
"0.6732971",
"0.67241156",
... | 0.79526204 | 1 |
If autoscale is enabled for all services. Each service can turn it off individually. | def status(self) -> Optional[pulumi.Input[Union[str, 'Status']]]:
return pulumi.get(self, "status") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def autoscale_scale_down_non_service_tasks(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"autoscale_scale_down_non_service_tasks\")",
"def auto_scaling(self, auto_scaling):\n\n self.container['auto_scaling'] = auto_scaling",
"def autoscale_down(self) -> Optional[pulumi.Input['... | [
"0.6944232",
"0.6363221",
"0.6202136",
"0.6192388",
"0.60941654",
"0.5971811",
"0.594023",
"0.594023",
"0.594023",
"0.594023",
"0.594023",
"0.5883424",
"0.5831784",
"0.57171434",
"0.5648819",
"0.5640058",
"0.5516951",
"0.54307204",
"0.53440803",
"0.5317507",
"0.52822995",
"... | 0.0 | -1 |
return the posts for logged in user's feed | def posts_for_feed():
user_id = session.get('user_id')
friend_posts = Post.query.join(Friend, db.and_(Post.user_id == Friend.user_2,
Friend.active == True)).outerjoin(Comment, db.and_(Comment.post_id == Post.post_id,
Comment.active == True)).filter... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def feed(request):\n followers = request.user.profile.followers.values_list('pk', flat=True)\n posts = Post.objects.filter(author_id__in=followers)\n\n return render(request,\n 'posts/feed.html',\n {'posts': posts})",
"def get_posts(self):\n return Post.select().... | [
"0.7385219",
"0.7289485",
"0.71484286",
"0.7128945",
"0.7029606",
"0.6970014",
"0.6950573",
"0.69401973",
"0.6868837",
"0.67536765",
"0.67504925",
"0.6743279",
"0.6740741",
"0.6723564",
"0.67098254",
"0.66598666",
"0.66451174",
"0.6602219",
"0.6547143",
"0.6545913",
"0.652870... | 0.75590307 | 0 |
r""" Computes pairwise dot product between two tensors | def _tensor_batch_dot(t1: Tensor, t2: Tensor) -> Tensor:
msg = (
"Please ensure each batch member has the same feature dimension. "
f"First input has {torch.numel(t1) / t1.shape[0]} features, and "
f"second input has {torch.numel(t2) / t2.shape[0]} features."
)
assert torch.numel(t1... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dot_product(a,b):\n return sum(pairwise_mult(a,b))",
"def dot_prod(t1: torch.Tensor, t2: torch.Tensor, verbose: bool = False):\n assert t1.size() == t2.size(), \"Sizes for dot-product must match\"\n return mo.dot_prod(t1, t2, verbose)",
"def dot(a, b):\r\n a, b = as_tensor_variable(a), as_tenso... | [
"0.817763",
"0.8165704",
"0.8088921",
"0.8057248",
"0.79711044",
"0.7941176",
"0.79144746",
"0.7875005",
"0.7860335",
"0.7837402",
"0.78154695",
"0.78144675",
"0.7808872",
"0.77830124",
"0.77555823",
"0.77292967",
"0.7714447",
"0.7695957",
"0.76839423",
"0.76728415",
"0.76693... | 0.72626925 | 42 |
r""" Helper function that computes the quantities returned by `TracInCPBase._get_k_most_influential`, using a specific implementation that is constant memory. | def _get_k_most_influential_helper(
influence_src_dataloader: DataLoader,
influence_batch_fn: Callable,
inputs: Tuple[Any, ...],
k: int = 5,
proponents: bool = True,
show_progress: bool = False,
desc: Optional[str] = None,
) -> Tuple[Tensor, Tensor]:
# For each test instance, maintain th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def solve(max_k=12000, min_k=2):\r\n float_inf = float('inf')\r\n min_ps_numbers = [float_inf] * (max_k - min_k + 1)\r\n\r\n for i in count(1):\r\n # I would like a better way of looking for the max than just checking to see that all values are\r\n # not inf, however this is only a minor p... | [
"0.57673687",
"0.56553537",
"0.56553537",
"0.5558618",
"0.55297816",
"0.5522898",
"0.5512659",
"0.5436768",
"0.54313684",
"0.54234993",
"0.5417373",
"0.53984433",
"0.5365512",
"0.53544426",
"0.5303304",
"0.5298846",
"0.52909005",
"0.52882737",
"0.5275242",
"0.5272284",
"0.524... | 0.5556548 | 4 |
Get the linear velocity of pupper's base. | def base_velocity(self):
raise NotImplementedError('Not yet implemented!') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def BetaVelocity(self):\n return np.linalg.norm(self.velocity) / const.speed_of_light",
"def getVelocity(self):\n return self.v",
"def get_velocity(self):\n return self.momentum/self.mass",
"def get_velocity(self):\n return (self._I85_msg_from_device(self.node.sdo[0x606c].phys)) / 10 ... | [
"0.6445023",
"0.6366614",
"0.6331171",
"0.62954646",
"0.62856305",
"0.6254967",
"0.60327375",
"0.6020356",
"0.5979641",
"0.59622234",
"0.59293413",
"0.59293413",
"0.5916608",
"0.5859421",
"0.58393586",
"0.58130085",
"0.576803",
"0.5707092",
"0.56817096",
"0.56566566",
"0.5656... | 0.657468 | 0 |
Get the orientation of pupper's base, represented as quaternion. | def base_orientation_quaternion(self):
raise NotImplementedError('Not yet implemented!') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def yaw2quat(yaw, base_quat=None):\n rot_euler = [yaw, 0, 0]\n abs_rot = R.from_euler('zyx', rot_euler)\n if base_quat is not None:\n base_rot = R.from_quat([base_quat])\n abs_rot = base_rot.reduce(left=abs_rot)\n return abs_rot.as_quat()",
"def quat_to_angle(self, quat):\n\t\trot = PyK... | [
"0.613074",
"0.61193657",
"0.6108384",
"0.61015373",
"0.6096911",
"0.60465294",
"0.59647256",
"0.59328246",
"0.5929303",
"0.5879437",
"0.586819",
"0.58274",
"0.5822361",
"0.5807857",
"0.5791859",
"0.5736837",
"0.570609",
"0.57030845",
"0.56986046",
"0.5686744",
"0.5666632",
... | 0.7008239 | 0 |
Convert a date_string to date type | def str_2_date(str_date):
str_format = "%m/%d/%y"
return datetime.strptime(str_date, str_format) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def string_to_date(date_string):\n\n return date(int(date_string[:4]),\n int(date_string[5:7]),\n int(date_string[8:10]))",
"def _str_to_date(self, date):\n return datetools.date_parser(date)",
"def string_to_date(string):\n params = string.strip().split('-')\n ... | [
"0.8198883",
"0.8110629",
"0.80763143",
"0.80613905",
"0.80155694",
"0.7849299",
"0.7770957",
"0.7708735",
"0.7706321",
"0.7680073",
"0.7679947",
"0.7672945",
"0.76615816",
"0.7649975",
"0.7607937",
"0.7597452",
"0.7558693",
"0.75560814",
"0.7554643",
"0.75494134",
"0.7546085... | 0.77120113 | 7 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, PodConfig):
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.8457179",
"0.8393067",
"0.81457263",
"0.8140635",
"0.8133462",
"0.8094992",
"0.8093376",
"0.8093376",
"0.8093376",
"0.80863357",
"0.80863357",
"0.8077303",
"0.8077303",
"0.8066831"
] | 0.0 | -1 |
Pretend it is a vector, return magnitude | def magnitude(self):
return math.sqrt(self.x**2 + self.y**2 + self.z**2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def magnitude(v: Vector) -> float:\n return math.sqrt(sum_of_squares(v)) #math.sqrt() is a square root function",
"def magnitude(v):\n if len(v.arr) != 4 or v[3] != 0.0:\n raise ValueError(\"Only use this function with vectors.\")\n return np.sqrt(np.sum(np.square(v.arr)))",
"def magnitude(v: V... | [
"0.83212495",
"0.82795614",
"0.82095546",
"0.8184698",
"0.8156178",
"0.7991793",
"0.79893816",
"0.7858376",
"0.7829627",
"0.77027106",
"0.76909196",
"0.76669794",
"0.7621764",
"0.75843215",
"0.75431645",
"0.74838066",
"0.73868483",
"0.73465514",
"0.733537",
"0.73240113",
"0.7... | 0.7111796 | 29 |
Return copy of our point, shifted by other. | def __add__(self, other):
cls = self.__class__
return cls(self.x+other.x, self.y+other.y, self.z+other.z) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __rmul__(self, other):\n return Point(x * other for x in self.data)",
"def __sub__(self, other):\n return Point(self.x - other[0], self.y - other[1])",
"def __add__(self, other):\n return Point(self.x+other.x, self.y+other.y)",
"def __rshift__(self, other):\n other.set_upstrea... | [
"0.69401866",
"0.6871399",
"0.6828172",
"0.6774653",
"0.66611445",
"0.66412777",
"0.65821534",
"0.65691817",
"0.6567369",
"0.64887",
"0.6451639",
"0.6419063",
"0.63904065",
"0.63462067",
"0.63462067",
"0.62460613",
"0.6237011",
"0.62252444",
"0.6213744",
"0.61964566",
"0.6190... | 0.57748973 | 53 |
Initializes an instance of class Node. Ensures data is an integer and raises a TypeError if it's not. | def __init__(self, data, next_node=None):
if type(data) is not int:
raise TypeError("data must be an integer")
else:
self.data = data
if isinstance(next_node, Node) or next_node is None:
self.next_node = next_node
else:
raise TypeError("ne... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, data, node):\n self.data = data\n self.node = node",
"def __init__(self, value: int):\n self._data = value\n self._next = None",
"def __init__(self, data=None):\n if data is not None:\n self._size = 1\n self.head = Node(data)\n ... | [
"0.7103087",
"0.6888529",
"0.6782137",
"0.67696524",
"0.6692282",
"0.6681539",
"0.6640865",
"0.6596899",
"0.64916956",
"0.6468642",
"0.6424842",
"0.6418991",
"0.64061683",
"0.63961744",
"0.63961744",
"0.63309205",
"0.6329963",
"0.63056785",
"0.62727034",
"0.6257369",
"0.62478... | 0.82900274 | 0 |
Initializes an instance of class SinglyLinkedList | def __init__(self):
self.__head = None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n self._head = self._Node(None, None, None)\n self._tail = self._Node(None, None, None)\n self._head._next = self._tail\n self._tail._prev = self._head\n self._size = 0",
"def __init__(self):\n node = ListNode(0) # dummy\n self.head = node\n ... | [
"0.74831873",
"0.74680954",
"0.74317276",
"0.733495",
"0.7324408",
"0.7301711",
"0.72934777",
"0.7279951",
"0.72563905",
"0.72551745",
"0.72551745",
"0.7224028",
"0.7224028",
"0.7224028",
"0.7208595",
"0.7206092",
"0.72034454",
"0.7195974",
"0.71766365",
"0.7174176",
"0.71618... | 0.7186778 | 18 |
Inserts a new Node into the correct sorted position (increasing) | def sorted_insert(self, value):
new = Node(value)
if self.__head is None:
self.__head = new
elif self.__head.data > value:
new.next_node = self.__head
self.__head = new
else:
temp = self.__head
while (temp.next_node is not None... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sorted_insert(self, value):\n new = Node(value)\n if self.__head is None:\n self.__head = new\n return\n\n cur = self.__head\n if new.data < cur.data:\n new.next_node = self.__head\n self.__head = new\n return\n\n while (... | [
"0.7960838",
"0.7916846",
"0.7894647",
"0.7048809",
"0.703373",
"0.69106734",
"0.6901034",
"0.6886095",
"0.68436915",
"0.6839785",
"0.67785627",
"0.67767525",
"0.6742976",
"0.67267144",
"0.6697202",
"0.66967976",
"0.668254",
"0.6681316",
"0.667863",
"0.6677952",
"0.6676317",
... | 0.76554143 | 3 |
Get the details of a words by its `id`. If successful, returns a Collection resource in the response body specified in `GetSearchWordsDetailResponseSchema` | async def getSearchKeywords(self, id=None):
payload = {}
if id:
payload["id"] = id
# Parameter validation
schema = CatalogValidator.getSearchKeywords()
schema.dump(schema.load(payload))
url_with_params = await create_url_with_param... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def doc_details(id):\n doctor = get_doctor_detail(id)\n\n location = doctor[\"location\"][\"city\"]\n print(f\"getting similar doctors in {location}\")\n category = doctor[\"categories\"][0][\"alias\"]\n category_name = doctor[\"categories\"][0][\"title\"]\n similar_doctors = get_doctors(\"doctor... | [
"0.57461864",
"0.5740392",
"0.56850916",
"0.56753105",
"0.55729306",
"0.5269994",
"0.5254381",
"0.5237878",
"0.52344656",
"0.52329636",
"0.5055821",
"0.5016651",
"0.5013943",
"0.49679527",
"0.49645448",
"0.49605826",
"0.49319285",
"0.49295816",
"0.4927264",
"0.49039948",
"0.4... | 0.51061565 | 10 |
Products are the core resource of an application. If successful, returns a Company Application Product resource in the response body depending upon filter sent. | async def getAppProduct(self, item_id=None):
payload = {}
if item_id:
payload["item_id"] = item_id
# Parameter validation
schema = CatalogValidator.getAppProduct()
schema.dump(schema.load(payload))
url_with_params = await create_ur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def products(self):\n response = requests.get(self._url(self._PRODUCTS_PATH), headers=self._headers)\n return response.json()",
"def processProductsRequest(self):\n\n\t\t# Use the simple page renderer to create the body content\n\t\treturn self.render_simple_page('Products')",
"def get_all_produc... | [
"0.6907818",
"0.6736245",
"0.66459817",
"0.6556905",
"0.6483247",
"0.64386344",
"0.643064",
"0.63484496",
"0.6338219",
"0.6272332",
"0.62246424",
"0.6180877",
"0.61707425",
"0.6146661",
"0.61121774",
"0.60756373",
"0.60710835",
"0.6065253",
"0.60551447",
"0.6051591",
"0.60420... | 0.6075654 | 15 |
Update configuration for listing. | async def updateListingConfiguration(self, config_type=None, config_id=None, body=""):
payload = {}
if config_type:
payload["config_type"] = config_type
if config_id:
payload["config_id"] = config_id
# Parameter validation
schem... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def conf_update(self):\n pass",
"def with_config_update(self):\n original_config = self.load_config()\n\n config_data = original_config.json\n if str(self.ITEM_PUBLIC_ID) in config_data[f\"{self.ITEM_TYPE}s\"]:\n config_data[f\"{self.ITEM_TYPE}s\"].remove(str(self.ITEM_PUBL... | [
"0.6858528",
"0.682887",
"0.6549667",
"0.64303935",
"0.63750416",
"0.63509357",
"0.6195411",
"0.6179669",
"0.61264443",
"0.60464954",
"0.6041735",
"0.5977474",
"0.59732676",
"0.5960031",
"0.59428537",
"0.59428537",
"0.5931172",
"0.5930059",
"0.59036076",
"0.5858026",
"0.58517... | 0.6471731 | 3 |
Get the details of a collection by its `slug`. If successful, returns a Collection resource in the response body specified in `CollectionDetailResponse` | async def getCollectionDetail(self, slug=None):
payload = {}
if slug:
payload["slug"] = slug
# Parameter validation
schema = CatalogValidator.getCollectionDetail()
schema.dump(schema.load(payload))
url_with_params = await create_ur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_details(cls, collection, uid):\n result = collection.find_one({\"_id\": cls.object_id(uid)})\n if result is None:\n raise APIError(\n \"No object matching _id '{}' in collection '{}'\".format(\n uid, collection.name\n ),\n ... | [
"0.7059914",
"0.6674633",
"0.66093224",
"0.6592739",
"0.6438432",
"0.6386326",
"0.62654966",
"0.6244412",
"0.5886946",
"0.5876481",
"0.58235365",
"0.58094215",
"0.57920927",
"0.57679325",
"0.56869364",
"0.56781524",
"0.56612426",
"0.56535053",
"0.56337017",
"0.563233",
"0.562... | 0.8644603 | 0 |
Products are the core resource of an application. Products can be associated by categories, collections, brands and more. If successful, returns a Product resource in the response body specified in `ApplicationProductListingResponseDatabasePowered` | async def getAppProducts(self, brand_ids=None, category_ids=None, department_ids=None, tags=None, item_ids=None, page_no=None, page_size=None, q=None):
payload = {}
if brand_ids:
payload["brand_ids"] = brand_ids
if category_ids:
payload["category_ids"] =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def products(self):\n response = requests.get(self._url(self._PRODUCTS_PATH), headers=self._headers)\n return response.json()",
"def list_products(self):\n return self._make_get_request(self._urls['products'])",
"def products(self):\n from hubspot3.products import ProductsClient\n\n... | [
"0.7194822",
"0.7147236",
"0.6985063",
"0.6957534",
"0.6896469",
"0.68158233",
"0.66960317",
"0.66780835",
"0.66502905",
"0.6633502",
"0.66330755",
"0.66122544",
"0.6567421",
"0.65539426",
"0.6551176",
"0.6540888",
"0.65162116",
"0.64719766",
"0.6470924",
"0.6427235",
"0.6424... | 0.62485427 | 25 |
Take an array and return whether the array is strictly increasing or not. | def increasing(data):
return (np.diff(data) > 0).all() == True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_strictly_increasing(a):\n return np.all(np.diff(a) > 0)",
"def is_sorted_array(arr, increasing=True):\n # If only 1\n if len(arr) == 0:\n return True\n # If multiple values\n if increasing:\n return np.all(np.diff(arr) >= 0)\n else:\n return np.all(np.diff(arr) <= 0)... | [
"0.8435516",
"0.7985802",
"0.76749957",
"0.75439185",
"0.7527223",
"0.74065775",
"0.74063396",
"0.7221936",
"0.70638204",
"0.70570487",
"0.69742227",
"0.6968388",
"0.6944009",
"0.6850256",
"0.6788427",
"0.6775441",
"0.6770309",
"0.67677075",
"0.6764303",
"0.6753061",
"0.66902... | 0.77329713 | 2 |
Returns true if this is a valid url | def valid(url):
return 0 < len(urlparse(url)[1]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_url(self):\r\n if self.resolver:\r\n return True\r\n return False",
"def check_url_invalidity(self) -> bool:\n validate = URLValidator()\n try:\n validate(self.args.url)\n return False\n except ValidationError:\n return True... | [
"0.8459905",
"0.8365042",
"0.8349497",
"0.82956135",
"0.8192476",
"0.8111698",
"0.80761296",
"0.8068111",
"0.80660886",
"0.80393326",
"0.79730046",
"0.7956076",
"0.7956076",
"0.79418004",
"0.79344326",
"0.7923651",
"0.7890589",
"0.7876599",
"0.7787461",
"0.7785099",
"0.777344... | 0.8056837 | 9 |
Creates and returns a pandas data frame from a Weka arff file. | def create_dataframe(file_descriptior, binned=False):
attributes = []
is_data = False
data = {}
URL_INDEX = -1
id_index = - \
1 # If no urls in the data, we label the index with a ascending id
for index, line in enumerate(file_descriptior.readlines()):
if is_data:
c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_data(dataset_path: str):\n data = arff.loadarff(dataset_path)\n data_frame = pd.DataFrame(data[0])\n return data_frame",
"def _dataframe_from_feather(fn, **kwargs):\n\treturn pd.read_feather(fn, **kwargs)",
"def pandas2arff(df, filename, wekaname=\"pandasdata\", cleanstringdata=True, cleannan... | [
"0.6896652",
"0.63749504",
"0.6300467",
"0.6258507",
"0.60809386",
"0.6067322",
"0.6040736",
"0.60003114",
"0.5970567",
"0.57890475",
"0.57825744",
"0.5768192",
"0.5706115",
"0.56877947",
"0.5684231",
"0.5677587",
"0.56683767",
"0.56581473",
"0.56405205",
"0.5622583",
"0.5596... | 0.0 | -1 |
Reset global statistics dictionary. | def reset_stats() -> None:
STATS["cleaned"] = 0
STATS["null"] = 0
STATS["unknown"] = 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset(self):\n self.stats = {}",
"def reset_metric_stats(self):\n self.__stats_table = {}",
"def reset_metric_stats(self):\n\n self.__stats_table = {}",
"def reset(self) -> None:\n self.statistics = defaultdict(float)",
"def reset(self) -> None:\n self.statistics = de... | [
"0.8293292",
"0.82081735",
"0.8191345",
"0.8086345",
"0.80615574",
"0.79317147",
"0.79317147",
"0.75796163",
"0.7497475",
"0.7360163",
"0.7360163",
"0.7360163",
"0.7313594",
"0.7254072",
"0.7058761",
"0.68124324",
"0.6777969",
"0.67372173",
"0.67168313",
"0.67164683",
"0.6643... | 0.7731842 | 7 |
Given the lowest edge in the search tree, backup its value along all edges to the root | def backup(from_edge, reward):
cur_edge = from_edge
while cur_edge is not None and cur_edge.parent is not None:
cur_edge.total_reward += reward
cur_edge.visit_count += 1
cur_edge.avg_reward = cur_edge.total_reward / cur_edge.visit_count
cur_edge = cur_edge.parent.parent_edge | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def backup_edges(self, value: float, backup_until=None):\n current = self.current\n parent = current.parent\n sum_from_leaf = value\n\n while parent is not backup_until:\n edge = parent.edges[current.index]\n edge.visits += 1\n sum_from_leaf += current.s... | [
"0.64578086",
"0.64005613",
"0.63505846",
"0.6306446",
"0.6258873",
"0.6237712",
"0.6219051",
"0.6129095",
"0.6128473",
"0.60948586",
"0.60475034",
"0.5989608",
"0.59821326",
"0.5923738",
"0.5912156",
"0.58807766",
"0.58460575",
"0.58214927",
"0.5821385",
"0.58108705",
"0.580... | 0.5733141 | 27 |
Render the root index page. | def root():
return flask.render_template('index.html') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def root():\n return render_template('index.html')",
"def root():\n return render_template('index.html')",
"def root():\n return render_template('index.html')",
"def index():\r\n return render_template('index.html')",
"def index(self):\n\t\treturn render_template('index.html')",
"def ... | [
"0.8183606",
"0.8183606",
"0.8183606",
"0.8112007",
"0.81083304",
"0.8101133",
"0.80989635",
"0.8085401",
"0.8085401",
"0.7937648",
"0.79349715",
"0.79349715",
"0.7921631",
"0.7881508",
"0.78801703",
"0.78779125",
"0.78541213",
"0.78510344",
"0.78273135",
"0.78209394",
"0.780... | 0.74934137 | 82 |
Render the browser page. | def browser():
return flask.render_template('browser.html') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def renderPage():\n return render_template(\"index.html\")",
"def get(self):\n self.render(\"index.html\")",
"def get(self):\n self.render(\n \"index.html\",\n )",
"def get(self):\n self.render('index.html')\n return",
"def run(self) -> None:\n self._re... | [
"0.75061005",
"0.7244879",
"0.71513355",
"0.71417814",
"0.7089995",
"0.7023496",
"0.6992184",
"0.6893141",
"0.68442404",
"0.68321484",
"0.68089557",
"0.67964613",
"0.679536",
"0.6790774",
"0.6790539",
"0.67665976",
"0.66990024",
"0.66513026",
"0.66270864",
"0.6623908",
"0.659... | 0.69714457 | 7 |
Given a datetime object, return the nearest time in the database (in string format), or None if empty. | def getNearestTime(time_query):
# Convert datetime object to string, for lookup in database.
tstamp_query = coils.time2string(time_query)
# Retrieve image timestamps.
try:
tstamp_left = db.session.query(mapping.Image.time).\
filter(mapping.Image.time <= tstamp_query).\
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nearest_time_sql(self, t):\n if self.verbose:\n sys.stderr.write('SQL Time %s' % t)\n self.cursor.execute('SELECT * FROM tracklog WHERE dt <= ? ORDER BY dt DESC LIMIT 1', (t,))\n d = self.cursor.fetchone()\n if d != None:\n t0 = [datetime.strptime(d[0],'%Y-%m-%... | [
"0.68339187",
"0.6200543",
"0.61982375",
"0.6133891",
"0.6118181",
"0.5926496",
"0.5697461",
"0.56276345",
"0.5610388",
"0.5587665",
"0.5519962",
"0.5509945",
"0.54903024",
"0.5426412",
"0.5422848",
"0.5421275",
"0.5323081",
"0.53056514",
"0.5294015",
"0.52822715",
"0.5249685... | 0.6193283 | 3 |
Builds a Sukharevgrid hypercube design dataframe from a dictionary of factor/level ranges. Number of samples raised to the power of (1/dimension), where dimension is the number of variables, must be an integer. Only min and max values of the range are required. | def build_sukharev(d,num_samples=None):
return build_sukharev(d,num_samples=num_samples) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def expand_grid(data_dict: Dict[str, Union[int, float, np.ndarray]]) -> pd.DataFrame:\n rows = it.product(*data_dict.values())\n return pd.DataFrame.from_records(rows, columns=data_dict.keys())",
"def __init__(\n self, data: pd.DataFrame,\n n_picked: int, n_choices: int,\n vmin: int, v... | [
"0.6052764",
"0.59037673",
"0.5789137",
"0.5610777",
"0.5575302",
"0.5435865",
"0.5409098",
"0.5386549",
"0.5361984",
"0.53291714",
"0.529285",
"0.5273553",
"0.52391833",
"0.5218937",
"0.5197006",
"0.5178087",
"0.51730216",
"0.5172327",
"0.5155161",
"0.51338536",
"0.5105367",... | 0.0 | -1 |
Builds a design dataframe with samples drawn from uniform random distribution based on a dictionary of factor/level ranges. Only min and max values of the range are required. | def uniform_random (d, num_samples=None):
return build_uniform_random (d, num_samples=num_samples) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_uniform_dist_data(debug, dataset, resamplefactor, raw, analysis):\n\n project_wd, project_data, project_sink = get_paths(debug, dataset)\n\n demographics, imgs, dataframe = get_data(project_data, dataset,\n debug, project_wd,\n ... | [
"0.6120273",
"0.57362914",
"0.56356394",
"0.5590903",
"0.5580051",
"0.554625",
"0.544098",
"0.54278064",
"0.54259616",
"0.5405972",
"0.540069",
"0.53572416",
"0.535494",
"0.5325751",
"0.52944916",
"0.5289679",
"0.5276429",
"0.5261791",
"0.520247",
"0.5180726",
"0.51744366",
... | 0.0 | -1 |
The L_2 optimized attack. This attack is the most efficient and should be used as the primary attack to evaluate potential defenses. Returns adversarial examples for the supplied model. | def __init__(self, model, batch_size=1, confidence=CONFIDENCE,
targeted=TARGETED, learning_rate=LEARNING_RATE,
binary_search_steps=BINARY_SEARCH_STEPS, max_iterations=MAX_ITERATIONS, print_every=100, early_stop_iters=0,
abort_early=ABORT_EARLY,
initial... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Attack(model):\n candidate_number = 10\n\n attack_embeddings = WordEmbedding.counterfitted_GLOVE_embedding()\n\n transformation = WordSwapEmbeddingDisplacement(\n max_candidates=10, embedding=attack_embeddings, learning_rate=0.5, discretize_by_cosine=False)\n\n constraints = CONSTRAINTS\n\n ... | [
"0.57577574",
"0.56006753",
"0.54432786",
"0.54042715",
"0.5355783",
"0.52470887",
"0.52401364",
"0.5080776",
"0.5078789",
"0.50548965",
"0.50382966",
"0.5012398",
"0.50013757",
"0.49923596",
"0.4991546",
"0.49646848",
"0.49643445",
"0.4963997",
"0.4945777",
"0.49454907",
"0.... | 0.0 | -1 |
Returns a list of those inputs which should be considered when attempting to merge two different protocols of the same type. Returns set of ProtocolPath References to those inputs which should be considered. | def _find_inputs_to_merge(self):
inputs_to_consider = set()
for input_path in self.required_inputs:
# Do not consider paths that point to child (e.g grouped) protocols.
# These should be handled by the container classes themselves.
if (input_path.start_protocol is n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def protocols(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:\n return pulumi.get(self, \"protocols\")",
"def mergeURLS(inputs):\n urls = set()\n for i in inputs:\n # Re-raise any exceptions\n try:\n urls = urls.union(i.urls())\n except:\n rai... | [
"0.606534",
"0.5921542",
"0.56391585",
"0.5582945",
"0.5582945",
"0.5499798",
"0.5394667",
"0.5348988",
"0.5148564",
"0.514139",
"0.5138376",
"0.51202196",
"0.5107636",
"0.5075969",
"0.50506335",
"0.5040749",
"0.49956554",
"0.49919233",
"0.4980945",
"0.49595803",
"0.49321705"... | 0.7201167 | 0 |
Returns one of this protocols, or any of its children's, attributes directly (rather than its value). | def get_class_attribute(self, reference_path):
if reference_path.start_protocol is not None and reference_path.start_protocol != self.id:
raise ValueError('The reference path {} does not point to this protocol'.format(reference_path))
if (reference_path.property_name.count(ProtocolPath.pro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attrib(self) -> Any:\n return self.attributes",
"def get_attribute(self, lexeme: str) -> typing.Union[Attributes.Attributes]:\n return self._parent_node.get_attribute(lexeme)",
"def get_attr(self):\n attr = self._bld.FindOrCreateAttribute(self._sobj, self.sname)\n return attr._n... | [
"0.66290337",
"0.61623335",
"0.61337537",
"0.60472715",
"0.60307115",
"0.6029202",
"0.60283405",
"0.59579617",
"0.59337056",
"0.59335685",
"0.5925819",
"0.592047",
"0.592047",
"0.58975416",
"0.58941126",
"0.58849657",
"0.58722186",
"0.5866904",
"0.5859108",
"0.58565736",
"0.5... | 0.0 | -1 |
Returns the value of one of this protocols inputs / outputs. | def get_value(self, reference_path):
if (reference_path.start_protocol is not None and
reference_path.start_protocol != self.id):
raise ValueError('The reference path does not target this protocol.')
if reference_path.property_name is None or reference_path.property_name == ''... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def value(self):\n return self['input'].value()",
"def value_for_protocol(self, proto):\n proto = protocols.protocol_with_any(proto)\n for proto2, value in self.items():\n if proto2 is proto or proto2 == proto:\n return value\n raise exceptions.ProtocolLookup... | [
"0.6471683",
"0.64303595",
"0.6367092",
"0.6327082",
"0.63108855",
"0.61634654",
"0.6133807",
"0.6123385",
"0.60559344",
"0.6052717",
"0.6052717",
"0.59725505",
"0.5952316",
"0.5924429",
"0.5918395",
"0.5918395",
"0.5918395",
"0.5918395",
"0.5918395",
"0.5918395",
"0.5918395"... | 0.0 | -1 |
Applies a `ProtocolReplicator` to this protocol. This method should clone any protocols whose id contains the id of the replicator (in the format `$(replicator.id)`). | def apply_replicator(self, replicator, template_values, template_index=-1,
template_value=None, update_input_references=False):
return {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, replicator_id=''):\n self.replicator_id = replicator_id",
"def replace_protocol(self, old_id, new_id):\n\n for input_path in self.required_inputs:\n\n input_path.replace_protocol(old_id, new_id)\n\n if input_path.start_protocol is not None or (input_path.sta... | [
"0.5212206",
"0.5155001",
"0.5092272",
"0.482206",
"0.45493725",
"0.45493725",
"0.45485687",
"0.45385852",
"0.4492771",
"0.44367614",
"0.44129315",
"0.4407569",
"0.44025335",
"0.43890157",
"0.43871552",
"0.43437824",
"0.43313554",
"0.43102112",
"0.42590275",
"0.4256028",
"0.4... | 0.43847278 | 15 |
The string name of this object. | def name(self):
return self._name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self) -> str:\n return self.__name",
"def name(self) -> str:\n return self.__name",
"def name(self) -> str:\n return self.__name",
"def name(self) -> str:\n return self.__name",
"def name(self) -> str:\n return self.__name",
"def name(self) -> str:\n ret... | [
"0.8641713",
"0.8641713",
"0.8641713",
"0.8641713",
"0.8641713",
"0.8641713",
"0.8641713",
"0.86382765",
"0.86366504",
"0.86366504",
"0.86366504",
"0.86366504",
"0.86366504",
"0.86366504",
"0.86366504",
"0.86366504",
"0.86366504",
"0.86366504",
"0.854574",
"0.854574",
"0.8545... | 0.0 | -1 |
Returns True if `self` is subtype of `other`. | def is_subtype_of(self, other):
if type(self) is not type(other):
return False
if (not self._transform_is_composite and
self.transform_or_spec != other.transform_or_spec):
return False
# pylint: disable=protected-access
try:
tf.nest.assert_same_structure((self._specs, self._u... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_same_type_as_other(cls, other):\r\n return isinstance(other, cls)",
"def matches(self, other):\n if isinstance(other, type):\n return isinstance(self, other)\n\n return self == other",
"def __eq__(self, other):\n return isinstance(other, self.__class__)",
"def is... | [
"0.78547263",
"0.76336676",
"0.73961675",
"0.7058479",
"0.692733",
"0.69169086",
"0.6738126",
"0.67178416",
"0.6691528",
"0.66556174",
"0.66554534",
"0.66383874",
"0.66254455",
"0.6550018",
"0.6540524",
"0.65269595",
"0.65269476",
"0.64918786",
"0.64704806",
"0.64704806",
"0.... | 0.70454806 | 4 |
Returns True if `spec_or_value` is compatible with this TypeSpec. | def is_compatible_with(self, spec_or_value):
if not isinstance(spec_or_value, tf.TypeSpec):
spec_or_value = type_spec.type_spec_from_value(spec_or_value)
if type(self) is not type(spec_or_value):
return False
if not self._transform_is_composite:
if self.transform_or_spec != spec_or_value.t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_value_type(self, value):\n if value is not None and self.value_type is not None:\n valid = isinstance(value, self.value_type)\n if not valid:\n return False\n return True",
"def is_valid_value(self, value: Any) -> bool:\n return self.type_regis... | [
"0.6090885",
"0.60800487",
"0.59740835",
"0.5972587",
"0.5841784",
"0.58039266",
"0.57995975",
"0.57938844",
"0.5790969",
"0.57170725",
"0.569705",
"0.5694284",
"0.5682722",
"0.5666257",
"0.561704",
"0.5566469",
"0.55634415",
"0.5527648",
"0.55116",
"0.55059814",
"0.5490449",... | 0.8151051 | 0 |
Returns the `input_spec` with leading batch dimension removed. | def _get_unbatched_input_spec(self):
if isinstance(self._input_spec, type_spec.BatchableTypeSpec):
return self._input_spec._unbatch() # pylint: disable=protected-access
if isinstance(self._input_spec, resource_variable_ops.VariableSpec):
return resource_variable_ops.VariableSpec(
shape=(N... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _unbatch(self):\n transform_or_spec = self._specs.get(\n 'transform_or_spec', self.transform_or_spec)\n if hasattr(transform_or_spec, '_unbatch'):\n transform_or_spec = transform_or_spec._unbatch()\n return _DeferredTensorSpec(\n self._get_unbatched_input_spec(),\n transform_... | [
"0.65780014",
"0.60339016",
"0.5858282",
"0.5787339",
"0.5759501",
"0.56426686",
"0.56240726",
"0.55431986",
"0.55280155",
"0.54403126",
"0.54354197",
"0.5397142",
"0.5383978",
"0.5363839",
"0.5327748",
"0.53150475",
"0.5271061",
"0.51590055",
"0.5136601",
"0.51251155",
"0.51... | 0.6334988 | 1 |
Initializes a new `_TransformedVariableSpec`. | def __init__(self, input_spec, transform_or_spec, dtype, name):
self._input_spec = input_spec
self._transform_or_spec = transform_or_spec
self._dtype = dtype
self._name = name
self._unique_id_params = {'dtype': dtype}
self._transform_is_composite = isinstance(transform_or_spec, tf.TypeSpec)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _from_components(self, components):\n bijector = components.pop('bijector', self.transform_or_spec)\n return TransformedVariable(\n **components, initial_value=None, bijector=bijector,\n dtype=self.dtype, name=self.name)",
"def __init__(self, initial_value, bijector, dtype=None, name=None... | [
"0.6138193",
"0.61043125",
"0.59204894",
"0.58342403",
"0.5778291",
"0.5722805",
"0.5702514",
"0.55525905",
"0.5540655",
"0.54837817",
"0.54630786",
"0.54498744",
"0.54365695",
"0.5427383",
"0.5425426",
"0.54199487",
"0.5410114",
"0.5403379",
"0.53761965",
"0.53729236",
"0.53... | 0.580823 | 4 |
Sets the learning rate to the initial LR decayed by 10 every 30 epochs | def adjust_learning_rate(optimizer_P, epoch):
if epoch < 10:
lr = args.lr * (epoch + 1) / 10
elif 10 <= epoch < 20:
lr = args.lr
elif 20 <= epoch < 50:
lr = args.lr * 0.1
elif epoch >= 50:
lr = args.lr * 0.01
optimizer_P.param_groups[0]['lr'] = 0.1 * lr
for i in ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def adjust_learning_rate(init_lr, optimizer, epoch, n=100):\n init_lr = init_lr * (0.1 ** (epoch // n))\n print('learning rate : ', init_lr)\n for param_group in optimizer.param_groups:\n param_group['lr'] = init_lr",
"def adjust_learning_rate(start_lr, optimizer, epoch, total_epoch_num):\n #l... | [
"0.7913536",
"0.7906521",
"0.7849834",
"0.777524",
"0.77338326",
"0.77306354",
"0.7722718",
"0.77224237",
"0.771982",
"0.77092624",
"0.7693604",
"0.76742035",
"0.7665748",
"0.7665748",
"0.7665748",
"0.7655329",
"0.76419765",
"0.76399755",
"0.7637868",
"0.7626077",
"0.76247585... | 0.0 | -1 |
Validate a given set of query parameters and confirm they are applicable for this endpoint | def __call__(self, state=None, **filters) -> "Client":
col = "fips" if self.path == "covid" else "location"
if state is not None and self.has_filter(col):
if col in filters:
msg = f"Both state {state} and {col} {filters[col]} were passed."
msg += " Only one ma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _validate_query_parameters(self):\n check_years(self._years)\n check_geo_hierarchy(self.for_geo, self.in_geo)\n check_geo_estimates(self.estimate, self.for_geo)\n return True",
"def validate_args(engine: SqRestEngine, params: Dict):\n def req_error(param: str, exp: str, got: st... | [
"0.75395805",
"0.70680356",
"0.6989793",
"0.6597404",
"0.64976615",
"0.6454052",
"0.6426118",
"0.64165086",
"0.64060557",
"0.6398697",
"0.6392284",
"0.6381563",
"0.63649553",
"0.63162225",
"0.6289131",
"0.6286899",
"0.6280915",
"0.6251446",
"0.6247898",
"0.6243303",
"0.622107... | 0.0 | -1 |
Asserts that the version of dockercomposenoplacementconstraints is the latest | def test_repo_docker_compose_no_placement_contraints():
with open("docker_config/docker-compose-no-placement-constraints.yaml",
"r") as hosts0:
with open("docker_config/docker-compose.yaml", "r") as stream:
dict = yaml.safe_load(stream)
dict = remove_placement_contraint... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ensure_docker_version() -> None:\n compose_version = get_compose_version()\n if compose_version < version.parse(MINIMUM_DOCKER_COMPOSE_VERSION):\n raise VersionError(\n f\"Docker-compose {compose_version} is not supported. \"\n f\"You need to have at least {MINIMUM_DOCKER_COM... | [
"0.6654591",
"0.6281692",
"0.6153739",
"0.60202277",
"0.60174435",
"0.6002098",
"0.5993986",
"0.5977341",
"0.58967453",
"0.58948433",
"0.58862793",
"0.57865256",
"0.5786191",
"0.57769173",
"0.5757584",
"0.57115114",
"0.56823",
"0.56812084",
"0.56684655",
"0.5653574",
"0.56468... | 0.5633351 | 22 |
Return a random rotation matrix | def random_rotate():
u = np.random.uniform(size=3)
# Random quaternion
q = np.array([np.sqrt(1-u[0])*np.sin(2*np.pi*u[1]),
np.sqrt(1-u[0])*np.cos(2*np.pi*u[1]),
np.sqrt(u[0])*np.sin(2*np.pi*u[2]),
np.sqrt(u[0])*np.cos(2*np.pi*u[2])])
# Convert the quaternion into... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_rotation_matrix():\n\n x = np.random.uniform(size=3)\n theta = x[0]*2*math.pi\n phi = x[1]*2*math.pi\n z = x[2]*2\n\n r = math.sqrt(z)\n vx = math.sin(phi)*r\n vy = math.cos(phi)*r\n vz = math.sqrt(2.0-z)\n\n st = math.sin(theta)\n ct = math.cos(theta)\n\n sx = vx*ct-vy*... | [
"0.85812455",
"0.7744618",
"0.75840765",
"0.7518206",
"0.73470306",
"0.7260589",
"0.7238953",
"0.7024455",
"0.68993294",
"0.68715715",
"0.6864829",
"0.6864829",
"0.6864829",
"0.68593216",
"0.6765641",
"0.67651105",
"0.67651105",
"0.67403316",
"0.6725854",
"0.67216176",
"0.662... | 0.7425117 | 4 |
Computes the crossentropy cost | def compute_cost(A3, Y):
m = A3.shape[1]
cost = -1 / m * (np.dot(Y, np.log(A3).T) + np.dot(1 - Y, np.log(1 - A3).T));
return cost | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_reconstruction_cost(self, nv):\n cross_entropy = T.mean(\n T.sum(\n self.input * T.log(nv) +\n (1 - self.input) * T.log(1 - nv),\n axis=1\n )\n )\n return cross_entropy",
"def get_reconstruction_cost(self, updates, pr... | [
"0.7532285",
"0.7491906",
"0.7471267",
"0.7415311",
"0.73066145",
"0.728905",
"0.72790325",
"0.72023773",
"0.7167079",
"0.7149328",
"0.7140391",
"0.71380997",
"0.7070278",
"0.70476264",
"0.7047075",
"0.6991439",
"0.69882655",
"0.6970435",
"0.695001",
"0.69297063",
"0.69114333... | 0.0 | -1 |
Sets the href of this CustomerServiceMetricTaskCollection. | def href(self, href):
self._href = href | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def item_href(self, item_href):\n\n self._item_href = item_href",
"def item_group_href(self, item_group_href):\n\n self._item_group_href = item_group_href",
"def href(self):\n return self._href",
"def href(self):\n return self._href",
"def async_action(self, renderer, action, wi... | [
"0.57693386",
"0.5111322",
"0.50520396",
"0.50520396",
"0.50450623",
"0.5005647",
"0.5005647",
"0.5005647",
"0.5005647",
"0.5005647",
"0.5005647",
"0.5005647",
"0.5005647",
"0.5005647",
"0.5005647",
"0.5005647",
"0.5003668",
"0.49553016",
"0.49553016",
"0.49553016",
"0.495530... | 0.6521095 | 1 |
Sets the limit of this CustomerServiceMetricTaskCollection. | def limit(self, limit):
self._limit = limit | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def limit(self, limit):\n self._evaluated = False\n self._limit = limit\n return self",
"def limit(self, limit):\n self._limit = limit",
"def set_Limit(self, value):\n super(DescribeEvaluationsInputSet, self)._set_input('Limit', value)",
"def limit(self, limit):\n self._limit = ... | [
"0.6743655",
"0.6693186",
"0.66077745",
"0.65790546",
"0.6555484",
"0.6550848",
"0.64116675",
"0.6389649",
"0.6255083",
"0.6239727",
"0.6140176",
"0.6119365",
"0.6108381",
"0.60264796",
"0.58797807",
"0.5830482",
"0.57486165",
"0.57144994",
"0.56906",
"0.5682152",
"0.56467175... | 0.66888 | 2 |
Sets the prev of this CustomerServiceMetricTaskCollection. | def prev(self, prev):
self._prev = prev | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setPrev(self, prev):\n\t\t\tself.prev = prev",
"def set_previous(self, new_previous):\n self.previous = new_previous",
"def set_prev(self, p) -> None:\n self.prev = p",
"def prev(self):\n return self.__prev",
"def prev(self,p):\n assert type(p) is type(self)\n self.__... | [
"0.6650694",
"0.6334318",
"0.6213",
"0.61976296",
"0.61835843",
"0.6072512",
"0.5917777",
"0.58412755",
"0.57648003",
"0.5644707",
"0.5642294",
"0.5610288",
"0.5544255",
"0.55235255",
"0.5514401",
"0.5485441",
"0.54735726",
"0.5449381",
"0.54301924",
"0.54298246",
"0.54269516... | 0.6791883 | 0 |
Sets the total of this CustomerServiceMetricTaskCollection. | def total(self, total):
self._total = total | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total(self, total: float):\n if total is None:\n raise ValueError(\"Invalid value for `total`, must not be `None`\") # noqa: E501\n \n self._total = total",
"def total(self, total):\n if self.local_vars_configuration.client_side_validation and total is None: # noqa: E... | [
"0.6683123",
"0.66456103",
"0.6316005",
"0.62762046",
"0.6240422",
"0.61213803",
"0.61170787",
"0.6033454",
"0.59787023",
"0.5963401",
"0.592862",
"0.5855848",
"0.58510476",
"0.58291984",
"0.58032006",
"0.57362837",
"0.5710675",
"0.56916434",
"0.56700474",
"0.5602156",
"0.557... | 0.68796426 | 4 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, CustomerServiceMetricTaskCollection):
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.8089204",
"0.8089204",
"0.8055265",
"0.7983358",
"0.7967577",
"0.7967577",
"0.7967577",
"0.7967577",
"0.7967577",
"0.7967577",
"0.7967577",
"0.7967577",
"0.7967577",
"0.7967577",
"0.7967577",
"0.7967577",
"0.7967577",
"0.7967577",
"0.7967577",
"0.7967577",
"0.7967577",
"... | 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 |
Given a the user_rating dict compute average user ratings | def compute_average_user_ratings(user_ratings):
ave_ratings = {}
for user,value in user_ratings.items():
sum = 0
movie_num=0
for movieId, rating in value.items():
sum += float(rating)
movie_num += 1
average = sum / movie_num
ave_ratings[user]=... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calcUserMeanRating(userRatingGroup):\n userID = userRatingGroup[0]\n ratingSum = 0.0\n ratingCnt = len(userRatingGroup[1])\n if ratingCnt == 0:\n return (userID, 0.0)\n for item in userRatingGroup[1]:\n ratingSum += item[1]\n return (userID, 1.0 * ratingSum / ratingCnt)",
"def... | [
"0.7645329",
"0.7486663",
"0.7363803",
"0.71609515",
"0.71256304",
"0.71016675",
"0.6949304",
"0.6906164",
"0.6871054",
"0.6858859",
"0.66771",
"0.66672695",
"0.66564226",
"0.6606957",
"0.65784776",
"0.6528221",
"0.6519632",
"0.64716643",
"0.64383996",
"0.64283603",
"0.640452... | 0.8639182 | 0 |
Return difference of two ints. | def subtract(a, b):
return a - b | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subtract(x: int, y: int):\n return x - y",
"def subtract_numbers(x,y):\n return x - y",
"def subtract(num1, num2):\n difference = num1 - num2\n return difference",
"def subtract(num1, num2):\n \n difference = num2 - num1\n return difference",
"def subtraction(num1, num2):\n diff... | [
"0.72578734",
"0.69304067",
"0.69127005",
"0.685296",
"0.6830722",
"0.67837423",
"0.67591757",
"0.6753341",
"0.6726393",
"0.6726393",
"0.6695918",
"0.6544012",
"0.65060765",
"0.6447873",
"0.64163566",
"0.64163566",
"0.64163566",
"0.6412628",
"0.6400336",
"0.63495356",
"0.6348... | 0.645472 | 14 |
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`. | def plot_confusion_matrix(y_true, y_pred, classes,
normalize=False,
title=None,
cmap=plt.cm.Blues):
if not title:
if normalize:
title = 'Normalized confusion matrix'
else:
title = 'Confusion matrix,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n... | [
"0.8194862",
"0.80949175",
"0.8029915",
"0.8019153",
"0.79941195",
"0.7991258",
"0.7980955",
"0.7976606",
"0.79610753",
"0.79590565",
"0.79378676",
"0.7934962",
"0.7934504",
"0.79313844",
"0.7926313",
"0.7924577",
"0.79241234",
"0.7923211",
"0.7923023",
"0.7921931",
"0.791787... | 0.0 | -1 |
Sets the learning rate to the initial LR decayed by 0.98 each epoch | def adjust_learning_rate(self, optimizer, epoch, initial_lr, writer=None):
lr = initial_lr * (0.98 ** epoch)
for param_group in optimizer.param_groups:
param_group['lr'] = lr
if writer:
writer.add_scalar("lr_G", lr, epoch + 1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_learning_rate(self):\n\n if (self.FLAGS.learning_rate_decay is \"exponential\"):\n self.learning_rate = tf.train.exponential_decay(\n self.FLAGS.learning_rate,\n self.global_step,\n self.... | [
"0.7826302",
"0.7777572",
"0.7766485",
"0.776375",
"0.7760067",
"0.775624",
"0.775624",
"0.77274007",
"0.7696412",
"0.7661156",
"0.76403975",
"0.76403415",
"0.763854",
"0.76367867",
"0.76232225",
"0.76171553",
"0.7599348",
"0.75963974",
"0.7591719",
"0.75831807",
"0.75807536"... | 0.7543214 | 23 |
Finds the first peak point in the signal. | def first_peak_detect(beam, start_point):
logging.debug('running first_peak_detect function')
for i in range(start_point, len(beam)):
logging.debug('current value of i is %d', i)
if beam[i-1] < beam[i] > beam[i+1]:
logging.debug('value determined to be the center of the values %d, %d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def peak(self):\n\n return self._data[0]",
"def peak(self) -> Point:\n return self.most_intense_point()",
"def peak(self):\n pass",
"def peak(self):\n return self.peak",
"def peak(data, fft_data=None):\n return np.max(np.abs(data))",
"def detect_peak(data):\n nonloca... | [
"0.75364155",
"0.7515242",
"0.7205967",
"0.7067757",
"0.7063192",
"0.7011398",
"0.69656426",
"0.6899543",
"0.68681777",
"0.674646",
"0.66507727",
"0.66276026",
"0.65652406",
"0.65066725",
"0.64852947",
"0.64128417",
"0.63915634",
"0.6386856",
"0.6376283",
"0.637301",
"0.63552... | 0.7387292 | 2 |
Forward pass for training; returns the loss and hidden state to be passed to the next stage | def forward(self, input_mix, separated_inputs, mask, partial_input=None):
batch_size = input_mix.shape[0]
mix_latent = self.encoder(input_mix)
mix_latents = mix_latent.unsqueeze(1)
mix_latents = mix_latents.expand(-1, self.C, -1, -1).contiguous()
if self.args.similarity_loss_weig... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __getstate__(self):\n return (self.layers, self.best_loss)",
"def training_step(self, x):\n self.train() # Sets network to train mode\n rec_error, feat, y = self.forward(x)\n # Reconstruction Loss\n rec_loss = torch.mean(rec_error)\n loss = rec_loss\n\n self.zero_grad()\n loss.bac... | [
"0.6842813",
"0.67254674",
"0.66808844",
"0.6661478",
"0.66317296",
"0.6518796",
"0.6501482",
"0.6441055",
"0.640115",
"0.63945925",
"0.6378223",
"0.63754857",
"0.63608974",
"0.6318288",
"0.62991476",
"0.62950486",
"0.62885267",
"0.62850523",
"0.62636465",
"0.625404",
"0.6252... | 0.0 | -1 |
Forward pass for inference; returns the separated signal and hidden state to be passed to the next stage | def inference(self, x, partial_input=None):
x = self.encoder(x)
x = x.expand(self.C, -1, -1).unsqueeze_(0)
if partial_input is not None:
mask_input = torch.cat([x, partial_input], 2)
else:
mask_input = x
del partial_input
instruments = torch.arange... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward(self, x, hidden):\n batch_size=x.shape[0]\n\n x = self.embed(x)\n\n x,hidden = self.lstm(x,hidden)\n\n x = x.reshape(-1,self.hidden_dim)\n\n x = self.drp(x)\n\n x = self.fc(x)\n\n sig_out = self.sigmoid(x)\n\n # return last sigmoid output and hidd... | [
"0.634465",
"0.6198443",
"0.61823845",
"0.61330324",
"0.6131121",
"0.61177427",
"0.60765475",
"0.6072029",
"0.60652095",
"0.59722996",
"0.594419",
"0.5937271",
"0.5928774",
"0.59094137",
"0.5895278",
"0.5882043",
"0.58692193",
"0.585079",
"0.58409804",
"0.58311045",
"0.582869... | 0.0 | -1 |
Forward pass for inference; returns the separated signal | def inference(self, input_audio, n_chunks=4):
assert len(input_audio) == self.stages_num
chunks = [int(input_audio[0].shape[-1] / n_chunks * c + 0.5) for c in range(n_chunks)]
chunks.append(input_audio[0].shape[-1])
chunk_intervals = [(max(0, chunks[n] - self.base_sr * 8), min(chunks[n +... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward( self, x ):\n x = x + self.pe[ :x.size(0), : ]\n return self.dropout( x )",
"def forward(self, x):\n output1, output2 = self.model(x)\n return output1, output2",
"def forward(self, x):\n x = x + self.pe[: x.size(0), :]\n return self.dropout(x)",
"... | [
"0.67058116",
"0.669237",
"0.65974075",
"0.6561029",
"0.6397809",
"0.63973707",
"0.63973707",
"0.63973707",
"0.63973707",
"0.63736236",
"0.6353369",
"0.63480484",
"0.63420767",
"0.634186",
"0.6331248",
"0.6305852",
"0.63045794",
"0.626796",
"0.6263219",
"0.6236724",
"0.623359... | 0.0 | -1 |
Test that user with no role cannot be created | def test_create_user_with_no_role(setup_client):
client = setup_client
payload = {
'email': 'test@gmail.com',
'password': 'password',
'name': 'Test name'
}
res = client.post(CREATE_USER_URL, payload)
assert res.status_code == status.HTTP_400_BAD_REQUEST
user_exists = get_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_dont_create_user(self):\n self.assertFalse(User.objects.exists())",
"def test_08_create_user_not_exists(self):\n\n _, user = self.get_random_item(models.User)\n utils.create_user(user, session=self.session)\n success, error = utils.create_user(user, session=self.session)\n ... | [
"0.7774761",
"0.7420876",
"0.7157188",
"0.7140013",
"0.70629483",
"0.701963",
"0.6951725",
"0.69096833",
"0.690207",
"0.68526024",
"0.6847458",
"0.6828952",
"0.682121",
"0.6818705",
"0.6812512",
"0.6800999",
"0.67619777",
"0.6755123",
"0.67497134",
"0.67273474",
"0.6719412",
... | 0.76015866 | 1 |
Test that a user token is successfully created | def test_create_token_for_user(setup_client):
client = setup_client
payload = {
'email': 'test@gmail.com',
'password': 'testpass',
}
create_user(**payload, **{'role': 'Supplier'})
res = client.post(TOKEN_URL, payload)
assert "token" in res.data
assert res.status_code == statu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_token_for_user(self):\n payload = {'email': 'test@test.com', 'password': 'testpass'}\n create_user(**payload)\n res = self.client.post(TOKEN_URL, payload)\n\n self.assertIn('token', res.data)\n self.assertEqual(res.status_code, status.HTTP_200_OK)",
"def test_cr... | [
"0.87322414",
"0.87006867",
"0.8689321",
"0.86811435",
"0.86803985",
"0.8531873",
"0.84982514",
"0.84742093",
"0.83392423",
"0.79925317",
"0.7961978",
"0.78766966",
"0.7868033",
"0.7835669",
"0.7804045",
"0.77614194",
"0.7748596",
"0.77454436",
"0.77368826",
"0.77176225",
"0.... | 0.82065636 | 9 |
Test that a user when supplies invalid credentials token is not created | def test_create_token_invalid_credentials(setup_client):
client = setup_client
payload = {
'email': 'test@gmail.com',
'password': 'testpass',
}
create_user(**payload, **{'role': 'Supplier'})
payload["password"] = "Something else"
res = client.post(TOKEN_URL, payload)
assert "... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_token_invalid_credantials(self):\n create_user(email='test@test1.com', password='testpass')\n payload = {'email': 'test@test2.com', 'password': 'wrong'}\n res = self.client.post(TOKEN_URL, payload)\n\n self.assertNotIn('token', res.data)\n self.assertEquals(res.st... | [
"0.8257808",
"0.8195655",
"0.80803543",
"0.8038532",
"0.80152225",
"0.80055183",
"0.7945737",
"0.7921069",
"0.7912662",
"0.7853528",
"0.7809791",
"0.7639763",
"0.7607157",
"0.7589302",
"0.7584726",
"0.7570403",
"0.7570219",
"0.7569818",
"0.7544183",
"0.7530165",
"0.7471799",
... | 0.7662122 | 11 |
Test that token is not created when there is no user | def test_create_token_no_user_in_database(setup_client):
client = setup_client
payload = {
'email': 'test@gmail.com',
'password': 'testpass',
}
res = client.post(TOKEN_URL, payload)
assert "token" not in res.data
assert res.status_code == status.HTTP_400_BAD_REQUEST | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_token_no_user(self):\n res = self.client.post(TOKEN_URL, self.mock_user)\n\n self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST)\n self.assertNotIn('token', res.data)",
"def test_create_token_no_user(self):\n payload = {'email': 'test1@test.com', 'password':... | [
"0.8515701",
"0.83989817",
"0.8380544",
"0.83048964",
"0.82594067",
"0.8241376",
"0.8202359",
"0.79099673",
"0.7798587",
"0.77823734",
"0.77569425",
"0.7684717",
"0.76623714",
"0.76574594",
"0.7617291",
"0.75941426",
"0.7568244",
"0.75575113",
"0.75458264",
"0.7466553",
"0.74... | 0.78720003 | 8 |
Test token is not created when the password is missing | def test_create_token_missing_field(setup_client):
client = setup_client
res = client.post(TOKEN_URL, {"email": "test@gmail.com"})
assert "token" not in res.data
assert res.status_code == status.HTTP_400_BAD_REQUEST | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_token_with_invalid_password(self):\n payload = {'email': 'test123@mail.com', 'password': ''}\n\n create_user(**payload)\n token = self.client.post(TOKEN_URL, payload)\n\n self.assertEqual(token.status_code, status.HTTP_400_BAD_REQUEST)",
"def test_create_token_invalid_cre... | [
"0.7682041",
"0.7571809",
"0.7536491",
"0.7499466",
"0.7485443",
"0.74748117",
"0.74565387",
"0.745399",
"0.7434687",
"0.7429031",
"0.7417534",
"0.7410483",
"0.7402607",
"0.7375788",
"0.7374388",
"0.73612297",
"0.73594105",
"0.7359254",
"0.7353193",
"0.7350076",
"0.7328687",
... | 0.68093663 | 55 |
Test retrieving profile for logged in user | def test_retrieve_profile_success(setup_client, setup_user):
client = setup_client
user = setup_user
res = client.get(ME_URL)
assert res.status_code == status.HTTP_200_OK
assert res.data == {'name': user.name, 'email': user.email,
'role': 'Supplier'} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_retrieve_profile(self):\n\n response = self.client.get(URL_ME)\n\n self.assertEqual(response.status_code, status.HTTP_200_OK)\n\n # Check that the user object returns as expected. There is no need\n # (and it is not secure) to return a password to client side.\n self.ass... | [
"0.8208589",
"0.807811",
"0.8027141",
"0.8024252",
"0.80075693",
"0.7999291",
"0.7981915",
"0.79818964",
"0.7970111",
"0.795909",
"0.7951995",
"0.79075676",
"0.79026365",
"0.78413916",
"0.7801892",
"0.77627635",
"0.77301943",
"0.77071506",
"0.76768214",
"0.7648913",
"0.758592... | 0.7817132 | 14 |
Reshape groups to correspond to preds and target. | def _groups_format(groups: torch.Tensor) -> torch.Tensor:
return groups.reshape(groups.shape[0], -1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def regroup_dataset(labels):\r\n batch_y = labels.copy()\r\n for i, label in enumerate(labels):\r\n if label in [0, 15, 19]:\r\n batch_y[i]=0\r\n if label in [1, 2, 3, 4, 5,]:\r\n batch_y[i]=1\r\n if label in [... | [
"0.6214245",
"0.6038991",
"0.58977145",
"0.56156784",
"0.5595342",
"0.5534742",
"0.5532647",
"0.5400082",
"0.53650177",
"0.5322542",
"0.52945703",
"0.52931136",
"0.52823704",
"0.5266065",
"0.5263557",
"0.5222995",
"0.5206752",
"0.5202234",
"0.5151183",
"0.5144041",
"0.5139873... | 0.5281119 | 13 |
Compute demographic parity based on the binary stats. | def _compute_binary_demographic_parity(
tp: torch.Tensor, fp: torch.Tensor, tn: torch.Tensor, fn: torch.Tensor
) -> Dict[str, torch.Tensor]:
pos_rates = _safe_divide(tp + fp, tp + fp + tn + fn)
min_pos_rate_id = torch.argmin(pos_rates)
max_pos_rate_id = torch.argmax(pos_rates)
return {
f"DP... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parity(n):\n # bin(n) returns 0b.... \n # bin(n)[2:] trims \"ob\"\n return sum(int(x) for x in bin(n)[2:]) % 2",
"def parity(it):\n \n return sum(it)%2",
"def parity(n):\n if n%2==0:\n p=1\n else:\n p=-1\n return p",
"def parity(p):\n\n f = dict(zip(sorted(p), p))\n ... | [
"0.7187931",
"0.69241786",
"0.6648208",
"0.6545556",
"0.64169145",
"0.6374655",
"0.6301056",
"0.6256405",
"0.62306535",
"0.6174822",
"0.6148865",
"0.6128668",
"0.58308756",
"0.5809784",
"0.58013695",
"0.5790299",
"0.56048834",
"0.5584757",
"0.5532079",
"0.5458318",
"0.544604"... | 0.6273525 | 7 |
r"""`Demographic parity`_ compares the positivity rates between all groups. If more than two groups are present, the disparity between the lowest and highest group is reported. The lowest positivity rate is divided by the highest, so a lower value means more discrimination against the numerator. In the results this is ... | def demographic_parity(
preds: torch.Tensor,
groups: torch.Tensor,
threshold: float = 0.5,
ignore_index: Optional[int] = None,
validate_args: bool = True,
) -> Dict[str, torch.Tensor]:
num_groups = torch.unique(groups).shape[0]
target = torch.zeros(preds.shape)
group_stats = _binary_gro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_disparity(code, k, w=1):\n est_price, shares, value, net_worth, roe, excess_earning = estimate_price(code, k, w)\n cur_price = reader.get_current_price(code)\n\n try:\n disparity = (cur_price / est_price) * 100\n except:\n disparity = None\n return disparity, cur_price, est_pri... | [
"0.554045",
"0.52919245",
"0.5226246",
"0.50096136",
"0.4976829",
"0.49624375",
"0.48357052",
"0.4765742",
"0.47568828",
"0.47441325",
"0.47412166",
"0.46955025",
"0.4657417",
"0.45577863",
"0.45471704",
"0.45434585",
"0.45323294",
"0.45277312",
"0.4504757",
"0.44954553",
"0.... | 0.55969113 | 0 |
Make a zappos dataset class | def make_dataset(condition, root, base_path, files_json_path):
normalize = transforms.Normalize(
mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
dataset = ZapposDataset(root, base_path, files_json_path, condition,
transform=transforms.Compose([
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_dataset(opt):\n\tdata_loader = CustomDatasetDataLoader(opt)\n\tdataset = data_loader.load_data()\n\treturn dataset",
"def __init__(self, dataset: Dataset):\n self.dataset = dataset",
"def create_dataset(opt):\n data_loader = CustomDatasetDataLoader(opt)\n dataset = data_loader.load_data... | [
"0.71085876",
"0.7048227",
"0.70216566",
"0.67754894",
"0.67157274",
"0.66751313",
"0.6652703",
"0.66443014",
"0.6606609",
"0.6605893",
"0.6545907",
"0.65374416",
"0.65353817",
"0.6522868",
"0.6437898",
"0.64139396",
"0.64111483",
"0.63846666",
"0.6376421",
"0.63296235",
"0.6... | 0.69864786 | 3 |
The address this socket is connected to. For TCP streams, this is a tuple of (IP address, port). For UNIX socket streams, this is the path to the socket. | def remote_address(self) -> T_SockAddr:
from anyio._core._sockets import convert_ipv6_sockaddr
return convert_ipv6_sockaddr(self.raw_socket.getpeername()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_address(self):\n \n if self._addr == None:\n return self._socket.getpeername()\n return self._addr",
"def get_address(self):\n \n return tuple('localhost',self._port)",
"def get_address(self):\n \n return tuple('localhost',self._port)",
"def... | [
"0.7438824",
"0.73247105",
"0.73247105",
"0.70936626",
"0.7054064",
"0.7049155",
"0.7041599",
"0.69537586",
"0.68976885",
"0.68746656",
"0.68202794",
"0.67735016",
"0.6748753",
"0.6745112",
"0.67268467",
"0.67204195",
"0.66942865",
"0.6680643",
"0.6656147",
"0.6627671",
"0.65... | 0.67137545 | 16 |
The address this socket is connected to. | def remote_address(self) -> IPSockAddrType:
from anyio._core._sockets import convert_ipv6_sockaddr
return convert_ipv6_sockaddr(self.raw_socket.getpeername()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_address(self):\n \n if self._addr == None:\n return self._socket.getpeername()\n return self._addr",
"def addr(self):\r\n return self._addr",
"def address(self):\n \n return self.__ip",
"def get_address(self):\n \n return self._addr",
"... | [
"0.85109526",
"0.80972004",
"0.79191345",
"0.7725311",
"0.7725311",
"0.7706213",
"0.7631237",
"0.7600099",
"0.7514334",
"0.74700177",
"0.74627995",
"0.74423015",
"0.7425132",
"0.73893356",
"0.73893356",
"0.7376573",
"0.73659176",
"0.73336077",
"0.72922766",
"0.7274585",
"0.72... | 0.7070197 | 35 |
overwrites forward function from "utils.py" specific for an rnn model, as hidden and output values must be tracked. Simply calling model.forward(X) will fail with dropout and linear layers added to recurrent layers | def _forward(self, X):
firstLayer = True
for layer, fcn in self.model.named_children():
if 'recurrent' in layer:
if firstLayer:
Y, hidden = fcn(X)
else:
Y, hidden = fcn(Y)
elif 'dropout' in layer:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward(self, input_var: Tensor, hidden: Optional[HiddenDict] = None, **additional: Dict) -> RecurrentOutput:\n ...",
"def forward(self, x_in):\r\n # x_out = torch.zeros_like(x_in)\r\n\r\n for layer in self.layers: #Call forward function of each layer in order\r\n x_... | [
"0.7339656",
"0.70745814",
"0.7058552",
"0.7038954",
"0.6973463",
"0.6951654",
"0.6931969",
"0.6902181",
"0.6879351",
"0.6875522",
"0.6860826",
"0.68586874",
"0.68329686",
"0.67970353",
"0.67915267",
"0.6788944",
"0.67716974",
"0.6756703",
"0.6735382",
"0.67349607",
"0.672955... | 0.758289 | 0 |
numerically stable log_softmax implementation that prevents overflow | def log_prob_from_logits(x):
axis = len(x.shape) - 1
m = x.max(dim=axis, keepdim=True)[0]
return x - m - torch.log(torch.exp(x - m).sum(dim=axis, keepdim=True)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stablesoftmax(x):\r\n shiftx = x - np.max(x)\r\n exps = np.exp(shiftx)\r\n return exps / np.sum(exps)",
"def log_softmax(input, dim, inplace=False):\n return FunctionLib.apply(\n 'LogSoftmax', input.device, [input],\n outputs=[input if inplace else None], axis=dim)",
"def log_soft... | [
"0.77298",
"0.77168965",
"0.77082556",
"0.76411545",
"0.76040596",
"0.7375868",
"0.7343657",
"0.7335469",
"0.7334381",
"0.7319122",
"0.7316114",
"0.7291785",
"0.72785354",
"0.72421026",
"0.7237872",
"0.7236452",
"0.7203207",
"0.7203207",
"0.7200916",
"0.719867",
"0.7190057",
... | 0.69582486 | 96 |
weight_variable generates a weight variable of a given shape. | def weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.1)
return tf.Variable(initial) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def weight_variable(shape):\n initial = tf.truncated_normal(shape, stddev=0.1)\n return tf.get_variable(\n 'weight', initializer=initial, regularizer=tf.nn.l2_loss)",
"def weight_variable(shape):\n initial = tf.truncated_normal(shape)\n return tf.Variable(initial)",
"def create_weight_variable(shape):... | [
"0.82682097",
"0.8235508",
"0.8158841",
"0.8156995",
"0.81399417",
"0.81399417",
"0.81399417",
"0.8137802",
"0.812119",
"0.80655366",
"0.7983301",
"0.79793143",
"0.79584336",
"0.79206425",
"0.777795",
"0.7553387",
"0.7533732",
"0.75042933",
"0.73055935",
"0.7289978",
"0.72055... | 0.81348443 | 12 |
Construct an empty occupancy grid. | def __init__(self, origin_x=0., origin_y=0., resolution=myRes,
width=30, height=30):
self.origin_x = origin_x
self.origin_y = origin_y
self.resolution = resolution
self.width = width / resolution
self.height = height / resolution
self.grid = 0.5 * np.ones... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_empty_grid(width, height):\n return [[None] * width for _ in range(height)]",
"def __init__(self, grid_height, grid_width):\n self._grid_height = grid_height\n self._grid_width = grid_width\n self._cells = [[EMPTY for dummy_col in range(self._grid_width)]\n ... | [
"0.7382614",
"0.72059935",
"0.6904236",
"0.68017924",
"0.67940444",
"0.678721",
"0.6727695",
"0.66969347",
"0.6674715",
"0.66708755",
"0.6658825",
"0.6632146",
"0.66313326",
"0.661717",
"0.6565707",
"0.65415424",
"0.6514893",
"0.65148395",
"0.6480044",
"0.64799976",
"0.647310... | 0.0 | -1 |
Gets the id of this BundleVersionMetadata. The id of this version of the extension bundle | def id(self):
return self._id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bundle_id(self):\n return self._bundle_id",
"def bundle_id(self) -> str:\n return pulumi.get(self, \"bundle_id\")",
"def bundle_id(self) -> str:\n return pulumi.get(self, \"bundle_id\")",
"def version_id(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"versio... | [
"0.7120391",
"0.70424384",
"0.70424384",
"0.7007643",
"0.6944954",
"0.6914494",
"0.687606",
"0.66998047",
"0.6617725",
"0.6589261",
"0.6538833",
"0.65280694",
"0.648461",
"0.6457281",
"0.6457281",
"0.6457281",
"0.64207727",
"0.64197046",
"0.64197046",
"0.64118147",
"0.6407731... | 0.0 | -1 |
Sets the id of this BundleVersionMetadata. The id of this version of the extension bundle | def id(self, id):
self._id = id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_id(self, id):\n self.data['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\n self.id_ = id_",
"def id(self, _id):\n self.metadata[\"id\"] = _id",
"def set_id(self, id):\n\n\t\tif id is n... | [
"0.6576982",
"0.65335536",
"0.6415786",
"0.6357636",
"0.63565326",
"0.6258344",
"0.6257857",
"0.61367863",
"0.6131152",
"0.6109296",
"0.61040723",
"0.61040723",
"0.61040723",
"0.61040723",
"0.61040723",
"0.61040723",
"0.60897905",
"0.60897905",
"0.60897905",
"0.60897905",
"0.... | 0.0 | -1 |
Gets the bucket_id of this BundleVersionMetadata. The id of the bucket the extension bundle belongs to | def bucket_id(self):
return self._bucket_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bucket_name(self) -> str:\n return self._values.get('bucket_name')",
"def bucket(self) -> \"IBucket\":\n return self._values.get('bucket')",
"def bucket_name(self) -> str:\n return jsii.get(self, \"bucketName\")",
"def bucket_name(self) -> str:\n return jsii.get(self, \"bucket... | [
"0.6582187",
"0.65716374",
"0.6492747",
"0.6492747",
"0.649047",
"0.64158034",
"0.64158034",
"0.63025737",
"0.63025737",
"0.6295716",
"0.62550527",
"0.62049043",
"0.61671174",
"0.6165583",
"0.6150865",
"0.6150865",
"0.61453617",
"0.61453617",
"0.6145263",
"0.61047006",
"0.606... | 0.82620203 | 0 |
Gets the group_id of this BundleVersionMetadata. | def group_id(self):
return self._group_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GroupId(self):\n\t\treturn self._get_attribute('groupId')",
"def group_id(self):\n return self._id",
"def group_identifier(self):\n return self._group_identifier",
"def group_id(self) -> int:\n return self._group_id",
"def group_id(self) -> str:\n return pulumi.get(self, \"g... | [
"0.7758553",
"0.7723982",
"0.7666234",
"0.7615398",
"0.7591658",
"0.7591658",
"0.7533234",
"0.74919957",
"0.741769",
"0.7393036",
"0.7111249",
"0.7107687",
"0.6964118",
"0.6964118",
"0.6964118",
"0.69534075",
"0.69534075",
"0.69534075",
"0.6921472",
"0.686988",
"0.68666196",
... | 0.7808255 | 1 |
Sets the group_id of this BundleVersionMetadata. | def group_id(self, group_id):
self._group_id = group_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_group(self, group: str) -> None:\n self.group = group",
"def set_group(self, group):\n self._group = group",
"def setGroupId(self, groupId):\n internals.blpapi_ServiceRegistrationOptions_setGroupId(\n self.__handle, groupId.encode('utf-8'))\n # NOTE: we should... | [
"0.73525274",
"0.7327102",
"0.7205855",
"0.7085071",
"0.69900453",
"0.68731725",
"0.68365735",
"0.68082154",
"0.67935544",
"0.67935544",
"0.67935544",
"0.6793312",
"0.67711645",
"0.66883427",
"0.65522546",
"0.6487466",
"0.6384826",
"0.6360513",
"0.627717",
"0.62399834",
"0.61... | 0.76808155 | 2 |
Gets the version of this BundleVersionMetadata. The version of the extension bundle | def version(self):
return self._version | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_version(self):\n return self.version",
"def get_version(self):\n return self._version",
"def get_version(self):\n return self._version",
"def get_version(self):\n data = self._get('app_version')\n return data['version']",
"def version(self):\n\n return self... | [
"0.76621723",
"0.7620496",
"0.7620496",
"0.76146567",
"0.7613883",
"0.7581909",
"0.75546396",
"0.7546733",
"0.74946123",
"0.74946123",
"0.74896586",
"0.7465462",
"0.74538153",
"0.7422597",
"0.7409233",
"0.740479",
"0.7383701",
"0.7377193",
"0.7346784",
"0.73283184",
"0.731828... | 0.7108574 | 45 |
Gets the timestamp of this BundleVersionMetadata. The timestamp of the create date of this version | def timestamp(self):
return self._timestamp | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def creation_timestamp(self):\n\n return self.get_signingTime()",
"def creation_timestamp(self):\n\n return self.getThisUpdate()",
"def create_timestamp(self):\n return self._create_ts",
"def creation_timestamp(self) -> str:\n return pulumi.get(self, \"creation_timestamp\")",
"d... | [
"0.7803785",
"0.77930236",
"0.76959574",
"0.7683748",
"0.7683748",
"0.7683748",
"0.7445849",
"0.73648757",
"0.73022527",
"0.72013736",
"0.712413",
"0.70924157",
"0.70520025",
"0.7033243",
"0.7030247",
"0.70198166",
"0.7016662",
"0.70090926",
"0.69851446",
"0.69499886",
"0.691... | 0.6926132 | 25 |
Gets the author of this BundleVersionMetadata. The identity that created this version | def author(self):
return self._author | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def author(self):\n return self._changeset.get('author', None)",
"def get_author(self):\n return self.author",
"def get_author(self):\n return self.author",
"def author(self):\n return self._data.get('author', None)",
"def author(self) -> str:\n return pulumi.get(self, \"... | [
"0.7716698",
"0.756853",
"0.756853",
"0.75560224",
"0.7537357",
"0.7504783",
"0.7504783",
"0.7493765",
"0.74896353",
"0.74642426",
"0.7373546",
"0.7357944",
"0.70853734",
"0.6927217",
"0.6898083",
"0.68740076",
"0.68216866",
"0.6815465",
"0.6724321",
"0.6642525",
"0.65869826"... | 0.7598273 | 2 |
Gets the description of this BundleVersionMetadata. The description for this version | def description(self):
return self._description | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def version_description(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"version_description\")",
"def version_description(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"version_description\")",
"def getVersionInfo(cls):\n\n return __version__ + \"\\n\... | [
"0.7872758",
"0.73547363",
"0.69375986",
"0.69135505",
"0.6883567",
"0.684535",
"0.68289703",
"0.680829",
"0.6791155",
"0.6784457",
"0.67523265",
"0.67376363",
"0.67376363",
"0.67376363",
"0.67376363",
"0.67376363",
"0.67376363",
"0.67376363",
"0.67376363",
"0.67376363",
"0.6... | 0.66209525 | 94 |
Sets the description of this BundleVersionMetadata. The description for this version | def description(self, description):
self._description = description | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_description(self, description):\n self.__description = description",
"def set_description(self, description):\r\n self.__description = description",
"def set_description(self, desc: str) -> None:\n self.metadata.data[\"description\"] = desc",
"def set_description(self, descriptio... | [
"0.72506404",
"0.7244477",
"0.7214894",
"0.7175276",
"0.7162924",
"0.6990073",
"0.6990073",
"0.6990073",
"0.6990073",
"0.6976215",
"0.689171",
"0.689171",
"0.689171",
"0.689171",
"0.68130755",
"0.67479634",
"0.67006844",
"0.66990304",
"0.66787666",
"0.66744757",
"0.6602969",
... | 0.697067 | 31 |
Gets the content_size of this BundleVersionMetadata. The size of the binary content for this version in bytes | def content_size(self):
return self._content_size | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def content_length(self):\n return self._content_length",
"def _getContentSize(self):\n return Size(200, 200)",
"def size_bytes(self) -> int:\n return pulumi.get(self, \"size_bytes\")",
"def get_size(self):\n if self.file_meta[:2] == b'bp':\n file_meta_plist = ccl_bplis... | [
"0.66650385",
"0.6627916",
"0.6482155",
"0.6435267",
"0.6376775",
"0.63500005",
"0.6260639",
"0.6243745",
"0.6243745",
"0.6228458",
"0.6228458",
"0.6228458",
"0.62130034",
"0.62130034",
"0.6202926",
"0.6195624",
"0.61741686",
"0.6172316",
"0.61631334",
"0.6145135",
"0.6123876... | 0.76230836 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.