query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Map MXNet's multinomial operator attributes to onnx's Multinomial operator and return the created node.
def convert_multinomial(node, **kwargs): name, input_nodes, attrs = get_inputs(node, kwargs) dtype = onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[np.dtype(attrs.get("dtype", 'int32'))] sample_size = convert_string_to_list(attrs.get("shape", '1')) if len(sample_size) < 2: sample_size = sample_size[-1] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_broadcast_mul(node, **kwargs):\n return create_basic_op_node('Mul', node, kwargs)", "def _create_gemm(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n node.attribute.extend([\n helper.make_attribute('alpha', float(op.alpha)),\n helper...
[ "0.58884233", "0.5768025", "0.54848015", "0.5398994", "0.5315125", "0.52907187", "0.5282063", "0.5165217", "0.51454043", "0.51417667", "0.5104819", "0.50990736", "0.50983584", "0.5056548", "0.5052555", "0.5041364", "0.50398886", "0.5031336", "0.5016045", "0.5006198", "0.50032...
0.71358234
0
Map MXNet's random_uniform operator attributes to onnx's RandomUniform operator and return the created node.
def convert_random_uniform(node, **kwargs): name, input_nodes, attrs = get_inputs(node, kwargs) # Converting to float32 low = float(attrs.get("low", 0)) high = float(attrs.get("high", 1.0)) shape = convert_string_to_list(attrs.get('shape', '[]')) dtype = onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[np.d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen(self, op, *args, **kwargs):\r\n random_state_variable = raw_random.random_state_type()\r\n new_r, out = op(random_state_variable, *args, **kwargs)\r\n out.rng = random_state_variable\r\n self.random_state_variables.append((random_state_variable, new_r))\r\n return out", ...
[ "0.60839343", "0.5966107", "0.5965341", "0.59418684", "0.5821455", "0.55140215", "0.5499431", "0.5494168", "0.5481163", "0.5478966", "0.5458399", "0.5442405", "0.54335564", "0.5417929", "0.53986716", "0.539796", "0.539796", "0.5386957", "0.53401625", "0.5309333", "0.5306019",...
0.7275685
0
Map MXNet's random_normal operator attributes to onnx's RandomNormal operator and return the created node.
def convert_random_normal(node, **kwargs): name, input_nodes, attrs = get_inputs(node, kwargs) # Converting to float32 mean = float(attrs.get("loc", 0)) scale = float(attrs.get("scale", 1.0)) shape = convert_string_to_list(attrs.get('shape', '[]')) dtype = onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[np...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_random_uniform(node, **kwargs):\n name, input_nodes, attrs = get_inputs(node, kwargs)\n\n # Converting to float32\n low = float(attrs.get(\"low\", 0))\n high = float(attrs.get(\"high\", 1.0))\n shape = convert_string_to_list(attrs.get('shape', '[]'))\n dtype = onnx.mapping.NP_TYPE_TO_...
[ "0.62901884", "0.60207254", "0.5817178", "0.57946956", "0.5718311", "0.5678145", "0.56305474", "0.5630399", "0.5541356", "0.55390555", "0.5524819", "0.55016184", "0.5497462", "0.54788977", "0.54603964", "0.54529095", "0.5433405", "0.5368286", "0.5364437", "0.534533", "0.53327...
0.7576377
0
Map MXNet's ROIPooling operator attributes to onnx's MaxRoiPool operator and return the created node.
def convert_roipooling(node, **kwargs): name, input_nodes, attrs = get_inputs(node, kwargs) pooled_shape = convert_string_to_list(attrs.get('pooled_size')) scale = float(attrs.get("spatial_scale")) node = onnx.helper.make_node( 'MaxRoiPool', input_nodes, [name], pooled_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_pooling(node, **kwargs):\n name, input_nodes, attrs = get_inputs(node, kwargs)\n\n kernel = eval(attrs[\"kernel\"])\n pool_type = attrs[\"pool_type\"] if attrs.get(\"pool_type\") else \"max\"\n stride = eval(attrs[\"stride\"]) if attrs.get(\"stride\") else (1, 1)\n global_pool = get_bool...
[ "0.641093", "0.58088446", "0.56600386", "0.5579279", "0.55671954", "0.55426383", "0.5540293", "0.54378605", "0.5431979", "0.54058385", "0.5381407", "0.5371967", "0.5365166", "0.53410465", "0.5257729", "0.52336967", "0.5228986", "0.5204838", "0.51902246", "0.5179581", "0.51613...
0.7807513
0
Map MXNet's Tile operator attributes to onnx's Tile operator and return the created node.
def convert_tile(node, **kwargs): name, input_nodes, attrs = get_inputs(node, kwargs) reps_list = convert_string_to_list(attrs["reps"]) initializer = kwargs["initializer"] reps_shape_np = np.array(reps_list, dtype='int64') data_type = onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[reps_shape_np.dtype] di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_tile(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n node.input.append(op.name + \":repeats\")\n return node", "def _create_tile(cls, onnx_node, inputs, opset_version):\n # we move several inputs to singa's attribuates\n # and mark them ...
[ "0.6590867", "0.5910745", "0.58112407", "0.5749959", "0.5646954", "0.5629699", "0.5605283", "0.5601611", "0.55009604", "0.54751515", "0.5461425", "0.5446524", "0.5431833", "0.542485", "0.5410572", "0.53914165", "0.53725374", "0.5355028", "0.53471506", "0.5346676", "0.53449744...
0.67022306
0
Map MXNet's broadcast_to operator attributes to onnx's Expand operator and return the created node.
def convert_broadcast_to(node, **kwargs): name, input_nodes, attrs = get_inputs(node, kwargs) shape_list = convert_string_to_list(attrs["shape"]) initializer = kwargs["initializer"] output_shape_np = np.array(shape_list, dtype='int64') data_type = onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[output_shape_n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_expand_as(g, op, block):\n\n x = g.get_node(op.input(\"X\")[0])\n target_shape = op.attr(\"target_shape\")\n out = _op.broadcast_to(x, target_shape)\n g.add_node(op.output(\"Out\")[0], out)", "def convert_broadcast_power(node, **kwargs):\n return create_basic_op_node('Pow', node, kwarg...
[ "0.6505846", "0.604694", "0.60059506", "0.59943974", "0.5957492", "0.5825268", "0.5748968", "0.57150435", "0.5620855", "0.5597498", "0.55732626", "0.5556347", "0.5554119", "0.5502286", "0.54921335", "0.5468958", "0.5464709", "0.5461847", "0.5448856", "0.54340446", "0.53191674...
0.74339557
0
Map MXNet's topk operator attributes to onnx's TopK operator and return the created node.
def convert_topk(node, **kwargs): name, input_nodes, attrs = get_inputs(node, kwargs) axis = int(attrs.get('axis', '-1')) k = int(attrs.get('k', '1')) ret_type = attrs.get('ret_typ') dtype = attrs.get('dtype') outputs = [name + '_output0'] if ret_type and ret_type == 'both': if dty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_topk(g, op, block):\n\n data = g.get_node(op.input(\"X\")[0])\n if op.input(\"K\"):\n k = g.get_node(op.input(\"K\")[0])\n else:\n k = op.attr(\"k\")\n\n largest = True\n axis = -1\n if op.has_attr(\"axis\"):\n axis = op.attr(\"axis\")\n if op.has_attr(\"larges...
[ "0.6419405", "0.6140541", "0.5742067", "0.54392713", "0.5406331", "0.5386023", "0.5383082", "0.5365803", "0.5237811", "0.5237811", "0.51466364", "0.51442844", "0.5112016", "0.509088", "0.5069989", "0.50558615", "0.50066954", "0.49857953", "0.49676558", "0.49675217", "0.496543...
0.68704766
0
Map MXNet's Take operator attributes to onnx's Gather operator.
def convert_take(node, **kwargs): name, input_nodes, attrs = get_inputs(node, kwargs) axis = int(attrs.get('axis', 0)) node = onnx.helper.make_node( "Gather", input_nodes, [name], axis=axis, name=name, ) return [node]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_gather(g, op, block):\n\n x = g.get_node(op.input(\"X\")[0])\n index = g.get_node(op.input(\"Index\")[0])\n axis = op.attr(\"axis\")\n out = _op.take(x, index, axis)\n g.add_node(op.output(\"Out\")[0], out)", "def _create_gather(cls, onnx_node, inputs, opset_version):\n axis = o...
[ "0.5603602", "0.5088366", "0.4996854", "0.49716508", "0.49634594", "0.4908585", "0.48814094", "0.4826999", "0.46374422", "0.46165276", "0.46148214", "0.46006873", "0.4598241", "0.45922422", "0.45850176", "0.4572346", "0.45681974", "0.45681974", "0.45681974", "0.45255744", "0....
0.6138117
0
raise from_none(ValueError('a')) == raise ValueError('a') from None
def from_none(exc): exc.__cause__ = None exc.__suppress_context__ = True return exc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fail(raise_):\n if raise_:\n raise _UnexpectedForm()\n return None", "def test_invalid_argument_type(self):\n t = TruthTable('A or B')\n\n with self.assertRaises(InvalidArgumentTypeError):\n t.equivalent_to(float())\n\n with self.assertRaises(InvalidArgumentTypeE...
[ "0.65491164", "0.6507355", "0.63295954", "0.61693627", "0.6143416", "0.60782343", "0.59815896", "0.5925763", "0.5909486", "0.5908904", "0.5904242", "0.58995235", "0.5848055", "0.5834902", "0.5818783", "0.57958984", "0.5760411", "0.5742847", "0.57380986", "0.5723444", "0.57004...
0.68841505
0
Calculates the average price we would pay / receive per unit of `symbol` if we wanted to trade `quantity` of that `symbol`, based on its order book
def getOrderBookPrice(exchange, symbol, side, quantity, order_book=None): # TODO test it # print("obap1") order_book_side = order_book['asks'] \ if side == exchange.SIDE_SELL else order_book['bids'] quantity = Decimal(quantity) i, orders, price = 0, [], Decimal(0) accounted_for_quantity = Decimal(0) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cost(self, symbol) -> float:\n if len(symbol) <= 6:\n search = self.trader.stock_positions + self.trader.crypto_positions\n for p in search:\n if p['symbol'] == symbol:\n return p['avg_price']\n return None\n else:\n ...
[ "0.64651424", "0.6410142", "0.63740027", "0.63389856", "0.6299657", "0.6286352", "0.6263074", "0.6189815", "0.6114266", "0.6032858", "0.60058963", "0.5941486", "0.5917772", "0.5853512", "0.5828471", "0.5826779", "0.580022", "0.57563347", "0.57001877", "0.5657362", "0.5588201"...
0.7126667
0
Inserts multiple new asks in the order book (assumes that the order book AND the new_asks list are sorted)
def insertAsks(previous_asks, received_asks): new_asks = [] if len(received_asks) < 1: return previous_asks if len(previous_asks) < 1: return received_asks # print("Prev") # pprint(previous_asks) # print("Recv") # pprint(received_asks) # Uses the merge-sort idea of popping the first elemen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_answers(conn, cur, answers):\n \n print 'Adding answers...',\n \n for i, answer in enumerate(answers):\n cur.execute('INSERT INTO answers VALUES (\"{_id}\", \"{task_id}\", \"{text}\")'.format(\n _id = i+1,\n task_id = answer['task_id'],\n ...
[ "0.5846932", "0.5842225", "0.5782144", "0.5523276", "0.5449554", "0.53335917", "0.5256855", "0.5231915", "0.5231915", "0.51975715", "0.5142276", "0.51192087", "0.50733495", "0.5046175", "0.5029141", "0.49793863", "0.4966205", "0.49656373", "0.49622992", "0.49538177", "0.48968...
0.7092049
0
Inserts multiple new bids in the order book (assumes that the order book AND the new_bids list are sorted)
def insertBids(previous_bids, received_bids): new_bids = [] while len(previous_bids) > 0 and len(received_bids) > 0: bid = None if Decimal(previous_bids[0][0]) > Decimal(received_bids[0][0]): bid = previous_bids.pop(0) elif Decimal(previous_bids[0][0]) < Decimal(received_bids[0][0]): bid =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_new_bids(self):\n for bidder in self._bidders:\n if bidder != self._highest_current_bidder:\n bid_price = bidder(self)\n if bid_price > self.current_bid:\n self.update_bid(bid_price, bidder)", "def add_boid(self, new_boid):\r\n s...
[ "0.6216382", "0.6018596", "0.5861003", "0.57200617", "0.5687406", "0.5627169", "0.5626909", "0.5589654", "0.5553824", "0.5513555", "0.54484546", "0.544297", "0.5307633", "0.52903914", "0.5283958", "0.5282783", "0.5269406", "0.52541256", "0.5221003", "0.51885104", "0.51821554"...
0.72524697
0
Populate paths with lengths in database
def postPathLengths(map_area): paths = Path.query.filter(Path.map_area==map_area).all() for path in paths: start = Node.query.filter_by(id=path.start).first() end = Node.query.filter_by(id=path.end).first() # get the length of the two side of the paths avg_length = calculatePath...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculateWireLenght(path_list):\n\n total_length = 0\n for path in path_list:\n total_length += len(path)\n return total_length", "def path_length(self,path,num_repeats=10):\n begin_time=datetime.datetime.now()\n #num_repeats=100\n for i in range(num_repeats):\n ...
[ "0.58111256", "0.58005226", "0.5792587", "0.54623866", "0.5386073", "0.5357159", "0.5356317", "0.5353135", "0.5353135", "0.53270024", "0.53158593", "0.5290157", "0.52883023", "0.52871025", "0.5284866", "0.5262351", "0.52564347", "0.5213889", "0.5204303", "0.5164193", "0.51576...
0.6926739
0
Create a database according to schema in JSON format.
def create_db(db, schema_json): with open(schema_json) as of: schema = json.load(of, object_pairs_hook=OrderedDict) # OrderedDict so that tables are created in the order specified, # allowing foreign keys to reference previously defined tables for table_name, columns in schema.items(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(db_path, schema_json):\n create_db(db_path, schema_json)", "def create_db():\n db.create_all()\n print('Database structure created successfully')", "def create_db():\n db.create_all()\n print(\"DB Created\")", "def create_schema(db_name, schema_name):\n # 1. Connect to database\n ...
[ "0.82075125", "0.7394558", "0.7111433", "0.7067049", "0.70018756", "0.7000087", "0.6994893", "0.6987741", "0.696631", "0.6925411", "0.69109344", "0.69109344", "0.69109344", "0.69109344", "0.69109344", "0.69109344", "0.69109344", "0.69109344", "0.69109344", "0.69109344", "0.69...
0.81120163
1
Create a database from a schema and populate it with CSV/JSON data.
def main(db_path, schema_json): create_db(db_path, schema_json)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_db(db, schema_json):\n with open(schema_json) as of:\n schema = json.load(of, object_pairs_hook=OrderedDict)\n # OrderedDict so that tables are created in the order specified,\n # allowing foreign keys to reference previously defined tables\n\n for table_name, columns in schem...
[ "0.7358652", "0.6983746", "0.6980258", "0.6947382", "0.68650365", "0.6854215", "0.68521404", "0.68436974", "0.6828379", "0.678138", "0.67692417", "0.67509025", "0.67440456", "0.67321527", "0.67321527", "0.67321527", "0.67321527", "0.67321527", "0.67321527", "0.67321527", "0.6...
0.7520764
0
verify that, once send() is called, a tenant has been setup
def test_tenant_setup_celery(self): class interceptor(mock.Mock): tenant = None def send(self, *kw, **args): self.tenant = properties.tenant msg = interceptor() tenant = mock.Mock() tenant.client_name = 'mock-tenant' _send_celery_mail(m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_tenant_setup_celery_reset(self):\n msg = mock.Mock()\n tenant = mock.Mock()\n tenant.client_name = 'mock-tenant'\n\n _send_celery_mail(msg, tenant, send=False)\n\n self.assertFalse(hasattr(properties, 'tenant'))\n self.assertEqual(properties.tenant_properties, {})...
[ "0.6928082", "0.60256696", "0.5895501", "0.5891009", "0.5843694", "0.57787097", "0.577437", "0.56721795", "0.56186384", "0.55741477", "0.5572975", "0.557291", "0.55664927", "0.5555025", "0.54957616", "0.54935724", "0.5484652", "0.5469827", "0.54646283", "0.5463046", "0.544083...
0.7089597
0
after _send_celery_mail finishes, the tenant should be cleared again
def test_tenant_setup_celery_reset(self): msg = mock.Mock() tenant = mock.Mock() tenant.client_name = 'mock-tenant' _send_celery_mail(msg, tenant, send=False) self.assertFalse(hasattr(properties, 'tenant')) self.assertEqual(properties.tenant_properties, {})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_tenant_setup_celery(self):\n\n class interceptor(mock.Mock):\n tenant = None\n\n def send(self, *kw, **args):\n self.tenant = properties.tenant\n\n msg = interceptor()\n tenant = mock.Mock()\n tenant.client_name = 'mock-tenant'\n\n _s...
[ "0.60660076", "0.5897273", "0.5827525", "0.58136255", "0.57590765", "0.57500565", "0.57095784", "0.56320375", "0.5629329", "0.56141365", "0.560764", "0.55990505", "0.55975515", "0.5582091", "0.5547078", "0.5544799", "0.55407256", "0.5533396", "0.5488413", "0.54429895", "0.540...
0.7174306
0
Handles a success in payment. If the order is paidoff, sends success, else return page to pay remaining.
def _onSuccess(self, controller): if controller.order.paid_in_full: controller.cart.empty() for item in controller.order.orderitem_set.all(): if item.product.is_subscription: item.completed = True item.save() try:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ui_redirect_success(self, order: Order = None) -> HttpResponse:\n ui_return_url = self.extract_ui_return_url()\n if ui_return_url:\n return self._redirect_to_ui(\n ui_return_url, \"success\", order, path=\"/payment-result\"\n )\n else:\n retu...
[ "0.7352169", "0.72179747", "0.7183236", "0.7149302", "0.70583147", "0.700066", "0.69343185", "0.68865967", "0.6824747", "0.68121576", "0.6804239", "0.6716359", "0.6692291", "0.661997", "0.6476802", "0.6473549", "0.6418588", "0.6369197", "0.63250667", "0.6308499", "0.6287491",...
0.74831283
0
| Ground Truth | Forehand Backhand Serve Forehand num_FF num_BF num_SF Backhand num_FB num_BB num_SB Serve num_FS num_BS num_SS No_action num_FN num_BN num_SN
def show_eval_class_level(num_BB, num_BF, num_BS, num_BN, num_FB, num_FF, num_FS, num_FN, num_SB, num_SF, num_SS, num_SN): print("************************************************") print(" | Ground Truth | ") print(" Forehand Backhand Serve ") print("F...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handDecision(handIn):", "def part1b_2():\n xs = exampleInput\n z = 5.881\n forward = [\n Counter({'-FEAT-': 0.622, '-SIZE-': 0.377}), \n Counter({'-SIZE-': 0.761, '-FEAT-': 0.238}), \n Counter({'-SIZE-': 0.741, '-FEAT-': 0.258})]\n \n z_, forward_ = submission....
[ "0.58027256", "0.5786682", "0.5755825", "0.5679587", "0.56194", "0.56090933", "0.5567905", "0.5535476", "0.5521466", "0.54943043", "0.5431216", "0.5410346", "0.5410346", "0.54039884", "0.53975636", "0.53964627", "0.53595126", "0.5350653", "0.5346474", "0.53431875", "0.5331558...
0.58535993
0
Remove Key from a Key Value pair Can be performed on Dictionary or Json key value string
def remove(kv_data, key): if isinstance(kv_data, str): kv_data = loads(kv_data) # Turn into Dictionary try: del kv_data[key] except NameError: print(key, " does not exists in key value pair.") kv_data = dumps(kv_data) else: print("Provide a Json Ke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_value(self, thing_key, dkey):\n if thing_key in self.things_dict:\n dic = self.things_dict[thing_key]\n if type(dic) != type({}):\n return\n dic.pop(dkey, None)", "def remove_value(self, key: str) -> None:\n raise NotImplementedError", "d...
[ "0.7145345", "0.7130893", "0.7018091", "0.6990667", "0.6903429", "0.6875397", "0.6862628", "0.6806682", "0.6771876", "0.6739055", "0.67074156", "0.6704598", "0.6693101", "0.6646352", "0.6637673", "0.66145486", "0.6510989", "0.6470834", "0.64574033", "0.64387095", "0.6428868",...
0.8426328
0
If JSON Key Value, Value contains this value
def contains_value(kv_json, value): if isinstance(kv_json, str): kv_dict = loads(kv_json) for key in kv_dict: if kv_dict[key] == value: # Found value in dictionary return True return False else: print("Provide A JSON Key Value String")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __is_key_in_json(self, key=str, json_dict=json):\n if key in json_dict:\n # noinspection PyUnresolvedReferences\n return json_dict[key]\n else:\n return self.NO_KEY_VALUE_FOR_ENTRY", "def is_item_in_the_response(key, value, jsonResponse):\n flag = False\n ...
[ "0.71973366", "0.68866235", "0.66816956", "0.64885634", "0.6401842", "0.6400266", "0.6142757", "0.61393195", "0.60865045", "0.60471123", "0.60368866", "0.60345954", "0.6024064", "0.6017378", "0.5997288", "0.59498996", "0.59224445", "0.58714145", "0.5839041", "0.58378595", "0....
0.71492994
1
from all the information provided by the ONCat template, we are only interested by the following infos [name, path and units]. We isolate those into the template_information dictionary
def isolate_relevant_information(self): def get_formula(oncat_formula): """will need to go from something like "${value/10e11}`" to something more pythonic "{value/10e11}""" regular_expression = r'\$(?P<formula>.+)\`' m = re.se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_template(self):\n for line in self.raw_template.split(\"\\n\"):\n line = line.strip()\n if line.startswith('#m3'):\n key, val = line[3:].strip().split('=', 1)\n key = key.strip()\n val = val.strip()\n self.variables[...
[ "0.6129451", "0.5694503", "0.5597461", "0.5589702", "0.5520051", "0.5466003", "0.5434218", "0.5390082", "0.5387614", "0.53731686", "0.53682715", "0.53276026", "0.5297058", "0.5292366", "0.52901614", "0.52713674", "0.5267604", "0.5235461", "0.52188444", "0.5214309", "0.5210592...
0.7443054
0
Using the ONCat template to create projection used by oncat to return full information
def create_oncat_projection_from_template(with_location=False, template={}): projection = [] if with_location: projection = ['location'] nbr_columns = len(template) for _col in np.arange(nbr_columns): projection.appe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def projection(self):\n pass", "def describe(self, template='projection_default.txt', engine='default'):\n raise NotImplementedError", "def output_projection(self):\n return self.projection(what='output')", "def makeProjection(self, variable, token, typed_token, constituent_dict):\n m...
[ "0.6503911", "0.61083275", "0.58378226", "0.53846645", "0.52837193", "0.52689284", "0.5229088", "0.52271664", "0.518275", "0.5146785", "0.51318693", "0.51146895", "0.5093305", "0.5028556", "0.50255054", "0.49924508", "0.49750137", "0.4933599", "0.49226946", "0.49170607", "0.4...
0.67057735
0
Applies selected activation function to intermediate output.
def apply_activation(intermediate_output, intermediate_activation): if intermediate_activation is None: return intermediate_output if intermediate_activation == 'gelu': intermediate_output = nn.gelu(intermediate_output) elif intermediate_activation == 'relu': intermediate_output = nn.relu(intermediat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_layer_activation(x):\n return x", "def uf_activate(self, output_reg):\n if len(self.inputs) is 2:\n self.two_activation(output_reg)\n elif len(self.inputs) is 3:\n self.three_activation(output_reg)\n else:\n self.large_activation(output_reg)", ...
[ "0.7604806", "0.7194517", "0.6661993", "0.6523873", "0.64537185", "0.6431659", "0.64278513", "0.6370167", "0.63165534", "0.6285312", "0.6285312", "0.6214801", "0.6194766", "0.6191587", "0.6181813", "0.614133", "0.6128814", "0.6084095", "0.607957", "0.6078586", "0.60711646", ...
0.7784417
0
Returns TF Bert config..
def get_tf_config(config_path): return modeling.BertConfig.from_json_file(config_path).__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bert_config(config):\n if config.model_size == \"large\":\n args = {\"hidden_size\": 1024, \"num_hidden_layers\": 24}\n elif config.model_size == \"base\":\n args = {\"hidden_size\": 768, \"num_hidden_layers\": 12}\n elif config.model_size == \"small\":\n args = {\"hidden_size\": 256, \"num_hid...
[ "0.66096175", "0.6400916", "0.6374486", "0.63508105", "0.6265168", "0.61243945", "0.6115964", "0.61093426", "0.61093426", "0.60153896", "0.601387", "0.5967145", "0.59554666", "0.59397674", "0.5929531", "0.59017366", "0.5877108", "0.5862486", "0.5856384", "0.585002", "0.584904...
0.7430698
0
Return tf mlperf model parameters in a dictionary format. Use get_tf_model_variables if using kerasBERT checkpoint. This function works
def get_mlperf_model_variables(config_path, init_checkpoint): # Load saved model configuration bert_config = modeling.BertConfig.from_json_file(config_path) seq_length = bert_config.max_position_embeddings tf_variables = {} max_predictions_per_seq = 76 # Generate BERT TF model and initiate variable update ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def describe_model():\n train_vars = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES)\n msg = [\"\"]\n total = 0\n for v in train_vars:\n shape = v.get_shape()\n ele = shape.num_elements()\n total += ele\n msg.append(\"{}: shape={}, dim={}\".format(\n v.name, s...
[ "0.65184647", "0.65112454", "0.638817", "0.63505626", "0.6223993", "0.6148675", "0.6122482", "0.6062248", "0.6055513", "0.6027013", "0.600799", "0.59653383", "0.59652144", "0.5957283", "0.59522676", "0.5892172", "0.58268005", "0.5810189", "0.58081865", "0.57768404", "0.577381...
0.7301645
0
Convert TF BERT model config to be compatible with JAX BERT model.
def convert_tf_config_to_jax_bert(config): unnecessary_keys = ['initializer_range', 'backward_compatible', 'embedding_size'] for key in unnecessary_keys: if key in config: config.pop(key) # change TF parameter names to match JAX parameter names mapping = { 'attention_dropo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bert_config(config):\n if config.model_size == \"large\":\n args = {\"hidden_size\": 1024, \"num_hidden_layers\": 24}\n elif config.model_size == \"base\":\n args = {\"hidden_size\": 768, \"num_hidden_layers\": 12}\n elif config.model_size == \"small\":\n args = {\"hidden_size\": 256, \"num_hid...
[ "0.61332077", "0.6126715", "0.5987451", "0.5933029", "0.57321113", "0.57210857", "0.57176137", "0.568357", "0.56809187", "0.56193393", "0.55681133", "0.5533706", "0.5505984", "0.54603016", "0.54229367", "0.5420582", "0.5410694", "0.54047483", "0.53842753", "0.535301", "0.5317...
0.7478179
0
Modify TF mlperf model parameter dict to be compatible with JAX parameter dict. Convert parameter names in tf_params to match JAX parameter names and create a nested dictionary of parameters for each layer in the model using `/` in each key as a delimeter. This function uses mlperf model naming convention. Use convert_...
def convert_mlperf_param_dict_to_jax(tf_params, emb_dim, num_heads): jax_params = {} # mapping between mlperf model and JAX model # works for model in //third_party/tensorflow_models/mlperf/models/rough/bert tf_key_to_jax_key = [ ('cls/seq_relationship/', 'classification/predictions_transform_logits/'), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_tf_param_dict_to_jax(tf_params):\n jax_params = {}\n tf_key_to_jax_key = [\n ('embeddings/layer_norm', 'embeddings_layer_norm'),\n ('transformer/layer', 'encoder_layer'), ('embeddings:0', 'embedding'),\n (':0', ''), ('beta', 'bias'), ('gamma', 'scale'),\n ('position_embedding/', '...
[ "0.7303152", "0.59408104", "0.544858", "0.5378973", "0.531307", "0.5166872", "0.50446033", "0.5018701", "0.49990663", "0.4953636", "0.49412417", "0.49221116", "0.49118844", "0.49070784", "0.49015772", "0.48552454", "0.48360878", "0.48341933", "0.48306793", "0.48175794", "0.48...
0.80498666
0
Modify TF parameter dict to be compatible with JAX parameter dict. Convert parameter names in tf_params to match JAX parameter names and create a nested dictionary of parameters for each layer in the model using `/` in each key as a delimeter.
def convert_tf_param_dict_to_jax(tf_params): jax_params = {} tf_key_to_jax_key = [ ('embeddings/layer_norm', 'embeddings_layer_norm'), ('transformer/layer', 'encoder_layer'), ('embeddings:0', 'embedding'), (':0', ''), ('beta', 'bias'), ('gamma', 'scale'), ('position_embedding/', 'position_em...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_mlperf_param_dict_to_jax(tf_params, emb_dim, num_heads):\n jax_params = {}\n # mapping between mlperf model and JAX model\n # works for model in //third_party/tensorflow_models/mlperf/models/rough/bert\n tf_key_to_jax_key = [\n ('cls/seq_relationship/', 'classification/predictions_transform_lo...
[ "0.6692091", "0.574194", "0.57411915", "0.55651945", "0.5472306", "0.54638326", "0.53691083", "0.53339547", "0.5273296", "0.5266139", "0.5258614", "0.5244856", "0.52444565", "0.5239768", "0.5239768", "0.52044886", "0.5198123", "0.5191683", "0.51802343", "0.51680446", "0.51627...
0.7722715
0
>>> get_comparison_value('AS KS QS JS TS'.split())[1] 'Royal Flush' >>> get_comparison_value('KS QS JS TS 9S'.split())[1] 'Straight Flush' >>> get_comparison_value('8S 8C 8D 8H 3S'.split())[1] 'Four of a Kind' >>> get_comparison_value('8S 8C 8D 3H 3S'.split())[1] 'Full House' >>> get_comparison_value('2S QS JS TS 9S'.s...
def get_comparison_value(hand): suits = set(get_suit(card) for card in hand) values = set(get_value(card) for card in hand) is_flush = len(suits) == 1 is_straight = (len(values) == 5 and min(values) + 4 == max(values)) kinds = get_kinds(hand) kind_counts = [k.count for k in kinds] i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def comparison(self) -> str:\n return self._values.get('comparison')", "def comparison(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"comparison\")", "def testWinkler(self): # - - - - - - - - - - - - - - - - - - - - - - - - - -\n\n for pair in self.string_pairs:\n\n a...
[ "0.578843", "0.5683622", "0.5322386", "0.5317316", "0.5244176", "0.5244176", "0.52301955", "0.51247126", "0.5097643", "0.50959706", "0.5091257", "0.5083387", "0.50707597", "0.5040682", "0.5037145", "0.5023796", "0.5014674", "0.50132555", "0.50123906", "0.50123906", "0.4993311...
0.6191718
0
Compute the transformation matrix from Galactic spherical to Magellanic Stream coordinates.
def galactic_to_MS(): return MS_MATRIX
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MS_to_galactic():\n return matrix_transpose(MS_MATRIX)", "def get_transformation_matrix(theta=45):\n\n theta = theta/360 * 2 * np.pi # in radians\n hx = np.cos(theta)\n sy = np.sin(theta)\n\n S = np.array([[1, hx, 0],\n [0, sy, 0],\n [0, 0, 1]])\n #S_inv = ...
[ "0.6793291", "0.6397168", "0.6347205", "0.6225888", "0.6009966", "0.5733559", "0.5673262", "0.56630766", "0.56511235", "0.5618374", "0.5604634", "0.5580951", "0.5580951", "0.5563582", "0.55473304", "0.5542603", "0.55239236", "0.547165", "0.546832", "0.5466667", "0.54391974", ...
0.6850105
0
Compute the transformation matrix from Magellanic Stream coordinates to spherical Galactic.
def MS_to_galactic(): return matrix_transpose(MS_MATRIX)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def galactic_to_MS():\n return MS_MATRIX", "def get_transformation_matrix(theta=45):\n\n theta = theta/360 * 2 * np.pi # in radians\n hx = np.cos(theta)\n sy = np.sin(theta)\n\n S = np.array([[1, hx, 0],\n [0, sy, 0],\n [0, 0, 1]])\n #S_inv = np.linalg.inv(S)\n...
[ "0.6758652", "0.6351473", "0.6289319", "0.6249192", "0.5900926", "0.58043545", "0.5739055", "0.55864763", "0.558487", "0.55819327", "0.55792", "0.55535346", "0.5547185", "0.5533851", "0.55322266", "0.55322266", "0.55189437", "0.551152", "0.5510809", "0.54767853", "0.5444235",...
0.67547804
1
Add the ``request.raven`` method and configure the `ravenjs` panel.
def includeme(config, get_raven=None, panel=None): # Compose. if get_raven is None: #pragma: no cover get_raven = get_raven_client if panel is None: #pragma: no cover panel = raven_js_panel # Unpack. settings = config.registry.settings # Provide the client as ``req...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def includeme(config):\n config.add_subscriber(add_renderer_globals, BeforeRender)\n config.add_subscriber(add_localizer, NewRequest)\n config.add_subscriber(add_csrf_validation, NewRequest)\n config.add_subscriber(add_resources, NewRequest)", "def enable(self):\n LOGGER.info('Enabling WebAPI ...
[ "0.59271264", "0.52645963", "0.5064856", "0.5035225", "0.5023455", "0.50157934", "0.5003367", "0.49658138", "0.49607152", "0.49281287", "0.48860234", "0.4869646", "0.48251504", "0.48205826", "0.48137787", "0.47873187", "0.47489318", "0.46791732", "0.46751204", "0.46577823", "...
0.7125961
0
Loading model weights and meta information from cfg and checkpoint. Subclasses could override this method to load extra meta information from ``checkpoint`` and ``cfg`` to model.
def _load_weights_to_model(self, model: nn.Module, checkpoint: Optional[dict], cfg: Optional[ConfigType]) -> None: if checkpoint is not None: _load_checkpoint_to_model(model, checkpoint) else: warnings.warn('Checkpoint...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_model(self, ckpt_name=\"best_model.pth\"):\n path = \"/\".join(ckpt_name.split(\"/\")[:-1])\n chkpt = torch.load(ckpt_name)\n self.start_epoch = chkpt['epoch']\n self.best_metric = chkpt['best_metric']\n\n # fix the DataParallel caused problem with keys names\n if...
[ "0.6934471", "0.69131255", "0.69076866", "0.67372805", "0.6686757", "0.6633907", "0.66300243", "0.6628675", "0.6621558", "0.65934366", "0.6577404", "0.6577404", "0.6514096", "0.6467032", "0.64553356", "0.64483273", "0.64396846", "0.6426327", "0.6404203", "0.6404203", "0.63859...
0.7453869
0
Initialize the ``collate_fn`` with the given config. The returned ``collate_fn`` will be used to collate the batch data.
def _init_collate(self, cfg: ConfigType) -> Callable: try: with FUNCTIONS.switch_scope_and_registry(self.scope) as registry: collate_fn = registry.get(cfg.test_dataloader.collate_fn) except AttributeError: collate_fn = pseudo_collate return collate_fn # t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collate_fn(self, *args):\n return TupleMiniBatch(default_collate(*args))", "def build_collate_fn(\n cls, args: argparse.Namespace, train: bool\n ) -> Callable[[Sequence[Dict[str, np.ndarray]]], Dict[str, torch.Tensor]]:\n raise NotImplementedError", "def collate_fn(batch):\n\n fl...
[ "0.6244159", "0.599894", "0.5865807", "0.5771731", "0.56962913", "0.5471204", "0.5424939", "0.5283143", "0.52531415", "0.52518207", "0.5231545", "0.51880026", "0.5077874", "0.5077874", "0.49971217", "0.49632436", "0.49623293", "0.4961835", "0.4936827", "0.49166656", "0.489373...
0.7657155
0
List models defined in metafile of corresponding packages.
def list_models(scope: Optional[str] = None, patterns: str = r'.*'): matched_models = [] if scope is None: default_scope = DefaultScope.get_current_instance() assert default_scope is not None, ( 'scope should be initialized if you want ' 'to load c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_models_from_metafile(dir: str):\n meta_indexes = load(osp.join(dir, 'model-index.yml'))\n for meta_path in meta_indexes['Import']:\n # meta_path example: mmcls/.mim/configs/conformer/metafile.yml\n meta_path = osp.join(dir, meta_path)\n metainfo = load(meta_p...
[ "0.72860724", "0.6853126", "0.6804148", "0.6785551", "0.6757944", "0.66406256", "0.6595081", "0.65213096", "0.6515239", "0.64433444", "0.6440567", "0.6412613", "0.6402561", "0.63477504", "0.63247734", "0.63229364", "0.6300605", "0.6296517", "0.6291255", "0.6263", "0.62552387"...
0.70225334
1
By this save method we create user and make a relationship with contact model and secoud depend on conatc type.
def save(self,commit=True): instance = super(ClientSignupForm, self).save(commit=False) if commit: instance.username = self.cleaned_data['email'] instance.is_active = False instance.save() contact = Client.objects.create(first_name=self.cleaned_data['first...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_model(self, request, obj, form, change):\n if not change:\n if form.is_valid():\n user = form.save()\n user.identity = Users.SUPERVISOR\n user.set_password(form.data.get('password'))\n user.iCode = InviteCls.encode_invite_code(u...
[ "0.64130485", "0.6218375", "0.61476517", "0.60348797", "0.6014504", "0.5965818", "0.59625626", "0.5833716", "0.5819595", "0.5818768", "0.5805604", "0.5791148", "0.5760427", "0.575658", "0.5729577", "0.56765777", "0.5676002", "0.5647934", "0.56215864", "0.56215864", "0.5614676...
0.64635587
0
Must preserve data used at construction. Specifically for default averaging/length adjustments. averaging/length adjustments recalculate the underlying data
def _original_data(self, data: np.ndarray): if self._raw_data is None: self._raw_data = data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_avg(self):\n if self._data_type == 'coords':\n # default averaging is supported only for 'matrix' dataTypes\n return\n elif self._data_type == 'image':\n\n x, y = self._averaging, self._averaging\n\n if (x,y) == (1, 1):\n self.vec...
[ "0.60771775", "0.5992512", "0.5975735", "0.5974339", "0.58970016", "0.5867703", "0.58252496", "0.58230865", "0.58149874", "0.57894266", "0.5773829", "0.5726125", "0.5725895", "0.570828", "0.56946415", "0.56483364", "0.56139916", "0.56139916", "0.5607044", "0.5600587", "0.5596...
0.60240406
1
Fully refresh the underlying visual.
def _refresh(self): self._need_display_update = True self._update()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def redraw(self):\n self.vispy_viewer.canvas.update()", "def refresh(self):\n\t\tself.win.refresh()\n\t\tfor c in self.components:\n\t\t\tc.refresh()", "def refresh(self):\n self.getWindow().getDecorView().postInvalidate()", "def update_visualization(self) -> None:\n pass", "def redraw...
[ "0.7797752", "0.76777506", "0.7624245", "0.7607786", "0.75885034", "0.74661344", "0.74655384", "0.74655384", "0.7456086", "0.7437477", "0.7407238", "0.7366163", "0.7329085", "0.7314451", "0.722998", "0.7220857", "0.7200671", "0.7197712", "0.7181533", "0.71769416", "0.7154286"...
0.80525124
0
Generates list of mesh vertices and triangles from a list of vectors
def _generate_meshes(self, vectors, width): centers = np.repeat(vectors, 2, axis=0) offsets = segment_normal(vectors[::2, :], vectors[1::2, :]) offsets = np.repeat(offsets, 4, axis=0) signs = np.ones((len(offsets), 2)) signs[::2] = -1 offsets = offsets*signs vert...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vertices(tri, vertex_list):\n dim = len(vertex_list[0])\n p = numpy.zeros((3, dim))\n for j in range(3):\n p[j] = vertex_list[tri[j]]\n return p", "def get_vertices(self):\n vertices = []\n V = [[-self.base_vectors[:,n], self.base_vectors[:,n]] for n in range(self.base_vector...
[ "0.70674706", "0.67971975", "0.6688014", "0.6595674", "0.65747494", "0.65282524", "0.6382806", "0.63815814", "0.63469017", "0.623005", "0.62253344", "0.6019658", "0.60096925", "0.60038024", "0.6003564", "0.59902227", "0.59812725", "0.5978787", "0.59492654", "0.59366006", "0.5...
0.6878562
1
Sets the view given the indices to slice with.
def _set_view_slice(self, indices): vertices = self._mesh_vertices faces = self._mesh_triangles if len(faces) == 0: self._node.set_data(vertices=None, faces=None) else: self._node.set_data(vertices=vertices[:, ::-1], faces=faces, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, indices: Tuple[int, ...], slices: Tuple[slice, ...] = (slice(0, 0, 0),)):\n self.indices = indices\n self.slices = slices", "def _set_neighs_slice(self, key):\n ## Condition to use slice type\n self._constant_neighs = True\n self.ks = range(1) if self.ks is N...
[ "0.62833464", "0.61686224", "0.6001683", "0.58963263", "0.5595757", "0.5592054", "0.5561091", "0.55347645", "0.5515838", "0.55009526", "0.5443674", "0.5426867", "0.5424508", "0.53574157", "0.52848315", "0.52843475", "0.5270382", "0.5265261", "0.52636987", "0.5232416", "0.5228...
0.77993363
0
Utilities for spatio temporal analysis zed.uchicago.edu Fit dataproc with specified grid parameters and create timeseries for date boundaries specified by INIT, THRESHOLD, and END which do not have to match the arguments first input to the dataproc
def fit(self,grid=None,INIT=None,END=None,THRESHOLD=None,csvPREF='TS'): if INIT is not None: self._INIT=INIT if END is not None: self._END=END if grid is not None: self._grid=grid assert(self._END is not None) assert(self._coord1 in self._gri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fit_timeseries(xdates, ydata):\n\n pass", "def fit_surface(tdata,\n scale_params=[40.0, 1.25]):\n agg_tdata = aggregate_data(tdata)\n\n # unpack data\n mt = agg_tdata.mean_temp\n dt = agg_tdata.daily_temp\n scaled_dt = utils.scale_daily_temp(mt, dt, scale_params)\n\n obs_m...
[ "0.6216409", "0.61393374", "0.60502726", "0.59144783", "0.5902388", "0.56675595", "0.56113106", "0.55587673", "0.55573833", "0.5554575", "0.55389374", "0.55208224", "0.55186224", "0.54923666", "0.5484279", "0.5448603", "0.5447749", "0.5442355", "0.5438024", "0.5410568", "0.54...
0.6764931
0
Utility function zed.uchicago.edu Converts list into string separated by dashes or empty string if input list is not list or is empty
def stringify(List): if List is None: return '' if not List: return '' return '-'.join(str(elem) for elem in List)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_to_string(in_list):\n if not in_list:\n return \"[]\"\n else:\n return \"\\n- \" + \"\\n- \".join(in_list)", "def list_to_str( L ):\n if len(L) == 0: return ''\n return L[0] + list_to_str( L[1:] )", "def list_to_str( L ):\n if len(L) == 0: return ''\n return L[0] + list_to_str(...
[ "0.7693768", "0.6974077", "0.6974077", "0.6955682", "0.6715619", "0.6706818", "0.66814554", "0.6577999", "0.6566847", "0.65541935", "0.65537137", "0.65157914", "0.6480404", "0.64604145", "0.6455032", "0.6404342", "0.63729745", "0.63619614", "0.63449293", "0.6314343", "0.62951...
0.7753648
0
Utilities for storing and manipulating XPFSA models inferred by XGenESeSS zed.uchicago.edu Calculates the distance between all models and stores them under the distance key of each model; modifies instance in place No I/O
def augmentDistance(self): for key,value in self._models.iteritems(): src=[float(i) for i in value['src'].replace('#',' ').split()] tgt=[float(i) for i in value['tgt'].replace('#',' ').split()] dist = haversine((np.mean(src[0:2]),np.mean(src[2:])), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance_train(self):\n\n for self.epoch in range(self.args.epochs):\n # switch to train mode\n self.set_train()\n data_loading_time = 0\n gpu_time = 0\n before_op_time = time.time()\n\n for batch_idx, inputs in enumerate(self.train_loade...
[ "0.5727781", "0.55241746", "0.55023146", "0.5344562", "0.5287414", "0.5233412", "0.5179906", "0.51727074", "0.5120181", "0.51190937", "0.5085125", "0.5083492", "0.50830466", "0.50505143", "0.5047023", "0.5040699", "0.50249517", "0.50155187", "0.50076103", "0.49986377", "0.499...
0.6418641
0
Path of the directory that stores all the instances.
def instance_dir(self): return os.path.join(self.basedir, self.yml['instdir'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _InstanceDir(cls, instance_name):\n return utils.PathJoin(cls._ROOT_DIR, instance_name)", "def store_path(self):\n return path.join(env.store_home, self._store_path)", "def data_directory(self):\n\n return self.get_raw(\"data_directory\")", "def path(self):\n return self._containe...
[ "0.78036046", "0.7167195", "0.702", "0.6844666", "0.6840358", "0.6783134", "0.676215", "0.6758423", "0.67428887", "0.6675447", "0.6670271", "0.66667795", "0.66445255", "0.66307175", "0.66128314", "0.6605219", "0.6593088", "0.6589724", "0.6554919", "0.65276265", "0.6510622", ...
0.7848447
0
Collects all successful runs and optionally parses their output.
def collect_successful_results(self, parse_fn=None): def successful_runs(verbose=False): for run in self.discover_all_runs(): finished = os.access(run.output_file_path('status'), os.F_OK) if not finished: if verbose: print("Skipping unfinished run {}/{}[{}]".format(run.experiment.name, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collect_output(self):\n pass", "def collect_output(self):\n pass", "def task_parse_results():\n pass", "def __parse_success(self, fullname, results):\n match = NUMBER_PASSED_RE.match(results[0])\n if not match:\n raise ValueError(\"All passed line incorrect: '%s'...
[ "0.6443427", "0.6443427", "0.6302049", "0.6148188", "0.6071832", "0.6046133", "0.5980672", "0.59162134", "0.5890119", "0.58879757", "0.58761954", "0.5875161", "0.5846488", "0.5807116", "0.57725614", "0.57704043", "0.5761875", "0.57333165", "0.57006025", "0.5662879", "0.565996...
0.7599388
0
Exports experiments based on their status.
def export_experiments(self, included_statuses=None): experiment_list = [] if included_statuses is not None: for run in self.discover_all_runs(): status = run.get_status() if status in included_statuses: experiment_list.append(( run.experiment.name, tuple(variant.name for variant in run...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_comparisons(self):\n print(\"Exporting comparisons:\")\n\n return", "def run(self,\n example_input : Union[str,Path,None] = None) -> EasyDict :\n outputs = []\n ok = True\n for export_config in self.export_configs :\n exporter = create_exporter(...
[ "0.5686498", "0.5624677", "0.5623435", "0.5498768", "0.546386", "0.5412859", "0.53924197", "0.5347752", "0.53329897", "0.53323716", "0.52957964", "0.5271474", "0.5201375", "0.5200578", "0.5200364", "0.5186541", "0.5160601", "0.51597124", "0.51319706", "0.5105871", "0.5100903"...
0.67712706
0
devbuilds only have a source directory instead of a repo and clone directory
def source_dir(self): assert self.revision.is_dev_build rev = self._get_dev_build_suffix() return os.path.join(self._cfg.basedir, 'develop', self.name + rev)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fork(args):\n subprocess.check_call([\"git\", \"config\", \"--global\",\n \"--add\", \"safe.directory\", args.src])\n head = subprocess.check_output([\"git\", \"rev-parse\", args.rev], cwd=args.src).strip()\n obj_dir = subprocess.check_output([\"git\", \"rev-parse\", \"--git-...
[ "0.6243398", "0.6228782", "0.6211728", "0.62041354", "0.6192375", "0.61694247", "0.6141966", "0.60571873", "0.60399204", "0.6031721", "0.6004611", "0.5989618", "0.5989434", "0.59862226", "0.5955796", "0.59555477", "0.5943259", "0.5915231", "0.5878496", "0.58773404", "0.587551...
0.67784536
0
Calculates the correlation coefficients between columns. Displays them in descending order of their absolute values.
def correlation(data, method, caption): columns = list(data) coefficients = data.astype(float).corr(method=method) results = [] for i in range(len(columns)): for j in range(i + 1, len(columns)): coefficient = coefficients[columns[i]][columns[j]] results.append(( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def correlate_columns(matrix):\n return np.dot(matrix.T, matrix) / (la.norm(matrix) ** 2)", "def get_correlation(df):\n frame_correlation = df.corr()\n return frame_correlation", "def _calculate_correlation(self, anomaly):\n if self.silence_level <= 1:\n print(\"Calculating partial c...
[ "0.684586", "0.6635547", "0.6557074", "0.65286785", "0.6519738", "0.63619393", "0.63094735", "0.6283914", "0.62756026", "0.627133", "0.62701637", "0.62639886", "0.6246803", "0.6214507", "0.620774", "0.6157019", "0.6151323", "0.6137466", "0.61353064", "0.6128442", "0.61145526"...
0.76043904
0
Generate new UUIDs for all rows in a table
def assign_uuids( model: Any, session: Session, batch_size: int = DEFAULT_BATCH_SIZE ) -> None: bind = op.get_bind() table_name = model.__tablename__ count = session.query(model).count() # silently skip if the table is empty (suitable for db initialization) if count == 0: return sta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def function_uuid():\r\n yield uuid.uuid4()", "def _generate_uuid(self):\n\n return uuid.uuid4()", "def generate_uuids():\n uuid_start = str(uuid())\n while uuid_start.startswith(\"zzzzzzzz\"):\n uuid_start = str(uuid())\n uuid_end = list(deepcopy(uuid_start))\n \n char_pool = l...
[ "0.6252362", "0.6069835", "0.60602546", "0.6031163", "0.5899798", "0.58836985", "0.58688223", "0.58331877", "0.5799059", "0.5787476", "0.57632875", "0.5743339", "0.5730291", "0.57265776", "0.57037145", "0.5674246", "0.5665568", "0.5646195", "0.56417024", "0.56417024", "0.5639...
0.65638924
0
If param == 0, sets turn angle to default value. Converts current position angle from radians to degrees. Converts negative angles to positive. COntinues to turn left until the current distance to the goal is greater than the previous distance, meaning that the goal has been passed.
def left(self, param): global estop_flag, move_state #If input angle is zero, set angle to default if param: angle = param else: angle = riu.default_angle signal.alarm(0) #Disable timer interrupt for the duration of the movement #safely grab current yaw with self.move_state_lock: current_yaw = (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def right(self, param):\n\t\tglobal estop_flag, move_state\n\t\t#If input angle is zero, set angle to default\n\t\tif param:\n\t\t\tangle = param\n\t\telse:\n\t\t\tangle = riu.default_angle\n\n\t\tsignal.alarm(0) #Disable timer interrupt for the duration of the movement\n\t\t#safely grab current yaw\n\t\twith self...
[ "0.7021173", "0.70137686", "0.67029786", "0.65796685", "0.63092864", "0.61473304", "0.6123353", "0.61182714", "0.61117864", "0.60715616", "0.60414594", "0.60361344", "0.59939015", "0.5975596", "0.59737754", "0.5938437", "0.59375", "0.59341085", "0.59288204", "0.5903714", "0.5...
0.7418729
0
If param == 0, sets turn angle to default value. Converts current position angle from radians to degrees. Converts negative angles to positive. COntinues to turn left until the current distance to the goal is greater than the previous distance, meaning that the goal has been passed.
def right(self, param): global estop_flag, move_state #If input angle is zero, set angle to default if param: angle = param else: angle = riu.default_angle signal.alarm(0) #Disable timer interrupt for the duration of the movement #safely grab current yaw with self.move_state_lock: current_yaw = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def left(self, param):\n\t\tglobal estop_flag, move_state\n\t\t#If input angle is zero, set angle to default\n\t\tif param:\n\t\t\tangle = param\n\t\telse:\n\t\t\tangle = riu.default_angle\n\n\t\tsignal.alarm(0) #Disable timer interrupt for the duration of the movement\n\t\t#safely grab current yaw\n\t\twith self....
[ "0.7420052", "0.70118314", "0.67038393", "0.6579593", "0.6309404", "0.6147523", "0.6123622", "0.61167604", "0.6110599", "0.6072676", "0.6042288", "0.60363406", "0.59952015", "0.59768206", "0.5973986", "0.59382665", "0.59378344", "0.59349597", "0.5929142", "0.59034985", "0.587...
0.7022378
1
Calls linear_move. If no parameter, defaults to default_dist
def forward(self, param): if param: self.linear_move(param * .3048) else: self.linear_move(riu.default_dist * .3048)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linear_move(self, initial_position, final_position):\n if any(initial_position - final_position):\n # The desired position is not the actual position (would make a 'divide by zero' error otherwise)\n\n # Compute directional vector\n dir_vector = final_position - initial_...
[ "0.6693261", "0.66415036", "0.65412503", "0.6132586", "0.6122272", "0.60313886", "0.5981754", "0.59595865", "0.59388167", "0.58818024", "0.5879753", "0.58745044", "0.58463347", "0.5828148", "0.5824566", "0.58189654", "0.57764554", "0.5741105", "0.5720051", "0.5718488", "0.569...
0.7202606
0
Checks the tracking variable updated by the tracker callback. If no correction is needed, sends a linear twist message. If correction is needed, sends a left or right angular twist as appropriate. Acquires a lock on the move state to update its position. Checks for estop every cycle. Disables ready messages for duratio...
def linear_track(self, dist): global estop_flag, move_state #Disable timer interrupt, reset halfway flag, set target distance signal.alarm(0) halfway_flag = False #Set starting position with self.move_state_lock: start_x, start_y, start_z = move_state['x'], move_state['y'], move_state['z'] #Set curr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linear_move(self, dist):\n\t\tglobal estop_flag, move_state\n\t\tsignal.alarm(0) #Disable timer interrupt for the duration of the movement\n\t\thalfway_flag = False\n\t\t\n\t\twith self.move_state_lock:\n\t\t\tstart_x, start_y, start_z = move_state['x'], move_state['y'], move_state['z']\n\t\tcurrent_x = start_...
[ "0.6857079", "0.6112145", "0.5854988", "0.5841018", "0.58113366", "0.57477736", "0.5714076", "0.57138836", "0.5696555", "0.56912374", "0.5585474", "0.5583985", "0.557774", "0.5564837", "0.5528463", "0.55114955", "0.5441816", "0.54202133", "0.5392405", "0.53795177", "0.5377141...
0.71479756
0
Moves the robot a distance equal to dist. Checks for estop on each iteration. Publishes a Done message after completion and a Half message when the current distance is equal to half of the goal distance.
def linear_move(self, dist): global estop_flag, move_state signal.alarm(0) #Disable timer interrupt for the duration of the movement halfway_flag = False with self.move_state_lock: start_x, start_y, start_z = move_state['x'], move_state['y'], move_state['z'] current_x = start_x current_y = start_y c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drive(self, distance, tolerance=0.0, tolerance_step=0.5,\n max_attempts=10, avoid_targets=True, avoid_home=False,\n use_waypoints=True):\n self.cur_loc = self.swarmie.get_odom_location()\n start = self.cur_loc.get_pose()\n\n goal = Point()\n goal.x = start....
[ "0.64928085", "0.6398207", "0.63323027", "0.63294876", "0.62530607", "0.61761117", "0.6161925", "0.6121459", "0.60939133", "0.6092826", "0.60628915", "0.6010287", "0.5977998", "0.5970592", "0.5965475", "0.59644395", "0.5960455", "0.5934109", "0.5906981", "0.5897367", "0.58761...
0.708726
0
Clean the distributed compute pipeline.
def cleanup(): dist.destroy_process_group()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_up(self):\n dist.destroy_process_group()", "def cleanup(self):\n with hide(\"output\", \"warnings\", \"running\"):\n self.stop_all()\n self._execute_standard(\"rm -rf {model_repo}\".format(model_repo=MODEL_REPO))\n self._execute_root(\"docker rmi --force $(doc...
[ "0.71976703", "0.6800443", "0.6734573", "0.64912385", "0.63518906", "0.63412476", "0.62536824", "0.6208296", "0.6204782", "0.61962974", "0.6179033", "0.617475", "0.61652684", "0.61405635", "0.61350846", "0.6127614", "0.60969156", "0.6074719", "0.6072437", "0.6032038", "0.6014...
0.68549407
1
Reset all OATH data. This action will delete all accounts and restore factory settings for the OATH application on the YubiKey.
def reset(ctx, force): force or click.confirm( "WARNING! This will delete all stored OATH accounts and restore factory " "settings. Proceed?", abort=True, err=True, ) session = ctx.obj["session"] click.echo("Resetting OATH data...") old_id = session.device_id se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(ctx):\n\n controller = ctx.obj['controller']\n click.echo('Resetting OATH data...')\n old_id = controller.id\n controller.reset()\n\n settings = ctx.obj['settings']\n keys = settings.setdefault('keys', {})\n if old_id in keys:\n del keys[old_id]\n settings.write()\n\n ...
[ "0.8467011", "0.65540415", "0.63808334", "0.6317176", "0.6243645", "0.62291396", "0.6131616", "0.6092173", "0.6083494", "0.6074787", "0.6063735", "0.6057817", "0.6048862", "0.6033866", "0.60303414", "0.6019029", "0.601429", "0.5997502", "0.5983064", "0.59774274", "0.59740347"...
0.8467517
0
Manage and use OATH accounts.
def accounts():
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accounts():\n pass", "def open_account():\n print(\"\\n\")\n print(messages.open_account)\n u_id = pyip.inputInt(\"Id: \", greaterThan=0)\n name = pyip.inputCustom(raiseNameError, prompt=\"Name: \")\n address = pyip.inputCustom(raiseAddressError, prompt=\"Address: \")\n ...
[ "0.68266904", "0.65521026", "0.6182628", "0.60371274", "0.6025271", "0.6007449", "0.5981175", "0.5968835", "0.59599483", "0.59120464", "0.58873284", "0.58873284", "0.58796024", "0.58731365", "0.5872677", "0.5826017", "0.582573", "0.58219486", "0.5776078", "0.57698965", "0.576...
0.7143794
0
Generate codes. Generate codes from OATH accounts stored on the YubiKey. Provide a query string to match one or more specific accounts. Accounts of type HOTP, or those that require touch, requre a single match to be triggered.
def code(ctx, show_hidden, query, single, password, remember): _init_session(ctx, password, remember) session = ctx.obj["session"] entries = session.calculate_all() creds = _search(entries.keys(), query, show_hidden) if len(creds) == 1: cred = creds[0] code = entries[cred] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def code(ctx, show_hidden, query, single):\n\n ensure_validated(ctx)\n\n controller = ctx.obj['controller']\n creds = [(cr, c)\n for (cr, c) in controller.calculate_all()\n if show_hidden or not cr.is_hidden\n ]\n\n creds = _search(creds, query)\n\n if len(creds) ...
[ "0.5709946", "0.54599285", "0.52223974", "0.5158887", "0.511579", "0.49772036", "0.4926266", "0.48736855", "0.482959", "0.48240364", "0.47595084", "0.47581586", "0.47494113", "0.47327673", "0.47232696", "0.47091013", "0.47038928", "0.46369225", "0.4620117", "0.46148378", "0.4...
0.60336894
0
Rename an account (requires YubiKey 5.3 or later). \b QUERY a query to match a single account (as shown in "list")
def rename(ctx, query, name, force, password, remember): _init_session(ctx, password, remember) session = ctx.obj["session"] creds = session.list_credentials() hits = _search(creds, query, True) if len(hits) == 0: click.echo("No matches, nothing to be done.") elif len(hits) == 1: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_name(change_account):\n change_data(change_account, changed_data='name')", "def userRenamed(self, oldname, newname):\n # Send messasge to Server bot.\n self.data_in(text=\"\", type=\"renamed\", oldname=oldname, newname=newname)", "def change_username(self, accountid, oldusername, ne...
[ "0.680213", "0.61724126", "0.61534506", "0.5984996", "0.58834755", "0.5820864", "0.5812739", "0.580092", "0.57732266", "0.57656634", "0.5690298", "0.56819504", "0.56756616", "0.5665553", "0.5652086", "0.56036377", "0.55914325", "0.55752826", "0.5561572", "0.5548004", "0.54920...
0.78993976
0
Returns True if link_id is in a valid format.
def isLinkIdFormatValid(link_id): if linkable.LINK_ID_REGEX.match(link_id): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_item_link(self, item):\n if len(item.link) > 255:\n raise ValueError(\"item.link length too long.\")\n\n return True", "def isValid(t_id):\n\tstr_id=str(t_id).strip()\n\treturn str_id.isdigit()", "def is_id_valid(id_code: str) -> bool:\n if id_code.isdigit():\n ...
[ "0.6823712", "0.6606774", "0.65906495", "0.63503116", "0.63053745", "0.62947255", "0.62471926", "0.6207654", "0.6194306", "0.6191876", "0.6190582", "0.60711575", "0.60548055", "0.6014753", "0.5996904", "0.59781694", "0.5946499", "0.59353083", "0.59190065", "0.5917687", "0.590...
0.90292734
0
Returns True if scope_path is in a valid format.
def isScopePathFormatValid(scope_path): if linkable.SCOPE_PATH_REGEX.match(scope_path): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path_validate(path):\n # functionality to be added later\n return path", "def _IsWellFormattedFilePath(path):\n return path.startswith(SRC) and path.endswith(_OWNERS)", "def ValidatePath(self, root_path: str) -> bool:\n if 'silver' in root_path:\n return True\n\n return False", "def val...
[ "0.62401545", "0.6233845", "0.61344105", "0.61142206", "0.6085311", "0.6056564", "0.6019026", "0.5993043", "0.59646183", "0.5931616", "0.59268624", "0.57996225", "0.5798255", "0.5786526", "0.5785276", "0.5777391", "0.57569396", "0.5749316", "0.57310104", "0.57060814", "0.5705...
0.90448207
0
Fetch latest crease xml from animation publish folder...
def _crease_XML_latest_publish(self, tk, templateFile = '', id = '', shotNum = ''): debug(app = self.app, method = '_crease_XML_latest_publish', message = 'Looking for crease xml now...', verbose = False) getCreaseXMLPublishFolder = tk.paths_from_template( templateFile, {'Step' : 'Anm', 'id' : id, 'Shot' : shot...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fetchAnimPublish(self, tk, templateFile = '', fields = '', id = '', shotNum = '', inprogressBar = '', filteredPublish = ''):\r\n\t\tdebug(app = self.app, method = '_fetchAnimPublish', message = 'Fetching latest caches now....', verbose = False)\r\n\t\tdebug(app = self.app, method = '_fetchAnimPublish', messag...
[ "0.6206035", "0.55234224", "0.52666616", "0.5235553", "0.52091956", "0.5206474", "0.52010465", "0.51887625", "0.51887625", "0.5178505", "0.51600707", "0.51256144", "0.5122521", "0.50846535", "0.50757486", "0.5039742", "0.5022523", "0.5022523", "0.5006762", "0.4999023", "0.499...
0.63504636
0
Exposing a tool to help push the ocean into the right location based off the FX published fluid containers fluids_hrc
def _setOceanLocation(self): ## If the fluids_hrc exists if cmds.objExists('fluids_hrc'): if cmds.objExists('ocean_srf'): cmds.connectAttr('fluids_hrc.translateX', 'ocean_srf.translateX', f = True) cmds.connectAttr('fluids_hrc.translateZ', 'ocean_srf.translateZ', f = True) else: cmds.warnin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n\n\n fab_list = get_fabric_list(SANNAV_IP_ADDRESS, SANNAV_FOS_USERNAME, SANNAV_FOS_PASSWORD)\n\n # Print all known facts about the fabrics and the switches\n # Comment out this print statement if this code will be used to generate\n # an Ansible Tower inventory.\n print(json.dumps(fab_l...
[ "0.5672977", "0.560191", "0.55638695", "0.55382484", "0.55016917", "0.5492851", "0.5487739", "0.547502", "0.5456432", "0.5440167", "0.54215467", "0.5404361", "0.53749293", "0.53648347", "0.53563046", "0.5336703", "0.53051615", "0.5297738", "0.52720964", "0.52703017", "0.52670...
0.5646119
1
Return if the selected digits from start in the number are a palindrome
def is_number_palindrome(number, digits, start): number = str((number // 10**start) % 10**digits).zfill(digits) return is_palindrome(number)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_palindrome(n):\n d = digits(n)\n r = int(\"\".join([str(i) for i in d]))\n return n == r", "def isPalindrome(Number):\r\n ListOfDigit=[int(d) for d in str(Number)]\r\n n=len(ListOfDigit)\r\n for i in range(n//2):\r\n if ListOfDigit[i]!=ListOfDigit[-(i+1)]:\r\n return(Fa...
[ "0.7902744", "0.78919506", "0.7875554", "0.78522855", "0.780591", "0.77704966", "0.7650538", "0.7627759", "0.7580284", "0.75686455", "0.7507331", "0.75047344", "0.7498053", "0.7495534", "0.74926513", "0.74589795", "0.74185145", "0.73735946", "0.7350664", "0.73400944", "0.7291...
0.8182947
0
Get all the tag combinations possible for a tree of length n
def get_all_tag_seq(self, n): tags = list(product(self.tags, repeat=n)) return tags
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fn(n):\n if n == 1: return [TreeNode()]\n ans = []\n for nn in range(1, n, 2): \n for left in fn(nn):\n for right in fn(n-1-nn): \n ans.append(TreeNode(left=left, right=right))\n return ans", "def get_subs(n)...
[ "0.6263927", "0.61682093", "0.60873145", "0.599515", "0.596374", "0.5940209", "0.5909812", "0.5883347", "0.58303434", "0.58066684", "0.5776324", "0.57579505", "0.57390195", "0.5715532", "0.57020915", "0.5674218", "0.5645066", "0.5627819", "0.56251854", "0.56197864", "0.561497...
0.6972763
0
Get index of a tag sequence m in self.tags
def get_tag_index(self, m): return self.tags.index(m)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_in_tag(self):\n if hasattr(self, '_m_index_in_tag'):\n return self._m_index_in_tag if hasattr(self, '_m_index_in_tag') else None\n\n self._m_index_in_tag = (self.tag - 35)\n return self._m_index_in_tag if hasattr(self, '_m_index_in_tag') els...
[ "0.7142307", "0.6958829", "0.6688589", "0.66438335", "0.65356153", "0.6207758", "0.62011987", "0.6198451", "0.61982673", "0.6162026", "0.6146128", "0.6113043", "0.60828024", "0.60632235", "0.60050696", "0.5982074", "0.59499717", "0.5918507", "0.5912195", "0.5911467", "0.59011...
0.8766997
0
Given two tags and a label, return the psi factor of the two tag sequences
def get_psi_score(self, psi, pos1, pos2, lab, m1, m2): i, j = self.get_tag_index(m1), self.get_tag_index(m2) return psi[pos1, pos2, lab, i, j]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _psi_function(share1, share2):\n return (share1 - share2) * math.log(share1/share2)", "def get_emissions_probability(label_matches, given_tag, given_word, tag_counts):\r\n\tlookup_tuple = (given_word, given_tag)\r\n\tword_tag_frequency = label_matches.get(lookup_tuple, 0)\r\n\ttag_frequency = tag_counts[g...
[ "0.59438974", "0.5719111", "0.5711388", "0.5612045", "0.5503579", "0.54424065", "0.54400754", "0.5393413", "0.53729504", "0.53618443", "0.5353206", "0.5324507", "0.5300333", "0.52868974", "0.5257343", "0.52473134", "0.52161574", "0.52138144", "0.5211579", "0.5206199", "0.5191...
0.58502215
1
Calculate the gradient of the log probability for a given tree with respect to the psi and phi parameters
def dlog_prob(self, T, pos, m, psi, phi=tr.Tensor()): if phi.size() == tr.Size([0]): phi = self.create_phi(T, pos, m) dpsi_score = self.dlog_score(T, pos, m, psi) dpsi_Z = self.dlogZ(T, pos, psi, phi) return dpsi_score - dpsi_Z
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dlogZ(self, T, pos, psi, phi):\n msgs = belief_propagation(T, pos, psi, phi, True)\n dpsi = calculate_gradient(msgs, T, pos, psi, True, True)\n return dpsi", "def fd_grad(self, T, pos, psi, phi, eps=1e-5):\n dpsi = tr.zeros_like(psi)\n dphi = tr.zeros_like(phi)\n for...
[ "0.7159313", "0.6766048", "0.6629792", "0.6519036", "0.6494689", "0.6489138", "0.6413346", "0.64006495", "0.6371672", "0.63623327", "0.63360333", "0.63232714", "0.6310686", "0.6310686", "0.6260827", "0.62424856", "0.62325174", "0.62135476", "0.61898154", "0.61844623", "0.6144...
0.6783176
1
returns beat info as string
def Beat_disp(self): return ' '.join(str(x+self.offset) for x in self.beats)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info(self):\n out = f\"sec: {self.em_sec()}\\nmin: {self.em_min()}\"\n out += f\"\\nhora: {self.em_hora()}\\ndia: {self.em_dia()}\"\n return out", "def get_at_as_string(self):\n\n return self.at.strftime(\"%Y-%m-%dT%H:%M:%S.000Z\")", "def __str__(self):\n return_text = \"...
[ "0.66582495", "0.6518425", "0.6161863", "0.6112195", "0.6085194", "0.6056986", "0.6040513", "0.59848976", "0.5980764", "0.59712094", "0.5916152", "0.59127504", "0.5898801", "0.5861905", "0.58609194", "0.5855922", "0.58121693", "0.5801718", "0.5774646", "0.5771938", "0.574199"...
0.7030934
0
Team members' stats page for app
def team_members_stats(request): username = request.session.get('username', False) profile = request.session.get('profile', False) if (username): context = {'username': username, 'profile': profile} return render(request, 'MedTAG_sket_dock_App/index.html', context) else: return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_stats(self):\n print(self.team_one.name + \" stats: \")\n self.team_one.stats()\n print(self.team_two.name + \" stats: \")\n self.team_two.stats()", "def info():\n print 'Loading info page'\n\n team_list = datastore.get_all_teams(engine)\n\n return render_template('i...
[ "0.72802764", "0.7093188", "0.6892792", "0.66899914", "0.65582514", "0.6528671", "0.64821774", "0.6452844", "0.64374906", "0.64060926", "0.63946265", "0.63593155", "0.63570726", "0.6330489", "0.6300333", "0.62758255", "0.6246533", "0.6213044", "0.6185886", "0.6148427", "0.613...
0.7581212
0
This view returns the current session parameters
def get_session_params(request): json_resp = {} usecase = request.session.get('usecase',None) language = request.session.get('language',None) institute = request.session.get('institute',None) annotation = request.session.get('mode',None) team_member = request.session.get('team_member',None) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_params(self):\n \n return self.params[self.profile]", "def get_parameters(self):\n return self.context.params", "def SessionInfo(self):\r\n\t\treturn self._get_attribute('sessionInfo')", "def get(self):\n return self.params", "def get(self):\n return self._params", ...
[ "0.6704671", "0.64286435", "0.624347", "0.6236312", "0.6195294", "0.6193571", "0.61749065", "0.61749065", "0.6170325", "0.6170325", "0.6170325", "0.6147238", "0.6137965", "0.61196494", "0.6095869", "0.6027674", "0.60054123", "0.5997175", "0.5986101", "0.5984785", "0.59830755"...
0.6681705
1
This view handles the GET and POST requestes for LABELS ANNOTATION ACTION
def annotationlabel(request,action=None): username = request.session['username'] mode1 = request.session['mode'] auto_required = request.GET.get('ns_id', None) mode = NameSpace.objects.get(ns_id=mode1) # print('mode',mode1) usecase = request.session['usecase'] # language = request.GET.get(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def label():\n\n if request.method == \"GET\":\n return render_template(\"/label.html\")\n\n else:\n # initialise the variables from the hidden html form input\n type = request.form.get(\"type\")\n url = request.form.get(\"url\")\n thumb = request.form.get(\"thumb\")\n\n ...
[ "0.66144353", "0.63546795", "0.63470924", "0.60510325", "0.5695163", "0.5651894", "0.5647814", "0.5625091", "0.5582534", "0.5574167", "0.5572838", "0.55621165", "0.5510184", "0.5436197", "0.54305923", "0.5367623", "0.5344053", "0.532556", "0.5323372", "0.526705", "0.5223831",...
0.7058827
0
This view handles the GET AND POST requests to insert, delete, get concepts.
def contains(request, action=None): username = request.session.get('username', False) mode1 = request.session.get('mode', False) mode = NameSpace.objects.get(ns_id=mode1) error_json = {"Error": "No user authenticated"} if (username): response_json = {} if request.method == 'GET': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conc_view(request):\n\n usecase = request.session['usecase']\n mode = request.session['mode']\n auto_required = request.GET.get('ns_id',None)\n jsonDict = {}\n concepts = {}\n notEmpty = False\n jsonDict['concepts'] = []\n if mode == 'Human' or auto_required == 'Human':\n cursor ...
[ "0.61219996", "0.59057087", "0.56041396", "0.5594849", "0.55910647", "0.5548109", "0.5538304", "0.55363566", "0.551329", "0.551329", "0.5454264", "0.5444275", "0.5436636", "0.5426927", "0.54256684", "0.5419429", "0.5403076", "0.53987503", "0.53939396", "0.5388849", "0.5387255...
0.60170645
1
This view returns the list of reports associated to a single use_case, institute and language
def get_reports(request): inst = request.GET.get('institute',None) use = request.GET.get('usec',None) print(use) lang = request.GET.get('lang',None) batch = request.GET.get('batch',None) all = request.GET.get('all',None) actual_report = request.GET.get('actual_report',None) if all == 'a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(request):\n\n json_resp = {}\n # reports = Report.objects.filter(name = UseCase.objects.get(name=request.session['usecase']),institute = request.session['institute'],language = request.session['language'])\n\n json_resp['reports'] = []\n institute = request.GET.get('institute',request.sess...
[ "0.61894846", "0.60761696", "0.5919785", "0.58525854", "0.5772856", "0.575343", "0.5743181", "0.57404655", "0.5713519", "0.56065595", "0.5573967", "0.5552891", "0.54978424", "0.5465102", "0.5448308", "0.5387445", "0.53673327", "0.5361622", "0.53593826", "0.52845144", "0.52631...
0.6606941
0
This view checks whether the configuration files the user inserted are well formed and returns the response
def check_input_files(request): reports = [] labels = [] pubmedfiles = [] concepts = [] type1 = request.POST.get('type',None) username = request.POST.get('username',None) # email = request.POST.get('email',None) password = request.POST.get('password',None) for filename, file in requ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config_verify(self,\n raw_response: Any,\n *args,\n **kwargs) -> bool:\n pass", "def edit_config_verify(self,\n raw_response: Any,\n *args,\n **k...
[ "0.59801537", "0.5930928", "0.59076905", "0.58123827", "0.5767755", "0.5741729", "0.5710974", "0.5606", "0.5606", "0.5601504", "0.5598409", "0.5596937", "0.5566562", "0.55586517", "0.5556762", "0.5550772", "0.55330944", "0.55282456", "0.5525261", "0.5514157", "0.5479723", "...
0.61117023
0
This view checks whether the files inserted by the user to update the configuration are well formed
def check_files_for_update(request): reports = [] pubmedfiles = [] labels = [] concepts = [] type1 = request.POST.get('type',None) for filename, file in request.FILES.items(): if filename.startswith('reports'): reports.append(file) if filename.startswith('pubmed'): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_config(self):\n try:\n config_metadata = self.dbc.get_metadata(\"config.txt\")\n except rest.ErrorResponse:\n print str(datetime.datetime.now()) \\\n + \": No config.txt in Dropbox directory. Exiting.\"\n sys.exit()\n if config_metadata...
[ "0.5990421", "0.5856733", "0.58000755", "0.5700677", "0.5700643", "0.5694012", "0.56602377", "0.5652492", "0.5576875", "0.5533964", "0.55261713", "0.5525095", "0.54940057", "0.5441861", "0.54376626", "0.54344094", "0.5424616", "0.5412756", "0.54043454", "0.53829175", "0.53707...
0.6431848
0
This view returns the list of all the distinct keys present in the json reports. This view is called during configuration
def get_keys(request): keys=[] reports = Report.objects.all().exclude(institute = 'PUBMED') for report in reports: json_rep = report.report_json for el in json_rep.keys(): if el not in keys: keys.append(el) json_resp = {'keys':keys} return JsonResponse(js...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def AllKeys(self) -> _n_0_t_1[str]:", "def distinct(self, key):\n return self.database.command({'distinct': self.name,\n 'key': key})['values']", "def keys(self) -> KeysView:\n return self._dict.keys()", "def GET(self, key):\n header('Content-Type', '...
[ "0.6015251", "0.5963718", "0.5916041", "0.58546275", "0.5769133", "0.57459795", "0.5695538", "0.5680063", "0.5674234", "0.56573683", "0.56514174", "0.56393325", "0.5621896", "0.55753326", "0.55740577", "0.5571665", "0.55628973", "0.55588096", "0.55510443", "0.55476856", "0.55...
0.79304016
0
This view returns ALL the ground truths to be downloaded. This view can be called only by the admin and the ground truths returned are those of ALL the users in the platform
def download_all_ground_truths(request): json_resp = {} json_resp['ground_truth'] = [] cursor = connection.cursor() mode = request.GET.get('gt_mode',None) if mode is None: human = NameSpace.objects.get(ns_id = 'Human') robot = NameSpace.objects.get(ns_id = 'Robot') gt_human ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_ground_truths(request):\n\n workpath = os.path.dirname(os.path.abspath(__file__)) # Returns the Path your .py file is in\n path1 = os.path.join(workpath, './static/temp/temp.csv')\n path2 = os.path.join(workpath, './static/BioC/temp_files/to_download.csv')\n if os.path.exists(path1):\n ...
[ "0.6390326", "0.6114309", "0.5874675", "0.5586476", "0.54724544", "0.54573137", "0.538209", "0.5373068", "0.5310844", "0.5264944", "0.5234574", "0.5225719", "0.52199984", "0.52116776", "0.52091205", "0.5126838", "0.5124764", "0.5122737", "0.5103302", "0.51019853", "0.50845915...
0.71700454
0
This view returns the key files of BioC mentions and linking.
def download_key_files(request): workpath = os.path.dirname(os.path.abspath(__file__)) # Returns the Path your .py file is in path = os.path.join(workpath, './static/BioC/linking.key') path1 = os.path.join(workpath, './static/BioC/mention.key') ment = request.GET.get('type_key',None) if ment == 'm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def take_auth_data():\n home = str(Path.home())\n path_to_keys = '/Documents/twitter/keys/'\n\n files = [f for f in listdir(home+path_to_keys) if '.DS' not in f]\n\n tokens = []\n for f in files:\n with open(home+path_to_keys+f, 'r') as lines:\n ln = lines.readline().replace(\" \",...
[ "0.5546954", "0.5437735", "0.5268663", "0.5253988", "0.52061164", "0.52018476", "0.5182864", "0.51804817", "0.5095209", "0.5094157", "0.50905", "0.5058644", "0.5009201", "0.50003994", "0.49914286", "0.4987616", "0.49603057", "0.49587998", "0.4955711", "0.49460372", "0.4943244...
0.7325465
0
This view returns the last ground truth created by the user for the session's parameters
def get_last_gt(request): username = request.session['username'] mode1 = request.session['mode'] mode = NameSpace.objects.get(ns_id=mode1) language = request.session['language'] usecase = request.session['usecase'] institute = request.session['institute'] batch = request.session['batch'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_ground_truth(request):\n\n user = request.GET.get('user',None)\n action = request.GET.get('action',None)\n mode = request.GET.get('mode',None)\n report = request.GET.get('report',None)\n language = request.GET.get('language',request.session['language'])\n mode_obj = NameSpace.objects...
[ "0.6362369", "0.5618397", "0.55958295", "0.5394522", "0.53271693", "0.532361", "0.524949", "0.52235365", "0.5198521", "0.51720786", "0.5165802", "0.51398844", "0.5132665", "0.5132122", "0.51075196", "0.5077153", "0.503414", "0.5029794", "0.5022567", "0.50175035", "0.49976113"...
0.65990674
0
This view returns for each key of the json report required its text, the indexes of the start and stop chars in the json report string and the number of words that compose the fields to annotate.
def report_start_end(request): report = request.GET.get('report_id') lang = request.GET.get('language',None) usecase = request.session['usecase'] data = get_fields_from_json() json_keys_to_display = data['fields'] json_keys_to_display.extend(['journal','authors','year','volume']) json_keys_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def annotation_all_stats(request):\n\n id_report = request.GET.get('report',None)\n language = request.GET.get('language',None)\n\n json_dict = get_annotations_count(id_report,language)\n\n # print('annotations',json_dict)\n return JsonResponse(json_dict)", "def keyword_analysis(request): \n ...
[ "0.5901755", "0.557389", "0.5426363", "0.53363323", "0.53263783", "0.530319", "0.529372", "0.52915365", "0.52282554", "0.52024233", "0.51975214", "0.5193073", "0.5190849", "0.5155429", "0.51324636", "0.51046854", "0.51033866", "0.50946844", "0.5073294", "0.5071243", "0.507050...
0.5978528
0
This view returns the fields to display and annotate. If the annotation mode is automatic the fields to annotate are those the concepts and mentions have been extracted from. The fields are returned to give the user the chance to update the fields she wants to display/annotate in MANUAL CONFIGURATION.
def get_fields(request): json_resp = {} json_resp['fields'] = [] json_resp['fields_to_ann'] = [] all = request.GET.get('all',None) workpath = os.path.dirname(os.path.abspath(__file__)) # Returns the Path your .py file is in auto_request = request.GET.get('ns_id', None) report = request.GET...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_auto_annotations(request): # post\n\n request_body_json = json.loads(request.body)\n usecase_list = request_body_json['usecase']\n fields_list = request_body_json['selected']\n report_key = request_body_json['report_type']\n batch = request_body_json['batch']\n\n # check existence of e...
[ "0.5912422", "0.5710874", "0.5643516", "0.5519478", "0.5514924", "0.541801", "0.5411552", "0.5356129", "0.52762175", "0.5274392", "0.5206856", "0.51891625", "0.5185114", "0.51487356", "0.51449263", "0.5080195", "0.5075947", "0.50657296", "0.50644743", "0.50619006", "0.5053078...
0.63069195
0
This view creates the HttpResponse object with the CSV examples files, these are the examples the user can download.
def download_examples(request): file_required = request.GET.get('token',None) path = '' workpath = os.path.dirname(os.path.abspath(__file__)) # Returns the Path your .py file is in if file_required == 'reports': path = os.path.join(workpath, './static/examples/report.csv') elif file_requi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def csv_download_view(request):\n logging.info(\" CSV file download is working\")\n now = datetime.now()\n timestamp = now.strftime(\"%Y_%m_%d\")\n response = HttpResponse(content_type='text/csv')\n response['Content-Disposition'] = 'attachment; filename=\"results_' + \\\n GLOBAL_VARIABLE.get...
[ "0.66388816", "0.6486266", "0.6369911", "0.6286953", "0.62677735", "0.6229694", "0.6140815", "0.60950977", "0.60798424", "0.6048974", "0.588191", "0.5857587", "0.5844419", "0.58400095", "0.58131593", "0.5644796", "0.5629658", "0.5619012", "0.5589778", "0.55788064", "0.5575425...
0.8027104
0
This view creates the HttpResponse object with the appropriate CSV header, these are the templates the user can download.
def download_templates(request): file_required = request.GET.get('token',None) path = '' workpath = os.path.dirname(os.path.abspath(__file__)) # Returns the Path your .py file is in if file_required == 'reports': path = os.path.join(workpath, './static/templates/report.csv') elif file_re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def csv_download_view(request):\n logging.info(\" CSV file download is working\")\n now = datetime.now()\n timestamp = now.strftime(\"%Y_%m_%d\")\n response = HttpResponse(content_type='text/csv')\n response['Content-Disposition'] = 'attachment; filename=\"results_' + \\\n GLOBAL_VARIABLE.get...
[ "0.77301335", "0.73666567", "0.7355991", "0.7228909", "0.7226983", "0.7217648", "0.7094669", "0.70587486", "0.7015085", "0.7014507", "0.7010828", "0.70096016", "0.6967033", "0.69572055", "0.69189924", "0.6718752", "0.66366225", "0.6557932", "0.64799553", "0.6463194", "0.64586...
0.75247663
1
This view returns the list of all the keys found in report files (other than institute,usecase,id_report,language) the admin has just inserted to update the database (only the keys that have never been detected before are returned).
def get_keys_from_csv_update(request): reports = [] json_resp = {} for filename, file in request.FILES.items(): if filename.startswith('reports'): reports.append(file) elif filename.startswith('pubmed'): reports.append(file) keys,uses = get_keys_csv_update(repor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_keys(request):\n\n keys=[]\n reports = Report.objects.all().exclude(institute = 'PUBMED')\n for report in reports:\n json_rep = report.report_json\n for el in json_rep.keys():\n if el not in keys:\n keys.append(el)\n json_resp = {'keys':keys}\n return ...
[ "0.71772546", "0.5747411", "0.5723134", "0.569637", "0.5561608", "0.54670197", "0.5361327", "0.5307448", "0.53016967", "0.5248564", "0.5241497", "0.52275854", "0.5220743", "0.52100676", "0.5197569", "0.5185162", "0.5140861", "0.5136076", "0.51293594", "0.51133555", "0.5111757...
0.6515069
1
This view returns the groundtruth associated to a specific user,action,report
def get_user_ground_truth(request): user = request.GET.get('user',None) action = request.GET.get('action',None) mode = request.GET.get('mode',None) report = request.GET.get('report',None) language = request.GET.get('language',request.session['language']) mode_obj = NameSpace.objects.get(ns_id=m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_reports_from_action(request):\n\n username = request.session['username']\n mode1 = request.session['mode']\n mode = NameSpace.objects.get(ns_id=mode1)\n language = request.session['language']\n report_to_ret = []\n action = request.GET.get('action',None)\n user = User.objects.get(usern...
[ "0.6772657", "0.6000003", "0.59264755", "0.5880304", "0.57433313", "0.5722247", "0.56435704", "0.5437227", "0.5424971", "0.54028565", "0.5310623", "0.5304719", "0.5268187", "0.5193207", "0.51647246", "0.51642805", "0.51576793", "0.515311", "0.5151735", "0.5143959", "0.5133754...
0.69742775
0
This view returns the list of batches associated to a use case
def get_batch_list(request): json_resp = {} json_resp['batch_list'] = [] usecase = request.GET.get('usecase',None) # print(usecase) if usecase is None: batch = Report.objects.all().exclude(institute='PUBMED').values('batch') else: use_obj = UseCase.objects.get(name=usecase) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_batches(request):\n\n template = 'batch_list.html'\n\n context = {\n 'invalid_due_date': request.GET.get('invalid_due_date')\n }\n\n try:\n get_batches(request, context)\n except Exception as e:\n context['error'] = '{} {}'.format(e, traceback.format_exc())\n\n # TOD...
[ "0.65461797", "0.6110669", "0.60014474", "0.5702793", "0.56802934", "0.5664144", "0.56525695", "0.5584406", "0.5498826", "0.5481742", "0.5451509", "0.54278344", "0.53596485", "0.53492475", "0.53231066", "0.52532625", "0.52472556", "0.5156872", "0.5120976", "0.51208967", "0.51...
0.6295193
1
This view returns the list of batches associated to a use case which have english language
def get_auto_anno_batch_list(request): json_resp = {} usecase = request.GET.get('usecase') # print(usecase) use_obj = UseCase.objects.get(name=usecase) json_resp['batch_list'] = [] languages = ['English','english'] batch = Report.objects.filter(name=use_obj,language__in = languages).exclude...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_auto_anno_PUBMED_batch_list(request):\n\n json_resp = {}\n usecase = request.GET.get('usecase')\n # print(usecase)\n languages = ['English', 'english']\n use_obj = UseCase.objects.get(name=usecase)\n json_resp['batch_list'] = []\n batch = Report.objects.filter(name=use_obj,language__in...
[ "0.6487992", "0.5999556", "0.58158106", "0.57203585", "0.5676394", "0.56275505", "0.5532938", "0.5520498", "0.5510358", "0.55094916", "0.5498899", "0.54472136", "0.53090847", "0.5303731", "0.52797216", "0.5278192", "0.52427185", "0.5226427", "0.5222747", "0.5220931", "0.52123...
0.6674985
0
This view returns the list of batches associated to a PUBMED use case
def get_PUBMED_batch_list(request): json_resp = {} usecase = request.GET.get('usecase') # print(usecase) use_obj = UseCase.objects.get(name=usecase) json_resp['batch_list'] = [] batch = Report.objects.filter(name=use_obj,institute = 'PUBMED').values('batch') for el in batch: if el['...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_batches(request):\n\n template = 'batch_list.html'\n\n context = {\n 'invalid_due_date': request.GET.get('invalid_due_date')\n }\n\n try:\n get_batches(request, context)\n except Exception as e:\n context['error'] = '{} {}'.format(e, traceback.format_exc())\n\n # TOD...
[ "0.6342829", "0.6229871", "0.59056467", "0.58580834", "0.5704401", "0.5654031", "0.5634934", "0.5585", "0.5473519", "0.53536516", "0.53245217", "0.53240734", "0.52888346", "0.5250839", "0.52369195", "0.5228739", "0.52019703", "0.5178603", "0.5165569", "0.5162922", "0.51555914...
0.6636962
0
This view returns the list of batches associated to a PUBMED use case in english language
def get_auto_anno_PUBMED_batch_list(request): json_resp = {} usecase = request.GET.get('usecase') # print(usecase) languages = ['English', 'english'] use_obj = UseCase.objects.get(name=usecase) json_resp['batch_list'] = [] batch = Report.objects.filter(name=use_obj,language__in = languages,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_PUBMED_batch_list(request):\n\n json_resp = {}\n usecase = request.GET.get('usecase')\n # print(usecase)\n use_obj = UseCase.objects.get(name=usecase)\n json_resp['batch_list'] = []\n batch = Report.objects.filter(name=use_obj,institute = 'PUBMED').values('batch')\n for el in batch:\n ...
[ "0.65641147", "0.6093252", "0.59606016", "0.5839453", "0.55629605", "0.5310953", "0.5296694", "0.51423275", "0.5020829", "0.49711797", "0.49675223", "0.496288", "0.49492076", "0.48867327", "0.48834974", "0.48540273", "0.48291108", "0.4824442", "0.48152086", "0.48104975", "0.4...
0.6816767
0
This view handles the download of one or more reports' groundtruths (including the GT majority vote based.
def download_all_reports(request): request_body_json = json.loads(request.body) report_list = request_body_json['report_list'] mode = request_body_json['format'] action = request_body_json['action'] annot = request_body_json['annotation_mode'] if annot == 'Manual': annot = 'Human' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_all_ground_truths(request):\n\n json_resp = {}\n json_resp['ground_truth'] = []\n cursor = connection.cursor()\n mode = request.GET.get('gt_mode',None)\n if mode is None:\n human = NameSpace.objects.get(ns_id = 'Human')\n robot = NameSpace.objects.get(ns_id = 'Robot')\n ...
[ "0.6838261", "0.65341705", "0.62299836", "0.6090916", "0.59187865", "0.5832907", "0.5767083", "0.5675658", "0.56663036", "0.5666215", "0.5635911", "0.5478633", "0.5468885", "0.54647183", "0.54031974", "0.5370372", "0.53674585", "0.5365349", "0.5343065", "0.53406143", "0.53295...
0.65963656
1
This view returns the usecases which have not nor exa labels nor exa concepts
def get_uses_missing_exa(request): use_to_ret = {} use_to_ret['labels_present'] = [] use_to_ret['concepts_present'] = [] use_to_ret['labels_missing'] = [] use_to_ret['concepts_missing'] = [] uses = ['colon','uterine cervix','lung'] for el in uses: usecase = UseCase.objects.get(name=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_presence_exa_conc_lab(request):\n\n # reports = request.GET.get('reports',None)\n rep = request.GET.get('id_report',None)\n language = request.GET.get('language',None)\n usecase = request.GET.get('usecase',None)\n reports = None\n if request.method == 'POST':\n request_body_json ...
[ "0.59388274", "0.58805186", "0.58260775", "0.53480375", "0.53480375", "0.53390783", "0.5233926", "0.5202363", "0.5183914", "0.5163577", "0.5127641", "0.5122592", "0.5121663", "0.5119788", "0.51088226", "0.5098412", "0.5095758", "0.5095758", "0.50584406", "0.50419766", "0.5028...
0.7342495
0
This view returns the languages available for a report
def get_report_translations(request): id_report = request.GET.get('id_report',None) if id_report is not None: languages = [] lang = Report.objects.filter(id_report = id_report) for el in lang: if el.language not in languages: languages.append(el.language) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def languages(self):\r\n url = '{0}/{1}'.format(self.get_url(), 'languages')\r\n\r\n return http.Request('GET', url), parsers.parse_json", "def wikiLanguages():\n return languages", "def languages(self):\n\n return self._request('/languages')", "def languages():\n r = requests.get(...
[ "0.7279651", "0.72215253", "0.7170446", "0.6814636", "0.6712208", "0.66994166", "0.66713786", "0.6651076", "0.65438974", "0.6543734", "0.6529538", "0.65234035", "0.6458752", "0.64573747", "0.6453006", "0.6448716", "0.64473933", "0.64339", "0.64140487", "0.6352627", "0.633507"...
0.7563172
0
This view returns return the usecases of medtag reports
def medtag_reports(request): json_resp = {} json_resp['usecase'] = [] reps = Report.objects.all() for r in reps: if not r.id_report.startswith('PUBMED_') and not str(r.name_id) in json_resp['usecase']: json_resp['usecase'].append(str(r.name_id)) return JsonResponse(json_resp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_medtag_reports(request):\n\n json_resp = {}\n json_resp['count'] = 0\n medtag_arts = Report.objects.all().exclude(institute = 'PUBMED')\n # for el in pubmed_arts:\n # if el.id_report.startswith('PUBMED'):\n json_resp['count'] = medtag_arts.count()\n return JsonResponse(json_resp,...
[ "0.665116", "0.59123224", "0.55685633", "0.55224574", "0.5493389", "0.5459506", "0.54581726", "0.5311828", "0.530699", "0.52737117", "0.5272512", "0.527097", "0.52511895", "0.5246451", "0.5195243", "0.5169995", "0.51681095", "0.5164607", "0.51173073", "0.50936943", "0.5049706...
0.7262409
0
This view returns return the usecases of pubmed reports
def pubmed_reports(request): json_resp = {} json_resp['usecase'] = [] reps = Report.objects.all() for r in reps: if r.id_report.startswith('PUBMED_') and not str(r.name_id) in json_resp['usecase']: json_resp['usecase'].append(str(r.name_id)) return JsonResponse(json_resp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pubmed_missing_auto(request):\n\n usecases = UseCase.objects.all()\n json_resp = {}\n json_resp['annotated'] = 0\n json_resp['tot'] = 0\n json_resp['usecase'] = []\n languages = ['English','english']\n for el in usecases:\n use = el.name\n json_resp[use] = {}\n batches...
[ "0.6889685", "0.67816097", "0.6578456", "0.6462005", "0.6354941", "0.60960084", "0.6039205", "0.5924308", "0.59200716", "0.58842385", "0.58725315", "0.58610183", "0.58609855", "0.5834699", "0.5742797", "0.5734736", "0.572304", "0.56792724", "0.5666692", "0.56550825", "0.56486...
0.7125116
0
Returns the fuzz target of |benchmark|
def get_fuzz_target(benchmark): # Do this because of OSS-Fuzz-on-demand. # TODO(metzman): Use classes to mock a benchmark config for # OSS_FUZZ_ON_DEMAND. return benchmark_config.get_config(benchmark).get( 'fuzz_target', environment.get('FUZZ_TARGET'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fuzzer_benchmark_key(fuzzer: str, benchmark: str):\n return fuzzer + ' ' + benchmark", "def get_benchmark(self, benchmark):\n\t\tif not isinstance(benchmark, str) and not callable(benchmark): return benchmark\n\t\telif benchmark in self.classes:\treturn self.classes[benchmark]()\n\t\traise TypeError('...
[ "0.6541956", "0.62079185", "0.57205427", "0.5588023", "0.55567586", "0.543854", "0.54338294", "0.53948295", "0.5363798", "0.532333", "0.5268365", "0.5229397", "0.5206228", "0.51935446", "0.51308554", "0.5129264", "0.5088721", "0.5079886", "0.5032553", "0.5032553", "0.50242513...
0.8522614
0
Returns the project of |benchmark|
def get_project(benchmark): return benchmark_config.get_config(benchmark)['project']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def benchmark_result(self):\n return self._benchmark_id", "def benchmark_selection(self):\n return self._benchmark_selection", "def get_benchmark(client):\n r = client.get(config.API_PATH() + '/benchmarks')\n benchmarks = json.loads(r.data)\n return benchmarks['benchmarks'][0]['id']", ...
[ "0.6512932", "0.6404195", "0.634007", "0.62146837", "0.6029168", "0.59504235", "0.5943799", "0.5894067", "0.581235", "0.5640167", "0.54331803", "0.53937525", "0.53754103", "0.53711575", "0.53711575", "0.53711575", "0.53711575", "0.53711575", "0.53711575", "0.53711575", "0.537...
0.81019706
0
Returns the type of |benchmark|
def get_type(benchmark): # TODO(metzman): Use classes to mock a benchmark config for # OSS_FUZZ_ON_DEMAND. default_value = os.getenv('EXPERIMENT_TYPE', BenchmarkType.CODE.value) return benchmark_config.get_config(benchmark).get('type', default_value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_benchmark(self, benchmark):\n\t\tif not isinstance(benchmark, str) and not callable(benchmark): return benchmark\n\t\telif benchmark in self.classes:\treturn self.classes[benchmark]()\n\t\traise TypeError('Passed benchmark is not defined!')", "def validate_type(benchmark):\n benchmark_type = get_type(...
[ "0.7427512", "0.6534945", "0.6310375", "0.63042027", "0.6122598", "0.6042788", "0.58986205", "0.58470327", "0.58307236", "0.58241946", "0.5813828", "0.5782032", "0.5728832", "0.570958", "0.5697104", "0.56663436", "0.56439966", "0.5572599", "0.5552849", "0.5550577", "0.5532445...
0.8139171
0
Get the URL of the docker runner image for fuzzing the benchmark with fuzzer.
def get_runner_image_url(experiment, benchmark, fuzzer, docker_registry): tag = 'latest' if environment.get('LOCAL_EXPERIMENT') else experiment return f'{docker_registry}/runners/{fuzzer}/{benchmark}:{tag}'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_builder_image_url(benchmark, fuzzer, docker_registry):\n return f'{docker_registry}/builders/{fuzzer}/{benchmark}'", "def _to_dockerfile_url(image):\n path = \"/\".join((image.platform, image.release, image.architecture, \"Dockerfile\"))\n return git.get_github_blob_url(path, ref=f\"v{image.vers...
[ "0.8196786", "0.6458271", "0.5928085", "0.5869728", "0.5578148", "0.55031866", "0.5449406", "0.54289633", "0.5422988", "0.53856117", "0.5382283", "0.534175", "0.5297771", "0.5248548", "0.5238496", "0.5210609", "0.5198708", "0.519582", "0.5189414", "0.512294", "0.51160717", ...
0.87715006
0