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 |
|---|---|---|---|---|---|---|
quaternionFromTransform(Transform pT) > Quaternion | def quaternionFromTransform(*args):
return _almathswig.quaternionFromTransform(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fromQuaternion(*q):\n if(len(q) == 1):\n q = q[0]\n if isinstance(q, Quaternion):\n q = q.q # access member of Quaternion\n return Affine3(xform.quaternion_matrix(q))",
"def rotmat2quaternion(rotmat):\n qw = np.sqrt(1.0 + rotmat[0][0] + rotmat[1][1] + rotmat[2][2... | [
"0.7323747",
"0.721703",
"0.71367884",
"0.71367884",
"0.6931126",
"0.6931126",
"0.6900065",
"0.68887776",
"0.68887776",
"0.68466187",
"0.68409187",
"0.68028796",
"0.68028796",
"0.6752351",
"0.6716922",
"0.6716922",
"0.66138446",
"0.65798557",
"0.6570479",
"0.65292984",
"0.652... | 0.8268492 | 0 |
weightedMeanAngle(vectorFloat pAngles, vectorFloat pWeights) > float | def weightedMeanAngle(*args):
return _almathswig.weightedMeanAngle(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def weightedMean(measurements, weights):\n wTotal = np.mean([1/i**2 for i in weights])\n mwTotal = 0\n mean = 0 \n# for i in range(0, len(weights)):\n# wTotal += (1 / weights[i]**2)\n for i in range(0, len(measurements)):\n mwTotal += measurements[i]*(1/weights[i]**2)\n mean = mwTot... | [
"0.72530776",
"0.7205793",
"0.71180934",
"0.7079378",
"0.7055529",
"0.6847183",
"0.6819024",
"0.6716297",
"0.6703674",
"0.6696185",
"0.66786563",
"0.66147673",
"0.65977436",
"0.65226096",
"0.65226096",
"0.6509232",
"0.64842",
"0.63991547",
"0.63890004",
"0.63890004",
"0.63604... | 0.81567335 | 0 |
position6DFromVelocity6D(Velocity6D pVel) > Position6D | def position6DFromVelocity6D(*args):
return _almathswig.position6DFromVelocity6D(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def position6DFromPose2D(*args):\n return _almathswig.position6DFromPose2D(*args)",
"def position6DFromPose2D(*args):\n return _almathswig.position6DFromPose2D(*args)",
"def pose2DFromPosition6D(*args):\n return _almathswig.pose2DFromPosition6D(*args)",
"def pose2DFromPosition6D(*args):\n return _almaths... | [
"0.6978309",
"0.6978309",
"0.69050527",
"0.69050527",
"0.6749299",
"0.6749299",
"0.67090994",
"0.67090994",
"0.6688159",
"0.6688159",
"0.66479105",
"0.66479105",
"0.66266745",
"0.66266745",
"0.6583862",
"0.6583862",
"0.65010655",
"0.65010655",
"0.6455309",
"0.64367366",
"0.64... | 0.8467895 | 0 |
position2DFromPose2DInPlace(Pose2D pPose2D, Position2D pPosition2D) | def position2DFromPose2DInPlace(*args):
return _almathswig.position2DFromPose2DInPlace(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pose2DFromPosition2DInPlace(*args):\n return _almathswig.pose2DFromPosition2DInPlace(*args)",
"def pose2DFromPosition2DInPlace(*args):\n return _almathswig.pose2DFromPosition2DInPlace(*args)",
"def position2DFromPose2D(*args):\n return _almathswig.position2DFromPose2D(*args)",
"def position2DFromPose2... | [
"0.857887",
"0.857887",
"0.80472875",
"0.80472875",
"0.7916925",
"0.7916925",
"0.75959945",
"0.75959945",
"0.7556688",
"0.7556688",
"0.7249768",
"0.7249768",
"0.70777804",
"0.70777804",
"0.6996975",
"0.6996975",
"0.6891579",
"0.6891579",
"0.67252797",
"0.67252797",
"0.6650035... | 0.87488943 | 0 |
position2DFromPose2D(Pose2D pPose2D) > Position2D | def position2DFromPose2D(*args):
return _almathswig.position2DFromPose2D(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def position2DFromPose2DInPlace(*args):\n return _almathswig.position2DFromPose2DInPlace(*args)",
"def position2DFromPose2DInPlace(*args):\n return _almathswig.position2DFromPose2DInPlace(*args)",
"def pose2DFromPosition2D(*args):\n return _almathswig.pose2DFromPosition2D(*args)",
"def pose2DFromPosition2... | [
"0.8255083",
"0.8255083",
"0.81823146",
"0.81823146",
"0.7875365",
"0.7875365",
"0.72034335",
"0.72034335",
"0.7163043",
"0.7163043",
"0.6908066",
"0.6908066",
"0.6881879",
"0.6881879",
"0.6842633",
"0.6842633",
"0.6785842",
"0.6655925",
"0.6655925",
"0.66012186",
"0.65618265... | 0.85883725 | 0 |
position3DFromPosition6D(Position6D pPosition6D) > Position3D | def position3DFromPosition6D(*args):
return _almathswig.position3DFromPosition6D(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def position6DFromPosition3D(*args):\n return _almathswig.position6DFromPosition3D(*args)",
"def position6DFromPosition3D(*args):\n return _almathswig.position6DFromPosition3D(*args)",
"def position6DFromPosition3DInPlace(*args):\n return _almathswig.position6DFromPosition3DInPlace(*args)",
"def position6... | [
"0.8653259",
"0.8653259",
"0.84417444",
"0.84417444",
"0.8209947",
"0.8209947",
"0.70318025",
"0.70318025",
"0.70193475",
"0.70193475",
"0.69869035",
"0.69869035",
"0.6980178",
"0.6980178",
"0.6956017",
"0.6956017",
"0.6872381",
"0.6872381",
"0.6867521",
"0.6867521",
"0.65226... | 0.8842862 | 0 |
position6DFromPose2DInPlace(Pose2D pPose2D, Position6D pPosition6D) | def position6DFromPose2DInPlace(*args):
return _almathswig.position6DFromPose2DInPlace(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pose2DFromPosition6DInPlace(*args):\n return _almathswig.pose2DFromPosition6DInPlace(*args)",
"def pose2DFromPosition6DInPlace(*args):\n return _almathswig.pose2DFromPosition6DInPlace(*args)",
"def position6DFromPose2D(*args):\n return _almathswig.position6DFromPose2D(*args)",
"def position6DFromPose2... | [
"0.85764503",
"0.85764503",
"0.8454752",
"0.8454752",
"0.81843626",
"0.81843626",
"0.7732904",
"0.7732904",
"0.7639392",
"0.7639392",
"0.74323756",
"0.74323756",
"0.73921084",
"0.73921084",
"0.736481",
"0.736481",
"0.71024543",
"0.71024543",
"0.7072298",
"0.7072298",
"0.70527... | 0.88662845 | 0 |
position6DFromPose2D(Pose2D pPose2D) > Position6D | def position6DFromPose2D(*args):
return _almathswig.position6DFromPose2D(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def position6DFromPose2DInPlace(*args):\n return _almathswig.position6DFromPose2DInPlace(*args)",
"def position6DFromPose2DInPlace(*args):\n return _almathswig.position6DFromPose2DInPlace(*args)",
"def pose2DFromPosition6D(*args):\n return _almathswig.pose2DFromPosition6D(*args)",
"def pose2DFromPosition6... | [
"0.8682296",
"0.8682296",
"0.8504991",
"0.8504991",
"0.82593226",
"0.82593226",
"0.75894785",
"0.75894785",
"0.7428744",
"0.7428744",
"0.7301662",
"0.7301662",
"0.7155321",
"0.7155321",
"0.70857275",
"0.70857275",
"0.7066308",
"0.7066308",
"0.70443356",
"0.70443356",
"0.68485... | 0.8956293 | 0 |
position6DFromPosition3DInPlace(Position3D pPosition3D, Position6D pPosition6D) | def position6DFromPosition3DInPlace(*args):
return _almathswig.position6DFromPosition3DInPlace(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def position6DFromPosition3D(*args):\n return _almathswig.position6DFromPosition3D(*args)",
"def position6DFromPosition3D(*args):\n return _almathswig.position6DFromPosition3D(*args)",
"def position3DFromPosition6D(*args):\n return _almathswig.position3DFromPosition6D(*args)",
"def position3DFromPosition6... | [
"0.8367",
"0.8367",
"0.8238513",
"0.8238513",
"0.7742598",
"0.7742598",
"0.7638709",
"0.7638709",
"0.757206",
"0.757206",
"0.73665416",
"0.73665416",
"0.71990573",
"0.71990573",
"0.7191185",
"0.7191185",
"0.70649624",
"0.70649624",
"0.6976739",
"0.6976739",
"0.6931592",
"0.... | 0.8850472 | 0 |
position6DFromPosition3D(Position3D pPosition3D) > Position6D | def position6DFromPosition3D(*args):
return _almathswig.position6DFromPosition3D(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def position3DFromPosition6D(*args):\n return _almathswig.position3DFromPosition6D(*args)",
"def position3DFromPosition6D(*args):\n return _almathswig.position3DFromPosition6D(*args)",
"def position6DFromPosition3DInPlace(*args):\n return _almathswig.position6DFromPosition3DInPlace(*args)",
"def position6... | [
"0.84791666",
"0.84791666",
"0.84233165",
"0.84233165",
"0.7847622",
"0.7847622",
"0.7174401",
"0.7174401",
"0.7153885",
"0.7153885",
"0.71470267",
"0.71470267",
"0.7058832",
"0.7058832",
"0.70585614",
"0.70585614",
"0.69651043",
"0.69651043",
"0.6953484",
"0.6953484",
"0.658... | 0.8709752 | 0 |
pose2DFromPosition6D(Position6D pPosition6D) > Pose2D | def pose2DFromPosition6D(*args):
return _almathswig.pose2DFromPosition6D(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pose2DFromPosition6DInPlace(*args):\n return _almathswig.pose2DFromPosition6DInPlace(*args)",
"def pose2DFromPosition6DInPlace(*args):\n return _almathswig.pose2DFromPosition6DInPlace(*args)",
"def position6DFromPose2D(*args):\n return _almathswig.position6DFromPose2D(*args)",
"def position6DFromPose2... | [
"0.8461436",
"0.8461436",
"0.83855414",
"0.83855414",
"0.82462704",
"0.82462704",
"0.7648655",
"0.7648655",
"0.7315255",
"0.7315255",
"0.7124163",
"0.7124163",
"0.7086061",
"0.7086061",
"0.6889905",
"0.6889905",
"0.6819477",
"0.6819477",
"0.6644293",
"0.6644293",
"0.65778375"... | 0.8669272 | 0 |
pose2DFromPosition2DInPlace(Position2D pPosition2D, float pAngle, Pose2D pPose2D) | def pose2DFromPosition2DInPlace(*args):
return _almathswig.pose2DFromPosition2DInPlace(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def position2DFromPose2DInPlace(*args):\n return _almathswig.position2DFromPose2DInPlace(*args)",
"def position2DFromPose2DInPlace(*args):\n return _almathswig.position2DFromPose2DInPlace(*args)",
"def pose2DFromPosition2D(*args):\n return _almathswig.pose2DFromPosition2D(*args)",
"def pose2DFromPosition2... | [
"0.771101",
"0.771101",
"0.74333787",
"0.74333787",
"0.72723603",
"0.72723603",
"0.7266677",
"0.7266677",
"0.6991305",
"0.6991305",
"0.6838553",
"0.6838553",
"0.6726344",
"0.6726344",
"0.62419665",
"0.62419665",
"0.6138086",
"0.61173666",
"0.60818416",
"0.60818416",
"0.605779... | 0.7878061 | 0 |
quaternionPosition3DFromPosition6D(Position6D pPos6D, Quaternion pQua, Position3D pPos3D) | def quaternionPosition3DFromPosition6D(*args):
return _almathswig.quaternionPosition3DFromPosition6D(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def position3DFromPosition6D(*args):\n return _almathswig.position3DFromPosition6D(*args)",
"def position3DFromPosition6D(*args):\n return _almathswig.position3DFromPosition6D(*args)",
"def position6DFromPosition3D(*args):\n return _almathswig.position6DFromPosition3D(*args)",
"def position6DFromPosition3... | [
"0.7509253",
"0.7509253",
"0.73090744",
"0.73090744",
"0.7016134",
"0.7016134",
"0.63443816",
"0.63443816",
"0.6068397",
"0.6068397",
"0.6020603",
"0.6020603",
"0.5964279",
"0.5856317",
"0.5856317",
"0.5719538",
"0.5719538",
"0.56824404",
"0.5593697",
"0.5593264",
"0.55919504... | 0.87333834 | 0 |
axisRotationProjection(Position3D pAxis, Transform pT) > Transform axisRotationProjection(Position3D pAxis, Rotation pRot) > Rotation | def axisRotationProjection(*args):
return _almathswig.axisRotationProjection(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def axisRotationProjectionInPlace(*args):\n return _almathswig.axisRotationProjectionInPlace(*args)",
"def axisRotationProjectionInPlace(*args):\n return _almathswig.axisRotationProjectionInPlace(*args)",
"def transformFromRotationPosition3D(*args):\n return _almathswig.transformFromRotationPosition3D(*args... | [
"0.780185",
"0.780185",
"0.7328685",
"0.7328685",
"0.71696776",
"0.71003616",
"0.70982546",
"0.70982546",
"0.70754826",
"0.70754826",
"0.7042147",
"0.7042147",
"0.7021881",
"0.69924057",
"0.67725635",
"0.67257565",
"0.6599378",
"0.6598653",
"0.6551753",
"0.653737",
"0.653737"... | 0.81333333 | 0 |
rotationFromAngleDirection(float pAngle, float pX, float pY, float pZ) > Rotation rotationFromAngleDirection(float pTheta, Position3D pPos) > Rotation | def rotationFromAngleDirection(*args):
return _almathswig.rotationFromAngleDirection(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Rotation_fromAngleDirection(*args):\n return _almathswig.Rotation_fromAngleDirection(*args)",
"def Rotation_fromAngleDirection(*args):\n return _almathswig.Rotation_fromAngleDirection(*args)",
"def fromAngleDirection(*args):\n return _almathswig.Rotation_fromAngleDirection(*args)",
"def fromAngl... | [
"0.792951",
"0.792951",
"0.7560504",
"0.7560504",
"0.73144567",
"0.73144567",
"0.7247764",
"0.72127867",
"0.72127867",
"0.71584934",
"0.71584934",
"0.71233726",
"0.70756114",
"0.70373064",
"0.69835985",
"0.6958378",
"0.6958378",
"0.69566435",
"0.69101655",
"0.69101655",
"0.68... | 0.7920331 | 2 |
pose2DFromPosition2D(Position2D pPosition2D, float pAngle = 0.0) > Pose2D pose2DFromPosition2D(Position2D pPosition2D) > Pose2D | def pose2DFromPosition2D(*args):
return _almathswig.pose2DFromPosition2D(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def position2DFromPose2D(*args):\n return _almathswig.position2DFromPose2D(*args)",
"def position2DFromPose2D(*args):\n return _almathswig.position2DFromPose2D(*args)",
"def pose2DFromPosition2DInPlace(*args):\n return _almathswig.pose2DFromPosition2DInPlace(*args)",
"def pose2DFromPosition2DInPlace(*args... | [
"0.73895454",
"0.73895454",
"0.7265447",
"0.7265447",
"0.7024637",
"0.7024637",
"0.6980129",
"0.6980129",
"0.6515449",
"0.6515449",
"0.6510907",
"0.6510907",
"0.62732834",
"0.62732834",
"0.62182474",
"0.6198271",
"0.60454273",
"0.5996234",
"0.5996234",
"0.5973839",
"0.5973839... | 0.77062136 | 0 |
quaternionFromRotation3D(Rotation3D pRot3D, Quaternion pQuaternion) quaternionFromRotation3D(Rotation3D pRot3D) > Quaternion | def quaternionFromRotation3D(*args):
return _almathswig.quaternionFromRotation3D(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rotation3DFromQuaternion(*args):\n return _almathswig.rotation3DFromQuaternion(*args)",
"def rotation3DFromQuaternion(*args):\n return _almathswig.rotation3DFromQuaternion(*args)",
"def fromQuaternion(*q):\n if(len(q) == 1):\n q = q[0]\n if isinstance(q, Quaternion):\n ... | [
"0.8361517",
"0.8361517",
"0.7315388",
"0.726394",
"0.726394",
"0.7253998",
"0.7253998",
"0.70318204",
"0.70318204",
"0.6940712",
"0.6940712",
"0.6882514",
"0.6882514",
"0.68674004",
"0.68674004",
"0.677234",
"0.67512476",
"0.67512476",
"0.6747867",
"0.6747867",
"0.6663994",
... | 0.8623818 | 0 |
rotationFromQuaternion(float pA, float pB, float pC, float pD) > Rotation rotationFromQuaternion(Quaternion pQua, Rotation pRot) rotationFromQuaternion(Quaternion pQua) > Rotation | def rotationFromQuaternion(*args):
return _almathswig.rotationFromQuaternion(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Rotation_fromQuaternion(*args):\n return _almathswig.Rotation_fromQuaternion(*args)",
"def Rotation_fromQuaternion(*args):\n return _almathswig.Rotation_fromQuaternion(*args)",
"def fromQuaternion(*args):\n return _almathswig.Rotation_fromQuaternion(*args)",
"def fromQuaternion(*args):\n ... | [
"0.8421366",
"0.8421366",
"0.80376923",
"0.80376923",
"0.7814966",
"0.7814966",
"0.7643125",
"0.7643125",
"0.7560659",
"0.7560659",
"0.7527854",
"0.7527854",
"0.7385473",
"0.7324791",
"0.7324791",
"0.7269383",
"0.7269383",
"0.72283375",
"0.72283375",
"0.71918786",
"0.71918786... | 0.8429193 | 0 |
rotation3DFromQuaternion(Quaternion pQuaterion, Rotation3D pRot3D) rotation3DFromQuaternion(Quaternion pQuaternion) > Rotation3D | def rotation3DFromQuaternion(*args):
return _almathswig.rotation3DFromQuaternion(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quaternionFromRotation3D(*args):\n return _almathswig.quaternionFromRotation3D(*args)",
"def quaternionFromRotation3D(*args):\n return _almathswig.quaternionFromRotation3D(*args)",
"def rotation3DFromRotation(*args):\n return _almathswig.rotation3DFromRotation(*args)",
"def rotation3DFromRotation(*arg... | [
"0.8256367",
"0.8256367",
"0.7589181",
"0.7589181",
"0.75686353",
"0.75686353",
"0.74144495",
"0.74144495",
"0.7347486",
"0.7347486",
"0.7324813",
"0.7324813",
"0.7319755",
"0.7319755",
"0.7289424",
"0.7147591",
"0.7147591",
"0.70447534",
"0.70447534",
"0.6944077",
"0.6924864... | 0.85490686 | 0 |
String rep of the name of the person contacting us | def __str__(self):
return f"{self.first_name} {self.last_name}" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def showName(self, email, first_name, last_name):\n if first_name and last_name:\n return first_name + ' ' + last_name\n \n name = None\n if first_name:\n name = first_name\n elif last_name:\n name = last_name \n \n if name:\n ... | [
"0.75090724",
"0.7386349",
"0.735461",
"0.7305121",
"0.72646743",
"0.72036016",
"0.7124776",
"0.71082556",
"0.70629054",
"0.7061437",
"0.70524937",
"0.7027782",
"0.7027663",
"0.7022015",
"0.7016779",
"0.6996172",
"0.69940907",
"0.69792",
"0.6964444",
"0.693756",
"0.6931944",
... | 0.0 | -1 |
Retrieve a string representation of the status message | def __str__(self):
return f'{self.researcher} ' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def status_message(self) -> str:\n return pulumi.get(self, \"status_message\")",
"def status_message(self) -> str:\n return pulumi.get(self, \"status_message\")",
"def status_message(self):\n return self.safe_data['status']['message']",
"def detailed_status_message(self) -> str:\n ... | [
"0.8647422",
"0.8647422",
"0.8450309",
"0.81935185",
"0.80048656",
"0.80048656",
"0.799564",
"0.7835075",
"0.75775445",
"0.75317234",
"0.7401921",
"0.7391073",
"0.738007",
"0.7329159",
"0.7218627",
"0.71709657",
"0.71546525",
"0.7134402",
"0.70660585",
"0.7036305",
"0.7021862... | 0.0 | -1 |
Read JSON from the specified filename. | def read_json(json_filename: str) -> JSON:
with open(json_filename, encoding="utf-8") as json_file:
return JSON(json.load(json_file)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_json(self, filename):\n dct = jsonio.read_json(filename)\n self.fromdict(dct)",
"def read_file(filename):\r\n with open(filename) as json_load:\r\n json_data = json.load(json_load)\r\n return json_data",
"def read_json(filename):\n with open(filename) as data_file:\n ... | [
"0.8615825",
"0.8514742",
"0.84254116",
"0.83866143",
"0.836522",
"0.8305213",
"0.82934177",
"0.8260528",
"0.8212709",
"0.81825924",
"0.8145603",
"0.81455636",
"0.8110167",
"0.8052567",
"0.8048169",
"0.8025241",
"0.8012735",
"0.80042076",
"0.80025256",
"0.79495865",
"0.792630... | 0.7840257 | 31 |
Increase alpha according to the number of trained images such that it reaches 1 when a half of args.num_img_iter are used for training. | def update_alpha(self, num_trained_images):
alpha = min(num_trained_images/(self.args.num_img_iter/2), 1)
writer_.add_scalar(tag="alpha", scalar_value=alpha, global_step=self.cur_global_step)
self.g.set_alpha(alpha)
self.d.set_alpha(alpha) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def InitAlpha(*args, **kwargs):\n return _core_.Image_InitAlpha(*args, **kwargs)",
"def establecer_alpha(self, alpha):\n\t\tself.__alpha = alpha",
"def training_step(self, batch: Dict, batch_idx: int):\n self.train_on_batch(batch, batch_idx)\n self.images_shown += len(batch[\"images\"])\n ... | [
"0.58430755",
"0.5841465",
"0.5764597",
"0.55857635",
"0.5571716",
"0.5530026",
"0.55082166",
"0.5482151",
"0.54813015",
"0.54620224",
"0.54429185",
"0.53716606",
"0.536621",
"0.5362823",
"0.5352432",
"0.53186566",
"0.529454",
"0.5288012",
"0.5287148",
"0.5284473",
"0.5251424... | 0.7830762 | 0 |
was_published_recently() returns False for questions whose pub_date is in the future. | def test_was_published_recently_with_future_question(self):
time = timezone.now() + datetime.timedelta(days=30)
future_post = Post(pub_date=time)
self.assertIs(future_post.was_published_recently(), False) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def was_published_recently(self):\n now = timezone.now()\n return now - datetime.timedelta(days=1) <= self.pub_date <= now",
"def was_published_recently(self):\n now = timezone.now()\n return now - datetime.timedelta(days=1) <= self.pub_date <= now",
"def test_was_published_recently... | [
"0.8770315",
"0.8770315",
"0.8535514",
"0.84413534",
"0.84330666",
"0.8416829",
"0.8412571",
"0.8412571",
"0.8412571",
"0.8412571",
"0.8412571",
"0.8404051",
"0.84035766",
"0.8398206",
"0.8395304",
"0.839041",
"0.83801836",
"0.8371903",
"0.8370151",
"0.83586746",
"0.8333628",... | 0.82630765 | 26 |
was_published_recently() returns False for questions whose pub_date is older than 31 days. | def test_was_published_recently_with_old_question(self):
time = timezone.now() - datetime.timedelta(days=31, seconds=1)
old_post = Post(pub_date=time)
self.assertIs(old_post.was_published_recently(), False) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def was_published_recently(self):\n now = timezone.now()\n return now - datetime.timedelta(days=1) <= self.pub_date <= now",
"def was_published_recently(self):\n now = timezone.now()\n return now - datetime.timedelta(days=1) <= self.pub_date <= now",
"def test_was_published_recently... | [
"0.8477623",
"0.8477623",
"0.82749987",
"0.81860095",
"0.8177689",
"0.8160007",
"0.81395656",
"0.8106903",
"0.8098072",
"0.8097128",
"0.8096808",
"0.8092218",
"0.80825174",
"0.80736375",
"0.8070967",
"0.8070967",
"0.80672884",
"0.8066639",
"0.8066639",
"0.8066639",
"0.8062864... | 0.8131044 | 7 |
was_published_recently() returns True for questions whose pub_date is within the last 31 days. | def test_was_published_recently_with_recent_question(self):
time = timezone.now() - datetime.timedelta(hours=23, minutes=59, seconds=59)
recent_question = Post(pub_date=time)
self.assertIs(recent_post.was_published_recently(), True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def was_published_recently(self):\n now = timezone.now()\n return now - datetime.timedelta(days=1) <= self.pub_date <= now",
"def was_published_recently(self):\n now = timezone.now()\n return now - datetime.timedelta(days=1) <= self.pub_date <= now",
"def test_was_published_recently... | [
"0.8527435",
"0.8527435",
"0.8197362",
"0.8126755",
"0.81123585",
"0.81099343",
"0.80667794",
"0.80541605",
"0.80541605",
"0.80528843",
"0.79952824",
"0.7989453",
"0.7949184",
"0.7943692",
"0.794165",
"0.794084",
"0.7936622",
"0.7934415",
"0.7926073",
"0.79156196",
"0.7915619... | 0.79495686 | 12 |
Get the anonymous user. Note that is the actual user object with username specified in setting ANONYMOUS_USER_NAME or id specified in setting ANONYMOUS_USER_ID. The later setting has precedence. Store the computed value into global variable get_anonymous_user() to avoid querying the database every time, unless the cach... | def get_anonymous_user(cache=True) -> User:
global ANONYMOUS_USER
if ANONYMOUS_USER is None or not cache:
ANONYMOUS_USER = get_user_model().objects.get(
username=settings.ANONYMOUS_USER_NAME
)
return ANONYMOUS_USER | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user(self):\n user = AnonymousUser()\n memberid = self.saved_data.get('memberid', None)\n email = self.saved_data.get('email', None)\n\n if memberid: # memberid takes priority over email\n membership = Membership.objects.first(member_number=memberid)\n if ... | [
"0.72474605",
"0.7157611",
"0.7088106",
"0.69293076",
"0.6586783",
"0.6517144",
"0.6438599",
"0.6382783",
"0.6323182",
"0.630855",
"0.62770694",
"0.62566835",
"0.6230793",
"0.6228067",
"0.61906934",
"0.618794",
"0.61292756",
"0.608241",
"0.6057875",
"0.60461354",
"0.60310835"... | 0.85015464 | 0 |
Iterate through permission in increasing order. When iterating over permission instance the permissions included in the current one (including permission itself) are returned (in increasing order). The permission Permission.NONE is excluded from the listing. | def __iter__(self):
for permission in Permission:
if 0 < permission.value <= self.value:
yield permission | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __reversed__(self):\n for permission in reversed(Permission):\n if 0 < permission.value <= self.value:\n yield permission",
"def permissions(self) -> PermissionList:\n return list(self.permission)",
"def listPermissions(self, request):\n pass",
"def get_permissi... | [
"0.67060405",
"0.6574921",
"0.62986815",
"0.6231551",
"0.6210583",
"0.6210583",
"0.6210583",
"0.614035",
"0.6085798",
"0.6085798",
"0.6050272",
"0.604695",
"0.60412043",
"0.6027674",
"0.60257375",
"0.6019614",
"0.60017914",
"0.5957967",
"0.5927061",
"0.5927061",
"0.5927061",
... | 0.70841944 | 0 |
Iterate through permissions in decreasing order. When iterating over permission instance the permissions included in the current one (including permission itself) are returned (in decreasing order). The permission Permission.NONE is excluded from the listing. | def __reversed__(self):
for permission in reversed(Permission):
if 0 < permission.value <= self.value:
yield permission | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __iter__(self):\n for permission in Permission:\n if 0 < permission.value <= self.value:\n yield permission",
"def permissions(self) -> PermissionList:\n return list(self.permission)",
"def get_permissions(self) -> List[Type[BasePermission]]:\n return [NoRestr... | [
"0.70022476",
"0.6700476",
"0.6509354",
"0.6509354",
"0.6509354",
"0.6478893",
"0.6439091",
"0.641842",
"0.625426",
"0.62518597",
"0.6238079",
"0.62009543",
"0.6182575",
"0.6171407",
"0.6167714",
"0.61317956",
"0.61240697",
"0.6107772",
"0.6087817",
"0.6059331",
"0.6059331",
... | 0.7117426 | 0 |
Get the string representation of the permission. This is used in serialization so it must be equal to 'view', 'edit', 'share' and 'owner'. | def __str__(self) -> str:
return self.name.lower() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self) -> str:\n return (\n f\"PermissionModel({self.id}, {Permission(self.permission)}, \"\n f\"user: {self.user}, group: {self.group})\"\n )",
"def __repr__(self):\n return f'<{self.__class__.__name__} owner = {self.owner}, permissions = {int.__repr__(self... | [
"0.77015096",
"0.72569835",
"0.71237916",
"0.7122277",
"0.68828",
"0.6582116",
"0.65819544",
"0.65529734",
"0.644878",
"0.63179845",
"0.6246729",
"0.6224186",
"0.62136537",
"0.6205958",
"0.61842376",
"0.61174023",
"0.6072628",
"0.6071512",
"0.60671973",
"0.5987712",
"0.596561... | 0.0 | -1 |
Return the permission objects associated with this instance. | def permissions(self) -> PermissionList:
return list(self.permission) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_permissions(self):\n return [permission() for permission in self.permissions.get(self.action, self.permission_classes)]",
"def get_permissions(self):\n return [permission() for permission in self.permission_classes]",
"def permission_resources(self):\n return self._permission_resou... | [
"0.82903963",
"0.8275844",
"0.80953866",
"0.80953866",
"0.80953866",
"0.80953866",
"0.8089336",
"0.80245984",
"0.8014024",
"0.7982141",
"0.7930517",
"0.7918419",
"0.7890127",
"0.78806245",
"0.7862186",
"0.78590536",
"0.7832856",
"0.7827151",
"0.7826815",
"0.7815346",
"0.78117... | 0.8296335 | 0 |
Get the string representation used for debugging. | def __str__(self) -> str:
return (
f"PermissionModel({self.id}, {Permission(self.permission)}, "
f"user: {self.user}, group: {self.group})"
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __repr__(self) -> str:\n\n return self.debug()",
"def __str__(self) -> str:\n return self._repr(verbose=False)",
"def to_string(self):\r\n return self.__str__()",
"def to_str(self):\n return pformat(self.to_dict())",
"def to_str(self):\n return pformat(self.to_dict())... | [
"0.75737184",
"0.7245241",
"0.72327316",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.7231",
"0.72... | 0.0 | -1 |
Return the string representation used for debugging purposes. | def __str__(self) -> str:
return f"PermissionGroup({self.id}, {self.permissions.all()})" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __repr__(self) -> str:\n\n return self.debug()",
"def __str__(self) -> str:\n return self._repr(verbose=False)",
"def __str__(self):\n str_rep = str(self.__class__.__name__) + \":\\n\"\n str_rep += \"\\tVertices: \" + str(self.get_vertices()) + \"\\n\"\n str_rep += \"\\tE... | [
"0.78759193",
"0.76496357",
"0.7542528",
"0.74485505",
"0.7420286",
"0.740534",
"0.740534",
"0.740534",
"0.740534",
"0.740534",
"0.740534",
"0.740534",
"0.740534",
"0.740534",
"0.740534",
"0.740534",
"0.740534",
"0.740534",
"0.740534",
"0.740534",
"0.740534",
"0.740534",
... | 0.0 | -1 |
Get a list of users with at least this permission level. Calling this with Permission.NONE will return users for whom an explicit PermissionModel with Permission.NONE exists. | def users_with_permission(
self, permission: Permission, with_superusers=False
) -> List[User]:
filtered_permissions = self.permissions.filter(value__gte=permission)
filter = models.Q(
groups__in=filtered_permissions.values_list("group", flat=True)
) | models.Q(pk__in=fil... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_users_by_permission(self):\n permissions = []\n required = self.permission_required\n if isinstance(required, str):\n required = [required]\n for perm_required in required:\n app_label, codename = perm_required.split(\".\")\n perm = Permission.ob... | [
"0.7252754",
"0.643308",
"0.6362189",
"0.62014824",
"0.6104484",
"0.5932746",
"0.59242177",
"0.58395284",
"0.58048517",
"0.57590866",
"0.575044",
"0.5738517",
"0.5715152",
"0.5683905",
"0.5630985",
"0.5619467",
"0.55604446",
"0.5556519",
"0.55444866",
"0.5533592",
"0.5502845"... | 0.6873062 | 1 |
Get a list of groups with at least this permission level. Calling this with Permission.NONE will return groups for which an explicit PermissionModel with Permission.NONE exists. | def groups_with_permission(self, permission: Permission) -> List[Group]:
filtered_permissions = self.permissions.filter(value__gte=permission)
filter = models.Q(pk__in=filtered_permissions.values_list("group", flat=True))
return list(Group.objects.filter(filter).distinct()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def groups_with_permission(self, permission: Permission) -> List[Group]:\n return self.permission_group.groups_with_permission(permission)",
"def groups(self):\n # pylint: disable=singleton-comparison\n group_aces = self.AccessControlEntry.query.filter(\n not_(self.AccessControlEn... | [
"0.66414016",
"0.64703876",
"0.62534034",
"0.622974",
"0.6166367",
"0.61483127",
"0.60522926",
"0.60107857",
"0.58900344",
"0.58519125",
"0.5844797",
"0.5819575",
"0.58144575",
"0.577742",
"0.5701989",
"0.56979436",
"0.56979436",
"0.56979436",
"0.56979436",
"0.5693542",
"0.56... | 0.72226495 | 0 |
Check if user has the given permission on the current object. | def has_permission(self, permission: Permission, user: User):
return (
self._meta.model.objects.filter(pk=self.pk)
.filter_for_user(user, permission)
.exists()
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_object_permission(self, request, view, obj):\n return request.user.is_authenticated and obj and obj.get_membership(request.user)",
"def has_object_permission(self, request, view, obj) -> bool:\n\n return obj.user == request.user",
"def has_permission(self):\n perms = self.get_permi... | [
"0.8203251",
"0.8174975",
"0.81608427",
"0.8129",
"0.81152374",
"0.8113052",
"0.80868685",
"0.80868685",
"0.80868685",
"0.80672604",
"0.8065266",
"0.8063667",
"0.8063667",
"0.8049483",
"0.8037719",
"0.8022772",
"0.80152184",
"0.80139965",
"0.80001503",
"0.79914576",
"0.799041... | 0.8262567 | 0 |
Set permission on this instance. It performs additional check if permissions can be set on this object. | def set_permission(self, permission: Permission, user_or_group: UserOrGroup):
if self.in_container():
raise RuntimeError(
f"The permissions can not be set on object {self} ({self._meta.label}) in container."
)
pre_permission_changed.send(sender=type(self), instan... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_permission(self, permission: Permission, user_or_group: UserOrGroup):\n from resolwe.permissions.utils import get_identity # Circular import\n\n entity, entity_name = get_identity(user_or_group)\n self.permissions.update_or_create(\n **{\"permission_group\": self, entity_na... | [
"0.70601946",
"0.70307326",
"0.69918644",
"0.6985554",
"0.6927691",
"0.67938447",
"0.6712553",
"0.670132",
"0.65940475",
"0.64526284",
"0.6439673",
"0.63935655",
"0.6383361",
"0.6345909",
"0.6323235",
"0.6320116",
"0.62576073",
"0.6248514",
"0.6235441",
"0.6185888",
"0.617347... | 0.754364 | 0 |
Get a list of all permissions on the object. The Permission.NONE is excluded from list. | def get_permissions(self, user_or_group: UserOrGroup) -> PermissionList:
permission = self.get_permission(user_or_group)
if permission:
return list(permission)
else:
return [] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def permissions_list_all(self, **kwargs):\n return self.call_api_get(\"permissions.listAll\", kwargs=kwargs)",
"def permissions(self) -> PermissionList:\n return list(self.permission)",
"def permissions_list_all(self, **kwargs):\n return self.__call_api_get('permissions.listAll', kwargs=kw... | [
"0.787937",
"0.78725976",
"0.78353",
"0.7654639",
"0.75473416",
"0.75473416",
"0.75473416",
"0.7530074",
"0.7509451",
"0.7490456",
"0.74166787",
"0.7408014",
"0.73860943",
"0.73126304",
"0.73064935",
"0.725482",
"0.72511774",
"0.72207487",
"0.7185156",
"0.71801674",
"0.717153... | 0.7126331 | 21 |
Get a list of users with at least this permission level. Calling this with Permission.NONE will return users for whom an explicit PermissionModel with Permission.NONE exists. | def users_with_permission(
self, permission: Permission, with_superusers=False
) -> List[User]:
return self.permission_group.users_with_permission(permission, with_superusers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_users_by_permission(self):\n permissions = []\n required = self.permission_required\n if isinstance(required, str):\n required = [required]\n for perm_required in required:\n app_label, codename = perm_required.split(\".\")\n perm = Permission.ob... | [
"0.7253497",
"0.6872799",
"0.6432671",
"0.6200675",
"0.61026293",
"0.593182",
"0.592187",
"0.5836472",
"0.5803184",
"0.5758388",
"0.5748763",
"0.5736366",
"0.5713459",
"0.5682224",
"0.5629944",
"0.56175315",
"0.5558221",
"0.55550003",
"0.5543001",
"0.5531944",
"0.5500856",
... | 0.63616395 | 3 |
Get a list of groups with at least this permission level. Calling this with Permission.NONE will return groups for which an explicit PermissionModel with Permission.NONE exists. | def groups_with_permission(self, permission: Permission) -> List[Group]:
return self.permission_group.groups_with_permission(permission) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def groups_with_permission(self, permission: Permission) -> List[Group]:\n filtered_permissions = self.permissions.filter(value__gte=permission)\n filter = models.Q(pk__in=filtered_permissions.values_list(\"group\", flat=True))\n return list(Group.objects.filter(filter).distinct())",
"def gr... | [
"0.72239405",
"0.64709914",
"0.62536955",
"0.62303513",
"0.61657685",
"0.6149431",
"0.60528916",
"0.60104716",
"0.589063",
"0.5852486",
"0.584536",
"0.5820407",
"0.5816717",
"0.5776217",
"0.5702016",
"0.569853",
"0.569853",
"0.569853",
"0.569853",
"0.5694168",
"0.5694106",
... | 0.6643215 | 1 |
Get list of valid alarm class names | def get_alarm_class_list() :
return(AlarmClass._member_names_) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_category_list() : \n return(AlarmCategory._member_names_)",
"def choices() -> List[str]:\n members = inspect.getmembers(sys.modules[__name__])\n clsses = [name for name, obj in members if inspect.isclass(obj)]\n return clsses",
"def get_priority_list() : \n return(AlarmPriority._mem... | [
"0.64568716",
"0.6219957",
"0.61899644",
"0.60364515",
"0.58913237",
"0.5876414",
"0.5831286",
"0.5826427",
"0.5687363",
"0.5662887",
"0.5645889",
"0.5584299",
"0.5522597",
"0.55209595",
"0.5493896",
"0.54931563",
"0.5486178",
"0.544943",
"0.544675",
"0.54272556",
"0.5419881"... | 0.8281164 | 0 |
Create a JAWSProducer instance | def __init__(self,topic,name) :
super(JAWSProducer,self).__init__(topic)
topic = self.topic
topic_config = self.avro_serdes[topic]
avro_serde = topic_config['serde']
if (topic_config['serializer'] == None) :
topic_config['serializer'] = \
av... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_producer():\n producer = KafkaProducer(bootstrap_servers=KAFKA_SERVER,\n api_version=KAFKA_API_VERSION,\n value_serializer=lambda v: json.dumps(v).encode('utf-8'),\n key_serializer=lambda v: json.dumps(v).encode('utf-8'... | [
"0.6825696",
"0.6281642",
"0.62331295",
"0.6161064",
"0.61557686",
"0.60729545",
"0.5956039",
"0.56712955",
"0.5634291",
"0.5604048",
"0.5561112",
"0.54478884",
"0.539555",
"0.53655666",
"0.53579503",
"0.53510255",
"0.533061",
"0.533061",
"0.526836",
"0.52572644",
"0.5244436"... | 0.707126 | 0 |
Constructs a environment for observations and actions from a KeyBoard. | def __init__(self, keymap_path):
self._pressed_keys = set()
self._keymap = self._parse_keymap(self._read_keymap(keymap_path))
# We don't want to hog demo frames if threads thrash, so we only dedicate 1 to writing.
self._demo_queue = thread_pool.ThreadPool(1)
self._default_action = 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_env(cfg):\n if cfg.env == 'ball_in_cup_catch':\n domain_name = 'ball_in_cup'\n task_name = 'catch'\n else:\n domain_name = cfg.env.split('_')[0]\n task_name = '_'.join(cfg.env.split('_')[1:])\n\n env = dmc2gym.make(domain_name=domain_name,\n task_... | [
"0.65109223",
"0.63362193",
"0.61922723",
"0.6108308",
"0.59489965",
"0.5945564",
"0.5942718",
"0.5914854",
"0.5914854",
"0.5851422",
"0.5820872",
"0.57982224",
"0.5788122",
"0.5778367",
"0.5755381",
"0.57082874",
"0.5685856",
"0.5663698",
"0.5651615",
"0.5616251",
"0.5610218... | 0.5511299 | 24 |
Computes the euclidean distance between two states | def distance(x1, x2):
return np.linalg.norm(np.array(x1) - np.array(x2)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _dist_between_group(self, state1, state2):\n c1 = self._center(state1)\n c2 = self._center(state2)\n return np.linalg.norm(c1 - c2)",
"def coord_distance(coordinates, state1, state2):\n distsqs = ((state1(coordinate) - state2(coordinate)).real**2 for\n coordinate in coor... | [
"0.73481196",
"0.72529066",
"0.71830463",
"0.7113428",
"0.6928404",
"0.68718183",
"0.6839538",
"0.6836144",
"0.6828822",
"0.68107533",
"0.6802355",
"0.6797243",
"0.67909104",
"0.67879647",
"0.6782961",
"0.6765092",
"0.6764842",
"0.67636126",
"0.67592466",
"0.67588747",
"0.674... | 0.655862 | 44 |
Nondifferentiable Intersection over Union (IoU) for comparing the similarity of two batch of data, usually be used for evaluating binary image segmentation. The coefficient between 0 to 1, and 1 means totally match. | def iou_coe(output, target, threshold=0.5, axis=(0, 1, 2), smooth=1e-5):
pre = tf.cast(output > threshold, dtype=tf.float32)
truth = tf.cast(target > threshold, dtype=tf.float32)
inse = tf.reduce_sum(tf.multiply(pre, truth), axis=axis) # AND
union = tf.reduce_sum(tf.cast(tf.add(pre, truth) >= 1, dtype=... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def IoU(bb1, bb2):\n I = intersection(bb1, bb2)\n U = union(bb1, bb2)\n return I/U",
"def simple_IOU(binary_image_1, binary_image_2):\n try:\n intersection = np.sum(binary_image_1 * binary_image_2)\n union = np.sum((binary_image_1 + binary_image_2).clip(max=1))\n except:\n plt... | [
"0.7443864",
"0.72667116",
"0.68768644",
"0.6826223",
"0.67956024",
"0.6710995",
"0.6699552",
"0.6657861",
"0.6638642",
"0.6631531",
"0.6615862",
"0.65989673",
"0.65828043",
"0.6568615",
"0.65629286",
"0.6555721",
"0.6493019",
"0.6489633",
"0.64889014",
"0.64750284",
"0.64715... | 0.0 | -1 |
The Unique Identifier that represents this Subject in the datastore. Read only. | def uid(self):
return self._uid | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unique_id(self):\n return self._unique_id",
"def unique_id(self):\n return self._unique_id",
"def unique_id(self):\n return self._unique_id",
"def unique_id(self):\n return self._unique_id",
"def unique_id(self):\n return self._unique_id",
"def unique_id(self):\n ... | [
"0.8024792",
"0.8024792",
"0.8024792",
"0.8024792",
"0.8024792",
"0.8024792",
"0.8024792",
"0.8024792",
"0.8024792",
"0.8024792",
"0.8024792",
"0.8024792",
"0.8024792",
"0.8024792",
"0.8024792",
"0.8024792",
"0.8024266",
"0.8004764",
"0.8004764",
"0.7962729",
"0.7962729",
"... | 0.0 | -1 |
Initializes a TeekoPlayer object by randomly selecting red or black as its piece color. | def __init__(self):
self.my_piece = random.choice(self.pieces)
self.opp = self.pieces[0] if self.my_piece == self.pieces[1] else self.pieces[1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, width, height, relevant_colors):\n self.color = relevant_colors[random.randint(0, len(relevant_colors)-1)]\n self.x = random.randint(0, width)\n self.y = random.randint(0, height)\n self.width = random.randint(0, width//2)\n self.height = random.randint(0, heig... | [
"0.69260824",
"0.6758045",
"0.6712156",
"0.6663019",
"0.6374335",
"0.63048446",
"0.62807655",
"0.62239164",
"0.62088895",
"0.6203389",
"0.6166591",
"0.61016625",
"0.60810995",
"0.6069528",
"0.60549855",
"0.6037725",
"0.602735",
"0.60242045",
"0.6020874",
"0.6018699",
"0.60088... | 0.6193769 | 11 |
Test temperaturebased lapse rate when there's only a single temperature level available. Will throw warning because stupid test file doesn't have units. Only pressure_0m and temperature_80m are available from this file | def test_t_lapse_rate():
h5 = os.path.join(TESTDATADIR, 'wtk/ri_wtk_2012_incomplete_1.h5')
with pytest.warns(ResourceWarning):
with WindResource(h5, use_lapse_rate=True) as wind:
assert (wind['temperature_90m'] < wind['temperature_80m']).all()
assert (wind['temperature_80m'] == w... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testtemperature(self) -> None:\r\n assert 298.15 == self.data.temperature",
"def testtemperature(self) -> None:\r\n assert round(abs(298.15 - self.data.temperature), 7) == 0",
"def testtemperature(self) -> None:\r\n assert round(abs(298.15 - self.data.temperature), 7) == 0",
"def tes... | [
"0.6740751",
"0.67063624",
"0.67063624",
"0.67063624",
"0.67063624",
"0.670447",
"0.65477866",
"0.65047574",
"0.6379682",
"0.63581014",
"0.63420016",
"0.6334742",
"0.63297814",
"0.628693",
"0.62852764",
"0.6211747",
"0.6138704",
"0.6138704",
"0.6132535",
"0.61115414",
"0.6110... | 0.67433023 | 0 |
Return a string representation of the list. | def __str__(self):
outstr = ""
node = self.head.next
while node and node!=self.tail:
outstr = outstr + '(' + str(node.element) +")"+ "\n"
node = node.next
return outstr | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return (str([str(item) for item in self.list]))",
"def __str__(self):\r\n return ' '.join('[{0}]'.format(str(elem)) if isinstance(elem, list)\r\n else elem for elem in self)",
"def listToStr(self):\r\n string = \"\"\r\n for i in self.tape:... | [
"0.86208683",
"0.77787024",
"0.7776714",
"0.77720386",
"0.7719058",
"0.77155036",
"0.771274",
"0.76702017",
"0.76259136",
"0.7594793",
"0.75636023",
"0.75588167",
"0.7524843",
"0.7459642",
"0.7450397",
"0.7436194",
"0.73922116",
"0.7385541",
"0.7315847",
"0.731485",
"0.731442... | 0.65801364 | 99 |
Parses datetime from string | def parse_datetime(s: str) -> datetime:
DATETIME_FORMAT = r"%d/%m/%Y %H:%M"
return datetime.strptime(s, DATETIME_FORMAT) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_datetime_string(input):\n result = parser.parse(input)\n return result",
"def parse_datetime(date_str):\n return datetime.strptime(date_str, '%Y-%m-%d %H:%M')",
"def parse_todoist_datetime(timestring):\n dt = parser.isoparse(timestring)\n return dt",
"def parse_date(string):\n if ... | [
"0.83610106",
"0.81212115",
"0.7945236",
"0.7587595",
"0.75598854",
"0.7538463",
"0.7537546",
"0.74680907",
"0.7466244",
"0.74627835",
"0.7460414",
"0.7447246",
"0.7446976",
"0.7410418",
"0.73845714",
"0.7376551",
"0.73452127",
"0.7330114",
"0.73234546",
"0.7314164",
"0.73089... | 0.8198231 | 1 |
Parses lap time in milliseconds from string | def parse_lap_time(s: str) -> int:
LAP_TIME_PATTERN = r"(\d+):(\d{2})\.(\d{3})"
matches = re.fullmatch(LAP_TIME_PATTERN, s).groups()
minutes, seconds, millis = tuple(map(int, matches))
return (minutes * 60 + seconds) * 1000 + millis | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_time(val):\n assert(val[-2:] == 'ms')\n return (float(val[:-2]) / 1000.0)",
"def _parse_time_string(time_string):\n # make commas and colons the same symbol and split\n hours, minutes, seconds, frames = time_string.replace(',', ':').split(':')\n return (float(hours) * 60 * 60 +\n ... | [
"0.76943433",
"0.7261362",
"0.6913321",
"0.6761492",
"0.6734474",
"0.66267234",
"0.65827745",
"0.658215",
"0.656449",
"0.6537624",
"0.65021193",
"0.6430645",
"0.6332907",
"0.6294587",
"0.62842995",
"0.6254076",
"0.622215",
"0.6213387",
"0.61884874",
"0.6182986",
"0.6159819",
... | 0.78231627 | 0 |
Convert the Rule object to a JSON string. | def to_json(self):
return json.dumps(self.to_json_dict()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_json(self):\n json_dict = self._asdict()\n rules = json_dict[\"inbound_rules\"]\n json_dict[\"inbound_rules\"] = [rule.to_json_dict() for rule in rules]\n rules = json_dict[\"outbound_rules\"]\n json_dict[\"outbound_rules\"] = [rule.to_json_dict() for rule in rules]\n ... | [
"0.7737996",
"0.6840653",
"0.67496866",
"0.6683834",
"0.6630696",
"0.6630696",
"0.6630696",
"0.6630696",
"0.6630696",
"0.66138154",
"0.66138154",
"0.66138154",
"0.66138154",
"0.66138154",
"0.66138154",
"0.66138154",
"0.66138154",
"0.66138154",
"0.6583647",
"0.6539464",
"0.651... | 0.6413899 | 27 |
Convert the Rules object to a JSON string. | def to_json(self):
json_dict = self._asdict()
rules = json_dict["inbound_rules"]
json_dict["inbound_rules"] = [rule.to_json_dict() for rule in rules]
rules = json_dict["outbound_rules"]
json_dict["outbound_rules"] = [rule.to_json_dict() for rule in rules]
return json.dump... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n\n # Start by building the canonical strings for the rules\n out_rules = {}\n for key, value in self.items():\n # Use empty string for singleton TrueCheck instances\n if isinstance(value, TrueCheck):\n out_rules[key] = ''\n el... | [
"0.7310175",
"0.7000487",
"0.66453993",
"0.63944",
"0.63944",
"0.63944",
"0.63944",
"0.63944",
"0.63763505",
"0.6360691",
"0.6308707",
"0.62807375",
"0.6269601",
"0.6253727",
"0.62456673",
"0.62456673",
"0.62456673",
"0.62456673",
"0.62456673",
"0.62456673",
"0.62456673",
"... | 0.82593673 | 0 |
Convert the BGPPeer to a JSON string. | def to_json(self):
json_dict = {"ip": str(self.ip), "as_num": self.as_num}
return json.dumps(json_dict) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_json(self):\n data = self.to_dict()\n data_str = json.dumps(data)\n return data_str",
"def toJsonString(self):\n return json.dumps(self, cls=ProtocolElementEncoder)",
"def to_json(self) -> str:\n return json.dumps(self.to_object(), ensure_ascii=False)",
"def to_json(... | [
"0.7182713",
"0.7138841",
"0.7129153",
"0.6968985",
"0.6968985",
"0.6968985",
"0.6968985",
"0.6968985",
"0.6968985",
"0.6968985",
"0.6968985",
"0.6968985",
"0.68588907",
"0.6850081",
"0.6846174",
"0.68384886",
"0.68258685",
"0.6759035",
"0.6759035",
"0.6759035",
"0.6759035",
... | 0.64634514 | 66 |
Get the configuration for the given pool. | def get_ip_pool_config(self, version, pool):
assert version in ("v4", "v6")
assert isinstance(pool, IPNetwork)
# Normalize to CIDR format (i.e. 10.1.1.1/8 goes to 10.0.0.0/8)
pool = pool.cidr
key = IP_POOL_KEY % {"version": version,
"pool": str(pool... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def config(self) -> pulumi.Output['outputs.VMwareNodePoolConfig']:\n return pulumi.get(self, \"config\")",
"def config(self) -> Optional[pulumi.Input['VMwareNodePoolConfigArgs']]:\n return pulumi.get(self, \"config\")",
"def config(self) -> pulumi.Input['VMwareNodePoolConfigArgs']:\n retur... | [
"0.6850798",
"0.68318826",
"0.6756132",
"0.6589446",
"0.65506667",
"0.6528294",
"0.6528294",
"0.65010136",
"0.6488435",
"0.6484415",
"0.6438396",
"0.6369764",
"0.6365806",
"0.6350399",
"0.6324933",
"0.62881774",
"0.62689525",
"0.62686",
"0.62686",
"0.62686",
"0.62686",
"0.6... | 0.7320331 | 0 |
Get a Profile object representing the named profile from the data store. | def get_profile(self, name):
profile_path = PROFILE_PATH % {"profile_id": name}
try:
_ = self.etcd_client.read(profile_path)
profile = Profile(name)
except EtcdKeyNotFound:
raise KeyError("%s is not a configured profile." % name)
tags_path = TAGS_PATH... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_profile():\n return Profile.get_profile()",
"def get_profile(name, *, unicodedata=None):\n profile = name.lower().replace(':', '_')\n return _PROFILES[profile](_unicode.UnicodeData(unicodedata))",
"def get_profile(self, request=None):\n if not request:\n request = get_current... | [
"0.7587098",
"0.7407545",
"0.7352445",
"0.73490757",
"0.73483986",
"0.72879225",
"0.7226844",
"0.7199869",
"0.71616685",
"0.7032089",
"0.69268185",
"0.6890995",
"0.6890995",
"0.67826134",
"0.67645574",
"0.6758617",
"0.6686533",
"0.66719604",
"0.66629505",
"0.6647076",
"0.6618... | 0.78133607 | 0 |
Set whether the BGP node mesh is enabled or not. | def set_bgp_node_mesh(self, enable):
node_mesh = {"enabled": enable}
self.etcd_client.write(BGP_NODE_MESH_PATH, json.dumps(node_mesh)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_enabled(self, *, enabled: bool = True) -> None:\n lib.wlr_scene_node_set_enabled(self._ptr, enabled)",
"def get_bgp_node_mesh(self):\n try:\n node_mesh = json.loads(\n self.etcd_client.read(BGP_NODE_MESH_PATH).value)\n except EtcdKeyNotFound:\... | [
"0.671508",
"0.6412763",
"0.58220625",
"0.58220625",
"0.5713355",
"0.5698929",
"0.56924385",
"0.56393784",
"0.55572206",
"0.5461466",
"0.54526967",
"0.5445294",
"0.52327454",
"0.51806045",
"0.5173195",
"0.51699996",
"0.51699996",
"0.51699996",
"0.51699996",
"0.5162785",
"0.51... | 0.77623695 | 0 |
Determine whether the BGP node mesh is enabled or not. | def get_bgp_node_mesh(self):
try:
node_mesh = json.loads(
self.etcd_client.read(BGP_NODE_MESH_PATH).value)
except EtcdKeyNotFound:
enabled = True
else:
enabled = node_mesh["enabled"]
return enabled | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_bgp_enabled(self):\n if 'dynamic_routing' in self.data:\n routing = self.data['dynamic_routing']\n ospf = routing.get('bgp')\n return ospf.get('enabled', False)\n raise UnsupportedEngineFeature(\n 'Dynamic routing is only supported on layer 3 engine ... | [
"0.6502879",
"0.6193896",
"0.5825537",
"0.5768303",
"0.5750399",
"0.5695198",
"0.5577875",
"0.55232096",
"0.54529417",
"0.54464304",
"0.54409206",
"0.5438288",
"0.5413789",
"0.5392612",
"0.53700954",
"0.5342758",
"0.53224957",
"0.53178126",
"0.5312715",
"0.5305907",
"0.530503... | 0.8255223 | 0 |
Causes the player to make a move randomly. | def player_move_random(self, player):
empty_spaces = self.get_empty_spaces()
if len(empty_spaces) > 0:
coord = random.choice(self.get_empty_spaces())
self.player_make_move(coord[0], coord[1], player) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_move(self):\n possible_moves = self.model.grid.get_neighborhood(self.pos, moore=True, radius=1)\n\n new_pos = random.choice(possible_moves)\n\n self.model.grid.move_agent(self, new_pos)",
"def make_random_move(self):\n raise NotImplementedError",
"def random_move(self):\n... | [
"0.78227186",
"0.7751474",
"0.77474076",
"0.76539576",
"0.7485258",
"0.7341074",
"0.73287433",
"0.72226465",
"0.7154253",
"0.7119619",
"0.71007174",
"0.7001683",
"0.69725007",
"0.69350535",
"0.6911287",
"0.6903912",
"0.68546057",
"0.6780734",
"0.6756151",
"0.67138445",
"0.669... | 0.8000591 | 0 |
Factory method for creating a new connection to the SQLite database. | def new_connection(self):
result = sqlite3.connect(self.database_file)
result.row_factory = sqlite3.Row
return result | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_connection(database_url):\n connection = sqlite.connect(database_url)\n connection.row_factory = dict_factory\n return connection",
"def new_connection():\n return sqlite3.connect(DATABASE_NAME)",
"def create_connection():\n p = Path(__file__).parents[2]\n try:\n conn = sqli... | [
"0.78515756",
"0.7847319",
"0.7624526",
"0.7585757",
"0.755304",
"0.75440735",
"0.7523761",
"0.75195134",
"0.7490906",
"0.7457255",
"0.74410313",
"0.74374723",
"0.7422707",
"0.7422346",
"0.74179405",
"0.7412887",
"0.7404123",
"0.7404123",
"0.73962903",
"0.73841375",
"0.737530... | 0.7808876 | 2 |
Initialize a Quay API wrapper with logging, url information, and other necessary variables to track state. | def __init__(self, base_url: str = None, username: str = None,
password: str = None, verbosity: int = 0) -> None:
super().__init__(
service_name='Quay',
base_url=base_url,
username=username,
password=password,
verbosity=verbosity
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, api_key: str) -> None:\n self._client = floq.client.CirqClient(api_key)",
"def __init__(self, api_key, user_agent, db_name, _format='json'):\n self.headers = {'user_agent': user_agent}\n self.payload = {'api_key': api_key,\n 'format': _format}\n ... | [
"0.6327516",
"0.6163252",
"0.61115885",
"0.61069626",
"0.60942525",
"0.59657437",
"0.59636533",
"0.59341246",
"0.58781433",
"0.5878021",
"0.58761066",
"0.58716434",
"0.58582217",
"0.5850918",
"0.5826722",
"0.5818272",
"0.58115053",
"0.58115053",
"0.5804155",
"0.5792476",
"0.5... | 0.67261535 | 0 |
Returns the response from the API server about a given robot account, returning None if no robot is present. | def get_robot(self, org_name: str = None,
robot_name: str = None) -> requests.Response:
try:
return self.api_req(
'get',
f'organization/{org_name}/robots/{robot_name}',
)
except UnexpectedApiResponse as e:
self.logger.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_me(self):\n response = requests.get(BOT_API_URL + self.token + \"/getMe\")\n response.raise_for_status()\n if response.status_code == 200 and response.json()[\"ok\"]:\n return response.json()[\"result\"]\n else:\n raise EnvironmentError(response.text)",
"... | [
"0.5656698",
"0.5598915",
"0.5523534",
"0.54454124",
"0.5410545",
"0.5352919",
"0.52754354",
"0.52718717",
"0.52524894",
"0.521239",
"0.51516956",
"0.5137847",
"0.50810826",
"0.5070572",
"0.50668603",
"0.49985296",
"0.4970404",
"0.4967103",
"0.4936753",
"0.49137622",
"0.49137... | 0.7141664 | 0 |
Find the minimum number of coins needed, using Greedy algorithm | def _foo(self, change):
num = len(self._DES_DENOMINATIONS)
i = 0
remain = change
count = 0
while i < num:
curr = self._DES_DENOMINATIONS[i]
count_curr = remain // curr
remain = remain % curr
count += count_curr
i += 1
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_change(m, coins: list = [1, 3, 4]):\n min_num_coins = {0: 0}\n for m in range(1, m + 1):\n min_num_coins[m] = math.inf\n for coin in coins:\n if m >= coin:\n num_coins = min_num_coins[m - coin] + 1\n if num_coins < min_num_coins[m]:\n ... | [
"0.66965556",
"0.6680512",
"0.65429264",
"0.63508016",
"0.62770367",
"0.623396",
"0.61921877",
"0.6135658",
"0.6122765",
"0.6097997",
"0.6042058",
"0.5924558",
"0.5922037",
"0.59197503",
"0.5909812",
"0.5851912",
"0.5849732",
"0.5800933",
"0.57942754",
"0.5790664",
"0.5775664... | 0.0 | -1 |
Return the name of this tracker. | def name(self):
if self.id in self.coordinator.data:
return f"{self.coordinator.data[self.id]['name']} {self._name}" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n _, _, name, _ = RPR.GetTrackName(self.id, \"\", 2048)\n return name",
"def get_name(self) -> str:\n return self._name",
"def get_name(self) -> str:\n return self._name",
"def get_name(self) -> str:\n return self._name",
"def name(self) -> str:\n r... | [
"0.8333273",
"0.8297787",
"0.8297787",
"0.8297787",
"0.8290292",
"0.8245564",
"0.821785",
"0.82116246",
"0.820544",
"0.820544",
"0.820544",
"0.820544",
"0.820544",
"0.820544",
"0.820544",
"0.820544",
"0.820544",
"0.820544",
"0.820544",
"0.820544",
"0.820544",
"0.820544",
... | 0.0 | -1 |
Return a unique ID to use for this entity. | def unique_id(self):
return f"{self.id}_{self._value_name}" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unique_id(self):\n return self.entity_id",
"def unique_id(self):\n return self.entity_id",
"def unique_id(self) -> str:\n return self._id",
"def unique_id(self) -> str:\n return self._id",
"def unique_id(self) -> str:\n tmp_id = (\n f\"{self._device_config.... | [
"0.878345",
"0.878345",
"0.8693195",
"0.8693195",
"0.84751266",
"0.8460817",
"0.8460817",
"0.8460817",
"0.8460817",
"0.83973056",
"0.83973056",
"0.83973056",
"0.8343812",
"0.826933",
"0.82201",
"0.8216117",
"0.8195488",
"0.81923836",
"0.8159725",
"0.8158213",
"0.8151488",
"... | 0.7943355 | 58 |
Device class of this entity. | def device_class(self):
return self._device_class | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device_class(self):\n return self._dclass",
"def device_class(self):\n return OBSERVATIONS[self.observation][2]",
"def device_class(self):\n return self.sensor.get('class')",
"def device_class(self) -> str:\n return self._device_class",
"def device_class(self) -> str:\n ... | [
"0.8650999",
"0.8425096",
"0.83888125",
"0.83860266",
"0.83860266",
"0.8378277",
"0.83291215",
"0.82704085",
"0.8178265",
"0.81364",
"0.8069012",
"0.8028685",
"0.7995493",
"0.7980421",
"0.79765785",
"0.7871021",
"0.7790236",
"0.77845013",
"0.7769415",
"0.7717599",
"0.75752276... | 0.8665227 | 7 |
Return if the entity should be enabled when first added to the entity registry. | def entity_registry_enabled_default(self) -> bool:
return self._enabled | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def entity_registry_enabled_default(self) -> bool:\n return self._enabled_default",
"def entity_registry_enabled_default(self) -> bool:\n return self._enabled_default",
"def entity_registry_enabled_default(self) -> bool:\n return True",
"def entity_registry_enabled_default(self):\n ... | [
"0.7445182",
"0.7445182",
"0.73641783",
"0.7316885",
"0.73118573",
"0.69114023",
"0.6639748",
"0.6639748",
"0.6639748",
"0.6639748",
"0.6639748",
"0.6639748",
"0.6639748",
"0.6639748",
"0.6639748",
"0.6639748",
"0.6639748",
"0.6639748",
"0.6639748",
"0.6639748",
"0.6639748",
... | 0.7684387 | 0 |
Return the one hot version of the sentence, | def line_to_one_hot_inference(self, line):
tokens = tokenize_sentence(line)
n_tokens = len(tokens) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def one_hot_encode(self, sentence) -> List[np.ndarray]:\n if isinstance(sentence, list):\n return [self.word2one_hot_dict[word] for word in sentence]\n else:\n return [self.word2one_hot_dict[word] for word in sentence.split(\" \")]",
"def __onehot_char(self, data):\n ve... | [
"0.7831746",
"0.7206823",
"0.718582",
"0.70536363",
"0.7053394",
"0.7002855",
"0.69269896",
"0.6863717",
"0.68270415",
"0.68202734",
"0.6818504",
"0.6804363",
"0.674594",
"0.66823864",
"0.6583552",
"0.65800834",
"0.65411323",
"0.6515512",
"0.65096563",
"0.6503679",
"0.6483236... | 0.7509562 | 1 |
Build a dictionary containing everything we know about a user. | def build_profile(first, last, **user_info):
user_info['first_name'] = first
user_info['last_name'] = last
return user_info | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user_info(user: User)-> dict:\n data = {\n 'user_id': user.id,\n 'user_name': user.name,\n 'user_last_name': user.last_name,\n 'user_gov_id': user.gov_id,\n 'user_email': user.email,\n 'user_company': user.company,\n 'user_orders': [f'id {o.id} paid{o.pa... | [
"0.7384379",
"0.7368637",
"0.7206945",
"0.71931744",
"0.7161423",
"0.7069983",
"0.7055394",
"0.69541955",
"0.69476086",
"0.6903888",
"0.6769213",
"0.67668116",
"0.670597",
"0.6698858",
"0.6695341",
"0.6691447",
"0.66426325",
"0.66051507",
"0.66051507",
"0.65781546",
"0.657689... | 0.0 | -1 |
Deletes the module files associated with every spec in specs, for every module type in module types. | def rm(module_type, specs, args):
check_module_set_name(args.module_set_name)
module_cls = spack.modules.module_types[module_type]
module_exist = lambda x: os.path.exists(module_cls(x, args.module_set_name).layout.filename)
specs_with_modules = [spec for spec in specs if module_exist(spec)]
modul... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def module_delete_all(self):\n self.test_runner.run_module_delete()",
"def teardown_module():\n for f in files_to_remove:\n if os.path.exists(f):\n os.remove(f)",
"def teardown_module(module):\n p_this = Path(__file__)\n to_remove_list = [\n p_this.change(new_basename=\... | [
"0.7013325",
"0.70088625",
"0.61879194",
"0.618131",
"0.60986817",
"0.60881543",
"0.60766333",
"0.6036803",
"0.5994903",
"0.59941393",
"0.5965433",
"0.59307307",
"0.59155595",
"0.59091115",
"0.59091115",
"0.59010464",
"0.5887315",
"0.58852214",
"0.5873021",
"0.584147",
"0.583... | 0.7470979 | 0 |
Build CIFAR10 train and test data loaders. Will download datasets if needed. | def build_dataset():
transform_train = transforms.Compose([
transforms.RandomCrop(32, padding=4),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)),
])
transform_test = transforms.Compose([
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_cifar10_loaders(root, batch_size, num_workers):\n # For evaluation, we normalize the mean and the variance of the dataset to be 0 and 1, respectively.\n # Specifically, (0.4914, 0.4822, 0.4465) and (0.247, 0.243, 0.261) are the mean and the standard deviation computed\n # from the raw CIFAR-10 dat... | [
"0.7663232",
"0.76570505",
"0.7279348",
"0.72127455",
"0.7040505",
"0.6887316",
"0.68871665",
"0.6886189",
"0.6841228",
"0.6798664",
"0.6736851",
"0.6735856",
"0.6723264",
"0.6705207",
"0.6692911",
"0.66844773",
"0.66234756",
"0.6622096",
"0.6594136",
"0.6575113",
"0.65334",
... | 0.7347864 | 2 |
Get a Boto 3 S3 resource with a specific Region or with your default Region. | def get_s3(region=None):
global s3_resource
if not region or s3_resource.meta.client.meta.region_name == region:
return s3_resource
else:
return boto3.resource('s3', region_name=region) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_s3(region=None):\n readJson()\n s3_resource = boto3.resource(\n 's3',\n aws_access_key_id=AWS_KEY_ID,\n aws_secret_access_key=AWS_SECRET_KEY,\n aws_session_token=AWS_SESSION_TOKEN)\n\n if not region or s3_resource.meta.client.meta.region_name == region:\n return ... | [
"0.85614187",
"0.727061",
"0.723039",
"0.7175803",
"0.6975619",
"0.6920573",
"0.6884303",
"0.68835086",
"0.6880243",
"0.68791556",
"0.67809194",
"0.6659682",
"0.65518653",
"0.6489507",
"0.64646477",
"0.62947077",
"0.6212672",
"0.62059665",
"0.61493206",
"0.61408204",
"0.61111... | 0.8659334 | 0 |
Apply CORS rules to a bucket. CORS rules specify the HTTP actions that are allowed from other domains. Usage is shown in usage_demo at the end of this module. | def put_cors(bucket_name, cors_rules):
s3 = get_s3()
try:
s3.Bucket(bucket_name).Cors().put(CORSConfiguration={
'CORSRules': cors_rules
})
logger.info("Put CORS rules %s for bucket '%s'.", cors_rules, bucket_name)
except ClientError:
logger.exception("Couldn't put... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_cors(bucket_name):\n s3 = get_s3()\n try:\n cors = s3.Bucket(bucket_name).Cors()\n logger.info(\"Got CORS rules %s for bucket '%s'.\", cors.cors_rules, bucket_name)\n except ClientError:\n logger.exception((\"Couldn't get CORS for bucket %s.\", bucket_name))\n raise\n ... | [
"0.6890304",
"0.6334892",
"0.61295146",
"0.6018776",
"0.6006355",
"0.5926007",
"0.5914961",
"0.58315617",
"0.5814825",
"0.572377",
"0.5662058",
"0.56522524",
"0.55800897",
"0.5520969",
"0.5515038",
"0.5507376",
"0.54893714",
"0.54829335",
"0.54637164",
"0.5452329",
"0.5452162... | 0.829347 | 0 |
Get the lifecycle configuration of the specified bucket. Usage is shown in usage_demo at the end of this module. | def get_lifecycle_configuration(bucket_name):
s3 = get_s3()
try:
config = s3.Bucket(bucket_name).LifecycleConfiguration()
logger.info("Got lifecycle rules %s for bucket '%s'.",
config.rules, bucket_name)
except:
logger.exception("Couldn't get lifecycle configurati... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_bucket_lifecycle(self, bucket):\n details = self._details(\n method=b\"GET\",\n url_context=self._url_context(bucket=bucket, object_name=\"?lifecycle\"),\n )\n d = self._submit(self._query_factory(details))\n d.addCallback(self._parse_lifecycle_config)\n ... | [
"0.81330156",
"0.6939602",
"0.6663073",
"0.6440045",
"0.63474673",
"0.62318605",
"0.6189976",
"0.60533774",
"0.6045635",
"0.59314907",
"0.5845826",
"0.5802516",
"0.5736621",
"0.57072943",
"0.5685735",
"0.5685735",
"0.5685171",
"0.56824595",
"0.5671661",
"0.5671661",
"0.567166... | 0.77314883 | 1 |
Sets the dep_service_map_list of this V1StoreAppVersionTempleteApp. | def dep_service_map_list(self, dep_service_map_list):
if self.local_vars_configuration.client_side_validation and dep_service_map_list is None: # noqa: E501
raise ValueError("Invalid value for `dep_service_map_list`, must not be `None`") # noqa: E501
self._dep_service_map_list = dep_servi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_env_map_list(self, service_env_map_list):\n if self.local_vars_configuration.client_side_validation and service_env_map_list is None: # noqa: E501\n raise ValueError(\"Invalid value for `service_env_map_list`, must not be `None`\") # noqa: E501\n\n self._service_env_map_list ... | [
"0.67643636",
"0.58992565",
"0.54892725",
"0.5327212",
"0.49550635",
"0.4760047",
"0.47250733",
"0.47190076",
"0.4648292",
"0.4554561",
"0.4552866",
"0.45513493",
"0.45201778",
"0.450368",
"0.4491493",
"0.44614804",
"0.4452674",
"0.44412163",
"0.44399452",
"0.43969476",
"0.43... | 0.77163374 | 0 |
Sets the extend_method of this V1StoreAppVersionTempleteApp. | def extend_method(self, extend_method):
if self.local_vars_configuration.client_side_validation and extend_method is None: # noqa: E501
raise ValueError("Invalid value for `extend_method`, must not be `None`") # noqa: E501
self._extend_method = extend_method | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extend(self, extend):\n self._extend = extend",
"def extend_method_map(self, extend_method_map):\n if self.local_vars_configuration.client_side_validation and extend_method_map is None: # noqa: E501\n raise ValueError(\"Invalid value for `extend_method_map`, must not be `None`\") #... | [
"0.59423333",
"0.5220057",
"0.49183926",
"0.4883155",
"0.48027268",
"0.4604423",
"0.4596358",
"0.4590208",
"0.45901906",
"0.45658806",
"0.45540568",
"0.45167747",
"0.451365",
"0.44986406",
"0.43899274",
"0.43658742",
"0.42958596",
"0.4277728",
"0.4271837",
"0.42707244",
"0.42... | 0.649946 | 0 |
Sets the image of this V1StoreAppVersionTempleteApp. | def image(self, image):
if self.local_vars_configuration.client_side_validation and image is None: # noqa: E501
raise ValueError("Invalid value for `image`, must not be `None`") # noqa: E501
self._image = image | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_image(self, image):\n self.image = image",
"def set_image(self, image):\n return self._set_image(image, 'logo.png')",
"def set_image(self, image):\r\n raise NotImplementedError",
"def SetImage(self, id_=None):\r\n\r\n self._image_key = self._type",
"def setImage(self, va... | [
"0.61111003",
"0.5940138",
"0.5799056",
"0.57882404",
"0.5715547",
"0.5685725",
"0.55852175",
"0.5564675",
"0.5564675",
"0.5564675",
"0.5564675",
"0.55130404",
"0.54806525",
"0.53880966",
"0.5302543",
"0.52700084",
"0.52296245",
"0.517425",
"0.5100458",
"0.5080848",
"0.507923... | 0.5443057 | 13 |
Sets the language of this V1StoreAppVersionTempleteApp. | def language(self, language):
if self.local_vars_configuration.client_side_validation and language is None: # noqa: E501
raise ValueError("Invalid value for `language`, must not be `None`") # noqa: E501
self._language = language | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_language(self, language):\n self.language = language",
"def setLanguage(self, language):\n pass",
"def set_language(self, language):\n set_language(language)\n self.config.set_key(\"language\", language)",
"def set_translation(self, language = LANGUAGE_DEFAULT):\r\n\r\n ... | [
"0.6103096",
"0.6048507",
"0.6035761",
"0.5947055",
"0.58728945",
"0.58664155",
"0.58447105",
"0.57536656",
"0.5685544",
"0.5685544",
"0.5685544",
"0.5685544",
"0.56833726",
"0.56736773",
"0.56736773",
"0.5615806",
"0.5452165",
"0.54409266",
"0.5303254",
"0.5265241",
"0.52351... | 0.5614804 | 16 |
Sets the memory of this V1StoreAppVersionTempleteApp. | def memory(self, memory):
if self.local_vars_configuration.client_side_validation and memory is None: # noqa: E501
raise ValueError("Invalid value for `memory`, must not be `None`") # noqa: E501
self._memory = memory | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_memory(self, memory: D.T_memory[D.T_state]) -> None:\n return self._set_memory(memory)",
"def _set_memory(self, memory: D.T_memory[D.T_state]) -> None:\n self._memory = memory",
"def memory(self, memory):\n\n self._memory = memory",
"def set_memory(self, memory):\n if memo... | [
"0.62603635",
"0.60845715",
"0.60589004",
"0.5977523",
"0.59427",
"0.5719739",
"0.5623965",
"0.5450253",
"0.54482645",
"0.5422622",
"0.54103667",
"0.5247917",
"0.52277124",
"0.52199674",
"0.5209194",
"0.51844007",
"0.5137251",
"0.5134311",
"0.5108054",
"0.5098363",
"0.504017"... | 0.59718555 | 4 |
Sets the mnt_relation_list of this V1StoreAppVersionTempleteApp. | def mnt_relation_list(self, mnt_relation_list):
if self.local_vars_configuration.client_side_validation and mnt_relation_list is None: # noqa: E501
raise ValueError("Invalid value for `mnt_relation_list`, must not be `None`") # noqa: E501
self._mnt_relation_list = mnt_relation_list | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device_reset_list(self, device_reset_list):\n\n self._device_reset_list = device_reset_list",
"def mount_options(self, mount_options):\n\n self._mount_options = mount_options",
"def setRelation(self):\n self.relatives[\"root\"] = self.ctl\n self.controlRelatives[\"root\"] = self... | [
"0.4938856",
"0.4605893",
"0.45540443",
"0.43833005",
"0.4221392",
"0.42004505",
"0.41544524",
"0.40984505",
"0.40804905",
"0.40736815",
"0.40690815",
"0.40650213",
"0.4042054",
"0.40374422",
"0.4030121",
"0.40165302",
"0.40090254",
"0.39973825",
"0.39862195",
"0.39779466",
"... | 0.81667554 | 0 |
Sets the port_map_list of this V1StoreAppVersionTempleteApp. | def port_map_list(self, port_map_list):
if self.local_vars_configuration.client_side_validation and port_map_list is None: # noqa: E501
raise ValueError("Invalid value for `port_map_list`, must not be `None`") # noqa: E501
self._port_map_list = port_map_list | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_env_map_list(self, service_env_map_list):\n if self.local_vars_configuration.client_side_validation and service_env_map_list is None: # noqa: E501\n raise ValueError(\"Invalid value for `service_env_map_list`, must not be `None`\") # noqa: E501\n\n self._service_env_map_list ... | [
"0.58406496",
"0.5559514",
"0.55042285",
"0.54731584",
"0.53651935",
"0.5128151",
"0.50866216",
"0.504773",
"0.49904925",
"0.4947755",
"0.49358565",
"0.49125344",
"0.49107555",
"0.48424536",
"0.4833261",
"0.47511575",
"0.47336748",
"0.4727161",
"0.4727161",
"0.47225833",
"0.4... | 0.7242579 | 0 |
Sets the service_cname of this V1StoreAppVersionTempleteApp. | def service_cname(self, service_cname):
if self.local_vars_configuration.client_side_validation and service_cname is None: # noqa: E501
raise ValueError("Invalid value for `service_cname`, must not be `None`") # noqa: E501
self._service_cname = service_cname | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_service(self, service):\n self.service = service",
"def service(self, service):\n allowed_values = [\"CLOUDWATCH\", \"CLOUDTRAIL\", \"EC2\"]\n if service not in allowed_values:\n raise ValueError(\n \"Invalid value for `service` ({0}), must be one of {1}\"\n... | [
"0.6017336",
"0.57784",
"0.57731646",
"0.5718024",
"0.5655999",
"0.55272436",
"0.5493073",
"0.5493073",
"0.5430881",
"0.53945714",
"0.5378691",
"0.5370271",
"0.53568697",
"0.53439915",
"0.53439915",
"0.52865213",
"0.5229331",
"0.5102139",
"0.50747186",
"0.49968356",
"0.496991... | 0.75012994 | 0 |
Sets the service_image of this V1StoreAppVersionTempleteApp. | def service_image(self, service_image):
if self.local_vars_configuration.client_side_validation and service_image is None: # noqa: E501
raise ValueError("Invalid value for `service_image`, must not be `None`") # noqa: E501
self._service_image = service_image | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_service(self, service):\n self.service = service",
"def set_service(self, service_info):\n self.service = service_info",
"def service(self, service):\n\n self._service = service",
"def service(self, service):\n\n self._service = service",
"def service(self, service):\n ... | [
"0.62426025",
"0.59118253",
"0.5818215",
"0.5818215",
"0.5801605",
"0.54505426",
"0.5401992",
"0.5294451",
"0.5294451",
"0.5227776",
"0.5201842",
"0.51765776",
"0.51544785",
"0.51119435",
"0.50736207",
"0.50669086",
"0.5042652",
"0.503577",
"0.5029158",
"0.5017253",
"0.501718... | 0.7284548 | 0 |
Sets the service_key of this V1StoreAppVersionTempleteApp. | def service_key(self, service_key):
if self.local_vars_configuration.client_side_validation and service_key is None: # noqa: E501
raise ValueError("Invalid value for `service_key`, must not be `None`") # noqa: E501
self._service_key = service_key | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_id(self, service_id):\n\n self._service_id = service_id",
"def service_id(self, service_id):\n\n self._service_id = service_id",
"def set_service(self, service):\n self.service = service",
"def set_ifttt_service_key():\n try:\n key = request.form[\"iftttkey\"]\n ... | [
"0.61947554",
"0.61947554",
"0.614927",
"0.5928703",
"0.578114",
"0.5766351",
"0.5766351",
"0.5752156",
"0.5591979",
"0.55620646",
"0.5473035",
"0.5461323",
"0.5390876",
"0.53486043",
"0.53232205",
"0.53082556",
"0.5287559",
"0.51628906",
"0.5152623",
"0.5141824",
"0.5141616"... | 0.7009186 | 0 |
Sets the service_name of this V1StoreAppVersionTempleteApp. | def service_name(self, service_name):
if self.local_vars_configuration.client_side_validation and service_name is None: # noqa: E501
raise ValueError("Invalid value for `service_name`, must not be `None`") # noqa: E501
self._service_name = service_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetServiceName(self, name):\n self.service_name = name",
"def set_service(self, service):\n self.service = service",
"def service_account_name(self, service_account_name):\n\n self._service_account_name = service_account_name",
"def service_unit_name(self, service_unit_name):\n\n ... | [
"0.71729887",
"0.63600713",
"0.6353192",
"0.6236457",
"0.6021591",
"0.59625983",
"0.59340495",
"0.58560467",
"0.5805841",
"0.57670593",
"0.5741462",
"0.57393265",
"0.57393265",
"0.5727836",
"0.5727836",
"0.57158434",
"0.5659483",
"0.56479734",
"0.5588299",
"0.5588299",
"0.558... | 0.7013371 | 1 |
Sets the service_region of this V1StoreAppVersionTempleteApp. | def service_region(self, service_region):
if self.local_vars_configuration.client_side_validation and service_region is None: # noqa: E501
raise ValueError("Invalid value for `service_region`, must not be `None`") # noqa: E501
self._service_region = service_region | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_region(self, region):\n self._region = region",
"def set_service(self, service):\n self.service = service",
"def regions(self, regions: Optional[List[str]]) -> Self:\n\n if not isinstance(self._batch._backend, backend.ServiceBackend):\n raise NotImplementedError(\"A Serv... | [
"0.5718774",
"0.5588872",
"0.5425436",
"0.51800835",
"0.51800835",
"0.51335704",
"0.51335704",
"0.51335704",
"0.51335704",
"0.51265365",
"0.5119405",
"0.5091232",
"0.5091232",
"0.5026721",
"0.5017926",
"0.4983699",
"0.49285752",
"0.4927079",
"0.48826218",
"0.48787478",
"0.483... | 0.7418979 | 0 |
Sets the service_source of this V1StoreAppVersionTempleteApp. | def service_source(self, service_source):
if self.local_vars_configuration.client_side_validation and service_source is None: # noqa: E501
raise ValueError("Invalid value for `service_source`, must not be `None`") # noqa: E501
self._service_source = service_source | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_service(self, service):\n self.service = service",
"def service(self, service):\n\n self._service = service",
"def service(self, service):\n\n self._service = service",
"def service(self, service):\n self._service = service",
"def SetSource(self, source):\r\n self... | [
"0.6143264",
"0.57075995",
"0.57075995",
"0.56880397",
"0.56037855",
"0.5587752",
"0.55843556",
"0.5512612",
"0.54736596",
"0.5472086",
"0.5472086",
"0.5449639",
"0.54482424",
"0.5370339",
"0.5319035",
"0.52249396",
"0.5214316",
"0.52115697",
"0.52004117",
"0.51841307",
"0.51... | 0.7335845 | 0 |
Sets the service_type of this V1StoreAppVersionTempleteApp. | def service_type(self, service_type):
if self.local_vars_configuration.client_side_validation and service_type is None: # noqa: E501
raise ValueError("Invalid value for `service_type`, must not be `None`") # noqa: E501
self._service_type = service_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_type(self, service_type):\n allowed_values = [undefined, undefined, undefined, ] # noqa: E501\n\n self._service_type = service_type",
"def set(self, service: T, service_type: Union[Type[T], None] = None) -> NoReturn:\n if service_type is None:\n service_type = type(se... | [
"0.7305097",
"0.63289505",
"0.6178255",
"0.6057163",
"0.5702813",
"0.56363386",
"0.5628187",
"0.5628187",
"0.5624759",
"0.5588215",
"0.5516544",
"0.5467023",
"0.52567357",
"0.5156668",
"0.5083763",
"0.5083763",
"0.5061938",
"0.50383145",
"0.50368506",
"0.500197",
"0.49933684"... | 0.735629 | 0 |
Sets the service_volume_map_list of this V1StoreAppVersionTempleteApp. | def service_volume_map_list(self, service_volume_map_list):
if self.local_vars_configuration.client_side_validation and service_volume_map_list is None: # noqa: E501
raise ValueError("Invalid value for `service_volume_map_list`, must not be `None`") # noqa: E501
self._service_volume_map_l... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_env_map_list(self, service_env_map_list):\n if self.local_vars_configuration.client_side_validation and service_env_map_list is None: # noqa: E501\n raise ValueError(\"Invalid value for `service_env_map_list`, must not be `None`\") # noqa: E501\n\n self._service_env_map_list ... | [
"0.6584667",
"0.5846398",
"0.5626046",
"0.5194929",
"0.5107569",
"0.5081928",
"0.5066687",
"0.503459",
"0.503146",
"0.47938743",
"0.47857904",
"0.47857904",
"0.47517738",
"0.4558224",
"0.45499733",
"0.4525081",
"0.44734186",
"0.44600308",
"0.4450699",
"0.44426003",
"0.4442600... | 0.8108351 | 0 |
Sets the share_image of this V1StoreAppVersionTempleteApp. | def share_image(self, share_image):
if self.local_vars_configuration.client_side_validation and share_image is None: # noqa: E501
raise ValueError("Invalid value for `share_image`, must not be `None`") # noqa: E501
self._share_image = share_image | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def share_type(self, share_type):\n\n self._share_type = share_type",
"def set_ImageURL(self, value):\n super(CreateShareInputSet, self)._set_input('ImageURL', value)",
"def set_shares(self, shares):\n self.shares = shares",
"def share_social_copy(self, share_social_copy):\n\n sel... | [
"0.61635226",
"0.5900139",
"0.5519939",
"0.5471127",
"0.53560925",
"0.53133786",
"0.51981884",
"0.51460505",
"0.50740284",
"0.5028865",
"0.5023497",
"0.4976442",
"0.49690497",
"0.48963243",
"0.48509195",
"0.48423165",
"0.48127463",
"0.4777393",
"0.4774014",
"0.477088",
"0.474... | 0.774177 | 0 |
Sets the share_type of this V1StoreAppVersionTempleteApp. | def share_type(self, share_type):
self._share_type = share_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def share_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"share_type\")",
"def share_image(self, share_image):\n if self.local_vars_configuration.client_side_validation and share_image is None: # noqa: E501\n raise ValueError(\"Invalid value for `share_image`, mus... | [
"0.60217434",
"0.58374476",
"0.5773112",
"0.56535816",
"0.5534613",
"0.52722836",
"0.5241467",
"0.5204192",
"0.50478524",
"0.5003109",
"0.49683294",
"0.4965514",
"0.49552464",
"0.49316913",
"0.49276212",
"0.4872502",
"0.48556507",
"0.48503688",
"0.4837551",
"0.48343724",
"0.4... | 0.7927517 | 0 |
Returns the string representation of the model | def to_str(self):
return pprint.pformat(self.to_dict()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _repr_model_(self):\n return str(self)",
"def __str__(self):\n\n return str(self.model)",
"def get_model_string(self):\n raise NotImplementedError()",
"def __str__(self):\n return self.model",
"def serialize_model(self):\n return dill.dumps(self.model)",
"def __str_... | [
"0.8602374",
"0.85093755",
"0.8237104",
"0.8050309",
"0.80128866",
"0.79348034",
"0.78766525",
"0.77898884",
"0.7786461",
"0.7745792",
"0.7627315",
"0.76055235",
"0.757999",
"0.7514394",
"0.75038797",
"0.75035286",
"0.74850684",
"0.7440529",
"0.74325883",
"0.74239755",
"0.740... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
if not isinstance(other, V1StoreAppVersionTempleteApp):
return True
return self.to_dict() != other.to_dict() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n return not self == other",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other):\n return self.__dict__ != other.__dict__",
"def __eq__(self, other):\n return not self.__ne__(other)",
... | [
"0.8410411",
"0.8391477",
"0.8172175",
"0.81410587",
"0.80920255",
"0.8088807",
"0.80676955",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
... | 0.0 | -1 |
Gets a tile's colours as (bgcol, fgcol). | def get_col(self, x, y):
if (x,y) in self.dirty_tiles:
return self.dirty_tiles[(x,y)][0], self.dirty_tiles[(x,y)][2]
return self.tiles[x][y][0], self.tiles[x][y][2] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getColors(self):\n _val = self._color\n _r = (_val & 0xff0000) >> 16\n _g = (_val & 0xff00) >> 8\n _b = (_val & 0xff)\n return _r, _g, _b",
"def weblogo_color_to_tuple(col):\n return col.red, col.green, col.blue",
"def get_colors(self) -> Tuple[str, ...]:\n if l... | [
"0.7025664",
"0.69885015",
"0.69003916",
"0.67503154",
"0.6732676",
"0.6656328",
"0.6654941",
"0.6631733",
"0.65759504",
"0.6563248",
"0.6501969",
"0.63479704",
"0.63094467",
"0.62711775",
"0.62426275",
"0.62134975",
"0.62043464",
"0.61982715",
"0.6193625",
"0.61929405",
"0.6... | 0.5802482 | 64 |
Get the height of the rectangle tightly fitting the string inside that rectangle. | def test_string_height(self, x, y, w, h, msg):
h = self.size[1]
cur_x = x
cur_y = y
words = msg.split(" ")
for word in words:
if cur_x-x + len(word) > w:
cur_y += 1
cur_x = x
for letter in word:
cur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def string_width_height(self, s):\n if not len(s):\n return 0, 0\n total_width = 0\n namelast = None\n miny = 1e9\n maxy = 0\n for c in s:\n if c == '\\n':\n continue\n wx, name, bbox = self._metrics[ord(c)]\n\n to... | [
"0.78337467",
"0.72926915",
"0.709173",
"0.6835283",
"0.6832407",
"0.6805497",
"0.6714252",
"0.65724254",
"0.6548308",
"0.6525446",
"0.6481611",
"0.6459371",
"0.6458297",
"0.64577836",
"0.6408719",
"0.63633025",
"0.63387036",
"0.63387036",
"0.63387036",
"0.631323",
"0.6308204... | 0.76237875 | 1 |
Sets the utm_east of this AvalancheWarningDetail. | def utm_east(self, utm_east):
self._utm_east = utm_east | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_east(self, east=False):\n try:\n if east:\n self.lon_rho[self.lon_rho < 0] += 360.0\n self.lon_u[self.lon_u < 0] += 360.0\n self.lon_v[self.lon_v < 0] += 360.0\n else:\n self.lon_rho[self.lon_rho > 180] -= 360.0\n ... | [
"0.7314299",
"0.5314502",
"0.5309331",
"0.5301826",
"0.5262268",
"0.5241527",
"0.519584",
"0.5164801",
"0.50225234",
"0.49253586",
"0.48713544",
"0.48683584",
"0.4846916",
"0.4757711",
"0.47207084",
"0.47061265",
"0.4692453",
"0.46789184",
"0.4660908",
"0.46470267",
"0.463960... | 0.8830515 | 0 |
Sets the avalanche_danger of this AvalancheWarningDetail. | def avalanche_danger(self, avalanche_danger):
self._avalanche_danger = avalanche_danger | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def danger_level(self, danger_level):\n\n self._danger_level = danger_level",
"def danger_level_name(self, danger_level_name):\n\n self._danger_level_name = danger_level_name",
"def danger_sign_flag(self):\n if self.danger_sign.lower() in ('o','n','0'):\n self.danger_sign = None... | [
"0.6365431",
"0.5827685",
"0.47997573",
"0.44894782",
"0.4450212",
"0.44267866",
"0.44060287",
"0.4340866",
"0.42772087",
"0.42767188",
"0.4275115",
"0.42441517",
"0.42209148",
"0.4218684",
"0.4218077",
"0.4217861",
"0.42109424",
"0.4209051",
"0.41716847",
"0.4156315",
"0.413... | 0.8743599 | 0 |
Sets the emergency_warning of this AvalancheWarningDetail. | def emergency_warning(self, emergency_warning):
self._emergency_warning = emergency_warning | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setWasEmergency(self, value='NULL'):\n\t\tself.setEnvironmentVariable( name='WAS_EMERGENCY', value=value.upper() )",
"def emergency_off(self, cause='client'):\n # make sure write buffer won't get send anymore\n logging.error(\"EMERGENCY OFF\")\n self.running = False\n # do not use... | [
"0.6687564",
"0.62620574",
"0.6146702",
"0.61254865",
"0.612244",
"0.6072934",
"0.5730116",
"0.5509315",
"0.5438385",
"0.5400004",
"0.5197664",
"0.5160563",
"0.51589155",
"0.5147909",
"0.51469874",
"0.5136077",
"0.5124167",
"0.50669885",
"0.501672",
"0.49887675",
"0.49878323"... | 0.89396065 | 0 |
Sets the snow_surface of this AvalancheWarningDetail. | def snow_surface(self, snow_surface):
self._snow_surface = snow_surface | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def surface(self, surface):\n if surface is not None and surface > 10000:\n raise ValueError(\"Invalid value for `surface`, must be a value less than or equal to `10000`\")\n if surface is not None and surface < 1:\n raise ValueError(\"Invalid value for `surface`, must be a valu... | [
"0.5501251",
"0.49433726",
"0.48508537",
"0.48041135",
"0.47548252",
"0.47184348",
"0.4603912",
"0.46007982",
"0.4593142",
"0.45822066",
"0.45813257",
"0.4547488",
"0.45154",
"0.4501934",
"0.44115207",
"0.44115207",
"0.43916932",
"0.43897986",
"0.43606433",
"0.43484047",
"0.4... | 0.82812095 | 0 |
Sets the latest_observations of this AvalancheWarningDetail. | def latest_observations(self, latest_observations):
self._latest_observations = latest_observations | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def latest(self, latest):\n\n self._latest = latest",
"def most_recent(self, most_recent):\n\n self._most_recent = most_recent",
"def latest_timestamp(self, latest_timestamp):\n\n self._latest_timestamp = latest_timestamp",
"def set_obs_date(self, date):\n self.last_observed = 1.0... | [
"0.596671",
"0.5698125",
"0.56204003",
"0.5341322",
"0.5318304",
"0.5318304",
"0.5318304",
"0.5318304",
"0.52875584",
"0.52875584",
"0.5249849",
"0.5210029",
"0.5188996",
"0.5159942",
"0.5089704",
"0.50717187",
"0.5033736",
"0.49442437",
"0.49388617",
"0.49237162",
"0.4872246... | 0.796 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.