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
Given two (nested) lists of tensors, return whether they are equal.
def tensor_lists_equal(t1, t2): if isinstance(t1, torch.Tensor) and isinstance(t2, torch.Tensor): ## round in case of floating errors t1 = np.round(t1.data.numpy(), decimals=5) t2 = np.round(t2.data.numpy(), decimals=5) return np.array_equal(t1, t2) assert isinstance(t1, list) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tensors_equal(self, x, y):\n if isinstance(x, PackedSequence):\n return self.tensors_equal(x[0], y[0]) and self.tensors_equal(x[1], y[1])\n\n if isinstance(x, dict):\n return (\n (x.keys() == y.keys()) and\n all(self.tensors_equal(x[k], y[k]) fo...
[ "0.788319", "0.7249695", "0.7223901", "0.6960324", "0.6813348", "0.6810137", "0.67806697", "0.67561144", "0.6703272", "0.66944456", "0.66410375", "0.6631499", "0.65602744", "0.6520822", "0.6506562", "0.6469257", "0.6439419", "0.6430223", "0.6427981", "0.6399093", "0.6396647",...
0.8785997
0
Euclidean distance between two unit quaternions as defined in [Huynh]_ and
def qdist(q1: np.ndarray, q2: np.ndarray) -> float: q1 = np.copy(q1) q2 = np.copy(q2) if q1.shape!=q2.shape: raise ValueError("Cannot compare q1 of shape {} and q2 of shape {}".format(q1.shape, q2.shape)) if q1.ndim==1: q1 /= np.linalg.norm(q1) q2 /= np.linalg.norm(q2) if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qdist(q1: np.ndarray, q2: np.ndarray) -> float:\n _quaternions_guard_clauses(q1, q2)\n q1, q2 = np.copy(q1), np.copy(q2)\n if q1.ndim == 1:\n q1 /= np.linalg.norm(q1)\n q2 /= np.linalg.norm(q2)\n if np.allclose(q1, q2) or np.allclose(-q1, q2):\n return 0.0\n retu...
[ "0.7589446", "0.7577467", "0.7440493", "0.7182569", "0.6882823", "0.6804164", "0.6797553", "0.6726708", "0.6678801", "0.66298974", "0.65738976", "0.6568971", "0.6567321", "0.6479824", "0.6473558", "0.6413479", "0.64032185", "0.6400051", "0.63728106", "0.6357321", "0.6345775",...
0.6657061
9
Composes dimension matrices that are needed for smartly batching
def _compose_dimension_matrices(training_data, test_data): # Number of the training data _NUM_TRAINING_DATA = len(training_data[_METRICS[0]]) # Number of the test data _NUM_TEST_DATA = len(test_data[_METRICS[0]]) # Dictionary that contains dimensions for each metric for each time series dim_ma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _flatten_batch(self, matrix_tups):\n out_vecs = []\n for t in matrix_tups:\n for v in t:\n new_shape = (v.shape[0],)\n if len(v.shape) > 1:\n new_shape = new_shape + (np.prod(v.shape[1:]),)\n out_vecs.append(v.reshape(new_...
[ "0.6309081", "0.6265947", "0.6198435", "0.61734277", "0.61125743", "0.61125743", "0.61031467", "0.6088638", "0.60723144", "0.60712254", "0.6069881", "0.6055343", "0.6045657", "0.60235214", "0.5995106", "0.59796023", "0.597535", "0.59743", "0.5971789", "0.5952188", "0.5911417"...
0.5793446
23
Extract the line start and length data for a normal patch. T.i. for "@@ 685,8 +686,14 @@ ..." extract `(685, 8, 686, 14)`. Raises `UnsupportedCombinedDiff` for cc diffs.
def parse(self): # type: () -> Tuple[LineNo, int, LineNo, int] metadata = self.safely_parse_metadata() if len(metadata) > 2: raise UnsupportedCombinedDiff(self.text) assert len(metadata) == 2 return tuple(flatten(metadata)) # type: ignore[return-value]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_diff2_data(request, ps_left_id, ps_right_id, patch_id, context,\n column_width, tab_spaces, patch_filename=None):\n ps_left = models.PatchSet.get_by_id(int(ps_left_id), parent=request.issue.key)\n if ps_left is None:\n return HttpTextResponse(\n 'No patch set exists with tha...
[ "0.57193804", "0.56556463", "0.5587805", "0.5558647", "0.5546249", "0.554476", "0.55102074", "0.54657567", "0.54104847", "0.53969556", "0.5375589", "0.53662705", "0.5319067", "0.52210104", "0.51829237", "0.51700425", "0.5166278", "0.51625717", "0.515758", "0.51339746", "0.513...
0.5646307
2
How long ago in days
def date_in_days(date): delta = delta_from_now(date) return (delta.days) + delta.seconds / 86400
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relativeTime(date):\n diff = datetime.utcnow() - date\n\n if diff.days > 7 or diff.days < 0:\n return date.ctime()\n elif diff.days == 1:\n return '1 day ago'\n elif diff.days > 1:\n return '%d days ago' % diff.days\n elif diff.seconds <= 1:\n return 'just now'\n elif diff.seconds < 60:\n ...
[ "0.7033108", "0.70047724", "0.695701", "0.6877489", "0.6671708", "0.6611428", "0.6609944", "0.65422094", "0.6540877", "0.64948165", "0.6474081", "0.64718443", "0.6421113", "0.6415724", "0.6330963", "0.63253576", "0.6307487", "0.63034", "0.624902", "0.62482136", "0.61640257", ...
0.0
-1
Creates a CSR representation of a sparse ESN reservoir.
def sparse_esn_reservoir(size, spectral_radius, density, symmetric): rvs = stats.uniform(loc=-1., scale=2.).rvs matrix = sparse.random(size, size, density=density, data_rvs=rvs) matrix = matrix.tocsr() if symmetric: matrix = sparse.triu(matrix) tril = sparse.tril(matrix.transpose(), k=-1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tocsr(self):\n\n indptr = np.asarray([len(x) for x in self.rows], dtype=np.intc)\n indptr = np.concatenate( (np.array([0], dtype=np.intc), np.cumsum(indptr)) )\n\n nnz = indptr[-1]\n\n indices = []\n for x in self.rows:\n indices.extend(x)\n indices = np.asa...
[ "0.6676143", "0.6495221", "0.6308354", "0.61166304", "0.60686713", "0.5998005", "0.59657687", "0.59617865", "0.5958458", "0.5952898", "0.59500706", "0.5943473", "0.5903988", "0.5898253", "0.58749306", "0.5798289", "0.5765686", "0.5660308", "0.5638334", "0.56244606", "0.561902...
0.6053023
5
Filter function Takes a dict with field names as argument Returns True if conditions are satisfied
def filter_cond(line_dict): if(line_dict["if1"] == ''): return False cond_match = ( (int(line_dict["if1"]) > 20 and int(line_dict["if1"]) < 40) ) return True if cond_match else False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter(self, filter_dict):\n self.result = [x for x in self.result if all(str(x[y]) == z or (hasattr(x[y], \"__iter__\") and (z in str(x[y]) or any(z in str(d.values) for d in x[y] if isinstance(d, dict)))) for y,z in filter_dict.items())] \n\n return self", "def filter(self, filter_dict):\n ...
[ "0.7052546", "0.6931371", "0.675938", "0.6532915", "0.6477931", "0.64123166", "0.63697743", "0.6314457", "0.62024033", "0.61617976", "0.6156781", "0.615486", "0.6114109", "0.61048603", "0.60737675", "0.6056328", "0.602717", "0.60052", "0.6002941", "0.5969463", "0.5959849", ...
0.5494211
67
Assert the equality of two lists.
def assert_lists_equal (a, b): assert len(a) == len(b) for index, expected in enumerate(a): actual = b[index] if isinstance(actual,str) and isinstance(expected, str) and \ actual.isspace() and expected.isspace (): continue elif isinstance(actual, list) and isinstan...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_lists_equal( list1, list2, assertobject ):\n assertEqualsImproved( len( list1 ), len( list2 ), assertobject )\n for element in list1:\n assertobject.assertIn( element, list2 )", "def assertListEqual(self, list1, list2, msg=None):\r\n self.assertSequenceEqual(list1, list2, msg, seq_type=list...
[ "0.8008599", "0.7936728", "0.78908825", "0.7528358", "0.7522845", "0.7520287", "0.73712087", "0.7357554", "0.73326474", "0.71704143", "0.708539", "0.7041224", "0.70262545", "0.701175", "0.69478023", "0.6923543", "0.6916157", "0.6909904", "0.69016683", "0.6884514", "0.68343896...
0.75978327
3
Declare attribute for bank account number.
def bank_account_number(cls): # pylint:disable=no-self-argument, # noqa: N805 return db.Column('bank_account_number', StringEncryptedType(String, cls._get_enc_secret, AesEngine, 'pkcs5'), nullable=True, index=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, owner, initial_balance=0.0):\n Account.count += 1\n self.owner = owner\n self.account_number = '%sXY-%s-%08d' % (Account.division,\n Account.branch, Account.count)\n self.balance = initial_balance", "def create_account_...
[ "0.6284065", "0.6187421", "0.6022238", "0.5976614", "0.59271795", "0.59124166", "0.58611524", "0.57728064", "0.56861794", "0.56256825", "0.55930215", "0.5584585", "0.5569789", "0.55608404", "0.55424184", "0.55222857", "0.55130976", "0.5481672", "0.5476077", "0.5448975", "0.54...
0.6315163
0
Return a Account by id.
def find_effective_by_account_id(cls, account_id: str): return CfsAccount.query.filter(CfsAccount.account_id == account_id, CfsAccount.status != CfsAccountStatus.INACTIVE.value).one_or_none()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_account_by_id(self, id_):\n return next((account for account in self.accounts\n if account.id == id_), None)", "def account(self, account_id: str):\n return get_from_list(self.accounts, \"id\", account_id)", "def get_by_id(self, id):\n accts = [acct for acct in ...
[ "0.8390429", "0.8212541", "0.7932882", "0.76353866", "0.757035", "0.75485486", "0.7541886", "0.7305673", "0.71669924", "0.7052718", "0.70186365", "0.67959106", "0.6782285", "0.6734103", "0.6732504", "0.6689594", "0.6660617", "0.6565088", "0.6533906", "0.6533906", "0.6530287",...
0.62911624
30
Return a Account by id.
def find_by_account_id(cls, account_id: str) -> List[CfsAccount]: return CfsAccount.query.filter(CfsAccount.account_id == account_id).all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_account_by_id(self, id_):\n return next((account for account in self.accounts\n if account.id == id_), None)", "def account(self, account_id: str):\n return get_from_list(self.accounts, \"id\", account_id)", "def get_by_id(self, id):\n accts = [acct for acct in ...
[ "0.8390429", "0.8212541", "0.7932882", "0.76353866", "0.757035", "0.75485486", "0.7541886", "0.7305673", "0.71669924", "0.7052718", "0.70186365", "0.67959106", "0.6782285", "0.6734103", "0.6732504", "0.6689594", "0.6660617", "0.6565088", "0.6533906", "0.6533906", "0.65222746"...
0.6530287
20
Reverse a velocity component if the edge of screen is reached
def update(self): if self.right > games.screen.width: #or self.left < 0: self.dx = -self.dx if self.bottom > games.screen.height or self.top < 0: self.dy = -self.dy self.handle_collide() if self.left < 60: self.end_game()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vertbounce(self):\r\n self.dy=-self.dy", "def sidebounce(self):\r\n self.dx=-self.dx", "def moveBackward(self):\n if self.onGround:\n self.vx = -4", "def right_backward(self):\n self.right_motor.run_forever(speed_sp=-self.MAX_SPEED)", "def bounce_vertical(self):\n...
[ "0.6849631", "0.6772073", "0.67669755", "0.6612066", "0.6558709", "0.65061116", "0.6422549", "0.6368025", "0.63315606", "0.63013476", "0.62595284", "0.62489915", "0.6216412", "0.6214", "0.6209145", "0.6204163", "0.6191817", "0.6167603", "0.6123724", "0.61030066", "0.6096547",...
0.5575341
72
If this worker has fewer than target_in_queue items in its queue, then we send the specified frame numebr to the worker and return true. Otherwise, we return false.
def offer(self, frame_num, target_in_queue) -> bool: if self.in_queue < target_in_queue: self.send(frame_num) return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def any(self) -> bool:\n return len(self.queue) > 0", "def isFull(self):\r\n if (len(self.queue) == self.maxlen):\r\n return True\r\n else:\r\n return False", "def isFull(self):\n return len(self.queue) == self.size", "def queue_progress(self):\r\n ret = T...
[ "0.6630116", "0.6628836", "0.65659404", "0.654566", "0.62802523", "0.62745416", "0.6247163", "0.6159139", "0.6119754", "0.6000629", "0.59391946", "0.59151196", "0.5913453", "0.5898343", "0.5897065", "0.5881539", "0.58422446", "0.5802772", "0.5802048", "0.5798299", "0.5796814"...
0.8310253
0
Computes the cartesian product with itself if other is equal to 2.
def __pow__(self, other): if other == 2: # cartesian product new_set = Set() for s1 in self: for s2 in self: new_set += Set(List([[s1, s2]])) return new_set raise TypeError( f"{other} must be 2 to compute car...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def same_side_product(p, q, a, b):\n return line_ccw(a, b, p) * line_ccw(a, b, q)", "def cartesian_product(self, other, only_accessible_components=True):\n def function(*transitions):\n if equal(t.word_in for t in transitions):\n return (transitions[0].word_in,\n ...
[ "0.67812854", "0.65287524", "0.65172505", "0.64342856", "0.63827103", "0.62974447", "0.6271194", "0.6246401", "0.6210645", "0.6202078", "0.6144252", "0.6134404", "0.6120954", "0.6094628", "0.60883814", "0.6088177", "0.6081006", "0.60778904", "0.60576415", "0.60426986", "0.604...
0.7357516
0
Implements >= relation for sets.
def __ge__(self, other): return other <= self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ge__(self, other):\n if self is other:\n return True\n if not isinstance(other, UniSet):\n other = self.fam.c_uniset(other)\n return self.fam.c_ge(self, other)", "def __ge__(self, other: Schema) -> bool:\n return set(self.items()) >= set(other.items())", ...
[ "0.66766626", "0.6595208", "0.65942216", "0.65860486", "0.6573308", "0.6538556", "0.6405722", "0.639205", "0.63831425", "0.6370728", "0.63634753", "0.63634753", "0.6358873", "0.6323312", "0.63012147", "0.62999254", "0.6296335", "0.62837327", "0.6282514", "0.6271326", "0.62629...
0.6345268
13
returns bounded angular difference between two locations
def compute_angle_in_rad(location1, location2): return np.arctan2(location1[0] - location2[0], location1[1] - location2[1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def angular_distance(lng1, lat1, lng2, lat2):\n\n phi1 = math.radians(lat1)\n phi2 = math.radians(lat2)\n\n d_phi = math.radians(lat2 - lat1)\n d_lmd = math.radians(lng2 - lng1)\n\n A = math.pow(math.sin(d_phi / 2), 2) + \\\n math.cos(phi1) * math.cos(phi2) * \\\n math.pow(math.sin(d_lmd / 2), 2)\n\n return 2 * ...
[ "0.6207273", "0.620459", "0.60019475", "0.5994316", "0.59694564", "0.59545815", "0.5946495", "0.5809231", "0.57854116", "0.5763123", "0.57327867", "0.5719821", "0.5685627", "0.5680937", "0.564515", "0.5617595", "0.5588101", "0.5587774", "0.5580274", "0.5549691", "0.554933", ...
0.0
-1
Gets the task that will be scheduled. If agent is busy, the output will be a null task, but what the agent is currently working on will not change.
def compute_task_to_schedule(self, agent_num): task = self.schedule_task(agent_num) # get chosen task agent = self.agents[agent_num] # get current agent # self.write_csv_pairwise(agent_num) # self.write_csv(agent_num) if task[0] == -1: # if null task chosen task_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_task(self):\n return self.queue.get()", "def task(self):\n return self._task", "def task(self):\n return self._task", "def task(self):\n return self._task", "def task(self):\n return self._task", "def task(self):\n return self._task", "def task(self) ->...
[ "0.7362456", "0.724245", "0.724245", "0.724245", "0.724245", "0.724245", "0.70036715", "0.6981466", "0.6814681", "0.6814681", "0.66983026", "0.6648036", "0.65973353", "0.6596637", "0.6551021", "0.6509872", "0.64760995", "0.6461781", "0.64498675", "0.6409149", "0.63307875", ...
0.6531647
15
adds data to the csv for a certain agent
def write_csv(self, agent_num): data = [] data.append(self.t) data.append(self.w_EDR) data.append(self.w_RESOURCE) data.append(self.w_DISTANCE) data.append(agent_num) for task_num, task in enumerate(self.tasks): vectorized_task_loc = self.get_vectorize...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_add(invoice_details):\r\n with open(\"beer_data.csv\", \"a\") as data_file:\r\n writer = csv.writer(data_file)\r\n writer.writerow(invoice_details)\r\n data_file.close()", "def setup_csv(self) -> None:\n csvData = ['Followers', 'Time']\n\n # Create our CSV file header\n...
[ "0.662632", "0.6398973", "0.63391227", "0.6135978", "0.61266804", "0.5973132", "0.5939993", "0.5921802", "0.5902474", "0.5853977", "0.5835502", "0.58188224", "0.58076525", "0.575672", "0.5740445", "0.57366645", "0.5726228", "0.5687795", "0.56800157", "0.5677692", "0.56772965"...
0.6684417
0
Converts a numpy array from xyzhwc to xyzchw.
def from_nhwc_to_nchw(input_data): return np.rollaxis(input_data, -1, -3)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hwc2chw(hwc):\n return hwc.permute(2, 0, 1)", "def to_chx(array):\n return _backend._convert_arrays(array, _array_to_chainerx)", "def hwc2bchw(hwc):\n return prepend_dimension(hwc2chw(hwc))", "def xy_to_XYZ(xy: ArrayLike) -> NDArrayFloat:\n\n return xyY_to_XYZ(xy_to_xyY(xy))", "def XYZ_to_x...
[ "0.6349144", "0.6347098", "0.617832", "0.59873", "0.57078016", "0.56661105", "0.56398267", "0.5603955", "0.56033236", "0.54797477", "0.54298866", "0.5370956", "0.53598356", "0.5356028", "0.53412586", "0.530018", "0.5286777", "0.52828544", "0.52653956", "0.52481604", "0.523289...
0.6120124
3
Initializes grid to be empty, take height and width of grid as parameters Indexed by rows (left to right), then by columns (top to bottom)
def __init__(self, grid_height, grid_width): self._grid_height = grid_height self._grid_width = grid_width self._cells = [[EMPTY for dummy_col in range(self._grid_width)] for dummy_row in range(self._grid_height)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_grid(self):\r\n for i in range(self.height):\r\n for j in range(self.width):\r\n self.grid[i][j] = 0\r\n \r\n # fill up unvisited cells\r\n for r in range(self.height):\r\n for c in range(self.width):\r\n if r % ...
[ "0.7630782", "0.74650055", "0.7415772", "0.73265195", "0.7318922", "0.72002435", "0.7185097", "0.7185097", "0.7185097", "0.7169826", "0.7161286", "0.71592313", "0.71498895", "0.71498895", "0.7091087", "0.70734245", "0.7069152", "0.7042371", "0.70330805", "0.7016255", "0.69839...
0.81462014
0
Fills positions if trade history data is available
def fillPositions(self): if self.th is not None: self.df['POSITION'] = self.th.positions['Qty'] self.df['REGS'] = self.th.positions['REGS'] self.df['144A'] = self.th.positions['144A'] self.df['POSITION'].fillna(0, inplace=True) self.df['REGS'].fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def openPositionHistory(self):\n dt_only, tm_only = self.getDatetimeSplit()\n\n # GET OPEN POSITIONS\n open_positions_found = self.open_positions_history.find_one(\n {\"Date\": dt_only, \"Trader\": self.user[\"Name\"], \"Asset_Type\": self.asset_type, \"Account_ID\": self.account_id...
[ "0.6459351", "0.6103853", "0.6029683", "0.59873354", "0.59233195", "0.57485735", "0.5711293", "0.5682093", "0.56430924", "0.56382126", "0.5636288", "0.5630813", "0.56141084", "0.5610457", "0.5599238", "0.55738753", "0.5553225", "0.5523361", "0.551922", "0.55105466", "0.546896...
0.6728969
0
Convert input to a list If input is None, this method simply returns None.
def _to_list( self, input ): import numpy listtypes = (list, tuple, numpy.ndarray) if input == None: return None elif type(input) in listtypes: return list(input) else: return [input]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _convert_to_list(self, input_argument):\n if type(input_argument) is not list:\n input_argument = [input_argument]\n return input_argument", "def _MakeList(input):\n if len(input) == 0:\n raise ValueError(\n 'input cannot be empty.')\n elif len(input) == 1:\n ...
[ "0.7752635", "0.73784405", "0.7284458", "0.7166048", "0.7078194", "0.7020485", "0.6989503", "0.689384", "0.6810329", "0.676979", "0.67141014", "0.6616923", "0.6545607", "0.6530351", "0.6525318", "0.6469693", "0.64340585", "0.6415135", "0.6366174", "0.632168", "0.62872195", ...
0.89297014
0
Compute an estimate of number of real cells in a dataset. Given a Dataset, compute an estimate of the number of real cells. This is done CellRangerstyle, by taking barcode with total UMI count in the 99th percentile of the dataset, and then finding the number of barcodes that have greater than 0.9 that number of UMIs.
def estimate_cell_count_from_dataset(dataset: Dataset) -> int: # If it's a model that does not model empty droplets, the dataset is cells. # NOTE: this is overridden if --expected_cells is specified. if dataset.model_name == 'simple': return dataset.data['matrix'].shape[0] # Count number of UM...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_d_priors_from_dataset(dataset: Dataset) -> Tuple[float, float]:\n\n # Count the total unique UMIs per barcode (summing after transforming).\n transformed_counts = \\\n np.array(dataset.transformation.transform(dataset.data['matrix']\n [:, datase...
[ "0.665363", "0.6281301", "0.59919727", "0.59555984", "0.5892062", "0.5744019", "0.5660073", "0.56421137", "0.5569726", "0.5563326", "0.54325527", "0.5362565", "0.5356441", "0.53364575", "0.53349966", "0.5327423", "0.5314066", "0.5296762", "0.5288975", "0.5220886", "0.519564",...
0.83259344
0
Return this user's email address.
def email(self): return self.__email
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_email(self):\n member = self.get_user()\n if member:\n return member.getProperty('email')", "def email_address(self) -> str:\n return self._email_address", "def email(self):\n # Look for a primary address\n useremail = UserEmail.query.filter_by(user_id...
[ "0.8563465", "0.8513585", "0.83337694", "0.8244531", "0.82422745", "0.82375246", "0.8129974", "0.80820173", "0.80608183", "0.8055742", "0.80318475", "0.80051243", "0.80051243", "0.80051243", "0.79839945", "0.7977961", "0.79362917", "0.78935546", "0.78935546", "0.78935546", "0...
0.7192052
47
Return this user's auth domain.
def auth_domain(self): return self.__auth_domain
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def domain(self):\n # type: (...) -> AuthDomain\n return self._domain", "def auth_domain(request):\n return request.registry.settings.get('h.auth_domain', request.domain)", "def get_domain(self):\n return self.domain", "def get_domain(self):\n return self._domain", "def get_d...
[ "0.8473398", "0.7908221", "0.7783108", "0.7752245", "0.77312803", "0.7607269", "0.7606187", "0.7574134", "0.7574134", "0.75533456", "0.7479255", "0.7479255", "0.7479255", "0.74182606", "0.7284481", "0.7259606", "0.7259606", "0.7225471", "0.7218564", "0.7094098", "0.7087787", ...
0.8618813
0
Return true if the user making this request is an admin for this application, false otherwise. We specifically make this a separate function, and not a member function of the User class, because admin status is not persisted in the datastore. It only exists for the user making this request right now.
def is_current_user_admin(): return (os.environ.get('USER_IS_ADMIN', '0')) == "1"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_admin_user(self):\n if \"is_admin\" in self._properties and self.is_admin == 'YES':\n return True\n return False", "def is_admin(self):\n if self.user is None:\n return False\n if unicode(self.user._id) in self.barcamp.admins:\n return True\n ...
[ "0.8503483", "0.8260801", "0.82359815", "0.8231025", "0.8198623", "0.81850326", "0.81450564", "0.81348693", "0.81348693", "0.80983436", "0.8092972", "0.8080409", "0.80608785", "0.8011804", "0.79828334", "0.795272", "0.7927396", "0.79024345", "0.7856595", "0.78488934", "0.7834...
0.7614485
31
Instantiate the data aggregator object.
def __init__(self, dbfile="eom_default_db.sqlite", init_db=False): self.sql = None missing = not os.path.exists(dbfile) self.sql = sqlite3.connect(dbfile, detect_types = sqlite3.PARSE_DECLTYPES) self.sql.text_factory = str if missing or init_db: self.init_rpki_rtr_tab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, aggregator: af.Aggregator):\r\n self.aggregator = aggregator", "def __init__(self, data, aggregate=np.mean, base=None, time_slices=None):\n\n # Check that the arguments have the right types\n assert isinstance(data, pd.DataFrame)\n\n self.data = data\n self.a...
[ "0.71384317", "0.692967", "0.68425673", "0.6547178", "0.65178347", "0.6469725", "0.63864183", "0.63864183", "0.63864183", "0.63767475", "0.62953156", "0.6274697", "0.6274697", "0.6220427", "0.6204985", "0.6204985", "0.6201553", "0.61870664", "0.61457086", "0.61259055", "0.611...
0.0
-1
Determines if a locus should be considered heterozygous.
def beta_posterior_test(n_a, n_b, offset): if n_a == -1 or n_b == -1: return False p_lower = gamma / 2.0 p_upper = 1 - p_lower [c_lower, c_upper] = beta.ppf([p_lower, p_upper], n_a + 1, n_b + 1) o = offset return c_lower <= 0.5+o and c_upper >= 0.5-o
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_heating(self) -> bool:\r\n self._logger.debug(log_message_formatter(\r\n \"get\", f\"{self}\", \"is_heating\"))\r\n return (self._ambient_temperature < self._target_temperature) \\\r\n and self.can_heat \\\r\n and (self._hvac_mode == \"heat\" or self._hvac_mode...
[ "0.6212957", "0.61688715", "0.60975945", "0.5915356", "0.5794185", "0.57883245", "0.57061553", "0.5656567", "0.5642931", "0.5642786", "0.5639126", "0.5621696", "0.5620523", "0.5615695", "0.5612412", "0.559978", "0.5592743", "0.5592743", "0.55458134", "0.5539166", "0.55318356"...
0.0
-1
Unload Tailscale config entry.
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS) if unload_ok: del hass.data[DOMAIN][entry.entry_id] return unload_ok
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:\n hass.data.pop(DOMAIN)\n return True", "async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry):\n unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)\n if unload_ok:\n hass...
[ "0.6450723", "0.62555087", "0.6215532", "0.6211942", "0.62116414", "0.6176228", "0.6120534", "0.6119118", "0.61155134", "0.61155134", "0.61112636", "0.61112636", "0.61112636", "0.61112636", "0.60903513", "0.60903513", "0.60903513", "0.60903513", "0.60900986", "0.60808325", "0...
0.6041648
27
Initialize a Tailscale sensor.
def __init__( self, *, coordinator: DataUpdateCoordinator, device: TailscaleDevice, description: EntityDescription, ) -> None: super().__init__(coordinator=coordinator) self.entity_description = description self.device_id = device.device_id sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, sensor):\n self.sensor = sensor\n self.temperature = None\n self.humitidy = None\n self.update()", "def __init__(self, initializer, scale=1):\n self.scale = normalize_tuple(scale, 2, \"scale\")\n self.initializer = initializer", "def __init__(self,sc...
[ "0.6203773", "0.60734326", "0.6038516", "0.60029596", "0.58955145", "0.58856654", "0.5810761", "0.5740052", "0.57215834", "0.5706978", "0.5691228", "0.5686742", "0.5643052", "0.5625031", "0.5616927", "0.5612364", "0.55866027", "0.55665183", "0.55513424", "0.5489697", "0.54880...
0.0
-1
implement the equation (2) in the DenseNet paper to concatenate the dense block feature maps
def _dense_connect_layer(self, input_data, name): with tf.variable_scope(name): conv_out = self._composite_conv(input_data=input_data, out_channel=self._growth_rate, name='composite_conv') concate_cout = tf.concat(values=[conv_out, input_data],...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dense_block(x):\n h1 = _conv_block(x, 32)\n h1 = tf.keras.layers.Concatenate()([x, h1])\n\n h2 = _conv_block(h1, 32)\n h2 = tf.keras.layers.Concatenate()([x, h1, h2])\n\n h3 = _conv_block(h2, 32)\n h3 = tf.keras.layers.Concatenate()([x, h1, h2, h3])\n\n h4 = _conv_block(h3, 32)\n h4 = tf.keras.layers.C...
[ "0.6322475", "0.6176367", "0.61375093", "0.59872884", "0.5953076", "0.5938731", "0.58839357", "0.58586365", "0.5832224", "0.57725483", "0.5755811", "0.5734254", "0.5722837", "0.5693617", "0.5682268", "0.5673355", "0.5661673", "0.5637933", "0.562283", "0.5618276", "0.5617841",...
0.0
-1
Fill gas tank to capacity.
def fill_tank(self): self.fuel_level = self.fuel_capacity print("Fuel tank is full.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fill_gas_tank(self):\n print(\"Filling the tank for\", self.get_descriptive_name())", "def fill_tank(self):\r\n self.fuel_level = self.fuel_capacity", "def fill_gas_tank(self):\n print(\"This car doesn't need a gas tank!\")", "def fill_gas_tank(self):\n print(\"This car doesn'...
[ "0.75570387", "0.7555652", "0.75070673", "0.75070673", "0.7409439", "0.7332757", "0.7316251", "0.7300285", "0.7292465", "0.72852", "0.65248567", "0.6324267", "0.61628115", "0.60551983", "0.5968692", "0.59553367", "0.5789458", "0.5675085", "0.5598182", "0.5592617", "0.55783993...
0.7370245
6
Initialize an electric car.
def __init__(self, make, model, year): super().__init__(make, model, year) # Attributes specific to electric cars. self.battery = Battery()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, car=None):\n if car is not None:\n self.actual_coordinates = car.get_actual_coordinates()\n self.origin_coordinates = car.get_origin_coordinates()\n self.acceleration = car.get_acceleration()\n self.speed = car.get_speed()\n self.name...
[ "0.68687886", "0.67927253", "0.6722194", "0.6722194", "0.6722194", "0.65718067", "0.65649307", "0.6398391", "0.63270605", "0.63130134", "0.62439173", "0.6240051", "0.61416733", "0.61211264", "0.60592383", "0.6048782", "0.60476965", "0.6044821", "0.6014955", "0.59922445", "0.5...
0.6531219
7
Fully charge the vehicle.
def charge(self): self.battery.charge_level = 100 print("The vehicle is fully charged.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recharge(self):\n self.battery=self.full\n return self", "def charge(self):\r\n\r\n self.charge_level = 100\r\n print(\"The battery is fully charged.\")", "def charge(self):\r\n\r\n self.charge_level = 100\r\n print(\"The battery is fully charged.\")", "def updat...
[ "0.71078575", "0.6817597", "0.6817597", "0.62536246", "0.6069697", "0.6024664", "0.5913083", "0.59018713", "0.5884432", "0.5862029", "0.58491033", "0.58241874", "0.5808281", "0.57654655", "0.57301015", "0.56985885", "0.5672971", "0.56674844", "0.56599915", "0.5631653", "0.563...
0.7852408
0
Returns a dictionary containing the default values for a TypeSystem instance.
def get_defaults(): return { 'base_types': _get_base_types(), 'template_types': _get_template_types(), 'refined_types': _get_refined_types(), 'humannames': _get_humannames(), 'argument_kinds': _get_argument_kinds(), 'variable_namespace': {}, 'type_aliases': _...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _types(cls):\n return {}", "def _get_type_mapping():\n return {\n Box.SPACE_NAME: Box,\n Dict.SPACE_NAME: Dict,\n Discrete.SPACE_NAME: Discrete\n }", "def base_type_dict():\n return {'filter' : filters.Filter,\n 'global_options' : global_o...
[ "0.685847", "0.684092", "0.645624", "0.6348184", "0.62123823", "0.61765605", "0.6172182", "0.61505497", "0.5981587", "0.59764034", "0.58403903", "0.5837749", "0.5796993", "0.5795893", "0.5776779", "0.5767089", "0.5765757", "0.5755373", "0.571303", "0.57106674", "0.56888264", ...
0.6779118
2
add a new transition to the buffer
def add(self, obs_t, action, reward, obs_tp1, done): data = (obs_t, action, reward, obs_tp1, done) if self._next_idx >= len(self._storage): self._storage.append(data) else: self._storage[self._next_idx] = data self._next_idx = (self._next_idx + 1) % self._maxsize
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def storeTransition(self, transition):\n self.buffer.append(transition)", "def add(self, state, action, reward, next_state, done):\n e = self.transition(state, action, reward, next_state, done)\n self.buffer.append(e)", "def add(self, transition: Tuple[np.ndarray, ...]) -> Tuple[Any, ...]:...
[ "0.77596265", "0.7419274", "0.7304988", "0.7234456", "0.70836526", "0.70348704", "0.6973781", "0.68939126", "0.6768309", "0.6743578", "0.67420524", "0.6680733", "0.6604713", "0.65684104", "0.65420747", "0.6486401", "0.64780766", "0.6453972", "0.6449315", "0.6435826", "0.64216...
0.0
-1
Get the distance in the syntactic tree between two extends. The particular purpose of the method in the task is to find the distance between two events or an event and the time in a sentence.
def get_tree_distance (self, index_1_beg, index_1_end, index_2_beg, index_2_end ): tempo_2_beg = index_2_beg tempo_2_end = index_2_end if index_1_beg >= index_2_end: index_2_beg = index_1_beg index_2_end = index_1_end index_1_beg = t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getTokenDistance(self, node1, node2):\n txt = self.getText()\n if node1 < node2:\n start = node1.getSpan()[1]+1\n end = node2.getSpan()[0]\n direction = 1\n else:\n start = node2.getSpan()[1]+1\n end = node1.getSpan()[0]\n d...
[ "0.689098", "0.673437", "0.6614487", "0.6518491", "0.6506768", "0.64325213", "0.64266384", "0.6420356", "0.64075905", "0.6363932", "0.63351756", "0.63141567", "0.6306855", "0.62922955", "0.6266099", "0.62644297", "0.6259533", "0.6235477", "0.62352675", "0.62306124", "0.623046...
0.5929505
61
return a comma + space (', ') separated string of jeep models (original order)
def get_all_jeeps(cars=cars): Jeep_list = cars["Jeep"] return ", ".join(Jeep_list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def comma_separated_list(model):\n return \", \".join(model)", "def __str__(self):\r\n\t\tacumulador = \"[\"\r\n\t\tfor x in self.elementos:\r\n\t\t\tacumulador += str(x) + \",\"\r\n\t\treturn acumulador.rstrip(\",\")+\"]\"", "def __str__(self):\n L = []\n for s,e in self.normalized():\n ...
[ "0.75830364", "0.6378074", "0.6335463", "0.6308942", "0.62725854", "0.6264572", "0.6233202", "0.62196636", "0.61696225", "0.6104148", "0.6097838", "0.60654783", "0.6030665", "0.6030577", "0.5962757", "0.59550625", "0.5922775", "0.5805409", "0.5793003", "0.57832265", "0.577199...
0.5852799
17
return a copy of the cars dict with the car models (values) sorted alphabetically
def sort_car_models(cars=cars): for model in cars: cars[model].sort() return cars
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_car_models():\n for make, model in cars.items():\n cars[make] = sorted(model)\n return cars", "def sort_car_models(cars=cars):\n return {k:sorted(cars[k]) for k in cars.keys()}", "def load_car_models(self):\n car_models_all = OrderedDict([])\n logging.info('loading %d car...
[ "0.8388931", "0.82743686", "0.610952", "0.5692521", "0.56728625", "0.56715757", "0.5667574", "0.56374073", "0.5591204", "0.5549295", "0.55482507", "0.5536235", "0.5531021", "0.54859114", "0.54815584", "0.5480016", "0.5470978", "0.54680556", "0.53974396", "0.53897595", "0.5376...
0.78874487
2
Load and parser yaml file.
def load_config_file(path): with open(path) as file: return yaml.load(file, Loader=yaml.FullLoader)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_yaml(file: Text):\n with open(file) as fp:\n return yaml.load(fp, yaml.FullLoader)", "def _load_yaml_file(yaml_file):\n with io.open(yaml_file, 'r', encoding='utf-8') as stream:\n yaml_content = yaml.load(stream)\n FileUtils._check_format(yaml_file, yaml_co...
[ "0.75834435", "0.75619686", "0.7522685", "0.7521333", "0.74964887", "0.7495487", "0.74940765", "0.7389067", "0.73587745", "0.7353921", "0.73122144", "0.72766966", "0.7273823", "0.72659487", "0.72637224", "0.7235835", "0.72286034", "0.71824783", "0.7180383", "0.7173734", "0.71...
0.70679164
30
Create a instance of proxmox API.
def connection_proxmox(config): return ProxmoxAPI( config["host"], user=config["user"], password=config["password"], verify_ssl=config["verify_ssl"], )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, **kwargs):\n\n builder_kwargs = {}\n\n if \"token\" in kwargs and str(kwargs[\"token\"]) != \"None\":\n\n # If there is a token use it along with the specified proxy details if specified\n config = ApiConfiguration(\n api_url=kwargs.get(\"api_ur...
[ "0.62811315", "0.6246885", "0.6237589", "0.6237589", "0.6151815", "0.61117625", "0.60022", "0.595346", "0.5949549", "0.5943282", "0.590346", "0.5862528", "0.58615875", "0.58429396", "0.5837407", "0.5835226", "0.5828535", "0.5819076", "0.5808679", "0.5795841", "0.5793958", "...
0.694525
0
Check if the local toon is allowed to enter.
def allowedToEnter(self): if base.cr.isPaid(): return True place = base.cr.playGame.getPlace() myHoodId = ZoneUtil.getCanonicalHoodId(place.zoneId) if myHoodId in \ (ToontownGlobals.ToontownCentral, ToontownGlobals.MyEstate, ToontownGlobals...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_telescope_on_allowed(self):\n handler = self.get_command_object(\"TelescopeOn\")\n return handler.check_allowed()", "def __TipIsForbiddenToEnter(self, vial, tipId = None):\n if tipId == None:\n tipId = self.__m_Platform.CurrentTipID()[1]\n if vial.getLabel() in self....
[ "0.6684113", "0.62243545", "0.61877936", "0.61838484", "0.61765593", "0.611133", "0.60216933", "0.60216933", "0.59972715", "0.59768903", "0.58596575", "0.58082616", "0.5807725", "0.58012944", "0.5789078", "0.5779336", "0.57534045", "0.57501376", "0.5747623", "0.5714134", "0.5...
0.7630505
0
Check for minimum version.
def check_version(self, minimum_version=0): # -> bool if minimum_version == 0: minimum_version = self.tested_version if os.name == "nt": # The library is not available in the LibreOffice # and OpenOffice for Windows python environments. # winsound.PlaySou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_version_sufficient(self, min_version):\n \n try:\n current_version = self.get_software_version()\n return LooseVersion(current_version) >= LooseVersion(min_version)\n except:\n raise", "def python_version_check():\n min_version_list = PYTHON_MIN_VERSION.split...
[ "0.8048338", "0.7990985", "0.7749143", "0.77294487", "0.76835257", "0.7655913", "0.76210546", "0.75222784", "0.73564655", "0.73544496", "0.7346611", "0.7319313", "0.7310799", "0.72974306", "0.7291244", "0.72410756", "0.72410756", "0.72410756", "0.7206761", "0.7188891", "0.703...
0.7030855
21
Derive the file name of a modelspecific config file
def modelconfigfile(modelfile): return os.path.splitext(modelfile)[0] + '.vars'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_model_filename(config):\n base = os.path.splitext(config['corpus'])[0]\n return '%s--%dT.model' % (base, config['T'])", "def _setupFilename(self):\n try:\n os.mkdir('./.netModel')\n except:\n pass # hope it's already there...\n filenames = os.listdir('./.n...
[ "0.7968517", "0.75344723", "0.73829776", "0.73329455", "0.7190793", "0.709332", "0.70396525", "0.7021086", "0.7006523", "0.69161147", "0.68957627", "0.6892056", "0.6885437", "0.6775761", "0.6737451", "0.67183787", "0.6651527", "0.65063626", "0.6502298", "0.648453", "0.6474647...
0.7901898
1
Figuring out if an object is a named tuple is not as trivial as one may expect
def is_namedtuple(v) -> bool: try: return isinstance(v, tuple) and hasattr(v, "_fields") except TypeError: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_namedtuple(obj):\n return isinstance(obj, tuple) and hasattr(obj, '_asdict')", "def isnamedtuple(obj):\n return isinstance(obj, tuple) \\\n and hasattr(obj, \"_fields\") \\\n and hasattr(obj, \"_asdict\") \\\n and callable(obj._asdict)", "def type_is_namedtuple(t) -> ...
[ "0.85558367", "0.8495043", "0.7875424", "0.77297825", "0.7667712", "0.74565136", "0.68393", "0.662794", "0.62647086", "0.6235007", "0.5973642", "0.5963398", "0.59247863", "0.59199417", "0.58857936", "0.58831155", "0.5878824", "0.5878065", "0.58611035", "0.5860707", "0.5749084...
0.79931337
2
Determine if value is a subclass of type_ Will work even if it is not a valid question to ask of the given value.
def isinstance_safe(value, type_): try: return isinstance(value, type_) except TypeError: # Cannot perform isinstance on some types return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_type(value):\n if isinstance(value, type):\n return issubclass(value, Type)\n return isinstance(value, Type)", "def issubclass_safe(value, type_):\n try:\n return issubclass(value, type_)\n except (TypeError, AttributeError):\n # Cannot perform issubclass on so...
[ "0.7286698", "0.7174919", "0.6722685", "0.67038673", "0.6585503", "0.6573454", "0.65025955", "0.64936304", "0.64846593", "0.64599854", "0.64384884", "0.64090407", "0.6404362", "0.63885236", "0.6343604", "0.63334024", "0.6254614", "0.6253148", "0.6237684", "0.62232685", "0.613...
0.6961925
2
Determine if value is a subclass of type_ Will work even value is not a class
def issubclass_safe(value, type_): try: return issubclass(value, type_) except (TypeError, AttributeError): # Cannot perform issubclass on some types return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_type(value):\n if isinstance(value, type):\n return issubclass(value, Type)\n return isinstance(value, Type)", "def isinstance_safe(value, type_):\n try:\n return isinstance(value, type_)\n except TypeError:\n # Cannot perform isinstance on some types\n ...
[ "0.7880763", "0.7379336", "0.7272714", "0.72481436", "0.72121257", "0.7209383", "0.6984322", "0.68737435", "0.68694156", "0.6789055", "0.67275107", "0.6715976", "0.670521", "0.66198355", "0.6616635", "0.6616613", "0.6574762", "0.6546906", "0.64954215", "0.6469347", "0.6450119...
0.7830925
1
Return True if entity has to be polled for state.
def should_poll(self): return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def available(self):\n return self._state is not None", "def available(self):\n return self._state is not None", "def should_poll(self):\n return self._command_state is not None", "def is_on(self):\n return not self.ready", "def is_on(self) -> bool:\n return self.entity_d...
[ "0.73400193", "0.73400193", "0.72597003", "0.72511536", "0.7243004", "0.71719337", "0.7011543", "0.6902802", "0.68940157", "0.6886581", "0.68599194", "0.6859271", "0.6859271", "0.6859271", "0.6857794", "0.680829", "0.68011504", "0.68008024", "0.6789138", "0.6789138", "0.67847...
0.66810775
51
Find a satisfying assignment for a given CNF formula. Returns that assignment if one exists, or None otherwise. >>> satisfying_assignment([]) {} >>> x = satisfying_assignment([[('a', True), ('b', False), ('c', True)]]) >>> x.get('a', None) is True or x.get('b', None) is False or x.get('c', None) is True True >>> satisf...
def satisfying_assignment(formula): return solver(convert_formula(formula))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def satisfying_assignment(formula):\n # convert the formula to a list of sets.\n formula = [set(i) for i in formula]\n\n # call the helper starting with the givne formula and an empty assignments\n # dictionary.\n result = sat_helper(formula, {})\n if result[0]:\n return result[1] # resul...
[ "0.81980455", "0.760124", "0.6243344", "0.5711161", "0.5696274", "0.5462617", "0.54510206", "0.5447149", "0.5437544", "0.5256762", "0.52323097", "0.5216544", "0.5183868", "0.51752055", "0.5155989", "0.5109571", "0.5088553", "0.5080614", "0.5071303", "0.50615454", "0.49924192"...
0.70834386
2
Returns same formula, but with clauses expressed as sets of tuples rather than lists of tuples. Formula remains a list.
def convert_formula(formula): return [set(clause) for clause in formula]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lf(formula):\n lfset = set()\n nameObj = formula.getName()\n if nameObj in doubles:\n first = formula.getFirst()\n second = formula.getSec()\n # call for function\n if nameObj == '|':\n firstForm = lf(first)\n secondForm = lf(second)\n lfset...
[ "0.6366528", "0.633642", "0.6149193", "0.5893506", "0.58395267", "0.57534564", "0.5645297", "0.56093985", "0.5568409", "0.55423987", "0.5500192", "0.5485004", "0.54606825", "0.5426495", "0.54117817", "0.5408915", "0.54063284", "0.5405922", "0.5393781", "0.53883916", "0.538435...
0.7646575
0
Find a satisfying assignment for a given CNF formula. Returns that assignment if one exists, or None otherwise. >>> satisfying_assignment([]) {} >>> x = satisfying_assignment([[('a', True), ('b', False), ('c', True)]]) >>> x.get('a', None) is True or x.get('b', None) is False or x.get('c', None) is True True >>> satisf...
def solver(formula): # dictionary initializing output solution assignments={} # check and simplify unit clauses for clause in formula: # if clause is a unit clause if len(clause)==1: # extract random literal from clause var,val=get_from_set(clause) # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def satisfying_assignment(formula):\n # convert the formula to a list of sets.\n formula = [set(i) for i in formula]\n\n # call the helper starting with the givne formula and an empty assignments\n # dictionary.\n result = sat_helper(formula, {})\n if result[0]:\n return result[1] # resul...
[ "0.81980455", "0.760124", "0.70834386", "0.5711161", "0.5696274", "0.5462617", "0.54510206", "0.5447149", "0.5437544", "0.5256762", "0.52323097", "0.5216544", "0.5183868", "0.51752055", "0.5155989", "0.5109571", "0.5088553", "0.5080614", "0.5071303", "0.50615454", "0.49924192...
0.6243344
3
Creates a new node at the front of the list and assigns to it the passed value Increments the list size by 1
def push_front(self, value): new_node = self.Node(value) # Edge Case : List is empty if self._size == 0: self._tail = new_node self._head = new_node self._size += 1 return new_node.next = self._head self._head.prev = new_node ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_first(self, value):\n self.head = Node(value, self.head)", "def push_front(self, val):\n new_node = Node(val, self.head)\n if self.is_empty():\n self.tail = new_node\n self.head = new_node\n self.size += 1", "def add_to_head(self, value):\n\n new_nod...
[ "0.7686634", "0.7617703", "0.76045", "0.7579039", "0.7531801", "0.74938774", "0.74524677", "0.74524677", "0.744536", "0.7401989", "0.73863536", "0.7339731", "0.7316137", "0.7264587", "0.71709114", "0.71600443", "0.7120181", "0.7105105", "0.7083401", "0.707433", "0.70651096", ...
0.79621935
0
Creates a new node at the end of the list and assigns to it the passed value Increments the list size by 1
def push_back(self, value): # Edge Case : List is empty # Behave just like push_front() if self._size == 0: self.push_front(value) return new_node = self.Node(value) new_node.prev = self._tail self._tail.next = new_node self._tail = new_n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push(self, value):\n new_node = Node(value)\n new_node.next = self.head\n self.head = new_node\n self.count += 1\n return new_node", "def addAtTail(self, val: int) -> None:\n '''node = self.head\n\n if node:\n while True:\n if node.ne...
[ "0.74462616", "0.7348876", "0.7293926", "0.7278214", "0.72760534", "0.72629744", "0.72587335", "0.7200632", "0.71713567", "0.71447206", "0.7125874", "0.71072936", "0.71072936", "0.7103247", "0.706299", "0.7043126", "0.7041882", "0.7029737", "0.70101917", "0.7002715", "0.69780...
0.7012729
18
Creates a new node at the specified index in the list and assigns to it the passed value Increments the list size by 1
def insert(self, value, index=0): # Error case: Index out of acceptable range if index < 0 or index > self._size: raise RangeError("index out of range.") # Edge case 1: index == 0 # Behave like push_front() if index == 0: self.push_front(value) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addAtIndex(self, index: int, val: int) -> None:\n if self.size < index:\n return\n if index < 0:\n return\n\n new_node = Node(val)\n curr = self.head\n for _ in range(index):\n curr = curr.next\n new_node.next = curr.next\n curr....
[ "0.76762843", "0.76605123", "0.7614325", "0.7478217", "0.74580437", "0.74430656", "0.73286635", "0.72690463", "0.72315407", "0.7194177", "0.7183783", "0.71322894", "0.71083087", "0.71083087", "0.708453", "0.7080326", "0.70803165", "0.70784533", "0.70751774", "0.7028018", "0.6...
0.66486245
23
Removes and returns the values at the end of the list Returns None if empty
def pop_back(self): if (self._size == 0): return None # Edge case, list has only one element # Behave same as pop_front() if (self._size == 1): return self.pop_front() output_value = self._tail.value self._tail = self._tail.prev self._ta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chop(some_list):\n # This function will take the list and remove the first and last element in list but return None.\n some_list.pop(0)\n some_list.pop(-1)\n return None", "def pop(self): ##################### <-\n value = self.lst[-1]\n self.lst = self.lst[:-1]\n return valu...
[ "0.7246398", "0.6990184", "0.69634694", "0.69539994", "0.6918766", "0.69068164", "0.6832731", "0.6812277", "0.67647165", "0.66406864", "0.6582686", "0.6564143", "0.65631413", "0.6531265", "0.65241396", "0.6523971", "0.65021825", "0.6491821", "0.6475184", "0.64725584", "0.6464...
0.66226006
10
Returns the list values as a standard python List
def toList(self): if (self._size == 0): return [] output_list = [] current_node = self._head while(current_node != None): output_list.append(current_node.value) current_node = current_node.next return output_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _to_pylist(self):\r\n\t\tpylist = []\r\n\t\tdef record_values(i, list):\r\n\t\t\tpylist.append(list._value)\r\n\t\t\treturn True\r\n\t\tself._traverse(record_values)\r\n\t\treturn pylist", "def aslist(self):\n try:\n return [x.aslist() for x in self]\n except Exception:\n pass\n return [x ...
[ "0.7844315", "0.7498847", "0.7442242", "0.7364043", "0.73295605", "0.7320489", "0.73036796", "0.72650635", "0.72474223", "0.72275376", "0.72169185", "0.719499", "0.71937156", "0.71879727", "0.7178676", "0.7129259", "0.71198004", "0.70828617", "0.70489925", "0.70461345", "0.70...
0.7165838
15
Test case for add_category_to_asset
def test_add_category_to_asset(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_remove_category_from_asset(self):\n pass", "def test_add_category(self):\n self.add_success(self.test_data['pants'])", "def test_create_category(self):\n pass", "def test_already_added_asset(self):\n # assign the asset to the story\n self.story.assets.add(self.asse...
[ "0.81523687", "0.764425", "0.7570311", "0.6889236", "0.6887647", "0.6819343", "0.67514527", "0.6708014", "0.6673375", "0.6647989", "0.65606", "0.64768696", "0.647213", "0.6441778", "0.642443", "0.642372", "0.63488626", "0.63487214", "0.63214856", "0.6315992", "0.631255", "0...
0.95660377
0
Test case for allocate_virtualization_realm
def test_allocate_virtualization_realm(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_virtualization_realm(self):\n pass", "def test_register_virtualization_realm(self):\n pass", "def test_set_virtualization_realm_active(self):\n pass", "def test_get_virtualization_realm_resources(self):\n pass", "def test_update_virtualization_realm(self):\n ...
[ "0.81738967", "0.81207174", "0.7674074", "0.7670276", "0.73524356", "0.7052354", "0.7019888", "0.6925424", "0.68759066", "0.66911906", "0.66594386", "0.6524497", "0.62494606", "0.61741275", "0.6134701", "0.5982555", "0.59148824", "0.5906454", "0.5885194", "0.5815983", "0.5792...
0.94568443
0
Test case for create_template_subsciption
def test_create_template_subsciption(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_namespaced_template(self):\n pass", "def test_create_subscription_template(self):\n pass", "def test_register_template(self):\n pass", "def test_create_activity_template(self):\n pass", "def test_create_namespaced_processed_template(self):\n pass", "def ...
[ "0.7543965", "0.74555725", "0.73099774", "0.7259014", "0.7108045", "0.7072468", "0.69551826", "0.68299764", "0.681227", "0.67984265", "0.67033446", "0.6637706", "0.6623759", "0.6559831", "0.6538498", "0.6537776", "0.6537776", "0.6491336", "0.6463776", "0.64331627", "0.6406280...
0.93009686
0
Test case for delete_deployment_run
def test_delete_deployment_run(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_deployment(self):\n pass", "def test_remove_deployment(self):\n del_deployment, mod_del_dep_bp1 = \\\n self._deploy_and_get_modified_bp_path('remove_deployment',\n deployment_id='del_dep')\n\n undel_deployment, mod_u...
[ "0.867448", "0.7608501", "0.74323153", "0.73011905", "0.72511435", "0.7250415", "0.7247018", "0.7219005", "0.70478123", "0.7030893", "0.70227975", "0.6893348", "0.6891038", "0.68697864", "0.6785895", "0.6785029", "0.67260367", "0.67216665", "0.6642672", "0.66380054", "0.66042...
0.93325716
0
Test case for delete_software_asset_bundle
def test_delete_software_asset_bundle(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_system_asset(self):\n pass", "def test_delete_asset(self):\n pass", "def test_update_software_asset_bundle(self):\n pass", "async def test_deleter_delete_bundle(config, mocker):\n logger_mock = mocker.MagicMock()\n lta_rc_mock = mocker.patch(\"rest_tools.client.Rest...
[ "0.80919915", "0.79550517", "0.7599956", "0.7187153", "0.69839835", "0.68842155", "0.68526673", "0.6682587", "0.6676647", "0.6661918", "0.6593671", "0.65800726", "0.65216184", "0.6501501", "0.6496982", "0.64812243", "0.64527225", "0.640331", "0.63805336", "0.63252723", "0.630...
0.9550257
0
Test case for delete_system_asset
def test_delete_system_asset(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_asset(self):\n pass", "def test_delete_software_asset_bundle(self):\n pass", "def test_delete_asset_type(self):\n self.assertEqual(self.all_assets.count(), 1)\n get_asset = Asset.objects.get(asset_code=\"IC001\")\n statuses = AssetStatus.objects.filter(asset=g...
[ "0.8655649", "0.8234435", "0.752207", "0.73021317", "0.7064291", "0.70400894", "0.70157003", "0.6983601", "0.6964017", "0.6923627", "0.68705094", "0.681115", "0.67882484", "0.663221", "0.66320956", "0.6508906", "0.6490903", "0.64670813", "0.6428559", "0.6422137", "0.64050126"...
0.9475287
0
Test case for delete_team
def test_delete_team(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_teams_delete_team_v1(self):\n pass", "def test_delete_team_member(self):\n pass", "def test_handle_delete(self):\n team = Team(\"BRS\", \"brs\", \"web\")\n team.github_team_id = \"12345\"\n test_user = User(\"userid\")\n test_user.github_id = \"1234\"\n ...
[ "0.8947988", "0.8845459", "0.8455357", "0.7699966", "0.7632404", "0.7621499", "0.7612774", "0.7545243", "0.7499598", "0.7487986", "0.7477289", "0.7415911", "0.74132884", "0.73915285", "0.7368085", "0.72588295", "0.72588295", "0.7225099", "0.72123814", "0.72032857", "0.7188579...
0.945034
0
Test case for get_deployment_metric
def test_get_deployment_metric(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_deployment_resource(self):\n pass", "def test_get_deployment_resource_data(self):\n pass", "def test_get_deployment(self):\n pass", "def test_get_deployment(self):\n pass", "def test_get_derived_metric(self):\n pass", "def test_get_deployment_run(self):\n ...
[ "0.69096184", "0.6758528", "0.6713598", "0.6713598", "0.6592443", "0.64808583", "0.6403167", "0.625861", "0.6237708", "0.6157586", "0.6136067", "0.6127703", "0.6085391", "0.60746324", "0.60693747", "0.6025807", "0.593881", "0.5857284", "0.5829559", "0.58050215", "0.5769839", ...
0.9364589
0
Test case for get_environment_string
def test_get_environment_string(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_environment():\n namespace = current_app.config.get('POD_NAMESPACE').lower()\n if namespace.endswith('dev'):\n return 'DEV'\n if namespace.endswith('test'):\n return 'TEST'\n if namespace.endswith('tools'):\n return 'SANDBOX'\n return ''"...
[ "0.7463902", "0.72996217", "0.6940578", "0.6840579", "0.6776166", "0.66800684", "0.66537464", "0.6652348", "0.6626986", "0.65878564", "0.65742695", "0.6563765", "0.6465944", "0.64491796", "0.64137214", "0.6406609", "0.6382997", "0.636827", "0.63412637", "0.63345975", "0.63226...
0.95803916
0
Test case for get_software_asset_bundle_expanded
def test_get_software_asset_bundle_expanded(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_software_bundles(self):\n pass", "def test_get_test_assets_expanded(self):\n pass", "def test_get_software_bundle(self):\n pass", "def test_create_software_asset_bundle_from_system_module(self):\n pass", "def test_get_container_assets_expanded(self):\n pass",...
[ "0.7447893", "0.7385767", "0.725668", "0.7151176", "0.69947815", "0.69888884", "0.64153165", "0.63940763", "0.6304117", "0.62138736", "0.61021364", "0.6032962", "0.6028531", "0.60236627", "0.5825482", "0.57914394", "0.57085747", "0.56888574", "0.5656609", "0.5573399", "0.5572...
0.95281523
0
Test case for get_template_subscription
def test_get_template_subscription(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_subscription_template(self):\n pass", "def test_get_subscription_templates(self):\n pass", "def test_create_subscription_template(self):\n pass", "def test_update_template_subscription(self):\n pass", "def test_list_template_subscriptions(self):\n pass", "d...
[ "0.91254216", "0.8465079", "0.83400655", "0.7970487", "0.78837746", "0.780573", "0.77934146", "0.74571586", "0.7394973", "0.7294791", "0.7174411", "0.71060663", "0.7010564", "0.6695348", "0.6669228", "0.6440063", "0.64380753", "0.64185697", "0.6368903", "0.6362722", "0.635258...
0.9414446
0
Test case for get_templates_in_virtualization_realm
def test_get_templates_in_virtualization_realm(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_list_virtualization_realm_templates(self):\n pass", "def test_get_virtualization_realm_resources(self):\n pass", "def test_get_virtualization_realm(self):\n pass", "def test_team_template_folders_id_templates_get(self):\n pass", "def test_invalidate_template_cache_in_vi...
[ "0.8728161", "0.73325515", "0.7203499", "0.67043316", "0.6665658", "0.6649772", "0.6569931", "0.6565045", "0.6523989", "0.6463076", "0.6445338", "0.6443119", "0.6429947", "0.6382415", "0.6331302", "0.6329164", "0.6323613", "0.62802017", "0.62723553", "0.6254154", "0.6235713",...
0.950381
0
Test case for list_template_subscriptions
def test_list_template_subscriptions(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_list_pending_template_subscriptions(self):\n pass", "def test_get_template_subscription(self):\n pass", "def test_get_subscription_templates(self):\n pass", "def test_get_subscription_template(self):\n pass", "def test_create_subscription_template(self):\n pass",...
[ "0.8628919", "0.82787085", "0.8199221", "0.7790471", "0.7419106", "0.7410631", "0.7367596", "0.7059741", "0.70037997", "0.69278824", "0.67292595", "0.6713537", "0.6691017", "0.65685594", "0.654975", "0.6541098", "0.64744055", "0.64571506", "0.6438153", "0.6392939", "0.6353327...
0.91405636
0
Test case for list_unregistered_templates
def test_list_unregistered_templates(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unregister_template(self):\n pass", "def test_list_template_registrations(self):\n pass", "def test_unshare_template_registration(self):\n pass", "def test_list_template_for_all_namespaces(self):\n pass", "def test_list_pending_template_subscriptions(self):\n pas...
[ "0.75481784", "0.73308456", "0.69799423", "0.63553554", "0.6333266", "0.62794816", "0.6273035", "0.6190113", "0.6148708", "0.6106866", "0.60849756", "0.6065083", "0.60300964", "0.6014723", "0.5821083", "0.57576245", "0.57576245", "0.5705154", "0.5694319", "0.5686872", "0.5639...
0.945489
0
Test case for list_virtualization_realm_templates
def test_list_virtualization_realm_templates(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_templates_in_virtualization_realm(self):\n pass", "def test_get_virtualization_realm_resources(self):\n pass", "def test_get_virtualization_realm(self):\n pass", "def test_register_virtualization_realm(self):\n pass", "def test_get_virtualization_realms(self):\n ...
[ "0.8621017", "0.7722742", "0.74632126", "0.69660634", "0.67916626", "0.67195785", "0.6663076", "0.64468944", "0.6398868", "0.62883246", "0.628213", "0.6210438", "0.61632943", "0.61375594", "0.61226946", "0.6101096", "0.60812944", "0.60292757", "0.59332967", "0.591286", "0.590...
0.94661987
0
Test case for remove_project_member
def test_remove_project_member(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_remove_role_from_project_member(self):\n pass", "def test_remove_project(self):\n pass", "def test_delete_team_member(self):\n pass", "def test_add_project_member(self):\n pass", "def test_handle_remove_not_admin(self):\n test_user = User(\"userid\")\n tea...
[ "0.85118395", "0.8030549", "0.7708815", "0.7382339", "0.713292", "0.7131107", "0.7131107", "0.70848227", "0.70440656", "0.6995782", "0.6969919", "0.69667006", "0.6948475", "0.6910283", "0.6872892", "0.6840699", "0.68179274", "0.6802598", "0.6795497", "0.6773166", "0.674492", ...
0.9583643
0
Test case for remove_team_manager_from_team
def test_remove_team_manager_from_team(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unassign_managing_team(self):\n pass", "def test_add_team_manager_to_team(self):\n pass", "def test_delete_team(self):\n pass", "def test_teams_remove_user_from_team_v2(self):\n pass", "def test_delete_team_member(self):\n pass", "def test_handle_remove_not_in_...
[ "0.7736126", "0.76965594", "0.76597404", "0.7627749", "0.75544083", "0.7447805", "0.74260515", "0.7294839", "0.712906", "0.70324224", "0.7022559", "0.6872612", "0.68682903", "0.6837995", "0.67318153", "0.6667099", "0.66502196", "0.6639373", "0.66099364", "0.6507255", "0.64261...
0.95891887
0
Test case for request_project_invitation
def test_request_project_invitation(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_meeting_invitation(self):\n pass", "def test_new_invitation(self):\n (approval_user_id,\n joining_user_id,\n conversation_id,\n _) = self.setup_invites()\n uri = '/status/{}/{}'.format(conversation_id, approval_user_id)\n self.set_user_cookie(approval_...
[ "0.72965556", "0.697636", "0.6641643", "0.6631371", "0.6587696", "0.6527494", "0.65196896", "0.65032", "0.64932173", "0.649059", "0.6410881", "0.63772416", "0.63487726", "0.6341639", "0.6314764", "0.6272159", "0.62623215", "0.6262167", "0.62577415", "0.61963934", "0.6161806",...
0.9356486
0
Test case for retrieve_system_asset
def test_retrieve_system_asset(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_system_asset(self):\n pass", "def test_get_test_asset(self):\n pass", "def test_import_system_asset(self):\n pass", "def test_list_system_assets(self):\n pass", "def test_update_system_asset(self):\n pass", "def test_delete_system_asset(self):\n p...
[ "0.77519137", "0.7707771", "0.7535579", "0.7114247", "0.70973", "0.6749351", "0.6716273", "0.6668374", "0.6478854", "0.64206934", "0.63568413", "0.6275273", "0.6256317", "0.6254281", "0.6108569", "0.597755", "0.5956065", "0.5931337", "0.5883109", "0.58797544", "0.58766145", ...
0.9224318
0
Test case for share_template_registration
def test_share_template_registration(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unshare_template_registration(self):\n pass", "def test_retrieve_template_registration(self):\n pass", "def test_register_template(self):\n pass", "def test_update_template_registration(self):\n pass", "def test_create_template_subsciption(self):\n pass", "def ...
[ "0.81283075", "0.79852206", "0.784368", "0.78152233", "0.70685333", "0.70141304", "0.6897447", "0.6868497", "0.6802155", "0.66807735", "0.66322416", "0.65081495", "0.64922345", "0.64888346", "0.64753515", "0.6442192", "0.6432612", "0.6390854", "0.63531464", "0.63472337", "0.6...
0.94731945
0
Test case for unshare_template_registration
def test_unshare_template_registration(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unregister_template(self):\n pass", "def test_share_template_registration(self):\n pass", "def test_list_unregistered_templates(self):\n pass", "def test_delete_template_subscription(self):\n pass", "def test_update_template_registration(self):\n pass", "def te...
[ "0.8519667", "0.79101807", "0.73495406", "0.70867145", "0.69696724", "0.68918645", "0.68361384", "0.68302506", "0.6418135", "0.6403143", "0.62631977", "0.6220697", "0.62183076", "0.620692", "0.6064587", "0.60095567", "0.5959378", "0.5951477", "0.59085053", "0.58501303", "0.58...
0.9629609
0
Test case for update_asset
def test_update_asset(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_test_asset(self):\n pass", "def test_update_asset_content(self):\n pass", "def test_update_test_asset_content(self):\n pass", "def test_update_asset_state(self):\n pass", "def test_update_system_asset(self):\n pass", "def test_update_software_asset(self)...
[ "0.9143298", "0.8754931", "0.85765153", "0.84248626", "0.8293034", "0.82076514", "0.79654044", "0.7586861", "0.75134826", "0.74644655", "0.73476195", "0.7059753", "0.70486987", "0.69465137", "0.6925012", "0.6866125", "0.6836165", "0.6777377", "0.67356104", "0.6722325", "0.672...
0.93774635
0
Test case for update_category
def test_update_category(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_category(self):\n self.update_success(self.test_data['pants'], self.test_data['shirts'])", "def test_category_update(self):\n login = self.autheniticate()\n token = json.loads(login.data.decode()).get('token')\n self.app.post(category_url,\n data=j...
[ "0.86986804", "0.82034546", "0.8127593", "0.81214726", "0.8116833", "0.77859855", "0.7695535", "0.76880234", "0.7634107", "0.75649005", "0.75559545", "0.7522682", "0.73546076", "0.73352194", "0.7146677", "0.71418315", "0.71250314", "0.6967468", "0.6949111", "0.69295293", "0.6...
0.93830985
0
Test case for update_system_asset
def test_update_system_asset(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_software_asset(self):\n pass", "def test_update_asset(self):\n pass", "def test_update_test_asset(self):\n pass", "def test_update_software_asset_content(self):\n pass", "def test_update_software_asset_bundle(self):\n pass", "def test_update_asset_conten...
[ "0.8627617", "0.86174226", "0.847632", "0.83158314", "0.8198396", "0.8134645", "0.8015189", "0.78182375", "0.7675692", "0.7624564", "0.7601504", "0.7267885", "0.720338", "0.7172237", "0.7145844", "0.69633514", "0.6903347", "0.68385565", "0.6721758", "0.6652686", "0.6607123", ...
0.9345082
0
Test case for update_team
def test_update_team(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_team_state(self):\n pass", "def test_teams_partial_update(self):\n pass", "def test_assign_managing_team(self):\n pass", "def test_owners_can_edit_team_data(self):\n\n data = {\n 'description': 'Edited description',\n 'name': 'Edited Name'\n ...
[ "0.85192895", "0.8296829", "0.77149934", "0.7379314", "0.7291607", "0.7266206", "0.72539693", "0.7237011", "0.7220214", "0.71904546", "0.71381044", "0.71381044", "0.71381044", "0.705516", "0.70339763", "0.7015948", "0.69919944", "0.6967077", "0.69559014", "0.68977255", "0.689...
0.93950874
0
Test case for update_template_registration
def test_update_template_registration(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_template_subscription(self):\n pass", "def test_retrieve_template_registration(self):\n pass", "def test_register_template(self):\n pass", "def test_update_device_template(self):\n pass", "def test_share_template_registration(self):\n pass", "def test_up...
[ "0.8083718", "0.79749024", "0.7708383", "0.7686474", "0.7682151", "0.753326", "0.7352316", "0.72988415", "0.70525295", "0.7021686", "0.6982262", "0.6621553", "0.6618101", "0.658619", "0.6572706", "0.6557499", "0.6534021", "0.6534021", "0.6345299", "0.6320398", "0.6245217", ...
0.9445199
0
Test case for update_template_subscription
def test_update_template_subscription(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_subscription_template(self):\n pass", "def test_update_subscription(self):\n pass", "def test_get_template_subscription(self):\n pass", "def test_create_subscription_template(self):\n pass", "def test_delete_template_subscription(self):\n pass", "def tes...
[ "0.93085617", "0.81070775", "0.79437876", "0.7854699", "0.75393814", "0.750173", "0.7486028", "0.73872113", "0.73769885", "0.71420544", "0.70529866", "0.6996687", "0.68146324", "0.671821", "0.6618665", "0.6602217", "0.6570982", "0.6490833", "0.64818263", "0.640444", "0.636651...
0.9456401
0
Test case for update_test_asset
def test_update_test_asset(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_asset(self):\n pass", "def test_update_test_asset_content(self):\n pass", "def test_update_asset_content(self):\n pass", "def test_update_system_asset(self):\n pass", "def test_update_software_asset(self):\n pass", "def test_update_asset_state(self):\n ...
[ "0.9405167", "0.8970323", "0.8844878", "0.8524712", "0.8446598", "0.8428697", "0.81937164", "0.7833235", "0.75604", "0.7455418", "0.74237746", "0.7359769", "0.7320598", "0.72027475", "0.71906775", "0.71747935", "0.70215386", "0.70215386", "0.70215386", "0.69742155", "0.693540...
0.95299613
0
Test case for update_virt_realm
def test_update_virt_realm(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_virtualization_realm(self):\n pass", "def test_update_virt_realm_remote_access_config(self):\n pass", "def test_remove_virt_realm(self):\n pass", "def test_enable_virt_realm_remote_access(self):\n pass", "def test_deallocate_virt_realm(self):\n pass", "d...
[ "0.8676987", "0.7930964", "0.77614", "0.70606196", "0.6879447", "0.686318", "0.68215346", "0.6770379", "0.66104203", "0.6395189", "0.6332107", "0.6267194", "0.6243547", "0.6209109", "0.6196717", "0.6183286", "0.6130521", "0.6086439", "0.5971164", "0.59483135", "0.5940871", ...
0.9600858
0
Returns a variable from the VARIABLES dict.
def variable(self, name, default=None): if not self._variablesDef: return default return self._variablesDef.get(name, default)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Var(key):\n return vars[key]", "def visit_Variable(self, node):\n var_name = node.value\n val = self.VARIABLES.get(var_name)\n if val is None:\n raise NameError(repr(var_name))\n else:\n return val", "def __getitem__(self, key: str) -> Any:\n retu...
[ "0.7391382", "0.67173004", "0.6576597", "0.6544751", "0.6526343", "0.6425948", "0.6425948", "0.6425948", "0.641794", "0.62910074", "0.6282325", "0.6180755", "0.6179679", "0.6130139", "0.61107737", "0.6068131", "0.60489625", "0.6022954", "0.5961862", "0.59382325", "0.5934132",...
0.60287464
17
Returns the full variables dict. If you're looking for a specific variable, the variable() method is a more robust option. This method is for classes where you want to scan the whole variables list looking for a pattern. It's valid for there to be no variables defined at all, so there's no guard for missing values.
def variables(self): return self._variablesDef
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def variables(self):\n return {u for u in self if u.type == 'var'}", "def variables(self) -> VariableDict:\n if self.scope is None:\n raise ValueError(\"Can't access variables on unbound modules\")\n return self.scope.variables()", "def variables_declared (self) :\r\n\t\tresult = {}\r\n\r\n\t...
[ "0.73722506", "0.71579313", "0.71402794", "0.7121354", "0.7100456", "0.7031384", "0.6908763", "0.68842", "0.6812743", "0.66709423", "0.6644417", "0.6588639", "0.65865165", "0.6519678", "0.64997536", "0.64754987", "0.6468515", "0.64520407", "0.6420493", "0.6397299", "0.6390241...
0.6604831
11
Determines if the current environment is a production environment.
def on_production(self): if not self.is_valid_platform() and not self.in_build(): return False prod_branch = 'production' if self.on_dedicated() else 'master' return self['BRANCH'] == prod_branch
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_production_environment(self):\n return self.get_current_environment() == Environment.PRODUCTION", "def is_production_mode(self):\n return getattr(self.env, 'mode', None) == 'production'", "def test_is_production_env(self) -> None:\n os.environ.update({\"NC_MODE\": \"production\"})\n...
[ "0.89711934", "0.8611636", "0.8165631", "0.80740345", "0.7578254", "0.7508955", "0.73933595", "0.7368135", "0.7278554", "0.7266004", "0.70119935", "0.6968728", "0.66911227", "0.6626267", "0.6569873", "0.6565853", "0.64657384", "0.64298946", "0.6344231", "0.6263374", "0.622264...
0.81113493
3
Determines if a relationship is defined, and thus has credentials available.
def has_relationship(self, relationship): return relationship in self._relationshipsDef
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_lookup_relationships(self):\n # Implemented from template for\n # osid.resource.ResourceLookupSession.can_lookup_resources\n # NOTE: It is expected that real authentication hints will be\n # handled in a service adapter above the pay grade of this impl.\n return True", ...
[ "0.67414904", "0.65511733", "0.64646643", "0.64207226", "0.6308635", "0.62848073", "0.6214413", "0.6043955", "0.6015531", "0.5980491", "0.59218323", "0.5909289", "0.5891679", "0.5874262", "0.5869431", "0.58548236", "0.5824025", "0.58188796", "0.57893836", "0.5766132", "0.5749...
0.6532602
2
Reads an environment variable, taking the variable prefix into account.
def __getitem__(self, item): check_name = self._varPrefix + item.upper() return self._environmentVariables.get(check_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getenv(self, var):\n return os.environ[var]", "def GetEnvVariable(name):\n return os.environ.get(name)", "def get_var(var_name: str):\n return os.environ[var_name]", "def getenv(self, key):\n return self._env[key]", "def get_environment_variable(name):\n\n variable = None\n tr...
[ "0.68339676", "0.6790212", "0.67025906", "0.6693052", "0.6686809", "0.6672266", "0.66033936", "0.6598295", "0.6496651", "0.64270884", "0.6383883", "0.635358", "0.6349981", "0.63334036", "0.6295513", "0.6275286", "0.6264916", "0.6256492", "0.6251365", "0.6233015", "0.62179476"...
0.0
-1
Decodes a Platform.sh environment variable.
def decode(variable): try: if sys.version_info[1] > 5: return json.loads(base64.b64decode(variable)) else: return json.loads(base64.b64decode(variable).decode('utf-8')) except json.decoder.JSONDecodeError: print('Error decoding JSON, c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_env(key: str) -> str:\n value = os.getenv(key)\n assert isinstance(value, str), (\n f\"the {key} environment variable must be set and a string, \" f\"{value=}\"\n )\n return value", "def parse(env, platform_name=None):\n\n platform_name = platform_name or PLATFO...
[ "0.58628464", "0.57395405", "0.57205755", "0.56262934", "0.56074154", "0.5546978", "0.54179484", "0.5410667", "0.53220564", "0.5305576", "0.52621686", "0.5250759", "0.5237902", "0.522902", "0.5214382", "0.5195442", "0.5167963", "0.51660407", "0.5145286", "0.5132241", "0.51245...
0.47133344
96
Recursive function to determine all valid combinations of numbers in the 'values' array that sum to the 'desiredNum' target number. This is a combinatoric function that essentially checks combinations of values from the array 'values' to see if they sum to the 'desiredNum', so some changes have been made to only see ea...
def recursiveSums(desiredNum, values, depth=0, max_depth=5): depth+=1 if(depth>max_depth): return if(len(values)==1): if(values[0]==desiredNum): return values[0] else: arr = [] removals = [] for i, value in enumerate(values): thisDesiredNum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def challenge1(data, num_values=2, target_value=2020):\n data_array = [data for _ in range(num_values)]\n for values in product(*data_array):\n if np.sum(values) == target_value:\n print(\"Solution found.\")\n return np.product(values)", "def recursion(self, size, target, start...
[ "0.6217983", "0.57935846", "0.57762575", "0.574159", "0.56296545", "0.5558328", "0.55192983", "0.5499441", "0.546985", "0.5435398", "0.5432282", "0.5407435", "0.5388396", "0.5349023", "0.53418314", "0.5290699", "0.5256048", "0.5246714", "0.5219322", "0.5185486", "0.51835936",...
0.79681623
0
Creates a map from the output of 'recursiveSums' with the numbers in its parameter 'values' as the keys, using the helper function 'setFromValues'
def convertSumsToMap(arr, values): num_map = {} for item in values: num_map[item] = [] for i in range(len(arr)): num_map[i+1] = setFromValues(arr[i]) return num_map
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_values(values):\n return (sum(values))", "def __valuesToIndices(self, mappings, values):\n indices = np.empty(0, dtype=np.int_)\n\n for key, _ in mappings.items():\n # Lookup the index of the value of the values in the map.\n index = mappings[key](values[key])\n\n ...
[ "0.59756285", "0.58839905", "0.5788393", "0.57338154", "0.5684472", "0.56488043", "0.5573895", "0.54984564", "0.54971635", "0.54934275", "0.54745364", "0.54526776", "0.5443377", "0.5410857", "0.54092413", "0.5406314", "0.54035735", "0.53682464", "0.53666186", "0.5336206", "0....
0.77104384
0
Helper function for 'convertSumsToMap', this function takes in an array for a specific number in the set of 'values' and recursively converts it to an array that contains all the sets of numbers summing to the 'desiredNum' value including that number
def setFromValues(arr): if(isinstance(arr, int)): return arr num = arr.pop(0) currSet = set() currSet.add(num) allSets = [currSet] for i in range(len(arr)): if(isinstance(arr[i], int)): currSet.add(arr[i]) else: newSet = set() newSet.ad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recursiveSums(desiredNum, values, depth=0, max_depth=5):\n depth+=1\n if(depth>max_depth):\n return\n if(len(values)==1):\n if(values[0]==desiredNum):\n return values[0]\n else:\n arr = []\n removals = []\n for i, value in enumerate(values):\n ...
[ "0.7082339", "0.67172486", "0.5896685", "0.5876177", "0.5303792", "0.5249836", "0.5186384", "0.51631725", "0.50948036", "0.5082651", "0.5081729", "0.50804615", "0.50397736", "0.50333595", "0.50283664", "0.50282264", "0.5021297", "0.5015133", "0.50054747", "0.50048256", "0.500...
0.6156768
2
Get the basename of the full path to the file.
def basename(file_path: str, extension: bool = False): file_name = os.path.basename(file_path) if not extension: file_name, *_ = file_name.split(".") return file_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def basename(file_path):\n return os.path.basename(file_path)", "def basename(self):\n return os.path.basename(self.filepath)", "def get_basename(absolute_file_path):\r\n return absolute_file_path.split('/')[-1]", "def basename(self):\n return get_basename(self.filename)", "def get_file...
[ "0.8632059", "0.85389507", "0.84653044", "0.8454128", "0.83614177", "0.83480054", "0.8314358", "0.8252319", "0.81742626", "0.811537", "0.80889064", "0.801743", "0.8009266", "0.7935398", "0.79135317", "0.7911225", "0.7898924", "0.7883706", "0.7869377", "0.78643996", "0.7858465...
0.7527247
29
Sets the id of this BigqueryConnection.
def id(self, id): self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, id):\n self.__id = id", "def set_id(self, id_):\n\n self.id_ = id_", "def connection_id(self, connection_id: PublicId) -> None:\n if self._connection_id is not None:\n raise ValueError(\"connection_id already set!\") # pragma: nocover\n self._connection_...
[ "0.6800032", "0.67368394", "0.66767997", "0.6523671", "0.6470866", "0.6451028", "0.6427343", "0.6427343", "0.6427343", "0.64236754", "0.64236754", "0.64236754", "0.64236754", "0.64236754", "0.6417885", "0.6403358" ]
0.6360009
59
Sets the account_id of this BigqueryConnection.
def account_id(self, account_id): self._account_id = account_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account_id(self, account_id):\n self._account_id = account_id", "def setAccount(self, account_id):\n self.data_struct['_setAccount'] = account_id", "def account_id(self, account_id: str):\n if account_id is None:\n raise ValueError(\"Invalid value for `account_id`, must not ...
[ "0.7933109", "0.7848906", "0.7233253", "0.7158426", "0.6591483", "0.63913643", "0.6388676", "0.63466644", "0.6318316", "0.6318316", "0.6318316", "0.6318316", "0.6298998", "0.6298998", "0.6054785", "0.6017184", "0.60045624", "0.595437", "0.59290403", "0.5871855", "0.5863215", ...
0.7949594
2
Sets the created_by_id of this BigqueryConnection.
def created_by_id(self, created_by_id): self._created_by_id = created_by_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def created_by_id(self, created_by_id):\n self._created_by_id = created_by_id", "def created_by(self, created_by):\n\n self._created_by = created_by", "def created_by(self, created_by):\n\n self._created_by = created_by", "def created_by(self, created_by):\n\n self._created_by = c...
[ "0.7827399", "0.7238225", "0.7238225", "0.7238225", "0.7238225", "0.7238225", "0.7238225", "0.6770423", "0.6478218", "0.6478218", "0.6478218", "0.6478218", "0.61777014", "0.6108819", "0.58232164", "0.5540735", "0.5509084", "0.5416939", "0.5345631", "0.52725977", "0.52501637",...
0.78331757
0
Sets the name of this BigqueryConnection.
def name(self, name): self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(self, name):\n self._name = name", "def set_name(self, name):\n self.__name = name", "def set_name(self, name):\n self.__name = name", "def set_name(self, name: str):\n self._name = name", "def setname(self, name):\n self.__name = name", "def set_dag_name(s...
[ "0.6841395", "0.68065464", "0.68065464", "0.6780296", "0.6773226", "0.6767191", "0.6749997", "0.6749997", "0.6749997", "0.6749997", "0.6749997", "0.6724661", "0.6722506", "0.66571724", "0.66305685", "0.66305685", "0.65751463", "0.6550988", "0.65465647", "0.65353763", "0.64798...
0.6381796
80
Sets the type of this BigqueryConnection.
def type(self, type): allowed_values = ["postgres", "redshift", "snowflake", "bigquery"] # noqa: E501 if type not in allowed_values: raise ValueError( "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 .format(type, allowed_values) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setDataSetType(self, type):\n self.__data_set_type__ = type", "def set_type(self, type):\n self.type = type", "def set_type(self, type):\n self.type = type", "def set_type(self, type):\n self._type = type", "def type(self, type: str):\n\n self._type = type", "def ty...
[ "0.66367114", "0.6553918", "0.6553918", "0.6532762", "0.6192238", "0.6190833", "0.6190833", "0.6190833", "0.6190833", "0.6190833", "0.6190833", "0.6190833", "0.6190833", "0.6190833", "0.6190833", "0.6190833", "0.6190833", "0.6190833", "0.6190833", "0.6190833", "0.6190833", ...
0.7026672
0