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 |
|---|---|---|---|---|---|---|
Split windowed data into separate inputs for each feature. | def windows_to_inputs(X_windows, num_concepts, skip_last):
n = X_windows.shape[0]
return {f"concept_{i}": X_windows[:(-1 if skip_last else n), :, i] for i in range(num_concepts)} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_trajectory(context, features, window_length=7):\n # Our strategy is to make sure all the leading dimensions are the same size,\n # then we can use from_tensor_slices.\n\n trajectory_length = features['position'].get_shape().as_list()[0]\n\n # We then stack window_length position changes so the final\... | [
"0.6697223",
"0.6475389",
"0.64160585",
"0.63944924",
"0.6368413",
"0.6367853",
"0.63276374",
"0.63041466",
"0.62341577",
"0.6208215",
"0.6178964",
"0.60845566",
"0.6021297",
"0.6009604",
"0.60032076",
"0.5974468",
"0.59717387",
"0.5952166",
"0.59230554",
"0.59179825",
"0.590... | 0.60943645 | 11 |
To verify that request fails incase of missing user id | def test_missing_user_id(flask_app, db): # pylint: disable=unused-argument
request_data = copy.deepcopy(REQUEST_DATA)
request_data['user_id'] = ''
headers = {'Content-Type': 'multipart/form-data'}
rv = flask_app.post(DEVICE_REGISTRATION_REQ_API, data=request_data, headers=headers)
assert rv.stat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_request_users_user_invalid(self):\n response = requests.get(self.url + '/users/invalid')\n\n self.assertEqual(response.status_code, 404)",
"def test_wrong_id(self):\n self.request.matchdict = {'user_id': int(self.request.user.id)+4}\n self.request.json_body = {}\n resu... | [
"0.7655822",
"0.761114",
"0.7607717",
"0.75762004",
"0.74662995",
"0.7437786",
"0.73381823",
"0.7327694",
"0.7271393",
"0.7270963",
"0.7263133",
"0.7236444",
"0.71932274",
"0.71916896",
"0.7127593",
"0.71043",
"0.70943075",
"0.70440155",
"0.7002788",
"0.6948396",
"0.6945231",... | 0.7398762 | 6 |
To verify that registration put method gets failed in case of new request response is correct | def test_device_registration_put_method_failure(flask_app, db): # pylint: disable=unused-argument
request = create_registration(REQUEST_DATA, uuid.uuid4())
headers = {'Content-Type': 'multipart/form-data'}
modified_data = {'m_location': 'overseas', 'reg_id': request.id, 'user_id': USER_ID}
rv = flask_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_put_validation_fail(self):\n test_data = {\n 'first_name': 'new_first_name',\n 'last_name': 'new_last_name'\n }\n\n with mock.patch('user_profile.views.profile_validator') as profile_validator:\n profile_validator.return_value = False\n resp... | [
"0.73365957",
"0.69546956",
"0.6798247",
"0.6784024",
"0.67324436",
"0.67217827",
"0.6634823",
"0.6543775",
"0.64737415",
"0.64571494",
"0.6431058",
"0.64160246",
"0.641544",
"0.63914704",
"0.6361956",
"0.6306354",
"0.63023365",
"0.6282559",
"0.62741244",
"0.62650776",
"0.624... | 0.7448162 | 0 |
Checks if the Control was touched. Returns True if the touch_point is within the Control's touch_boundary. | def contains(self, point):
return super().contains((point[0] - self.x, point[1] - self.y)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def touching(self):\n if self._touching != 0:\n return True\n return False",
"def detect_in_bounds(self):\n creature_x, creature_y = self.creature.current_location\n if creature_x < 0 or creature_x >= self.world_width\\\n or creature_y < 0 or creature_y >= self.w... | [
"0.6381558",
"0.59678423",
"0.59171754",
"0.58679014",
"0.58029735",
"0.5764061",
"0.5755532",
"0.5747077",
"0.571133",
"0.571133",
"0.5700879",
"0.56779945",
"0.56678075",
"0.5664686",
"0.563283",
"0.56298524",
"0.5606126",
"0.5583801",
"0.5577436",
"0.5556956",
"0.55471677"... | 0.5073784 | 79 |
equal(SwigPyIterator self, SwigPyIterator x) > bool | def equal(self, *args):
return _osgAnimation.SwigPyIterator_equal(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, x):\n return _elas.SwigPyIterator___eq__(self, x)",
"def equal(self, x):\n return _elas.SwigPyIterator_equal(self, x)",
"def equal(self, *args):\n return _libsbml.SwigPyIterator_equal(self, *args)",
"def __eq__(self, *args):\n return _libsbml.SwigPyIterator___eq__... | [
"0.8124091",
"0.8102479",
"0.8018911",
"0.7937991",
"0.7769782",
"0.7718643",
"0.74248403",
"0.71860796",
"0.67593956",
"0.66843367",
"0.6627367",
"0.6626721",
"0.65686876",
"0.6560078",
"0.65255284",
"0.6514503",
"0.64721674",
"0.64414895",
"0.6411529",
"0.6394593",
"0.63460... | 0.7360107 | 7 |
__eq__(SwigPyIterator self, SwigPyIterator x) > bool | def __eq__(self, *args):
return _osgAnimation.SwigPyIterator___eq__(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, x):\n return _elas.SwigPyIterator___eq__(self, x)",
"def __eq__(self, *args):\n return _libsbml.SwigPyIterator___eq__(self, *args)",
"def __eq__(self, *args):\n return _SALOMERuntime.SALOMERuntime_PySwigIterator___eq__(self, *args)",
"def equal(self, x):\n return ... | [
"0.862938",
"0.85142654",
"0.8201599",
"0.7874298",
"0.7825124",
"0.75550544",
"0.7362281",
"0.72234887",
"0.7159859",
"0.71583486",
"0.7123068",
"0.7074502",
"0.6965081",
"0.6912728",
"0.68926835",
"0.6871103",
"0.67954063",
"0.67646265",
"0.6749558",
"0.67460847",
"0.673508... | 0.80150855 | 3 |
__ne__(SwigPyIterator self, SwigPyIterator x) > bool | def __ne__(self, *args):
return _osgAnimation.SwigPyIterator___ne__(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, x):\n return _elas.SwigPyIterator___ne__(self, x)",
"def __ne__(self, *args):\n return _libsbml.SwigPyIterator___ne__(self, *args)",
"def __ne__(self, *args):\n return _SALOMERuntime.SALOMERuntime_PySwigIterator___ne__(self, *args)",
"def __ne__(self, *args):\n re... | [
"0.8836034",
"0.853604",
"0.8523256",
"0.79599017",
"0.78480077",
"0.7633325",
"0.75983775",
"0.7582724",
"0.7565349",
"0.75388855",
"0.7432565",
"0.7304654",
"0.716664",
"0.7086787",
"0.70792764",
"0.70608515",
"0.7044849",
"0.702299",
"0.7020666",
"0.69914424",
"0.69728625"... | 0.7848325 | 4 |
__iadd__(SwigPyIterator self, ptrdiff_t n) > SwigPyIterator | def __iadd__(self, *args):
return _osgAnimation.SwigPyIterator___iadd__(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __iadd__(self, n):\n return _elas.SwigPyIterator___iadd__(self, n)",
"def __add__(self, n):\n return _elas.SwigPyIterator___add__(self, n)",
"def __iadd__(self, *args):\n return _libsbml.SwigPyIterator___iadd__(self, *args)",
"def __iadd__(self, *args):\n return _SALOMERuntime... | [
"0.8115641",
"0.7903315",
"0.7230087",
"0.7141349",
"0.6826374",
"0.6798432",
"0.6644176",
"0.6610137",
"0.65106803",
"0.6327704",
"0.6277335",
"0.62616277",
"0.6235755",
"0.6187036",
"0.61256063",
"0.6092001",
"0.60815376",
"0.60354495",
"0.60190713",
"0.5940588",
"0.5937125... | 0.65482926 | 8 |
__isub__(SwigPyIterator self, ptrdiff_t n) > SwigPyIterator | def __isub__(self, *args):
return _osgAnimation.SwigPyIterator___isub__(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __isub__(self, n):\n return _elas.SwigPyIterator___isub__(self, n)",
"def __isub__(self, *args):\n return _libsbml.SwigPyIterator___isub__(self, *args)",
"def __isub__(self, *args):\n return _SALOMERuntime.SALOMERuntime_PySwigIterator___isub__(self, *args)",
"def __ne__(self, *args):... | [
"0.8378952",
"0.73434573",
"0.7192319",
"0.6513186",
"0.64859295",
"0.6450767",
"0.61450106",
"0.6031537",
"0.60000354",
"0.59995747",
"0.5977053",
"0.5964306",
"0.5911347",
"0.58638686",
"0.5843538",
"0.58360696",
"0.58270735",
"0.58237195",
"0.5822505",
"0.5822505",
"0.5809... | 0.671418 | 3 |
__add__(SwigPyIterator self, ptrdiff_t n) > SwigPyIterator | def __add__(self, *args):
return _osgAnimation.SwigPyIterator___add__(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __add__(self, n):\n return _elas.SwigPyIterator___add__(self, n)",
"def __iadd__(self, n):\n return _elas.SwigPyIterator___iadd__(self, n)",
"def __iadd__(self, *args):\n return _libsbml.SwigPyIterator___iadd__(self, *args)",
"def __iadd__(self, *args):\n return _SALOMERuntime... | [
"0.79915166",
"0.79236174",
"0.7096506",
"0.695667",
"0.6921746",
"0.68103284",
"0.65348136",
"0.6529943",
"0.64255875",
"0.639372",
"0.63793796",
"0.61608446",
"0.60525066",
"0.6041655",
"0.6037768",
"0.6035314",
"0.603325",
"0.603325",
"0.59981",
"0.59679",
"0.5960781",
"... | 0.6195929 | 11 |
isSameKindAs(Bone self, Object obj) > bool | def isSameKindAs(self, *args):
return _osgAnimation.Bone_isSameKindAs(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isSameKindAs(self, *args):\n return _osgAnimation.Skeleton_isSameKindAs(self, *args)",
"def isSameKindAs(self, *args):\n return _osgAnimation.RigGeometry_isSameKindAs(self, *args)",
"def is_same_class(obj, a_class):\n if type(obj) is a_class:\n return True\n else:\n return... | [
"0.688776",
"0.681451",
"0.6792125",
"0.67550397",
"0.67447704",
"0.673581",
"0.6727356",
"0.6727356",
"0.6722284",
"0.6713956",
"0.6710613",
"0.6674929",
"0.66725147",
"0.66725147",
"0.66497874",
"0.6631282",
"0.65625167",
"0.6553595",
"0.6529641",
"0.64855295",
"0.64619523"... | 0.8055254 | 0 |
getDuration(Animation self) > double | def getDuration(self):
return _osgAnimation.Animation_getDuration(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _animation_over(self) -> bool:\n \treturn self.current_height == 0 or self.current_height == self.original_height",
"def getDuration(self):\n return _osgAnimation.Motion_getDuration(self)",
"def ended(self):\n return self.dur <= 0",
"def _isBasisDuration(self):\n invdur = 1/self.g... | [
"0.6512794",
"0.64889514",
"0.64611965",
"0.6436985",
"0.6261393",
"0.61244094",
"0.61114067",
"0.6110488",
"0.6110488",
"0.59552723",
"0.58716244",
"0.5858845",
"0.58369476",
"0.5815701",
"0.581173",
"0.5802952",
"0.57944643",
"0.5780207",
"0.5774594",
"0.5774594",
"0.576601... | 0.6672601 | 0 |
__nonzero__(VertexList self) > bool | def __nonzero__(self):
return _osgAnimation.VertexList___nonzero__(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __bool__(self):\n return _osgAnimation.VertexList___bool__(self)",
"def __nonzero__(self):\n for e in self:\n if e != 0:\n return True\n return False",
"def hasvertices(self):\n if len(self.vertices) > 0:\n return True\n else:\n ... | [
"0.75853145",
"0.7304485",
"0.71349514",
"0.7114057",
"0.7064323",
"0.7001537",
"0.69381577",
"0.6928379",
"0.6903203",
"0.6903203",
"0.6886585",
"0.68669856",
"0.68598735",
"0.68525386",
"0.68450683",
"0.6804126",
"0.67194676",
"0.6687429",
"0.6638664",
"0.6635855",
"0.66358... | 0.8120467 | 0 |
addVertexInfluence(VertexInfluenceSet self, VertexInfluence v) | def addVertexInfluence(self, *args):
return _osgAnimation.VertexInfluenceSet_addVertexInfluence(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def addVertex(self, v: Vertex):\n if v is not None:\n self._vertices.add(v)\n\n # Possibly need to recalculate genus/core/etc.\n self.invalidateCaches()",
"def addVertex(self, v):\r\n self.adjacent.setdefault(v, list())",
"def add_vertex(self, v, i=None):\n ... | [
"0.6043088",
"0.5955522",
"0.5953655",
"0.5940819",
"0.59392196",
"0.5917256",
"0.57761496",
"0.57155126",
"0.5705817",
"0.5705817",
"0.5705817",
"0.5705817",
"0.5657216",
"0.5653312",
"0.56521934",
"0.56521934",
"0.5646287",
"0.56412524",
"0.5622402",
"0.5611171",
"0.5607732... | 0.8146161 | 0 |
getNumVertexes(RigTransformHardware self) > int | def getNumVertexes(self):
return _osgAnimation.RigTransformHardware_getNumVertexes(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def num_vertices(self):\n return len(self)",
"def num_vertices(self):\n return self.n * (1 + int(self.variant.is_bipartite()))",
"def num_vertices(self):\n return len(self.vertices)",
"def num_vertices(self):\n return len(self.vertices)",
"def getNumVertices(self):\n retu... | [
"0.7573248",
"0.7557775",
"0.7544695",
"0.7544695",
"0.7477292",
"0.7346259",
"0.7334602",
"0.7318546",
"0.7305746",
"0.72857",
"0.7276788",
"0.72747475",
"0.720293",
"0.71541834",
"0.71511626",
"0.6888364",
"0.6858941",
"0.68330353",
"0.6823522",
"0.68050617",
"0.6792352",
... | 0.8549334 | 0 |
isSameKindAs(RigGeometry self, Object obj) > bool | def isSameKindAs(self, *args):
return _osgAnimation.RigGeometry_isSameKindAs(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isSameKindAs(self, *args):\n return _osgAnimation.VertexInfluenceMap_isSameKindAs(self, *args)",
"def isSameKindAs(self, *args):\n return _osgAnimation.Bone_isSameKindAs(self, *args)",
"def isSameKindAs(self, *args):\n return _osgAnimation.Animation_isSameKindAs(self, *args)",
"def i... | [
"0.6731391",
"0.6466084",
"0.6414504",
"0.63121456",
"0.62811697",
"0.6279673",
"0.6179285",
"0.61633414",
"0.6040943",
"0.60372186",
"0.6023128",
"0.6019263",
"0.6017019",
"0.60165614",
"0.59890634",
"0.59672374",
"0.59347844",
"0.59271556",
"0.5925292",
"0.58991337",
"0.589... | 0.844001 | 0 |
isSameKindAs(BasicAnimationManager self, Object obj) > bool | def isSameKindAs(self, *args):
return _osgAnimation.BasicAnimationManager_isSameKindAs(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isSameKindAs(self, *args):\n return _osgAnimation.Animation_isSameKindAs(self, *args)",
"def isSameKindAs(self, *args):\n return _osgAnimation.Skeleton_isSameKindAs(self, *args)",
"def isSameKindAs(self, *args):\n return _osgAnimation.Bone_isSameKindAs(self, *args)",
"def isSameKindA... | [
"0.8155883",
"0.71495277",
"0.6826679",
"0.66938525",
"0.66856205",
"0.58878875",
"0.5886944",
"0.579339",
"0.5785472",
"0.5754167",
"0.57476336",
"0.57407343",
"0.57238925",
"0.5686127",
"0.5611721",
"0.5591111",
"0.5574849",
"0.5562376",
"0.5553341",
"0.55217195",
"0.549425... | 0.85282046 | 0 |
__nonzero__(vectorQuatKeyframe self) > bool | def __nonzero__(self):
return _osgAnimation.vectorQuatKeyframe___nonzero__(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __bool__(self):\n return _osgAnimation.vectorQuatKeyframe___bool__(self)",
"def __nonzero__(self):\n return _osgAnimation.vectorVec3Keyframe___nonzero__(self)",
"def __nonzero__(self):\n return _osgAnimation.vectorVec4Keyframe___nonzero__(self)",
"def __nonzero__(self):\n retu... | [
"0.83894056",
"0.81658417",
"0.8162069",
"0.80440295",
"0.79400045",
"0.78438914",
"0.7794214",
"0.77785844",
"0.7762507",
"0.7646565",
"0.7447715",
"0.6906747",
"0.67589015",
"0.6456041",
"0.64456373",
"0.6433337",
"0.6353056",
"0.63359445",
"0.6273025",
"0.62518525",
"0.623... | 0.88542837 | 0 |
front(vectorQuatKeyframe self) > QuatKeyframe | def front(self):
return _osgAnimation.vectorQuatKeyframe_front(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def front(self):\n return _osgAnimation.vectorVec4Keyframe_front(self)",
"def front(self):\n return _osgAnimation.vectorVec3Keyframe_front(self)",
"def front(self):\n return _osgAnimation.vectorFloatKeyframe_front(self)",
"def front(self):\n return _osgAnimation.vectorVec2Keyframe... | [
"0.76511985",
"0.76037246",
"0.75959283",
"0.74163616",
"0.7311846",
"0.72032243",
"0.6879824",
"0.6850227",
"0.6823446",
"0.65516084",
"0.654169",
"0.65382564",
"0.6529343",
"0.6455252",
"0.6418006",
"0.6368165",
"0.61918384",
"0.6168356",
"0.6159174",
"0.6158369",
"0.614928... | 0.8245196 | 0 |
getValueAt(QuatSphericalLinearSampler self, double time, Quat result) | def getValueAt(self, *args):
return _osgAnimation.QuatSphericalLinearSampler_getValueAt(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def InQuadFunction_getValueAt(*args):\n return _osgAnimation.InQuadFunction_getValueAt(*args)",
"def getValueAt(*args):\n return _osgAnimation.InQuadFunction_getValueAt(*args)",
"def getValueAt(*args):\n return _osgAnimation.InOutQuadFunction_getValueAt(*args)",
"def InQuartFunction_getValueAt... | [
"0.6790253",
"0.6771801",
"0.6767785",
"0.6745517",
"0.668537",
"0.66521585",
"0.6626124",
"0.66171443",
"0.66105384",
"0.6591782",
"0.6582371",
"0.6557363",
"0.6509575",
"0.6167091",
"0.61443275",
"0.6132313",
"0.6108465",
"0.6074684",
"0.6067872",
"0.60357255",
"0.6022007",... | 0.7840971 | 0 |
createKeyframeContainerFromTargetValue(QuatSphericalLinearChannel self) > bool | def createKeyframeContainerFromTargetValue(self):
return _osgAnimation.QuatSphericalLinearChannel_createKeyframeContainerFromTargetValue(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def createKeyframeContainerFromTargetValue(self):\n return _osgAnimation.Channel_createKeyframeContainerFromTargetValue(self)",
"def __bool__(self):\n return _osgAnimation.vectorQuatKeyframe___bool__(self)",
"def getOrCreateKeyframeContainer(self):\n return _osgAnimation.QuatSphericalLinea... | [
"0.7115577",
"0.67520726",
"0.66854525",
"0.66706324",
"0.6326471",
"0.62401295",
"0.60730904",
"0.6054746",
"0.59570944",
"0.59543943",
"0.59408313",
"0.5665963",
"0.56063485",
"0.55731845",
"0.54785675",
"0.54756",
"0.5444679",
"0.5378577",
"0.5364044",
"0.5350776",
"0.5342... | 0.8242292 | 0 |
getOrCreateSampler(QuatSphericalLinearChannel self) > QuatSphericalLinearSampler | def getOrCreateSampler(self):
return _osgAnimation.QuatSphericalLinearChannel_getOrCreateSampler(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setSampler(self, *args):\n return _osgAnimation.QuatSphericalLinearChannel_setSampler(self, *args)",
"def getSampler(self, *args):\n return _osgAnimation.QuatSphericalLinearChannel_getSampler(self, *args)",
"def getSamplerTyped(self, *args):\n return _osgAnimation.QuatSphericalLinearCh... | [
"0.81281745",
"0.7980085",
"0.717932",
"0.58106583",
"0.57604885",
"0.5738651",
"0.5628734",
"0.56213814",
"0.56184775",
"0.5606969",
"0.55963457",
"0.55836016",
"0.554985",
"0.5523408",
"0.55020654",
"0.52516663",
"0.5245176",
"0.5243952",
"0.5202667",
"0.5157589",
"0.514092... | 0.83372504 | 0 |
getSampler(QuatSphericalLinearChannel self) > Sampler getSampler(QuatSphericalLinearChannel self) > Sampler | def getSampler(self, *args):
return _osgAnimation.QuatSphericalLinearChannel_getSampler(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getOrCreateSampler(self):\n return _osgAnimation.QuatSphericalLinearChannel_getOrCreateSampler(self)",
"def getSamplerTyped(self, *args):\n return _osgAnimation.QuatSphericalLinearChannel_getSamplerTyped(self, *args)",
"def setSampler(self, *args):\n return _osgAnimation.QuatSphericalL... | [
"0.82451427",
"0.75768375",
"0.7296899",
"0.71176016",
"0.6360652",
"0.6273774",
"0.61006397",
"0.59200025",
"0.5919303",
"0.5790939",
"0.5686584",
"0.5530702",
"0.5459947",
"0.5405197",
"0.5391311",
"0.53387195",
"0.5319086",
"0.53098226",
"0.529171",
"0.52746695",
"0.526340... | 0.86099213 | 0 |
getSamplerTyped(QuatSphericalLinearChannel self) > QuatSphericalLinearSampler getSamplerTyped(QuatSphericalLinearChannel self) > QuatSphericalLinearSampler | def getSamplerTyped(self, *args):
return _osgAnimation.QuatSphericalLinearChannel_getSamplerTyped(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getSampler(self, *args):\n return _osgAnimation.QuatSphericalLinearChannel_getSampler(self, *args)",
"def getOrCreateSampler(self):\n return _osgAnimation.QuatSphericalLinearChannel_getOrCreateSampler(self)",
"def setSampler(self, *args):\n return _osgAnimation.QuatSphericalLinearChann... | [
"0.7668043",
"0.7511827",
"0.65532357",
"0.6281618",
"0.5985041",
"0.57574904",
"0.5586765",
"0.55727935",
"0.54540706",
"0.5443795",
"0.5434866",
"0.5320399",
"0.5116284",
"0.5083763",
"0.5017123",
"0.5001447",
"0.4991562",
"0.4977302",
"0.49722192",
"0.49717724",
"0.4967407... | 0.867386 | 0 |
setTarget(QuatSphericalLinearChannel self, Target target) > bool | def setTarget(self, *args):
return _osgAnimation.QuatSphericalLinearChannel_setTarget(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getTarget(self):\n return _osgAnimation.QuatSphericalLinearChannel_getTarget(self)",
"def __bool__(self):\n return _osgAnimation.vectorQuatKeyframe___bool__(self)",
"def setTarget(self, *args):\n return _osgAnimation.Channel_setTarget(self, *args)",
"def _test_stick_position(self, ta... | [
"0.67601365",
"0.6046661",
"0.5796687",
"0.56986105",
"0.5662002",
"0.56230754",
"0.5542961",
"0.5526312",
"0.5504033",
"0.54429656",
"0.5438362",
"0.5367946",
"0.5289093",
"0.5286614",
"0.5260741",
"0.52192605",
"0.5214541",
"0.5161902",
"0.5153357",
"0.5147111",
"0.5140953"... | 0.7824745 | 0 |
front(vectorVec2Keyframe self) > Vec2Keyframe | def front(self):
return _osgAnimation.vectorVec2Keyframe_front(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def front(self):\n return _osgAnimation.vectorVec3Keyframe_front(self)",
"def front(self):\n return _osgAnimation.vectorVec4Keyframe_front(self)",
"def front(self):\n return _osgAnimation.vectorFloatKeyframe_front(self)",
"def front(self):\n return _osgAnimation.vectorQuatKeyframe... | [
"0.8065363",
"0.7982883",
"0.79186827",
"0.7395023",
"0.73833066",
"0.71692276",
"0.69484735",
"0.69246036",
"0.67608935",
"0.67313665",
"0.6592448",
"0.65443164",
"0.6485601",
"0.6484666",
"0.646362",
"0.63699394",
"0.63693947",
"0.6362699",
"0.6342047",
"0.63103014",
"0.628... | 0.8433546 | 0 |
front(vectorVec3Keyframe self) > Vec3Keyframe | def front(self):
return _osgAnimation.vectorVec3Keyframe_front(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def front(self):\n return _osgAnimation.vectorVec2Keyframe_front(self)",
"def front(self):\n return _osgAnimation.vectorVec4Keyframe_front(self)",
"def front(self):\n return _osgAnimation.vectorFloatKeyframe_front(self)",
"def front(self):\n return _osgAnimation.vectorQuatKeyframe... | [
"0.8363345",
"0.8248409",
"0.8230903",
"0.778477",
"0.7642741",
"0.71081823",
"0.6961184",
"0.6691311",
"0.66698354",
"0.66288817",
"0.6607128",
"0.6586686",
"0.64884436",
"0.6449567",
"0.64391786",
"0.6428168",
"0.6414354",
"0.63341016",
"0.6313109",
"0.6303868",
"0.6293274"... | 0.8496508 | 0 |
__nonzero__(vectorMatrixKeyframe self) > bool | def __nonzero__(self):
return _osgAnimation.vectorMatrixKeyframe___nonzero__(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __nonzero__(self):\n return _osgAnimation.vectorVec3Keyframe___nonzero__(self)",
"def __nonzero__(self):\n return _osgAnimation.vectorVec4Keyframe___nonzero__(self)",
"def __nonzero__(self):\n return _osgAnimation.vectorVec2Keyframe___nonzero__(self)",
"def __nonzero__(self):\n ... | [
"0.79368603",
"0.79270333",
"0.7825658",
"0.77193314",
"0.7713585",
"0.7693118",
"0.71595794",
"0.7115232",
"0.7100689",
"0.699386",
"0.6982662",
"0.6965819",
"0.69629735",
"0.6958282",
"0.68668044",
"0.6823945",
"0.6823945",
"0.6784162",
"0.6783118",
"0.67280537",
"0.6714093... | 0.8536085 | 0 |
Returns a header with invalid auth token. | def invalid_auth_token_header():
headers = '{"Host":"$host","User-Agent":"$user_agent","Date":"DATE",'
headers += '"Accept": "application/json","Accept-Encoding": "gzip",'
headers += '"X-Project-ID": "$project_id",'
headers += '"X-Auth-Token": "InvalidToken"}'
headers = string.Template(headers)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unauthorized():\n return HttpError(401)",
"def missing_header_fields():\n auth_token = get_auth_token()\n\n headers = '{\"Host\": \"$host\",\"Date\": \"DATE\",'\n headers += '\"Accept-Encoding\": \"gzip\",'\n headers += '\"X-Auth-Token\": \"$token\"}'\n headers = string.Template(headers... | [
"0.7171218",
"0.7126481",
"0.69666386",
"0.68639034",
"0.6842354",
"0.6807138",
"0.6794132",
"0.6793327",
"0.679145",
"0.6789238",
"0.6780624",
"0.6769268",
"0.67653733",
"0.6642075",
"0.66268",
"0.66213226",
"0.66178834",
"0.66014576",
"0.6549639",
"0.6540157",
"0.6539664",
... | 0.8470616 | 0 |
Returns a header with no Accept header. | def missing_header_fields():
auth_token = get_auth_token()
headers = '{"Host": "$host","Date": "DATE",'
headers += '"Accept-Encoding": "gzip",'
headers += '"X-Auth-Token": "$token"}'
headers = string.Template(headers)
return headers.substitute(host=CFG.host, token=auth_token) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_default_header() -> dict:\n return {\"Accept\": \"application/json\"}",
"def test_content_type_header_not_automatically_added(httpbin):\n resp = requests.get(httpbin + \"/headers\").json()[\"headers\"]\n assert \"Content-Type\" not in resp",
"def create_204_response() -> bytes:\n date =... | [
"0.64759904",
"0.595047",
"0.584593",
"0.5782807",
"0.54851985",
"0.54805285",
"0.5441329",
"0.5439712",
"0.54260796",
"0.5387783",
"0.5291243",
"0.5287545",
"0.5284846",
"0.5242091",
"0.52336144",
"0.51947284",
"0.51887816",
"0.5179636",
"0.517295",
"0.5121896",
"0.5088791",... | 0.5394638 | 9 |
returns an image that is reshaped to IMG_SIZE | def format_example(image, label):
image = tf.cast(image, tf.float32)
image = (image/127.5) - 1
image = tf.image.resize(image, (IMG_SIZE, IMG_SIZE))
return image, label | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reshape_image(img_as_np, to_shape=(256, 256)):\n\n # Trim original image to have an even number of pixels (in both axes)\n if np.shape(img_as_np)[0] % 2 != 0:\n img_as_np = img_as_np[0:np.shape(img_as_np)[0] - 1, :]\n if np.shape(img_as_np)[1] % 2 != 0:\n img_as_np = img_as_np[:, 0:np.sh... | [
"0.67336714",
"0.67262787",
"0.67031413",
"0.6700795",
"0.6654481",
"0.6651598",
"0.66447824",
"0.6597278",
"0.65193534",
"0.6517176",
"0.6469964",
"0.644362",
"0.64168054",
"0.6416522",
"0.6411982",
"0.6405337",
"0.6393232",
"0.63834685",
"0.6353993",
"0.63266855",
"0.629321... | 0.0 | -1 |
Removes a member from the pool but only if it is still larger than the minimum size. Returns True if it was removed, False otherwise. | def attemptRemove(self, member):
with self.lock:
if len(self.pool) > Pyro4.config.THREADPOOL_MINTHREADS:
self.pool.remove(member)
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove(self):\n length = len(self.heap_list)\n if length == 0:\n return False\n elif length == 1:\n self.heap_list.pop()\n return True\n else:\n # exchange last data with top data and remove last data\n self.heap_list[0] = self.... | [
"0.6420775",
"0.61851734",
"0.61112195",
"0.61004734",
"0.6069845",
"0.6049702",
"0.6030171",
"0.5992376",
"0.5954967",
"0.5939633",
"0.5822543",
"0.58122396",
"0.5751114",
"0.57396084",
"0.5730906",
"0.5726818",
"0.57137775",
"0.56920326",
"0.5669334",
"0.5577556",
"0.557629... | 0.6925464 | 0 |
The rotation from the object frame to the stable pose | def object_to_stp_transform(self):
R_obj_stp = self.stable_pose.r
return RigidTransform(rotation=R_obj_stp,
from_frame='obj', to_frame='stp') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rotation(self):\n\t\treturn self.piv.a.rotate.v",
"def rotation(self):\n return self.transform.getRotation() + [0]",
"def rotation(self):\n return self._rotation",
"def rotation(self):\n return self._rotation",
"def rotation(self):\n return self._rotation",
"def rotation(s... | [
"0.755852",
"0.73098475",
"0.72031677",
"0.72031677",
"0.72031677",
"0.72031677",
"0.72031677",
"0.72031677",
"0.72031677",
"0.72031677",
"0.72031677",
"0.72031677",
"0.72031677",
"0.71451956",
"0.7063095",
"0.7049965",
"0.6876349",
"0.6866361",
"0.68622684",
"0.6848104",
"0.... | 0.0 | -1 |
Application factory, used to create application | def create_app(testing=False, cli=False):
app = Flask(__name__)
app.config.from_object("flask_cli.config")
if testing is True:
app.config["TESTING"] = True
configure_extensions(app, cli)
configure_apispec(app)
register_blueprints(app)
return app | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def app():\n app = create_app()\n return app",
"def app():\n return create_app()",
"def create():\n\n return App()",
"def create_app(self):\n raise NotImplementedError",
"def create_app():\n\n # Create app\n app = Flask(__name__)\n app.config.from_object(\"nextbus.config.Config\... | [
"0.7947476",
"0.7934086",
"0.7726531",
"0.7715676",
"0.754462",
"0.7518834",
"0.7518369",
"0.74267834",
"0.74227667",
"0.7419348",
"0.7418712",
"0.74181694",
"0.7385955",
"0.73705435",
"0.7341734",
"0.7338202",
"0.73250043",
"0.72909516",
"0.7270276",
"0.7265304",
"0.7249705"... | 0.0 | -1 |
Return the model class by its name. | def get_model(params):
module_name, class_name = params.model.name.rsplit('.', 1)
i = importlib.import_module(module_name)
return getattr(i, class_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_model_by_name(cls, name):\n model_name = inflection.camelize(name) # class name of the model to use\n model = cls.models[model_name]\n return model",
"def get_model(name):\n # Evil reflection\n model_name = name.lower()\n model_module = importlib.import_module('.'+model_nam... | [
"0.85478395",
"0.8257423",
"0.80818844",
"0.7948726",
"0.7777131",
"0.7687463",
"0.7660314",
"0.75804156",
"0.7559506",
"0.7397376",
"0.7362348",
"0.73276305",
"0.7188399",
"0.7140064",
"0.7126861",
"0.7061374",
"0.70537204",
"0.6869393",
"0.67956185",
"0.67443895",
"0.674368... | 0.7737596 | 5 |
Return the loss class by its name. | def get_loss_fn(params):
i = importlib.import_module("dlex.utils.losses")
return getattr(i, params.loss) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_loss_instance(name, **kwargs):\n if name not in losses and name.lower() not in losses:\n err_str = '\"%s\" is not among the following loss list:\\n\\t' % (name)\n err_str += '%s' % ('\\n\\t'.join(sorted(losses.keys())))\n raise ValueError(err_str)\n loss = losses[name]()\n ret... | [
"0.76192456",
"0.7608651",
"0.7243411",
"0.67179537",
"0.6561505",
"0.6413668",
"0.6373862",
"0.63277084",
"0.6291623",
"0.622353",
"0.6217859",
"0.6124568",
"0.61150193",
"0.6114964",
"0.6113145",
"0.60989475",
"0.60884124",
"0.60277796",
"0.59750766",
"0.59624213",
"0.59613... | 0.62995857 | 8 |
Checks the guest into the hotel by allocating a room | def checkin(self, guest_name):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def room_of(self, guest_name):\n pass",
"def booking(self, customer, room):\n self.room[room] = customer\n return True",
"def test_create_room(self) -> None:\n\n self._perform_background_initial_update()\n\n u1 = self.register_user(\"u1\", \"pass\")\n u1token = self.lo... | [
"0.7328556",
"0.6624573",
"0.62834215",
"0.62243193",
"0.61463434",
"0.58444923",
"0.5812949",
"0.5758757",
"0.57580644",
"0.5684367",
"0.5656415",
"0.56523466",
"0.5641614",
"0.56246924",
"0.55623263",
"0.5540933",
"0.5530623",
"0.5525462",
"0.5481893",
"0.5479194",
"0.54749... | 0.5792137 | 7 |
Home page of app with form | def home():
# Create form
screamForm = ImageForm(prefix="screamForm")
laMuseForm = ImageForm(prefix="laMuseForm")
rainPrincessForm = ImageForm(prefix="rainPrincessForm")
udnieForm = ImageForm(prefix="udnieForm")
waveForm = ImageForm(prefix="waveForm")
wreckForm = ImageForm(prefix="wre... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def home():\n return render_template('home.html', form=None)",
"def home():\n form = AddCupcakeForm()\n return render_template(\"home.html\", form=form)",
"def home():\n\n form = HomePageForm()\n if form.validate_on_submit():\n return redirect(url_for('character'))\n return render_temp... | [
"0.80366963",
"0.78754795",
"0.76532954",
"0.75976074",
"0.7335663",
"0.7297236",
"0.7277349",
"0.71310645",
"0.7129768",
"0.70617735",
"0.7053414",
"0.6994699",
"0.6939214",
"0.68766326",
"0.6874456",
"0.68599737",
"0.68535376",
"0.68534094",
"0.67980325",
"0.6772223",
"0.67... | 0.0 | -1 |
Returns a random advert for ``ad_zone``. The advert returned is independent of the category In order for the impression to be saved add the following | def random_zone_ad(context, ad_zone):
to_return = {}
# Retrieve a random ad for the zone
ad = AdBase.objects.get_random_ad(ad_zone)
to_return['ad'] = ad
# Record a impression for the ad
if context.has_key('from_ip') and ad:
from_ip = context.get('from_ip')
try:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_random_ad(self, ad_zone, ad_category=None):\r\n qs = self.get_query_set().filter(start_showing__lte=now(),\r\n stop_showing__gte=now(),\r\n zone__slug=ad_zone,\r\n sites=Site.objec... | [
"0.84900063",
"0.80265826",
"0.632558",
"0.5960999",
"0.55323756",
"0.5373538",
"0.52149314",
"0.52085847",
"0.5206343",
"0.5201754",
"0.5179042",
"0.5066888",
"0.5053532",
"0.4985258",
"0.49640742",
"0.4950496",
"0.48759252",
"0.4815963",
"0.47899324",
"0.47237623",
"0.47098... | 0.8084852 | 1 |
Return extra academic education and first_name and last_name. | def __str__(self):
return f'{self.user.first_name} {self.user.last_name} | {self.title}' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_edu_fields():\n edu_hs_men_fields = [\n 'B15002_003E', #\tMale:!!No schooling completed\t\n 'B15002_004E', #\tMale:!!Nursery to 4th grade\t\n 'B15002_005E', #\tMale:!!5th and 6th grade\t\n 'B15002_006E', #\tMale:!!7th and 8th grade\t\n ... | [
"0.6190095",
"0.60505766",
"0.5995042",
"0.5923879",
"0.59105974",
"0.58602655",
"0.57817024",
"0.576465",
"0.5747478",
"0.57179195",
"0.571135",
"0.5690954",
"0.56892157",
"0.56813854",
"0.5681327",
"0.5668021",
"0.5658436",
"0.565256",
"0.5586932",
"0.5584328",
"0.5581272",... | 0.0 | -1 |
Draws the player's current score in the topleft corner of the screen. | def draw_score(score: int):
arcade.draw_text(
"Number of Wins: " + str(score), 0, WINDOW_HEIGHT - 30, arcade.color.WHITE, 20
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw_score(self):\n score_text = \"Score: {}\".format(self.score)\n start_x = 10\n start_y = (SCREEN_HEIGHT - 20)\n arcade.draw_text(score_text, start_x=start_x, start_y=start_y, font_size=12, color=arcade.color.BLACK)",
"def draw_score(self):\n score_text = \"Score: {}\".f... | [
"0.77459466",
"0.7734247",
"0.77134585",
"0.75977755",
"0.7547121",
"0.75321096",
"0.7519488",
"0.747745",
"0.7468346",
"0.7414069",
"0.734158",
"0.732659",
"0.73095906",
"0.72535187",
"0.72357994",
"0.720129",
"0.7187288",
"0.71744454",
"0.71603036",
"0.71263456",
"0.7076789... | 0.7252257 | 14 |
Downgrades the skill by one level and calls functions to update the UI. | def downgrade_skill(self, skill_string):
skill = self.__skills[skill_string]
skill.skill_level -= 1
# Updates the UI and skill point value
self.update_skill_level_info(skill_string)
self.update_skill_info_box(skill_string)
self.deduct_skill_points(-skill.points_to... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def level_down(self):\n if self.level > 1:\n self.level = self.level - 1\n self.update_level_buttons()",
"def upgrade_skill(self, skill_string):\r\n skill = self.__skills[skill_string]\r\n skill.skill_level += 1\r\n\r\n # Downgrading enabled the first time a skil... | [
"0.6584728",
"0.6349853",
"0.62587184",
"0.6178582",
"0.6147785",
"0.6128223",
"0.59969383",
"0.598178",
"0.59790236",
"0.5943472",
"0.59255123",
"0.5909471",
"0.5833051",
"0.58173466",
"0.57955605",
"0.5747227",
"0.5727345",
"0.5675517",
"0.5612633",
"0.55926985",
"0.5588372... | 0.7600707 | 0 |
Initialize probability space for a Gaussian process. | def __init__(self, mean_func, cov_func, index_set=Reals()):
def draw():
return get_gaussian_process_result(
mean_func,
cov_func,
index_set)
super().__init__(draw) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gaussian_prior(self):\n self.prior = sps.multivariate_normal(self.m0,self.S0)",
"def initializeDistribution(self):\n if self.nPoints is None:\n self.xArray = np.arange(self.lowerBound,self.upperBound+1)\n else:\n self.xArray = np.linspace(self.lowerBound,self.upperBound,self.nPoint... | [
"0.6863067",
"0.6811164",
"0.67381275",
"0.67330414",
"0.6681775",
"0.6593535",
"0.65336555",
"0.6520978",
"0.6517843",
"0.64866436",
"0.64600664",
"0.64277977",
"0.6388867",
"0.6384629",
"0.63822746",
"0.6373511",
"0.6358679",
"0.62960005",
"0.6265503",
"0.6257156",
"0.62109... | 0.0 | -1 |
Computes distance between two clusters. cluster1 and cluster2 are lists of lists of points | def clusters_distance(cluster1, cluster2):
return max([euclidean_distance(point1, point2) for point1 in cluster1 for point2 in cluster2]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clusters_distance_2(cluster1, cluster2):\n cluster1_center = np.average(cluster1, axis=0)\n cluster2_center = np.average(cluster2, axis=0)\n return euclidean_distance(cluster1_center, cluster2_center)",
"def clusters_distance_2(cluster1, cluster2):\n cluster1_center = np.average(cluster1, axis=0)... | [
"0.84950584",
"0.84950584",
"0.7666566",
"0.7642027",
"0.75466186",
"0.7517962",
"0.7284307",
"0.72558326",
"0.70726603",
"0.70726603",
"0.69029874",
"0.68913144",
"0.68742865",
"0.6873431",
"0.687046",
"0.6849447",
"0.6848603",
"0.67718107",
"0.6760955",
"0.6723617",
"0.6718... | 0.84979695 | 0 |
Computes distance between two centroids of the two clusters cluster1 and cluster2 are lists of lists of points | def clusters_distance_2(cluster1, cluster2):
cluster1_center = np.average(cluster1, axis=0)
cluster2_center = np.average(cluster2, axis=0)
return euclidean_distance(cluster1_center, cluster2_center) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clusters_distance(cluster1, cluster2):\n return max([euclidean_distance(point1, point2) for point1 in cluster1 for point2 in cluster2])",
"def __between_cluster_distance(self,cluster_1,cluster_2,condensed_distance_matrix):\n mixed_cohesion = 0\n for c_i in cluster_1.all_elements:\n ... | [
"0.8317162",
"0.72761196",
"0.72618496",
"0.72126836",
"0.71731675",
"0.71348757",
"0.7057509",
"0.69589746",
"0.6861213",
"0.6861213",
"0.6796088",
"0.66974044",
"0.6620172",
"0.6599817",
"0.657282",
"0.6552511",
"0.64893115",
"0.6485607",
"0.64778876",
"0.6475829",
"0.64754... | 0.8427839 | 1 |
Initialize the weights of a layer with fan_in incoming connections and fan_out outgoing connections using a fixed strategy, this will help you later in debugging W = debugInitializeWeights(fan_in, fan_out) initializes the weights of a layer with fan_in incoming connections and fan_out outgoing connections using a fix s... | def debugInitializeWeights(fan_out, fan_in):
# Initialize W using "sin", this ensures that W is always of the same
# values and will be useful for debugging
W = np.sin(np.arange(1, fan_out * (1 + fan_in) + 1)
).reshape((fan_out, 1 + fan_in)) / 10
return W | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def debugInitializeWeights(fan_out, fan_in):\n\n # Set W to zeros\n W = np.zeros((fan_out, 1 + fan_in))\n\n # Initialize W using \"sin\", this ensures that W is always of the same\n # values and will be useful for debugging\n W = np.reshape(np.sin(range(1, W.size+1)), W.T.shape).T / 10.0\n return... | [
"0.7743061",
"0.68028766",
"0.6787294",
"0.67453",
"0.67453",
"0.66968733",
"0.66937387",
"0.66887116",
"0.6687483",
"0.6644708",
"0.6640607",
"0.6610592",
"0.66074085",
"0.65632224",
"0.65632224",
"0.65632224",
"0.6558615",
"0.6525018",
"0.6522898",
"0.6518632",
"0.6515618",... | 0.7810011 | 0 |
Gets the status of this AsyncDocStatus. The present status of the document. Can be queued, working, completed, and failed. | def status(self):
return self._status | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def status(self):\n with self.__lock:\n assert(self.__complete)\n return self.__status",
"def status(self):\n assert(self.__complete)\n return self.__status",
"def get_status(self):\n return self._status",
"def getStatus(self):\n return self._status",
... | [
"0.723874",
"0.720359",
"0.7004345",
"0.6985238",
"0.6967074",
"0.69161177",
"0.68762755",
"0.6850544",
"0.6847432",
"0.68465966",
"0.68465966",
"0.68465966",
"0.6822626",
"0.6822626",
"0.67603797",
"0.67586154",
"0.67586154",
"0.67586154",
"0.6740265",
"0.67341536",
"0.67205... | 0.6839136 | 31 |
Sets the status of this AsyncDocStatus. The present status of the document. Can be queued, working, completed, and failed. | def status(self, status):
self._status = status | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setstatus(self, status):\n with self.lock:\n self.status = status",
"def status(self, status):\n\n self._status = status",
"def status(self, status):\n\n self._status = status",
"def status(self, status):\n\n self._status = status",
"def status(self, status):\n\n ... | [
"0.7290507",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.71381",
"0.7122333",
... | 0.7102393 | 29 |
Gets the download_url of this AsyncDocStatus. The URL where the document can be retrieved. This URL may only be used a few times. | def download_url(self):
return self._download_url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_download_url(self):\n\n\t\treturn self.__download_url",
"def download_url(self) -> str:\n return self._download_url",
"def url(self) -> str:\n if self._download_path is None:\n raise ValueError(\"No download URL given.\")\n return urljoin(self._download_path, self.filena... | [
"0.7807059",
"0.7772749",
"0.70838135",
"0.7039731",
"0.68267274",
"0.664291",
"0.6564549",
"0.6378348",
"0.6355755",
"0.63386124",
"0.6300296",
"0.6283362",
"0.6161326",
"0.613003",
"0.6122332",
"0.60806066",
"0.6065637",
"0.60436374",
"0.60237294",
"0.6022218",
"0.5977692",... | 0.78682 | 0 |
Sets the download_id of this AsyncDocStatus. The identifier for downloading the document with the download api. | def download_id(self, download_id):
self._download_id = download_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def download_id(self):\n return self._download_id",
"def download_url(self, download_url):\n\n self._download_url = download_url",
"def download_url(self, download_url):\n self._download_url = download_url",
"def set_download_url(self, download_url):\n\n\t\tif download_url is not None an... | [
"0.6302446",
"0.6031977",
"0.59505713",
"0.59360814",
"0.58640856",
"0.58307433",
"0.56417936",
"0.5282904",
"0.5232025",
"0.52046293",
"0.5200611",
"0.5156838",
"0.5136283",
"0.51172394",
"0.5095901",
"0.50585604",
"0.50503415",
"0.50364214",
"0.50280803",
"0.49903342",
"0.4... | 0.7889768 | 0 |
Gets the message of this AsyncDocStatus. Additional information. | def message(self):
return self._message | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_status(self):\n return self.msg",
"def get_message(self):\n return self.msg",
"def get_message (self) :\n return self._message",
"def status_message(self) -> Optional[str]:\n return pulumi.get(self, \"status_message\")",
"def getMessage(self):\n return self.messag... | [
"0.72414696",
"0.71576244",
"0.7132995",
"0.70666367",
"0.7042803",
"0.7042803",
"0.7040044",
"0.70205307",
"0.70061773",
"0.70061773",
"0.69759494",
"0.6936041",
"0.6936041",
"0.6936041",
"0.6936041",
"0.6936041",
"0.6936041",
"0.68784094",
"0.6868812",
"0.6817805",
"0.68178... | 0.6914406 | 20 |
Returns true if both objects are equal | def __eq__(self, other):
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.80885184",
"0.80885184",
"0.805514",
"0.7983044",
"0.79614645",
"0.79614645",
"0.7942978",
"0.79307914",
"0.79270965",
"0.78980374",
"0.78832436",
"0.78832436",
"0.78809714",
"0.7873277",
"0.7868898",
"0.78659886",
"0.78258073",
"0.7820066",
"0.7816123",
"0.7807926",
"0.78... | 0.7966715 | 32 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.84568954",
"0.83923674",
"0.81447554",
"0.81407183",
"0.81326675",
"0.80941343",
"0.8092415",
"0.8092415",
"0.8092415",
"0.8085536",
"0.8085536",
"0.8076502",
"0.8076502",
"0.8066026"
] | 0.0 | -1 |
Applies the CDF from the Student t distribution as the activation rather than a sigmoid. | def robit(x, df=1):
from tensorflow_probability import distributions
return distributions.StudentT(df, 0, 1).cdf(x) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def d_act_f(self, p):\n if self.activation is None:\n return p\n if self.activation == \"tanh\":\n return 1 - np.tanh(p)**2\n if self.activation == \"sigmoid\":\n return (1 / (1 + np.exp(-p))) * (1 - (1 / (1 + np.exp(-p))))\n if self.activation == \"relu... | [
"0.6218174",
"0.59291404",
"0.5907676",
"0.589417",
"0.5879768",
"0.58462185",
"0.581379",
"0.5802906",
"0.5769178",
"0.57469946",
"0.5743274",
"0.5717614",
"0.5715907",
"0.57095414",
"0.57067794",
"0.57000726",
"0.565952",
"0.56565773",
"0.56367815",
"0.56364924",
"0.5579825... | 0.0 | -1 |
Applies the CDF from the Normal distribution as the activation rather than a sigmoid | def probit(x):
from tensorflow_probability import distributions
return distributions.Normal(0, 1).cdf(x) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _normal_distribution_cdf(x, stddev):\n return 0.5 * (1.0 + tf.erf(x / (math.sqrt(2) * stddev + 1e-20)))",
"def normal_cdf(x: torch.Tensor) -> torch.Tensor:\n return torch.distributions.Normal(0, 1.0).cdf(x)",
"def d_act_f(self, p):\n if self.activation is None:\n return p\n i... | [
"0.6685284",
"0.65952045",
"0.6538369",
"0.6522903",
"0.6443323",
"0.6341026",
"0.6320909",
"0.62920564",
"0.6236386",
"0.6233232",
"0.62117773",
"0.620038",
"0.6191479",
"0.61841357",
"0.6179537",
"0.61103344",
"0.610421",
"0.61017793",
"0.6077832",
"0.60741866",
"0.6060603"... | 0.57565045 | 43 |
Google brain team new activation. Their experiments show that Swish tends to work better than ReLU on deeper models across a number of challenging data sets This make ReLU derivative continuous for all values of x | def swish(x):
return x * k.activations.sigmoid(x) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ReLU(self, x):\n self.x = x\n output = np.maximum(0, x)\n return output",
"def run(self, x):\n \"*** YOUR CODE HERE ***\"\n layer1 = nn.ReLU(nn.AddBias(nn.Linear(x, self.layer1), self.bias1))\n layer2 = nn.ReLU(nn.AddBias(nn.Linear(layer1, self.layer2), self.bias2))\n lay... | [
"0.7032113",
"0.69784445",
"0.6964537",
"0.6921367",
"0.6888361",
"0.6884788",
"0.6868909",
"0.6842996",
"0.6825373",
"0.6801986",
"0.67866147",
"0.67793405",
"0.6767209",
"0.6764031",
"0.67433524",
"0.674308",
"0.6736656",
"0.6733296",
"0.67324734",
"0.67060316",
"0.6692789"... | 0.0 | -1 |
Return the execute table as a data frame | def get_execute_table(self, limit=None):
query = self.select_all()
self.cur.execute(query)
if limit is None:
result = self.cur.fetchall()
else:
result = self.cur.fetchmany(limit)
return to_data_frame(result) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_execute_table(self):\n return self.get_table(self._EXECUTE_LIST)",
"def get_df(self) -> pd.DataFrame:\n return pd.DataFrame(self.fetchall(), columns=self.headers())",
"def as_DataFrame (self):\n return DataFrame(self.table)",
"def targets_to_dataframe(conn):\n return connect_d... | [
"0.7248217",
"0.68042606",
"0.65944356",
"0.6581562",
"0.65078425",
"0.6500838",
"0.6437194",
"0.64358824",
"0.641033",
"0.63869965",
"0.6378579",
"0.6332088",
"0.6309337",
"0.63078797",
"0.62618005",
"0.62390244",
"0.62309873",
"0.6196431",
"0.6182403",
"0.6176415",
"0.61549... | 0.7991539 | 0 |
Return the status for the scenario | def get_status(self, scenario_id):
table = self.get_execute_table()
try:
return table.loc[int(scenario_id), "status"]
except KeyError:
raise Exception(f"Scenario not found in execute list, id = {scenario_id}") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_status(self):\n return self.status",
"def get_status(self):\n return self.status",
"def get_status(self):\n return self.status",
"def GetStatus(self):\r\n return self.status",
"def _get_status(self):\n return self.__status",
"def test_get_status(self):\n pass",
... | [
"0.73648757",
"0.73648757",
"0.73648757",
"0.7347757",
"0.71756333",
"0.71622896",
"0.71622896",
"0.7138609",
"0.71175116",
"0.71011883",
"0.7098669",
"0.7098669",
"0.7098669",
"0.7098669",
"0.7098669",
"0.7098669",
"0.7098669",
"0.7098669",
"0.7098669",
"0.7098669",
"0.70986... | 0.7735107 | 0 |
Return a list of projects for provided language(s) | def projects(self, langs=True) -> List['RadsProjectVersion']:
dependencies = self.dependencies()
if langs is False:
return dependencies[None]
elif langs is True:
return list({pv for pvs in dependencies.values() for pv in pvs})
elif isinstance(langs, Language):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def db_projects():\n return [{\"name\": \"IT\"}, {\"name\": \"Financial\"}, {\"name\": \"Failed\"}]",
"def list_projects(arn=None, nextToken=None):\n pass",
"def list_projects():\n if '.wcscanner' not in os.listdir(context.__BASE_PATH__):\n return []\n return os.listdir(context.__PROJECTS_PA... | [
"0.6949032",
"0.68110335",
"0.6801866",
"0.67276114",
"0.66389954",
"0.66282266",
"0.6611712",
"0.6550908",
"0.65373105",
"0.6514981",
"0.6451912",
"0.6411102",
"0.64047134",
"0.6402258",
"0.6393683",
"0.6384294",
"0.63665694",
"0.6341216",
"0.63257337",
"0.6308958",
"0.62825... | 0.71614444 | 0 |
Returns the variables to be set for this test | def getVariables(self)->Dict[str,str]:
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_test_variables():\n if __name__ == \"__main__\":\n return _MOCKUP_TEST_VARIABLES\n else:\n return BuiltIn().get_variables()",
"def get_variables(self):\n\t\treturn self.variables",
"def variables(self):\n return self._.vars",
"def get_variables(self):\n return self.... | [
"0.778573",
"0.7729801",
"0.75593823",
"0.74253595",
"0.7350923",
"0.7316454",
"0.7258797",
"0.7156751",
"0.71461374",
"0.70772284",
"0.7071317",
"0.70551056",
"0.69713473",
"0.6948332",
"0.6904692",
"0.6868844",
"0.6868329",
"0.68664706",
"0.686448",
"0.68555677",
"0.6850635... | 0.68105525 | 24 |
One step in the spread activation model. | def spread_activation_step(self, graph, attribute, spreading_factor, transfer_function):
# Pass influence/message to neighboring nodes (weighted/unweighted option)
if transfer_function == "unweighted":
msgToSrc = (AM.src[attribute] / AM.src["outDegree"]) * (1 - spreading_factor)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def spread_activation_full(self, steps=0):\n\n # Compute degrees\n self.compute_degrees(self.graph)\n\n graph = self.graph\n\n # Number of iterations specified for spread activation\n for s in range(0, steps, 1):\n graph = self.spread_activation_step(graph, self.attrib... | [
"0.643476",
"0.6403131",
"0.63698",
"0.62653136",
"0.6193774",
"0.6146834",
"0.60961133",
"0.6095267",
"0.60912776",
"0.60909206",
"0.6061919",
"0.6050818",
"0.6038091",
"0.6025377",
"0.6019413",
"0.60176396",
"0.5987613",
"0.5983707",
"0.59660816",
"0.5956088",
"0.5936325",
... | 0.5919511 | 22 |
random_line() generate random points arround y=ax+b, with normal distribution defined using sigma | def random_line(a, b, sigma, size=10,start=-1,end=1):
xdata = np.linspace(start,end,size)
errors = scipy.stats.norm.rvs(loc=0,scale=sigma, size=size)
ydata = a*xdata + b + errors
return xdata, ydata | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_line(bound_x, bound_y, length):\n x = random.randint(200 + length, bound_x - length)\n y = random.randint(200 + length, bound_y - length)\n center = np.array([x, y])\n rotation = random.randint(0, 360)\n return line(center, length, rotation=rotation)",
"def make_line(x = np.linspace(sta... | [
"0.6309467",
"0.61940557",
"0.5970699",
"0.58195865",
"0.57621354",
"0.5750892",
"0.56999284",
"0.56780493",
"0.5676394",
"0.5619872",
"0.56198627",
"0.55939573",
"0.5593757",
"0.5592452",
"0.55839324",
"0.5549936",
"0.5531634",
"0.5503544",
"0.5497506",
"0.54779077",
"0.5473... | 0.8152146 | 0 |
Loads a split from the COCO dataset using TensorFlow Datasets. | def coco_load_split_from_tfds(batch_size,
*,
train,
preprocess_fn,
decode_fn,
cache=False,
max_size=1333,
max_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load(cfg, train_mode, split, shot, query,\n bs, test_bs, num_workers, pin_memory,\n ret_name=False):\n if train_mode == \"train\":\n dataset = COCOTrain(cfg, split, shot, query, ret_name=ret_name)\n data_loader = DataLoader(dataset,\n batch_size=... | [
"0.6909112",
"0.6185758",
"0.61426765",
"0.60438067",
"0.60333097",
"0.60038745",
"0.5962444",
"0.59112763",
"0.58521676",
"0.5845736",
"0.5791337",
"0.5789342",
"0.57810324",
"0.5770613",
"0.5751475",
"0.57213",
"0.5706892",
"0.5692091",
"0.5678159",
"0.5668145",
"0.5649371"... | 0.6432584 | 1 |
This API is used to invalidate the email verification. | def invalidate_email(self, accountid, verificationUrl = '', emailTemplate = ''):
auth = 'appkey='+ self._lr_object._get_api_key()+ '&appsecret='+ self._lr_object._get_api_secret() + '&accountid=' + accountid + '&emailTemplate='+emailTemplate+'&verificationUrl='+verificationUrl
payload = {}
url ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verifyemail(request,id=None,key=None):\n logging.debug('')\n if settings.EMAIL_VALIDATION == True:\n user = User.objects.get(id=id)\n if user:\n if user.email_key == key:\n user.email_isvalid = True\n clear_email_validation_message(user)\n ... | [
"0.61499083",
"0.6082256",
"0.59198296",
"0.58638036",
"0.5826079",
"0.58233464",
"0.57115096",
"0.5702195",
"0.5668602",
"0.56640327",
"0.5653453",
"0.5652808",
"0.564709",
"0.56412137",
"0.5617363",
"0.5605823",
"0.5600848",
"0.55849373",
"0.55691856",
"0.5553734",
"0.55523... | 0.81182784 | 0 |
Tests the method which let us overwrite the `env_file_path` attribute. | def test_set_env_file_path_attribute(self) -> None:
given = self.temp_env_file.name
expected = given
self.helper.env_file_path = given
actual = self.helper.env_file_path
self.assertEqual(expected, actual) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_set_env_file_path_method(self) -> None:\n\n given = self.temp_env_file.name\n expected = given\n\n self.helper.set_env_file_path(given)\n\n actual = self.helper.env_file_path\n\n self.assertEqual(expected, actual)",
"def test_set_env_file_path_through_init(self) -> Non... | [
"0.8141756",
"0.7732138",
"0.7600063",
"0.7491916",
"0.7300452",
"0.72969884",
"0.7249622",
"0.70130485",
"0.7006759",
"0.6996864",
"0.6912605",
"0.6820626",
"0.68103284",
"0.6667747",
"0.66361684",
"0.6596832",
"0.6580142",
"0.6518855",
"0.6501179",
"0.6490418",
"0.64493644"... | 0.8232186 | 0 |
Tests the overwritting of the dotenv file to work with through the class constructor. | def test_set_env_file_path_through_init(self) -> None:
given = self.temp_env_file.name
expected = given
helper = EnvironmentVariableHelper(env_file_path=given)
actual = helper.env_file_path
self.assertEqual(expected, actual) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup_method(self, method):\n super().setup_method(method)\n\n Env.ENVIRON = {}\n self.env.read_env(\n Path(__file__, is_file=True)('test_env.txt'),\n PATH_VAR=Path(__file__, is_file=True).__root__\n )",
"def setup_method(self, method):\n super().setup... | [
"0.70570743",
"0.67725044",
"0.6657131",
"0.6507074",
"0.6493518",
"0.64690834",
"0.6461615",
"0.6449538",
"0.6429276",
"0.6425758",
"0.64113754",
"0.6392906",
"0.63880444",
"0.6387346",
"0.6387346",
"0.6387346",
"0.6387346",
"0.6387346",
"0.6387346",
"0.6366228",
"0.63599837... | 0.66786605 | 2 |
Tests of the method which let us get the value of an environment variable. | def test_get_value(self) -> None:
expected = False
actual = self.helper.set_name(self.test_name).exists()
self.assertEqual(expected, actual)
expected = "Hello"
actual = self.helper.get_value(default="Hello")
self.assertEqual(expected, actual)
expected = "This... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_environment_string(self):\n pass",
"def getenv_check(e):\n res = os.getenv(e)\n if res == None:\n print(e, 'environment variable not set - stopping.')\n exit(1)\n else:\n return res",
"def _get_env(key: str) -> str:\n value = os.getenv(key)\n asse... | [
"0.81489944",
"0.7380394",
"0.7276479",
"0.7231966",
"0.72151613",
"0.7169936",
"0.71304643",
"0.7020597",
"0.6994323",
"0.69920516",
"0.69704676",
"0.68934155",
"0.6860331",
"0.68373275",
"0.6820063",
"0.6808715",
"0.6798044",
"0.6797476",
"0.6773118",
"0.67285764",
"0.67137... | 0.730285 | 2 |
Tests of the method which let us get the value of an environment variable from a given environment file. | def test_get_value_from_file(self) -> None:
self.temp_env_file.write("IS_THIS_A_GHOST=yes\n")
self.temp_env_file.seek(0)
self.helper.set_env_file_path(self.temp_env_file.name)
self.helper.set_name("IS_THIS_A_GHOST")
expected = "yes"
actual = self.helper.get_value_from... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_environment_string(self):\n pass",
"def test_set_value_in_env_file(self) -> None:\n\n self.helper.set_env_file_path(self.temp_env_file.name)\n self.helper.set_name(\"GHOST_FINDER\")\n\n self.assertIsNone(self.helper.get_value())\n\n expected = 'GHOST_FINDER=\"no\"\... | [
"0.7609635",
"0.75933284",
"0.7501105",
"0.70761657",
"0.6990133",
"0.69771934",
"0.6938293",
"0.6917027",
"0.6878822",
"0.68437016",
"0.6750081",
"0.67387885",
"0.66934776",
"0.66770893",
"0.66726995",
"0.6660976",
"0.663651",
"0.65973866",
"0.6596692",
"0.6585537",
"0.65763... | 0.8072646 | 0 |
Gets the ddos_protection of this VultrExtra. | def ddos_protection(self):
return self._ddos_protection | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ddos_protection(self, ddos_protection):\n\n self._ddos_protection = ddos_protection",
"def protection_level(self) -> str:\n return pulumi.get(self, \"protection_level\")",
"def protection_level(self) -> str:\n return pulumi.get(self, \"protection_level\")",
"def deletion_protection_e... | [
"0.62957275",
"0.5979247",
"0.5979247",
"0.58388436",
"0.5585266",
"0.5288179",
"0.5243333",
"0.5241695",
"0.523109",
"0.51940817",
"0.5178158",
"0.51279926",
"0.5077495",
"0.49909016",
"0.49831268",
"0.49084103",
"0.48972774",
"0.48661712",
"0.48605096",
"0.4850107",
"0.4832... | 0.840142 | 0 |
Single forward pass of the encoder network | def forward(self, x, lengths):
orig_len = x.shape[1]
lengths, sort_idx = torch.sort(lengths, dim=0, descending=True)
x = x[sort_idx]
x = pack_padded_sequence(x, lengths, batch_first=True)
self.lstm.flatten_parameters()
enc_hiddens, (last_hidden, last_cell) = self.lstm(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward(self, x):\n # Get results of encoder network\n q = self.encode_nn(x)\n\n return q",
"def forward(self, x, mask):\n x = self.sublayer[0](x, lambda x: self.self_attn(x, x, x, mask))\n #print('encoder')\n #print(x.shape)\n return self.sublayer[1](x, self.... | [
"0.74813545",
"0.7365391",
"0.72568727",
"0.7221666",
"0.7195801",
"0.71945107",
"0.71886855",
"0.7164444",
"0.71220464",
"0.7091186",
"0.7053123",
"0.7053123",
"0.6987717",
"0.6979732",
"0.69664985",
"0.69167846",
"0.6909628",
"0.6838496",
"0.6825931",
"0.6812424",
"0.680989... | 0.0 | -1 |
Single forward pass of the attention layer | def forward(self, context, question, c_masks):
# context_hidden_proj = self.attn_proj(context) # shape (batch_size, context_len, hidden_size)
logits_1 = torch.bmm(self.attn_proj_1(context), torch.unsqueeze(question, 2)) # shape (batch_size, context_len, 1)
logits_1 = torch.squeeze(logits_1, -1)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward(self, graph, feat):\n graph = graph.local_var()\n\n if isinstance(feat, tuple):\n h_src = self.feat_drop(feat[0])\n h_dst = self.feat_drop(feat[1])\n feat_src = self.fc_src(h_src).view(-1, self._num_heads, self._out_feats)\n feat_dst = self.fc_dst(h_dst).view(-1, self._num_hea... | [
"0.72906554",
"0.7258266",
"0.72058797",
"0.7014525",
"0.70072496",
"0.6882194",
"0.6881467",
"0.68357396",
"0.6811991",
"0.6746873",
"0.6746708",
"0.67429084",
"0.6733677",
"0.6718873",
"0.6689221",
"0.66772145",
"0.6661679",
"0.664648",
"0.66385335",
"0.66237247",
"0.661815... | 0.0 | -1 |
Get varnams set to this ragam | def get_varnams(self, varnam_list):
self.varnams = [[v.name, v.composer, v.talam] for v in varnam_list
if v.raga == self.name] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_vars(self):\n return [self.mu, self.var]",
"def variables(self):\r\n return self.get_field('variable')",
"def vars(self):\n return self.v",
"def variables(self):\n return {u for u in self if u.type == 'var'}",
"def get_variables(self):\n\t\treturn self.variables",
"def var... | [
"0.7449364",
"0.7140687",
"0.71302146",
"0.70934165",
"0.7057523",
"0.6990409",
"0.69707793",
"0.69103426",
"0.68455225",
"0.68237156",
"0.67911285",
"0.6787537",
"0.67248917",
"0.668836",
"0.66356504",
"0.66289586",
"0.6624777",
"0.6613692",
"0.65869045",
"0.65647393",
"0.65... | 0.7035654 | 5 |
Transliterates string, list of strings and list of list of strings | def transliterate(trans, item):
if isinstance(item, str):
return trans.get(item, item)
if isinstance(item, list) and len(item) > 0:
if isinstance(item[0], str):
return [trans.get(i, i) for i in item]
if isinstance(item[0], list):
return [[trans.get(i, i) for i in ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def string_list_to_actg(b: list[list[str]]) -> list[list[str]]:\r\n s_out = b\r\n for i in range(len(s_out)):\r\n for j in range(len(s_out[i])):\r\n s_out[i][j] = single_string_to_actg(b[i][j])\r\n return s_out",
"def str_transform_list(L):\n return [str(x) for x in L]",
"def _con... | [
"0.698793",
"0.6279885",
"0.6234557",
"0.6109475",
"0.6049809",
"0.59743685",
"0.59015703",
"0.58988565",
"0.5874906",
"0.5871623",
"0.57951635",
"0.5763",
"0.57569855",
"0.57543033",
"0.5747442",
"0.5728409",
"0.5727647",
"0.5706848",
"0.56838304",
"0.5683019",
"0.56777364",... | 0.6864442 | 1 |
Checks if the dot product needs to be reshaped. Also does a bunch of error checking based on the shapes of A and X. | def reshape_dot(A, X, Y, tag=None):
badshape = False
ashape = (1,) if A.shape == () else A.shape
xshape = (1,) if X.shape == () else X.shape
if A.shape == ():
incshape = X.shape
elif X.shape == ():
incshape = A.shape
elif X.ndim == 1:
badshape = ashape[-1] != xshape[0]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_shape(self, X):\n return all([X.shape[i] == self.train_shape[i] for i in range(2)])",
"def _shape_check(shape_a, shape_b, shape_bias, src_dtype, trans_a, trans_b):\n shape_len = len(shape_a)\n inp_src_dtype = src_dtype.lower()\n k_block_size = cce.BLOCK_REDUCE\n check_list = (\"floa... | [
"0.63022107",
"0.5804408",
"0.5738161",
"0.5736961",
"0.5697813",
"0.56891716",
"0.561682",
"0.56139904",
"0.5567815",
"0.5559689",
"0.55426913",
"0.55200505",
"0.5517434",
"0.5469758",
"0.54690045",
"0.5465894",
"0.5460792",
"0.54596996",
"0.5423567",
"0.540824",
"0.5370734"... | 0.653364 | 0 |
Returns the dictionary of models currently in storage | def all(self, cls=None):
if cls:
dic = {}
for key, val in self.__objects.items():
if type(val) == cls:
dic[key] = self.__objects[key]
return dic
else:
return self.__objects | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_storage_model(self) -> Dict[str, Any]:\n return self.data.dict()",
"def modelstorage(self):\n return self._modelstorage",
"def get():\n\n return {'model_ids': mgmt.get_model_ids()}",
"def get_models(self):\n self.load()\n return self._models",
"def get_modelDict(s... | [
"0.7887289",
"0.7573833",
"0.7000826",
"0.6848435",
"0.67771506",
"0.67277056",
"0.6708529",
"0.6621973",
"0.6566659",
"0.65549386",
"0.65549386",
"0.6550181",
"0.64756685",
"0.647511",
"0.6468644",
"0.64317745",
"0.6404353",
"0.6402254",
"0.63834924",
"0.6372608",
"0.6363240... | 0.0 | -1 |
Deserializes the JSON file to __objects if __file_path exists. Otherwise does nothing. | def reload(self):
try:
# if os.path.isfile(FileStorage.__file_path):
with open(FileStorage.__file_path, 'r', encoding='UTF-8') as f:
context2 = json.load(f)
for key in context2.keys():
new_value = context2[key]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _load(self):\n if self.file_path.exists():\n with open(self.file_path) as fid:\n self.data = json.load(fid)",
"def load(self):\n if not self.exist:\n self.create()\n\n with open(self.file_path, encoding=Config.ENCODING) as file:\n self.data... | [
"0.72558355",
"0.69089603",
"0.68236697",
"0.6822512",
"0.6623497",
"0.6618236",
"0.6606975",
"0.6598314",
"0.65816706",
"0.656194",
"0.65617704",
"0.65510756",
"0.6539435",
"0.6523297",
"0.65092283",
"0.6492271",
"0.64501923",
"0.6445589",
"0.64408636",
"0.6416291",
"0.64104... | 0.0 | -1 |
Returns minimum of 1) number of points at the beginning of `data` for which in every `window_size` range there are no more than `pos_diff_ratio` positive derivatives 2) first data point which cross zero | def fit_limit(data: List[Union[float, int]], window_size=50, pos_diff_ratio=0.5) -> int:
def moving_average(data_set, periods=3):
weights = np.ones(periods) / periods
return np.convolve(data_set, weights, mode='valid')
diff = np.diff(data)
pos_diff = (diff > 0).astype(int)
pos_diff_avg... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def count_sliding_window(top, step=10, window_size=(20,20)):\n\tc = 0\n\tfor x in range(0, top.shape[0], step):\n\t\tif x + window_size[0] > top.shape[0]:\n\t\t\tx = top.shape[0] - window_size[0]\n\t\tfor y in range(0, top.shape[1], step):\n\t\t\tif y + window_size[1] > top.shape[1]:\n\t\t\t\ty = top.shape[1] - wi... | [
"0.6069903",
"0.59870136",
"0.5948472",
"0.59223247",
"0.5667926",
"0.559898",
"0.5593327",
"0.53959626",
"0.53885305",
"0.5385423",
"0.537137",
"0.537137",
"0.53436476",
"0.5273835",
"0.52566844",
"0.5249893",
"0.523809",
"0.5220268",
"0.5212477",
"0.5210838",
"0.5207987",
... | 0.7579247 | 0 |
Round down to the nearest integer, e.g. 1.01 returns 2 | def INT(val):
return math.floor(val) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def round_down(x):\n return int(math.floor(x / 10.0)) * 10",
"def nearest_int(num):\n return int(np.round(num))",
"def decimal_ceil(x):\n int_x = int(x)\n if x - int_x == 0:\n return int_x\n return int_x + 1",
"def ceil(x):\n return 0.0",
"def _round_to_nearest_multiple_down(x, n=5... | [
"0.76375103",
"0.75479466",
"0.7300554",
"0.7231778",
"0.7184762",
"0.70968837",
"0.70489347",
"0.70139813",
"0.69737446",
"0.6964083",
"0.69067734",
"0.68869376",
"0.68835354",
"0.68606985",
"0.6852822",
"0.6830005",
"0.6818142",
"0.6786798",
"0.67822397",
"0.67729604",
"0.6... | 0.6146155 | 65 |
Given a list of names, check that each player given by the name_list has a character object that can receive messengers. Return all valid characters. | def check_valid_receivers(self, name_list):
targs = []
for arg in name_list:
targ = self.caller.player.search(arg)
if targ:
can_deliver = True
character = targ.char_ob
if not character:
can_deliver = False
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def confirm_names(name_list, message):\n name_msg = \"\"\n namecount = 1\n char_name_dict[message.author.id] = {}\n\n for name in name_list:\n clean_name = re.sub('(\\[|\\().*(\\]|\\))', '', name).strip()\n char_name_dict[message.author.id][namecount] = clean_name\n name_msg ... | [
"0.6040362",
"0.60028154",
"0.59834987",
"0.573316",
"0.57217777",
"0.56977445",
"0.55617917",
"0.5556558",
"0.54995877",
"0.54709536",
"0.54447806",
"0.53839785",
"0.53691757",
"0.53617597",
"0.535371",
"0.5325638",
"0.532206",
"0.53148645",
"0.5290552",
"0.52801895",
"0.527... | 0.6815979 | 0 |
Randomly generated list of players we can claim | def scenelist(self):
return self.caller.player_ob.db.random_scenelist or [] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_players(player_names, seed):\n\n np.random.seed(seed)\n players = [Player(name) for name in player_names]\n\n for player in players:\n player.set_prefs(\n np.random.permutation([p for p in players if p != player]).tolist()\n )\n\n return players",
"def randomize(self... | [
"0.7054499",
"0.6960985",
"0.66882795",
"0.6647858",
"0.6618412",
"0.6596345",
"0.6566279",
"0.6534431",
"0.6409707",
"0.6402656",
"0.6376182",
"0.6368",
"0.63456786",
"0.6332502",
"0.6307661",
"0.6278751",
"0.62771565",
"0.626343",
"0.6230377",
"0.62120414",
"0.6209119",
"... | 0.0 | -1 |
List of players we have validated the scenes for | def validatedlist(self):
return self.caller.player_ob.db.validated_list or [] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def players(self):\n return self._get(\"players\")",
"def _player_list(self):\n game = self.ctrl.game\n return game.players[self.i_to_player_id(0)], game.players[self.i_to_player_id(1)]",
"def get_players(self):\r\n return self.players.values()",
"def get_accepted_players(self):\n... | [
"0.73096454",
"0.7178884",
"0.6944498",
"0.69299513",
"0.6896175",
"0.6892801",
"0.6755422",
"0.66367996",
"0.66277933",
"0.6616994",
"0.6608891",
"0.66019154",
"0.6560455",
"0.6508917",
"0.64648783",
"0.64528966",
"0.6440282",
"0.6410716",
"0.6409864",
"0.63865364",
"0.63746... | 0.67876196 | 6 |
List of valid_choices but without newbies or those already claimed. | def valid_scene_choices(self):
newbies = [ob.id for ob in self.newbies]
claimlist = [ob.id for ob in self.claimlist if ob.id not in newbies]
choices = self.valid_choices
if newbies:
choices = choices.exclude(id__in=newbies)
if claimlist:
choices = choices.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_choices_new_protected():\n ret = []\n ret.append( (1, _(u'Nur Community-Mitglieder dürfen neue Beiträge leisten')) )\n ret.append( (-1, _(u'Offener Zugang')) )\n return ret",
"def generate_list_of_wrong_choices(possible_wrong_choices, no_of_wrong_choices):\n\n wrong_choices = random.sample(list(po... | [
"0.68194693",
"0.66035163",
"0.65528375",
"0.65280443",
"0.6429501",
"0.63140893",
"0.6094776",
"0.60686743",
"0.6037685",
"0.60268116",
"0.5840666",
"0.5748544",
"0.5696973",
"0.5696973",
"0.56858224",
"0.56713873",
"0.5642924",
"0.56129616",
"0.5599339",
"0.55733305",
"0.55... | 0.7779243 | 0 |
Ensures that RPHooks doesn't have a name with special characters that would break it | def validate_name(self, name):
import re
if not re.findall("^[\w',]+$", name):
self.msg("That category name contains invalid characters.")
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_funny_chars_in_names(names, is_full_qualified_name=True):\n if names and len(names) > 0:\n for name in names:\n if ('\\t' in name or '\\n' in name or '!' in name or ',' in name or\n (is_full_qualified_name and name.count('.') > 1) or (not is_full_qualified_name and name... | [
"0.6631361",
"0.6625279",
"0.65931046",
"0.6570273",
"0.6526353",
"0.6495282",
"0.6454102",
"0.64057505",
"0.64052695",
"0.6374936",
"0.63389",
"0.6329079",
"0.627093",
"0.62438136",
"0.6207509",
"0.62027264",
"0.61880827",
"0.6145164",
"0.61360914",
"0.61249846",
"0.6122599"... | 0.5943632 | 40 |
Checks if we can create a line, or if one already exists. | def check_line(self):
if not self.hosts and not self.line:
self.msg("There is no line here. You can create one with +line/createline.")
return
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def line_exists():\n global _current_line\n return _current_line is not None",
"def check_Lines(self):\n\n pass",
"def can_create_land_line(self, can_create_land_line):\n\n self._can_create_land_line = can_create_land_line",
"def insertLine(row):\n if check(\"script\", row[\"dialogue\"... | [
"0.6756314",
"0.63407904",
"0.6261581",
"0.61314017",
"0.6080344",
"0.6070081",
"0.6033342",
"0.6023032",
"0.6020426",
"0.60184145",
"0.60184145",
"0.60051364",
"0.59069973",
"0.59069973",
"0.5834232",
"0.5814902",
"0.57597536",
"0.5697107",
"0.5680878",
"0.56786287",
"0.5624... | 0.7830403 | 0 |
Test that load_configuration raises an exception if file doesn't exist | def test_load_configuration_raises_an_exception_when_file_does_not_exist():
with pytest.raises(FileNotFoundError):
config.load_configuration(invalid_configuration_path) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_load_configuration_fails_gracefully_when_file_does_not_exist():\n config.load_configuration(invalid_configuration_path, graceful=True)\n assert True",
"def test_load_missing(self):\n with NamedTemporaryFile(suffix=\".yaml\") as config:\n with open(config.name, \"w\") as w... | [
"0.8713167",
"0.78314936",
"0.78303546",
"0.7818603",
"0.7690192",
"0.75913477",
"0.75680304",
"0.7485868",
"0.745333",
"0.7389737",
"0.7357868",
"0.72904634",
"0.7267408",
"0.7262768",
"0.72421694",
"0.723206",
"0.72244084",
"0.7213017",
"0.7166195",
"0.7132268",
"0.7121612"... | 0.89582896 | 0 |
Test that get_config_key returns implicit environment value if available | def test_get_returns_implicit_environment_value_when_available():
deep_key_path = 'deep.key.implicit'
deep_key_value = 'Default value'
deep_key_env_var_path = 'DEEP_KEY_IMPLICIT'
deep_key_env_var_value = 'Environment value'
os.environ[deep_key_env_var_path] = deep_key_env_var_v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(self, key, default=None):\n value = os.environ.get(key)\n\n if value:\n self.logging.info(\"Got %s from environment.\" % key)\n self.logging.debug(value)\n return_val = value\n elif key in self._config.keys():\n self.logging.info(\"Got %s fro... | [
"0.7057775",
"0.6969972",
"0.6897425",
"0.6894274",
"0.6851761",
"0.68250424",
"0.6803977",
"0.6793386",
"0.6772107",
"0.6748643",
"0.67286694",
"0.6721085",
"0.6699831",
"0.66980076",
"0.6692633",
"0.6692397",
"0.66549426",
"0.6654059",
"0.662647",
"0.6619034",
"0.6605255",
... | 0.75049776 | 0 |
Compute distance between 2 actor, using as input | def distance_between_actor(vehicle, ped):
return distance_to_vehicle(vehicle, ped.get_location()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_distance(asteroid_1: Asteroid, asteroid_2: Asteroid) -> float:\n dy = asteroid_2.y - asteroid_1.y\n dx = asteroid_2.x - asteroid_1.x\n return math.sqrt(dy * dy + dx * dx)",
"def distance(self, other):\n ...",
"def distance_metric(actions1, actions2):\n diff = actions1-actions2\... | [
"0.7347509",
"0.7276451",
"0.7250698",
"0.72048044",
"0.71816105",
"0.71086407",
"0.70827806",
"0.7070759",
"0.7054073",
"0.70354414",
"0.7021823",
"0.7012923",
"0.70069575",
"0.70033085",
"0.6980279",
"0.69249225",
"0.6922279",
"0.6922122",
"0.69137627",
"0.6904935",
"0.6889... | 0.6981468 | 14 |
Copied from CANbus sensor module and modified. Calculate a 3D transformation matrix in ZYX order. | def _get_rotation_matrix(transform):
# caution: UE4 is using left-hand ortation order
roll = np.deg2rad(-transform.rotation.roll)
pitch = np.deg2rad(-transform.rotation.pitch)
yaw = np.deg2rad(transform.rotation.yaw)
sr, cr = np.sin(roll), np.cos(roll)
sp, cp = np.sin(pitch), np.cos(pitch)
s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def matrix_translate_3d(tx: float, ty: float, tz: float) -> np.matrix:\n return np.matrix([[1, 0, 0, tx], [0, 1, 0, ty], [0, 0, 1, tz], [0, 0, 0, 1]])",
"def transform3D(x: float, y: float, z: float, R: np.array) -> np.array:\n T = np.zeros((4, 4))\n T[:3, :3] = R\n T[:, 3] = [x, y, z, 1.0]\n\n re... | [
"0.77219605",
"0.674584",
"0.6605107",
"0.6599586",
"0.6587338",
"0.6539377",
"0.653162",
"0.6528486",
"0.6444402",
"0.6398336",
"0.63663614",
"0.6346298",
"0.6346298",
"0.634595",
"0.6343031",
"0.6336715",
"0.6323021",
"0.62994355",
"0.62925273",
"0.62586445",
"0.6257941",
... | 0.5730042 | 73 |
Get a 2D transform matrix of a specified transform from actor reference frame to map coordinate frame | def get_rotation_matrix_2D(transform):
yaw = np.deg2rad(transform.rotation.yaw)
cy = np.cos(yaw)
sy = np.sin(yaw)
rotation_matrix_2D = np.array([[cy, -sy],
[sy, cy]])
return rotation_matrix_2D | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_matrix(transform):\n\n rotation = transform.rotation\n location = transform.location\n c_y = np.cos(np.radians(rotation.yaw))\n s_y = np.sin(np.radians(rotation.yaw))\n c_r = np.cos(np.radians(rotation.roll))\n s_r = np.sin(np.radians(rotation.roll))\n c_p =... | [
"0.67522305",
"0.6713581",
"0.6603221",
"0.6603221",
"0.6426626",
"0.64259493",
"0.6382133",
"0.6235195",
"0.62111956",
"0.6198373",
"0.6181333",
"0.61555004",
"0.61530215",
"0.6127025",
"0.60999024",
"0.6096758",
"0.6086485",
"0.6064576",
"0.6054807",
"0.6047578",
"0.6021862... | 0.6164553 | 11 |
Plot local coordinate frame. Using initial vehicle transform as origin | def plot_local_coordinate_frame(world, origin_transform, axis_length_scale = 3):
# for test
# origin_transform = transform
# axis_length_scale = 3
# longitudinal direction(x-axis)
yaw = np.deg2rad(origin_transform.rotation.yaw)
# x axis
cy = np.cos(yaw)
sy = np.sin(yaw)
Origin_coo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_potential(self):\n imshow(self.U, extent=(self.x[0], self.x[-1], self.y[0], self.y[-1]), aspect='auto', interpolation='None')\n xlabel('x')\n ylabel('y')",
"def plot(self):\n\t\tself.plotOfXray().plot()",
"def plot(self):\n\t\tself.plotOfTF().plot()",
"def plot(self):\n R... | [
"0.6049303",
"0.6027379",
"0.5996335",
"0.59953827",
"0.59828156",
"0.5887147",
"0.58738804",
"0.58688843",
"0.5857106",
"0.583748",
"0.58102626",
"0.5772559",
"0.57711905",
"0.5722513",
"0.5719648",
"0.5716756",
"0.5705354",
"0.56823725",
"0.56731015",
"0.5635092",
"0.563231... | 0.7284736 | 0 |
Calculates the correlation function for a 1/f power spectrum. | def calculate_overf_correlation(amp, index, f0, dt, n_lags):
# Cast inputs as floats as I do a bunch of division.
dt = float(dt)
f0 = float(f0)
index = float(index)
# Number of points used in calculation needs to be at least 10 times bigger
# than final number of point returned. This is so... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calc_corr(f, f_unc, g, g_unc, fac, fac_unc):\n # calculate the covariance between f and g\n # cov(f,g) = (df/dfac) * (dg/dfac) * fac_unc**2\n # in this case f=x/fac, g=y/fac\n # so cov(f,g) = f * g * fac_unc**2 / fac**2\n cov = f * g * fac_unc ** 2 / fac ** 2\n\n # calculate and return the co... | [
"0.67351997",
"0.66667646",
"0.6566066",
"0.6543416",
"0.6452465",
"0.6429266",
"0.6411559",
"0.6321838",
"0.6259758",
"0.6220389",
"0.61260283",
"0.6103693",
"0.6071674",
"0.6028234",
"0.5976751",
"0.5929951",
"0.5903812",
"0.59001905",
"0.58953255",
"0.5876679",
"0.5857842"... | 0.6739602 | 0 |
An alternative getter for unique_id. | def uuid(self):
return UUID(self.unique_id) | {
"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.81846863",
"0.81846863",
"0.81846863",
"0.81846863",
"0.81846863",
"0.81846863",
"0.81846863",
"0.81846863",
"0.81846863",
"0.81846863",
"0.81846863",
"0.81846863",
"0.81846863",
"0.81846863",
"0.81846863",
"0.81846863",
"0.81846863",
"0.81846863",
"0.81846863",
"0.81846863"... | 0.0 | -1 |
An alternative setter for unique_id. | def uuid(self, value):
self.unique_id = UUID(str(value)).hex | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_id(self, value):\n pass",
"def _set_id(self):\n raise NotImplementedError()",
"def unique_identifier(self, unique_identifier):\n\n self._unique_identifier = unique_identifier",
"def _set_unique_id(self, json_request):\n values = []\n for field in value_fields:\n ... | [
"0.7355507",
"0.7172033",
"0.71190965",
"0.6900252",
"0.68940556",
"0.6847696",
"0.6756156",
"0.6695541",
"0.6695541",
"0.6695541",
"0.6695541",
"0.6695541",
"0.6695541",
"0.6695541",
"0.6695541",
"0.6695541",
"0.6695541",
"0.6695541",
"0.6695541",
"0.6695541",
"0.6695541",
... | 0.62763155 | 60 |
Sync Organisation locally from the result of the server's Organisation.to_dict(). Return organisation | def create_from_dict(cls, dict_from_server):
unique_id = dict_from_server['unique_id']
name = dict_from_server['name']
org, created = cls.objects.get_or_create(
unique_id=unique_id, defaults=dict(name=name))
if not created and org.name != name:
# It changed
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update(self, organisation: Organisation) -> None:\n ...",
"def get_org(self):\n return Org.deserialize(self._get_single('org', {}, from_results=False))",
"def getOrganisation(self):\n return _libsbml.ModelCreator_getOrganisation(self)",
"def sync_org(config, orgs):\n\n logger = lo... | [
"0.6306042",
"0.60283667",
"0.59352475",
"0.5714484",
"0.5648241",
"0.5594969",
"0.55883586",
"0.55693406",
"0.5476007",
"0.54202384",
"0.53669894",
"0.53524435",
"0.5347903",
"0.5343103",
"0.53045994",
"0.52709955",
"0.51704794",
"0.51701325",
"0.5168584",
"0.51337725",
"0.5... | 0.47346056 | 52 |
Return a queryset of organisations in which user has this role. | def get_organisations_with_role(user, rolecode):
return Organisation.objects.filter(
user_organisation_roles__user=user,
user_organisation_roles__role__code=rolecode) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_queryset(self, request):\n qs = super().get_queryset(request)\n if not request.user.is_superuser and request.user.approved_organisations.exists():\n qs = qs.filter(organisation__in=request.user.approved_organisations.all()).distinct()\n return qs",
"def get_organisation_wi... | [
"0.73728406",
"0.69124365",
"0.6563196",
"0.6411081",
"0.64072627",
"0.6371758",
"0.63661826",
"0.63348514",
"0.6270254",
"0.62691396",
"0.60747296",
"0.6074298",
"0.6031586",
"0.6031586",
"0.60153",
"0.59692687",
"0.5965131",
"0.594412",
"0.59313554",
"0.59313554",
"0.593135... | 0.785347 | 0 |
Use this version of the function if there must be only a single organisation in which the user has this role. Raises Organisation.DoesNotExist if user has no such organisation, or Organisation.MultipleObjectsReturned if he has more than one. | def get_organisation_with_role(user, rolecode):
return get_organisations_with_role(user, rolecode).get() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def users_organizations(user):\n if not user or not user.is_authenticated():\n return None\n else:\n return get_users_organizations(user)",
"def isSetOrganisation(self):\n return _libsbml.ModelCreator_isSetOrganisation(self)",
"def is_organization(self):\n return self.user_id ... | [
"0.6117039",
"0.61001045",
"0.6059834",
"0.59753245",
"0.5945566",
"0.5881131",
"0.57085556",
"0.56940323",
"0.5661435",
"0.56502706",
"0.5611895",
"0.5595028",
"0.5594494",
"0.55941963",
"0.5540127",
"0.54783523",
"0.547229",
"0.5399376",
"0.53842777",
"0.5372154",
"0.537136... | 0.6621085 | 0 |
Saves the given dictionary as a JSON file in the './data/json' folder with the given name. | def save_to_json(data, file_name):
try:
if not os.path.exists(jsons_directory):
os.makedirs(jsons_directory)
file_path = jsons_directory + '/' + file_name
with open(file_path, 'w') as f:
json.dump(data, f, indent=4)
print(f"The data has been saved to {file_pat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_json(dict_obj, path, name):\n if 'txt' not in name:\n name += '.json'\n with open(os.path.join(path, name), 'w') as json_file:\n json.dump(dict_obj, json_file)",
"def save_data(data_dict, directory, filename) :\n filename = os.path.join(directory, filename+\".json\")\n with open(fi... | [
"0.8498973",
"0.8327698",
"0.8008859",
"0.78937936",
"0.786208",
"0.7843715",
"0.78136593",
"0.7807064",
"0.7795823",
"0.775528",
"0.7751328",
"0.7706187",
"0.76043046",
"0.75618386",
"0.7549709",
"0.7529307",
"0.74984664",
"0.7472916",
"0.7468829",
"0.745344",
"0.7445883",
... | 0.82982385 | 2 |
Return a new Tensor of the given shape and type, without initializing entries. | def empty(shape, dtype=np.float32, constant=False):
return Tensor(np.empty(shape, dtype), constant=constant) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def empty(*shape, **kwargs):\n return Tensor(np.empty(shape), **kwargs)",
"def zeros(shape, dtype=np.float32, constant=False):\n return Tensor(np.zeros(shape, dtype), constant=constant)",
"def zeros(*shape, **kwargs):\n return Tensor(np.zeros(shape), **kwargs)",
"def empty_like(other, dtype=... | [
"0.7145684",
"0.66121376",
"0.6339776",
"0.63149965",
"0.6182064",
"0.61769366",
"0.61170655",
"0.6108641",
"0.60541016",
"0.6029863",
"0.6029006",
"0.6008083",
"0.59882414",
"0.59785426",
"0.59740055",
"0.59343135",
"0.58620584",
"0.5853141",
"0.5837753",
"0.58325773",
"0.58... | 0.72898936 | 0 |
Return a new Tensor of the same shape and type as the given array. | def empty_like(other, dtype=None, constant=False):
if isinstance(other, Tensor):
other = other.data
return Tensor(np.empty_like(other, dtype), constant=constant) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _from_numpy(array):\n return tf.constant(array)",
"def create_from_array(cls, array: np.ndarray) -> \"TensorImage\":\n if array.dtype != np.uint8:\n raise ValueError(\"Expect numpy array with dtype=uint8.\")\n\n image_data = image_utils.ImageData(np.squeeze(array))\n return cls(image_dat... | [
"0.79374343",
"0.7030472",
"0.7012101",
"0.6873829",
"0.68691564",
"0.64869",
"0.63994133",
"0.6300189",
"0.62512094",
"0.6193206",
"0.61510134",
"0.6120541",
"0.60671043",
"0.5920553",
"0.58872753",
"0.5859414",
"0.5841012",
"0.5825259",
"0.58084446",
"0.5802744",
"0.5786079... | 0.0 | -1 |
Return a 2D Tensor with ones on the diagonal and zeros elsewhere. | def eye(rows, cols=None, diag_idx=0, dtype=np.float32, constant=False):
return Tensor(np.eye(rows, cols, diag_idx, dtype), constant=constant) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def diag(diag_elements):\n return tf.diag(tf.reshape(diag_elements, [-1]))",
"def ones(shape, dtype=np.float32, constant=False):\n return Tensor(np.ones(shape, dtype), constant=constant)",
"def ones(shape, **kwargs):\n return Tensor(np.ones(shape), **kwargs)",
"def ones():\n return Vec2d(1,... | [
"0.6456881",
"0.63042504",
"0.6220637",
"0.6109802",
"0.6040359",
"0.6021215",
"0.6017222",
"0.5987131",
"0.59181076",
"0.58699626",
"0.5845648",
"0.58413863",
"0.58347213",
"0.5817071",
"0.5779171",
"0.57746375",
"0.57735264",
"0.57657367",
"0.57564306",
"0.5750026",
"0.5743... | 0.61785287 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.