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 |
|---|---|---|---|---|---|---|
Test case for replace_cluster_policy_binding | def test_replace_cluster_policy_binding(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_cluster_policy_binding(self):\n pass",
"def test_create_cluster_policy_binding(self):\n pass",
"def test_replace_cluster_policy(self):\n pass",
"def test_delete_cluster_policy_binding(self):\n pass",
"def test_replace_cluster_role_binding(self):\n pass",
... | [
"0.8825095",
"0.83823466",
"0.82347655",
"0.79850763",
"0.7864699",
"0.777195",
"0.77688307",
"0.76552796",
"0.74235946",
"0.7259801",
"0.7178297",
"0.7133931",
"0.70231754",
"0.6948916",
"0.6942355",
"0.68618757",
"0.6825636",
"0.6820126",
"0.6692589",
"0.6601875",
"0.657180... | 0.94153637 | 0 |
Test case for replace_cluster_resource_quota | def test_replace_cluster_resource_quota(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_replace_cluster_resource_quota_status(self):\n pass",
"def test_patch_cluster_resource_quota(self):\n pass",
"def test_patch_cluster_resource_quota_status(self):\n pass",
"def test_create_cluster_resource_quota(self):\n pass",
"def test_delete_cluster_resource_quota(sel... | [
"0.90944487",
"0.90520597",
"0.85975665",
"0.8582962",
"0.8470919",
"0.82330614",
"0.80726534",
"0.78893715",
"0.7827342",
"0.77161044",
"0.74641263",
"0.6841068",
"0.67694116",
"0.6589487",
"0.64559287",
"0.6426441",
"0.60735357",
"0.60325116",
"0.59661657",
"0.5948562",
"0.... | 0.95103735 | 0 |
Test case for replace_cluster_resource_quota_status | def test_replace_cluster_resource_quota_status(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_cluster_resource_quota_status(self):\n pass",
"def test_replace_cluster_resource_quota(self):\n pass",
"def test_patch_cluster_resource_quota(self):\n pass",
"def test_read_cluster_resource_quota_status(self):\n pass",
"def test_delete_cluster_resource_quota(self)... | [
"0.903926",
"0.8505909",
"0.8269465",
"0.8069531",
"0.77259207",
"0.7651133",
"0.75495875",
"0.72610116",
"0.70299006",
"0.69875675",
"0.6911573",
"0.6375897",
"0.63320744",
"0.6170609",
"0.61348987",
"0.60568666",
"0.60472554",
"0.59891146",
"0.58430576",
"0.5818568",
"0.572... | 0.94734645 | 0 |
Test case for replace_cluster_role | def test_replace_cluster_role(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_cluster_role(self):\n pass",
"def test_create_cluster_role(self):\n pass",
"def test_replace_cluster_role_binding(self):\n pass",
"def test_delete_cluster_role(self):\n pass",
"def test_list_cluster_role(self):\n pass",
"def test_patch_cluster_role_bindin... | [
"0.8899584",
"0.8210573",
"0.819381",
"0.79171234",
"0.7807641",
"0.7777545",
"0.7695965",
"0.76022327",
"0.7408938",
"0.72357744",
"0.71137494",
"0.7015425",
"0.69980806",
"0.6902513",
"0.6887825",
"0.6841563",
"0.683068",
"0.66502506",
"0.65630305",
"0.6536006",
"0.65178233... | 0.95055526 | 0 |
Test case for replace_cluster_role_binding | def test_replace_cluster_role_binding(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_cluster_role_binding(self):\n pass",
"def test_create_cluster_role_binding(self):\n pass",
"def test_replace_cluster_role(self):\n pass",
"def test_delete_cluster_role_binding(self):\n pass",
"def test_read_cluster_role_binding(self):\n pass",
"def test_l... | [
"0.8963232",
"0.8524294",
"0.8225817",
"0.808996",
"0.80537176",
"0.7975362",
"0.78786236",
"0.78325576",
"0.7814807",
"0.76335555",
"0.7350155",
"0.7339054",
"0.715327",
"0.7091871",
"0.70771766",
"0.70586514",
"0.6988954",
"0.69034433",
"0.6895235",
"0.6886141",
"0.6851548"... | 0.94552994 | 0 |
Test case for replace_group | def test_replace_group(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_replace_groups(self):\n pass",
"def test_patch_group(self):\n pass",
"def test_patch_group(self):\n pass",
"def test_update_group(self):\n pass",
"def test_groups_group_ref_put(self):\n pass",
"def test_replace(self):\n\n regex = \"th\"\n expected... | [
"0.88233745",
"0.7081355",
"0.7081355",
"0.6786857",
"0.6455842",
"0.6180168",
"0.61329186",
"0.6097816",
"0.6067482",
"0.6063582",
"0.60209054",
"0.60166144",
"0.60125",
"0.60086286",
"0.5964774",
"0.5950818",
"0.594403",
"0.594403",
"0.59317255",
"0.59028274",
"0.58689517",... | 0.90213645 | 0 |
Test case for replace_host_subnet | def test_replace_host_subnet(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_host_subnet(self):\n pass",
"def test_create_host_subnet(self):\n pass",
"def test_delete_host_subnet(self):\n pass",
"def test_read_host_subnet(self):\n pass",
"def test_list_host_subnet(self):\n pass",
"def test_delete_collection_host_subnet(self):\n ... | [
"0.8900706",
"0.8182892",
"0.7838388",
"0.7570771",
"0.7466593",
"0.69128096",
"0.68322545",
"0.6701829",
"0.66122967",
"0.6517911",
"0.6325697",
"0.63236725",
"0.62717617",
"0.6245155",
"0.62425774",
"0.61518836",
"0.6151816",
"0.61401826",
"0.6125274",
"0.61138487",
"0.6029... | 0.94400644 | 0 |
Test case for replace_identity | def test_replace_identity(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_identity(self):\n pass",
"def test_replace_user_identity_mapping(self):\n pass",
"def test_special_substitution_of_identity(free_alg):\n\n dr = free_alg\n p = dr.names\n\n x = IndexedBase('x')\n t = IndexedBase('y')\n a = IndexedBase('a')\n i, j = p.i, p.j\n v ... | [
"0.721331",
"0.6729908",
"0.6603086",
"0.64245504",
"0.6420772",
"0.6338257",
"0.62810874",
"0.618439",
"0.6160784",
"0.6119927",
"0.60566664",
"0.60125226",
"0.5988351",
"0.5984537",
"0.59110934",
"0.5883701",
"0.5880807",
"0.5858332",
"0.5856969",
"0.58504695",
"0.5826152",... | 0.91430455 | 0 |
Test case for replace_image | def test_replace_image(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_image(self):\n pass",
"def test_replace(self):\n with self.assertRaises(NotImplementedError):\n self.client.photo.replace(None, None)",
"def ff_correct_image(image):\n pass",
"def ff_correct_image(image):\n pass",
"def modify_image(self, example, target... | [
"0.76789653",
"0.7174158",
"0.71346325",
"0.71346325",
"0.6640061",
"0.6554253",
"0.65121883",
"0.6501614",
"0.64897037",
"0.6397167",
"0.639469",
"0.63761586",
"0.634786",
"0.6286283",
"0.6284474",
"0.62598085",
"0.62315285",
"0.6207226",
"0.6180478",
"0.6169867",
"0.6169371... | 0.92344016 | 0 |
Test case for replace_namespaced_build | def test_replace_namespaced_build(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_replace_namespaced_build_details(self):\n pass",
"def test_patch_namespaced_build(self):\n pass",
"def test_replace_namespaced_build_config(self):\n pass",
"def test_create_namespaced_build(self):\n pass",
"def test_patch_namespaced_build_config(self):\n pass",
... | [
"0.8762977",
"0.8623058",
"0.8315092",
"0.79639214",
"0.7918297",
"0.7362612",
"0.7346688",
"0.73462087",
"0.715569",
"0.68976766",
"0.6889208",
"0.68634266",
"0.6751175",
"0.6659082",
"0.66183263",
"0.65911376",
"0.658008",
"0.65469027",
"0.6544243",
"0.6324354",
"0.6317951"... | 0.92252356 | 0 |
Test case for replace_namespaced_build_config | def test_replace_namespaced_build_config(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_namespaced_build_config(self):\n pass",
"def test_replace_namespaced_build(self):\n pass",
"def test_replace_namespaced_deployment_config(self):\n pass",
"def test_replace_namespaced_build_details(self):\n pass",
"def test_create_namespaced_build_config(self):\n ... | [
"0.89115095",
"0.8251464",
"0.8063088",
"0.80603904",
"0.80549735",
"0.7872551",
"0.7819731",
"0.7758912",
"0.77458847",
"0.7424372",
"0.74102026",
"0.72118354",
"0.706696",
"0.6992362",
"0.6974616",
"0.69483316",
"0.67422616",
"0.66776425",
"0.6655153",
"0.66542125",
"0.6552... | 0.92933106 | 0 |
Test case for replace_namespaced_build_details | def test_replace_namespaced_build_details(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_replace_namespaced_build(self):\n pass",
"def test_patch_namespaced_build(self):\n pass",
"def test_replace_namespaced_build_config(self):\n pass",
"def test_patch_namespaced_build_config(self):\n pass",
"def test_create_namespaced_build(self):\n pass",
"def te... | [
"0.8477939",
"0.806373",
"0.7846346",
"0.75376314",
"0.73916316",
"0.7127973",
"0.6900529",
"0.67800313",
"0.6731821",
"0.6676773",
"0.6559523",
"0.6456891",
"0.638395",
"0.6201054",
"0.61816806",
"0.6163677",
"0.61428326",
"0.60630625",
"0.6048437",
"0.5956575",
"0.59464645"... | 0.9375999 | 0 |
Test case for replace_namespaced_deployment_config | def test_replace_namespaced_deployment_config(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_namespaced_deployment_config(self):\n pass",
"def test_replace_namespaced_deployment_config_status(self):\n pass",
"def test_create_namespaced_deployment_config(self):\n pass",
"def test_generate_namespaced_deployment_config(self):\n pass",
"def test_patch_namespa... | [
"0.89676344",
"0.8765923",
"0.81881803",
"0.8152552",
"0.8149071",
"0.7948566",
"0.7685555",
"0.7632705",
"0.7446794",
"0.7364053",
"0.72418326",
"0.7208435",
"0.7145629",
"0.7138119",
"0.70431954",
"0.6886506",
"0.67183024",
"0.66597956",
"0.65682966",
"0.6478931",
"0.646420... | 0.93668616 | 0 |
Test case for replace_namespaced_deployment_config_status | def test_replace_namespaced_deployment_config_status(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_namespaced_deployment_config_status(self):\n pass",
"def test_replace_namespaced_deployment_config(self):\n pass",
"def test_read_namespaced_deployment_config_status(self):\n pass",
"def test_patch_namespaced_deployment_config(self):\n pass",
"def test_delete_name... | [
"0.9077437",
"0.8093075",
"0.8090764",
"0.8012836",
"0.73361146",
"0.72328234",
"0.71699154",
"0.71106404",
"0.7076299",
"0.70643705",
"0.6807396",
"0.67077523",
"0.6545072",
"0.65230423",
"0.64710814",
"0.63409925",
"0.631678",
"0.6310832",
"0.62975526",
"0.62397736",
"0.619... | 0.9422467 | 0 |
Test case for replace_namespaced_egress_network_policy | def test_replace_namespaced_egress_network_policy(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_namespaced_egress_network_policy(self):\n pass",
"def test_create_namespaced_egress_network_policy(self):\n pass",
"def test_delete_namespaced_egress_network_policy(self):\n pass",
"def test_read_namespaced_egress_network_policy(self):\n pass",
"def test_list_name... | [
"0.8956728",
"0.8705721",
"0.84044665",
"0.83021057",
"0.8095901",
"0.7916204",
"0.7399577",
"0.71620125",
"0.6780843",
"0.63877505",
"0.60804576",
"0.60586923",
"0.6015408",
"0.59164834",
"0.5886516",
"0.57567894",
"0.573082",
"0.5694427",
"0.5681005",
"0.5635501",
"0.553573... | 0.94444555 | 0 |
Test case for replace_namespaced_image_stream | def test_replace_namespaced_image_stream(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_replace_namespaced_image_stream_tag(self):\n pass",
"def test_patch_namespaced_image_stream(self):\n pass",
"def test_replace_namespaced_image_stream_status(self):\n pass",
"def test_patch_namespaced_image_stream_tag(self):\n pass",
"def test_create_namespaced_image_str... | [
"0.903108",
"0.87318355",
"0.87304646",
"0.8519567",
"0.82006806",
"0.8083379",
"0.8074502",
"0.80488694",
"0.7904807",
"0.7818146",
"0.7757038",
"0.77537215",
"0.7699169",
"0.75567085",
"0.7485972",
"0.7422016",
"0.72978973",
"0.7278156",
"0.71866524",
"0.71750915",
"0.69638... | 0.94997567 | 0 |
Test case for replace_namespaced_image_stream_status | def test_replace_namespaced_image_stream_status(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_namespaced_image_stream_status(self):\n pass",
"def test_replace_namespaced_image_stream(self):\n pass",
"def test_read_namespaced_image_stream_status(self):\n pass",
"def test_replace_namespaced_image_stream_tag(self):\n pass",
"def test_patch_namespaced_image_st... | [
"0.9019557",
"0.832522",
"0.82416624",
"0.8063453",
"0.79305047",
"0.79270774",
"0.7520824",
"0.7412274",
"0.7368369",
"0.7236439",
"0.72332066",
"0.72194946",
"0.7152216",
"0.7120764",
"0.70933837",
"0.70334077",
"0.70114636",
"0.69937474",
"0.6962279",
"0.68679094",
"0.6578... | 0.94668317 | 0 |
Test case for replace_namespaced_image_stream_tag | def test_replace_namespaced_image_stream_tag(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_namespaced_image_stream_tag(self):\n pass",
"def test_replace_namespaced_image_stream(self):\n pass",
"def test_create_namespaced_image_stream_tag(self):\n pass",
"def test_replace_namespaced_image_stream_status(self):\n pass",
"def test_read_namespaced_image_stre... | [
"0.89403737",
"0.8859994",
"0.84644556",
"0.82173675",
"0.8153144",
"0.8034805",
"0.7964295",
"0.77844036",
"0.77463096",
"0.75652725",
"0.752651",
"0.7346247",
"0.72245437",
"0.72100097",
"0.7205298",
"0.7164246",
"0.71595997",
"0.7025611",
"0.69198143",
"0.6815857",
"0.6800... | 0.94826895 | 0 |
Test case for replace_namespaced_policy | def test_replace_namespaced_policy(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_replace_namespaced_policy_binding(self):\n pass",
"def test_patch_namespaced_policy(self):\n pass",
"def test_patch_namespaced_policy_binding(self):\n pass",
"def test_create_namespaced_policy(self):\n pass",
"def test_delete_namespaced_policy(self):\n pass",
"... | [
"0.85956126",
"0.84932315",
"0.7981715",
"0.7802912",
"0.74888945",
"0.7307528",
"0.70882314",
"0.70839316",
"0.70651513",
"0.7028067",
"0.6999062",
"0.6894913",
"0.6874332",
"0.68268967",
"0.68138945",
"0.6786766",
"0.67765564",
"0.67324567",
"0.6640167",
"0.6599705",
"0.649... | 0.93145555 | 0 |
Test case for replace_namespaced_policy_binding | def test_replace_namespaced_policy_binding(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_replace_namespaced_policy(self):\n pass",
"def test_patch_namespaced_policy_binding(self):\n pass",
"def test_create_namespaced_policy_binding(self):\n pass",
"def test_patch_namespaced_policy(self):\n pass",
"def test_delete_namespaced_policy_binding(self):\n pa... | [
"0.86989194",
"0.8652881",
"0.82459605",
"0.79204464",
"0.7818484",
"0.7640414",
"0.76052934",
"0.74074817",
"0.73223156",
"0.7265056",
"0.71855193",
"0.714238",
"0.71397364",
"0.68988097",
"0.6849962",
"0.68448925",
"0.6768197",
"0.6730452",
"0.67253023",
"0.6724539",
"0.672... | 0.9406181 | 0 |
Test case for replace_namespaced_role | def test_replace_namespaced_role(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_namespaced_role(self):\n pass",
"def test_replace_namespaced_role_binding(self):\n pass",
"def test_replace_namespaced_role_binding_restriction(self):\n pass",
"def test_create_namespaced_role(self):\n pass",
"def test_replace_roles(self):\n pass",
"def t... | [
"0.85598963",
"0.84424764",
"0.8186519",
"0.79386616",
"0.7818804",
"0.781122",
"0.76223254",
"0.74895674",
"0.74835366",
"0.73795825",
"0.73505473",
"0.7238259",
"0.7190156",
"0.71737117",
"0.70637757",
"0.69240457",
"0.6877987",
"0.685664",
"0.68482053",
"0.67223674",
"0.66... | 0.9369328 | 0 |
Test case for replace_namespaced_role_binding | def test_replace_namespaced_role_binding(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_replace_namespaced_role_binding_restriction(self):\n pass",
"def test_patch_namespaced_role_binding(self):\n pass",
"def test_replace_namespaced_role(self):\n pass",
"def test_create_namespaced_role_binding(self):\n pass",
"def test_patch_namespaced_role_binding_restric... | [
"0.9075005",
"0.8802105",
"0.8598719",
"0.8413053",
"0.84068215",
"0.8180925",
"0.7986236",
"0.7945224",
"0.7912334",
"0.7910178",
"0.77768624",
"0.76076573",
"0.7551479",
"0.74984974",
"0.7410984",
"0.7313777",
"0.7242691",
"0.7226832",
"0.7205951",
"0.71212965",
"0.70980686... | 0.9403523 | 0 |
Test case for replace_namespaced_role_binding_restriction | def test_replace_namespaced_role_binding_restriction(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_namespaced_role_binding_restriction(self):\n pass",
"def test_replace_namespaced_role_binding(self):\n pass",
"def test_create_namespaced_role_binding_restriction(self):\n pass",
"def test_patch_namespaced_role_binding(self):\n pass",
"def test_read_namespaced_rol... | [
"0.89409345",
"0.8883371",
"0.8661767",
"0.83864236",
"0.82354087",
"0.81467795",
"0.8086052",
"0.7906804",
"0.7888461",
"0.7871832",
"0.76663095",
"0.7570545",
"0.75620073",
"0.7431664",
"0.72870547",
"0.7271901",
"0.71431196",
"0.7118071",
"0.71131945",
"0.69772863",
"0.686... | 0.9462208 | 0 |
Test case for replace_namespaced_route | def test_replace_namespaced_route(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_namespaced_route(self):\n pass",
"def test_replace_namespaced_route_status(self):\n pass",
"def test_create_namespaced_route(self):\n pass",
"def test_patch_namespaced_route_status(self):\n pass",
"def test_read_namespaced_route(self):\n pass",
"def test_... | [
"0.86410624",
"0.84732205",
"0.79561853",
"0.7547684",
"0.7480766",
"0.7415874",
"0.73724127",
"0.7122009",
"0.7082708",
"0.6886149",
"0.6864758",
"0.66584617",
"0.6626207",
"0.66069627",
"0.65939116",
"0.64144045",
"0.6414396",
"0.6343787",
"0.63279265",
"0.62811655",
"0.617... | 0.942678 | 0 |
Test case for replace_namespaced_route_status | def test_replace_namespaced_route_status(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_namespaced_route_status(self):\n pass",
"def test_read_namespaced_route_status(self):\n pass",
"def test_replace_namespaced_route(self):\n pass",
"def replace_namespaced_route_status(self, body, namespace, name, **kwargs):\n\n all_params = ['body', 'namespace', 'nam... | [
"0.882733",
"0.7814552",
"0.7626319",
"0.7326821",
"0.72766924",
"0.67824805",
"0.6594041",
"0.6345812",
"0.630787",
"0.62994164",
"0.62272906",
"0.6105072",
"0.59572566",
"0.59212613",
"0.5848084",
"0.57249033",
"0.5715877",
"0.5708853",
"0.5708752",
"0.56928027",
"0.5684039... | 0.9353736 | 0 |
Test case for replace_namespaced_scale_scale | def test_replace_namespaced_scale_scale(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_namespaced_scale_scale(self):\n pass",
"def test_read_namespaced_scale_scale(self):\n pass",
"def replace_namespaced_scale_scale(self, body, namespace, name, **kwargs):\n\n all_params = ['body', 'namespace', 'name', 'pretty']\n all_params.append('callback')\n\n ... | [
"0.86272687",
"0.76630753",
"0.69590205",
"0.66042185",
"0.6238931",
"0.6049822",
"0.60464984",
"0.60436493",
"0.5918374",
"0.59165",
"0.5915465",
"0.58202183",
"0.58131474",
"0.5800194",
"0.57783186",
"0.5770329",
"0.5766349",
"0.5730761",
"0.56879",
"0.568188",
"0.5638088",... | 0.928097 | 0 |
Test case for replace_namespaced_template | def test_replace_namespaced_template(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_namespaced_template(self):\n pass",
"def test_create_namespaced_processed_template(self):\n pass",
"def test_create_namespaced_template(self):\n pass",
"def test_read_namespaced_template(self):\n pass",
"def test_replace_namespaced_route(self):\n pass",
"... | [
"0.82809186",
"0.78056943",
"0.74295866",
"0.7100756",
"0.7013253",
"0.6949027",
"0.67777807",
"0.6728041",
"0.66583323",
"0.65082896",
"0.63616866",
"0.6353416",
"0.63262695",
"0.6298508",
"0.6283132",
"0.6229773",
"0.61997473",
"0.60810435",
"0.6051537",
"0.6032966",
"0.600... | 0.92963606 | 0 |
Test case for replace_net_namespace | def test_replace_net_namespace(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_net_namespace(self):\n pass",
"def test_create_net_namespace(self):\n pass",
"def test_delete_net_namespace(self):\n pass",
"def test_read_net_namespace(self):\n pass",
"def test_list_net_namespace(self):\n pass",
"def test_replace_namespaced_policy(self)... | [
"0.8691869",
"0.80906755",
"0.77389735",
"0.7523356",
"0.73763067",
"0.7106577",
"0.7056627",
"0.693036",
"0.6864427",
"0.6746449",
"0.6705596",
"0.6538162",
"0.6504022",
"0.64356077",
"0.64003587",
"0.63744915",
"0.63484824",
"0.63484824",
"0.6327842",
"0.63201046",
"0.63193... | 0.93272287 | 0 |
Test case for replace_o_auth_access_token | def test_replace_o_auth_access_token(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_o_auth_access_token(self):\n pass",
"def test_replace_o_auth_authorize_token(self):\n pass",
"def test_create_o_auth_access_token(self):\n pass",
"def test_patch_o_auth_authorize_token(self):\n pass",
"def test_delete_o_auth_access_token(self):\n pass",
"... | [
"0.8620613",
"0.8026686",
"0.74021757",
"0.7382057",
"0.7372027",
"0.7275954",
"0.7099181",
"0.6875532",
"0.66974777",
"0.6576196",
"0.6489097",
"0.6447067",
"0.64425087",
"0.64101845",
"0.63849014",
"0.6336068",
"0.6331894",
"0.6321566",
"0.6318307",
"0.63091755",
"0.6306729... | 0.936919 | 0 |
Test case for replace_o_auth_authorize_token | def test_replace_o_auth_authorize_token(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_o_auth_authorize_token(self):\n pass",
"def test_replace_o_auth_access_token(self):\n pass",
"def test_create_o_auth_authorize_token(self):\n pass",
"def test_read_o_auth_authorize_token(self):\n pass",
"def test_list_o_auth_authorize_token(self):\n pass",
... | [
"0.8754329",
"0.7960014",
"0.79472536",
"0.7851136",
"0.7673392",
"0.767122",
"0.7042199",
"0.69109434",
"0.662788",
"0.65807086",
"0.65639406",
"0.64222836",
"0.62521636",
"0.6231609",
"0.62283707",
"0.6145511",
"0.6075389",
"0.6053472",
"0.5958521",
"0.5950847",
"0.5930306"... | 0.9418478 | 0 |
Test case for replace_o_auth_client | def test_replace_o_auth_client(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_replace_o_auth_client_authorization(self):\n pass",
"def test_patch_o_auth_client(self):\n pass",
"def test_patch_o_auth_client_authorization(self):\n pass",
"def test_create_o_auth_client(self):\n pass",
"def test_create_o_auth_client_authorization(self):\n pass... | [
"0.87713194",
"0.8602946",
"0.81785303",
"0.7697321",
"0.745717",
"0.7314954",
"0.7251735",
"0.72173536",
"0.71579343",
"0.7012937",
"0.69749635",
"0.69545376",
"0.68180966",
"0.66120845",
"0.65001446",
"0.6441086",
"0.63928014",
"0.6383814",
"0.63408947",
"0.6270022",
"0.625... | 0.9282521 | 0 |
Test case for replace_o_auth_client_authorization | def test_replace_o_auth_client_authorization(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_o_auth_client_authorization(self):\n pass",
"def test_replace_o_auth_client(self):\n pass",
"def test_create_o_auth_client_authorization(self):\n pass",
"def test_read_o_auth_client_authorization(self):\n pass",
"def test_patch_o_auth_client(self):\n pass",... | [
"0.8677574",
"0.84498614",
"0.8153951",
"0.7992852",
"0.7877582",
"0.7733545",
"0.7676204",
"0.75979924",
"0.73987573",
"0.7257882",
"0.70835906",
"0.70415884",
"0.6990808",
"0.6731316",
"0.658539",
"0.65433455",
"0.64863616",
"0.64697987",
"0.64683634",
"0.64316905",
"0.6428... | 0.9253923 | 0 |
Test case for replace_project | def test_replace_project(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_project(self):\n pass",
"def test_update_project(self):\n pass",
"def test_update_project(self):\n pass",
"def test_remove_project(self):\n pass",
"def test_replaceProjectVersion(self):\n replaceProjectVersion(\"test_project\",\n ... | [
"0.80749005",
"0.78071326",
"0.78071326",
"0.72602296",
"0.71960473",
"0.7003125",
"0.6946229",
"0.6931396",
"0.6931396",
"0.6931396",
"0.68102825",
"0.6679517",
"0.6635317",
"0.6635317",
"0.65954447",
"0.65929425",
"0.6573913",
"0.65598166",
"0.6554803",
"0.6554803",
"0.6547... | 0.9270444 | 0 |
Test case for replace_user | def test_replace_user(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_replace_user(self):\n\n replacement_data = dict(\n username='test_new_username',\n first_name='test_new_first_name',\n last_name='test_new_last_name',\n password='test_new_password',\n email='test_new_email',\n role='test_new_role',\... | [
"0.78980917",
"0.74527025",
"0.7221786",
"0.7096544",
"0.70060456",
"0.6940676",
"0.6645868",
"0.66022086",
"0.6593107",
"0.6549635",
"0.65276283",
"0.6526271",
"0.6503165",
"0.6424442",
"0.6402906",
"0.63845503",
"0.63552177",
"0.63524127",
"0.6319968",
"0.62451833",
"0.6237... | 0.9055799 | 0 |
Test case for replace_user_identity_mapping | def test_replace_user_identity_mapping(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_user_identity_mapping(self):\n pass",
"def test_create_user_identity_mapping(self):\n pass",
"def test_read_user_identity_mapping(self):\n pass",
"def test_replace_user(self):\n pass",
"def test_delete_user_identity_mapping(self):\n pass",
"def test_repla... | [
"0.8916992",
"0.80091196",
"0.7672377",
"0.7554565",
"0.7484374",
"0.7203426",
"0.68533224",
"0.6563803",
"0.63797075",
"0.62792873",
"0.6068897",
"0.6028269",
"0.5952737",
"0.5947097",
"0.5866021",
"0.5862291",
"0.57984775",
"0.579333",
"0.57326055",
"0.5648298",
"0.55776376... | 0.9480204 | 0 |
Parses the camera name from the S3 Object Key | def parse_camera_name_from_object_key(object_key):
first_parts = object_key.split("/")
return first_parts[1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _extract_bucket_key(s3_uri: str)->tuple:\n s3_regex=\"^s3://([a-z0-9.-]+)/(.*)$\"\n search =re.search(s3_regex, s3_uri)\n if search is None:\n raise Error(\"Invalid s3 uri: {}\".format(s3_uri))\n return search.groups()",
"def s3_key(self) -> pulumi.Input[str]:\n return pulumi.get(se... | [
"0.6068487",
"0.60591346",
"0.59437984",
"0.58954835",
"0.5870015",
"0.57224745",
"0.5706212",
"0.5686476",
"0.5675471",
"0.5613313",
"0.5565013",
"0.5521519",
"0.5514461",
"0.54904205",
"0.54869753",
"0.54478157",
"0.5415071",
"0.5412702",
"0.53466153",
"0.532687",
"0.531310... | 0.8231692 | 0 |
validates either the default or command line provided config file. | def check_config_file():
# Locate and init config.
default_config = "config.json"
if len(sys.argv) == 2:
# config from command line
app_config = config_reader(sys.argv[1])
else:
# config should be in default
app_config = config_reader(default_config)
# fin
if not ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _validate_config(self):\n pass",
"def validate_config(self):\n pass",
"def validate_config(self):\n pass",
"def __check_config(config):\n\n for key, value in defaults.CONFIG_REQUIRED_ENTRIES.items():\n if (key not in config.keys()) or (config[key] == \"\" and not va... | [
"0.72565967",
"0.72210765",
"0.72210765",
"0.6795908",
"0.67094606",
"0.6637963",
"0.66208035",
"0.65620023",
"0.6534319",
"0.6504273",
"0.64987046",
"0.64796966",
"0.64713526",
"0.6464463",
"0.64498085",
"0.64367545",
"0.6409162",
"0.6403595",
"0.6386648",
"0.6366032",
"0.63... | 0.7515331 | 0 |
Function parses the log file line for the information required to push the file to s3. | def parse_upload_file_line(line, logger, app_config, is_test=False):
import datetime
s3_object_info = {}
# Set Up
base_dir = get_config_item(app_config, 'ftp_base_dir')
start_timing = time.time()
start_date = datetime.datetime.now()
s3_object_info['date_string'] = start_date.strftime('%Y'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse(self, line):\n try:\n (year, month, day, hour, minute, second, microseconds, offset_hour, offset_minute, source, process, logentry) = re.match('^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)\\.([\\d]+)\\+(\\d\\d):(\\d\\d) ([a-z]+)\\[([a-zA-Z0-9_.]+)\\]: ([0-9a-z-A-Z\\-_\\.... | [
"0.6306382",
"0.6176867",
"0.60579836",
"0.6029742",
"0.60053253",
"0.5975853",
"0.5966789",
"0.5934284",
"0.58705586",
"0.5842775",
"0.584076",
"0.5840367",
"0.5830545",
"0.5734028",
"0.5699476",
"0.56991863",
"0.56885326",
"0.56865424",
"0.5685427",
"0.5661369",
"0.5656249"... | 0.73046 | 0 |
Transcodes our .mkv file to .mp4 prior to upload to s3 | def transcodetomp4(file_in, logger):
import subprocess
file_out = file_in.replace('.mkv', '.mp4')
if os.path.isfile('/usr/bin/avconv'):
convert_command = 'su securityspy -c \"/usr/bin/avconv -i "{}" -f mp4 -vcodec copy -acodec '.format(file_in) + \
'libfaac -b:a 112k -a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transcode(filePath: str) -> str:\n asset_uuid = uuid.uuid4()\n outPath = os.path.join(\"/tmp\", str(asset_uuid)+'.mp4')\n ffmpeg.input(filePath).output(outPath).run()\n return outPath",
"def convert_and_move_file (filename, origpath, wavpath, mp4path, mono):\n name, ext = path.... | [
"0.6191943",
"0.5961763",
"0.58747387",
"0.57044303",
"0.5675749",
"0.5640551",
"0.56128055",
"0.55979544",
"0.55527073",
"0.5478661",
"0.5455664",
"0.5393403",
"0.5379788",
"0.5373087",
"0.5341747",
"0.5321764",
"0.53072",
"0.5270807",
"0.5259411",
"0.52452445",
"0.5182081",... | 0.67287457 | 0 |
Parses Pacific Time from Object Key | def parse_date_time_pacific(object_key):
return extract_date_info(object_key) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extract_date_info(object_key):\n pacific = pytz.timezone('America/Los_Angeles')\n first_parts = object_key.split(\"/\")\n capture_type = first_parts[4]\n last_part_idx = len(first_parts) - 1\n file_name = first_parts[last_part_idx]\n\n # now parse the date and time out of the file name\n s... | [
"0.6107548",
"0.58502144",
"0.5767245",
"0.5760589",
"0.5728982",
"0.5698598",
"0.56663567",
"0.5595769",
"0.5564398",
"0.55641216",
"0.5552413",
"0.5542355",
"0.55335176",
"0.5518693",
"0.5512907",
"0.55063623",
"0.54856646",
"0.54854417",
"0.5449845",
"0.5428661",
"0.538585... | 0.7746621 | 0 |
Extract date information from the S3 Object Key | def extract_date_info(object_key):
pacific = pytz.timezone('America/Los_Angeles')
first_parts = object_key.split("/")
capture_type = first_parts[4]
last_part_idx = len(first_parts) - 1
file_name = first_parts[last_part_idx]
# now parse the date and time out of the file name
second_parts = f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_object_with_timestamp(self, key):\n response = self.client.get_object(Bucket=self.bucket, Key=key)\n return response['Body'].read().decode('latin-1').encode('ascii', 'ignore').decode('utf-8'), response[\n 'LastModified']",
"def parse_date_time_pacific(object_key):\n return ext... | [
"0.6645387",
"0.6360361",
"0.6182639",
"0.6104995",
"0.60909855",
"0.5733529",
"0.5723071",
"0.567674",
"0.5653475",
"0.5610599",
"0.56085724",
"0.5599934",
"0.5576975",
"0.5557569",
"0.5547125",
"0.5409194",
"0.53969854",
"0.53947616",
"0.53929687",
"0.5357202",
"0.53488266"... | 0.7033693 | 0 |
Converts a local naive date & time to a UTC Timestamp. | def convert_naive_local_to_utc_timestamp(year, month, day, hour, minutes, seconds):
pacific = pytz.timezone('America/Los_Angeles')
this_date = datetime.datetime(int(year), int(month), int(day), int(hour),
int(minutes), int(seconds))
local_dt = pacific.localize(this_date, is... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def UTCtimestampTolocal(ts, local_tz):\n t_utc = dt.datetime.fromtimestamp(ts,tz=pytz.timezone(\"UTC\"))\n t_local = t_utc.astimezone(local_tz)\n return t_local",
"def utc_timestamp(ts):\n import pandas\n\n ts = pandas.Timestamp(ts)\n if not ts.tzinfo:\n ts = ts.tz_localize(\"UTC\")\n ... | [
"0.72205764",
"0.6983059",
"0.6770738",
"0.677013",
"0.6730794",
"0.67281",
"0.6722522",
"0.67161834",
"0.6703183",
"0.66836935",
"0.65544444",
"0.6550889",
"0.6534934",
"0.6487955",
"0.6462393",
"0.64471936",
"0.64004195",
"0.63812923",
"0.6343139",
"0.6335491",
"0.63339645"... | 0.76103634 | 0 |
Get a generator of dicts for the stats model given by the filters. primary_field takes a field name that can be referenced by the key 'count' extra_fields takes a list of fields that can be found in the index on top of date and count and can be seen in the output | def get_series(model, primary_field=None, extra_fields=[], **filters):
# Put a slice on it so we get more than 10 (the default), but limit to 365.
qs = (model.search().order_by('-date').filter(**filters)
.values_dict('date', 'count', primary_field, *extra_fields))[:365]
for val in qs:
# Co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def db_stats(self):\n return { \"search_and_get\": self.db_search_and_get }",
"def __iter__(self):\n\t\tfields = 'fieldname', 'text', 'docfreq', 'indexfreq'\n\t\tcur = self.index.collection.find(fields=fields).sort('fieldname')\n\t\treturn (tuple(rec[field] for field in fields) for rec in cur)",
"def db_sta... | [
"0.54149985",
"0.54056007",
"0.5391118",
"0.5344368",
"0.5318489",
"0.52847236",
"0.5203437",
"0.51685715",
"0.5105639",
"0.50924635",
"0.5081627",
"0.5081627",
"0.5013903",
"0.4987854",
"0.4977408",
"0.4970459",
"0.4965423",
"0.49645317",
"0.4953344",
"0.49512574",
"0.494728... | 0.72104424 | 0 |
Get an variation of the image according to the object config | def get_variation(self, image):
#Crop
min_dim = min(image.size)
scale = random.uniform(*self.size_range)
size = int(random.random()*min_dim*(1-scale)+min_dim*scale)
pos = (random.randrange(0, image.size[0]-size), random.randrange(0, image.size[1]-size))
image = image.crop... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_variations_urls(self, obj):\n\n # Initiate return object\n return_object = {}\n\n # Get the field of the object\n field = obj.field\n\n # A lot of ifs going around, first check if it has the field variations\n if hasattr(field, 'variations'):\n # Get the... | [
"0.6710214",
"0.6096653",
"0.6017284",
"0.5857149",
"0.5801004",
"0.57686365",
"0.5765864",
"0.5734774",
"0.5731978",
"0.56540936",
"0.56378686",
"0.5554385",
"0.55035275",
"0.5491396",
"0.5485799",
"0.54690486",
"0.5460518",
"0.54252875",
"0.53941035",
"0.5393592",
"0.538732... | 0.70371515 | 0 |
avatar server handles user avatar requests | def test_user_avatar_serving(self):
User = get_user_model()
test_user = User.objects.create_user('Bob', 'bob@bob.com', 'pass123',
set_default_avatar=True)
avatar_url = reverse('misago:user-avatar', kwargs={
'pk': test_user.pk,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handle_avatar(self, url, save=True):\r\n response = requests.get(url)\r\n if response.status_code == 200:\r\n fp = BytesIO(response.content)\r\n ext = url.split('.')[-1]\r\n ext = ext if ext in [\"png\", \"jpg\", \"gif\", \"jpeg\"] else \"jpg\"\r\n file... | [
"0.6706043",
"0.6585643",
"0.65725255",
"0.6503974",
"0.64102757",
"0.63006324",
"0.6276676",
"0.6274863",
"0.62568325",
"0.62561643",
"0.6162704",
"0.6159254",
"0.6157274",
"0.6042145",
"0.6039384",
"0.602299",
"0.6021959",
"0.60130256",
"0.6008692",
"0.59990877",
"0.5974922... | 0.69089735 | 0 |
avatar server handles deleted user avatar requests | def test_deleted_user_avatar_serving(self):
avatar_url = reverse('misago:user-avatar', kwargs={
'pk': 12345,
'hash': '12356af',
'size': 150,
})
response = self.client.get(avatar_url)
self.assertEqual(response.status_code, 200)
self.assertEqual... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DeleteAvatar(self):\n\n return self.__Delete(\"/avatar\")",
"def deleteImage(username,imagename):\n if g.user == username:\n delete_blob(username,imagename)\n return redirect(url_for('landing'))",
"def delete(avatar_id):\n result = tourney_avatar_service.delete_avatar_image(avatar_id... | [
"0.73581797",
"0.6535996",
"0.6475129",
"0.6234199",
"0.6104524",
"0.60756737",
"0.6059146",
"0.60475725",
"0.604705",
"0.6022115",
"0.6022115",
"0.6013423",
"0.60087484",
"0.59903073",
"0.5971713",
"0.5846271",
"0.58327943",
"0.58215225",
"0.5811763",
"0.58093536",
"0.578544... | 0.7201987 | 1 |
avatar server handles blank avatar requests | def test_blank_avatar_serving(self):
response = self.client.get(reverse('misago:blank-avatar', kwargs={
'size': 150,
}))
self.assertEqual(response.status_code, 200)
self.assertEqual(response['Content-Type'], 'image/png') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post_avatar_view(request):\n msg = {}\n msg['Code'] = False\n try:\n username = request.user.username\n user_this = request.user\n avatar = request.FILES.get('avatar', None)\n print(1)\n if not avatar:\n print(2)\n return HttpResponse(json.dumps... | [
"0.64682335",
"0.645517",
"0.6349568",
"0.61625636",
"0.61291534",
"0.6122712",
"0.61162794",
"0.60240614",
"0.59968674",
"0.593721",
"0.593003",
"0.5916052",
"0.5885455",
"0.5854677",
"0.5841885",
"0.5828548",
"0.5806121",
"0.5785862",
"0.57817805",
"0.57628775",
"0.5719074"... | 0.7371538 | 0 |
clean_size returns max for too big size | def test_size_too_big(self):
max_size = max(settings.MISAGO_AVATARS_SIZES)
too_big = max_size * 2
self.assertEqual(clean_size(too_big), max_size) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def maxsize(self):\r\n return None",
"def max_size(self):\n raise NotImplementedError()",
"def test_size_too_small(self):\n min_size = min(settings.MISAGO_AVATARS_SIZES)\n too_small = min_size / 2\n\n self.assertEqual(clean_size(too_small), min_size)",
"def remove_files_siz... | [
"0.7087125",
"0.6722244",
"0.6587309",
"0.65810645",
"0.65523523",
"0.6518597",
"0.64548016",
"0.64165",
"0.6414158",
"0.6408194",
"0.6396132",
"0.639558",
"0.6371853",
"0.63360816",
"0.6327586",
"0.62781775",
"0.62722987",
"0.6268337",
"0.6257176",
"0.62487006",
"0.618654",
... | 0.7569357 | 0 |
clean_size returns min for too small size | def test_size_too_small(self):
min_size = min(settings.MISAGO_AVATARS_SIZES)
too_small = min_size / 2
self.assertEqual(clean_size(too_small), min_size) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def minsize(self):# -> int:\r\n return 0",
"def min_size(self):\n raise NotImplementedError()",
"def minimize_size(self) -> int:\n min_size_out = subprocess.check_output(\n nsenter_as_root(\n self._unshare,\n # pyre-fixme[6]: Expected `List[Variable... | [
"0.76190764",
"0.7389638",
"0.7335242",
"0.7106966",
"0.70281905",
"0.70051837",
"0.698039",
"0.6955294",
"0.69513625",
"0.6887566",
"0.6811317",
"0.67063046",
"0.66946334",
"0.6678158",
"0.6673452",
"0.6661509",
"0.6633962",
"0.66162205",
"0.65392846",
"0.65337044",
"0.65138... | 0.8013477 | 0 |
clean_size returns valid sizes untouched | def test_valid_sizes(self):
for size in settings.MISAGO_AVATARS_SIZES:
self.assertEqual(clean_size(size), size) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_size_too_small(self):\n min_size = min(settings.MISAGO_AVATARS_SIZES)\n too_small = min_size / 2\n\n self.assertEqual(clean_size(too_small), min_size)",
"def clean_size(size):\n size = size.replace(\"M\",\"\")\n if size.endswith(\"k\"):\n size = float(size[:-1])/1000\n ... | [
"0.69816965",
"0.6850633",
"0.66148",
"0.655926",
"0.64865744",
"0.6451457",
"0.63983613",
"0.6224004",
"0.61833584",
"0.61739016",
"0.6149554",
"0.6137566",
"0.6126592",
"0.6079727",
"0.6021883",
"0.5924575",
"0.5909546",
"0.58741087",
"0.58427763",
"0.5826414",
"0.5810769",... | 0.7004182 | 0 |
Calculate the gravitational delay The implementation is described in IERS Conventions [1]_, section 11.1, in particular equation (11.9). | def vlbi_grav_delay(dset):
eph = apriori.get("ephemerides", time=dset.time)
grav_delay = np.zeros(dset.num_obs)
# List of celestial bodies. Major moons are also recommended, like Titan, Ganymedes, ...
bodies = [
"mercury barycenter",
"venus barycenter",
"earth",
"moon",
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_gravitation(self):\n with PhysicsEngineHarness('tests/massive-objects.json') as physics_engine:\n # In this case, the first entity is very massive and the second\n # entity should gravitate towards the first entity.\n t0 = 1\n t1 = 2\n initial ... | [
"0.68207735",
"0.6423103",
"0.6103835",
"0.60187733",
"0.59844357",
"0.59758383",
"0.59610367",
"0.5958875",
"0.5919561",
"0.5867162",
"0.5851209",
"0.58429337",
"0.5788291",
"0.5788291",
"0.5756704",
"0.5749892",
"0.5749892",
"0.5729351",
"0.57071257",
"0.56512266",
"0.56450... | 0.71809274 | 0 |
Split large message into smaller messages each smaller than the max_length. | def split_message(message, max_length):
ms = []
while len(message) > max_length:
ms.append(message[:max_length])
message = message[max_length:]
ms.append(message)
return ms | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_message(text, max_length=640):\n res = []\n sub_message = ''\n sentences = split_into_sentences(text)\n for sentence in sentences:\n new_sub_message = sub_message + ' ' + sentence if sub_message else sentence\n if len(sentence) > max_length:\n res.extend(split_by_spac... | [
"0.7418631",
"0.691962",
"0.6583737",
"0.65408283",
"0.64927566",
"0.6427934",
"0.63861686",
"0.638267",
"0.6321458",
"0.59109515",
"0.58571",
"0.5847147",
"0.5800728",
"0.57832974",
"0.5766912",
"0.5757795",
"0.57126135",
"0.5684644",
"0.5675258",
"0.56650776",
"0.5657382",
... | 0.82024264 | 0 |
Vaildates markdown specs type | def _validate_markdown_spec(
self, spec: standard_component_specs, markdown_dict: dict
):
for key in spec.MARKDOWN_DICT:
if key not in markdown_dict:
raise ValueError(f"Missing mandatory key - {key}")
if key in markdown_dict:
self._type_check(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_description_markdown_with_custom_options() -> None:\n soup = generate_case(\n \"description_markdown\",\n GenerationConfiguration(\n markdown_options={\n \"cuddled-lists\": True,\n }\n ),\n )\n\n assert (\n str(soup.find(\"span\", c... | [
"0.5983284",
"0.5921397",
"0.5793576",
"0.5785793",
"0.5780583",
"0.57444686",
"0.5696425",
"0.56614536",
"0.5658293",
"0.56429744",
"0.56287116",
"0.55960137",
"0.5591266",
"0.55230945",
"0.54582703",
"0.5453709",
"0.54453486",
"0.5339734",
"0.5287391",
"0.52568823",
"0.5250... | 0.63553214 | 0 |
Validates confusion matrix specs type | def _validate_confusion_matrix_spec(
self, spec: standard_component_specs, confusion_matrix_dict: dict
):
for key in spec.CONFUSION_MATRIX_DICT:
if key not in confusion_matrix_dict:
raise ValueError(f"Missing mandatory key - {key}")
if key in confusion_matrix_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _type_check(data):\n if data.__class__.__name__ != \"Matrix3\":\n return False\n return True",
"def test_types(self):\n \n self.assertIsInstance(self.tx_data_in, numpy.ndarray)\n self.assertIsInstance(self.circuit_simulation, bool)\n self.assertIsInstance(... | [
"0.6245011",
"0.61135805",
"0.6018642",
"0.58923566",
"0.5853928",
"0.5838295",
"0.57679915",
"0.5748935",
"0.5718453",
"0.56808",
"0.5662633",
"0.5660403",
"0.56409234",
"0.5625351",
"0.5616002",
"0.5611728",
"0.55845785",
"0.55771273",
"0.5556319",
"0.5551494",
"0.55378246"... | 0.73671454 | 0 |
Remove project from a node with all related services and files. | def destroy(config, args):
log = logging.getLogger('kraftwerk.destroy')
if confirm("Remove project %s from node %s along with all services and data?" %
(args.project.name, args.node.hostname)):
args.node.ssh(config.template("scripts/project_destroy.sh", project=args.project))
print ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_remove_project(self):\n pass",
"def cleanUp(self):\n import evoware.fileutil as F\n F.tryRemove(self.f_project, verbose=(self.VERBOSITY>1), tree=1)",
"def remove_single_project(project_name):\n p = subprocess.Popen('rm -rf {}/{}'.format(context.__PROJECTS_PATH__, project_name),... | [
"0.6944873",
"0.6878074",
"0.667365",
"0.6634251",
"0.6486534",
"0.6413726",
"0.63376826",
"0.61284745",
"0.6079854",
"0.60776126",
"0.6052018",
"0.60398597",
"0.60185987",
"0.6001516",
"0.6001516",
"0.5963188",
"0.59469116",
"0.5944436",
"0.58971494",
"0.58846754",
"0.586114... | 0.7186239 | 0 |
Load a timestamped dumpdir from the same node. (No support yet for user provided dumps). To load data from another node use `syncservices`. | def load(config, args):
if not confirm("WARNING: This isn't considered production ready just yet. Continue?"):
return
if not args.no_backup:
timestamp = args.project.dump(args.node)
print "Pre-load backup: %s" % args.project.dump_path(timestamp)
args.project.load(args.node, args.time... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dumbcache_load(cache_dir=r'data\\cache'):\n DUMBCACHE = os.path.join(r'..', cache_dir, r'br_store.dmp')\n with open(DUMBCACHE, 'rb') as f:\n return pkl.load(f)",
"def PullDumps(self, host_dir):\n # The device/emulator's clock might be off from the host, so calculate an\n # offset that can ... | [
"0.5743635",
"0.5709323",
"0.5641507",
"0.5386622",
"0.53373593",
"0.52402914",
"0.51993835",
"0.51800746",
"0.5136665",
"0.5136665",
"0.5061591",
"0.50038725",
"0.498076",
"0.49675483",
"0.4962034",
"0.4913579",
"0.49112496",
"0.4894733",
"0.48415193",
"0.48140103",
"0.48119... | 0.5949346 | 0 |
Generates a binary matrix for DNA/RNA sequence, where each column is a possible base and each row is a position along the sequence. Matrix column order is A, T/U, C, G | def rs1_score(sequence):
import math
import numpy as np
seq = str(sequence).upper()
seq = list(seq)
matrix1 = np.zeros([len(sequence),4], dtype=int)
for i,item in enumerate(sequence):
if item == 'A':
matrix1[i,0] = 1
if item == 'T':
matrix1[i,1] = 1
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def matrixmaker(dnastring): \n\n\tlettersinv = {\"A\":0,\"C\":1,\"G\":2,\"T\":3}\n\tmatrix = np.zeros( (4, len(dnastring)) ) # Make a matrix full of zeros of of the length of the DNA string\n\tindex = []\n\tfor i in range(len(dnastring)): \n\t\tindex.append([lettersinv[list(dnastring)[i]], i]) #convert the stri... | [
"0.7547849",
"0.6428862",
"0.6175554",
"0.61283636",
"0.6128263",
"0.6001595",
"0.600059",
"0.5882467",
"0.58732945",
"0.58269197",
"0.58063984",
"0.57889557",
"0.57760364",
"0.56999916",
"0.56896293",
"0.568432",
"0.5679552",
"0.56640226",
"0.56455046",
"0.56055176",
"0.5595... | 0.65043736 | 1 |
Returns a LaTeX bmatrix | def bmatrix(a):
if len(a.shape) > 2:
raise ValueError('bmatrix can at most display two dimensions')
lines = str(a).replace('[', '').replace(']', '').splitlines()
rv = [r'\begin{bmatrix}']
rv += [' ' + ' & '.join(l.split()) + r'\\' for l in lines]
rv += [r'\end{bmatrix}']
return '\n'.jo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _repr_latex_(self):\n if len(self.shape) > 2:\n raise ValueError(\"bmatrix can at most display two dimensions\")\n\n def fmt(x):\n if x == 0:\n return \".\"\n if np.abs(x) < EPS:\n return \"0.\"\n return \"{:.2g}\".format(x... | [
"0.76726884",
"0.74842423",
"0.63150483",
"0.6305179",
"0.63013434",
"0.6166482",
"0.5991281",
"0.59912777",
"0.59640145",
"0.59256893",
"0.5863013",
"0.5815379",
"0.57520753",
"0.571899",
"0.5717092",
"0.571185",
"0.5644417",
"0.5642071",
"0.55754423",
"0.55503935",
"0.55488... | 0.7743502 | 0 |
This function responds to a request for /api/directors/{director_id}/movies/{movie_id} with one matching movie for the associated director | def read_one(director_id, movie_id):
# Query the database for the movie
movie = (
Movies.query.join(Directors, Directors.id == Movies.director_id)
.filter(Directors.id == director_id)
.filter(Movies.id == movie_id)
.one_or_none()
)
# Was a movie found?
if movie is no... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_movies_by_director(self, director: str):\n raise NotImplementedError",
"def single_movie(request, pk):\n try: \n single_movie = Movie.objects.get(pk=pk)\n except Movie.DoesNotExist:\n return Response(status=status.HTTP_404_NOT_FOUND)\n\n #print (request.data)\n if request... | [
"0.708872",
"0.7029216",
"0.6962466",
"0.67997044",
"0.67540914",
"0.673394",
"0.6714526",
"0.65669346",
"0.6539842",
"0.6459561",
"0.63922524",
"0.6388064",
"0.6375318",
"0.63303095",
"0.6302917",
"0.62473845",
"0.62286574",
"0.62257546",
"0.6188286",
"0.6161508",
"0.6100542... | 0.72081804 | 0 |
This function creates a new movie related to the passed in director id. | def create(director_id, movie):
uid = movie.get("uid")
title = movie.get("title")
# validators
if not((uid or uid==0) and title):
return "",400
existing_movie = (
Movies.query.filter(Movies.uid == uid)
.one_or_none()
)
# get the parent director
director = Dire... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post_movie():\n id = request.params.get('id')\n mongo_mgr.add_film_to_user(id, aaa.current_user.id)",
"def create(self, title: str, description: str, releasedate: str, director: str, category: str) -> Movie:\n return MoviesFactory.create1(self.get_next_identifier(), title, description, releaseda... | [
"0.7072465",
"0.6954096",
"0.6461437",
"0.64473164",
"0.64310783",
"0.6429957",
"0.64250535",
"0.6262646",
"0.6223765",
"0.61789995",
"0.61575466",
"0.6155177",
"0.60917753",
"0.60718167",
"0.60543764",
"0.6029562",
"0.59644616",
"0.5936372",
"0.59291273",
"0.592471",
"0.5916... | 0.78997344 | 0 |
This function updates an existing movie related to the passed in director id. | def update(director_id, movie_id, movie):
uid = movie.get("uid")
title = movie.get("title")
# validators
if not((uid or uid==0) and title):
return "",400
update_movie = (
Movies.query.filter(Directors.id == director_id)
.filter(Movies.id == movie_id)
.one_or_none()... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update(movie_id, movie):\n # Get the movie requested from the db into session\n update_movie = Movie.query.filter(\n Movie.movie_id == movie_id\n ).one_or_none()\n\n # Are we trying to find a movie that does not exist?\n if update_movie is None:\n abort(\n 404,\n ... | [
"0.74005884",
"0.68599683",
"0.68007743",
"0.6500231",
"0.62720966",
"0.6245024",
"0.62047195",
"0.6188829",
"0.6057575",
"0.59723455",
"0.5888192",
"0.58382547",
"0.5760921",
"0.57288235",
"0.56393623",
"0.5603149",
"0.5553609",
"0.55351245",
"0.5487013",
"0.5477334",
"0.547... | 0.8159399 | 0 |
This function responds to a request for /api/movies/budgetFilter/ with the complete list of movies, sorted by movie budget | def budgetFilter(budget):
# Query the database for all the movies
movies = Movies.query.order_by(db.asc(Movies.budget)).filter(Movies.budget>=budget).limit(100).all()
# Serialize the list of movies from our data
movies_schema = MoviesSchema(many=True)
data = movies_schema.dump(movies)
return da... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter_movie():\n name = request.args.get('name', default=\"\", type=str)\n year = request.args.get('year', default=-1, type=int)\n\n filtered_list = []\n\n if name != \"\":\n name = name.replace('_', ' ')\n name = name.replace('\"', '')\n for movie in movies_data:\n ... | [
"0.6194646",
"0.6185997",
"0.60520345",
"0.60433215",
"0.60237235",
"0.58494836",
"0.5809012",
"0.57603014",
"0.57403916",
"0.56052566",
"0.55823064",
"0.5557327",
"0.5504466",
"0.54578716",
"0.5384181",
"0.53797144",
"0.5337868",
"0.5308203",
"0.5290098",
"0.52517307",
"0.52... | 0.72808444 | 0 |
This function responds to a request for /api/movies/voteFilter with the complete list of movies, sorted by movie vote_average | def voteFilter(vote_average):
# Query the database for all the movies
movies = Movies.query.order_by(db.asc(Movies.vote_average)).filter(Movies.vote_average>=vote_average).limit(100).all()
# Serialize the list of movies from our data
movies_schema = MoviesSchema(many=True)
data = movies_schema.dump... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def top_ten(request):\n if request.method == 'GET':\n movies = Movie.objects.filter(date_of_release__lte=datetime.date.today())\n movies = movies.order_by('-rating')[:10]\n serializer = MovieSerializer(movies, many=True)\n return Response(serializer.data)",
"def test_get_movies_ord... | [
"0.67898273",
"0.628587",
"0.61284184",
"0.610419",
"0.60876334",
"0.60831326",
"0.6034912",
"0.59865177",
"0.58934975",
"0.58662695",
"0.5843937",
"0.5747316",
"0.56859845",
"0.56828725",
"0.5635194",
"0.5631617",
"0.5615504",
"0.56133264",
"0.56133264",
"0.5606299",
"0.5597... | 0.69732875 | 0 |
This function responds to a request for /api/movies/revenueFilter with the complete list of movies, sorted by movie revenue | def revenueFilter(revenue):
# Query the database for all the movies
movies = Movies.query.order_by(db.asc(Movies.revenue)).filter(Movies.revenue>=revenue).limit(100).all()
# Serialize the list of movies from our data
movies_schema = MoviesSchema(many=True)
data = movies_schema.dump(movies)
retu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_movies(self, **kwargs):\n self.url = f\"{self.base_url}{self.FILMS_URL}\"\n self.method = \"get\"\n self.params = self._prepare_query_params(kwargs)\n\n self._make_request()\n\n return self.response.json()",
"def top_ten(request):\n if request.method == 'GET':\n ... | [
"0.62334967",
"0.61897826",
"0.6109716",
"0.60886914",
"0.6008584",
"0.5961294",
"0.5936529",
"0.58577",
"0.58222216",
"0.5799172",
"0.56839365",
"0.5678778",
"0.56009865",
"0.5578165",
"0.5555892",
"0.5478501",
"0.542953",
"0.5420212",
"0.54066664",
"0.54026216",
"0.536141",... | 0.7336774 | 0 |
This function responds to a request for /api/movies/popularityFilter with the complete list of movies, sorted by movie popularity | def popularityFilter(popularity):
# Query the database for all the movies
movies = Movies.query.order_by(db.asc(Movies.popularity)).filter(Movies.popularity>=popularity).limit(100).all()
# Serialize the list of movies from our data
movies_schema = MoviesSchema(many=True)
data = movies_schema.dump(m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def top_ten(request):\n if request.method == 'GET':\n movies = Movie.objects.filter(date_of_release__lte=datetime.date.today())\n movies = movies.order_by('-rating')[:10]\n serializer = MovieSerializer(movies, many=True)\n return Response(serializer.data)",
"def popular(self, **kwa... | [
"0.6893475",
"0.68772715",
"0.6624343",
"0.6536105",
"0.6365944",
"0.6345866",
"0.6309158",
"0.6253549",
"0.6211948",
"0.6196819",
"0.61110556",
"0.61001754",
"0.6029069",
"0.59877795",
"0.5943055",
"0.5921197",
"0.5920061",
"0.58843386",
"0.5832017",
"0.58234775",
"0.5766528... | 0.6885904 | 1 |
This function responds to a request for /api/movies/voteCountFilter with the complete list of movies, sorted by movie vote_count | def voteCountFilter(vote_count):
# Query the database for all the movies
movies = Movies.query.order_by(db.asc(Movies.vote_count)).filter(Movies.vote_count>=vote_count).limit(100).all()
# Serialize the list of movies from our data
movies_schema = MoviesSchema(many=True)
data = movies_schema.dump(mo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def top_ten(request):\n if request.method == 'GET':\n movies = Movie.objects.filter(date_of_release__lte=datetime.date.today())\n movies = movies.order_by('-rating')[:10]\n serializer = MovieSerializer(movies, many=True)\n return Response(serializer.data)",
"def get_number_of_movie... | [
"0.65571856",
"0.6077565",
"0.5961426",
"0.58362144",
"0.58065075",
"0.57730377",
"0.5740588",
"0.5739573",
"0.5716054",
"0.56854475",
"0.5614231",
"0.5605161",
"0.5601184",
"0.55587685",
"0.54986614",
"0.5453162",
"0.544951",
"0.54091567",
"0.54034007",
"0.53951716",
"0.5386... | 0.6806439 | 0 |
This function responds to a request for /api/movies/titleFilter with the complete list of movies, sorted by movie id | def titleFilter(title):
# Query the database for all the movies
movies = Movies.query.order_by(db.asc(Movies.id)).filter(Movies.title.ilike('%'+title+'%')).limit(100).all()
# Serialize the list of movies from our data
movies_schema = MoviesSchema(many=True)
data = movies_schema.dump(movies)
ret... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __get_movies(title):\n params = {\n 's': title,\n 'type': 'movie'\n }\n\n response = requests.get(API_URL + API_KEY, params=params).json()\n return response",
"def test_get_movies_order_by_title(self):\n\n r = self.client.get(reverse('movieapi:movies'), {'order_by': 'title'})... | [
"0.7571002",
"0.71358126",
"0.7077287",
"0.70145077",
"0.6959381",
"0.6900023",
"0.6885668",
"0.6757085",
"0.6721459",
"0.65840214",
"0.65502095",
"0.6488465",
"0.6363202",
"0.63251626",
"0.6318451",
"0.63140047",
"0.62668234",
"0.62500495",
"0.62383103",
"0.62092537",
"0.618... | 0.72301364 | 1 |
Returns a matrix of the cosine distance between all ItemItem vectors. To get cosine similarity, subtract returned values from 1 | def cosineDistanceMatrix():
matrix = movieMatrix()
similarity = np.dot(matrix, matrix.T)
squareMag = np.diag(similarity)
invSquareMag = 1/squareMag
invSquareMag[np.isinf(invSquareMag)]=0
invMag = np.sqrt(invSquareMag)
cosine = similarity * invMag
cosine = cosine.T * invMag
return cosine | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_cosine_similarity(self):\n tfidf_matrix = self.calculate_tfidf()\n\n cosine_similarity = linear_kernel(tfidf_matrix, tfidf_matrix) # Cosine similarity matrix calculation\n\n return cosine_similarity",
"def compute_cosine_similarity(self):\n cos_matrix = []\n for ... | [
"0.7108773",
"0.67838144",
"0.6688413",
"0.66667473",
"0.6655696",
"0.6586604",
"0.6558179",
"0.6524422",
"0.6493675",
"0.6437112",
"0.64185953",
"0.63227534",
"0.6316974",
"0.631486",
"0.6305053",
"0.62956613",
"0.6292672",
"0.6214044",
"0.6186623",
"0.61788327",
"0.6164011"... | 0.7306782 | 0 |
Method for generating a rating for a given movie ID based on calculating relation between existing ratings and the ratings of similar movies in the database. | def predictRating(self, movieID):
return movieID | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def predict_rating(self, movie):\n\n #\n # option 1: SQLAlchemy ORM\n #\n UserMovies = db.aliased(Rating)\n MovieUsers = db.aliased(Rating)\n\n query = (db.session.query(Rating.user_id, Rating.score, UserMovies.score, MovieUsers.score)\n .join(UserMovies, U... | [
"0.68963665",
"0.68167573",
"0.66719234",
"0.65102756",
"0.64888936",
"0.61246043",
"0.61128944",
"0.6079175",
"0.5898718",
"0.5893919",
"0.5889352",
"0.58788633",
"0.5859166",
"0.5839653",
"0.58377033",
"0.58012885",
"0.5766866",
"0.57454723",
"0.574112",
"0.5739906",
"0.572... | 0.71079534 | 0 |
Length of the arc between two angles (in rad) on a circle of radius r. | def arc_length(angle_1, angle_2, r=1.):
# Compute the angle between the two inputs between 0 and 2*pi.
theta = np.mod(angle_2 - angle_1, 2*pi)
if theta > pi:
theta = theta - 2 * pi
# Return the length of the arc
L = r * np.abs(theta)
return(L) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def area_of_circle(r):\n a = r**2 * math.pi\n return a",
"def area_of_circle(r):\n a = r**2 * math.pi\n return a",
"def _arc_radius(height_in_units):\n return height_in_units * _ARC_HEIGHT_UNIT / (1 - math.cos(_ANGLE))",
"def radius_length(a = 0, b = 0):\n return math.sqrt(a**2 + b**2)",
... | [
"0.7431485",
"0.7431485",
"0.70981354",
"0.70454156",
"0.7032206",
"0.70320016",
"0.69171315",
"0.6906662",
"0.68250483",
"0.657148",
"0.6514631",
"0.64861625",
"0.64715",
"0.6443854",
"0.64328116",
"0.6420829",
"0.63649535",
"0.6341196",
"0.6315033",
"0.6305998",
"0.62924516... | 0.83516645 | 0 |
Fill in columns of peerhostname and peerifname if requested Using a combination of LLDP info, if available and without it, this routine tries to fill in the columns of peerhostname and peerifname for the relevant rows. In the absence of LLDP info, filling in peerifname is very errorprone especially in the presence of u... | def _get_peernames(self, df: pd.DataFrame, columns: List[str],
**kwargs) -> pd.DataFrame:
if df.empty or not any(x in columns
for x in ['peerHostname', 'peerIfname', '*',
'default']):
return df
d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def peer_config_set(host_id, status, peer_config_fields, peer_config_param, time_slot_param, user_name):\n global sqlalche_obj\n sqlalche_obj.sql_alchemy_db_connection_open()\n if status == 1:\n result = 'Timeslot is smaller than the number of slaves you want to fill'\n return result\n el... | [
"0.5090622",
"0.45656672",
"0.4557526",
"0.44901878",
"0.44827902",
"0.4469369",
"0.44475865",
"0.44266284",
"0.4401839",
"0.43123284",
"0.4302144",
"0.42857343",
"0.42750102",
"0.42664707",
"0.42560342",
"0.42410547",
"0.42405173",
"0.41874677",
"0.41559947",
"0.412936",
"0.... | 0.6581798 | 0 |
Test Event Page load response and headers | def test_event_page(self):
res = self.client.get('/events')
data = res.data.decode('utf-8')
assert res.status == '200 OK'
assert 'Upcoming Events' in data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_event_load(self):\n res = self.client.get('/create-event')\n data = res.data.decode('utf-8')\n assert res.status == '200 OK'\n assert 'Create Event' in data",
"def test_events(self):\n\n response = self.client.get(reverse('events'))\n\n assert response.st... | [
"0.67243963",
"0.65502965",
"0.65413606",
"0.6372961",
"0.6323419",
"0.62771714",
"0.6264577",
"0.62523866",
"0.6246403",
"0.62210697",
"0.62210697",
"0.6156657",
"0.61405146",
"0.6081699",
"0.6078666",
"0.6067772",
"0.6065795",
"0.60552984",
"0.60446584",
"0.6038586",
"0.603... | 0.703474 | 0 |
Test Contact Page load response and headers | def test_contact_page(self):
res = self.client.get('/contact')
data = res.data.decode('utf-8')
assert res.status == '200 OK'
assert 'Contact Us' in data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_contact_page(self, client):\n response = client.get(url_for('contact.index'))\n assert response.status_code == 200",
"def test_contact(self):\n\t\tresponse = self.client.get('/contact')\n\t\tself.assertContains(response, 'Contact', 4, 200)",
"def test_contact(self):\n response = s... | [
"0.76097435",
"0.70431745",
"0.70324767",
"0.68447495",
"0.6504395",
"0.64159054",
"0.63965094",
"0.6373251",
"0.6353944",
"0.628743",
"0.62654436",
"0.62109023",
"0.6158396",
"0.6148875",
"0.6148875",
"0.6137095",
"0.6124843",
"0.6066636",
"0.6065561",
"0.6064088",
"0.605532... | 0.7733748 | 0 |
Test Sign Up Page load response and headers | def test_signup_page(self):
res = self.client.get('/signup')
data = res.data.decode('utf-8')
assert res.status == '200 OK'
assert 'Sign Up' in data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_signin_page(self):\n res = self.client.get('/signup')\n data = res.data.decode('utf-8')\n assert res.status == '200 OK'\n assert 'Sign Up' in data",
"def testsignup(self):\n rv = self.app.get('/signup')\n self.assertEqual(rv.status_code, 200, \"signup page did n... | [
"0.76574355",
"0.7478787",
"0.74427336",
"0.7351948",
"0.7096097",
"0.7087104",
"0.70664585",
"0.70106405",
"0.69789755",
"0.6955895",
"0.69524956",
"0.69441074",
"0.6936016",
"0.6923386",
"0.68811786",
"0.6875551",
"0.68677163",
"0.6849414",
"0.6822588",
"0.68062764",
"0.680... | 0.7892331 | 0 |
Test Sign In Page load response and headers | def test_signin_page(self):
res = self.client.get('/signup')
data = res.data.decode('utf-8')
assert res.status == '200 OK'
assert 'Sign Up' in data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testsignin(self):\n rv = self.app.get('/signin')\n self.assertEqual(rv.status_code, 200, \"log in page didnot load as expected\")",
"def test_login_page(self):\n r = requests.get(self.url)\n self.assertEqual(r.status_code, 200)\n soup = BeautifulSoup(r.content)\n sel... | [
"0.7726488",
"0.73342806",
"0.72265077",
"0.7200119",
"0.70581585",
"0.69857186",
"0.6924344",
"0.69096863",
"0.6892179",
"0.6870843",
"0.68696064",
"0.68443173",
"0.67943347",
"0.6788796",
"0.67186874",
"0.67141616",
"0.66537213",
"0.6651939",
"0.6650704",
"0.664873",
"0.663... | 0.7565019 | 1 |
Test Successful Sign in and profile redirect functionality | def test_signin_functionality(self):
res = self.client.post('/signin',
follow_redirects=True, data=dict(
username='orange',
password='123Orange',
))
data = res.data.decode(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_profile_secure_login(self):\n response = self.client.get('/profile/')\n self.assertEqual(response.status_code, 302)",
"def test_redirect_profile(self):\n self.create_user_and_login(\n agreed_to_terms_of_service=True,\n filled_out=False\n )\n\n res... | [
"0.7776962",
"0.7622822",
"0.74702895",
"0.7423229",
"0.72802716",
"0.7247355",
"0.7229361",
"0.7214754",
"0.71739393",
"0.71480405",
"0.7147519",
"0.7125705",
"0.7103401",
"0.7102967",
"0.7101574",
"0.7100971",
"0.7092242",
"0.70858425",
"0.7080488",
"0.7069559",
"0.7055555"... | 0.80402327 | 0 |
Test Create Event page load | def test_create_event_load(self):
res = self.client.get('/create-event')
data = res.data.decode('utf-8')
assert res.status == '200 OK'
assert 'Create Event' in data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_event(self):\n self.driver.get(f'{self.base_url}/event')\n\n enter_event_name = WebDriverWait(self.driver, 20).until(expected_conditions.presence_of_element_located((By.NAME, 'eventName')))\n enter_event_name.send_keys(self.random_string)\n\n # self.driver.find_element_by_xpa... | [
"0.7078409",
"0.69474506",
"0.6541802",
"0.64792424",
"0.6424573",
"0.63934857",
"0.6385465",
"0.632545",
"0.6267737",
"0.62280506",
"0.62194765",
"0.61965585",
"0.6196447",
"0.6164848",
"0.6157423",
"0.60995895",
"0.60610837",
"0.6017669",
"0.6004318",
"0.60042185",
"0.59545... | 0.741547 | 0 |
Test event edit functionality | def test_edit_event(self):
event = mongo.db.events.find_one()
ids = event.get('_id')
res = self.client.post('/edit-event/{}'.format(ids),
follow_redirects=True, data=dict(
event_type='Club Hosted Event',
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_edit_event(self):\n self.login()\n # Create event\n fakeName = fake.text()[0:100]\n date = datetime.now()\n self.create_event(fakeName, date)\n time.sleep(2)\n\n self.driver.get(self.live_server_url)\n self.assertEqual(self.live_server_url + \"/\",\n... | [
"0.7509319",
"0.742014",
"0.7296443",
"0.71822375",
"0.7064891",
"0.69753647",
"0.6967993",
"0.6877685",
"0.6874774",
"0.68603617",
"0.67939603",
"0.6783043",
"0.6764588",
"0.6747904",
"0.6705685",
"0.67033654",
"0.669343",
"0.669063",
"0.664353",
"0.6632315",
"0.66153276",
... | 0.7794233 | 0 |
Generate second derivative of the Lengendre polynomials of order n recursivley P"(0,X) = 0 P"(1,X) = 0 P"(N,X) = ( (2N1)(2P'(N1,X)+XP"(N1,X)(N1)P'(N2,X) ) / N | def ddL(n):
if (n==0):
return lambda x: 0.0
elif (n==1):
return lambda x: 0.0
else:
# approximate by fitting polynomial and taking derivatives
c_om1 = coef_approximation(L(n), n)
c_prime = polynomial_derivative(c_om1)
c_double_prime = polynomial_derivative(c_prime)
# [TODO]: fix own method from Hw... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dL(n):\n\n\t#[TODO]: allow evaluation at 0\n\tif (n==0):\n\t\treturn lambda x: 0.0\n\n\telif (n==1):\n\t\treturn lambda x: 1.0\n\n\telse:\n\t\treturn lambda x: (n/(x**2-1.0))*(x*L(n)(x)-L(n-1)(x))",
"def compute_deriv(poly):\n derivative_of_poly = []\n for i in range(1, len(poly)):\n power = i\n... | [
"0.6483024",
"0.64090174",
"0.6364489",
"0.62934566",
"0.62353987",
"0.61637276",
"0.60919505",
"0.6084369",
"0.60772884",
"0.6057502",
"0.60458857",
"0.6025057",
"0.6008195",
"0.5991168",
"0.596904",
"0.59511256",
"0.5872074",
"0.5842978",
"0.58157027",
"0.576626",
"0.574864... | 0.68769693 | 0 |
Find weights for the lobatto polynomial of given order on the unit interval [1, 1]. Ai = 2 / [ (1 xi^2) (p'n+1(xi))^2 ] Gauss Legendre Weights wi = 2/(n(n1) Pn1(xi)^2) | def unit_lobatto_weights_and_nodes(order):
# find roots of legendre polynomial on unit interval
nodes = unit_lobatto_nodes(order)
# calculate weights for unit interval
# wi = 2/(n(n-1) * Pn-1(xi)^2)
weights = 2.0/( (order*(order-1)) * L(order-1)(nodes)**2 )
return weights, nodes | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def polyFunction(x,weights):\n y=0\n for i in range (0,len(weights)):\n y+= weights[i]*(x**i)\n return y",
"def definePolyFunction():\n lstWeights=[]\n degree = input(\"degree of polynomial in terms of highest exponent of x:\")\n degree = int(degree+1)\n for a in range (0,degree):\n ... | [
"0.62402517",
"0.6151592",
"0.6117073",
"0.6046306",
"0.58369356",
"0.5816266",
"0.58156705",
"0.5696495",
"0.56030405",
"0.5600582",
"0.556135",
"0.55503976",
"0.5547936",
"0.5531686",
"0.5523763",
"0.5478577",
"0.5475781",
"0.54577297",
"0.54518116",
"0.54295766",
"0.542630... | 0.75627387 | 0 |
Given unit weights and nodes on interval [1,1] map to interval [a,b]. | def project_weights_and_nodes(a, b, unit_weights, unit_nodes):
# project onto interval [a,b]
nodes = 0.5*(b-a)*unit_nodes + 0.5*(a+b)
weights = 0.5*(b-a)*unit_weights
return weights, nodes | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unit_lobatto_weights_and_nodes(order):\n\n\t# find roots of legendre polynomial on unit interval\n\tnodes = unit_lobatto_nodes(order)\n\n\t# calculate weights for unit interval\n\t# wi = 2/(n(n-1) * Pn-1(xi)^2)\n\tweights = 2.0/( (order*(order-1)) * L(order-1)(nodes)**2 )\n\n\treturn weights, nodes",
"def r... | [
"0.6281771",
"0.6180618",
"0.60219276",
"0.58451176",
"0.58372337",
"0.56553286",
"0.5647442",
"0.54421324",
"0.5433425",
"0.543125",
"0.5386971",
"0.5356544",
"0.5266298",
"0.5244842",
"0.5237848",
"0.5223894",
"0.5214987",
"0.5203038",
"0.5194137",
"0.5187337",
"0.51733667"... | 0.80120486 | 0 |
fix bed format errors, simple bed3, bed6 format 1. chromStart < chromEnd, int | def bed_fix(bed):
if isinstance(bed, list) and len(bed) >= 6:
chrom, chromStart, chromEnd, name, score, strand = bed[:6]
chromStart, chromEnd = coord_valid(chromStart, chromEnd)
if len(name) > 40:
name = name[0:40] # maximum width: 40
if re.fullmatch('-?\d+(\.0+)?', score... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bed_to_glitr(in_bed, out_starts):\n with open(in_bed) as infile:\n with open(out_starts, 'w') as outfile:\n for chrom, start, stop, strand in readBedLines(infile):\n outfile.write('\\t'.join([chrom, str(start), strand]) + '\\n')",
"def bed_str(self, chrom, strand):\n ... | [
"0.5562089",
"0.5452004",
"0.534478",
"0.53408194",
"0.5208701",
"0.5184666",
"0.5161096",
"0.5089227",
"0.5062045",
"0.5040209",
"0.5027099",
"0.4945829",
"0.48722935",
"0.486818",
"0.48571175",
"0.48380995",
"0.4821464",
"0.48154652",
"0.4812605",
"0.48090613",
"0.4798277",... | 0.65326 | 0 |
Return the metamodel dependency this model dependency conforms to. This could raise a ValueError if there are more than one or no metamodel dependency.This should not occur unless the metamodels are not built with care. | def metamodelDependency(self) -> MetamodelDependency:
# could raise a ValueError, but should not
from modelscript.megamodels import Megamodel
return Megamodel.metamodelDependency(
source=self.sourceModel.metamodel,
target=self.targetModel.metamodel) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def metamodelDependency(cls, source, target):\n # type: (Metamodel, Metamodel) -> MetamodelDependency\n ds = cls.metamodelDependencies(source=source, target=target)\n if (len(ds) == 0):\n raise ValueError(\n 'Invalid dependency between %s'\n ' metamodel... | [
"0.7645835",
"0.58155316",
"0.56247795",
"0.5610696",
"0.5593037",
"0.5487391",
"0.54566336",
"0.54331094",
"0.535464",
"0.5342194",
"0.53180796",
"0.5298061",
"0.52505153",
"0.5232853",
"0.5204617",
"0.5194758",
"0.5167176",
"0.5154645",
"0.51440907",
"0.5140649",
"0.513964"... | 0.81550616 | 0 |
This callback takes the 'active_tab' property as input, and renders the associated graph with the tab name on page 1. | def render_tab_content(active_tab):
if active_tab is not None:
if active_tab == "Info":
return html.Div([html.P('We will remember coronavirus for a long time as our society got affected worldwide adapting to a new normal. It was a global pandemic causing transformations to the daily life. The... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render_tab_content(active_tab):\n if active_tab is not None:\n if active_tab == \"graph1\":\n return dcc.Graph(figure=example_graph1, id='graph')\n elif active_tab == \"graph2\":\n return dcc.Graph(figure=example_graph2, id='graph')\n elif active_tab == \"graph3\":... | [
"0.7178829",
"0.61400294",
"0.5957339",
"0.5912146",
"0.5634638",
"0.5634638",
"0.5544952",
"0.5368222",
"0.5354222",
"0.5352418",
"0.52777565",
"0.52389956",
"0.52202475",
"0.5184347",
"0.5163877",
"0.5155045",
"0.51503795",
"0.5150326",
"0.5106969",
"0.5074858",
"0.50545067... | 0.6685756 | 1 |
This callback takes in page2buttons selected value and returns content to display in selectedbutton | def button_choice(value):
return 'You have selected "{}"'.format(value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clickMe():\r\n global Format\r\n Format = typeToChoose.get()\r\n print(Format)\r\n action.configure(text='selected ' + Format) # show the selected item after clicked\r\n action.configure(state='disabled') # button disabled after clicked\r",
"def OnButt... | [
"0.61198336",
"0.61137295",
"0.61010796",
"0.5993279",
"0.59686697",
"0.5852285",
"0.5759832",
"0.573023",
"0.56591195",
"0.5650327",
"0.56135285",
"0.55811036",
"0.5573263",
"0.55661714",
"0.5554369",
"0.55432415",
"0.55432415",
"0.55297554",
"0.5525453",
"0.55017567",
"0.54... | 0.6444269 | 0 |
Make substitution to element at index, augmenting name map if the element is not already in the map. | def fix_name(row, index, name_map):
# print("Input row: {}".format(row))
name = row[index].strip()
# print("Name entry is {}".format(name))
if name.endswith(" (yourself)"):
name = name[:-len(" (yourself)")]
# print("Shortening to |{}|".format(name))
if name not in name_map:
name_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_name(name, mapping): \n words = name.split()\n for w in range(len(words)):\n if words[w] in mapping:\n #print words[w]\n words[w] = mapping[words[w]]\n name = \" \".join(words)\n return name",
"def update_name(name, mapping):\n m = street_type_re.search... | [
"0.6238279",
"0.60043",
"0.58511156",
"0.58350646",
"0.58261216",
"0.5794092",
"0.5793603",
"0.5655385",
"0.55565214",
"0.55487823",
"0.5500318",
"0.54947186",
"0.5464672",
"0.5444878",
"0.5433744",
"0.5419656",
"0.5396861",
"0.5376777",
"0.5313509",
"0.5310736",
"0.5298401",... | 0.61248034 | 1 |
Returns modified GME file as a list of rows; also updates name_map | def clean_names(gme_file_path, name_map):
gmes = [ ]
with open(gme_file_path, newline="") as csvfile:
reader = csv.reader(csvfile)
for row in reader:
if row[0] == "date":
# Header row, skip
pass
else:
fix_name(row, rater_na... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mel_gff_list():\n\tmod_gff3 = sys.argv[1]\n\twith open(mod_gff3, 'r') as f:\n\t\tgff = [line.strip().split('\\t') for line in f]\n\t\tf.close()\n\treturn gff\n\t#gff_list ex/:\n\t#['2L', 'FlyBase', 'gene', '7529', '9484', '.', '+', '.', 'ID=FBgn0031208;Name=CG11023;Ontology_term=SO:0000010,SO:0000087,GO:001692... | [
"0.5840434",
"0.5830444",
"0.58051616",
"0.5585324",
"0.55281264",
"0.5497307",
"0.5435611",
"0.54321355",
"0.5424603",
"0.5416705",
"0.539461",
"0.53144455",
"0.5285358",
"0.52719176",
"0.5228661",
"0.5223331",
"0.5205004",
"0.520172",
"0.5184211",
"0.51828927",
"0.5179186",... | 0.6697693 | 0 |
Write the modified gmes to a CSV file | def rewrite_gmes(gme_file_path, gmes):
with open(gme_file_path, 'w', newline="") as csvfile:
writer = csv.writer(csvfile)
for row in gmes:
writer.writerow(row)
return | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write(self, args):\n\t\tnewcsvfile = self.filename[:len(self.filename)-4] + \"NEW.csv\" #clever naming MIGHT NEED TO CHANGE THIS LATER/OVERWRITE OLD FILE?\n\t\twith open(newcsvfile, 'wb') as f:\n\t\t\twriter = csv.writer(f)\n\t\t\twriter.writerows(self.all_likes)",
"def write_to_csv(self, data):\n wit... | [
"0.7120693",
"0.69695747",
"0.6880533",
"0.6819143",
"0.6809741",
"0.6782455",
"0.6753334",
"0.67477185",
"0.67143416",
"0.6666509",
"0.66608304",
"0.663023",
"0.66189295",
"0.66149265",
"0.66142803",
"0.6582355",
"0.65476865",
"0.65290415",
"0.6516749",
"0.648296",
"0.645796... | 0.8078012 | 0 |
Construct an obstacle list of proximal objects given vehicle_transform. | def build_obstacle_list(self, vehicle_transform, prediction_msg):
obstacle_list = []
# look over all predictions
for prediction in prediction_msg.predictions:
# use all prediction times as potential obstacles
previous_origin = None
for transform in prediction.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _find_obstacle(self, obstacle_type='*traffic_light*'): \r\n obst = list()\r\n \r\n _actors = self._world.get_actors()\r\n _obstacles = _actors.filter(obstacle_type)\r\n\r\n\r\n for _obstacle in _obstacles:\r\n trigger = _obstacle.trigger_volume\r\n\r\n ... | [
"0.56552035",
"0.5358925",
"0.5337781",
"0.5281724",
"0.5277752",
"0.5247164",
"0.5237319",
"0.51197946",
"0.50525624",
"0.50198406",
"0.49950153",
"0.49788874",
"0.49575853",
"0.4950962",
"0.4945567",
"0.4891531",
"0.48911673",
"0.48862293",
"0.48748988",
"0.48602277",
"0.48... | 0.7395267 | 0 |
Gets the max timestamp that was set during the latest merge. | def get_max_ingest_timestamp(self):
get_last_max_ts_config = bigquery.QueryJobConfig()
get_last_max_ts_config.use_legacy_sql = False
get_last_max_timestamp_query = self.bq_client.query(
query='SELECT max(ingestTimestamp) as max_ingest_timestamp '
'FROM `{0:s}.{1:s}.{2:s}`... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max_time(self):\n return self._ll_tree_sequence.get_max_time()",
"def last_timestamp(self):\n return self._last_timestamp",
"def last_timestamp(self):\n LOGGER.debug('Getting last_timestamp as: %s', self._last_timestamp)\n return self._last_timestamp",
"def max(self):\n\n r... | [
"0.7324069",
"0.72471076",
"0.7213113",
"0.71249187",
"0.70386344",
"0.69946057",
"0.69175625",
"0.67901427",
"0.67749435",
"0.6734356",
"0.6730179",
"0.6711431",
"0.6706463",
"0.66920155",
"0.66324604",
"0.6624491",
"0.66190374",
"0.6587741",
"0.65800637",
"0.6567245",
"0.65... | 0.75948834 | 0 |
Gathers updates to a temp table. | def gather_updates(self, gather_updates_query):
logging.info(
'{0:s} Gathering updates and writing to temp table.'.format(
str(datetime.datetime.now())))
max_ingest_timestamp = self.get_max_ingest_timestamp()
temp_updates_table_ref = self.dataset_ref.table(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def callUpdateTable(self):\r\n self.updateTable()",
"def update_out_temp(self):\n\t\tpass # Constant for now",
"def updateTempSensorValues(self):\n # Look through each temperature sensor\n for hw_sensor in self.t_sensors:\n # Grab the serial number for the sensor\n tr... | [
"0.59615934",
"0.58289903",
"0.55772805",
"0.5571853",
"0.54725814",
"0.5410827",
"0.5387089",
"0.53666174",
"0.5327981",
"0.53238636",
"0.5271738",
"0.5230418",
"0.5229809",
"0.52263343",
"0.52177465",
"0.5217567",
"0.521294",
"0.51995075",
"0.5175148",
"0.51695067",
"0.5163... | 0.6226153 | 0 |
search(q, start = 0, num = 10) > generator Do google web search. | def search(self, q, start = 0, num = 10):
url = 'http://www.google.com/xhtml?'
query = urllib.urlencode({'q':q, 'start':start, 'num':num})
result = self.get(url + query)
content = result.read()
tokens = re.findall(
'<a\s+accesskey="\d+"\s+href="(.*?)"\s*>(.*?)</a>(.*?)<span class="c2">',
content)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search_google(query, num_results=1):\n\n results = []\n num_ppg = min([num_results, 10])\n for i in search(\n query, # The query you want to run\n tld=\"com\", # The top level domain\n lang=\"en\", # The language\n num=num_ppg, # Number of results per page\n star... | [
"0.73638535",
"0.71525663",
"0.6740497",
"0.66138023",
"0.6475366",
"0.6365151",
"0.6348128",
"0.633933",
"0.6298817",
"0.6266946",
"0.6263116",
"0.6223394",
"0.6197527",
"0.6183103",
"0.61520183",
"0.61432964",
"0.6076785",
"0.60717386",
"0.6049212",
"0.6024784",
"0.5960969"... | 0.77862144 | 0 |
crawl(q, depth = 0) > generator Do google web crawl. | def crawl(self, q, depth = 0):
index = 1
last_results = None
while True:
if index == 1:
start = 0
else:
start = (index - 1) * 10
try:
results = self.search(q, start, 10)
except: continue
if not results:
break
if last_results == results:
break
last_results = results... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search(self, query):\n opener = urllib2.build_opener()\n opener.addheaders = self.DEFAULT_HEADERS\n response = opener.open(self.SEARCH_URL + \"?q=\"+ urllib2.quote(query) + \"&hl=\" + \"en\")\n opener.close()\n\n mybytes = response.read()\n mystr = mybytes.decode(\"utf... | [
"0.5895122",
"0.58275014",
"0.5771042",
"0.57705826",
"0.5760762",
"0.57444745",
"0.57162917",
"0.5637397",
"0.5613811",
"0.55855244",
"0.55816865",
"0.55754757",
"0.5565192",
"0.5558121",
"0.5551372",
"0.5453599",
"0.541219",
"0.5407984",
"0.5393511",
"0.53791976",
"0.537085... | 0.6945578 | 0 |
return all disk object list from hba and chipset. | def get_all_disk():
disks = []
disks_lines = linux.exe_shell("lsblk -o NAME,VENDOR|grep -P '^sd.*[A-Z]'")
for line in disks_lines.splitlines():
disk_t = line.split()
if len(disk_t) > 1 and "LSI" not in disk_t[1]:
disks.append(disk_t[0])
ds = []
for i in disks:
d_t = DiskFromLsiSas3("", i)
d_t.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_all_disks():\n return DISKS_API.get(abs_link=False)",
"def get_ceph_disk():\n disks = []\n for srv in get_srv_list():\n cfg = get_srv_config(srv)\n for key in ['osd_data', 'osd_journal', 'mds_data', 'mon_data']:\n mnt_point = cfg[key]\n disk = get_disk_by_moun... | [
"0.6937561",
"0.68555814",
"0.6534132",
"0.65330964",
"0.647376",
"0.6414962",
"0.6329",
"0.63246197",
"0.6297751",
"0.62465906",
"0.6193684",
"0.6181737",
"0.6153161",
"0.60684943",
"0.60590905",
"0.6034656",
"0.6018533",
"0.6006882",
"0.5985379",
"0.5955427",
"0.59448415",
... | 0.7452175 | 0 |
return True if smart info of disk_oj has error, else return False | def __if_smart_err(disk_oj):
if "SAS" in disk_oj.smart:
if int(disk_oj.smart_attr["channel0Error"]["Invalid DWORD count"]) > 0 or \
int(disk_oj.smart_attr["channel0Error"]["Running disparity error count"]) > 0 or \
int(disk_oj.smart_attr["channel0Error"]["Loss of DWORD synchronization"]) > 0 or \
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_mounted(self):\n try:\n _ = openmediavault.subprocess.check_output(\n [\n 'findmnt',\n '--canonicalize',\n '--first-only',\n '--noheadings',\n '--raw',\n '--nofs... | [
"0.6809113",
"0.6798887",
"0.6446254",
"0.63360596",
"0.6037574",
"0.6007787",
"0.59618545",
"0.5876024",
"0.5861284",
"0.5857378",
"0.5802325",
"0.57920265",
"0.57753253",
"0.5770162",
"0.5758878",
"0.57519037",
"0.5748554",
"0.574288",
"0.5731437",
"0.57168806",
"0.5686667"... | 0.7779912 | 0 |
return sas and sata disk list witch start_stop_hours/count or data is over the limit | def get_over_agelimit_disks(disk_list):
over_sas_disk = []
over_sata_disk = []
for disk in disk_list:
if disk.type == "SAS":
if int(disk.age["start_stop_count"]) > SAS_LIMIT_COUNT or float(disk.age["data_gb"]) > SAS_LIMIT_GB:
over_sas_disk.append(disk)
if disk.type == "SATA":
if int(disk.age["s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _filterPhysicalDisks(self,data):\n\t\tvd = False\n\t\tif re.search(\"virtual.*disk\",\"\".join(data),re.I):\n\t\t\tvd = True\n\n\t\tindex = -1\n\t\tfor item in data:\n\t\t\tif re.search(\"Unconfigured.Physical.Disks\",item):\n\t\t\t\tindex = data.index(item)\n\t\t\t\tbreak\n\t\telse:\n\t\t\tno_config = self.se... | [
"0.55623966",
"0.537125",
"0.5363509",
"0.5348289",
"0.52951854",
"0.52652514",
"0.52586335",
"0.525321",
"0.52461314",
"0.52229965",
"0.52228165",
"0.5177484",
"0.51567703",
"0.5147077",
"0.51429915",
"0.51351386",
"0.51348126",
"0.5109303",
"0.50951475",
"0.5072797",
"0.506... | 0.62552375 | 0 |
get_overage_disks function's json model | def get_overage_disks_json(disk_list):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getObjDisks(name, get_href=True, is_template=False):\n response = get_disk_attachments(\n name, 'template' if is_template else 'vm', get_href\n )\n if get_href:\n return response\n return get_disk_list_from_disk_attachments(response)",
"def list_disks(self, instance_name):\n ... | [
"0.6238214",
"0.6230407",
"0.6145006",
"0.6046552",
"0.57312244",
"0.5707928",
"0.5625934",
"0.5615898",
"0.5575543",
"0.55730367",
"0.5541527",
"0.55307865",
"0.55225307",
"0.550305",
"0.5500882",
"0.5483429",
"0.5456083",
"0.5448192",
"0.5419707",
"0.5385917",
"0.5376728",
... | 0.8156021 | 0 |
return disk dict has error | def get_err_disk_dict():
err_disk_dict = {}
disks = Disk.get_all_disk()
for i in disks:
if Disk.__if_smart_err(i):
struct = {
"dev": i.dev_name,
"model": i.model,
"fw": i.fw,
"SN": i.sn,
"type": i.type,
"vendor": i.vendor,
"smart": i.smart_attr,
"hctl": i.hctl,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_update_volume_stats_error(self):\n self._fail_host_storage = True\n actual = self.driver.get_volume_stats(True)\n self.assertEqual('HGST', actual['vendor_name'])\n self.assertEqual('hgst', actual['storage_protocol'])\n self.assertEqual('unknown', actual['total_capacity_g... | [
"0.6109273",
"0.6029441",
"0.57736325",
"0.5756884",
"0.5747644",
"0.574022",
"0.57063735",
"0.57063735",
"0.5670395",
"0.5631981",
"0.56113243",
"0.5526723",
"0.55123705",
"0.5498835",
"0.5485141",
"0.5480538",
"0.5476723",
"0.5447829",
"0.54433423",
"0.54395986",
"0.5435072... | 0.74851125 | 0 |
return ssd wearout status dict | def get_wearout_ssd_status():
disks = Disk.get_all_disk()
ssd_status = {}
for i in disks:
tmp = i.get_wearout_status()
# tmp[0] is dev_name, tmp[1] is wearout %
if tmp is not None:
ssd_status[tmp[0]] = tmp[1]
if len(ssd_status) == 0:
return None
return ssd_status | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def status() -> Dict[str, Any]:",
"def _do_status(self) -> Dict[str, Any]:\n return {}",
"def _do_status(self) -> Dict[str, Any]:\n return {}",
"def status(self):\n now = int(time())\n return {\n 'smrt': {\n 'smrt_version': '1.0.0',\n 'app_... | [
"0.63643354",
"0.62789065",
"0.62789065",
"0.62420875",
"0.6181757",
"0.6124469",
"0.6024772",
"0.59104645",
"0.5901134",
"0.589251",
"0.5885941",
"0.5884911",
"0.58058184",
"0.573894",
"0.565318",
"0.56411994",
"0.56019825",
"0.55880773",
"0.5568756",
"0.55574155",
"0.553401... | 0.7094716 | 0 |
Delete option with duration | def __init__(__self__, *,
duration: pulumi.Input[str],
object_type: pulumi.Input[str]):
pulumi.set(__self__, "duration", duration)
pulumi.set(__self__, "object_type", 'AbsoluteDeleteOption') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(__self__, *,\n duration: str,\n object_type: str):\n pulumi.set(__self__, \"duration\", duration)\n pulumi.set(__self__, \"object_type\", 'AbsoluteDeleteOption')",
"def deleteOrDelay(self):\n self.delete()",
"async def deleteafter(self, ctx, tim... | [
"0.6515591",
"0.64059025",
"0.6152188",
"0.5992763",
"0.59332246",
"0.59332246",
"0.59232074",
"0.57482237",
"0.5744008",
"0.5709613",
"0.56832904",
"0.56574976",
"0.56281066",
"0.56169325",
"0.5592618",
"0.5566542",
"0.55351007",
"0.5530143",
"0.55093414",
"0.5500347",
"0.54... | 0.66098523 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.