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
Test if an ATEvent object implements all relevant interfaces.
def test_implementsInterfaces(self): self.assertTrue(IEvent.providedBy(self.obj)) self.assertTrue(IEventRecurrence.providedBy(self.obj)) self.assertTrue(IATEvent.providedBy(self.obj)) self.assertTrue(IATEventRecurrence.providedBy(self.obj)) self.assertTrue(IATEvent_ATCT.provided...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hasUnoInterfaces( oObject, *cInterfaces ):\n for cInterface in cInterfaces:\n if not hasUnoInterface( oObject, cInterface ):\n return False\n return True", "def hasUnoInterfaces( oObject, *cInterfaces ):\n for cInterface in cInterfaces:\n if not hasUnoInterface( oObject, cIn...
[ "0.6279814", "0.6279814", "0.6165603", "0.6112963", "0.59556156", "0.5929444", "0.5881702", "0.58559626", "0.5817494", "0.5721367", "0.5681247", "0.5681247", "0.56597096", "0.5642392", "0.5635892", "0.5613095", "0.5574558", "0.55547416", "0.55369914", "0.5534713", "0.55184144...
0.71761626
1
Plots the standard deviation as a function of training percentages. Takes a bit of time to run.
def make_deviation_plot(num_trials=100): data = load_digits() # print data.DESCR train_percentages = range(5, 95, 1) test_accuracies = numpy.zeros(len(train_percentages)) test_sdevs = numpy.zeros(len(train_percentages)) for i in range(len(train_percentages)): individual_trial_accuracies...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_std_mean_of_each_neuron(self, title:str, show:bool=True, dest_path:str=None):\n d = Data(self.populations, self.path)\n d.split_trial_wise()\n X, x, Y, y = d.get_data()\n X = np.concatenate((X, x))\n Y = np.concatenate((Y, y))\n\n d = {}\n for i in range(le...
[ "0.6742138", "0.6663849", "0.6644901", "0.6603573", "0.6488067", "0.63766265", "0.635768", "0.63425994", "0.6321784", "0.6308115", "0.62963265", "0.6283951", "0.62477505", "0.6235579", "0.6200145", "0.61949146", "0.61919504", "0.6152787", "0.6139527", "0.6138518", "0.61363757...
0.74518573
0
Returns the value of this metric.
def result(self): if self._buffer: return self._buffer.mean(dtype=np.float32) return np.array(0.0, dtype=np.float32)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMetricValue(self):\n return self.getOrDefault(self.metricParams)", "def value(self):\n return self.compute_value()", "def value(self) -> float:\n return pulumi.get(self, \"value\")", "def value(self) -> float:\n return pulumi.get(self, \"value\")", "def metric_value(self)...
[ "0.85527354", "0.81594145", "0.80585873", "0.80585873", "0.7994095", "0.7994095", "0.7870549", "0.785694", "0.7848603", "0.78430593", "0.78245276", "0.78245276", "0.78245276", "0.77875584", "0.7776013", "0.7776013", "0.7776013", "0.7774847", "0.77735126", "0.77317226", "0.771...
0.0
-1
The CacheControl generalheader field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.
def surrogate_control(self): def on_update(surrogate_control): if not surrogate_control and "surrogate-control" in self.headers: del self.headers["surrogate-control"] elif surrogate_control: # pragma: no cover self.headers["Surrogate-Control"] = \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_header(response):\n response.cache_control.public = True\n response.headers[\"Cache-Control\"] = \"no-cache, no-store, must-revalidate\"\n response.headers[\"Pragma\"] = \"no-cache\"\n response.headers[\"Expires\"] = \"0\"\n return response", "def add_header(r):\n r.headers[\"Cache-Cont...
[ "0.6853234", "0.67490506", "0.6723761", "0.6660226", "0.66601974", "0.66601974", "0.66507816", "0.66405797", "0.66392845", "0.66392845", "0.66325253", "0.6598136", "0.6595648", "0.6595648", "0.6595648", "0.6595648", "0.6595648", "0.6595648", "0.6595648", "0.6595648", "0.65956...
0.68039256
1
Get all legal actions for current state.
def _get_legal_actions(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getLegalActions(self, state):\n return self.actionFn(state)", "def getLegalActions(self,state):\n return self.actionFn(state)", "def legal_actions(self):\n return self.env.legal_actions()", "def _get_legal_actions(self):\n return self.game.get_legal_actions()", "def getActio...
[ "0.8356039", "0.8275241", "0.82160044", "0.81928676", "0.79124784", "0.78798527", "0.7759536", "0.77369595", "0.7669449", "0.7656899", "0.75958204", "0.7442864", "0.7408284", "0.7309073", "0.72782993", "0.72772175", "0.72709537", "0.72064", "0.71978444", "0.71812433", "0.7181...
0.7682433
8
Set the default save directory for module.
def set_save_dir(dirname): global SAVE_DIR SAVE_DIR = Path(dirname) if not SAVE_DIR.exists(): print("Creating", SAVE_DIR) SAVE_DIR.mkdir() raw_dir = SAVE_DIR/RAW_SAVE_DIR if not raw_dir.exists(): print("Creating", raw_dir) raw_dir.mkdir()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_save_dir(self, new_dir):\n self.save_dir = new_dir", "def default_save_dir(save_dir_base, save_dir, task_name):\n if save_dir is None:\n save_dir = os.path.join(save_dir_base, task_name, make_unique_timestamp())\n _ = locals()\n del _", "def set_default_save_location(self):\n ...
[ "0.7289227", "0.7286592", "0.6993658", "0.69707847", "0.6831248", "0.66835773", "0.66686547", "0.65405536", "0.6524515", "0.65032667", "0.6492619", "0.64829284", "0.640209", "0.634612", "0.63027143", "0.6283045", "0.6276466", "0.6272548", "0.62400883", "0.62400883", "0.623942...
0.71548194
2
Return the accuracy rate based on dense predictions and sparse labels.
def accuracy_rate(predictions: torch.Tensor, labels: torch.Tensor) -> float: assert len(predictions) == len(labels), "Predictions and labels must have the same length." assert len(labels.shape) == 1, "Labels must be a column vector." return ( # type: ignore float((predictions.argmax(1) == labels.t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accuracy(preds, labels):\n correct = preds == labels\n return correct.sum().float() / correct.shape[0]", "def accuracy(predictions, test_labels):\n return f1_score(test_labels, predictions, average='micro') * 100", "def accuracy(predictions, labels):\n return (100.0 * np.sum(np.argm...
[ "0.76300937", "0.74029756", "0.7306407", "0.7283336", "0.71999604", "0.715786", "0.7125886", "0.71129096", "0.7095554", "0.70955276", "0.7078285", "0.7035779", "0.7021177", "0.7000603", "0.6966932", "0.6946823", "0.6936064", "0.6935026", "0.6934993", "0.6920538", "0.6887895",...
0.7343649
2
Show the input image and return the current axes. By default, the image is displayed in greyscale, rather than the matplotlib default colormap. Images are assumed to have standard range for their type. For example, if a floating point image has values in [0, 0.5], the most intense color will be gray50, not white. If th...
def imshow(image, ax=None, show_cbar=None, **kwargs): import matplotlib.pyplot as plt lo, hi, cmap = _get_display_range(image) kwargs.setdefault('interpolation', 'nearest') kwargs.setdefault('cmap', cmap) kwargs.setdefault('vmin', lo) kwargs.setdefault('vmax', hi) ax = ax or plt.gca() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def imshow(self):\n axes([0, 0, 1, 1], xticks=[], yticks=[])\n imshow(self.rgb_image())", "def imshow_cspad(self, image, vmin=0, vmax=None, mpl_axes=None):\n\n if image.shape == (32, 185, 388):\n img = self.assemble_image(image)\n else:\n img = image\n\n #...
[ "0.71640736", "0.709699", "0.707775", "0.69066936", "0.69066936", "0.69066936", "0.6893336", "0.68022454", "0.67201567", "0.6606666", "0.6572219", "0.65623575", "0.65531266", "0.6527872", "0.65001667", "0.6426153", "0.64174527", "0.6406021", "0.6404387", "0.6377824", "0.63386...
0.6843344
7
creates a scatterplot in three colors
def scatterplot(): #get the data for the plots reddata = np.array([[1,1],[1,3],[4,2]]) bluedata = np.array([[0,1],[0,5],[1,2],[2,3],[3,4]]) yellowdata = np.array([[1,4],[2,2],[3,5],[6,2]]) #convert the data to a pd DataFrame df = pd.DataFrame(reddata, columns=["x","y"]) df1 = pd.DataF...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scatterPlot2():\n N = 100\n x = np.random.rand(N)\n y = np.random.rand(N)\n colors = np.random.rand(N)\n\n plt.scatter(x, y, c=colors, alpha=0.5)\n plt.show()", "def scatter(x, colors):\n \n # We choose a color palette with seaborn.\n palette = np.array(sns.color_palette(\"hls\", 2...
[ "0.79650617", "0.7176228", "0.7041901", "0.6938064", "0.6850028", "0.6806123", "0.67140985", "0.6689596", "0.6607454", "0.6566183", "0.65623033", "0.65363413", "0.65345407", "0.65253615", "0.65225154", "0.64272225", "0.63974845", "0.6382435", "0.636727", "0.63608176", "0.6357...
0.723282
1
Move elements to the left to insert B[index] into the relevant position
def rearrange_array(B: List[int], index: int): original_elem = B[index] index += 1 len_B = len(B) while index < len_B and B[index] < original_elem: B[index - 1] = B[index] index += 1 B[index - 1] = original_elem
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_element(self,n_a,n_b):\n self.element_array.insert(n_b,self.element_array.pop(n_a))", "def shift_item_up(self, index):\n while index > 0:\n parent_index = index // 2\n if parent_index > 0 and self.heaplist[parent_index] < self.heaplist[index]:\n self.he...
[ "0.67065895", "0.6235323", "0.5933899", "0.5913871", "0.5912525", "0.58244336", "0.5770209", "0.57641846", "0.57377374", "0.57264876", "0.5722406", "0.5712464", "0.5633465", "0.55824655", "0.55812746", "0.5579907", "0.55781025", "0.5577946", "0.55715245", "0.5563493", "0.5519...
0.7027853
0
Return a Smiley object which was already claimed and has remaining points at 0.
def claimed_smiley_no_remaining_points(child): smiley = SmileyFactory( owner=child, earned_on=timezone.now(), description="Removed rubbish", points=5, claimed=True, points_remaining=0 ) smiley.save() return smiley
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def claimed_smiley_remaining_points(child):\n smiley = SmileyFactory(\n owner=child,\n earned_on=timezone.now(),\n description=\"Removed rubbish\",\n points=5,\n claimed=True,\n points_remaining=1\n )\n smiley.save()\n return smiley", "def claimed_oopsy_no_re...
[ "0.74325323", "0.59339166", "0.5474256", "0.5378434", "0.5279365", "0.5278261", "0.52523017", "0.52037036", "0.51658833", "0.51120883", "0.5100303", "0.50459033", "0.5024137", "0.50226283", "0.49853924", "0.49731928", "0.49637306", "0.49201083", "0.48877826", "0.48414952", "0...
0.74957
0
Returns if the word is in the trie.
def search(self, word: str) -> bool: node = self.head for c in word: if c not in node.next: return False node = node.next[c] return node.valid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_trie(self, trie, word):\n current_dict = trie\n for letter in word:\n if letter in current_dict:\n current_dict = current_dict[letter]\n else:\n return False\n else:\n if '_end_' in current_dict:\n return curr...
[ "0.838632", "0.8150416", "0.8123471", "0.7856802", "0.7830664", "0.77935004", "0.7792806", "0.77642965", "0.7753436", "0.7747724", "0.7711298", "0.76816714", "0.7677101", "0.7664614", "0.76506114", "0.76338875", "0.7628353", "0.76114196", "0.7577657", "0.75695884", "0.756079"...
0.7448905
34
Generate a price which could be given as a quote to the customer.
def generate_price(base_price, risk_gradient, age, excess=0): log = logging.getLogger(__name__) log.debug(f"base:{base_price} risk:{risk_gradient} age:{age}") age_risk = calculate_age_risk(risk_gradient, age) log.debug(f"age_risk is:{age_risk}") policy_price = base_price + age_risk log.debug(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __get_deal_price(self):\n return self.create_random_decimal(min=1, max=100000)", "def get_price():\n return uniform(1.0, 350.0)", "def buying_price(self):\n buy_price = self.standard_init_price()\n # Special status and resources price adaptation\n if self.planet.status in...
[ "0.7553232", "0.7345696", "0.67335516", "0.6617147", "0.6556913", "0.65012354", "0.6493047", "0.64493835", "0.64461374", "0.64461374", "0.64461374", "0.64409584", "0.64318615", "0.6425789", "0.63993603", "0.636334", "0.63545614", "0.63489413", "0.6329851", "0.63273805", "0.63...
0.66951036
3
Splits the text strings into a list of sentences, which are lists of words.
def split_text(text: str) -> list[list[str]]: # Removing punctuation trantab = str.maketrans(dict.fromkeys(list(string.punctuation))) text = text.translate(trantab) # Case folding text = text.lower() # tokenize return [word_tokenize(sentence) for sentence in sent_tokenize(text)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_sentences(text: str) -> List[str]:\n return sent_tokenize(text)", "def split(text):\n doc = nlp(text)\n sentences = [x.text_with_ws for x in doc.sents]\n return sentences", "def split_into_words(sentences):\n return list(sentences.split(\" \"))", "def split_sentences(...
[ "0.8530453", "0.82759196", "0.8112133", "0.8078625", "0.80242616", "0.80242616", "0.7982165", "0.79236597", "0.78377956", "0.7768373", "0.76940054", "0.7673895", "0.7600511", "0.75406134", "0.74584556", "0.73885185", "0.73831046", "0.73804426", "0.7320253", "0.72066647", "0.7...
0.81707036
2
Replaces each word in the text string with its lemma. This method uses the nltk library, and requires some NLTK data in order to run. This data can be downloaded by running `setup.py` in the `nltk` directory.
def lemmatize(text: Iterable[Iterable[str]]) -> Generator[str, None, None]: tag_dict = { "J": wordnet.ADJ, "N": wordnet.NOUN, "R": wordnet.ADV, "V": wordnet.VERB, } lemmatizer = WordNetLemmatizer() # Tags the words with their type/pos (part of speech) # Then translate...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lemmatize_text(text):\n text = nlp(text)\n text = ' '.join([word.lemma_ if word.lemma_ != '-PRON-' else word.text for word in text])\n return text", "def lemmatize_words(text: str, lemmatizer=WordNetLemmatizer()) -> str:\n return ' '.join(lemmatizer.lemmatize(word) for word in text.split())", "...
[ "0.73475283", "0.71695095", "0.7111294", "0.704403", "0.70000577", "0.6820766", "0.6737445", "0.6671416", "0.6667663", "0.6590659", "0.6549414", "0.6540353", "0.65336186", "0.6506137", "0.6496968", "0.6455138", "0.64408267", "0.64208025", "0.6374826", "0.63745093", "0.6372935...
0.67182916
7
Stop words are commonly used words("the","a","an","in") NLTK Stores a list of these stopwords that we use to remove them from our CSV
def remove_stopwords(text: Iterable[str]) -> Generator[str, None, None]: stop_words = set(stopwords.words("english")) return ( word for word in text if word not in stop_words )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_stopwords_fun(self):\n tokens = str(self.doc).split()\n cleaned_tokens = [token for token in tokens\n if token.lower() not in self.stopword_list]\n self.doc = ' '.join(cleaned_tokens)", "def remove_stopwords(words):\r\n new_words = []\r\n for word in...
[ "0.7766654", "0.7734025", "0.7712912", "0.76632035", "0.76632035", "0.76632035", "0.76632035", "0.766205", "0.7623977", "0.7613695", "0.7610639", "0.75980055", "0.7584179", "0.7581501", "0.7578742", "0.7569575", "0.75615084", "0.7548558", "0.75387585", "0.7527661", "0.7521454...
0.6852775
80
Convert infix notation to reverse polish notion
def infixToRPN(expression): stack = Stack() RPNList = [] tokens = expression.split() spaces = True # If no spaces in expression then push each char in a tokens list if len(tokens) == 1: spaces = False tokens = [char for char in expression] for token in tokens: if token in alphabet or token ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def infix_to_postfix(infix:str) -> str:\n stack = deque()\n precedence = {'+':1, '-':1,\n '*':2, '/':2,\n '^':3, '(':-9\n }\n output = \"\"\n for ch in infix:\n if ch not in {'+', '-', '*', '/', '^', '(', ')'}:\n output += ch\n e...
[ "0.7424033", "0.7197166", "0.7072782", "0.7060292", "0.7049963", "0.70399827", "0.70172006", "0.6961704", "0.6948785", "0.6944209", "0.69213367", "0.6889996", "0.68219066", "0.6814941", "0.68141854", "0.6808347", "0.6797951", "0.6782647", "0.67540205", "0.6744058", "0.6724316...
0.6713839
21
Enclose argument in double quotes.
def quote(m): return '"' + m + '"'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _escapeArg(arg):\n #XXX There is a *lot* more that we should escape here.\n return arg.replace('\"', r'\\\"')", "def _quote(self, arg):\n arg = arg.replace('\\\\', '\\\\\\\\')\n arg = arg.replace('\"', '\\\\\"')\n return '\"%s\"' % arg", "def argument_quote(argument):\n argume...
[ "0.79821897", "0.7580129", "0.73400056", "0.7126797", "0.7126797", "0.7077473", "0.7069489", "0.7024407", "0.6909418", "0.6817582", "0.67943215", "0.67499226", "0.67171425", "0.6667975", "0.66590273", "0.6659003", "0.6593867", "0.6581305", "0.6521179", "0.6483779", "0.6468940...
0.62293404
34
from_list builds a linked list from the given list.
def from_list(L): n = None for i in xrange(len(L)-1, -1, -1): n = Node(x=L[i], nxt=n) return n
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_linked_list(input_list):\n\t\ttry:\n\t\t\thead = Node(input_list.pop(0)) #remove the first list item and return as its head\n\n\t\t\twhile (len(input_list)>0):\n\t\t\t\tcurrent_node = head\n\t\t\t\twhile current_node.next:\n\t\t\t\t\tcurrent_node = current_node.next\n\t\t\t\tcurrent_node.next = Node(inp...
[ "0.68085164", "0.67522126", "0.67188007", "0.6682575", "0.65677404", "0.65371275", "0.6514426", "0.64367056", "0.6363595", "0.6092823", "0.6030045", "0.601553", "0.5919988", "0.58357865", "0.58289623", "0.58069545", "0.57630116", "0.5754531", "0.5746659", "0.5663743", "0.5655...
0.668616
4
Parses the dataset and returns a DataFrame
def parse_dataset(self, data): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_data(self):\n structure_data = self.parse_root(self.root)\n\n dict_data = {}\n for d in structure_data:\n dict_data = {**dict_data, **d}\n df = pd.DataFrame(data=list(dict_data.values()), index=dict_data.keys()).T\n\n return df", "def create_dataframe():\...
[ "0.70756644", "0.7066172", "0.6924783", "0.6914507", "0.6908253", "0.68696654", "0.6852153", "0.6744138", "0.6744138", "0.6710805", "0.6694228", "0.66766024", "0.6658253", "0.6654011", "0.6613978", "0.6578354", "0.65413404", "0.65089315", "0.6504171", "0.64812285", "0.6474576...
0.6737821
9
Open ThermAP_presentation.pdf in the Web Browser.
def aboutThermAP(): import webbrowser url = os.path.join(progpath, "ThermAP_presentation.pdf") if platform.system() == "Darwin": webbrowser._browsers['safari'][1].open(url) else: webbrowser.open(url)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preview():\n url = \"http://{}:{}\".format(_hostname, _port)\n webbrowser.open(url)", "def open(url):\r\n webbrowser.open(url)", "def open_in_browser(self):\n webbrowser.open(self.url)", "def open_browser(self):\n\n webbrowser.open(self.trailer_youtube_url)", "def show_trailer():...
[ "0.6627875", "0.6439503", "0.6435883", "0.6422709", "0.63993305", "0.62372947", "0.62266624", "0.62230057", "0.61958957", "0.61930263", "0.61912864", "0.61899847", "0.6166199", "0.6142754", "0.6098221", "0.6087481", "0.6086893", "0.6079478", "0.6064588", "0.6047153", "0.60379...
0.77473843
0
Returns an initialized Flask application.
def create_rest_app(config=base_config): app = Flask(__name__, template_folder="templates", static_folder="static") app.config.from_object(config) register_extensions(app) register_blueprints(app) @app.route('/', methods=['GET']) def index(): """Returns the applications index.""" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app():\n app = create_app()\n return app", "def create_app():\n app = Flask(__name__)\n app.config.from_object('app.configs.config')\n app.config.from_object('app.configs.settings')\n return app", "def app():\n return create_app()", "def create_app() -> Flask:\r\n app = Flask(__na...
[ "0.82887465", "0.8231283", "0.81956017", "0.81438714", "0.81094986", "0.8079586", "0.80196", "0.79639727", "0.79363436", "0.7914559", "0.7910863", "0.79035574", "0.79026777", "0.7900439", "0.78957665", "0.78844637", "0.7873546", "0.7850171", "0.78150153", "0.7787033", "0.7754...
0.0
-1
Returns an initialized Flask application.
def create_script_app(config=base_config): app = Flask(__name__, template_folder="templates", static_folder="static") app.config.from_object(config) register_extensions(app) register_blueprints(app) manager = register_scripts(app) return manager
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app():\n app = create_app()\n return app", "def create_app():\n app = Flask(__name__)\n app.config.from_object('app.configs.config')\n app.config.from_object('app.configs.settings')\n return app", "def app():\n return create_app()", "def create_app() -> Flask:\r\n app = Flask(__na...
[ "0.82883763", "0.8231111", "0.8195493", "0.8143884", "0.8109914", "0.8079831", "0.80196226", "0.79647774", "0.7936932", "0.7914332", "0.7910948", "0.79038984", "0.7903194", "0.79017186", "0.7896538", "0.7885806", "0.78751445", "0.7849692", "0.7814658", "0.77887756", "0.775453...
0.0
-1
Creates a card with the given rank and face down.
def __init__(self, rank): self.rank = rank self.face = 'down'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def card_factory(rank,suit):\n pass", "def __init__(self, rank=\"\", suit=\"\"):\n self.suit = suit\n self.rank = rank\n self.face_up = False", "def create_deck():\r\n deck = []\r\n faces = [2,3,4,5,6,7,8,9,10,\r\n 'Jack','Queen','King','Ace']\r\n suits = ['Spades', ...
[ "0.70928323", "0.630839", "0.6258498", "0.60979253", "0.6015247", "0.6014049", "0.5973388", "0.5772907", "0.5771419", "0.5766231", "0.57519996", "0.5689047", "0.5683947", "0.56606156", "0.5572875", "0.55688846", "0.5553314", "0.5547997", "0.55208844", "0.55165154", "0.5511656...
0.63681406
1
Returns the string representation of a deck.
def __str__(self): result = '' for c in self._cards: result = result + str(c) + '\n' return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_deck(self):\n deck = Deck(self.get_cards())\n return deck.as_string()", "def __str__(self):\n string = \"Deck contains \"\n\n for i in range(len(self.deck)):\n string += str(self.deck[i].get_suit()) + str(self.deck[i].get_rank()) + \" \"\n return string", "...
[ "0.83336", "0.8266361", "0.8211994", "0.7970482", "0.7948513", "0.79302895", "0.79184276", "0.7853972", "0.7600925", "0.75690424", "0.74557513", "0.7323615", "0.73229706", "0.7321422", "0.72839534", "0.72503394", "0.7194852", "0.7108533", "0.7038603", "0.6985019", "0.69572777...
0.7210956
17
Return new moving direction.
def get_response(self) -> Tuple[int, int]: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move(self):\n if (self._dir is Direction.UP) and (self._y_pos is 0):\n self._dir = Direction.DOWN\n elif (self._dir is Direction.DOWN) and (self._y_pos+self._len is self._bs):\n self._dir = Direction.UP\n elif (self._dir is Direction.LEFT) and (self._x_pos is 0):\n ...
[ "0.772866", "0.7309167", "0.73053735", "0.7273661", "0.7111077", "0.7101077", "0.70726895", "0.6976979", "0.69215906", "0.6920856", "0.6912076", "0.6893409", "0.6885747", "0.687596", "0.68702644", "0.68683857", "0.6850809", "0.68277156", "0.67954266", "0.6788799", "0.67849237...
0.0
-1
Get all annotations of frame
def get_annotations(self, frame): # self.annotations_timestamp = (self.vid.frame_number + self.annotations_offset) / self.vid.fps self.annotations_timestamp = self.vid.frame_number / self.vid.fps frame = self.video_annotations.get_frame(frame_num=self.vid.frame_number).show(image=frame, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def annotations(self):\n return self._annotations", "def annotations(self):\n\n return self._annotations", "def _init_annotation(self):\n annotations = []\n for frame in self.frames:\n coordinates, sources, targets, ids = [], [], [], []\n frame_id = set()\n ...
[ "0.71675766", "0.70432097", "0.6710057", "0.6478725", "0.6442509", "0.6328812", "0.62967265", "0.6291989", "0.6268516", "0.6268425", "0.62279826", "0.62159055", "0.62108314", "0.6204611", "0.6181381", "0.6177242", "0.61611766", "0.61371267", "0.61371267", "0.6076309", "0.6070...
0.7343791
0
Alpha defined in T. Damour and N. Deruelle(1986)equation [46] alpha = A1/csin(omega)
def alpha(self): sinOmg = np.sin(self.omega()) return self.a1()/c.c*sinOmg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_alpha(epsilon): \n return float(0.5 * np.log((1-epsilon)/epsilon))", "def _alpha(self):\n return _handle_ab(self.solution, self.use_const)[0]", "def phase_Venus_1(alpha):\n phase = 10.**(-0.4*(- 1.044e-03*alpha + 3.687e-04*alpha**2. - 2.814e-06*alpha**3. + 8.938e-09*alpha**4.))\n re...
[ "0.67781895", "0.67753047", "0.67198396", "0.67087954", "0.6669377", "0.66419333", "0.6579254", "0.65142107", "0.64438516", "0.64231104", "0.6422555", "0.63996637", "0.6394361", "0.6329448", "0.63284874", "0.6313662", "0.626899", "0.6267942", "0.6255628", "0.62200433", "0.621...
0.810901
0
T. Damour and N. Deruelle(1986)equation [46] alpha = a1/csin(omega) dAlpha/dA1 = 1.0/csin(omega) dAlpha/dPar = a1/ccos(omega)dOmega/dPar
def d_alpha_d_par(self,par): if par not in self.binary_params: errorMesg = par + "is not in binary parameter list." raise ValueError(errorMesg) if par in ['A1','A1DOT']: dername = 'd_alpha_d_'+par return getattr(self,dername)() else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def alpha(self):\n sinOmg = np.sin(self.omega())\n return self.a1()/c.c*sinOmg", "def ds_by_dalpha(alpha,a_p):\n ds_dalpha = a_p*np.cos(alpha)\n return ds_dalpha", "def d_planet_earth_alpha(alpha,a_p):\n a_earth = 1. #in AU\n\n #For the given a_p, check all alphas are possible (Not ab...
[ "0.6866035", "0.67938894", "0.67823887", "0.6581188", "0.6491421", "0.63464355", "0.6311088", "0.6266569", "0.6265256", "0.614214", "0.6134358", "0.6050586", "0.60403544", "0.59954333", "0.59926313", "0.59884644", "0.5981938", "0.5971878", "0.5951077", "0.5930634", "0.5906580...
0.7052838
0
Beta defined in T. Damour and N. Deruelle(1986)equation [47] beta = A1/c(1eTheta2)0.5cos(omega)
def beta(self): eTheta = self.eTheta() cosOmg = np.cos(self.omega()) return self.a1()/c.c*(1-eTheta**2)**0.5*cosOmg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def beta(theta, a, b):\n B = math.gamma(a) * math.gamma(b) / math.gamma(a + b)\n return (theta ** (a - 1)) * ((1 - theta) ** (b - 1)) / B", "def beta_func(eps, E, theta):\n\n def parameter_s(eps, E, theta):\n\n \"\"\"\n Return the parameter s (formula 3 from Gould's article)\n\...
[ "0.7199048", "0.719861", "0.7070582", "0.70245177", "0.69901496", "0.6963658", "0.69622606", "0.69316936", "0.69316936", "0.69316936", "0.6928063", "0.6925143", "0.6911693", "0.684624", "0.6736834", "0.66625756", "0.6572399", "0.6561582", "0.6549064", "0.6520471", "0.6494829"...
0.8396306
0
beta = A1/c(1eTheta2)0.5cos(omega) eTheta = ecc+Dth ?? dBeta/dA1 = 1.0/c(1eTheta2)0.5cos(omega) dBeta/dECC = A1/c(((e+dr)/sqrt(1(e+dr)2)cos(omega)de/dECC (1eTheta2)0.5sin(omega)domega/dECC dBeta/dEDOT = A1/c(((e+dr)/sqrt(1(e+dr)2)cos(omega)de/dEDOT (1eTheta2)0.5sin(omega)domega/dEDOT dBeta/dDth = A1/c((e+dr)/sqrt(1(e+d...
def d_beta_d_par(self,par): if par not in self.binary_params: errorMesg = par + "is not in binary parameter list." raise ValueError(errorMesg) if par in ['A1','ECC','EDOT','DTH','A1DOT']: dername = 'd_beta_d_'+par return getattr(self,dername)() e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def d_beta_d_ECC(self):\n eTheta = self.eTheta()\n a1 = (self.a1()).decompose()\n sinOmg = np.sin(self.omega())\n cosOmg = np.cos(self.omega())\n return a1/c.c*((-eTheta)/np.sqrt(1-eTheta**2)*cosOmg- \\\n (1-eTheta**2)**0.5*sinOmg*self.d_omega_d_par('ECC'))", "def...
[ "0.7945656", "0.7425367", "0.6485847", "0.64658386", "0.630435", "0.62178206", "0.62169963", "0.61995095", "0.61984634", "0.61685663", "0.6160557", "0.6151392", "0.6150774", "0.6133828", "0.60536605", "0.6003225", "0.59415233", "0.59335536", "0.5931357", "0.5926227", "0.59067...
0.64008313
4
dBeta/dEDOT = A1/c(((e+dtheta)/sqrt(1(e+dtheta)2)cos(omega)de/dEDOT \ (1eTheta2)0.5sin(omega)domega/dEDOT de/dEDOT = tt0
def d_beta_d_EDOT(self): eTheta = self.eTheta() a1 = (self.a1()).decompose() sinOmg = np.sin(self.omega()) cosOmg = np.cos(self.omega()) return a1/c.c*((-eTheta)/np.sqrt(1-eTheta**2)*cosOmg*self.tt0- \ (1-eTheta**2)**0.5*sinOmg*self.d_omega_d_par('EDOT'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def d_beta_d_ECC(self):\n eTheta = self.eTheta()\n a1 = (self.a1()).decompose()\n sinOmg = np.sin(self.omega())\n cosOmg = np.cos(self.omega())\n return a1/c.c*((-eTheta)/np.sqrt(1-eTheta**2)*cosOmg- \\\n (1-eTheta**2)**0.5*sinOmg*self.d_omega_d_par('ECC'))", "def...
[ "0.68507767", "0.65447253", "0.6451425", "0.6337838", "0.6297723", "0.62862164", "0.6275", "0.62317395", "0.6217246", "0.61506045", "0.6129567", "0.6101173", "0.6092437", "0.60774356", "0.6060085", "0.6040916", "0.6005688", "0.59942514", "0.5978095", "0.59645903", "0.5936357"...
0.8338384
0
Dre defined in T. Damour and N. Deruelle(1986)equation [48] Dre = alpha(cos(E)er)+(beta+gamma)sin(E)
def Dre(self): er = self.er() sinE = np.sin(self.E()) cosE = np.cos(self.E()) return self.alpha()*(cosE- er)+ \ (self.beta()+self.GAMMA)*sinE
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Drep(self):\n sinE = np.sin(self.E())\n cosE = np.cos(self.E())\n return -self.alpha()*sinE+(self.beta()+self.GAMMA)*cosE", "def d_Dre_d_par(self,par):\n sinE = np.sin(self.E())\n cosE = np.cos(self.E())\n # First term\n term1 = self.alpha()*(-self.prtl_der('e...
[ "0.7630594", "0.73792875", "0.7378725", "0.69440395", "0.6896435", "0.6864759", "0.6697169", "0.6587734", "0.6314407", "0.6229167", "0.62251097", "0.61893773", "0.61133516", "0.6112521", "0.6106609", "0.60688865", "0.60524863", "0.6043067", "0.60393435", "0.6034239", "0.60119...
0.8293948
0
Second way of doing derivative on delay inverse. Did not test the accuracy against the first way yet.
def d_delayI_d_par2(self,par): e = self.ecc() sE = np.sin(self.E()) cE = np.cos(self.E()) dE_dpar = self.prtl_der('E',par) decc_dpar = self.prtl_der('ecc',par) Dre = self.Dre() Drep = self.Drep() Drepp = self.Drepp() nHat = self.nhat() del...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delayInverse(self):\n Dre = self.Dre()\n Drep = self.Drep()\n Drepp = self.Drepp()\n nHat = self.nhat()\n e = self.ecc()\n sinE = np.sin(self.E())\n cosE = np.cos(self.E())\n return (Dre*(1-nHat*Drep+(nHat*Drep)**2+1.0/2*nHat**2*Dre*Drepp-\\\n ...
[ "0.7007135", "0.6349818", "0.63299763", "0.62999976", "0.624899", "0.62419194", "0.62186563", "0.6204064", "0.62012607", "0.61898136", "0.6177442", "0.616083", "0.61411905", "0.6120615", "0.6120615", "0.6087173", "0.60645545", "0.6060887", "0.6053546", "0.60484135", "0.604598...
0.57342905
56
Save a given dictionary to the yaml save file
def save(dikt): with open(SAVE_FILE_NAME, 'w') as save_file: yaml.safe_dump(dikt, save_file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_yaml(dict_file, yaml_path):\n with open(yaml_path, \"w\") as file:\n documents = yaml.dump(dict_file, file)", "def save_file(filename,d):\n f = open(filename, 'w')\n yaml.dump(d, f)\n f.close()", "def save_solution_dict(solution_dict: Dict[int, Dict[str, List[str or Tuple[str, str]]...
[ "0.8200555", "0.79704076", "0.7884356", "0.78535134", "0.7366919", "0.7274513", "0.7232156", "0.72002006", "0.7181457", "0.7127469", "0.70945895", "0.70784086", "0.7068967", "0.6955657", "0.6938729", "0.6933189", "0.69178903", "0.69015115", "0.69015115", "0.6890951", "0.68020...
0.8326193
0
Input only. The contents of the artifact. Provided by API callers when artifacts are created or replaced. To access the contents of an artifact, use GetArtifactContents.
def contents(self) -> str: return pulumi.get(self, "contents")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_read_artifact(self):\n pass", "def artifact(self) -> aws_cdk.aws_codepipeline.Artifact:\n return self._values.get(\"artifact\")", "def artifact_file(self) -> aws_cdk.aws_codepipeline.ArtifactPath:\n return jsii.get(self, \"artifactFile\")", "def get_artifact(self, artifact_key: ...
[ "0.653721", "0.64753675", "0.64569455", "0.6406388", "0.6343128", "0.62992334", "0.6294247", "0.62138325", "0.6189157", "0.6132723", "0.6112936", "0.60325426", "0.59842473", "0.5970869", "0.5915728", "0.58797246", "0.5876082", "0.5863932", "0.58587307", "0.58462197", "0.58139...
0.59392184
14
Returns a specified artifact.
def get_artifact(api_id: Optional[str] = None, artifact_id: Optional[str] = None, location: Optional[str] = None, project: Optional[str] = None, spec_id: Optional[str] = None, version_id: Optional[str] = None, opts: Op...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_artifact(self, artifact_key: str) -> object:\n return self._artifacts[artifact_key]", "def retrieve_artifact(args, producing_task_name, artifact_name):\n if producing_task_name not in args._artifacts:\n raise KeyError(f\"Cannot find {producing_task_name} in _artifacts. The task either di...
[ "0.7862447", "0.77000606", "0.76083386", "0.7419801", "0.7369262", "0.7272473", "0.72374034", "0.71306854", "0.7114057", "0.7064085", "0.6965326", "0.6933939", "0.68826914", "0.68578005", "0.6773741", "0.67151755", "0.6668139", "0.6668139", "0.6668139", "0.6668139", "0.647032...
0.6624506
20
Returns a specified artifact.
def get_artifact_output(api_id: Optional[pulumi.Input[str]] = None, artifact_id: Optional[pulumi.Input[str]] = None, location: Optional[pulumi.Input[str]] = None, project: Optional[pulumi.Input[Optional[str]]] = None, spec_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_artifact(self, artifact_key: str) -> object:\n return self._artifacts[artifact_key]", "def retrieve_artifact(args, producing_task_name, artifact_name):\n if producing_task_name not in args._artifacts:\n raise KeyError(f\"Cannot find {producing_task_name} in _artifacts. The task either di...
[ "0.78619975", "0.77015543", "0.7608621", "0.7418167", "0.7369977", "0.7273157", "0.72368246", "0.7113954", "0.70636654", "0.6964676", "0.6934272", "0.6881661", "0.6857933", "0.6772751", "0.67148817", "0.66680163", "0.66680163", "0.66680163", "0.66680163", "0.66249716", "0.647...
0.71305454
7
Convert a word to a dictionary key.
def word_key(word): key = ''.join(sorted(word)) return key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_new_key(key, word):\n return (key[1], word)", "def _dict_key_to_key(dictionary):\n return {key : key for key in dictionary.keys()}", "def _convert_dict_key(self, string):\r\n try:\r\n # Don't do any of this if the string is empty or None.\r\n if string is None:\r\n ...
[ "0.6460083", "0.62095773", "0.618404", "0.6154475", "0.6051014", "0.59796536", "0.5852464", "0.581195", "0.57541174", "0.5688952", "0.5677488", "0.56710964", "0.56702715", "0.566969", "0.5653786", "0.56535953", "0.5649018", "0.56478953", "0.56416214", "0.5620962", "0.55845785...
0.6687046
0
Return the input string with single and double quotes escaped out
def esc_quotes(strng): return strng.replace('"','\\"').replace("'","\\'")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quot(string):\r\n return string.replace('\"', \"'\")", "def DoubleQuote(s):\n if not s:\n return '\"\"'\n elif all(c in _SafeShellChars for c in s):\n return s\n else:\n return '\"' + s.replace('\"', '\\\\\"') + '\"'", "def quote(s):\n # Based on shlex.quote. Bun unlike shlex,...
[ "0.7955961", "0.7834651", "0.78327084", "0.78050566", "0.7656766", "0.761447", "0.74725187", "0.7471884", "0.7430912", "0.7404512", "0.73719496", "0.73719496", "0.73210734", "0.7316419", "0.72891915", "0.7249339", "0.7218438", "0.7212112", "0.72078896", "0.7194712", "0.717631...
0.77613014
4
Sets the security_identities of this InlineResponse20021Links.
def security_identities(self, security_identities): self._security_identities = security_identities
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def security_list_ids(self, security_list_ids):\n self._security_list_ids = security_list_ids", "def security_entries(self, security_entries):\n\n self._security_entries = security_entries", "def security_groups(self, security_groups):\n\n self._security_groups = security_groups", "def s...
[ "0.67410034", "0.62923265", "0.552188", "0.55183744", "0.5461008", "0.53982276", "0.5324136", "0.5218219", "0.5129409", "0.5088339", "0.50633353", "0.4997583", "0.49316627", "0.4915405", "0.49075192", "0.49016753", "0.49016753", "0.48492512", "0.48385385", "0.4822796", "0.477...
0.75898206
0
Sets the security_mappings of this InlineResponse20021Links.
def security_mappings(self, security_mappings): self._security_mappings = security_mappings
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def security_entries(self, security_entries):\n\n self._security_entries = security_entries", "def security_mappings(self):\n return self._security_mappings", "def security_list_ids(self, security_list_ids):\n self._security_list_ids = security_list_ids", "def security_groups(self, secur...
[ "0.5735888", "0.5478279", "0.528632", "0.5205074", "0.517388", "0.517388", "0.517388", "0.517388", "0.517388", "0.517388", "0.517388", "0.517388", "0.517388", "0.517388", "0.517388", "0.51034266", "0.5061945", "0.50297964", "0.5012648", "0.49858207", "0.49660444", "0.480652...
0.7516315
0
Gets the analysis_rule_plug_ins of this InlineResponse20021Links.
def analysis_rule_plug_ins(self): return self._analysis_rule_plug_ins
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def analysis_rule_plug_ins(self, analysis_rule_plug_ins):\n\n self._analysis_rule_plug_ins = analysis_rule_plug_ins", "def time_rule_plug_ins(self):\n return self._time_rule_plug_ins", "def analysis_rule_plug_in_name(self):\n return self._analysis_rule_plug_in_name", "def rules(self):\n ...
[ "0.6187092", "0.54403895", "0.5399513", "0.5336199", "0.5000958", "0.49940985", "0.49454862", "0.49055558", "0.4893924", "0.48653764", "0.47944397", "0.4774746", "0.47732142", "0.4702845", "0.46907046", "0.4670957", "0.46560508", "0.46396327", "0.4595532", "0.4585538", "0.458...
0.7809449
0
Sets the analysis_rule_plug_ins of this InlineResponse20021Links.
def analysis_rule_plug_ins(self, analysis_rule_plug_ins): self._analysis_rule_plug_ins = analysis_rule_plug_ins
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def analysis_rule_plug_ins(self):\n return self._analysis_rule_plug_ins", "def analysis_rule_plug_in_name(self, analysis_rule_plug_in_name):\n\n self._analysis_rule_plug_in_name = analysis_rule_plug_in_name", "def time_rule_plug_ins(self, time_rule_plug_ins):\n\n self._time_rule_plug_ins =...
[ "0.58965397", "0.557601", "0.5099745", "0.5090438", "0.48163784", "0.4506292", "0.4480952", "0.44235343", "0.44112563", "0.43607423", "0.4312515", "0.4263391", "0.4255213", "0.4255213", "0.4255213", "0.4255213", "0.4255213", "0.4255213", "0.4255213", "0.4255213", "0.4255213",...
0.7920971
0
Gets the time_rule_plug_ins of this InlineResponse20021Links.
def time_rule_plug_ins(self): return self._time_rule_plug_ins
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def analysis_rule_plug_ins(self):\n return self._analysis_rule_plug_ins", "def time_rule_plug_ins(self, time_rule_plug_ins):\n\n self._time_rule_plug_ins = time_rule_plug_ins", "def time_rule_plug_in_name(self):\n return self._time_rule_plug_in_name", "def ActiveHlt2Lines(self) :\n\n ...
[ "0.61340046", "0.61320907", "0.5459515", "0.5076435", "0.499136", "0.49063873", "0.48587036", "0.4795006", "0.47793922", "0.47671625", "0.4691705", "0.4679331", "0.4592812", "0.45900258", "0.45761892", "0.45299256", "0.4508813", "0.44888663", "0.44530025", "0.4451043", "0.442...
0.78765225
0
Sets the time_rule_plug_ins of this InlineResponse20021Links.
def time_rule_plug_ins(self, time_rule_plug_ins): self._time_rule_plug_ins = time_rule_plug_ins
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def analysis_rule_plug_ins(self, analysis_rule_plug_ins):\n\n self._analysis_rule_plug_ins = analysis_rule_plug_ins", "def time_rule_plug_ins(self):\n return self._time_rule_plug_ins", "def time_rule_plug_in_name(self, time_rule_plug_in_name):\n\n self._time_rule_plug_in_name = time_rule_p...
[ "0.62052953", "0.61544234", "0.5859454", "0.46252942", "0.45184785", "0.4439927", "0.4331454", "0.4173009", "0.40280896", "0.4025594", "0.40002018", "0.39975968", "0.3940181", "0.39313334", "0.3913574", "0.3913574", "0.39047968", "0.3899536", "0.389816", "0.3883649", "0.38836...
0.7883865
0
Sets the security of this InlineResponse20021Links.
def security(self, security): self._security = security
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def security(self, security: ModelDeploymentSecurityConfig):\n\n self._security = security", "def security_entries(self, security_entries):\n\n self._security_entries = security_entries", "def security_list_ids(self, security_list_ids):\n self._security_list_ids = security_list_ids", "de...
[ "0.6000448", "0.5540234", "0.52137405", "0.5105452", "0.49984494", "0.49816182", "0.49451163", "0.49169436", "0.49033594", "0.4721465", "0.47004628", "0.4685554", "0.4685554", "0.46615508", "0.46267688", "0.46259427", "0.46209237", "0.46180198", "0.46084258", "0.46084258", "0...
0.6135703
0
Sets the security_entries of this InlineResponse20021Links.
def security_entries(self, security_entries): self._security_entries = security_entries
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def security_list_ids(self, security_list_ids):\n self._security_list_ids = security_list_ids", "def security_identities(self, security_identities):\n\n self._security_identities = security_identities", "def security(self, security: ModelDeploymentSecurityConfig):\n\n self._security = secu...
[ "0.5997324", "0.57879966", "0.55575097", "0.54850405", "0.5462741", "0.5252834", "0.5157175", "0.5093209", "0.5093209", "0.5093209", "0.5093209", "0.5093209", "0.5093209", "0.5093209", "0.5093209", "0.5093209", "0.5093209", "0.5093209", "0.504488", "0.50388616", "0.49987286",...
0.7770975
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, InlineResponse20021Links): 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.80891633", "0.80891633", "0.8055254", "0.7983334", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", ...
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.8456063", "0.83918154", "0.8144437", "0.8140196", "0.8132038", "0.8093834", "0.80918837", "0.80918837", "0.80918837", "0.80852824", "0.80852824", "0.807626", "0.807626", "0.80657643" ]
0.0
-1
Computes mean absolute percentage error (MAPE)
def mape(truth, pred, reduction='mean') -> tensor: norm = torch.abs(truth) ret= torch.div(torch.abs(pred - truth), norm) if reduction != 'none': ret = torch.mean(ret) if reduction == 'mean' else torch.sum(ret) return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mape(actual: np.ndarray, predicted: np.ndarray):\n return np.mean(np.abs(_percentage_error(actual, predicted)))", "def mean_absolute_percentage_error(y_true, y_pred):\n if len(y_true.shape) > 1 or len(y_pred.shape) > 1:\n raise TypeError('Arrays need to be one-dimensional.')\n \n mape ...
[ "0.79146814", "0.7632996", "0.7501791", "0.73550767", "0.72961515", "0.7287494", "0.72373843", "0.714133", "0.7129199", "0.71042657", "0.7098121", "0.707652", "0.7071614", "0.70479417", "0.7029631", "0.6951978", "0.69244176", "0.6918379", "0.6891686", "0.6884102", "0.6854949"...
0.0
-1
Computes symmetric mean absolute percentage error (SMAPE) on the mean
def smape(truth, pred, agg=None, reduction='mean') -> tensor: if pred.shape != truth.shape: raise ValueError('Last three dimensions of data_samples and data_truth need to be compatible') eps = 1e-16 # Need to make sure that denominator is not zero norm = (torch.abs(pred) + torch.abs(truth)) + eps ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def smape(actual: np.ndarray, predicted: np.ndarray):\n return np.mean(np.divide(np.abs(actual - predicted), (np.abs(actual) + np.abs(predicted) + np.finfo(float).eps) * 0.5))", "def _symmetric_mean_absolute_percentage_error_compute(sum_abs_per_error: Tensor, num_obs: int) ->Tensor:\n return sum_abs_per_er...
[ "0.7198658", "0.7169417", "0.7125031", "0.6985343", "0.6978893", "0.6875179", "0.67472786", "0.6704108", "0.66879326", "0.66865766", "0.6671654", "0.6640912", "0.6634403", "0.65803576", "0.656413", "0.6513591", "0.6496876", "0.64746696", "0.6473864", "0.64652556", "0.64582485...
0.0
-1
This method verifies that an email/password combo (as sent by the site forms) is valid or not. Checks that the email exists, and that the password associated to that email is correct.
def is_login_valid(email, password): user_data = Database.find_one(UserConstants.COLLECTION, {"email": email}) admin_created_user = Database.find_one(UserConstants.COLLECTION, {"email": email, "admin_created": "Yes"}) if user_data is None: # Tell the user that their e-mail doesn't ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_5_sign_in_functionality_invalid_email_password(self):\n self.log.debug(\"Validate email and password fields are present\")\n self.page.validate_sign_in_window_elements()\n email = \"abc@gmail.com\" #Invalid email id\n password = \"123456\" #Invalid password\n self.log.de...
[ "0.7024327", "0.6823944", "0.6815157", "0.6695944", "0.66715795", "0.657195", "0.6562051", "0.6518498", "0.65165186", "0.6493367", "0.64129674", "0.63949984", "0.63725245", "0.6357591", "0.63427335", "0.63134724", "0.6313406", "0.6310508", "0.6293323", "0.6279478", "0.627074"...
0.6046885
44
Returns the library path if platform or backupPlatform matches the current library, or an empty string otherwise.
def _GetLibraryPath(self, platform, backupPlatform=''): if platform == Environment.GetPlatform() or \ (backupPlatform and backupPlatform == Environment.GetPlatform()): return os.path.split(self._libraryPath)[1] return ''
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def python_lib_arch_dir(self):\n return get_python_lib(plat_specific=True)", "def libRootPath(self):\n path = grapher.binPath\n libFld = None\n if self.rbStudio.isChecked():\n libFld = 'studio'\n path = os.path.join(path, libFld)\n elif self.rbProd.isCheck...
[ "0.67198634", "0.6659257", "0.66001683", "0.65525174", "0.6477", "0.6388494", "0.637965", "0.62829363", "0.62446445", "0.6058812", "0.59642816", "0.5926693", "0.5892519", "0.58294153", "0.5793963", "0.5782644", "0.57815677", "0.57722485", "0.57613796", "0.57472914", "0.570879...
0.8755724
0
Joining a classroom using a resource token for another resource should not be allowed.
def test_api_bbb_join_from_other_classroom(self): classroom = ClassroomFactory( meeting_id="21e6634f-ab6f-4c77-a665-4229c61b479a", title="Classroom 1", ) other_classroom = ClassroomFactory() jwt_token = StudentLtiTokenFactory( playlist=other_classroom...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def join_route_you_have_joined_fails(self):\n self.join_route_successfully()\n response = self.client.post(\n self.join_route_url, self.route, format='json',\n HTTP_AUTHORIZATION='token {}'.format(self.token_two))\n\n return response", "def test_api_bbb_join_instructor_...
[ "0.55153954", "0.54332846", "0.5225912", "0.51781046", "0.5155832", "0.5150775", "0.51466", "0.51276195", "0.50726986", "0.50437576", "0.5002753", "0.4982296", "0.4981943", "0.49750286", "0.4970005", "0.49523485", "0.49409023", "0.49192324", "0.488612", "0.48824257", "0.48798...
0.65619737
0
Joining a classroom as instructor should return a moderator classroom url.
def test_api_bbb_join_instructor(self): classroom = ClassroomFactory( meeting_id="21e6634f-ab6f-4c77-a665-4229c61b479a", title="Classroom 1", ) jwt_token = InstructorOrAdminLtiTokenFactory( playlist=classroom.playlist, consumer_site="consumer_site...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_api_bbb_join_instructor_no_fullname(self):\n classroom = ClassroomFactory(\n meeting_id=\"21e6634f-ab6f-4c77-a665-4229c61b479a\",\n title=\"Classroom 1\",\n )\n\n jwt_token = InstructorOrAdminLtiTokenFactory(playlist=classroom.playlist)\n\n response = self...
[ "0.6575558", "0.6147292", "0.58483446", "0.58177996", "0.58161867", "0.5811391", "0.5803019", "0.5674573", "0.56394637", "0.5630504", "0.55520004", "0.5539499", "0.54611164", "0.5444985", "0.5328228", "0.5311187", "0.5305726", "0.5265405", "0.5197943", "0.5193803", "0.518329"...
0.6852414
0
An organization administrator should be able to join a classroom.
def test_api_bbb_join_user_access_token_organization_admin(self): organization_access = OrganizationAccessFactory(role=ADMINISTRATOR) playlist = PlaylistFactory(organization=organization_access.organization) classroom = ClassroomFactory(playlist=playlist) jwt_token = UserAccessTokenFact...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_api_bbb_join_instructor(self):\n classroom = ClassroomFactory(\n meeting_id=\"21e6634f-ab6f-4c77-a665-4229c61b479a\",\n title=\"Classroom 1\",\n )\n\n jwt_token = InstructorOrAdminLtiTokenFactory(\n playlist=classroom.playlist,\n consumer_si...
[ "0.6517485", "0.6475778", "0.6460546", "0.64263904", "0.61392564", "0.6122702", "0.601556", "0.5916277", "0.58834445", "0.5862167", "0.585259", "0.58311796", "0.57798785", "0.57646483", "0.5725822", "0.5724693", "0.5692384", "0.5677216", "0.56641364", "0.564244", "0.56309956"...
0.6580465
0
A playlist administrator should be able to join a classroom.
def test_api_bbb_join_user_access_token_playlist_admin(self): playlist_access = PlaylistAccessFactory(role=ADMINISTRATOR) classroom = ClassroomFactory(playlist=playlist_access.playlist) jwt_token = UserAccessTokenFactory(user=playlist_access.user) response = self.client.patch( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_api_bbb_join_from_other_classroom(self):\n classroom = ClassroomFactory(\n meeting_id=\"21e6634f-ab6f-4c77-a665-4229c61b479a\",\n title=\"Classroom 1\",\n )\n other_classroom = ClassroomFactory()\n\n jwt_token = StudentLtiTokenFactory(\n playlis...
[ "0.6107479", "0.6083621", "0.60750157", "0.60168576", "0.59596074", "0.58931625", "0.5840474", "0.58315754", "0.5793931", "0.5762833", "0.57495147", "0.5731872", "0.5685747", "0.56484276", "0.5638104", "0.5625279", "0.5587912", "0.5572701", "0.5503463", "0.54822135", "0.54349...
0.67390877
0
Gets the type of this TimeDelta.
def type(self): return self._type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_type(self):\n return self._type_obj", "def get_type(self):\n return self._type", "def get_type(self):\n return self._type", "def get_type(self):\n return self._TYPE", "def get_type(self):\n return self.type", "def get_type(self):\n return self.type", "d...
[ "0.703558", "0.69859016", "0.69859016", "0.6940469", "0.69268423", "0.69268423", "0.68981844", "0.68966997", "0.68934447", "0.68785083", "0.674601", "0.67380995", "0.6724182", "0.6709774", "0.66956365", "0.6689046", "0.66732264", "0.66732264", "0.6660784", "0.6639971", "0.663...
0.6783274
25
Gets the days of this TimeDelta.
def days(self): return self._days
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def days(self):\n return int(self.hours / 24)", "def days(self):\n return self._contents", "def days(self) -> localedata.LocaleDataDict:\n return self._data['days']", "def day(self):\n return self._days", "def days(self) -> Optional[int]:\n return pulumi.get(self, \"days\")",...
[ "0.7724983", "0.7665834", "0.7487659", "0.7400622", "0.7296723", "0.72261095", "0.7122669", "0.70297915", "0.6927605", "0.68447185", "0.66930974", "0.66547763", "0.65760446", "0.65631944", "0.643906", "0.6393608", "0.6370138", "0.63289034", "0.6246991", "0.62280816", "0.61924...
0.83746344
0
Sets the days of this TimeDelta.
def days(self, days): self._days = days
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setDay(self, *args):\n return _libsbml.Date_setDay(self, *args)", "def AddDays(self, days):\n return Time(self.ut + days)", "def set_day(self, day):\n if day not in range(1, 31):\n raise ValueError(\"Day value must be in range [1..12] but is {}\".format(day))\n\n # Fi...
[ "0.67481685", "0.6282975", "0.6211118", "0.60892755", "0.6010261", "0.6010261", "0.59853035", "0.5873682", "0.582167", "0.5737246", "0.5679357", "0.5651348", "0.5580923", "0.5466667", "0.54287857", "0.5423969", "0.5285094", "0.5202137", "0.5200283", "0.51834744", "0.51777667"...
0.8150698
1
Gets the seconds of this TimeDelta.
def seconds(self): return self._seconds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seconds(self):\n return int(self)", "def seconds(self):\n end = self.end or timezone.now()\n result = end - self.start\n return result.seconds", "def elapsed_time_in_seconds(self):\n return self._elapsed_time_in_seconds", "def get_seconds(self):\n return self.sec...
[ "0.8074574", "0.8016026", "0.76550066", "0.7651455", "0.7556938", "0.74580735", "0.73250854", "0.73018116", "0.72156703", "0.7176364", "0.71622664", "0.71370316", "0.701836", "0.7004536", "0.6928138", "0.6928138", "0.6909008", "0.68722457", "0.67319554", "0.67305285", "0.6710...
0.8472494
1
Sets the seconds of this TimeDelta.
def seconds(self, seconds): self._seconds = seconds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_time(self, sec):\n self.set_timed(round(sec * 10.0))", "def __init__(self, seconds):\n self._seconds = seconds", "def set_timeout(self, seconds):\n self._timeout = seconds", "def seconds(self):\n return self._seconds", "def seconds(self):\n return self._seconds", ...
[ "0.6810063", "0.6632932", "0.65402776", "0.64813113", "0.64813113", "0.64486337", "0.642553", "0.64173967", "0.6330453", "0.6282555", "0.6260244", "0.6203994", "0.61984813", "0.61966795", "0.6192124", "0.6192124", "0.61542845", "0.6118087", "0.6015357", "0.6003133", "0.600313...
0.83012927
0
Gets the microsecond of this TimeDelta.
def microsecond(self): return self._microsecond
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timeTime(self):\n return self._micros / 1000000.0", "def num_microseconds(self, td):\n return float(td.microseconds + 1000000 * (td.seconds + 86400 * td.days))", "def millis(self):\n return self._micros // 1000", "def us(self):\n return 1000 * 1000 * self.read()", "def _unit...
[ "0.7106287", "0.70960015", "0.688888", "0.678411", "0.6730802", "0.6703445", "0.66763407", "0.66692644", "0.6656384", "0.6639469", "0.658625", "0.6569181", "0.6567314", "0.6555955", "0.64769536", "0.64004016", "0.6314467", "0.6293675", "0.6292478", "0.6269806", "0.6265364", ...
0.8602965
0
group([0,3,4,10,2,3], 2) => [(0,3), (4,10), (2,3)] Group a list into consecutive ntuples. Incomplete tuples are discarded e.g. >>> group(range(10), 3) [(0, 1, 2), (3, 4, 5), (6, 7, 8)]
def group(lst, n): return zip(*[lst[i::n] for i in range(n)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_tuples(l, n):\n assert len(l) % n == 0\n ret = []\n for i in range(0, len(l), n):\n v = l[i:i + n]\n ret.append(tuple(v))\n return ret", "def grouper(n, iterable):\n args = [iter(iterable)] * n\n return list((tuple([e for e in t if e != None]) for t in zip_longest(*args)...
[ "0.77166075", "0.7431403", "0.7235768", "0.7226033", "0.71423167", "0.70415825", "0.696839", "0.69655544", "0.6907547", "0.68876237", "0.68561655", "0.6852677", "0.68507653", "0.6839593", "0.6837483", "0.6836663", "0.6821022", "0.681446", "0.681446", "0.6801948", "0.6801948",...
0.744096
1
Get absolute path to resource, works for dev and for PyInstaller
def resource_path(relative_path): try: # PyInstaller creates a temp folder and stores path in _MEIPASS base_path = sys._MEIPASS except Exception: base_path = os.path.abspath(".") return os.path.join(base_path, relative_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_resource_path():\n return os.path.join(os.path.dirname(__file__), \"resources\") + os.path.sep", "def resourcePath(relative):\r\n try:\r\n # PyInstaller creates a temp folder and stores path in _MEIPASS\r\n base_path = sys._MEIPASS\r\n except Exception:\r\n base_path = os.pa...
[ "0.83703053", "0.8280665", "0.8248955", "0.8139455", "0.81142074", "0.8098781", "0.80942494", "0.80799556", "0.8067926", "0.80675894", "0.80627203", "0.80627203", "0.80627203", "0.80627203", "0.80627203", "0.80627203", "0.80627203", "0.80571795", "0.8054659", "0.8040502", "0....
0.8045055
31
Returns the number of the misplaced tiles in the given state
def no_of_misplaced_tiles(state): h1 = 0 goal_state = [[0], [1, 2, 3], [4, 5, 6], [7, 8, 9]] for y in range(len(goal_state)): for x in range(len(goal_state[y])): if state[y][x] != goal_state[y][x]: h1 += 1 return h1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_nr_of_misplaced_tiles(board):\n result = 0\n\n for idx, val in enumerate(board):\n if idx != val:\n result += 1\n\n return result", "def misplaced_heuristic(state):\n msp_h = 0\n size = len(state)\n for i in range (size):\n for j in range (size):\n if...
[ "0.7603895", "0.7365585", "0.6923576", "0.68336004", "0.67028564", "0.66850436", "0.6553833", "0.6529333", "0.6481356", "0.6456752", "0.6401006", "0.63996434", "0.6396819", "0.6379321", "0.63779706", "0.6354483", "0.6297823", "0.6286979", "0.62134063", "0.6183768", "0.6159739...
0.8721227
0
U = exp( x^2 / 2) + 2 exp( (x 1) ^ 2 / 2)
def initial_conditions_1(x): from math import exp u1 = 1 u2 = 2 return u1 * exp(- x ** 2 / 2) + u2 * exp(- (x - 1) ** 2 / 2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exp(self, X, U):\n raise NotImplementedError", "def ExpU(x):\n\treturn sum(x * lambdas)", "def exo2_1(x,mu):\r\n return (x*1.0)*mu*(1-x)", "def NormU(x):\n return sum(0.5*x**2)", "def F(x):\n return math.exp(-0.5 * (x ** 2))", "def U(n,gamma,A,y):\n return (2*A*gamma*math.sin(math....
[ "0.7482904", "0.7444792", "0.73515326", "0.71571827", "0.70566493", "0.6983036", "0.6975332", "0.6820438", "0.68089145", "0.67936164", "0.67936164", "0.67478615", "0.67468625", "0.6694803", "0.6684441", "0.66647124", "0.66647124", "0.66647124", "0.66647124", "0.66647124", "0....
0.6941545
7
The XML representation of this page. Returns an etree.Element object.
def xml(self, request): raise Exception("Not Implemented")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xml(self):\n return self._xml", "def xml(self):\n return self._xml", "def get_xml(self):\n return etree.tostring(self.get_etree())", "def xml(self):\n return parse_xml(self, tab=\"\\t\", id=self.id or \"\")", "def xml(self):\n return lxml.etree.fromstring(self.content...
[ "0.73401463", "0.73401463", "0.7048817", "0.70146155", "0.70092654", "0.70035905", "0.69213355", "0.6904078", "0.68569833", "0.66485786", "0.6430963", "0.6385024", "0.638318", "0.634318", "0.6300098", "0.624862", "0.6123896", "0.609562", "0.6062898", "0.5981497", "0.5965818",...
0.5434564
61
Find the process start time in seconds since epoch
def proc_start(): fd = open("/proc/self/stat") start_clk = int(fd.readline().split()[21]) start_sec = start_clk // os.sysconf("SC_CLK_TCK") fd.close() fd = open("/proc/stat") boot_sec = None for line in fd: if line.startswith("btime"): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_start_time(self):\n # Searching through qstat and grabbing only the start time. Lot of weeding out.\n qstat = subprocess.getoutput(\"qstat -j {0}\".format(self.id))\n qstat = qstat[qstat.find(\"start_time\"):]\n qstat = qstat[:qstat.find('\\n')]\n return qstat[28:]", "d...
[ "0.73020154", "0.71002936", "0.7090944", "0.7041562", "0.70121115", "0.6975595", "0.69687605", "0.691083", "0.6906726", "0.6887662", "0.68876094", "0.685053", "0.685053", "0.6833187", "0.6833187", "0.68103546", "0.6800225", "0.6783602", "0.6779121", "0.67742", "0.67742", "0...
0.7166436
1
Returns empty string if num is 0, else deltastr of num wrapped in parens and leading space.
def pdeltastr(num, include_sign=True, currency=False): if num == 0: return '' return f' ({deltastr(num, include_sign=include_sign, currency=currency)})'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deltastr(num, include_sign=True, currency=False):\n if num == 0:\n return ''\n elif num > 0:\n b4 = Fore.GREEN\n elif num < 0:\n b4 = Fore.RED\n signage = '+' if include_sign else ''\n b4 += '$' if currency else ''\n numfmt = ',.0f' if currency else ''\n return f'{b4}{...
[ "0.75879884", "0.63615566", "0.6291513", "0.62501764", "0.6224222", "0.62028486", "0.6095904", "0.6074634", "0.600898", "0.5904692", "0.58546597", "0.5814962", "0.57782805", "0.5767514", "0.57100093", "0.5699665", "0.56891596", "0.5661626", "0.5649867", "0.5646915", "0.558203...
0.7876739
0
Called the close a client's connection.
def client_close(self, transport, reason): client = self.clients[transport] if client.ident.registered: client.send_as_user('QUIT', f':{reason}') for chan in client.joined_channels.values(): chan.user_quit(client, reason) client._write(f'ERROR :Closing Link: {c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def closeConnecetion(self):\n client.close()", "def close(self):\n if self.client:\n self.client.connection.close()\n self.client = None", "def close_connection(self, connection):\n connection.client = None\n connection.close()", "def close_connection(self):\n\n ...
[ "0.8410175", "0.7890963", "0.77258545", "0.77042955", "0.7681945", "0.7667413", "0.7634875", "0.76231045", "0.761215", "0.75926864", "0.7565583", "0.75390166", "0.7511652", "0.74437755", "0.7421762", "0.74182224", "0.7412031", "0.7403245", "0.7397795", "0.73764503", "0.736914...
0.7257629
38
return human readable string representation of rrsig timestamp
def rrsigtime2string(rrsig_time): return time.strftime("%Y-%m-%d-%H:%M", time.gmtime(rrsig_time))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timeStamp():\n import time\n return str(time.strftime(\"%a %d %b %Y %I:%M:%S %p\"))", "def timestamp():\n return datetime.now().strftime(\"%Y%m%dT%H%M%S\")", "def _get_timestamp():\n return str(int(time.time()))", "def timestamp():\n tmptz = time.timezone\n sign_str = '+'\n i...
[ "0.706641", "0.6930976", "0.6844006", "0.68285877", "0.6820314", "0.6718581", "0.66697687", "0.6654269", "0.6627397", "0.66018754", "0.6591093", "0.6575036", "0.65576386", "0.6534326", "0.6525083", "0.6517755", "0.65122736", "0.6500743", "0.6455363", "0.64499396", "0.6416318"...
0.8070521
0
Send a message to slack.
async def send_message(self, message: dict) -> None: await self.client.chat_postMessage(channel=self.channel_id, **message)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_slack(self, message):\n self.slack_client.api_call('chat.postMessage', channel=self.slack_channel, text=message, username=self.username, icon_emoji=self.slack_icon_emoji)\n print(\"Slack Notification sent\")", "def send_message(channel, message):\n slack_client = get_client()\n slack...
[ "0.8559471", "0.7874424", "0.7823575", "0.73514163", "0.73196906", "0.72976357", "0.72936374", "0.7270686", "0.72591066", "0.72574115", "0.72484803", "0.7213883", "0.71053416", "0.71001226", "0.709008", "0.70291615", "0.70284885", "0.70014435", "0.6952026", "0.6887193", "0.68...
0.667519
31
An empty string produces a zerolength match
def test_empty_string_is_also_a_match(self): pattern = "" s = "abcdef" self.assertEqual(__, re.search(pattern, s).group())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_empty_string_is_also_a_match(self):\n empty_string = \"\"\n s = \"abcdef\"\n self.assertEqual(__, re.match(empty_string, s).group())", "def test_handles_empty_string(self):\n result = encode_run_length(\"\")\n self.assertEqual(result, \"\")", "def test_no_match(self)...
[ "0.717302", "0.7040296", "0.6639365", "0.66279715", "0.65890396", "0.6567421", "0.6458653", "0.6436814", "0.6394537", "0.6387724", "0.6317118", "0.6284666", "0.62062955", "0.6171678", "0.6149206", "0.6131138", "0.61064345", "0.59907097", "0.5970105", "0.59045875", "0.5898277"...
0.7109084
1
If no match is found, None is returned.
def test_no_match(self): pattern = "q" s = "abcdef" self.assertEqual(__, re.search(pattern, s)) # You can also test for False self.assertEqual(__, self._truth_value(re.search(pattern, s)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_match_result(self, variable):\n try:\n return self._match_result_dict[variable]\n except KeyError:\n return None", "def _find_first(self, ast, label):\n res = self._find_all(ast, label, max_results=1)\n if len(res):\n return res[0]\n ret...
[ "0.71160924", "0.66627014", "0.66321117", "0.66225207", "0.6600267", "0.65928066", "0.6575274", "0.64357936", "0.6431958", "0.63773596", "0.63650346", "0.62763935", "0.6268462", "0.61682683", "0.6121754", "0.6119858", "0.6057726", "0.6037225", "0.6024601", "0.60051805", "0.59...
0.0
-1
Move current to north.
def moveNorth(self): north = (self.current[0], self.current[1] - 1) mv = self.lab.north() self.check_grue(mv) self.current = north self.visited.add(self.current)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_north(self):\r\n self.move(dx=0, dy=-1)", "def do_north(self, arg):\r\n moveDirection('north')", "def move_north(self):\n self.vertical = (self.vertical * 2)[1:5]\n self.horizontal[1] = self.vertical[0]\n self.horizontal[3] = self.vertical[2]", "def moveNorth(self)...
[ "0.7902218", "0.7640808", "0.75572795", "0.7476105", "0.6765409", "0.669074", "0.6542743", "0.6474336", "0.6463978", "0.64041656", "0.6387174", "0.63617265", "0.63605154", "0.6279849", "0.62762886", "0.62679887", "0.62588596", "0.625499", "0.62205887", "0.62007564", "0.619816...
0.83685005
0
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues): #based on http://scikit-learn.org/stable/auto_examples/model_selection/plot_confusion_matrix.html if normalize: cm = cm.asty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n...
[ "0.81940335", "0.8095006", "0.80290395", "0.8019189", "0.7993875", "0.7991161", "0.79809004", "0.7975263", "0.7961412", "0.7956938", "0.7937461", "0.7934524", "0.7934342", "0.7931134", "0.79244965", "0.792367", "0.79231006", "0.7922885", "0.792215", "0.7917699", "0.7915931", ...
0.7926225
14
Construct a Budget instance using a Dataset
def __init__(self, dset, grid=None): self.grid = xgcm.Grid(dset) if grid is None else grid self.coords = dset.coords.to_dataset().reset_coords() self.dset = dset self.terms = None # self.dset = dset.reset_coords(drop=True) # self.volume = dset.drF * dset.h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, dataset: Dataset):\n self.dataset = dataset", "def __init__(self, dataset):\n self._dataset = dataset", "def BDT(BDTSetup, dataloader, factory):\n\n factory.BookMethod(dataloader, ROOT.TMVA.Types.kBDT,\n BDTSetup.ModelName ,\"!H:!V:NTrees=\"+BDTSetup.T...
[ "0.6247712", "0.6094925", "0.59988284", "0.5967083", "0.58397275", "0.5798842", "0.5735186", "0.5731092", "0.57284236", "0.5706039", "0.56516707", "0.56244624", "0.5599986", "0.55957985", "0.55917513", "0.5546313", "0.5544497", "0.55394304", "0.5536071", "0.5493607", "0.54704...
0.0
-1
Similar to Levenshtein, DamerauLevenshtein distance is the minimum number of operations needed to transform\ one string into the other, where an operation is defined as an insertion, deletion, or substitution of \ a single character, or a transposition of two adjacent characters.
def damerau_levenshtein_distance(s1, s2): utils.check_for_none(s1, s2) utils.check_for_type(str, s1, s2) # s1 = utils.unicode_normalize(s1) # s2 = utils.unicode_normalize(s2) n1, n2 = len(s1), len(s2) infinite = n1 + n2 char_arr = defaultdict(int) dp = [[0] * (n2 + 2) for _ in range(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def string_edit_dist(str1, str2):\n sm = edit_distance.SequenceMatcher(a=str1, b=str2)\n return sm.distance()", "def levenshtein_distance(s1,s2):\n\n\t\tif len(s1) < len(s2):\n\t\t\treturn Searcher.levenshtein_distance(s2, s1)\n\n\t\t# len(s1) >= len(s2)\n\t\tif len(s2) == 0:\n\t\t\treturn len(s1)\n\n\t\tp...
[ "0.78854764", "0.7880295", "0.77333295", "0.76940846", "0.751089", "0.74969727", "0.748904", "0.745947", "0.7456", "0.7385905", "0.73622215", "0.7346673", "0.7341416", "0.7304381", "0.7303413", "0.7276858", "0.7268963", "0.72327125", "0.7232213", "0.71839744", "0.71532655", ...
0.76465
4
Adds an Edge or WeightedEdge instance to the Digraph. Raises a ValueError if either of the nodes associated with the edge is not in the graph.
def add_edge(self, edge): src = edge.get_source() dest = edge.get_destination() #weightEdge = WeightedEdge(src, dest, edge.get_total_distance(), edge.get_outdoor_distance()) if not (src in self.edges and dest in self.edges): raise ValueError('Node not in graph') self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_edge(self, name1: Any, name2: Any, weight: float = 1.0) -> None:\n if name1 in self._vertices and name2 in self._vertices:\n v1 = self._vertices[name1]\n v2 = self._vertices[name2]\n\n # Add the new edge\n v1.neighbours[v2] = weight\n v2.neighbo...
[ "0.7257835", "0.72203094", "0.7217524", "0.7213543", "0.71921957", "0.70997864", "0.7074714", "0.7040058", "0.7009269", "0.69821876", "0.6972704", "0.6930132", "0.6926065", "0.6897106", "0.68655914", "0.6833851", "0.68137264", "0.68077", "0.6806881", "0.679178", "0.67913944",...
0.7554839
0
cond_single_imputation takes in a dataframe with columns father and child (with missing values in child) and imputes singlevalued mean imputation of the child column, conditional on father. Your function should return a Series.
def cond_single_imputation(new_heights): quartile_heights = new_heights.assign(quartile=pd.qcut(new_heights['father'], 4)) # Find the quartile for each height of father child_mean = quartile_heights.groupby('quartile')['child'].transform('mean') # A series of child mean heights imputed = new_heights['child'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fill_missing(df,strategy='mean', missingValue=np.nan):\n c_name = [n for n,d in df.dtypes if d != 'string' and d != 'boolean']\n imp = Imputer(inputCols=c_name,outputCols=c_name,strategy=strategy, missingValue=missingValue).fit(df)\n return imp,imp.transform(df)", "def impute(df, median=False, mean=...
[ "0.5700621", "0.5495814", "0.53209054", "0.5211726", "0.5178586", "0.5164251", "0.51208377", "0.5103357", "0.50699043", "0.502336", "0.50118643", "0.5001999", "0.4981807", "0.49431702", "0.49332556", "0.49225762", "0.49000287", "0.48975685", "0.48800728", "0.48800728", "0.483...
0.7279283
0
Returns the project that this instance of the check is scoped to
def get_scoped_project(self, project_auth_scope): filter_params = {} url = "{0}/{1}/{2}".format(self.keystone_server_url, DEFAULT_KEYSTONE_API_VERSION, "projects") if project_auth_scope.tenant_id: if project_auth_scope.project_name: return {"id": project_auth_scope.t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def project(self):\n return self._project", "def project(self):\n return self._project", "def project(self):\n return self._project", "def project(self):\n return self._project", "def project(self):\n return self._project", "def getProject(self):\r\n return self....
[ "0.7730776", "0.7730776", "0.7730776", "0.7730776", "0.7730776", "0.7717879", "0.76701653", "0.76286095", "0.7598338", "0.7349904", "0.7348948", "0.7288143", "0.725343", "0.72432095", "0.7085965", "0.6964929", "0.6964929", "0.6964929", "0.6964929", "0.6964929", "0.6964929", ...
0.6556958
68
Constructs an empty comparison algorithm for bounding boxes. The bounding boxes are then defined using the Initialize function.
def __init__(self, *args): _Bnd.Bnd_BoundSortBox_swiginit(self,_Bnd.new_Bnd_BoundSortBox(*args))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_bounding_box_intersection(self):\n\n west_java = [105, -7, 108, -5]\n jakarta = [106.5, -6.5, 107, -6]\n\n # Test commutative law\n assert numpy.allclose(bbox_intersection(west_java, jakarta),\n bbox_intersection(jakarta, west_java))\n\n # Te...
[ "0.61537594", "0.6082697", "0.6068528", "0.6050072", "0.60234797", "0.59425175", "0.5934042", "0.5924104", "0.58388835", "0.58251333", "0.5823121", "0.5818926", "0.5776806", "0.5774812", "0.5763587", "0.57391596", "0.57176393", "0.571594", "0.570627", "0.56951845", "0.5691379...
0.61480415
1
Initializes this comparison algorithm with the set of bounding boxes SetOfBox.
def Initialize(self, *args): return _Bnd.Bnd_BoundSortBox_Initialize(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_boxes(self, listOfBoxes):\n self._boxes = listOfBoxes", "def build_boxes(self):\n for index in self.box_space.points:\n if self.rank_of_box[index] == self.my_rank:\n self.my_boxes.append(Box(self, index))", "def calc_bounding_box(self):\n self.BB = self.g...
[ "0.6079625", "0.6055667", "0.6003076", "0.5997159", "0.599146", "0.5888168", "0.5821823", "0.57895696", "0.5775231", "0.57385015", "0.5725594", "0.56588644", "0.56587285", "0.56562907", "0.5655232", "0.55803376", "0.5558193", "0.5543945", "0.549001", "0.5474804", "0.54721147"...
0.5599943
15
Compares the bounding box theBox, with the set of bounding boxes to be sorted by this comparison algorithm, and returns the list of intersecting bounding boxes as a list of indexes on the array of bounding boxes used by this algorithm.
def Compare(self, *args): return _Bnd.Bnd_BoundSortBox_Compare(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intersection(boxes, box):\n ix = np.maximum(0, np.minimum(box[2], boxes[:,2]) - np.maximum(box[0], boxes[:,0]))\n iy = np.maximum(0, np.minimum(box[3], boxes[:,3]) - np.maximum(box[1], boxes[:,1]))\n return ix*iy", "def containing(*boxes):\n if not boxes:\n raise ValueError('At least one boundin...
[ "0.67275715", "0.65763843", "0.65554476", "0.6382834", "0.633206", "0.6264027", "0.6180333", "0.6162171", "0.61469525", "0.6120469", "0.6106462", "0.60373676", "0.6028207", "0.6027797", "0.5994653", "0.59031314", "0.5899352", "0.5888319", "0.58673036", "0.58652014", "0.586409...
0.5574407
45
Constructs an empty comparison algorithm for 2D bounding boxes. The bounding boxes are then defined using the Initialize function.
def __init__(self, *args): _Bnd.Bnd_BoundSortBox2d_swiginit(self,_Bnd.new_Bnd_BoundSortBox2d(*args))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iou_bbox(bboxes1, bboxes2):\n bboxes1 = np.array(bboxes1, np.float32)\n bboxes2 = np.array(bboxes2, np.float32)\n \n intersection_min_y = np.maximum(bboxes1[:, 0], bboxes2[:, 0])\n intersection_max_y = np.minimum(bboxes1[:, 0] + bboxes1[:, 2] - 1, bboxes2[:, 0] + bboxes2[:, 2] - 1)\n intersec...
[ "0.63952726", "0.63203335", "0.62192166", "0.6218588", "0.6193795", "0.61698127", "0.6166384", "0.61317146", "0.6092019", "0.6089869", "0.6065107", "0.6060138", "0.6052084", "0.60142463", "0.59958744", "0.5986751", "0.5963053", "0.5932616", "0.5916168", "0.5902891", "0.588572...
0.63592523
1
Compares the 2D bounding box theBox with the set of bounding boxes to be sorted by this comparison algorithm, and returns the list of intersecting bounding boxes as a list of indexes on the array of bounding boxes used by this algorithm.
def Compare(self, *args): return _Bnd.Bnd_BoundSortBox2d_Compare(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intersection(boxes, box):\n ix = np.maximum(0, np.minimum(box[2], boxes[:,2]) - np.maximum(box[0], boxes[:,0]))\n iy = np.maximum(0, np.minimum(box[3], boxes[:,3]) - np.maximum(box[1], boxes[:,1]))\n return ix*iy", "def _filter_box_candidates(self, bboxes, labels):\n bbox_w = bboxes[:, 2] - b...
[ "0.686238", "0.6585757", "0.6474506", "0.64416903", "0.6381553", "0.62875587", "0.6198391", "0.6193202", "0.61643606", "0.6158885", "0.615312", "0.60585946", "0.6043888", "0.60289675", "0.6026197", "0.60082483", "0.5994584", "0.5994481", "0.5972711", "0.59592086", "0.5952935"...
0.5487832
73
Returns the gap of this bounding box.
def GetGap(self, *args): return _Bnd.Bnd_Box_GetGap(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetGap(self, *args):\n return _Bnd.Bnd_Box2d_GetGap(self, *args)", "def Gap(self):\n\t\treturn self._get_attribute('gap')", "def gap_width(self):\n return self.container['gap_width']", "def gap_depth(self):\n return self.container['gap_depth']", "def gapless(self):\n return ...
[ "0.7923536", "0.754379", "0.75110376", "0.7339822", "0.72897536", "0.7108356", "0.6733533", "0.66776615", "0.6543685", "0.64624", "0.631531", "0.6245704", "0.61330897", "0.61330897", "0.61330897", "0.6109773", "0.60771465", "0.60724443", "0.6062596", "0.60454303", "0.60343957...
0.8342801
0
Set the gap of this bounding box to abs(Tol).
def SetGap(self, *args): return _Bnd.Bnd_Box_SetGap(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetAbsTol(self, atol):\n return _hypre.HyprePCG_SetAbsTol(self, atol)", "def SetTol(self, tol):\n return _hypre.HypreBoomerAMG_SetTol(self, tol)", "def set_abs_tolerance(self, value):\n\n self._abs_tolerance = value", "def set_tolerance(self, tol):\n self.tolerance = tol", "...
[ "0.6429482", "0.61815405", "0.6117248", "0.5939136", "0.58057404", "0.57472616", "0.5674504", "0.564736", "0.5523236", "0.55016387", "0.5449436", "0.5445979", "0.5408376", "0.5387069", "0.53750324", "0.5305313", "0.5214793", "0.52125585", "0.52007747", "0.5177376", "0.5164475...
0.60851556
3
Enlarges the box with a tolerance value. (minvaluesAbs() and maxvalues+Abs()) //!This means that the minimum values of its X, Y and Z intervals of definition, when they are finite, are reduced by the absolute value of Tol, while the maximum values are increased by the same amount.
def Enlarge(self, *args): return _Bnd.Bnd_Box_Enlarge(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testMinMax(self, value):\n\t\tif value > self.oldmax:\n\t\t\tself.oldmax = value\n\t\t\tself.maxBox.SetValue(str(value).encode('utf-8'))\n\t\telif value < self.oldmin:\n\t\t\tself.oldmin = value\n\t\t\tself.minBox.SetValue(str(value).encode('utf-8'))", "def set_abs_tolerance(self, value):\n\n self._ab...
[ "0.6424777", "0.5976167", "0.5747552", "0.572023", "0.5642022", "0.5623884", "0.5582774", "0.55660236", "0.55414486", "0.55315137", "0.5520396", "0.54982615", "0.54380584", "0.54263043", "0.53888655", "0.536884", "0.5367788", "0.5365747", "0.53634965", "0.53257567", "0.531157...
0.4906981
77
The Box will be infinitely long in the Xmin direction.
def OpenXmin(self, *args): return _Bnd.Bnd_Box_OpenXmin(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getExceedingBoxLeft(self):\n return self.exceedingBoxLeft", "def Enlarge(self, *args):\n return _Bnd.Bnd_Box_Enlarge(self, *args)", "def border_box_x(self):\n return self.position_x + self.margin_left", "def box(self, x, y, w, h):\n\t\tpass", "def content_box_x(self):\n retu...
[ "0.60542816", "0.6019284", "0.5974027", "0.59691733", "0.58866143", "0.57969964", "0.5785842", "0.57740086", "0.57670116", "0.5736743", "0.57330936", "0.5723996", "0.56913865", "0.56887394", "0.5640146", "0.56230783", "0.5609342", "0.56078017", "0.56026936", "0.5599427", "0.5...
0.6148627
0
The Box will be infinitely long in the Xmax direction.
def OpenXmax(self, *args): return _Bnd.Bnd_Box_OpenXmax(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maxX(self):\n return max(self.getx())", "def OpenXmax(self, *args):\n return _Bnd.Bnd_Box2d_OpenXmax(self, *args)", "def box(self, x, y, w, h):\n\t\tpass", "def OpenZmax(self, *args):\n return _Bnd.Bnd_Box_OpenZmax(self, *args)", "def Enlarge(self, *args):\n return _Bnd.Bnd_...
[ "0.6260456", "0.61927193", "0.6025847", "0.602418", "0.59927213", "0.59055215", "0.5848352", "0.58344257", "0.58150023", "0.5742435", "0.57261765", "0.5708261", "0.5703498", "0.569588", "0.56812215", "0.5661412", "0.5655045", "0.56497496", "0.56344485", "0.5597465", "0.559744...
0.66178334
0
The Box will be infinitely long in the Ymin direction.
def OpenYmin(self, *args): return _Bnd.Bnd_Box_OpenYmin(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self):\r\n self.rect.y += 12\r\n\r\n if self.rect.y > 500:\r\n self.rect.y = random.randrange(-1000, -60)", "def toTk(self,y):\r\n if y == maxValue: return 0\r\n tk_y = Size\r\n if y != minValue:\r\n tk_y -= y\r\n return tk_y", "def che...
[ "0.61588454", "0.602974", "0.60118395", "0.6011714", "0.58847064", "0.58748573", "0.5857971", "0.5852167", "0.58391917", "0.58213776", "0.57865906", "0.57847404", "0.5782609", "0.5778817", "0.57745445", "0.57711726", "0.57694715", "0.57681865", "0.57193327", "0.57187766", "0....
0.603874
1
The Box will be infinitely long in the Ymax direction.
def OpenYmax(self, *args): return _Bnd.Bnd_Box_OpenYmax(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def OpenYmax(self, *args):\n return _Bnd.Bnd_Box2d_OpenYmax(self, *args)", "def getMaxY(self):\n return self.maxy", "def border_box_y(self):\n return self.position_y + self.margin_top", "def get_y(self):\n\t\treturn self._collision_rect.y + 25", "def toTk(self,y):\r\n if y == ma...
[ "0.65089345", "0.6230374", "0.6224476", "0.6187412", "0.6175203", "0.6119015", "0.60495317", "0.6024424", "0.6017736", "0.60133564", "0.5985591", "0.59715986", "0.59695053", "0.59173983", "0.5895119", "0.58898914", "0.5881197", "0.5874255", "0.5867704", "0.58589023", "0.58579...
0.66693866
0
Returns true if this bounding box is open in the Xmax direction.
def IsOpenXmax(self, *args): return _Bnd.Bnd_Box_IsOpenXmax(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def IsOpenXmax(self, *args):\n return _Bnd.Bnd_Box2d_IsOpenXmax(self, *args)", "def IsOpenXmin(self, *args):\n return _Bnd.Bnd_Box_IsOpenXmin(self, *args)", "def IsOpenYmax(self, *args):\n return _Bnd.Bnd_Box_IsOpenYmax(self, *args)", "def IsOpenXmin(self, *args):\n return _Bnd.Bn...
[ "0.84815514", "0.7708037", "0.75882566", "0.7518821", "0.7484127", "0.7229682", "0.7218617", "0.6906463", "0.6807362", "0.65920174", "0.6567638", "0.6388174", "0.63586354", "0.6303765", "0.6267946", "0.61094725", "0.61094725", "0.6062759", "0.5992613", "0.5967686", "0.5936086...
0.8650418
0
Computes the minimum distance between two boxes.
def Distance(self, *args): return _Bnd.Bnd_Box_Distance(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def minDistBoundingBox(box1, box2):\n\n x1, y1, bw1, bh1 = box1[0], box1[1], box1[2], box1[3]\n x1b, y1b = x1 + bw1, y1 + bh1\n x2, y2, bw2, bh2 = box2[0], box2[1], box2[2], box2[3]\n x2b, y2b = x2 + bw2, y2 + bh2\n left = x2b < x1\n right = x1b < x2\n bottom = y2b < y1\n top = y1b < y2\n ...
[ "0.73741424", "0.72668433", "0.7220609", "0.71784115", "0.67081183", "0.6707593", "0.6621747", "0.65915895", "0.6582767", "0.6568873", "0.65343016", "0.64736944", "0.6470667", "0.64662254", "0.642127", "0.64003724", "0.63891536", "0.63873243", "0.6339235", "0.63168424", "0.63...
0.6055135
46
Returns the gap of this 2D bounding box.
def GetGap(self, *args): return _Bnd.Bnd_Box2d_GetGap(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetGap(self, *args):\n return _Bnd.Bnd_Box_GetGap(self, *args)", "def gap_width(self):\n return self.container['gap_width']", "def Gap(self):\n\t\treturn self._get_attribute('gap')", "def gap_depth(self):\n return self.container['gap_depth']", "def gapless(self):\n return se...
[ "0.7966738", "0.70892686", "0.70154387", "0.69600374", "0.6854435", "0.6589621", "0.63569564", "0.6346956", "0.6313244", "0.63094217", "0.61966074", "0.6178771", "0.61536664", "0.6146663", "0.6126472", "0.61073947", "0.6098056", "0.6056804", "0.605255", "0.6001975", "0.599070...
0.8073069
0
Set the gap of this 2D bounding box to abs(Tol).
def SetGap(self, *args): return _Bnd.Bnd_Box2d_SetGap(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetTol(self, tol):\n return _hypre.HypreBoomerAMG_SetTol(self, tol)", "def SetGap(self, *args):\n return _Bnd.Bnd_Box_SetGap(self, *args)", "def SetAbsTol(self, atol):\n return _hypre.HyprePCG_SetAbsTol(self, atol)", "def set_tolerance(self, tol):\n self.tolerance = tol", "d...
[ "0.59892136", "0.58637667", "0.5834912", "0.5784683", "0.57178056", "0.56489706", "0.5600895", "0.557566", "0.54841614", "0.5469809", "0.5451848", "0.5316743", "0.5310652", "0.5282661", "0.5251493", "0.52508116", "0.5245115", "0.52353555", "0.52004546", "0.5156026", "0.515378...
0.56685513
5
Enlarges the box with a tolerance value. This means that the minimum values of its X and Y intervals of definition, when they are finite, are reduced by the absolute value of Tol, while the maximum values are increased by the same amount.
def Enlarge(self, *args): return _Bnd.Bnd_Box2d_Enlarge(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_size_tolerance(self, tolerance):\n self._size_tolerance = tolerance", "def set_tol_2d(value=1e-9):\r\n geometry.gmSetXyTol(value)", "def set_tolerance(self, value):\n\n self._tolerance = value", "def tolerance(self, tolerance: float) -> None:\n self._tolerance = tolerance", ...
[ "0.6292211", "0.5902316", "0.5845207", "0.57429975", "0.5718173", "0.5623542", "0.5591686", "0.5558219", "0.5556086", "0.55155516", "0.55085856", "0.54569495", "0.5426542", "0.5424399", "0.5407613", "0.53956324", "0.53947777", "0.5385308", "0.5346603", "0.5335749", "0.5317379...
0.48126417
64