query stringlengths 10 2k | document stringlengths 20 51.2k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
ID of the billing account to set a budget on. | def billing_account(self) -> pulumi.Output[str]:
return pulumi.get(self, "billing_account") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_billing_account_id():\n org_client = boto3.client(\"organizations\")\n response = org_client.describe_organization()\n return response[\"Organization\"][\"MasterAccountId\"]",
"def account_id(self):\n return self._account_id",
"def billing_account(self) -> pulumi.Input[str]:\n r... | [
"0.708502",
"0.6489374",
"0.6405801",
"0.6405801",
"0.6375092",
"0.6375092",
"0.6375092",
"0.6375092",
"0.6375092",
"0.6375092",
"0.6375092",
"0.6375092",
"0.63689065",
"0.6368068",
"0.6344874",
"0.6307345",
"0.6282439",
"0.6272353",
"0.61288166",
"0.610314",
"0.610314",
"0... | 0.60315883 | 23 |
Constructs an operator from an array of diagonals. | def qdiags(diagonals, offsets=None, dims=None, shape=None, *,
dtype=None):
dtype = dtype or settings.core["default_dtype"] or _data.Dia
offsets = [0] if offsets is None else offsets
data = _data.diag[dtype](diagonals, offsets, shape)
return Qobj(data, dims=dims, type='oper', copy=False) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def diag_operator(self, diag_elements, subsystem):\n dim = subsystem.truncated_dim\n index = range(dim)\n diag_matrix = np.zeros((dim, dim), dtype=np.float_)\n diag_matrix[index, index] = diag_elements\n return self.identity_wrap(diag_matrix, subsystem)",
"def from_diag(d, cont... | [
"0.65071154",
"0.59069145",
"0.586862",
"0.5804937",
"0.5654129",
"0.5586014",
"0.5576276",
"0.5488109",
"0.5435257",
"0.54153854",
"0.5408845",
"0.5353578",
"0.53513896",
"0.5340385",
"0.5330635",
"0.5296116",
"0.5284892",
"0.52455354",
"0.5238309",
"0.52167505",
"0.52073",
... | 0.59381104 | 1 |
Determines whether this position is on the board | def in_board(self,pos : np.ndarray) -> bool:
if 0 > pos[0] or pos[0] >= BOARD_SIZE:
return False
if 0 > pos[1] or pos[1] >= BOARD_SIZE:
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_board(self, pos):\n i, j = pos\n return 0 <= i < COLS and 0 <= j < ROWS",
"def is_on_board(x: int, y: int) -> bool:\n return x >= 0 and x < BOARDWIDTH and y < BOARDHEIGHT",
"def on_board(self):\n if -1 < self._rank < 8 and \\\n -1 < self._file < 8:\n ret... | [
"0.81498706",
"0.78732497",
"0.7755435",
"0.7717559",
"0.75796986",
"0.75289285",
"0.7458956",
"0.745256",
"0.73967874",
"0.7356471",
"0.71337366",
"0.7132117",
"0.71007866",
"0.70901364",
"0.7058172",
"0.704911",
"0.7046944",
"0.7008636",
"0.699687",
"0.69832903",
"0.6973063... | 0.8019457 | 1 |
Return the execution price if an order open a position. It depend of the direction of the order and the market bid/ofr prices. If position is long, then returns the market ofr price. If position is short, then returns the market bid price. | def open_exec_price(self, direction):
if direction > 0:
return self._market_ofr
elif direction < 0:
return self._market_bid
else:
return self._market_ofr | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_order_price(self):\r\n if self.price is not None:\r\n return self.price #typical limit price order\r\n else:\r\n #Check the orderbook\r\n logger.info(\"floating price\")\r\n self.get_orderbook()\r\n logger.info(self.orderbook_snapshot)\r\... | [
"0.64150524",
"0.62830645",
"0.6098872",
"0.6017437",
"0.5974247",
"0.5765821",
"0.57276094",
"0.57276094",
"0.56938624",
"0.5669108",
"0.56382257",
"0.563431",
"0.5617114",
"0.56142503",
"0.5610393",
"0.55896497",
"0.55893433",
"0.55827796",
"0.55815804",
"0.55397147",
"0.55... | 0.7290426 | 0 |
Return the execution price if an order/position is closing. It depend of the direction of the order and the market bid/ofr prices. If position is long, then returns the market bid price. If position is short, then returns the market ofr price. | def close_exec_price(self, direction):
if direction > 0:
return self._market_bid
elif direction < 0:
return self._market_ofr
else:
return self._market_bid | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def open_exec_price(self, direction):\n if direction > 0:\n return self._market_ofr\n elif direction < 0:\n return self._market_bid\n else:\n return self._market_ofr",
"def close_position(self, symbol):\n #Need to add a check for intraday_quantity, if ... | [
"0.72555554",
"0.68134475",
"0.60038996",
"0.5954429",
"0.5954429",
"0.5941992",
"0.58907574",
"0.5777061",
"0.57573104",
"0.57491124",
"0.573018",
"0.5716566",
"0.5684228",
"0.5632406",
"0.56132317",
"0.5594526",
"0.5580105",
"0.5559574",
"0.55466336",
"0.5522094",
"0.551983... | 0.7269363 | 0 |
Format the price according to the precision. | def adjust_price(self, price):
precision = self._price_limits[3] or 8
tick_size = self._price_limits[2] or 0.00000001
# adjusted price at precision and by step of pip meaning
return truncate(round(price / tick_size) * tick_size, precision) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format_price(self, price):\n precision = self._price_limits[3] or 8\n tick_size = self._price_limits[2] or 0.00000001\n\n adjusted_price = truncate(round(price / tick_size) * tick_size, precision)\n formatted_price = \"{:0.0{}f}\".format(adjusted_price, precision)\n\n # remov... | [
"0.83805925",
"0.7948184",
"0.70812726",
"0.6851744",
"0.67090076",
"0.66487193",
"0.6485122",
"0.643207",
"0.6341096",
"0.6275892",
"0.6265527",
"0.62199074",
"0.614903",
"0.611961",
"0.60881114",
"0.60480404",
"0.6036738",
"0.6033766",
"0.59782916",
"0.59467477",
"0.5945127... | 0.69948137 | 3 |
Format the price according to the precision. | def format_price(self, price):
precision = self._price_limits[3] or 8
tick_size = self._price_limits[2] or 0.00000001
adjusted_price = truncate(round(price / tick_size) * tick_size, precision)
formatted_price = "{:0.0{}f}".format(adjusted_price, precision)
# remove tailing 0s a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_formated_price(\n amount: Decimal,\n precision: int = DEFAULT_DECIMAL_PLACES\n) -> str:\n return \"{:0.0{}f}\".format(amount, precision)",
"def price_pounds(self):\n price = '{0:03d}'.format(self.price)\n return price[:-2] + '.' + price[-2:]",
"def adjust_price(self, price):\n ... | [
"0.7948184",
"0.70812726",
"0.69948137",
"0.6851744",
"0.67090076",
"0.66487193",
"0.6485122",
"0.643207",
"0.6341096",
"0.6275892",
"0.6265527",
"0.62199074",
"0.614903",
"0.611961",
"0.60881114",
"0.60480404",
"0.6036738",
"0.6033766",
"0.59782916",
"0.59467477",
"0.5945127... | 0.83805925 | 0 |
From quantity return the floor tradable quantity according to min, max and rounded to step size. To make a precise value for trade use format_value from this returned value. quantity float Quantity to adjust min_is_zero boolean Default True. If quantity is lesser than min returns 0 else return min size. | def adjust_quantity(self, quantity, min_is_zero=True):
if self.min_size > 0.0 and quantity < self.min_size:
if min_is_zero:
return 0.0
return self.min_size
if self.max_size > 0.0 and quantity > self.max_size:
return self.max_size
if self.ste... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _minimum(self) -> float:\n if self._type == \"power\":\n return 1.0\n elif self._type == \"setpoint\":\n return self._product.get_data_config_json()[\"_value_setpoint_min\"]\n elif self._type == \"fan1\":\n fan = 1\n return self._product.get_data... | [
"0.6206918",
"0.60330063",
"0.585838",
"0.58567363",
"0.57672155",
"0.57672155",
"0.5741646",
"0.55550754",
"0.54496026",
"0.54421544",
"0.54421544",
"0.5430682",
"0.54051363",
"0.5398593",
"0.5387698",
"0.5387698",
"0.5345768",
"0.5345768",
"0.5345768",
"0.5333195",
"0.53317... | 0.73941565 | 0 |
Writes the information of all tracks in the playlist[s] to a text file in csv kind of format This includins the name, artist, and spotify URL. Each is delimited by a comma. | def write_tracks(tracks_file, song_dict):
track_db = []
with open(tracks_file, "w+", encoding="utf-8", newline="") as file_out:
i = 0
writer = csv.writer(file_out, delimiter=";")
for url_dict in song_dict["urls"]:
# for track in url_dict['songs']:
for track in ur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_playlist_tracks(playlist):\n track_ids = [id for id in load_from_json(f\"playlist_{playlist}.json\") if id is not None]\n tracks = []\n\n for i in range(0, len(track_ids), 50):\n tracks_info = sp.tracks(track_ids[i: i+50])['tracks']\n for track in tracks_info:\n if track:\... | [
"0.65468687",
"0.6247322",
"0.6229117",
"0.6228196",
"0.61741185",
"0.60902107",
"0.6026559",
"0.59733105",
"0.5912996",
"0.5889268",
"0.58746123",
"0.5803826",
"0.5777052",
"0.5744444",
"0.56849664",
"0.5644501",
"0.56269264",
"0.5625296",
"0.56203276",
"0.5596947",
"0.55895... | 0.665103 | 0 |
Compute softmax values for each sets of scores in x. | def softmax(x):
e_x = np.exp(x - np.max(x))
return e_x / e_x.sum() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def softmax(self, scores):\n\n\n # for each sample, for each class ,caclulate\n # np.exp(scores) : still (n_samples, n_classes)\n\n # axis = 1\n # a00, a01, a02 as a sinlge one to perfrom np_sum\n # which is the same sample \n # sum_exp : still (n_samples, 1)\n\n # ... | [
"0.7796294",
"0.7760558",
"0.7759004",
"0.77567077",
"0.76577055",
"0.76577055",
"0.76577055",
"0.76577055",
"0.7585655",
"0.743143",
"0.7407772",
"0.73941606",
"0.7358175",
"0.73174125",
"0.72689486",
"0.72623265",
"0.72614294",
"0.7256868",
"0.723019",
"0.7214918",
"0.72017... | 0.70900273 | 55 |
Getter message for the error message property | def message(self):
return(self.__message) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_error_message(self):\n return self.error_message.get_error_message()",
"def get_error_message(self):\n\n return self.err_message",
"def getErrorMessage(self):\n return self._message",
"def error_message(self) -> str:\n return self._error_message",
"def error_message(self... | [
"0.84507716",
"0.8272372",
"0.82341063",
"0.8156294",
"0.81057173",
"0.81057173",
"0.81057173",
"0.80858296",
"0.8050317",
"0.79771084",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.79377925",
"0.79222834",
"0.78714764",
"0.787... | 0.69084185 | 56 |
Getter message for the error message property | def message(self):
return(self.__message) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_error_message(self):\n return self.error_message.get_error_message()",
"def get_error_message(self):\n\n return self.err_message",
"def getErrorMessage(self):\n return self._message",
"def error_message(self) -> str:\n return self._error_message",
"def error_message(self... | [
"0.84507716",
"0.8272372",
"0.82341063",
"0.8156294",
"0.81057173",
"0.81057173",
"0.81057173",
"0.80858296",
"0.8050317",
"0.79771084",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.79377925",
"0.79222834",
"0.78714764",
"0.787... | 0.69084185 | 58 |
Getter message for the error message property | def message(self):
return(self.__message) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_error_message(self):\n return self.error_message.get_error_message()",
"def get_error_message(self):\n\n return self.err_message",
"def getErrorMessage(self):\n return self._message",
"def error_message(self) -> str:\n return self._error_message",
"def error_message(self... | [
"0.84515",
"0.82730705",
"0.8234179",
"0.8156736",
"0.8106271",
"0.8106271",
"0.8106271",
"0.8086509",
"0.8050979",
"0.79771173",
"0.7972601",
"0.7972601",
"0.7972601",
"0.7972601",
"0.7972601",
"0.7972601",
"0.7972601",
"0.7938373",
"0.79227245",
"0.78722125",
"0.78722125",
... | 0.69069344 | 57 |
Getter message for the error message property | def message(self):
return(self.__message) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_error_message(self):\n return self.error_message.get_error_message()",
"def get_error_message(self):\n\n return self.err_message",
"def getErrorMessage(self):\n return self._message",
"def error_message(self) -> str:\n return self._error_message",
"def error_message(self... | [
"0.84507716",
"0.8272372",
"0.82341063",
"0.8156294",
"0.81057173",
"0.81057173",
"0.81057173",
"0.80858296",
"0.8050317",
"0.79771084",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.79377925",
"0.79222834",
"0.78714764",
"0.787... | 0.69084185 | 59 |
Getter message for the error message property | def message(self):
return(self.__message) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_error_message(self):\n return self.error_message.get_error_message()",
"def get_error_message(self):\n\n return self.err_message",
"def getErrorMessage(self):\n return self._message",
"def error_message(self) -> str:\n return self._error_message",
"def error_message(self... | [
"0.84507716",
"0.8272372",
"0.82341063",
"0.8156294",
"0.81057173",
"0.81057173",
"0.81057173",
"0.80858296",
"0.8050317",
"0.79771084",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.79377925",
"0.79222834",
"0.78714764",
"0.787... | 0.69084185 | 60 |
Getter message for the error message property | def message(self):
return(self.__message) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_error_message(self):\n return self.error_message.get_error_message()",
"def get_error_message(self):\n\n return self.err_message",
"def getErrorMessage(self):\n return self._message",
"def error_message(self) -> str:\n return self._error_message",
"def error_message(self... | [
"0.84507716",
"0.8272372",
"0.82341063",
"0.8156294",
"0.81057173",
"0.81057173",
"0.81057173",
"0.80858296",
"0.8050317",
"0.79771084",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.7971884",
"0.79377925",
"0.79222834",
"0.78714764",
"0.787... | 0.69084185 | 61 |
Get the maximums of the box. | def maxs(self):
return self._maxs | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def maxs(self):\n return self.intervals[:, 1]",
"def maximums(self):\n # The maximums are at the peaks position but might be swallowed by \n # other peaks\n maximums = list()\n for func, pos, height, width in zip(self.peaks_function,\n ... | [
"0.727284",
"0.7030874",
"0.693986",
"0.69067794",
"0.6878829",
"0.68736434",
"0.6868502",
"0.68478525",
"0.6806683",
"0.6784204",
"0.67625403",
"0.6754861",
"0.67235214",
"0.67173207",
"0.6717256",
"0.66883105",
"0.66697544",
"0.6655225",
"0.66526324",
"0.6638028",
"0.661769... | 0.7920239 | 0 |
Calculates the upperright (k, k) submatrix of the (k + 3, k + 3) shaped L matrix. | def K_matrix(X, Y):
eps = 1e-9
D2 = torch.pow(X[:, :, None, :] - Y[:, None, :, :], 2).sum(-1)
K = D2 * torch.log(D2 + eps)
return K | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def PLU(A):\n n, _ = A.shape\n P = np.eye(n, n, dtype=A.dtype)\n L = np.eye(n, n, dtype=A.dtype) \n U = np.copy(A)\n \n for k in range(n-1):\n i = np.argmax(np.abs(U[k:, k])) + k # index of row with highest absolute value in column k\n\n U[[k, i], k:] = U[[i, k], k:]\n L[[k, ... | [
"0.62292093",
"0.62259126",
"0.58949107",
"0.5821799",
"0.5802326",
"0.55839527",
"0.5574345",
"0.5528231",
"0.5525469",
"0.5523643",
"0.54820645",
"0.5480811",
"0.5453957",
"0.54290855",
"0.5385439",
"0.5380995",
"0.5372382",
"0.5355528",
"0.53281003",
"0.5317574",
"0.531520... | 0.0 | -1 |
Returns whether the stack is empty. | def empty(self):
if len(self.List_store) == 0:
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_empty(self):\n return len(self.the_stack) == 0",
"def is_empty(self):\n return len(self.stack) == 0",
"def empty(self) -> bool:\n return len(self.stack) == 0",
"def isEmpty(self):\n return len(self.stack) == 0",
"def empty(self):\n return len(self.stack) == 0",
"... | [
"0.9207258",
"0.91276956",
"0.90185934",
"0.9000551",
"0.89481044",
"0.89481044",
"0.8914844",
"0.8904091",
"0.8881541",
"0.88791907",
"0.8867761",
"0.87955654",
"0.8768181",
"0.8748518",
"0.87393755",
"0.8728073",
"0.8719241",
"0.87090814",
"0.87090814",
"0.85431594",
"0.850... | 0.0 | -1 |
Return the total number of bonds in a given molecule. | def total_num_bonds(self):
return self.GetNumberOfBonds() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def count_bonds(self):\n n = 0\n for bond in self.iter_bonds():\n n += 1\n return n",
"def count_bonds(self):\n n = 0\n for bond in self.iter_bonds():\n n += 1\n return n",
"def n_rigid_bonds(mol: Mol) -> int:\n non_rigid_bonds_count = from_sma... | [
"0.80025625",
"0.80025625",
"0.66126955",
"0.6533329",
"0.6530094",
"0.6212478",
"0.6210571",
"0.6202222",
"0.6122616",
"0.60915023",
"0.6087865",
"0.6072382",
"0.6042857",
"0.6033683",
"0.6027071",
"0.6027071",
"0.5946125",
"0.5936661",
"0.5904915",
"0.5904915",
"0.59033066"... | 0.7891599 | 2 |
Get the atomic number of an atom for a specified index. Returns the atomic number of the atom present at index atom_index. | def get_atomic_number(molecule, atom_index):
return molecule.GetAtomAtomicNumber(atom_index) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_atomic_position(molecule, atom_index):\n return molecule.GetAtomPosition(atom_index)",
"def index(self, atom):\n return self.atom_list.index(atom)",
"def get(self, index: int) -> int:\n node = self.get_node(index)\n if node:\n return node.val\n else:\n ... | [
"0.68005484",
"0.60752213",
"0.59588075",
"0.5871908",
"0.5819159",
"0.57988024",
"0.55818534",
"0.55516666",
"0.5425327",
"0.54243624",
"0.5349884",
"0.5335964",
"0.5299057",
"0.5220479",
"0.5187373",
"0.5121672",
"0.50906634",
"0.50878614",
"0.5075936",
"0.50756437",
"0.505... | 0.8606187 | 0 |
Set the atomic number of an atom for a specified index. Assign atomic_num as the atomic number of the atom present at atom_index. | def set_atomic_number(molecule, atom_index, atomic_num):
molecule.SetAtomAtomicNumber(atom_index, atomic_num) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_atomic_number(molecule, atom_index):\n return molecule.GetAtomAtomicNumber(atom_index)",
"def set_atomic_position(molecule, atom_index, x_coord, y_coord, z_coord):\n molecule.SetAtomPosition(atom_index, x_coord, y_coord, z_coord)",
"def set_atom(self, locant, atom):\n atom.set_id(locant)\n... | [
"0.6560087",
"0.6199398",
"0.5951252",
"0.58578175",
"0.5596008",
"0.55953026",
"0.5589196",
"0.553421",
"0.5525989",
"0.55205667",
"0.5504498",
"0.54476297",
"0.5439793",
"0.5423999",
"0.54001343",
"0.53582937",
"0.5349304",
"0.5333335",
"0.5326711",
"0.52993786",
"0.5289031... | 0.8712859 | 0 |
Get the order of bond for a specified index. Returns the order of bond (whether it's a single/double/triple bond) present at bond_index. | def get_bond_order(molecule, bond_index):
return molecule.GetBondOrder(bond_index) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_bond_order(bond_type):\n if bond_type == 'single':\n return 1\n elif bond_type == 'aromatic':\n return 1.5\n elif bond_type == 'double':\n return 2\n elif bond_type == 'triple':\n return 3\n else:\n raise ValueError(f'Unexpected bond type: {bond_type.upper(... | [
"0.6752312",
"0.63966566",
"0.57815874",
"0.5262618",
"0.5093663",
"0.50919545",
"0.5012569",
"0.50036746",
"0.49367315",
"0.48917815",
"0.46992457",
"0.46574548",
"0.46573806",
"0.46078455",
"0.45987606",
"0.4591198",
"0.45611867",
"0.44986278",
"0.44406894",
"0.4431078",
"0... | 0.85749006 | 0 |
Set the bond order of a bond for a specified index. Assign bond_order (whether it's a single/double/triple bond) to the bond present at the bond_index. | def set_bond_order(molecule, bond_index, bond_order):
return molecule.SetBondOrder(bond_index, bond_order) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_bond_order(molecule, bond_index):\n return molecule.GetBondOrder(bond_index)",
"def add_bond(molecule, atom1_index, atom2_index, bond_order=1):\n molecule.AppendBond(atom1_index, atom2_index, bond_order)",
"def set_order(self, order):\n self.order = order",
"def set_order(self, order):\n... | [
"0.6456186",
"0.56341326",
"0.55784166",
"0.55784166",
"0.5533212",
"0.55101186",
"0.54243904",
"0.53122276",
"0.5237427",
"0.5230102",
"0.5230102",
"0.5230102",
"0.5217105",
"0.52066356",
"0.5180444",
"0.5153465",
"0.5142009",
"0.51258487",
"0.51060444",
"0.5096011",
"0.5086... | 0.85224 | 0 |
Create an actor for ball and stick molecular representation. | def ball_stick(
molecule,
colormode='discrete',
atom_scale_factor=0.3,
bond_thickness=0.1,
multiple_bonds=True,
):
if molecule.total_num_bonds == 0:
raise ValueError(
'No bonding data available for the molecule! Ball '
'and stick model cannot be made!'
)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def actor():\n return Actor()",
"def __create_actor(mapper: vtkLabeledDataMapper) -> vtkActor2D:\n actor = vtkActor2D()\n actor.SetMapper(mapper)\n\n return actor",
"def create_ball():\n balls.append(gen_ball())\n generate_velocity(balls)",
"def _make_actor(self, safe_distance):\n... | [
"0.6521576",
"0.6408675",
"0.6302898",
"0.6125257",
"0.60556537",
"0.5993816",
"0.59129834",
"0.58806634",
"0.58585757",
"0.5801043",
"0.5771813",
"0.576336",
"0.5716615",
"0.5686013",
"0.5625455",
"0.5612588",
"0.5543517",
"0.5501177",
"0.5501139",
"0.5485162",
"0.54721844",... | 0.5976301 | 6 |
Humanreadable short title for this Daemon instance. | def get_title(self):
return "{id}@{hn}".format(id=self.model.identity, hn=self.model.hostname) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def short_title(self):\n if hasattr(self, \"title\"):\n return self.title\n else:\n return \"\"",
"def title(self):\n return self.run_command('title')[0]",
"def title(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"title\")",
"def title(self):\n r... | [
"0.7855064",
"0.7478442",
"0.73336846",
"0.732346",
"0.732346",
"0.732346",
"0.7310889",
"0.73041844",
"0.7287646",
"0.7287646",
"0.7287646",
"0.72835344",
"0.72835344",
"0.72835344",
"0.72835344",
"0.72835344",
"0.72835344",
"0.72835344",
"0.7278651",
"0.7165633",
"0.7147154... | 0.7489472 | 1 |
Rotates the point around the X axis by the given angle in degrees. | def rotateX(self, angle):
rad = angle * math.pi / 180
cosa = math.cos(rad)
sina = math.sin(rad)
y = self.y * cosa - self.z * sina
z = self.y * sina + self.z * cosa
return Point3D(self.x, y, z) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rotate_x(self, angle):\n angle *= np.pi / 180\n return self.transform(np.matrix([[1, 0, 0],\n [0, np.cos(angle), -np.sin(angle)],\n [0, np.sin(angle), np.cos(angle)]]))",
"def rotate_x(self, angle:... | [
"0.794659",
"0.7539638",
"0.73145586",
"0.71019506",
"0.709467",
"0.70256436",
"0.6984359",
"0.694846",
"0.69418216",
"0.6880606",
"0.68804455",
"0.6836407",
"0.67816424",
"0.67309594",
"0.66042733",
"0.65942734",
"0.65035325",
"0.64926547",
"0.6485459",
"0.64773697",
"0.6475... | 0.6460902 | 25 |
The negative signs are to represent a max heap using min heap | def add_num(self, num: int) -> None:
if len(self.min_heap) == len(self.max_heap):
heappush(self.max_heap, -heappushpop(self.min_heap, -num))
else:
heappush(self.min_heap, -heappushpop(self.max_heap, num)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def min_heap(self): \n \n for pos in range(self.size//2, 0, -1): \n self.min_heapify(pos)",
"def build_max_heap(heap):\n\tfor j in range(heap.len//2, -1, -1):\n\t\tmax_heapify(heap, j)",
"def build_max_heap(a):\r\n for i in range(math.floor((len(a) - 1)/2), -1, -1):\r\n max_heapify... | [
"0.775092",
"0.7528531",
"0.75228065",
"0.7384742",
"0.72893196",
"0.7205864",
"0.70503825",
"0.70503825",
"0.69889665",
"0.6974715",
"0.69675845",
"0.6956956",
"0.6956593",
"0.6955806",
"0.69353676",
"0.6908895",
"0.69062996",
"0.690229",
"0.68809444",
"0.6872392",
"0.684086... | 0.618285 | 84 |
Utility function to split a list into a list of lists of size chunk_size | def ghetto_split(list_, chunk_size=100):
logging.debug(f"Splitting list of {len(list_)} length, chunk size = {chunk_size}")
split_lists = []
for i in range(0,len(list_),chunk_size):
split_lists.append(list_[i:i+chunk_size])
logging.debug(f"List has been split into {len(split_lists)} lists. Total... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def chunked(list_: List, chunksize: int=20) -> List[List]:\n chunks: List[List] = []\n for i in range(0, len(list_), chunksize):\n chunks.append(list_[i:i + chunksize])\n return chunks",
"def split_chunk(list, chunk_size):\n for i in range(0, len(list), chunk_size):\n yield list... | [
"0.8550787",
"0.8521343",
"0.8501392",
"0.85000056",
"0.84749764",
"0.8366589",
"0.8246785",
"0.8217724",
"0.80815494",
"0.79625213",
"0.79560506",
"0.7927173",
"0.7881198",
"0.78379625",
"0.78200275",
"0.7817737",
"0.78015924",
"0.7789853",
"0.7757746",
"0.77572495",
"0.7701... | 0.85844827 | 0 |
Test linear Activation function | def test_linear_activation(self):
self.assertEqual([0.5, 0.6], af.Linear().output([0.5, 0.6]))
self.assertEqual([1, 1], list(
af.Linear().derivative(np.array([0.5, 0.6])))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_relu_activation(self):\n self.assertEqual([0, 0.5], list(\n af.Relu().output(np.array([-0.5, 0.5]))))\n self.assertEqual([0, 1], list(\n af.Relu().derivative(np.array([-0.5, 0.5]))))",
"def testActivation(self):\n result = Sigmoid.activ(self, 12)\n self.... | [
"0.7714273",
"0.7520323",
"0.7393367",
"0.7270706",
"0.7141478",
"0.7122633",
"0.7084347",
"0.7030661",
"0.70254207",
"0.6983885",
"0.69341344",
"0.6896828",
"0.68939906",
"0.6830876",
"0.68034536",
"0.6740119",
"0.67200714",
"0.66562957",
"0.66394305",
"0.6619526",
"0.659814... | 0.8070748 | 0 |
Test Sigmoid Activation function | def test_sigmoid_activation(self):
self.assertEqual([0.5, 0.5], list(
af.Sigmoid().output(np.array([0, 0]))))
self.assertEqual([0.25, 0.25], list(
af.Sigmoid().derivative(np.array([0, 0])))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_activation_sigmoid(self):\r\n senal = 1\r\n result = activation.soft_sigmoid(senal)\r\n self.assertEqual(result, 0.6963549298238342)",
"def testActivation(self):\n result = Sigmoid.activ(self, 12)\n self.assertEqual(0.9999938558253978, result)",
"def sigmoid_activati... | [
"0.86405325",
"0.8547377",
"0.8101663",
"0.7992341",
"0.7894172",
"0.7856627",
"0.78477913",
"0.78192943",
"0.7805054",
"0.7805054",
"0.77882427",
"0.77882427",
"0.77882427",
"0.77882427",
"0.77882427",
"0.77882427",
"0.77768815",
"0.7769157",
"0.7767805",
"0.7761993",
"0.776... | 0.8803924 | 0 |
Test Relu Activation function | def test_relu_activation(self):
self.assertEqual([0, 0.5], list(
af.Relu().output(np.array([-0.5, 0.5]))))
self.assertEqual([0, 1], list(
af.Relu().derivative(np.array([-0.5, 0.5])))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_relu(self):\n activation_name = 'ReLU'\n args = {}\n\n activation = activation_factory.create(activation_name, **args)\n self.assertEqual(activation._get_name(), activation_name)\n\n x = torch.ones(10) * -1\n y = activation(x)\n self.assertEqual(len(torch.n... | [
"0.7655277",
"0.7547752",
"0.74729645",
"0.6927675",
"0.69085747",
"0.68051904",
"0.6734226",
"0.66706294",
"0.6579837",
"0.6566238",
"0.64818835",
"0.64459395",
"0.64139664",
"0.63688",
"0.63349473",
"0.63275087",
"0.63229686",
"0.63110685",
"0.63066477",
"0.629632",
"0.6295... | 0.85658056 | 0 |
Test Leaky Relu Activation function | def test_leaky_relu_activation(self):
self.assertEqual(
[-0.0050, 0.5000], list(af.LeakyRelu(0.01).output(np.array([-0.5, 0.5]))))
self.assertEqual([0.01, 1], list(af.LeakyRelu(
0.01).derivative(np.array([-0.5, 0.5])))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_leaky_relu(self):\n activation_name = 'LeakyReLU'\n args = {}\n\n activation = activation_factory.create(activation_name, **args)\n self.assertEqual(activation._get_name(), activation_name)",
"def test_relu_activation(self):\n self.assertEqual([0, 0.5], list(\n ... | [
"0.7895562",
"0.7778071",
"0.7409891",
"0.664251",
"0.6625259",
"0.660916",
"0.6572951",
"0.6503279",
"0.6494961",
"0.646147",
"0.63875353",
"0.6384317",
"0.6374039",
"0.63020295",
"0.62956446",
"0.6192345",
"0.61737454",
"0.61713505",
"0.61553013",
"0.61240476",
"0.61184704"... | 0.8239878 | 0 |
A function to strip punctuation, strip stopwords, casefold, lemmatize, And part pf speech tag words for clean data for modeling | def data_cleaner(doc):
sw = stopwords.words('english')
regex_token = RegexpTokenizer(r"([a-zA-Z]+(?:’[a-z]+)?)")
doc = regex_token.tokenize(doc)
doc = [word.lower() for word in doc]
doc = [word for word in doc if word not in sw]
#print(doc)
doc = pos_tag(doc)
doc = [(word[0], get_wo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def preprocess_training_text(text, accented_chars=True, \n convert_num=False, extra_whitespace=True, \n lemmatization=True, lowercase=True, punctuations=True,\n remove_html=True, remove_num=True, special_chars=True, \n stop_wor... | [
"0.7346214",
"0.7204978",
"0.7085485",
"0.70339763",
"0.70253",
"0.6995439",
"0.69350874",
"0.6869514",
"0.68610775",
"0.6824548",
"0.67725897",
"0.670217",
"0.66989547",
"0.6681447",
"0.6665155",
"0.66587085",
"0.66543514",
"0.6634308",
"0.66300875",
"0.660763",
"0.6602324",... | 0.6848987 | 9 |
create confusion matrix plots | def conf_matrix_plotter(model, X_t_vec, y_t):
fig, ax = plt.subplots()
fig.suptitle(str(model))
plot_confusion_matrix(model, X_t_vec, y_t, ax=ax, cmap="plasma"); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_confusion_matrix(self):\r\n interp = ClassificationInterpretation.from_learner(self.learn)\r\n interp.plot_confusion_matrix()",
"def plot_confusion_matrix(cm, class_names):\n figure = plt.figure(figsize=(10, 10))\n plt.imshow(cm, interpolation='nearest', cmap=plt.cm.Blues)\n plt.title(\... | [
"0.8067573",
"0.79644215",
"0.7915834",
"0.7814926",
"0.7726184",
"0.7716197",
"0.7713153",
"0.76880276",
"0.7685792",
"0.76844615",
"0.76674414",
"0.76344496",
"0.7630151",
"0.76161575",
"0.7613531",
"0.75990355",
"0.75956106",
"0.7595505",
"0.7595505",
"0.758967",
"0.758813... | 0.0 | -1 |
This method returns the top most item in the stack | def peek(self):
if self._count == 0:
raise IndexError("Stack is empty")
return self._items[self._count-1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def top(self):\n try:\n if self.size() > 0:\n return self.items[len(self.items) - 1]\n else:\n raise IndexError('Cannot get top item, stack is empty.')\n except IndexError as err:\n print(err)\n raise",
"def top(self):\n ... | [
"0.88591945",
"0.8830027",
"0.8646745",
"0.84458494",
"0.84156674",
"0.8412785",
"0.83922064",
"0.83777547",
"0.8350138",
"0.833888",
"0.8332611",
"0.8302345",
"0.8214753",
"0.8189639",
"0.81250155",
"0.8117171",
"0.8010013",
"0.8010013",
"0.79524904",
"0.7930449",
"0.7930018... | 0.77378124 | 34 |
Find the full path for a disk. Given a string representing a device, check if it exists as a direct path, a path under /dev/mapper, or a path under /dev | def resolve_disk(s: str) -> str:
maybes = [
s,
f"/dev/mapper/{s}",
f"/dev/{s}",
]
for maybe in maybes:
if os.path.exists(maybe):
return maybe
raise FileNotFoundError(f"Could not find device with name {s}") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isMounted(device):\n for _device, _path in getMounted():\n if device == _device:\n return _path\n return ''",
"def getPath(device):\n # If there is a entry record for this partition in fstab\n # use path in there.\n if device in listEntries():\n path_, fsType_, options... | [
"0.7483137",
"0.73629546",
"0.72565264",
"0.72163814",
"0.7058402",
"0.6899361",
"0.67327946",
"0.66899985",
"0.6687576",
"0.66871053",
"0.6631361",
"0.65779763",
"0.65466255",
"0.65073526",
"0.647599",
"0.64646614",
"0.6394581",
"0.63265395",
"0.630106",
"0.6215711",
"0.6201... | 0.7969486 | 0 |
Returns a copy of current view | def getView(self):
return cv2.resize(self._view, (0,0),
fx=self._view_scale,
fy=self._view_scale) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_view(self):\n return self.view",
"def View(self):\n return self._view",
"def GetView(self):\r\n return self.model.GetView()",
"def view(self):\n view = self.empty_like()\n # Note that this is a shallow copy.\n view.sects = self.sects.copy()\n return vi... | [
"0.66439146",
"0.6624419",
"0.64911115",
"0.6452521",
"0.64088285",
"0.6372151",
"0.6372151",
"0.6372151",
"0.6372151",
"0.6366766",
"0.63644767",
"0.63301134",
"0.63113374",
"0.6287963",
"0.6287235",
"0.6287235",
"0.62713134",
"0.626538",
"0.62635106",
"0.62635106",
"0.62635... | 0.0 | -1 |
expands `~` as well as variable names, defaults to $XDG_DATA_HOME | def expand_db_path(path):
if path is None:
path = join(xdg.BaseDirectory.xdg_data_home, 'khal', 'khal.db')
return expanduser(expandvars(path)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def homedir():\n return os.path.expanduser('~')",
"def get_user_homedir():\n return os.path.expanduser(\"~\")",
"def _get_home():\n from os.path import expanduser\n home = expanduser('~')\n return home",
"def user(path = None):\n if path:\n return \"%s/%s\" % (expanduser(\"~\"), path... | [
"0.7333964",
"0.7147041",
"0.69678324",
"0.6536542",
"0.64811414",
"0.6430729",
"0.63934326",
"0.6371726",
"0.6330711",
"0.62962",
"0.628675",
"0.624678",
"0.62388694",
"0.61947423",
"0.6110296",
"0.607845",
"0.6070522",
"0.6070522",
"0.6032753",
"0.60076874",
"0.60032356",
... | 0.4999493 | 98 |
returns a list of paths, expanded using glob | def get_all_vdirs(path):
items = glob.glob(path)
return items | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def expand(self, path_list):\n path_list2 = []\n for path in path_list:\n if glob.has_magic(path):\n iterator = glob.iglob(path)\n path_list2.extend(iterator)\n else:\n path_list2.append(path)\n return path_list2",
"def expan... | [
"0.80809927",
"0.80169445",
"0.79923224",
"0.76249576",
"0.7616704",
"0.7475759",
"0.7417678",
"0.73933303",
"0.73432904",
"0.73126924",
"0.7272393",
"0.7264",
"0.72035486",
"0.7201689",
"0.7188408",
"0.7139433",
"0.70919096",
"0.70829743",
"0.7022732",
"0.6999642",
"0.696267... | 0.0 | -1 |
Returns color [r,g,b] LOT for formation numbers. | def _create_color_lot(color_names, color_subnames, color_dict_rgb):
lot = {}
i = 0
for sn in np.arange(len(color_subnames)):
for n in np.arange(len(color_names)):
lot[i] = color_dict_rgb[color_names[n]][color_subnames[sn]]
i += 1
return lot | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_rgb(self, r,g,b):\n return \"#%02x%02x%02x\" % (r,g,b)",
"def color(self):\n return 0x2f3136",
"def _get_color(self, r, g, b):\n clr = (r, g, b)\n return clr",
"def get_rgb(self):\n\n return \"#%02X%02X%02X\" % (self.r, self.g, self.b)",
"def default_render_color_... | [
"0.7155649",
"0.71068186",
"0.7083868",
"0.7003396",
"0.69344044",
"0.6920773",
"0.69116217",
"0.6908243",
"0.6878598",
"0.6809199",
"0.6809199",
"0.6809199",
"0.67736554",
"0.6763048",
"0.6725893",
"0.6724445",
"0.67235076",
"0.67182016",
"0.6701258",
"0.66290164",
"0.662613... | 0.0 | -1 |
Base is the base point distribution this instance will wrap. Translation is applied before rotation. If rotation or translation are None, than that operation will not be applied. Both operations are relative to the origin, and other base point distributions natively generate around the origin, so this class should tran... | def __init__(self, base, rotation=None, translation=None, scale=None):
self._base = base
self.rotation = rotation
self.translation = translation
self.scale = scale
self._base.post_update_handles.append(self._apply_transformation) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transform(self) -> Affine:\n transform = (\n Affine.translation(*self.origin)\n * Affine.rotation(self.rotation)\n * Affine.scale(*self.res)\n )\n return transform",
"def rotate(self, rx: float = 0, ry: float = 0, rz: float = 0,\n center: On... | [
"0.60170627",
"0.58316773",
"0.58278024",
"0.5778792",
"0.5743731",
"0.564146",
"0.5619725",
"0.55909586",
"0.5408869",
"0.5383326",
"0.535607",
"0.5309864",
"0.53030276",
"0.5287092",
"0.5279286",
"0.5275025",
"0.52742124",
"0.5266339",
"0.5245706",
"0.5209969",
"0.52069813"... | 0.703418 | 0 |
Flatten a point cloud sampled from any arbitrary distribution into a uniform one. This function computes the cumulative distribution function of an arbitrary distribution and then applies the cdf to the input distribution to flatten it into a uniform one. This is the inverse operation compared to what ArbitraryDistribu... | def flatten_distribution(x, y, evaluation_limits):
x_min, x_max, x_res = evaluation_limits[0]
y_min, y_max, y_res = evaluation_limits[1]
# Compute the input density via a histogram. np.histogram2d gives the transpose of
# what is expected, so we take the transpose to fix this. And it also does no... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normal_cdf(x: torch.Tensor) -> torch.Tensor:\n return torch.distributions.Normal(0, 1.0).cdf(x)",
"def cumulative_normal_distribution(z):\n from math import exp\n\n b1 = +0.319381530\n b2 = -0.356563782\n b3 = +1.781477937\n b4 = -1.821255978\n b5 = +1.330274429\n p = +0.2316419\n ... | [
"0.5586892",
"0.5563694",
"0.54852474",
"0.543941",
"0.5413336",
"0.537273",
"0.53583604",
"0.53518397",
"0.5246547",
"0.5208789",
"0.5204593",
"0.51924646",
"0.5175445",
"0.5164667",
"0.5160543",
"0.5147375",
"0.51423824",
"0.5114984",
"0.5080699",
"0.50799197",
"0.50594187"... | 0.5230309 | 9 |
Get the index of the first matching column. | def find_column_index(self, columns):
for i in range(len(columns)):
if self.match(columns[i]):
return i
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_col(table, col):\n return table[0].index(col)",
"def get_index(self, column):\r\n\r\n\t\treturn self.columns.index(column)",
"def get_colnumber(self, header):\n for i in range(0, len(self.data)):\n if self.data[i][0] == header:\n return i\n return None",
"d... | [
"0.76492685",
"0.763803",
"0.7461113",
"0.7168229",
"0.71643466",
"0.7158796",
"0.7142186",
"0.6967918",
"0.6895111",
"0.68891233",
"0.68192405",
"0.6818686",
"0.68023604",
"0.6779614",
"0.6743045",
"0.67320335",
"0.66572577",
"0.66330564",
"0.6577666",
"0.65124077",
"0.64886... | 0.7967314 | 0 |
Test if a column matches any of the patterns in a list. | def match_list(column, patterns):
for pattern in patterns:
if pattern.match(column):
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def HaveChildren(ListofList, pattern):\n result = False\n for row in ListofList:\n if any(pattern in s for s in row):\n result = True\n return result",
"def column_values_in_list(col, test_list):\n test = np.array([c_i in test_list for c_i in col])\n return test",
"def check_co... | [
"0.6556683",
"0.64302546",
"0.63067436",
"0.6258623",
"0.6187614",
"0.6126113",
"0.6111609",
"0.6071658",
"0.6025094",
"0.6011538",
"0.5879156",
"0.58788866",
"0.5873742",
"0.5815781",
"0.5814044",
"0.58079004",
"0.57674956",
"0.5740474",
"0.57298553",
"0.5728475",
"0.5724627... | 0.88387614 | 0 |
Get the iterator over the rows. | def __iter__(self):
raise RuntimeException("child class must implement __iter__() method") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __iter__(self):\n return iter(self.__rows)",
"def __iter__(self):\n for row in self.rows:\n yield row",
"def __iter__(self):\n return iter(self.rows)",
"def iterrows(self):\n return (self.Row(*row_vals) for row_vals in izip(*self.columns))",
"def Iterator():\n ... | [
"0.85183847",
"0.83765113",
"0.83707154",
"0.79104555",
"0.73708725",
"0.731996",
"0.7302216",
"0.72275394",
"0.72252095",
"0.72252095",
"0.7140404",
"0.714005",
"0.71241605",
"0.71231925",
"0.71168184",
"0.7109036",
"0.70676625",
"0.70500535",
"0.6974074",
"0.6972438",
"0.69... | 0.0 | -1 |
Get all values for the dataset at once, in an array of arrays. This method can be highly inefficient for large datasets. | def values(self):
return [row.values for row in self] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def values(self):\n arr = self.view(np.ndarray).copy()\n return arr",
"def get_data():\n data = [np.array([32.,595.]),\n np.array([30.,599.]),\n np.array([18.,622.]),\n np.array([51.,606.]),\n np.array([38.,578.])]\n return data",
"def read(self, ... | [
"0.69703174",
"0.69307035",
"0.6879977",
"0.6855093",
"0.68078256",
"0.6745971",
"0.66884196",
"0.66602236",
"0.6642484",
"0.64727646",
"0.6455229",
"0.64072067",
"0.6395013",
"0.6383382",
"0.6383382",
"0.63684094",
"0.63331574",
"0.6270158",
"0.6256057",
"0.62505716",
"0.624... | 0.6390509 | 13 |
Get a list of indices that match the tag patterns provided | def get_column_indices(self, tag_patterns, columns):
patterns = TagPattern.parse_list(tag_patterns)
indices = []
for i, column in enumerate(columns):
for pattern in patterns:
if pattern.match(column):
indices.push(i)
return indices | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_predicate_indices(tags: List[str]) -> List[int]:\n return [ind for ind, tag in enumerate(tags) if \"V\" in tag]",
"def get_column_indices(tag_patterns, columns):\n tag_patterns = TagPattern.parse_list(tag_patterns)\n columns = [Column.parse(column) for column in columns]\n indices = []\n f... | [
"0.722843",
"0.70798177",
"0.67879546",
"0.6785787",
"0.64592427",
"0.644368",
"0.64284664",
"0.6339925",
"0.63329494",
"0.62984705",
"0.6296195",
"0.62435573",
"0.6155397",
"0.6134906",
"0.6133075",
"0.6068198",
"0.60586774",
"0.6057099",
"0.6045007",
"0.6029159",
"0.6029058... | 0.6859146 | 2 |
Expand lists by repeating rows. By default, applies to every column with a +list attribute, and uses "|" as the separator. | def expand_lists(self, patterns=None, separator="|", correlate=False, queries=[]):
import hxl.filters
return hxl.filters.ExpandListsFilter(self, patterns=patterns, separator=separator, correlate=correlate, queries=queries) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def expand_row(\n row: Sequence[Union[str, Sequence[Union[str, Sequence[str]]]]]\n) -> List[List[str]]:\n elems_as_lists = []\n for elem in row:\n if isinstance(elem, list):\n elems_as_lists.append(elem)\n else:\n elems_as_lists.append([elem])\n aligned = [list(i) fo... | [
"0.6498559",
"0.63500637",
"0.6195757",
"0.6087575",
"0.6031837",
"0.5988283",
"0.59425014",
"0.58630353",
"0.5849503",
"0.5724522",
"0.5655385",
"0.5640293",
"0.56312585",
"0.55733323",
"0.55643886",
"0.5484327",
"0.5473916",
"0.5464347",
"0.5459419",
"0.54296577",
"0.539647... | 0.6714359 | 0 |
Test for comparison with another object. For equality, only the hashtag and attributes have to be the same. | def __eq__(self, other):
try:
return (self.tag == other.tag and self.attributes == other.attributes)
except:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\r\n return self.__dict__ == other.__dict__",
"def __eq__(self, other):\n return self.__dict__ == other.__dict__",
"def __eq__(self, other):\n return self.__dict__ == other.__dict__",
"def __eq__(self, other):\n return self.__dict__ == other.__dict__",
"d... | [
"0.7577895",
"0.7509241",
"0.7509241",
"0.7509241",
"0.7509241",
"0.7509241",
"0.7509241",
"0.7509241",
"0.7509241",
"0.7509241",
"0.7509241",
"0.7509241",
"0.7509241",
"0.7509241",
"0.7509241",
"0.7509241",
"0.7509241",
"0.7509241",
"0.7509241",
"0.7509241",
"0.7509241",
"... | 0.76670873 | 0 |
Return the row as a Python dict. The keys will be HXL hashtags and attributes, normalised per HXL 1.1. If two or more columns have the same hashtags and attributes, only the first will be included. | def dictionary(self):
data = {}
for i, col in enumerate(self.columns):
key = col.get_display_tag(sort_attributes=True)
if key and (not key in data) and (i < len(self.values)):
data[key] = self.values[i]
return data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reformat_attrTable(\n self):\n #format into a dictionary of rows for quick aligning with the tracking_id\n if self.attrTable: attrTable = self.attrTable[:];\n else: attrTable = [];\n\n attrTable_dict = {};\n for row in attrTable:\n attrTable_dict[row['tracki... | [
"0.667913",
"0.6461216",
"0.636688",
"0.61484194",
"0.6051544",
"0.60468364",
"0.6014249",
"0.59909004",
"0.5900011",
"0.587809",
"0.5850842",
"0.58400846",
"0.5833326",
"0.58227205",
"0.5815393",
"0.5813333",
"0.5813333",
"0.5806374",
"0.57443744",
"0.5698505",
"0.5687542",
... | 0.62785184 | 3 |
Get a list of column indices that match the tag patterns provided | def get_column_indices(tag_patterns, columns):
tag_patterns = TagPattern.parse_list(tag_patterns)
columns = [Column.parse(column) for column in columns]
indices = []
for i, column in enumerate(columns):
for pattern in tag_patterns:
if pattern.match(column):
indices.ap... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_column_indices(self, tag_patterns, columns):\n patterns = TagPattern.parse_list(tag_patterns)\n indices = []\n for i, column in enumerate(columns):\n for pattern in patterns:\n if pattern.match(column):\n indices.push(i)\n return indi... | [
"0.8450538",
"0.68007433",
"0.6378853",
"0.6313471",
"0.6256628",
"0.6146388",
"0.6097416",
"0.6093199",
"0.6028557",
"0.58799136",
"0.58190155",
"0.58045346",
"0.5803244",
"0.58020294",
"0.57893914",
"0.577954",
"0.5727999",
"0.5719707",
"0.56921905",
"0.5690233",
"0.5660097... | 0.8508822 | 0 |
Test expected result if pin request fails. | async def test_pin_request_fails(hass: HomeAssistant) -> None:
flow = config_flow.EcobeeFlowHandler()
flow.hass = hass
flow.hass.data[DATA_ECOBEE_CONFIG] = {}
with patch("homeassistant.components.ecobee.config_flow.Ecobee") as mock_ecobee:
mock_ecobee = mock_ecobee.return_value
mock_eco... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_registered_incorrect_pin(self):\n self.contact.pin = '1234'\n self.contact.save()\n msg = self._send(self.reg_conn, '4444')\n self.assertEqual(len(msg.responses), 1)\n self.assertEqual(msg.responses[0].text,\n self.app.incorrect_pin)",
"def test... | [
"0.7238182",
"0.7238182",
"0.6808269",
"0.65973055",
"0.6587121",
"0.65418226",
"0.65418226",
"0.6459002",
"0.6278712",
"0.6229318",
"0.6164026",
"0.6147369",
"0.61314195",
"0.6115511",
"0.6095732",
"0.6053475",
"0.5977893",
"0.59505725",
"0.5940151",
"0.5931674",
"0.59220797... | 0.6819293 | 2 |
Insert size bytes of empty space starting at offset. fobj must be an open file object, open rb+ or equivalent. | def insert_bytes(self,fobj, size, offset, BUFFER_SIZE=2 ** 16):
if size < 0 or offset < 0:
raise ValueError
fobj.seek(0, 2)
filesize = fobj.tell()
movesize = filesize - offset
if movesize < 0:
raise ValueError
self.resize_file(fobj, size, BUFFE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def insert_bytes(fobj, size, offset, BUFFER_SIZE=2 ** 16):\n\n if size < 0 or offset < 0:\n raise ValueError\n\n fobj.seek(0, 2)\n filesize = fobj.tell()\n movesize = filesize - offset\n\n if movesize < 0:\n raise ValueError\n\n resize_file(fobj, size, BUFFER_SIZE)\n\n if mmap is... | [
"0.7231294",
"0.65476257",
"0.62179416",
"0.61566144",
"0.6153236",
"0.61397356",
"0.5710457",
"0.5598464",
"0.54636663",
"0.5437528",
"0.5435916",
"0.5384069",
"0.5366884",
"0.52552164",
"0.52528274",
"0.51998854",
"0.50527495",
"0.5052372",
"0.50284874",
"0.5019198",
"0.501... | 0.7137758 | 1 |
Apply default keyword arguments. Named keywords may have been left blank. This function applies the default values so that every argument is defined. | def _apply_defaults(func, args, kwargs):
sig = signature(func)
bound_arguments = sig.bind(*args, **kwargs)
for param in sig.parameters.values():
if param.name not in bound_arguments.arguments:
bound_arguments.arguments[param.name] = param.default
args = [bound_arguments.arguments[ke... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_default_args(kwargs_old, **kwargs_new):\n for key in kwargs_new:\n if key not in kwargs_old:\n kwargs_old[key] = kwargs_new[key]",
"def defaults(self, **kwargs):\n for i in kwargs:\n self._.setdefault(i, kwargs[i])\n return self",
"def default_a... | [
"0.7157559",
"0.6939161",
"0.6750786",
"0.67469263",
"0.6548224",
"0.65029705",
"0.6500061",
"0.6484644",
"0.6483329",
"0.6312059",
"0.6284324",
"0.62505805",
"0.6176438",
"0.6124212",
"0.6105467",
"0.60948884",
"0.6071097",
"0.6017015",
"0.6013532",
"0.6008589",
"0.5998938",... | 0.73297 | 0 |
Get last and first name to account | def get_first_and_last_name(self) -> Name:
name_db = self.read_file(self.db_name)
first_name = str(name_db.at[random.randint(0, len(name_db)), 'first name'])
last_name = str(name_db.at[random.randint(0, len(name_db)), 'last name'])
return Name(first_name=first_name, last_name=last_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_full_name(self):\n # The user is identified by their email address\n return self.first_name+' '+self.last_name",
"def get_user_firstname_lastname(self, record):\n lower_first_name, lower_last_name = self.clean_user_names(record)\n\n #No first name and last name check email\n... | [
"0.7471454",
"0.7463361",
"0.7412814",
"0.7382013",
"0.7360934",
"0.73516333",
"0.731855",
"0.7296664",
"0.7286074",
"0.7278677",
"0.7275519",
"0.71862173",
"0.7173238",
"0.7161276",
"0.71598756",
"0.7132737",
"0.7084635",
"0.7082379",
"0.705671",
"0.70546055",
"0.70372665",
... | 0.6905941 | 64 |
Small room, entrance on the right. Start on the right. there is only one way to move. West | def test_moves_to_walkable_area_in_the_west(self):
picture = """
----------- level z=0 :
####
# #
####
-----------
"""
(state, actions) = self.get_brain_decisions(
picture, entrance_point=Point(2, 1, 0), my_position=Poi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_right():\n return __maze.move_right()",
"def do_west(self, arg):\r\n moveDirection('west')",
"def move_right(self):\n self.rect.x += 5 # Moves to the right by 5\n\n # If the player reaches the edge of the screen, they can't go further\n if self.rect.x >= 580:\n ... | [
"0.69074565",
"0.6707441",
"0.6700669",
"0.65906274",
"0.6517882",
"0.6511123",
"0.64477795",
"0.6438553",
"0.6398159",
"0.6331219",
"0.6263788",
"0.6221958",
"0.62212956",
"0.62189686",
"0.62181914",
"0.6202515",
"0.6151981",
"0.6139172",
"0.61316055",
"0.61278355",
"0.61240... | 0.5729758 | 76 |
If we have a 2x2 room, and move 4 times, we should have explored all cells in that room. | def testCanExploreASmallEmptyRoom(self):
picture = """
----------- level z=0 :
####
# #
# #
####
-----------
"""
max_moves_to_make = 3
points_visited = self.explore_dungeon(picture, max_moves_to_make)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_move(grid, n_columns, n_rows):\r\n # Generate the game grid to be manipulated\r\n new_grid = [[0] * (n_columns + 1) for i in range(n_rows + 1)]\r\n\r\n\r\n for i in range(n_rows):\r\n for j in range(n_columns):\r\n upper_left = grid[i-1][j-1] # neighbor to upper left of cell of ... | [
"0.6954404",
"0.68770915",
"0.6841134",
"0.66528326",
"0.65932626",
"0.65704787",
"0.65634567",
"0.65545404",
"0.6523662",
"0.6518593",
"0.6467627",
"0.6435853",
"0.64085436",
"0.6394247",
"0.63736755",
"0.632975",
"0.62972695",
"0.62925726",
"0.628977",
"0.6282857",
"0.62820... | 0.59530675 | 81 |
If we have a 2x2 room, and move 4 times, we should have explored all cells in that room. | def testCanExploreATwoFloorHouse(self):
picture = """
----------- level z=0 : top of dungeon:
####
# >#
# #
####
----------- level z=1: one level down:
####
# <#
# #
####
-------... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_move(grid, n_columns, n_rows):\r\n # Generate the game grid to be manipulated\r\n new_grid = [[0] * (n_columns + 1) for i in range(n_rows + 1)]\r\n\r\n\r\n for i in range(n_rows):\r\n for j in range(n_columns):\r\n upper_left = grid[i-1][j-1] # neighbor to upper left of cell of ... | [
"0.6953217",
"0.6877604",
"0.6839772",
"0.6650935",
"0.65931404",
"0.6569237",
"0.656364",
"0.6554506",
"0.6523684",
"0.6517954",
"0.64675003",
"0.64363325",
"0.64075065",
"0.6394344",
"0.6371403",
"0.6329564",
"0.62962735",
"0.62928414",
"0.62886894",
"0.62831414",
"0.628171... | 0.0 | -1 |
Returns all AssignmentGroupobjects where given ``user`` is examiners. | def create_searchqryset(cls, user):
return cls._meta.model.published_where_is_examiner(user).annotate(latest_delivery_id=Max('deadlines__deliveries__id'),
latest_deadline_id=Max('deadlines__id'),
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def where_is_candidate(cls, user_obj):\n return AssignmentGroup.objects.filter(cls.q_is_candidate(user_obj))",
"def where_is_candidate(cls, user_obj):\n return AssignmentGroup.objects.filter(cls.q_is_candidate(user_obj))",
"def user_is_examiner(userobj):\n from .assignment_group import Assignm... | [
"0.6680107",
"0.6680107",
"0.6601722",
"0.5985014",
"0.5895106",
"0.5723876",
"0.5671283",
"0.56352174",
"0.5606133",
"0.54998434",
"0.548901",
"0.5453988",
"0.54371005",
"0.539448",
"0.5378403",
"0.5348604",
"0.5330244",
"0.5326632",
"0.53208107",
"0.5308824",
"0.52896863",
... | 0.53026545 | 20 |
Check if the given ``user`` can save changes to the given ``obj``, and raise ``PermissionDenied`` if not. | def write_authorize(cls, user, obj):
if not models.AssignmentGroup.published_where_is_examiner(user).filter(id=obj.deadline.assignment_group.id):
raise PermissionDenied()
cls.write_authorize_examinercommon(user, obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_authorize(cls, user, obj):\n if not cls._meta.model.published_where_is_examiner(user).filter(id=obj.id):\n raise PermissionDenied()\n if obj.id == None:\n raise PermissionDenied() # We only allow update",
"def can_edit_or_403(self, user):\n if self.get_permiss... | [
"0.80460095",
"0.7331845",
"0.73247457",
"0.7313981",
"0.71476823",
"0.7121872",
"0.7120705",
"0.7111636",
"0.7099004",
"0.7099004",
"0.7097043",
"0.7094021",
"0.7084154",
"0.7075858",
"0.70698863",
"0.7062223",
"0.70343024",
"0.70189697",
"0.6971448",
"0.6971448",
"0.6969559... | 0.6682683 | 42 |
Checks if the given ``user`` is an examiner in the given Deadline ``obj``, and raises ``PermissionDenied`` if not. | def write_authorize(cls, user, obj):
if not obj.assignment_group.is_examiner(user):
raise PermissionDenied() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_authorize(cls, user, obj):\n if not cls._meta.model.published_where_is_examiner(user).filter(id=obj.id):\n raise PermissionDenied()",
"def user_is_examiner(userobj):\n from .assignment_group import AssignmentGroup\n return AssignmentGroup.published_where_is_examiner(userobj).exis... | [
"0.7419948",
"0.7282177",
"0.7230976",
"0.6886869",
"0.6881749",
"0.6846234",
"0.6786418",
"0.65925",
"0.6566509",
"0.6433327",
"0.63982606",
"0.634496",
"0.63200617",
"0.6306755",
"0.630458",
"0.6300359",
"0.6272099",
"0.6253552",
"0.62470776",
"0.61801106",
"0.61793435",
... | 0.69465214 | 3 |
Look up user by ID. | def lookup(self, user_id):
return self.users.get(str(user_id)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user_by_id(self, id):\n\t\treturn self.users.get(id)",
"def get_single_user(self, id):\n for user in self.users:\n if user['id'] == id:\n return user",
"def get_user(id):\n pass",
"def lookupUser_byID(self, user_id):\n sql = \"SELECT * FROM Users WHERE id='%... | [
"0.8311971",
"0.8272055",
"0.8252262",
"0.8172156",
"0.8027348",
"0.795923",
"0.7918431",
"0.7918431",
"0.7918431",
"0.7918431",
"0.78946453",
"0.78774357",
"0.78547454",
"0.7845801",
"0.7844495",
"0.7792024",
"0.77398497",
"0.77389365",
"0.7727113",
"0.7723424",
"0.7709543",... | 0.8121034 | 4 |
Turn GPU on or off. If True, GPU is on, if false, GPU is off. Needs to be called prior keras or tensorflow is first imported. | def setGPU(state):
import tensorflow as tf
from keras import backend as K
checkGPU()
num_cores = 1
num_CPU = 1
num_GPU = 0
if state:
num_GPU = 1
config = tf.ConfigProto(intra_op_parallelism_threads=num_cores,\
inter_op_parallelism_threads=num_cores, allow_soft_placement=True,\
device_cou... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cpu_fallback(flag=True):\n gpu_phy_devices = tf.config.list_physical_devices(\"GPU\")\n cpu_phy_devices = tf.config.list_physical_devices(\"CPU\")\n\n general_warning_msg = (\n f\"Tensorflow has already been initialized, {inspect.currentframe().f_code.co_name}() needs \"\n f\"to be calle... | [
"0.678071",
"0.66911536",
"0.65576345",
"0.65004677",
"0.6472776",
"0.64415026",
"0.64332193",
"0.63630724",
"0.6361377",
"0.6300233",
"0.62992704",
"0.62445164",
"0.62319046",
"0.62304604",
"0.6211725",
"0.61443216",
"0.61369693",
"0.61317796",
"0.610577",
"0.60991895",
"0.6... | 0.7342647 | 0 |
GETs from an authenticated Kalshi HTTP endpoint. Returns the response body. Raises an HttpError on non2XX results. | def get(self, path: str, params: Dict[str, Any] = {}) -> Any:
self.rate_limit()
response = requests.get(
self.host + path, headers=self.request_headers(), params=params
)
self.raise_if_bad_response(response)
return response.json() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get(self):\n try:\n r = self.session.get(self.url)\n except requests.exceptions.SSLError as e:\n raise Exception(\"SSL Error\\n Error: {}\\n URL: {}\".format(e.message[0], self.url))\n except requests.exceptions.ConnectionError:\n raise Exception(\"Una... | [
"0.7147728",
"0.69012445",
"0.6869457",
"0.6774202",
"0.67394537",
"0.6731725",
"0.66233486",
"0.6530998",
"0.65273",
"0.6498613",
"0.6414514",
"0.63925815",
"0.63232964",
"0.631775",
"0.6309301",
"0.6309301",
"0.6309301",
"0.6303749",
"0.62985116",
"0.6298011",
"0.62934947",... | 0.0 | -1 |
Get a running node object that matches a name. | def _get_running_node(self, node_name):
nodes = self._driver.list_nodes()
node = [i for i in nodes if (i.name == node_name and i.state != 'terminated')]
return (len(node) > 0 and node or None) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_node_by_name(self, name):\n\n for node in self.nodes:\n if node.name == name:\n return node\n\n return None",
"def ex_get_node_by_name(self, name):\n domain = self._get_domain_for_name(name=name)\n node = self._to_node(domain=domain)\n return n... | [
"0.7296409",
"0.7270308",
"0.7046818",
"0.70248455",
"0.6911657",
"0.69031686",
"0.6708162",
"0.6676499",
"0.66447914",
"0.66289806",
"0.66235286",
"0.65597135",
"0.6498036",
"0.6485404",
"0.64539295",
"0.64460385",
"0.63747174",
"0.6322791",
"0.6280549",
"0.6227114",
"0.6227... | 0.7119902 | 2 |
Stop the monitor thread. | def monitor_stop(_service_or_event):
_LOGGER.info("Stopping threads for Docker monitor")
for t in threads.values():
t.stop() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_monitor(self):\n self._logger.info(\"Stopping monitor...\")\n if self.monitor_lc:\n self.monitor_lc.cancel()\n if self.monitor_process:\n self.monitor_process.terminate()\n os.system(\"pkill -f listenblock\") # To kill the spawned Go run subprocess",
... | [
"0.80320716",
"0.7971689",
"0.79214144",
"0.7916955",
"0.78480417",
"0.7749154",
"0.7709552",
"0.7681981",
"0.7632703",
"0.76182944",
"0.7616441",
"0.7562319",
"0.7502068",
"0.7459798",
"0.74423534",
"0.73142034",
"0.7310694",
"0.7203108",
"0.71779794",
"0.71779794",
"0.71528... | 0.71430033 | 21 |
Return the state attributes. | def device_state_attributes(self):
return self._attributes | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def state_attributes(self):\n return self._attributes",
"def state_attributes(self):\n return self._attributes",
"def device_state_attributes(self):\r\n return self.attributes",
"def device_state_attributes(self):\n return self._state_attrs",
"def device_state_attributes(self):\... | [
"0.8953404",
"0.8953404",
"0.85239846",
"0.8366765",
"0.8366765",
"0.8363429",
"0.83362615",
"0.8334551",
"0.8310377",
"0.8292682",
"0.8289349",
"0.8289349",
"0.8273077",
"0.82236886",
"0.8223562",
"0.8205066",
"0.8184393",
"0.81659013",
"0.8102565",
"0.8064994",
"0.8064994",... | 0.82871646 | 17 |
Return the state attributes. | def device_state_attributes(self):
return self._attributes | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def state_attributes(self):\n return self._attributes",
"def state_attributes(self):\n return self._attributes",
"def device_state_attributes(self):\r\n return self.attributes",
"def device_state_attributes(self):\n return self._state_attrs",
"def device_state_attributes(self):\... | [
"0.8953404",
"0.8953404",
"0.85239846",
"0.8366765",
"0.8366765",
"0.8363429",
"0.83362615",
"0.8334551",
"0.8310377",
"0.8292682",
"0.8289349",
"0.8289349",
"0.8273077",
"0.82236886",
"0.8223562",
"0.8205066",
"0.8184393",
"0.81659013",
"0.8102565",
"0.8064994",
"0.8064994",... | 0.82871646 | 16 |
Properly format a floating point number according to the fontobene specifications. | def format_number(num):
rounded = round(float(num), 2)
rounded_str = "{:g}".format(rounded)
if rounded_str.startswith('-0.'):
rounded_str = '-' + rounded_str[2:]
elif rounded_str.startswith('0.'):
rounded_str = rounded_str[1:]
return rounded_str | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def float_format(self):\n ...",
"def latex_float(input_number):\n float_str = \"{0:.2g}\".format(input_number)\n if \"e\" in float_str:\n base, exponent = float_str.split(\"e\")\n return r\"${0} \\times 10^{{{1}}}$\".format(base, int(exponent))\n else:\n return float_str",
... | [
"0.7765871",
"0.70918447",
"0.7056674",
"0.70554984",
"0.69597924",
"0.69415927",
"0.68992734",
"0.68992734",
"0.6888198",
"0.66928124",
"0.6680294",
"0.66729677",
"0.665795",
"0.66113573",
"0.66048175",
"0.6595526",
"0.65911746",
"0.6588093",
"0.65765834",
"0.6562481",
"0.65... | 0.6184891 | 48 |
Plot custom confusion matrix chart. | def heatmap_chart(df, title=""):
source = df.copy()
source = source.reset_index()
source = pd.melt(source, id_vars="index", value_vars=df.columns)
source.columns = ["m1", "m2", "value"]
base = alt.Chart(source).encode(
alt.X('m1:O', title="New Model"),
alt.Y("m2:O", title="B... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_confusion_matrix(self):\r\n interp = ClassificationInterpretation.from_learner(self.learn)\r\n interp.plot_confusion_matrix()",
"def plot_confusion_matrix(cm, class_names):\n figure = plt.figure(figsize=(10, 10))\n plt.imshow(cm, interpolation='nearest', cmap=plt.cm.Blues)\n plt.title(\... | [
"0.79490983",
"0.7829431",
"0.7794925",
"0.7749858",
"0.7742887",
"0.76699764",
"0.7664901",
"0.766141",
"0.76476663",
"0.7641274",
"0.76193213",
"0.7607578",
"0.7598432",
"0.7597083",
"0.7588289",
"0.7574436",
"0.7569805",
"0.7568525",
"0.7560449",
"0.7552828",
"0.7551474",
... | 0.0 | -1 |
Get a list of tokens. | def get(self, filters=None, pagination=None, sort=None):
filters = filters or {}
if not is_user_action_allowed('manage_others_tokens'):
filters['_user_fk'] = current_user.id
sm = get_storage_manager()
result = sm.list(models.Token, filters=filters,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_tokens(self) -> List[str]:\n return self.tokens",
"def tokens(self):\n # type: () -> List[Token]\n return self._tokens",
"def getTokens(self):\n list = []\n for i in range(self.startIdx, self.endIdx + 1):\n token = self.sentence[i]\n list.append(token)\n... | [
"0.84577584",
"0.8271703",
"0.8186385",
"0.78194696",
"0.7753249",
"0.77504075",
"0.7655102",
"0.7651295",
"0.7651295",
"0.7651295",
"0.75834113",
"0.7564851",
"0.7508029",
"0.74478513",
"0.7391352",
"0.7338311",
"0.72981405",
"0.7290869",
"0.72548044",
"0.72461283",
"0.72420... | 0.0 | -1 |
Create a new token. | def post(self):
_purge_expired_user_tokens()
request_dict = get_json_and_verify_params({
'description': {'type': str, 'optional': True},
'expiration_date': {'optional': True},
})
expiration_date = request_dict.get('expiration_date')
if expiration_date:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_token(self, token_id, data):\n raise exception.NotImplemented() # pragma: no cover",
"async def create_token(self, *args, **kwargs) -> OAuth2Token:\n token = await super().create_token(*args, **kwargs)\n # NOTE: Save data from token to db here.\n return token",
"def crea... | [
"0.8130268",
"0.76122075",
"0.76098174",
"0.7525182",
"0.74004394",
"0.7391528",
"0.7294902",
"0.7212832",
"0.7195884",
"0.7148666",
"0.709604",
"0.709604",
"0.709604",
"0.70908123",
"0.70557845",
"0.7037195",
"0.7037195",
"0.7037195",
"0.7037195",
"0.7037195",
"0.7037195",
... | 0.6181684 | 73 |
min || alpha v ||^2, subject to \sum{alpha}=1, alpha >= 0 | def solve_huang_eq_13(v):
n = len(v)
u = v - np.ones((n, n)) @ v / (n) + np.ones(n) / (n)
lambda_bar_star = solve_huang_eq_24(u)
lambda_star = (lambda_bar_star - u) + np.clip(u - lambda_bar_star, 0, None)
return u + lambda_star - lambda_bar_star * np.ones(n) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def optimal_alpha():\n\n # When I checked all of alphas, -0.01 was the best\n alpha = -0.01\n # np.random.choice([-0.06, -0.01, 0.04, 0.1])\n return alpha",
"def search_alpha_min(self):\n alpha_min = 0\n\n for alpha in range(0, 180, 4):\n r = self.solver(alpha)[0]\n ... | [
"0.6842892",
"0.67928666",
"0.6652993",
"0.6382272",
"0.6352336",
"0.630119",
"0.61689425",
"0.61330134",
"0.60706925",
"0.60369635",
"0.599193",
"0.59544617",
"0.59247285",
"0.5892145",
"0.5888041",
"0.5843474",
"0.57803637",
"0.57722086",
"0.57616067",
"0.5746921",
"0.57273... | 0.0 | -1 |
Initialize the model, with model structure and hyperparameters | def __init__(
self,
n_timesteps: int = 80,
n_features: int = 5,
n_LSTM_layers: int = 2,
LSTM_size: int = 64,
random_seed: Optional[int] = None
):
self.n_timesteps = n_timesteps
self.n_features = n_features
self.random_seed = random_seed
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_model(self):\n pass",
"def init_model(self):\n pass",
"def init(self):\n inputs = self.inputs()\n outputs = self.outputs(inputs)\n self.model = tf.keras.Model(inputs=inputs, outputs=outputs)\n self.model.compile(optimizer=self.optimizer() or self.config.... | [
"0.7531575",
"0.74101233",
"0.7406556",
"0.7397189",
"0.73969567",
"0.73910505",
"0.73630476",
"0.73531634",
"0.73347515",
"0.7290576",
"0.7287418",
"0.72146523",
"0.72038335",
"0.71342087",
"0.711464",
"0.71036726",
"0.7083342",
"0.7061206",
"0.7053081",
"0.7040719",
"0.7039... | 0.0 | -1 |
A transformation that batches ragged elements into `tf.RaggedTensor`s. This transformation combines multiple consecutive elements of the input dataset into a single element. Like `tf.data.Dataset.batch`, the components of the resulting element will have an additional outer dimension, which will be `batch_size` (or `N %... | def dense_to_ragged_batch(batch_size,
drop_remainder=False,
row_splits_dtype=dtypes.int64):
def _apply_fn(dataset):
return dataset.ragged_batch(batch_size, drop_remainder, row_splits_dtype)
return _apply_fn | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _fully_partitioned_ragged_tensor(rt: Union[tf.RaggedTensor, tf.Tensor],\n dtype=tf.dtypes.int64):\n if isinstance(rt, tf.RaggedTensor):\n rt = rt.with_row_splits_dtype(dtype)\n flattened_values = _partition_if_not_vector(rt.flat_values, dtype=dtype)\n return rt.wit... | [
"0.6661254",
"0.64618015",
"0.6296781",
"0.6296781",
"0.6260107",
"0.62228405",
"0.61794186",
"0.61794186",
"0.6146636",
"0.6065816",
"0.6054104",
"0.5873956",
"0.58456135",
"0.5817782",
"0.57895577",
"0.5777174",
"0.5739818",
"0.57111835",
"0.5708858",
"0.56962407",
"0.56340... | 0.75228924 | 0 |
A transformation that batches ragged elements into `tf.sparse.SparseTensor`s. Like `Dataset.padded_batch()`, this transformation combines multiple consecutive elements of the dataset, which might have different shapes, into a single element. The resulting element has three components (`indices`, `values`, and `dense_sh... | def dense_to_sparse_batch(batch_size, row_shape):
def _apply_fn(dataset):
return dataset.sparse_batch(batch_size, row_shape)
return _apply_fn | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dense_to_ragged_batch(batch_size,\n drop_remainder=False,\n row_splits_dtype=dtypes.int64):\n def _apply_fn(dataset):\n return dataset.ragged_batch(batch_size, drop_remainder, row_splits_dtype)\n\n return _apply_fn",
"def _pad_reshape_mask_batch(batch, f... | [
"0.6834973",
"0.61885273",
"0.6133805",
"0.6133805",
"0.6118299",
"0.609185",
"0.60514516",
"0.60200197",
"0.6011961",
"0.59403723",
"0.58763945",
"0.58763945",
"0.5868475",
"0.58559144",
"0.58559144",
"0.5840113",
"0.5762089",
"0.57282156",
"0.57074594",
"0.5684968",
"0.5633... | 0.6893238 | 0 |
Fused implementation of `map` and `batch`. Maps `map_func` across `batch_size` consecutive elements of this dataset and then combines them into a batch. Functionally, it is equivalent to `map` followed by `batch`. This API is temporary and deprecated since input pipeline optimization now fuses consecutive `map` and `ba... | def map_and_batch(map_func,
batch_size,
num_parallel_batches=None,
drop_remainder=False,
num_parallel_calls=None):
if num_parallel_batches is None and num_parallel_calls is None:
num_parallel_calls = batch_size
elif num_parallel_batches is... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def map_and_batch_with_legacy_function(map_func,\n batch_size,\n num_parallel_batches=None,\n drop_remainder=False,\n num_parallel_calls=None):\n\n if num_paralle... | [
"0.76548666",
"0.6428743",
"0.6423285",
"0.6402761",
"0.63997674",
"0.6349475",
"0.62774205",
"0.61956775",
"0.6052903",
"0.60277444",
"0.60201555",
"0.60139006",
"0.5994452",
"0.5905943",
"0.5887998",
"0.58798826",
"0.5879108",
"0.5877131",
"0.5850125",
"0.5827735",
"0.58240... | 0.8207381 | 0 |
See `Dataset.dense_to_sparse_batch()` for more details. | def __init__(self, input_dataset, batch_size, row_shape):
if not isinstance(
dataset_ops.get_legacy_output_types(input_dataset), dtypes.DType):
raise TypeError("`dense_to_sparse_batch` requires an input dataset whose "
"elements have a single component, but the given dataset "
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dense_to_sparse_batch(batch_size, row_shape):\n\n def _apply_fn(dataset):\n return dataset.sparse_batch(batch_size, row_shape)\n\n return _apply_fn",
"def to_sparse_representation(label, batch_idx):\n indices = []\n vals = []\n\n for i, idx in enumerate(batch_idx):\n for j, c in enumerat... | [
"0.75668025",
"0.71717817",
"0.6723861",
"0.6514351",
"0.64329255",
"0.6388908",
"0.63793164",
"0.6338439",
"0.6331802",
"0.62845683",
"0.622844",
"0.61825955",
"0.61223274",
"0.61171454",
"0.6115206",
"0.61047125",
"0.6086186",
"0.6085435",
"0.6060007",
"0.60404956",
"0.6029... | 0.66519076 | 3 |
Calculate the great circle distance between two points on the earth (specified in decimal degrees) | def haversine(lon1, lat1, lon2, lat2):
# convert decimal degrees to radians
lon1, lat1, lon2, lat2 = map(radians, [lon1, lat1, lon2, lat2])
# haversine formula
dlon = lon2 - lon1
dlat = lat2 - lat1
a = sin(dlat/2)**2 + cos(lat1) * cos(lat2) * sin(dlon/2)**2
c = 2 * asin(sqrt(a))
r = 637... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def great_circle(lat_1, long_1, lat_2, long_2):\n long_1 = m.radians(long_1)\n lat_1 = m.radians(lat_1)\n long_2 = m.radians(long_2)\n lat_2 = m.radians(lat_2)\n\n d = 2 * 6367.45 * m.asin(\n m.sqrt(haversine(lat_2 - lat_1)\n + m.cos(lat_1)*m.cos(lat_2) *\n haversine(long... | [
"0.8145869",
"0.7864717",
"0.7633036",
"0.7605665",
"0.7596642",
"0.75959784",
"0.75934994",
"0.75714386",
"0.7563202",
"0.7555913",
"0.75290483",
"0.7516102",
"0.749458",
"0.74664295",
"0.7451783",
"0.74342626",
"0.73920393",
"0.73578167",
"0.73480356",
"0.7330858",
"0.73286... | 0.0 | -1 |
One subnet at the beginning | def test_one_subnet(self):
self._test_find_next_subnet(
network="10.0.0.0/16",
subnets=["10.0.0.0/24"],
requests=[24],
expected=["10.0.1.0/24"],
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allocate_subnet(self):\n if len(self.subnet_list) == 0:\n subnet = '192.168.1.0/24'\n self.subnet_list.append(subnet)\n return subnet\n else:\n subnet = self.subnet_list[::-1][0]\n ip = ipaddress.IPv4Network(subnet)[0]\n s = ipaddr... | [
"0.71165836",
"0.66601914",
"0.64572406",
"0.6366779",
"0.63357073",
"0.6259079",
"0.6258229",
"0.6247981",
"0.6151443",
"0.60790884",
"0.6072729",
"0.6019281",
"0.60101473",
"0.59626585",
"0.5954719",
"0.5937508",
"0.5937093",
"0.5928644",
"0.5845021",
"0.5820546",
"0.579881... | 0.74252737 | 0 |
One subnet at the beginning, looking for two different sized subnet | def test_different_sizes(self):
self._test_find_next_subnet(
network="10.0.0.0/16",
subnets=["10.0.0.0/25"],
requests=[24, 25],
expected=["10.0.0.128/24", "10.0.1.128/25"],
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_one_subnet(self):\n\n self._test_find_next_subnet(\n network=\"10.0.0.0/16\", \n subnets=[\"10.0.0.0/24\"],\n requests=[24],\n expected=[\"10.0.1.0/24\"],\n )",
"def test_two_adjacent_at_start(self):\n\n self._test_find_next_subnet(\n ... | [
"0.7538247",
"0.73625815",
"0.7177689",
"0.71560794",
"0.6935244",
"0.6655643",
"0.65563667",
"0.65182245",
"0.64209414",
"0.62785256",
"0.62730163",
"0.6266421",
"0.6262748",
"0.6239045",
"0.6215448",
"0.61699384",
"0.6120432",
"0.61109394",
"0.6056152",
"0.6044382",
"0.5991... | 0.7156927 | 3 |
Existing subnets not supplied in size order | def test_unordered_subnets(self):
self._test_find_next_subnet(
network="172.31.0.0/16",
subnets=["172.31.48.0/20", "172.31.0.0/20", "172.31.16.0/20", "172.31.32.0/20"],
requests=[24],
expected=["172.31.64.0/24"],
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_aws_service_api_network_subnets_get(self):\n pass",
"def subnets(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:\n return pulumi.get(self, \"subnets\")",
"def test_different_sizes(self):\n\n self._test_find_next_subnet(\n network=\"10.0.0.0/16\",\n ... | [
"0.66782284",
"0.64517105",
"0.64064467",
"0.638809",
"0.6342284",
"0.6285332",
"0.6250416",
"0.6155536",
"0.61246914",
"0.610507",
"0.6053245",
"0.6053245",
"0.6043815",
"0.60015607",
"0.5980955",
"0.5958874",
"0.5935136",
"0.59185946",
"0.58392125",
"0.5823053",
"0.5816172"... | 0.6691406 | 0 |
A subnet should fit in the gap | def test_middle_gap(self):
self._test_find_next_subnet(
network="192.168.1.0/24",
subnets=["192.168.1.0/26", "192.168.1.128/25"],
requests=[26],
expected=["192.168.1.64/26"],
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_host_subnet(self):\n pass",
"def test_insufficient_space(self):\n\n self._test_find_next_subnet(\n network=\"10.0.0.0/24\",\n subnets=[\"10.0.0.64/25\"],\n requests=[25],\n expected=None,\n )",
"def is_subnet_of(a, b) -> bool:\n\n... | [
"0.6699309",
"0.64955693",
"0.6487309",
"0.6442857",
"0.6409484",
"0.6409399",
"0.6350243",
"0.63301444",
"0.63093126",
"0.6287745",
"0.6236005",
"0.62186134",
"0.62154156",
"0.6165762",
"0.61649626",
"0.61604047",
"0.60707283",
"0.6000076",
"0.5965292",
"0.5961993",
"0.59607... | 0.6001611 | 17 |
Subnet in the middle but not enough space either side | def test_insufficient_space(self):
self._test_find_next_subnet(
network="10.0.0.0/24",
subnets=["10.0.0.64/25"],
requests=[25],
expected=None,
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_host_subnet(self):\n pass",
"def allocate_subnet(self):\n if len(self.subnet_list) == 0:\n subnet = '192.168.1.0/24'\n self.subnet_list.append(subnet)\n return subnet\n else:\n subnet = self.subnet_list[::-1][0]\n ip = ip... | [
"0.6247384",
"0.6204876",
"0.61068046",
"0.59659135",
"0.59385407",
"0.5929295",
"0.5882542",
"0.5862027",
"0.57188314",
"0.5716374",
"0.5709984",
"0.57096505",
"0.57076216",
"0.57051164",
"0.56669706",
"0.56602937",
"0.5627736",
"0.5626858",
"0.5625432",
"0.5602344",
"0.5602... | 0.57557136 | 8 |
_makeTimestampString_ Working from an integer timestamp, generate the datestamp fragment of the LFN. This uses gmtime as a convention so that all LFNs get the same timestamp based on the request, rather than the local time zone interpretation. Why GMT? Because Im British dammit! God Save The Queen! | def makeTimestampString(timestamp):
gmTuple = time.gmtime(timestamp)
year = gmTuple[0]
month = gmTuple[1]
day = gmTuple[2]
return "%s/%s/%s" % (year, month, day) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _generate_timestamp():\n\t\treturn strftime(\"%Y%m%dT%H%M%S\")",
"def epoch2localstr(timestamp=time(), fmat=\"%Y-%m-%d %H:%M:%S\"):\n return strftime(fmat, localtime(timestamp))",
"def make_timestamp(precision=0):\n\t#Outputs time stamp in format YYYYMMDD_hhmmss\n\tt = time.localtime()\n\td = time.time(... | [
"0.76370513",
"0.73009616",
"0.7081951",
"0.69541764",
"0.69241107",
"0.6917818",
"0.68791175",
"0.68621045",
"0.68540907",
"0.68434155",
"0.67958134",
"0.6760723",
"0.6723764",
"0.67221105",
"0.6712855",
"0.6669665",
"0.66366076",
"0.66261506",
"0.6620966",
"0.65650505",
"0.... | 0.7427034 | 1 |
Duration of the movie in a format suitable for display | def _get_display_duration(self):
duration = self.duration
return '%dmn' % duration if duration < 60 else '%dh%dmn' % (duration / 60, duration % 60) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def duration():\r\n elapsed_time, duration = video_time()\r\n return duration",
"def duration(self) -> str:\n return pulumi.get(self, \"duration\")",
"def duration_display(self):\n return self.duration_poster or self.duration",
"def duration(self):\n pass",
"def duration(self):\n... | [
"0.777296",
"0.73180413",
"0.72933984",
"0.72733545",
"0.72733545",
"0.7265492",
"0.72241926",
"0.7103312",
"0.6974093",
"0.6921495",
"0.6918213",
"0.69139063",
"0.686397",
"0.68635404",
"0.6862099",
"0.683791",
"0.6825466",
"0.6825466",
"0.6822558",
"0.68109745",
"0.68066347... | 0.7358666 | 1 |
Gets the list of episodes of this series | def _get_episodes(self):
return [series_episode for series_episode in SeriesEpisode.objects.filter(series=self)] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def episodes(self):\n episodes = []\n for series in self.series:\n episodes.extend(series.episodes)\n return episodes",
"def episodes(self):\n episodes = []\n for season in self.seasons:\n episodes.extend(season.episodes)\n return episodes",
"def ... | [
"0.900455",
"0.86826456",
"0.7879995",
"0.76952314",
"0.7262344",
"0.7236335",
"0.7069578",
"0.7059861",
"0.6732954",
"0.6684449",
"0.6548593",
"0.65139747",
"0.65077364",
"0.63407654",
"0.63366663",
"0.62658024",
"0.61716634",
"0.6146226",
"0.613938",
"0.61305416",
"0.612999... | 0.84750897 | 2 |
This is the forward pass through the network given an input state. The implementation of this function is different per network type. | def inference(self, x, name):
raise NotImplemented | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward(self, input, context, state):\n raise NotImplementedError",
"def forward(self, state):\n x = F.relu(self.fc1(state))\n x = F.relu(self.fc2(x))\n x = F.relu(self.fc3(x))\n return self.fc4(x)",
"def forward(self, state):\n x = self.fc(state)\n return x... | [
"0.7623267",
"0.7611611",
"0.7601058",
"0.7395795",
"0.7395795",
"0.7395795",
"0.73288393",
"0.73234826",
"0.7288737",
"0.72876287",
"0.7281217",
"0.7281217",
"0.7281217",
"0.71893907",
"0.71602887",
"0.71571887",
"0.71571887",
"0.71551085",
"0.7147878",
"0.71423274",
"0.7120... | 0.0 | -1 |
Load network weights for action and target networks and load these into separate networks. | def load(self, path, nr_of_saves, test_it=-1):
with self.graph.as_default():
print("Loading networks...")
checkpoint_dir = os.path.join(os.environ['APPROXIMATOR_HOME'], path, "network-"+str(test_it))
self.saver = tf.train.Saver(max_to_keep=nr_of_saves+1)
try:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_weigths_into_target_network(self):\n logging.debug(\"Transfer Weight!\")\n self.network.save_weights(self._save_path)\n self.target_network.load_weights(self._save_path)",
"def load_networks(self, dir_weights, idx_load):\n\n path_p = dir_weights + 'p_{}.ckpt'\n path_D ... | [
"0.7635478",
"0.7308514",
"0.71815646",
"0.70369345",
"0.68551004",
"0.6842774",
"0.68085575",
"0.6736255",
"0.65765566",
"0.6500852",
"0.6411397",
"0.6406008",
"0.6398009",
"0.6391791",
"0.63624716",
"0.634854",
"0.6312793",
"0.6274902",
"0.6267881",
"0.6214352",
"0.6204818"... | 0.0 | -1 |
The name of the resource group under which the Service Bus Queue has been created. Changing this forces a new resource to be created. | def resource_group_name(self) -> pulumi.Input[str]:
return pulumi.get(self, "resource_group_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_group_name(self) -> str:\n return pulumi.get(self, \"resource_group_name\")",
"def resource_group(self) -> str:\n return pulumi.get(self, \"resource_group\")",
"def resource_group_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"resource_group_name\")",
... | [
"0.7225191",
"0.6934854",
"0.6875516",
"0.6875516",
"0.6875516",
"0.6875516",
"0.6875516",
"0.6875516",
"0.6875516",
"0.6875516",
"0.6875516",
"0.6875516",
"0.6875516",
"0.6875516",
"0.6875516",
"0.6875516",
"0.6875516",
"0.6766738",
"0.6766738",
"0.6766738",
"0.6766738",
"... | 0.69719994 | 27 |
The connection string for the endpoint. This attribute can only be specified and is mandatory when `authentication_type` is `keyBased`. | def connection_string(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "connection_string") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connection_string(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"connection_string\")",
"def connection_string(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"connection_string\")",
"def connection_string(self) -> pulumi.Output[str]:\n return pulumi.get(sel... | [
"0.6831183",
"0.67943907",
"0.67943907",
"0.67290044",
"0.6614292",
"0.62720186",
"0.62165016",
"0.61846125",
"0.6167701",
"0.61267036",
"0.61200696",
"0.6093978",
"0.60520095",
"0.59966856",
"0.59911984",
"0.59555745",
"0.58865017",
"0.5835899",
"0.58283526",
"0.5786386",
"0... | 0.7113709 | 1 |
Name of the Service Bus Queue. This attribute can only be specified and is mandatory when `authentication_type` is `identityBased`. | def entity_path(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "entity_path") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def queue_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"queue_name\")",
"def queue_name(is_parallel):\n return QUEUE_NAMES[int(bool(is_parallel))]",
"def get_queue_name(self):\n return self._graph_executor.get_queue_name()",
"def azure_queue(self) -> Optional[pulumi.... | [
"0.7466725",
"0.671094",
"0.6577484",
"0.63740057",
"0.6332695",
"0.62789017",
"0.62789017",
"0.62197745",
"0.60960996",
"0.60942674",
"0.60921144",
"0.60221577",
"0.599301",
"0.59002167",
"0.5882262",
"0.5803494",
"0.5775603",
"0.5775603",
"0.5734532",
"0.5714602",
"0.571460... | 0.0 | -1 |
ID of the User Managed Identity used to authenticate against the Service Bus Queue endpoint. | def identity_id(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "identity_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_id(self) -> str:\n return self._user_id",
"def user_id(self) -> str:\n return self._user_id",
"def user_id(self):\n return self._user_id",
"def user_id(self):\n return self._user_id",
"def user_id(self):\n return self._user_id",
"def user_id(self):\n ret... | [
"0.69907063",
"0.69907063",
"0.6939324",
"0.6939324",
"0.6939324",
"0.6939324",
"0.6939324",
"0.6875801",
"0.6858073",
"0.67586154",
"0.6744285",
"0.67085814",
"0.6691733",
"0.66626483",
"0.66626483",
"0.6647796",
"0.6630985",
"0.6576022",
"0.6576022",
"0.6553367",
"0.6541990... | 0.0 | -1 |
The connection string for the endpoint. This attribute can only be specified and is mandatory when `authentication_type` is `keyBased`. | def connection_string(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "connection_string") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connection_string(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"connection_string\")",
"def connection_string(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"connection_string\")",
"def connection_string(self) -> pulumi.Output[str]:\n return pulumi.get(sel... | [
"0.6829344",
"0.6792421",
"0.6792421",
"0.6728195",
"0.66137034",
"0.6269684",
"0.6215213",
"0.61831534",
"0.61664534",
"0.6125673",
"0.61185646",
"0.6092346",
"0.6050753",
"0.5995907",
"0.598987",
"0.5954883",
"0.5885103",
"0.5835318",
"0.58273876",
"0.5784639",
"0.57816035"... | 0.7112801 | 2 |
Name of the Service Bus Queue. This attribute can only be specified and is mandatory when `authentication_type` is `identityBased`. | def entity_path(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "entity_path") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def queue_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"queue_name\")",
"def queue_name(is_parallel):\n return QUEUE_NAMES[int(bool(is_parallel))]",
"def get_queue_name(self):\n return self._graph_executor.get_queue_name()",
"def azure_queue(self) -> Optional[pulumi.... | [
"0.7466943",
"0.6710663",
"0.6577805",
"0.63742113",
"0.63342834",
"0.62797886",
"0.62797886",
"0.62196535",
"0.60971326",
"0.6094619",
"0.6092706",
"0.6023015",
"0.59932894",
"0.5900316",
"0.58835906",
"0.5805791",
"0.57764655",
"0.57764655",
"0.57333386",
"0.57134634",
"0.5... | 0.0 | -1 |
ID of the User Managed Identity used to authenticate against the Service Bus Queue endpoint. | def identity_id(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "identity_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_id(self) -> str:\n return self._user_id",
"def user_id(self) -> str:\n return self._user_id",
"def user_id(self):\n return self._user_id",
"def user_id(self):\n return self._user_id",
"def user_id(self):\n return self._user_id",
"def user_id(self):\n ret... | [
"0.6991596",
"0.6991596",
"0.69403976",
"0.69403976",
"0.69403976",
"0.69403976",
"0.69403976",
"0.6876316",
"0.6860254",
"0.67595714",
"0.67455626",
"0.67094463",
"0.6693101",
"0.6663939",
"0.6663939",
"0.66494966",
"0.663175",
"0.6576561",
"0.6576561",
"0.65554374",
"0.6542... | 0.0 | -1 |
The name of the resource group under which the Service Bus Queue has been created. Changing this forces a new resource to be created. | def resource_group_name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "resource_group_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_group_name(self) -> str:\n return pulumi.get(self, \"resource_group_name\")",
"def resource_group_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"resource_group_name\")",
"def resource_group_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"resource_gro... | [
"0.72246414",
"0.6970831",
"0.6970831",
"0.6970831",
"0.6970831",
"0.6970831",
"0.6970831",
"0.6970831",
"0.6970831",
"0.6970831",
"0.6970831",
"0.6970831",
"0.6970831",
"0.6970831",
"0.6970831",
"0.6970831",
"0.6970831",
"0.6970831",
"0.6970831",
"0.6970831",
"0.6970831",
... | 0.68744767 | 54 |
The connection string for the endpoint. This attribute can only be specified and is mandatory when `authentication_type` is `keyBased`. | def connection_string(self) -> pulumi.Output[Optional[str]]:
return pulumi.get(self, "connection_string") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connection_string(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"connection_string\")",
"def connection_string(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"connection_string\")",
"def connection_string(self) -> Optional[pulumi.Input[str]]:\n retu... | [
"0.7113709",
"0.7113709",
"0.7113709",
"0.7113709",
"0.67943907",
"0.67943907",
"0.67290044",
"0.6614292",
"0.62720186",
"0.62165016",
"0.61846125",
"0.6167701",
"0.61267036",
"0.61200696",
"0.6093978",
"0.60520095",
"0.59966856",
"0.59911984",
"0.59555745",
"0.58865017",
"0.... | 0.6831183 | 4 |
Name of the Service Bus Queue. This attribute can only be specified and is mandatory when `authentication_type` is `identityBased`. | def entity_path(self) -> pulumi.Output[Optional[str]]:
return pulumi.get(self, "entity_path") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def queue_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"queue_name\")",
"def queue_name(is_parallel):\n return QUEUE_NAMES[int(bool(is_parallel))]",
"def get_queue_name(self):\n return self._graph_executor.get_queue_name()",
"def azure_queue(self) -> Optional[pulumi.... | [
"0.7466725",
"0.671094",
"0.6577484",
"0.63740057",
"0.6332695",
"0.62789017",
"0.62789017",
"0.62197745",
"0.60960996",
"0.60942674",
"0.60921144",
"0.60221577",
"0.599301",
"0.59002167",
"0.5882262",
"0.5803494",
"0.5775603",
"0.5775603",
"0.5734532",
"0.5714602",
"0.571460... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.