query stringlengths 9 3.4k | document stringlengths 9 87.4k | metadata dict | negatives listlengths 4 101 | negative_scores listlengths 4 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Perform a bitwise not op with a bit size < 1 byte. | def test_bit_not_small_bit_size(self):
ops = [bitwise_operations.bit_not(self.five_255_bin, 5, 3, None)]
self.as_connection.operate(self.test_key, ops)
_, _, bins = self.as_connection.get(self.test_key)
expected_result = bytearray([248] + [255] * 4)
assert bins[self.five_255_bi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bitwise_not(data):\n return _make.bitwise_not(data)",
"def test_bit_not_bit_size_too_large(self):\n ops = [bitwise_operations.bit_not(self.five_255_bin, 0, 41, None)]\n\n with pytest.raises(e.OpNotApplicable):\n self.as_connection.operate(self.test_key, ops)",
"def bitwise_not(s... | [
"0.8016902",
"0.7274832",
"0.7223049",
"0.71927834",
"0.71571875",
"0.6743562",
"0.6564801",
"0.6546381",
"0.6545397",
"0.64084345",
"0.63974786",
"0.6395954",
"0.63715124",
"0.6363555",
"0.63291365",
"0.62612635",
"0.62440753",
"0.62283516",
"0.6187479",
"0.6150215",
"0.6096... | 0.69887877 | 5 |
Perform a bitwise not op with a bit_offset outside the bitmap being modified. | def test_bit_not_offset_out_of_range(self):
ops = [bitwise_operations.bit_not(self.five_255_bin, 41, 8, None)]
with pytest.raises(e.OpNotApplicable):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bitwise_not(data):\n return _make.bitwise_not(data)",
"def bitwise_not(self) -> ColumnOperators:\n\n return self.operate(bitwise_not_op)",
"def test_bit_not(self):\n ops = [bitwise_operations.bit_not(self.five_255_bin, 0, 40, None)]\n\n self.as_connection.operate(self.test_key, ops)... | [
"0.74823546",
"0.6964996",
"0.6755713",
"0.66801834",
"0.64724386",
"0.6463088",
"0.64555913",
"0.6405989",
"0.6384692",
"0.6381951",
"0.6373578",
"0.63649803",
"0.63099575",
"0.6218361",
"0.6063737",
"0.60232586",
"0.6011438",
"0.5980012",
"0.596996",
"0.59055775",
"0.589176... | 0.69286186 | 2 |
Perform a bitwise not op with a bit_size > bitmap. | def test_bit_not_bit_size_too_large(self):
ops = [bitwise_operations.bit_not(self.five_255_bin, 0, 41, None)]
with pytest.raises(e.OpNotApplicable):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bitwise_not(data):\n return _make.bitwise_not(data)",
"def NOT(bmp):\n\n maxX, maxY = size = bmp.size()\n result = bitmap(size)\n for x in range(maxX):\n for y in range(maxY):\n result.set(x,y, not bmp.get(x,y))\n return result",
"def test_bit_not_small_bit_size(self):\n ... | [
"0.7226076",
"0.72110623",
"0.70213264",
"0.7011794",
"0.6715211",
"0.6617093",
"0.62654257",
"0.62304515",
"0.62099355",
"0.6074832",
"0.60745364",
"0.6057515",
"0.605546",
"0.6027605",
"0.59840214",
"0.58479655",
"0.5844934",
"0.5838357",
"0.5771804",
"0.57580274",
"0.56813... | 0.7249606 | 0 |
Perform a bitwise not op with a bit_size > bitmap. | def test_bit_not_bad_bin_name(self):
ops = [bitwise_operations.bit_not("bad_name", 0, 8, None)]
with pytest.raises(e.BinNotFound):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_not_bit_size_too_large(self):\n ops = [bitwise_operations.bit_not(self.five_255_bin, 0, 41, None)]\n\n with pytest.raises(e.OpNotApplicable):\n self.as_connection.operate(self.test_key, ops)",
"def bitwise_not(data):\n return _make.bitwise_not(data)",
"def NOT(bmp):\n\n... | [
"0.7249606",
"0.7226076",
"0.72110623",
"0.70213264",
"0.7011794",
"0.6715211",
"0.6617093",
"0.62654257",
"0.62304515",
"0.62099355",
"0.6074832",
"0.60745364",
"0.6057515",
"0.605546",
"0.6027605",
"0.59840214",
"0.58479655",
"0.5844934",
"0.5838357",
"0.5771804",
"0.575802... | 0.4893494 | 99 |
Perform a bitwise not op with a float for bit_offset. | def test_bit_not_bad_arg(self):
ops = [bitwise_operations.bit_not(self.five_255_bin, 2.7, 8, None)]
with pytest.raises(e.ParamError):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bitwise_not(data):\n return _make.bitwise_not(data)",
"def logical_not(x, f=None):\n return _cur_framework(x, f=f).logical_not(x)",
"def bitwise_not(self) -> ColumnOperators:\n\n return self.operate(bitwise_not_op)",
"def _logical_not(x):\n x_ = _static_value(x)\n if x_ is None:\n retur... | [
"0.6835018",
"0.66702706",
"0.64162046",
"0.6341217",
"0.6281908",
"0.62469065",
"0.6207816",
"0.6173857",
"0.61586845",
"0.6145538",
"0.6126697",
"0.5953471",
"0.59113646",
"0.5872796",
"0.5871931",
"0.5819127",
"0.5803318",
"0.5704828",
"0.5640363",
"0.56370187",
"0.5607316... | 0.5801283 | 17 |
Perform a bitwise or op. | def test_bit_or(self):
value = bytearray()
value.append(8)
ops = [bitwise_operations.bit_or(self.test_bin_ones, 0, 8, 1, value, None)]
self.as_connection.operate(self.test_key, ops)
_, _, bins = self.as_connection.get(self.test_key)
expected_result = bytearray([9] * 1 +... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bitwise_or(lhs, rhs):\n return _make.bitwise_or(lhs, rhs)",
"def bitwise_or(self):\n register = self.return_middle_registers(self.opcode)\n self.registers[register[0]] = (\n self.registers[register[0]] | self.registers[register[1]])\n logger.info(\"Bitwise OR on V{} and V{}... | [
"0.8288428",
"0.79808706",
"0.77977544",
"0.77902883",
"0.7632203",
"0.7562827",
"0.7559482",
"0.738967",
"0.73569524",
"0.73475283",
"0.7305373",
"0.73049253",
"0.7294768",
"0.72477716",
"0.7220024",
"0.7195785",
"0.7126033",
"0.7066201",
"0.70294964",
"0.701288",
"0.6968752... | 0.7260251 | 13 |
Perform a bitwise or op on multiple bytes. | def test_bit_or_multiple_bytes(self):
value = bytearray([8] * 5)
ops = [bitwise_operations.bit_or(self.test_bin_ones, 0, 40, 5, value, None)]
self.as_connection.operate(self.test_key, ops)
_, _, bins = self.as_connection.get(self.test_key)
expected_result = bytearray([9] * 5)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bitwise_or(self):\n register = self.return_middle_registers(self.opcode)\n self.registers[register[0]] = (\n self.registers[register[0]] | self.registers[register[1]])\n logger.info(\"Bitwise OR on V{} and V{} for {}\".format(\n register[0],\n register[1],\... | [
"0.7118076",
"0.6908915",
"0.68121326",
"0.67484117",
"0.6612568",
"0.64334434",
"0.63509226",
"0.62192816",
"0.61630046",
"0.61462665",
"0.6096318",
"0.60574114",
"0.6025009",
"0.6018953",
"0.5995515",
"0.5988682",
"0.59162784",
"0.5895464",
"0.58875316",
"0.586352",
"0.5814... | 0.7336967 | 0 |
Perform a bitwise or op. | def test_bit_or_multiple_bytes_value_unchanged(self):
value = bytearray([255])
ops = [bitwise_operations.bit_or(self.five_255_bin, 7, 8, 1, value, None)]
self.as_connection.operate(self.test_key, ops)
_, _, bins = self.as_connection.get(self.test_key)
expected_result = bytearra... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bitwise_or(lhs, rhs):\n return _make.bitwise_or(lhs, rhs)",
"def bitwise_or(self):\n register = self.return_middle_registers(self.opcode)\n self.registers[register[0]] = (\n self.registers[register[0]] | self.registers[register[1]])\n logger.info(\"Bitwise OR on V{} and V{}... | [
"0.8288428",
"0.79808706",
"0.77977544",
"0.77902883",
"0.7632203",
"0.7562827",
"0.7559482",
"0.738967",
"0.73569524",
"0.73475283",
"0.7305373",
"0.73049253",
"0.7294768",
"0.7260251",
"0.72477716",
"0.7220024",
"0.7195785",
"0.7126033",
"0.7066201",
"0.70294964",
"0.701288... | 0.0 | -1 |
Perform a bitwise or op with bit_offset > bitmap. | def test_bit_or_bit_offset_out_of_range(self):
value = bytearray()
value.append(8)
ops = [bitwise_operations.bit_or(self.test_bin_ones, 41, 8, 1, value, None)]
with pytest.raises(e.OpNotApplicable):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_or(self):\n value = bytearray()\n value.append(8)\n ops = [bitwise_operations.bit_or(self.test_bin_ones, 0, 8, 1, value, None)]\n\n self.as_connection.operate(self.test_key, ops)\n\n _, _, bins = self.as_connection.get(self.test_key)\n expected_result = bytear... | [
"0.6729167",
"0.6678208",
"0.65645045",
"0.6495425",
"0.6474674",
"0.64089435",
"0.61538225",
"0.61365926",
"0.6038137",
"0.59736896",
"0.5905584",
"0.5881746",
"0.57951003",
"0.5723682",
"0.570876",
"0.5666415",
"0.56518066",
"0.5618289",
"0.55157775",
"0.54992855",
"0.54678... | 0.6939254 | 0 |
Perform a bitwise or op with bit_size > value. | def test_bit_or_bit_size_larger_than_value(self):
value = bytearray()
value.append(8)
ops = [bitwise_operations.bit_or(self.test_bin_ones, 0, 9, 1, value, None)]
with pytest.raises(e.InvalidRequest):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_or_bit_size_too_large(self):\n value = bytearray([8] * 6)\n ops = [bitwise_operations.bit_or(self.test_bin_ones, 0, 41, 6, value, None)]\n\n with pytest.raises(e.OpNotApplicable):\n self.as_connection.operate(self.test_key, ops)",
"def test_bit_or_bit_offset_out_of_ra... | [
"0.7268937",
"0.64769953",
"0.6328302",
"0.61380446",
"0.6119461",
"0.60546505",
"0.60256964",
"0.5878146",
"0.58711094",
"0.58374584",
"0.5796204",
"0.57682717",
"0.57471216",
"0.57353663",
"0.5596316",
"0.55628544",
"0.5561486",
"0.5496804",
"0.54590476",
"0.5422026",
"0.54... | 0.7830411 | 0 |
Perform a bitwise or op with bit_size > bitmap. | def test_bit_or_bit_size_too_large(self):
value = bytearray([8] * 6)
ops = [bitwise_operations.bit_or(self.test_bin_ones, 0, 41, 6, value, None)]
with pytest.raises(e.OpNotApplicable):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_or_bit_size_larger_than_value(self):\n value = bytearray()\n value.append(8)\n ops = [bitwise_operations.bit_or(self.test_bin_ones, 0, 9, 1, value, None)]\n\n with pytest.raises(e.InvalidRequest):\n self.as_connection.operate(self.test_key, ops)",
"def test_bit... | [
"0.6960213",
"0.66661066",
"0.65235865",
"0.64447516",
"0.6371661",
"0.6339229",
"0.6302238",
"0.6228568",
"0.6185054",
"0.58057094",
"0.5755791",
"0.5741155",
"0.57355267",
"0.56997937",
"0.56335616",
"0.5625084",
"0.56033003",
"0.5583323",
"0.5559221",
"0.5544787",
"0.54311... | 0.71554786 | 0 |
Perform a bitwise or op with a non existent bin. | def test_bit_or_bad_bin_name(self):
value = bytearray([8])
ops = [bitwise_operations.bit_or("bad_name", 0, 8, 1, value, None)]
with pytest.raises(e.BinNotFound):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_or(self):\n value = bytearray()\n value.append(8)\n ops = [bitwise_operations.bit_or(self.test_bin_ones, 0, 8, 1, value, None)]\n\n self.as_connection.operate(self.test_key, ops)\n\n _, _, bins = self.as_connection.get(self.test_key)\n expected_result = bytear... | [
"0.7058968",
"0.68445206",
"0.6766226",
"0.6755977",
"0.66884106",
"0.6688318",
"0.662055",
"0.6593961",
"0.6555172",
"0.65347177",
"0.64945513",
"0.6492931",
"0.6429049",
"0.6394153",
"0.63550234",
"0.6181719",
"0.61228025",
"0.61127645",
"0.6107482",
"0.60979706",
"0.608336... | 0.7370496 | 0 |
Perform a bitwise or op with an integer for value. | def test_bit_or_bad_arg(self):
value = 1
ops = [bitwise_operations.bit_or("bad_name", 0, 8, 1, value, None)]
with pytest.raises(e.ParamError):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __or__(self, other):\n\t\tif isinstance(other, int):\n\t\t\treturn self.value | other\n\t\telif type(self) is type(other):\n\t\t\treturn self.value | other.value",
"def bitwise_or(lhs, rhs):\n return _make.bitwise_or(lhs, rhs)",
"def __or__(self, other):\n return MyCustomNumber(self.value | other... | [
"0.7523105",
"0.68928385",
"0.6852939",
"0.6759527",
"0.66787887",
"0.6597283",
"0.65526557",
"0.6494191",
"0.64469886",
"0.63842696",
"0.6379319",
"0.6375721",
"0.63413054",
"0.6298505",
"0.621562",
"0.6188663",
"0.6132604",
"0.6081135",
"0.6042462",
"0.5995598",
"0.5984375"... | 0.62201685 | 14 |
Perform a bitwise rscan op. | def test_bit_rscan(self):
value = True
ops = [bitwise_operations.bit_rscan(self.count_bin, 32, 8, value)]
expected_value = 7
_, _, result = self.as_connection.operate(self.test_key, ops)
assert result[self.count_bin] == expected_value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_rscan_across_bytes(self):\n value = False\n ops = [bitwise_operations.bit_rscan(self.count_bin, 4, 8, value)]\n\n expected_value = 6\n _, _, result = self.as_connection.operate(self.test_key, ops)\n assert result[self.count_bin] == expected_value",
"def test_bit_rs... | [
"0.74822855",
"0.6734437",
"0.6538638",
"0.6246549",
"0.62174636",
"0.6194373",
"0.618414",
"0.607976",
"0.59486955",
"0.57588637",
"0.5621344",
"0.5594654",
"0.5458126",
"0.52684414",
"0.5247702",
"0.51422316",
"0.51344895",
"0.51321477",
"0.5124892",
"0.5113414",
"0.5090413... | 0.75062853 | 0 |
Perform a bitwise rscan op with an offset that causes the scan to search multiple bytes. | def test_bit_rscan_across_bytes(self):
value = False
ops = [bitwise_operations.bit_rscan(self.count_bin, 4, 8, value)]
expected_value = 6
_, _, result = self.as_connection.operate(self.test_key, ops)
assert result[self.count_bin] == expected_value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_rscan_offset_out_of_range(self):\n value = True\n ops = [bitwise_operations.bit_rscan(self.count_bin, 41, 8, value)]\n\n with pytest.raises(e.OpNotApplicable):\n self.as_connection.operate(self.test_key, ops)",
"def test_bit_rscan(self):\n value = True\n ... | [
"0.65359974",
"0.62749314",
"0.61366034",
"0.5726591",
"0.56616104",
"0.5530678",
"0.53169584",
"0.525473",
"0.52101773",
"0.51923454",
"0.5138028",
"0.51262224",
"0.5119742",
"0.5088162",
"0.5071134",
"0.5071134",
"0.5028353",
"0.49690193",
"0.4927765",
"0.49174833",
"0.4893... | 0.68539107 | 0 |
Perform a bitwise rscan op with an offset that causes the scan to search multiple bytes. | def test_bit_rscan_value_not_found(self):
value = False
ops = [bitwise_operations.bit_rscan(self.five_255_bin, 0, 40, value)]
expected_value = -1
_, _, result = self.as_connection.operate(self.test_key, ops)
assert result[self.five_255_bin] == expected_value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_rscan_across_bytes(self):\n value = False\n ops = [bitwise_operations.bit_rscan(self.count_bin, 4, 8, value)]\n\n expected_value = 6\n _, _, result = self.as_connection.operate(self.test_key, ops)\n assert result[self.count_bin] == expected_value",
"def test_bit_rs... | [
"0.68544704",
"0.65370834",
"0.627496",
"0.61362857",
"0.57260394",
"0.5660787",
"0.5533928",
"0.5315801",
"0.5253782",
"0.51921064",
"0.513603",
"0.5124937",
"0.5119677",
"0.5085345",
"0.50696814",
"0.50696814",
"0.5026898",
"0.49680832",
"0.4927054",
"0.49190137",
"0.489481... | 0.5210973 | 9 |
Perform a bitwise rscan op with bit_offset outside bitmap. | def test_bit_rscan_offset_out_of_range(self):
value = True
ops = [bitwise_operations.bit_rscan(self.count_bin, 41, 8, value)]
with pytest.raises(e.OpNotApplicable):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_rscan_across_bytes(self):\n value = False\n ops = [bitwise_operations.bit_rscan(self.count_bin, 4, 8, value)]\n\n expected_value = 6\n _, _, result = self.as_connection.operate(self.test_key, ops)\n assert result[self.count_bin] == expected_value",
"def test_bit_rs... | [
"0.67986",
"0.66038847",
"0.6403984",
"0.6318248",
"0.599119",
"0.5979703",
"0.54372746",
"0.5428746",
"0.53934145",
"0.5282545",
"0.5277166",
"0.51844627",
"0.5067494",
"0.5055215",
"0.4952921",
"0.49221352",
"0.4920336",
"0.48970672",
"0.4873152",
"0.48365533",
"0.47873604"... | 0.7030813 | 0 |
Perform a bitwise rscan op with bit_size larger than bitmap. | def test_bit_rscan_bit_size_too_large(self):
value = True
ops = [bitwise_operations.bit_rscan(self.test_bin_ones, 0, 41, value)]
with pytest.raises(e.OpNotApplicable):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_rscan_across_bytes(self):\n value = False\n ops = [bitwise_operations.bit_rscan(self.count_bin, 4, 8, value)]\n\n expected_value = 6\n _, _, result = self.as_connection.operate(self.test_key, ops)\n assert result[self.count_bin] == expected_value",
"def test_bit_rs... | [
"0.69535387",
"0.67778087",
"0.6079555",
"0.5970527",
"0.56409127",
"0.5558105",
"0.5542117",
"0.5486178",
"0.5464228",
"0.5384822",
"0.5123307",
"0.5029938",
"0.49641097",
"0.49303055",
"0.49159634",
"0.4879424",
"0.47828934",
"0.4773927",
"0.47594815",
"0.46685913",
"0.4661... | 0.73615736 | 0 |
Perform a bitwise rscan op with a non existent bin. | def test_bit_rscan_bad_bin_name(self):
value = True
ops = [bitwise_operations.bit_rscan("bad_name", 0, 8, value)]
expected_value = None
_, _, result = self.as_connection.operate(self.test_key, ops)
assert result["bad_name"] == expected_value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_rscan_across_bytes(self):\n value = False\n ops = [bitwise_operations.bit_rscan(self.count_bin, 4, 8, value)]\n\n expected_value = 6\n _, _, result = self.as_connection.operate(self.test_key, ops)\n assert result[self.count_bin] == expected_value",
"def test_bit_rs... | [
"0.7261481",
"0.72082704",
"0.7034685",
"0.6986966",
"0.68758494",
"0.61879885",
"0.60316986",
"0.60069513",
"0.5920498",
"0.5846148",
"0.5832056",
"0.57076246",
"0.5401789",
"0.5342819",
"0.5299882",
"0.5268165",
"0.5236106",
"0.5226257",
"0.5212469",
"0.51460004",
"0.509923... | 0.7060372 | 2 |
Perform a bitwise rshift op. | def test_bit_rshift(self):
ops = [bitwise_operations.bit_rshift(self.count_bin, 8, 8, 3, None)]
self.as_connection.operate(self.test_key, ops)
_, _, bins = self.as_connection.get(self.test_key)
expected_result = bytearray([1] * 1 + [10] * 1 + [86] * 1 + [255] * 1 + [3] * 1)
ass... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bitwise_rshift(self, other: Any) -> ColumnOperators:\n\n return self.operate(bitwise_rshift_op, other)",
"def test_rshift():\n value = 42\n num_a = param.Integer(value=value)\n assert num_a.value == value\n\n new_value = operator.rshift(value, 1)\n num_a.value >>= 1\... | [
"0.810491",
"0.7768511",
"0.7738266",
"0.7697016",
"0.75073284",
"0.7475046",
"0.7341795",
"0.7313474",
"0.7258233",
"0.7258233",
"0.7221981",
"0.711292",
"0.7078737",
"0.70613086",
"0.6942691",
"0.68833375",
"0.687751",
"0.6842917",
"0.6815135",
"0.68089026",
"0.67682934",
... | 0.72645825 | 8 |
Perform a bitwise rshift op with bit_offset causing the op to cross bytes. | def test_bit_rshift_across_bytes(self):
ops = [bitwise_operations.bit_rshift(self.test_bin_ones, 4, 16, 3, None)]
self.as_connection.operate(self.test_key, ops)
_, _, bins = self.as_connection.get(self.test_key)
expected_result = bytearray([0] + [32] + [33] + [1] * 2)
assert bi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bitwise_rshift(self, other: Any) -> ColumnOperators:\n\n return self.operate(bitwise_rshift_op, other)",
"def test_bit_rshift_offset_out_of_range(self):\n ops = [bitwise_operations.bit_rshift(self.test_bin_ones, 41, 8, 1, None)]\n\n with pytest.raises(e.OpNotApplicable):\n sel... | [
"0.7244314",
"0.7154679",
"0.7113184",
"0.70583224",
"0.70583224",
"0.6990083",
"0.698848",
"0.6960102",
"0.692946",
"0.6912611",
"0.69054914",
"0.67830527",
"0.6759512",
"0.675112",
"0.67480206",
"0.6669106",
"0.66167897",
"0.6611077",
"0.6480847",
"0.6463618",
"0.64371794",... | 0.70983434 | 3 |
Perform a bitwise rshift op with shift > 1 byte. | def test_bit_rshift_wrap(self):
ops = [bitwise_operations.bit_rshift(self.test_bin_ones, 0, 40, 8, None)]
self.as_connection.operate(self.test_key, ops)
_, _, bins = self.as_connection.get(self.test_key)
expected_result = bytearray([0] + [1] * 4)
assert bins[self.test_bin_ones]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bitwise_rshift(self, other: Any) -> ColumnOperators:\n\n return self.operate(bitwise_rshift_op, other)",
"def test_rshift():\n value = 42\n num_a = param.Integer(value=value)\n assert num_a.value == value\n\n new_value = operator.rshift(value, 1)\n num_a.value >>= 1\... | [
"0.7760486",
"0.7638108",
"0.7405463",
"0.73835355",
"0.73835355",
"0.7353638",
"0.73003703",
"0.72271913",
"0.7211861",
"0.72058064",
"0.7191554",
"0.7107763",
"0.7016541",
"0.6985756",
"0.69458497",
"0.6906127",
"0.6903872",
"0.6837047",
"0.6822582",
"0.6795754",
"0.6775661... | 0.7462429 | 2 |
Perform a bitwise rshift op with offset > bitmap. | def test_bit_rshift_offset_out_of_range(self):
ops = [bitwise_operations.bit_rshift(self.test_bin_ones, 41, 8, 1, None)]
with pytest.raises(e.OpNotApplicable):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bitwise_rshift(self, other: Any) -> ColumnOperators:\n\n return self.operate(bitwise_rshift_op, other)",
"def test_bit_rshift_wrap(self):\n ops = [bitwise_operations.bit_rshift(self.test_bin_ones, 0, 40, 8, None)]\n\n self.as_connection.operate(self.test_key, ops)\n\n _, _, bins =... | [
"0.68082476",
"0.6507718",
"0.6502205",
"0.6427334",
"0.6422783",
"0.6422783",
"0.6422021",
"0.64078856",
"0.6404838",
"0.63749677",
"0.62379384",
"0.6169324",
"0.6154082",
"0.61445355",
"0.61361104",
"0.60724884",
"0.6042694",
"0.60101116",
"0.5978205",
"0.59142226",
"0.5843... | 0.6681683 | 1 |
Perform a bitwise rshift op with bit_size > bitmap. | def test_bit_rshift_bit_size_too_large(self):
ops = [bitwise_operations.bit_rshift(self.test_bin_ones, 0, 41, 1, None)]
with pytest.raises(e.OpNotApplicable):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_rshift_wrap(self):\n ops = [bitwise_operations.bit_rshift(self.test_bin_ones, 0, 40, 8, None)]\n\n self.as_connection.operate(self.test_key, ops)\n\n _, _, bins = self.as_connection.get(self.test_key)\n expected_result = bytearray([0] + [1] * 4)\n assert bins[self.te... | [
"0.6985838",
"0.6975781",
"0.6904481",
"0.6876606",
"0.6723617",
"0.6723617",
"0.64922476",
"0.6429139",
"0.6359374",
"0.63542265",
"0.6311663",
"0.62846226",
"0.6275696",
"0.6140997",
"0.6140134",
"0.60402584",
"0.60362566",
"0.60202444",
"0.5996184",
"0.5978953",
"0.5953361... | 0.73658377 | 0 |
Perform a bitwise rshift op with non existent bin. | def test_bit_rshift_bad_bin_name(self):
ops = [bitwise_operations.bit_rshift("bad_name", 0, 8, 1, None)]
with pytest.raises(e.BinNotFound):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_rshift_wrap(self):\n ops = [bitwise_operations.bit_rshift(self.test_bin_ones, 0, 40, 8, None)]\n\n self.as_connection.operate(self.test_key, ops)\n\n _, _, bins = self.as_connection.get(self.test_key)\n expected_result = bytearray([0] + [1] * 4)\n assert bins[self.te... | [
"0.77459735",
"0.75241",
"0.74613017",
"0.74604154",
"0.71995145",
"0.71995145",
"0.71397847",
"0.70742303",
"0.70375466",
"0.6978173",
"0.6948442",
"0.6911191",
"0.67862636",
"0.67795265",
"0.6759934",
"0.6620327",
"0.6605335",
"0.65548635",
"0.65455306",
"0.653168",
"0.6469... | 0.6898766 | 12 |
Perform a bitwise rshift op with a float for bit_offset. | def test_bit_rshift_bad_arg(self):
ops = [bitwise_operations.bit_rshift(self.test_bin_ones, 1.5, 8, 1, None)]
with pytest.raises(e.ParamError):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_rshift():\n value = 42\n num_a = param.Integer(value=value)\n assert num_a.value == value\n\n new_value = operator.rshift(value, 1)\n num_a.value >>= 1\n assert num_a.value == new_value",
"def rshift(val, n):\n return (val % 0x100000000) >> n",
"def rshift(... | [
"0.64491475",
"0.6418916",
"0.6418916",
"0.6334104",
"0.6238364",
"0.613158",
"0.60414225",
"0.59965366",
"0.5973791",
"0.5960168",
"0.58904314",
"0.5882007",
"0.5775575",
"0.5775489",
"0.57745934",
"0.571472",
"0.5707195",
"0.5705338",
"0.5673862",
"0.5666417",
"0.5567847",
... | 0.54344374 | 24 |
Perform a bitwise subtract op. | def test_bit_subtract_simple(self):
ops = [bitwise_operations.bit_subtract(self.test_bin_ones, 0, 8, 1, False, aerospike.BIT_OVERFLOW_FAIL, None)]
self.as_connection.operate(self.test_key, ops)
_, _, bins = self.as_connection.get(self.test_key)
expected_result = bytearray([0] * 1 + [1]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subtract(a, b):\n return a - b",
"def subtract(a, b):\n return a - b",
"def subtract(lhs, rhs):\n return _make.subtract(lhs, rhs)",
"def minus(self, a, b):\n return a - b",
"def subtract(x, y):\n\n return x - y",
"def subtract(x, y):\n return x - y",
"def subtract(x, y):\n retur... | [
"0.7082489",
"0.7082489",
"0.70479083",
"0.67831296",
"0.6770172",
"0.6761636",
"0.6761636",
"0.6761636",
"0.67572296",
"0.674928",
"0.672167",
"0.6708909",
"0.66160005",
"0.6612557",
"0.65945584",
"0.65892845",
"0.65485513",
"0.6544877",
"0.65226656",
"0.64625907",
"0.646259... | 0.6720297 | 11 |
Perform a bitwise subtract op with an offset that lands inbetween bytes. | def test_bit_subtract_inbetween_bytes(self):
ops = [bitwise_operations.bit_subtract(self.five_255_bin, 4, 8, 255, False, aerospike.BIT_OVERFLOW_FAIL, None)]
self.as_connection.operate(self.test_key, ops)
_, _, bins = self.as_connection.get(self.test_key)
expected_result = bytearray([24... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_subtract_bit_offset_out_of_range(self):\n ops = [\n bitwise_operations.bit_subtract(self.test_bin_zeroes, 41, 1, 1, False, aerospike.BIT_OVERFLOW_FAIL, None)\n ]\n\n with pytest.raises(e.OpNotApplicable):\n self.as_connection.operate(self.test_key, ops)",
"... | [
"0.64977556",
"0.62412834",
"0.6239557",
"0.62195957",
"0.6215681",
"0.618028",
"0.59770906",
"0.5848042",
"0.5848042",
"0.5848042",
"0.58252114",
"0.5815021",
"0.5802187",
"0.5801449",
"0.5796449",
"0.5793272",
"0.5781425",
"0.5732522",
"0.5732522",
"0.57230633",
"0.5714507"... | 0.6829426 | 0 |
Perform a bitwise subtract op with multiple bytes. | def test_bit_subtract_multiple_bytes(self):
ops = [
bitwise_operations.bit_subtract(self.test_bin_ones, 8, 16, 257, False, aerospike.BIT_OVERFLOW_FAIL, None)
]
self.as_connection.operate(self.test_key, ops)
_, _, bins = self.as_connection.get(self.test_key)
expected... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_subtract_inbetween_bytes(self):\n ops = [bitwise_operations.bit_subtract(self.five_255_bin, 4, 8, 255, False, aerospike.BIT_OVERFLOW_FAIL, None)]\n\n self.as_connection.operate(self.test_key, ops)\n\n _, _, bins = self.as_connection.get(self.test_key)\n expected_result = by... | [
"0.7051683",
"0.6489156",
"0.6265554",
"0.62049377",
"0.6195712",
"0.61772144",
"0.61772144",
"0.60979056",
"0.60612816",
"0.6039638",
"0.6035834",
"0.6015598",
"0.5974205",
"0.59607345",
"0.5958435",
"0.58393854",
"0.58328086",
"0.5803468",
"0.579507",
"0.5792536",
"0.579253... | 0.75186557 | 0 |
Perform a bitwise subtract op on a nonexistent bin. | def test_bit_subtract_bad_bin_name(self):
ops = [bitwise_operations.bit_subtract("bad_name", 8, 16, 257, False, aerospike.BIT_OVERFLOW_FAIL, None)]
with pytest.raises(e.BinNotFound):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_subtract_overflow_fail(self):\n ops = [bitwise_operations.bit_subtract(self.test_bin_ones, 0, 8, 255, False, aerospike.BIT_OVERFLOW_FAIL, None)]\n\n with pytest.raises(e.OpNotApplicable):\n self.as_connection.operate(self.test_key, ops)",
"def test_bit_subtract_simple(self):... | [
"0.6932047",
"0.68951654",
"0.68864524",
"0.68545467",
"0.68055755",
"0.668892",
"0.6510099",
"0.64084166",
"0.628363",
"0.62496334",
"0.6238307",
"0.6140046",
"0.6119843",
"0.6021742",
"0.5957144",
"0.5939512",
"0.5780383",
"0.5756103",
"0.56450284",
"0.56420887",
"0.5607923... | 0.78149927 | 0 |
Perform a bitwise subtract op with a bit_offset that is out of range for the bitmap being modified. | def test_bit_subtract_bit_offset_out_of_range(self):
ops = [
bitwise_operations.bit_subtract(self.test_bin_zeroes, 41, 1, 1, False, aerospike.BIT_OVERFLOW_FAIL, None)
]
with pytest.raises(e.OpNotApplicable):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_remove_offset_out_of_range(self):\n ops = [bitwise_operations.bit_remove(self.test_bin_zeroes, 6, 1, None)]\n\n with pytest.raises(e.InvalidRequest):\n self.as_connection.operate(self.test_key, ops)",
"def test_bit_subtract_bit_size_out_of_range(self):\n ops = [\n ... | [
"0.68870574",
"0.6712617",
"0.66374624",
"0.6593059",
"0.6452417",
"0.6321592",
"0.6146227",
"0.6096179",
"0.6046044",
"0.5997577",
"0.59970427",
"0.5973413",
"0.59491795",
"0.5849707",
"0.57583743",
"0.57313645",
"0.5667159",
"0.5593854",
"0.55748856",
"0.55695486",
"0.55690... | 0.743607 | 0 |
Perform a bitwise subtract op with a bit size too large for the bitmap being modified. | def test_bit_subtract_bit_size_out_of_range(self):
ops = [
bitwise_operations.bit_subtract(self.test_bin_zeroes, 0, 41, 1, False, aerospike.BIT_OVERFLOW_FAIL, None)
]
with pytest.raises(e.OpNotApplicable):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_subtract_bit_size_signed(self):\n ops = [bitwise_operations.bit_subtract(self.five_255_bin, 0, 8, 156, True, aerospike.BIT_OVERFLOW_FAIL, None)]\n\n self.as_connection.operate(self.test_key, ops)\n\n _, _, bins = self.as_connection.get(self.test_key)\n expected_result = byt... | [
"0.6800847",
"0.6652983",
"0.63065845",
"0.6276774",
"0.61352545",
"0.60940164",
"0.6081256",
"0.60409594",
"0.60386544",
"0.59446245",
"0.5817696",
"0.55523944",
"0.55090845",
"0.550583",
"0.55041265",
"0.54145783",
"0.5402549",
"0.53797835",
"0.5377048",
"0.5362389",
"0.536... | 0.6642727 | 2 |
Perform a bitwise subtract op subtraction. | def test_bit_subtract_bit_size_signed(self):
ops = [bitwise_operations.bit_subtract(self.five_255_bin, 0, 8, 156, True, aerospike.BIT_OVERFLOW_FAIL, None)]
self.as_connection.operate(self.test_key, ops)
_, _, bins = self.as_connection.get(self.test_key)
expected_result = bytearray([99]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subtract(a, b):\n return a - b",
"def subtract(a, b):\n return a - b",
"def subtract(lhs, rhs):\n return _make.subtract(lhs, rhs)",
"def subtract(first, second):\n return first - second",
"def subtract(a, b):\n print(\"SUBTRACTING %d - %d\" % (a, b))\n return a - b",
"def subtractio... | [
"0.7220958",
"0.7220958",
"0.7145313",
"0.69309103",
"0.6923972",
"0.69073254",
"0.68696684",
"0.68522",
"0.68522",
"0.68522",
"0.68401295",
"0.6810974",
"0.6792126",
"0.67744535",
"0.6679891",
"0.6679891",
"0.6679764",
"0.6675345",
"0.66583526",
"0.6636741",
"0.6635649",
"... | 0.63568115 | 38 |
Perform a bitwise subtract op that overflows with the BIT_OVERFLOW_FAIL action. | def test_bit_subtract_overflow_fail(self):
ops = [bitwise_operations.bit_subtract(self.test_bin_ones, 0, 8, 255, False, aerospike.BIT_OVERFLOW_FAIL, None)]
with pytest.raises(e.OpNotApplicable):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_subtract_bit_offset_out_of_range(self):\n ops = [\n bitwise_operations.bit_subtract(self.test_bin_zeroes, 41, 1, 1, False, aerospike.BIT_OVERFLOW_FAIL, None)\n ]\n\n with pytest.raises(e.OpNotApplicable):\n self.as_connection.operate(self.test_key, ops)",
"... | [
"0.7370349",
"0.7360217",
"0.67168427",
"0.66955477",
"0.6690933",
"0.6342002",
"0.63284343",
"0.62131953",
"0.6136948",
"0.6106323",
"0.60354006",
"0.595727",
"0.590616",
"0.58953905",
"0.58631927",
"0.58592397",
"0.58166087",
"0.5726038",
"0.5701894",
"0.56896704",
"0.56878... | 0.819887 | 0 |
Perform a bitwise subtract op that overflows with the BIT_OVERFLOW_SATURATE action. | def test_bit_subtract_overflow_saturate(self):
ops = [
bitwise_operations.bit_subtract(self.test_bin_ones, 0, 8, 255, False, aerospike.BIT_OVERFLOW_SATURATE, None)
]
self.as_connection.operate(self.test_key, ops)
_, _, bins = self.as_connection.get(self.test_key)
ex... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_subtract_overflow_fail(self):\n ops = [bitwise_operations.bit_subtract(self.test_bin_ones, 0, 8, 255, False, aerospike.BIT_OVERFLOW_FAIL, None)]\n\n with pytest.raises(e.OpNotApplicable):\n self.as_connection.operate(self.test_key, ops)",
"def test_bit_subtract_bit_offset_ou... | [
"0.726783",
"0.6864169",
"0.67772174",
"0.67653507",
"0.67579377",
"0.6566348",
"0.61904657",
"0.6066806",
"0.59181464",
"0.57647073",
"0.57319677",
"0.57319677",
"0.5728272",
"0.56917715",
"0.56846565",
"0.5678812",
"0.56218684",
"0.5600619",
"0.5527363",
"0.5527363",
"0.552... | 0.72179174 | 1 |
Perform a bitwise subtract op that overflows with the BIT_OVERFLOW_WRAP action. | def test_bit_subtract_overflow_wrap(self):
ops = [bitwise_operations.bit_subtract(self.five_255_bin, 0, 8, 1, False, aerospike.BIT_OVERFLOW_WRAP, None)]
self.as_connection.operate(self.test_key, ops)
_, _, bins = self.as_connection.get(self.test_key)
expected_result = bytearray([254] *... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_subtract_overflow_fail(self):\n ops = [bitwise_operations.bit_subtract(self.test_bin_ones, 0, 8, 255, False, aerospike.BIT_OVERFLOW_FAIL, None)]\n\n with pytest.raises(e.OpNotApplicable):\n self.as_connection.operate(self.test_key, ops)",
"def test_bit_subtract_bit_size_out_... | [
"0.71338594",
"0.63404083",
"0.6331683",
"0.6260237",
"0.625121",
"0.61504817",
"0.6129522",
"0.60416776",
"0.56835353",
"0.5678757",
"0.56779814",
"0.5620698",
"0.55475885",
"0.55475885",
"0.5547116",
"0.5539497",
"0.54920566",
"0.5421593",
"0.5421593",
"0.5421593",
"0.53716... | 0.7361038 | 0 |
Perform a bitwise xor op. | def test_bit_xor(self):
value = bytearray([1])
ops = [bitwise_operations.bit_xor(self.test_bin_ones, 0, 8, 1, value, None)]
self.as_connection.operate(self.test_key, ops)
_, _, bins = self.as_connection.get(self.test_key)
expected_result = bytearray([0] * 1 + [1] * 4)
a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xor(a, b):",
"def bitwise_xor(lhs, rhs):\n return _make.bitwise_xor(lhs, rhs)",
"def xor(self, *args):\n return Xor(self, *args)",
"def bitwise_xor(self):\n register = self.return_middle_registers(self.opcode)\n self.registers[register[0]] = (\n self.registers[register[... | [
"0.81265134",
"0.80022305",
"0.7884883",
"0.76791275",
"0.76186454",
"0.7585848",
"0.748491",
"0.7460548",
"0.73506576",
"0.7247339",
"0.7206677",
"0.7181552",
"0.717918",
"0.70741284",
"0.7039075",
"0.7028481",
"0.70267266",
"0.70186317",
"0.70030993",
"0.69934756",
"0.69769... | 0.7228245 | 10 |
Perform a bitwise xor op on multiple bytes. | def test_bit_xor_multiple_bytes(self):
value = bytearray([8] * 5)
ops = [bitwise_operations.bit_xor(self.five_255_bin, 0, 40, 5, value, None)]
self.as_connection.operate(self.test_key, ops)
_, _, bins = self.as_connection.get(self.test_key)
expected_result = bytearray([247] * 5... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xor(data1=None, data2=None):\n\n return bytearray(a ^ b for a, b in zip(*map(bytearray, [data1, data2])))",
"def xor(a, b):",
"def xor_bytes(a, b):\n return bytes(i^j for i, j in zip(a, b))",
"def xor(b1, b2):\n\n b = bytearray(len(b1))\n for i in range(len(b1)):\n b[i] = b1[i] ^ b2[i]... | [
"0.77092266",
"0.75397766",
"0.7437098",
"0.73599523",
"0.7203552",
"0.7183907",
"0.71256256",
"0.7079576",
"0.7048601",
"0.702959",
"0.700498",
"0.699976",
"0.69641954",
"0.69050246",
"0.6879175",
"0.6869852",
"0.6850761",
"0.6825906",
"0.6796211",
"0.6778304",
"0.6754803",
... | 0.735205 | 4 |
Perform a bitwise xor op. | def test_bit_xor_multiple_bytes_value_unchanged(self):
value = bytearray([0])
ops = [bitwise_operations.bit_xor(self.test_bin_zeroes, 7, 8, 1, value, None)]
self.as_connection.operate(self.test_key, ops)
_, _, bins = self.as_connection.get(self.test_key)
expected_result = bytea... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xor(a, b):",
"def bitwise_xor(lhs, rhs):\n return _make.bitwise_xor(lhs, rhs)",
"def xor(self, *args):\n return Xor(self, *args)",
"def bitwise_xor(self):\n register = self.return_middle_registers(self.opcode)\n self.registers[register[0]] = (\n self.registers[register[... | [
"0.81265134",
"0.80022305",
"0.7884883",
"0.76791275",
"0.76186454",
"0.7585848",
"0.748491",
"0.7460548",
"0.73506576",
"0.7247339",
"0.7228245",
"0.7206677",
"0.7181552",
"0.717918",
"0.70741284",
"0.7039075",
"0.7028481",
"0.70267266",
"0.70186317",
"0.70030993",
"0.699347... | 0.6603844 | 29 |
Perform a bitwise xor op with bit_offset > bitmap. | def test_bit_xor_bit_offset_out_of_range(self):
value = bytearray()
value.append(8)
ops = [bitwise_operations.bit_xor(self.test_bin_ones, 41, 8, 1, value, None)]
with pytest.raises(e.OpNotApplicable):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_xor_with_policy(self):\n value = bytearray([0])\n bit_policy = {\n \"bit_write_flags\": aerospike.BIT_WRITE_UPDATE_ONLY,\n }\n ops = [bitwise_operations.bit_xor(self.test_bin_zeroes, 7, 8, 1, value, bit_policy)]\n\n self.as_connection.operate(self.test_key... | [
"0.65985656",
"0.65077275",
"0.6500673",
"0.6443339",
"0.6437669",
"0.63780266",
"0.6351648",
"0.6344364",
"0.6307836",
"0.62951785",
"0.62089914",
"0.6118041",
"0.6113544",
"0.6078223",
"0.5945127",
"0.59304786",
"0.58627397",
"0.5844661",
"0.5823797",
"0.57821214",
"0.57653... | 0.67272615 | 0 |
Perform a bitwise xor op with bit_size > value. | def test_bit_xor_bit_size_larger_than_value(self):
value = bytearray()
value.append(8)
ops = [bitwise_operations.bit_xor(self.test_bin_ones, 0, 9, 1, value, None)]
with pytest.raises(e.InvalidRequest):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_xor_bit_size_too_large(self):\n value = bytearray([8] * 6)\n ops = [bitwise_operations.bit_xor(self.test_bin_ones, 0, 41, 6, value, None)]\n\n with pytest.raises(e.OpNotApplicable):\n self.as_connection.operate(self.test_key, ops)",
"def test_bit_xor_with_policy(self)... | [
"0.73067886",
"0.6601729",
"0.64713144",
"0.63067836",
"0.6222421",
"0.6178869",
"0.60622954",
"0.6051137",
"0.5981829",
"0.58503556",
"0.58304",
"0.57703584",
"0.57439303",
"0.57016945",
"0.5671008",
"0.5643629",
"0.56371194",
"0.56351",
"0.5610179",
"0.5597002",
"0.5594237"... | 0.7796739 | 0 |
Perform a bitwise xor op with bit_size > bitmap. | def test_bit_xor_bit_size_too_large(self):
value = bytearray([8] * 6)
ops = [bitwise_operations.bit_xor(self.test_bin_ones, 0, 41, 6, value, None)]
with pytest.raises(e.OpNotApplicable):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bit_xor_bit_size_larger_than_value(self):\n value = bytearray()\n value.append(8)\n ops = [bitwise_operations.bit_xor(self.test_bin_ones, 0, 9, 1, value, None)]\n\n with pytest.raises(e.InvalidRequest):\n self.as_connection.operate(self.test_key, ops)",
"def test_b... | [
"0.6650416",
"0.6514225",
"0.6504798",
"0.64670455",
"0.63607264",
"0.6328545",
"0.62608737",
"0.6258549",
"0.62444615",
"0.6225799",
"0.6198831",
"0.6184471",
"0.61594546",
"0.6144056",
"0.61243796",
"0.6093759",
"0.5990066",
"0.5982106",
"0.5820446",
"0.58060426",
"0.579869... | 0.6932577 | 0 |
Perform a bitwise xor op with a non existent bin. | def test_bit_xor_bad_bin_name(self):
value = bytearray([8])
ops = [bitwise_operations.bit_xor("bad_name", 0, 8, 1, value, None)]
with pytest.raises(e.BinNotFound):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xor(a, b):",
"def test_bit_xor_with_policy(self):\n value = bytearray([0])\n bit_policy = {\n \"bit_write_flags\": aerospike.BIT_WRITE_UPDATE_ONLY,\n }\n ops = [bitwise_operations.bit_xor(self.test_bin_zeroes, 7, 8, 1, value, bit_policy)]\n\n self.as_connection.o... | [
"0.7574724",
"0.73832107",
"0.735303",
"0.7245088",
"0.72166264",
"0.7210552",
"0.7141636",
"0.6988114",
"0.69824183",
"0.69609416",
"0.69542986",
"0.6906838",
"0.6833466",
"0.67492014",
"0.67457587",
"0.67267334",
"0.67037773",
"0.66894704",
"0.65736765",
"0.65700537",
"0.65... | 0.7214699 | 5 |
Perform a bitwise xor op with an integer for value. | def test_bit_xor_bad_arg(self):
value = 1
ops = [bitwise_operations.bit_xor("bad_name", 0, 8, 1, value, None)]
with pytest.raises(e.ParamError):
self.as_connection.operate(self.test_key, ops) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _XOR(integer1, integer2):\n _checkInt(integer1, minvalue=0, description='integer1')\n _checkInt(integer2, minvalue=0, description='integer2')\n\n return integer1 ^ integer2",
"def test_bit_xor_with_policy(self):\n value = bytearray([0])\n bit_policy = {\n \"bit_write_flags\"... | [
"0.7129324",
"0.6966714",
"0.69513005",
"0.6771664",
"0.6738682",
"0.66853553",
"0.6657061",
"0.66539866",
"0.6650171",
"0.66493356",
"0.6610109",
"0.65789557",
"0.6490302",
"0.6440446",
"0.638228",
"0.63625175",
"0.61989164",
"0.61577696",
"0.61323434",
"0.6128598",
"0.61198... | 0.6171284 | 17 |
Perform a bitwise xor op with a policy. | def test_bit_xor_with_policy(self):
value = bytearray([0])
bit_policy = {
"bit_write_flags": aerospike.BIT_WRITE_UPDATE_ONLY,
}
ops = [bitwise_operations.bit_xor(self.test_bin_zeroes, 7, 8, 1, value, bit_policy)]
self.as_connection.operate(self.test_key, ops)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xor(a, b):",
"def xor(self, *args):\n return Xor(self, *args)",
"def bitwise_xor(lhs, rhs):\n return _make.bitwise_xor(lhs, rhs)",
"def logical_xor(lhs, rhs):\n return _make.logical_xor(lhs, rhs)",
"def convert_broadcast_logical_xor(node, **kwargs):\n return create_basic_op_node('Xor', ... | [
"0.70831174",
"0.70623076",
"0.7059884",
"0.6676336",
"0.6656898",
"0.664496",
"0.66145754",
"0.64989746",
"0.6422519",
"0.6372238",
"0.6363608",
"0.6344332",
"0.63420236",
"0.6274215",
"0.6215274",
"0.6188354",
"0.61743647",
"0.6155858",
"0.61499715",
"0.6121868",
"0.6027265... | 0.7542527 | 0 |
Builds the Training and Eval DataLoaders | def build_dataloaders(dataset, batch_size, train_test_split=0.1, train_shuffle=True, eval_shuffle=True):
# 데이터셋 길이
dataset_len = len(dataset)
# 학습, 평가 데이터 나누기
eval_len = int(dataset_len * train_test_split)
train_len = dataset_len - eval_len
train_dataset, eval_dataset = random_split(dataset, (train_len, e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_training_data_loader(self) -> DataLoader:\n pass",
"def get_data_loaders(args, tokenizer):\n personachat = get_dataset(tokenizer, args.dataset_path, args.dataset_cache, args.train_lang)\n _ = personachat.pop(\"test\", None)\n logger.info(\"Build inputs and labels\")\n datasets = {\"t... | [
"0.77615035",
"0.7203594",
"0.71892494",
"0.71586543",
"0.7131367",
"0.70940703",
"0.70084804",
"0.6948732",
"0.6909035",
"0.68894297",
"0.6849166",
"0.6840078",
"0.68375945",
"0.6814795",
"0.67931867",
"0.678198",
"0.6742094",
"0.67255706",
"0.6717077",
"0.67025393",
"0.6699... | 0.6872649 | 10 |
Define hash behavior where hash of service ID is returned. | def __hash__(self):
return self['id'].__hash__() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash_key(self):",
"def _service_hash(self, service, vpc_outputs):\n params = dict(vpc_outputs)\n\n for key in SERVICE_KEYS_ITERABLE:\n value = service.get(key)\n if value:\n params[key] = sorted(value)\n\n for key in SERVICE_KEYS_STRINGS:\n ... | [
"0.7266011",
"0.72059745",
"0.72059745",
"0.70977956",
"0.6909675",
"0.69065595",
"0.6877844",
"0.68330246",
"0.6828365",
"0.67920864",
"0.6762853",
"0.6756751",
"0.6733904",
"0.6719983",
"0.66831344",
"0.6681504",
"0.6677548",
"0.66085917",
"0.66081715",
"0.6589555",
"0.6575... | 0.6776339 | 10 |
Attempts to find a candidate layer to use for CAM extraction | def locate_candidate_layer(mod: nn.Module, input_shape: Tuple[int, ...] = (3, 224, 224)) -> Optional[str]:
# Set module in eval mode
module_mode = mod.training
mod.eval()
output_shapes: List[Tuple[Optional[str], Tuple[int, ...]]] = []
def _record_output_shape(module: nn.Module, input: Tensor, outp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_CA_layer(arch, target_layer_name):\n\n hierarchy = target_layer_name.rsplit(\"_\",1)\n \n\n if target_layer_name == \"layer1\":\n return arch.layer1\n elif target_layer_name == \"layer2\":\n return arch.layer2\n elif target_layer_name == \"layer3\":\n return arch.layer3... | [
"0.62724084",
"0.6052908",
"0.5938766",
"0.5923088",
"0.58682144",
"0.5823416",
"0.5793721",
"0.5652858",
"0.56480765",
"0.5600004",
"0.55514055",
"0.55042034",
"0.5492678",
"0.54090405",
"0.53978735",
"0.53533643",
"0.53379434",
"0.5288922",
"0.52618504",
"0.5260588",
"0.524... | 0.6229697 | 1 |
Attempts to find a fully connecter layer to use for CAM extraction | def locate_linear_layer(mod: nn.Module) -> Optional[str]:
candidate_layer = None
for layer_name, m in mod.named_modules():
if isinstance(m, nn.Linear):
candidate_layer = layer_name
break
return candidate_layer | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_1dcnn_layer(arch, target_layer_name):\n\n hierarchy = target_layer_name.rsplit(\"_\",1)\n \n\n if target_layer_name.rsplit(\"_\",1)[0] == \"conv_1\":\n target_layer = arch.conv_1\n elif target_layer_name.rsplit(\"_\",1)[0] == \"conv_2\":\n target_layer = arch.conv_2\n elif tar... | [
"0.6235165",
"0.61649525",
"0.6135848",
"0.60220754",
"0.5801609",
"0.5757393",
"0.56605875",
"0.56124294",
"0.5590572",
"0.5570829",
"0.5509256",
"0.549481",
"0.5467345",
"0.54363424",
"0.5420622",
"0.53929347",
"0.5343131",
"0.5336345",
"0.5311497",
"0.5276976",
"0.5258702"... | 0.52236956 | 22 |
affiche le menu avec la selection en surbrillance | def show_menu(stdscr, choice=0):
stdscr.clear()
curses.curs_set(False)
stdscr.addstr("*** --- Interface de chiffrement --- ***\n\n")
if choice == 1:
stdscr.addstr("->1<- Chiffrement symétrique avec Threefish\n", curses.color_pair(1))
else:
stdscr.addstr("->1<- Chiffrement symétrique ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def menu():\n\tprint (\"\\n\\tSeleccionar una opcion\")\n\n\tprint (\"\\t1.- Resistencia en un Alambre \")\n\n\tprint (\"\\t2.- Voltaje\")\n\n\tprint (\"\\t3.- Corriente\")\n\n print (\"\\t4.- Resistencia\")\n\n\tprint (\"\\t5.- salir\")",
"def menu():\n ferme_fenetre()\n Menu()",
"def men... | [
"0.77105415",
"0.74756",
"0.6966005",
"0.68954504",
"0.688689",
"0.68805563",
"0.68805563",
"0.6758973",
"0.6755254",
"0.6743972",
"0.67343956",
"0.6726645",
"0.6707578",
"0.670444",
"0.66525996",
"0.66090655",
"0.654108",
"0.64731765",
"0.6468823",
"0.6442781",
"0.6441959",
... | 0.6300941 | 32 |
Effectue le chiffrement d'un fichier avec CramerShoup | def mode_crypt_cramershoup(stdscr, message=None):
loop = True
cursor = 0
while loop:
show_key_choices(stdscr, cursor, message)
key = stdscr.getkey()
loop = False
cs = CramerShoup()
if key == '1' or (key == '\n' and cursor == 1):
key_size = choose_keys_size... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _compress_meds_file(self, ucfilename, fzfilename):\n from os.path import basename\n\n tup=(basename(ucfilename),basename(fzfilename))\n print('compressing file: %s -> %s' % tup)\n tpath=files.expandpath(fzfilename)\n if os.path.exists(tpath):\n os.remove(tpath)\n\n... | [
"0.5562549",
"0.55497557",
"0.5539442",
"0.5481602",
"0.54636526",
"0.54450125",
"0.54042387",
"0.53944653",
"0.5392226",
"0.5348338",
"0.5325322",
"0.5266273",
"0.5238077",
"0.5231111",
"0.52081877",
"0.5202329",
"0.5197767",
"0.519266",
"0.51908654",
"0.51897204",
"0.517902... | 0.0 | -1 |
Create a deque containing not only the equities but also a timestamp for processing | def makequeuenodes(equities, nysenow, test_mode):
_wait_until = nysenow
if test_mode:
_wait_until = nysenow + dt.timedelta(seconds=10)
return [{"symbol": _eq, "waitUntil": _wait_until} for _eq in equities] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _query_data(self, index, tag):\n version, datapoints = yield self.quasar.stream_get(self.name, tag, tag+(15*qdf.MINUTE))\n values = np.empty((BLOCK_SIZE,), dtype=(type(datapoints[0])))\n values[:] = None\n \n for point in datapoints:\n time = float(point.time - tag)\n time_index = int(... | [
"0.5797774",
"0.5688308",
"0.5687349",
"0.56073284",
"0.56059563",
"0.55917233",
"0.5581784",
"0.55008185",
"0.54558545",
"0.5440964",
"0.5393363",
"0.5302756",
"0.52266675",
"0.52253956",
"0.5209304",
"0.51827526",
"0.5180614",
"0.51539594",
"0.51515394",
"0.5146804",
"0.514... | 0.5389778 | 11 |
Returns the asset with the given id. | def get_asset(self, asset_id):
text, code = ApiClient(self._config, 'assets/' + asset_id).get()
return Asset.deserialize(text) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_asset(self, asset_id):\n endpoint = '/assets/{}'.format(asset_id)\n return self._api_call('get', endpoint)",
"def asset(self, asset_id):\n headers, items = self._get('/asset/%s' % asset_id)\n return Asset.fromdict(items[0], api=self, full=True)",
"def get_asset(self, asset_id, asset... | [
"0.86297536",
"0.8100816",
"0.7962342",
"0.7741411",
"0.74044025",
"0.7134656",
"0.7062719",
"0.7001603",
"0.68088776",
"0.67893684",
"0.6752635",
"0.6658891",
"0.6634489",
"0.6628158",
"0.6605129",
"0.66020226",
"0.6591007",
"0.6567516",
"0.6552751",
"0.6544386",
"0.6536535"... | 0.85032684 | 1 |
Obtains Marketplace object given its ID. | def get_marketplace(self, marketplace_id):
return MarketplaceResource(self._config).get(marketplace_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_place_by_id(id):\n rv = query_db('select * from places where place_id = ?',\n [id])\n return rv[0] if rv else None",
"def get_object(self, id_):\n return self._objects.get(id_, None)",
"def get_place_by_id(place_id):\n place_obj = storage.get(\"Place\", place_id)\n i... | [
"0.6927319",
"0.6671522",
"0.664275",
"0.66377103",
"0.662131",
"0.6612834",
"0.6585188",
"0.65535146",
"0.64867014",
"0.6379136",
"0.6267908",
"0.62560844",
"0.61420566",
"0.61420566",
"0.6021101",
"0.6012841",
"0.60083824",
"0.59366053",
"0.592935",
"0.59106505",
"0.590253"... | 0.78990203 | 0 |
Returns the product with the given id. | def get_product(self, product_id):
text, code = ApiClient(self._config, 'products/' + product_id).get()
return Product.deserialize(text) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_product(cls, product_id):\n return Product.query.get(product_id)",
"def get_product_with_id(product_id: str) -> Product:\n return Product.query.filter_by(id=product_id).first()",
"def get_product(self, id):\n endpoint = '/v3/educator/products/%s' % id\n result = self.request(end... | [
"0.85281813",
"0.85013664",
"0.84031856",
"0.83624065",
"0.83443093",
"0.82873625",
"0.8281815",
"0.80858845",
"0.8047738",
"0.7840262",
"0.78134006",
"0.77144617",
"0.7700242",
"0.7573052",
"0.7383476",
"0.7344832",
"0.7296699",
"0.72861874",
"0.72677994",
"0.72662723",
"0.7... | 0.7998839 | 9 |
List the tier configs. | def list_tier_configs(self, filters=None):
query = self._get_filters_query(filters, True)
text, code = ApiClient(self._config, 'tier/configs' + query.compile()).get()
return TierConfig.deserialize(text) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def getTiers(self, ctx):\n server_dict = self.get_server_dict(ctx)\n tierList = server_dict.setdefault(\"Tiers\", [])\n\n if(len(tierList) > 0):\n await self.bot.say(\"Tiers:\")\n for tier in tierList:\n await self.bot.say(tier)\n else:\n ... | [
"0.6430079",
"0.6417699",
"0.6046109",
"0.59574795",
"0.5842776",
"0.5786352",
"0.5761368",
"0.5682218",
"0.56768256",
"0.56768256",
"0.56768256",
"0.56163913",
"0.55981684",
"0.5581887",
"0.55486715",
"0.54345995",
"0.53955334",
"0.53955334",
"0.53955334",
"0.53955334",
"0.5... | 0.7024054 | 0 |
Returns the tier config with the given id. | def get_tier_config(self, tier_config_id):
text, code = ApiClient(self._config, 'tier/configs/' + tier_config_id).get()
return TierConfig.deserialize(text) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_tier(pkmn_id):\n if pkmn_id in tiers.TIERS[\"0\"]:\n return 0\n elif pkmn_id in tiers.TIERS[\"1\"]:\n return 1\n elif pkmn_id in tiers.TIERS[\"2\"]:\n return 2\n elif pkmn_id in tiers.TIERS[\"3\"]:\n return 3\n else:\n return 4",
"def get_tenant_config(t... | [
"0.6171392",
"0.6161959",
"0.6053528",
"0.58012205",
"0.56873274",
"0.5458873",
"0.54341584",
"0.54274875",
"0.54274875",
"0.54274875",
"0.54274875",
"0.54111546",
"0.54089653",
"0.53808326",
"0.53808326",
"0.53808326",
"0.5372766",
"0.53144056",
"0.5300942",
"0.5277725",
"0.... | 0.8059733 | 0 |
Registering H&E with IHC slides. \b | def register(
sample_file,
select,
src=dstain.config.DATA_RAW,
output=dstain.config.REGISTRATION,
window=512,
downsample=1,
patches=0,
zip_patches=False,
verbose=True,
thumbnail_downsample=128,
nfeatures=5000,
ransacreprojthreshold=25,
affine=True):
# Reading lis... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plugh():",
"def initialise_har(_page_ref):",
"def h_27(options,buildout):\n h(options, buildout, '27', options['configure-options'])",
"def _register(self, comm, handler):",
"def _register(self):\n curses.init_pair(self.i, self.font, self.background)",
"def _connect(self):\n\n log.in... | [
"0.58058006",
"0.57988507",
"0.5493394",
"0.5279756",
"0.5167721",
"0.51371807",
"0.5056296",
"0.5032564",
"0.50154895",
"0.50146204",
"0.5002026",
"0.49939653",
"0.49846208",
"0.49842864",
"0.49733007",
"0.49688673",
"0.49627882",
"0.49401054",
"0.49284917",
"0.49052227",
"0... | 0.0 | -1 |
Parse the command line arguments | def parse_args(argv=None):
description = textwrap.dedent('''Panacea -
This script does ... (Fill in Later)
''')
parser = ap.ArgumentParser(description=description,
formatter_class=ap.RawTextHe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_arguments(args):",
"def parse_args():\n parser = argparse.ArgumentParser(\n description=\"Reads datapacket pcds, interpolates quaternions and generates scans from dataset in config file\")\n parser.add_argument(\"--visualization\", \"-v\", action=\"store_true\", help=\"if generated clouds ... | [
"0.8463088",
"0.7762483",
"0.7595797",
"0.75803727",
"0.75363654",
"0.74865943",
"0.74373615",
"0.74205333",
"0.74059993",
"0.73710746",
"0.7360746",
"0.7359222",
"0.7348543",
"0.7336221",
"0.7312769",
"0.7304517",
"0.7295875",
"0.72851336",
"0.72816515",
"0.72586316",
"0.725... | 0.0 | -1 |
Method for get requests | def get(biblestudy_id):
if biblestudy_id:
biblestudy_id = uuid.UUID(biblestudy_id)
biblestudy = BibleStudy.view_biblestudy_by_ID(biblestudy_id)
return jsonify(biblestudy), 200
else:
biblestudies = BibleStudy.view_all_biblestudies()
if BIBLESTUD... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(self, request):\n pass",
"def _get(self, *args, **kwargs):\n return self._request('get', *args, **kwargs)",
"def get(self):\n self.get_or_post(method='GET')",
"def get(self, *args, **kwargs):\n self.request(\"get\", *args, **kwargs)",
"def do_GET(self):\n self.htt... | [
"0.8463291",
"0.80142653",
"0.7961967",
"0.7943116",
"0.78019035",
"0.769378",
"0.7652034",
"0.76316446",
"0.7612648",
"0.75936604",
"0.7589165",
"0.7589165",
"0.75778246",
"0.7562761",
"0.7554217",
"0.7547737",
"0.75473094",
"0.75222695",
"0.75222695",
"0.74679065",
"0.74445... | 0.0 | -1 |
Property for the event type based on the code | def event_type(self) -> str:
try:
return _EVENT_TYPE_MAPPINGS.get(self.transaction_event_code[0:3])
except:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_type(self):\n return self.event_type",
"def event_type(self) -> int:\n return self.data[\"args\"][\"eventType\"]",
"def getTypeCode(self):\n return _libsbml.Event_getTypeCode(self)",
"def eventType(self, code):\n for idx in self.pj[ETHOGRAM]:\n if self.pj[ETHOGR... | [
"0.7975509",
"0.79043937",
"0.78299266",
"0.7595855",
"0.7507185",
"0.7507185",
"0.73829275",
"0.7172342",
"0.7009818",
"0.6883189",
"0.6868885",
"0.6839677",
"0.6837829",
"0.66198236",
"0.6600466",
"0.6572228",
"0.6427415",
"0.6401485",
"0.6225099",
"0.6215366",
"0.6162485",... | 0.7815724 | 3 |
Property for the event description based on the code | def event_desc(self) -> str:
return _EVENT_DESC_MAPPINGS.get(self.transaction_event_code) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_interesting_event_description(self):\n pass",
"def new_desc_event(self, event):\r\n pass",
"def get_description(self, code):\n try:\n return self.message[str(code)]\n except KeyError:\n return \"Unknown (\" + str(code) + \")\"",
"def event_for_event_descr... | [
"0.7521428",
"0.71878743",
"0.7116342",
"0.6826529",
"0.6817979",
"0.67542845",
"0.6681775",
"0.6681775",
"0.6652655",
"0.6632184",
"0.6632184",
"0.6611476",
"0.65897524",
"0.6565737",
"0.65504605",
"0.65504605",
"0.65504605",
"0.65266895",
"0.65266895",
"0.65266895",
"0.6498... | 0.807602 | 0 |
Property for the enumeration of this transaction () | def transaction_status_enum(self) -> TransactionStatus:
return _TRANSACTION_STATUS_MAPPING.get(self.transaction_status) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enum(self):\r\n raise NotImplementedError",
"def enumeration(self):\n raise exceptions.NotImplementedError()",
"def __index__(cls): # pylint: disable=invalid-index-returned\n return TransType(60)",
"def attr(self):\n\n return EnumAttr(self)",
"def natural_key(self):\n\t\tse... | [
"0.71118397",
"0.6270592",
"0.62465674",
"0.6158069",
"0.59486014",
"0.58366627",
"0.58330446",
"0.58252573",
"0.5776557",
"0.5740692",
"0.57314277",
"0.5705731",
"0.5659605",
"0.565769",
"0.5623061",
"0.56176597",
"0.56176597",
"0.561505",
"0.561505",
"0.5612701",
"0.5606627... | 0.6593331 | 1 |
Property for the enumeration of this transaction () | def paypal_reference_id_type_enum(self) -> ReferenceIdType:
return _REFERENCE_ID_MAPPINGS.get(self.paypal_reference_id_type) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enum(self):\r\n raise NotImplementedError",
"def transaction_status_enum(self) -> TransactionStatus:\n return _TRANSACTION_STATUS_MAPPING.get(self.transaction_status)",
"def enumeration(self):\n raise exceptions.NotImplementedError()",
"def __index__(cls): # pylint: disable=invalid-... | [
"0.71118397",
"0.6593331",
"0.6270592",
"0.62465674",
"0.6158069",
"0.59486014",
"0.58366627",
"0.58330446",
"0.58252573",
"0.5776557",
"0.5740692",
"0.57314277",
"0.5705731",
"0.5659605",
"0.565769",
"0.5623061",
"0.56176597",
"0.56176597",
"0.561505",
"0.561505",
"0.5612701... | 0.0 | -1 |
Property for the enumeration of this transaction () | def protection_eligibility_enum(self) -> ProtectionElegibility:
try:
return ProtectionElegibility(int(self.protection_eligibility))
except:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enum(self):\r\n raise NotImplementedError",
"def transaction_status_enum(self) -> TransactionStatus:\n return _TRANSACTION_STATUS_MAPPING.get(self.transaction_status)",
"def enumeration(self):\n raise exceptions.NotImplementedError()",
"def __index__(cls): # pylint: disable=invalid-... | [
"0.71118397",
"0.6593331",
"0.6270592",
"0.62465674",
"0.6158069",
"0.59486014",
"0.58366627",
"0.58330446",
"0.58252573",
"0.5776557",
"0.5740692",
"0.57314277",
"0.5705731",
"0.5659605",
"0.565769",
"0.5623061",
"0.56176597",
"0.56176597",
"0.561505",
"0.561505",
"0.5612701... | 0.0 | -1 |
Subscription must have an auto created_at attribute. | def test_create_at(self):
self.assertIsInstance(self.obj.created_at, datetime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_subscription(self):\n pass",
"def handle_create(self):\n subscription = self.client().subscription(\n self.properties[self.QUEUE_NAME],\n subscriber=self.properties[self.SUBSCRIBER],\n ttl=self.properties[self.TTL],\n options=self.properti... | [
"0.62214595",
"0.60435605",
"0.59733623",
"0.5837559",
"0.5824142",
"0.5757536",
"0.57300204",
"0.5678576",
"0.56596017",
"0.55581343",
"0.5556325",
"0.55548495",
"0.54913765",
"0.5458549",
"0.54476094",
"0.5432429",
"0.5402192",
"0.5395527",
"0.5390144",
"0.53898585",
"0.538... | 0.56080896 | 9 |
Forward process. Only 4x feature maps is used to calculate loss. Additional feature maps supervising can be added if calculating resource is enough. | def forward(self, x):
x_4 = x[0]
x_p4 = self.P4_conv(x_4)
x_4_1x7 = self.channel4_1x7_conv(x_4)
x_p4_1x7 = self.P4_1x7_conv(x_p4)
x_4 = x_p4_1x7 + x_p4 + x_4_1x7
x_4 = self.rpn4(x_4)
# predict results of aligned cell region mask and global pyramid mask
m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward(self, x):\n sources = list()\n new_sources = list()\n\n # apply lds to the initial image\n x_pool = self.lds(x)\n\n # apply vgg up to conv4_3\n for k in range(22):\n x = self.features[k](x)\n conv4_3_bn = self.ibn1(x)\n x_pool1_skip, x_... | [
"0.69317913",
"0.68093896",
"0.67466486",
"0.66855973",
"0.6674017",
"0.6602134",
"0.65924376",
"0.657881",
"0.65654254",
"0.65557927",
"0.6488124",
"0.64579856",
"0.6447587",
"0.6445193",
"0.6444281",
"0.642611",
"0.64092565",
"0.6401186",
"0.63872015",
"0.6384943",
"0.63688... | 0.62248266 | 32 |
Generating gt_mask for training(GPMA branch) | def get_target(self, gt_semantic_seg):
# aligned cell region mask
score_map_target = gt_semantic_seg[:, 0:1, :, :].float()
score_map_weights = gt_semantic_seg[:, 1, :, :].float()
# global pyramid mask
geo_bond_target = gt_semantic_seg[:, 2:4, :, :]
geo_bond_weights_targ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_GT_masks(root_dir, background_dir, intrinsic_matrix,classes):\n list_all_images = load_obj(root_dir + \"all_images_adr\")\n training_images_idx = load_obj(root_dir + \"train_images_indices\")\n for i in range(len(training_images_idx)):\n img_adr = list_all_images[training_images_idx[i]]\... | [
"0.6587925",
"0.6439197",
"0.6427601",
"0.6214899",
"0.61333",
"0.6079509",
"0.60001504",
"0.59900105",
"0.59897834",
"0.5966944",
"0.5923342",
"0.5761176",
"0.5759754",
"0.57458866",
"0.5744418",
"0.5743072",
"0.5733626",
"0.57243675",
"0.56848824",
"0.5662102",
"0.56010026"... | 0.0 | -1 |
Get the final predictions of GPMA branch in testing. | def get_seg_masks(self, preds, img_metas, pad_shape):
mask_pred, reg_pred = preds
h_pad, w_pad = pad_shape
cell_region_mask, gp_mask_hor, gp_mask_ver = [], [], []
for i, meta in enumerate(img_metas):
h_img, w_img, _ = meta['img_shape']
h_ori, w_ori, _ = meta['ori... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def predict_proba(self, test_data):\r\n return self.gs.predict_proba(test_data)",
"def getPredictions(self):\n\t\tself.bestLabel = self.testingProbs.apply(lambda x: x.argmax(),1)",
"def predict(self, test_data):\r\n return self.gs.predict(test_data)",
"def get_predictions():\n\n print(\"OK1\... | [
"0.67786694",
"0.6742009",
"0.6672143",
"0.661158",
"0.65346944",
"0.6534206",
"0.642764",
"0.6390099",
"0.6348899",
"0.6294217",
"0.6288946",
"0.6268972",
"0.62415266",
"0.624068",
"0.62350875",
"0.62335014",
"0.62050843",
"0.62034786",
"0.6201398",
"0.6188522",
"0.6162944",... | 0.0 | -1 |
Return a dictionary structure of configuration items | def read_node_configuration(node_xml):
node_config = node_xml.find(xmlns + "config[@key='model']")
if node_config != None:
return elementtree_to_dict(node_config)
else:
return {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def items(self):\n return [(section, dict(self.conf.items(section, raw=True))) for \\\n section in [section for section in self.conf.sections()]]",
"def items(self):\n return [(section, dict(self.conf.items(section, raw=True))) for \\\n section in [section for section in self.... | [
"0.7746376",
"0.7746376",
"0.76396483",
"0.738996",
"0.7319747",
"0.73143387",
"0.72544336",
"0.7224196",
"0.7204205",
"0.72018033",
"0.6954519",
"0.69118047",
"0.6880073",
"0.6743703",
"0.66848516",
"0.6680234",
"0.66616994",
"0.6654844",
"0.66422963",
"0.6620089",
"0.661452... | 0.0 | -1 |
Return a dictionary structure of settings items | def read_node_settings(node_xml):
workflow_template_information = node_xml.find(xmlns + "config[@key='workflow_template_information']")
if workflow_template_information is not None:
workflow_template_information = elementtree_to_dict(workflow_template_information)
return { 'workflow_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def settings(self):\n return {}",
"def settings(self) -> Dict[str, Any]:\n return {}",
"def load_values(self):\n rv = {}\n for setting in self.manager.all():\n rv[setting.name] = setting.to_dict()\n return rv",
"def _get_dict_from_settings(self, settings):\n ... | [
"0.7856634",
"0.7759619",
"0.7334263",
"0.721693",
"0.71687514",
"0.71687514",
"0.70768046",
"0.7010694",
"0.7010694",
"0.6921825",
"0.69130135",
"0.67607963",
"0.67258215",
"0.6680766",
"0.66754884",
"0.66524404",
"0.66346765",
"0.66346765",
"0.66328996",
"0.661143",
"0.6587... | 0.0 | -1 |
Build the queryset's menu nodes | def queryset_nodes(queryset):
for article in queryset:
article_nodes.append(NavigationNode(
article.title,
aritcle.url,
article.menu.menuid,
article.menu.parent,
)
)
return article_nodes | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_menus( self ):",
"def create_all_menus(self, ):\n m = self._model\n if not m:\n return\n indizes = self._flatten_hierarchy(m)\n for i in indizes:\n self.create_menu_for_index(i)",
"def menu(self):\n menu = list()\n \n \n menu.extend([\n ... | [
"0.6887437",
"0.6695563",
"0.65804785",
"0.6051546",
"0.6004562",
"0.6000519",
"0.60000986",
"0.5959026",
"0.5901801",
"0.58684534",
"0.5846643",
"0.58404493",
"0.5832597",
"0.58244693",
"0.58063537",
"0.57588434",
"0.57193357",
"0.5719219",
"0.5705354",
"0.5689959",
"0.56385... | 0.734222 | 0 |
Get a category node which including queryset's articles | def category_node(article, nodes):
for node in nodes:
if node.id == article.menu.parent:
parent_node = node
return node
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def queryset_nodes(queryset):\n for article in queryset:\n article_nodes.append(NavigationNode(\n article.title,\n aritcle.url,\n article.menu.menuid,\n article.menu.parent,\n )\n )\n return article_nodes",
"def articles(self):\n r... | [
"0.6826594",
"0.64453834",
"0.6261507",
"0.62490326",
"0.59907746",
"0.59431964",
"0.5938653",
"0.5930572",
"0.59263855",
"0.58901745",
"0.58336705",
"0.5822548",
"0.58144563",
"0.5806823",
"0.57744884",
"0.5763223",
"0.57177407",
"0.57156205",
"0.5699243",
"0.5681948",
"0.56... | 0.58477324 | 10 |
Build a page of one category's article nodes | def cache_nodes(request, queryset):
if queryset:
lang = get_language()
site_id = Site.objects.get_current().pk
prefix = getattr(settings, "CMS_CACHE_PREFIX", "menu_cache_")
key = "%smenu_nodes_%s_%s" % (prefix, lang, site_id)
parent_node = None
# build article_nodes ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_category_pages(app):\n env = app.builder.env\n\n template = \"category.html\"\n\n categories = env.categories\n for name, category in categories.iteritems():\n context = {}\n context[\"title\"] = category.name\n context[\"subcategories\"] = category.subcategories\n ... | [
"0.6574229",
"0.65195274",
"0.6363851",
"0.6183687",
"0.6148541",
"0.61365473",
"0.5983859",
"0.5935477",
"0.58813024",
"0.58725756",
"0.5836721",
"0.5832494",
"0.58153504",
"0.5739997",
"0.56698304",
"0.564322",
"0.56281185",
"0.560928",
"0.55960125",
"0.5566375",
"0.5521866... | 0.0 | -1 |
returns the populated cache using products as defined in settings.py | def populate_product_cache(products=BILLING_PRODUCTS):
if not products:
product_classes = []
elif isinstance(products, basestring):
# we have a module containing products
product_classes = collect_products_from_modules(products)
product_classes.sort(key=lambda x: x.base_pri... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fill_cache_table():\n products = []\n for query in ['bread', 'milk', 'rice']:\n grocery = grocery_search(query)\n products += get_all_products_from_grocery_search(grocery)\n\n orm = ORM()\n for product in products:\n orm.add_cache(**product)",
"def products():\n try:\n ... | [
"0.72026014",
"0.6700284",
"0.6651304",
"0.6560125",
"0.6445207",
"0.6209694",
"0.6205761",
"0.6112258",
"0.6101845",
"0.6099612",
"0.60875267",
"0.6069428",
"0.5992004",
"0.59812343",
"0.5977329",
"0.5944043",
"0.5935326",
"0.5926559",
"0.59135944",
"0.58451366",
"0.58451366... | 0.6437903 | 5 |
returns the list of products that is visible to the given account | def get_visible_products(self):
all_products = billing.loading.get_products(hidden=True)
public_products = billing.loading.get_products()
subscribed_product_types = ProductType.objects \
.filter(subscriptions__billing_account=self) \
.distinct()
subscribed... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def see_products_for_rent_handler():\n\n products = ShowProductsAndCustomers()\n my_list = products.see_products_for_rent()\n my_result_list = []\n for product in my_list:\n my_result_list.append(product)\n print(product)\n return my_result_list",
"def get_vendors_and_products_seen(c... | [
"0.61855996",
"0.6172926",
"0.59688145",
"0.5910303",
"0.5864358",
"0.5848761",
"0.58424187",
"0.58332884",
"0.5669318",
"0.5644832",
"0.56349075",
"0.5614921",
"0.56030047",
"0.55888885",
"0.55652934",
"0.55594563",
"0.5548453",
"0.5529825",
"0.55008173",
"0.54984933",
"0.54... | 0.7699004 | 0 |
returns the subscriptions whose most recent status is one of those specified | def filter_by_current_statuses(self, statuses):
annotated = self.annotate(
newest=models.Max('approval_statuses__created'))
newest_subs = annotated.filter(
approval_statuses__created=models.F('newest'),
approval_statuses__status__in=statuses
)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter_by_current_status(self, status):\r\n return self.filter_by_current_statuses([status])",
"def get_latest_statuses(self):\n self.status_lock.acquire()\n status = copy.deepcopy(self.cached_status)\n self.status_lock.release()\n return status",
"def latest_payment(owne... | [
"0.5411569",
"0.5321596",
"0.53178895",
"0.5255911",
"0.51426303",
"0.50995034",
"0.50858927",
"0.5026834",
"0.4995144",
"0.4961031",
"0.49494302",
"0.49330226",
"0.4916144",
"0.48843575",
"0.48827955",
"0.48712513",
"0.4863807",
"0.48464385",
"0.48384252",
"0.4829559",
"0.48... | 0.641309 | 0 |
returns the subscriptions whose most recent status is that specified | def filter_by_current_status(self, status):
return self.filter_by_current_statuses([status]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter_by_current_statuses(self, statuses):\r\n \r\n annotated = self.annotate(\r\n newest=models.Max('approval_statuses__created'))\r\n newest_subs = annotated.filter(\r\n approval_statuses__created=models.F('newest'),\r\n approval_statuses__status__in=sta... | [
"0.6525145",
"0.5680638",
"0.5588344",
"0.5539279",
"0.55073756",
"0.5480578",
"0.53735834",
"0.52672017",
"0.5131874",
"0.5127889",
"0.5121025",
"0.51174986",
"0.5111294",
"0.5084101",
"0.50805837",
"0.5063793",
"0.50378966",
"0.502453",
"0.5020091",
"0.50186706",
"0.5017041... | 0.53893167 | 6 |
If the billing account already has an IOU account, return the update form. If there isn't an account yet, then return the creation form | def get_billing_details_form(billing_account):
try:
iou_account = billing_account.simple_processor_iou_account
return IOUAccountUpdateForm
except IOUAccount.DoesNotExist:
return IOUAccountCreationForm | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def manage():\n if current_user.is_agency:\n form = ManageAgencyUserAccountForm(user=current_user)\n else:\n form = ManageUserAccountForm(user=current_user)\n\n if request.method == \"POST\":\n if form.validate_on_submit():\n update_openrecords_user(form)\n redir... | [
"0.6070687",
"0.6037547",
"0.5988173",
"0.5983497",
"0.5789755",
"0.57439816",
"0.56556976",
"0.563131",
"0.5623569",
"0.5617682",
"0.5516923",
"0.54676425",
"0.5454282",
"0.54209024",
"0.5419233",
"0.5396492",
"0.53896946",
"0.53603184",
"0.5337848",
"0.52935314",
"0.5287341... | 0.7438349 | 0 |
`sender` is the subscription instance requiring approval | def do_subscription_approval(sender, **kwargs):
req_payment = sender.get_product_class().get_requires_payment_details()
if not req_payment or has_valid_billing_details(sender.billing_account):
status = 'approved'
else:
status = 'declined'
sender.set_current_approval_status(status)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save(self):\n owner = self.context[\"request\"].user\n recipient = self._recipient_email_inst.user\n\n logger.info(\n \"Transferring subscription %r from user %r to user %r\",\n owner.know_me_subscription,\n owner.pk,\n recipient.pk,\n )\n... | [
"0.64126",
"0.6349764",
"0.6349764",
"0.6349764",
"0.6021129",
"0.6001644",
"0.5986496",
"0.59361017",
"0.59361017",
"0.59361017",
"0.59361017",
"0.59361017",
"0.59173584",
"0.58232635",
"0.58184",
"0.581205",
"0.580477",
"0.58026046",
"0.5777631",
"0.57491696",
"0.5715194",
... | 0.6396265 | 1 |
returns a function to conditionally dispatch a view based on a user's current subscription status If the user is already subscribed to the plan, dispatch the current_subscription_view If the plan requires billing details, and the user doesn't have billing details on file (as reported by the processor), then dispatch th... | def subscription_view(
current_subscription_view=CurrentSubscriptionView.as_view(),
billing_details_view=SubscriptionBillingDetailsView.as_view(),
confirmation_view=SubscriptionConfirmationView.as_view(),
):
def dispatch(request, *args, **kwargs):
cur_product_cls = request.user.billing_acc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subscription_purchase(request):\n if request.method==\"POST\":\n # POST request means user submitted Stripe card form\n if \"stripeToken\" in request.POST:\n try:\n customer = stripe.Charge.create(\n amount = 60*100,\n currency = ... | [
"0.5515831",
"0.5395123",
"0.539442",
"0.5309995",
"0.5069644",
"0.50552225",
"0.5021062",
"0.50068426",
"0.49595723",
"0.49220333",
"0.48865813",
"0.48719206",
"0.4826401",
"0.47936228",
"0.47907218",
"0.4754648",
"0.4741204",
"0.47088012",
"0.46711046",
"0.4648662",
"0.4637... | 0.7740026 | 0 |
Returns the Channels Group name that sockets should subscribe to to get sent messages as they are generated. | def group_name(self):
return "room-%s" % self.pk | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group_name(self):\n\t\treturn \"DocumentChat-%s\" % self.id",
"def _get_peer_group_name(self):\n return self.__peer_group_name",
"def _get_peer_group_name(self):\n return self.__peer_group_name",
"def get_group_name(self):\n return self.groupname",
"def websocket_group(self):\n ... | [
"0.67033607",
"0.647381",
"0.647381",
"0.6465417",
"0.6434411",
"0.64291686",
"0.642359",
"0.6367134",
"0.63132614",
"0.6228915",
"0.62003005",
"0.6188551",
"0.6169147",
"0.6107189",
"0.60954183",
"0.6086085",
"0.60798824",
"0.6052177",
"0.60476255",
"0.6019649",
"0.6003893",... | 0.58056945 | 37 |
Takes a Nx9 prediction matrix, and a NxK prediction matrices of a subclassifier the subclassifier classifies only the classes in the subclasses list then, it combines the two predictions, and returns the new prediction matrix copyPred means that the prediction matrix will be copied, which costs more memory by default, ... | def combinePredictions(predictions, subpredictions, subclasses = [2,3], copyPred = False):
assert len(subclasses) == np.shape(subpredictions)[1]
assert np.shape(subpredictions)[1] < np.shape(predictions)[1]
assert np.shape(subpredictions)[0] == np.shape(predictions)[0]
if copyPred:
predicti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _multiclass_confusion_matrix_update(preds: Tensor, target: Tensor, num_classes: int) ->Tensor:\n unique_mapping = target * num_classes + preds\n bins = _bincount(unique_mapping, minlength=num_classes ** 2)\n return bins.reshape(num_classes, num_classes)",
"def process_predictions(self, predictions, ... | [
"0.6202629",
"0.56319284",
"0.55949056",
"0.5581213",
"0.55317783",
"0.55251276",
"0.55228347",
"0.5518485",
"0.55066335",
"0.5490606",
"0.5483566",
"0.5453201",
"0.54506636",
"0.5432664",
"0.5418056",
"0.54165256",
"0.5387387",
"0.53693783",
"0.5364137",
"0.53587484",
"0.535... | 0.76767987 | 0 |
Gets training data for classification, from only the given classes Either filter existing data, or load the default training data, and filter that. If either train_data or true_classes is None, the data will be loaded using get_training_data() from utils.loading | def getSubClassifierData(subclasses = [2,3], train_data = None, true_classes = None):
if (train_data is None) or (true_classes is None):
train_data, true_classes, _ = get_training_data()
assert len(true_classes) == np.shape(train_data)[0]
validsample = np.array([x in subclasses for x in true_c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_training_data(\n self,\n train_data_file=\"datasets/train_data.json\",\n test_data_file=\"datasets/test_data.json\",\n ):\n train_data = pd.read_json(train_data_file)\n test_data = pd.read_json(test_data_file)\n return train_data, test_data",
"def train(self)... | [
"0.6166976",
"0.60436237",
"0.59472346",
"0.59368724",
"0.5928723",
"0.59101176",
"0.5907316",
"0.58968824",
"0.58936644",
"0.5892785",
"0.5844393",
"0.5816411",
"0.5815247",
"0.5812829",
"0.5800985",
"0.57745534",
"0.5773249",
"0.575504",
"0.57530016",
"0.5745181",
"0.573280... | 0.64171195 | 0 |
!woot [] Returns the current woot sale for the current sub woot site | def cmd_woot(bot, user, channel, args):
base_url = 'woot'
if len(args) != 0:
base_url = args[0] + '.' + base_url
url = "http://%s.com/salerss.aspx" % (base_url)
d = getPage(url, timeout=10)
d.addCallback(parse_body, bot, base_url, channel)
d.addErrback(bot.log.err) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_wotd():\n\treturn wotd",
"def Site(self) -> str:",
"def site(obj):\n return \"%s\" % (obj.site.name)",
"def get_one_meal():",
"def my_site(self):\n if \"mySite\" in self._prop_dict:\n return self._prop_dict[\"mySite\"]\n else:\n return None",
"def sell():\n ... | [
"0.56296927",
"0.53932893",
"0.5388723",
"0.5326253",
"0.5259303",
"0.5234345",
"0.51914865",
"0.51019454",
"0.50605583",
"0.50302356",
"0.4983343",
"0.4920281",
"0.4898316",
"0.4858292",
"0.48524618",
"0.48396766",
"0.4808637",
"0.47999215",
"0.47914094",
"0.47776863",
"0.47... | 0.49740252 | 11 |
Interactively chat with the model | def interact_model(
model_name='117M',
asker=None,
responder=None,
restore_from=None,
seed=None,
length=None,
temperature=1,
top_k=0,
top_p=0.0,
penalize=0,
prompt=None
):
if asker is None:
raise Exception("Add a name present in the training dataset that you will ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __sendMessage(self):\n # TODO: Switch to this when implemented\n \n msg = self.ui.inputWidget.toPlainText()\n self.ui.inputWidget.clear()\n strv = StringView()\n strv.appendText(unicode(msg))\n self._amsn_conversation.sendMessage(strv)\n self.ui.textEdit.... | [
"0.73204255",
"0.6992054",
"0.6817315",
"0.65010595",
"0.6449504",
"0.6411088",
"0.637461",
"0.6361894",
"0.6337098",
"0.63135856",
"0.6303412",
"0.62997276",
"0.62753755",
"0.626618",
"0.62627745",
"0.62625325",
"0.6251494",
"0.62493265",
"0.6238796",
"0.62273794",
"0.622012... | 0.0 | -1 |
The set of arguments for constructing a UserGpgKey resource. | def __init__(__self__, *,
key: pulumi.Input[str],
user_id: Optional[pulumi.Input[int]] = None):
pulumi.set(__self__, "key", key)
if user_id is not None:
pulumi.set(__self__, "user_id", user_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(__self__,\n resource_name: str,\n args: UserGpgKeyArgs,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...",
"def create_key ():",
"def generate_prototype_key(self, *args):\n return str(uuid.uuid5(UUID_XYZ_NAMESPACE, str((self.X, s... | [
"0.7139286",
"0.6167342",
"0.61082613",
"0.6075583",
"0.5890069",
"0.57742643",
"0.5772281",
"0.57666415",
"0.57517797",
"0.5742523",
"0.56961834",
"0.5635335",
"0.55548966",
"0.55476093",
"0.55024284",
"0.54636425",
"0.5430512",
"0.5403845",
"0.5361252",
"0.5349655",
"0.5324... | 0.54451126 | 16 |
The armored GPG public key. | def key(self) -> pulumi.Input[str]:
return pulumi.get(self, "key") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def public_key():\n if not Authorizer.__public_key:\n Authorizer.__public_key = download_public_key()\n return Authorizer.__public_key",
"def public_key(self):",
"def get_public_key(self):\n return self.public_key",
"async def client_public_key(self) -> bytes:\n raise N... | [
"0.7310315",
"0.7261075",
"0.7163275",
"0.71390903",
"0.71195096",
"0.71009403",
"0.7095869",
"0.70790446",
"0.69872767",
"0.69723666",
"0.6962964",
"0.6948088",
"0.69408524",
"0.6896595",
"0.68739593",
"0.6806223",
"0.6748333",
"0.6742872",
"0.67361313",
"0.66902655",
"0.657... | 0.0 | -1 |
The ID of the user to add the GPG key to. If this field is omitted, this resource manages a GPG key for the current user. Otherwise, this resource manages a GPG key for the specified user, and an admin token is required. | def user_id(self) -> Optional[pulumi.Input[int]]:
return pulumi.get(self, "user_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"user_id\")",
"def user_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"user_id\")",
"def user_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"user_id\")",
"def user_id(self) -> Optional[pu... | [
"0.59973806",
"0.59973806",
"0.59461033",
"0.59461033",
"0.59461033",
"0.58855414",
"0.5857102",
"0.57523966",
"0.5672502",
"0.56256455",
"0.561052",
"0.561052",
"0.561052",
"0.561052",
"0.561052",
"0.56017846",
"0.5598544",
"0.55765146",
"0.55765146",
"0.5566953",
"0.5566593... | 0.5794713 | 8 |
Input properties used for looking up and filtering UserGpgKey resources. | def __init__(__self__, *,
created_at: Optional[pulumi.Input[str]] = None,
key: Optional[pulumi.Input[str]] = None,
key_id: Optional[pulumi.Input[int]] = None,
user_id: Optional[pulumi.Input[int]] = None):
if created_at is not None:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_keys_query(self, kind):\n\n (old_email, new_email, prop) = self.get_email_params()\n # When a user's personal Google account is replaced by their transitioned Google Apps account with the same email,\n # the Google user ID changes and the new User object's are not considered equal to t... | [
"0.56195474",
"0.54138803",
"0.53139937",
"0.5281109",
"0.52637136",
"0.525693",
"0.52030176",
"0.52003443",
"0.51581264",
"0.51372254",
"0.5104356",
"0.50864327",
"0.5070421",
"0.50658625",
"0.5063704",
"0.50547856",
"0.50320804",
"0.50316215",
"0.5012136",
"0.49918634",
"0.... | 0.0 | -1 |
The time when this key was created in GitLab. | def created_at(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "created_at") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def creation_time(self) -> str:\n return pulumi.get(self, \"creation_time\")",
"def creation_time(self) -> str:\n return pulumi.get(self, \"creation_time\")",
"def creation_time(self) -> str:\n return pulumi.get(self, \"creation_time\")",
"def creation_timestamp(self) -> str:\n re... | [
"0.78340214",
"0.78340214",
"0.78340214",
"0.7804342",
"0.7804342",
"0.7804342",
"0.77040094",
"0.77040094",
"0.77040094",
"0.7682238",
"0.75567406",
"0.75567406",
"0.75567406",
"0.75567406",
"0.75567406",
"0.75567406",
"0.75567406",
"0.75567406",
"0.75567406",
"0.75567406",
... | 0.0 | -1 |
The armored GPG public key. | def key(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "key") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def public_key():\n if not Authorizer.__public_key:\n Authorizer.__public_key = download_public_key()\n return Authorizer.__public_key",
"def public_key(self):",
"def get_public_key(self):\n return self.public_key",
"async def client_public_key(self) -> bytes:\n raise N... | [
"0.7310315",
"0.7261075",
"0.7163275",
"0.71390903",
"0.71195096",
"0.71009403",
"0.7095869",
"0.70790446",
"0.69872767",
"0.69723666",
"0.6962964",
"0.6948088",
"0.69408524",
"0.6896595",
"0.68739593",
"0.6806223",
"0.6748333",
"0.6742872",
"0.67361313",
"0.66902655",
"0.657... | 0.0 | -1 |
The ID of the GPG key. | def key_id(self) -> Optional[pulumi.Input[int]]:
return pulumi.get(self, "key_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def key_id(self):\n return self._key_id",
"def key_id(self) -> pulumi.Output[int]:\n return pulumi.get(self, \"key_id\")",
"def crypto_key_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"crypto_key_id\")",
"def key(self):\n return str(self._id)",
"def get_pgp_key_id(... | [
"0.76533425",
"0.7478572",
"0.73216677",
"0.7293038",
"0.72849256",
"0.7156193",
"0.71369255",
"0.7129503",
"0.70065194",
"0.6963701",
"0.69266695",
"0.6895049",
"0.6895049",
"0.6895049",
"0.6895049",
"0.6895049",
"0.6895049",
"0.6895049",
"0.6895049",
"0.6895049",
"0.6895049... | 0.7083336 | 8 |
The ID of the user to add the GPG key to. If this field is omitted, this resource manages a GPG key for the current user. Otherwise, this resource manages a GPG key for the specified user, and an admin token is required. | def user_id(self) -> Optional[pulumi.Input[int]]:
return pulumi.get(self, "user_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"user_id\")",
"def user_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"user_id\")",
"def user_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"user_id\")",
"def user_id(self) -> Optional[pu... | [
"0.59973806",
"0.59973806",
"0.59461033",
"0.59461033",
"0.59461033",
"0.58855414",
"0.5857102",
"0.57523966",
"0.5672502",
"0.56256455",
"0.561052",
"0.561052",
"0.561052",
"0.561052",
"0.561052",
"0.56017846",
"0.5598544",
"0.55765146",
"0.55765146",
"0.5566953",
"0.5566593... | 0.5794713 | 7 |
The `UserGpgKey` resource allows to manage the lifecycle of a GPG key assigned to the current user or a specific user. > Managing GPG keys for arbitrary users requires admin privileges. | def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
key: Optional[pulumi.Input[str]] = None,
user_id: Optional[pulumi.Input[int]] = None,
__props__=None):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n created_at: Optional[pulumi.Input[str]] = None,\n key: Optional[pulumi.Input[str]] = None,\n key_id: Optional[pulumi.Input[int]] = None,\n user_i... | [
"0.687181",
"0.6380439",
"0.602855",
"0.5629067",
"0.55743873",
"0.55611336",
"0.5556669",
"0.5351029",
"0.51739377",
"0.5046954",
"0.5010196",
"0.49549356",
"0.4946365",
"0.49389258",
"0.49171305",
"0.4904886",
"0.4885452",
"0.48572877",
"0.48357147",
"0.48297393",
"0.482409... | 0.0 | -1 |
The `UserGpgKey` resource allows to manage the lifecycle of a GPG key assigned to the current user or a specific user. > Managing GPG keys for arbitrary users requires admin privileges. | def __init__(__self__,
resource_name: str,
args: UserGpgKeyArgs,
opts: Optional[pulumi.ResourceOptions] = None):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n created_at: Optional[pulumi.Input[str]] = None,\n key: Optional[pulumi.Input[str]] = None,\n key_id: Optional[pulumi.Input[int]] = None,\n user_i... | [
"0.687021",
"0.63795817",
"0.6026969",
"0.5628973",
"0.5574105",
"0.5560977",
"0.55560684",
"0.5350653",
"0.51723266",
"0.50449383",
"0.5010463",
"0.49541673",
"0.4943393",
"0.4938442",
"0.49170473",
"0.49053615",
"0.48839605",
"0.48360732",
"0.48297486",
"0.48225832",
"0.480... | 0.48560655 | 17 |
Get an existing UserGpgKey resource's state with the given name, id, and optional extra properties used to qualify the lookup. | def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
created_at: Optional[pulumi.Input[str]] = None,
key: Optional[pulumi.Input[str]] = None,
key_id: Optional[pulumi.Input[int]] = None,
user_id: Optional... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_state_by_id(state_id):\n for key, value in storage.all(\"State\").items():\n if state_id == value.id:\n return jsonify(value.to_dict())\n abort(404)",
"def get_state_by_id(state_id):\n my_state = storage.get('State', state_id)\n if my_state is None:\n abort(404)\n ... | [
"0.5549637",
"0.55430037",
"0.5496678",
"0.543263",
"0.5378798",
"0.53005373",
"0.5287543",
"0.5244176",
"0.51912683",
"0.51762015",
"0.51510936",
"0.5111083",
"0.51086766",
"0.5092615",
"0.50612205",
"0.5041373",
"0.50369424",
"0.5009481",
"0.50084484",
"0.49910453",
"0.4983... | 0.7061528 | 0 |
The time when this key was created in GitLab. | def created_at(self) -> pulumi.Output[str]:
return pulumi.get(self, "created_at") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def creation_time(self) -> str:\n return pulumi.get(self, \"creation_time\")",
"def creation_time(self) -> str:\n return pulumi.get(self, \"creation_time\")",
"def creation_time(self) -> str:\n return pulumi.get(self, \"creation_time\")",
"def creation_timestamp(self) -> str:\n re... | [
"0.7834208",
"0.7834208",
"0.7834208",
"0.78040594",
"0.78040594",
"0.78040594",
"0.7704223",
"0.7704223",
"0.7704223",
"0.7681726",
"0.7557174",
"0.7557174",
"0.7557174",
"0.7557174",
"0.7557174",
"0.7557174",
"0.7557174",
"0.7557174",
"0.7557174",
"0.7557174",
"0.7557174",
... | 0.65770125 | 97 |
The armored GPG public key. | def key(self) -> pulumi.Output[str]:
return pulumi.get(self, "key") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def public_key():\n if not Authorizer.__public_key:\n Authorizer.__public_key = download_public_key()\n return Authorizer.__public_key",
"def public_key(self):",
"def get_public_key(self):\n return self.public_key",
"async def client_public_key(self) -> bytes:\n raise N... | [
"0.7310315",
"0.7261075",
"0.7163275",
"0.71390903",
"0.71195096",
"0.71009403",
"0.7095869",
"0.70790446",
"0.69872767",
"0.69723666",
"0.6962964",
"0.6948088",
"0.69408524",
"0.6896595",
"0.68739593",
"0.6806223",
"0.6748333",
"0.6742872",
"0.67361313",
"0.66902655",
"0.657... | 0.0 | -1 |
The ID of the GPG key. | def key_id(self) -> pulumi.Output[int]:
return pulumi.get(self, "key_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def key_id(self):\n return self._key_id",
"def crypto_key_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"crypto_key_id\")",
"def key(self):\n return str(self._id)",
"def get_pgp_key_id(raw_key: bytes) -> str:\n # Flush stdout and stderr to prevent interleaving messages fr... | [
"0.76533425",
"0.73216677",
"0.7293038",
"0.72849256",
"0.7156193",
"0.71369255",
"0.7129503",
"0.7083336",
"0.70065194",
"0.6963701",
"0.69266695",
"0.6895049",
"0.6895049",
"0.6895049",
"0.6895049",
"0.6895049",
"0.6895049",
"0.6895049",
"0.6895049",
"0.6895049",
"0.6895049... | 0.7478572 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.