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
Initialize the updater class with all mandatory and optional arguments.
def __init__(self, settings_path: str, mod_path: str, fact_path: str, creds: hash): self.mod_server_url = 'https://mods.factorio.com' self.mod_path = mod_path self.timestamp = datetime.utcnow() # Get the credentials to download mods if settings_path is not None:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n _Updater.__init__(self)\n\n self._updaters[1] = self._update_version1\n self._updaters[2] = self._update_version2", "def update(self, *args, **kwargs):\n values = {}\n values.update(*args, **kwargs)\n\n self._check_init_argnames(values)\n\n f...
[ "0.7593987", "0.6787485", "0.676268", "0.6737045", "0.6729703", "0.67024195", "0.65563697", "0.6529985", "0.6445357", "0.6431929", "0.642621", "0.6425287", "0.64124584", "0.64101005", "0.6403637", "0.6239584", "0.6179084", "0.616796", "0.6139571", "0.6096999", "0.60802", "0...
0.0
-1
Missing values are handled as infinite values, effectively separating the visibility graph into different disconnected components.
def __init__(self, time_series, timings=None, missing_values=False, horizontal=False, silence_level=0): # Set silence_level self.silence_level = silence_level """The inverse level of verbosity of the object.""" # Set missing_values flag self.missing_values = m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_finite(self):\n\t\tpass", "def apply_nan(self):\n nodatavals = {dvar: self._ref_nodatavals[i] for i, dvar in enumerate(self.data_view.data_vars)}\n super().apply_nan(nodatavals=nodatavals)", "def set_infinity(self):\n for riga in range(len(self.vertici)):\n for col in ran...
[ "0.5943592", "0.58879334", "0.58480906", "0.5778421", "0.5777625", "0.57736564", "0.57365745", "0.5708626", "0.5698039", "0.5682388", "0.5672099", "0.56347233", "0.5567006", "0.555606", "0.55329555", "0.55293655", "0.5522876", "0.55146176", "0.54962516", "0.5492319", "0.54713...
0.0
-1
Returns the visibility between all nodes of self.time_series and node as array of booleans.
def visibility_single(self, node): return self.adjacency[node, :]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def visible_nodes(self):\n return list(filter(lambda n: n.visible, self.nodes))", "def visibility_relations(self):\n if self.silence_level <= 1:\n print(\"Calculating visibility relations...\")\n\n # Prepare\n x = self.time_series\n t = self.timings\n N = len...
[ "0.6960569", "0.6604221", "0.6099715", "0.6006918", "0.58415824", "0.57655245", "0.57601565", "0.57601565", "0.57601565", "0.57553333", "0.57553333", "0.5738531", "0.5719705", "0.57123464", "0.5699621", "0.5577374", "0.55287504", "0.5460248", "0.5450175", "0.5392751", "0.5358...
0.5702975
14
Return number of neighbors in the past of a node.
def retarded_degree(self): # Prepare retarded_degree = np.zeros(self.N) A = self.adjacency for i in range(self.N): retarded_degree[i] = A[i, :i].sum() return retarded_degree
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def n_neighbors_alive(self, row, col):\n return len([cell for cell in self.graph.neighbors(row, col) if cell.is_alive])", "def leaving_node_count(self) -> int:\n return pulumi.get(self, \"leaving_node_count\")", "def leaving_node_count(self) -> int:\n return pulumi.get(self, \"leaving_node...
[ "0.67043644", "0.6584815", "0.6584815", "0.6253778", "0.61854005", "0.6172669", "0.6148723", "0.6119217", "0.61129946", "0.61070514", "0.60767436", "0.60018873", "0.5983656", "0.5983297", "0.5961068", "0.59567446", "0.59487957", "0.59318477", "0.5907284", "0.5899304", "0.5887...
0.0
-1
Return average path length to nodes in the past of a node.
def retarded_closeness(self): # Prepare retarded_closeness = np.zeros(self.N) path_lengths = self.path_lengths() for i in range(self.N): retarded_closeness[i] = path_lengths[i, :i].mean() ** (-1) return retarded_closeness
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path_lenght(self, path):\n if path is None:\n return float(\"inf\")\n lenght = 0.0\n # given the path (list of node) returns the edges contained\n path_edges = [path[i:i + 2] for i in range(len(path) - 2)]\n # itereate to edges and calculate the weight\n for...
[ "0.6589236", "0.64252734", "0.6362625", "0.63493717", "0.62929404", "0.626647", "0.6248759", "0.6174978", "0.6139297", "0.6077647", "0.6065461", "0.60523736", "0.6036174", "0.60300314", "0.60120094", "0.6005308", "0.6002619", "0.5969166", "0.59336793", "0.5924279", "0.5862828...
0.51931757
92
Return average path length to nodes in the future of a node.
def advanced_closeness(self): # Prepare advanced_closeness = np.zeros(self.N) path_lengths = self.path_lengths() for i in range(self.N): advanced_closeness[i] = path_lengths[i, i+1:].mean() ** (-1) return advanced_closeness
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path_lenght(self, path):\n if path is None:\n return float(\"inf\")\n lenght = 0.0\n # given the path (list of node) returns the edges contained\n path_edges = [path[i:i + 2] for i in range(len(path) - 2)]\n # itereate to edges and calculate the weight\n for...
[ "0.66683954", "0.63220894", "0.6311525", "0.6290327", "0.6273245", "0.6215452", "0.6177424", "0.6114899", "0.6095026", "0.6092387", "0.6073838", "0.6054514", "0.5993766", "0.5992946", "0.59233546", "0.5866931", "0.5837583", "0.5835264", "0.5834631", "0.5827251", "0.57818836",...
0.0
-1
Return a weighted degree corrected for trivial boundary effects.
def boundary_corrected_degree(self): # Prepare N_past = np.arange(self.N) N_future = N_past[::-1] cdegree = (self.retarded_degree() * N_past + self.advanced_degree() * N_future) / float(self.N - 1) return cdegree
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_weight():\n # Set a weight for energy function. Adjusting this value will give different\n # behaviour: the larger the weight, the more influence the constraints have.\n # The weight value should be >= 0.0\t\n return 10.0", "def weight(self):\n P = self.parent().weight_lattice_real...
[ "0.65181863", "0.63102466", "0.63102466", "0.6173487", "0.61502296", "0.61294216", "0.6127593", "0.5968495", "0.59504336", "0.5935608", "0.58989364", "0.5893854", "0.5888141", "0.5860783", "0.58494794", "0.58169276", "0.5812643", "0.5808871", "0.57869315", "0.57803947", "0.57...
0.5987324
7
Return a weighted closeness corrected for trivial boundary effects.
def boundary_corrected_closeness(self): # Prepare N_past = np.arange(self.N) N_future = N_past[::-1] ccloseness = (self.N - 1) * (self.retarded_closeness() / N_past + self.advanced_closeness() / N_future) return ccloseness
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def closeness_factor(y, x, cf_th= self.cf_th, cmax= self.cmax):\n d= np.linalg.norm(y - x)/len(y)\n if d == 0.0:\n d= 0.1\n if 1.0/d < cf_th:\n f= 1.0/d\n else:\n f= cf_th\n return f/cf_th*cmax", "def get_weight()...
[ "0.61896306", "0.60166687", "0.59662193", "0.58989125", "0.58814615", "0.58015174", "0.5742537", "0.57258064", "0.570271", "0.569844", "0.5689243", "0.56727463", "0.56554115", "0.5644423", "0.56425005", "0.5641829", "0.56367356", "0.56336445", "0.55979854", "0.55923456", "0.5...
0.6026672
1
Check that we can't login using valid username that has empty password.
def valid_username_with_valid_empty_password(self, server): user = {"cn": "empty_password", "userpassword": ""} exitcode = 4 message = f"DB::Exception: {user['cn']}: Authentication failed: password is incorrect or there is no user with such name" add_user_to_ldap_and_login(user=user, exitcode=exitcode,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_username_and_invalid_empty_password(self, server):\n username = \"user_non_empty_password\"\n user = {\"cn\": username, \"userpassword\": username}\n login = {\"password\": \"\"}\n\n exitcode = 4\n message = f\"DB::Exception: {username}: Authentication failed: password is incorrect or ther...
[ "0.80194575", "0.7674351", "0.749087", "0.7416891", "0.73798776", "0.7316237", "0.73161674", "0.73126835", "0.72789294", "0.72545725", "0.72410774", "0.72145706", "0.7166929", "0.7134075", "0.7097966", "0.70975304", "0.7020729", "0.6999091", "0.69919425", "0.69895357", "0.697...
0.7945752
1
Test for home page 200 response_code.
def test_factorial_main_page(): r = requests.post(url_homepage) assert r.status_code == 200
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_home_view_status_code(self):\n self.assertEquals(self.response.status_code, 200)", "def test_home_view_status_code(self):\n response = self.client.get(reverse('home'))\n self.assertEqual(response.status_code, 200)", "def test_play_200_okay(self):\n assert self.response.stat...
[ "0.80416864", "0.76482505", "0.7600634", "0.7499547", "0.74378", "0.743105", "0.73273224", "0.7286688", "0.71497536", "0.7088711", "0.70720935", "0.7018719", "0.700135", "0.6977676", "0.69579536", "0.6933301", "0.6931891", "0.6911899", "0.69064367", "0.6882271", "0.6878174", ...
0.0
-1
Kernel for ycomponent of displacement in the infinite space domain (1st system)
def kernel_d_y1(y, x, z, yp, xp, zp): # Y = y - yp # X = x - xp # Z = z - zp Y = yp - y X = xp - x Z = zp - z rho = np.sqrt(Y ** 2 + X ** 2 + Z ** 2) # kernel = Y/rho**3 kernel = -Y/rho**3 return kernel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def y(self):\n assert self.ndim > 1, \"This property needs 2D beams\"\n N = self.shape[-1]\n return (np.linspace(-(N - 1) / 2.0, (N - 1) / 2.0, N) * self.dx)[np.newaxis, :]", "def kernel_d_y2(y, x, z, yp, xp, zp):\n # Y = y - yp\n # X = x - xp\n # Z = z + zp\n Y = yp - y\n X =...
[ "0.6502458", "0.6474927", "0.6283008", "0.6174865", "0.6139622", "0.6120835", "0.60812473", "0.60479134", "0.60399765", "0.60139", "0.5958233", "0.5951874", "0.59449106", "0.59411716", "0.5939667", "0.59176177", "0.5910773", "0.5902899", "0.5889697", "0.5856539", "0.5838499",...
0.6767743
0
Kernel for zcomponent of displacement in the infinite space domain (1st system)
def kernel_d_z1(y, x, z, yp, xp, zp): # Y = y - yp # X = x - xp # Z = z - zp Y = yp - y X = xp - x Z = zp - z rho = np.sqrt(Y ** 2 + X ** 2 + Z ** 2) # kernel = Z/rho**3 kernel = -Z/rho**3 return kernel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kernel_d_x1(y, x, z, yp, xp, zp):\n # Y = y - yp\n # X = x - xp\n # Z = z - zp\n Y = yp - y\n X = xp - x\n Z = zp - z\n rho = np.sqrt(Y ** 2 + X ** 2 + Z ** 2)\n # kernel = X/rho**3\n kernel = -X/rho**3\n return kernel", "def _kernel(z_loc):\n return numpy.prod(\n ...
[ "0.68205553", "0.67934644", "0.67153347", "0.6690728", "0.6649612", "0.6624705", "0.64136225", "0.63280123", "0.60762197", "0.5999857", "0.5989036", "0.59569275", "0.58191586", "0.58007383", "0.5799905", "0.5796545", "0.5727278", "0.56868654", "0.5662141", "0.5655625", "0.564...
0.72713923
0
Kernel for ycomponent of displacement in the semiinfinite space domain (2nd system)
def kernel_d_y2(y, x, z, yp, xp, zp): # Y = y - yp # X = x - xp # Z = z + zp Y = yp - y X = xp - x Z = zp + z rho = np.sqrt(Y ** 2 + X ** 2 + Z ** 2) # kernel = Y/rho**3 kernel = -Y/rho**3 return kernel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kernel_d_y1(y, x, z, yp, xp, zp):\n # Y = y - yp\n # X = x - xp\n # Z = z - zp\n Y = yp - y\n X = xp - x\n Z = zp - z\n rho = np.sqrt(Y ** 2 + X ** 2 + Z ** 2)\n # kernel = Y/rho**3\n kernel = -Y/rho**3\n return kernel", "def y(self):\n assert self.ndim > 1, \"This proper...
[ "0.6804616", "0.65451384", "0.6510069", "0.6440755", "0.63565266", "0.6278935", "0.61875534", "0.6164543", "0.6012756", "0.59989434", "0.5983953", "0.5982019", "0.5947659", "0.59399045", "0.59181124", "0.5896892", "0.5891298", "0.58883667", "0.58806074", "0.5873729", "0.58730...
0.7056843
0
Kernel for zcomponent of displacement in the semiinfinite space domain (2nd system)
def kernel_d_z2(y, x, z, yp, xp, zp): # Y = y - yp # X = x - xp # Z = z + zp Y = yp - y X = xp - x Z = zp + z rho = np.sqrt(Y ** 2 + X ** 2 + Z ** 2) # kernel = Z/rho**3 kernel = -Z/rho**3 return kernel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kernel_d_zz2(y, x, z, yp, xp, zp):\n # Y = y - yp\n # X = x - xp\n # Z = z + zp\n Y = yp - y\n X = xp - x\n Z = zp + z\n rho = np.sqrt(Y ** 2 + X ** 2 + Z ** 2)\n kernel = 2 * zp * ( (3*(Z**2))/rho**5 - ( 1./rho**3 ) )\n return kernel", "def kernel_d_z1(y, x, z, yp, xp, zp):\n ...
[ "0.7331148", "0.7321421", "0.7168036", "0.713674", "0.69672126", "0.6918635", "0.68348867", "0.68039227", "0.6756586", "0.6093814", "0.60601896", "0.5957958", "0.59103996", "0.5904018", "0.58438206", "0.5833137", "0.5825587", "0.57965547", "0.57029325", "0.5692089", "0.568790...
0.73535615
0
Kernel for xzcomponent of displacement in the semiinfinite space domain (2nd system)
def kernel_d_xz2(y, x, z, yp, xp, zp): # Y = y - yp # X = x - xp # Z = z + zp Y = yp - y X = xp - x Z = zp + z rho = np.sqrt(Y ** 2 + X ** 2 + Z ** 2) kernel = 2 * zp *((3*X*Z)/rho**5) return kernel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kernel_d_x1(y, x, z, yp, xp, zp):\n # Y = y - yp\n # X = x - xp\n # Z = z - zp\n Y = yp - y\n X = xp - x\n Z = zp - z\n rho = np.sqrt(Y ** 2 + X ** 2 + Z ** 2)\n # kernel = X/rho**3\n kernel = -X/rho**3\n return kernel", "def kernel_d_x2(y, x, z, yp, xp, zp):\n # Y = y - yp\n...
[ "0.71047515", "0.696638", "0.6868965", "0.67120117", "0.6607045", "0.65085", "0.649075", "0.63218313", "0.6174364", "0.6069759", "0.5995322", "0.5946777", "0.5873429", "0.5805641", "0.57854897", "0.57602066", "0.5747607", "0.57267714", "0.5719757", "0.5710471", "0.5701038", ...
0.7133006
0
Kernel for yzcomponent of displacement in the semiinfinite space domain (2nd system)
def kernel_d_yz2(y, x, z, yp, xp, zp): # Y = y - yp # X = x - xp # Z = z + zp Y = yp - y X = xp - x Z = zp + z rho = np.sqrt(Y ** 2 + X ** 2 + Z ** 2) kernel = 2 * zp * ((3*Y*Z)/rho**5) return kernel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kernel_d_y2(y, x, z, yp, xp, zp):\n # Y = y - yp\n # X = x - xp\n # Z = z + zp\n Y = yp - y\n X = xp - x\n Z = zp + z\n rho = np.sqrt(Y ** 2 + X ** 2 + Z ** 2)\n # kernel = Y/rho**3\n kernel = -Y/rho**3\n return kernel", "def kernel_d_zz2(y, x, z, yp, xp, zp):\n # Y = y - yp\...
[ "0.75026435", "0.7409884", "0.7245963", "0.72402173", "0.7225316", "0.6925026", "0.6790538", "0.6414734", "0.63858044", "0.62079597", "0.61604685", "0.6063439", "0.60326356", "0.59654593", "0.586916", "0.5867381", "0.58424705", "0.58010745", "0.57480687", "0.57466537", "0.571...
0.7509574
0
Return frame with np.nan set for all rows that have failed_qa set to true
def filter_failed_qa(df): df = df.copy() if 'failed_qa' in df.columns: df['failed_qa'] = df['failed_qa'].replace(np.nan, False) df['failed_qa'] = df['failed_qa'].astype('bool') df.loc[df.failed_qa, (df.columns.difference(['failed_qa', 'filename']))] = np.nan df.loc[df.failed_qa, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_good_df():\n return pd.DataFrame({\n 'x1': ['t', 't', 't', 't', 't', 'f', 'f', 'f', 'f', 'f'],\n 'x2': ['t', 't', 't', 't', 'f', 't', 'f', 'f', 'f', 'f'],\n 'x3': ['t', 't', 't', 't', 't', 't', 'f', 'f', 'f', 'f'],\n 'x4': ['t', 't', 't', 't', 't', 'f', 'f', 'f', 'f', 'f']\n ...
[ "0.5867517", "0.5625989", "0.55566657", "0.55540633", "0.5521742", "0.55005276", "0.54116344", "0.54076725", "0.5381636", "0.5379004", "0.5347645", "0.53445536", "0.5310646", "0.52969015", "0.5225639", "0.5211348", "0.52072346", "0.5206507", "0.5205249", "0.5190947", "0.51621...
0.76626074
0
Returns frame with 'hemisphere' index level removed from index and added as a data column
def collapse_hemisphere_index(df): updated_frame = df.copy() return updated_frame.reset_index(level='hemisphere', drop=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_frame(self, suppress_hash: bool = False):\n rows = []\n hash_option = \"\" if suppress_hash else \"#\"\n for idx, voxel in enumerate(self.fractal):\n ss = voxel.to_series()\n ss[hash_option + \"IDX\"] = idx\n rows.append(ss)\n df = pd.DataFrame(ro...
[ "0.62820905", "0.5887304", "0.5827139", "0.57643366", "0.572346", "0.5565057", "0.55558735", "0.5451316", "0.5395392", "0.53797764", "0.5336209", "0.53299105", "0.52525187", "0.52183926", "0.5213556", "0.5203575", "0.5202486", "0.5201375", "0.5184062", "0.5175463", "0.5158342...
0.78806406
0
Drop any columns with missing in it name.
def drop_missing_columns(df_in): df = df_in.copy() [df.drop(c, axis=1, inplace=True) for c in df.columns if re.search('missing', c)] return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_unnamed(df: pd.DataFrame) -> pd.DataFrame:\r\n\r\n col_to_remove = [x for x in df.columns if 'unnamed' in x.lower()]\r\n df = df.drop(columns=col_to_remove)\r\n\r\n return df", "def drop_cols(gdf):\n\n for c in gdf.columns:\n if c.endswith('_y'):\n ...
[ "0.72103834", "0.7075042", "0.70617783", "0.69823843", "0.6963854", "0.69118106", "0.68624926", "0.6861576", "0.68356526", "0.68045664", "0.6763592", "0.668699", "0.668536", "0.6662131", "0.66610676", "0.6659255", "0.6607775", "0.65926975", "0.65538263", "0.6531017", "0.65045...
0.73000205
0
Load json file into a dictionary. Return None if file does not exist.
def json_file_to_dict(config_file: str) -> dict|None: if os.path.isfile(config_file): with open(config_file, 'r') as f: return json.load(f) else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_dict_from_json_file (file_name):\n with open(file_name, \"r\") as json_file:\n return json.load(json_file)", "def load(self, filename, encoding='utf-8') -> dict:\n if not os.path.exists(filename):\n return {}\n with self._lock:\n dictionary = json.load(open(filename, encoding=e...
[ "0.7961064", "0.79034984", "0.7761749", "0.77107084", "0.7697164", "0.76885104", "0.7636672", "0.76279813", "0.7627657", "0.7621927", "0.7611632", "0.7610844", "0.76072526", "0.76053274", "0.7585298", "0.75774705", "0.7559848", "0.75499547", "0.7549141", "0.7520426", "0.75194...
0.7497636
21
Returns original value if valid, fallback value if invalid
def replace_if_invalid(value: str, replacement: str, pattern: str|re.Pattern[str]) -> str: if re.match(pattern, value): return value else: return replacement
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_value(self):\n try:\n value = self.raw_value\n except (AttributeError, KeyError) as err:\n self._reraise_if_required(err)\n default_value = self.default_value\n if self.transform_default:\n return self.transform(default_value)\n ...
[ "0.63520795", "0.619192", "0.60704535", "0.59024525", "0.5863677", "0.58442134", "0.5801391", "0.5793518", "0.5774711", "0.5694128", "0.5686191", "0.56455153", "0.559687", "0.55881315", "0.55444646", "0.5542678", "0.5527103", "0.5443192", "0.54401857", "0.5424057", "0.5421526...
0.0
-1
Returns the mesh nodes.
def nodes(self): return self._nodes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_nodes(self):\n return self.nodes", "def get_nodes(self):\n return self.nodes", "def get_nodes(self) -> Iterable[Node]:\n return self.G.vs().indices", "def get_nodes(self):\n return self.node_list", "def get_nodes_objects(self):\n return [self._nodes[j] for j in ra...
[ "0.7621894", "0.7621894", "0.75966966", "0.7515777", "0.75052416", "0.7461498", "0.74436074", "0.73369837", "0.73262167", "0.7306971", "0.730024", "0.72638434", "0.726009", "0.72384346", "0.7228574", "0.7222945", "0.7188339", "0.7112122", "0.69780344", "0.69581664", "0.692274...
0.7387696
12
Checks whether all elements are positively oriented.
def check_element_orientations(self): ok = True for elem in self.elems: a,b,c = elem ax = self.nodes[a][0] ay = self.nodes[a][1] bx = self.nodes[b][0] by = self.nodes[b][1] cx = self.nodes[c][0] cy = self.nodes[c][1] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_orientations(self):\n bad_cells=[]\n for c in self.valid_cell_iter():\n node_xy=self.nodes['x'][self.cells['nodes'][c]]\n if robust_predicates.orientation(*node_xy) <= 0:\n bad_cells.append(c)\n return bad_cells", "def orientation(self) -> bool:...
[ "0.660677", "0.64873385", "0.6312321", "0.6107603", "0.601656", "0.59983826", "0.59498656", "0.585399", "0.5853987", "0.58494115", "0.5829214", "0.582874", "0.57847095", "0.5756986", "0.5750096", "0.571468", "0.5700084", "0.5686481", "0.56812656", "0.5677356", "0.56678027", ...
0.7783498
0
Return the corresponding name ID for the given name_string. If the name string is not present in the names list, add it.
def lookup(self, name_string): if not type(name_string) is str: raise TypeError("name has to be a string") if not (name_string in self.names): self.names.append(name_string) return self.names.index(name_string)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lookup(self, name_string):\n try:\n index = self.list.index(name_string)\n return index\n except ValueError:\n self.list.append(name_string)\n return len(self.list) - 1", "def id_from_name(detector, name):\n return [p.get_name() for p in detector].in...
[ "0.68467003", "0.6094386", "0.6060516", "0.59534806", "0.592859", "0.5924603", "0.584815", "0.58340836", "0.57514614", "0.56940484", "0.56170005", "0.5573158", "0.5554278", "0.55501854", "0.55053043", "0.5431895", "0.5411411", "0.5371831", "0.5366104", "0.53614503", "0.535440...
0.76176083
0
Take in a path and file name for a csv file and returns a pandas dataframe
def csv_to_data_frame(path_and_file_name): list_of_dictionaries = csv_to_list_of_dictionaries(path_and_file_name) dataframe = pandas.DataFrame(list_of_dictionaries) if dataframe is None: return None return dataframe
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def csv(file_path):\n return pd.read_csv(file_path)", "def load_file(path):\n return pd.read_csv(path)", "def read_csv(filename,\n parent_path='../data/',\n ):\n path_csv = pathlib.Path(parent_path) / filename\n assert path_csv.is_file()\n df = pd.read_csv(path_csv)\n ...
[ "0.8393939", "0.80855674", "0.8000421", "0.7973534", "0.79452515", "0.7929281", "0.7871354", "0.78706396", "0.7824636", "0.7701085", "0.7632224", "0.76312447", "0.76003885", "0.75528234", "0.7540872", "0.74931747", "0.7473346", "0.7463529", "0.74626255", "0.7412523", "0.73919...
0.7726321
9
Initialize attributes to describe a restaurant
def __init__(self, restaurant_name, cuisine_type): self.restaurant_name = restaurant_name self.cuisine_type = cuisine_type self.number_served = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__ (self, restaurant_name, cuisine_type):\n self.restaurant_name = restaurant_name\n self.cuisine_type = cuisine_type", "def __init__(self, restaurant_name, cuisine_type):\n self.restaurant_name = restaurant_name\n self.cuisine_type = cuisine_type\n self.restaurant_op...
[ "0.7931169", "0.78280073", "0.78212136", "0.7802042", "0.77200353", "0.77015656", "0.77015656", "0.77015656", "0.77015656", "0.77015656", "0.77015656", "0.77015656", "0.77015656", "0.7697793", "0.7693585", "0.7678999", "0.7677309", "0.76732713", "0.75891733", "0.75551087", "0...
0.7673725
20
Create a new Guest instance from a source URL.
def create_guest_url(self, source_url, expires_at=None, max_uses=-1, save=True): guest_url = GuestUrl( source_url=source_url, expires_at=expires_at, max_uses=max_uses ) if save: guest_url.save() return guest_url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_from_remote_url(cls, remote_url):\n raise NotImplementedError()", "def guest():\n return Guest()", "def create_remote(self, name, url, **kwargs):\r\n return Remote.create(self, name, url, **kwargs)", "def create_instance_url(self, *args):\n return urljoin(ENDPOINT, self.url...
[ "0.59095216", "0.56226337", "0.5524073", "0.5299005", "0.5298956", "0.5298956", "0.52039266", "0.5125707", "0.511311", "0.4987502", "0.49597377", "0.4955067", "0.4929418", "0.49064237", "0.48907167", "0.4884712", "0.48476702", "0.48147792", "0.48044828", "0.48044828", "0.4804...
0.7247331
0
Return True if we've gone past the expiry date.
def has_expired(self): return self.expires_at is not None and self.expires_at < now()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_expired(self):\n if self._expiry is not None:\n now = datetime.datetime.utcnow()\n expiry = self._expiry - datetime.timedelta(hours=6)\n return now >= expiry\n return False", "def expired(self):\n if date.today() >= self._expiry_date:\n retu...
[ "0.85711837", "0.8546006", "0.83577", "0.831234", "0.81119615", "0.8048252", "0.79445183", "0.7915051", "0.79111457", "0.7840419", "0.7838609", "0.7809305", "0.77907014", "0.7787982", "0.7748911", "0.76602936", "0.763728", "0.7613708", "0.76080585", "0.75304586", "0.7524542",...
0.83398616
3
Return True if we haven't exceeded max_uses and haven't expired.
def can_be_used(self): return self.is_valid and (self.has_expired is False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_expired(self, now, last_used, created_at):\r\n if ( self.max_idle <= 0\r\n or self.max_age <= 0\r\n or now - last_used > self.max_idle\r\n or now - created_at > self.max_age ):\r\n return True\r\n return False", "def _is_expired_by_max_reuse(se...
[ "0.80492854", "0.79128474", "0.7912713", "0.75679594", "0.7546503", "0.74708545", "0.7396418", "0.71906656", "0.717871", "0.71725494", "0.7166656", "0.71646035", "0.7127044", "0.707664", "0.703038", "0.70145935", "0.69748014", "0.6928969", "0.6906505", "0.6847894", "0.6837479...
0.77229166
3
Returns the new 'reverse'd URL. This uses get_absolute_url method and is only here as a standalone method to round the 'resolve' and 'reverse' methods to make it easier to use.
def reverse(self): return self.get_absolute_url()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_url(self):\n return reverse(self.url_name,\n args=self.get_url_args(),\n kwargs=self.get_url_kwargs(),\n urlconf=self.get_urlconf())", "def get_absolute_url(self):\n return reverse(self.url_name)", "def get_absolute_url(sel...
[ "0.753324", "0.74785376", "0.7168294", "0.6839032", "0.68302995", "0.6791235", "0.6751817", "0.6677164", "0.66531456", "0.6648495", "0.65984267", "0.65685695", "0.6509651", "0.64883506", "0.6469701", "0.64617705", "0.64264274", "0.64154416", "0.6403143", "0.63774604", "0.6322...
0.7156018
3
Updates the position of all cards.
def update_card_movement(self, dt): player_chars = [player.character_card for player in self.players] player_missions = [player.mission_card for player in self.players] for card in self.cards + player_chars + player_missions: if not self.anim: card.move_render_to(car...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self) -> None:\n self._data.update_cards()\n self._card = self._data.card(self._card[\"id\"], self._card)", "def set(self, *cards):\n self.empty()\n for cardname in cards:\n card = self.game[cardname].remove()\n card.location = self.name\n s...
[ "0.6733775", "0.6691017", "0.646016", "0.64417344", "0.642708", "0.6409936", "0.6340818", "0.6299433", "0.6299225", "0.6248016", "0.62291044", "0.6222174", "0.618771", "0.6166566", "0.6123464", "0.6111499", "0.6101914", "0.60829514", "0.60713816", "0.59860533", "0.59789646", ...
0.6680098
2
Returns the entropy H(x) where x is given by the list of columns xcols in the dataframe df.
def ent(df, xcols, verbose=False): if len(xcols) == 0 or xcols is None: return 0.0 sample_size = len(df.index) df1 = df.copy() df1 = df1.groupby(xcols)[xcols].size() df1 = df1.apply(lambda x: x/sample_size) local_ent = -df1*np.log(df1 + 1E-7) all_ent =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entropy(data):\n\ttry:\n\t\tcols = data.shape[1]\n\texcept IndexError:\n\t\tcols = 1\n\n\t#bins = np.amax(data,axis=0)\n\tbins = unique_bins(data)\n\n\tif cols == 1:\n\t\thist,_ = np.histogramdd(data, bins=(bins)) # frequency counts\n\t\tPx = hist/hist.sum()\n\t\tH = -1 * np.sum( Px * np.log( Px ) )\n\n\telif ...
[ "0.6784569", "0.66552275", "0.6534377", "0.62642086", "0.5988562", "0.5982953", "0.5970085", "0.59694415", "0.59674084", "0.5951995", "0.58819956", "0.5864935", "0.58023536", "0.5768003", "0.5767989", "0.5726589", "0.57265794", "0.5705605", "0.5695891", "0.56889546", "0.56854...
0.6343199
3
return a list of days from parsed json
def create_days_list(parsed_json): days = [] for period in parsed_json['forecast']['txt_forecast']['forecastday']: days.append(str(period['title'])) return days
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_weather_list(parsed_json):\n weather = []\n for period in parsed_json['forecast']['txt_forecast']['forecastday']:\n weather.append(str(period['fcttext']))\n return weather", "def _someday(self, data) -> list:\n if data is None or data is SENTINEL:\n return []\n\n ...
[ "0.66351926", "0.6435628", "0.62031627", "0.6107881", "0.6033793", "0.5904607", "0.58862287", "0.58630645", "0.58361113", "0.58099455", "0.57135975", "0.5701068", "0.57000625", "0.5693245", "0.56929547", "0.5660463", "0.5652051", "0.5651776", "0.56223446", "0.5618347", "0.561...
0.7978802
0
Returns the symmetric key shared between you and Alice.
def get_symmetric_key_from_alice(self): return self.key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeSharedKey(self):\n\t\t\n\t\tif not self.pool:\n\t\t\tself.fillPool()\n\n\t\twhile 1:\n\t\t\tself.pool.stir()\n\t\t\trandomkey = self.pool.get_bytes(40)\n\t\t\t# First 256 bits are for the session key\n\t\t\tsessionkey = randomkey[:32]\n\t\t\t# Last 64 bits are for the CBC initial value.\n\t\t\tinitialvalue...
[ "0.6729515", "0.6697322", "0.664055", "0.649025", "0.63905466", "0.6324145", "0.62880284", "0.6270747", "0.60489595", "0.6008841", "0.5986159", "0.5976789", "0.5935646", "0.5902603", "0.5826271", "0.5768911", "0.57591635", "0.5729744", "0.56861377", "0.56638217", "0.5661063",...
0.82000333
0
Should return a 404 not found for add new invoice a not exists sale
def test_not_found_sale_for_add_invoice(self): client = Client() url = reverse_lazy('invoice_to_sale', kwargs={'sale_id': 1000}) response = client.get(url) self.assertEqual(response.status_code, 404)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_add_sale_for_add_invoice(self):\n sale = SaleFactory()\n client = Client()\n url = reverse_lazy('invoice_to_sale', kwargs={'sale_id': sale.id})\n response = client.get(url)\n self.assertEqual(response.status_code, 200)\n self.assertEqual(response.context['sale'], ...
[ "0.77588284", "0.7545007", "0.75219965", "0.7360377", "0.6951844", "0.67369705", "0.6504168", "0.6165318", "0.61480415", "0.60964274", "0.60870093", "0.6064467", "0.60632175", "0.6038377", "0.6015304", "0.6014623", "0.59898716", "0.5971821", "0.5971638", "0.5937767", "0.59370...
0.8678706
0
Should return a 404 not found for not PK for Invoice
def test_not_found_invoice_edit(self): client = Client() url = reverse_lazy('invoice_edit', kwargs={'pk': 9669}) response = client.get(url) self.assertEqual(response.status_code, 404)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_not_found_invoice(self):\n client = Client()\n url = reverse_lazy('invoice', kwargs={'pk': 9669})\n response = client.get(url)\n self.assertEqual(response.status_code, 404)", "def test_not_found_invoice_200(self):\n\n invoice = InvoiceFactory(total_value=1500)\n ...
[ "0.80542016", "0.7678763", "0.76442635", "0.71621406", "0.6256996", "0.6255096", "0.6213517", "0.6206418", "0.6104119", "0.60918725", "0.60803944", "0.60769767", "0.60572505", "0.6047262", "0.60444117", "0.6008123", "0.6008123", "0.598541", "0.59646565", "0.5961588", "0.59614...
0.7738098
1
Convert cat value into num between 0 and 1.
def get_val(self, x): interval, mean, std = self.probability_map[x] new_val = norm.rvs(mean, std) return new_val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def natural(c):\n return numerize(c)", "def category_to_numeric(labels):\n labels = np.array(labels)\n if np.issubdtype(labels.dtype, np.integer):\n return labels\n else:\n cats = np.unique(labels)\n map_ = dict(zip(cats, np.arange(cats.shape[0])))\n return np.array([map_[...
[ "0.60891193", "0.57284576", "0.5721369", "0.569885", "0.56737334", "0.5663188", "0.56327516", "0.55742687", "0.55742687", "0.5556405", "0.5527778", "0.55164737", "0.5500643", "0.54848254", "0.54847234", "0.54691064", "0.5461143", "0.5460251", "0.54514295", "0.5402906", "0.538...
0.0
-1
Render the background box and text overlay.
def renderDescription(text, image, font, font_size=24): draw = ImageDraw.Draw(image, 'RGBA') desc_font = ImageFont.truetype(font=font, size=font_size) description = reflowText(text, image.width, desc_font) desc_xy = (image.width//2, image.height-10) desc_bbox = draw.textbbox(desc_xy, description, a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_overlay(self):\n pass", "def render(self) -> None:\n surface = pygame.Surface(self.rect.size)\n\n # Background and border\n pygame.draw.rect(surface, self.color, pygame.Rect(1, 1, self.rect.width - 2, self.rect.height - 2), 0)\n pygame.draw.rect(surface, self.bordercol...
[ "0.6819329", "0.66289616", "0.6506876", "0.64756024", "0.6471717", "0.6372436", "0.62759715", "0.6259512", "0.6237254", "0.62032235", "0.6111349", "0.6045874", "0.6045712", "0.6013147", "0.59286356", "0.5887308", "0.58524275", "0.58524275", "0.58510655", "0.5838273", "0.58135...
0.0
-1
Return the value (in seconds) of a monotonic clock. The return value of consecutive calls is guaranteed to be greater or equal then the results of previous calls. The initial value may not be defined. Don't depend on it.
def time(self): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def monotonic():\n if clock_gettime(CLOCK_MONOTONIC, ctypes.pointer(ts)):\n errno = ctypes.get_errno()\n raise OSError(errno, os.strerror(errno))\n return ts.tv_sec + ts.tv_nsec / 1.0e9", "def monotonic_time():\n t = timespec()\n if _clock...
[ "0.7810723", "0.7571057", "0.70680666", "0.700277", "0.69053626", "0.68600893", "0.6701152", "0.6656102", "0.63495374", "0.6280794", "0.6264554", "0.6192803", "0.6179583", "0.61535007", "0.61392015", "0.6089433", "0.6043802", "0.60433334", "0.60401446", "0.59741604", "0.59706...
0.0
-1
Create various features columns related to requests and time.
def create_time_req_features(df_casted): time_df = (df_casted .withColumn('prev_timestamp', lag(df_casted['timestamp']).over(Window.partitionBy("ip").orderBy("timestamp"))) .withColumn('time_diff', analysis.get_time_delta(col("prev_timestamp"), col("timestamp"))) .withCo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_datetime_features(df, time_col):\n\n # applying date-related functions:\n\n # day-level attributes:\n df = df.withColumn(\"day_of_week\", F.dayofweek(F.col(time_col)))\n\n df = df.withColumn(\"day_of_month\", F.dayofmonth(F.col(time_col)))\n\n df = df.withColumn(\"day_of_year\", F.dayofyear(...
[ "0.6614965", "0.6520411", "0.64838356", "0.6407246", "0.6160174", "0.6037378", "0.6037232", "0.59884465", "0.5950516", "0.588289", "0.5881691", "0.5861627", "0.5802705", "0.5790527", "0.57827216", "0.5769192", "0.57530296", "0.5739001", "0.5714844", "0.5707257", "0.56927747",...
0.6732352
0
fills edge object with data from dump. works only if self.graph is filled with vertices which are reconstructed from the dump;
def fillEdgeFromDumpingData(self,data): self.logger.log('Filling edge data from dump...') start=time.time() self.id=data['id'] try: for vertex in self.graph.vertices: if vertex.id==data['way'].split()[0]: if not self.setInitial(vertex): self.logger.log('Setting vertex('+vertex.id+') initial fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fillVertexFromDumpingData(self,data):\n\t\tself.logger.log('Filling vertex data from dump...')\n\t\tstart=time.time()\n\t\ttry:\n\t\t\tself.name=data['name']\n\t\t\tself.id=data['id']\n\t\t\tself.vType=data['vType']\n\t\t\tself.subVtype=data['subVtype']\n\t\texcept:\n\t\t\tself.logger.log('Vertex filling has f...
[ "0.63603735", "0.62149763", "0.6214264", "0.6201529", "0.61984634", "0.5994323", "0.5972304", "0.5961785", "0.5937157", "0.5867883", "0.5791647", "0.57541054", "0.5661943", "0.5553113", "0.55057913", "0.5502215", "0.54643065", "0.546304", "0.54113555", "0.5409507", "0.5358587...
0.78349173
0
Return a class instantied from a dictionary of attributes.
def create(cls, **dictionary): if dictionary and dictionary != {}: if cls.__name__ == "Rectangle": new = cls(1, 1) else: new = cls(1) new.update(**dictionary) return new
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, cls_dict):\n cls = cls_dict.pop(\"cls\", None)\n return cls(**cls_dict)", "def from_dict(cls, cls_dict):\n cls_str = cls_dict.pop(\"cls\", None)\n return cls(**cls_dict)", "def from_dict(cls, dict_):\n obj = cls.__new__(cls)\n obj.__dict__.update(dic...
[ "0.7096084", "0.7020194", "0.6995787", "0.67710114", "0.67710114", "0.66558856", "0.6553085", "0.6457017", "0.6361495", "0.6353387", "0.63422185", "0.6317289", "0.6317289", "0.6317289", "0.63058114", "0.63058114", "0.63058114", "0.63058114", "0.63058114", "0.63058114", "0.630...
0.0
-1
Handles empty line as input, do nothing, get them foodstamps
def emptyline(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def emptyline(self):\n return None # do not repeat the last nonempty command entered", "def emptyline(self):\r\n pass", "def handle_empty_line(self, line):\n if self.comment_lines and self.allow_blank_lines:\n self.trailing_empty_lines.append(line)\n else:\n ...
[ "0.68861395", "0.6838", "0.67956865", "0.628862", "0.6233497", "0.61565936", "0.6133826", "0.60876244", "0.60876244", "0.6051545", "0.6024864", "0.599822", "0.58808196", "0.57850575", "0.5755294", "0.5728656", "0.5719158", "0.5704752", "0.56850886", "0.56779534", "0.5674284",...
0.6809768
9
Initialize a new class with a dictionary
def __init__(self, data, filename=...) -> None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dict_):\n obj = cls.__new__(cls)\n obj.__dict__.update(dict_)\n return obj", "def create(cls, dictionary):\n return cls(**dictionary)", "def create(cls, dictionary):\n return cls(**dictionary)", "def create_from_dict(cls, dic):\n bar = cls()\n ...
[ "0.8149248", "0.797227", "0.797227", "0.7917717", "0.7766822", "0.76943153", "0.76943153", "0.76943153", "0.76943153", "0.76943153", "0.76943153", "0.76943153", "0.76943153", "0.76943153", "0.76943153", "0.76943153", "0.76943153", "0.76943153", "0.76943153", "0.76943153", "0....
0.0
-1
Convert a quaternion into euler angles (roll, pitch, yaw) roll is rotation around x in radians (counterclockwise) pitch is rotation around y in radians (counterclockwise) yaw is rotation around z in radians (counterclockwise)
def euler_from_quaternion(x, y, z, w): t0 = +2.0 * (w * x + y * z) t1 = +1.0 - 2.0 * (x * x + y * y) roll_x = math.atan2(t0, t1) t2 = +2.0 * (w * y - z * x) t2 = +1.0 if t2 > +1.0 else t2 t2 = -1.0 if t2 < -1.0 else t2 pitch_y = math.asin(t2) t3 = +2.0 * (w * z + x * y) t4 = +1.0 -...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def euler_from_quaternion(self, quaternion):\n x = quaternion.x\n y = quaternion.y\n z = quaternion.z\n w = quaternion.w\n\n sinr_cosp = 2 * (w * x + y * z)\n cosr_cosp = 1 - 2 * (x * x + y * y)\n roll = np.arctan2(sinr_cosp, cosr_cosp)\n\n sinp = 2 * (w * y ...
[ "0.86578", "0.84732616", "0.844043", "0.8292638", "0.8292638", "0.8248075", "0.81753314", "0.8088709", "0.7940486", "0.7854334", "0.78395313", "0.78395313", "0.781616", "0.7770918", "0.76351327", "0.7615809", "0.7570064", "0.7549317", "0.7549317", "0.75263387", "0.7501823", ...
0.8320276
4
Initialize KITData object based on the input that is passed.
def __init__(self, dataInput=None, measurement="probe", credentials='db.cfg', show_input=None, new_db=True): self.log = logging.getLogger(__class__.__name__) self.log.setLevel(logging.DEBUG) if self.log.hasHandlers() is False: format_string = '%(asctime)s - %(levelna...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__, *,\n key_data: pulumi.Input[str]):\n pulumi.set(__self__, \"key_data\", key_data)", "def __init__(self, data: Dict[str, Any] = {}) -> None:\n super().__init__()\n self.last_batch = data.get(\"last_batch\", None) # One of \"rollover\", \"discard\"\n ...
[ "0.68539613", "0.6532535", "0.6475744", "0.63647175", "0.62228", "0.62083536", "0.6168286", "0.61200505", "0.6094761", "0.60697585", "0.6058212", "0.6042245", "0.60406697", "0.60314876", "0.60236704", "0.6023369", "0.6008045", "0.5996172", "0.5971497", "0.5949178", "0.5937981...
0.0
-1
Set new or initialize y values of data file
def setY(self, inputArray=None): if inputArray is not None: try: self.__y = inputArray return True except: self.log.info("Cannot set y: wrong format") return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def y(self, value):\n self._data[1] = value", "def y(self, value):\n self[0]= value", "def sety(self, value):\n self.y = value", "def sety(self, value):\n self.y = value", "def sety(self, value):\n self.y = value", "def _set_y(self, value):\n self.raiseNotImpleme...
[ "0.7002282", "0.6800817", "0.662703", "0.662703", "0.662703", "0.6612066", "0.64992774", "0.64837563", "0.64837563", "0.6393605", "0.6319265", "0.6319265", "0.6269695", "0.6255012", "0.62492466", "0.6205555", "0.6181665", "0.6165519", "0.612605", "0.6105438", "0.60745806", ...
0.59024125
27
Return the JSON string representation of list_dictionaries
def to_json_string(list_dictionaries): if list_dictionaries is None or len(list_dictionaries) == 0: return json.dumps([]) return json.dumps(list_dictionaries)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_json_string(list_dictionaries):\n if list_dictionaries is None:\n list_dictionaries = []\n return json.dumps(list_dictionaries)", "def to_json_string(list_dictionaries):\n\n if list_dictionaries is None:\n list_dictionaries = []\n\n return json.dumps(list_...
[ "0.8469158", "0.84262764", "0.8397411", "0.8395152", "0.83701897", "0.8341249", "0.8340744", "0.83363175", "0.8329113", "0.83056706", "0.8305558", "0.82964057", "0.8283968", "0.8267261", "0.8261266", "0.8261266", "0.8261266", "0.8246613", "0.8246613", "0.82420915", "0.8242091...
0.8252629
17
Check if the timestamp of a packet falls within the duration of a flow's life.
def _check_timestamp(self, pkt_ts, flow_start, flow_stop): dt_ts = datetime.fromtimestamp(pkt_ts) dt_start = datetime.strptime(flow_start, "%Y-%m-%dT%H:%M:%S") dt_stop = datetime.strptime(flow_stop, "%Y-%m-%dT%H:%M:%S") return dt_start <= dt_ts <= dt_stop
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkTime(self):\n now = time()\n if self.duration > (now - self.startTime):\n return True\n else:\n return False", "def valid_timestamp(self, time):\n if time - 5 < self.chain[-1].get('timestamp'):\n return False\n else:\n return...
[ "0.70556337", "0.67931944", "0.66525805", "0.660958", "0.64153945", "0.6327726", "0.6327726", "0.6291249", "0.6279569", "0.6261771", "0.6243439", "0.6176699", "0.6176699", "0.6131408", "0.61232656", "0.61135274", "0.6043214", "0.60361665", "0.5983461", "0.5976984", "0.5940963...
0.7200292
0
set level and reset logger
def set_level(self, level: int): self._init(level)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setLevel(lvl):\n logger.setLevel(lvl)", "def set_logger_level(self, level):\r\n self._level = level\r\n self._root_logger.setLevel(levels[level])", "def setLevel(self, level):\n self.level = logging._checkLevel(level)\n _accquire_lock()\n # The same logic as `logging.M...
[ "0.8016489", "0.78525656", "0.78257", "0.7806045", "0.7766164", "0.7692268", "0.75301445", "0.7481824", "0.74732614", "0.7472137", "0.73433846", "0.7279328", "0.7216572", "0.7195802", "0.7173502", "0.71660835", "0.7122183", "0.71206164", "0.70892924", "0.70653516", "0.7063750...
0.662877
42
Compute Adapted Rand error as defined by the SNEMI3D contest [1] Formula is given as 1 the maximal Fscore of the Rand index (excluding the zero component of the original labels). Adapted from the SNEMI3D MATLAB script, hence the strange style.
def adapted_rand(gt, seg, all_stats=False): # segA is truth, segB is query segA = np.ravel(gt) segB = np.ravel(seg) n = segA.size n_labels_A = np.amax(segA) + 1 n_labels_B = np.amax(segB) + 1 ones_data = np.ones(n) p_ij = sparse.csr_matrix((ones_data, (segA[:], segB[:])), shape=(n_lab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _E(i: int, r: int) -> float:\n # if r = 0, then we're out of samples and has a constant value of 0 \n return 0 if r == 0 else capped(rv[i], pmf[i], _E(i, r - 1))", "def bias_error(self, dddx):\n return -self.dt**3 * dddx / (2*self.k)", "def ssq_error(correct, estimate):\n if np.sum(estimate...
[ "0.5699269", "0.5497995", "0.54712796", "0.5330585", "0.5296669", "0.5283878", "0.52662706", "0.5262791", "0.52426493", "0.52269757", "0.52109236", "0.5210482", "0.51980793", "0.5188959", "0.5182153", "0.5166581", "0.51658404", "0.51615953", "0.51565266", "0.5139107", "0.5121...
0.0
-1
Yield successive nsized chunks from l.
def chunks(l, n): for i in range(0, len(l), n): yield l[i:i + n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i+n]", "def _chunks(self, l, n):\n for i in xrange(0, len(l), n):\n yield l[i:i+n]", "def chunk(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def chunks(l, n):\n ...
[ "0.80763406", "0.79780173", "0.7848591", "0.7818154", "0.7764843", "0.7764843", "0.7740603", "0.76803994", "0.7677509", "0.7673566", "0.765864", "0.7655856", "0.7655856", "0.7655856", "0.76458347", "0.7615106", "0.75838816", "0.7557435", "0.7549177", "0.7549177", "0.7549177",...
0.7448925
63
Create a Table from any supported data, heuristically selecting how to represent the data in Table format.
def from_data(cls, data, headers=_MISSING, max_depth=1, _data_type=None): # TODO: seen/cycle detection/reuse ? # maxdepth follows the same behavior as find command # i.e., it doesn't work if max_depth=0 is passed in if max_depth < 1: return cls(headers=headers) # return data...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_tables_from_json(columns: List, data: List) -> Type[BeautifulTable]:\n table = BeautifulTable()\n table.column_headers = columns\n\n for entry in data:\n row = []\n for column in columns:\n value = entry[column]\n row.append(value)\n table.append_row(ro...
[ "0.68220115", "0.6713891", "0.6642296", "0.66416943", "0.6620802", "0.65922195", "0.65691674", "0.64691055", "0.64550304", "0.6423783", "0.6420696", "0.635933", "0.6327926", "0.6324111", "0.6290074", "0.62747097", "0.6234433", "0.6217252", "0.6181285", "0.61763215", "0.616614...
0.61730796
20
>>> _isnumber("123.45") True >>> _isnumber("123") True >>> _isnumber("spam") False
def _isnumber(string): return _isconvertible(float, string)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_number(s):\n try: float(s) \n except ValueError: return False\n return True", "def is_number(string):\n\n try:\n float(string)\n is_num = True\n except ValueError:\n is_num = False\n\n return is_num", "def is_number(s):\n try:\n float(s)\n return T...
[ "0.8744721", "0.87370545", "0.866232", "0.866232", "0.866232", "0.866232", "0.866232", "0.866232", "0.866232", "0.8643263", "0.8609603", "0.8481344", "0.8409965", "0.8401621", "0.8382315", "0.8377412", "0.83528847", "0.8313767", "0.83065283", "0.8304971", "0.8195068", "0.81...
0.88076323
1
Symbols after a decimal point, 1 if the string lacks the decimal point. >>> _afterpoint("123.45") 2 >>> _afterpoint("1001") 1 >>> _afterpoint("eggs") 1 >>> _afterpoint("123e45") 2
def _afterpoint(string): if _isnumber(string): if _isint(string): return -1 else: pos = string.rfind(".") pos = string.lower().rfind("e") if pos < 0 else pos if pos >= 0: return len(string) - pos - 1 else: re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def suffix_after(string, split_at):\n return string.split(split_at, 1)[-1]", "def _alphan(string):\n ind = 0\n while string[ind].isdigit() or string[ind] == \".\":\n ind+=1\n pass\n if ind == 0:\n numeric = 1\n pass\n else:\n numeric = string[0:ind]\n pass...
[ "0.57200813", "0.55671334", "0.52926004", "0.5222818", "0.5174006", "0.51285005", "0.51023483", "0.50967544", "0.50527465", "0.4941395", "0.49216342", "0.48984933", "0.4835174", "0.48259348", "0.4777291", "0.4777291", "0.47535923", "0.4753381", "0.4738787", "0.47325385", "0.4...
0.76308984
1
Flush right. >>> _padleft(6, '\u044f\u0439\u0446\u0430') == ' \u044f\u0439\u0446\u0430' True
def _padleft(width, s, has_invisible=True): iwidth = width + len(s) - len(_strip_invisible(s)) if has_invisible else width fmt = "{0:>%ds}" % iwidth return fmt.format(s)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __pad_left(self, txt, length):\n\n s = []\n\n if len(txt) < length:\n diff = length - len(txt) - 1\n [s.append(\" \") for i in xrange(0, diff)]\n s.append(''.join(txt) + \" \")\n elif len(txt) == length:\n s.append(txt)\n\n return ''.join(...
[ "0.68867517", "0.6839038", "0.6656666", "0.6491947", "0.6478792", "0.6478792", "0.6430834", "0.6411684", "0.6320064", "0.6305904", "0.62487775", "0.62487775", "0.619303", "0.6192278", "0.61880195", "0.6161723", "0.6102014", "0.5982634", "0.5976396", "0.5963962", "0.59625864",...
0.6668603
2
Flush left. >>> _padright(6, '\u044f\u0439\u0446\u0430') == '\u044f\u0439\u0446\u0430 ' True
def _padright(width, s, has_invisible=True): iwidth = width + len(s) - len(_strip_invisible(s)) if has_invisible else width fmt = "{0:<%ds}" % iwidth return fmt.format(s)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _padright(width, s, has_invisible=True):\n iwidth = width + len(s) - len(_strip_invisible(s)\n ) if has_invisible else width\n fmt = \"{0:<%ds}\" % iwidth\n return fmt.format(s)", "def utf8_rpad(self, width: int, padding: str = ' ') -> 'StringColumn':\n return...
[ "0.673961", "0.6534682", "0.6486043", "0.63556725", "0.63556725", "0.62423015", "0.62298095", "0.6139131", "0.61131066", "0.60507154", "0.60352796", "0.5995653", "0.593525", "0.593525", "0.59305036", "0.5926339", "0.59155935", "0.5888487", "0.58832103", "0.5876786", "0.586961...
0.6740315
0
Center string. >>> _padboth(6, '\u044f\u0439\u0446\u0430') == ' \u044f\u0439\u0446\u0430 ' True
def _padboth(width, s, has_invisible=True): iwidth = width + len(s) - len(_strip_invisible(s)) if has_invisible else width fmt = "{0:^%ds}" % iwidth return fmt.format(s)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _padboth(width, s, has_invisible=True):\n iwidth = width + len(s) - len(_strip_invisible(s)\n ) if has_invisible else width\n fmt = \"{0:^%ds}\" % iwidth\n return fmt.format(s)", "def padtext(text):\n if len(text) % 16 != 0:\n return text.ljust((len(text) /...
[ "0.66906434", "0.6683492", "0.64752674", "0.63891834", "0.6292243", "0.6172393", "0.6127709", "0.6096495", "0.60658854", "0.60244274", "0.5991765", "0.5974689", "0.5967894", "0.5951032", "0.5945889", "0.59389424", "0.59209645", "0.59108865", "0.586697", "0.5863464", "0.581432...
0.67065585
0
Returns the Euclidean distance between `a` and `b`.
def euclid(a, b): return np.linalg.norm(np.array(a, dtype=float) - np.array(b, dtype=float))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def euclidean_distance(a, b):\n return math.sqrt((a.x - b.x) ** 2 + (a.y - b.y) ** 2)", "def euclidean(a, b):\n return math.sqrt((a[0]-b[0])**2+(a[1]-b[1])**2)", "def dist_euclidean(self, a, b):\n diff = self.get_difference(a, b)\n if self._weights is None:\n return sqrt(sum([val...
[ "0.8878597", "0.837013", "0.8288524", "0.8260412", "0.8212229", "0.820581", "0.8187939", "0.8148303", "0.81223845", "0.8121173", "0.8094293", "0.809021", "0.80076176", "0.7999038", "0.79396725", "0.7936344", "0.78908175", "0.7868626", "0.7849543", "0.78069746", "0.779948", ...
0.7871231
17
Stacks up variable length series into a fauxjagged (masked) array.
def jagged_mask(data): h_size = max(len(trace) for trace in data) # stack up data, mask off non-existant values (np can't do jagged arrays) dstack = np.ma.masked_all((len(data), h_size)) for i, trace in enumerate(data): len_trace = len(trace) dstack[i, 0:len_trace] = trace return ds...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _embedseries(self):\n\n ts = self.ts\n k = self.window\n n = self._n_ts\n\n x = np.zeros(shape=(n, k))\n\n for i in range(k):\n x[:n-i, i] = ts[i:]\n\n return np.matrix(x)", "def compressed(series):\n if series._mask is nomask:\n return series\n ...
[ "0.60559916", "0.60448635", "0.5853757", "0.58256125", "0.58090544", "0.57761335", "0.5769817", "0.57544184", "0.5703236", "0.5659715", "0.5508132", "0.5493298", "0.54792106", "0.54549575", "0.5421378", "0.54098463", "0.5397593", "0.53858656", "0.5381348", "0.53791916", "0.53...
0.6334038
0
This view will return the Contact Us template and render the form
def contact(request): if request.method == 'POST': form = ContactUsForm(request.POST) if form.is_valid(): full_name = form.cleaned_data['full_name'] user_email = form.cleaned_data['email'] message = form.cleaned_data['message'] try: sen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contact_us():\n return render_template(\"contact_us.html\")", "def contact(request):\n\n contact_form = ContactForm()\n\n return render(request, \"contact_us.html\", {'contact_form': contact_form,\n \"emjs_id\":\n ...
[ "0.83475405", "0.8074074", "0.8006926", "0.78996646", "0.78374994", "0.780365", "0.77561426", "0.7737157", "0.7710683", "0.76671845", "0.7633127", "0.7614618", "0.7614618", "0.7582892", "0.75759184", "0.75759184", "0.7563894", "0.7563894", "0.7563894", "0.7563894", "0.7563894...
0.72616667
52
3x3 convolution with padding
def conv3x3(in_planes, out_planes, stride=1): return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conv3x3(in_planes, out_planes, stride=1, padding=1, groups=1, dilation=1, zero_init=False):\n conv = nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=padding, groups=groups, bias=False, dilation=dilation)\n if zero_init:\n conv.weight.data.zero_()\n return conv", "def co...
[ "0.73706514", "0.7335249", "0.7216377", "0.72037584", "0.72037584", "0.7199952", "0.7192902", "0.7183875", "0.7178802", "0.7172082", "0.71645725", "0.71645725", "0.716185", "0.7156602", "0.7156602", "0.7156602", "0.7156602", "0.7156602", "0.7156602", "0.7156602", "0.7156602",...
0.7081058
66
Checks that all the mentioned coords share the same dimensions as the x and y coords
def _check_coords_are_horizontal(self, cube: Cube, coords: List[str]) -> None: y_coord, x_coord = (cube.coord(axis=n) for n in "yx") horizontal_dims = set([cube.coord_dims(n)[0] for n in [y_coord, x_coord]]) for coord in coords: try: coord_dims = set(cube.coord_dims(c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _has_valid_coords(self, coords: CoordinatePair) -> bool:\n return (\n 0 <= coords.x_ul < self.dimensions[0]\n and 0 <= coords.x_br < self.dimensions[0]\n and 0 <= coords.y_ul < self.dimensions[1]\n and 0 <= coords.y_br < self.dimensions[1]\n )", "def ...
[ "0.72760177", "0.6966484", "0.6895471", "0.68190336", "0.67914414", "0.67577904", "0.67244333", "0.6719408", "0.6656194", "0.66095495", "0.6541661", "0.64792365", "0.64762753", "0.6453851", "0.6451579", "0.64392006", "0.6418091", "0.6395117", "0.6377273", "0.6370906", "0.6366...
0.6171693
34
This function converts integer label data to onehot encoded matrix.
def int_to_onehot(input, total_class): # check asserts assert isinstance(total_class, int), '"total_class" should be positive integer, number of classes.' n_input = len(input) result = np.zeros((n_input, total_class)).astype('int32') # create output result[np.arange(n_input), input] = 1 # set 1 fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_one_hot(labels):\n numbers = np.max(labels) + 1\n return np.eye(numbers)[labels]", "def label_to_one_hot(y, num_label): \n num_labels = y.shape[0] \n index_offset = np.arange(num_labels) * num_label \n labels_one_hot = np.zeros((num_labels, num_label)) \n label...
[ "0.81251246", "0.80933666", "0.80774295", "0.8024988", "0.7957081", "0.7938463", "0.7886545", "0.7855152", "0.7850405", "0.78238326", "0.77842385", "0.7723324", "0.7647822", "0.7639187", "0.7634092", "0.75863445", "0.75807166", "0.757481", "0.7563738", "0.7551289", "0.7546354...
0.79375285
6
Cleans html, new lines, and quotation marks from text
def clean_text(raw_html): clean_reg = re.compile('<.*?>') text = re.sub(clean_reg, '', raw_html) text = text.replace('\n', ' ') text = text.replace('\"', "\'") print(text) return text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_text(text):\r\n if not isinstance(text, six.string_types):\r\n return text\r\n text = remove_tags(text)\r\n text = replace_entities(text)\r\n # Normalize whitespace\r\n text = re.sub(r'(\\s)+', '\\\\1', text)\r\n # Strip whitespace\r\n return text.strip()", "def _clean_text(...
[ "0.78808564", "0.7777358", "0.774169", "0.76918066", "0.7616354", "0.7540624", "0.7530591", "0.7525859", "0.75006425", "0.74729466", "0.7383225", "0.7350046", "0.73045856", "0.7268507", "0.7244231", "0.72331035", "0.7193427", "0.7176014", "0.71682507", "0.71652025", "0.706962...
0.8008661
0
Return the about page
def about(): return render_template('about_page/about.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about():\n about_template = templates_lookup.get_template('about.html')\n return about_template.render(active_page='about')", "def about():\n return render_template(\"about.html\")", "def about(request):\n\treturn render_to_response('aboutus.html')", "def about():\n\n return render_templa...
[ "0.8567094", "0.8495438", "0.83890504", "0.8385712", "0.83490294", "0.8337607", "0.83352387", "0.83352387", "0.8333053", "0.8330056", "0.8330056", "0.8318664", "0.83132344", "0.83132344", "0.83132344", "0.83132344", "0.83132344", "0.83132344", "0.83132344", "0.83132344", "0.8...
0.8423772
2
r""" Check execution envirionment. OS, Processor, CUDA version, Pytorch version, ... etc.
def _check_environment(use_cuda: bool, logger) -> int: check_backends() cuda = use_cuda and torch.cuda.is_available() device = torch.device('cuda' if cuda else 'cpu') logger.info(f"Operating System : {platform.system()} {platform.release()}") logger.info(f"Processor : {platform.processor()}") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_environment(configs: DictConfig, logger) -> int:\n logger.info(f\"Operating System : {platform.system()} {platform.release()}\")\n logger.info(f\"Processor : {platform.processor()}\")\n\n num_devices = torch.cuda.device_count()\n\n if configs.use_cuda == 'cuda':\n for idx in range(torc...
[ "0.72766453", "0.68898463", "0.6664264", "0.6596723", "0.64993155", "0.644562", "0.6405568", "0.6377336", "0.63436455", "0.6340097", "0.63314915", "0.6316348", "0.63121605", "0.63015085", "0.62118363", "0.6134754", "0.6132019", "0.60742694", "0.60324466", "0.60287493", "0.600...
0.7623044
0
Get the number of errors in validation result.
def get_number_of_errors(result, output_format): if output_format == 'json': result = json.loads(result) return len(result[0]['errors']) if output_format == 'json2': result = json.loads(result) return sum((len(error['errors']) for error in result[0]['errors'])) if output_form...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def errors(self) -> int:\n return self._errors", "def total_errors(self) -> int:\n result: int = 0\n for test in self._tests:\n result += test.errors\n return result", "def error_count(self) -> str:\n return pulumi.get(self, \"error_count\")", "def error_count(se...
[ "0.796684", "0.7467753", "0.74216485", "0.7403364", "0.73526", "0.73442036", "0.73349535", "0.7252101", "0.71834165", "0.7083078", "0.70751995", "0.70700294", "0.7060042", "0.70284534", "0.6954525", "0.68037075", "0.677247", "0.6751505", "0.6717705", "0.6717705", "0.6717705",...
0.7161061
9
Get language of the document.
def get_language(base_url, document, timeout=None, ssl_context=None): url = base_url + '/rest/document/language' data = {'document': document} data = urllib.parse.urlencode(data).encode('utf8') headers = sabacan.utils.make_headers(user_agent) request = urllib.request.Request(url, data, headers) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_language(self):\n return self._lang", "def getLanguage(self):\n return globalref.lang", "def get_language(self):\n return self.language", "def get_language(self):\n return self._language", "def getLanguage(self):\n return self._language", "def GetLanguage(self):...
[ "0.81012565", "0.8031399", "0.8017338", "0.7993736", "0.78760463", "0.78645855", "0.7825924", "0.7825924", "0.77788293", "0.76989746", "0.76989746", "0.76763076", "0.7655272", "0.7648168", "0.7573435", "0.7538184", "0.75038004", "0.74868804", "0.7476745", "0.74501026", "0.745...
0.6434979
64
Get the weekday for an integer, assuming 0 is Monday
def _get_weekday(num: int) -> int: day_list = [0, 1, 2, 3, 4, 5, 6] return day_list[num % 7]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weekday(d):\n return (d + 2) % 7", "def weekday_num() -> int:\n weekday_num = date.today().isocalendar()[2]\n return weekday_num", "def get_weekdigit():\n return date.today().weekday()", "def weekday(self):\n return (int(self.day+.5) + 1) % 7 + 1", "def weekday(self):\n return...
[ "0.78890646", "0.7888704", "0.77694976", "0.7743159", "0.77304393", "0.7473165", "0.7347383", "0.7327534", "0.72482175", "0.7185599", "0.7150589", "0.71320957", "0.7077282", "0.70584685", "0.7054477", "0.7022905", "0.70016015", "0.6965309", "0.69390005", "0.6932365", "0.69273...
0.810655
0
Check whether the same shuttle was at this stop twice in a row
def validate_stop(self, shuttle_id: int, stop_id: int) -> bool: # TODO Save this dictionary to DB on close so that the state can be loaded when the program starts # TODO Custom logic for Howe Center stop self._shuttle_data_lock.acquire() valid = False try: if self._s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cut_twice(cls):\n return False", "def cut_twice(cls):\n return False", "def cut_twice(cls):\n return True", "def repeats(self):\n\t\treturn False", "def has_twopair(self):\n if len(self.ranks) == 0:\n self.rank_hist()\n pair_counter = 0\n for val in ...
[ "0.63943654", "0.63943654", "0.6257594", "0.6186772", "0.6056922", "0.6006159", "0.5966353", "0.59265035", "0.58203775", "0.57956535", "0.5742948", "0.5690029", "0.5687411", "0.56340146", "0.56331575", "0.561901", "0.5617209", "0.56118965", "0.56068325", "0.55981517", "0.5578...
0.6229662
3
Convert a datetime to UTC
def _convert_to_utc(self, time: datetime) -> datetime: return self._tz.localize(time).astimezone(pytz.utc)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_utc(datetime):\n if datetime.tzinfo is None:\n datetime = get_timezone().localize(datetime)\n return datetime.astimezone(UTC).replace(tzinfo=None)", "def convert_datetime_to_utc(datetime_tz):\n return datetime_tz.astimezone(pytz.utc)", "def cast_datetime_to_utc(datetime):\n if datetim...
[ "0.81241685", "0.80647105", "0.7983647", "0.7432269", "0.7396317", "0.7298228", "0.7288065", "0.7179613", "0.71781576", "0.71256596", "0.70179266", "0.70154464", "0.69898623", "0.6980561", "0.68997735", "0.68940693", "0.6893454", "0.68056375", "0.6714813", "0.6707218", "0.670...
0.8044341
2
Convert to parent QuadrantGate class.
def convert_to_parent_class(self): return gates.QuadrantGate(self.gate_name, self.dimensions, self.quadrants.values())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_parent_class(self):\n return gates.PolygonGate(self.gate_name, self.dimensions, self.vertices, use_complement=self.use_complement)", "def convert_to_parent_class(self):\n return gates.RectangleGate(self.gate_name, self.dimensions, use_complement=self.use_complement)", "def convert_...
[ "0.65872234", "0.6533802", "0.65007645", "0.6291389", "0.5804711", "0.5488525", "0.5365701", "0.5307392", "0.5260083", "0.5116582", "0.51018137", "0.5049471", "0.50351155", "0.48837665", "0.48814383", "0.48196244", "0.48112917", "0.47810394", "0.47772285", "0.47724426", "0.47...
0.8090945
0
Function that creates the middle layer blocks
def layer_block(inp, num_filters, name): with tf.variable_scope(name): in_ch = inp.shape[-1].value # create sub-layer and feed the upscaled block lay = util.conv_lay(inp, filter_size=[3, 3], num_filters=in_ch, activation="leaky_relu", scope="lay_0") # ne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_block(\n inc: int, outc: int, channels: Sequence[int], strides: Sequence[int], is_top: bool\n ) -> nn.Module:\n c = channels[0]\n s = strides[0]\n\n subblock: nn.Module\n\n if len(channels) > 2:\n subblock = _create_block(c, c...
[ "0.67164433", "0.6603024", "0.65893334", "0.64818794", "0.6477534", "0.6408059", "0.63401204", "0.6314672", "0.6301151", "0.62903595", "0.6240682", "0.6232269", "0.6185673", "0.61276245", "0.61111", "0.6101424", "0.60961556", "0.6050062", "0.6025652", "0.6018125", "0.6003471"...
0.0
-1
Tests that get_type returns the correct default value.
def test_get_default_type(_): assert benchmark_utils.get_type('benchmark') == 'code'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_type():\n return None", "def get_default_value(meta_type: str) -> Any:\n if (\n meta_type.startswith(\"Int\")\n or meta_type.startswith(\"UInt\")\n or meta_type.startswith(\"Float\")\n ):\n return 0\n else:\n return None",...
[ "0.68841237", "0.67582", "0.6753924", "0.6707918", "0.6399536", "0.62598735", "0.62586355", "0.6253584", "0.6242163", "0.61695576", "0.61455685", "0.61132437", "0.6082725", "0.6082725", "0.6082725", "0.6082725", "0.6082725", "0.6082725", "0.60818565", "0.60818565", "0.6081856...
0.74665135
0
Resets metrics variables to initial value.
def reset_metrics(self): for var in self.local_variables: var.assign(tf.zeros_like(var))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\r\n try:\r\n for metric in self.metrics:\r\n metric.reset()\r\n except AttributeError:\r\n pass", "def reset(self):\n try:\n for metric in self.metrics:\n metric.reset()\n except AttributeError:\n ...
[ "0.7939063", "0.7932025", "0.78880316", "0.76749665", "0.7622086", "0.7555847", "0.75550807", "0.7546434", "0.7526299", "0.74685407", "0.7438479", "0.73913175", "0.73338383", "0.7242712", "0.7242712", "0.7232565", "0.72268623", "0.72198856", "0.7215922", "0.72127336", "0.7201...
0.84971595
0
Returns the id of the worker that vertex is assigned to.
def worker(self,vertex): return hash(vertex) % self.num_workers
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _vertex_to_worker_id(self, vertex_id):\n\n return vertex_id % self._num_of_workers + 1", "def assigned_worker(self):\n return self._assigned_worker", "def worker(self,vertex):\r\n return hash(vertex) % self.num_workers", "def worker_num(self):\n return self._role_maker._worker...
[ "0.78556794", "0.67665094", "0.673629", "0.67108035", "0.66573966", "0.6295075", "0.62460244", "0.6114488", "0.6102196", "0.59803176", "0.5973554", "0.5970842", "0.5946055", "0.59223235", "0.59165597", "0.5873534", "0.5873534", "0.5873534", "0.58641946", "0.5839912", "0.58399...
0.681076
1
Return the duration in second.
def get_duration(self): return self.samples / self.sr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duration_seconds(self):\n return type(self).DURATION.total_seconds()", "def duration(self):\r\n duration = self._data.duration\r\n if duration < 0:\r\n duration = time() + duration\r\n return timedelta(seconds=duration)", "def getDuration(self):\r\n return self...
[ "0.82027686", "0.81439245", "0.8126842", "0.81116277", "0.8085527", "0.8077367", "0.801352", "0.801352", "0.8009697", "0.79841983", "0.79841983", "0.79841983", "0.79841983", "0.79841983", "0.79841983", "0.79841983", "0.79841983", "0.7944104", "0.79364026", "0.79364026", "0.79...
0.7591621
43
Return status code from response.
def status(self): return self.response.status_code
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_status_code(response):\n return response.status_code", "def get_status_code(self):\n status_code = self.response.status_code\n\n return status_code", "def status_code(self) -> int:\n return self._error.response.status_code", "def status(http_response):\n return http_re...
[ "0.86260605", "0.7949398", "0.7933232", "0.79081845", "0.7515118", "0.74653995", "0.74376315", "0.7434747", "0.7434747", "0.7414658", "0.7289917", "0.72829354", "0.72581345", "0.7090148", "0.705313", "0.70193154", "0.6970062", "0.6941383", "0.6938919", "0.68668085", "0.686394...
0.7497137
5
Returns str representation of the class square
def __str__(self): return "[Rectangle] {:d}/{:d}".format(self.__width, self.__height)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n string_obj = \"[Square] {}/{}\".format(self.__size, self.__size)\n return string_obj", "def __str__(self):\n out = \"[Square] ({}) {}/{} - {}\"\n return (out.format(self.id, self.x, self.y, self.size))", "def __str__(self):\n return ('[Square] ({}) {}/{} ...
[ "0.8284009", "0.81412584", "0.7973154", "0.7922793", "0.7917576", "0.7813896", "0.78057015", "0.7772661", "0.7763962", "0.7727759", "0.7711916", "0.7453076", "0.72536796", "0.72174037", "0.6954108", "0.6932427", "0.6911252", "0.68196726", "0.67435265", "0.6692876", "0.6679355...
0.64260834
61
Truncates a sequence pair in place to the maximum length.
def _truncate_seq(tokens, max_length): while len(tokens) > max_length: tokens.pop()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _truncate_seq_pair(tokens_a, tokens_b, max_length):\n\n\t# This is a simple heuristic which will always truncate the longer sequence\n\t# one token at a time. This makes more sense than truncating an equal percent\n\t# of tokens from each, since if one sequence is very short then each token\n\t# that's truncat...
[ "0.7615645", "0.7604508", "0.7604508", "0.76036716", "0.75670713", "0.7559492", "0.7559492", "0.7529625", "0.7527809", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", ...
0.69459033
32
The set of arguments for constructing a Subscription resource.
def __init__(__self__, *, max_delivery_count: pulumi.Input[int], topic_id: pulumi.Input[str], auto_delete_on_idle: Optional[pulumi.Input[str]] = None, client_scoped_subscription: Optional[pulumi.Input['SubscriptionClientScopedSubscriptionArgs']] = None...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__,\n resource_name: str,\n args: SubscriptionArgs,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...", "def __init__(__self__,\n resource_name: str,\n opts: Optional[pulumi.ResourceOptions] = None,\n ...
[ "0.78140116", "0.64488304", "0.634876", "0.6191446", "0.6107919", "0.60913295", "0.60814863", "0.5999243", "0.5991154", "0.5983495", "0.5983495", "0.59587634", "0.5890025", "0.5886919", "0.5886822", "0.5868369", "0.583997", "0.58196425", "0.58073175", "0.57810974", "0.5764385...
0.0
-1
Boolean flag which controls whether the Subscription has dead letter support on filter evaluation exceptions. Defaults to `true`.
def dead_lettering_on_filter_evaluation_error(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "dead_lettering_on_filter_evaluation_error")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dead_lettering_on_filter_evaluation_error(self) -> pulumi.Output[Optional[bool]]:\n return pulumi.get(self, \"dead_lettering_on_filter_evaluation_error\")", "def subscriber_suspension_allowed(self):\n return self._subscriber_suspension_allowed", "def available(self, exception_flag=True):\n ...
[ "0.7075724", "0.63648826", "0.5862021", "0.5862021", "0.5550734", "0.5440938", "0.5430177", "0.54274297", "0.5395826", "0.53383553", "0.53308225", "0.5303603", "0.528674", "0.5236421", "0.52086616", "0.5188128", "0.5184317", "0.51445204", "0.5128163", "0.5115162", "0.5112935"...
0.7182497
0
Boolean flag which controls whether the Subscription has dead letter support when a message expires.
def dead_lettering_on_message_expiration(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "dead_lettering_on_message_expiration")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dead_lettering_on_message_expiration(self) -> pulumi.Output[Optional[bool]]:\n return pulumi.get(self, \"dead_lettering_on_message_expiration\")", "def expired(self) -> bool:\n return self.remaining == 0", "def has_expired(self):\n return datetime.datetime.now() > self._cert.not_valid_...
[ "0.78482234", "0.6754547", "0.66881573", "0.66155726", "0.65903926", "0.6583904", "0.65679073", "0.65391445", "0.6516199", "0.6498109", "0.6473933", "0.64561933", "0.641996", "0.6377583", "0.6303165", "0.6286307", "0.6269333", "0.62682694", "0.62529093", "0.6239148", "0.62388...
0.7911602
0
The name of a Queue or Topic to automatically forward messages to.
def forward_to(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "forward_to")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_queue_name(self):\n raise NotImplementedError", "def topic(self):\n return self._name_exchange", "def forwarding_rule_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"forwarding_rule_name\")", "def forwarding_rule_name(self) -> Optional[pulumi.Input[str]]:\...
[ "0.63321793", "0.6280895", "0.62513715", "0.62513715", "0.60751003", "0.6023338", "0.58882105", "0.58527774", "0.5673226", "0.5673226", "0.5532765", "0.55324286", "0.55219257", "0.55067325", "0.5502547", "0.550208", "0.548585", "0.54514134", "0.54284626", "0.54244447", "0.538...
0.5353402
21
Specifies the name of the ServiceBus Subscription resource. Changing this forces a new resource to be created.
def name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__,\n resource_name: str,\n args: SubscriptionArgs,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...", "async def set_subscribed(self, name: str, subscribed: bool) -> None:\n ...", "def subscription_id(self, subscription_id...
[ "0.670592", "0.6140069", "0.60007924", "0.57882965", "0.57693505", "0.57693505", "0.5748629", "0.573106", "0.5716255", "0.5679315", "0.5665034", "0.5658903", "0.5655096", "0.56310034", "0.55916137", "0.55684716", "0.55640924", "0.5532811", "0.5531337", "0.5500906", "0.5484554...
0.0
-1
The status of the Subscription. Possible values are `Active`,`ReceiveDisabled`, or `Disabled`. Defaults to `Active`.
def status(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "status")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subscriptionStatus(self, subscriptionId):\n\n return self.templatepage(\"WMBSSubscription\",\n subscriptionId = int(subscriptionId))", "def status(self):\n return self._engine.exec(\"subscription-manager status\")", "def get_status(self):\n ret...
[ "0.7227791", "0.7203063", "0.6643882", "0.6613454", "0.660365", "0.660365", "0.65656126", "0.6550675", "0.6423792", "0.6422816", "0.64173293", "0.6416456", "0.64068127", "0.63985753", "0.63985753", "0.63985753", "0.63985753", "0.63985753", "0.63985753", "0.63985753", "0.63985...
0.0
-1
Boolean flag which controls whether the Subscription has dead letter support on filter evaluation exceptions. Defaults to `true`.
def dead_lettering_on_filter_evaluation_error(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "dead_lettering_on_filter_evaluation_error")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dead_lettering_on_filter_evaluation_error(self) -> pulumi.Output[Optional[bool]]:\n return pulumi.get(self, \"dead_lettering_on_filter_evaluation_error\")", "def subscriber_suspension_allowed(self):\n return self._subscriber_suspension_allowed", "def available(self, exception_flag=True):\n ...
[ "0.7074186", "0.6366", "0.5861131", "0.5861131", "0.5553519", "0.5441857", "0.54270464", "0.5425886", "0.5397792", "0.5337092", "0.53289115", "0.53033173", "0.52851784", "0.52354324", "0.52064407", "0.5188157", "0.51828027", "0.5145647", "0.51269764", "0.51136583", "0.5112429...
0.7181162
1
Boolean flag which controls whether the Subscription has dead letter support when a message expires.
def dead_lettering_on_message_expiration(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "dead_lettering_on_message_expiration")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dead_lettering_on_message_expiration(self) -> pulumi.Output[Optional[bool]]:\n return pulumi.get(self, \"dead_lettering_on_message_expiration\")", "def expired(self) -> bool:\n return self.remaining == 0", "def has_expired(self):\n return datetime.datetime.now() > self._cert.not_valid_...
[ "0.78482234", "0.6754547", "0.66881573", "0.66155726", "0.65903926", "0.6583904", "0.65679073", "0.65391445", "0.6516199", "0.6498109", "0.6473933", "0.64561933", "0.641996", "0.6377583", "0.6303165", "0.6286307", "0.6269333", "0.62682694", "0.62529093", "0.6239148", "0.62388...
0.7911602
1
The name of a Queue or Topic to automatically forward messages to.
def forward_to(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "forward_to")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_queue_name(self):\n raise NotImplementedError", "def topic(self):\n return self._name_exchange", "def forwarding_rule_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"forwarding_rule_name\")", "def forwarding_rule_name(self) -> Optional[pulumi.Input[str]]:\...
[ "0.6329992", "0.62817454", "0.62497306", "0.62497306", "0.60738754", "0.6020583", "0.5887551", "0.58508736", "0.5673859", "0.5673859", "0.55338836", "0.5531386", "0.55194986", "0.5505574", "0.550363", "0.5503157", "0.54836816", "0.5449472", "0.54298955", "0.54222906", "0.5384...
0.5354329
22
Specifies the name of the ServiceBus Subscription resource. Changing this forces a new resource to be created.
def name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__,\n resource_name: str,\n args: SubscriptionArgs,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...", "async def set_subscribed(self, name: str, subscribed: bool) -> None:\n ...", "def subscription_id(self, subscription_id...
[ "0.670592", "0.6140069", "0.60007924", "0.57882965", "0.57693505", "0.57693505", "0.5748629", "0.573106", "0.5716255", "0.5679315", "0.5665034", "0.5658903", "0.5655096", "0.56310034", "0.55916137", "0.55684716", "0.55640924", "0.5532811", "0.5531337", "0.5500906", "0.5484554...
0.0
-1
The status of the Subscription. Possible values are `Active`,`ReceiveDisabled`, or `Disabled`. Defaults to `Active`.
def status(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "status")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subscriptionStatus(self, subscriptionId):\n\n return self.templatepage(\"WMBSSubscription\",\n subscriptionId = int(subscriptionId))", "def status(self):\n return self._engine.exec(\"subscription-manager status\")", "def get_status(self):\n ret...
[ "0.7227791", "0.7203063", "0.6643882", "0.6613454", "0.660365", "0.660365", "0.65656126", "0.6550675", "0.6423792", "0.6422816", "0.64173293", "0.6416456", "0.64068127", "0.63985753", "0.63985753", "0.63985753", "0.63985753", "0.63985753", "0.63985753", "0.63985753", "0.63985...
0.0
-1
Boolean flag which controls whether the Subscription has dead letter support on filter evaluation exceptions. Defaults to `true`.
def dead_lettering_on_filter_evaluation_error(self) -> pulumi.Output[Optional[bool]]: return pulumi.get(self, "dead_lettering_on_filter_evaluation_error")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dead_lettering_on_filter_evaluation_error(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"dead_lettering_on_filter_evaluation_error\")", "def dead_lettering_on_filter_evaluation_error(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"dead_lettering_on_filter_...
[ "0.7181139", "0.7181139", "0.63644534", "0.5864187", "0.5864187", "0.5551404", "0.54395396", "0.5428265", "0.54281044", "0.53979456", "0.53363794", "0.5329193", "0.53038895", "0.52869046", "0.52368766", "0.5208667", "0.5188077", "0.51833117", "0.5144044", "0.512766", "0.51174...
0.7074139
2
Boolean flag which controls whether the Subscription has dead letter support when a message expires.
def dead_lettering_on_message_expiration(self) -> pulumi.Output[Optional[bool]]: return pulumi.get(self, "dead_lettering_on_message_expiration")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dead_lettering_on_message_expiration(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"dead_lettering_on_message_expiration\")", "def dead_lettering_on_message_expiration(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"dead_lettering_on_message_expiration\")"...
[ "0.7912223", "0.7912223", "0.6753584", "0.66876245", "0.6615146", "0.65899", "0.6583553", "0.65669215", "0.65376395", "0.6515094", "0.6496681", "0.6473284", "0.64552355", "0.6419112", "0.63760597", "0.63018686", "0.6285714", "0.6268109", "0.6267665", "0.6251768", "0.6239466",...
0.7848835
2
The name of a Queue or Topic to automatically forward messages to.
def forward_to(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "forward_to")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_queue_name(self):\n raise NotImplementedError", "def topic(self):\n return self._name_exchange", "def forwarding_rule_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"forwarding_rule_name\")", "def forwarding_rule_name(self) -> Optional[pulumi.Input[str]]:\...
[ "0.6336442", "0.6286435", "0.6249177", "0.6249177", "0.60734385", "0.6027212", "0.5888908", "0.5856341", "0.5669742", "0.5669742", "0.55384773", "0.55330193", "0.55247444", "0.55076134", "0.55065054", "0.5498596", "0.5490525", "0.54528487", "0.5426067", "0.53838205", "0.53504...
0.5425416
19
Specifies the name of the ServiceBus Subscription resource. Changing this forces a new resource to be created.
def name(self) -> pulumi.Output[str]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__,\n resource_name: str,\n args: SubscriptionArgs,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...", "async def set_subscribed(self, name: str, subscribed: bool) -> None:\n ...", "def subscription_id(self, subscription_id...
[ "0.67040956", "0.61389303", "0.5999423", "0.57866967", "0.5768006", "0.5768006", "0.5748118", "0.5731195", "0.5716099", "0.5677488", "0.5664428", "0.5657647", "0.5653993", "0.5629499", "0.5590482", "0.55673873", "0.5564071", "0.55329543", "0.553062", "0.55010736", "0.54842585...
0.0
-1
The status of the Subscription. Possible values are `Active`,`ReceiveDisabled`, or `Disabled`. Defaults to `Active`.
def status(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "status")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subscriptionStatus(self, subscriptionId):\n\n return self.templatepage(\"WMBSSubscription\",\n subscriptionId = int(subscriptionId))", "def status(self):\n return self._engine.exec(\"subscription-manager status\")", "def get_status(self):\n ret...
[ "0.72262394", "0.72034436", "0.6645416", "0.6613904", "0.6605335", "0.6605335", "0.65673536", "0.65523636", "0.64246905", "0.6424365", "0.64194924", "0.641775", "0.64063275", "0.64000857", "0.64000857", "0.64000857", "0.64000857", "0.64000857", "0.64000857", "0.64000857", "0....
0.0
-1
Computes the init prior distribution (alpha) for the arms. Arms that lie on the same host or between the control host and computing hosts get a puhs.
def _compute_init_prior(self) -> np.ndarray: return np.repeat(float(self._push_likely_arms), self._K)\ * self._arm_knowledge.arm_likely
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_DP_alpha(self):\n k = len(self.cells_per_cluster)\n # Escobar, D., West, M. (1995) - Eq. 14\n eta = np.random.beta(self.DP_a + 1, self.cells_total)\n w = (self.DP_a_gamma[0] + k - 1) \\\n / (self.cells_total * (self.DP_a_gamma[1] - np.log(eta)))\n pi_eta = w...
[ "0.63915575", "0.6120347", "0.601193", "0.600094", "0.5972526", "0.589276", "0.57742643", "0.57182723", "0.57116026", "0.5710786", "0.5643556", "0.5598343", "0.5593529", "0.54943794", "0.54895633", "0.5487302", "0.5472511", "0.5451667", "0.54350585", "0.54301095", "0.5405164"...
0.60864145
2
Create a binary mask that indicates nonzero values.
def _make_value_mask(graph: nx.Graph, tail: Any, max_degree: int) -> np.array: mask = np.zeros([1, max_degree, 1], dtype=np.float32) non_zero = nx.degree(graph)[tail] + 1 mask[0, :non_zero, 0] = 1 return mask
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def binarize(self, mask):\n\n mask[mask > 0] = 1\n return mask", "def zeroed_bitarray(initial):\n ba = bitarray(initial)\n ba.setall(False)\n return ba", "def mask(self, data):\n result = np.zeros(data.shape)\n result[:, self.zero_mask] = data[:, self.zero_mask]\n re...
[ "0.7340647", "0.6696097", "0.6628802", "0.6526157", "0.64764035", "0.6462034", "0.64312637", "0.6406633", "0.6386927", "0.6158421", "0.6130486", "0.61233443", "0.60497254", "0.6031939", "0.60278136", "0.6014591", "0.6009177", "0.5977549", "0.59763765", "0.59735626", "0.595433...
0.54090714
87
bbox = bounding box picked out of the image
def __init__(self, frame, height, bbox=None): """(x coordinate, y coordinate, width in x, height in y)""" self.tracker = cv2.TrackerCSRT_create() self.height = height if bbox is not None: self.bbox = bbox else: self.bbox = request_bounding_box(frame, height) ok = self.tracker.init(frame, self.bbox)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drawbox(img,bbox):\n return img", "def draw_bounding_box(image, bbox: List[int], color: Tuple = (0, 255, 0)):\n x1, y1, x2, y2 = bbox\n cv2.rectangle(image, (x1, y1), (x2, y2), color, 2)\n return image", "def detect_face(img):\n bbox = []\n return bbox", "def _get_bounding_box_values(se...
[ "0.7796835", "0.75788844", "0.7554381", "0.7494035", "0.74471164", "0.74422306", "0.74352986", "0.74124265", "0.7383925", "0.7343446", "0.7306628", "0.7271402", "0.7237084", "0.723003", "0.7225753", "0.71855325", "0.7130302", "0.7075136", "0.7075136", "0.7052117", "0.7005711"...
0.0
-1