query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
itkClosingByReconstructionImageFilterIUC2IUC2SE2_cast(itkLightObject obj) > itkClosingByReconstructionImageFilterIUC2IUC2SE2 | def itkClosingByReconstructionImageFilterIUC2IUC2SE2_cast(obj: 'itkLightObject') -> "itkClosingByReconstructionImageFilterIUC2IUC2SE2 *":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUC2IUC2SE2_cast(obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkClosingByReconstructionImageFilterIF2IF2SE2_cast(obj: 'itkLightObject') -> \"itkClosingByReconstructionImageFilterIF2IF2SE2 *\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIF2IF2SE2_cast(obj)",
"def itkClosingByReconstructionImageFilterISS2ISS2SE2_cast(ob... | [
"0.9094487",
"0.892813",
"0.88923836",
"0.8808969",
"0.86756104",
"0.849839",
"0.84565437",
"0.8413163",
"0.8300593",
"0.8144473",
"0.8085332",
"0.80624056",
"0.79270774",
"0.78160214",
"0.7811117",
"0.7381053",
"0.7363875",
"0.73554814",
"0.72934204",
"0.72761345",
"0.726952... | 0.9434102 | 0 |
Clone(itkClosingByReconstructionImageFilterIUC3IUC3SE3 self) > itkClosingByReconstructionImageFilterIUC3IUC3SE3_Pointer | def Clone(self) -> "itkClosingByReconstructionImageFilterIUC3IUC3SE3_Pointer":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUC3IUC3SE3_Clone(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Clone(self) -> \"itkClosingByReconstructionImageFilterIF3IF3SE3_Pointer\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIF3IF3SE3_Clone(self)",
"def Clone(self) -> \"itkClosingByReconstructionImageFilterISS3ISS3SE3_Pointer\":\n return _itkClosingByR... | [
"0.8870095",
"0.8852904",
"0.86978513",
"0.82489634",
"0.7940481",
"0.7861347",
"0.78182197",
"0.7719044",
"0.7642605",
"0.7639799",
"0.7575767",
"0.7507209",
"0.7497229",
"0.74765986",
"0.7464829",
"0.74192995",
"0.7403438",
"0.7402809",
"0.7399535",
"0.7379717",
"0.73676556... | 0.9087483 | 0 |
SetKernel(itkClosingByReconstructionImageFilterIUC3IUC3SE3 self, itkFlatStructuringElement3 _arg) | def SetKernel(self, _arg: 'itkFlatStructuringElement3') -> "void":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUC3IUC3SE3_SetKernel(self, _arg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetKernel(self, _arg: 'itkFlatStructuringElement3') -> \"void\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterISS3ISS3SE3_SetKernel(self, _arg)",
"def SetKernel(self, _arg: 'itkFlatStructuringElement3') -> \"void\":\n return _itkClosingByReconstruct... | [
"0.87967896",
"0.8768365",
"0.8676756",
"0.80837196",
"0.7657948",
"0.75440073",
"0.74304426",
"0.7106602",
"0.68617153",
"0.68583995",
"0.67624915",
"0.6503266",
"0.60740113",
"0.60377955",
"0.5928931",
"0.5890028",
"0.5850205",
"0.57892156",
"0.57512635",
"0.5732098",
"0.57... | 0.90187323 | 0 |
GetKernel(itkClosingByReconstructionImageFilterIUC3IUC3SE3 self) > itkFlatStructuringElement3 | def GetKernel(self) -> "itkFlatStructuringElement3 const &":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUC3IUC3SE3_GetKernel(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetKernel(self) -> \"itkFlatStructuringElement3 const &\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIF3IF3SE3_GetKernel(self)",
"def GetKernel(self) -> \"itkFlatStructuringElement3 const &\":\n return _itkClosingByReconstructionImageFilterPython... | [
"0.8720017",
"0.870213",
"0.8526976",
"0.81219715",
"0.7829018",
"0.76152015",
"0.75632316",
"0.7383283",
"0.7299358",
"0.7229781",
"0.6935656",
"0.65073776",
"0.6350634",
"0.6319421",
"0.61794525",
"0.6025813",
"0.6003018",
"0.59922576",
"0.59605676",
"0.5940384",
"0.5936271... | 0.88501745 | 0 |
SetFullyConnected(itkClosingByReconstructionImageFilterIUC3IUC3SE3 self, bool const _arg) | def SetFullyConnected(self, _arg: 'bool const') -> "void":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUC3IUC3SE3_SetFullyConnected(self, _arg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetFullyConnected(self, _arg: 'bool const') -> \"void\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterISS3ISS3SE3_SetFullyConnected(self, _arg)",
"def SetFullyConnected(self, _arg: 'bool const') -> \"void\":\n return _itkClosingByReconstructionImage... | [
"0.8940274",
"0.8907193",
"0.8878431",
"0.85763353",
"0.8461777",
"0.8330449",
"0.82187444",
"0.81940156",
"0.79421276",
"0.7782718",
"0.77632457",
"0.7712408",
"0.7641748",
"0.7638555",
"0.755289",
"0.73011106",
"0.72259843",
"0.7209995",
"0.70541453",
"0.696733",
"0.6949492... | 0.9132044 | 0 |
GetFullyConnected(itkClosingByReconstructionImageFilterIUC3IUC3SE3 self) > bool const & | def GetFullyConnected(self) -> "bool const &":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUC3IUC3SE3_GetFullyConnected(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetFullyConnected(self) -> \"bool const &\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterISS3ISS3SE3_GetFullyConnected(self)",
"def GetFullyConnected(self) -> \"bool const &\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByRecon... | [
"0.89245474",
"0.88499874",
"0.87483287",
"0.8408562",
"0.8331849",
"0.8277154",
"0.81766677",
"0.79348415",
"0.7849235",
"0.78357506",
"0.782642",
"0.7814798",
"0.7790844",
"0.76885945",
"0.75227916",
"0.75099283",
"0.7382205",
"0.73414326",
"0.7134758",
"0.7092631",
"0.6994... | 0.9071447 | 0 |
SetPreserveIntensities(itkClosingByReconstructionImageFilterIUC3IUC3SE3 self, bool const _arg) | def SetPreserveIntensities(self, _arg: 'bool const') -> "void":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUC3IUC3SE3_SetPreserveIntensities(self, _arg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetPreserveIntensities(self, _arg: 'bool const') -> \"void\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS3IUS3SE3_SetPreserveIntensities(self, _arg)",
"def SetPreserveIntensities(self, _arg: 'bool const') -> \"void\":\n return _itkClosingByReco... | [
"0.89666015",
"0.8939188",
"0.8915819",
"0.8669218",
"0.83719575",
"0.818505",
"0.8164125",
"0.76863796",
"0.7526853",
"0.751382",
"0.7507289",
"0.7298677",
"0.6963878",
"0.6863821",
"0.684122",
"0.6343539",
"0.62201446",
"0.6176192",
"0.5994617",
"0.5910288",
"0.5835555",
... | 0.9107639 | 0 |
GetPreserveIntensities(itkClosingByReconstructionImageFilterIUC3IUC3SE3 self) > bool const & | def GetPreserveIntensities(self) -> "bool const &":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUC3IUC3SE3_GetPreserveIntensities(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetPreserveIntensities(self) -> \"bool const &\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterISS3ISS3SE3_GetPreserveIntensities(self)",
"def GetPreserveIntensities(self) -> \"bool const &\":\n return _itkClosingByReconstructionImageFilterPython.it... | [
"0.91535944",
"0.91393644",
"0.90981555",
"0.8916886",
"0.8631113",
"0.8564229",
"0.8544625",
"0.8061919",
"0.7982208",
"0.7930507",
"0.7927121",
"0.77030545",
"0.74598235",
"0.7415036",
"0.7394481",
"0.6501116",
"0.6339946",
"0.6316789",
"0.6048363",
"0.5906522",
"0.58116794... | 0.92567843 | 0 |
New() > itkClosingByReconstructionImageFilterIUC3IUC3SE3 Create a new object of the class itkClosingByReconstructionImageFilterIUC3IUC3SE3 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new object... | def New(*args, **kargs):
obj = itkClosingByReconstructionImageFilterIUC3IUC3SE3.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkClosingByReconstructionImageFilterIF3IF3SE3.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkClosingByReconstructionImageFilterISS3ISS3SE3.__New_orig__()\n i... | [
"0.7901545",
"0.78035825",
"0.7753514",
"0.73671824",
"0.73583114",
"0.7345497",
"0.73065835",
"0.7288644",
"0.72746885",
"0.7258372",
"0.7249874",
"0.72422403",
"0.7218361",
"0.72172165",
"0.7216565",
"0.7203041",
"0.7197322",
"0.7193438",
"0.7192178",
"0.7183932",
"0.717745... | 0.8043357 | 0 |
itkClosingByReconstructionImageFilterIUC3IUC3SE3_cast(itkLightObject obj) > itkClosingByReconstructionImageFilterIUC3IUC3SE3 | def itkClosingByReconstructionImageFilterIUC3IUC3SE3_cast(obj: 'itkLightObject') -> "itkClosingByReconstructionImageFilterIUC3IUC3SE3 *":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUC3IUC3SE3_cast(obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkClosingByReconstructionImageFilterIF3IF3SE3_cast(obj: 'itkLightObject') -> \"itkClosingByReconstructionImageFilterIF3IF3SE3 *\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIF3IF3SE3_cast(obj)",
"def itkClosingByReconstructionImageFilterISS3ISS3SE3_cast(ob... | [
"0.92251986",
"0.91105694",
"0.902514",
"0.8686058",
"0.86790997",
"0.8542711",
"0.8507781",
"0.8432451",
"0.8179849",
"0.8127734",
"0.808936",
"0.8034706",
"0.7851973",
"0.7834374",
"0.78329265",
"0.7335175",
"0.7288044",
"0.7283043",
"0.72808725",
"0.7266606",
"0.72111905",... | 0.94122666 | 0 |
Clone(itkClosingByReconstructionImageFilterIUS2IUS2SE2 self) > itkClosingByReconstructionImageFilterIUS2IUS2SE2_Pointer | def Clone(self) -> "itkClosingByReconstructionImageFilterIUS2IUS2SE2_Pointer":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS2IUS2SE2_Clone(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Clone(self) -> \"itkClosingByReconstructionImageFilterIUC2IUC2SE2_Pointer\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUC2IUC2SE2_Clone(self)",
"def Clone(self) -> \"itkClosingByReconstructionImageFilterIF2IF2SE2_Pointer\":\n return _itkClosingB... | [
"0.85015124",
"0.84877455",
"0.8421094",
"0.8391097",
"0.79423773",
"0.7843026",
"0.77931875",
"0.7774556",
"0.77409136",
"0.77389",
"0.7699804",
"0.7666084",
"0.7658649",
"0.7563679",
"0.75306475",
"0.75256",
"0.7523187",
"0.7375108",
"0.73621374",
"0.7350906",
"0.73398274",... | 0.9153919 | 0 |
SetKernel(itkClosingByReconstructionImageFilterIUS2IUS2SE2 self, itkFlatStructuringElement2 _arg) | def SetKernel(self, _arg: 'itkFlatStructuringElement2') -> "void":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS2IUS2SE2_SetKernel(self, _arg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetKernel(self, _arg: 'itkFlatStructuringElement2') -> \"void\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIF2IF2SE2_SetKernel(self, _arg)",
"def SetKernel(self, _arg: 'itkFlatStructuringElement2') -> \"void\":\n return _itkClosingByReconstructio... | [
"0.8645127",
"0.8488477",
"0.84837323",
"0.8135113",
"0.78003716",
"0.7599809",
"0.745969",
"0.72576296",
"0.6897831",
"0.6881336",
"0.68070436",
"0.62231696",
"0.6208213",
"0.6139644",
"0.5932276",
"0.5915778",
"0.58419853",
"0.57307214",
"0.5694225",
"0.568464",
"0.5668344"... | 0.90341544 | 0 |
GetKernel(itkClosingByReconstructionImageFilterIUS2IUS2SE2 self) > itkFlatStructuringElement2 | def GetKernel(self) -> "itkFlatStructuringElement2 const &":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS2IUS2SE2_GetKernel(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetKernel(self) -> \"itkFlatStructuringElement2 const &\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIF2IF2SE2_GetKernel(self)",
"def GetKernel(self) -> \"itkFlatStructuringElement2 const &\":\n return _itkClosingByReconstructionImageFilterPython... | [
"0.8614796",
"0.84830785",
"0.8438221",
"0.77230066",
"0.75065386",
"0.74044544",
"0.7280007",
"0.72523093",
"0.7185758",
"0.69011515",
"0.68770754",
"0.64597654",
"0.6223974",
"0.61098355",
"0.61056185",
"0.60981476",
"0.6032902",
"0.59857684",
"0.5957543",
"0.5922142",
"0.5... | 0.87821114 | 0 |
SetFullyConnected(itkClosingByReconstructionImageFilterIUS2IUS2SE2 self, bool const _arg) | def SetFullyConnected(self, _arg: 'bool const') -> "void":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS2IUS2SE2_SetFullyConnected(self, _arg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetFullyConnected(self, _arg: 'bool const') -> \"void\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIF2IF2SE2_SetFullyConnected(self, _arg)",
"def SetFullyConnected(self, _arg: 'bool const') -> \"void\":\n return _itkClosingByReconstructionImageFi... | [
"0.86272013",
"0.855463",
"0.85445607",
"0.82872486",
"0.8215462",
"0.8008392",
"0.7973231",
"0.7906793",
"0.79065967",
"0.77987903",
"0.7726246",
"0.75605214",
"0.75489783",
"0.74917716",
"0.741857",
"0.73723006",
"0.7251151",
"0.7231512",
"0.7115057",
"0.70686233",
"0.70606... | 0.9149572 | 0 |
GetFullyConnected(itkClosingByReconstructionImageFilterIUS2IUS2SE2 self) > bool const & | def GetFullyConnected(self) -> "bool const &":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS2IUS2SE2_GetFullyConnected(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetFullyConnected(self) -> \"bool const &\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIF2IF2SE2_GetFullyConnected(self)",
"def GetFullyConnected(self) -> \"bool const &\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconst... | [
"0.8684348",
"0.8644756",
"0.85777193",
"0.83312166",
"0.81481636",
"0.80399376",
"0.79924554",
"0.7987091",
"0.7966345",
"0.7914293",
"0.78480446",
"0.75379825",
"0.7527912",
"0.74987245",
"0.7496596",
"0.7405684",
"0.7298534",
"0.7266777",
"0.7254238",
"0.71520525",
"0.7077... | 0.89732593 | 0 |
SetPreserveIntensities(itkClosingByReconstructionImageFilterIUS2IUS2SE2 self, bool const _arg) | def SetPreserveIntensities(self, _arg: 'bool const') -> "void":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS2IUS2SE2_SetPreserveIntensities(self, _arg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetPreserveIntensities(self, _arg: 'bool const') -> \"void\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIF2IF2SE2_SetPreserveIntensities(self, _arg)",
"def SetPreserveIntensities(self, _arg: 'bool const') -> \"void\":\n return _itkClosingByRecons... | [
"0.8780772",
"0.87706864",
"0.8750592",
"0.84332615",
"0.8119866",
"0.8041043",
"0.78704566",
"0.77361315",
"0.7387475",
"0.7358677",
"0.73467845",
"0.7033211",
"0.67388386",
"0.66814405",
"0.65339565",
"0.6368427",
"0.6288632",
"0.61187065",
"0.60125244",
"0.58179533",
"0.56... | 0.9192003 | 0 |
GetPreserveIntensities(itkClosingByReconstructionImageFilterIUS2IUS2SE2 self) > bool const & | def GetPreserveIntensities(self) -> "bool const &":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS2IUS2SE2_GetPreserveIntensities(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetPreserveIntensities(self) -> \"bool const &\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIF2IF2SE2_GetPreserveIntensities(self)",
"def GetPreserveIntensities(self) -> \"bool const &\":\n return _itkClosingByReconstructionImageFilterPython.itkC... | [
"0.89520186",
"0.8950909",
"0.89209706",
"0.8713262",
"0.84571296",
"0.8400122",
"0.8240409",
"0.8178559",
"0.7939745",
"0.789017",
"0.7843256",
"0.75349635",
"0.7335985",
"0.72460735",
"0.71129596",
"0.6395361",
"0.63435966",
"0.6277531",
"0.5898122",
"0.56449664",
"0.558923... | 0.92547655 | 0 |
cast(itkLightObject obj) > itkClosingByReconstructionImageFilterIUS2IUS2SE2 | def cast(obj: 'itkLightObject') -> "itkClosingByReconstructionImageFilterIUS2IUS2SE2 *":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS2IUS2SE2_cast(obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkClosingByReconstructionImageFilterIUS2IUS2SE2_cast(obj: 'itkLightObject') -> \"itkClosingByReconstructionImageFilterIUS2IUS2SE2 *\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS2IUS2SE2_cast(obj)",
"def itkClosingByReconstructionImageFilterIF2IF2SE2_cas... | [
"0.90009856",
"0.86672235",
"0.8609859",
"0.8599575",
"0.85493976",
"0.84069884",
"0.8391315",
"0.83661693",
"0.82655585",
"0.8137448",
"0.8013584",
"0.7959478",
"0.78977084",
"0.78772926",
"0.78583014",
"0.7464113",
"0.7369629",
"0.73474246",
"0.73442006",
"0.7341893",
"0.73... | 0.8742411 | 1 |
New() > itkClosingByReconstructionImageFilterIUS2IUS2SE2 Create a new object of the class itkClosingByReconstructionImageFilterIUS2IUS2SE2 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new object... | def New(*args, **kargs):
obj = itkClosingByReconstructionImageFilterIUS2IUS2SE2.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkClosingByReconstructionImageFilterIF2IF2SE2.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkClosingByReconstructionImageFilterISS2ISS2SE2.__New_orig__()\n i... | [
"0.7739434",
"0.773748",
"0.7674915",
"0.7394538",
"0.7271518",
"0.725568",
"0.7117268",
"0.7096452",
"0.7058575",
"0.70510274",
"0.70429605",
"0.701467",
"0.69993955",
"0.69908696",
"0.69858193",
"0.6982005",
"0.698027",
"0.6971387",
"0.69706655",
"0.6962964",
"0.69600946",
... | 0.80050063 | 0 |
itkClosingByReconstructionImageFilterIUS2IUS2SE2_cast(itkLightObject obj) > itkClosingByReconstructionImageFilterIUS2IUS2SE2 | def itkClosingByReconstructionImageFilterIUS2IUS2SE2_cast(obj: 'itkLightObject') -> "itkClosingByReconstructionImageFilterIUS2IUS2SE2 *":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS2IUS2SE2_cast(obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkClosingByReconstructionImageFilterIF2IF2SE2_cast(obj: 'itkLightObject') -> \"itkClosingByReconstructionImageFilterIF2IF2SE2 *\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIF2IF2SE2_cast(obj)",
"def itkClosingByReconstructionImageFilterIUC2IUC2SE2_cast(ob... | [
"0.9005013",
"0.8971759",
"0.88796717",
"0.8775801",
"0.8584742",
"0.85481197",
"0.8410268",
"0.83874696",
"0.8264278",
"0.8136872",
"0.81331176",
"0.79599327",
"0.78856677",
"0.77576107",
"0.77172554",
"0.7083911",
"0.7057294",
"0.70163554",
"0.7000654",
"0.699567",
"0.69923... | 0.9335144 | 0 |
Clone(itkClosingByReconstructionImageFilterIUS3IUS3SE3 self) > itkClosingByReconstructionImageFilterIUS3IUS3SE3_Pointer | def Clone(self) -> "itkClosingByReconstructionImageFilterIUS3IUS3SE3_Pointer":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS3IUS3SE3_Clone(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Clone(self) -> \"itkClosingByReconstructionImageFilterIUC3IUC3SE3_Pointer\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUC3IUC3SE3_Clone(self)",
"def Clone(self) -> \"itkClosingByReconstructionImageFilterISS3ISS3SE3_Pointer\":\n return _itkClosin... | [
"0.8484318",
"0.84702325",
"0.842707",
"0.840378",
"0.7751902",
"0.76950467",
"0.76757926",
"0.76589197",
"0.7598815",
"0.7550278",
"0.74730957",
"0.7391906",
"0.73515147",
"0.73485017",
"0.73307157",
"0.7250309",
"0.7232967",
"0.72257906",
"0.72111714",
"0.7161519",
"0.71503... | 0.9029011 | 0 |
SetKernel(itkClosingByReconstructionImageFilterIUS3IUS3SE3 self, itkFlatStructuringElement3 _arg) | def SetKernel(self, _arg: 'itkFlatStructuringElement3') -> "void":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS3IUS3SE3_SetKernel(self, _arg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetKernel(self, _arg: 'itkFlatStructuringElement3') -> \"void\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterISS3ISS3SE3_SetKernel(self, _arg)",
"def SetKernel(self, _arg: 'itkFlatStructuringElement3') -> \"void\":\n return _itkClosingByReconstruct... | [
"0.8544999",
"0.8429703",
"0.8407344",
"0.82220656",
"0.77760094",
"0.77499765",
"0.7565369",
"0.6848285",
"0.6543831",
"0.6532451",
"0.6454369",
"0.64529634",
"0.619017",
"0.60362065",
"0.5930904",
"0.5808548",
"0.5657731",
"0.56368774",
"0.55790496",
"0.5397168",
"0.5296951... | 0.89128524 | 0 |
GetKernel(itkClosingByReconstructionImageFilterIUS3IUS3SE3 self) > itkFlatStructuringElement3 | def GetKernel(self) -> "itkFlatStructuringElement3 const &":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS3IUS3SE3_GetKernel(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetKernel(self) -> \"itkFlatStructuringElement3 const &\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterISS3ISS3SE3_GetKernel(self)",
"def GetKernel(self) -> \"itkFlatStructuringElement3 const &\":\n return _itkClosingByReconstructionImageFilterPyth... | [
"0.8478558",
"0.84371465",
"0.84278625",
"0.8028384",
"0.78205335",
"0.7763454",
"0.7580585",
"0.71872014",
"0.70047",
"0.7002124",
"0.69068766",
"0.6467817",
"0.62754744",
"0.6270326",
"0.616907",
"0.6074677",
"0.5980593",
"0.59529406",
"0.59240556",
"0.59156674",
"0.5834862... | 0.8712078 | 0 |
SetFullyConnected(itkClosingByReconstructionImageFilterIUS3IUS3SE3 self, bool const _arg) | def SetFullyConnected(self, _arg: 'bool const') -> "void":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS3IUS3SE3_SetFullyConnected(self, _arg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetFullyConnected(self, _arg: 'bool const') -> \"void\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterISS3ISS3SE3_SetFullyConnected(self, _arg)",
"def SetFullyConnected(self, _arg: 'bool const') -> \"void\":\n return _itkClosingByReconstructionImage... | [
"0.87793493",
"0.8670281",
"0.8652685",
"0.83085936",
"0.818941",
"0.817972",
"0.80729187",
"0.8032319",
"0.78198785",
"0.7774943",
"0.7705494",
"0.7651955",
"0.75825",
"0.7532281",
"0.74605453",
"0.7291711",
"0.7272569",
"0.7262682",
"0.7221417",
"0.70685947",
"0.6985759",
... | 0.9075917 | 0 |
GetFullyConnected(itkClosingByReconstructionImageFilterIUS3IUS3SE3 self) > bool const & | def GetFullyConnected(self) -> "bool const &":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS3IUS3SE3_GetFullyConnected(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetFullyConnected(self) -> \"bool const &\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterISS3ISS3SE3_GetFullyConnected(self)",
"def GetFullyConnected(self) -> \"bool const &\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByRecon... | [
"0.8820575",
"0.8732048",
"0.87097955",
"0.82368064",
"0.81092364",
"0.8064562",
"0.8043824",
"0.80306643",
"0.7984785",
"0.7902991",
"0.77958727",
"0.761335",
"0.75799084",
"0.75475013",
"0.7513527",
"0.7483533",
"0.7461316",
"0.7449499",
"0.71325946",
"0.7115286",
"0.711403... | 0.89998007 | 0 |
SetPreserveIntensities(itkClosingByReconstructionImageFilterIUS3IUS3SE3 self, bool const _arg) | def SetPreserveIntensities(self, _arg: 'bool const') -> "void":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS3IUS3SE3_SetPreserveIntensities(self, _arg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetPreserveIntensities(self, _arg: 'bool const') -> \"void\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterISS3ISS3SE3_SetPreserveIntensities(self, _arg)",
"def SetPreserveIntensities(self, _arg: 'bool const') -> \"void\":\n return _itkClosingByReco... | [
"0.8820491",
"0.8789229",
"0.8732143",
"0.8716661",
"0.8355718",
"0.82196546",
"0.8185138",
"0.7591703",
"0.7334283",
"0.73190963",
"0.72886044",
"0.7238671",
"0.6941433",
"0.6812144",
"0.67764693",
"0.59817064",
"0.59329647",
"0.5781655",
"0.5677562",
"0.56147516",
"0.558688... | 0.90965956 | 0 |
GetPreserveIntensities(itkClosingByReconstructionImageFilterIUS3IUS3SE3 self) > bool const & | def GetPreserveIntensities(self) -> "bool const &":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS3IUS3SE3_GetPreserveIntensities(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetPreserveIntensities(self) -> \"bool const &\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterISS3ISS3SE3_GetPreserveIntensities(self)",
"def GetPreserveIntensities(self) -> \"bool const &\":\n return _itkClosingByReconstructionImageFilterPython.it... | [
"0.89789957",
"0.8955424",
"0.88808346",
"0.8870446",
"0.86316764",
"0.84845334",
"0.8450105",
"0.8021811",
"0.7842461",
"0.7791627",
"0.77381504",
"0.7734085",
"0.7455635",
"0.73785913",
"0.73750436",
"0.6197675",
"0.60644907",
"0.5986067",
"0.58347577",
"0.5728896",
"0.5721... | 0.9218565 | 0 |
New() > itkClosingByReconstructionImageFilterIUS3IUS3SE3 Create a new object of the class itkClosingByReconstructionImageFilterIUS3IUS3SE3 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new object... | def New(*args, **kargs):
obj = itkClosingByReconstructionImageFilterIUS3IUS3SE3.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkClosingByReconstructionImageFilterIF3IF3SE3.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkClosingByReconstructionImageFilterIUC3IUC3SE3.__New_orig__()\n i... | [
"0.7800396",
"0.77463865",
"0.77456737",
"0.73035336",
"0.72925544",
"0.72432643",
"0.72315735",
"0.7191846",
"0.7169465",
"0.71634096",
"0.7152158",
"0.7131833",
"0.7127582",
"0.71201",
"0.7117096",
"0.71168154",
"0.70939165",
"0.7092374",
"0.7081723",
"0.7074484",
"0.706879... | 0.81307817 | 0 |
itkClosingByReconstructionImageFilterIUS3IUS3SE3_cast(itkLightObject obj) > itkClosingByReconstructionImageFilterIUS3IUS3SE3 | def itkClosingByReconstructionImageFilterIUS3IUS3SE3_cast(obj: 'itkLightObject') -> "itkClosingByReconstructionImageFilterIUS3IUS3SE3 *":
return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS3IUS3SE3_cast(obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkClosingByReconstructionImageFilterIUC3IUC3SE3_cast(obj: 'itkLightObject') -> \"itkClosingByReconstructionImageFilterIUC3IUC3SE3 *\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUC3IUC3SE3_cast(obj)",
"def itkClosingByReconstructionImageFilterIF3IF3SE3_cas... | [
"0.90610385",
"0.90469825",
"0.89925444",
"0.863602",
"0.850568",
"0.8504291",
"0.8383299",
"0.8359962",
"0.8161705",
"0.8080607",
"0.80224025",
"0.79543",
"0.7725504",
"0.7709635",
"0.76784",
"0.70103747",
"0.7008954",
"0.7000842",
"0.69716895",
"0.6968204",
"0.69012684",
... | 0.93086535 | 0 |
Procedural interface for ClosingByReconstructionImageFilter | def closing_by_reconstruction_image_filter(*args, **kwargs):
import itk
instance = itk.ClosingByReconstructionImageFilter.New(*args, **kwargs)
return instance.__internal_call__() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkClosingByReconstructionImageFilterIUS3IUS3SE3_cast(obj: 'itkLightObject') -> \"itkClosingByReconstructionImageFilterIUS3IUS3SE3 *\":\n return _itkClosingByReconstructionImageFilterPython.itkClosingByReconstructionImageFilterIUS3IUS3SE3_cast(obj)",
"def itkClosingByReconstructionImageFilterISS3ISS3SE3_c... | [
"0.63548434",
"0.63303536",
"0.62666154",
"0.6262504",
"0.62137145",
"0.6175071",
"0.6165676",
"0.616227",
"0.59355927",
"0.5900054",
"0.5850508",
"0.5825451",
"0.58229274",
"0.58176297",
"0.5816939",
"0.5806825",
"0.5799639",
"0.5787858",
"0.57646954",
"0.5745068",
"0.573676... | 0.82311475 | 0 |
Given a path of an excel file, and the key word to search for, return a list of row name (part title) and column name (date) | def get_events(path, sheet_index=0, key="SF"):
wb = xlrd.open_workbook(path)
sheet = wb.sheet_by_index(sheet_index)
events = []
# Scan the excel file for all cells that contanin the key ("SF") and return them
for i in range(sheet.nrows):
for j in range(sheet.ncols):
if... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_excel_column(file_path):\n excel = load_workbook(file_path)\n ws = excel.active\n\n folder_names = [ws[f\"A{row}\"].value for row in range(1, ws.max_row + 1)]\n\n return folder_names",
"def extract_xlsx(fname=None, search_hdrs=None):\n results = []\n\n if fname is None or search_hdrs i... | [
"0.60739326",
"0.6069642",
"0.60424995",
"0.5662053",
"0.5661541",
"0.55312496",
"0.5518624",
"0.5503751",
"0.5461845",
"0.54326236",
"0.5400862",
"0.5390291",
"0.5327766",
"0.5297836",
"0.5297794",
"0.5269683",
"0.5219931",
"0.5203534",
"0.5192281",
"0.5173685",
"0.5163066",... | 0.6282939 | 0 |
Add the background updates we need to run. | def _add_background_updates(self) -> None:
# Ugh, have to reset this flag
self.store.db_pool.updates._all_done = False
self.get_success(
self.store.db_pool.simple_insert(
"background_updates",
{
"update_name": "populate_stats_proce... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def apply_updates(self, updates):\n raise NotImplementedError()",
"def update_with_background(conn, table11, table12):\n c = get_cursor(conn)\n y12_temp = []\n y11 = c.execute(\"select name, N_ucn_gadget_time_offset_0, \\\n N_ucn_Gadget_time_offset_10, \\\n N... | [
"0.6056364",
"0.59839153",
"0.5982003",
"0.58476335",
"0.58471817",
"0.580506",
"0.57085776",
"0.57085776",
"0.5644559",
"0.562831",
"0.5612061",
"0.5565634",
"0.5507911",
"0.5504246",
"0.5494891",
"0.54617864",
"0.54388374",
"0.5436723",
"0.53947693",
"0.53685457",
"0.535784... | 0.80678904 | 0 |
When we create a user, it should have statistics already ready. | def test_create_user(self) -> None:
u1 = self.register_user("u1", "pass")
u1stats = self._get_current_stats("user", u1)
assert u1stats is not None
# not in any rooms by default
self.assertEqual(u1stats["joined_rooms"], 0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_user_create(self, user):",
"def ready(self):\n\n from django.dispatch import receiver\n from django.db.models.signals import post_save\n\n @receiver(post_save, sender=get_user_model(), dispatch_uid='create_profile_for_new_user', weak=False)\n def create_profile_for_new_user(sen... | [
"0.6532903",
"0.64836967",
"0.6451608",
"0.6438491",
"0.64274126",
"0.6360561",
"0.62718606",
"0.62718606",
"0.6264211",
"0.62587714",
"0.61885023",
"0.6178239",
"0.612783",
"0.6124604",
"0.61213136",
"0.61051863",
"0.6077972",
"0.60746056",
"0.60487974",
"0.60487974",
"0.604... | 0.71359956 | 0 |
When we create a room, it should have statistics already ready. | def test_create_room(self) -> None:
self._perform_background_initial_update()
u1 = self.register_user("u1", "pass")
u1token = self.login("u1", "pass")
r1 = self.helper.create_room_as(u1, tok=u1token)
r1stats = self._get_current_stats("room", r1)
r2 = self.helper.create_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_initial_room(self) -> None:\n r = self.get_success(self.get_all_room_state())\n self.assertEqual(len(r), 0)\n\n # Disable stats\n self.hs.config.stats.stats_enabled = False\n self.handler.stats_enabled = False\n\n u1 = self.register_user(\"u1\", \"pass\")\n ... | [
"0.68553406",
"0.6465387",
"0.60137737",
"0.5893817",
"0.58506906",
"0.5763357",
"0.5763357",
"0.5757465",
"0.5741517",
"0.571944",
"0.5715264",
"0.5676014",
"0.5630572",
"0.5620727",
"0.56175774",
"0.56039953",
"0.55939823",
"0.55919516",
"0.5588111",
"0.5576234",
"0.5571000... | 0.7014823 | 0 |
Check that the joined_members count does not increase when a user changes their profile information (which is done by sending another join membership event into the room. | def test_updating_profile_information_does_not_increase_joined_members_count(
self,
) -> None:
self._perform_background_initial_update()
# Create a user and room
u1 = self.register_user("u1", "pass")
u1token = self.login("u1", "pass")
r1 = self.helper.create_room_as(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def on_member_join(self, member: Member) -> None:\n if member.guild.id != Guild.id:\n return\n\n self.bot.stats.gauge(\"guild.total_members\", len(member.guild.members))",
"async def on_member_leave(self, member: Member) -> None:\n if member.guild.id != Guild.id:\n ... | [
"0.6869855",
"0.68166924",
"0.6404332",
"0.6248339",
"0.61954445",
"0.61417925",
"0.6070378",
"0.602709",
"0.5997346",
"0.59915704",
"0.59397566",
"0.5908685",
"0.58963937",
"0.587346",
"0.5854399",
"0.5841349",
"0.5798234",
"0.57818437",
"0.5779018",
"0.5704024",
"0.56968933... | 0.78851503 | 0 |
When we send a nonoverwriting state event, it increments current_state_events | def test_send_state_event_nonoverwriting(self) -> None:
self._perform_background_initial_update()
u1 = self.register_user("u1", "pass")
u1token = self.login("u1", "pass")
r1 = self.helper.create_room_as(u1, tok=u1token)
self.helper.send_state(
r1, "cat.hissing", {"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def state_changed(self, oldstate, newstate, event, *args, **kwargs):",
"def state_changed(self, oldstate, newstate, event, *args, **kwargs):",
"def state_not_changed(self, curstate, event, *args, **kwargs):",
"def state_not_changed(self, curstate, event, *args, **kwargs):",
"def event_m20_11_x78():\n \"... | [
"0.7038768",
"0.7038768",
"0.6892146",
"0.6892146",
"0.6581123",
"0.6432743",
"0.6241337",
"0.6234832",
"0.6214873",
"0.61381626",
"0.6121127",
"0.6098407",
"0.6097788",
"0.60918456",
"0.6087105",
"0.60741526",
"0.6016871",
"0.59944445",
"0.59821403",
"0.59372073",
"0.5935215... | 0.7044309 | 0 |
When a user joins a room for the first time, current_state_events and joined_members should increase by exactly 1. | def test_join_first_time(self) -> None:
self._perform_background_initial_update()
u1 = self.register_user("u1", "pass")
u1token = self.login("u1", "pass")
r1 = self.helper.create_room_as(u1, tok=u1token)
u2 = self.register_user("u2", "pass")
u2token = self.login("u2", ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_left(self) -> None:\n\n self._perform_background_initial_update()\n\n u1 = self.register_user(\"u1\", \"pass\")\n u1token = self.login(\"u1\", \"pass\")\n r1 = self.helper.create_room_as(u1, tok=u1token)\n\n u2 = self.register_user(\"u2\", \"pass\")\n u2token = se... | [
"0.61923236",
"0.61729",
"0.5849123",
"0.5670317",
"0.5647825",
"0.55116916",
"0.54975545",
"0.546851",
"0.5429992",
"0.5418824",
"0.5392885",
"0.5301927",
"0.52645737",
"0.5241673",
"0.5174897",
"0.51493716",
"0.5096865",
"0.5090626",
"0.5065686",
"0.5065471",
"0.50493836",
... | 0.6617902 | 0 |
When a user invites another user, current_state_events and invited_members should increase by exactly 1. | def test_invited(self) -> None:
self._perform_background_initial_update()
u1 = self.register_user("u1", "pass")
u1token = self.login("u1", "pass")
r1 = self.helper.create_room_as(u1, tok=u1token)
u2 = self.register_user("u2", "pass")
r1stats_ante = self._get_current_s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_invites_added(self):\n rsp = self.client.post('/join/join-here', data={'name': 'bob'})\n rsp_json = json.loads(rsp.data)\n\n invites = model.Invitation.query.filter_by(\n joining_user_id=rsp_json['new_user_id']).count()\n self.assertNotEqual(int(invites), 0)",
... | [
"0.62669677",
"0.6151333",
"0.6146201",
"0.6146201",
"0.5982737",
"0.5917056",
"0.58961165",
"0.5864554",
"0.58228034",
"0.5767328",
"0.56286234",
"0.5563426",
"0.55605423",
"0.5538223",
"0.5535634",
"0.5492615",
"0.5424227",
"0.53574204",
"0.5346219",
"0.53082675",
"0.527454... | 0.72165114 | 0 |
When a user joins a room after being invited and joined_members should increase by exactly 1. current_state_events should not increase. invited_members should decrease by exactly 1. | def test_join_after_invite(self) -> None:
self._perform_background_initial_update()
u1 = self.register_user("u1", "pass")
u1token = self.login("u1", "pass")
r1 = self.helper.create_room_as(u1, tok=u1token)
u2 = self.register_user("u2", "pass")
u2token = self.login("u2"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_updating_profile_information_does_not_increase_joined_members_count(\n self,\n ) -> None:\n self._perform_background_initial_update()\n\n # Create a user and room\n u1 = self.register_user(\"u1\", \"pass\")\n u1token = self.login(\"u1\", \"pass\")\n r1 = self.h... | [
"0.6267237",
"0.6255446",
"0.6143402",
"0.60078174",
"0.5930082",
"0.57408834",
"0.56175256",
"0.5502865",
"0.5489063",
"0.5452673",
"0.5424638",
"0.53998023",
"0.5343082",
"0.5338269",
"0.5332079",
"0.53257495",
"0.525084",
"0.52493846",
"0.5203204",
"0.52001464",
"0.5157115... | 0.6345596 | 0 |
When a user leaves a room after joining and left_members should increase by exactly 1. current_state_events should not increase. joined_members should decrease by exactly 1. | def test_left(self) -> None:
self._perform_background_initial_update()
u1 = self.register_user("u1", "pass")
u1token = self.login("u1", "pass")
r1 = self.helper.create_room_as(u1, tok=u1token)
u2 = self.register_user("u2", "pass")
u2token = self.login("u2", "pass")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_join_after_leave(self) -> None:\n\n self._perform_background_initial_update()\n\n u1 = self.register_user(\"u1\", \"pass\")\n u1token = self.login(\"u1\", \"pass\")\n r1 = self.helper.create_room_as(u1, tok=u1token)\n\n u2 = self.register_user(\"u2\", \"pass\")\n ... | [
"0.6676531",
"0.62421066",
"0.6240414",
"0.6054202",
"0.60157704",
"0.5906167",
"0.58742523",
"0.5870555",
"0.58667487",
"0.58667487",
"0.58667487",
"0.58667487",
"0.5765743",
"0.5730516",
"0.5714041",
"0.5699091",
"0.5648446",
"0.5572455",
"0.5469315",
"0.5442863",
"0.543843... | 0.72765714 | 0 |
When a user is banned from a room after joining and left_members should increase by exactly 1. current_state_events should not increase. banned_members should decrease by exactly 1. | def test_banned(self) -> None:
self._perform_background_initial_update()
u1 = self.register_user("u1", "pass")
u1token = self.login("u1", "pass")
r1 = self.helper.create_room_as(u1, tok=u1token)
u2 = self.register_user("u2", "pass")
u2token = self.login("u2", "pass")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_left(self) -> None:\n\n self._perform_background_initial_update()\n\n u1 = self.register_user(\"u1\", \"pass\")\n u1token = self.login(\"u1\", \"pass\")\n r1 = self.helper.create_room_as(u1, tok=u1token)\n\n u2 = self.register_user(\"u2\", \"pass\")\n u2token = se... | [
"0.6417384",
"0.5791914",
"0.57784915",
"0.57503456",
"0.5625447",
"0.5577208",
"0.55642927",
"0.55357516",
"0.54930985",
"0.54406565",
"0.5437866",
"0.5437866",
"0.5350779",
"0.5350779",
"0.53496784",
"0.5284599",
"0.52844584",
"0.52296644",
"0.51913357",
"0.514781",
"0.5108... | 0.65219855 | 0 |
Test that statistics can be generated by the initial background update handler. This test also tests that stats rows are not created for new subjects when stats are disabled. However, it may be desirable to change this behaviour eventually to still keep current rows. | def test_initial_background_update(self) -> None:
self.hs.config.stats.stats_enabled = False
self.handler.stats_enabled = False
u1 = self.register_user("u1", "pass")
u1token = self.login("u1", "pass")
r1 = self.helper.create_room_as(u1, tok=u1token)
# test that these s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_incomplete_stats(self) -> None:\n\n u1 = self.register_user(\"u1\", \"pass\")\n u1token = self.login(\"u1\", \"pass\")\n u2 = self.register_user(\"u2\", \"pass\")\n u2token = self.login(\"u2\", \"pass\")\n u3 = self.register_user(\"u3\", \"pass\")\n r1 = self.help... | [
"0.69991827",
"0.56929016",
"0.56826496",
"0.56800884",
"0.55342835",
"0.55225754",
"0.551775",
"0.5515975",
"0.5510311",
"0.53979516",
"0.53977644",
"0.53937167",
"0.53831583",
"0.53823787",
"0.5368692",
"0.5360374",
"0.5336794",
"0.5333024",
"0.52924734",
"0.52905583",
"0.5... | 0.7543413 | 0 |
This tests that we track incomplete statistics. We first test that incomplete stats are incrementally generated, following the preparation of a background regen. We then test that these incomplete rows are completed by the background regen. | def test_incomplete_stats(self) -> None:
u1 = self.register_user("u1", "pass")
u1token = self.login("u1", "pass")
u2 = self.register_user("u2", "pass")
u2token = self.login("u2", "pass")
u3 = self.register_user("u3", "pass")
r1 = self.helper.create_room_as(u1, tok=u1toke... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_dataset_scenario_generation_full_incomplete(self):\n params = ParameterServer()\n\n map_filename = os.path.join(os.path.dirname(__file__), \"data/DR_CHN_Merging_ZS_partial_v02.xodr\")\n track_filename = os.path.join(os.path.dirname(__file__), \"data/interaction_dataset_CHN_Merging_dummy_track_i... | [
"0.6376003",
"0.6111881",
"0.60915554",
"0.59847647",
"0.59795815",
"0.5837561",
"0.57572603",
"0.5740389",
"0.57235134",
"0.5714973",
"0.57064825",
"0.5670711",
"0.565431",
"0.56492686",
"0.5625276",
"0.56210244",
"0.56156737",
"0.56119835",
"0.5593985",
"0.557517",
"0.55575... | 0.7584583 | 0 |
Sets the destination files creation and modification dates equal to those of the source file. | def fix_file_dates(source_file_name, dest_file_name):
shutil.copystat(source_file_name, dest_file_name)
print("Fixed dates for " + dest_file_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _copy_file ( self, source, dest ):\n return",
"def copy(self, src_path: str, tgt_path: str) -> None:",
"def multicopy(src_file_or_dir, target_dir, num_copies, min_period_days=0, target_base_name=None, append_time=True,\r\n ignore_errors=False, reporter=None):\r\n \r\n def log_info(... | [
"0.5787591",
"0.5738975",
"0.5528444",
"0.5424799",
"0.5363778",
"0.53178966",
"0.53148353",
"0.53132135",
"0.52762586",
"0.5272542",
"0.52270204",
"0.5204267",
"0.5204267",
"0.5204267",
"0.5186348",
"0.5181818",
"0.51763284",
"0.5171035",
"0.51658225",
"0.51593035",
"0.51593... | 0.68550074 | 0 |
Copies the source file to the complete path given by the destination file name. | def copy_file(source_file_name, dest_file_name):
print("Copying " + source_file_name + " to " + dest_file_name)
shutil.copy2(source_file_name, dest_file_name)
print("Copying done.") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _copy_file ( self, source, dest ):\n return",
"def copyFile(srcPath, destPath):\n shutil.copy(srcPath, destPath)",
"def copy(self, src_path: str, tgt_path: str) -> None:",
"def copyfile(self, source, outputfile):\n shutil.copyfileobj(source, outputfile)",
"def copyfile(self, source, ... | [
"0.8305233",
"0.8165325",
"0.80052423",
"0.79078555",
"0.79078555",
"0.79078555",
"0.7757644",
"0.77523226",
"0.77361107",
"0.7706218",
"0.76773053",
"0.7676942",
"0.7594872",
"0.75890267",
"0.75653714",
"0.75216645",
"0.75098884",
"0.7491349",
"0.74740213",
"0.74288714",
"0.... | 0.8358859 | 0 |
Finds a dmi id from the dmi type name Returns a dmi id or raises KeyError | def dmi_id(self, dmi_type):
if dmi_type not in self.dmi_types.values():
raise KeyError(_('unknown dmi type'))
return [item[0]
for item in self.dmi_types.items()
if item[1] == dmi_type][0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_id(type_: Dict[str, str]) -> int:\n return int(type_[f'{type_name}_id'])",
"def get_id(disk):\n\n #TODO\n return \"Unknown\"",
"def get_id(self, entity_name, type_name):\n if not self.is_type(type_name):\n raise TypeNameError(type_name, 'Undeclared type')\n try:\n retur... | [
"0.6799138",
"0.6263075",
"0.60022056",
"0.59098756",
"0.57927275",
"0.5776779",
"0.5695641",
"0.5681889",
"0.56678605",
"0.56395626",
"0.5614103",
"0.56126016",
"0.5598625",
"0.55976176",
"0.55845064",
"0.5583997",
"0.5582245",
"0.556944",
"0.55494374",
"0.5542063",
"0.55134... | 0.7403647 | 0 |
Returns dmi items matching an optional dmi id | def get_items(self, dmi_type=None):
if dmi_type is None:
return [elt[1] for elt in self.data]
dmi_id = self.dmi_id(dmi_type)
return [elt[1] for elt in self.data if elt[0] == dmi_id] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_macd_by_id(id, items):\n\n for x in items:\n if x.plato_ids == id:\n return x\n \n return None",
"def get_from_id(self,id=None):\n if id is None:\n return(self.items)\n if type(id) is int:\n for item in self.items:\n if ite... | [
"0.6512489",
"0.6301968",
"0.5970963",
"0.5757869",
"0.5726346",
"0.56626356",
"0.5608432",
"0.56043154",
"0.5546777",
"0.5486322",
"0.54813045",
"0.54663026",
"0.54590404",
"0.54240704",
"0.53930503",
"0.5381725",
"0.53579557",
"0.53565246",
"0.5352973",
"0.5346482",
"0.5335... | 0.6604527 | 0 |
Parse the whole dmidecode output. Returns a list of tuples of (type int, value dict). | def _parse_dmi(self, content):
info = []
lines = iter(content.strip().splitlines())
while True:
try:
line = next(lines)
except StopIteration:
break
if line.startswith('Handle 0x'):
typ = int(line.split(',', 2)[1... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_dmidecode(output):\n \n dict1 = parseSplit(output,delimit = \":\",add_underscore = 1)\n \n manufacturer = dict1['manufacturer']\n model = dict1['product_name']\n return manufacturer,model\n pass",
"def parseDuMap(output):\n #z00du00(DB-SL-MSL-CH-SCH) : 00-00-0-0-0 01-01-0-0-0 04... | [
"0.6622796",
"0.5792142",
"0.56839275",
"0.5674415",
"0.5599573",
"0.558803",
"0.5522216",
"0.53948164",
"0.5362736",
"0.5355701",
"0.5344866",
"0.5338441",
"0.53352517",
"0.53190315",
"0.53088856",
"0.52894753",
"0.5273296",
"0.52658886",
"0.5249392",
"0.524254",
"0.52136385... | 0.60553604 | 1 |
Return a list of dictionaries of vasp files. | def read_vasp_from_dir(path):
file_names = os.listdir(path)
# Convert all the VASP files into a list of dictionaries.
mts = []
for file_name in file_names:
file_path = os.path.join(path, file_name)
mt = read_vasp(file_path)
mts.append(mt)
return mts | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_vfiles(vfiles: List[Path]) -> Dict:\n models = {}\n for vfile in vfiles:\n assert vfile.is_file(), f\"{vfile} not found.\"\n model_name = vfile.parent.stem\n\n steps = {}\n for line in vfile.read_text(encoding=\"utf-8\").splitlines():\n entries = line.strip().s... | [
"0.617539",
"0.6120495",
"0.6105825",
"0.59928626",
"0.5938262",
"0.5936922",
"0.592364",
"0.58899593",
"0.58887285",
"0.5762474",
"0.57582617",
"0.57545364",
"0.57389504",
"0.57311535",
"0.57222027",
"0.5719902",
"0.57150817",
"0.5710185",
"0.56854993",
"0.56806296",
"0.5678... | 0.7573444 | 0 |
Create the respective market offer odd depending on the given offer odd model and assigns the dummy source to the created offer odd entry id the odds have been created by us (they belong to the dummy bookmaker) | def create_market_offer_odd(offer_odd_model, market_offer, market_odd, bookmaker, source, timestamp):
# TODO you could compare with the latest entry of this bookmaker and save only if its different.
# Have in mind the case that you have all the same but different source
# As it is now every change in the ti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_initial_markets(events, source=get_dummy_source):\n # TODO NOW MAKE IT FASTER\n if not isinstance(source, games.models.Source):\n source = source()\n logger.info(\"creating initial markets (from source %s)...\", source)\n if not source:\n return []\n markets = games.models.M... | [
"0.5801467",
"0.573139",
"0.5286467",
"0.5071691",
"0.49881226",
"0.49708775",
"0.4960566",
"0.48354894",
"0.4756988",
"0.47553658",
"0.4748612",
"0.47181866",
"0.47178853",
"0.47089615",
"0.46790126",
"0.46666893",
"0.4661192",
"0.46429843",
"0.4619307",
"0.4596428",
"0.4590... | 0.75060195 | 0 |
Creates market trees for the given events using the given source (for the entries that need a source). These markets would have all odds as 1. This happens in order to be able to show to the templates, events for which we haven't get odds yet (so these events have no market tree and so they are not available for select... | def create_initial_markets(events, source=get_dummy_source):
# TODO NOW MAKE IT FASTER
if not isinstance(source, games.models.Source):
source = source()
logger.info("creating initial markets (from source %s)...", source)
if not source:
return []
markets = games.models.MarketType.obje... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_winner_offer_tree(event, bookmaker_name, bookmaker_sid, source_timestamp, home, draw, away, source):\n try:\n with transaction.atomic():\n # event = zakanda.db.get_event_from(event_sid, source=source)\n open_winner_result, open_winner_result_created = games.models.MarketR... | [
"0.59935576",
"0.5869428",
"0.586578",
"0.5438899",
"0.5175914",
"0.5100437",
"0.50986767",
"0.5070654",
"0.49881256",
"0.48746252",
"0.48639494",
"0.47771758",
"0.4723523",
"0.4699708",
"0.46826112",
"0.46564043",
"0.46338087",
"0.4611741",
"0.4592044",
"0.45786324",
"0.4514... | 0.82975733 | 0 |
Test the version has the right type. | def test_version_type(self):
self.assertIsInstance(get_version(), str) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_version_type(self):\n self.assertIsInstance(VERSION, str)",
"def test_version(self):\n self.assertIsInstance(nevow.version, Version)",
"def is_for(self, model_type: str, version: Version):\n return model_type == self.model_type and version in self.version_spec",
"def check_type(... | [
"0.7902882",
"0.73431396",
"0.7259362",
"0.69525206",
"0.69502354",
"0.675765",
"0.66693646",
"0.6649047",
"0.6645403",
"0.6643989",
"0.6626245",
"0.65915287",
"0.65611786",
"0.6533981",
"0.6476329",
"0.6466666",
"0.6460401",
"0.64543813",
"0.6429425",
"0.642619",
"0.63135505... | 0.7991225 | 0 |
Create a file with given text and return the path to the file. | def _create_file(self, rel_path, text):
# FIXME: There are better/more secure APIs for creating tmp file paths.
file_path = self.filesystem.join(self._temp_dir, rel_path)
self.filesystem.write_text_file(file_path, text)
return file_path | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_text_file(text, path):\n os.makedirs(os.path.dirname(path), exist_ok=True)\n with open(path, \"w\") as f:\n f.write(text)",
"def create_file(file_name: str, startup_text: str) -> None:\n with open(file_name, 'w') as f:\n f.write(startup_text)",
"def write_file(text):\n\n... | [
"0.7485118",
"0.7133904",
"0.70352113",
"0.693468",
"0.68880665",
"0.68616074",
"0.6808318",
"0.67852104",
"0.67777216",
"0.67590594",
"0.6717497",
"0.6708046",
"0.66795063",
"0.66623086",
"0.6656562",
"0.6597362",
"0.65952146",
"0.65633154",
"0.6545989",
"0.65401393",
"0.652... | 0.7915241 | 0 |
Assert the state of the file reader. | def _assert_file_reader(self, passed_to_processor, file_count):
self.assertEqual(passed_to_processor, self._passed_to_processor())
self.assertEqual(file_count, self._file_reader.file_count) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assertState(self, files):\n\n for path, expected in files.iteritems():\n fullpath = os.path.join(self._dir, path)\n self.assertFile(fullpath, path)\n with open(fullpath, 'r') as file:\n actual = file.read() \n self.assertEqual(actual, expected)",... | [
"0.65576375",
"0.630704",
"0.6259095",
"0.6129729",
"0.6102388",
"0.6047664",
"0.5981475",
"0.5981327",
"0.59391576",
"0.5931246",
"0.5887123",
"0.58822995",
"0.5847855",
"0.5837889",
"0.5825261",
"0.5813653",
"0.5811164",
"0.5801451",
"0.5795041",
"0.5791119",
"0.57892203",
... | 0.7348435 | 0 |
Gets some matches from a region and inserts them until the DB is up to date. | async def crawl_region(region):
api = crawler.Crawler()
while True:
try:
last_match_update = (await db.select(
"""
SELECT data->'attributes'->>'createdAt' AS created
FROM match
WHERE data->'attributes'->>'shardId'='""" + region... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def recrawl():\n print(\"getting recent matches\")\n\n # TODO: insert API version (force update if changed)\n # TODO: create database indices\n # get or put when the last crawl was executed\n\n # crawl and upsert\n for region in [\"na\", \"eu\"]:\n # fire workers\n asyncio.ens... | [
"0.5880626",
"0.5664854",
"0.56467146",
"0.55274117",
"0.5381915",
"0.53720456",
"0.5368748",
"0.5272098",
"0.5232718",
"0.52208513",
"0.5215454",
"0.5131369",
"0.5126437",
"0.5070577",
"0.506748",
"0.5041423",
"0.5034717",
"0.50088394",
"0.49895504",
"0.49647525",
"0.4954279... | 0.71871024 | 0 |
Gets the latest matches from all regions every 5 minutes. | async def recrawl():
print("getting recent matches")
# TODO: insert API version (force update if changed)
# TODO: create database indices
# get or put when the last crawl was executed
# crawl and upsert
for region in ["na", "eu"]:
# fire workers
asyncio.ensure_future(crawl_regi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def crawl_region(region):\n api = crawler.Crawler()\n\n while True:\n try:\n last_match_update = (await db.select(\n \"\"\"\n SELECT data->'attributes'->>'createdAt' AS created\n FROM match\n WHERE data->'attributes'->>'shard... | [
"0.59167427",
"0.5419016",
"0.53820026",
"0.522453",
"0.5222131",
"0.5203309",
"0.5109126",
"0.50215584",
"0.4995967",
"0.49675328",
"0.49284062",
"0.49078292",
"0.48930252",
"0.48487175",
"0.48147234",
"0.48088905",
"0.48084053",
"0.48047125",
"0.4802607",
"0.47965136",
"0.4... | 0.5939364 | 0 |
Retrieve user id associated with unknown user | def _get_unknown_userid(self):
cursor = self.conn.cursor()
unknown_user_str = dbtypes.User.null
cursor.execute("select id from users where uniqueid='%s'" % unknown_user_str)
return cursor.fetchone()[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_user_id(self, user: Optional[Dict[str, Any]]) -> Optional[str]:\n return user[\"id\"] if user and \"id\" in user else None",
"def get_user_id(self, user):\n\n found_user = self.search(user)\n\n if found_user:\n return found_user[\"data\"][0][\"id\"]\n else:\n ... | [
"0.80703926",
"0.7739519",
"0.74276316",
"0.74240243",
"0.7409892",
"0.7354176",
"0.73442143",
"0.73369294",
"0.7335993",
"0.7314981",
"0.7309735",
"0.7252466",
"0.7252466",
"0.7247549",
"0.72232276",
"0.71860266",
"0.71308315",
"0.71196645",
"0.7065585",
"0.7065585",
"0.7065... | 0.8226905 | 0 |
Returns a table with userid and most likely country (based on carrier location frequency). | def users_and_countries(self, use_cache=True):
key = 'user_and_countries'
if use_cache and key in self.cache:
return self.cache[key].copy()
cursor = self.conn.cursor()
if not use_cache:
self._drop_tables(['user_country_freqs', 'user_and_likely_country'])
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def topBrandsandCountries(df, countries_unique):\n top_countries = {}\n for x in countries_unique:\n if df[df.geo_country==x].device_brand_name.count() > 500:\n top_countries[x] = df[df.geo_country==x].device_brand_name.count()\n\n top_3_brands = ['Apple','Samsung','Huawei']\n\n apple... | [
"0.6027341",
"0.5707412",
"0.56690294",
"0.5584211",
"0.55345434",
"0.5529844",
"0.55264854",
"0.5523708",
"0.54850024",
"0.54555094",
"0.54511356",
"0.5417159",
"0.54145026",
"0.5412654",
"0.54065925",
"0.5402608",
"0.5402319",
"0.5393934",
"0.5393602",
"0.5368755",
"0.53668... | 0.6677945 | 0 |
Create a temporary reference table by inserting values. This is used to speed up sqlite queries that are too slow when given the list directly in the query text (most likely a parsing issue?). | def create_reference_ids_table(self, vals, table_name='_ref'):
# remove existing
self._drop_tables([table_name])
cursor = self.conn.cursor()
cursor.execute('CREATE TEMP TABLE %s (id INTEGER)' % table_name)
for i, v in enumerate(vals):
cursor.execute('INSERT INTO %s VA... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_temp_table(self):\n self.assertEqual([\"test\", [[\"c1\", \"INT\"], [\"c2\", \"VARCHAR(200)\"]]],\n grammar._TEMP_TABLE_EXPR.parseString(\"test(c1 INT, c2 VARCHAR(200));\").asList())",
"def addrow_from_list(self, list):\n database = managers.database_manager.get_dat... | [
"0.5920271",
"0.58773065",
"0.58020234",
"0.5671305",
"0.565148",
"0.5648343",
"0.5610942",
"0.56091493",
"0.558918",
"0.5520262",
"0.5502982",
"0.54935277",
"0.5473874",
"0.54285735",
"0.5411863",
"0.54074514",
"0.5402223",
"0.5401393",
"0.53903306",
"0.53665066",
"0.5363484... | 0.6863687 | 0 |
Compute the time offset from the start of a session for a list of events. Only possible with data from JSON files. CSV files have dummy timestamps. | def get_time_offset(self, event_ids, get_extra_info=True, use_cache=True):
print "Warning: This is only valid for data from the json files! Timestamps in csv are dummies"
if event_ids is None:
raise ValueError('Must provide event ids ts')
key = ('timestamps', tuple(event_ids), get_e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_window_start_times(profileDict):\n assert isinstance(profileDict, dict) and \"samples\" in profileDict\n\n return profileDict[\"samples\"][\"window_start_offsets\"]",
"def _GetTailStartingTimestamp(filters, offset=None):\n if not offset:\n return None\n entries = list(logging_common.FetchLogs(... | [
"0.58332235",
"0.5735889",
"0.57119995",
"0.569874",
"0.5684806",
"0.56834036",
"0.559623",
"0.5569012",
"0.5567375",
"0.5535038",
"0.5506386",
"0.5488047",
"0.5475499",
"0.54591525",
"0.54331064",
"0.54012716",
"0.5340266",
"0.5327516",
"0.5310809",
"0.5304903",
"0.5303611",... | 0.6715626 | 0 |
Query the devices associated with particular event ids. | def get_devices(self, event_ids, use_cache=True):
if event_ids is None:
raise ValueError('Must provide event ids')
# cast to tuple so that can be hashed
key = ('devices', tuple(event_ids))
if use_cache and key in self.cache:
return self.cache[key].copy()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_devices(self):\n devices = self.get(\"event/device\")",
"def devices(self, query=None):\n if query is not None:\n query = clean(query, self.devices_parameters)\n query = \"?\" + urllib.parse.urlencode(query)\n else:\n query = \"\"\n return self... | [
"0.7170884",
"0.6299945",
"0.6194025",
"0.61619055",
"0.61565423",
"0.60946774",
"0.6046447",
"0.5950645",
"0.58948815",
"0.58842397",
"0.58684516",
"0.58558017",
"0.5834594",
"0.58154005",
"0.5810874",
"0.5760978",
"0.57068545",
"0.56993943",
"0.5685767",
"0.56246704",
"0.56... | 0.7090315 | 1 |
Obtain base selections data, consisting of selections for known userids (i.e. this precludes data from the CSV files from Flurry, which do not have known user ids associated with each record). Selects only the first turn in a 'play', to control for game play. Selects data for users with at least `min_turns` such turns.... | def base_selections(self, min_turns=50, which='all', add_fields=None, use_cache=True):
if min_turns < 0:
raise ValueError('min_turns must be > 0')
if add_fields and not utils.is_iterable(add_fields):
raise ValueError('add_fields must be iterable')
if not which in ['all', ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_pickable_selections(trimmed_query_results, deck_format, current_deck, num_selections=3):\n # Lets shuffle the results first, so we only have to randomize once\n random.shuffle(trimmed_query_results)\n result = []\n for item in trimmed_query_results:\n if not check_banned(deck_format... | [
"0.53410625",
"0.50723565",
"0.5011236",
"0.49850658",
"0.49573284",
"0.4957262",
"0.4939377",
"0.48191985",
"0.48016065",
"0.4727564",
"0.47013792",
"0.46939638",
"0.4673641",
"0.46717373",
"0.46447805",
"0.46394265",
"0.4626147",
"0.4625857",
"0.45892957",
"0.45717233",
"0.... | 0.7220127 | 0 |
Coordinates of the Ellipse vertexes, endpoints of the major axis Returns np.array vertexes coordinates | def vertexes(self):
theta = self.orientation
shifts = np.array([np.cos(theta), np.sin(theta)]) * self.a
return self.coords + (shifts[:, None] * [-1, 1]).T | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def coordinates(self):\n return np.array([self.x, self.y])",
"def get_coordinates(self):\n return np.array([(n.x, n.y) for n in self.nodes])",
"def points(self):\n return np.vstack((self.x(), self.y()))",
"def xy_coordinates(self):\n\n return np.meshgrid(self.x_coord, self.y_coord... | [
"0.66089475",
"0.6598253",
"0.6472907",
"0.64344364",
"0.6419347",
"0.63847584",
"0.6297802",
"0.6273511",
"0.62037206",
"0.6127132",
"0.6110768",
"0.6091351",
"0.6067472",
"0.60247266",
"0.60212684",
"0.59698385",
"0.5962112",
"0.59583503",
"0.5949391",
"0.5939902",
"0.59126... | 0.6998114 | 0 |
`photutils.aperture.CircularAperture` centered on the source | def circular_aperture(self, r, scale=True):
if scale:
radius = r * self.a
else:
radius = r
return CircularAperture(self.coords, float(np.abs(radius))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _compute_raw_image_norm(self):\n xypos = (self._nx / 2.0, self._ny / 2.0)\n # TODO: generalize \"radius\" (ellipse?) is oversampling is\n # different along x/y axes\n radius = self._norm_radius * self.oversampling[0]\n aper = CircularAperture(xypos, r=radius)\n flux, _... | [
"0.62356836",
"0.6005332",
"0.5912981",
"0.58894813",
"0.5824607",
"0.5793723",
"0.57092154",
"0.5600088",
"0.55953217",
"0.55737966",
"0.55671287",
"0.556056",
"0.55380523",
"0.5526953",
"0.55149794",
"0.55108434",
"0.55051935",
"0.5505152",
"0.549774",
"0.5473602",
"0.54618... | 0.7088482 | 0 |
`photutils.aperture.EllipticalAperture` centered on the source | def elliptical_aperture(self, r, scale=True):
if scale:
a, b = r * self.a, r * self.b
else:
a, b = r, r * self.eccentricity
return EllipticalAperture(self.coords, a, b, self.orientation) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getAfinityCenter(width, height, point, center, radius=7, img_affinity=None):\n tensor = torch.zeros(2,height,width).float()\n\n # Create the canvas for the afinity output\n imgAffinity = Image.new(\"RGB\", (width,height), \"black\")\n totensor = transforms.Compose([transforms.ToTensor()])\n \n ... | [
"0.6241785",
"0.6216147",
"0.6137607",
"0.59506565",
"0.58521193",
"0.5804789",
"0.57868546",
"0.5782865",
"0.57451",
"0.5681231",
"0.56203556",
"0.56060547",
"0.5604879",
"0.55895686",
"0.558598",
"0.55817163",
"0.55462366",
"0.55153394",
"0.5486808",
"0.5469599",
"0.5464792... | 0.64434016 | 0 |
Plot circle centered on source | def plot(self, radius=15, **kwargs):
self.plot_circle(radius, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def drawCircle( image, center, radius):\n fig = plt.figure()\n ax = fig.add_subplot(111)\n # optionaly first draw image\n if image is not None:\n if np.size(image) == np.size(image, 0) * np.size(image, 1):\n ax.imshow( image, cmap = 'gray' ) # grayscale\n #ax.imshow( image... | [
"0.70193255",
"0.6915312",
"0.68753904",
"0.6837382",
"0.6814154",
"0.67469513",
"0.6733997",
"0.6731365",
"0.66622436",
"0.6576476",
"0.64900076",
"0.64828765",
"0.64762866",
"0.6450801",
"0.64484197",
"0.64198035",
"0.6394404",
"0.6372111",
"0.6372111",
"0.63549113",
"0.628... | 0.7163412 | 0 |
Plot Ellipse on source | def plot(self, radius=None, **kwargs):
self.plot_ellipse(radius, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_source_ellipse(self):\n\n # Add ellipse for source within positional uncertainty\n if self.plot_source:\n source_colour = 'springgreen' if self.stokes == 'v' else 'springgreen'\n pos = SkyCoord(ra=self.source.ra_deg_cont, dec=self.source.dec_deg_cont, unit='deg')\n ... | [
"0.759055",
"0.62596714",
"0.6192084",
"0.6180379",
"0.6140086",
"0.6133918",
"0.6088097",
"0.6015146",
"0.6007328",
"0.59739846",
"0.59705937",
"0.59631014",
"0.5937159",
"0.5916947",
"0.5887272",
"0.588701",
"0.5821883",
"0.5813768",
"0.5799372",
"0.5781751",
"0.5769178",
... | 0.6489323 | 1 |
No. 5 tests collection for ConceptMap. | def test_conceptmap_5(base_settings):
filename = base_settings["unittest_data_dir"] / "cm-composition-status-v3.json"
inst = conceptmap.ConceptMap.parse_file(
filename, content_type="application/json", encoding="utf-8"
)
assert "ConceptMap" == inst.resource_type
impl_conceptmap_5(inst)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_conceptmap_6(base_settings):\n filename = base_settings[\"unittest_data_dir\"] / \"cm-contact-point-use-v2.json\"\n inst = conceptmap.ConceptMap.parse_file(\n filename, content_type=\"application/json\", encoding=\"utf-8\"\n )\n assert \"ConceptMap\" == inst.resource_type\n\n impl_co... | [
"0.67802674",
"0.66276085",
"0.6624199",
"0.65775055",
"0.6359484",
"0.6355655",
"0.632648",
"0.6274631",
"0.6128818",
"0.61214876",
"0.6113673",
"0.60241956",
"0.59948903",
"0.59455353",
"0.5933544",
"0.59251916",
"0.58880323",
"0.5877918",
"0.58585674",
"0.583263",
"0.57275... | 0.6635518 | 1 |
No. 6 tests collection for ConceptMap. | def test_conceptmap_6(base_settings):
filename = base_settings["unittest_data_dir"] / "cm-contact-point-use-v2.json"
inst = conceptmap.ConceptMap.parse_file(
filename, content_type="application/json", encoding="utf-8"
)
assert "ConceptMap" == inst.resource_type
impl_conceptmap_6(inst)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_conceptmap_10(base_settings):\n filename = base_settings[\"unittest_data_dir\"] / \"conceptmap-example.json\"\n inst = conceptmap.ConceptMap.parse_file(\n filename, content_type=\"application/json\", encoding=\"utf-8\"\n )\n assert \"ConceptMap\" == inst.resource_type\n\n impl_concep... | [
"0.6676227",
"0.6675516",
"0.6674327",
"0.64780337",
"0.6444871",
"0.64168495",
"0.64146304",
"0.63252705",
"0.6225453",
"0.61768365",
"0.61181945",
"0.6012922",
"0.600361",
"0.6002469",
"0.5973262",
"0.5959839",
"0.5917618",
"0.58103967",
"0.5803485",
"0.5795753",
"0.5786050... | 0.6875816 | 0 |
No. 7 tests collection for ConceptMap. | def test_conceptmap_7(base_settings):
filename = base_settings["unittest_data_dir"] / "cm-contact-point-use-v3.json"
inst = conceptmap.ConceptMap.parse_file(
filename, content_type="application/json", encoding="utf-8"
)
assert "ConceptMap" == inst.resource_type
impl_conceptmap_7(inst)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_conceptmap_6(base_settings):\n filename = base_settings[\"unittest_data_dir\"] / \"cm-contact-point-use-v2.json\"\n inst = conceptmap.ConceptMap.parse_file(\n filename, content_type=\"application/json\", encoding=\"utf-8\"\n )\n assert \"ConceptMap\" == inst.resource_type\n\n impl_co... | [
"0.6908866",
"0.68234175",
"0.662276",
"0.6597603",
"0.6520313",
"0.64994437",
"0.6486616",
"0.6451874",
"0.6287695",
"0.62704355",
"0.6056309",
"0.6044384",
"0.6034306",
"0.60339826",
"0.6024019",
"0.59559625",
"0.58503586",
"0.58329684",
"0.58308244",
"0.5823995",
"0.581380... | 0.683264 | 1 |
No. 10 tests collection for ConceptMap. | def test_conceptmap_10(base_settings):
filename = base_settings["unittest_data_dir"] / "conceptmap-example.json"
inst = conceptmap.ConceptMap.parse_file(
filename, content_type="application/json", encoding="utf-8"
)
assert "ConceptMap" == inst.resource_type
impl_conceptmap_10(inst)
# t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_conceptmap_6(base_settings):\n filename = base_settings[\"unittest_data_dir\"] / \"cm-contact-point-use-v2.json\"\n inst = conceptmap.ConceptMap.parse_file(\n filename, content_type=\"application/json\", encoding=\"utf-8\"\n )\n assert \"ConceptMap\" == inst.resource_type\n\n impl_co... | [
"0.6383984",
"0.634451",
"0.6318398",
"0.6311376",
"0.62502086",
"0.6163185",
"0.6024022",
"0.6003569",
"0.5940034",
"0.5935652",
"0.59186107",
"0.5913767",
"0.5908131",
"0.58942974",
"0.58871394",
"0.58544385",
"0.58518285",
"0.5849326",
"0.5839157",
"0.5821094",
"0.5805311"... | 0.66984093 | 0 |
Convert a string to a goal. | def parseGoal(s):
return Parser._convertGoal(goalNT.parseString(s)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def goal_(s):\n a, b = path.split(s)\n return path.join(a, b[len('goal_'):])",
"def str_to_action(str):\n raise NotImplementedError",
"def goToMyGoal(state):\n return goTo(state, state.my_goal)",
"def parseGoalList(s):\n return map(Parser._convertGoal, goalListNT.parseString(s).asList(... | [
"0.63016003",
"0.5952742",
"0.55346686",
"0.5488997",
"0.54585564",
"0.5386929",
"0.52365756",
"0.5152425",
"0.5132572",
"0.51207405",
"0.51146775",
"0.51003325",
"0.5088034",
"0.5086561",
"0.50429016",
"0.49822423",
"0.49633306",
"0.49550816",
"0.49469316",
"0.49355057",
"0.... | 0.771987 | 0 |
Convert a string to a goal list. | def parseGoalList(s):
return map(Parser._convertGoal, goalListNT.parseString(s).asList()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_string_to_list_string(self):\n assert_equals(\n str_to_list('a, b, c'),\n ['a', 'b', 'c']\n )",
"def test_string_to_list_string(self):\n\n assert_equals(\n str_to_list('a, b, c'),\n ['a', 'b', 'c']\n )",
"def test_string_to_list(s... | [
"0.66362816",
"0.66166717",
"0.6484041",
"0.63240284",
"0.62622994",
"0.62045187",
"0.5911772",
"0.5905924",
"0.5856528",
"0.5852823",
"0.5846389",
"0.58087486",
"0.57753444",
"0.57733536",
"0.57704955",
"0.5750634",
"0.5750541",
"0.57435274",
"0.57388735",
"0.572409",
"0.571... | 0.8058594 | 0 |
Convert a string to a rule. | def parseRule(s):
return Parser._convertRule(ruleNT.parseString(s)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stringToRule(string):\n productionRule = re.split(\"[?:]+\", string)\n rule_type, predecessor = stringToPredecessor(productionRule[0])\n if len(productionRule) == 2:\n probs, successor = stringToSuccessor(productionRule[1])\n return(Rule(rule_type, predecessor[0], predecessor[1], predece... | [
"0.75731784",
"0.6961815",
"0.6526789",
"0.6375641",
"0.6325683",
"0.6306846",
"0.6145459",
"0.6098167",
"0.59980243",
"0.58696973",
"0.58696973",
"0.58696973",
"0.58361316",
"0.5817049",
"0.5795566",
"0.57767826",
"0.57426494",
"0.56586796",
"0.56472415",
"0.5607581",
"0.559... | 0.7777213 | 0 |
Extract a series of rules from a file. | def parseFile(file,rules = None):
if not rules: rules = RuleCollection()
buf = ""
for line in open(file,'r'):
if not line[0]=='#':
buf += line
try:
for (ptree,lo,hi) in ruleNT.scanString(buf):
rules.add(Parser._convertRule(ptree))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parseRules(self, filename):\n\n try:\n with open(filename) as fd:\n\n lineNo = 1\n \n for line in fd:\n if '#' in line:\n line = line.split('#', 1)[0]\n if line.strip() != '':\n ... | [
"0.68597776",
"0.6507359",
"0.64891845",
"0.6370398",
"0.63181955",
"0.63049585",
"0.62977654",
"0.62957907",
"0.6009218",
"0.60054487",
"0.5992668",
"0.59867156",
"0.5895462",
"0.58479583",
"0.5842237",
"0.58295923",
"0.5784128",
"0.5746525",
"0.57268053",
"0.5697798",
"0.56... | 0.7532949 | 0 |
Append a single instruction. | def append(self,instr):
self.instructions.append(instr) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def addOp(self, op):\n self.operations << op",
"def AddOperation(self, op):\n self._operations.append(op)",
"def append(self, instructions):\n if type(instructions) is list:\n self.instructions.extend(instructions)\n else:\n self.instructions.append(instructions)",... | [
"0.68843144",
"0.6838598",
"0.6804331",
"0.67219985",
"0.66647327",
"0.64813983",
"0.64198506",
"0.6400295",
"0.62860703",
"0.6242816",
"0.62268287",
"0.62150663",
"0.61912805",
"0.6143253",
"0.6114257",
"0.6110309",
"0.6070112",
"0.60198104",
"0.5960536",
"0.5956851",
"0.595... | 0.8004033 | 0 |
given a DataFrame containing one or more position vectors, Create price process of the strategies, adding the daily change if we are long subtracting if we are short. | def price_of_strategy(df, df_positions, LongHold=False, LongShort=False, MA=False, EMA=False, MACD=False):
df_price_of_strategy = pd.DataFrame(index=df_positions.index)
df_price_of_strategy["asset price"] = df["Adj Close"]
# long hold will long the strategy if condition is met, but instead of shorting it... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strategy_returns(df, df_price_of_strategy):\r\n df_return_of_strategy = pd.DataFrame(index=df_price_of_strategy.index)\r\n cols = df_price_of_strategy.columns\r\n\r\n for priceSeries in cols:\r\n df_return_of_strategy[priceSeries] = (df_price_of_strategy[priceSeries]\r\n ... | [
"0.6095817",
"0.6095817",
"0.58036894",
"0.5703037",
"0.5636094",
"0.55804205",
"0.54742676",
"0.5386479",
"0.5303829",
"0.5298434",
"0.52872294",
"0.5269304",
"0.5265073",
"0.52649325",
"0.52647746",
"0.52256864",
"0.5206527",
"0.5204931",
"0.51899624",
"0.5183487",
"0.51753... | 0.6879784 | 1 |
A function that gets a assembly command and translated it into machine code, using a supplied marker dictionary. This function is designed to update the supplied marker dictionary. | def translate_a_command(marker_dictionary, cmd):
if cmd.isdigit():
return translate_to_binary(cmd)
else:
if cmd in marker_dictionary:
return translate_to_binary(marker_dictionary[cmd])
else:
global numOfVariables
marker_dictionary[cmd] = VAR_FI... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pre_process_asm_file(assembly_file):\r\n line_counter = 0\r\n marker_dictionary = load_constants()\r\n commands_list = list()\r\n for command in assembly_file.readlines():\r\n command = command.split(\"/\")[0] # getting rid of comments\r\n command = \"\".join(command.split()) # gett... | [
"0.5992748",
"0.5758082",
"0.5600123",
"0.5551047",
"0.54708827",
"0.5418531",
"0.53678024",
"0.5362615",
"0.5226419",
"0.5217909",
"0.5194576",
"0.5184543",
"0.51802254",
"0.51404583",
"0.5116529",
"0.5106166",
"0.508427",
"0.5074874",
"0.50744194",
"0.5035463",
"0.5030108",... | 0.686218 | 0 |
A function that creates a dictionary containing all the hack assembly constants and their respective binary values, including I/O and reserved RAM locations | def load_constants():
marker_dictionary = dict()
marker_dictionary["SP"] = SP
marker_dictionary["LCL"] = LCL
marker_dictionary["ARG"] = ARG
marker_dictionary["THIS"] = THIS
marker_dictionary["THAT"] = THAT
marker_dictionary["SCREEN"] = SCREEN
marker_dictionary["KBD"] = KBD
f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getRegisterValues(self) -> Dict[str,int]:\n regs = {}\n arch = self.root.arch\n for i in range(len(arch.registers)):\n name = self.__values.item(i, 0).text()\n value = self.__values.item(i, 1).text()\n regs[name] = int(value, 16)\n return regs",
"d... | [
"0.62985826",
"0.61150587",
"0.6026211",
"0.58911103",
"0.5777609",
"0.5687741",
"0.56318384",
"0.5619683",
"0.5581683",
"0.5574507",
"0.55684584",
"0.55496323",
"0.5468864",
"0.54394424",
"0.5417184",
"0.5396253",
"0.53719133",
"0.53675073",
"0.5355234",
"0.5308181",
"0.5300... | 0.7260989 | 0 |
This function process an assembly file before it's translation to machine code. It creates a dictionary, and places into it all markers in the code, and assigns each one of them it's location in code, allowing to use it as a reference in future. While doing so, it deletes each marker's declaration. The function also cl... | def pre_process_asm_file(assembly_file):
line_counter = 0
marker_dictionary = load_constants()
commands_list = list()
for command in assembly_file.readlines():
command = command.split("/")[0] # getting rid of comments
command = "".join(command.split()) # getting rid of whitespace... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assemble_file(assembly_file_name, hack_file_name):\r\n global numOfVariables\r\n numOfVariables = 0\r\n assembly_file = open(assembly_file_name)\r\n command_list, marker_dictionary = pre_process_asm_file(assembly_file)\r\n hack_file = open(hack_file_name, 'w')\r\n for command in command_list:... | [
"0.63618416",
"0.5626231",
"0.55970985",
"0.5559756",
"0.55214596",
"0.5371988",
"0.5366805",
"0.5355931",
"0.53523964",
"0.52817833",
"0.5274325",
"0.5268544",
"0.5263442",
"0.52460796",
"0.5215014",
"0.52076447",
"0.5197786",
"0.5185883",
"0.51844597",
"0.51429814",
"0.5112... | 0.76841706 | 0 |
A function that receives names of an .asm file and a .hack file. The function will create the specified .hack file, and using helper functions will write to it hack machine code, line by line, respective to the supplied assembly code. | def assemble_file(assembly_file_name, hack_file_name):
global numOfVariables
numOfVariables = 0
assembly_file = open(assembly_file_name)
command_list, marker_dictionary = pre_process_asm_file(assembly_file)
hack_file = open(hack_file_name, 'w')
for command in command_list:
write_c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assemble(f):\r\n input_file = Path(f)\r\n if input_file.suffix != '.asm':\r\n raise Exception('Expected .asm file')\r\n\r\n result = parse_data(input_file.read_text())\r\n input_file.with_suffix('.hack').write_text(result)",
"def get_hack_file(asm_file):\n if asm_file.endswith('.asm... | [
"0.7213883",
"0.68883884",
"0.66536516",
"0.59449667",
"0.57214224",
"0.5632129",
"0.5437709",
"0.5423376",
"0.5387398",
"0.5353019",
"0.52576816",
"0.52342004",
"0.51890266",
"0.5186473",
"0.5132102",
"0.5092956",
"0.5034164",
"0.49966323",
"0.49812478",
"0.49604425",
"0.494... | 0.7207127 | 1 |
This function works on supplied arguments by the user. The arguments are either an .asm file or a directory. If given a directory, the function will operate on each of the .asm files contained within it, if any exist. The file(s) name(s) will be sent to assemble_file func, which in turn, and by helper functions, will t... | def assemble_files():
path = os.path.expanduser(sys.argv[1])
if os.path.isdir(path):
file_root = path + "/"
for file in os.listdir(path):
filename = os.path.splitext(file)
if filename[1] == ".asm":
hack_file_name = file_root + filename[0] + ".hack"
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def main():\n if os.path.isdir(path):\n for filename in os.listdir(path):\n if filename.endswith('.asm'):\n execute_asm_file(path + '/' + filename, filename)\n else:\n execute_asm_file(path, path[path.rfind(\"/\") + 1:])",
"def assemble(f):\r\n input_file = Path(f... | [
"0.6707795",
"0.65115887",
"0.61815923",
"0.60384965",
"0.60105145",
"0.5784941",
"0.57329094",
"0.56278634",
"0.5548395",
"0.53949803",
"0.5345995",
"0.53019947",
"0.51933736",
"0.5146586",
"0.5085719",
"0.5008094",
"0.5001273",
"0.4957408",
"0.49540913",
"0.4946641",
"0.494... | 0.8377722 | 0 |
GET /auth/nxresource on empty DB must return HTTP 404 | def test_get_non_existing(self):
response = self.client.get('/auth/non-existing-resource')
self.assert404(response)
self.assertEqual('not found', response.json['error']) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_not_exist(self):\n attempt_id = 9999\n _, err = self.resource.get(attempt_id)\n self.assertEqual(404, err)",
"def test_get_user_404(self):\n resp = self.app.get('/users/thisuserdoesntexist')\n assert resp.status_code == 404",
"def test_read_non_existent(self):\n ... | [
"0.64738226",
"0.645993",
"0.6332124",
"0.62425023",
"0.61564004",
"0.6088868",
"0.60267395",
"0.60204613",
"0.60175776",
"0.6002853",
"0.5984592",
"0.59316444",
"0.5919845",
"0.59131277",
"0.5891283",
"0.58901876",
"0.58843213",
"0.5877954",
"0.5859265",
"0.58422184",
"0.583... | 0.6752115 | 0 |
Prepend `LOGS_DIR` to all 'filename' attributes listed for handlers in logging.yaml | def prepare_filenames(config: Dict[str, Any]) -> Dict[str, Any]:
for handler_name in config["handlers"].keys():
handler_config = config["handlers"][handler_name]
if "filename" in handler_config:
filename = Path(handler_config["filename"]).name
handler_conf... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_custom_log_dir(self) -> str:",
"def _initialize_log_file(config):\n for settings in config[\"handlers\"].values():\n if _is_file_handler(settings):\n log_path = Path(settings[\"filename\"])\n log_path.parent.mkdir(parents=True, exist_ok=True)\n log_path.touch(ex... | [
"0.6940266",
"0.67195207",
"0.6556406",
"0.6440838",
"0.6245913",
"0.6224063",
"0.6205713",
"0.61513865",
"0.6134805",
"0.61214453",
"0.6067131",
"0.6042188",
"0.5913662",
"0.58965117",
"0.5896018",
"0.5863045",
"0.5849974",
"0.5849574",
"0.5846982",
"0.57956666",
"0.5782952"... | 0.72755027 | 0 |
Truncate or pad a float `f` to `n` decimal places, without rounding. | def truncate(f, n):
if isinstance(f, float):
s = '{}'.format(f)
else:
s = f
if 'e' in s or 'E' in s:
return '{0:.{1}f}'.format(f, n)
i, p, d = s.partition('.')
return '.'.join([i, (d+'0'*n)[:n]]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def float_round(num, n):\n num = float(num)\n num = round(num, n)\n return num",
"def floatToStrWithDecimals(n: float) -> str:\n\n return '{0:.10f}'.format(n)",
"def fmt_float(f, p=0):\n\n string = str(\n decimal.Decimal(f).quantize(decimal.Decimal('0.' + ('0' * p) if p > 0 else '0'), dec... | [
"0.72251207",
"0.67771244",
"0.6773471",
"0.669315",
"0.65935296",
"0.6580925",
"0.65674317",
"0.6565095",
"0.64404017",
"0.6415787",
"0.6410134",
"0.633918",
"0.63265264",
"0.62075645",
"0.61407804",
"0.6132876",
"0.6014174",
"0.5931887",
"0.58997494",
"0.58451086",
"0.58423... | 0.77267224 | 0 |
Take an image or string path to one, return (top, base) depths. If `inspect`, will `plt.show` any text bboxes where < 2 floats found. | def depth_range_from_img(img, inspect):
x0, y0, x1, y1 = TEXT_BBOX
crop_fn = lambda x: x[x0:x1,y0:y1]
if isinstance(img, str):
img = io.imread(img)
# Get string of text, look for possible floats
chars = pytesseract.image_to_string(crop_fn(img), config=TESSERACT_CONFIG)
numbers = [trunc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_png_depth(file):\n depth_png = np.array(load_image(file), dtype=int)\n\n depth = depth_png.astype(np.float) / 1000.\n # assert (np.max(depth_png) > 1000.), 'Wrong .png depth file'\n # if (np.max(depth_png) > 1000.):\n # depth = depth_png.astype(np.float) / 1000.\n # else:\n # ... | [
"0.59015715",
"0.58357596",
"0.58339924",
"0.58253497",
"0.5712015",
"0.55192465",
"0.5511254",
"0.5511254",
"0.5493266",
"0.54893214",
"0.5481338",
"0.5481169",
"0.5441007",
"0.54385364",
"0.5432206",
"0.5419677",
"0.53712696",
"0.53493905",
"0.53419894",
"0.5322312",
"0.531... | 0.71908164 | 0 |
Seteaza idul filmului cu idf | def setID(self, idf):
self.id = idf | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_id(self, value):\n pass",
"def set_id(self, refobj, identifier):\n cmds.setAttr(\"%s.identifier\" %refobj, identifier)",
"def set_id(self, id):\n self.id = id\n print(\"self id = \" + str(self.id))",
"def _set_id(self):\n raise NotImplementedError()",
"def set_id... | [
"0.6454677",
"0.6315507",
"0.61273503",
"0.6112127",
"0.6100905",
"0.60755306",
"0.6036128",
"0.6015184",
"0.59992284",
"0.59992284",
"0.59027857",
"0.59021324",
"0.59021324",
"0.59021324",
"0.59021324",
"0.59021324",
"0.59021324",
"0.59021324",
"0.59021324",
"0.59021324",
"0... | 0.76365787 | 0 |
Seteaza titlulul filmului cu titlu | def setTitlu(self, titlu):
self.titlu = titlu | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_title(self, title):\n\t\tpass",
"def setTitle(self,value):\n self.PDFreactorConfiguration.in1[\"title\"] = value",
"def set_title(self, setto):\n command = 'title ' + str(setto)\n self.run_command(command)",
"def set_title(self, title):\r\n self.title = title",
"def set_title(se... | [
"0.7465722",
"0.7216052",
"0.72078884",
"0.7207426",
"0.7206523",
"0.71538574",
"0.71427274",
"0.7094294",
"0.7088595",
"0.7073991",
"0.6992008",
"0.69776845",
"0.6952835",
"0.6932684",
"0.6930287",
"0.6923173",
"0.69088274",
"0.68718034",
"0.68718034",
"0.683304",
"0.6816672... | 0.81989866 | 0 |
Seteaza pretul filmului cu pret | def setPret(self, pret):
self.pret = pret | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def preberi_pot(ukazi):",
"def preberi_pot(ukazi):",
"def preberi_pot(ukazi):",
"def preberi_pot(ukazi):",
"def preberi_pot(ukazi):",
"def setFila(self, fila):\n \n self.row = fila",
"def mezclar_bolsa(self):",
"def acquisizioneParametri(self):\n\n messaggio =''\n\n try: \n... | [
"0.59617794",
"0.59617794",
"0.59617794",
"0.59617794",
"0.59617794",
"0.5709276",
"0.5634832",
"0.5629598",
"0.55452335",
"0.5513075",
"0.54785866",
"0.5418668",
"0.5381426",
"0.5336592",
"0.53326356",
"0.52663153",
"0.5249881",
"0.5244421",
"0.5230246",
"0.5207263",
"0.5206... | 0.6318051 | 0 |
Recursively returns an array of all the children of the comment. | def get_children(self):
children = []
for i in self.children_ids:
child = Comment(self.articleID, self.children_ids[i])
children.append(child)
children.extend(child.get_children())
return children | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def children(self):\n return Comment.objects.filter(parent=self)",
"def get_post_comments_recur(comment, comments, parent_comment_id, parent_post_id):\n if 'data' in comment:\n comment_data = comment['data']\n\n new_comment = None\n\n # a new comment exists at this layer, add it to... | [
"0.75854313",
"0.6678317",
"0.6461377",
"0.64051634",
"0.6313842",
"0.6257591",
"0.62333965",
"0.6224846",
"0.62101185",
"0.6195434",
"0.6167015",
"0.6159942",
"0.6151541",
"0.6142611",
"0.6128883",
"0.6128883",
"0.6128883",
"0.6127858",
"0.61252487",
"0.60670644",
"0.6054243... | 0.81902605 | 0 |
Gets cookie from the raw cookie file. | def default_cookie():
with open(raw_cookie_file) as f:
rc = "".join(f.readlines())
return browser_cookie(rc) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _load_cookies(filename):\n with open(filename, 'rb') as handle:\n return pickle.load(handle)",
"def loadCookies():\n try:\n with open(getCookieFile(), 'rb') as f:\n cookies = pickle.load(f)\n f.close()\n return cookies\n except IOError as err:\n ... | [
"0.7184235",
"0.6742507",
"0.67266494",
"0.6673472",
"0.6618109",
"0.6544186",
"0.6503154",
"0.6483331",
"0.64288133",
"0.63877684",
"0.6207503",
"0.61093885",
"0.60494995",
"0.60412043",
"0.5993757",
"0.59856945",
"0.59710914",
"0.5951462",
"0.594921",
"0.5892516",
"0.588800... | 0.6774578 | 1 |
Gets default database configuration. | def default_db_config():
return read_json_file(db_config_file) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_default_database(self):\n attr_name = mangle_delegate_name(self.__class__, '__default_database_name')\n default_db_name = getattr(self.delegate, attr_name)\n if default_db_name is None:\n raise ConfigurationError('No default database defined')\n\n return self[default_... | [
"0.8126852",
"0.7541678",
"0.75129694",
"0.74455094",
"0.7217911",
"0.7178954",
"0.71244574",
"0.7124234",
"0.6950143",
"0.6855051",
"0.68289155",
"0.6682855",
"0.66762173",
"0.6675876",
"0.6595389",
"0.65917087",
"0.6585282",
"0.654623",
"0.6531118",
"0.6517416",
"0.6513442"... | 0.8298972 | 0 |
Returns all comments for the given article as array of jsons. | def get_comment_jsons(article_id, cookie):
url = "https://seekingalpha.com/account/ajax_get_comments?id=%s&type=Article&commentType=" % article_id
r = safe_request(url, cookie)
comments = []
if r.status_code != 404:
res = json.loads(r.text)
for comment in res['comments'].values():
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fetch_comments_by_article(api: NytApi, article_url: str, article_id: Optional[str] = None, pagination_size: int = 100) -> List[Dict]:\n\n comments = fetch_top_level_comments(api, article_url, pagination_size=pagination_size)\n fetch_replies(api, article_url, comments, pagination_size=pagination_size)\n\n... | [
"0.7669916",
"0.7027676",
"0.66095394",
"0.64120436",
"0.63289636",
"0.6322181",
"0.6295914",
"0.6266438",
"0.6222453",
"0.6061615",
"0.6031693",
"0.59384656",
"0.58510315",
"0.58484095",
"0.58295006",
"0.58199674",
"0.5789178",
"0.57719564",
"0.5771573",
"0.5750583",
"0.5725... | 0.82818395 | 0 |
Given array of comment jsons, adds comments to database. | def try_add_comment(com_jsons, cursor, article_id):
if not com_jsons:
print("\t No comments found for " + article_id)
for c in com_jsons:
try:
cursor.execute(add_comment, c)
except mysql.connector.DatabaseError as err:
if not err.errno == 1062:
pr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_comments(session, comments):\n for c in tqdm(comments, desc=\"Injecting comments into DB\"):\n db_comment = session.query(Comment).get(c['id'])\n if db_comment:\n db_comment.update(session, **c)\n else:\n Comment.create(session, **c)",
"def update_comment... | [
"0.71083325",
"0.6784769",
"0.6427785",
"0.637937",
"0.6277244",
"0.6065134",
"0.599712",
"0.5861961",
"0.58252144",
"0.5720556",
"0.57087207",
"0.57087207",
"0.57087207",
"0.57087207",
"0.564279",
"0.5594726",
"0.55417585",
"0.5541252",
"0.5532089",
"0.5441044",
"0.5435865",... | 0.69590884 | 1 |
Given an article json, tries to write that article to database. | def try_add_article(art_json, cursor):
try:
cursor.execute(add_article, art_json)
except mysql.connector.errors.IntegrityError:
print("Duplicate Article") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post_new_article(article: Article = Body(...)):\n article_to_insert = article.dict()\n\n res = articles_db.post_articles_mongo(\n articles,\n keywords,\n article_to_insert\n )\n return res",
"def save_articles(self, articles):\n for article in articles:\n wi... | [
"0.6862452",
"0.6762084",
"0.67200565",
"0.65532476",
"0.60703146",
"0.601015",
"0.5950674",
"0.59301597",
"0.5849263",
"0.58045936",
"0.5760186",
"0.5742518",
"0.56447595",
"0.5625428",
"0.56181395",
"0.55947614",
"0.55856717",
"0.5576952",
"0.55593085",
"0.5555919",
"0.5548... | 0.6876098 | 0 |
Given a file with Seeking Alpha article ids separated by commas, iterates through the article ids in the article and records the article and comment data in the mysql database. | def gather_mysql_data(article_fn, start=0, stop=None, comments_only=False):
config = default_db_config()
cookie = default_cookie()
cnx = mysql.connector.connect(**config)
cursor = cnx.cursor()
with open(article_fn) as f:
articles = f.read().split(",")
i, total = start+1, float(len(arti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def import_data(filename):\r\n regex = re.compile(\"\"\"\"(?P<show_name>.*?)\"\\s+\\((?P<year>\\d+)(?:|/.*?)\\)\\s+\\{(?P<episode_name>.*?)\\s?\\(\\#(?P<season_no>\\d+)\\.(?P<episode_no>\\d+)\\)\\}\"\"\")\r\n\r\n with codecs.open(filename, \"r\", \"latin-1\") as ratings:\r\n # Generate all the lines t... | [
"0.57495564",
"0.56686085",
"0.5643155",
"0.5639852",
"0.5623809",
"0.55385566",
"0.54360336",
"0.5385288",
"0.53813",
"0.53761214",
"0.53596044",
"0.53592724",
"0.5315589",
"0.530184",
"0.5297801",
"0.5272201",
"0.5264217",
"0.5264137",
"0.5258495",
"0.5257588",
"0.5246504",... | 0.68105036 | 0 |
Install the unaccess extension in PostgreSQL | def config_create_extension_unaccent():
config = settings.load_config()
install_extension_postgres(config=config, command="create extension unaccent;") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def downgrade():\n\n op.drop_column('shares', 'revert_to_snapshot_support')",
"def downgrade():\n op.execute(textwrap.dedent(\"\"\"DROP FUNCTION public.upsert_group(character varying, character varying);\"\"\"))\n op.drop_table('group')",
"def post_install_postgresql():\n from django.conf import se... | [
"0.58437306",
"0.5657047",
"0.5594443",
"0.5530839",
"0.5520028",
"0.5476288",
"0.54133385",
"0.5348719",
"0.5305421",
"0.5253563",
"0.52352697",
"0.52159446",
"0.5211785",
"0.5206099",
"0.5166151",
"0.51509696",
"0.51198465",
"0.51190174",
"0.50755954",
"0.5051855",
"0.49968... | 0.6245562 | 0 |
Run Lint to arrange code according to PEP8 | def commands_lint():
lint() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lint(session):\n session.install(\"flake8\")\n session.run(\"flake8\", \"\")",
"def lint(context):\n context.run(\" \".join([\n \"autopep8\",\n \"--recursive\",\n \"--jobs 0\",\n \"--in-place\",\n \"--aggressive\",\n \"-v\",\n PACKAGE_NAME,\n \... | [
"0.7142155",
"0.70565",
"0.7030829",
"0.6976287",
"0.68483126",
"0.672167",
"0.67034775",
"0.6679957",
"0.6660085",
"0.6581245",
"0.65745974",
"0.65347797",
"0.65275306",
"0.6504785",
"0.645629",
"0.6438242",
"0.6427716",
"0.64242315",
"0.6397528",
"0.6394588",
"0.63807875",
... | 0.7309474 | 0 |
Calculate the complexity of project methods | def commands_complexity():
complexity() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def complexity(self):\n raise NotImplementedError()",
"def _calculate_complexity(workflow):\n complexity = estimate_complexity(workflow.type_, workflow.reana_specification)\n workflow.complexity = complexity\n Session.commit()\n return complexity",
"def complexity(self):\n from kinbak... | [
"0.71412104",
"0.6643136",
"0.6404984",
"0.61128277",
"0.6098668",
"0.60706514",
"0.6062454",
"0.6059344",
"0.6053397",
"0.5892268",
"0.5765553",
"0.5668515",
"0.5632793",
"0.5622483",
"0.5586905",
"0.5566863",
"0.5414714",
"0.53658634",
"0.53415585",
"0.5309097",
"0.52782565... | 0.71232665 | 1 |
Runs Lint, complexity, and tests commands | def commands_all():
lint()
complexity()
coverage() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def commands_lint():\n lint()",
"def _run_ci_test():\n _run_install(False)\n _run_coverage_html(False)\n _run_typecheck_xml(False)\n _run_lint(True)",
"def lint():\n load_env_vars('dev')\n from tools.static_code_analysis import Lint\n pylint = Lint()\n score = pylint.run_test()\n... | [
"0.7883877",
"0.69822717",
"0.69436914",
"0.6748843",
"0.6665134",
"0.66598284",
"0.66582566",
"0.6600934",
"0.6496596",
"0.64399034",
"0.6431389",
"0.6420695",
"0.6323446",
"0.62546813",
"0.62370545",
"0.6221371",
"0.6214749",
"0.62135",
"0.62023723",
"0.6201474",
"0.6170931... | 0.7931563 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.