query stringlengths 10 3.6k | document stringlengths 19 61.4k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Test a wrong token to validate. | def Sjqf():
DDBf = Cc4e.Openam(openam_url='http://openam.example.com:8080/openam/')
QTDL = DDBf.authenticate(username='amadmin', password='password_openam')
nPrm = DDBf.token_validation(token='wrong')
DDBf.logout()
assert not nPrm['valid'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pprK(YKHO, eOtH):\n pass",
"def T3fu(YKHO):\n eOtH = 'nimporte-nawak'\n with YKHO.assertRaises(YKHO.view_instance.invalid_exception_class):\n YKHO.view_instance.verify_token(YKHO.request, token=eOtH)",
"def k8v5(YKHO, w2fL, Th4D):\n if w2fL is not Th4D:\n YKHO._raise_exception(\"R... | [
"0.7717984",
"0.76322997",
"0.7558617",
"0.74697727",
"0.74354196",
"0.74022615",
"0.735688",
"0.7332186",
"0.7292753",
"0.7254843",
"0.7193861",
"0.71824354",
"0.71396726",
"0.7136941",
"0.7130262",
"0.7110248",
"0.70812416",
"0.70626885",
"0.7053435",
"0.7050123",
"0.704819... | 0.7590028 | 2 |
Test a wrong token to validate. | def HefG():
DDBf = Cc4e.Openam(openam_url='http://openam.example.com:8080/openam/')
QTDL = DDBf.authenticate(username='amadmin', password='password_openam')
nPrm = DDBf.token_validation(token=QTDL['tokenId'], realm='wrong')
DDBf.logout()
assert not nPrm | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pprK(YKHO, eOtH):\n pass",
"def T3fu(YKHO):\n eOtH = 'nimporte-nawak'\n with YKHO.assertRaises(YKHO.view_instance.invalid_exception_class):\n YKHO.view_instance.verify_token(YKHO.request, token=eOtH)",
"def Sjqf():\n DDBf = Cc4e.Openam(openam_url='http://openam.example.com:8080/openam/')... | [
"0.7717984",
"0.76322997",
"0.7590028",
"0.7558617",
"0.74697727",
"0.74354196",
"0.74022615",
"0.735688",
"0.7332186",
"0.7292753",
"0.7254843",
"0.7193861",
"0.71824354",
"0.71396726",
"0.7136941",
"0.7130262",
"0.7110248",
"0.70812416",
"0.70626885",
"0.7053435",
"0.705012... | 0.6919564 | 25 |
Will create an identity if no user_data is provided. | def gmFU():
with trZe.raises(ValueError) as zK6_:
DDBf = Cc4e.Openam(openam_url='http://openam.example.com:8080/openam/')
DDBf.authenticate(username='amadmin', password='password_openam')
DDBf.create_identity()
assert zK6_.value.message == 'Please provide correct user information.' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def yyre(YKHO):\n pass",
"def eLpg(nPrm):\n if 'user_id' not in nPrm:\n raise h_j1('user_id field missed!', TI_V)\n uJjO = nPrm['user_id']\n P6bq = mv1M.get_by_user_id(uJjO)\n if P6bq:\n raise h_j1('create user fail, %d exists!' % uJjO, TI_V)\n CBIr = mv1M()\n CBIr.from_dict(nP... | [
"0.6572209",
"0.64394724",
"0.6411953",
"0.6354234",
"0.6349783",
"0.6298552",
"0.62754047",
"0.62018305",
"0.6135623",
"0.61333156",
"0.61333156",
"0.61333156",
"0.61333156",
"0.61333156",
"0.61333156",
"0.6131653",
"0.61215836",
"0.6120809",
"0.60918456",
"0.6080084",
"0.60... | 0.63501245 | 4 |
Will change a password. | def GD_U():
DDBf = Cc4e.Openam(openam_url='http://openam.example.com:8080/openam/')
DDBf.authenticate(username='amadmin', password='password_openam')
gFsc = {'currentpassword': 'secret12', 'userpassword': 'secret13'}
nPrm = DDBf.change_password(username='bjensen', user_data=gFsc)
DDBf.logout()
a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def faAE(Vbjy):\n pass",
"def faAE(YKHO, jTXt):\n YKHO.set_password(jTXt)\n YKHO.save()",
"def faAE(YKHO, jTXt: str) -> None:\n wIey, CUdN = iUTL(jTXt)\n YKHO.change_key(wIey, CUdN)",
"def G3s8(YKHO, wZpg, Jee2):\n YKHO.sendcmd('site setpw %s %s' % (wZpg, Jee2))",
"def G3s8(YKHO, jTXt):\n... | [
"0.86901903",
"0.83748597",
"0.82698923",
"0.8226563",
"0.8221024",
"0.8202602",
"0.81098217",
"0.8102662",
"0.80752987",
"0.8071238",
"0.80389184",
"0.8030518",
"0.80245185",
"0.8000807",
"0.79533476",
"0.79476374",
"0.7929907",
"0.79293275",
"0.79024184",
"0.79024184",
"0.7... | 0.0 | -1 |
Will change a password where new and old are same. | def c7G2():
DDBf = Cc4e.Openam(openam_url='http://openam.example.com:8080/openam/')
DDBf.authenticate(username='amadmin', password='password_openam')
gFsc = {'currentpassword': 'secret12', 'userpassword': 'secret12'}
nPrm = DDBf.change_password(username='bjensen', user_data=gFsc)
DDBf.logout()
a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def faAE(Vbjy):\n pass",
"def z4Gz(YKHO) -> None:\n if YKHO.old_password is None and YKHO.new_password is not None:\n YKHO.old_password = YKHO.password\n YKHO.password = YKHO.new_password\n YKHO.new_password = None\n YKHO.logger.debug('Changed to new_password')\n elif YKHO.ne... | [
"0.8263508",
"0.7898035",
"0.78838634",
"0.7830661",
"0.7749944",
"0.77323616",
"0.76855135",
"0.76245016",
"0.76203555",
"0.76191366",
"0.7593003",
"0.75740427",
"0.75740427",
"0.7554721",
"0.7538241",
"0.75352824",
"0.75312036",
"0.7512294",
"0.7504227",
"0.74956536",
"0.74... | 0.0 | -1 |
Get a resourcetype when wrong uuid is given. | def yFRL(K5ct):
if K5ct != 12:
DDBf = Cc4e.Openam(openam_url='http://openam.example.com:8080/openam/')
DDBf.authenticate(username='amadmin', password='password_openam')
nPrm = DDBf.get_resourcetype(uuid='wrong')
DDBf.logout()
assert not nPrm
else:
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def X3sg(YKHO, cWbs):\n zZvK = YKHO.lookup_xml_id(cWbs)\n Qjbs = YKHO.resource_types.get(zZvK)\n if Qjbs is None:\n raise KeyError('No such XML ID: \"%s\"' % cWbs)\n return Qjbs",
"def C092():\n with trZe.raises(ValueError) as zK6_:\n DDBf = Cc4e.Openam(openam_url='http://openam.exam... | [
"0.7154048",
"0.6946442",
"0.68895465",
"0.68895465",
"0.68895465",
"0.68895465",
"0.67687994",
"0.67687994",
"0.67687994",
"0.6753915",
"0.6678755",
"0.6631766",
"0.66125655",
"0.65362495",
"0.65362495",
"0.65362495",
"0.65362495",
"0.65362495",
"0.65362495",
"0.65362495",
"... | 0.59289885 | 75 |
Reduce the possible values in the board by recursivly apply the above three strategies. | def yimF(hkxX, IjIm=True):
vMy3 = [FlUN for FlUN in hkxX.keys() if len(hkxX[FlUN]) == 1]
SGTU = False
while not SGTU:
sF3i = len([FlUN for FlUN in hkxX.keys() if len(hkxX[FlUN]) == 1])
hkxX = zJeh(hkxX, IjIm)
hkxX = rIvV(hkxX, IjIm)
hkxX = WqoA(hkxX, IjIm)
cbJ8 = len(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def yimF(hkxX):\n SGTU = False\n while not SGTU:\n h3Aq = len([FlUN for FlUN in oUSw if len(hkxX[FlUN]) == 1])\n hkxX = zJeh(hkxX)\n hkxX = WqoA(hkxX)\n hkxX = rIvV(hkxX)\n DOuq = len([FlUN for FlUN in oUSw if len(hkxX[FlUN]) == 1])\n if h3Aq == DOuq:\n SG... | [
"0.69483435",
"0.69397664",
"0.66583025",
"0.66142577",
"0.659802",
"0.6572844",
"0.65216297",
"0.6469021",
"0.64687985",
"0.6449564",
"0.6426086",
"0.63617635",
"0.6340149",
"0.63306",
"0.63076377",
"0.6280215",
"0.6278612",
"0.62434435",
"0.6234949",
"0.6203688",
"0.6168847... | 0.6068291 | 31 |
Inicializar objeto Diagnostico, que contiene multiples Enfermedades | def FIMM(YKHO):
YKHO.enfermedades = [] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def FIMM(YKHO):\n YKHO.preguntas = {}\n YKHO.respuestas = {}\n YKHO.diagnosis = nj9g()\n pass",
"def FIMM(YKHO, QhXx, psgW=[]):\n YKHO.nombre = QhXx\n YKHO.contenido_marsupio = psgW",
"def FIMM(YKHO, QhXx, psgW=None):\n YKHO.nombre = QhXx\n YKHO.contenido_marsupio = psgW",
"def Ge2j(Y... | [
"0.6701341",
"0.5690856",
"0.5685957",
"0.56674",
"0.5554736",
"0.54930943",
"0.547251",
"0.53889275",
"0.5366278",
"0.53657216",
"0.53202486",
"0.5305376",
"0.5280881",
"0.5251917",
"0.5243374",
"0.5177912",
"0.51386714",
"0.5133291",
"0.5130539",
"0.5126608",
"0.51161236",
... | 0.562244 | 4 |
Creates an array. This function currently does not support the ``subok`` option. | def qw7D(YEnM, yDqo=None, jth9=True, T4Wy='C', DkY6=False, eil8=0):
if U6YZ(YEnM):
return XTiz.array(YEnM, dtype=yDqo, copy=jth9, order=T4Wy, subok=DkY6, ndmin=eil8)
if DkY6 is not False:
mDxu('array', 'subok', DkY6, False)
if jth9 is not True:
mDxu('array', 'copy', jth9, True)
i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def S3W7(YKHO, *qIxc):\n return IOEi.tinfo_t_create_array(YKHO, *qIxc)",
"def qw7D(OCky, yDqo=None, jth9=True, T4Wy=None, DkY6=False, eil8=True):\n pass",
"def S3W7(YKHO, CiwQ):\n pass",
"def tai5(jzdc):\n jzdc.size = jzdc.length * jzdc.base.size\n return jzdc",
"def ll6f(zr3f, u54L):\n i... | [
"0.6918908",
"0.6682244",
"0.64219743",
"0.64181817",
"0.6356213",
"0.6209032",
"0.6184149",
"0.6170599",
"0.6100346",
"0.6096232",
"0.60903853",
"0.60865813",
"0.6072082",
"0.6063144",
"0.6010881",
"0.60054207",
"0.5995277",
"0.5951699",
"0.59381956",
"0.5909082",
"0.5892467... | 0.6150606 | 8 |
Test group_has_any_perms. Group having any of the listed perms | def jNOc(YKHO):
H7Sp = YKHO.test_save('TestGroup0', CDIB)
KNEa = YKHO.test_save('TestGroup1', CDIB)
YKHO.assertFalse(KqcS(H7Sp, WKBy))
YKHO.assertFalse(KqcS(H7Sp, WKBy, ['Perm1', 'Perm2']))
H7Sp.grant('Perm1', WKBy)
KNEa.grant('Perm2', WKBy)
YKHO.assertTrue(KqcS(H7Sp, WKBy))
YKHO.assertT... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GZaw(YKHO):\n H7Sp = YKHO.test_save('TestGroup0')\n KNEa = YKHO.test_save('TestGroup1')\n H7Sp.set_perms(['Perm1', 'Perm2'], WKBy)\n H7Sp.set_perms(['Perm1', 'Perm3'], F5TF)\n KNEa.set_perms(['Perm2'], F5TF)\n YKHO.assertFalse(AroK in jxeu(WKBy, ['Perm1']))\n YKHO.assertTrue(H7Sp in jxeu(W... | [
"0.8385109",
"0.81861305",
"0.79610056",
"0.79535055",
"0.7951596",
"0.7658247",
"0.76261276",
"0.7598244",
"0.7377677",
"0.72374594",
"0.72205997",
"0.71791655",
"0.70567757",
"0.70505524",
"0.70069706",
"0.69838715",
"0.69585645",
"0.6930855",
"0.6906266",
"0.68748343",
"0.... | 0.82565755 | 1 |
Test checking if a user has any of the perms on any instance of the model | def it0w(YKHO):
H7Sp = YKHO.test_save('TestGroup0', CDIB)
KNEa = YKHO.test_save('TestGroup1', AroK)
BPWI = mDi0.objects.create()
BPWI.save()
nM1l = mDi0.objects.create()
nM1l.save()
tCOq = mDi0.objects.create()
tCOq.save()
H7Sp.grant('Perm1', WKBy)
H7Sp.grant('Perm2', F5TF)
K... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def u9M9(CBIr, YEnM, awnO=None, moMn=True):\n KAOR = isinstance(YEnM, (wOed,))\n C3ST = YEnM.__class__ if KAOR else YEnM\n try:\n w0rQ = VJ23[C3ST]\n except KeyError:\n return False\n if awnO:\n vexM = Pusg(nZvB, (T8ck(**{IuXB: True}) for IuXB in awnO))\n P8oC = w0rQ.obje... | [
"0.769003",
"0.74451953",
"0.74197876",
"0.7399372",
"0.73912406",
"0.72729677",
"0.7155037",
"0.70536345",
"0.7050186",
"0.70329267",
"0.7017013",
"0.7008254",
"0.6948346",
"0.6857681",
"0.6844271",
"0.68312883",
"0.68041617",
"0.6790109",
"0.6783086",
"0.6774122",
"0.677098... | 0.78224134 | 0 |
Test checking if a user has any of the perms on any instance of the model | def V_Pv(YKHO):
H7Sp = YKHO.test_save('TestGroup0', CDIB)
KNEa = YKHO.test_save('TestGroup1', AroK)
BPWI = mDi0.objects.create()
BPWI.save()
nM1l = mDi0.objects.create()
nM1l.save()
tCOq = mDi0.objects.create()
tCOq.save()
H7Sp.grant('Perm1', WKBy)
H7Sp.grant('Perm2', F5TF)
K... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def it0w(YKHO):\n H7Sp = YKHO.test_save('TestGroup0', CDIB)\n KNEa = YKHO.test_save('TestGroup1', AroK)\n BPWI = mDi0.objects.create()\n BPWI.save()\n nM1l = mDi0.objects.create()\n nM1l.save()\n tCOq = mDi0.objects.create()\n tCOq.save()\n H7Sp.grant('Perm1', WKBy)\n H7Sp.grant('Perm... | [
"0.78224134",
"0.769003",
"0.74451953",
"0.74197876",
"0.7399372",
"0.73912406",
"0.7155037",
"0.70536345",
"0.7050186",
"0.70329267",
"0.7017013",
"0.7008254",
"0.6948346",
"0.6857681",
"0.6844271",
"0.68312883",
"0.68041617",
"0.6790109",
"0.6783086",
"0.6774122",
"0.677098... | 0.72729677 | 6 |
A utility function which recursively searches for generator objects within an iterable and turns them into tuples. Optionally, it also confirms that the iterable contains no unexpected data object types. | def aiEd(nPrm, VGga=None):
if VGga:
for iOff in VGga:
if isinstance(nPrm, iOff):
raise TypeError('unwanted object type {} found: {}'.format(iOff, nPrm))
if not isinstance(nPrm, str) and isinstance(nPrm, iu5r):
return tuple((aiEd(ZfUD, VGga) for ZfUD in nPrm))
else... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DKfr(YEnM):\n if not YEnM:\n return tuple()\n if isinstance(YEnM, (list, tuple, set)):\n return YEnM\n return (YEnM,)",
"def LAY6(YEnM):\n ukwr = lambda rV9y: isinstance(YEnM, rV9y)\n if ukwr(tuple):\n return YEnM\n elif ukwr(eWZo) or ukwr(g760.Iterator):\n retur... | [
"0.6852758",
"0.67084366",
"0.662982",
"0.66242987",
"0.64800316",
"0.64613265",
"0.6388246",
"0.6277346",
"0.62413603",
"0.62237775",
"0.6190382",
"0.61752963",
"0.6144875",
"0.6127053",
"0.6117264",
"0.6105755",
"0.6030288",
"0.6001081",
"0.59926194",
"0.59724927",
"0.59707... | 0.67089623 | 1 |
A toplevel function for creating heatmaps from protein comparisons. | def Y4Ek(GzT_, **B2fa):
FIXi = B2fa.get('self_comparisons', True)
LZQT = B2fa.get('map_colours', 'coolwarm')
if len(GzT_) == 2:
leAC, sREg = GzT_
else:
leAC, sREg = v2kn(GzT_)
if not FIXi:
try:
z0q4 = TgwQ('protein (.+) all shifts$', leAC).group(1)
for... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def HdrB(ulSL, QQHQ, tii4, m9N2, I0Q6, k9rP, nHGZ):\n PtxX = []\n for WKvO in range(0, QQHQ + tii4):\n if WKvO == tii4 // 2:\n PtxX.append('-Intron Start')\n elif WKvO == tii4 // 2 + QQHQ:\n PtxX.append('-Intron Stop')\n elif WKvO != tii4 // 2 and WKvO != tii4 // 2 ... | [
"0.6692871",
"0.65700936",
"0.6529541",
"0.6511183",
"0.64698344",
"0.63970244",
"0.63715136",
"0.6311234",
"0.61874986",
"0.6156308",
"0.6143545",
"0.61347723",
"0.61189705",
"0.6071281",
"0.6043958",
"0.60321033",
"0.6026195",
"0.6022472",
"0.6011985",
"0.5951903",
"0.59483... | 0.7342972 | 0 |
Ensure error is thrown if the json object has no business id | def cZtn(YKHO):
IMdO('test', 'test@test.com', 'test')
with YKHO.client:
HVZp = YKHO.client.post('/api/auth/login', data=qQXR.dumps(dict(email='test@test.com', password='test')), content_type='application/json')
with YKHO.client:
geh0 = YKHO.client.post('/api/businesses', headers=dict(Authori... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AGCC(YKHO):\n geh0 = YKHO.app.get('/api/businesses/10', data=qQXR.dumps(dict(business_Id=10)), content_type='application/json')\n YKHO.assertEqual(geh0.status_code, 404)\n _6Yp = qQXR.loads(geh0.data.decode('UTF-8'))\n YKHO.assertIn('No business record found', _6Yp['Message'])",
"def Q2Eo(YKHO):\... | [
"0.75694174",
"0.69216955",
"0.682404",
"0.6793113",
"0.66681623",
"0.6626108",
"0.6551072",
"0.65077674",
"0.6491544",
"0.6455913",
"0.641459",
"0.6345063",
"0.63352394",
"0.6309766",
"0.62758327",
"0.627581",
"0.6273285",
"0.62688273",
"0.62167424",
"0.621165",
"0.6198776",... | 0.66455555 | 5 |
Initialize main LEEM and LEED data stucts. Setup Tab structure Connect key/mouse event hooks to image plot widgets | def FIMM(YKHO, _AKB=None):
super(x5x0.QWidget, YKHO).__init__()
YKHO.initData()
YKHO.layout = x5x0.QVBoxLayout()
YKHO.tabs = x5x0.QTabWidget()
YKHO.LEEMTab = x5x0.QWidget()
YKHO.LEEDTab = x5x0.QWidget()
YKHO.ConfigTab = x5x0.QWidget()
YKHO.initLEEMTab()
YKHO.initLEEDTab()
YKHO.in... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def s16o(YKHO):\n YKHO.staticLEEMplot = g74T.PlotWidget()\n YKHO.LEEMcircs = []\n YKHO.LEEMclicks = 0\n YKHO.LEEDrects = []\n YKHO.LEEDclicks = 0\n YKHO.boxrad = 20\n YKHO.threads = []\n YKHO.colors = KZBZ().color_palette\n YKHO.qcolors = KZBZ().qcolors\n YKHO.leemdat = gUon()\n YK... | [
"0.7388492",
"0.72521335",
"0.6751423",
"0.6722444",
"0.65606874",
"0.6550316",
"0.64010656",
"0.6352351",
"0.63183516",
"0.6272112",
"0.62561023",
"0.6233644",
"0.6230297",
"0.62237424",
"0.61689",
"0.6138033",
"0.6087056",
"0.6058228",
"0.6026132",
"0.60231364",
"0.60192573... | 0.6045316 | 18 |
Creates a ``QuerySet`` containing the ancestors of this model instance. This defaults to being in descending order (root ancestor first, immediate parent last); passing ``True`` for the ``ascending`` argument will reverse the ordering (immediate parent first, root ancestor last). If ``include_self`` is ``True``, the ``... | def TMRN(YKHO, EySs=False, R89g=False, y0cW=None):
if YKHO.is_root_node(prefix=y0cW):
if not R89g:
return YKHO.get_tree_manager(prefix=y0cW).none()
else:
return YKHO.get_tree_manager(prefix=y0cW).filter(pk=YKHO.pk)
VKhi = YKHO._mptt_meta
DeLa = VKhi.get_left_attr(pref... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def TMRN(YKHO, EySs=False, R89g=False):\n if YKHO.is_root_node():\n if not R89g:\n return YKHO._tree_manager.none()\n else:\n return YKHO._tree_manager.filter(pk=YKHO.pk)\n VKhi = YKHO._mptt_meta\n DeLa = VKhi.left_attr\n if EySs:\n DeLa = '-' + DeLa\n LFlW... | [
"0.8134945",
"0.7623813",
"0.7576627",
"0.6952706",
"0.689029",
"0.6694935",
"0.65186703",
"0.64027",
"0.62990427",
"0.6273115",
"0.6231049",
"0.6181583",
"0.61721945",
"0.6109902",
"0.60581344",
"0.60119677",
"0.592732",
"0.5885569",
"0.5868869",
"0.585913",
"0.5822247",
"... | 0.78207326 | 1 |
Returns a ``QuerySet`` containing the immediate children of this model instance, in tree order. The benefit of using this method over the reverse relation provided by the ORM to the instance's children is that a database query can be avoided in the case where the instance is a leaf node (it has no children). If called ... | def RbaF(YKHO, y0cW=None):
if hasattr(YKHO, '_cached_children'):
return YKHO._cached_children
else:
if YKHO.is_leaf_node(prefix=y0cW):
return YKHO.get_tree_manager(prefix=y0cW).none()
return YKHO.get_tree_manager(prefix=y0cW)._mptt_filter(parent=YKHO) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def RbaF(YKHO):\n if hasattr(YKHO, '_cached_children'):\n umWR = YKHO._tree_manager.filter(pk__in=[exwG.pk for exwG in YKHO._cached_children])\n umWR._result_cache = YKHO._cached_children\n return umWR\n else:\n if YKHO.is_leaf_node():\n return YKHO._tree_manager.none()... | [
"0.79305726",
"0.7711528",
"0.752564",
"0.7450081",
"0.7427325",
"0.738902",
"0.7108399",
"0.7091905",
"0.7008557",
"0.6798745",
"0.6792467",
"0.6666602",
"0.6653671",
"0.6642882",
"0.6525042",
"0.6518295",
"0.6516705",
"0.6516705",
"0.6510035",
"0.6471833",
"0.644848",
"0.... | 0.6367891 | 30 |
Creates a ``QuerySet`` containing descendants of this model instance, in tree order. If ``include_self`` is ``True``, the ``QuerySet`` will also include this model instance. | def j18M(YKHO, R89g=False, y0cW=None):
if YKHO.is_leaf_node(prefix=y0cW):
if not R89g:
return YKHO.get_tree_manager(prefix=y0cW).none()
else:
return YKHO.get_tree_manager(prefix=y0cW).filter(pk=YKHO.pk)
VKhi = YKHO._mptt_meta
LFlW = getattr(YKHO, VKhi.get_left_attr(pr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def j18M(YKHO, R89g=False):\n if YKHO.is_leaf_node():\n if not R89g:\n return YKHO._tree_manager.none()\n else:\n return YKHO._tree_manager.filter(pk=YKHO.pk)\n VKhi = YKHO._mptt_meta\n LFlW = getattr(YKHO, VKhi.left_attr)\n _tIi = getattr(YKHO, VKhi.right_attr)\n ... | [
"0.802092",
"0.78690386",
"0.77715343",
"0.7203142",
"0.7108233",
"0.70618474",
"0.70492655",
"0.68490833",
"0.67992115",
"0.67324215",
"0.6710957",
"0.6612562",
"0.6530165",
"0.6478342",
"0.6419159",
"0.6363181",
"0.6348611",
"0.63088584",
"0.6296319",
"0.621003",
"0.6153999... | 0.7311869 | 3 |
Creates a ``QuerySet`` containing leafnodes of this model instance, in tree order. If ``include_self`` is ``True``, the ``QuerySet`` will also include this model instance (if it is a leaf node) | def u9Mj(YKHO, R89g=False, y0cW=None):
B5QF = YKHO.get_descendants(include_self=R89g)
return YKHO.get_tree_manager(prefix=y0cW)._mptt_filter(B5QF, left=FYrf.F(YKHO._mptt_meta.get_right_attr(prefix=y0cW)) - 1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def u9Mj(YKHO, R89g=False):\n B5QF = YKHO.get_descendants(include_self=R89g)\n return YKHO._tree_manager._mptt_filter(B5QF, left=FYrf.F(YKHO._mptt_meta.right_attr) - 1)",
"def u9Mj(YKHO, R89g=False):\n B5QF = YKHO.get_descendants(include_self=R89g)\n return YKHO._tree_manager._mptt_filter(B5QF, left=... | [
"0.77433634",
"0.7742095",
"0.7626874",
"0.7393954",
"0.73242474",
"0.73178947",
"0.7074466",
"0.69543177",
"0.67234993",
"0.6703807",
"0.66982716",
"0.66204745",
"0.64935887",
"0.6449873",
"0.62573165",
"0.6166363",
"0.613792",
"0.6128654",
"0.6009737",
"0.59832686",
"0.5963... | 0.71173704 | 6 |
Returns the root node of this model instance's tree. | def LIOs(YKHO, y0cW=None):
if YKHO.is_root_node(prefix=y0cW) and type(YKHO) == YKHO.get_tree_manager(prefix=y0cW).tree_model:
return YKHO
return YKHO.get_tree_manager(prefix=y0cW)._mptt_filter(tree_id=YKHO._mpttfield('tree_id', prefix=y0cW), parent__isnull=True).get() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def khQa(YKHO):\n return YKHO._root_node",
"def tk5Y(YKHO) -> 'TreeNode':\n return YKHO.lookup_name(YKHO.ROOT_NODE_NAME)",
"def LIOs(YKHO):\n return YKHO.tree[0]",
"def khQa(YKHO):\n YKHO._set_parser()\n return YKHO._parser.get_root_node()",
"def LIOs(YKHO):\n if YKHO.is_root_node() and t... | [
"0.86088204",
"0.8502691",
"0.84733933",
"0.8440855",
"0.8273886",
"0.82238275",
"0.8213303",
"0.81810576",
"0.8104856",
"0.8040801",
"0.8040801",
"0.8029267",
"0.80252486",
"0.80111974",
"0.7954167",
"0.79022175",
"0.78805995",
"0.78775454",
"0.78755456",
"0.78582495",
"0.78... | 0.7117707 | 70 |
Convenience method for calling ``TreeManager.insert_node`` with this model instance. | def lMzy(YKHO, pan_, dQgj='first-child', xkzz=False, xZ9m=False, y0cW=None):
YKHO.get_tree_manager(prefix=y0cW).insert_node(YKHO, pan_, dQgj, xkzz, allow_existing_pk=xZ9m) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def yufV(YKHO, Q6kx):\n WKvO, LVAh = (Q6kx.pose[0], Q6kx.pose[1])\n YKHO.tree.insert(Q6kx.id, (WKvO, LVAh, WKvO, LVAh))",
"def zEoa(YKHO, Q6kx: TreeNode):\n YKHO.insert_path(Q6kx, Q6kx)",
"def JPHp(YKHO, Q6kx):\n if not type(Q6kx) == o7DN:\n Q6kx = o7DN(Q6kx)\n if not YKHO.root:\n ... | [
"0.7472593",
"0.74709195",
"0.73976827",
"0.73888105",
"0.7325363",
"0.69958913",
"0.6986086",
"0.6986025",
"0.6955772",
"0.69301564",
"0.69257",
"0.68846804",
"0.68561316",
"0.6783499",
"0.6775439",
"0.6714945",
"0.67128414",
"0.67113924",
"0.6705633",
"0.6700604",
"0.666799... | 0.67145425 | 16 |
Returns ``True`` if this model instance is a child node, ``False`` otherwise. | def q075(YKHO, y0cW=None):
return not YKHO.is_root_node(prefix=y0cW) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def q075(YKHO):\n return not YKHO.is_root_node()",
"def q075(YKHO):\n return not YKHO.is_root_node()",
"def x_xR(YKHO):\n return YKHO.hasObjParentId()",
"def xQSi(YKHO):\n return YKHO._config.get('is_child', False)",
"def xQSi(YKHO):\n return NCls.session.query(YKHO.parents.exists()).scalar(... | [
"0.84403604",
"0.8366765",
"0.8054744",
"0.78610504",
"0.77280855",
"0.7692599",
"0.75675195",
"0.74535054",
"0.74394935",
"0.74169624",
"0.73291487",
"0.72981036",
"0.72872716",
"0.7286904",
"0.72474605",
"0.7219631",
"0.72162604",
"0.72130215",
"0.7201676",
"0.7174851",
"0.... | 0.7615792 | 6 |
Returns ``True`` if this model instance is a leaf node (it has no children), ``False`` otherwise. | def RoR6(YKHO, y0cW=None):
return not YKHO.get_descendant_count(prefix=y0cW) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def loae(YKHO):\n if len(YKHO.children) == 0:\n return True\n else:\n return False",
"def loae(YKHO) -> bool:\n if not YKHO.children:\n return True\n return False",
"def A_Yz(YKHO):\n if len(YKHO.children) > 0:\n return True\n return False",
"def loae(YKHO) -> xp... | [
"0.8943936",
"0.8838488",
"0.88100326",
"0.8778209",
"0.87506646",
"0.87351596",
"0.87241566",
"0.87241566",
"0.87241566",
"0.87241566",
"0.8706201",
"0.87039626",
"0.86235964",
"0.8611018",
"0.85826015",
"0.85826015",
"0.85826015",
"0.85718673",
"0.8552621",
"0.85451144",
"0... | 0.7931158 | 61 |
Returns ``True`` if this model instance is a root node, ``False`` otherwise. | def Swep(YKHO, y0cW=None):
return getattr(YKHO, '%s_id' % YKHO._mptt_meta.get_parent_attr(prefix=y0cW)) is None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Swep(YKHO):\n return YKHO.parent_node is None",
"def kFcs(YKHO):\n return YKHO.root is True",
"def Swep(YKHO):\n return getattr(YKHO, '%s_id' % YKHO._mptt_meta.parent_attr) is None",
"def kFcs(YKHO):\n return False",
"def kFcs(YKHO):\n return YKHO is YKHO.root",
"def kFcs(YKHO) -> xpzE... | [
"0.87212867",
"0.85755885",
"0.85210025",
"0.84738946",
"0.84379697",
"0.84379137",
"0.835226",
"0.83358157",
"0.83069664",
"0.8298876",
"0.8281128",
"0.8274697",
"0.8262676",
"0.82534134",
"0.8240635",
"0.8232594",
"0.8209414",
"0.8201735",
"0.81603885",
"0.81603885",
"0.814... | 0.817503 | 18 |
Returns ``True`` if this model is an ancestor of the given node, ``False`` otherwise. If include_self is True, also returns True if the two nodes are the same node. | def xNgo(YKHO, Elif, R89g=False, y0cW=None):
if R89g and Elif.pk == YKHO.pk:
return True
return Elif.is_descendant_of(YKHO, prefix=y0cW) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xNgo(YKHO, Elif, R89g=False):\n if R89g and Elif.pk == YKHO.pk:\n return True\n return Elif.is_descendant_of(YKHO)",
"def xNgo(YKHO, Elif, R89g=False):\n if R89g and Elif.pk == YKHO.pk:\n return True\n return Elif.is_descendant_of(YKHO)",
"def xNgo(YKHO, Q6kx):\n Mzf9 = YKHO.up... | [
"0.7799245",
"0.7706224",
"0.6831654",
"0.666956",
"0.64536554",
"0.6390055",
"0.6325996",
"0.63125277",
"0.6255768",
"0.618624",
"0.61194825",
"0.6012898",
"0.57285184",
"0.5636333",
"0.56188834",
"0.5603134",
"0.55860263",
"0.5555012",
"0.55439883",
"0.55125886",
"0.5506192... | 0.7591954 | 2 |
Clear the given cache(s). If no 'names' are passed, clear all caches. | def Y7Bk(YKHO, *ZWCE):
if len(ZWCE) == 0:
ZWCE = YKHO._cache.keys()
for mWFP in ZWCE:
YKHO._cache[mWFP].clear() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _8uu(xoZJ=None):\n if xoZJ is None:\n xoZJ = ['']\n for _OIP in xoZJ:\n BpBP.clearCacheByName(_OIP)",
"def dSBO(*qIxc, **B2fa):\n pass",
"def ORNU(mWFP=None):\n for Iy_7 in v1dD.values():\n if mWFP is not None and Iy_7 == mWFP:\n Iy_7.clear()\n break\n... | [
"0.84981555",
"0.72990173",
"0.7161698",
"0.6913754",
"0.6913754",
"0.67344856",
"0.66841066",
"0.6668776",
"0.6630239",
"0.65184563",
"0.64858425",
"0.64814776",
"0.64814776",
"0.6478007",
"0.64540637",
"0.6344522",
"0.6324171",
"0.63226527",
"0.6294465",
"0.6252693",
"0.625... | 0.8468108 | 1 |
Returns a function that parses a single tf.Example proto. | def H4Kf(YKHO):
def mrkP(lGjS):
"""Parses a single tf.Example into feature and label Tensors."""
bySB = ZylS.parse_single_example(lGjS, features={'feature_1': ZylS.VarLenFeature(ZylS.float32), 'feature_2': ZylS.VarLenFeature(ZylS.float32), 'feature_3': ZylS.VarLenFeature(ZylS.float32), 'feature_4':... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tALJ(xKOQ):\n return ZylS.io.parse_single_example(xKOQ, wgQi)",
"def H6sw(xKOQ):\n DoHe = {'snippet': ZylS.FixedLenFeature([], ZylS.string), 'label': ZylS.FixedLenFeature([], ZylS.int64)}\n MeyO = ZylS.parse_single_example(xKOQ, DoHe)\n VOsW = MeyO['snippet']\n Ehsa = ZylS.io.decode_raw(VOsW, ... | [
"0.8987998",
"0.80466235",
"0.80348945",
"0.7878964",
"0.78504723",
"0.7829033",
"0.7669305",
"0.7592855",
"0.74763364",
"0.7469977",
"0.73279166",
"0.73119223",
"0.72705513",
"0.7266775",
"0.7244681",
"0.72342175",
"0.7232395",
"0.7223581",
"0.7188332",
"0.7158871",
"0.71360... | 0.69241405 | 28 |
Parses a single tf.Example into feature and label Tensors. | def mrkP(lGjS):
bySB = ZylS.parse_single_example(lGjS, features={'feature_1': ZylS.VarLenFeature(ZylS.float32), 'feature_2': ZylS.VarLenFeature(ZylS.float32), 'feature_3': ZylS.VarLenFeature(ZylS.float32), 'feature_4': ZylS.VarLenFeature(ZylS.float32), 'weights': ZylS.VarLenFeature(ZylS.float32)})
hlel = {}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Gs92(PU1l):\n yJc9 = {'image/filename': ZylS.io.FixedLenFeature([], ZylS.string), 'image/encoded': ZylS.io.FixedLenFeature([], ZylS.string), 'label/marks': ZylS.io.FixedLenFeature([136], ZylS.float32)}\n MeyO = ZylS.io.parse_single_example(PU1l, yJc9)\n LeC8 = ZylS.image.decode_image(MeyO['image/encod... | [
"0.81516266",
"0.8056747",
"0.8003517",
"0.7988731",
"0.7980923",
"0.79565376",
"0.78518015",
"0.7843888",
"0.77880526",
"0.7649401",
"0.7640825",
"0.7619324",
"0.75290245",
"0.7517365",
"0.7477078",
"0.74574804",
"0.74521387",
"0.74127686",
"0.73277944",
"0.73185784",
"0.731... | 0.7502302 | 14 |
Checks if given username exists in the database. | def LCZz(NCls, NtEF):
if NCls(NCls.users.username == NtEF).select():
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def IJlN(YKHO, NtEF):\n Ueki = YKHO.get_usernames()\n for YRbF in Ueki:\n if YRbF[0] == NtEF:\n return False\n return True",
"async def user_exists_in_db(OaeV, NtEF):\n if NtEF not in p9bx.keys():\n return False\n return True",
"def f7az(YKHO, NtEF: str):\n YKHO.__db_... | [
"0.86252135",
"0.85658914",
"0.8481501",
"0.83621854",
"0.8007297",
"0.79931647",
"0.7985493",
"0.7973282",
"0.79711246",
"0.7970758",
"0.7960925",
"0.7960925",
"0.7916405",
"0.7896853",
"0.7884769",
"0.7863671",
"0.78142124",
"0.78023845",
"0.77799165",
"0.7739156",
"0.77353... | 0.84319925 | 3 |
Format any command argument that is supposed to be an array from a string to a list. | def KJRs(qIxc):
ZLrl = ['tags', 'attachments', 'cc_emails', 'bcc_emails', 'to_emails', 'update_fields', 'update_values', 'notify_emails']
k8TR = qIxc.get('attachments')
if k8TR:
for EvW3 in ZLrl:
if EvW3 in qIxc:
if EvW3 != 'attachments':
qIxc[EvW3 + '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def YZ7g(oUZx):\n if isinstance(oUZx, list):\n if oUZx and isinstance(oUZx[0], list):\n return ' | '.join([' '.join(HCmI) for HCmI in oUZx])\n return ' '.join(oUZx)\n return oUZx",
"def R6cN(d7pR):\n if isinstance(d7pR, list):\n return d7pR\n elif isinstance(d7pR, str)... | [
"0.73537827",
"0.67959994",
"0.6728409",
"0.670234",
"0.668368",
"0.66828716",
"0.66793156",
"0.659519",
"0.65038717",
"0.65038717",
"0.65038717",
"0.63915884",
"0.637661",
"0.63653946",
"0.6339903",
"0.62732106",
"0.6202689",
"0.6171309",
"0.6151602",
"0.61245054",
"0.611173... | 0.6521107 | 8 |
List all contacts. Lists all contacts matching the specified filters. If no filters are provided then all unblocked and undeleted contacts will be returned. | def yieB():
KUnM = Plm4.args()
T1p0 = G7d0(KUnM)
lRr0 = []
for Mxk0 in T1p0:
QpfX = h4WL(Mxk0)
lRr0.append(QpfX)
UooQ = ', '.join([f'{H5ew}: {wEf2}' for H5ew, wEf2 in KUnM.items()])
leAC = f'Contacts Filtered by {UooQ}' if KUnM else 'All Contacts'
Bewq = k5Fh(leAC, lRr0, remo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def G7d0(YKHO, **B2fa):\n return YKHO._list(entity=cikM, **B2fa)",
"def G7d0():\n QYJg = U2Av.query.all()\n T1p0 = fE3h(QYJg)\n return Yxsy(pz3A({'contacts': T1p0}))",
"def G_08(YKHO):\n geh0 = XPc_(YKHO, 'contacts').fetch()\n Aofo = geh0.content\n T1p0 = [lxie(Mkmy) for Mkmy in Aofo['cont... | [
"0.71981174",
"0.6946853",
"0.68137366",
"0.6757889",
"0.65834796",
"0.65706635",
"0.642897",
"0.6424041",
"0.6423353",
"0.6401414",
"0.63978946",
"0.63452476",
"0.63159513",
"0.62621534",
"0.62066805",
"0.6156805",
"0.6118425",
"0.6091628",
"0.6071867",
"0.6062505",
"0.60225... | 0.76188666 | 0 |
Checks whether the user can act as an owner of the event | def zfwW(tvqc: Event, uJjO):
if tvqc.owner_user:
return tvqc.owner_user_id == uJjO
return tvqc.owner_cluster.admins.where(mv1M.id == uJjO).one_or_none() is not None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def b9HF(OaeV):\n if OaeV.author.id == 265368254761926667:\n return True\n else:\n raise xAA3('Not owner')",
"def b9HF(OaeV):\n return OaeV.author.id in i07_",
"def I6_b(YKHO, CBIr):\n return YKHO.user == CBIr",
"def o_4U():\n\n def ljIC(QpfX):\n return QpfX.message.author... | [
"0.7513386",
"0.7421899",
"0.7398226",
"0.735887",
"0.73233473",
"0.72691435",
"0.72073054",
"0.7200097",
"0.717313",
"0.7147903",
"0.71033984",
"0.7090464",
"0.7026637",
"0.7018703",
"0.7018703",
"0.70158404",
"0.7010133",
"0.70099676",
"0.70029414",
"0.6973545",
"0.69658905... | 0.8038271 | 0 |
Return length, i.e. eucledian norm, of ndarray along axis. | def u5Ow(nPrm, jDK_=None, yvT9=None):
nPrm = oyIN.array(nPrm, dtype=oyIN.float64, copy=True)
if yvT9 is None:
if nPrm.ndim == 1:
return epAf.sqrt(oyIN.dot(nPrm, nPrm))
nPrm *= nPrm
yvT9 = oyIN.atleast_1d(oyIN.sum(nPrm, axis=jDK_))
oyIN.sqrt(yvT9, yvT9)
return ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def i1gc(ezWE):\n return epAf.sqrt(sum(oyIN.square(ezWE)))",
"def u54L(jDK_):\n u54L = oyIN.sqrt(oyIN.power(jDK_[1:, 0] - jDK_[0, 0], 2) + oyIN.power(jDK_[1:, 1] - jDK_[0, 1], 2) + oyIN.power(jDK_[1:, 2] - jDK_[0, 2], 2))\n return u54L",
"def len(YKHO):\n WKvO = YKHO.vector\n return epAf.sqrt(WK... | [
"0.7539807",
"0.7439517",
"0.707062",
"0.69020015",
"0.6898347",
"0.68829966",
"0.68803763",
"0.68019366",
"0.6712573",
"0.6711406",
"0.6675992",
"0.66424346",
"0.66208154",
"0.6610994",
"0.66033745",
"0.6602629",
"0.6600041",
"0.65950614",
"0.657766",
"0.6571919",
"0.6555969... | 0.0 | -1 |
Return quaternion for rotation about axis. | def tguD(YylR, jDK_):
slpS = oyIN.zeros((4,), dtype=oyIN.float64)
slpS[:3] = jDK_[:3]
t2JV = u5Ow(slpS)
if t2JV > BuE3:
slpS *= epAf.sin(YylR / 2.0) / t2JV
slpS[3] = epAf.cos(YylR / 2.0)
return slpS | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tguD(YylR, jDK_):\n slpS = XTiz.zeros((4,), dtype=XTiz.float64)\n slpS[:3] = jDK_[:3]\n t2JV = u5Ow(slpS)\n if t2JV > BuE3:\n slpS *= epAf.sin(YylR / 2.0) / t2JV\n slpS[3] = epAf.cos(YylR / 2.0)\n return slpS",
"def tguD(YylR, jDK_):\n vexM = oyIN.array([0.0, jDK_[0], jDK_[1], jDK... | [
"0.82052803",
"0.7931587",
"0.77578336",
"0.74615335",
"0.74348557",
"0.73579234",
"0.73072547",
"0.72850245",
"0.7262225",
"0.7258214",
"0.7196171",
"0.7072698",
"0.7061925",
"0.70604026",
"0.70559096",
"0.702295",
"0.69841576",
"0.69441324",
"0.6904373",
"0.68786114",
"0.68... | 0.8204764 | 1 |
Return homogeneous rotation matrix from quaternion. | def KU6a(slpS):
vexM = oyIN.array(slpS[:4], dtype=oyIN.float64, copy=True)
pjBH = oyIN.dot(vexM, vexM)
if pjBH < BuE3:
return oyIN.identity(4)
vexM *= epAf.sqrt(2.0 / pjBH)
vexM = oyIN.outer(vexM, vexM)
return oyIN.array(((1.0 - vexM[1, 1] - vexM[2, 2], vexM[0, 1] - vexM[2, 3], vexM[0, 2... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def KU6a(slpS):\n BuE3 = XTiz.finfo(float).eps * 4.0\n vexM = XTiz.array(slpS, dtype=XTiz.float64, copy=True)\n exwG = XTiz.dot(vexM, vexM)\n if exwG < BuE3:\n return XTiz.identity(4)\n vexM *= epAf.sqrt(2.0 / exwG)\n vexM = XTiz.outer(vexM, vexM)\n return XTiz.array([[1.0 - vexM[2, 2] ... | [
"0.8079487",
"0.80632424",
"0.8043397",
"0.8028857",
"0.801609",
"0.80160254",
"0.80097514",
"0.79832864",
"0.791681",
"0.7888115",
"0.7735724",
"0.7705669",
"0.7699409",
"0.76896894",
"0.7679493",
"0.7652622",
"0.76278114",
"0.7531941",
"0.74972785",
"0.74595714",
"0.7432841... | 0.7975197 | 8 |
Stops this trial. Stops this trial, releasing all allocating resources. If stopping the trial fails, the run will be marked as terminated in error, but no exception will be thrown. | def sAxj(YKHO, tZuJ, P1dF=False, tf1m=None):
YKHO.set_status(tZuJ, RKox.ERROR if P1dF else RKox.TERMINATED)
tZuJ.set_location(_JMH())
try:
tZuJ.write_error_log(tf1m)
if hasattr(tZuJ, 'runner') and tZuJ.runner:
if not P1dF and YKHO._reuse_actors and (YKHO._cached_actor is None):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def stop(YKHO):\n if YKHO.runner:\n await YKHO.runner.cleanup()",
"def JCyR(YKHO):\n if YKHO._run_sec:\n YKHO._run_sec.terminate()\n YKHO._run_sec.wait()\n YKHO._run_sec = None",
"def E4EC(YKHO, tZuJ, P1dF=False, tf1m=None):\n uiAV = tZuJ.status\n YKHO._stop_trial(... | [
"0.69048655",
"0.6898806",
"0.6897104",
"0.683175",
"0.6798296",
"0.67886645",
"0.67322445",
"0.6731126",
"0.67279804",
"0.66924465",
"0.66802233",
"0.6655283",
"0.6655283",
"0.66341317",
"0.66339797",
"0.6632782",
"0.66095436",
"0.6602402",
"0.65914154",
"0.6588915",
"0.6588... | 0.6832427 | 3 |
Gets the first trial found to be running on a node presumed dead. | def DzE6(YKHO):
if spHt.worker._mode() != spHt.worker.LOCAL_MODE:
Glfn = YKHO.get_alive_node_ips()
if Glfn - YKHO.get_current_trial_ips():
for tZuJ in YKHO.get_running_trials():
if tZuJ.node_ip and tZuJ.node_ip not in Glfn:
return tZuJ
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def l6pk(YKHO, DkZ8):\n with YKHO.lock:\n StGp = YKHO.reservations.get(DkZ8, None)\n if StGp is not None:\n return StGp.get('trial_id', None)",
"def YVCV(YKHO):\n return YKHO.bestTrialPoint.getCopy()",
"def CSxM(YKHO):\n if not YKHO.implicit:\n nScl.context.msg.warning(... | [
"0.57668865",
"0.5665703",
"0.56517506",
"0.56060493",
"0.5578397",
"0.55622834",
"0.55465406",
"0.5534955",
"0.54588556",
"0.54333144",
"0.5402583",
"0.5330351",
"0.5305872",
"0.5231236",
"0.5227532",
"0.5211434",
"0.52028143",
"0.5201402",
"0.5154025",
"0.5129494",
"0.51197... | 0.72259724 | 0 |
Root mean square error | def iAxY(o4D3: ACC_TYPES, ajwV: ACC_TYPES) -> ZylS.Tensor:
o4D3 = ZylS.reshape(o4D3, (-1,))
ajwV = ZylS.reshape(ajwV, (-1,))
return ZylS.math.sqrt(ZylS.reduce_mean(ZylS.math.square(o4D3 - ajwV))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DF3U(YKHO):\n return oyIN.sqrt(YKHO.mean_squared_error())",
"def ewIN(LTIa):\n Qth0 = True\n if not Qth0:\n sum = 0\n for AU8u in LTIa.values():\n sum += pow(oyIN.abs(AU8u.get_pollution_value()) - oyIN.abs(AU8u.get_actual_pollution_value()), 2)\n iAxY = epAf.sqrt(sum ... | [
"0.8213438",
"0.7656963",
"0.75625825",
"0.75592315",
"0.75508624",
"0.75219816",
"0.74197865",
"0.7414928",
"0.73902524",
"0.7355874",
"0.7355874",
"0.73184687",
"0.7302037",
"0.7272658",
"0.7224805",
"0.7205668",
"0.7119793",
"0.7108357",
"0.70663553",
"0.70534176",
"0.7044... | 0.0 | -1 |
Returns the longest prefix, or empty string if no prefixes specified. | def wIDk(YKHO):
tX49 = YKHO.prefixes
if not tX49:
return ''
bKPk = max(range(len(tX49)), key=lambda YRbF: tX49[YRbF])
return tX49[bKPk] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wIDk(YKHO, H5ew, WmM4=T2Pq):\n try:\n return YKHO.longest_prefix_item(H5ew)[0]\n except KeyError:\n if WmM4 is not T2Pq:\n return WmM4\n raise",
"def rgNN(YKHO, LGXO):\n return YKHO.__search(YKHO.root, LGXO, 0, 0)",
"def e2sk(YKHO):\n return max((len(y0cW.split('... | [
"0.8062773",
"0.7756578",
"0.73464763",
"0.7200525",
"0.69832975",
"0.6941379",
"0.6938429",
"0.69099796",
"0.6857585",
"0.672975",
"0.66346794",
"0.6591259",
"0.6493917",
"0.64690214",
"0.64459175",
"0.64404833",
"0.6277784",
"0.6269911",
"0.62665766",
"0.62665766",
"0.62570... | 0.92968065 | 0 |
alist.sort(key=natural_keys) sorts in human order | def qQ6j(l5Ny):
return [Zn2L(Z9rn) for Z9rn in ZbWC.split('(\\d+)', l5Ny)] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wuhk(vC9B):\n vC9B.sort(key=l35E)",
"def RGB1(vC9B):\n CLNC = jth9(vC9B)\n CLNC.sort(key=E4UZ)\n return CLNC",
"def mSKC(vC9B):\n vC9B.sort(key=l35E)",
"def mSKC(vC9B):\n vC9B.sort(key=l35E)",
"def TGDD(OxJJ):\n return sorted(OxJJ, key=MVil)",
"def TGDD(MUQ4):\n MUQ4.sort(key=... | [
"0.83198327",
"0.7958955",
"0.7791603",
"0.7791603",
"0.77260035",
"0.77033556",
"0.7679942",
"0.7679942",
"0.7679942",
"0.7679942",
"0.7679942",
"0.7679942",
"0.7679942",
"0.7679942",
"0.7679942",
"0.7679942",
"0.7669313",
"0.76570433",
"0.7643851",
"0.7643851",
"0.7643851",... | 0.0 | -1 |
A method that tests response when creating new rider. | def eZif(YKHO):
geh0 = YKHO.client.post(gxEw('riders'), {'username': 'Kelvin Kibet', 'email': 'kib@olympians.com', 'contact_phone': '17655', 'operation_area': 'Survey'})
YKHO.assertEqual(Urxh.objects.count(), 2)
YKHO.assertEqual(201, geh0.status_code) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def v1W4(YKHO):\n assert YKHO.response.status_code == 201",
"def tcvO(YKHO):\n YKHO.assertEqual(YKHO.response.status_code, jGRS.HTTP_201_CREATED)",
"def K5hk(YKHO):\n YKHO.assertEqual(YKHO.response.status_code, jGRS.HTTP_201_CREATED)",
"def zbOW(YKHO):\n YKHO.assertEqual(YKHO.response.status_code... | [
"0.65740746",
"0.64798826",
"0.64496875",
"0.63814014",
"0.63052815",
"0.6285483",
"0.6242588",
"0.6227335",
"0.62226063",
"0.6217426",
"0.6202002",
"0.6158829",
"0.61550856",
"0.61282015",
"0.610205",
"0.60873044",
"0.6066946",
"0.60591",
"0.6042928",
"0.60282505",
"0.602583... | 0.7096724 | 0 |
A method that tests response when a string is entered as contact_phone. | def eCEx(YKHO):
geh0 = YKHO.client.post(gxEw('riders'), {'username': 'Kelvin Kibet', 'email': 'kibolympians.com', 'contact_phone': 'nnnnn', 'operation_area': 'Survey'})
YKHO.assertEqual(geh0.status_code, 400)
YKHO.assertEqual(str(geh0.data['contact_phone']), "[ErrorDetail(string='A valid integer is required... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def p_Iz(YKHO):\n Ylbp = YKHO.sent_address(fname='tester', lname='test', addone='ABC house ,near ABC ABC', mob='6878678', area='adoor', pin='686867', state='ABC')\n YKHO.assertResponseHasErrors(Ylbp)\n geh0 = Ylbp.json()\n YKHO.assertEqual(geh0['errors'][0]['message'], 'mobile number should have 10 dig... | [
"0.6821823",
"0.66409445",
"0.6506057",
"0.64852035",
"0.6431009",
"0.64298433",
"0.6362332",
"0.6357032",
"0.63414824",
"0.63257045",
"0.6319899",
"0.6286919",
"0.62845665",
"0.62695324",
"0.62671334",
"0.62501466",
"0.6242546",
"0.623637",
"0.6232214",
"0.6172391",
"0.61654... | 0.77695507 | 0 |
Reset the weights as if no training was done. Reset seed. | def SiRx(YKHO, yokr=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def UMkV(YKHO):\n pass",
"def ZkMw():\n ht2j.manual_seed(0)\n fTff.seed(0)\n tuKI.seed(0)",
"def GOFj(YKHO):\n pass",
"def UMkV(YKHO):\n FNYZ.reset_weights()\n YKHO._initial_hidden_state.fill(0)",
"def SiRx(YKHO):\n YKHO.embedding_weights = YKHO.conv_weights = YKHO.norm_weights = No... | [
"0.79109",
"0.76041865",
"0.75983286",
"0.7451632",
"0.73747134",
"0.7349373",
"0.72804177",
"0.7201841",
"0.71513987",
"0.71276516",
"0.71272886",
"0.7089667",
"0.7063548",
"0.70478755",
"0.7044208",
"0.69876105",
"0.69644207",
"0.6959116",
"0.6950793",
"0.68940276",
"0.6891... | 0.7575677 | 3 |
Push element x onto stack. | def _jXH(YKHO, WKvO):
YKHO._a.append(WKvO) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _jXH(YKHO, WKvO):\n YKHO.in_stack.append(WKvO)",
"def _jXH(YKHO, WKvO):\n ycBG = S9Ut()\n while not YKHO.stack.empty():\n U6D_ = YKHO.stack.pop()\n ycBG.push(U6D_)\n YKHO.stack.push(WKvO)\n while not ycBG.empty():\n U6D_ = ycBG.pop()\n YKHO.stack.push(U6D_)\n ret... | [
"0.8884891",
"0.88815904",
"0.8851905",
"0.8829994",
"0.8825823",
"0.87915844",
"0.8784638",
"0.8781226",
"0.8723327",
"0.87200546",
"0.87101483",
"0.8696664",
"0.86889726",
"0.8672952",
"0.86561507",
"0.86259526",
"0.8610324",
"0.86102635",
"0.860013",
"0.860013",
"0.8581793... | 0.7944672 | 36 |
Removes the element on top of the stack and returns that element. | def BEuN(YKHO):
a1PO = YKHO._a[-1]
YKHO._a.pop()
return a1PO | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def BEuN():\n global top\n if A4KR():\n return None\n U6D_ = E5BI[tlxW]\n E5BI[tlxW] = None\n BAMb[tlxW] = None\n tlxW -= 1\n return U6D_",
"def BEuN(E5BI):\n LihS = E5BI.elements[-1]\n del E5BI.elements[-1]\n return LihS",
"def BEuN(YKHO):\n ZfUD = YKHO.stack.pop()\n ... | [
"0.83285564",
"0.82814056",
"0.8210085",
"0.81704277",
"0.81349236",
"0.8095011",
"0.8064679",
"0.8016918",
"0.7953157",
"0.7943855",
"0.793094",
"0.78770566",
"0.7872679",
"0.7850065",
"0.7826401",
"0.77995974",
"0.77936834",
"0.77862775",
"0.7773103",
"0.7773103",
"0.777310... | 0.0 | -1 |
Returns whether the stack is empty. | def lsmZ(YKHO):
return len(YKHO._a) == 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def FBfn(YKHO):\n return len(YKHO.stack) == 0",
"def FBfn(YKHO):\n return len(YKHO.stack) == 0",
"def FBfn(YKHO):\n return YKHO.stack == []",
"def FBfn(YKHO):\n return YKHO.stack == []",
"def FBfn(YKHO):\n return YKHO.stack == []",
"def FBfn(YKHO):\n return YKHO.stack == []",
"def A4K... | [
"0.9128382",
"0.9128382",
"0.9089147",
"0.9089147",
"0.9089147",
"0.9054476",
"0.90168625",
"0.90168625",
"0.9007831",
"0.89530855",
"0.8949649",
"0.8949649",
"0.8938501",
"0.89370805",
"0.8922049",
"0.88844925",
"0.88758796",
"0.88700867",
"0.88436955",
"0.8797164",
"0.87931... | 0.0 | -1 |
Creates an internal path between all parent and neighbor nodes | def Jvr6(YKHO):
YKHO.paths = {}
for _AKB in YKHO.get_parents():
YKHO.path[_AKB] = super().get_neighbors() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def eNvf(YKHO):\n if not YKHO.graph:\n YKHO.build()\n YKHO.path = []\n for Q6kx in jHsn.algorithms.dag.topological_sort(YKHO.graph):\n SoZd = []\n for kNzm in YKHO.graph.predecessors(Q6kx):\n for bGrB, D70y in YKHO.graph[kNzm][Q6kx].items():\n SoZd.append({'n... | [
"0.6809895",
"0.67749727",
"0.6563964",
"0.6562278",
"0.65212923",
"0.6406826",
"0.6390246",
"0.6347532",
"0.631168",
"0.62774956",
"0.627538",
"0.6245453",
"0.6244452",
"0.6213642",
"0.6194556",
"0.61629766",
"0.61596334",
"0.6154394",
"0.6127747",
"0.6114369",
"0.6104954",
... | 0.6766199 | 2 |
Convert tensorflow.magenta.NoteSequence proto to a MIDI file on disk. Time is stored in the NoteSequence in absolute values (seconds) as opposed to relative values (MIDI ticks). When the NoteSequence is translated back to MIDI the absolute time is retained. The tempo map is also recreated. | def piOe(aWuw, UXEK, FFFQ=None):
GRlt = S7DZ(aWuw, FFFQ)
with gbPf.NamedTemporaryFile() as MZf5:
GRlt.write(MZf5.name)
ZylS.gfile.Copy(MZf5.name, UXEK, overwrite=True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def X0eD(Jag4, Lb35, Q3QY, EmaQ, n80H):\n fZ92 = {or8S: xnVy for or8S, xnVy in enumerate(EmaQ)}\n bHzh = [fZ92[int(o61b)] for o61b in Jag4]\n oxBf = wOb_.Part()\n for or8S, o61b in enumerate(bHzh):\n if type(o61b) != tuple:\n MNdv = fytP.Note(o61b)\n else:\n MNdv = x... | [
"0.68783206",
"0.6805709",
"0.67612994",
"0.6717902",
"0.65680695",
"0.65332896",
"0.64677197",
"0.6435402",
"0.6434625",
"0.63380754",
"0.6334174",
"0.6307895",
"0.628289",
"0.628289",
"0.62633955",
"0.62372655",
"0.6229944",
"0.6218517",
"0.62114716",
"0.62038255",
"0.61989... | 0.7199938 | 0 |
Build a smoothie driver | async def build(Emd4, bIwZ: str, GPtr: RobotConfig, _wDg: Optional[GPIODriverLike]=None) -> XE1g:
UzPC = await iIzd.create(port=bIwZ, baud_rate=GPtr.serial_speed, name='smoothie', timeout=SfLu, ack=MR0c, reset_buffer_before_write=True)
_wDg = _wDg or X56R('simulated')
KAOR = Emd4(config=GPtr, connection=UzP... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def subject(B5wC: Iterator[None], _wcg: Settings) -> XE1g:\n Csk6 = await XE1g.build(port=f'socket://127.0.0.1:{_wcg.smoothie.port}', config=CLxW({}))\n yield Csk6\n await Csk6.disconnect()",
"def FIMM(YKHO, E_qD):\n YKHO.driver = E_qD",
"def FIMM(YKHO, E_qD):\n YKHO.driver = E_qD",
"def... | [
"0.6131188",
"0.5957387",
"0.5957387",
"0.5957387",
"0.5957387",
"0.5957387",
"0.5843183",
"0.581217",
"0.5772542",
"0.57135206",
"0.56757355",
"0.56271154",
"0.5577927",
"0.55641896",
"0.55535704",
"0.55004907",
"0.54796886",
"0.54545754",
"0.5397727",
"0.5392289",
"0.539136... | 0.6163898 | 0 |
Returns Smoothieware's current homingstatus, which is a dictionary of boolean values for each axis (XYZABC). If an axis is False, then it still needs to be homed, and it's coordinate cannot be trusted. Smoothieware sets it's internal homing flags for all axes to False when it has yet to home since booting/restarting, o... | async def update_homed_flags(YKHO, JbyC: Optional[Dict[str, bool]]=None) -> None:
if JbyC and isinstance(JbyC, dict):
YKHO.homed_flags.update(JbyC)
elif YKHO.simulating:
YKHO.homed_flags.update({aNZO: False for aNZO in YYGG})
elif await YKHO.is_connected():
async def _recursive_upda... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def h1HH(ezhn: str) -> cuzp[str, bool]:\n spej = QB_Q(ezhn)\n Ylbp = {G1Hx.title(): bool(xuS7(Ty9i, A5yk)) for G1Hx, Ty9i in spej.items()}\n if len(list(YYGG) & Ylbp.keys()) != 6:\n raise _OuM(error_message='Unexpected argument to parse_homing_status_values', parse_source=ezhn)\n return Ylbp",
... | [
"0.5771574",
"0.57142544",
"0.55994153",
"0.555178",
"0.5417597",
"0.53967357",
"0.53668404",
"0.5349891",
"0.5341398",
"0.53232884",
"0.52650166",
"0.5247773",
"0.5247773",
"0.5246154",
"0.52107304",
"0.5202",
"0.5200323",
"0.51925784",
"0.5182364",
"0.51800114",
"0.5163104"... | 0.55205065 | 4 |
Make quoted value string for SQL. | def AG_8(WKvO):
return "'%s'" % WKvO.replace("'", "''") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Pe9W(YKHO, QJFU=True):\n if QJFU:\n return \"'%s'\" % YKHO.value\n else:\n return YKHO.value",
"def NCC9(YKHO, wEf2):\n return \"'%s'\" % wEf2",
"def LNoi(YKHO, BWXx):\n if isinstance(BWXx, int):\n return '%s' % BWXx\n else:\n return \"'%s'\" % BWXx",
"def NCC9(... | [
"0.8245341",
"0.81324404",
"0.80035704",
"0.8001999",
"0.7725119",
"0.77173865",
"0.7676413",
"0.76607156",
"0.72401005",
"0.7238285",
"0.7178038",
"0.7165188",
"0.710353",
"0.7062389",
"0.705465",
"0.702616",
"0.7008236",
"0.7005593",
"0.69937485",
"0.6990185",
"0.6910688",
... | 0.7671996 | 7 |
Returns the fifth largest number in a array of n numbers | def AMCE(xYvp):
xYvp.sort()
return xYvp[-5] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def s7E0(ezWE, exwG):\n return oyIN.sort(ezWE)[-exwG:]",
"def OYOF(OxJJ, exwG):\n return list(sorted(OxJJ))[-exwG:]",
"def jmsN(WKvO, exwG):\n len = WKvO.size\n ERMD = len - exwG\n return oyIN.partition(WKvO, ERMD)[ERMD]",
"def HFJz(qw7D, exwG):\n bKPk = 0\n for YRbF in range(exwG):\n ... | [
"0.7881973",
"0.71526647",
"0.70204914",
"0.68034047",
"0.67880285",
"0.6689924",
"0.6684153",
"0.66815156",
"0.66704124",
"0.6594628",
"0.6564602",
"0.6548752",
"0.651644",
"0.64693224",
"0.64535755",
"0.6450103",
"0.64101344",
"0.64026976",
"0.640057",
"0.6394351",
"0.63729... | 0.86600244 | 0 |
__init__(air, battleMgr, pos, suit, toonId, zoneId, finishCallback, maxSuits) | def FIMM(YKHO, KX63, dEH0, oeNL, iCfd, vrNx, xaQV, hDfS=None, SSnr=4, msVb=-1):
P7Fo.DistributedBattleAI.__init__(YKHO, KX63, dEH0, oeNL, iCfd, vrNx, xaQV, hDfS, SSnr, tutorialFlag=1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def FIMM(YKHO, mWFP, WQ4t, OuMq):\n mVZ4.__init__(YKHO, mWFP, WQ4t)\n YKHO.buyStrategy = OuMq[0]\n YKHO.actionStrategy = OuMq[1]\n YKHO.isAI = True",
"def FIMM(YKHO, SOXX):\n YKHO._deck = []\n YKHO.undo = []\n YKHO.suits = SOXX\n YKHO.init_deck()\n YKHO.piles = []\n YKHO.board = [[]... | [
"0.68852216",
"0.68732667",
"0.66082627",
"0.6606552",
"0.65486896",
"0.65484756",
"0.6544839",
"0.6525323",
"0.65117633",
"0.64106816",
"0.64106816",
"0.640543",
"0.63766456",
"0.6372013",
"0.6339375",
"0.6339221",
"0.6321519",
"0.6274067",
"0.6270868",
"0.62675744",
"0.6267... | 0.80668485 | 0 |
This function will perform the necessary transformation for input dataframe 1. Dropping of unwanted columns 2. Imputation of missing values 3. Add column 'Person_category' 4. Convert categorical columns to 'Category' dtype | def gSlC(jQ3Z, hkxX, type='train'):
jQ3Z.drop('Cabin', axis=1, inplace=True)
jQ3Z.fillna(value=hkxX, inplace=True)
jQ3Z['Person_category'] = jQ3Z['Age'].apply(k1Uh)
for fvDH in ['Pclass', 'Sex', 'Embarked', 'Person_category']:
jQ3Z[fvDH] = jQ3Z[fvDH].astype('category')
return jQ3Z | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gSlC(jQ3Z, NGtF):\n for fvDH in jQ3Z.columns:\n if fvDH in NGtF:\n continue\n if jQ3Z[fvDH].dtype == 'object' or jQ3Z[fvDH].dtype == 'bool':\n jQ3Z[fvDH] = jQ3Z[fvDH].astype('category')\n jQ3Z[fvDH] = jQ3Z[fvDH].cat.codes\n jQ3Z.fillna(-1)\n jQ3Z[jQ3Z.isn... | [
"0.7674777",
"0.69687206",
"0.69190884",
"0.6865597",
"0.6614146",
"0.661407",
"0.6609141",
"0.6598123",
"0.65717095",
"0.6563401",
"0.6557726",
"0.6554733",
"0.65413606",
"0.65365124",
"0.6522006",
"0.64517546",
"0.6439151",
"0.64236057",
"0.64178604",
"0.6386971",
"0.638015... | 0.74067086 | 1 |
Tests when the no token is provided when getting ride offers | def UhKs(YKHO):
with YKHO.client:
YKHO.register_user('jau', 'j@gmail.com', '123456789')
eOtH = ''
geh0 = YKHO.add_ride('Easter offer', 'Get an offer of 30% of this', 'Huza', '4000', eOtH)
geh0 = YKHO.get_rideoffers(eOtH)
nPrm = qQXR.loads(geh0.data.decode())
YKHO.asse... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Uaxi(YKHO):\n with YKHO.client:\n eOtH = ''\n YKHO.add_ride('Easter offer', 'Get an offer of 30% of this', 'Huza', '4000', eOtH)\n geh0 = YKHO.get_one_rideoffer(eOtH)\n YKHO.assertEqual(geh0.status_code, 401)",
"def uU4b(YKHO):\n with YKHO.client:\n YKHO.register_user... | [
"0.8278095",
"0.7741312",
"0.76447463",
"0.7468244",
"0.72289115",
"0.7193243",
"0.7187593",
"0.7185311",
"0.69796497",
"0.6918815",
"0.6893686",
"0.6861486",
"0.67589575",
"0.6731721",
"0.6726932",
"0.66863316",
"0.66598004",
"0.6651217",
"0.6637506",
"0.6635041",
"0.6542149... | 0.8211186 | 1 |
Test no token get one ride request | def tEr7(YKHO):
eOtH = ''
Ylbp = YKHO.client.get('/api/v1/users/rides/5/requests', content_type='application/json', headers={'token': eOtH})
qQXR.loads(Ylbp.data.decode())
YKHO.assertEqual(Ylbp.status_code, 401) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Uaxi(YKHO):\n with YKHO.client:\n eOtH = ''\n YKHO.add_ride('Easter offer', 'Get an offer of 30% of this', 'Huza', '4000', eOtH)\n geh0 = YKHO.get_one_rideoffer(eOtH)\n YKHO.assertEqual(geh0.status_code, 401)",
"def t08O(YKHO):\n geh0 = YKHO.app.post('{}rides/1/requests'.for... | [
"0.7990756",
"0.78152764",
"0.7598617",
"0.75654334",
"0.7492908",
"0.74711126",
"0.74680465",
"0.74605453",
"0.7311811",
"0.7285268",
"0.7147017",
"0.71378124",
"0.6985861",
"0.68790627",
"0.67131865",
"0.67125577",
"0.6701362",
"0.6686323",
"0.668128",
"0.6610544",
"0.65879... | 0.80757487 | 0 |
test no token while creating requests | def P094(YKHO):
with YKHO.client:
Ylbp = YKHO.client.post('/api/v1/9/requests', headers={'token': ''})
nPrm = qQXR.loads(Ylbp.data.decode())
YKHO.assertEqual(Ylbp.status_code, 401)
YKHO.assertEqual(nPrm.get('message'), 'Token is missing') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def w346(YKHO):\n with YKHO.client:\n Ylbp = YKHO.client.post('/api/v1/1/requests', headers={'token': ''})\n nPrm = qQXR.loads(Ylbp.data.decode())\n YKHO.assertEqual(Ylbp.status_code, 401)\n YKHO.assertEqual(nPrm.get('message'), 'Token is missing')",
"def i_2a(YKHO):\n Ylbp = YK... | [
"0.811356",
"0.7780119",
"0.77035546",
"0.76901656",
"0.76895857",
"0.768654",
"0.76756763",
"0.76399946",
"0.76382965",
"0.76319003",
"0.76304865",
"0.7628596",
"0.7626226",
"0.76239276",
"0.7617572",
"0.76060206",
"0.7602189",
"0.7581075",
"0.7577729",
"0.7575935",
"0.75727... | 0.8437781 | 0 |
Tests no ride requests found | def W5An(YKHO):
eOtH = YKHO.get_token()
Ylbp = YKHO.client.post('/api/v1/190/requests', headers={'token': eOtH})
nPrm = qQXR.loads(Ylbp.data.decode())
YKHO.assertEqual(Ylbp.status_code, 404)
YKHO.assertEqual(nPrm.get('message'), 'sorry please , ride offer not found') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _XuU(YKHO):\n with YKHO.client:\n eOtH = YKHO.get_token()\n Ylbp = YKHO.client.get('/api/v1/rides/200', headers={'token': eOtH})\n qQXR.loads(Ylbp.data.decode())\n YKHO.assertEqual(Ylbp.status_code, 404)",
"def g_mP(DvXa):\n geh0 = DvXa.request_ride(product_id=VmlG, start_la... | [
"0.7678899",
"0.73234826",
"0.7280709",
"0.72795385",
"0.7141392",
"0.68693566",
"0.686571",
"0.68584114",
"0.6845086",
"0.6707145",
"0.6704831",
"0.67044693",
"0.6704047",
"0.66810894",
"0.66651404",
"0.66514194",
"0.6606755",
"0.66037077",
"0.6534289",
"0.65248716",
"0.6497... | 0.77009815 | 0 |
Input tensor integers, return softmax weights of vecs. | def upAO(YKHO, _0VL):
return ZylS.nn.embedding_lookup(YKHO._embedding_w, _0VL) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def N93T(x4XE):\n ltYM = sum(map(lambda WKvO: epAf.exp(WKvO), x4XE))\n dKbF = map(lambda WKvO: epAf.exp(WKvO) / ltYM, x4XE)\n return dKbF",
"def N93T(zKTd):\n return zKTd / (XTiz.sum(zKTd) + 1e-06)",
"def N93T(WKvO):\n return Kt_s.nnet.softmax(WKvO.T)",
"def gYwr(YoQM, eHV2, ayOL):\n l0O9 =... | [
"0.70418346",
"0.6820713",
"0.66837096",
"0.66565895",
"0.65917975",
"0.6556622",
"0.64777184",
"0.6457188",
"0.63747996",
"0.63688135",
"0.6356318",
"0.6334359",
"0.6324806",
"0.63091815",
"0.63091326",
"0.627935",
"0.6278406",
"0.6259837",
"0.6257409",
"0.62426955",
"0.6212... | 0.0 | -1 |
Input tensor integers, return softmax biases of vecs. | def oug5(YKHO, _0VL):
return ZylS.nn.embedding_lookup(YKHO._embedding_b, _0VL) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def N93T(WKvO):\n return Kt_s.nnet.softmax(WKvO.T)",
"def NSDm(YKHO, RVMj: torch.Tensor, UqYS: float=10000000.0, tpio: int=64) -> ht2j.Tensor:\n Ep8u, p2QI = (RVMj.shape[0], RVMj.shape[1])\n r5AS = RVMj.view(Ep8u, p2QI, -1).float()\n lMfz = U78l.Softmax(dim=-1)\n N93T = lMfz(r5AS * UqYS).float()\n... | [
"0.68403065",
"0.6662163",
"0.66492146",
"0.66459525",
"0.6587379",
"0.6545485",
"0.6517717",
"0.6495359",
"0.64640933",
"0.6451119",
"0.64067656",
"0.6391142",
"0.63730675",
"0.6348073",
"0.6321224",
"0.6321224",
"0.6315033",
"0.6314921",
"0.6314453",
"0.6313151",
"0.6295365... | 0.0 | -1 |
Returns `true` if at least one of the elements of the list match the predicate, `false` otherwise. | def any(eHNT, yv6U):
return fR_9.any(map(eHNT, yv6U)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rKz3(OxJJ: Iterable[T], lgNN: Predicate[T]) -> bool:\n return any(map(lgNN, OxJJ))",
"def Yw0j(OxJJ: Iterable[T], lgNN: Predicate[T]) -> bool:\n return all(map(lgNN, OxJJ))",
"def tLXV(OxJJ, lgNN):\n return any((lgNN(WKvO) for WKvO in OxJJ))",
"def vtfo(lgNN: Callable[[_T], bool], fUYa: List[_T]... | [
"0.79173476",
"0.76516795",
"0.75948876",
"0.7578734",
"0.7563785",
"0.734515",
"0.7335419",
"0.70824313",
"0.7077756",
"0.69507897",
"0.6806725",
"0.6806246",
"0.6793343",
"0.6745624",
"0.65892845",
"0.6547682",
"0.6541996",
"0.65225714",
"0.6519538",
"0.65169674",
"0.650830... | 0.6820494 | 10 |
True if entire board is empty. 'Stop' condition. | def FBfn(YKHO):
return oyIN.count_nonzero(YKHO) == 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def LWCs(YKHO):\n for LVAh in range(8):\n for WKvO in range(8):\n if YKHO.board[WKvO][LVAh] == KAvf:\n return False\n return True",
"def LWCs(YKHO):\n for LVAh in range(8):\n for WKvO in range(8):\n if YKHO.board[WKvO][LVAh] == KAvf:\n re... | [
"0.84770244",
"0.84770244",
"0.8095584",
"0.80499417",
"0.804543",
"0.79959595",
"0.79739875",
"0.79613626",
"0.7944504",
"0.7939792",
"0.79280925",
"0.7919005",
"0.79154795",
"0.7910007",
"0.78949434",
"0.7884698",
"0.7874073",
"0.7827526",
"0.7819008",
"0.7818052",
"0.78087... | 0.0 | -1 |
Unit test Given gra investigate anomaly summary command args page, max command raw response When mock the Client's send_request. Then run the gra investigate anomaly summary command using the Client Validate the output with mock response Validate the output prefix Validate key field | def erFJ(sisH):
from GuruculGRA import Client, fetch_record_command
ZG9D = S3ET('test_data/gra-investigate-anomaly-summary.json')
sisH.get('https://test.com/api/investigateAnomaly/anomalySummary/ModelName', json=ZG9D)
ljU6 = '/investigateAnomaly/anomalySummary/ModelName'
x0hE = Client(base_url='http... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def test_view(fEex):\n _hkX = await fEex.get(Fhex.API_ENDPOINT)\n assert _hkX.status == 200\n assert _hkX.headers['content-type'] == 'text/plain'\n TBsA = await _hkX.text()\n TBsA = TBsA.split('\\n')\n assert len(TBsA) > 3\n assert '# HELP python_info Python platform information' in TBsA... | [
"0.6358987",
"0.6329677",
"0.6100466",
"0.6046379",
"0.60450625",
"0.6020687",
"0.59661543",
"0.5916068",
"0.58445156",
"0.57876503",
"0.57728213",
"0.5771817",
"0.5758859",
"0.5758671",
"0.57566446",
"0.5756126",
"0.5733837",
"0.5725435",
"0.5724864",
"0.5711428",
"0.5698003... | 0.6698762 | 0 |
Generate a random walk (brownian motion). Data is scaled to produce a soft "flickering" effect. | def UL3h(YKHO):
nPrm = oyIN.zeros((1, 4))
UHFx = 0
while True:
rn_i = YKHO.get_next_data_point()
nPrm[UHFx] = rn_i[:4]
UHFx += 1
B4Dq = len(nPrm)
if UHFx >= B4Dq:
DYef = oyIN.zeros((B4Dq, 4))
nPrm = oyIN.vstack([nPrm, DYef])
yield nPrm | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def JYfK(Fb9w):\n ZAda = []\n LVAh = 0\n for bGrB in range(Fb9w):\n if tuKI.randint(0, 1):\n LVAh += 1\n else:\n LVAh -= 1\n ZAda.append(LVAh)\n return oyIN.array(ZAda)",
"def JYfK(YKHO, N3Vf, pu_z=None, DyFO=None, SiRx=0.0, aXEN=[0.99], ffTp=False):\n as... | [
"0.64948153",
"0.6363016",
"0.6273695",
"0.6261985",
"0.6215217",
"0.6156124",
"0.6098721",
"0.6067536",
"0.6059519",
"0.60495126",
"0.602538",
"0.60220003",
"0.60076326",
"0.5958432",
"0.59573126",
"0.59557",
"0.59476924",
"0.5942948",
"0.5935963",
"0.592117",
"0.591914",
... | 0.0 | -1 |
Return a boolean telling if the crawler is leaf. | def jwB3(YKHO):
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def jwB3(YKHO) -> bool:\n pass",
"def loae() -> bool:\n return True",
"def loae(YKHO):\n return True",
"def loae(YKHO):\n return YKHO._.is_leaf",
"def loae(YKHO):\n return YKHO._is_leaf",
"def loae(YKHO):\n return YKHO.leaf",
"def loae(YKHO):\n return False",
"def jwB3(YKHO):\n ... | [
"0.8202609",
"0.8190603",
"0.81589377",
"0.8143607",
"0.8075696",
"0.806584",
"0.805716",
"0.80548733",
"0.80260533",
"0.7980264",
"0.7980264",
"0.7980264",
"0.7980264",
"0.79520863",
"0.79315704",
"0.7920619",
"0.79200894",
"0.7911081",
"0.7870785",
"0.78707",
"0.78353035",
... | 0.8039213 | 8 |
Converts the image and associated groundtruth into a TF Example. | def NJQa(YKHO):
with open(YKHO.image_path, 'rb') as nUeQ:
LNo8 = nUeQ.read()
Mpe1 = ZylS.train.Example(features=ZylS.train.Features(feature={'image_id': NhGy(YKHO.image_id.encode()), 'image': NhGy(LNo8), 'cls_map': NhGy(YKHO.cls_map.tobytes()), 'reg_map': NhGy(YKHO.reg_map.tobytes())}))
return Mpe1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def LvEM(UiEM, Yp6v, aGOS, ROpF):\n if len(Yp6v) < 5:\n NzvN = [-2] * 56\n dvgN = 5 - len(Yp6v)\n for YRbF in range(dvgN):\n Yp6v.append(NzvN)\n iIhk = b'JPG'\n PU1l = ZylS.train.Example(features=ZylS.train.Features(feature={'image/height': xJYY(ROpF[0]), 'image/width': xJY... | [
"0.7988138",
"0.78621864",
"0.7701467",
"0.7519329",
"0.7485602",
"0.7476759",
"0.7442117",
"0.7406983",
"0.7375819",
"0.73309225",
"0.7319752",
"0.72928876",
"0.7268043",
"0.723452",
"0.72237",
"0.71517426",
"0.71426094",
"0.71072674",
"0.7068695",
"0.7041202",
"0.7026602",
... | 0.7740809 | 2 |
Look for a 'hosts' list in self.config. Each item in the list may either be a role or a hostname. Builds a new Cluster object containing only those hosts which match one (or more) of the roles or hostnames specified. The filtered Cluster object is stored as self.cluster so that the task may only run against those hosts... | def og8u(YKHO):
if not hasattr(YKHO.ctx, 'cluster'):
return
elif 'hosts' not in YKHO.config:
YKHO.cluster = YKHO.ctx.cluster
return YKHO.cluster
ScYp = YKHO.config.get('hosts', list())
hKn5 = PwH5()
for N4jK in ScYp:
VxAJ = YKHO.ctx.cluster.only(N4jK)
if len(V... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nyuy(YKHO):\n if YKHO.distributed_run:\n Xiek = list()\n for Z_mx in YKHO.config_data['hosts']:\n try:\n GT6L, Z_mx = Z_mx.popitem()\n if Z_mx.get('key') and '~' in Z_mx['key']:\n Z_mx['key'] = hIOi(Z_mx['key'])\n Xiek.... | [
"0.68318754",
"0.6554619",
"0.65231866",
"0.60940534",
"0.60685134",
"0.60671276",
"0.6022385",
"0.5996817",
"0.59566736",
"0.5901327",
"0.5874786",
"0.58674324",
"0.58650845",
"0.5852161",
"0.57814413",
"0.5770457",
"0.57701004",
"0.57575023",
"0.5746452",
"0.5723015",
"0.57... | 0.830427 | 0 |
When using an instance of the class as a context manager, this method calls self.setup(), then calls self.begin() and returns self. | def DMw_(YKHO):
YKHO.setup()
YKHO.begin()
return YKHO | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DMw_(YKHO):\n YKHO.setup()\n return YKHO",
"def DMw_(YKHO):\n YKHO.setup()\n return YKHO",
"def DMw_(YKHO):\n return YKHO",
"def Vs4Q(YKHO):\n YKHO._check_closed()\n return YKHO",
"def Vs4Q(YKHO):\n pass",
"def Vs4Q(YKHO):\n return YKHO()",
"def OBr8(YKHO) -> bDy6['MockFs... | [
"0.72084486",
"0.71464986",
"0.6972108",
"0.6869202",
"0.67911625",
"0.67798454",
"0.6738931",
"0.67214656",
"0.67214656",
"0.67214656",
"0.6714195",
"0.6679049",
"0.66034603",
"0.66034603",
"0.66034603",
"0.660221",
"0.660221",
"0.660221",
"0.65964526",
"0.65964526",
"0.6596... | 0.74025655 | 0 |
Return a list of strings in chunks of length | def YAly(l5Ny, vGWD):
Je0U = ZbWC.compile('\\s')
eHxA = list()
xpRm = len(l5Ny)
K0A_ = xpRm % vGWD
I2Si = xpRm / vGWD
if K0A_ > 0:
I2Si += 1
yKcO = 0
Os4s = vGWD
for yOAJ in range(I2Si):
if Je0U.match(l5Ny[Os4s:]):
eHxA.insert(yOAJ, l5Ny[yKcO:Os4s])
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def eHxA(vIwR, ym_X):\n return [vIwR[YRbF:YRbF + ym_X] for YRbF in range(0, len(vIwR), ym_X)]",
"def eHxA(aWuw: str | list[str], /, zNig: int=10) -> list[str] | list[list[str]]:\n return [aWuw[YRbF:YRbF + zNig] for YRbF in range(0, len(aWuw), zNig)]",
"def YjNl(vIwR, u54L):\n return [vIwR[0 + YRbF:u54... | [
"0.7791594",
"0.76072663",
"0.74278325",
"0.73524547",
"0.7295836",
"0.7295836",
"0.7257083",
"0.722368",
"0.7174222",
"0.7091336",
"0.7061457",
"0.70495075",
"0.70435107",
"0.70433486",
"0.70397425",
"0.7038682",
"0.70310926",
"0.70183885",
"0.70071644",
"0.70033294",
"0.699... | 0.0 | -1 |
Initiate field for game. | def FIMM(YKHO, v9Lt=False):
YKHO.active_token = None
if v9Lt:
YKHO.token_types = WBPg.data_from_cont()
else:
YKHO.token_types = [[tuKI.randrange(0, 6, 1) for YRbF in range(10)] for r845 in range(10)]
YKHO.old_grid = jth9.deepcopy(YKHO.token_types)
YKHO.Gtoken = [[GPv_([YRbF * 64, r84... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def FIMM(YKHO, CjMQ):\n YKHO.currentGameField = CjMQ",
"def jVw3(YKHO):\n assert YKHO._occupancy_grid is not None, 'Empty or not provided occupancy grid.'\n assert YKHO._goal is not None, 'Goal is not set.'\n YKHO._field = AqM8(YKHO._occupancy_grid, YKHO._goal)",
"def gIkZ(YKHO):\n KrNb = YKHO._... | [
"0.761574",
"0.69473785",
"0.6881156",
"0.6768398",
"0.6723285",
"0.6673746",
"0.6578123",
"0.65211046",
"0.65054876",
"0.6496298",
"0.64956176",
"0.64956176",
"0.64956176",
"0.64956176",
"0.64956176",
"0.64956176",
"0.64868444",
"0.6455906",
"0.6424003",
"0.6403546",
"0.6376... | 0.0 | -1 |
Renders the home page. | def kZiy(QePW):
assert isinstance(QePW, eu5F)
all = Y6Vf.objects.all().order_by('Category')
return _1tc(QePW, 'inventory/index.html', {'parts': all, 'title': 'Home Page'}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def kZiy():\n return TvZl('home.html')",
"def C_QL():\n return TvZl('home.html')",
"def kZiy():\n return TvZl('homepage.html')",
"def kZiy():\n return TvZl('home.html')",
"def kZiy():\n return TvZl('home.html')",
"def kZiy():\n return TvZl('pages/home.html')",
"def kZiy():\n leAC =... | [
"0.86085397",
"0.85661966",
"0.8562984",
"0.84564984",
"0.8353822",
"0.8353445",
"0.832796",
"0.83265287",
"0.83265287",
"0.8311966",
"0.83088946",
"0.83046836",
"0.8296962",
"0.82942903",
"0.82942903",
"0.82872546",
"0.8279762",
"0.8279762",
"0.8279762",
"0.8279762",
"0.8279... | 0.0 | -1 |
normalize shape to fit inside a unit sphere | def NWTw(iXlf):
OBib = oyIN.max(iXlf, axis=0)
r8Oe = oyIN.min(iXlf, axis=0)
e6ux = oyIN.stack((OBib, r8Oe), 0)
e6ux = oyIN.mean(e6ux, axis=0)
iXlf = iXlf - e6ux
MeW0 = oyIN.max(oyIN.sqrt(oyIN.sum(iXlf ** 2, axis=1)))
iXlf = iXlf / MeW0
return iXlf | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def NkkI(YKHO):\n Bcwd = YKHO.centerOfMass()\n jNOo = YKHO.coordinates()\n if not len(jNOo):\n return\n y5bX = jNOo - Bcwd\n Pwdg = oyIN.sum(y5bX * y5bX, axis=0)\n NXpY = 1 / oyIN.sqrt(oyIN.sum(Pwdg) / len(y5bX))\n a1PO = YU_E.vtkTransform()\n a1PO.Scale(NXpY, NXpY, NXpY)\n a1PO.T... | [
"0.6731059",
"0.66111666",
"0.65816545",
"0.6541162",
"0.6526467",
"0.65153885",
"0.6458686",
"0.6339695",
"0.62901217",
"0.6283504",
"0.6276321",
"0.6212658",
"0.62054783",
"0.61864316",
"0.61641896",
"0.6130155",
"0.61099434",
"0.60784143",
"0.6072214",
"0.6061045",
"0.6059... | 0.5886612 | 34 |
When all students are enrolled, redirect back to the school year. | def TrvC(YKHO):
CBIr = YKHO.make_user()
KMfL = vg3E(school=CBIr.school)
T8k0 = NVMw(school_year=KMfL)
Vyt8(student__school=CBIr.school, grade_level=T8k0)
with YKHO.login(CBIr):
geh0 = YKHO.get('students:enrollment_create', school_year_id=KMfL.id)
assert geh0.get('Location') == YKHO.rever... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def F4al(QePW):\n if 'work_study' in gCuF.INSTALLED_APPS:\n from work_study.views import student_timesheet\n from work_study.models import StudentWorker\n try:\n g3Gt = StudentWorker.objects.get(username=QePW.user.username)\n except rIt9:\n g3Gt = None\n ... | [
"0.64776486",
"0.6277199",
"0.6233502",
"0.6124116",
"0.6082679",
"0.60185206",
"0.5957482",
"0.59430134",
"0.59179455",
"0.58344156",
"0.5818728",
"0.57868993",
"0.5786798",
"0.57713413",
"0.5754003",
"0.574681",
"0.5723992",
"0.5662143",
"0.56464845",
"0.56328756",
"0.56273... | 0.5546659 | 26 |
An invalid POST for a student is rejected. | def pw_b(YKHO):
CBIr = YKHO.make_user()
g3Gt = izUC(school=CBIr.school)
OrWy = izUC()
T8k0 = NVMw(school_year__school=CBIr.school)
nPrm = {'student': str(OrWy.id), 'grade_level': str(T8k0.id)}
with YKHO.login(CBIr):
YKHO.post('students:student_enrollment_create', pk=g3Gt.id, school_year_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def BV64(YKHO):\n YKHO.client.login(username=YKHO.user1.username, password=YKHO.user1_plaintext_pass)\n geh0 = YKHO.client.post(gxEw('yaksh:reject_users', kwargs={'course_id': YKHO.user1_course.id}), data={'check': YKHO.student1.id})\n eHR5 = YKHO.user1_course.rejected.all()\n YKHO.assertEqual(geh0.sta... | [
"0.670799",
"0.6623532",
"0.6623532",
"0.65250945",
"0.64731556",
"0.6430567",
"0.62674147",
"0.62674147",
"0.6262766",
"0.6223725",
"0.6219777",
"0.6162422",
"0.6162422",
"0.614351",
"0.61386615",
"0.6053033",
"0.6043494",
"0.60055965",
"0.5976651",
"0.596194",
"0.5915277",
... | 0.7362396 | 0 |
Convert a subnet IP address integer to its dotdecimal string. | def LRsu(D8Ke):
D8Ke += _FgB
return '{}.{}.{}.{}/{}'.format(D8Ke >> 24 & 255, D8Ke >> 16 & 255, D8Ke >> 8 & 255, D8Ke & 255, LX4v) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bmpV(pBgW):\n _Rvo = 255\n return '.'.join([str(pBgW >> DkWr & _Rvo) for DkWr in (0, 8, 16, 24)])",
"def vflG(I33c):\n c2js = []\n mgCh = I33c.split('.')\n for mAB6 in mgCh:\n mLGw = int(mAB6)\n _XE3 = bin(mLGw)[2:].zfill(8)\n c2js.append(''.join(_XE3))\n return '.'.joi... | [
"0.711703",
"0.70498735",
"0.7021219",
"0.6975031",
"0.6935004",
"0.69009805",
"0.6894673",
"0.6822342",
"0.68133485",
"0.67910427",
"0.6682056",
"0.66462713",
"0.66301316",
"0.6626509",
"0.6625221",
"0.6619597",
"0.6608248",
"0.6585058",
"0.65776795",
"0.65465593",
"0.654068... | 0.6083206 | 64 |
Parses an image and label from the given `serialized_example`. | def x8I_(lGjS):
bySB = ZylS.parse_single_example(lGjS, features={'X': ZylS.FixedLenFeature([], ZylS.string), 'Y': ZylS.FixedLenFeature([], ZylS.string), 'size_X': ZylS.FixedLenFeature([], ZylS.int64), 'size_Y': ZylS.FixedLenFeature([], ZylS.int64), 'channel_X': ZylS.FixedLenFeature([], ZylS.int64), 'channel_Y': Zyl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def m6aZ(lGjS):\n bySB = {'img': ZylS.io.FixedLenFeature([], ZylS.string), 'height': ZylS.io.FixedLenFeature([], ZylS.int64), 'width': ZylS.io.FixedLenFeature([], ZylS.int64), 'depth': ZylS.io.FixedLenFeature([], ZylS.int64), 'label': ZylS.io.FixedLenFeature([], ZylS.string)}\n TlBS = ZylS.io.parse_single_ex... | [
"0.7953992",
"0.7786019",
"0.774252",
"0.77324796",
"0.7671443",
"0.7663667",
"0.7633243",
"0.759509",
"0.7557639",
"0.7551746",
"0.73881733",
"0.72674423",
"0.71680117",
"0.71669364",
"0.7111985",
"0.70312107",
"0.69229937",
"0.69229937",
"0.68701965",
"0.6837335",
"0.681745... | 0.57139134 | 80 |
r"""Expand dims so that there will be no broadcasting issues with different number of dimensions. For example, given two shapes (N, 3, 1), (E, 5, 3, 4) that are valid broadcastable shapes, change them to (N, 1, 3, 1) and (E, 5, 3, 4) | def j7Ov(f6ue, glJR):
axxH = vuvg.shape(f6ue)
fSFk = vuvg.shape(glJR)
if len(axxH) != len(fSFk):
ENmE = max(len(axxH), len(fSFk))
cOJ6 = ENmE - len(axxH)
gmiq = ENmE - len(fSFk)
RaY3 = (axxH[0],) + (1,) * cOJ6 + axxH[1:]
_K8u = (fSFk[0],) + (1,) * gmiq + fSFk[1:]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def XeFl(jzdc, Fg_i):\n assert Fg_i.ndim > jzdc.ndim\n g0XI = [1 for YRbF in range(Fg_i.ndim - 1)]\n return jzdc.reshape([-1] + g0XI)",
"def pF9N(YKHO):\n if not YKHO._inputs:\n return\n\n def dovB(WKvO):\n fdMZ = _WqI.rank(WKvO.t)\n if not WKvO.is_stacked:\n fdMZ +... | [
"0.73169583",
"0.7288022",
"0.71163327",
"0.68975794",
"0.66962004",
"0.6672413",
"0.6504841",
"0.65012926",
"0.6397253",
"0.63716114",
"0.63284856",
"0.62745476",
"0.6271014",
"0.62700486",
"0.626379",
"0.6243719",
"0.6238202",
"0.6227352",
"0.6163804",
"0.6148439",
"0.61460... | 0.0 | -1 |
Checks the database to see if the entered username is already within the database. | def ClZ2(NtEF, jTXt, A39G):
A39G.execute('SELECT * FROM credential_database WHERE username = (?);', NtEF)
nPrm = A39G.fetchall()
if nPrm is None:
mWFP = input('Please enter your name? ').strip()
fAPo(mWFP, NtEF, jTXt, A39G)
else:
SdQn(NtEF, jTXt, A39G) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def IJlN(YKHO, NtEF):\n Ueki = YKHO.get_usernames()\n for YRbF in Ueki:\n if YRbF[0] == NtEF:\n return False\n return True",
"def f7az(YKHO, NtEF: str):\n YKHO.__db_cursor.execute('SELECT * FROM user WHERE username = ?', (NtEF,))\n rdlD = YKHO.__db_cursor.fetchall()\n if rdlD:... | [
"0.8204134",
"0.79103076",
"0.7818543",
"0.77569616",
"0.7580327",
"0.7453281",
"0.73193234",
"0.72261333",
"0.7189061",
"0.7152409",
"0.70872885",
"0.7083907",
"0.706914",
"0.7053121",
"0.7001323",
"0.69999564",
"0.69936883",
"0.6993494",
"0.69835305",
"0.6960222",
"0.695693... | 0.66524386 | 53 |
Compute the matrix bringing the triangle into the plane with imaginary part 0. For an ideal triangle, the matrix will bring the vertices to 0, 1, and infinity. | def _FMV(YKHO):
if YKHO._matrix_to_std_form is None:
YKHO._matrix_to_std_form = cjBL(S8V7.matrix_taking_0_1_inf_to_given_points(*YKHO.three_projective_endpoints))
return YKHO._matrix_to_std_form | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tXIo():\n SxVy = oyIN.array([[2, 0], [1, oyIN.sqrt(3)]])\n eL5z = oyIN.array([[[0, 0], [2, 0], [1, oyIN.sqrt(3)]], [[2, 0], [1, oyIN.sqrt(3)], [3, oyIN.sqrt(3)]]])\n return (SxVy, eL5z)",
"def SppC(YKHO):\n return IPme.np.matrix([[0, 1], [-1j, 0]])",
"def SppC(YKHO):\n Itf2 = oyIN.cos(YKHO.a... | [
"0.65936375",
"0.639445",
"0.6373275",
"0.6239022",
"0.60892713",
"0.60603756",
"0.6047475",
"0.6032138",
"0.6030131",
"0.60270566",
"0.60183483",
"0.59846216",
"0.598284",
"0.59810925",
"0.59762275",
"0.59603447",
"0.5956638",
"0.595347",
"0.59433264",
"0.5933025",
"0.593215... | 0.0 | -1 |
r"""Reshape the density matrix to a tensor where all dimensions have shape 2. | def MD8Z(QTBn):
assert (len(QTBn.shape) == 2) & (int(oyIN.log2(QTBn.shape[0])) == oyIN.log2(QTBn.shape[0])), f'Expected `rho` to be of shape [2**nqubits, 2**nqubits], received shape {QTBn.shape}'
enAT = int(oyIN.log2(QTBn.shape[0]))
return QTBn.reshape([2] * (2 * enAT)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def b7l5(vhpA):\n with ZylS.compat.v1.name_scope(name='reshape_to_2d'):\n fdMZ = vhpA.shape.rank if vhpA.shape is not None else None\n if fdMZ is not None and fdMZ != 2:\n if fdMZ >= 3:\n vhpA = ZylS.reshape(vhpA, ZylS.shape(input=vhpA)[0:2])\n else:\n ... | [
"0.7307598",
"0.7296194",
"0.7249779",
"0.7249779",
"0.6587986",
"0.65807855",
"0.6480112",
"0.6466785",
"0.63117963",
"0.6295346",
"0.62585324",
"0.6234503",
"0.6083811",
"0.605454",
"0.6039918",
"0.6038288",
"0.60253596",
"0.6013825",
"0.60065275",
"0.5992409",
"0.5991125",... | 0.0 | -1 |
Root of the Binary Tree. | def fg9Z(Mkmy):
return [Mkmy, [], []] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tk5Y(YKHO) -> bytes:\n return S0sX if YKHO.root_node is None else YKHO.root_node.value",
"def tk5Y():\n return o7DN(YnkN, FL8s(()), None)",
"def LIOs(YKHO) -> int:\n return 0",
"def LIOs(YKHO):\n return YKHO.tree[0]",
"def _TPe():\n return ECwN(P_7U)",
"def auhX(YKHO):\n return YKHO... | [
"0.77571577",
"0.77450144",
"0.7551923",
"0.7498297",
"0.7466926",
"0.7425936",
"0.73927844",
"0.7372278",
"0.7370124",
"0.7353017",
"0.7346928",
"0.7327004",
"0.7312258",
"0.7312258",
"0.7312258",
"0.7305199",
"0.7302434",
"0.7287535",
"0.7282923",
"0.7275669",
"0.7261675",
... | 0.0 | -1 |
Returns the state of the connection | def jGRS(YKHO) -> bool:
return YKHO._ok | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def uRKJ(YKHO):\n return YKHO._connection_open",
"def cMf8(YKHO):\n return YKHO.__hub_state",
"def uRKJ(YKHO) -> VaR6:\n return YKHO._connection_status",
"def ynwu(YKHO):\n raise NotImplementedError('Not Implemented')",
"def uRKJ(YKHO) -> qe4Y.Output[str]:\n return qe4Y.get(YKHO, 'connection... | [
"0.790152",
"0.78404176",
"0.76402587",
"0.7590016",
"0.7585956",
"0.7522163",
"0.73913753",
"0.7367299",
"0.72544074",
"0.72424996",
"0.72256804",
"0.7223022",
"0.719384",
"0.7186394",
"0.71857023",
"0.71681124",
"0.71681124",
"0.71681124",
"0.71681124",
"0.71681124",
"0.716... | 0.0 | -1 |
Gets active job participants. Some clients might be dropped/dead during job execution. No need to abort those clients. | def IX5J(yGKp: Dict[str, Client], v_U2: Dict[str, Client]) -> x1iM[str]:
XmNI = []
for eOtH, x0hE in v_U2.items():
if eOtH in yGKp:
XmNI.append(x0hE.name)
return XmNI | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def k6cD(YKHO):\n return YKHO.partial_contract.functions.getCurrentParticipants().call()",
"def v_U2(YKHO):\n return [XP5J.user for XP5J in YKHO.active_participations.all()]",
"def RyuL(YKHO):\n return YKHO.participants",
"def v_U2(YKHO):\n return YKHO._participants",
"async def get_participant... | [
"0.74319494",
"0.6934216",
"0.6769818",
"0.67471445",
"0.67185634",
"0.65543723",
"0.6211559",
"0.619229",
"0.61857",
"0.6173507",
"0.6157108",
"0.613391",
"0.6063845",
"0.6060255",
"0.6012408",
"0.5913193",
"0.5900676",
"0.58680457",
"0.5859889",
"0.5853441",
"0.584354",
"... | 0.75838745 | 0 |
Remove storage file at end of tests | def tBIc(Emd4):
del Emd4.user | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tBIc(YKHO):\n del YKHO.storage\n if Hy7s.path.exists('file.json'):\n Hy7s.remove('file.json')",
"def tBIc(YKHO):\n EOaO.helpers.File(YKHO.storage_file).delete()",
"def tBIc(Emd4):\n try:\n kSdD('file.json')\n except Exception:\n pass",
"def tBIc(YKHO):\n try:\n ... | [
"0.8447585",
"0.81454515",
"0.8059325",
"0.80544233",
"0.80544233",
"0.80544233",
"0.80544233",
"0.8010433",
"0.8010433",
"0.79958624",
"0.79401696",
"0.7939776",
"0.7939776",
"0.7939776",
"0.7939776",
"0.7939776",
"0.7929465",
"0.79126716",
"0.79126716",
"0.79126716",
"0.791... | 0.0 | -1 |
Remove storage file at end of tests | def tBIc(YKHO):
try:
Hy7s.remove('file.json')
except Exception:
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tBIc(YKHO):\n del YKHO.storage\n if Hy7s.path.exists('file.json'):\n Hy7s.remove('file.json')",
"def tBIc(YKHO):\n EOaO.helpers.File(YKHO.storage_file).delete()",
"def tBIc(Emd4):\n try:\n kSdD('file.json')\n except Exception:\n pass",
"def tBIc(YKHO):\n try:\n ... | [
"0.8447585",
"0.81454515",
"0.8059325",
"0.80544233",
"0.80544233",
"0.80544233",
"0.80544233",
"0.8010433",
"0.8010433",
"0.79958624",
"0.79401696",
"0.7929465",
"0.79126716",
"0.79126716",
"0.79126716",
"0.79126716",
"0.7908854",
"0.790135",
"0.78895444",
"0.7871797",
"0.78... | 0.7939776 | 11 |
Get an unique file path with constant file upload prefix. | def KUgI(bGrB, Ux0P):
YBcr = Ux0P.split('.')[1]
Ux0P = '%s.%s' % (qxeD.uuid4(), YBcr)
return Hy7s.path.join(gCuF.FILE_UPLOAD_PREFIX_FOLDER_USER, Ux0P) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def D260(KAOR, Ux0P):\n return u'uploads/temp/%s' % Ux0P",
"def GqK0(KAOR, Ux0P):\n Ux0P, Fst3 = Hy7s.path.splitext(Ux0P)\n yGsg = '%s%s' % (str(qxeD.uuid4()).replace('-', ''), Fst3.lower())\n return Hy7s.path.join(KAOR._meta.app_label.lower(), yGsg)",
"def aSzP(KAOR, Ux0P) -> str:\n bGrB, ztnR ... | [
"0.7428025",
"0.7287402",
"0.72865635",
"0.7128981",
"0.7105647",
"0.7087041",
"0.7051743",
"0.70474076",
"0.7046219",
"0.7004483",
"0.698907",
"0.6942699",
"0.6938904",
"0.6878518",
"0.68624973",
"0.68519276",
"0.6824579",
"0.6811233",
"0.6796815",
"0.6792399",
"0.6789364",
... | 0.778643 | 0 |
Get original image url. | def DiWn(YKHO):
try:
return YKHO.original.url
except Exception:
return '' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def WmHo(YKHO):\n return YKHO.image_file.url",
"def eJh7(YKHO):\n return YKHO._build_image_url('o')",
"def kskO(YKHO):\n if YKHO.origin_img:\n return YKHO.origin_img.url\n else:\n return YKHO.serial.get_image_url()",
"def kskO(YKHO):\n if YKHO.origin_img:\n return YKHO.ori... | [
"0.896882",
"0.83839273",
"0.79040927",
"0.7834656",
"0.7800554",
"0.7697632",
"0.7651088",
"0.7649417",
"0.76428145",
"0.76216507",
"0.7549726",
"0.7549726",
"0.7523444",
"0.7509058",
"0.7487747",
"0.7467717",
"0.7370873",
"0.72550935",
"0.7175323",
"0.71632874",
"0.71538377... | 0.8160548 | 2 |
Get medium image url. | def Lbcz(YKHO):
try:
return YKHO.medium.url
except Exception:
return '' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def kskO(YKHO):\n if YKHO.image:\n return XN37.getMediaUrl(YKHO.image.url)\n else:\n return XN37.getBlankImage()",
"def C81C(YKHO):\n return YKHO._user_dict['small_image_url']",
"def kskO(YKHO) -> str:\n return YKHO.image_url",
"def C81C(YKHO):\n return YKHO._user_dict['small_ima... | [
"0.77818304",
"0.7665358",
"0.76569206",
"0.765645",
"0.76413864",
"0.759879",
"0.7598733",
"0.75393206",
"0.74774367",
"0.7391136",
"0.73519653",
"0.7330006",
"0.73195523",
"0.73186475",
"0.73186475",
"0.73185027",
"0.7317039",
"0.72669184",
"0.7264004",
"0.7262938",
"0.7242... | 0.84138614 | 0 |
Expect a response status code of 400 for a request with invalid query parameters | def DcEf(YKHO):
geh0 = YKHO.client.get(YKHO.url)
YKHO.assertEqual(geh0.status_code, jGRS.HTTP_400_BAD_REQUEST) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ZqII(YKHO, NArs):\n Ylbp = YKHO.client.get(YKHO.url, NArs)\n YKHO.assertEqual(Ylbp.status_code, jGRS.HTTP_400_BAD_REQUEST)",
"def _bbE(YKHO):\n bD7m = f'{Q_Es}&limit=1001'\n Ylbp = G4JS.get(bD7m)\n YKHO.assertEqual(Ylbp.status_code, 400)",
"def sWiX(wxKZ):\n Mkmy = wxKZ.get(ruq7 + '?s=foo... | [
"0.7746399",
"0.7459131",
"0.7391851",
"0.7346947",
"0.73132133",
"0.72922623",
"0.72553647",
"0.71820056",
"0.7165232",
"0.71592975",
"0.7139567",
"0.71275747",
"0.70819885",
"0.7058943",
"0.7057015",
"0.70413125",
"0.70142937",
"0.70137846",
"0.70027125",
"0.6979083",
"0.69... | 0.0 | -1 |
Test a course object is returned | def NFUA(YKHO):
zMIN = vK4f()
GQfX = W10k(tutors=[zMIN])
geh0 = YKHO.client.get(YKHO.url_format(coursename=GQfX.name))
YKHO.assertEqual(geh0.status_code, jGRS.HTTP_200_OK)
YKHO.assertEqual(geh0.json(), YKHO.format_course(GQfX, zMIN)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def NFUA(YKHO):\n pass",
"def wpKo(YKHO):\n pass",
"def NMoC(YKHO):\n return V_Pk",
"def i38a(YKHO):\n jwfv = CQpO.get_course(name='CPE 101')\n bcKS = CQpO.get_course(name='CPE 102')\n ie5Y = CQpO.get_course(name='CPE 103')\n bTiR = CQpO.get_course(name='CPE 309')\n YKHO.assertEqual(j... | [
"0.8349423",
"0.7764723",
"0.7405819",
"0.7343819",
"0.73229474",
"0.731012",
"0.72769415",
"0.72172457",
"0.7216993",
"0.72152185",
"0.7206605",
"0.715609",
"0.71267927",
"0.70912373",
"0.706671",
"0.7006648",
"0.7002238",
"0.6951381",
"0.6926128",
"0.692516",
"0.689053",
... | 0.77337384 | 2 |
Expect a response status code of 400 for a request with invalid query parameters | def DcEf(YKHO):
geh0 = YKHO.client.get(YKHO.url)
YKHO.assertEqual(geh0.status_code, jGRS.HTTP_400_BAD_REQUEST) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ZqII(YKHO, NArs):\n Ylbp = YKHO.client.get(YKHO.url, NArs)\n YKHO.assertEqual(Ylbp.status_code, jGRS.HTTP_400_BAD_REQUEST)",
"def _bbE(YKHO):\n bD7m = f'{Q_Es}&limit=1001'\n Ylbp = G4JS.get(bD7m)\n YKHO.assertEqual(Ylbp.status_code, 400)",
"def sWiX(wxKZ):\n Mkmy = wxKZ.get(ruq7 + '?s=foo... | [
"0.7746399",
"0.7459131",
"0.7391851",
"0.7346947",
"0.73132133",
"0.72922623",
"0.72553647",
"0.71820056",
"0.7165232",
"0.71592975",
"0.7139567",
"0.71275747",
"0.70819885",
"0.7058943",
"0.7057015",
"0.70413125",
"0.70142937",
"0.70137846",
"0.70027125",
"0.6979083",
"0.69... | 0.0 | -1 |
Test course objects matching query are returned | def aaQC(YKHO):
zMIN = vK4f()
sDlr = [W10k(tutors=[zMIN]) for YRbF in range(2)]
W10k(name='foo')
geh0 = YKHO.client.get(YKHO.url_format(coursename='course'))
YKHO.assertEqual(geh0.status_code, jGRS.HTTP_200_OK)
O0Fa = [YKHO.format_course(GQfX, zMIN) for GQfX in sDlr]
YKHO.assertEqual(geh0.js... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wpKo(YKHO):\n pass",
"def N7jp(YKHO):\n Ghho = vYJA(should_publish=True)\n sDlr = W10k.create_batch(3, page_title='my title', fill_categories=[Ghho], should_publish=True)\n scXH = Ghho.get_courses()\n with YKHO.assertNumQueries(2):\n YKHO.assertEqual(set(scXH), set(sDlr))\n with YKHO... | [
"0.7329641",
"0.7303545",
"0.7140284",
"0.71064866",
"0.70718986",
"0.69648457",
"0.6816861",
"0.68049103",
"0.6778209",
"0.6758164",
"0.6718715",
"0.6681225",
"0.66805637",
"0.66620094",
"0.66562796",
"0.6628294",
"0.66080165",
"0.6547386",
"0.6532009",
"0.64905185",
"0.6485... | 0.74394923 | 0 |
Convert the current object to a dict, with properly encoded and formatted values for dumping | def MNRr(YKHO):
nPrm = {'path': YKHO.path, 'title': YKHO.title, 'slug': YKHO.slug, 'is_temp': YKHO.is_temporary, 'cover_art': YKHO.cover_art.image_path, 'title_logo': YKHO.title_logo.image_path, 'modified': YKHO.modified, 'deployed': YKHO.deployed, 'plugin_main': YKHO.plugin_main, 'canvas_main': YKHO.canvas_main, '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def OL85(YKHO) -> cuzp[str, object]:\n return {'name': str(YKHO), 'desc': YKHO.desc}",
"def OL85(YKHO):\n return YKHO.to_dict()",
"def qssR(YKHO):\n return YKHO.to_dict()",
"def qssR(YKHO):\n return YKHO.to_dict()",
"def qssR(YKHO):\n return YKHO.to_dict()",
"def qssR(YKHO):\n return YK... | [
"0.76542443",
"0.76119936",
"0.76065606",
"0.76065606",
"0.76065606",
"0.76065606",
"0.76065606",
"0.76065606",
"0.76065606",
"0.76065606",
"0.76065606",
"0.76065606",
"0.76065606",
"0.76065606",
"0.76065606",
"0.76065606",
"0.76065606",
"0.76065606",
"0.76065606",
"0.76065606"... | 0.0 | -1 |
Makes sure the given slug is unique in the gamelist by attaching a counter to it if necessary. | def clH0(YKHO, s5ru):
INFh = YKHO._slugs.keys()
ewCu = 1
Tr7p = s5ru
while ewCu < 1000000:
if Tr7p in INFh:
Tr7p = '%s-%i' % (s5ru, ewCu)
ewCu += 1
else:
return Tr7p
raise nv0U("Exception when trying to make slug '%s' unique" % s5ru) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vsLG(YKHO, cuiw, s5ru):\n TxfB = s5ru\n d6pt = 1\n while True:\n if not YKHO._slug_exists(cuiw, s5ru):\n return s5ru\n d6pt += 1\n s5ru = u'%(slug)s%(separator)s%(index)s' % {'slug': TxfB, 'separator': YKHO._get_slug_option('separator'), 'index': d6pt}",
"def KIjs(YKH... | [
"0.7405539",
"0.7014569",
"0.67317766",
"0.67088246",
"0.6690718",
"0.6678227",
"0.66621256",
"0.6565326",
"0.6554731",
"0.6554731",
"0.65233624",
"0.6512611",
"0.64222264",
"0.63946664",
"0.63571054",
"0.6239738",
"0.6235156",
"0.62334627",
"0.6215285",
"0.616415",
"0.615463... | 0.75685984 | 0 |
Extracts a linearized model of the whole wing in TI coordinates. In addition to calculating a linearization of the wing statespace model, the wing position and velocity are rotated into transin coordinates. | def mEpU(YKHO, Ew_H, hdN7):
def SL9T(QTBn, g4y1):
iQy7 = YKHO.StateToWingState(QTBn)
IK8D = YKHO.InputsToWingInputs(g4y1)
return YKHO._trans_in_frame.StateTangentFromWingStateTangent(iQy7, YKHO._wing.CalcDeriv(iQy7, IK8D)).ToVector()
def ITN3(QTBn, g4y1):
iQy7 = YKHO.StateToWin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def z8o0(WKvO, yzQ0):\n return WKvO.mm(yzQ0)",
"def cs9v(rVnq, z3rX=4000, EaJn=1600, b4lR=330):\n pHXX = 1.0 / z3rX * (1 - rVnq) + rVnq * 1.0 / b4lR\n ftz7 = rVnq * (1.0 / EaJn - 1.0 / b4lR)\n return g74T.RTransLin(1.0 / ftz7, -pHXX / ftz7)",
"def KJk3(rVnq, z3rX=4000, EaJn=1600, b4lR=330):\n if... | [
"0.6314504",
"0.60251087",
"0.5916565",
"0.59073365",
"0.59057826",
"0.58395374",
"0.5835476",
"0.5820563",
"0.58149046",
"0.57998544",
"0.5732412",
"0.5693381",
"0.5683745",
"0.56832147",
"0.5681772",
"0.56781644",
"0.56501967",
"0.55991876",
"0.5598581",
"0.55802757",
"0.55... | 0.66989547 | 0 |
Blend params of target net with params from the model | def a7aw(YKHO, Cwt5):
assert isinstance(Cwt5, float)
assert 0.0 < Cwt5 <= 1.0
QTBn = YKHO.model.state_dict()
EHpn = YKHO.target_model.state_dict()
for G1Hx, Ty9i in QTBn.items():
EHpn[G1Hx] = EHpn[G1Hx] * Cwt5 + (1 - Cwt5) * Ty9i
YKHO.target_model.load_state_dict(EHpn) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xtb4(YKHO) -> None:\n for SIgb, zHw4 in zip(YKHO.model.target_network_1.parameters(), YKHO.model.value_network_1.parameters()):\n SIgb.data.copy_(zHw4.data)\n for SIgb, zHw4 in zip(YKHO.model.target_network_2.parameters(), YKHO.model.value_network_2.parameters()):\n SIgb.data.copy_(zHw4.dat... | [
"0.6593826",
"0.6565335",
"0.65058815",
"0.64494985",
"0.63955176",
"0.6374902",
"0.6374902",
"0.63106203",
"0.6265866",
"0.62491834",
"0.62491834",
"0.62354475",
"0.6230048",
"0.6204624",
"0.61404586",
"0.61373603",
"0.60964286",
"0.6089218",
"0.60281783",
"0.6011327",
"0.59... | 0.0 | -1 |
Put the given value into Node at head of list. | def JPHp(YKHO, nPrm):
Fv8N = o7DN(nPrm)
Fv8N.next = YKHO.head
YKHO.head = Fv8N | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mn5t(YKHO, BWXx):\n Esd_ = o7DN(BWXx)\n if YKHO.size == 0:\n YKHO.head = YKHO.tail = Esd_\n else:\n Esd_.next = YKHO.head\n YKHO.head.prev = Esd_\n YKHO.head = Esd_\n YKHO.size += 1",
"def PgMl(YKHO, wEf2):\n Q6kx = o7DN(wEf2, None)\n if len(YKHO.list) > 0:\n ... | [
"0.8256279",
"0.8107994",
"0.80775666",
"0.79889655",
"0.7937222",
"0.78546995",
"0.78536135",
"0.7853575",
"0.7839886",
"0.7785129",
"0.7771705",
"0.776932",
"0.77531946",
"0.7740771",
"0.77166843",
"0.77032155",
"0.76733935",
"0.76730525",
"0.7669958",
"0.7651833",
"0.76292... | 0.0 | -1 |
Return node data, remove node from head of list. | def BEuN(YKHO):
BWXx = YKHO.head.data
YKHO.head = YKHO.head.next
return BWXx | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def kSdD(YKHO, nPrm):\n if YKHO.is_empty():\n return 0\n Q6kx = YKHO.head\n CXwD = None\n while Q6kx:\n if Q6kx.data == nPrm:\n if CXwD:\n CXwD.next = Q6kx\n else:\n YKHO.head = o7DN(nPrm)\n CXwD = Q6kx\n Q6kx = Q6kx.next\n... | [
"0.76844275",
"0.7455303",
"0.73797923",
"0.73594016",
"0.72739035",
"0.7270031",
"0.7224282",
"0.7201085",
"0.7176251",
"0.7158221",
"0.7019253",
"0.6995881",
"0.6955447",
"0.69261616",
"0.69191635",
"0.6885169",
"0.68640494",
"0.6861548",
"0.6806987",
"0.6752573",
"0.674500... | 0.678547 | 19 |
Return length of linked list. | def zNig(YKHO):
THsq = YKHO.head
sL7f = 0
while THsq is not None:
sL7f = sL7f + 1
THsq = THsq.next
return sL7f | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def u54L(YKHO):\n exwG = 0\n AsCw = YKHO.head\n while AsCw != None:\n exwG += 1\n AsCw = AsCw.next\n return exwG",
"def szAg(YKHO):\n u54L = 0\n if YKHO.head is not None:\n aCLL = YKHO.head\n u54L = 1\n while aCLL.pointer_next is not None:\n u54L +=... | [
"0.8731087",
"0.8703748",
"0.8610377",
"0.857673",
"0.8531789",
"0.8523338",
"0.8480015",
"0.8430744",
"0.8388546",
"0.83812773",
"0.83704346",
"0.83685637",
"0.83614916",
"0.83409697",
"0.8320443",
"0.83203006",
"0.83119565",
"0.82508886",
"0.821235",
"0.821111",
"0.81901705... | 0.7984766 | 34 |