query stringlengths 9 9.05k | document stringlengths 10 222k | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
The count of data centers | def data_center_count(self) -> int:
return pulumi.get(self, "data_center_count") | [
"def cluster_obs_count(self):\n return(self.merged_data.groupby(\n 'labels').count().transpose().iloc[0, :])",
"def n_clusters(self):\n return len(self.clusters)",
"def get_cluster_count(self) -> int:\n return len(self.get_all_cluster_ids())",
"def nclusters(self):\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The expire time of the cluster. | def expire_time(self) -> str:
return pulumi.get(self, "expire_time") | [
"def expire_time(self) -> int:\n return pulumi.get(self, \"expire_time\")",
"def expire_time(self):\n return self._expire_time",
"def delete_lock_expire_time(self) -> str:\n return pulumi.get(self, \"delete_lock_expire_time\")",
"def expire_date(self):\n return self._expire_date",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The lock mode of the cluster. | def lock_mode(self) -> str:
return pulumi.get(self, "lock_mode") | [
"def lock_mode(self):\n return self._lock_mode",
"def oplock_level(self):\n return self._oplock_level",
"def lock_type(self):\n return self._lock_type",
"def cluster_mode(self):\n return self._cluster_mode",
"def lock_mode(self, lock_mode):\n self._lock_mode = lock_mode",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The major version of the cluster. | def major_version(self) -> str:
return pulumi.get(self, "major_version") | [
"def cluster_version(self) -> str:\n return pulumi.get(self, \"cluster_version\")",
"def _major_version(self):\n version_tuple = StrictVersion(self.plugin.version).version\n major = '.'.join(map(str, version_tuple[:2]))\n\n return major",
"def major(self):\n return self._major... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The minor version of the cluster. | def minor_version(self) -> str:
return pulumi.get(self, "minor_version") | [
"def get_minorversion(self):\n return core.las.LASHeader_GetVersionMinor(self.handle)",
"def minor_version(self):\n return self.unpack_dword(0x18)",
"def operatingsystem_version_minor(self):\n # type: () -> string_types\n return self._operatingsystem_version_minor",
"def minor(self... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The id of the Cassandra dataCenter. | def data_center_id(self) -> str:
return pulumi.get(self, "data_center_id") | [
"def datacenter_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"datacenter_id\")",
"def get_datacenter_id(options):\n datacenter = get_datacenter(options)\n return datacenter._GetMoId()",
"def get_datacenter_id():\n datacenter_id = config.get_cloud_config_value(\n \"d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The name of the Cassandra dataCenter. | def data_center_name(self) -> str:
return pulumi.get(self, "data_center_name") | [
"def datacenter(self) -> str:\n return pulumi.get(self, \"datacenter\")",
"def data_center_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"data_center_name\")",
"def datacenter(self) -> Optional[str]:\n return pulumi.get(self, \"datacenter\")",
"def data_center_id(s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A list of zone ids in which the multi zone. | def multi_zone_ids(self) -> Sequence[str]:
return pulumi.get(self, "multi_zone_ids") | [
"def zone_ids(self) -> \"list[str]\":\n return self._zone_ids",
"def get_zone_ids(self):\n # The zones are in a list, so there are no keys to pull out. I have to\n # create a new list of IDs.\n zone_list = []\n for zone in self.zones:\n zone_list.append(zone.zone_id)\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enviar data a firebase en chat. | def chat_firebase_db(data, room):
firebase = pyrebase.initialize_app(config)
db = firebase.database()
room = "chats/{}".format(room)
if exist_node(room):
res = db.child(room).update(data)
else:
res = db.child(room).set(data)
# chequear que los tipos de datos correspondan
if D... | [
"def send(self):\n url = \"https://chatbase.com/api/message\"\n return requests.post(url,\n data=self.to_json(),\n headers=Message.get_content_type())",
"def mark_uploaded_file(room, message_id, data):\n node = 'chats/' + room + '/' + Params... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remover query nodo en listado de clientes | def removeQueryAcceptList(specialist_id, client_id, query_id):
node_specialist = Params.PREFIX['specialist'] + str(specialist_id)
node_client = Params.PREFIX['client'] + str(client_id)
node_query = 'queries/{}'.format(Params.PREFIX['query'] + str(query_id))
main_node = "messagesList/specialist/{}/{}/{}... | [
"def remove(cliente: Cliente) -> bool:\n return remove_id(cliente.idd)",
"def del_query(self):\r\n for index in self.queries_list.curselection():\r\n self.queries_list.delete(index,index)\r\n del self.federation.queries[index]",
"def remove_client(self, client):\n self.cli... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Actualizar que el archivo se ha subido a firebase. | def mark_uploaded_file(room, message_id, data):
node = 'chats/' + room + '/' + Params.PREFIX['message'] + str(message_id)
firebase = pyrebase.initialize_app(config)
db = firebase.database()
if exist_node(node):
db.child(node).update(data)
if DEBUG_FIREBASE:
check_type_data('c... | [
"def updateFile(self):",
"def upload_finish(self, cloud_file):",
"def upload_image(resource, filename):\n # if we want to just overwrite the file, we would do\n # .child(resource).put(filename)\n # but we are going to create a new file now\n firebase.storage().child('ascii-' + resource).put(filename... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Elimina nodo de plan de clientes | def delete_actual_plan_client(client_id):
node_client = Params.PREFIX['client'] + str(client_id)
res = db.child("chosenPlans").child(node_client).remove()
return res | [
"def remove(cliente: Cliente) -> bool:\n return remove_id(cliente.idd)",
"def delete(self):\n app = App.get_running_app()\n id = self.manager.client.id\n app.session.query(Payment).filter(Payment.client_id == id).delete()\n app.session.query(Order).filter(Order.client_id == id).dele... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if all units_to_check have the same Dimension like the base_units If not | def check_matching_unit_dimension(
ureg: UnitRegistry, base_units: str, units_to_check: List[str]
) -> None:
base_unit = getattr(ureg, base_units)
for unit_string in units_to_check:
unit = getattr(ureg, unit_string)
if unit.dimensionality != base_unit.dimensionality:
raise Dime... | [
"def _check_dimensions(self, workspace_to_check):\n for i in range(self._raw_ws.getNumDims()):\n if self._raw_ws.getDimension(i).getNBins() != workspace_to_check._raw_ws.getDimension(i).getNBins():\n return False\n return True",
"def has_same_dimensions(self, other):\n if not unit_c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Plot the trace, but make breaks if the atoms pass over the periodic box so that very long lines aren't drawn | def _plot_trace(self, trace, axis, idx):
xy = [trace[0].value]
for prevrecord, record in zip(trace[:-1], trace[1:]):
if np.abs(prevrecord.value[0]-record.value[0]) > self.halfbox[0] or \
np.abs(prevrecord.value[1]-record.value[1]) > self.halfbox[1] :
xy = np.a... | [
"def plotTrace(trace):\n for t in trace:\n plt.plot(range(len(t)),t,alpha=0.5)\n plt.ylabel(\"Trace\")\n plt.xlabel(\"Step\")\n\n return",
"def plotTI():\n min_dl = dlam[dlam != 0].min()\n S = int(0.4/min_dl)\n fig = pl.figure(figsize = (8,6))\n ax = fig.add_subplot(1,1,1)\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test actions with mocked database. | def test_action_mocked(self):
with self.mock_global_connection:
self.assertEqual(0, Action.count())
manager = Manager(self.connection)
self.assertFalse(manager.is_populated())
manager.populate()
self.assertTrue(manager.is_populated())
sel... | [
"def setUp(self):\n self.database = Mock()",
"def test_retrieve_database(self):\n pass",
"def test_run_query(self):\n pass",
"def test_update_database(self):\n pass",
"def test_query(self):\n pass",
"def test_create_query(self):\n pass",
"def test_create_databas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Here we make sure that the variational_expectations gives the same result as logp if the latent function has no uncertainty. | def test_var_exp(self):
with self.test_context() as session:
test_setups, F, feed = self.prepare()
for test_setup in test_setups:
l = test_setup.likelihood
y = test_setup.Y
l.compile()
r1 = session.run(l.logp(F, y), feed_dic... | [
"def test_variational_expectations(likelihood_setup):\n likelihood = likelihood_setup.likelihood\n F = Datum.F\n Y = likelihood_setup.Y\n r1 = likelihood.log_prob(F, Y)\n r2 = likelihood.variational_expectations(F, tf.zeros_like(F), Y)\n assert_allclose(r1, r2, atol=likelihood_setup.atol, rtol=lik... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SoftMax assumes the class is given as a label (not, e.g., onehot encoded), and hence just uses the first column of Y. To prevent silent errors, there is a tf assertion that ensures Y only has one dimension. This test checks that this assert works as intended. | def test_softmax_y_shape_assert(session_tf):
F, Y, feed = _prepare(dimF=5, dimY=2)
l = gpflow.likelihoods.SoftMax(5)
l.compile()
try:
session_tf.run(l.logp(F, Y), feed_dict=feed)
except tf.errors.InvalidArgumentError as e:
assert "assertion failed" in e.message | [
"def test_softmax_y_shape_assert(num, dimF, dimY):\n F = tf.random.normal((num, dimF))\n dY = np.vstack((np.random.randn(num - 3, dimY), np.ones((3, dimY)))) > 0\n Y = tf.convert_to_tensor(dY, dtype=default_int())\n likelihood = Softmax(dimF)\n try:\n likelihood.log_prob(F, Y)\n except tf.e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This test is based on the observation that for symmetric inputs the class predictions must have equal probability. | def testSymmetric(self):
with self.test_context() as session:
nClasses = 5
nPoints = 10
tolerance = 1e-4
epsilon = 1e-3
F = tf.placeholder(settings.float_type)
F_data = np.ones((nPoints, nClasses))
feed = {F: F_data}
... | [
"def test_predictions_classification():\n\tn, p = 100, 10\n\tn_test = 50\n\tn_mc_samples = 15\n\t#(X_train, y_train), (X_test, y_test) = toy_binary_classification_data(n, p)\n\tbnn = BnnBinaryClassifier(verbose=0)\n\tbnn.fit(np.random.randn(n, p), np.random.randint(2, size=n))\n\tyhat_labels = bnn.predict(np.random... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks that eps K1 changes when epsilon changes. This used to not happen and had to be manually changed. | def testEpsK1Changes(self):
with self.test_context() as session:
initial_eps = 1e-3
num_classes = 5
rm = gpflow.likelihoods.RobustMax(num_classes, initial_eps)
expected_eps_k1 = initial_eps / (num_classes - 1.)
actual_eps_k1 = session.run(rm._eps_K1)
... | [
"def update_epsilon(self):\n if self.eps > self.eps_end:\n self.eps -= self.eps_decay\n\n # Reached final epsilon\n if self.eps <= self.eps_end:\n if not self.printStopExploration:\n self.dqn_print(msg=\"Finished exploration final eps = {:.2f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test the greedy strategy of the AI. | def test_greedy_strategy():
tiles = Tiles(800, 100)
board = Board(800, 100, tiles)
player = Player('Alfred', board, 'black')
ai = AI(board, player)
for i in range(board.count//2 + 1, board.count - 1):
board.add_tile(i, board.count//2 - 1, 'black')
assert ai.greedy_strategy()[0] == (board... | [
"def run_versus_greedy_bot(self):\n for i in range(len(self.individuals)):\n self.individuals[i].evaluate_versus_greedy_bot()\n # print(self.individuals[i].score)",
"def evaluate_versus_greedy_bot(self):\n game = Game()\n a = self\n b = greedy_bot\n while T... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test the occupy corner strategy of the AI. | def test_occupy_corner():
tiles = Tiles(800, 100)
board = Board(800, 100, tiles)
player = Player('Alfred', board, 'black')
ai = AI(board, player)
assert ai.occupy_corner() is False
for i in range(1, board.count//2 - 1):
board.add_tile(i, i, 'black')
assert ai.occupy_corner()[0] == (0... | [
"def test_best_move_has_corner_avoids_fork(self):\n state = [C,0,0,0,H,0,0,0,H]\n self.assertEquals(botMove(state),2)",
"def special_corner() -> None:\r\n if example[1, 1] == 0: # NW\r\n if conflict_space[0, 0] == conflict_space[0, 2] and conflict_space[2, 0] == conflict_space[0, 0] \\\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test the priority of occupy corner strategy and greedy strategy. | def test_prioritize():
tiles = Tiles(800, 100)
board = Board(800, 100, tiles)
player = Player('Alfred', board, 'black')
ai = AI(board, player)
board.add_tile(board.count//2 - 1, 0, 'white')
for i in range(1, board.count - 1):
if board.tiles_list[board.count//2 - 1][i] is None:
... | [
"def test_occupy_corner():\n tiles = Tiles(800, 100)\n board = Board(800, 100, tiles)\n player = Player('Alfred', board, 'black')\n ai = AI(board, player)\n assert ai.occupy_corner() is False\n for i in range(1, board.count//2 - 1):\n board.add_tile(i, i, 'black')\n assert ai.occupy_corn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts degrees to radians | def degrees_to_radians(degrees):
return degrees * math.pi / 180 | [
"def deg2rad(a):",
"def _deg_to_rad(deg):\r\n return deg * math.pi / 180",
"def deg_rad(deg):\r\n return deg*pi/180",
"def radians(self):\n self._setDegreesPerAU(2*math.pi)",
"def rad_to_deg(radians):\n if isinstance(radians, (Angle,)): #Ephem doesn't output a numerical value with unicode\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should retrieve position by id. | async def test_retrieve_position_by_id(self):
position = {
'id': '46214692',
'type': 'POSITION_TYPE_BUY',
'symbol': 'GBPUSD',
'magic': 1000,
'time': '2020-04-15T02:45:06.521Z',
'updateTime': '2020-04-15T02:45:06.521Z',
'openPric... | [
"def get_position_by_object_id(self, id):\n return self.entities_pos[id]",
"def get_vehicle_position(self, id_):\n if id_ in self._vehicles:\n return self._vehicles[id_].position",
"def get_pos_by_id(self, identifier):\n for i, b in enumerate(self.bookmarks):\n if b['i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should retrieve history orders by ticket. | async def test_retrieve_history_orders_by_ticket(self):
history_orders = {
'historyOrders': [{
'clientId': 'TE_GBPUSD_7hyINWqAlE',
'currentPrice': 1.261,
'currentVolume': 0,
'doneTime': '2020-04-15T02:45:06.521Z',
'id': ... | [
"def test_get_ticket_history(self):\n pass",
"def test_get_ticket_history_0(self):\n pass",
"def get_order_history(self):\n return self.__call__('orders', 'getorderhistory')",
"def get_history_orders(self):\n return self.engine.get_history_orders()",
"async def test_retrieve_hist... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should retrieve history orders by position. | async def test_retrieve_history_orders_by_position(self):
history_orders = {
'historyOrders': [{
'clientId': 'TE_GBPUSD_7hyINWqAlE',
'currentPrice': 1.261,
'currentVolume': 0,
'doneTime': '2020-04-15T02:45:06.521Z',
'id'... | [
"def get_history_orders(self):\n return self.engine.get_history_orders()",
"def get_order_history(self):\n return self.__call__('orders', 'getorderhistory')",
"def getOrderHistory(self):\n return self.__orderhistory",
"def foundOrderedHistories(self):\n return _pythia8.History_foun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should retrieve history orders by time range. | async def test_retrieve_history_orders_by_time_range(self):
history_orders = {
'historyOrders': [{
'clientId': 'TE_GBPUSD_7hyINWqAlE',
'currentPrice': 1.261,
'currentVolume': 0,
'doneTime': '2020-04-15T02:45:06.521Z',
'i... | [
"def _get_histohour_data_for_range(\n self,\n from_asset: AssetWithOracles,\n to_asset: AssetWithOracles,\n from_timestamp: Timestamp,\n to_timestamp: Timestamp,\n ) -> deque[dict[str, Any]]:\n msg = '_get_histohour_data_for_range from_timestamp shoul... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should retrieve history deals by ticket. | async def test_retrieve_history_deals_by_ticket(self):
deals = {
'deals': [{
'clientId': 'TE_GBPUSD_7hyINWqAlE',
'commission': -0.25,
'entryType': 'DEAL_ENTRY_IN',
'id': '33230099',
'magic': 1000,
'platfo... | [
"def test_get_ticket_history(self):\n pass",
"def test_get_ticket_history_0(self):\n pass",
"async def test_retrieve_history_orders_by_ticket(self):\n history_orders = {\n 'historyOrders': [{\n 'clientId': 'TE_GBPUSD_7hyINWqAlE',\n 'currentPrice': 1.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should retrieve history deals by position. | async def test_retrieve_history_deals_by_position(self):
deals = {
'deals': [{
'clientId': 'TE_GBPUSD_7hyINWqAlE',
'commission': -0.25,
'entryType': 'DEAL_ENTRY_IN',
'id': '33230099',
'magic': 1000,
'plat... | [
"def openPositionHistory(self):\n dt_only, tm_only = self.getDatetimeSplit()\n\n # GET OPEN POSITIONS\n open_positions_found = self.open_positions_history.find_one(\n {\"Date\": dt_only, \"Trader\": self.user[\"Name\"], \"Asset_Type\": self.asset_type, \"Account_ID\": self.account_id... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should retrieve history deals by time range. | async def test_retrieve_history_deals_by_time_range(self):
deals = {
'deals': [{
'clientId': 'TE_GBPUSD_7hyINWqAlE',
'commission': -0.25,
'entryType': 'DEAL_ENTRY_IN',
'id': '33230099',
'magic': 1000,
'pl... | [
"async def test_retrieve_history_orders_by_time_range(self):\n history_orders = {\n 'historyOrders': [{\n 'clientId': 'TE_GBPUSD_7hyINWqAlE',\n 'currentPrice': 1.261,\n 'currentVolume': 0,\n 'doneTime': '2020-04-15T02:45:06.521Z',\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should create market buy order. | async def test_create_market_buy_order(self):
trade_result = {
'error': 10009,
'description': 'TRADE_RETCODE_DONE',
'orderId': 46870472
}
client.trade = AsyncMock(return_value=trade_result)
actual = await api.create_market_buy_order('GBPUSD', 0.07, 0.9... | [
"def test_create_order(self):\n pass",
"async def test_create_market_sell_order(self):\n trade_result = {\n 'error': 10009,\n 'description': 'TRADE_RETCODE_DONE',\n 'orderId': 46870472\n }\n client.trade = AsyncMock(return_value=trade_result)\n a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should create market buy order with relative SL/TP. | async def test_create_market_buy_order_with_relative_sl_tp(self):
trade_result = {
'error': 10009,
'description': 'TRADE_RETCODE_DONE',
'orderId': 46870472
}
client.trade = AsyncMock(return_value=trade_result)
actual = await api.create_market_buy_order... | [
"async def test_create_market_buy_order(self):\n trade_result = {\n 'error': 10009,\n 'description': 'TRADE_RETCODE_DONE',\n 'orderId': 46870472\n }\n client.trade = AsyncMock(return_value=trade_result)\n actual = await api.create_market_buy_order('GBPUSD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should create market sell order. | async def test_create_market_sell_order(self):
trade_result = {
'error': 10009,
'description': 'TRADE_RETCODE_DONE',
'orderId': 46870472
}
client.trade = AsyncMock(return_value=trade_result)
actual = await api.create_market_sell_order('GBPUSD', 0.07, 0... | [
"def test_invalid_sell_order(self):\n\n _ = self.set_auth_token_header()\n\n data = {\n 'stock': 'GOOG',\n 'quantity': 15,\n 'price': 1.25,\n 'order_type': 'SELL'\n }\n\n # Order create API\n url = reverse('orders-list')\n respons... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should create limit buy order. | async def test_create_limit_buy_order(self):
trade_result = {
'error': 10009,
'description': 'TRADE_RETCODE_DONE',
'orderId': 46870472
}
client.trade = AsyncMock(return_value=trade_result)
actual = await api.create_limit_buy_order('GBPUSD', 0.07, 1.0, ... | [
"def createLimitOrder(self, action, instrument, limitPrice, quantity):\n raise NotImplementedError()",
"async def new_limit_order(side):\n symbol = App.config[\"symbol\"]\n now_ts = now_timestamp()\n\n #\n # Find limit price (from signal, last kline and adjustment parameters)\n #\n last_k... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should create limit sell order. | async def test_create_limit_sell_order(self):
trade_result = {
'error': 10009,
'description': 'TRADE_RETCODE_DONE',
'orderId': 46870472
}
client.trade = AsyncMock(return_value=trade_result)
actual = await api.create_limit_sell_order('GBPUSD', 0.07, 1.0... | [
"def limit_sell(self,quantity, price):\n\n self.is_tickSize_valid(price)\n\n side=\"Sell\"\n order = self.make_order(\n quantity=quantity, \n price=price,\n side=side, \n )\n return order",
"def createLimitOrder(self, action, instrument, limitPri... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should create stop buy order. | async def test_create_stop_buy_order(self):
trade_result = {
'error': 10009,
'description': 'TRADE_RETCODE_DONE',
'orderId': 46870472
}
client.trade = AsyncMock(return_value=trade_result)
actual = await api.create_stop_buy_order('GBPUSD', 0.07, 1.0, 0.... | [
"async def test_create_stop_sell_order(self):\n trade_result = {\n 'error': 10009,\n 'description': 'TRADE_RETCODE_DONE',\n 'orderId': 46870472\n }\n client.trade = AsyncMock(return_value=trade_result)\n actual = await api.create_stop_sell_order('GBPUSD',... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should create stop sell order. | async def test_create_stop_sell_order(self):
trade_result = {
'error': 10009,
'description': 'TRADE_RETCODE_DONE',
'orderId': 46870472
}
client.trade = AsyncMock(return_value=trade_result)
actual = await api.create_stop_sell_order('GBPUSD', 0.07, 1.0, ... | [
"def createStopOrder(self, action, instrument, stopPrice, quantity):\n raise NotImplementedError()",
"def _create_stop(self, price_stop):\n if self.price_stop is not None:\n return(order(self.symbol, -self.volume, style=StopOrder(self.price_stop))) # , exchange=self.order_master.style.exc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should create stop limit buy order. | async def test_create_stop_limit_buy_order(self):
trade_result = {
'error': 10009,
'description': 'TRADE_RETCODE_DONE',
'orderId': 46870472
}
client.trade = AsyncMock(return_value=trade_result)
actual = await api.create_stop_limit_buy_order('GBPUSD', 0... | [
"def createStopLimitOrder(self, action, instrument, stopPrice, limitPrice, quantity):\n raise NotImplementedError()",
"async def test_create_stop_limit_sell_order(self):\n trade_result = {\n 'error': 10009,\n 'description': 'TRADE_RETCODE_DONE',\n 'orderId': 46870472... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should create stop limit sell order. | async def test_create_stop_limit_sell_order(self):
trade_result = {
'error': 10009,
'description': 'TRADE_RETCODE_DONE',
'orderId': 46870472
}
client.trade = AsyncMock(return_value=trade_result)
actual = await api.create_stop_limit_sell_order('GBPUSD',... | [
"def createStopLimitOrder(self, action, instrument, stopPrice, limitPrice, quantity):\n raise NotImplementedError()",
"def limit_sell(self,quantity, price):\n\n self.is_tickSize_valid(price)\n\n side=\"Sell\"\n order = self.make_order(\n quantity=quantity, \n pric... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should retrieve symbol specification. | async def test_retrieve_symbol_specification(self):
specification = {
'symbol': 'AUDNZD',
'tickSize': 0.00001,
'minVolume': 0.01,
'maxVolume': 100,
'volumeStep': 0.01
}
client.get_symbol_specification = AsyncMock(return_value=specificat... | [
"def specification(self, symbol: str) -> MetatraderSymbolSpecification:\n return self._specificationsBySymbol[symbol] if (symbol in self._specificationsBySymbol) else None",
"def get_symbol(self):\n return self.symbol",
"def get_symbol(self, symbol, stats):\n\n raise NotImplementedError()",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should retrieve symbol price. | async def test_retrieve_symbol_price(self):
price = {
'symbol': 'AUDNZD',
'bid': 1.05297,
'ask': 1.05309,
'profitTickValue': 0.59731,
'lossTickValue': 0.59736
}
client.get_symbol_price = AsyncMock(return_value=price)
actual = aw... | [
"def get_price(self):\r\n try:\r\n self.price = self.exchange.symbol_ticker()\r\n except Exception as e:\r\n pass",
"def retrievePrice(self):\n pass",
"def price(self, symbol: str) -> MetatraderSymbolPrice:\n return self._pricesBySymbol[symbol] if (symbol in sel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should retrieve latest tick. | async def test_retrieve_latest_tick(self):
tick = {
'symbol': 'AUDNZD',
'time': '2020-04-07T03:45:00.000Z',
'brokerTime': '2020-04-07 06:45:00.000',
'bid': 1.05297,
'ask': 1.05309,
'last': 0.5298,
'volume': 0.13,
'si... | [
"def last_tick_time(self):\n return self.last_tick_",
"def get_tick(self):\n return self._tick",
"def tick(self):\n prev_last_tick = self.last_tick_\n self.last_tick_ = timeit.default_timer()\n latest_tick_period = self.last_tick_ - prev_last_tick\n return latest_tick_period",
"def curre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should retrieve latest order book. | async def test_retrieve_latest_order_book(self):
book = {
'symbol': 'AUDNZD',
'time': '2020-04-07T03:45:00.000Z',
'brokerTime': '2020-04-07 06:45:00.000',
'book': [
{
'type': 'BOOK_TYPE_SELL',
'price': 1.0530... | [
"def get_order_book(self, symbol):\n return self.request('book/' + symbol)",
"def latest_order_book_entry(symbol: str,\n exchange: str = CRYPTO_EXCHANGE,\n rate_limit: bool = True):\n try:\n check_exchange_existence(exchange=exchange)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply random errors using ErrorClass.calculate_errors | def apply_errors(star_name, arr, arr_err, nn):
if nn > 0:
errors = error_propagation.ErrorClass(
error_tables = "error_tables_ba.dat",
temperature_table = "bastars_temp.dat",
element_set = "element_set.dat")
error_diff = errors.calculate_errors(star_... | [
"def _random_error(self):\n return self._random_magnitude_error()[1]",
"def apply_error(self, word, error_function):\n # maximum number of errors we can make in this word\n max_err = max(1, int(len(word) * self.MAX_ERRORS))\n \n # number of errors we will make in this word\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate best dilution for this model and data if processed_models is None, then model is taken to be a label otherwise model is taken as a model | def calculate_dilution(data, model, processed_models = None, lower = 0,
upper = 1):
if processed_models is not None:
# Assign label
label = model
with open(processed_models, "r") as fread:
# Read header
fread.readline()
# Find mod... | [
"def pick_best_model(self, data):\n self.best_model_ = None\n self.best_performance_ = 0\n\n split_indexes = list(self.splitter_.split(data))\n for i in range(0, len(self.models_)):\n print 'Fitting model', self.models_[i].get_name(), '...'\n performance = self.esti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate a distance between model and data | def get_distance(model, data):
# L square
len_shape = len(data.shape)
if len_shape == 2:
dist = np.mean((model - data) ** 2, axis = 1)
elif len_shape == 1:
dist = np.mean((model - data) ** 2)
else:
raise NotImplementedError
return dist | [
"def distance(self,data,replica):",
"def distance(source, DM, model='NE2001'):\n\n d=SkyModel(dmmodel=model)\n return d.distance(source, DM)",
"def get_distance(self): \n return self.from_station.distance_to(self.to_station)",
"def euclidian_distance(data1, data2, parameters, model):\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a BruttoFace object. | def make_bruttoface(space_boundary, other_space, BaseFace=None, doc=None):
if not doc:
doc = App.activeDocument()
obj = doc.addObject("Part::FeaturePython",
"BruttoFace" + space_boundary.Name)
BruttoFace(obj)
obj.Space = space_boundary.Space
obj.Space2 = other_space... | [
"def create( self, fontStyle, mode=None ):",
"def make_legend_face(face):\n if face is None:\n legendface = pyvista.PolyData([0.0, 0.0, 0.0])\n elif face in [\"-\", \"line\"]:\n legendface = _line_for_legend()\n elif face in [\"^\", \"triangle\"]:\n legendface = pyvista.Triangle()\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests storing the computer as a backend when a string is given. | def test_computer_string(self):
# Computer to use for the network
comp = "1q-qvm"
# Get a network with the computer
qnn = self.get_test_network(comp)
# Checks
self.assertEqual(type(qnn.computer), QuantumComputer) | [
"def test_set_backend_to_windows_win32(self):\n with self.assertRaises(ValueError):\n self.desktop.windows(backend='win32')\n with self.assertRaises(ValueError):\n self.desktop.windows(backend='uia')",
"def using_backend(test_backend):\n require_set_backend()\n if isinsta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests compiling a network for all data points. | def test_compile(self):
# Get a network
qnn = self.get_test_network("1q-qvm")
# Compile a data point
executable = qnn.compile(index=0, shots=1000)
# Checks
self.assertEqual(type(executable), Program) | [
"def test_generate_subnetworks_allports(self):\n ntwk = rf.Network(os.path.join(self.test_dir,'ntwk.s32p'))\n for m in range(ntwk.nports):\n for n in range(ntwk.nports):\n npy.testing.assert_array_almost_equal(\n ntwk.s[:,m,n],\n getattr(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests propagating a data point through a network. | def test_propagate(self):
# Get network components
data = array([[0], [1]])
cdata = LabeledCData(data, labels=array([0, 1]))
encoder = BinaryEncoding(cdata)
unitary = ProductAnsatz(1)
measure = Measurement(1, [0])
qnn = Network([encoder, unitary, measure], "1q-qvm... | [
"def test_nn_forward_propagation_precomputed():\n pass",
"def test_nn_point(test_data):\n xp, yp, z = test_data\n\n tri = Delaunay(list(zip(xp, yp)))\n\n sim_gridx = [30]\n sim_gridy = [30]\n\n members, tri_info = find_natural_neighbors(tri,\n list(z... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests propagating a data point through a network with specified angles for the ansatz. | def test_propagate_with_angles(self):
# Get network components
data = array([[0], [1]])
cdata = LabeledCData(data, labels=array([0, 1]))
encoder = BinaryEncoding(cdata)
ansatz = ProductAnsatz(1)
measure = Measurement(1, [0])
# Make the network
qnn = Netwo... | [
"def test_approach_point_from_angle_consistent(self):\n\n for _ in range(10):\n test_point, test_angle = Point(cartesian=list((8 * rand(3)) + 8)), (30 * random()) - 15\n state = approach_point_from_angle(test_point, test_angle)\n for expect, test in zip(test_point.cartesian, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that Network.cost returns a correct value for a given Network.. | def test_cost(self):
# Get components for the network
data = array([[1, 0], [0, 1]])
cdata = LabeledCData(data, labels=array([0, 1]))
encoder = BinaryEncoding(cdata)
ansatz = ProductAnsatz(2)
measure = Measurement(2, [0, 1])
# Define a basic predictor (function w... | [
"def test_cost(self):\n self.assertAlmostEqual(m2.cost(params), 57.629, 2)",
"def test_check_cost():",
"def test_cost(self):\n self.assertTrue(\n int(self.ospf.parse_state(\n pattern='cost',\n cmd_key='sh_ospf_ints')) == 10, 'OSPF Interface: cost not found'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List all survivors, or create a new survivor | def survivor_list(request):
if request.method == 'GET':
survivor = Survivor.objects.all()
serializer = SurvivorSerializer(survivor, many=True)
return Response(serializer.data)
elif request.method == 'POST':
data = request.data
serializer = SurvivorSerializer(data=data)
... | [
"def get_survivors(self, return_type=False):\n\n survivors = list(mdb.survivors.find({\"$or\": [\n {\"email\": self.user[\"login\"]},\n {\"created_by\": self.user[\"_id\"]},\n ], \"removed\": {\"$exists\": False}}\n ).sort(\"name\"))\n\n # user version\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve the reports about the survivors | def survivor_reports(request):
if request.method == 'GET':
data = {}
total_survivors = infected = non_infected = water = food = medication = ammunition = pointslost = 0
for i in Survivor.objects.all():
total_survivors += 1
if i.infected is False:
non_... | [
"def survivor_list(request):\n if request.method == 'GET':\n survivor = Survivor.objects.all()\n serializer = SurvivorSerializer(survivor, many=True)\n return Response(serializer.data)\n\n elif request.method == 'POST':\n data = request.data\n serializer = SurvivorSerializer... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the location of survivor | def survivor_update_location(request, pk):
try:
survivor = Survivor.objects.get(pk=pk)
except Survivor.DoesNotExist:
return Response(status=status.HTTP_404_NOT_FOUND)
if request.method == 'PATCH':
data = request.data
for item in data.keys():
if len(data) != 2:
... | [
"def remove(self):\n self.logger.info(\"[%s] Removing survivor %s\" % (self.User, self))\n self.survivor[\"removed\"] = datetime.now()\n mdb.survivors.save(self.survivor)\n\n self.Settlement.increment_population(-1)\n\n self.Settlement.log_event(\"%s has been permanently deleted f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Flag one survivor as infected, starting from his id If gets a 3 flags, the boolean infected turns True | def survivor_flag_as_infected(request, pk):
try:
survivor = Survivor.objects.get(pk=pk)
except Survivor.DoesNotExist:
return Response(status=status.HTTP_404_NOT_FOUND)
def repeated_id_verify(list_id, id_to_verify):
if len(list_id) == 0:
list_id.append(id_to_verify)
... | [
"def infected_present(self):\n for x in self.population.flatten():\n if x.state == State.infected:\n return True\n return False",
"def _infect(self, infectee, time, probab, color):\n p = uniform_probability() + self.vaccinated\n if p <= probab:\n in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find the first matching pattern. If found, return the (pattern, match) tuple. If not, return (None,None). The "patterns" arugment is an itterable of compiled regular expressions, but see the compile_filename_patterns() function also in this module for a way to make this far more general. | def first_match(s,patterns):
for p in patterns:
m=p.match(s)
if m:
return p,m
return None,None | [
"def find_pattern(path, patterns):\n regular_expression = get_regular_expression(path)\n results = get_patterns_that_match(regular_expression, patterns)\n if(len(results) > 1):\n best_matching_pattern = check_best_matching_pattern(results)\n elif(len(results) == 1):\n best_matching_pattern... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a sequence of filespecs, regular expressions (prefixed with | def compile_filename_patterns(pattern_list):
pats=list(pattern_list)
for i in range(len(pats)):
if isinstance(pats[i],str):
if pats[i].startswith('re:'):
pats[i]=pats[i][3:]
else:
pats[i]=fnmatch.translate(pats[i])
pats[i]=re.compile(pats[i])
return pats | [
"def regexes_from_wildcards(strings):\n regexes = []\n if strings:\n for glob in strings:\n glob = glob.strip()\n # ignore empty wildcards\n if glob:\n # \\Z means end of string, (?ms) means accept either\n # the M multiline flag or S, whic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the given value quotted and escaped as necessary for a Unix shell to interpret it as a single value. >>> print(shellify(None)) '' >>> print(shellify(123)) 123 >>> print(shellify(123.456)) 123.456 >>> print(shellify("This 'is' a test of a (messy) string.")) 'This '"'"'is'"'"' a test of a (messy) string.' >>> prin... | def shellify(val):
if val==None:
s=''
elif not isinstance(val,str):
s=str(val)
else:
return shlex.quote(val)
return shlex.quote(s) | [
"def __shellquote(s):\n return \"'\" + s.replace(\"'\", \"'\\\\''\") + \"'\"",
"def shell_quote(s):\n return \"\\\"%s\\\"\" % s.replace('\"', '\\\"')",
"def shell_escape( cmd ):\n if type(cmd) == type(''):\n return ' '.join( [ pipes.quote(s) for s in shlex.split( cmd ) ] )\n return ' '.join( [ ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the full path to a reasonable guess at what might be a temp direcory on this system, creating it if necessary using the given permissions. If no permissions are given, we'll base the perms on the current umask. | def findMainTempDir(self,perms=None):
# Let the environment tell us where our temp directory is, or ought
# to be, or just use /tmp if the enrionment lets us down.
d=os.path.abspath(
os.environ.get('TMPDIR',
os.environ.get('TEMP',
os.environ.get('TMP',os.path.join(os.sep,'tmp'))
)))
... | [
"def mkpath(filepath, permissions=0o777):\n # Converting string of octal to integer, if string is given.\n if isinstance(permissions, str):\n permissions = sum([int(x)*8**i for i,x in enumerate(reversed(permissions))])\n # Creating directory\n if not os.path.exists(filepath):\n debug.log(\"Creatin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Open (and likely create, but at least truncate) a temp file for this program, and return the open (for reading and writing) file object. See the our "temp" attribute for the name of the file. Remove this file at program termination unless the "keep" argument is False. | def makeTempFile(self,perms=0o600,keep=False):
fd=os.open(self.temp,os.O_RDWR|os.O_CREAT|os.O_EXCL|os.O_TRUNC,perms)
f=os.fdopen(fd,'w+')
if not keep:
atexit.register(os.remove,self.temp)
return f | [
"def _temporary_file():\r\n return tempfile.mkstemp()[1]",
"def _mktemp(self):\r\n fd, name = mkstemp(dir=self.temp_dir)\r\n try:\r\n file_obj = os.fdopen(fd, 'wb')\r\n return file_obj, name\r\n except:\r\n _removeIfPresent(name)\r\n raise",
"d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read a single keystroke from stdin. The user needn't press Enter. This function returns the character as soon has it is typed. The character is not echoed to the screen unless the "echo" argument is True. If "prompt" is some true value, write that string to standard output before getting the input character, and then a... | def getch(prompt=None,echo=False):
import termios
import sys, tty
def _getch():
fd = sys.stdin.fileno()
old_settings=termios.tcgetattr(fd)
try:
tty.setraw(fd)
ch = sys.stdin.read(1)
finally:
termios.tcsetattr(fd,termios.TCSADRAIN,old_settings)
return ch
if prompt:
sys... | [
"def _readchar() -> str: # pragma: no cover\n if not sys.stdin.isatty():\n return sys.stdin.read(1)\n fd = sys.stdin.fileno()\n old_settings = termios.tcgetattr(fd)\n new_settings = termios.tcgetattr(fd)\n new_settings[3] = new_settings[3] & ~termios.ECHO & ~termios.ICANON\n termios.tcseta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add an RSS stream to the database. | def add_rss(url): | [
"def add_feed(self, feed):\n url = feed_argument(feed)\n with self.db:\n try:\n self.db.execute(\"\"\"\n INSERT INTO feeds (url)\n VALUES (:url);\n \"\"\", locals())\n except sqlite3.IntegrityError:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Changes the discord rank of a user, removes other rank roles and adds the new one. Visitor, Friend, Developer, or Moderator. | async def _changerank(self, ctx, user: discord.Member, *, level):
level = level.lower()
if level == 'visitor':
await self.remove_roles(user, ctx)
await self.usual_rank(user)
embed = Config(self.bot).embed()
embed.description = f"{user.mention}'s level ha... | [
"def cmd_rank(self, client, username = None, rank = None):\n if username == None:\n username = self.chat.identify(client)\n if not rank:\n caller = self.chat.identify(client)\n acct_rank = Account.get_rank(username)\n return StatusMessage(\"%s has rank %s.\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test that mode=transit raises exception when no departure or arrival time is set | def test_directions_mode_transit_invalid_request():
with pytest.raises(errors.InvalidRequest):
api.directions(u"Warsaw, Poland", u"Katowice, Poland", mode="transit") | [
"def test_flight_slots_arrivals_on_cancellation(fake):\n fs = fake.flight_slot(cancelled=True)\n\n assert fs.actualarrival is None\n assert fs.actualdeparture is None",
"def test_flight_slots_diff_actual_arrival_departure(fake):\n\n fs = fake.flight_slot(cancelled = False)\n assert fs.actualarrival... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that the .encryptObjectFromFile() method raises JSONDecodeError when the provided .json file cannot be deserialized | def test_deserialization_error():
tree = MerkleTree()
with pytest.raises(json.JSONDecodeError):
tree.encryptObjectFromFile(
os.path.join(os.path.dirname(__file__),
'objects/bad.json')
) | [
"def test_verifies_token_file_contains_json(self):\n\n with open(self.sample_token_file, 'w',\n encoding=\"utf8\", errors=\"surrogateescape\") as stf_h:\n stf_h.write(\"Bad JSON\")\n\n with self.assertRaises(json.decoder.JSONDecodeError):\n badgr = BadgrLite(toke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that the .encryptFilePerObject() method raises WrongJSONFormat when the deserialized object loaded from the provided file is not a list | def test_WronJSONFormat():
tree = MerkleTree()
with pytest.raises(WrongJSONFormat):
tree.encryptFilePerObject(
os.path.join(os.path.dirname(__file__),
'objects/sample.json')
) | [
"def test_deserialization_error():\n\n tree = MerkleTree()\n\n with pytest.raises(json.JSONDecodeError):\n tree.encryptObjectFromFile(\n os.path.join(os.path.dirname(__file__),\n 'objects/bad.json')\n )",
"def test_file(self):\n try:\n with open( setting... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sort on one specific quantile or on weighted value of all quants | def sort(self, quant=None):
if quant is None: # sort bei weight
self.__sortlist = [key for key, values in sorted(self.__quantile.items(), key=lambda items: sum((10^quantille * count for quantille, count in enumerate(items[1].values()))))]
elif isinstance(quant, int):
self.__sortl... | [
"def sortByQValue(a, b):\n return cmp(float(b.params.get('q', '1.0')), float(a.params.get('q', '1.0')))",
"def lower_quartile(data: Iterable[Real]) -> Real:\n ordered = sorted(data)\n\n return lower_quartile_sorted(ordered)",
"def lower_quartile_sorted(data: Sequence[Real]) -> Real:\n return median(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the client objects used to communicate with Pachyderm. | def get_clients(self):
return (self._clients['pps'], self._clients['pfs']) | [
"def clients(self):\n return self._clients",
"def getClientInterfaces(self):\n return self.clients",
"def clients(self):\n return MappingProxyType(self._server.clients\n if self._server else {})",
"def get_client_list(self):\n return self.__clients_li... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the client objects to communicate with Pachyderm. | def set_clients(self, pps, pfs):
self._clients = {
'pps': pps,
'pfs': pfs
} | [
"def clients(self, clients):\n\n self._clients = clients",
"def client(self, client):\n self._client = client",
"def update_clients(self):\n pass",
"def setup_clients(cls):\n super(ValetGroupsTest, cls).setup_clients()\n cls.client = cls.valet_client",
"def clients_initial... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up a workflow session. This creates a selfcontained set of Pachyderm constructs representing our operation. | def make_session(self):
clients = self._clients
name = 'doorstep-%s' % str(uuid.uuid4())
data_name = '%s-data' % name
processors_name = '%s-processors' % name
pipeline_definition = self.get_definition(
data_name=data_name,
processors_name=processors_nam... | [
"def _setup():\n\n # Set random seeds\n tf.set_random_seed(CONFIG.seed)\n np.random.seed(CONFIG.seed)\n\n gs_env = tf.Variable(0, trainable=False, name='global_step_env')\n inc_gs = tf.assign_add(gs_env, 1)\n\n # Make the gym environment\n if CONFIG.env == 'mnist':\n env = MNIST()\n e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wait until pipeline has completed. | async def _wait_for_pipeline(pipeline, retry_count, retry_processing_count, retry_delay):
async def _tick_callback():
sys.stdout.write('.')
sys.stdout.flush()
await asyncio.sleep(retry_delay)
# Wait for pipeline run to start
await pipeline.wait_for_run(
... | [
"def wait_until_finished(self):\n for processor in self._processors.values():\n while not processor.done:\n time.sleep(0.1)",
"def wait_till_pipeline_is_done(adf_client, run_response):\n status = \"\"\n while status != \"Succeeded\":\n pipeline_run = adf_client.pipeli... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get an existing EventFeedChart 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,
description: Optional[pulumi.Input[str]] = None,
end_time: Optional[pulumi.Input[int]] = None,
name: Optional[pulumi.Input[str]] = None,
program_text:... | [
"def get(resource_name, id, opts=None):\n opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))\n\n __props__ = dict()\n\n return Event(resource_name, opts=opts, __props__=__props__)",
"def get_state_from_id(self, id_s):\n if self._disc_state:\n return id_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called with TestWithMetaClass() called since it is of type TestMetaClass cls will be TestWithMetaClass | def __call__(cls, *args, **kwargs):
print('TestMetaClass.__call__()')
return cls.__new__(cls, *args, **kwargs) | [
"def test_class_started(self, cls):",
"def test(cls):\n _tests.append(cls)\n return cls",
"def test_metaclass(self):\n\n @Configurable(conf=Parameter('test', value=True))\n class MetaTest(type):\n pass\n\n @add_metaclass(MetaTest)\n class Test(object):\n p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Translate an image and a mask | def augment_translate(image, mask, trans_range):
tr_x = trans_range * np.random.uniform() - trans_range / 2
tr_y = trans_range * np.random.uniform() - trans_range / 2
trans_M = np.array([[1, 0, tr_x], [0, 1, tr_y]], dtype=np.float32)
width, height, _ = image.shape
image = cv2.wa... | [
"def translate_im(img, mask, kps, tx, ty):\n width, height = img.shape[1], img.shape[0]\n # get rotation matrix,2x3 [R|t],regard the translation to be a rotation without rotating\n M = np.array([[1, 0, tx],\n [0, 1, ty]], dtype=np.float32)\n # translate the image\n translated_img = c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a mirror reflection of an image | def mirror(image):
return cv2.flip(image, 1) | [
"def mirror(image):\n return mirror_horizontally(image)",
"def mirror_image(self):\n # Use the braid information if it is the shortest version\n # of what we have already computed\n if self._braid:\n lb = len(self._braid.Tietze())\n\n if self._pd_code:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test location endpoints permissions. | def test_location_permissions(client, testdata, json_headers, users):
dummy_location = dict(
name=_LOCATION_NAME,
opening_weekdays=[
{"weekday": w, "is_open": True, "times": _DEFAULT_TIMES} for w in _WEEKDAYS
],
opening_exceptions=[],
)
tests = [
("admin",... | [
"def test_resource_server_location_endpoint(self):\n endpoint = settings.RESOURCE_SERVER_LOCATION_ENDPOINT\n access_token = config.ACCESS_TOKEN\n self.assertValidGetOicJsonEndpoint(endpoint, access_token)",
"def test_pds_location_endpoint(self):\n endpoint = settings.PDS_LOCATION_ENDPO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function uses Spacy, open source NLP toolkit to find the most frequent words and parts of speech and return only nouns and verbs for word cloud | def pos_text(text):
nlp = spacy.load('en')
doc = nlp(text)
# all tokens that arent stop words or punctuations
words = [token.text.encode('ascii', 'ignore') for token in doc if token.is_stop != True and token.is_punct != True]
# noun tokens that arent stop words or punctuations
final_tokens = [t... | [
"def extract_nouns(article_content):\r\n #load spacy for English\r\n doc = nlp(article_content)\r\n compound_val = '';#For compound words, Ex: First token is Donald, and second token is Trump.\r\n #It would be better to do a wiki search for \"Donald Trump\" than \"Donald\" and \"Trump\" separately \r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the user doesn't run the program with super user privileges, don't allow them to continue. | def in_sudo_mode():
if not 'SUDO_UID' in os.environ.keys():
print("Try running this program with sudo.")
exit() | [
"def root_user_check():\n\n if not os.getuid() == 0:\n print(\"This program requires ROOT privileges. Exiting.\")\n sys.exit()",
"def ensure_sudo() -> None:\n user = cmd(\"whoami\")\n if \"root\" not in user:\n logger.error(f\"You need to be the root user to run this program but you ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is used to find the network interface controllers on your computer. | def find_nic():
result = subprocess.run(["iw", "dev"], capture_output=True).stdout.decode()
network_interface_controllers = wlan_code.findall(result)
return network_interface_controllers | [
"def getControllers():\n \n # Check enabled bluetooth service\n changeBluetoothService(enable=True)\n \n #proc = os.popen('bluetoothctl list').read()\n blueListStdout = execCommand('bluetoothctl list')\n \n # Get controller's MAC and name to list\n cntList = list()\n for line in blueLi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function needs the network interface controller name to put it into monitor mode. | def set_monitor_mode(controller_name):
subprocess.run(["ip", "link", "set", wifi_name, "down"])
subprocess.run(["airmon-ng", "check", "kill"])
subprocess.run(["iw", wifi_name, "set", "monitor", "none"])
subprocess.run(["ip", "link", "set", wifi_name, "up"]) | [
"def put_wifi_interface_in_monitor_mode(\n interface: str, path_to_airmon_ng: str, sudo_pwd: str\n) -> str:\n interfaces_before = net_interfaces()\n run_with_sudo(\n \"%s start %s\" % (path_to_airmon_ng, interface),\n sudo_pwd,\n \"PHY\",\n [\"processes that could cause trouble\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If you have a 5Ghz network interface controller you can use this function to put monitor either 2.4Ghz or 5Ghz bands or both. | def set_band_to_monitor(choice):
if choice == "0":
subprocess.Popen(["airodump-ng", "--band", "bg", "-w", "file", "--write-interval", "1", "--output-format", "csv", wifi_name], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
elif choice == "1":
subprocess.Popen(["airodump-ng", "--band", "a... | [
"def net_monitor_set(cs, args):\n cls_print.print_monitor_list(cs.net_monitor.set(\n args.test_ip,\n args.default_gw,\n args.switch_gw\n ).json()\n )",
"def __init__... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Move all .csv files in the directory to a new backup folder. | def backup_csv():
for file_name in os.listdir():
if ".csv" in file_name:
print("There shouldn't be any .csv files in your directory. We found .csv files in your directory.")
directory = os.getcwd()
try:
os.mkdir(directory + "/backup/")
except:
... | [
"def collect_csv(source_dir, dest_dir):\n source_dir = Path(source_dir)\n dest_dir = Path(dest_dir)\n for csvfile in source_dir.rglob(\"*.csv\"):\n species = normalized_species(csvfile)\n species_dir = dest_dir / species\n species_dir.mkdir(exist_ok=True, parents=True)\n date_ti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Will check if there is an ESSID in the list and then send False to end the loop. | def check_for_essid(essid, lst):
check_status = True
if len(lst) == 0:
return check_status
for item in lst:
if essid in item["ESSID"]:
check_status = False
return check_status | [
"def disconnect_from_wifi_network(SSID):\r\n Disconnect_cmd=\"./wifi disconnect \"+ SSID\r\n get_output=subprocess.Popen(Disconnect_cmd,stdin=subprocess.PIPE,stdout=subprocess.PIPE, stderr=subprocess.PIPE,shell=True)\r\n print(\"output \",get_output.stderr.readlines())\r\n for ele in get_output.stderr.r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loop that shows the wireless access points. We use a try except block and we will quit the loop by pressing ctrlc. | def wifi_networks_menu():
active_wireless_networks = list()
try:
while True:
subprocess.call("clear", shell=True)
for file_name in os.listdir():
fieldnames = ['BSSID', 'First_time_seen', 'Last_time_seen', 'channel', 'Speed', 'Privacy', 'Cipher', 'Authenticatio... | [
"def _wireless_autoconnect(self):\n print \"No wired connection present, attempting to autoconnect\" + \\\n \"to wireless network\"\n if self.GetWirelessInterface() is None:\n print 'Autoconnect failed because wireless interface returned None'\n return\n for x... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SET YOUR NETWORK CONTROLLER INTERFACE INTO MANAGED MODE & RESTART NETWORK MANAGER | def set_into_managed_mode(wifi_name):
subprocess.run(["ip", "link", "set", wifi_name, "down"])
subprocess.run(["iwconfig", wifi_name, "mode", "managed"])
subprocess.run(["ip", "link", "set", wifi_name, "up"])
subprocess.run(["service", "NetworkManager", "start"]) | [
"def reset_network():\n _execute(\"sudo service network-manager stop\")\n _execute(\"sudo rm -f /var/lib/NetworkManager/NetworkManager.state\")\n _execute(\"sudo service network-manager start\")",
"def restartNetworkManager(cls):\n nms = 'network-manager'\n nm_is_running = os.system('servic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Installing Nukestudio integration for avalon | def install(config):
# adding all events
_register_events()
log.info("Registering NukeStudio plug-ins..")
pyblish.register_host("nukestudio")
pyblish.register_plugin_path(PUBLISH_PATH)
avalon.register_plugin_path(avalon.Loader, LOAD_PATH)
avalon.register_plugin_path(avalon.Creator, CREATE_... | [
"def _install_ngs_tools():\n # XXX to do:\n # BWA\n # Bowtie\n # Fastx toolkit\n # samtools\n pass",
"def install_asuite_plugin(self):",
"def setup():\n\n # check version and download the latest version\n get_latest_codeql()\n # install vscode?\n # clone codeql libs\n # setup vs... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Event for automatic tag creation after nukestudio start | def add_tags(event):
add_tags_from_presets() | [
"def test_create_tag(self):\n pass",
"def test_create_tag_for_workspace(self):\n pass",
"def generate_entry_tags(sender, instance, created, raw, using, **kwargs):\n Tag.objects.create_tags(instance)",
"def new_tag(self):\n tag = self.tag_text.get(\"1.0\", 'end-1c')\n self.tags.a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Event for launching workfiles after nukestudio start | def launch_workfiles_app(event):
from .lib import set_workfiles
set_workfiles()
# Closing the new project.
event.sender.close()
# Deregister interest as its a one-time launch.
hiero.core.events.unregisterInterest(
"kAfterNewProjectCreated", launch_workfiles_app
) | [
"def project_opened(project):\r\n # Do whatever you like here!\r",
"def OnRunFile(self,event):\r\n self.parent.notebook.ExecFile()",
"def start_workunit(self, workunit):\r\n pass",
"def start_setup(proj):\n \n proj_list = shelve_db.get_projects()\n proj.status = \"started\"\n proj_lis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Uninstalling Nukestudio integration for avalon | def uninstall():
log.info("Deregistering NukeStudio plug-ins..")
pyblish.deregister_host("nukestudio")
pyblish.deregister_plugin_path(PUBLISH_PATH)
avalon.deregister_plugin_path(avalon.Loader, LOAD_PATH)
avalon.deregister_plugin_path(avalon.Creator, CREATE_PATH) | [
"def uninstall(self):\n pass",
"def Uninstall(vm):\n vm.RemoteCommand('rm -rf tpu')",
"def Uninstall(_):\n # No clean way to uninstall everything. The VM will be deleted at the end\n # of the test.\n pass",
"def uninstall(self):\n os.system(uninstallSoftware)",
"def uninstall(name, root):"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
confirms include, collection_id, and arbitrary query_params arguments to get_role_list are assembled correctly | def test_get_role_list_params(client):
register_api_route_fixture_file("gcs", "/roles", "role_list.json")
# no args
res = client.get_role_list()
assert res["code"] == "success"
params = get_last_request().params
assert params == {}
# collection_id
res = client.get_role_list(collection_... | [
"def grant_role(self, role, principal_ids):",
"def test_list_role(self):\n pass",
"def get_roles(role):",
"def test_list_roles(self):\n pass",
"def get_roles_ids(self, principal_id):",
"def test_ipam_roles_list(self):\n pass",
"def get_roles(self, principal_id):",
"def test_multi_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructor. address the adjusted address where the resource exists name the name of the resource size the size of the resource | def __init__(self, address: int, name: unicode, size: int):
... | [
"def __init__(self, owner, resourceFile):\n self.checksum = Path(resourceFile).md5 # Just use the path name as a unique ID\n _Resource.__init__(self, owner, resourceFile)\n if self._idevice:\n self._idevice.userResources.append(self)",
"def __init__(self,resource=\"\",LBName=\"\"):... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the adjusted address where the resource exists. the adjusted address where the resource exists | def getAddress(self) -> int:
... | [
"def getAbsoluteAddress(program: ghidra.program.model.listing.Program, address: ghidra.program.model.address.Address) -> ghidra.program.model.address.Address:\n ...",
"def get_address(self):\n entity = self\n if entity.abstract_entity:\n entity = self.get_real_ancestor()\n i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Nondivisible subset length is the size of maximal subset of the iterable where sum of any two numbers in the subset is not evenly divisible by key | def non_divisible_subset_len(iterable, key):
# To check whether the given iterable is list or tuple
if type(iterable) == list or type(iterable) == tuple:
pass
else:
raise TypeError("Iterable should be of either list or tuple")
# To check whether all the given items in the itera... | [
"def num_subset_permutations(n, k):\n return math.factorial(n) / math.factorial(n - k)",
"def get_max_divisible_subset_length(self, nums):\n if not nums:\n return 0\n \n max_lengths = [1]\n max_length = 1\n\n for i in range(1, len(nums)):\n max_length_he... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate the move Move is valid as long as it is within the size of the board and the selected move has 1 on the board | def validate_move(move, player_board):
select_row = move.select_row
select_col = move.select_col
player_board_rows = player_board.shape[0]
player_board_cols = player_board.shape[1]
if select_row >= player_board_rows or select_row < 0 or \
select_col >= player_board_cols or select_c... | [
"def validate_move(self, move_from, move_to, board):\n\n pass",
"def is_valid_move(self, move):\n\t\tpass",
"def validate(moves):\n assert len(moves) > 0\n assert len(moves) < 14\n\n # Create the starting board by finding the 'to' element of the first move\n # and setting that position to bla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return rendered news page for particular league | def league(request,league_id=1):
#define variables
args = {}
news = []
#getting data form models
this_league = get_object_or_404(League, pk = league_id)
leagues = League.objects.all().exclude(pk = league_id).order_by('name')
teams = this_league.team_set.all().order_by('name')
#collecting all news of leagu i... | [
"def team(request,league_id = 1,team_id = -1):\n\n\t#define variables\n\targs = {}\n\n\t#getting data form models\n\tthis_team = get_object_or_404(Team, pk = team_id)\n\tnews = this_team.news_set.all().order_by('date')\n\tthis_league = get_object_or_404(League, pk = league_id)\n\tteams = this_league.team_set.all().... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return rendered news page for particular team | def team(request,league_id = 1,team_id = -1):
#define variables
args = {}
#getting data form models
this_team = get_object_or_404(Team, pk = team_id)
news = this_team.news_set.all().order_by('date')
this_league = get_object_or_404(League, pk = league_id)
teams = this_league.team_set.all().exclude(pk = team_id)... | [
"def team():\n return render_template(\"team.html\")",
"def teams(request):\n return render(\n request, 'pages/home.html'\n )",
"def view_team_page(request, team_pk):\n\t\n\tselected_team = ChallengeTeam.objects.get(pk = team_pk)\n\t\n\tusers = selected_team.team_members.all()\n\t\n\tteam_name =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate unique integer according to current timestamp | def get_unique_integer() -> int:
return int(time.time()) | [
"def generateUniqueNumber(self):\n return int(DateTime())",
"def get_unique_id():\n global unique_id_increment\n if unique_id_increment is None:\n unique_id_increment = 0\n unique_id_increment += 1\n return '%d%d' % (int(time.time()), unique_id_increment)",
"def get_unique_id():\n global unique... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sklearn_crfsuite.CRF 参数 参数详细说明请查看 >>> import sklearn_crfsuite >>> help(sklearn_crfsuite.CRF) | def crfsuite_opt(parser):
group = parser.add_argument_group('sklearn_crfsuite.CRF')
group.add_argument('-algorithm', type=str, default='lbfgs',
help="""str, Training algorithm.\n\n
Allowed values:[lbfgs|l2sgd|ap|pa|arow]
""")
group.add_arg... | [
"def train_crf(threads=3, hyperparameter_crf='1.5', cut_off='5', alg='CRF-L2'):\n\n print '\\n\\ttrain crf'\n os.system('crf_learn -p ' + threads +\n ' -c ' + hyperparameter_crf +\n ' -f ' + cut_off +\n ' -a ' + alg +\n ' ' + template_file + ' ' + train_file... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Allows user to write study notes | def write_note():
title_note = request.form.get("title")
note = request.form.get("note")
date_string = datetime.today().strftime('%Y-%m-%d')
diary = Note(user_id=session["user_id"],title_note = title_note, note_created=date_string, note=note)
db.session.add(diary)
db.session.commit()
... | [
"def note(self):\n content = sys.argv[2]\n self.record('NOTE %s' % content)\n print('Note added')",
"def __add_note():\n os.system('clear')\n os.system('cls')\n title = input('Enter notes name: ')\n text = input('Enter note`s text: ')\n created_on = time.str... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |