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
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, AdditionalInfoResponseTimestamps): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8089204", "0.8089204", "0.8055265", "0.7983358", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Return the number of values of this predicate when it is obtained using the method `as_ndarray([])`
def ndarray_size(self) -> int: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __len__(self):\n return len(np.where(np.logical_not(self.data.mask))[0])", "def __len__(self):\n return np.size(self.A,0)", "def _N(self):\n return len(self._array)", "def __len__(self):\n ret = self.data.shape[0]\n return ret", "def __len__(self):\n return sel...
[ "0.7392939", "0.714693", "0.6818876", "0.67860365", "0.6773484", "0.6735049", "0.66651446", "0.66429114", "0.6633868", "0.66103494", "0.66103494", "0.65989506", "0.6573763", "0.65728533", "0.65728533", "0.6548736", "0.6517536", "0.6491783", "0.64609206", "0.64482355", "0.6438...
0.6766878
5
Instantiate a new instance of this class given the configuration JSONcompliant dictionary encapsulating initialization arguments. This method should not be called via super unless and instance of the class is desired.
def from_config(cls, config_dict, merge_default=True): # Controlling merge here so we can control known comment stripping from # default config. if merge_default: merged = cls.get_default_config() merge_dict(merged, config_dict) else: merged = config_d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwargs):\n wrap = lambda v: Config(v) if type(v) is dict else v\n kvdict = {k: wrap(v) for k, v in dict(*args, **kwargs).items()}\n super(Config, self).__init__(kvdict)\n self.__dict__ = self", "def __init__(self, config_dict: dict):\n self._config =...
[ "0.76626724", "0.7602898", "0.7442781", "0.7437511", "0.73921496", "0.7178688", "0.7168904", "0.7135104", "0.71101487", "0.7052455", "0.6991778", "0.69866556", "0.6961889", "0.6940852", "0.6923323", "0.69058925", "0.6874999", "0.6866121", "0.6802371", "0.6802371", "0.67628545...
0.0
-1
Return the given boundary as a Q object suitable for querysets.
def _boundary_filter(self, south, west, north, east): return Q(latitude__gt=south, longitude__gt=west, latitude__lt=north, longitude__lt=east)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boundary(self): # -> BaseGeometry:\n ...", "def _create_filter_object(form_data: Dict) -> Q:\n filter_object = Q(title__icontains=form_data[\"title\"])\n filter_object &= Q(author__icontains=form_data[\"author\"])\n filter_object &= Q(\n publication_language__icontains...
[ "0.57327753", "0.5393648", "0.5344611", "0.5293871", "0.52651924", "0.5209962", "0.5151361", "0.51221335", "0.509879", "0.5091258", "0.50874144", "0.5077453", "0.50735956", "0.50507224", "0.50312674", "0.4991418", "0.49901503", "0.49759102", "0.49629217", "0.49530393", "0.494...
0.6247211
0
Forward pass with input x.
def forward(self, x): score_map_tl, score_map_br = self.get_score_map(x) coorx_tl, coory_tl = self.soft_argmax(score_map_tl) coorx_br, coory_br = self.soft_argmax(score_map_br) return torch.stack((coorx_tl, coory_tl, coorx_br, coory_br), dim=1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, x):\n raise NotImplementedError", "def forward(self, x):\n raise NotImplementedError", "def forward(self, x):\n pass", "def forward(self, x):\n return x", "def forward(self, x, **kwargs):\n pass", "def forward(self, x):\n return self.l1(x)", "...
[ "0.85627484", "0.85627484", "0.8454736", "0.8326153", "0.8238122", "0.81895876", "0.8126321", "0.80574334", "0.80161226", "0.8003981", "0.8003981", "0.7945973", "0.79284286", "0.78629106", "0.7773906", "0.77444804", "0.7740612", "0.773067", "0.77300614", "0.77267337", "0.7717...
0.0
-1
Forward function for `StarkTransformer`. The difference with transofrmer module in `MMCV` is the input shape. The sizes of template feature maps and search feature maps are different. Thus, we must flatten and concatenate them outside this module. The `MMCV` flatten the input features inside tranformer module.
def forward(self, x, mask, query_embed, pos_embed): _, bs, _ = x.shape query_embed = query_embed.unsqueeze(1).repeat( 1, bs, 1) # [num_query, embed_dims] -> [num_query, bs, embed_dims] enc_mem = self.encoder( query=x, key=None, value=None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, feature_map, z):\n B, c_feat, H, W = feature_map.shape\n z = z.view(B, self.latent_dim, 1, 1).expand(B, self.latent_dim, H, W)\n concatinated = torch.cat([feature_map, z], dim=1)\n output = self.model(concatinated)\n return output", "def forward (self, feature...
[ "0.6500442", "0.59351355", "0.58577156", "0.58318603", "0.58303314", "0.58175373", "0.58131814", "0.572253", "0.56985843", "0.56965834", "0.5692329", "0.56656265", "0.5661357", "0.5643619", "0.55994296", "0.55974185", "0.55601496", "0.5559314", "0.5540445", "0.5530759", "0.55...
0.0
-1
Return the sample covariance for the observed examples
def covar_samp(self): if self.count <= 1: return None return self.Ck / (self.count - 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cov(self):\n E_x = Sample.mean(self)\n Std_x = Sample.std(self)\n cov = Std_x/E_x\n return(cov)", "def get_covariance(self):\n x = self.particles[:, 0]\n y = self.particles[:, 1]\n X = np.stack((x, y), axis=0)\n return np.cov(X)", "def covariance(x, y...
[ "0.7471068", "0.73846245", "0.73470837", "0.72903806", "0.72555923", "0.7240131", "0.71986336", "0.7140627", "0.70628107", "0.6969764", "0.6903477", "0.6854394", "0.68375295", "0.68366385", "0.67788225", "0.67629355", "0.67512", "0.6744352", "0.67009836", "0.669641", "0.66954...
0.59818333
81
Return the sample covariance for the observed examples
def covar_pop(self): if self.count == 0: return None return self.Ck / self.count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cov(self):\n E_x = Sample.mean(self)\n Std_x = Sample.std(self)\n cov = Std_x/E_x\n return(cov)", "def get_covariance(self):\n x = self.particles[:, 0]\n y = self.particles[:, 1]\n X = np.stack((x, y), axis=0)\n return np.cov(X)", "def covariance(x, y...
[ "0.74679345", "0.7381491", "0.7344377", "0.72873414", "0.7252664", "0.723715", "0.71965814", "0.7137875", "0.7060536", "0.69686985", "0.6901835", "0.6853615", "0.6835015", "0.6834084", "0.67765445", "0.676056", "0.6748398", "0.6743524", "0.6700604", "0.66952974", "0.6692625",...
0.0
-1
Get the front item from the deque.
def get_front(self) -> int: if self.size == 0: return -1 if self.frontIndex == self.capacity - 1: return self.deque[0] return self.deque[self.frontIndex + 1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def peek_front(self):\n if ((self.is_empty()) or self.data_[self.front_]== None): #If we trip this if block we raise an error since we know the deque should be empty \n raise IndexError\n return self.data_[self.front_]", "def getFront(self):\n\t\tfront = self.queue[self.front]\n\t\tretur...
[ "0.8504709", "0.8491281", "0.841562", "0.8374413", "0.8284823", "0.8202539", "0.7989508", "0.79789394", "0.79612917", "0.7959505", "0.79556924", "0.7929888", "0.7900811", "0.78996456", "0.78637207", "0.7849841", "0.7849841", "0.7751278", "0.77479947", "0.7728384", "0.76963913...
0.82578164
5
Get the last item from the deque.
def get_rear(self) -> int: if self.size == 0: return -1 if self.lastIndex == 0: return self.deque[self.capacity - 1] return self.deque[self.lastIndex - 1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last(self):\n return self.deque[-1]", "def last_item(self):\n return self.container[self.length-1]", "def last(self):\n if self.is_empty():\n raise Empty(\"Deque is empty\")\n return self._trailer._prev._element #real item just before trailer", "def last(iterabl...
[ "0.87347764", "0.8439102", "0.8212785", "0.8140632", "0.78037834", "0.7801528", "0.77510834", "0.7620917", "0.76178724", "0.7576057", "0.7523385", "0.74903995", "0.7486337", "0.7432542", "0.7432542", "0.74092215", "0.7395986", "0.73934394", "0.7360253", "0.7360069", "0.735752...
0.7275866
27
Checks whether the circular deque is full or not.
def is_full(self) -> bool: return self.size == self.capacity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return len(self.deque) == 0", "def isFull(self):\n return len(self.queue) == self.size", "def isFull(self):\r\n if (len(self.queue) == self.maxlen):\r\n return True\r\n else:\r\n return False", "def empty(self) -> bool:\n return l...
[ "0.7989078", "0.7895886", "0.7891434", "0.7660478", "0.75128245", "0.7484213", "0.7483096", "0.73029816", "0.73029816", "0.72759694", "0.7268464", "0.7253773", "0.7235688", "0.72299623", "0.72299623", "0.72278905", "0.72223043", "0.7189977", "0.7189218", "0.7189218", "0.71661...
0.6978687
41
rpc GetBlockHash (GetBlockHashRequest) returns (GetBlockHashResponse) { option (google.api.http) = {
def GetBlockHash(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_block(blockhash):\n return requests.get(BASE+f'/api/block/{blockhash}').json()", "def get_block_hash(height):\n return requests.get(BASE+f'/api/block-index/{height}').json()['blockHash']", "def get_blockHash(self, data):\n blockHash = data['blockHash']\n return blockHash", "def ge...
[ "0.7595978", "0.7173805", "0.6853576", "0.6824187", "0.6586017", "0.6550719", "0.65430444", "0.6444644", "0.6444644", "0.63811195", "0.61842805", "0.6078641", "0.6065449", "0.606363", "0.6060592", "0.60471463", "0.6044907", "0.6044907", "0.60407466", "0.6018738", "0.59679776"...
0.78051454
0
Normalizes a given hospital name. 1. Converts all words to lower case. 2. Removes all stopwords.
def normalize_hospital_name(name): normalized_name = name.lower() stopword_list = stopwords.words('english') filtered_words = [word for word in wordpunct_tokenize(normalized_name) if word not in stopword_list] slug = slugify(' '.join(filtered_words)) return slug
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _normalize_name(self, name, aggressive=False):\n stopwords = 'the', 'a'\n if aggressive:\n # Remove anything in brackets.\n name = re.sub(r'\\([^)]+\\)', '', name)\n # Some shows have a \"with Firstname Lastname\" suffix, like \"The Daily Show\n # with ...
[ "0.72365785", "0.68701774", "0.6862431", "0.6830881", "0.6830881", "0.6761262", "0.6750685", "0.6738248", "0.6719288", "0.6670043", "0.6665048", "0.66137934", "0.6578984", "0.6569107", "0.65648854", "0.6541455", "0.65140444", "0.64899707", "0.64899707", "0.64899707", "0.64876...
0.79034716
0
Checkout `branch` and automatically overwrites conflict files.
def checkout2(repo, branch, overwrite=True): cmd = 'git checkout %s' % (branch,) out = repo.issue(cmd, error='return') if overwrite and out is not None: repo._handle_overwrite_error(out) repo._handle_abort_merge_rebase(out) # Retry repo.issue(cmd)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkout(branch=\"lf-dev\"):\n with cd(FOLDER):\n sudo('git fetch', user='tomcat')\n sudo('git checkout %s' % branch, user='tomcat')\n status()", "def gitCheckoutBranch(self, path, branch):\r\n\r\n with workInDirectory(path):\r\n fetch_cmd = [\"git\", \"fetch\"]\r\n ...
[ "0.65946996", "0.6574886", "0.6410081", "0.6246568", "0.6213896", "0.6204029", "0.61986405", "0.6193927", "0.6152797", "0.61391264", "0.6123888", "0.61154884", "0.6081411", "0.6080463", "0.60580766", "0.60198873", "0.6007687", "0.5984934", "0.5980404", "0.5944135", "0.5940276...
0.68562466
0
Inverse of builtin zip(), returns iterators of each tuple item. Returns tuple of iterators based upon an iterable, each item of which is assumed to be a tuple of the same number of items (i.e., of the sort created by zip() builtin). Assumes that all items of the iterable are a tuple with same length as the initial item...
def unzip(iterable: Iterable[Tuple[Any, ...]]) -> Tuple[Iterator[Any], ...]: first, iterator = _common.peek(iter(iterable)) if first is None: return () tees = itertools.tee(iterator, len(first)) return (map(operator.itemgetter(i), tee) for i, tee in enumerate(tees))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unzip_finite(\n iterable: Iterable[Tuple[Any, ...]],\n) -> Tuple[Iterator[Any], ...]:\n for zipped in zip(*iterable):\n yield zipped", "def pairwise(iterable):\r\n a = iter(iterable)\r\n return izip(a, a)", "def unzip(seq: Iterable) -> tuple:\n seq = iter(seq)\n # check how man...
[ "0.7884123", "0.73951375", "0.73822427", "0.7329859", "0.72852314", "0.7253318", "0.72527623", "0.72527623", "0.72527623", "0.72360116", "0.7232941", "0.71585727", "0.7145812", "0.71393615", "0.71206856", "0.7116042", "0.7116042", "0.7113765", "0.7113765", "0.7113765", "0.711...
0.7844818
1
Similar to unzip(), but limited to finite iterables. This function does not distinguish sentinel values of the sort used by itertools.zip_longest(). Such sentinels will be included in the returned item iterators. See unzip_longest_finite() in this module to efficiently unzip an iterable created using itertools.zip_long...
def unzip_finite( iterable: Iterable[Tuple[Any, ...]], ) -> Tuple[Iterator[Any], ...]: for zipped in zip(*iterable): yield zipped
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unzip_longest_finite(\n iterable: Iterable[Tuple[Any, ...]],\n *,\n fillvalue: Optional[Any] = None,\n) -> Tuple[Iterator[Any], ...]:\n for zipped in zip(*iterable):\n yield tuple(item for item in zipped if item != fillvalue)", "def zip_discard_compr(*iterables: Iterable, senti...
[ "0.7599641", "0.7005301", "0.64382815", "0.62493163", "0.6243333", "0.6125157", "0.61182976", "0.6105243", "0.5990228", "0.59512585", "0.5897735", "0.5838505", "0.57998437", "0.5778073", "0.57158124", "0.5677239", "0.5629741", "0.56005573", "0.5599043", "0.5512083", "0.546287...
0.7502314
1
Get the datapoint associated with the index.
def __getitem__(self, item): if item not in self.complex_mols: complex_mol = rdkit.Chem.rdmolops.CombineMols(self.protein_mols[item],self.ligand_mols[item] ) self.complex_mols[item]=complex_mol return item, self.protein_mols[item], self.ligand_mols[item], \ self.c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, index):\n\n if self._data_indices is not None:\n index = self._data_indices[index]\n data = self._dataset[index]\n return data", "def __getitem__(self, index):\n return self._timeseriesData[index]", "def __getitem__(self, index):\n return self...
[ "0.7659013", "0.75296396", "0.73242515", "0.73173165", "0.7097016", "0.6862643", "0.6827571", "0.6808476", "0.6751162", "0.67420584", "0.67420584", "0.6728513", "0.6703278", "0.6695598", "0.66566104", "0.66437614", "0.6578066", "0.6578066", "0.65713805", "0.6553569", "0.65526...
0.0
-1
Loads a volumetric image in nifti format (extensions .nii, .nii.gz etc.) as a 3D numpy.ndarray.
def load_nifti(file_path, dtype=np.float32, incl_header=False, z_factor=None, mask=None): img = nib.load(file_path) struct_arr = img.get_data().astype(dtype) # replace infinite values with 0 if np.inf in struct_arr: struct_arr[struct_arr == np.inf] = 0. # replace NaN values wi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_nifty_volume_as_array(filename, with_header = False):\n img = nibabel.load(filename)\n data = img.get_data()\n data = np.transpose(data, [2,1,0])\n if(with_header):\n return data, img.affine, img.header\n else:\n return data", "def load_nifty_volume_as_array(filename, with_h...
[ "0.7214577", "0.7214577", "0.709228", "0.69455504", "0.6928431", "0.6928248", "0.69253945", "0.67528784", "0.6676745", "0.65893656", "0.6577156", "0.6477012", "0.6458193", "0.6338634", "0.63185775", "0.62432826", "0.62252605", "0.6168806", "0.6157617", "0.60782915", "0.599508...
0.692388
7
The distance from this point to the origin.
def radius(self) -> float: return math.hypot(self.x, self.y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance_from_origin(self):\n return ((self.x ** 2) + (self.y ** 2)) **0.5", "def distance_from_origin(self):\n return ((self.x ** 2) + (self.y ** 2)) ** 0.5", "def distance_from_origin(self):\n return ((self.x ** 2) + (self.y ** 2)) ** 0.5", "def distance_from_origin(self):\n ...
[ "0.8927227", "0.8912726", "0.8912726", "0.8912726", "0.8912726", "0.8912726", "0.8912726", "0.8912726", "0.8850169", "0.8810187", "0.8733091", "0.8552471", "0.75148124", "0.7395887", "0.7376847", "0.73464864", "0.73197937", "0.728429", "0.72274804", "0.7204807", "0.7203434", ...
0.64359146
100
A tuple of this point's x and y coordinates.
def xy(self) -> Tuple[float, float]: return (self.x, self.y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coordinates(self) -> Tuple[int, int]:\n return self.x, self.y", "def xy(self) -> Tuple[int, int]:\n return self._x, self._y", "def get_point(self):\n return self._x, self._y", "def coordinates(self) -> Tuple[float, float, float, float, float]:\n return (self.x, self.y, self.x ...
[ "0.8953007", "0.8937962", "0.86783415", "0.86111736", "0.8321993", "0.82544005", "0.82386565", "0.82255226", "0.8197248", "0.80881447", "0.8072225", "0.79811084", "0.7958825", "0.7913098", "0.79067475", "0.79028577", "0.7887499", "0.7886007", "0.7886007", "0.78790206", "0.787...
0.90129477
0
Add `other` to `self` and return a new Point.
def __add__(self, other: PointOrIterableOrScalar) -> PointType: return self.__op(other, operator.add)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, other):\n x = self._x + other.get_x()\n y = self._y + other.get_y()\n return Point(x,y)", "def __add__(self, other):\n return Point(self.x+other.x, self.y+other.y)", "def __add__(self,other):\n if isinstance(other, point):\n return self.add_points(oth...
[ "0.87237906", "0.83524173", "0.77548677", "0.7750509", "0.74485403", "0.7367556", "0.7184719", "0.71274793", "0.70628226", "0.70226336", "0.6997736", "0.69605994", "0.69222295", "0.6898772", "0.68906474", "0.68867755", "0.68113726", "0.6792045", "0.67880595", "0.674652", "0.6...
0.7366747
6
Add `other` to `self` inplace and returns `self`.
def __iadd__(self, other: PointOrIterableOrScalar) -> PointType: return self.__iop(other, operator.add)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iadd__(self, other):\n self.MergeWith(other)\n return self", "def add(self, other):\n return self._new_rep(self.rep + other.rep)", "def __add__(self, other):\n if not other:\n return self.clone()\n else:\n return self.using(join(self, other))", "...
[ "0.80372334", "0.7986134", "0.79664266", "0.78092366", "0.7738967", "0.77127343", "0.76409525", "0.75913817", "0.7589274", "0.7547711", "0.75278586", "0.75233424", "0.7493876", "0.7485334", "0.7409722", "0.7408713", "0.7408713", "0.7408713", "0.7408713", "0.7408713", "0.74087...
0.0
-1
Return the floating point distance between `self` and `other`. If other is not given, the distance from self to the origin is returned.
def distance(self, other: PointOrIterable = None) -> float: return (self.distance_squared(other or Point())) ** 0.5
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(self, other):\n return float(abs(self.x - other.x) + abs(self.y - other.y))", "def distance(self, other: \"Point\") -> float:\n if not isinstance(other, self.__class__):\n raise TypeError(\"Expected `other` to be an instance of `{}`\"\\\n .form...
[ "0.8535794", "0.85033715", "0.8408725", "0.83884984", "0.8372925", "0.83477175", "0.83424914", "0.8339309", "0.8314656", "0.82963485", "0.82629424", "0.8202225", "0.81942624", "0.8194223", "0.8162336", "0.8149353", "0.80973977", "0.8025616", "0.800162", "0.7989224", "0.798369...
0.8303592
9
Return the floating point squared distance between self and other. If other is not given, the squared distance from self to the origin is returned.
def distance_squared(self, other: PointOrIterable = None) -> float: return sum((((other or Point()) - self) ** 2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def squaredDistanceTo(self,other):\n if not isinstance(other,Point):\n return \n return (self.longitude - other.getLongitude())**2 +(self.latitude - other.getLatitude())**2", "def distance(self, other: PointOrIterable = None) -> float:\n return (self.distance_squared(other or Poin...
[ "0.80755734", "0.80645823", "0.7802913", "0.78016543", "0.76762885", "0.7650648", "0.7602126", "0.7595", "0.75585", "0.7540435", "0.7521282", "0.7496888", "0.7477617", "0.74663025", "0.74459094", "0.7387185", "0.73853767", "0.7372873", "0.7359835", "0.73340523", "0.7304411", ...
0.8365737
0
Return True if the angle [self, b, c] has counter clockwise winding, else False. Raises the exception `ColinearPoints` if the points compose a line.
def is_ccw(self, b: PointOrIterable, c: PointOrIterable) -> bool: result = self.ccw(b, c) if result == 0: raise ColinearPoints(self, b, c) return result > 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_colinear(self, b: PointType, c: PointType) -> bool:\n return self.ccw(b, c) == 0", "def is_ccw(point_a, point_b, point_c):\r\n return is_on_line(point_a, point_b, point_c) > 0", "def is_ccw(points):\n points = np.asanyarray(points, dtype=np.float64)\n\n if (len(points.shape) != 2 or\n ...
[ "0.7609235", "0.7557099", "0.6990511", "0.68427503", "0.683419", "0.68226945", "0.6582589", "0.64759666", "0.64759666", "0.64698136", "0.6272435", "0.6197709", "0.6191934", "0.61795664", "0.61134416", "0.60998017", "0.6020702", "0.59578556", "0.59384805", "0.58934057", "0.587...
0.7955458
0
True if the angle [self, b, c ] is a line, else False.
def is_colinear(self, b: PointType, c: PointType) -> bool: return self.ccw(b, c) == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _isLine(self):\n return (self.width == 0 and self.height > 1) or (self.height == 0 and self.width > 1)", "def _isLine(self):\n return (self.width == 0 and self.height > 1) or (self.height == 0 and self.width > 1)", "def _isLineTanToArc(self, x1, y1, x2, y2, cx, cy, d):\n p = QPointF(x2...
[ "0.72368664", "0.72368664", "0.7024019", "0.69143486", "0.6839409", "0.675803", "0.675803", "0.6641476", "0.66301024", "0.66082054", "0.6588251", "0.65468705", "0.65376484", "0.65376484", "0.64892673", "0.6383846", "0.6285809", "0.62338495", "0.6227295", "0.62247664", "0.6212...
0.61395836
24
Return a new Point midway between `self` and `other`. If other is not given, the midpoint between self and the origin is returned.
def midpoint(self, other: PointType = None) -> PointType: return (self + (other or Point())) / 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mid_point(a: Point, b: Point) -> Point:\n return Point((a.x + b.x) / 2, (a.y + b.y) / 2)", "def halfway(self, target):\n mx = (self.x + target.x) / 2\n my = (self.y + target.y) / 2\n return Point(mx, my)", "def halfway(self, target):\r\n mx = (self.x + target.x)/2\r\n ...
[ "0.6676469", "0.60114807", "0.6004466", "0.5985635", "0.5985635", "0.5985635", "0.59546316", "0.5879427", "0.5844241", "0.5816637", "0.580738", "0.58004814", "0.5790193", "0.57144624", "0.5713127", "0.571122", "0.56574553", "0.56470776", "0.5636528", "0.5634694", "0.5630058",...
0.8038037
0
Wraps hidden states in new Tensors, to detach them from their history.
def repackage_hidden(h): if isinstance(h, torch.Tensor): return h.detach() else: return tuple(repackage_hidden(v) for v in h)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def detach_hidden(hidden: Any) -> Any:\n return apply_to_tensor(hidden, Tensor.detach)", "def reset_hidden(self, hidden, reset_flags):\n # detach it from history (pytorch mechanics)\n if self.rnn_type in ['lstm', 'mylstm']:\n h = Variable(hidden[0].data)\n c = Variable(hidd...
[ "0.6896774", "0.6564761", "0.6440056", "0.63181335", "0.62956357", "0.61828166", "0.61425817", "0.61264986", "0.61264986", "0.6120289", "0.6029193", "0.60253143", "0.6020807", "0.5987143", "0.5969475", "0.5969475", "0.5932672", "0.5932672", "0.591887", "0.5889544", "0.5871412...
0.555539
39
Get a string representation of this object
def __str__(self): return "HyperStream version {version}, connected to mongodb://{host}:{port}/{db}, session id {sid}".format( version=__version__, host=self.config.mongo['host'], port=self.config.mongo['port'], db=self.config.mongo['db'], sid=self.cur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_string(self):\r\n return self.__str__()", "def toString(self) -> str:\n raise NotImplementedError", "def as_string(self):\n return self.__repr__()", "def serialize(self):\n\n\t\treturn str(self)", "def serialize(self):\n\n return str(self)", "def __str__ (self) :\n\n ...
[ "0.8772957", "0.86092013", "0.86087894", "0.8546864", "0.85193133", "0.8453341", "0.84088635", "0.84052026", "0.84052026", "0.84052026", "0.84052026", "0.84052026", "0.84052026", "0.84052026", "0.84052026", "0.84052026", "0.84052026", "0.84052026", "0.84052026", "0.84052026", ...
0.0
-1
The identity blocks are standard blocks used in Resnets where the input activation a[l] has the same dimension as the output activation a[l+2]. > X >> >> X > |Conv2D|BatchNorm|Relu| > |Conv2D|BatchNorm|Relu| > |Conv2D|BatchNorm|+|Relu|>
def _indentity_block(self, X, filters, f, stage, block): conv_layer_name = 'res' + str(stage) + block + '_branch' bn_layer_name = 'bm' + str(stage) + block + '_branch' X_shortcut = X F1, F2, F3 = filters # First component of main path X = Conv2D(filters = F1, kernel_size = (1, 1), strides = (1, 1), paddi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_block(input_tensor, kernel_size, filters, stage, block,use_bias=True,dilation_rate=(1, 1), train_bn=None):\n filters1, filters2, filters3 = filters\n if K.image_data_format() == 'channels_last':\n bn_axis = 3\n else:\n bn_axis = 1\n conv_name_base = 'res' + str(stage) + block...
[ "0.7218753", "0.72135097", "0.7212597", "0.72119904", "0.7169549", "0.71662825", "0.71420234", "0.7103479", "0.7067407", "0.70466936", "0.70401764", "0.7039895", "0.7039727", "0.7033284", "0.7033284", "0.7002071", "0.6992381", "0.6968666", "0.6958102", "0.6955848", "0.6955848...
0.0
-1
Convolutional blocks are used when the input activation a[l] is different from the output activation a[l+2] > X |Conv2D|BatchNorm| > > >> X > |Conv2D|BatchNorm|Relu| > |Conv2D|BatchNorm|Relu| > |Conv2D|BatchNorm|+|Relu|>
def _convolution_block(self, X, filters, f, s, stage, block): conv_layer_name = 'res' + str(stage) + block + '_branch' bn_layer_name = 'bn' + str(stage) + block + '_branch' X_shortcut = X F1, F2, F3 = filters # First component of the main path X = Conv2D(filters = F1, kernel_size = (1,1), strides = (s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _conv_block( inputs, filters, kernel, strides, nl):\n channel_axis = 1 if K.image_data_format() == 'channels_first' else -1\n x = Conv2D(filters, kernel, padding='same', strides=strides)(inputs)\n x = BatchNormalization(axis=channel_axis)(x)\n return _return_activati...
[ "0.8093184", "0.77841735", "0.74639565", "0.74009436", "0.7313207", "0.72923005", "0.7289703", "0.7241785", "0.72249305", "0.7224223", "0.7132335", "0.7109032", "0.7093447", "0.7086665", "0.70534664", "0.70328885", "0.7008613", "0.70008296", "0.6995562", "0.6988809", "0.69819...
0.68808746
30
Creates a SparseTensor from grouped indices, values, and shapes
def sparse_tensor_merge(indices: tf.Tensor, values: tf.Tensor, shape: tf.Tensor) -> tf.SparseTensor: indices = tf.cast(indices, dtype=tf.int64) shape = tf.cast(shape, dtype=tf.int64) merged_shape = tf.reduce_max(shape, axis=0) batch_size, elements, shape_dim = tf.unstack(tf.shape(indices)) index_ran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sparse_constructor(self, indices: 'np.ndarray', values: 'np.ndarray', shape: List[int]) -> 'SparseTensor':\n return SparseTensor(indices, values, shape)", "def bprop_make_sparse_tensor(indices, values, dense_shape, out, dout):\n return zeros_like(indices), F.sparse_tensor_get_values(dout), ()", "...
[ "0.77478737", "0.70774746", "0.70429033", "0.70391726", "0.67152846", "0.66837937", "0.65980595", "0.6553203", "0.64589757", "0.6326495", "0.6244223", "0.6223383", "0.6185766", "0.61845416", "0.61494625", "0.6115902", "0.60523856", "0.60466963", "0.6042048", "0.6013854", "0.6...
0.6803977
4
Clean up series name by removing any . and _ characters, along with any trailing hyphens. Is basically equivalent to replacing all _ and . with a
def CleanSerieName(series_name): try: series_name = re.sub("(\D)\.(?!\s)(\D)", "\\1 \\2", series_name) series_name = re.sub("(\d)\.(\d{4})", "\\1 \\2", series_name) # if it ends in a year then don't keep the dot series_name = re.sub("(\D)\.(?!\s)", "\\1 ", series_name) series_name =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sanitize_name(name: str) -> str:\n return re.sub(r\"[^A-Za-z0-9_-]\", \"-\", name)[0:128]", "def sanitize_name(name):\n # For now just change dashes to underscores. Fix this more in the future\n return name.replace(\"-\", \"_\")", "def clean_episode_title(filename):\n new_str = filename.replace...
[ "0.74064714", "0.7253388", "0.7148532", "0.71050465", "0.70775956", "0.7051443", "0.69524163", "0.69253844", "0.6901493", "0.6870551", "0.6868943", "0.68440765", "0.68252516", "0.6810167", "0.68019074", "0.6784888", "0.6768763", "0.6760372", "0.67535406", "0.67399555", "0.668...
0.799551
0
Test case for team_template_folders_find_one_get Find first instance of the model matched by filter from the data source.
def test_team_template_folders_find_one_get(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_team_template_folders_id_team_get(self):\n pass", "def test_team_template_folders_id_exists_get(self):\n pass", "def test_team_template_folders_id_templates_fk_get(self):\n pass", "def test_team_template_folders_id_get(self):\n pass", "def test_team_template_folders_id_...
[ "0.6741028", "0.66696125", "0.6659063", "0.6548872", "0.6494747", "0.63703674", "0.63639253", "0.6355142", "0.62466127", "0.5951043", "0.5894491", "0.5852349", "0.5748025", "0.5667436", "0.5662029", "0.56452614", "0.55575687", "0.55110466", "0.55069876", "0.5503777", "0.54715...
0.8466202
0
Test case for team_template_folders_id_put Replace attributes for a model instance and persist it into the data source.
def test_team_template_folders_id_put(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_team_template_folders_id_templates_fk_put(self):\n pass", "def test_team_template_folders_id_children_fk_put(self):\n pass", "def test_team_template_folders_id_replace_post(self):\n pass", "def test_team_template_folders_id_patch(self):\n pass", "def test_team_template_...
[ "0.7504428", "0.7104182", "0.70466805", "0.65424544", "0.63857955", "0.6227054", "0.60847133", "0.6040423", "0.6029789", "0.59896743", "0.5904628", "0.57987356", "0.57302064", "0.5700448", "0.5645764", "0.5642856", "0.5634773", "0.5634771", "0.5626497", "0.5549034", "0.551491...
0.7899408
0
Test case for team_template_folders_id_templates_post Creates a new instance in templates of this model.
def test_team_template_folders_id_templates_post(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_team_template_folders_post(self):\n pass", "def test_team_template_folders_id_templates_fk_put(self):\n pass", "def test_team_template_folders_id_children_post(self):\n pass", "def test_workflows_id_templates_post(self):\n pass", "def test_team_template_folders_id_repla...
[ "0.7337337", "0.721465", "0.7060718", "0.6698532", "0.6563004", "0.65542066", "0.6341067", "0.62356204", "0.62096906", "0.6188248", "0.59654826", "0.594923", "0.5935483", "0.58273405", "0.58084404", "0.57673085", "0.5725541", "0.57208335", "0.57106185", "0.57081985", "0.56814...
0.8269024
0
Returns a host address with a prefix length from its index in a network.
def get_interface( network: Union[ipaddress.IPv6Interface, ipaddress.IPv4Interface, str], index: int ) -> Union[ipaddress.IPv6Interface, ipaddress.IPv4Interface]: if isinstance(network, str): network = ipaddress.ip_network(network) host = network[index] return ipaddress.ip_interface(f"{host}/{n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def address_to_ip_prefix(address):\n return address.split('/')", "def get_dhcp_range(options, index):\n second_octet = 160 + index\n return \"192.%s.1.2-192.%s.255.254\" % (second_octet, second_octet)", "def host_ip_address(self, host_index, vlan_index):\n if isinstance(vlan_index, tuple):\n ...
[ "0.6298772", "0.62552655", "0.6225074", "0.6125748", "0.6093484", "0.6071969", "0.599591", "0.59213686", "0.58339036", "0.58277035", "0.5774389", "0.57737297", "0.57581437", "0.5608282", "0.5580417", "0.55408114", "0.55179876", "0.5503308", "0.54701847", "0.54176533", "0.5391...
0.5590431
14
retrieve data from existing file as a pandas DataFrame
def get_existing_data_for_ticker(ticker): filename = get_filename_for_ticker(ticker) logger.debug(f'Processing {filename}') df_ticker_data = pd.DataFrame() try: df_ticker_data = pd.read_csv(filename, index_col='Date') df_ticker_data.index = pd.to_datetime(df_ticker_data.index) except...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_file(fname: str) -> pd.DataFrame:\n raw_data = (\n pd.read_hdf(fname).to_frame().reset_index(level=[0, 1]).loc[ANALYSIS_DATE]\n )\n raw_data[\"date\"] = raw_data.index\n return raw_data", "def get_data(filename):\r\n return pd.read_csv(filename)", "def read_da...
[ "0.78751683", "0.76296395", "0.7519976", "0.7519976", "0.7519976", "0.7488012", "0.7414116", "0.74024737", "0.7321678", "0.72541535", "0.716172", "0.71392226", "0.71055347", "0.7099592", "0.7093465", "0.707126", "0.70622283", "0.70374", "0.7026195", "0.69648886", "0.69577485"...
0.0
-1
Checks whether the object is equal to another GraphViaEdges object. Two GraphViaEdges objects are equal if they have the same edges and the same names.
def __eq__(self, other): if self.edges != other.edges: return False if self.name != other.name: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other: Vertex) -> bool:\n if isinstance(other, self.__class__):\n return self.id == other.id and self.edges == other.edges\n return False", "def __eq__(self, other):\n if not type(other) == type(self):\n return False\n sedges, oedges = self.edges...
[ "0.7573153", "0.73986137", "0.72373873", "0.7203145", "0.7197092", "0.7126384", "0.70328027", "0.69937086", "0.69937086", "0.6891229", "0.6870849", "0.6869632", "0.68648255", "0.6817948", "0.68070734", "0.6747166", "0.66999537", "0.65927106", "0.65927106", "0.65757036", "0.65...
0.79617494
0
Indicates whether the interface is designed specifically to handle the supplied object's type. By default simply checks if the object is one of the types declared on the class, however if the type is expensive to import at load time the method may be overridden.
def applies(cls, obj): return type(obj) in cls.types
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_object_type(self):\n raise exceptions.NotImplementedError()", "def verify_type(self, obj):\n return isinstance(obj, self.type_)", "def isinstancemethod(cls, obj):\n return _isinstancemethod(cls, obj)", "def is_type(obj):\n return type(obj) is type or type(obj) is types.ClassType", ...
[ "0.72881466", "0.72243005", "0.70506996", "0.70410687", "0.6942121", "0.69025177", "0.68854284", "0.68413585", "0.67842245", "0.6779543", "0.671683", "0.66760117", "0.6669651", "0.6640231", "0.66180044", "0.6610032", "0.65361595", "0.65310186", "0.65304136", "0.6527261", "0.6...
0.7322255
0
Returns the data of a Dataset as a dataframe avoiding copying if it already a dataframe type.
def as_dframe(cls, dataset): return dataset.dframe()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dataframe(dataset: LGBMTypes.DatasetType) -> pd.DataFrame:\n if isinstance(dataset, lgb.Dataset):\n x = LGBMUtils.to_dataframe(dataset=dataset.data)\n if dataset.label is None:\n return x\n y = LGBMUtils.to_dataframe(dataset=dataset.label)\n ...
[ "0.74988043", "0.71751237", "0.7006334", "0.69861305", "0.6919226", "0.6832426", "0.68180156", "0.6808118", "0.6801346", "0.67590004", "0.6756455", "0.6708862", "0.66681975", "0.6589894", "0.6567048", "0.6565977", "0.65588295", "0.65258104", "0.64525884", "0.6371686", "0.6346...
0.7543955
0
Cell centered Gradient in the x dimension. Has neumann boundary conditions.
def cellGradx(self): if getattr(self, '_cellGradx', None) is None: G1 = self._cellGradxStencil() # Compute areas of cell faces & volumes V = self.aveCC2F*self.vol L = self.r(self.area/V, 'F','Fx', 'V') self._cellGradx = sdiag(L)*G1 return self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nodalGrad(self):\n if getattr(self, '_nodalGrad', None) is None:\n # The number of cell centers in each direction\n n = self.vnC\n # Compute divergence operator on faces\n if(self.dim == 1):\n G = ddx(n[0])\n elif(self.dim == 2):\n ...
[ "0.5974134", "0.57971627", "0.5780118", "0.56898856", "0.56190974", "0.5606267", "0.5569837", "0.5553896", "0.550776", "0.5492416", "0.547346", "0.54399157", "0.5436913", "0.5369846", "0.5360979", "0.5348835", "0.5348126", "0.53281224", "0.52887356", "0.52429634", "0.5235656"...
0.533531
17
Cell centered Gradient in the x dimension. Has neumann boundary conditions.
def cellGradz(self): if self.dim < 3: return None if getattr(self, '_cellGradz', None) is None: G3 = self._cellGradzStencil() # Compute areas of cell faces & volumes V = self.aveCC2F*self.vol L = self.r(self.area/V, 'F', 'Fz', 'V') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nodalGrad(self):\n if getattr(self, '_nodalGrad', None) is None:\n # The number of cell centers in each direction\n n = self.vnC\n # Compute divergence operator on faces\n if(self.dim == 1):\n G = ddx(n[0])\n elif(self.dim == 2):\n ...
[ "0.59716815", "0.5794979", "0.57816434", "0.5688464", "0.5617806", "0.56097573", "0.5568176", "0.5558523", "0.5505792", "0.5491174", "0.5471289", "0.54366285", "0.54350555", "0.53687614", "0.53658277", "0.5349038", "0.53457004", "0.5332609", "0.5325868", "0.5291756", "0.52403...
0.0
-1
Construct the 3D curl operator.
def edgeCurl(self): if getattr(self, '_edgeCurl', None) is None: assert self.dim > 1, "Edge Curl only programed for 2 or 3D." n = self.vnC # The number of cell centers in each direction L = self.edge # Compute lengths of cell edges S = self.area # Compute areas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Tol3d(self, *args):\n return _Adaptor3d.Adaptor3d_TopolTool_Tol3d(self, *args)", "def curl2(f,dx,dy,dz,x=[],y=[],z=[]):\n if (f.ndim != 4 or f.shape[0] != 3):\n print(\"curl2: must have vector 4-D array f[3,mz,my,mx] for curl2\")\n raise ValueError\n param = read_param(quiet=True)\...
[ "0.55220413", "0.5342687", "0.53203726", "0.53083605", "0.53001183", "0.5287159", "0.52739495", "0.527126", "0.52613837", "0.5236303", "0.5236303", "0.52332485", "0.5231991", "0.52018195", "0.5200924", "0.5187987", "0.51862645", "0.51706827", "0.51653796", "0.51440334", "0.51...
0.4889843
56
Retrieves all the columns of a task in the task table (select from task ...) The API is (only?) used in the monitor for operator.
def search(self, **kwargs): if 'workflow' not in kwargs or not kwargs['workflow']: raise InvalidParameter("Task name not found in the input parameters") try: row = next(self.api.query(None, None, self.Task.QuickSearch_sql, taskname=kwargs["workflow"])) except StopIterat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_get_all_tasks():\n sql = \"SELECT * FROM {};\".format(TABLE_NAME)\n return db_query(sql)", "def get_tasks(self):\n res = self.conn.cursor().execute(\"SELECT * FROM tasks\")\n return res.fetchall()", "def select_all_tasks(conn):\n cur = conn.cursor()\n cur.execute(\"SELECT * FRO...
[ "0.7353425", "0.70995665", "0.6960035", "0.6960035", "0.6858041", "0.6831462", "0.66364855", "0.6562159", "0.62685734", "0.6267503", "0.61690605", "0.6148924", "0.61424357", "0.60861117", "0.60420024", "0.60366994", "0.59879225", "0.59616435", "0.59240097", "0.59030104", "0.5...
0.0
-1
Parse the given XML and use the document element to create a Python instance.
def CreateFromDocument (xml_text, default_namespace=None, location_base=None): if pyxb.XMLStyle_saxer != pyxb._XMLStyle: dom = pyxb.utils.domutils.StringToDOM(xml_text) return CreateFromDOM(dom.documentElement) saxer = pyxb.binding.saxer.make_parser(fallback_namespace=Namespace.fallbackNamespace...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new(cls, xml):\n return oxml.parse_xml(xml)", "def FromXML(cls, doc, element):\n return cls()", "def FromXML(cls, doc, element):\n return cls(element.text)", "def FromXML(cls, doc, element):\n return cls(element.text)", "def FromXML(cls, doc, element):\n return cls(el...
[ "0.7285244", "0.7230691", "0.72086143", "0.72086143", "0.72086143", "0.694379", "0.69336003", "0.6916482", "0.681647", "0.681647", "0.681647", "0.67966795", "0.6786365", "0.6780595", "0.6780595", "0.6780595", "0.6780595", "0.6780595", "0.6780595", "0.6780595", "0.67726415", ...
0.6927175
9
Create a Python instance from the given DOM node. The node tag must correspond to an element declaration in this module.
def CreateFromDOM (node, default_namespace=None): if default_namespace is None: default_namespace = Namespace.fallbackNamespace() return pyxb.binding.basis.element.AnyCreateFromDOM(node, _fallback_namespace=default_namespace)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CreateFromDOM (node, default_namespace=None):\n if default_namespace is None:\n default_namespace = Namespace.fallbackNamespace()\n return pyxb.binding.basis.element.AnyCreateFromDOM(node, default_namespace)", "def CreateFromDOM (node, default_namespace=None):\n if default_namespace is None:\...
[ "0.70111525", "0.70111525", "0.70111525", "0.70111525", "0.70111525", "0.70111525", "0.70111525", "0.70111525", "0.70111525", "0.70111525", "0.70111525", "0.6946226", "0.6698814", "0.6698814", "0.6698814", "0.66975737", "0.66655135", "0.6650566", "0.6622097", "0.6594007", "0....
0.6949202
12
Return the cloned TracksDict corresponding to the current selected items
def _dictview(self) -> TracksDict: return self._items[self._keys, self._beads] # type: ignore
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reset_track_lst(self):\n del self._track_item\n self._track_item = {key : [] for key in self._track_lst}\n return self._track_item", "def checkpoint_items(self):\n items = dict(backbone=self.backbone, head=self.head)\n if self.decoder is not None:\n items.update(decoder=self....
[ "0.5568035", "0.54771763", "0.5457668", "0.545101", "0.53839874", "0.53815985", "0.5333072", "0.52926517", "0.5273943", "0.52510434", "0.52496594", "0.524671", "0.5231919", "0.5220479", "0.5164312", "0.51326734", "0.5117656", "0.5115659", "0.5113828", "0.510586", "0.5099929",...
0.5978185
0
Add the given Reply to this transaction store's list of responses. Also add to processedRequests if not added previously.
async def append(self, reply: Reply) \ -> None: result = reply.result identifier = result.get(f.IDENTIFIER.nm) txnId = result.get(TXN_ID) logger.debug("Reply being sent {}".format(reply)) if self._isNewTxn(identifier, reply, txnId): self.addToProcessedTxns...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addToProcessedTxns(self,\n identifier: str,\n txnId: str,\n reply: Reply) -> None:\n self.transactions[txnId] = reply\n if identifier not in self.processedRequests:\n self.processedRequests[identifier] = {}\n...
[ "0.6899966", "0.6166129", "0.61250067", "0.5979266", "0.57536274", "0.56638956", "0.5634618", "0.5630767", "0.54890007", "0.5479965", "0.5479965", "0.5436922", "0.5425434", "0.5344658", "0.5177299", "0.515309", "0.514785", "0.5144238", "0.51264435", "0.5090172", "0.5059836", ...
0.8082104
0
If client is not in `processedRequests` or requestId is not there in processed requests and txnId is present then its a new reply
def _isNewTxn(self, identifier, reply, txnId) -> bool: return (identifier not in self.processedRequests or reply.reqId not in self.processedRequests[identifier]) and \ txnId is not None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testReplyWhenRequestAlreadyExecuted(looper, nodeSet, client1, sent1):\n # Since view no is always zero in the current setup\n looper.run(eventually(checkSufficientRepliesRecvd,\n client1.inBox,\n sent1.reqId,\n 2,\n ...
[ "0.6786671", "0.64508814", "0.64042187", "0.60409987", "0.5892617", "0.55976886", "0.5570875", "0.54957646", "0.54149187", "0.5410394", "0.5357963", "0.5327926", "0.5290472", "0.5285692", "0.51636094", "0.5159471", "0.5154646", "0.5153234", "0.51339537", "0.5120444", "0.51175...
0.66603124
1
Sets letmehear into dry run mode, when all requested actions are only simulated, and no changes are written to filesystem.
def set_dry_run(self): self._dry_run = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dry_run(self, dry_run):\n\n self._dry_run = dry_run", "def dry(self):\n self._dry = True\n return self", "def do_dry_run(self):\n self.loggit.info('DRY-RUN MODE. No changes will be made.')\n msg = f'DRY-RUN: Update cluster routing transient settings: {self.settings}'\n ...
[ "0.6989833", "0.65439415", "0.6299042", "0.62920314", "0.6024881", "0.59835994", "0.59672785", "0.59232223", "0.58818495", "0.58818495", "0.58150184", "0.5740509", "0.55362505", "0.5323272", "0.52800596", "0.51863605", "0.51516193", "0.51297456", "0.50773555", "0.503785", "0....
0.7023573
0
Creates and returns dictionary of files in source directory. `recursive` if True search is also performed within subdirectories.
def get_dir_files(self, recursive=False): logging.info('Enumerating files under the source path (recursive=%s) ...', recursive) files = {} if not recursive: files[self.path_source] = [ f for f in os.listdir(self.path_source) if os.path.isfile(os.path.join(self.path_so...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_file_dict():\n import os\n file_dict = {}\n for root, dirs, files in os.walk('.'):\n dirs[:] = [ # add any extra dirs to ignore #\n d for d in dirs\n if '.' not in d\n and 'ENV' not in d\n and '__' not in d\n and 'build' not in d\n ...
[ "0.66049916", "0.6600909", "0.63020784", "0.58902156", "0.58048713", "0.5802294", "0.5765301", "0.57375884", "0.5660179", "0.5609506", "0.5603751", "0.5581873", "0.55007124", "0.5482791", "0.5479842", "0.5460904", "0.54340225", "0.53852797", "0.53830934", "0.5363218", "0.5351...
0.7256247
0
Returns temporary resampled file name from filepath.
def get_resampled_filename(filepath): try: filepath = filepath.encode('utf-8') except UnicodeDecodeError: pass return 'tmp_%s.flac' % md5(filepath).hexdigest()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_temporary_file_name(original_file):\n directory, basename = os.path.split(original_file)\n basename = basename[-MAX_TEMPORARY_FILE_BASENAME_LENGTH:]\n\n random_hex = binascii.b2a_hex(os.urandom(16)).decode('utf-8')\n new_file_path = os.path.join(directory, '%s%s' % (random_hex, basename))\n\n return n...
[ "0.67282295", "0.6667649", "0.66115636", "0.6438271", "0.64057815", "0.63899124", "0.63718104", "0.62631476", "0.6262597", "0.62606746", "0.6260422", "0.6186918", "0.61814684", "0.6142914", "0.6125212", "0.60798645", "0.6061999", "0.6057938", "0.60536873", "0.6019673", "0.601...
0.76514924
0
Test digit 12 min base.
def test_digit_12_min_base(self): expected = 5 digit = 12 assert expected == min_base(digit)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_digit_14_min_base(self):\n expected = 6\n digit = 14\n\n assert expected == min_base(digit)", "def test_single_digit_min_base(self):\n expected = 2\n digit = 1\n\n assert expected == min_base(digit)", "def modifier(base):\n return int(math.floor((base - 10)...
[ "0.68628234", "0.6560506", "0.5813826", "0.5736882", "0.570259", "0.5691976", "0.55865026", "0.5557803", "0.5555295", "0.54997677", "0.5392188", "0.5373415", "0.5369537", "0.5350108", "0.5335272", "0.53054", "0.5272494", "0.52332306", "0.52300835", "0.5220331", "0.5219849", ...
0.7900096
0
Get age of guitar.
def get_age(self): return CURRENT_YEAR - self.year
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_age(self):\n return Guitar.CURRENT_YEAR - self.year", "def get_age(self):\n\t\treturn self.age", "def get_age(self):\n return self.glb[iage]", "def get_age(self):\r\n return self.age", "def get_age(self) -> int:\n return self.age", "def get_age(self):\n age = CU...
[ "0.84469885", "0.77584475", "0.76878345", "0.76566404", "0.7651083", "0.757051", "0.75521964", "0.7512939", "0.7494675", "0.74860406", "0.74860406", "0.74860406", "0.7465721", "0.7459379", "0.7441809", "0.7420463", "0.74136597", "0.73773193", "0.72822326", "0.71942484", "0.71...
0.7481775
13
Determine if a guitar is vintage or not based on VINTAGE_AGE.
def is_vintage(self): return self.get_age() >= VINTAGE_AGE
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_vintage(self):\n return self.get_age() >= Guitar.VINTAGE_THRESHOLD", "def is_vintage(self):\n if self.get_age() >= 50: # Vintage age\n return True\n return False", "def is_vintage(self):\n return self.get_age()>=AGE", "def is_vintage(self):\n age = 2021 - se...
[ "0.832738", "0.75377995", "0.7394848", "0.7333356", "0.6236142", "0.5974915", "0.5697499", "0.5643358", "0.55941826", "0.55859154", "0.5560587", "0.54579747", "0.5406493", "0.5402945", "0.5399041", "0.5333284", "0.523712", "0.52107376", "0.5187122", "0.51752293", "0.51722413"...
0.7666413
2
obj.__init__(...) initializes obj; see help(type(obj)) for signature
def __init__(self, *args): from collections import OrderedDict new_dict = {} for x, y in enumerate(args): new_dict.update({x: y}) new_dict = OrderedDict(sorted(new_dict.items())) self.__dict__ = new_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init(self, *args, **kwds):\n pass", "def set_init_args(self, args_obj):\n if self and self[0][0] == '__init__':\n print(\"Only one __init__ step is allowed\")\n return\n self.insert(0, ('__init__', args_obj))", "def __init__(self, **params):\n self.__ob...
[ "0.74114347", "0.72835857", "0.7122263", "0.70239025", "0.70239025", "0.7010381", "0.7010381", "0.7010381", "0.7010381", "0.7010381", "0.7010381", "0.7010381", "0.7010381", "0.7010381", "0.7010381", "0.7010381", "0.7010381", "0.7010381", "0.7010381", "0.7010381", "0.7010381",...
0.0
-1
open a new figure and display the loaded image in the converted representation.
def imdisplay(filename, representation): im = read_image(filename, representation) if representation == 1: plt.imshow(im, cmap='gray') plt.show() if representation == 2: plt.imshow(im) plt.show()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subplot_to_figure(self):\n if self.format is \"show\":\n plt.show()\n elif self.format is \"png\":\n plt.savefig(self.path + self.filename + \".png\", bbox_inches=\"tight\")", "def imdisplay(filename, representation):\n\n image = read_image(filename, representation)\n ...
[ "0.66956806", "0.6405337", "0.636238", "0.6325579", "0.62663305", "0.626412", "0.624676", "0.6223937", "0.6185296", "0.61685014", "0.6145981", "0.60907847", "0.60787743", "0.6047645", "0.60255706", "0.60105425", "0.6002648", "0.5993337", "0.59828985", "0.5978824", "0.5972116"...
0.6192071
8
performs histogram equalization of a given grayscale or RGB image
def histogram_equalize(im_orig): shape_len = len(im_orig.shape) if shape_len == 2: # grayscale return histogram_equalization_helper(im_orig) elif shape_len == 3 and im_orig.shape[2] == 3: # rgb im_yiq = rgb2yiq(im_orig) y = im_yiq[:, :, 0] y_eq, hist_orig, hist_eq = histog...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def histogram_equalization(img):\n\n if len(img.shape) == 3:\n img_copy = np.copy(img)\n\n blue = img_copy[:,:,0]\n blue = histogram_equalize(blue)\n\n green = img_copy[:,:,1]\n green = histogram_equalize(green)\n\n red = img_copy[:,:,2]\n red = histogram_equaliz...
[ "0.80710983", "0.8060736", "0.7953996", "0.784499", "0.76294863", "0.7512506", "0.74931884", "0.748234", "0.7463035", "0.7412687", "0.7380056", "0.73792684", "0.73563737", "0.7353379", "0.7348153", "0.73468316", "0.7313132", "0.7283819", "0.7242754", "0.72079515", "0.71504617...
0.77089846
4
Creates a list of ClassificationItemSequence from the output of a data loader. The data loader returns a dictionary with collated items, this function is effectively the inverse.
def from_minibatch(minibatch: Dict[str, Any]) -> List[ClassificationItemSequence[ScalarItem]]: # batched is a de-generate ClassificationItemSequence, with id being a list of strings, and items being # a list of lists. batched = ClassificationItemSequence(**minibatch) return [Classificati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collate(items):\n # return batch items as a list\n return items", "def dict_collate(data):\n\n # Assuming there's at least one instance in the batch\n add_data_keys = data[0].keys()\n collected_data = {k: [] for k in add_data_keys}\n\n for i in range(len(list(data))):\n for k...
[ "0.62159747", "0.5501741", "0.549408", "0.54202926", "0.5394621", "0.5315256", "0.52561593", "0.5223887", "0.51632464", "0.51610637", "0.512795", "0.50298715", "0.50278896", "0.50274587", "0.5013698", "0.49944237", "0.49936005", "0.49602675", "0.49587265", "0.49348116", "0.49...
0.4938196
19
Gets the label fields for the sequence elements with the given zerobased indices, if they exist otherwise fill with NaN.
def get_labels_at_target_indices(self, target_indices: List[int]) -> torch.Tensor: target_indices = sorted(target_indices) def _get_label_or_nan(idx: int) -> torch.Tensor: return self.items[idx].label if idx < len(self.items) else torch.tensor([np.nan]) if any(p < 0 for p in target...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _label_generation(self, indexes):\n data = self.data.iloc[indexes]\n return np.array(data['peak_flux'])", "def _get_labels(self, label_vector):\n return () if label_vector is None else \\\n list(OrderedDict.fromkeys([label for term in label_vector \\\n for label...
[ "0.53191304", "0.49740028", "0.49389085", "0.49379084", "0.49303827", "0.4921169", "0.49067825", "0.48916012", "0.48315224", "0.47929028", "0.4785119", "0.4772437", "0.47671595", "0.47281677", "0.46998045", "0.46994752", "0.4698416", "0.46677098", "0.4638665", "0.4628398", "0...
0.47653604
13
Custom validator to ensure no duplicate users
def email_exists(form, field): if User.select().where(User.email == field.data).exists(): raise ValidationError('A user with that E-mail already exists.')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_unique(self, exclude=None, **kwargs):\n return super().validate_unique(exclude=exclude, user=self.user)", "def validate_unique(self, exclude=None):\n MyUser.objects.filter(email=self.email, is_active=False).delete()\n super(MyUser, self).validate_unique(exclude)", "def check_u...
[ "0.75998574", "0.6920855", "0.68487024", "0.6767753", "0.6609057", "0.655036", "0.6546512", "0.6524562", "0.6511921", "0.65045923", "0.649843", "0.6493294", "0.64857167", "0.6450199", "0.64436674", "0.6412568", "0.63727725", "0.6369219", "0.6350658", "0.6328337", "0.63271064"...
0.0
-1
Returns the minimum path sum from root to a leaf. For example, the minimum path in this tree is [10, 5, 1, 1], which has sum 15. 10 / \ 5 5 | | 2 1 / 1
def minimum_path_sum(self, root) -> int: def minimum_path_sum_aux(root, path=None): path.append(root.value) new_path = path[:] # Stop condition if root.is_leaf(): return else: if root.left is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_depth(t):\n if is_leaf(t):\n return 0\n h = float('inf')\n for b in branches(t):\n # Still works fine!\n h = min(h, 1 + min_depth(b))\n return h", "def minDepth(self, root: TreeNode) -> int:\n return self.bfs(root)", "def max_single_path(self, root: Optional[TreeNode...
[ "0.6976607", "0.6895128", "0.66671705", "0.6653948", "0.6637505", "0.6618621", "0.6516666", "0.64048195", "0.6392322", "0.63633066", "0.6349397", "0.629449", "0.6274608", "0.6259616", "0.6218573", "0.62072426", "0.60357225", "0.60211045", "0.59939396", "0.59901595", "0.598875...
0.85443187
0
Decorator for views that checks that the user passes the given test, redirecting to the login page if necessary. The test should be a callable that takes the user object and returns True if the user passes.
def user_passes_test(test_func, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME): if not login_url: login_url = LOGIN_URL def decorator(view_func): def _wrapped_view(request, *args, **kwargs): if test_func(request): return view_func(request, *args, **kwa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_passes_test(test_func, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME):\n if not login_url:\n login_url = settings.LOGIN_URL\n\n def decorator(view_func):\n def _wrapped_view(request, *args, **kwargs):\n if test_func(request):\n return view_func(re...
[ "0.81273854", "0.7381807", "0.73482054", "0.72734046", "0.7270463", "0.72175115", "0.72175115", "0.7205731", "0.7179196", "0.716704", "0.71667445", "0.71552765", "0.71374995", "0.7130772", "0.7118831", "0.70776236", "0.7057909", "0.70545197", "0.70490575", "0.70335615", "0.70...
0.8669284
0
Return the block to which the byte at index i belongs.
def ith_byte_block(block_size: int, i: int) -> int: assert block_size > 0 assert i >= 0 return i // block_size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, i):\n\t\treturn self._blocks[i]", "def get_block(self, idx):\n self.input_file.seek(idx * self.blocksize)\n return self.input_file.read(self.blocksize)", "def bytes_to_block(block_size: int, i: int) -> slice:\n return slice(0, block_size * (i + 1))", "def bytes_in_block...
[ "0.7340389", "0.7205009", "0.70781714", "0.7045041", "0.68863803", "0.66096956", "0.6457288", "0.62974566", "0.6244955", "0.6227672", "0.61692", "0.61403096", "0.608539", "0.6083282", "0.60359263", "0.59770757", "0.5969087", "0.5961824", "0.592703", "0.5893195", "0.58725035",...
0.7076991
3
A naive padding implementation. Given the block size, pad the input buffer with '\x00' bytes, so that the result is a multiple of the specified size. If the buffer is greater than 0, but already a multiple of `size` it's returned unmodified.
def naive_block_padding(b: bytes, size: int) -> bytes: assert size <= 0xff l = len(b) if l > 0 and l % size == 0: return b return b + b'\x00' * (size - (l % size))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Pad(value, block_size):\n assert block_size < 256\n pad_length = block_size - (len(value) % block_size)\n if not pad_length:\n # Always pad at least 1 block.\n pad_length = block_size\n padding = [random.randint(0, 255) for _ in range(pad_length)]\n padding[-1] = len(padding)\n padding = struct.pac...
[ "0.70165694", "0.65415794", "0.65264106", "0.6474348", "0.64708847", "0.6293283", "0.6265598", "0.6215768", "0.61022586", "0.6072546", "0.6051565", "0.5936931", "0.59051484", "0.5872826", "0.5849457", "0.583683", "0.58303237", "0.5825839", "0.5821051", "0.57902086", "0.577236...
0.83171093
0
Return the UTC Time of the last update for this node.
def last_update(self): return self._last_update
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_update_time(self):\n return self.last_update_time", "def last_update_time(self):\n return self._last_update_time", "def last_updated_time(self) -> datetime.datetime:\n return self.__last_updated_time", "def last_updated_time(self) -> datetime.datetime:\n return self._...
[ "0.86699593", "0.85909396", "0.83293694", "0.83293694", "0.82538307", "0.8226969", "0.8213794", "0.817445", "0.8151288", "0.79950815", "0.79944503", "0.79944503", "0.7985233", "0.7917114", "0.7901201", "0.77776587", "0.7775041", "0.7770254", "0.77681625", "0.7750907", "0.7716...
0.77841896
15
Return the Variable Precision.
def prec(self): return self._prec
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision(self):\n tpos, fpos = len(self.__true_positives), len(self.__false_positives)\n return float(tpos) / (tpos + fpos)", "def get_precision(self):\n ...", "def precision(self) :\n return self.__precision", "def precision(self) :\n return self.__precision", "def ...
[ "0.7369161", "0.7258463", "0.7169737", "0.7169737", "0.70004386", "0.695643", "0.6953954", "0.6934594", "0.68523765", "0.6820628", "0.6797631", "0.6795661", "0.67924666", "0.66953534", "0.66816366", "0.6631705", "0.6629141", "0.65917474", "0.6564887", "0.65547985", "0.6491633...
0.7183644
2
Function that does the transformation of a MIMO transfer function to a statespace model.
def mtf2ss(G): # Description to help the user # calculating the number of outputs p = len(G) # calculating the number of inputs m = len(G[0]) # creating a list for each matrix A = [] B = [] C = [] D = [] nss = 0 # loop that get the SISO state-space transformations ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, x):\n return torch.mm(x, self.matrixS)", "def forward(self, state):\n x = self._format(state)\n x = self.activation_fc(self.input_layer(x))\n for hidden_layer in self.hidden_layers:\n x = self.activation_fc(hidden_layer(x))\n x = self.output_layer(x...
[ "0.5455332", "0.5412556", "0.53700584", "0.5354151", "0.5343223", "0.5263439", "0.52409655", "0.5220827", "0.51881456", "0.5185633", "0.5157912", "0.5157735", "0.51349413", "0.5131477", "0.5121507", "0.5115568", "0.5115541", "0.51097274", "0.5103481", "0.50699323", "0.5063509...
0.58319175
0
Creates an instance of this model from a dictionary
def from_dictionary(cls, dictionary): if dictionary is None: return None # Extract variables from the dictionary wind_speed = dictionary.get('windSpeed') power = dictionary.get('power') # Return an object of this model return cls(wind...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n # Extract variables from the dictionary\n id = dictionary.get('id')\n name = dictionary.get('name')\n mtype = dictionary.get('type')\n usage_bytes = diction...
[ "0.83181584", "0.8168118", "0.8168118", "0.8118749", "0.8089047", "0.79787344", "0.7949278", "0.79231393", "0.7898951", "0.78923255", "0.788838", "0.7882321", "0.7882212", "0.7876749", "0.78585315", "0.7836853", "0.7801407", "0.7801407", "0.7801407", "0.7801407", "0.7801407",...
0.76302916
74
Converts distance given in feet, nautical miles, statue miles etc. to distance in meters
def distance2m(d, unit): if unit == UOM_M: d_m = d elif unit == UOM_KM: d_m = d * 1000 elif unit == UOM_F: d_m = d * F_FEET2M elif unit == UOM_SM: d_m = d * F_SM2M elif unit == UOM_NM: d_m = d * F_NM2M return d_m
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_meters(d, d_unit):\n if d_unit == UOM_M:\n dm = d\n elif d_unit == UOM_KM:\n dm = d * 1000\n elif d_unit == UOM_FEET:\n dm = feet2m(d)\n elif d_unit == UOM_SM:\n dm = SM2m(d)\n elif d_unit == UOM_NM:\n dm = NM2m(d)\n return dm", "def meters_to_miles(met...
[ "0.7152427", "0.7101094", "0.70066583", "0.6994092", "0.68908125", "0.6875249", "0.6846908", "0.6824611", "0.68166095", "0.67443156", "0.6739742", "0.66894317", "0.66883713", "0.6622991", "0.6531283", "0.6522354", "0.6466061", "0.6447896", "0.6412869", "0.6404517", "0.6402178...
0.70748186
2
Returns the ship count of all Fleet objects in this set
def ship_count(self): return sum(f.ship_count for f in self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_active_ships_count(self):\n active_ship_count = 0\n for row_index in range(self.rows):\n for column_index in range(self.columns):\n cell = self.grid[row_index][column_index]\n if cell.has_active_ship():\n active_ship_count += 1\n\n ...
[ "0.7439754", "0.7292249", "0.6891802", "0.6331213", "0.6320823", "0.6243501", "0.61365724", "0.6089166", "0.6058078", "0.60143656", "0.60038716", "0.6002114", "0.60006964", "0.5988058", "0.5968548", "0.59447414", "0.5932767", "0.5919404", "0.5915653", "0.5890712", "0.5857965"...
0.88019377
0
Returns an iterator that yields tuples of (turns_to_wait, Attacks) for all Subfleets that arrive in this many turns in ascending order (use reverse=True for descending).
def arrivals(self, reverse=False): turn_getter = attrgetter("turns_to_wait") for k, attacks in groupby(sorted(self, key=turn_getter, reverse=reverse), turn_getter): yield (k, Attacks(attacks))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def available_moves(self):\n\n heaps = range(len(self.heaps))\n return [(h, take) for h in range(len(self.heaps))\n for take in range(1, self.heaps[h] + 1)]", "def _get_children(self) -> Sequence[\"HallwayState\"]:\n if self.cur_pos < self.end_pos:\n if se...
[ "0.5195459", "0.5156163", "0.5128677", "0.51036954", "0.5094777", "0.50646555", "0.5048493", "0.5037157", "0.5025919", "0.49986604", "0.4967178", "0.49644658", "0.4949757", "0.4949631", "0.49480528", "0.4945935", "0.4902823", "0.49011064", "0.4890652", "0.4874848", "0.4856353...
0.7062301
0
Get the command line argument parser.
def get_argparser(): parser = argparse.ArgumentParser("garc") parser.add_argument('command', choices=commands) parser.add_argument('query', nargs='?', default=None) parser.add_argument("--log", dest="log", default="garc.log", help="log file") parser.add_argument("--user_acco...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_parser():\n\n parser = parser.ArgumentParser()\n return parser", "def get_parser():\n p = argparse.ArgumentParser(description='such a good program')\n p.add_argument('infile')\n p.add_argument('outfile')\n return p", "def get_parser():\n parser = ArgumentParser(\n de...
[ "0.8364347", "0.7911477", "0.7806405", "0.7735775", "0.7735775", "0.7635095", "0.7612216", "0.7570724", "0.75698674", "0.7545961", "0.7544787", "0.74788755", "0.74788755", "0.7467801", "0.7435268", "0.74284303", "0.738965", "0.7388834", "0.7374183", "0.7345834", "0.73301214",...
0.0
-1
cast(itkLightObject obj) > itkHalfHermitianToRealInverseFFTImageFilterICF2IF2
def cast(obj: 'itkLightObject') -> "itkHalfHermitianToRealInverseFFTImageFilterICF2IF2 *": return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_cast(obj: 'itkLightObject') -> \"itkHalfHermitianToRealInverseFFTImageFilterICF2IF2 *\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkHa...
[ "0.8758252", "0.8369405", "0.82023007", "0.7600542", "0.75206214", "0.7492559", "0.74633193", "0.7455476", "0.7385218", "0.7378154", "0.7370113", "0.7342949", "0.7299217", "0.72991484", "0.72808546", "0.7278873", "0.72355413", "0.7199508", "0.71967554", "0.71873283", "0.71853...
0.87814647
0
New() > itkHalfHermitianToRealInverseFFTImageFilterICF2IF2 Create a new object of the class itkHalfHermitianToRealInverseFFTImageFilterICF2IF2 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new ob...
def New(*args, **kargs): obj = itkHalfHermitianToRealInverseFFTImageFilterICF2IF2.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkSquaredDifferenceImageFilterIF2IF2IF2.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkHalfHermitianToRealInverseFFTImageFilterICF3IF3.__New_orig__()\n impor...
[ "0.7311116", "0.72815", "0.72209346", "0.7205358", "0.7124789", "0.7123721", "0.71095455", "0.71008086", "0.705505", "0.7032606", "0.70307887", "0.7022936", "0.70089126", "0.697373", "0.69708544", "0.69626844", "0.6954855", "0.69405806", "0.69339013", "0.6925278", "0.69092274...
0.8440965
0
itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_cast(itkLightObject obj) > itkHalfHermitianToRealInverseFFTImageFilterICF2IF2
def itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_cast(obj: 'itkLightObject') -> "itkHalfHermitianToRealInverseFFTImageFilterICF2IF2 *": return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkHalfHermitianToRealInverseFFTImageFilterICF2IF2 *\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 *...
[ "0.9269122", "0.84515977", "0.8448534", "0.79274684", "0.7901587", "0.78621644", "0.7820546", "0.77878016", "0.7710905", "0.7688822", "0.7686142", "0.76826346", "0.7652696", "0.7630173", "0.7629605", "0.7621622", "0.76134014", "0.76103306", "0.76072913", "0.75988936", "0.7579...
0.94871765
0
SetActualXDimensionIsOddInput(itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 self, itkSimpleDataObjectDecoratorB _arg)
def SetActualXDimensionIsOddInput(self, _arg: 'itkSimpleDataObjectDecoratorB') -> "void": return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_SetActualXDimensionIsOddInput(self, _arg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetActualXDimensionIsOddInput(self, _arg: 'itkSimpleDataObjectDecoratorB') -> \"void\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_SetActualXDimensionIsOddInput(self, _arg)", "def GetActualXDimensionIsOddInput(self) -> \"itkSimpleData...
[ "0.9123958", "0.8442863", "0.8440207", "0.8404514", "0.83800495", "0.7514097", "0.75077826", "0.6148815", "0.5708541", "0.57080245", "0.5218581", "0.52097803", "0.49215868", "0.49215868", "0.49037904", "0.4875511", "0.48751906", "0.48587048", "0.48545232", "0.48149854", "0.48...
0.9243138
0
GetActualXDimensionIsOdd(itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 self) > bool const &
def GetActualXDimensionIsOdd(self) -> "bool const &": return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_GetActualXDimensionIsOdd(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetActualXDimensionIsOdd(self) -> \"bool const &\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_GetActualXDimensionIsOdd(self)", "def GetActualXDimensionIsOddInput(self) -> \"itkSimpleDataObjectDecoratorB const *\":\n return _it...
[ "0.90134573", "0.8116078", "0.8011804", "0.8007661", "0.78912485", "0.7518797", "0.7378851", "0.5830744", "0.5698672", "0.55729944", "0.5495327", "0.54534477", "0.5449673", "0.54046744", "0.5294553", "0.5243625", "0.52380204", "0.51997244", "0.5157646", "0.51447916", "0.51310...
0.9105638
0
cast(itkLightObject obj) > itkHalfHermitianToRealInverseFFTImageFilterICF3IF3
def cast(obj: 'itkLightObject') -> "itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 *": return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_cast(obj: 'itkLightObject') -> \"itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 *\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkHa...
[ "0.8754373", "0.84519255", "0.8329674", "0.74115735", "0.73911655", "0.7372709", "0.73513615", "0.73473054", "0.7336441", "0.73128325", "0.72939885", "0.72838974", "0.72707695", "0.72588015", "0.72561187", "0.72537726", "0.72531945", "0.72531515", "0.7238233", "0.72148824", "...
0.88050354
0
New() > itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 Create a new object of the class itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new ob...
def New(*args, **kargs): obj = itkHalfHermitianToRealInverseFFTImageFilterICF3IF3.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkHuangThresholdImageFilterIF3ISS3.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkCosImageFilterIF3IF3.__New_orig__()\n import itkTemplate\n itkTempla...
[ "0.74215084", "0.7370187", "0.736912", "0.73665327", "0.73401374", "0.7301532", "0.7293052", "0.72928876", "0.7292436", "0.72576916", "0.7249076", "0.7237967", "0.720986", "0.7209201", "0.71870464", "0.7181294", "0.7172013", "0.7157828", "0.7155288", "0.7106769", "0.7103403",...
0.83887285
0
itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_cast(itkLightObject obj) > itkHalfHermitianToRealInverseFFTImageFilterICF3IF3
def itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_cast(obj: 'itkLightObject') -> "itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 *": return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkHalfHermitianToRealInverseFFTImageFilterICF3IF3 *\":\n return _itkHalfHermitianToRealInverseFFTImageFilterPython.itkHalfHermitianToRealInverseFFTImageFilterICF3IF3_cast(obj)", "def itkHalfHermitianToRealInverseFFTImageFilterICF2IF2_cast(obj: 'itkLightObject') -> \"i...
[ "0.91791695", "0.8398635", "0.8379627", "0.78276956", "0.77661604", "0.77512765", "0.774406", "0.77390754", "0.76507497", "0.7648699", "0.7641291", "0.7640236", "0.76136947", "0.760601", "0.76036775", "0.75992405", "0.75864094", "0.7560299", "0.7546588", "0.75093377", "0.7489...
0.9441769
0
Initialize empty, last node is None.
def test_initialization_with_empty_list_last_node_check(): queue = Queue([]) assert queue._queue.last_node is None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n\n\t\tself.root = None\n\t\tself.numNodes = 0", "def __init__(self):\n self._head = self._Node(None, None, None)\n self._tail = self._Node(None, None, None)\n self._head._next = self._tail\n self._tail._prev = self._head\n self._size = 0", "def __init__(s...
[ "0.72414404", "0.72259074", "0.71184075", "0.71113735", "0.71018976", "0.7051051", "0.70500505", "0.7000527", "0.6976001", "0.69459164", "0.6927554", "0.6877331", "0.6854051", "0.6824747", "0.6818185", "0.6798736", "0.67981714", "0.67902935", "0.67878264", "0.67878264", "0.67...
0.0
-1
Initialize one charicter itterable, first node is val.
def test_initialization_with_list_first_node_val(): queue = Queue('a') assert queue._queue.first_node == 'a'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(cell, value):\n\t\tcell.value = value\n\t\tcell.parent = None\n\t\tcell.visited = False", "def __init__(self, val):\n\n\t\tself.val = val\n\t\tself.left = None\n\t\tself.right = None", "def __init__(self):\n self.root = [None, dict(), False] # val, sons, end-able", "def __init__(self, val...
[ "0.6433613", "0.64173347", "0.626479", "0.62530535", "0.6226449", "0.61980516", "0.6193173", "0.6132395", "0.61198527", "0.6118368", "0.6101299", "0.6082775", "0.59962827", "0.5964482", "0.5883418", "0.58710074", "0.5836092", "0.58093303", "0.58093303", "0.57973003", "0.57847...
0.0
-1
Initialize two charicter itterable, first node is first char.
def test_initialization_with_two_items_first_node_val(): queue = Queue('ab') assert queue._queue.first_node == 'a'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, chars):\n self.chars = sorted(set(chars))\n self.char_indices = dict((c, i) for i, c in enumerate(self.chars))\n self.indices_char = dict((i, c) for i, c in enumerate(self.chars))", "def __init__(self, chars):\n self.chars = sorted(set(chars))\n s...
[ "0.6215362", "0.6186459", "0.6186459", "0.6166508", "0.60356486", "0.5984807", "0.58856267", "0.5670271", "0.5638243", "0.5599553", "0.5569989", "0.5392279", "0.53860754", "0.5363656", "0.5338391", "0.53375447", "0.52785677", "0.52714443", "0.5267104", "0.5227837", "0.5209828...
0.0
-1
Initialize two charicter itterable, first node is first char.
def test_initialization_with_two_items_last_node_val(): queue = Queue('ab') assert queue._queue.last_node == 'b'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, chars):\n self.chars = sorted(set(chars))\n self.char_indices = dict((c, i) for i, c in enumerate(self.chars))\n self.indices_char = dict((i, c) for i, c in enumerate(self.chars))", "def __init__(self, chars):\n self.chars = sorted(set(chars))\n s...
[ "0.62134194", "0.61846", "0.61846", "0.61653304", "0.6032911", "0.59830165", "0.58844", "0.5667955", "0.5636889", "0.5596977", "0.55669904", "0.5391777", "0.53840554", "0.5364721", "0.5339288", "0.533653", "0.5279634", "0.5270864", "0.5266606", "0.5226547", "0.52091783", "0...
0.0
-1
Enqueue(val), peak = val, node not removed(last_node is val).
def test_peak_returns_value_does_not_dequeue(): queue = Queue('a') a = queue.peak() assert queue._queue.last_node == 'a'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enqueue(self, val):\n\n if self.front is None:\n self.back = self.front = Node(val)\n self._size += 1\n else:\n self.back._next = self.back = Node(val)\n self._size += 1\n return self.back", "def enqueue(self, value): ################# <-\n ...
[ "0.7267571", "0.71198046", "0.71198046", "0.68370795", "0.68134886", "0.6758763", "0.67357445", "0.67254615", "0.66973007", "0.6693444", "0.6684631", "0.6636559", "0.6475878", "0.64465404", "0.642369", "0.63993365", "0.6378644", "0.6346149", "0.63368315", "0.63279337", "0.632...
0.642635
14
Size of new queue is 0.
def test_size_of_new_queue(): queue = Queue() assert queue.size() == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_size_empty(the_queue):\n assert the_queue.size() == 0", "def test_new_queue_is_empty(self):\n queue = Queue_()\n self.assertTrue(queue.empty())\n self.assertEqual(queue.size(), 0)", "def test_size(self):\n queue = Queue()\n self.assertEqual(queue.size(), 0)\n queue.enq...
[ "0.749195", "0.7395883", "0.727389", "0.7206155", "0.7155715", "0.7155715", "0.70977354", "0.7025954", "0.7025954", "0.69922", "0.69795096", "0.6951921", "0.6944076", "0.6941982", "0.694079", "0.6927224", "0.692247", "0.69112027", "0.69060826", "0.68897873", "0.68897873", "...
0.80333865
0
Dequeu, size of dll is 0.
def test_size_stays_with_dequeue_error(): queue = Queue() with pytest.raises(IndexError): queue.dequeue() assert queue.size() == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.deque = []", "def __init__(self):\n self._deque = []", "def __init__(self):\r\n self.deque = deque()", "def __init__(self):\n self.container = collections.deque()", "def __init__(self):\n \n self.elements = deque()", "def full_deque():\...
[ "0.6597113", "0.65373707", "0.63711333", "0.63338816", "0.6305421", "0.62364256", "0.61025685", "0.6091689", "0.6090377", "0.6086433", "0.602903", "0.5973189", "0.5962172", "0.5950778", "0.59440386", "0.59440386", "0.59440386", "0.59440386", "0.5939154", "0.59387696", "0.5913...
0.0
-1
Takes a pandas Series of lists containing datetime string information and approximates datetime. Returns Datetime type
def approx_date(date): if isinstance(date, float): log2.info(f'Failed to parse: {date}') return pd.Timestamp(pd.np.nan) try: if len(date) == 1: return pd.to_datetime(date[0], errors='coerce') elif len(date) == 2: time1 = pd.to_datetime(date[0]) time2 = pd.to_datetime(re.findall(r"\d+/\d+/\d+", d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _convert_datetimes(sas_datetimes: pd.Series, unit: str) -> pd.Series:\n try:\n return pd.to_datetime(sas_datetimes, unit=unit, origin=\"1960-01-01\")\n except OutOfBoundsDatetime:\n s_series = sas_datetimes.apply(_parse_datetime, unit=unit)\n s_series = cast(pd.Series, s_series)\n ...
[ "0.73075545", "0.6850342", "0.6219565", "0.617993", "0.6132479", "0.6116655", "0.60889006", "0.6015967", "0.60076225", "0.59266686", "0.5920088", "0.58810025", "0.5838859", "0.5820059", "0.5812186", "0.5741816", "0.56973267", "0.5697111", "0.568061", "0.56392956", "0.5638831"...
0.5829081
13
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix inorder arguments and keyword arguments.
def __init__(self, *args, **kwds): if args or kwds: super(Track, self).__init__(*args, **kwds) # message fields cannot be None, assign default values for those that are if self.header is None: self.header = std_msgs.msg.Header() if self.status is None: self.status = 0 i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwds):\n if args or kwds:\n super(KomodoSpeechRecCommand, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.header is None:\n self.header = std_msgs.msg.Header()\n if self.cmd is None:\n ...
[ "0.77950794", "0.7720336", "0.7720336", "0.7686725", "0.7626082", "0.75635314", "0.7439626", "0.74171734", "0.73522437", "0.7308215", "0.72808266", "0.7238561", "0.7227589", "0.7224258", "0.7224258", "0.7219543", "0.7211657", "0.7211657", "0.7211657", "0.7211657", "0.7211657"...
0.0
-1
Reads source and target sequences from txt files.
def __init__(self, data_info, slot_temp): self.ID = data_info['ID'] self.turn_domain = data_info['turn_domain'] self.turn_id = data_info['turn_id'] self.dialog_history = data_info['dialog_history'] self.turn_belief = data_info['turn_belief'] self.gating_label = data_info[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_examples(source_file, target_file):\n sources = []\n targets = []\n\n with gfile.GFile(source_file, \"r\") as txt_file:\n for line in txt_file:\n sources.append(line.rstrip(\"\\n\"))\n\n with gfile.GFile(target_file, \"r\") as txt_file:\n for line in txt_file:\n targets.append(line.rst...
[ "0.7004346", "0.6208018", "0.61497456", "0.6132846", "0.6076196", "0.60475314", "0.6025892", "0.5775756", "0.56896174", "0.5674089", "0.5657116", "0.56105125", "0.5501782", "0.5494425", "0.5476749", "0.5456228", "0.54284465", "0.54284143", "0.5420703", "0.5415088", "0.5394724...
0.0
-1
Use this method to stop updating a live location message sent by the bot or via the bot (for inline bots) before live_period expires.
async def stop_message_live_location(self, chat_id: typing.Union[base.Integer, base.String, None] = None, message_id: typing.Union[base.Integer, None] = None, inline_message_id: typing.Union[base.S...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop_periodic_update(self) -> None:\n self._stop_periodic_update()", "def _on_hass_stop(_: Event) -> None:\n cancel_update_stale()", "async def stop(self):\n self.updater.cancel()\n await self._update_once()", "async def stop(self, update: Update, context: ContextTypes.DEFAULT...
[ "0.6155753", "0.5895458", "0.5747896", "0.5693154", "0.5670761", "0.55502456", "0.5538108", "0.5527087", "0.55210924", "0.54891187", "0.5444661", "0.5444661", "0.54177076", "0.5412793", "0.54091173", "0.53680605", "0.53329235", "0.53192765", "0.5312744", "0.53035265", "0.5296...
0.57333755
3
Use this method to get the number of members in a chat.
async def get_chat_members_count(self, chat_id: typing.Union[base.Integer, base.String]) -> base.Integer: payload = generate_payload(**locals()) result = await self.request(api.Methods.GET_CHAT_MEMBERS_COUNT, payload) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_members_count(self, *args, **kwargs):\n return self.bot.get_chat_members_count(self.id, *args, **kwargs)", "async def membercount(ctx, *args):\n if ctx.message.channel.is_private:\n await bot.delete_message(ctx.message)\n return\n\n g = ctx.message.server\n\n gid = g.id\n ...
[ "0.8535938", "0.7045512", "0.70038784", "0.6915813", "0.68333334", "0.6814858", "0.67744184", "0.6622566", "0.6590299", "0.6495557", "0.6487808", "0.64398223", "0.6420605", "0.6212519", "0.60859007", "0.60826516", "0.6045725", "0.60334086", "0.60332364", "0.59774727", "0.5962...
0.8165247
1
return the size of the tree of x
def size(self,x): assert x in self return self.__size[self.find(x)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tree_length(x):\n length = list(self.__plan_graph.objects(subject=x, predicate=AGORA.length)).pop()\n return length", "def size(self) -> int:\n #binary search tree == empty\n if self.root is None:\n return 0\n\n #recursive helper count nodes\n...
[ "0.807432", "0.77441394", "0.7724502", "0.7661841", "0.76564497", "0.7577512", "0.75335836", "0.7499747", "0.7364961", "0.7301723", "0.72613984", "0.72027236", "0.7202584", "0.71721977", "0.71397454", "0.71374506", "0.71170855", "0.71165377", "0.71134734", "0.7101822", "0.707...
0.67673576
35
Defines the training, validation, and testing image directories and applies the relevant transforms. Returns dataloader objects for each. Note that dataloader objects are generators.
def load_data(data_dir): #Define training, validation, and testing directories, structured for use with ImageFolder Class train_dir = data_dir + '/train' valid_dir = data_dir + '/valid' test_dir = data_dir + '/test' #Define image transforms for training, validation, and testing trainin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataloaders():\n # train data path\n data_train = '../dataset/train/'\n # set transformations\n train_transforms = transforms.Compose([\n transforms.Resize((224, 224)),\n transforms.ToTensor(),\n transforms.Normalize([0.485, 0.456, 0.406],\n ...
[ "0.7603804", "0.75280523", "0.7414563", "0.73723507", "0.7318426", "0.72334963", "0.7076811", "0.70609415", "0.7023902", "0.7004058", "0.6925027", "0.69104624", "0.6809408", "0.68047667", "0.6794561", "0.6794536", "0.67483276", "0.67399555", "0.6736851", "0.67274797", "0.6694...
0.69856274
10
piecewise boundary condition from dict(boundary = value) where value is a dolfin.GenericFunction. will wrap with dolfin.Constant is input is a number/tuple, and do nothin if value is None.
def pwBC(self, V, string, homogenize=False, value=None): value = self._getvalue(string, value) #print "DEBUG:", value if isinstance(value, dict): # TODO: get rid of homogenize (it is only used for PB and is ugly, because assumes scalar pde) if homogenize: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _process_individual_bound(self, val):\n if(val not in [True, False]):\n raise ValueError('For composition bounds expected are iether True' \n '(free function) or False (fixed function) not %s' % (str(val)))\n return val", "def piecewise_constant(x, boundaries, values, ...
[ "0.64088684", "0.613178", "0.59904015", "0.55963933", "0.55792433", "0.5427714", "0.54212415", "0.5403506", "0.52785987", "0.52424794", "0.5230323", "0.5204102", "0.5189807", "0.51649636", "0.5155138", "0.51393104", "0.5134471", "0.5127572", "0.5125713", "0.50998145", "0.5097...
0.5798635
3
Test for successful password strength validation.
def test_password_strength_validator(self): self.assertIsNone(validate_password_strength('abcd123'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_password_strength():\r\n\r\n password_regex = re.compile(r'''(\r\n (?=.*[A-Z]{2})\r\n (?=.*[a-z]{3})\r\n (?=.*[/!@#$%^&_*+'\\\"-?.:;<>,])\r\n (?=.*[0-9])\r\n .{8,}\r\n )''', re.VERBOSE)\r\n\r\n get_password(password_regex)", "def test_password_strength_va...
[ "0.811253", "0.7808661", "0.7498085", "0.7460592", "0.7393634", "0.73335767", "0.73282", "0.71243334", "0.70749134", "0.69481057", "0.6916921", "0.6855777", "0.6833095", "0.6819363", "0.68002194", "0.67896336", "0.6761693", "0.6758369", "0.6751114", "0.6736633", "0.6694997", ...
0.85219926
0
Test for length fail password strength validation.
def test_password_strength_validator_length_fail(self): with self.assertRaises(ValidationError): validate_password_strength('hi')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_password_strength_validator(self):\n self.assertIsNone(validate_password_strength('abcd123'))", "def test01_password_length(self):\n self.set_complexity(length=13, numeric=0, upper=0, lower=0, special=0)\n\n invalid = (\n \"A\",\n \"Tr0ub4dor&3\",\n ...
[ "0.8374114", "0.80661535", "0.79859805", "0.7951157", "0.7858637", "0.77230054", "0.76463336", "0.7581791", "0.7435477", "0.73920065", "0.73624104", "0.73472536", "0.7245728", "0.7207087", "0.7175876", "0.7170261", "0.71615016", "0.7102726", "0.71006024", "0.7093672", "0.7046...
0.8685554
0