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
Sets gradients of all model parameters to zero.
def zero_grad(self): for p in self.parameters(): if p.grad is not None: p.grad.data.zero_()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zero_grad(self):\r\n for param in self.params:\r\n param.grad = None", "def zero_grad(self):\n for p, dp in self.params:\n dp.zero_()", "def zero_grad(self):\n for parameter in self.param():\n parameter.zero_grad()", "def zero_grad(self):\n for...
[ "0.82806003", "0.82769936", "0.8231913", "0.8031716", "0.8031716", "0.7783295", "0.7739907", "0.7729052", "0.7556755", "0.75208354", "0.7423662", "0.73386514", "0.7333627", "0.730899", "0.72826827", "0.72826827", "0.72826827", "0.7223956", "0.7222747", "0.7210486", "0.7208907...
0.7976485
5
This inner function plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def ploting(cm, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues): if normalize: cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis] print("Normalized confusion matrix") else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(self, cm, classes, normalize, cmap=plt.cm.Blues, title='confusin Matrix'):\r\n if normalize:\r\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\r\n print(\"Normalized confusion matrix\")\r\n else:\r\n print('Confusion matrix, without...
[ "0.77164495", "0.76540625", "0.764322", "0.7595908", "0.75909555", "0.7550877", "0.75483376", "0.754067", "0.75329095", "0.7528455", "0.7525228", "0.7520291", "0.7519119", "0.7517534", "0.75118315", "0.7500635", "0.7472815", "0.7470369", "0.7467355", "0.74652076", "0.74612886...
0.0
-1
Returns the vault location (either default or user defined)
def getVaultPath(): global args, vaultPathDefault if args.vault_location: return args.vault_location; return vaultPathDefault;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vault_uri(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"vault_uri\")", "def location(self) -> Optional[str]:\n return pulumi.get(self, \"location\")", "def location(self) -> Optional[str]:\n return pulumi.get(self, \"location\")", "def location(self) -> Optional[str]:\n ...
[ "0.69506", "0.6760911", "0.6760911", "0.6760911", "0.66249406", "0.66249406", "0.66249406", "0.66249406", "0.66249406", "0.66249406", "0.66249406", "0.66249406", "0.66249406", "0.66249406", "0.66249406", "0.66249406", "0.66249406", "0.6464653", "0.6464653", "0.6464653", "0.64...
0.8157565
0
Gets a list of documents in a project.
def get_document_list( self, project_id: int, url_parameters: dict = {} ) -> requests.models.Response: return self.get( 'v1/projects/{project_id}/docs{url_parameters}'.format( project_id=project_id, url_parameters=self.build_url_parameter(u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_documents(self, project_id, param=None):\n url = base_url + 'portal/' + str(self.portal_id) + '/projects/' + str(project_id) + '/documents/' \n response = zoho_http_client.get(url, self.details, param)\n return parser.get_documents(response)", "def documents(self, **kw):\r\n \...
[ "0.81018174", "0.707067", "0.6955606", "0.687658", "0.68592155", "0.67349243", "0.66181815", "0.6617949", "0.66143847", "0.6593786", "0.6581905", "0.65298635", "0.6526769", "0.6496761", "0.64907295", "0.644781", "0.6428039", "0.63709676", "0.63569045", "0.63443947", "0.632218...
0.83108544
0
Tests if instance is properly initialized
def test_initialization(): assert symmetric != None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkInit(this):\n\t\tif not this._CAP: raise Exception('Vous devez initialiser la caméra...')", "def _is_initialized(self) -> bool:\n return len(self) > 0", "def _check_initialized(self):\n self.assertEquals(0, self._error_count)\n self.assertEquals(0, len(self._error_messages))", "...
[ "0.7602685", "0.75069714", "0.74394304", "0.74244887", "0.73722965", "0.7157598", "0.7157598", "0.71361506", "0.71361506", "0.71331203", "0.71331203", "0.712493", "0.69910604", "0.6968258", "0.6944604", "0.6940901", "0.6917114", "0.68923914", "0.6881368", "0.68755925", "0.687...
0.0
-1
Function for dropout layer
def dropout(x, keep_prob, name): with tf.name_scope(name): outputs = tf.nn.dropout(x, keep_prob) # Return layer's output return outputs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_dropout_layer(self):\n return tf.keras.layers.Dropout(rate=self.dropout)", "def _dropout(self,components,dropout=None):\r\n \r\n if dropout is not None:\r\n components.append(nn.Dropout(dropout))", "def dropout(input_var=None):\n\n # Hyperparameters\n hp = Hyper...
[ "0.79477644", "0.78386915", "0.76815706", "0.75741386", "0.75179684", "0.7510735", "0.7435059", "0.7140886", "0.70981705", "0.70008665", "0.688738", "0.68718344", "0.68533725", "0.68001616", "0.6774679", "0.671026", "0.6708079", "0.66834867", "0.6683382", "0.6669269", "0.6668...
0.728888
7
Function for softmax layer
def softmax(x, name): with tf.name_scope(name): outputs = tf.nn.softmax (x) # Return layer's output return outputs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(x):\n return np.exp(x) / np.sum(np.exp(x), axis=1, keepdims=True)", "def _softmax(x):\n e = K.exp(x - K.max(x, axis=-1, keepdims=True))\n s = K.sum(e, axis=-1, keepdims=True)\n return e / s", "def softmax(x):\n return np.exp(x) / np.sum(np.exp(x), axis=1, keepdims=True)", "def softma...
[ "0.8131125", "0.81069386", "0.80578274", "0.8036261", "0.8024588", "0.8023435", "0.8013214", "0.8003693", "0.79769427", "0.79522514", "0.79522514", "0.79174936", "0.7905669", "0.7888684", "0.7888684", "0.7888684", "0.7888684", "0.7888684", "0.7888684", "0.7888684", "0.7888684...
0.8168294
0
Build API header using authorization token
def _make_header(self, token): header = HEADER.copy() header['Authorization'] = "Bearer {}".format(token) return header
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_auth_header(api_token):\n return {'Authorization': f'token {api_token}'}", "def build_header(token: str = None):\n return {\n \"Content-Type\": \"application/json\",\n \"X-Auth-Token\": token or get_project_token(),\n }", "def get_api_header(token):\n return {\n ...
[ "0.8609279", "0.8266735", "0.8214074", "0.80840755", "0.80487734", "0.7839815", "0.7624801", "0.7451923", "0.7447751", "0.7447751", "0.7307198", "0.72460806", "0.7203698", "0.7190798", "0.718133", "0.71532685", "0.7096322", "0.7086748", "0.7062081", "0.7056416", "0.70372945",...
0.82604975
2
Returns a string that describes the instance of the object.
def describe(self): return "The method describe() is not implemented"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info(self):\n return 'an instance of {cls}'.format(cls=self.instance_class.__name__)", "def __repr__(self):\n return \"<instance of {}>\".format(self.__class__.__name__)", "def __repr__(cls):\n return cls.__name__", "def __str__(self):\n return __class__.__name__", "def ...
[ "0.84114325", "0.7658453", "0.7523631", "0.7398424", "0.738109", "0.7318148", "0.7318148", "0.7318148", "0.7318148", "0.7303869", "0.7303869", "0.7299829", "0.7275287", "0.7275287", "0.7275287", "0.7273751", "0.72464514", "0.72452074", "0.72234654", "0.715386", "0.7114697", ...
0.0
-1
Closes the store. Idempotent.
def close(self): if self._open: self._open = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\n self._store.close()", "async def aclose(self) -> None:\n\t\tawait self._stores_cleanup()", "def __exit__(self, exc_type, exc_val, exc_tb):\n self.close()\n try:\n self._store.close()\n except AttributeError:\n pass", "def storage_close(self...
[ "0.8597703", "0.77696925", "0.7467451", "0.70079416", "0.6950418", "0.69022995", "0.6898541", "0.6881311", "0.6854068", "0.6818503", "0.67310274", "0.67001265", "0.6651409", "0.6642785", "0.6630151", "0.66104704", "0.6588819", "0.65833", "0.6560708", "0.6549639", "0.6541108",...
0.0
-1
The identity_block is the block that has no conv layer at shortcut
def identity_block(input_tensor, kernel_size, filters, stage, block): eps = 1.1e-5 # Retrieve Filters filters1, filters2, filters3 = filters # defining name basis conv_name_base = 'res152' + str(stage) + block + '_branch' bn_name_base = 'bn' + str(stage) + block + '_branch' chanDim = 3 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_block(self, input_tensor, filters, activation, stage, block, start_with_batch_norm = True):\n\n # Set the naming convention\n conv_name_base = 'res' + str(stage) + block + '_branch'\n batch_norm_name_base = 'batch_norm' + str(stage) + block + '_branch'\n\n x_shortcut = inpu...
[ "0.72902834", "0.7131176", "0.7119037", "0.7106076", "0.7093815", "0.70870507", "0.70678526", "0.69982195", "0.6985989", "0.6970297", "0.6937081", "0.6936931", "0.69368577", "0.6892994", "0.6874904", "0.6874904", "0.6866507", "0.68620384", "0.68557215", "0.6840287", "0.684028...
0.6943155
10
conv_block is the block that has a conv layer at shortcut
def convolutional_block(input_tensor, kernel_size, filters, stage, block, strides = (2, 2)): chanDim = 3 eps = 1.1e-5 if K.image_data_format() == "channels_first": inputShape = (depth, height, width) chanDim = 1 # defining name basis conv_name_base = 'res152' + str(stage) + block...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conv_block(self, output_channel, filter_, activate):\n return self.add_layer(conv_block, output_channel, filter_, activate)", "def conv_block(input, filters, phase=phase):\r\n\r\n conv_block = tf.layers.conv2d(\r\n inputs=input,\r\n filters=filters,\r\n kernel_s...
[ "0.74187773", "0.72761416", "0.72002536", "0.70002484", "0.69778305", "0.69715357", "0.6968555", "0.69630045", "0.69594145", "0.6914383", "0.6899269", "0.68976", "0.6897138", "0.6884398", "0.6819873", "0.68183106", "0.6813551", "0.68049926", "0.6794764", "0.679141", "0.678478...
0.6530974
42
Function to split a sentence into a list of words. It will replace all punctuation, by a space. Very crude.
def extract_words(s): # Convert the data the data into normal for (Eg: 'ç' to 'c') and lowercase it. s = unicodedata.normalize('NFKD', s).lower() # Replace the punctuation with a space using the _regex and filter stopwords. wordlist = [w for w in _regex.sub(' ', s).split() if w not in _stopwords] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sentence_to_words(sentence: str) -> List[str]:\n return list(map(clean_word, sentence.split(\" \")))", "def tokenize(sentence):\n lower_s = sentence.lower()\n no_punc_s = lower_s.translate(TRANS, string.punctuation)\n\n word_list = no_punc_s.split()\n\n return word_list", "def sent_to_words(...
[ "0.81118256", "0.79352844", "0.79164064", "0.7788361", "0.7662781", "0.7653752", "0.75988066", "0.75988066", "0.7542118", "0.75376165", "0.75376165", "0.751365", "0.7509974", "0.7468089", "0.74017686", "0.73725027", "0.73663145", "0.734229", "0.73318934", "0.7315141", "0.7286...
0.0
-1
Initialise the TfIdf model.
def __init__(self, min_freq = 20): # A dict from word to an index self.word_to_idx = {} # A dict from an index to a word self.idx_to_word = {} # A preprocessed vector for storing idf coefficients, # which need never be recalculated self.idf = None # Mi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initiate(self):\n # if self.opt.checkpoint_encoder:\n # self.load(self.opt.checkpoint_encoder, self.opt.checkpoint_decoder)\n # else:\n # start fresh.\n self.model = Transformer(\n self.opt.src_vocab_size,\n self.opt.tgt_vocab_size,\n self...
[ "0.639221", "0.61691105", "0.60797256", "0.60587275", "0.6023564", "0.5913701", "0.58835024", "0.5872897", "0.58645093", "0.5839887", "0.58245236", "0.5821963", "0.5809261", "0.57991177", "0.57983685", "0.5798297", "0.5786166", "0.5776728", "0.5698779", "0.56946814", "0.56945...
0.0
-1
String for representing the Model object (in Admin site etc.)
def __str__(self): return self.params
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self):\n return '%s%s' % (self.name, ' - %s' % self.model if self.model else '')", "def __str__(self):\n model = self._meta.verbose_name.title()\n return f\"{model:s}: {self.name:s}\"", "def __str_...
[ "0.7801624", "0.77112937", "0.767426", "0.767426", "0.7524702", "0.74020135", "0.7398639", "0.7378346", "0.7328583", "0.7270028", "0.7244434", "0.7233179", "0.7205981", "0.7174358", "0.7165676", "0.7108926", "0.70379156", "0.70379156", "0.7012156", "0.69865996", "0.6968002", ...
0.0
-1
String for representing the Model object (in Admin site etc.)
def __str__(self): return self.selected_components_for_analysis
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self):\n return '%s%s' % (self.name, ' - %s' % self.model if self.model else '')", "def __str__(self):\n model = self._meta.verbose_name.title()\n return f\"{model:s}: {self.name:s}\"", "def __str_...
[ "0.7801624", "0.77112937", "0.767426", "0.767426", "0.7524702", "0.74020135", "0.7398639", "0.7378346", "0.7328583", "0.7270028", "0.7244434", "0.7233179", "0.7205981", "0.7174358", "0.7165676", "0.7108926", "0.70379156", "0.70379156", "0.7012156", "0.69865996", "0.6968002", ...
0.0
-1
String for representing the Model object (in Admin site etc.)
def __str__(self): return self.components + ", " + self.circuit_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self):\n return '%s%s' % (self.name, ' - %s' % self.model if self.model else '')", "def __str__(self):\n model = self._meta.verbose_name.title()\n return f\"{model:s}: {self.name:s}\"", "def __str_...
[ "0.7801624", "0.77112937", "0.767426", "0.767426", "0.7524702", "0.74020135", "0.7398639", "0.7378346", "0.7328583", "0.7270028", "0.7244434", "0.7233179", "0.7205981", "0.7174358", "0.7165676", "0.7108926", "0.70379156", "0.70379156", "0.7012156", "0.69865996", "0.6968002", ...
0.0
-1
String for representing the Model object (in Admin site etc.)
def __str__(self): return self.circuit_url + ", " + self.equation_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self):\n return '%s%s' % (self.name, ' - %s' % self.model if self.model else '')", "def __str__(self):\n model = self._meta.verbose_name.title()\n return f\"{model:s}: {self.name:s}\"", "def __str_...
[ "0.7801624", "0.77112937", "0.767426", "0.767426", "0.7524702", "0.74020135", "0.7398639", "0.7378346", "0.7328583", "0.7270028", "0.7244434", "0.7233179", "0.7205981", "0.7174358", "0.7165676", "0.7108926", "0.70379156", "0.70379156", "0.7012156", "0.69865996", "0.6968002", ...
0.0
-1
Get appropriate reward probabilities and magnitudes for the specified environment type
def generate_state(): probs = calc_probs(env) n_options = len(probs) # feedback for agent r_mag = np.zeros(n_options) + rmag l_mag = np.zeros(n_options) + lmag new_state = Bogacz(n_trials, n_options, probs, r_mag, l_mag, V0=V0) return new_state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_episode(env, policy, gamma=1.0, render = False):\n obs = env.reset()\n total_reward = 0\n step_idx = 0\n while True:\n if render:\n env.render()\n obs, reward, done , _ = env.step(int(policy[obs]))\n total_reward += (gamma ** step_idx * reward)\n step_idx ...
[ "0.5735067", "0.56786704", "0.5578937", "0.5578005", "0.5552497", "0.5549969", "0.55411506", "0.55206627", "0.55062467", "0.54884577", "0.5409473", "0.53976387", "0.5372327", "0.5336546", "0.52945715", "0.52482665", "0.52115095", "0.51935154", "0.51680875", "0.51642865", "0.5...
0.0
-1
This function tests if channel ID is a valid channel.
def test_channel_join_except_channel(): # Clear the data structure clear_v1() # Call other functions to create the data and store in data structure auth_dict1 = auth_register_v2("johnsmith@gmail.com", "123456", "john", "smith") auth_dict2 = auth_register_v2("harrypotter@gmail.com", "555555", "harry"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validateChannel( self, name ):\n if name not in self.d.keys(): raise Exception('Invalid device channel {}'.format(name))", "def is_valid_channel_name(channel):\n if not is_channel_name(channel):\n return False\n\n test_section = channel[1:]\n\n if not MIN_CHANNEL_NAME_LEN < len(channel...
[ "0.7191834", "0.7037074", "0.68390846", "0.67598116", "0.6666539", "0.6547811", "0.6529578", "0.6497992", "0.64788", "0.6371125", "0.6357008", "0.6299137", "0.6271895", "0.6269656", "0.62527406", "0.6208131", "0.62073535", "0.6198941", "0.6154156", "0.60975283", "0.6084798", ...
0.5363442
83
This function tests if the user is already a member in that channel.
def test_channel_join_except_repetitive(): # Clear the data structure clear_v1() # Call other functions to create the data and store in data structure auth_register_v2("johnsmith@gmail.com", "123456", "john", "smith") auth_dict2 = auth_register_v2("harrypotter@gmail.com", "555555", "harry", "potter"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_present(ctx: Context, channel: TextChannel) -> bool:\n for member in channel.members:\n if member.id == ctx.author.id:\n return True\n\n return False", "def is_user_channel_member(channel_id, u_id):\n for selected_id in database.get_channel_data(channel_id)[\"member_ids\"]:\n if sele...
[ "0.8083576", "0.7774621", "0.70366037", "0.6984563", "0.6958817", "0.67023796", "0.66876537", "0.6578983", "0.65242314", "0.65176374", "0.64362967", "0.6359935", "0.63106453", "0.6305535", "0.6280492", "0.62686795", "0.6198063", "0.6160048", "0.6157889", "0.61391985", "0.6126...
0.0
-1
pair_scatter This takes the same args and kwargs that seaborn.pairplot does This is mostly just like seaborn.pairplot, but outputs a figure instead of the PairPlot object
def pair_scatter(df, **kwargs): grid = sns.pairplot(df, **kwargs) return grid.fig
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pairplot(self, dataframe):\n colors = {\"color\": self.plot_design.pairplot_color}\n p = sns.pairplot(dataframe, plot_kws=colors, diag_kws=colors)\n return p", "def pairplot(data, target_col, columns=None, scatter_alpha='auto',\n scatter_size='auto'):\n if columns is None:...
[ "0.73890513", "0.6957364", "0.6930941", "0.67144316", "0.66208094", "0.6536836", "0.6476543", "0.64353055", "0.64142156", "0.6403881", "0.6392307", "0.6258702", "0.61979514", "0.6187786", "0.61588895", "0.6156505", "0.6140446", "0.6137084", "0.61229384", "0.61052203", "0.6093...
0.8691291
0
Load user by ID.
def load_user(self, user_id): return self.get_user_by_id(int(user_id))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_user(id):\n return User.get_by_id(int(id))", "def load_user(id):\n\treturn User.query.get(int(id))", "def load_user(id):\n return User.query.get(int(id))", "def load_user(id):\n return User.query.get(int(id))", "def load_user(id):\n return User.query.get(int(id))", "def load_user(id)...
[ "0.8996386", "0.8917922", "0.8851071", "0.8851071", "0.8851071", "0.8851071", "0.8824558", "0.8784457", "0.8637541", "0.8620829", "0.8620829", "0.8620829", "0.8552219", "0.8500475", "0.8500475", "0.8500475", "0.8500475", "0.8500475", "0.8500475", "0.8487927", "0.84707946", ...
0.82733166
26
This method compute frequency in our sentence, output we got a dict with our words as key and their frequency as value
def sparse_it(self, query : str) -> Dict[str, int]: return matchingStrings(self.sentence,query)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def frequency(self):\n # BEGIN\n \n freq = {} \n # for word in my_list:\n # for letter in word:\n # keys=freq.keys()\n # if letter in keys:\n # freq[letter]+=1\n # else:\n # freq[letter]=1\n ...
[ "0.8010188", "0.7981466", "0.79751384", "0.7961267", "0.7899221", "0.78735006", "0.7868755", "0.78334075", "0.7742686", "0.7717778", "0.7693603", "0.7682794", "0.7678445", "0.76741695", "0.76602846", "0.75944376", "0.7536005", "0.75324273", "0.75254095", "0.7504569", "0.75041...
0.0
-1
GET a specific column
def get_column(): q = request.query.decode() worksheet = q['worksheetKey'] col = q['col'] values = ss.read_column(worksheet, col) if values is not None: response.status = '200 OK' response.content_type = 'application/json' return {'values': values, 'col': col,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_column(self, name):\r\n return self.column(name)", "def _get_column(cls, name):\r\n return cls._columns[name]", "def column(self):\n return self[\"column\"]", "def getCol(self, column_name):\n idx = self.colnames.index(column_name)\n return self.getColByIdx(idx)", ...
[ "0.81027824", "0.8023643", "0.7771552", "0.7703597", "0.76210535", "0.75037944", "0.741529", "0.74087614", "0.73429793", "0.7334374", "0.7291975", "0.7285666", "0.7235966", "0.72267145", "0.7215415", "0.7168489", "0.7165549", "0.71578985", "0.7143961", "0.71410656", "0.713865...
0.7268583
12
r""" Calculates the diffusive conductance of conduits in network with Knudsen correction. A conduit is defined as (1/2 pore full throat 1/2 pore). See Notes section for the limitations of this method.
def mixed_diffusion(target, pore_diameter="pore.diameter", throat_diameter="throat.diameter", pore_diffusivity="pore.diffusivity", throat_diffusivity="throat.diffusivity", pore_temperature="pore.temperature", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def estimate_diffusion_coefficient(n_CFx: int) -> t.Diffusivity:\n return t.Diffusivity(10 ** (-4.5360 + -0.1088 * n_CFx), \"cm^2/s\")", "def conductivity(self):\n m = 1.67296736e-02 # Determined from optimisation\n c = 8.54665149e-05 # Determined from optimisation\n return m * self.con...
[ "0.61012846", "0.6090041", "0.5988767", "0.5776319", "0.56953377", "0.56907004", "0.5687848", "0.5650993", "0.5644678", "0.5619494", "0.5617038", "0.5600806", "0.55904526", "0.5568432", "0.55664974", "0.5551836", "0.55277014", "0.55083054", "0.5487383", "0.54592997", "0.54185...
0.5144721
65
Constructor for the Vel3d_k__stc_imodemParser class.
def __init__(self, config, input_file, state, state_callback, publish_callback, exception_callback): # # From the input file, get the parameters which define the inputs. # (valid_flag_record, velocity_regex, end_of_velocity_regex, self.velocity_format, self.velocity_r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, osi, n_d_mat, n_dim):\n self.osi = osi\n self.n_d_mat = n_d_mat\n self.n_dim = int(n_dim)\n if osi is not None:\n osi.n_mat += 1\n self._tag = osi.n_mat\n self._parameters = [self.op_type, self._tag, self.n_d_mat.tag, self.n_dim]\n ...
[ "0.50951844", "0.49798307", "0.4908155", "0.48538482", "0.48508996", "0.48219338", "0.478428", "0.47173795", "0.47165218", "0.46510017", "0.4633375", "0.46286377", "0.46039876", "0.4594997", "0.45936438", "0.45734796", "0.45718026", "0.45689926", "0.45669135", "0.45573574", "...
0.48073146
6
The time that the task was created. `create_time` will be truncated to the nearest second.
def create_time(self) -> str: return pulumi.get(self, "create_time")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_time(self) -> Optional[str]:\n return pulumi.get(self, \"create_time\")", "def create_time(self):\n return self._create_time", "def create_time(self):\n return self._create_time", "def create_time(self):\n return self._create_time", "def create_time(self) -> pulumi.Ou...
[ "0.8007297", "0.79653144", "0.79653144", "0.79653144", "0.78487325", "0.78487325", "0.78487325", "0.78487325", "0.78487325", "0.78487325", "0.78487325", "0.78487325", "0.78487325", "0.78487325", "0.7676438", "0.7676438", "0.7676438", "0.76223123", "0.7492866", "0.7492866", "0...
0.81494695
11
The status of the task's first attempt. Only dispatch_time will be set. The other Attempt information is not retained by Cloud Tasks.
def first_attempt(self) -> 'outputs.AttemptResponse': return pulumi.get(self, "first_attempt")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_attempt_start_time():\n pass", "def get_jobAttempt_status(self,jobAttempt):\n raise NotImplementedError", "def initial_status(self):\n\n return self._initial_status", "def task_status(self) -> str:\n return self._task_status", "def getstatus(self):\n with self...
[ "0.632302", "0.6179762", "0.6081784", "0.5957686", "0.58072406", "0.5789425", "0.5730254", "0.5712778", "0.56944793", "0.5662154", "0.5608064", "0.56048805", "0.5577044", "0.5538479", "0.5533489", "0.55318993", "0.5528515", "0.5513949", "0.5513949", "0.5513949", "0.5503099", ...
0.69109195
0
The status of the task's last attempt.
def last_attempt(self) -> 'outputs.AttemptResponse': return pulumi.get(self, "last_attempt")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def task_status(self) -> str:\n return self._task_status", "def status(self):\n if not self._last_command:\n return None\n return self._last_command.status()", "def status(self):\n\t\treturn self._status", "def status(self):\n return self.__status", "def status(self):...
[ "0.75221205", "0.70977265", "0.7057964", "0.70540893", "0.70540893", "0.7025561", "0.7025561", "0.7021853", "0.7014899", "0.7012207", "0.70084274", "0.7008381", "0.7008381", "0.7008381", "0.7008381", "0.7008381", "0.7008381", "0.7008381", "0.7008381", "0.7008381", "0.7008381"...
0.72757167
1
The number of attempts which have received a response.
def response_count(self) -> int: return pulumi.get(self, "response_count")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def response_count(self):\n return self.responses.count()", "def get_retry_count(self):\r\n return self.retried_nomax + self.retried_withmax", "def get_tries(self):\n return self._tries", "def _get_echo_resp_received_count(self):\n return self.__echo_resp_received_count", "def _get_...
[ "0.78385603", "0.7570554", "0.73338926", "0.7281014", "0.7198159", "0.70592964", "0.70407015", "0.69883144", "0.6972543", "0.6963951", "0.6962343", "0.69531786", "0.6952647", "0.69318783", "0.6822602", "0.681391", "0.68120253", "0.6789667", "0.67754894", "0.67714596", "0.6753...
0.81446725
0
The betterEvaluationFunction takes in a GameState (pacman.py) and should return a number, where higher numbers are better. A GameState specifies the full game state, including the food, capsules, agent configurations and more. Following are a few of the helper methods that you can use to query a GameState object to gat...
def betterEvaluationFunction(gameState): score = gameState.getScore() food_grid = gameState.getFood() longest_road = food_grid.height + food_grid.width # longest manheten distance. score -= longest_road * len(gameState.getCapsules()) # giving the number of pills left some values. num_food = gameS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def betterEvaluationFunction(currentGameState):\n \"*** YOUR CODE HERE ***\"\n next_pacman_position = currentGameState.getPacmanPosition()\n next_food = [food for food in currentGameState.getFood().asList() if food]\n next_ghosts_states = currentGameState.getGhostStates()\n next_ghosts_scared_timers...
[ "0.7889473", "0.78060776", "0.771014", "0.7673175", "0.76435345", "0.763816", "0.76329374", "0.76190645", "0.76048577", "0.759801", "0.7576133", "0.7551659", "0.75455004", "0.74940455", "0.7486682", "0.7447774", "0.7427865", "0.74278563", "0.7355879", "0.7353096", "0.7340191"...
0.7765365
2
Returns the minimax action from the current gameState using self.depth
def getAction(self, gameState): # BEGIN_YOUR_CODE def G(gameState): return gameState.isWin() or gameState.isLose() def U(gameState): if gameState.isWin(): return numpy.inf if gameState.isLose(): return -numpy.inf def ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAction(self, gameState):\n return self.minimax(gameState, self.depth, 0)", "def minimax(self, game, depth):\n _, move = self.minimax_search(game, depth)\n return move", "def getAction(self, gameState):\n return self.expectimax(gameState, self.depth, 0)", "def minimax(self, game, de...
[ "0.8119442", "0.80528206", "0.7672852", "0.7626307", "0.760629", "0.75542367", "0.7516353", "0.7480004", "0.7465332", "0.73673624", "0.73193645", "0.722959", "0.72238237", "0.72043943", "0.72040683", "0.71991295", "0.71896046", "0.71701616", "0.7167447", "0.7151385", "0.71420...
0.6858474
45
Returns the minimax action using self.depth and self.evaluationFunction
def getAction(self, gameState): # BEGIN_YOUR_CODE def G(gameState): return gameState.isWin() or gameState.isLose() def U(gameState): if gameState.isWin(): return numpy.inf if gameState.isLose(): return -numpy.inf def ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAction(self, gameState: GameState):\n _max = float(\"-inf\")\n action = None\n for move in gameState.getLegalActions(0):\n util = minimax(self.evaluationFunction, 1, 0,\n gameState.generateSuccessor(0, move), self.depth)\n if util > _max o...
[ "0.7482665", "0.7383559", "0.71806973", "0.7110041", "0.70884514", "0.70694935", "0.70683014", "0.7048308", "0.70055133", "0.69651455", "0.69642085", "0.69604385", "0.6945924", "0.68998593", "0.6895832", "0.688605", "0.6826282", "0.6767276", "0.6758028", "0.6751636", "0.67054...
0.0
-1
Return a blue filtered copy of image; that is, an image that is showing only the blue color of the original image. >>> image = load_image(choose_file()) >>> inverted = invert(image) >>> show(inverted)
def blue_channel(image: Image) -> Image: new_image = copy(image) # filter the intensities of every component in every pixel. for x, y, (r, g, b) in image: blue = create_color(0,0,b) set_color(new_image, x, y, blue) return new_image
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invert(self, img):\n return self.inverse()(img)", "def reverse_black_and_white(img):\n img = 255 - img\n\n return img", "def invert_image(image_data):\n \n return _cv2.bitwise_not(image_data);", "def invert(img):\n print(\"invert image\")\n # Should we edit these parameters?\n ...
[ "0.6841666", "0.67207026", "0.66851586", "0.64867854", "0.6322392", "0.6225471", "0.62059945", "0.61917835", "0.61660177", "0.61458015", "0.6100702", "0.60523343", "0.60246366", "0.5917139", "0.5912366", "0.5827494", "0.5796539", "0.57886845", "0.5767702", "0.5754818", "0.572...
0.6706989
2
Convert a line represented in slope and intercept into pixel points
def make_line_points(y1, y2, line): if line is None: return None slope, intercept = line # make sure everything is integer as cv2.line requires it x1 = int((y1 - intercept) / slope) x2 = int((y2 - intercept) / slope) y1 = int(y1) y2 = int(y2) return ((x1, y1), (x2, y2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_coordinates(image, line_params):\n slope, intercept = line_params\n y1 = image.shape[0]\n y2 = int(y1 * (3/5))\n x1 = int((y1 - intercept)/ slope)\n x2 = int((y2 - intercept)/ slope)\n return np.array([x1, y1, x2, y2])", "def make_points(self,image,line):\n print(\"This is line ...
[ "0.74096894", "0.72594327", "0.70885116", "0.69204056", "0.6878454", "0.6558704", "0.6534711", "0.6435727", "0.62541074", "0.6199262", "0.61867845", "0.6135914", "0.61196333", "0.6095515", "0.60737485", "0.6069733", "0.6028197", "0.6015615", "0.59926707", "0.5944355", "0.5930...
0.73359877
1
Return package version as listed in `__version__` in `init.py`.
def get_version(package): print(os.path.join(package, '__init__.py')) init_py = open(os.path.join(package, '__init__.py')).read() return re.match("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_version_from_package() -> str:\n path = join(dirname(__file__), \"__init__.py\")\n path = normpath(abspath(path))\n with open(path) as f:\n for line in f:\n if line.startswith(\"__version__\"):\n token, version = line.split(\" = \", 1)\n version = ve...
[ "0.84893894", "0.83908445", "0.83863354", "0.8380136", "0.8370828", "0.8370828", "0.8370828", "0.8370828", "0.8370828", "0.8370828", "0.8370828", "0.83694756", "0.83582735", "0.8357903", "0.835638", "0.8078477", "0.7975143", "0.7938866", "0.78928864", "0.78928864", "0.7892886...
0.8379423
4
Calculate the distance between two agents
def __distance_to(self, other: Any) -> float: return np.linalg.norm(self.pos - other.pos)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance_between(agents_row_a, agents_row_b):\n return (((agents_row_a._y - agents_row_b._y)**2) + ((agents_row_a._x - agents_row_b._x)**2))**0.5", "def dist(gene1, gene2):\n return abs(len(gene1.goal) - len(gene2.goal))", "def calculate_distance(asteroid_1: Asteroid, asteroid_2: Asteroid) ->...
[ "0.7814406", "0.7574718", "0.7492769", "0.71866095", "0.6973506", "0.696076", "0.6945819", "0.69293475", "0.68873584", "0.68859565", "0.68843186", "0.68146455", "0.68087804", "0.68077147", "0.6803607", "0.6802777", "0.67979455", "0.67962873", "0.6793501", "0.6789658", "0.6774...
0.6825666
11
This it's gone turn index.html page and it content
def index(): isoko = get_sources('general') head = "ALLOVER THE WORLD NEWS" return render_template('index.html', title = head, isoko = isoko)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main_page():\n return render_template(\"index.html\")", "def index():\n return render_template('pages/index.html', isNav=True)", "def index(request):\r\n template = loader.get_template('index.html')\r\n return HttpResponse(template.render(), content_type='text/html')", "def index_page():\n\n ...
[ "0.7287084", "0.7201184", "0.7130397", "0.706242", "0.706242", "0.706242", "0.7047986", "0.7046092", "0.7012052", "0.69814", "0.6973493", "0.6960424", "0.6960424", "0.69515455", "0.693485", "0.6909258", "0.6904489", "0.6904489", "0.6891802", "0.688946", "0.68877625", "0.687...
0.7445376
0
Find largest node in tree
def find_max(self, root = None): return self._find_max(root if root else self.root)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _find_max(self, root):\n while root.right:\n root = root.right\n return root", "def find_maximum_value(self):\n if self.root: \n self.max_val = self.root.value\n else:\n return 'No tree found'\n def inner(root):\n if root.left:\n inner(root.left)\n\n if root.rig...
[ "0.78764224", "0.78672236", "0.7837464", "0.764396", "0.76304954", "0.7621293", "0.7611956", "0.7447082", "0.7432756", "0.7418194", "0.7379396", "0.7309103", "0.7289041", "0.72726774", "0.7248333", "0.7245537", "0.7139116", "0.7131684", "0.7110197", "0.70932734", "0.7090912",...
0.75121576
7
Find largest node in tree
def _find_max(self, root): while root.right: root = root.right return root
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_maximum_value(self):\n if self.root: \n self.max_val = self.root.value\n else:\n return 'No tree found'\n def inner(root):\n if root.left:\n inner(root.left)\n\n if root.right:\n inner(root.right)\n\n if self.max_val < root.value:\n self.max_val = roo...
[ "0.78672236", "0.7837464", "0.764396", "0.76304954", "0.7621293", "0.7611956", "0.75121576", "0.7447082", "0.7432756", "0.7418194", "0.7379396", "0.7309103", "0.7289041", "0.72726774", "0.7248333", "0.7245537", "0.7139116", "0.7131684", "0.7110197", "0.70932734", "0.7090912",...
0.78764224
0
Gets the trust_id of this DutyWhere. name of the trust
def trust_id(self): return self._trust_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trust_type(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"trust_type\")", "def trust_type(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"trust_type\")", "def trust_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"trust_type\")", "def trust_id(...
[ "0.67038584", "0.6499057", "0.60621184", "0.60080576", "0.59575444", "0.59575444", "0.5909876", "0.5841936", "0.5789147", "0.5705299", "0.5646863", "0.56258225", "0.56077", "0.5583657", "0.55801296", "0.5579116", "0.55748373", "0.55477047", "0.55401397", "0.5518343", "0.55126...
0.8068835
0
Gets the unit_code of this DutyWhere. Code for the unit within the trust
def unit_code(self): return self._unit_code
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getTypeCode(self):\n return _libsbml.Unit_getTypeCode(self)", "def getTypeCode(self):\n return _libsbml.UnitDefinition_getTypeCode(self)", "def get_code(self):\n return self.code", "def get_code(self):\n return self.code", "def get_code(self):\n return self.code", "...
[ "0.65158004", "0.62539524", "0.6146846", "0.6146846", "0.6146846", "0.6146846", "0.59471774", "0.58909506", "0.58909506", "0.58909506", "0.5810293", "0.57992256", "0.57506573", "0.57506573", "0.57506573", "0.57506573", "0.5719915", "0.5719915", "0.5683859", "0.5662948", "0.56...
0.81566304
0
Gets a collection of `InputExample`s for the train set.
def get_train_examples(self, data_dir): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_train_inputs(self, example):\n return example", "def get_train_examples(self):\n raise NotImplementedError()", "def get_train_examples(self, input_file):\r\n raise NotImplementedError()", "def _create_examples(self, data, set_type):\n examples = []\n for (i, elem) in en...
[ "0.73513573", "0.71743697", "0.71278554", "0.6560718", "0.6422419", "0.6403078", "0.6340598", "0.62880164", "0.6281034", "0.6251411", "0.6248832", "0.6233635", "0.62224823", "0.62224823", "0.62074494", "0.62074494", "0.62074494", "0.62074494", "0.62074494", "0.62074494", "0.6...
0.6248533
17
Gets a collection of `InputExample`s for the dev set.
def get_dev_examples(self, data_dir): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dev_examples(self, input_file):\r\n raise NotImplementedError()", "def get_train_inputs(self, example):\n return example", "def get_examples(self, env):\n return self.fam.c_get_examples(self, env)", "def get_dev_examples(self):\n raise NotImplementedError()", "def _create_ex...
[ "0.68112403", "0.6588688", "0.655683", "0.6552607", "0.64272827", "0.63816285", "0.6255956", "0.61930686", "0.61160946", "0.6094262", "0.6054992", "0.6051947", "0.5989807", "0.5927489", "0.5922901", "0.5920675", "0.59200704", "0.59155166", "0.59155166", "0.59155166", "0.59155...
0.5994604
16
GET given route and params. Serialize the result. Return as JSON.
def GetRouteAndSave(self, route, params=None): url = Url(route, params) return json.loads(self.GetAndSave(url, DEFAULT_SUFFIX))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sr_get_json(\n self, route_or_uri, params=None, query=None, headers=None, **kwargs\n ):\n return self.__req(\n route_or_uri,\n params=params,\n query=query,\n op=lambda r: self.get(r, headers=headers),\n raw_response=False,\n **...
[ "0.78712904", "0.70768774", "0.69536865", "0.6845011", "0.68407464", "0.68249154", "0.67622286", "0.67054296", "0.6701869", "0.6619591", "0.65701", "0.64673096", "0.6465392", "0.64311814", "0.6400853", "0.63912594", "0.6368223", "0.6368223", "0.6368223", "0.6368223", "0.63682...
0.70040745
2
Returns the supercell size, and whether the supercell should be applied to s1. If fu == 1, s1_supercell is returned as true, to avoid ambiguity.
def _get_supercell_size(self, s1, s2): if self._supercell_size == 'num_sites': fu = s2.num_sites / s1.num_sites elif self._supercell_size == 'num_atoms': fu = s2.composition.num_atoms / s1.composition.num_atoms elif self._supercell_size == 'volume': fu = s2.vo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_supercells(self, struct1, struct2, fu, s1_supercell):\n def av_lat(l1, l2):\n params = (np.array(l1.lengths_and_angles) +\n np.array(l2.lengths_and_angles)) / 2\n return Lattice.from_lengths_and_angles(*params)\n\n def sc_generator(s1, s2):\n ...
[ "0.6115968", "0.5805347", "0.5264357", "0.5202701", "0.51907843", "0.51287484", "0.5033274", "0.48451474", "0.483657", "0.4819052", "0.4785344", "0.4773524", "0.4761582", "0.47374627", "0.47332603", "0.47305235", "0.46891186", "0.46822417", "0.46752262", "0.46349266", "0.4627...
0.79271257
0
Returns true if a matching exists between s2 and s2 under frac_tol. s2 should be a subset of s1
def _cmp_fstruct(self, s1, s2, frac_tol, mask): if len(s2) > len(s1): raise ValueError("s1 must be larger than s2") if mask.shape != (len(s2), len(s1)): raise ValueError("mask has incorrect shape") return is_coord_subset_pbc(s2, s1, frac_tol, mask)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def equals_exact(self, other, tolerance): # -> bool:\n ...", "def compare_fracs(frac1, frac2):\n\treturn frac1[0]*frac2[1] > frac2[0]*frac1[1]", "def equalWithinTolerance(a, b, tol):\n return abs(a - b) <= tol", "def __eq__(self, frac):\n return self.equal == frac.equal", "def floats_are_...
[ "0.64357406", "0.6404424", "0.62616545", "0.62444466", "0.61546046", "0.61519325", "0.6039857", "0.60057884", "0.59772485", "0.59385866", "0.5925051", "0.5901621", "0.5882426", "0.58783686", "0.57963", "0.5742207", "0.57390463", "0.5710285", "0.5692037", "0.56900704", "0.5688...
0.66467285
0
Test if `set_aspect` works.
def test_aspect(): fix_text_kerning_factor() fig = plt.figure() ax = fig.add_subplot(projection='ternary') ax.plot(*get_spiral()) ax.set_aspect(1.5) ax.set_tlabel('Top') ax.set_llabel('Left') ax.set_rlabel('Right')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shell_preserve_aspect_ratio_changed(self, preserve):\n self.set_preserve_aspect_ratio(preserve)", "def shell_preserve_aspect_ratio_changed(self, preserve):\n self.set_preserve_aspect_ratio(preserve)", "def aspect(self, aspect):\n\n self._aspect = aspect", "def aspect_ratio(self, aspe...
[ "0.6403564", "0.6403564", "0.63115966", "0.60629815", "0.5848771", "0.5842859", "0.5722211", "0.5676829", "0.56386065", "0.5585852", "0.556926", "0.55387074", "0.5482834", "0.54743123", "0.54532754", "0.54045653", "0.5396406", "0.5387943", "0.53661966", "0.53245074", "0.53001...
0.66945904
0
Test if the taxis label is assigned properly.
def test_tlabel(self): fig = plt.figure() ax = fig.add_subplot(projection='ternary') label = "T" ax.set_tlabel(label) assert ax.get_tlabel() == label
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_for_labels(self):\n check = True\n if 'labels' not in self.mapper:\n check = False\n return check", "def need_labels(self) -> bool:\n return False", "def need_labels(self) -> bool:\n return False", "def has_label(self):\n return self.label is no...
[ "0.6767705", "0.66686714", "0.66686714", "0.6652911", "0.66190463", "0.64577633", "0.6430656", "0.6397393", "0.6375402", "0.63408446", "0.62084407", "0.6174028", "0.6145107", "0.6141471", "0.60700625", "0.60529286", "0.60121953", "0.60062003", "0.60028625", "0.5982958", "0.59...
0.792775
0
Test if the laxis label is assigned properly.
def test_llabel(self): fig = plt.figure() ax = fig.add_subplot(projection='ternary') label = "L" ax.set_llabel(label) assert ax.get_llabel() == label
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_for_labels(self):\n check = True\n if 'labels' not in self.mapper:\n check = False\n return check", "def test_label():\n label_path = pjoin(data_path, \"label\", \"lh.BA1.label\")\n label = read_label(label_path)\n # XXX : test more\n assert_true(np.all(labe...
[ "0.6915964", "0.6869979", "0.6740967", "0.6738316", "0.6696842", "0.6696842", "0.66755486", "0.6577181", "0.65229946", "0.6459412", "0.64190876", "0.635653", "0.6303839", "0.62841386", "0.62715", "0.61462396", "0.61240524", "0.6062717", "0.6022183", "0.60126865", "0.5974251",...
0.71906525
0
Test if the raxis label is assigned properly.
def test_rlabel(self): fig = plt.figure() ax = fig.add_subplot(projection='ternary') label = "R" ax.set_rlabel(label) assert ax.get_rlabel() == label
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_label(self):\n return self.label is not None", "def _check_for_labels(self):\n check = True\n if 'labels' not in self.mapper:\n check = False\n return check", "def test_label():\n label_path = pjoin(data_path, \"label\", \"lh.BA1.label\")\n label = read_labe...
[ "0.6817622", "0.6666895", "0.66417587", "0.6545014", "0.6545014", "0.65152204", "0.65135324", "0.64894676", "0.64420146", "0.6372059", "0.6314636", "0.6312459", "0.6272663", "0.624556", "0.61380047", "0.6118475", "0.6114992", "0.6103401", "0.60473824", "0.60328084", "0.602119...
0.7008074
0
Retorna el coeficiente del monomio x(i+n)yn)
def Coef(expr, n,i): return int(expr.coeff_monomial(x**(i+n)*y**n))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_multinomial_coefficient(n, x):\n return gammaln(n + 1) - gammaln(x + 1).sum()", "def _model(x, p):\n y_hat = 0\n for i, pi in enumerate(reversed(p)):\n y_hat += x**i * pi\n return y_hat", "def f(self, X):\n\n return (X[0])**3 - (X[1])**2 + 1", "def y(x):\n ...
[ "0.6618318", "0.6503867", "0.64838326", "0.6467117", "0.64599097", "0.6427226", "0.6406362", "0.6378462", "0.63544434", "0.6329032", "0.63180125", "0.6317357", "0.6308685", "0.6301725", "0.6289192", "0.6281891", "0.6272762", "0.6269528", "0.6265366", "0.6264305", "0.6262189",...
0.6228677
23
Return the Organization (instance) owning self. We refrain from storing the owner as a me.ReferenceField in order to avoid automatic/unwanted dereferencing.
def owner(self): return Organization.objects.get(id=self.owner_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_owner_object(self):\n return self", "def owner(self):\n return self.__owner", "def owner(self):\n return self._owner", "def owner(self):\n return self._owner", "def owner(self):\n return self._owner", "def owner(self):\n return self._owner", "def owner(...
[ "0.74968475", "0.73855215", "0.73527604", "0.73527604", "0.73527604", "0.73527604", "0.73527604", "0.7271214", "0.7223621", "0.71835005", "0.71835005", "0.71835005", "0.71798605", "0.71774983", "0.71774983", "0.7149011", "0.7004857", "0.7004857", "0.7004857", "0.6968682", "0....
0.8419285
0
Return a dataset object for the requested path
def get_dataset(self, dspath): dataset_id = self.__dataset_json_values.get_dataset(dspath) return Dataset(dataset_id, self.__dataset_json_values, self.__facets)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_dataset(path: str):\n\n # remove trailing slash:\n if path.endswith(\"/\"):\n path = path[:-1]\n\n if path.endswith(\".zarr.zip\") or path.endswith(\".zarr\"):\n # we can recognise a Zarr dataset by its extension.\n dataset = ZDataset(path)\n elif path.endswith(\"tif\") or...
[ "0.7443754", "0.7231678", "0.66988647", "0.66692835", "0.66372293", "0.6618392", "0.6614589", "0.65900046", "0.6547515", "0.65356094", "0.65061194", "0.6504655", "0.64662915", "0.6444945", "0.643819", "0.6379319", "0.6378118", "0.6364871", "0.63640875", "0.63547236", "0.62829...
0.74829936
0
Repeat a PyCUDA 1D array.
def cu_repeat(input, repeat, output=None): num = len(input) tot_num = num * repeat if output is None: output = gpuarray.empty(num * repeat, input.dtype) block = (1024, 1, 1) grid = ( min( 6 * cuda.Context.get_device().MULTIPROCESSOR_COUNT, (tot_num - 1) / blo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repeat(a, repeats, axis=None):\n return afnumpy.asarray(a).repeat(repeats, axis=axis)", "def np_repeat_2d(a, repeats):\r\n\r\n assert len(a.shape) == 2\r\n a = np.expand_dims(a, 0)\r\n a = np.tile(a, [repeats, 1, 1])\r\n return a", "def th_repeat(a, repeats, axis=0):\r\n assert len(a.size...
[ "0.6613329", "0.6531858", "0.6331242", "0.616121", "0.6057588", "0.5913599", "0.58552325", "0.5804637", "0.57970023", "0.5690868", "0.5688278", "0.56821513", "0.5656603", "0.56539977", "0.56503165", "0.5640061", "0.5607759", "0.5590669", "0.5529615", "0.55057436", "0.548744",...
0.7112809
0
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(y_true, predictions, classes, normalize=False, title=None, cmap=plt.cm.Blues): if not title: if normalize: title = 'Normalized confusion matrix' else: title = 'Conf...
{ "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.81920755", "0.8093736", "0.8028212", "0.8017333", "0.79923165", "0.7989431", "0.79789335", "0.7974398", "0.795948", "0.79555666", "0.7935652", "0.7932704", "0.7932632", "0.7929465", "0.7924336", "0.7922666", "0.79221356", "0.7921299", "0.79209703", "0.7920307", "0.7916008"...
0.0
-1
Create a temporary workspace that's deleted later.
def setUp(self): self.workspace_dir = tempfile.mkdtemp() if not os.path.exists(self.workspace_dir): os.makedirs(self.workspace_dir)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_workspace(client, workspace, context_name):\n data = {\"workspace\": workspace, \"context\": context_name}\n return client._creoson_post(\"windchill\", \"create_workspace\", data)", "def test_create_workspace():\n\n bambi = create_test_bambi()\n bambi.create_workspace(bambi.name)\n succ...
[ "0.6403683", "0.6292103", "0.629084", "0.6179071", "0.6123292", "0.61166424", "0.6063907", "0.6055099", "0.60203534", "0.6003764", "0.6000168", "0.59306157", "0.5887252", "0.5857108", "0.5838111", "0.583276", "0.5831473", "0.58028585", "0.5797624", "0.57534546", "0.574701", ...
0.59399295
11
If there is no release PR it should return None
def test_get_release_pr_no_pulls(): with patch( 'github.requests.get', return_value=Mock(json=Mock(return_value=[OTHER_PR])) ): assert get_release_pr('access_token', 'org', 'repo-missing') is None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def fetch_data(self) -> GitHubReleaseModel | None:\n result = await self._client.repos.releases.list(\n self.repository, **{\"params\": {\"per_page\": 1}}\n )\n if not result.data:\n return None\n\n for release in result.data:\n if not release.prer...
[ "0.68869066", "0.67248696", "0.6702946", "0.6335492", "0.627297", "0.61724794", "0.61574316", "0.60589975", "0.6033747", "0.6001112", "0.5942638", "0.58229923", "0.57530975", "0.56819075", "0.56147414", "0.5594965", "0.5571692", "0.5569532", "0.556103", "0.55477613", "0.55440...
0.74878085
0
If there is no release PR, an exception should be raised
def test_too_many_releases(): pulls = [RELEASE_PR, RELEASE_PR] with pytest.raises(Exception) as ex, patch( 'github.requests.get', return_value=Mock(json=Mock(return_value=pulls)) ): get_release_pr('access_token', 'org', 'repo') assert ex.value.args[0] == "More than one pull request for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_release_pr_no_pulls():\n with patch(\n 'github.requests.get', return_value=Mock(json=Mock(return_value=[OTHER_PR]))\n ):\n assert get_release_pr('access_token', 'org', 'repo-missing') is None", "def test_invalid_release(self):\n self.assertRaises(HTTPError, lambda: self.d....
[ "0.7243834", "0.66252226", "0.65557426", "0.65354776", "0.6247172", "0.62058735", "0.6186123", "0.6140308", "0.6120164", "0.60529345", "0.6008979", "0.60008025", "0.59942216", "0.59332687", "0.59209365", "0.5895773", "0.58838034", "0.58411646", "0.57549345", "0.5669394", "0.5...
0.65019834
4
reformatted_full_name should take the first and last names and make it lowercase
def test_reformatted_full_name(): assert reformatted_full_name("") == "" assert reformatted_full_name("George") == "george" assert reformatted_full_name("X Y Z A B") == "x b"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_formatted_name(first_name, last_name): \r\n full_name = f\"{first_name} {last_name}\"\r\n return full_name.title()", "def get_formatted_name(first_name,last_name):\n full_name= first_name + \" \"+last_name\n return full_name.title()", "def get_formatted_name(first_name,last_name):\n\tfull_n...
[ "0.79634774", "0.78689885", "0.78570503", "0.78530365", "0.78530365", "0.78530365", "0.7831602", "0.7782751", "0.7782751", "0.7782751", "0.778203", "0.7773057", "0.7742193", "0.77415067", "0.77213705", "0.7715623", "0.7697388", "0.76908904", "0.7690708", "0.76839775", "0.7680...
0.7722164
14
convert address to full path of dta file, adding ".dta" if necessary
def _get_fullpath(self, address): address = os.path.abspath(address) if len(address) < 4 or address[-4:] != ".dta": address = address + ".dta" return address
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_dta(address):\n with open(address, 'rb') as dta_file:\n first_bytes = dta_file.read(11)\n ds_format = first_bytes[0]\n if isinstance(ds_format, str): # happens in Python 2.7\n ds_format = ord(ds_format)\n # If format is 117, then first_bytes[0] is \"<\", which gets unpacked as 6...
[ "0.6231123", "0.6056488", "0.5875363", "0.5483136", "0.54393816", "0.54138017", "0.53989315", "0.5382245", "0.5343251", "0.53226244", "0.53045523", "0.52772117", "0.5266208", "0.5239285", "0.52267164", "0.5221742", "0.5207573", "0.5198608", "0.5194762", "0.51935047", "0.51788...
0.79562175
0
Take tuple of string abbreviations to variable names, and return list of lists of all matches within varlist. Raises error if no match or ambiguous abbreviation. Strip out duplicates if unique==True. Allow '_dta' if evars==True. If all_ok==True, using '_all' returns entire varlist if evars==False or entire varlist + '_...
def _find_vars(self, varnames, unique=False, evars=False, all_ok=False, empty_ok=False, single=False): if isinstance(varnames, str): varnames = (varnames,) elif not isinstance(varnames, collections.Iterable): raise TypeError("variable names should be str or i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_varnams(self, varnam_list):\n self.varnams = [[v.name, v.composer, v.talam] for v in varnam_list\n if v.raga == self.name]", "def stats_variable_names(res):\n def varname(s):\n pos = s.find(':')\n return s if pos==-1 else s[0:pos]\n return set( [ varname(...
[ "0.56152755", "0.5435036", "0.5386813", "0.5370414", "0.5283545", "0.52825266", "0.5275307", "0.52709144", "0.5250864", "0.5234491", "0.5224221", "0.5190402", "0.5138899", "0.510342", "0.50570965", "0.4950475", "0.4935325", "0.49248442", "0.49190775", "0.4898992", "0.488967",...
0.81142443
0
create dataset from iterable of values
def _new_from_iter(self, varvals, compress=True, single_row=False, quiet=False): global get_missing # first, list-alize like tuplize in __setitem__ def make_list(x): if isinstance(x, str) or not isinstance(x, collections.Iterable): retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CreateDataset(all_arrays):\n dataset = Dataset()\n\n dataset._addData(all_arrays[0])\n dataset._addData(all_arrays[1])\n dataset._addData(all_arrays[3])\n dataset._addData(all_arrays[5])\n dataset._addData(all_arrays[6])\n dataset._addData(all_arrays[9])\n dataset._addData(all_arrays[8]...
[ "0.6846699", "0.6706687", "0.6614409", "0.6572982", "0.6381319", "0.6152478", "0.6078053", "0.60516614", "0.6009887", "0.60028636", "0.60023683", "0.598267", "0.5980368", "0.59787655", "0.58694726", "0.5861628", "0.5835699", "0.5813715", "0.58033454", "0.57988906", "0.5784138...
0.0
-1
create dataset from iterable of values
def _new_from_iter(self, varvals, compress=True, single_row=False, quiet=False): global get_missing # first, list-alize like tuplize in __setitem__ def make_list(x): if (any(isinstance(x, t) for t in (str,bytes,bytearray)) or not is...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CreateDataset(all_arrays):\n dataset = Dataset()\n\n dataset._addData(all_arrays[0])\n dataset._addData(all_arrays[1])\n dataset._addData(all_arrays[3])\n dataset._addData(all_arrays[5])\n dataset._addData(all_arrays[6])\n dataset._addData(all_arrays[9])\n dataset._addData(all_arrays[8]...
[ "0.6846699", "0.6706687", "0.6614409", "0.6572982", "0.6381319", "0.6152478", "0.6078053", "0.60516614", "0.6009887", "0.60028636", "0.60023683", "0.598267", "0.5980368", "0.59787655", "0.58694726", "0.5861628", "0.5835699", "0.5813715", "0.58033454", "0.57988906", "0.5784138...
0.0
-1
Convert rotation with angle theta around a certain axis to a rotation matrix in 3D.
def angle_axis_to_rot3d(axis, theta): if isinstance(axis, string_types): axis = axis.lower() if axis == 'x': axis = np.array([1., 0., 0.]) elif axis == 'y': axis = np.array([0., 1., 0.]) elif axis == 'z': axis = np.array([0., 0., 1.]) else:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotation_matrix3(axis, theta):\n R = np.eye(3)\n c = math.cos(theta)\n s = math.sin(theta)\n a1 = (axis + 1) % 3\n a2 = (axis + 2) % 3\n R[a1, a1] = c\n R[a1, a2] = -s\n R[a2, a1] = s\n R[a2, a2] = c\n return np.matrix(R)", "def angleAxis2rot3D(axis, theta):\n if len(axis) is...
[ "0.83039474", "0.82996047", "0.7958076", "0.77876127", "0.7752959", "0.7738693", "0.771343", "0.7689451", "0.76676506", "0.7643729", "0.75913703", "0.7581533", "0.75791717", "0.7576023", "0.7539417", "0.7534004", "0.7530461", "0.7530461", "0.7530461", "0.75226116", "0.7505317...
0.8299248
2
Convert rotation with angle around an axis to a quaternion.
def angle_axis_to_quaternion(axis, theta): if isinstance(axis, string_types): axis = axis.lower() if axis == 'x': axis = np.array([1., 0., 0.]) elif axis == 'y': axis = np.array([0., 1., 0.]) elif axis == 'z': axis = np.array([0., 0., 1.]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quaternion_about_axis(angle, axis):\r\n q = numpy.array([0.0, axis[0], axis[1], axis[2]])\r\n qlen = vector_norm(q)\r\n if qlen > _EPS:\r\n q *= math.sin(angle/2.0) / qlen\r\n q[0] = math.cos(angle/2.0)\r\n return q", "def angle_axis_to_quaternion(angle_axis: torch.Tensor) -> torch.Tens...
[ "0.8411822", "0.8409346", "0.8036699", "0.7792417", "0.7709342", "0.7697754", "0.7606255", "0.7520978", "0.7503598", "0.73995024", "0.7381303", "0.7296744", "0.722843", "0.71755075", "0.71447015", "0.6989757", "0.69842374", "0.69297594", "0.68977565", "0.6880346", "0.6852553"...
0.83641195
2
Convert rotation with euler angle (psi, theta, phi) to a rotation matrix in 3D, following a Body 323 sequence.
def euler_to_rot3d(psi, theta, phi): rphi = np.array([[np.cos(phi), -np.sin(phi), 0], [np.sin(phi), np.cos(phi), 0], [0, 0, 1]]) rtheta = np.array([[np.cos(theta), 0, np.sin(theta)], [0, 1, 0], [-np.sin(theta), 0, np.cos(the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eulerAnglesToRotationMatrix(theta):\n\n R_x = np.array([[1, 0, 0 ],\n [0, np.cos(theta[0]), -np.sin(theta[0]) ],\n [0, np.sin(theta[0]), np.cos(theta[0]) ]\n ])\n R_y = np.array([[np.cos(t...
[ "0.70275456", "0.7008984", "0.69890505", "0.69890505", "0.6986371", "0.6929727", "0.68214726", "0.678568", "0.6781064", "0.6776072", "0.67505866", "0.67452586", "0.67209834", "0.66834885", "0.66385335", "0.65838516", "0.6544615", "0.6542263", "0.6536071", "0.65036774", "0.648...
0.7242869
0
Convert quaternion to a right hand rotation theta about certain axis.
def quaternion_to_angle_axis(quaternion): ha = np.arccos(quaternion[0]) theta = 2 * ha if theta < np.finfo(float).eps: theta = 0 axis = np.array([1, 0, 0]) else: axis = quaternion[[1, 2, 3]] / np.sin(ha) return theta, axis
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quaternion_to_angle_axis(quaternion: torch.Tensor) -> torch.Tensor:\n if not torch.is_tensor(quaternion):\n raise TypeError(\"Input type is not a torch.Tensor. Got {}\".format(\n type(quaternion)))\n\n if not quaternion.shape[-1] == 4:\n raise ValueError(\"Input must be a tensor ...
[ "0.74185026", "0.74043894", "0.73408055", "0.7284427", "0.72383684", "0.7179379", "0.7160747", "0.7117822", "0.7082858", "0.70802224", "0.7011333", "0.70066726", "0.68249214", "0.67860144", "0.67447174", "0.6735009", "0.67080814", "0.66954833", "0.6683593", "0.66753626", "0.6...
0.74275464
0
Convert the rotation matrix to a quaternion. This function is adopted form
def rotmat_to_quaternion(rotmat): r00 = rotmat[0,0] r01 = rotmat[0,1] r02 = rotmat[0,2] r10 = rotmat[1,0] r11 = rotmat[1,1] r12 = rotmat[1,2] r20 = rotmat[2,0] r21 = rotmat[2,1] r22 = rotmat[2,2] tr = r00 + r11 + r22 quat = np.zeros(4) if tr > 0: S = np.sqrt(tr+1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotation_matrix_to_quaternion(rotation_matrix):\n trace = np.trace(rotation_matrix)\n\n if trace > 0:\n S = np.sqrt(trace + 1) * 2\n q_w = 0.25 * S\n q_x = (rotation_matrix[2, 1] - rotation_matrix[1, 2]) / S\n q_y = (rotation_matrix[0, 2] - rotation_matrix[2, 0]) / S\n ...
[ "0.81543934", "0.8096411", "0.800307", "0.78666514", "0.7754998", "0.7681627", "0.7673315", "0.7656644", "0.7640824", "0.75980854", "0.75331944", "0.7512957", "0.745334", "0.7448648", "0.74362946", "0.73628175", "0.73116684", "0.7277427", "0.72080964", "0.72019076", "0.719082...
0.8025711
2
Convert the quaternion to rotation matrix. This function was originally adopted from
def quaternion2rot3d(quat): q01 = quat[0] * quat[1] q02 = quat[0] * quat[2] q03 = quat[0] * quat[3] q11 = quat[1] * quat[1] q12 = quat[1] * quat[2] q13 = quat[1] * quat[3] q22 = quat[2] * quat[2] q23 = quat[2] * quat[3] q33 = quat[3] * quat[3] # Obtain the rotation matrix ro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quaternion_to_rotation_matrix(quaternion):\n\n q_w, q_x, q_y, q_z = quaternion\n sqw, sqx, sqy, sqz = np.square(quaternion)\n norm = (sqx + sqy + sqz + sqw)\n rotation_matrix = np.zeros((3, 3))\n\n # division of square length if quaternion is not already normalized\n rotation_matrix[0, 0] = (...
[ "0.8385937", "0.80910295", "0.79646367", "0.78918993", "0.7873004", "0.7803609", "0.77704287", "0.771169", "0.7671887", "0.76718676", "0.7671697", "0.76704353", "0.7628803", "0.7514517", "0.7457908", "0.7448835", "0.744181", "0.74078906", "0.73895013", "0.73027116", "0.722585...
0.7414531
17
Setzen der Studenten ID
def set_student(self, student_id): self._student = student_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_student_id(self, student_id):\n self._student_id = student_id", "def get_student_id(self):\n return self.__student_id", "def _set_id(self, value):\n pass", "def get_student_id(self):\n return self._student_id", "def set_id(self, ssc_id):\r\n self.ssc_id = ssc_id",...
[ "0.80267626", "0.7273906", "0.7160689", "0.71434426", "0.6994023", "0.69688904", "0.68157136", "0.6731626", "0.6700038", "0.6695271", "0.660595", "0.65102375", "0.64598626", "0.64452785", "0.6409397", "0.6374223", "0.6368561", "0.63444614", "0.6341141", "0.6336631", "0.633576...
0.7797016
1
Updates the weights of the svm using the gradient of computed loss with respect to the weights.
def update_weights(self, X: np.ndarray, y: np.ndarray, learning_rate: float, reg_coeff: float): ################################################################################ # TODO: Compute the gradient of loss computed above w.r.t the svm weights. # # and then update self.w with the comp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __update_weights_grad_desc(self, x_train, y_train):\n\n predictions = self.__compute_prediction(x_train)\n weights_delta = np.dot(x_train.T, y_train - predictions)\n\n m = y_train.shape[0]\n self.__weights += self.__learning_rate / float(m) * weights_delta", "def update_weights(se...
[ "0.73741186", "0.72613984", "0.7249663", "0.7091025", "0.7080583", "0.6968178", "0.6825624", "0.6823445", "0.6819111", "0.67837256", "0.67547697", "0.67402846", "0.67402846", "0.6732447", "0.67245483", "0.67223966", "0.6635865", "0.66358334", "0.66128945", "0.65935004", "0.65...
0.7729326
0
Compute the sigmoid of z
def sigmoid(z): s = 1/(1+ np.exp(-z)); return s;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid(z):\r\n \r\n return vSigmoid(z);", "def sigmoid(z): \n return 1/(1 + np.e**(-z))", "def sigmoid(z):\r\n \r\n return 1.0 / (1.0+np.exp(-z))", "def sigmoid(z):\n return 1 / (1 + e ** -z)", "def sigmoid(z):\n return 1 / (1 + np.exp(-1 * z))", "def sigmoid(self, z):\n ...
[ "0.9236619", "0.91155094", "0.9034886", "0.9032656", "0.8983236", "0.8982324", "0.89819604", "0.8958828", "0.89279467", "0.8925133", "0.8906126", "0.8891459", "0.88882077", "0.8875157", "0.8872043", "0.88688284", "0.886221", "0.8861199", "0.8856525", "0.8849176", "0.88454694"...
0.8936817
8
Takes a TensorFlow Hub URL and creates a Keras Sequential model with it.
def create_model(model_url, num_classes = 10): # Download the pretrained model and save it as a Keras layer feature_extractor_layer = hub.KerasLayer(model_url, trainable = False, name="feature_extraction_layer", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_model(model_path):\n model = tf.keras.models.load_model(model_path,custom_objects={'KerasLayer':hub.KerasLayer})\n return model", "def create_model():\n\n # Create a sequential model (a simple NN is created) adding a softmax activation at the end with 10 units:\n model = Sequential()\n mo...
[ "0.67066735", "0.65982985", "0.6583202", "0.65256304", "0.643192", "0.6340482", "0.63166904", "0.6278078", "0.61787826", "0.6175333", "0.616845", "0.6164243", "0.6157707", "0.61543995", "0.6143902", "0.6132286", "0.60899836", "0.608897", "0.6088386", "0.60688317", "0.6065911"...
0.77539694
0
Reads an image from filename, turns it into a tensor and reshapes it to (img_shape, img_shape, color_channels)
def load_and_prep_image(filename, img_shape=224): # Read in the image img = tf.io.read_file(filename) # Decode the read file into a tensor img = tf.image.decode_image(img) #Resize the image img = tf.image.resize(img,size = [img_shape, img_shape]) # Rescale the image (get all the values btw 0 and 1) img ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_img(filename):\n img_str = tf.io.read_file(filename)\n img_decoded = tf.image.decode_image(img_str)\n img = tf.image.convert_image_dtype(img_decoded, tf.float32)\n return img", "def preprocess_image(filename):\n\n image_string = tf.io.read_file(filename)\n image = tf.i...
[ "0.74465257", "0.73770237", "0.73471385", "0.73118615", "0.72724974", "0.72222674", "0.72039926", "0.7152212", "0.70450866", "0.701073", "0.69462436", "0.69244057", "0.69102216", "0.6875912", "0.6848226", "0.6821782", "0.6810266", "0.68008214", "0.67899656", "0.6789875", "0.6...
0.7686212
0
Returns the ground distance in metres between two `LocationGlobal` or `LocationGlobalRelative` objects. This method is an approximation, and will not be accurate over large distances and close to the
def get_distance_meters(aLocation1, aLocation2): dlat = aLocation2.lat - aLocation1.lat dlong = aLocation2.lon - aLocation1.lon return math.sqrt((dlat*dlat) + (dlong*dlong)) * 1.113195e5
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_distance_metres(aLocation1, aLocation2):\n dlat = aLocation2.lat - aLocation1.lat\n dlong = aLocation2.lon - aLocation1.lon\n return math.sqrt((dlat*dlat) + (dlong*dlong)) * 1.113195e5", "def get_distance_metres(aLocation1, aLocation2):\n dlat = aLocation2.lat - aLocation1.lat\n dlong = aL...
[ "0.65628535", "0.65628535", "0.65628535", "0.65628535", "0.65628535", "0.6560967", "0.6534655", "0.65091217", "0.65084434", "0.64141434", "0.6116889", "0.6110357", "0.60877216", "0.6085446", "0.6042399", "0.58651173", "0.5864302", "0.58567363", "0.58172727", "0.5779377", "0.5...
0.62166005
10
Return a queryset of grandchallenges for this player
def get_challenges(self): return Challenge.objects.filter(id__in=GrandChallenge.objects.filter(Q(challenge__user_from__user__id=self.id)|Q(challenge__user_to__user__id=self.id)).order_by('round').values('challenge'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def challenges(self):\n return [gc.challenge for gc in GrandChallenge.objects.filter(round=self.round_number).order_by('challenge__status')]", "def start(cls):\n cls.create_users()\n challenges = []\n round = 1\n last = None\n for user in cls.base_query():\n u...
[ "0.6893353", "0.6092305", "0.53357244", "0.5322764", "0.52619404", "0.5103035", "0.50549614", "0.5044896", "0.50080514", "0.4953403", "0.49504527", "0.49347848", "0.48993596", "0.48974228", "0.4872433", "0.4855257", "0.4844304", "0.4828956", "0.48233017", "0.4812555", "0.4801...
0.7902538
0
Return a list of previous rounds, as an iterator
def rounds(self): if self.round_number > 0: for i in range(self.round_number): yield Round(i + 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def previous(self):\n return _libsbml.SwigPyIterator_previous(self)", "def previous(self):\n return _osgAnimation.SwigPyIterator_previous(self)", "def __iter__(self):\n self.__getitem__(self._num_steps - 1)\n return iter(self._previous_values[self.last_index:])", "def previous(sel...
[ "0.6394961", "0.6366603", "0.62678903", "0.6261321", "0.6107375", "0.6050373", "0.6022207", "0.5923141", "0.58976144", "0.579747", "0.575922", "0.571556", "0.5662907", "0.5651048", "0.56443703", "0.5640501", "0.5606768", "0.56036955", "0.5583842", "0.55826414", "0.5416696", ...
0.59366703
7
Gets the user's home directory. Similar to '~'
def get_home_dir(self) -> str: ret = os.path.expanduser("~") if not os.path.exists(ret): raise RuntimeError("The home directory does not exist.") return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_homedir():\n return os.path.expanduser(\"~\")", "def _get_home():\n from os.path import expanduser\n home = expanduser('~')\n return home", "def homedir():\n return os.path.expanduser('~')", "def get_home_directory():\n \n try:\n directory=os.path.expanduser(\"~\")\n ...
[ "0.90667164", "0.9007491", "0.8952078", "0.8929795", "0.87112486", "0.87112486", "0.8677931", "0.83854556", "0.83663696", "0.83194566", "0.82604116", "0.8138371", "0.8103358", "0.8035159", "0.79525226", "0.77942514", "0.7678532", "0.7652694", "0.7540874", "0.7468223", "0.7237...
0.89334846
3
Get all available L{renamer.irenamer.IRenamingAction}s.
def getActions(): return getPlugins(IRenamingAction, plugins)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_action_names() -> List[str]:\n\n return list(map(lambda c: c.name, LoggingActions))", "def actions(self):\n return self._action_list", "def actions(self):\n r = self.session.query(models.Action).all()\n return [x.type_name for x in r]", "def get_list_of_actions(self):\n ...
[ "0.71304685", "0.7109144", "0.70262104", "0.7007669", "0.697566", "0.6815434", "0.67821693", "0.6781966", "0.6781966", "0.67692804", "0.6704571", "0.66839874", "0.66802925", "0.66802925", "0.66802925", "0.6659922", "0.6654752", "0.66454697", "0.6626632", "0.6592426", "0.65719...
0.77088
0
Turn a byte string from the command line into a unicode string.
def decodeCommandLine(self, cmdline): if isinstance(cmdline, unicode): return cmdline codec = getattr(sys.stdin, 'encoding', None) or sys.getdefaultencoding() return unicode(cmdline, codec)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def utf8tounicode(arg):\n\n try:\n if isinstance(arg, unicode):\n return arg.decode('utf-8')\n except NameError:\n pass # Python 3\n return arg", "def unicode2utf8(arg):\n\n try:\n if isinstance(arg, unicode):\n return arg.encode('utf-8')\n except NameEr...
[ "0.7280202", "0.70232743", "0.6640679", "0.66292596", "0.65086067", "0.6292156", "0.62878865", "0.62137216", "0.61995786", "0.6194665", "0.6156905", "0.61211735", "0.6120495", "0.6120192", "0.6100422", "0.610035", "0.60757744", "0.60355866", "0.6014481", "0.6003192", "0.59444...
0.7238105
1
Add one item to the top of stack.
def Push(self, item): self.list.append(item)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push(self, item):\r\n self.stack.insert(0, item)", "def push(self, item):\n self.stack.append(item)", "def push(self, item):\n self.stack.append(item)", "def push(self, item):\n # Reassign the link to top of the stack and update the\n self.top = [item] + self.top", "d...
[ "0.8099888", "0.77666944", "0.77666944", "0.771764", "0.76159513", "0.75760615", "0.75542265", "0.75196534", "0.75003964", "0.74198526", "0.74007857", "0.73673713", "0.7340066", "0.72850096", "0.72487307", "0.72366273", "0.7204365", "0.71737266", "0.71668017", "0.7164049", "0...
0.6748148
53
Return the input number with N digits of precision.
def set_num_precision(number, precision, mode='int'): fmt = '{:.%ie}' % (precision - 1) value = float(fmt.format(number)) if mode == 'int': return int(value) else: return value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def round_to(n, precision):\n correction = 0.5 if n >= 0 else -0.5\n return int(n / precision + correction) * precision", "def last_n_digits(num, n):\n return num%(10**n)", "def round(n, precision=DEFAULT_ERROR):\n n = parse_number(n)\n sign = -1 if n < 0 else 1\n\n base = int(n)\n if abs(...
[ "0.7238972", "0.6974708", "0.69195527", "0.68070334", "0.6728197", "0.67044663", "0.65146494", "0.64940333", "0.6480701", "0.64786774", "0.6473848", "0.6461674", "0.6411782", "0.6324459", "0.62982416", "0.62649214", "0.6236041", "0.622631", "0.61993575", "0.6191945", "0.61615...
0.6787781
4
Takes file path as string; returns text as string. Takes a string that is a file path, opens the file, and turns the file's contents as one string of text.
def open_and_read_file(file_path): # your code goes here with open(file_path) as open_file: open_file = open_file.read() return open_file
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_and_read_file(file_path):\n\n text_file = open(file_path)\n full_text = text_file.read()\n\n return full_text", "def open_and_read_file(file_path):\n\n # your code goes here\n text_file = open(file_path)\n text_string= text_file.read()\n text_file.close()\n return text_string", ...
[ "0.81221646", "0.80870944", "0.80748755", "0.8069638", "0.7956668", "0.79429805", "0.78905916", "0.781456", "0.77169985", "0.7700115", "0.76644546", "0.76328695", "0.7626349", "0.76148456", "0.758024", "0.75330645", "0.7529367", "0.7489677", "0.744106", "0.741131", "0.7372124...
0.6512445
86
Remove transaction from weakref.
def _remove_from_weakref(self, tx: BaseTransaction) -> None: if self._tx_weakref_disabled: return assert tx.hash is not None self._tx_weakref.pop(tx.hash, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __del__(self):\n # weakref callbacks are rather low level, and working out how to use\n # them correctly requires a bit of head scratching. One must find\n # somewhere to store the weakref till after the referent is dead, and\n # without accidentally keeping the referent alive. Th...
[ "0.65708447", "0.6535732", "0.64346075", "0.62377256", "0.6160545", "0.607524", "0.6069282", "0.6055392", "0.6036366", "0.6007207", "0.6007207", "0.6007207", "0.6007207", "0.6007207", "0.6007207", "0.60058826", "0.5995328", "0.5986408", "0.5985007", "0.5955886", "0.59345174",...
0.8253074
0
Get a transaction from weakref if it exists. Otherwise, returns None.
def get_transaction_from_weakref(self, hash_bytes: bytes) -> Optional[BaseTransaction]: if self._tx_weakref_disabled: return None return self._tx_weakref.get(hash_bytes, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_transaction(self, clear=False):\n transaction = getattr(self.thread_local, \"transaction\", None)\n if clear:\n self.thread_local.transaction = None\n return transaction", "def get_transaction(self) -> Optional[SessionTransaction]:\n trans = self._transaction\n ...
[ "0.67278194", "0.6436779", "0.63510245", "0.62615293", "0.60788417", "0.5858933", "0.57774997", "0.57504517", "0.5735505", "0.5625709", "0.55738187", "0.5467461", "0.5437058", "0.53640836", "0.5353686", "0.53509676", "0.5332579", "0.53317183", "0.5307581", "0.52812034", "0.52...
0.79687685
0
Returns a transaction from the height index. This is fast.
def get_transaction_by_height(self, height: int) -> Optional[BaseTransaction]: assert self.indexes is not None ancestor_hash = self.indexes.height.get(height) return None if ancestor_hash is None else self.get_transaction(ancestor_hash)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def at(self, height: int):\n res = self.terra._tendermint.block(height) # block data\n block = Block.deserialize(res)\n if self.transform_after_fetch:\n block = self.transformer(block)\n return project(res, block)", "def getTransaction(self, hash):\n currBlock = sel...
[ "0.6437533", "0.61037576", "0.5990883", "0.5900534", "0.5897055", "0.5897055", "0.5849668", "0.5813809", "0.57463104", "0.5724059", "0.5694909", "0.5644055", "0.5592361", "0.55888736", "0.5581316", "0.5534876", "0.5508924", "0.5417827", "0.5372968", "0.53566366", "0.5281915",...
0.733556
0
Return all vertices (transactions and blocks) within the allowed scope.
def get_all_transactions(self) -> Iterator[BaseTransaction]: # It is necessary to retain a copy of the current scope because this method will yield # and the scope may undergo changes. By doing so, we ensure the usage of the scope at the # time of iterator creation. scope = self.get_allo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_isolated_vertices(self):\n graph = self.__graph_dict\n isolated = []\n for vertex in graph:\n # print(isolated,vertex)\n if not graph[vertex]:\n isolated += [vertex]\n return isolated", "def obtener_vertices(self):\n return list(sel...
[ "0.69668293", "0.66058844", "0.65219426", "0.64921474", "0.64921474", "0.64891905", "0.6451802", "0.6451668", "0.6429236", "0.64233506", "0.6412421", "0.6346769", "0.632314", "0.6284359", "0.62471706", "0.6246535", "0.62414896", "0.6240949", "0.6225686", "0.6225686", "0.62256...
0.6132494
23
Returning hardcoded genesis block and transactions.
def get_genesis(self, hash_bytes: bytes) -> Optional[BaseTransaction]: raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def genesis():\n #return Block(\n #GENESIS_DATA['timestamp'],\n #GENESIS_DATA['last_hash'],\n #GENESIS_DATA['hash'],\n #GENESIS_DATA['data']\n #)\n return Block(**GENESIS_DATA)", "def genesisBlock():\n return Block(0, \"0\", 1465154705, \"my gen...
[ "0.7793984", "0.7505452", "0.7283472", "0.7235298", "0.72187644", "0.700859", "0.70074207", "0.7004544", "0.6908137", "0.68930095", "0.68930095", "0.68894887", "0.6838904", "0.67117196", "0.6696959", "0.657097", "0.6495919", "0.6367913", "0.619405", "0.61502266", "0.60846657"...
0.6111452
20
Return the timestamp when the database was last started.
def get_last_started_at(self) -> int: # XXX: defaults to 1 just to force indexes initialization, by being higher than 0 return int(self.get_value(self._last_start_attribute) or NULL_LAST_STARTED_AT)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dbCurrentTime():\n return datetime.datetime.utcnow()", "def start_timestamp(self):\n return self._start_timestamp", "def current_timestamp(self) -> time:\n\n return time.time()", "def get_created_time(self):\n connection = self._open_db()\n cursor = connection.cursor()\n ...
[ "0.73128027", "0.725271", "0.70623165", "0.70231754", "0.695971", "0.6940355", "0.6888191", "0.6848937", "0.6845229", "0.6836749", "0.6831148", "0.68170816", "0.6789469", "0.67856354", "0.67856354", "0.67856354", "0.67856354", "0.67856354", "0.67856354", "0.67856354", "0.6765...
0.66651124
29
Update the timestamp when the database was last started.
def set_last_started_at(self, timestamp: int) -> None: self.add_value(self._last_start_attribute, str(timestamp))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_timestamp(self):\n self._timestamp = datetime.datetime.now()", "def update_last_started_at(self, timestamp: int) -> None:\n assert self.indexes is not None\n self.set_last_started_at(timestamp)\n for index in self.indexes.iter_all_indexes():\n index_db_name = ind...
[ "0.74080515", "0.6863849", "0.65158015", "0.6500878", "0.6396826", "0.63958627", "0.6235818", "0.6198539", "0.61654156", "0.61584973", "0.61302835", "0.6116164", "0.600262", "0.59016436", "0.58947384", "0.58935344", "0.5875305", "0.5798431", "0.5761469", "0.5725346", "0.57127...
0.6119882
11
Return the timestamp when an index was last started.
def get_index_last_started_at(self, index_db_name: str) -> int: attr_name = INDEX_ATTR_PREFIX + index_db_name return int(self.get_value(attr_name) or NULL_INDEX_LAST_STARTED_AT)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_started_at(self) -> int:\n # XXX: defaults to 1 just to force indexes initialization, by being higher than 0\n return int(self.get_value(self._last_start_attribute) or NULL_LAST_STARTED_AT)", "def time(self):\r\n return self._idx", "def start_timestamp(self):\n return s...
[ "0.7487484", "0.6983056", "0.695226", "0.6888503", "0.67846435", "0.67684853", "0.6681487", "0.6653099", "0.6618334", "0.6578107", "0.65639156", "0.65302485", "0.6527538", "0.6520416", "0.64754343", "0.6458171", "0.6414924", "0.640679", "0.63880444", "0.638776", "0.6380935", ...
0.7741106
0
Same behavior as the mempool index for iterating over the tips. This basically means that the returned iterator will yield all transactions that are tips and have not been confirmed by a block on the best chain. This method requires indexes to be enabled.
def iter_mempool_tips_from_tx_tips(self) -> Iterator[Transaction]: assert self.indexes is not None tx_tips = self.indexes.tx_tips for interval in tx_tips[self.latest_timestamp + 1]: tx = self.get_transaction(interval.data) tx_meta = tx.get_metadata() assert i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iter_mempool_tips_from_best_index(self) -> Iterator[Transaction]:\n assert self.indexes is not None\n if self.indexes.mempool_tips is not None:\n yield from self.indexes.mempool_tips.iter(self)\n else:\n yield from self.iter_mempool_tips_from_tx_tips()", "def iter_m...
[ "0.812182", "0.77967566", "0.7623582", "0.57374674", "0.5468153", "0.53758407", "0.5102042", "0.50013965", "0.4969693", "0.49371067", "0.48924854", "0.4861174", "0.48478752", "0.48476374", "0.4789271", "0.47679973", "0.47518396", "0.4747251", "0.47444865", "0.47435266", "0.47...
0.788768
1
Same behavior as the mempool index for iterating over all mempool transactions. This basically means that the returned iterator will yield all transactions that have not been confirmed by a block on the best chain. Order is not guaranteed to be the same as in the mempool index. This method requires indexes to be enable...
def iter_mempool_from_tx_tips(self) -> Iterator[Transaction]: from hathor.transaction.storage.traversal import BFSTimestampWalk root = self.iter_mempool_tips_from_tx_tips() walk = BFSTimestampWalk(self, is_dag_funds=True, is_dag_verifications=True, is_left_to_right=False) for tx in walk...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iter_mempool_from_best_index(self) -> Iterator[Transaction]:\n assert self.indexes is not None\n if self.indexes.mempool_tips is not None:\n yield from self.indexes.mempool_tips.iter_all(self)\n else:\n yield from self.iter_mempool_from_tx_tips()", "def iter_mempool...
[ "0.7472434", "0.6811732", "0.60440683", "0.59772116", "0.5897807", "0.5806162", "0.5794297", "0.5758832", "0.56124026", "0.5545067", "0.54433554", "0.54122823", "0.5342204", "0.53251827", "0.53122354", "0.5303473", "0.5279414", "0.5261173", "0.5250886", "0.52319175", "0.52179...
0.62386745
2
Get all transactions in the mempool, using the best available index (mempool_tips or tx_tips)
def iter_mempool_from_best_index(self) -> Iterator[Transaction]: assert self.indexes is not None if self.indexes.mempool_tips is not None: yield from self.indexes.mempool_tips.iter_all(self) else: yield from self.iter_mempool_from_tx_tips()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iter_mempool_tips_from_best_index(self) -> Iterator[Transaction]:\n assert self.indexes is not None\n if self.indexes.mempool_tips is not None:\n yield from self.indexes.mempool_tips.iter(self)\n else:\n yield from self.iter_mempool_tips_from_tx_tips()", "def iter_m...
[ "0.74429524", "0.6838563", "0.6806436", "0.6552864", "0.60036385", "0.59958357", "0.59380186", "0.58330953", "0.58294505", "0.57942474", "0.57091916", "0.5644992", "0.56218493", "0.5570393", "0.55554867", "0.55498815", "0.5547817", "0.5545725", "0.5478141", "0.5441722", "0.54...
0.7731035
0
Force the query to return only distinct result
def distinct(self): self.distinct_ = True return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distinct(self):\n return DistinctQuery(self)", "def distinct(self):\n qs = copy(self)\n qs._distinct = True\n return qs", "def test_distinct(self):\n self.Person(name=\"Mr Orange\", age=20).save()\n self.Person(name=\"Mr White\", age=20).save()\n self.Person...
[ "0.77206177", "0.72125274", "0.6879175", "0.66091937", "0.6503586", "0.6475674", "0.64212763", "0.63146764", "0.62641704", "0.6172608", "0.6043227", "0.59879524", "0.5960428", "0.5948239", "0.5943233", "0.5818738", "0.5801659", "0.57916", "0.5774843", "0.5765301", "0.5732206"...
0.7192102
2
Get a list with the values of a given column
def lists(self, column, key=None): columns = self._get_list_select(column, key) if key is not None: results = {} for result in self.get(columns): results[result[key]] = result[column] else: results = list(map(lambda x: x[column], self.get(colu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def column_values(table: list[dict[str, str]], column: str) -> list[str]:\n values: list[str] = []\n for row in table:\n values.append(row[column])\n return values", "def get_values(self, col) :\n\n if col not in self.cols :\n raise Exception('Column %s not in data' % col)\n\n ...
[ "0.8294753", "0.82824194", "0.82402974", "0.82402974", "0.80286855", "0.8027249", "0.7685646", "0.7529973", "0.73789763", "0.7311796", "0.7290849", "0.7208291", "0.7120693", "0.7057794", "0.68701273", "0.68339884", "0.6800797", "0.67937964", "0.67903507", "0.677056", "0.66568...
0.6468993
25
Retrieve the "min" result of the query
def min(self, column): return self.aggregate('min', *[column])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def take_min(self):\n return self.get_first()", "def find_min(self):\n return self.min", "def find_min(self):\n return self.min", "def min(self):\n return self.get_first()", "def get_min(self):\n min_value= self.df[self.col_name].min()\n return min_value", "def min(self)...
[ "0.76188296", "0.75588095", "0.75588095", "0.7493569", "0.74143374", "0.72629446", "0.7125147", "0.7065975", "0.7041148", "0.6991645", "0.69602793", "0.69137096", "0.69137096", "0.6912495", "0.68945575", "0.6885434", "0.6875296", "0.68329257", "0.67844856", "0.67844856", "0.6...
0.70864767
7
Sets the name of this Context.
def name(self, name): self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(self, name):\n self._name = name", "def set_name(self, name):\n self.__name = name", "def set_name(self, name):\n self.__name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):...
[ "0.81926197", "0.81900513", "0.81900513", "0.81850815", "0.81850815", "0.81850815", "0.81850815", "0.81850815", "0.8175745", "0.81757075", "0.81414706", "0.8091775", "0.80897206", "0.79991704", "0.7955868", "0.7946319", "0.7934019", "0.7934019", "0.79328835", "0.7886826", "0....
0.7705602
99