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
The disp precison of magnitude.
def disp_prec(self): return self._disp_prec
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def magnitude(self):\n\t\treturn sqrt(self.dot(self))", "def prec(self):\n return self._prec", "def prec(self):\n return self._prec", "def magnitude(self):\n return self.real ** 2 + numpy.inner(self.pure, self.pure)", "def displacement_mag(self):\n print(3284 * math.pow(self.con...
[ "0.73497194", "0.6985502", "0.6985502", "0.6970555", "0.6907471", "0.67152834", "0.66636467", "0.66636467", "0.6613037", "0.6583305", "0.653864", "0.6493269", "0.64543694", "0.64228874", "0.638858", "0.63856506", "0.6358863", "0.6260924", "0.62587225", "0.6247481", "0.6240782...
0.75960314
0
Create selfattention layer based on hyperparameters.
def self_attention_layer(hparams, prefix): return transformer_layers.SelfAttention( num_heads=hparams.get(prefix + "num_heads"), num_memory_heads=hparams.get(prefix + "num_memory_heads"), key_value_size=hparams.d_kv, shared_kv=hparams.get(prefix + "shared_kv", False), attention_kwargs=at...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def local_self_attention_layer(hparams, prefix):\n return transformer_layers.LocalSelfAttention(\n num_heads=hparams.get(prefix + \"num_heads\"),\n num_memory_heads=hparams.get(prefix + \"num_memory_heads\"),\n radius=hparams.local_attention_radius,\n key_value_size=hparams.d_kv,\n shared...
[ "0.66893494", "0.6627704", "0.6459502", "0.6377662", "0.62942165", "0.6203651", "0.6167646", "0.6165356", "0.61653554", "0.61335725", "0.6131403", "0.60959625", "0.5996145", "0.59474695", "0.59014875", "0.58737075", "0.5851989", "0.5850848", "0.5835678", "0.58214444", "0.5805...
0.7684387
0
Create selfattention layer based on hyperparameters.
def local_self_attention_layer(hparams, prefix): return transformer_layers.LocalSelfAttention( num_heads=hparams.get(prefix + "num_heads"), num_memory_heads=hparams.get(prefix + "num_memory_heads"), radius=hparams.local_attention_radius, key_value_size=hparams.d_kv, shared_kv=hparams.get...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def self_attention_layer(hparams, prefix):\n return transformer_layers.SelfAttention(\n num_heads=hparams.get(prefix + \"num_heads\"),\n num_memory_heads=hparams.get(prefix + \"num_memory_heads\"),\n key_value_size=hparams.d_kv,\n shared_kv=hparams.get(prefix + \"shared_kv\", False),\n at...
[ "0.76836133", "0.66260064", "0.64598966", "0.63764846", "0.62931037", "0.62039", "0.616754", "0.6166509", "0.6166408", "0.6134046", "0.6131281", "0.6096159", "0.5995811", "0.59482795", "0.5902533", "0.5874289", "0.5851157", "0.5850646", "0.5835517", "0.5823739", "0.5807127", ...
0.6687835
1
Create a layer stack based on the hyperparameter values.
def layer_stack_from_hparams(hparams, prefix): layers = hparams.get(prefix + "layers") return transformer.LayerStack( [layers_registry[l](hparams, prefix) for l in layers], dropout_rate=hparams.layer_prepostprocess_dropout, norm_epsilon=hparams.norm_epsilon)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(\n self,\n input_dim: int,\n output_dim: int,\n nr_params: int,\n generic_architecture: bool,\n num_stacks: int,\n num_blocks: int,\n num_layers: int,\n layer_widths: List[int],\n expansion_coefficient_dim: int,\n trend_polyn...
[ "0.6276851", "0.61861265", "0.606338", "0.5839751", "0.5811958", "0.5807619", "0.56825054", "0.5665251", "0.5632355", "0.5632355", "0.5596541", "0.5544771", "0.55371934", "0.5448702", "0.54428756", "0.5417888", "0.5407746", "0.5372548", "0.53345346", "0.5294633", "0.5289498",...
0.69276553
0
With local selfattention in the decoder.
def mtr_tr_dense_local(sz): hparams = mtr_tr_dense(sz) hparams.decoder_layers = ["local_self_att", "enc_att", "drd"] * 6 hparams.local_attention_radius = 32 return hparams
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def local_self_attention_layer(hparams, prefix):\n return transformer_layers.LocalSelfAttention(\n num_heads=hparams.get(prefix + \"num_heads\"),\n num_memory_heads=hparams.get(prefix + \"num_memory_heads\"),\n radius=hparams.local_attention_radius,\n key_value_size=hparams.d_kv,\n shared...
[ "0.7119131", "0.6746887", "0.64028156", "0.6393028", "0.61399734", "0.5986916", "0.58863395", "0.5844727", "0.5810577", "0.56561965", "0.5642601", "0.56316686", "0.56259996", "0.557907", "0.5472432", "0.54553354", "0.544108", "0.5436323", "0.5421209", "0.5323093", "0.53175604...
0.48150474
80
Finds the smallest element in array starting after `i`.
def find_smallest(i: int, arr: List[int]) -> int: smallest = i for j in range(i + 1, len(arr)): if arr[j] < arr[smallest]: smallest = j return smallest
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_index_of_smallest(L, i):\n index_of_smallest = i\n for j in range(i+1, len(L)):\n if L[j] < L[index_of_smallest]:\n index_of_smallest = j\n return index_of_smallest", "def get_index_of_smallest(L, i):\n #The index of the smallest item so far.\n index_of_smallest = i\n\n ...
[ "0.777351", "0.7587435", "0.7459751", "0.7379986", "0.7210024", "0.7138926", "0.7041319", "0.7028821", "0.7015712", "0.6965452", "0.69018525", "0.6857491", "0.6775987", "0.67108905", "0.66496557", "0.6618078", "0.6563501", "0.65365946", "0.6481123", "0.6465711", "0.6462061", ...
0.8171403
0
Get a PointsControl instance.
def get_pc(cls, points, points_range, sam_configs, cf_file, sites_per_worker=None, append=False): pc = super().get_pc(points, points_range, sam_configs, 'econ', sites_per_worker=sites_per_worker, res_file=cf_file) if append: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_controlpoints(self, index):\n if index < 2: # is index in very beginning\n current_controlpoints = self.controlpoints[0:4] # use first points\n elif index > len(self.controlpoints) - 2: # is index in very end\n current_controlpoints = self.controlpoints[-4:] # use la...
[ "0.58935773", "0.56794184", "0.5406749", "0.5374367", "0.52980846", "0.5275065", "0.52586144", "0.5178528", "0.51332897", "0.50873464", "0.50837845", "0.5019822", "0.49802995", "0.49760216", "0.49469864", "0.49457085", "0.49281082", "0.49237347", "0.4923346", "0.4910945", "0....
0.52081656
7
Samples the posterior GP at the points X, equivalent to posterior_samples_f due to the absence of a likelihood.
def posterior_samples(self, X, size=10, full_cov=False, Y_metadata=None, likelihood=None, **predict_kwargs): return self.posterior_samples_f(X, size, full_cov=full_cov, **predict_kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample_GP_posterior(x_train, y_train, x_test, mean_func, cov_func,\n\t\t\t\t\t kernel_params, sigma=0.1, seed=42, n_samples=5):\n K = cov_func(x_train, x_train, *kernel_params)\n L = np.linalg.cholesky(K + sigma**2 * np.identity((x_train.shape)[0]))\n K_star = cov_func(x_train, x_test, *kernel_para...
[ "0.6885686", "0.666528", "0.6444679", "0.6403861", "0.6382439", "0.63519335", "0.63485456", "0.62216985", "0.61851025", "0.61606026", "0.6129984", "0.60388404", "0.5996582", "0.5996135", "0.598435", "0.5951804", "0.5908426", "0.5863332", "0.5847303", "0.5845108", "0.5841378",...
0.69190866
0
Return the ContentType of the form's model.
def _get_content_type(self): if not getattr(self, 'model', None): raise NotImplementedError(f"{self.__class__.__name__} must specify a model class.") return ContentType.objects.get_for_model(self.model)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def content_type(self):\n return ContentType.objects.get_for_model(self)", "def getContentType(self):\n return self.content_type", "def model_type(self):\n return self._model_type", "def content_type(self):\n return self.content_types[0]", "def content_type(self):\n retur...
[ "0.82431555", "0.7514476", "0.71054745", "0.7037812", "0.7036644", "0.6982039", "0.6939561", "0.6861742", "0.6839088", "0.6784978", "0.66596365", "0.66257566", "0.65781975", "0.65675193", "0.6562619", "0.6538131", "0.648234", "0.63768387", "0.6374206", "0.6254152", "0.6242634...
0.79772776
1
Get a keystone client object for the tenant. Returns the client object. This may raise ``keystone.exceptions.AuthorizationFailure`` if authorization fails for any reason, including stale tokens in the database.
def get_keystoneclient(self): try: if self.token is None: client = keystoneclient.Client(user_name=self.cluster_account.cluster_user_name, password=self.cluster_account.cluster_password, aut...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_keystone_client():\n username = os.environ.get('OS_USERNAME')\n password = os.environ.get('OS_PASSWORD')\n tenant = os.environ.get('OS_TENANT_NAME')\n url = os.environ.get('OS_AUTH_URL')\n assert username is not None\n assert password is not None\n assert tenant is not None\n assert...
[ "0.7478647", "0.71949565", "0.6911477", "0.66864294", "0.6683456", "0.6650333", "0.6505047", "0.6465903", "0.6420545", "0.6404215", "0.6310471", "0.62774193", "0.6254848", "0.62490904", "0.62490904", "0.62487835", "0.6236823", "0.61940324", "0.61870563", "0.611288", "0.604124...
0.7907227
0
Insures localisation with provided timezone on "datetime" object. Does nothing to object of type "date".
def insure_localisation(dt, timezone=str(get_localzone())): if isinstance(dt, datetime): tz = pytz.timezone(timezone) if dt.tzinfo is None: dt = tz.localize(dt) return dt elif isinstance(dt, date): return dt else: raise TypeError('"date" or "datetime" obj...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tz_localize(self, dt):\n if is_datetime(dt):\n # Naive datetime, see\n # https://docs.python.org/3/library/datetime.html#available-types\n if dt.tzinfo == None or dt.tzinfo.utcoffset(dt) == None:\n return dt\n else:\n return dt.as...
[ "0.6556014", "0.6461035", "0.6424761", "0.64153415", "0.63509107", "0.6336791", "0.6263204", "0.6258497", "0.6203341", "0.6188459", "0.6186657", "0.6185476", "0.618464", "0.6161127", "0.61429614", "0.6131962", "0.6131962", "0.6131962", "0.6126149", "0.60157114", "0.5987251", ...
0.7801928
0
Validates the login/password combination with the database.
def validate_login(self, login, password, expire): login = self._sha512('{:s}{:s}'.format(login, self.salt)) # Select id/hashed password from database try: res = self.pg_select('id, password, auto_token', 'auth', 'login = %s', (login,)).next() except StopIteration: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_login(username, password):\n db = get_db()\n db.ping(True)\n cur = db.cursor()\n\n try:\n sql = \"SELECT password FROM users WHERE user_name = '{}';\".format(username)\n cur.execute(sql)\n for i in cur:\n return check_password_hash(i[0], password)\n retu...
[ "0.7074679", "0.7050045", "0.7039555", "0.69712645", "0.696716", "0.68660325", "0.6819974", "0.6788953", "0.67108446", "0.66978747", "0.66844106", "0.66727984", "0.6672509", "0.6669981", "0.665716", "0.6569801", "0.6552105", "0.6542765", "0.6539991", "0.65323496", "0.65292597...
0.642065
37
This method is the property for self.__searchActiveLabel attribute.
def searchActiveLabel(self): return self.__searchActiveLabel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def searchActiveLabel(self, value):\n\n\t\traise foundations.exceptions.ProgrammingError(\n\t\t\"{0} | '{1}' attribute is read only!\".format(self.__class__.__name__, \"searchActiveLabel\"))", "def searchActiveLabel(self):\n\n\t\traise foundations.exceptions.ProgrammingError(\n\t\t\"{0} | '{1}' attribute is not ...
[ "0.74668473", "0.73023313", "0.5707349", "0.56871957", "0.5613761", "0.5613761", "0.5584365", "0.5584365", "0.5584365", "0.5584365", "0.5584365", "0.5584365", "0.5584365", "0.5584365", "0.5584365", "0.5584365", "0.55750716", "0.5503356", "0.5445494", "0.5445494", "0.539945", ...
0.87942046
0
This method is the property for self.__completerVisibleItemsCount attribute.
def completerVisibleItemsCount(self): return self.__completerVisibleItemsCount
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def completerVisibleItemsCount(self, value):\n\n\t\traise foundations.exceptions.ProgrammingError(\n\t\t\"{0} | '{1}' attribute is read only!\".format(self.__class__.__name__, \"completerVisibleItemsCount\"))", "def completerVisibleItemsCount(self):\n\n\t\traise foundations.exceptions.ProgrammingError(\n\t\t\"{0...
[ "0.8113426", "0.80824006", "0.67499363", "0.65995234", "0.6597602", "0.6546463", "0.6546463", "0.6417699", "0.6310054", "0.62342036", "0.6134485", "0.6118109", "0.6102697", "0.6102697", "0.6102697", "0.6102697", "0.6102697", "0.6102697", "0.6093542", "0.60883266", "0.60883266...
0.90602905
0
This method is the setter method for self.__completerVisibleItemsCount attribute.
def completerVisibleItemsCount(self, value): raise foundations.exceptions.ProgrammingError( "{0} | '{1}' attribute is read only!".format(self.__class__.__name__, "completerVisibleItemsCount"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def completerVisibleItemsCount(self):\n\n\t\treturn self.__completerVisibleItemsCount", "def completerVisibleItemsCount(self):\n\n\t\traise foundations.exceptions.ProgrammingError(\n\t\t\"{0} | '{1}' attribute is not deletable!\".format(self.__class__.__name__, \"completerVisibleItemsCount\"))", "def setNumber...
[ "0.8188544", "0.76599306", "0.6282389", "0.5686623", "0.56051815", "0.5554099", "0.5485526", "0.5479457", "0.5382225", "0.5382225", "0.5363565", "0.531726", "0.5253967", "0.5240929", "0.5081206", "0.5081206", "0.5081206", "0.5081206", "0.5081206", "0.5081206", "0.5068873", ...
0.7916729
1
Displays statistics on the most frequent times of travel.
def time_stats(df, month, day): print('\nCalculating The Overall Most Frequent Times of Travel...\n') start_time = time.time() # display the most common month if month == 'all': print('Most Popular Month: ', df['month'].mode()[0]) # display the most common day of week if day == 'a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_stats(df):\n\n print('\\nDisplaying the statistics on the most frequent times of '\n 'travel...\\n')\n start_time = time.time()\n\n # display the most common month\n most_common_month = df['Month'].mode()[0]\n print('For the selected filter, the month with the most travels is: ' +\...
[ "0.8023676", "0.8022362", "0.79149705", "0.7825905", "0.78213924", "0.7813664", "0.7765152", "0.77395964", "0.7735777", "0.7733763", "0.76860064", "0.7668081", "0.7651128", "0.7644099", "0.7639373", "0.7636164", "0.7624668", "0.7622597", "0.76122236", "0.7599646", "0.75829977...
0.7157926
77
Displays statistics on the most popular stations and trip.
def station_stats(df): print('\nCalculating The Most Popular Stations and Trip...\n') start_time = time.time() # display most commonly used start station print('Most Popular Start Station:', df['Start Station'].mode()[0]) # display most commonly used end station print('Most Popular End Statio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def station_stats(df):\n\n print('\\nCalculating The Most Popular Stations and Trip...\\n')\n start_time = time.time()\n\n # display most commonly used start station\n print(popular_start_station(df))\n\n # display most commonly used end station\n print(popular_end_station(df))\n\n # display m...
[ "0.78160274", "0.7661919", "0.75536317", "0.7491503", "0.7474813", "0.74461776", "0.7431465", "0.74235755", "0.7417586", "0.7400262", "0.73873377", "0.73855174", "0.7365086", "0.7359132", "0.73566383", "0.7355021", "0.735213", "0.7351353", "0.73503", "0.73420906", "0.73405164...
0.70888746
66
Displays statistics on the total and average trip duration.
def trip_duration_stats(df): print('\nCalculating Trip Duration...\n') start_time = time.time() # display total travel time total_time = df['Trip Duration'].sum() print("Total Travel Time: ", total_time) # display mean travel time avg_time = df['Trip Duration'].mean() print("Aver...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trip_duration_stats(data):\n print('\\nCalculating Trip Duration...\\n')\n start_time = time.time()\n # display total travel time\n total_trip_time= data['Trip Duration'].sum()\n print('The Total Travel Time is {} Hours'. format(total_trip_time/3600))\n # display mean travel time\n avg_tri...
[ "0.8141812", "0.8024182", "0.80032814", "0.7948688", "0.79363805", "0.79301584", "0.7925556", "0.79139745", "0.79132074", "0.79069036", "0.79044855", "0.7899693", "0.78905743", "0.7888294", "0.78858185", "0.7883996", "0.78832155", "0.7881429", "0.7872763", "0.78675747", "0.78...
0.7842175
34
Sets setting 'name' value to 'value'. 'autosave' can be used to define whether to save or not after values are changed. 'override' can be used to specify whether to override existing value or not. Setting which does not exist is anyway always created.
def set(self, name, value, autosave=True, override=True): if self._is_section(name) and not isinstance(value, _Section): raise SectionError("Cannot override section with value.") if isinstance(value, _Section): if override: self._config_obj[name] = {} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set(self, name, value, priority=\"project\"):\n\t\tself._assert_mutability()\n\t\tpriority = get_settings_priority(priority)\n\t\t# print( name )\n\t\t# print( self )\n\t\t# sys.exit(3)\n\t\tif name not in self:\n\t\t\tif isinstance(value, SettingsAttribute):\n\t\t\t\tself.attributes[name] = value\n\t\t\telse:...
[ "0.6744715", "0.663977", "0.6493486", "0.63944405", "0.6376991", "0.6260839", "0.62504596", "0.6203638", "0.6171994", "0.6147388", "0.613414", "0.61255556", "0.61187285", "0.6064302", "0.6057818", "0.6055075", "0.5996565", "0.59887826", "0.5980223", "0.5920039", "0.5900844", ...
0.7401
0
Sets defaults based on dict and kwargs, kwargs having precedence.
def set_defaults(self, settings_dict=None, **settings): settings_dict = settings_dict or {} settings_dict.update(settings) return self.set_values(settings_dict, override=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initDefaults(self, kwargs):\n \n for k,v in self.defaults.iteritems():\n if k in kwargs: # use assigned values\n setattr(self, k, kwargs[k])\n else: # use default values\n setattr(self, k, v)\n \n for k,v in kwargs.iteritems():\n ...
[ "0.8276656", "0.7825265", "0.7135144", "0.7047791", "0.69190556", "0.68789023", "0.66745675", "0.6608392", "0.6568484", "0.65487003", "0.6541399", "0.6520038", "0.6479256", "0.6478705", "0.6417542", "0.6411001", "0.64037323", "0.6402815", "0.6402815", "0.6373261", "0.6346837"...
0.64280075
14
some defaults kwargs dicts for declaring models and datasets, e.g., >>> data_kwargs, model_kwargs = get_default_kwargs('compas', args) >>> data = MyDataset(data_kwargs) >>> model = MyModel(model_kwargs)
def get_default_kwargs(data_dir, opts, model_opts): dataset_agnostic_data_kwargs = dict( seed=opts['data_random_seed'], use_attr=opts['use_attr'] ) dataset_kwargs = dict( name=model_opts['name'], attr0_name=model_opts['attr0_name'], attr1_name=model_opts['attr1_name'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def defaults(self, **kwargs):\n for i in kwargs:\n self._.setdefault(i, kwargs[i])\n return self", "def _default_params(self) -> Dict[str, Any]:\n normal_params = {\n \"temperature\": self.temperature,\n \"max_tokens\": self.max_tokens,\n \"top_p\"...
[ "0.66081196", "0.66057384", "0.6605562", "0.63536644", "0.62880147", "0.6208283", "0.6166858", "0.6139097", "0.61327183", "0.6088185", "0.60107213", "0.5997508", "0.5991511", "0.5989212", "0.59595203", "0.59570754", "0.5938172", "0.5900815", "0.5899231", "0.5899231", "0.58947...
0.72775733
0
Resize image shape. Inputs 2D image, intended height Outputsresized image
def img_resize(img, img_height): img_width = int(img_height*img.shape[1]/img.shape[0]) img_pil = Image.fromarray(img) # convert array back to image img_pil_resize = img_pil.resize((img_width, img_height), Image.LANCZOS) # resize return np.array(img_pil_resize)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resize(image):\r\n return cv2.resize(image, (200, 66), interpolation=cv2.INTER_AREA)", "def resize(img, height=800):\n if img.shape[0] > height:\n ratio = height / img.shape[0]\n return cv2.resize(img, (int(ratio * img.shape[1]), height))", "def resize(img, height=800):\n ratio = hei...
[ "0.74198455", "0.7340668", "0.73163044", "0.7220134", "0.72027785", "0.7153022", "0.71527076", "0.7127549", "0.7039996", "0.7020025", "0.7005668", "0.6996695", "0.69951403", "0.6992216", "0.6987925", "0.69681543", "0.69665277", "0.69554615", "0.69375885", "0.69323957", "0.690...
0.7262315
3
Select a subset of keys from a dictionary.
def _filter_keys(d: dict, keys: set) -> dict: return {key: d[key] for key in keys if key in d}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subset_of_dict(dict, chosen_keys):\r\n return {key: value for key, value in dict.items() if key in chosen_keys}", "def select_keys(my_dict: Dict, keys: Sequence) -> Dict:\n keyset = set(keys)\n return {k: v for k, v in my_dict.items() if k in keyset}", "def select_keys(dictionary, keys):\n retu...
[ "0.80049956", "0.78235704", "0.7383121", "0.71997", "0.7100243", "0.7013596", "0.6818026", "0.6809175", "0.6788021", "0.67064685", "0.66495204", "0.65817106", "0.6525863", "0.6518785", "0.6469807", "0.6343108", "0.6341176", "0.631444", "0.63091904", "0.6304181", "0.6277688", ...
0.667984
10
Return a copy of this object with a subset of its attributes set.
def _filter_attributes(self, keyset): filtered = self._filter_keys(self.to_dict(), keyset) return Language.make(**filtered)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy(self):\n return self.__class__(*self.sets)", "def copy(self):\n return AttrDict(dict(self).copy())", "def copy(self):\n new = self.__class__(integration=None, data=None)\n for attribute, value in self.__dict__.items():\n if attribute in self.referenced_attributes...
[ "0.6689456", "0.6568927", "0.6530431", "0.6528238", "0.6495545", "0.64910346", "0.64910346", "0.64910346", "0.64910346", "0.64910346", "0.64910346", "0.64910346", "0.64910346", "0.64910346", "0.64910346", "0.64910346", "0.64910346", "0.64910346", "0.64910346", "0.64910346", "...
0.0
-1
Calculate Hamming distance between two strings of equal length (1G in BA_AALA)
def hamming(text1, text2): assert (len(text1) == len(text2)) return sum(a != b for a, b in zip(text1, text2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hamming_distance(string_a: str, string_b: str) -> int:\n if len(string_a) != len(string_b):\n raise ValueError(\n \"Strings are of unequal length can not compute hamming distance. Hamming distance is undefined.\"\n )\n return sum(char_1 != char_2 for char_1, c...
[ "0.8451062", "0.8429258", "0.8373108", "0.8332744", "0.8331815", "0.8327113", "0.829667", "0.8272201", "0.82001114", "0.81974196", "0.8160833", "0.80522126", "0.8010735", "0.79297954", "0.7819176", "0.7802909", "0.778176", "0.77283", "0.76552", "0.7653278", "0.76106083", "0...
0.72686577
32
REQUIRES PYAUDIO TO BE INSTALLED
def play(self): assert pyaudio is not None, ("You need to have pyaudio installed to " "use the play_wav function") filename = os.path.join(tempfile.gettempdir(), '6003_wave_%s.wav' % abs(hash(tuple(self.samples)))) self.save(fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n super().__init__(interface.Audio, DEFAULT_PRIORITIES)", "def setup_audio(self):\n\t\t\n\t\tpath_to_file = '/var/lib/snips/skills/snips_app_pilldispenser/settings/setup_audio.sh'\n\t\tsubprocess.call([path_to_file])", "def initAudio(self):\n\t\t# Initialize pitch detection\n\t\tself...
[ "0.7059564", "0.67432487", "0.6432147", "0.6215517", "0.61561286", "0.6016583", "0.5940349", "0.5853427", "0.58266914", "0.58182335", "0.57988256", "0.5798433", "0.5797265", "0.5785063", "0.5785063", "0.57311547", "0.57273424", "0.57154155", "0.57086223", "0.5706543", "0.5702...
0.0
-1
CLI later calls `SubHandler.__init__(Group(), self, name)` in its __setattr__() (All instance attributes are overridden by this)
def __init__(self, *, required=False, AND=_Null, OR=_Null, XOR=_Null): self._required = required self._and = AND self._or = OR self._xor = XOR
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __setattr__(self, *args, **kwargs):\n ...", "def __setattr__(self, *args, **kwargs):\n ...", "def __setattr__(self, *args, **kwargs):\n ...", "def __setattr__(self, *args, **kwargs):\n ...", "def __setattr__(self, *args, **kwargs):\n ...", "def __setattr__(self, *ar...
[ "0.65954566", "0.65954566", "0.65954566", "0.65954566", "0.65954566", "0.65954566", "0.65954566", "0.65954566", "0.65954566", "0.65954566", "0.65954566", "0.65954566", "0.65954566", "0.65954566", "0.65954566", "0.65954566", "0.65954566", "0.65954566", "0.65954566", "0.65954566"...
0.0
-1
Computes the precision for the specified values of k
def accuracy(output, target, topk=(1,)): maxk = max(topk) batch_size = target.size(0) _, pred = output.topk(maxk, 1, True, True) pred = pred.t() correct = pred.eq(target.view(1, -1).expand_as(pred)) res = [] for k in topk: correct_k = correct[:k].view(-1).float().sum(0) res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision(gt, pred, k):\n k = min(len(pred), k)\n den = min(len(gt), k)\n return sum([int(pred[i] in gt) for i in range(k)]) / den", "def precision_at_k(r, k):\n assert k >= 1\n r = np.asarray(r)[:k] != 0\n if r.size != k:\n raise ValueError('Relevance score length < k')\...
[ "0.76427615", "0.74189496", "0.7418079", "0.72710466", "0.72456723", "0.72446615", "0.7237539", "0.72213703", "0.7210107", "0.7058935", "0.6852219", "0.6786084", "0.67836976", "0.6768417", "0.67273885", "0.67181736", "0.67181736", "0.67181736", "0.67181736", "0.67181736", "0....
0.0
-1
Adjust the quantity of the specified product to the specified amount.
def adjust_cart(request, id): quantity = int(request.POST.get('quantity')) cart = request.session.get('cart', {}) if quantity > 0: cart[id] = quantity else: cart.pop(id) request.session['cart'] = cart return redirect(reverse('view_cart'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def increase_product_quantity(product_id, quantity_change) -> int:\n with db_session() as session:\n product = get_product_with_id(product_id)\n new_quantity = product.quantity + quantity_change\n product.quantity = new_quantity\n session.commit()\n return product.quantity", "de...
[ "0.680872", "0.6709418", "0.66411114", "0.6589033", "0.65393007", "0.64958483", "0.64397717", "0.6431817", "0.6371927", "0.63704747", "0.6335172", "0.62566566", "0.61898357", "0.61898357", "0.61898357", "0.61898357", "0.6085217", "0.60849476", "0.6076292", "0.6073559", "0.604...
0.0
-1
Returns a phase gate with an arbitrary nonempty list of control qbits Note that it doesn't really matter what is a `control_qbit` and what is a `phase_qbit`. Either way, the phase shift only occurs to the eigenstates where all qbits are 1.
def cn_phase(control_qbits, phase_qbit, phase): assert len(control_qbits) > 0 if len(control_qbits) == 1: return c_phase(control_qbits[0], phase_qbit, phase) else: head = control_qbits[0] tail = control_qbits[1:] half_phase = phase / 2 return ( c_phase(hea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def phase(N, phi0=0, *, dtype=None):\n dtype = dtype or settings.core[\"default_dtype\"] or _data.Dense\n phim = phi0 + (2 * np.pi * np.arange(N)) / N # discrete phase angles\n n = np.arange(N)[:, np.newaxis]\n states = np.array([np.sqrt(kk) / np.sqrt(N) * np.exp(1j * n * kk)\n f...
[ "0.62951094", "0.567437", "0.56543463", "0.5642806", "0.5574034", "0.5423603", "0.5226344", "0.5141229", "0.51088303", "0.5085481", "0.5076477", "0.50712013", "0.5062492", "0.50397736", "0.5010071", "0.4918662", "0.4903883", "0.48959905", "0.48875833", "0.48514852", "0.48429"...
0.6851547
0
Derive the shared secret, then hash it to obtain the shared key.
def genKey(self, otherKey): self.sharedSecret = self.genSecret(self.privateKey, otherKey) #print("Shared secret:") #print(self.sharedSecret) s = hashlib.sha256() s.update(bytes(str(self.sharedSecret).encode())) self.key = s.digest()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_sharedsecret(self):\n return self._get_shared_secret(self.public_key)", "def _create_shared_secret():\n\n randint = random.SystemRandom().randint\n bits = load_config(\"instavpn.json\")[\"shared_secret_bits\"]\n return urlsafe_b64encode(\"\".join(chr(randint(0, 255)) for _ in xrange(...
[ "0.7639108", "0.72053444", "0.70728004", "0.68946016", "0.67451495", "0.6745016", "0.6745016", "0.66920304", "0.65819275", "0.65552306", "0.6547123", "0.6506133", "0.64771515", "0.6456641", "0.63575107", "0.6327947", "0.62820345", "0.6276903", "0.62272316", "0.6135611", "0.61...
0.67432183
7
Generate a presigned URL for the S3 object
def create_presigned_url(bucket_name, bucket_key, expiration=3600, signature_version=s3_signature['v4']): s3_client = boto3.client('s3', aws_access_key_id=AWS_ACCESS_KEY_ID, aws_secret_access_key=AWS_SECRET_ACCESS_KEY, config=Con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_presigned_url(bucket_name, object_name, expiration=3600):\n\n # Generate a presigned URL for the S3 object\n s3_client = boto3.client('s3')\n try:\n response = s3_client.generate_presigned_url('get_object',\n Params={'Bucket': bucket_nam...
[ "0.80143076", "0.799271", "0.79154056", "0.7907784", "0.7901711", "0.7901087", "0.7876678", "0.7871523", "0.7846076", "0.77313715", "0.7577053", "0.7547458", "0.74634784", "0.73923117", "0.7348382", "0.7311892", "0.72726625", "0.71732396", "0.7155269", "0.71159863", "0.711579...
0.8020857
0
Compute multiple softmax() in groups defined by indices. E.g. index_softmax([0, 0, ln(2), 2], [0, 0, 0, 1], 2) computes softmax([0, 0, ln(2)]) and softmax([2]) => [0.25, 0.25, 0.5, 1.0] Acts over axis=0 of values.
def index_softmax(values: tf.Tensor, indices: tf.Tensor, n_indices: int) -> tf.Tensor: # Run everything in float32, for stability dtype = values.dtype values = tf.cast(values, tf.float32) max_values = tf.reduce_max(values, axis=0, keepdims=True) exp_values = tf.exp(values - max_va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(\n src: Tensor,\n index: Optional[Tensor] = None,\n ptr: Optional[Tensor] = None,\n num_nodes: Optional[int] = None,\n dim: int = 0,\n) -> Tensor:\n if ptr is not None:\n dim = dim + src.dim() if dim < 0 else dim\n size = ([1] * dim) + [-1]\n count = ptr[1:] - ptr...
[ "0.65902203", "0.626377", "0.6210972", "0.61430657", "0.6035823", "0.6033601", "0.6032128", "0.600277", "0.5990315", "0.59842026", "0.59738517", "0.5958747", "0.59494585", "0.59492093", "0.5948281", "0.5942673", "0.59377676", "0.5931513", "0.5931513", "0.5931513", "0.5931513"...
0.72989905
0
A standard linear layer `W x + b`.
def linear(input: tf.Tensor, n_output: int, use_bias: bool = True) -> tf.Tensor: weight = tf.get_variable( "weight", dtype=input.dtype, shape=(input.shape[-1], n_output), initializer=tf.glorot_normal_initializer(), ) output = input @ weight if use_bi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linear_layer(self, W, b, x, use_relu=True):\n\n if use_relu is True:\n return np.maximum(W @ x + b, 0)\n return W @ x + b", "def linear(x,output_dim):\n w=tf.get_variable(\"w\", [x.get_shape()[1], output_dim])\n b=tf.get_variable(\"b\", [output_dim], initializer=tf.constant_initial...
[ "0.8158973", "0.7837609", "0.717071", "0.71669585", "0.71193224", "0.7091381", "0.7054863", "0.686409", "0.68345463", "0.6804708", "0.6752642", "0.6747948", "0.67252016", "0.66898113", "0.6640136", "0.66325396", "0.66325396", "0.65840745", "0.6541", "0.6514098", "0.64389986",...
0.63938624
22
Compute a single step of a GRU (following the PyTorch parameterization).
def gru_cell(prev_hidden: tf.Tensor, input: tf.Tensor) -> tf.Tensor: batch_size, hidden_size = assert_shape(prev_hidden, (None, None)) _, input_size = assert_shape(input, (batch_size, None)) dtype = prev_hidden.dtype weight_i = tf.get_variable( "weight_i", (3, input_size, hidden_size), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GRU(previous_hidden_state, x):\n # R Gate\n r = tf.sigmoid(tf.matmul(x, Wr) + \\\n tf.matmul(previous_hidden_state, Ur) + br)\n # U Gate\n u = tf.sigmoid(tf.matmul(x, Wu) + \\\n tf.matmul(previous_hidden_state, Uu) + bu)\n # Final Memory cell\n ...
[ "0.6995662", "0.6531514", "0.623792", "0.6221177", "0.6210293", "0.6138193", "0.6077614", "0.6060733", "0.60192734", "0.5999984", "0.5995535", "0.595929", "0.5917466", "0.5895858", "0.5895858", "0.5895858", "0.5895858", "0.5895858", "0.5895858", "0.5895858", "0.5895858", "0...
0.0
-1
Retrieves the currently visible tab's PandasTable model.
def getCurrentPanda(self): view = self.getCurrentView() if view != None: panda = view.model() return panda else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_table(self):\n\t\treturn self._table", "def getTable(self):\n return self.table", "def table(self):\n return self._table", "def table(self):\n return self._table", "def table(self):\r\n return self._table", "def df(self):\n return self._df", "def getDataFrame(sel...
[ "0.6684711", "0.6659819", "0.6552955", "0.6552955", "0.65210164", "0.6254423", "0.6242152", "0.6228355", "0.6228351", "0.6188192", "0.6167821", "0.6164693", "0.6150947", "0.6110032", "0.61060876", "0.60609865", "0.60603696", "0.6057195", "0.6034996", "0.5980315", "0.5924961",...
0.6228293
9
Always returns False. This is a way of comparing User objects to anonymous users.
def is_anonymous(self): return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_func(self):\n if not self.request.user.is_authenticated:\n return False\n if self.request.user.is_staff:\n return True\n return self.get_user() == self.request.user", "def validUser(self):\n if self.state == SessionStates.LOGGED_OUT:\n return ...
[ "0.7409373", "0.7047953", "0.70110434", "0.69432896", "0.6890458", "0.68146884", "0.68121624", "0.68083864", "0.66976327", "0.6667576", "0.66602224", "0.6621195", "0.66140896", "0.65352565", "0.6532181", "0.6525827", "0.6525745", "0.6521556", "0.65108263", "0.6505203", "0.646...
0.68193376
13
Always return True. This is a way to tell if the user has been authenticated in templates.
def is_authenticated(self): return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_authenticated(self):\n return True #self.authenticated", "def is_authenticated(self, request, **kwargs):\r\n return True", "def is_authenticated(self):\r\n return self.authenticated", "def is_authenticated(self):\n return False", "def is_authenticated(self):\n retu...
[ "0.81519026", "0.8114883", "0.80303204", "0.7992952", "0.7878968", "0.7866886", "0.7866886", "0.7866886", "0.7866886", "0.7866886", "0.7866886", "0.7866886", "0.7866886", "0.7866886", "0.7866886", "0.7866886", "0.7866886", "0.7866886", "0.78154355", "0.7800292", "0.77655876",...
0.8268777
2
Returns the first_name plus the last_name, with a space in between.
def get_full_name(self): full_name = u'%s %s' % (self.first_name, self.last_name) return full_name.strip()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full_name(first_name, last_name):\n return first_name + \" \" + last_name", "def full_name(first_name, last_name):\n\t\n\treturn first_name + \" \" + last_name", "def get_formated_name(first_name,last_name):\n\tfull_name = first_name + '' + last_name\n\treturn full_name.title()", "def get_full_name(se...
[ "0.8313112", "0.82008433", "0.80503625", "0.8041713", "0.8018596", "0.8001245", "0.79558444", "0.7943763", "0.7943763", "0.7943763", "0.79368395", "0.79295915", "0.7923013", "0.7903894", "0.78929234", "0.78910595", "0.7879425", "0.78620094", "0.7853999", "0.7824539", "0.78148...
0.7430776
90
Returns a boolean of whether the raw_password was correct. Handles hashing formats behind the scenes.
def check_password(self, raw_password): def setter(raw_password): self.set_password(raw_password) self.save() return check_password(raw_password, self.password, setter)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_password(self, raw_password):\n return check_password(raw_password, self.password)", "def check_password(raw_password, enc_password):\n algo, salt, hsh = enc_password.split('$')\n return hsh == get_hexdigest(algo, salt, raw_password)", "def check_password(raw_password, enc_password):\n ...
[ "0.8014878", "0.76401216", "0.76401216", "0.74129486", "0.73400986", "0.7255763", "0.71083105", "0.7089921", "0.7077994", "0.7064628", "0.7058551", "0.70322514", "0.7022479", "0.7020057", "0.70097", "0.6995121", "0.69727314", "0.69459444", "0.6943152", "0.6896846", "0.6895963...
0.70965827
7
Returns True if the user has the specified permission. This method queries all available auth backends, but returns immediately if any backend returns True. Thus, a user who has permission from a single auth backend is assumed to have permission in general. If an object is provided, permissions for this specific object...
def has_perm(self, perm, obj=None): # Active superusers have all permissions. if self.is_active and self.is_superuser: return True # Otherwise we need to check the backends. return _user_has_perm(self, perm, obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_perm(self, perm, obj=None):\n\n # Active superusers have all permissions.\n if self.is_active and self.is_superuser:\n return True\n\n # Otherwise we need to check the backends.\n return _user_has_perm(self, perm, obj)", "def has_perm(self, user, perm, obj=None):\n\...
[ "0.78636175", "0.7860949", "0.7682455", "0.7682455", "0.73480254", "0.7307552", "0.72843814", "0.72576755", "0.7209428", "0.71671635", "0.71671635", "0.7163932", "0.708897", "0.7069484", "0.7044152", "0.70437276", "0.69471043", "0.6946923", "0.6911626", "0.6901665", "0.683946...
0.782947
2
Returns True if the user has any permissions in the given app label. Uses pretty much the same logic as has_perm, above.
def has_module_perms(self, app_label): # Active superusers have all permissions. if self.is_active and self.is_superuser: return True return _user_has_module_perms(self, app_label)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_module_perms(self, app_label):\n user_obj = self.user\n if not user_obj.is_active:\n return False\n for perm in self.get_all_permissions(user_obj):\n if perm[:perm.index('.')] == app_label:\n return True\n return False", "def has_module_per...
[ "0.8205342", "0.8130059", "0.80821604", "0.8062754", "0.7533179", "0.7533179", "0.7533179", "0.7530791", "0.7449421", "0.7449421", "0.7433025", "0.7403888", "0.72955835", "0.72955835", "0.69425064", "0.6870251", "0.6804618", "0.6570916", "0.641478", "0.6411478", "0.6339246", ...
0.7722297
6
Returns sitespecific profile for this user. Raises SiteProfileNotAvailable if this site does not allow profiles.
def get_profile(self): #for perm in _user_get_all_permissions(self,obj=None): if not hasattr(self, '_profile_cache'): from django.conf import settings if not getattr(settings, 'LOGIN_PROFILE_MODULE', False): raise SiteProfileNotAvailable( 'You...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_profile(self):\n return self.user.profile", "def _getProfileFromUser(self):\n # Make sure user is authenticated\n user = endpoints.get_current_user()\n if not user:\n raise endpoints.UnauthorizedException('Authorization required')\n # Get Profile from da...
[ "0.75083977", "0.7495572", "0.7071656", "0.70458704", "0.7038806", "0.6810919", "0.67732733", "0.6626436", "0.65756106", "0.65692234", "0.649736", "0.64702517", "0.6459861", "0.6432572", "0.6348061", "0.63339055", "0.63114035", "0.63114035", "0.6270325", "0.62173146", "0.6201...
0.6676191
7
graphical plot of the confusion matrix
def plot_confusion_matrix(cm, class_names=None, title="Confusion Matrix", cmap=plt.cm.Purples, fig_size=(8, 6)): class_names = ["0", "1"] if class_names is None else class_names df = pd.DataFrame(cm, index=class_names, columns=class_names) plt.figure(figsize=fig_size) with sns.axes_style("darkgrid"): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(self):\r\n interp = ClassificationInterpretation.from_learner(self.learn)\r\n interp.plot_confusion_matrix()", "def plot_cnf_matrix(self):\n\t\tplt.figure()\n\t\tanalysis.plot_cnf_matrix(self.y_pred, self.y_test)", "def confusion_matrix(y_true, y_pred):\n skplt.pl...
[ "0.8279748", "0.7984912", "0.79607874", "0.79519284", "0.79382104", "0.78209233", "0.77443737", "0.7726927", "0.77245885", "0.77066785", "0.7704786", "0.7691205", "0.76867765", "0.7684453", "0.76838833", "0.76803607", "0.76803607", "0.7666966", "0.76621395", "0.7659665", "0.7...
0.0
-1
(convenience function) creates a nn.Linear layer, with weights initiated using xavier_uniform initializer and bias, if set, initialized using zeros initializer as is the default in Keras.
def Linear(in_features, out_features, bias=True, device=None, dtype=None): layer = nn.Linear(in_features, out_features, bias, device, dtype) # @see: https://msdn.microsoft.com/en-us/magazine/mt833293.aspx for example torch.nn.init.xavier_uniform_(layer.weight) if bias: torch.nn.init.zeros_(layer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linear(w_in, w_out, *, bias=False):\n return nn.Linear(w_in, w_out, bias=bias)", "def init_layer(layer):\n nn.init.xavier_uniform_(layer.weight)\n \n if hasattr(layer, 'bias'):\n if layer.bias is not None:\n layer.bias.data.fill_(0.)", "def init_layer(layer):\n nn.init.xavier_...
[ "0.7222009", "0.72159874", "0.71309835", "0.7044733", "0.6950058", "0.6694187", "0.66845113", "0.6661602", "0.66541255", "0.65647584", "0.6552521", "0.6545017", "0.65151745", "0.64481384", "0.63762724", "0.63696134", "0.6363802", "0.6354587", "0.6343668", "0.6343346", "0.6329...
0.7113202
3
(convenience function) Creates a nn.Conv2d layer, with weights initiated using xavier_uniform initializer and bias, if set, initialized using zeros initializer. This is similar to Keras.
def Conv2d( in_channels, out_channels, kernel_size=3, stride=1, padding=1, dilation=1, groups=1, bias=True, padding_mode="zeros", device=None, dtype=None, ): layer = nn.Conv2d( in_channels, out_channels, kernel_size=kernel_size, stride=stri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_conv2d(self, x, w, b, stride = 1, name = None):\n x = tf.nn.conv2d(x, w, strides=[1, stride, stride, 1], padding='VALID', name = name)\n x = tf.nn.bias_add(x, b)\n return tf.nn.relu(x)", "def conv2d(x, weight, bias):\n return tf.nn.conv2d(x, filter=weight, strides=[1,1,1,1], padding='SAME'...
[ "0.6967771", "0.6914755", "0.68396413", "0.6833209", "0.6812964", "0.6768705", "0.6736337", "0.6731332", "0.67015404", "0.66999567", "0.6685131", "0.6669074", "0.666302", "0.661779", "0.6617118", "0.6607647", "0.6597864", "0.65769964", "0.6566625", "0.65586793", "0.65561014",...
0.6164868
68
plots epoch metrics values across epochs to show how training progresses
def plot_metrics(self, title=None, fig_size=None, col_count=3): metric_names = self.tracked_metrics() metric_vals = {metric_name: self.metrics_history[metric_name]["epoch_vals"] for metric_name in metric_names} if self.include_val_metrics: # also has validation metrics fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_nn(train_nn_results, label, title, yaxis):\n plt.figure(figsize=(12,5))\n for i in range(len(label)):\n plt.plot(train_nn_results[i], label=label[i], alpha=0.75)\n plt.title(title)\n plt.xlabel('epoch')\n plt.ylabel(yaxis)\n plt.legend(bbox_to_anchor=(1.05, 1.0), loc='upper left'...
[ "0.75747204", "0.7412848", "0.73683393", "0.7354024", "0.7217893", "0.7125196", "0.70939195", "0.70710987", "0.70526755", "0.7026432", "0.7022218", "0.7011282", "0.6997555", "0.69794846", "0.6979122", "0.69769627", "0.6958362", "0.6906868", "0.6906642", "0.69044894", "0.68927...
0.7081281
7
Test running the authorize method with a blank answer
def authorize_blank_answer(context): context.security_answer = '' context.execute_steps('Given I run the authorize command')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authorize_answer(context, answer):\n context.security_answer = answer\n context.execute_steps('Given I run the authorize command')", "def test_authorize(self):\n account = self._get_hosting_account()\n service = account.service\n\n self.assertFalse(service.is_authorized())\n\n ...
[ "0.7235581", "0.7157022", "0.7100838", "0.7033909", "0.6952745", "0.6848676", "0.6820224", "0.676804", "0.6696066", "0.6662524", "0.66453516", "0.66446453", "0.66103816", "0.6575496", "0.6571787", "0.6526681", "0.65087825", "0.6506799", "0.64773476", "0.6465332", "0.6452522",...
0.7590824
0
Vignetting function value at the specified sky coordinates for a particular CCD.
def at_sky_coord(self, sky_coord, wcs, pix_to_fp): # Compute pixel coordinates of the sky position on the CCD, # then convert to focal plane coordinates to compute the # radial distance from the focal plane center. This will be # used with the spline model to obtain the vignetting scale...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _vce(self):\n sum = 0.0\n for sail in self.sails:\n cl2 = sail.cl(self.awa)**2\n cd2 = sail.cd(self.awa)**2\n sum += sail.area * sail.vce * sail.bk * np.sqrt(cl2+cd2)\n self._area()\n deltaCH = 0 if self.sails[1].up!=True else (1-self.ftj)*0.05*self....
[ "0.56376773", "0.54823244", "0.5473367", "0.5473367", "0.5451211", "0.5449379", "0.54230136", "0.53710794", "0.5366188", "0.53508955", "0.52844507", "0.5272747", "0.52489144", "0.5241249", "0.5233098", "0.5197168", "0.5196922", "0.51755476", "0.51585746", "0.51283544", "0.512...
0.5188395
17
Simple, shortnamed getter function for environment variables.
def env(var): return os.environ[var]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, key):\n return os.environ[key]", "def __getitem__(self, name):\n return os.environ[name]", "def _get_env(key: str) -> str:\n value = os.getenv(key)\n assert isinstance(value, str), (\n f\"the {key} environment variable must be set and a string, \" f\...
[ "0.7507341", "0.7388676", "0.73260605", "0.7263089", "0.7091815", "0.7059706", "0.70344156", "0.70138896", "0.6990074", "0.69314015", "0.6896341", "0.6843857", "0.6838009", "0.68260574", "0.67992806", "0.67714757", "0.67627305", "0.67627305", "0.67606604", "0.67602736", "0.67...
0.75958115
0
Sets the environment variable to the default_value if it's not defined.
def default_env(var, default_value): if var not in os.environ: os.environ[var] = default_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setdefault_path(envvar, default):\n if envvar in os.environ:\n return _strip_slash(os.environ[envvar])\n value = os.environ[envvar] = _strip_slash(default() if callable(default) else default)\n return value", "def _set_from_env(name, context, default):\n if default is _DEFA...
[ "0.72383255", "0.7010498", "0.6846171", "0.6830027", "0.6830027", "0.6830027", "0.67922443", "0.6612479", "0.65604025", "0.6547924", "0.6536963", "0.6530787", "0.64864516", "0.645175", "0.6448598", "0.635525", "0.6345132", "0.6330451", "0.629224", "0.6273931", "0.6261569", ...
0.8446604
0
int > date corresponding to a proleptic Gregorian ordinal.
def fromordinal(cls, *args, **kwargs): # real signature unknown pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def julianToGregorian(self, p_int): # real signature unknown; restored from __doc__\r\n pass", "def gregorianToJulian(self, p_int, p_int_1, p_int_2): # real signature unknown; restored from __doc__\r\n return 0", "def gregorian_date(year, julian_day):\n result = datetime.date(year, 1, 1)\n ...
[ "0.6931177", "0.6504359", "0.6331793", "0.62870276", "0.62730604", "0.6083336", "0.59203315", "0.588552", "0.5868714", "0.5856038", "0.5829733", "0.5822957", "0.57977533", "0.57911736", "0.5776873", "0.57642245", "0.57224905", "0.56627023", "0.56453514", "0.5629634", "0.56117...
0.0
-1
timestamp > local date from a POSIX timestamp (like time.time()).
def fromtimestamp(cls, *args, **kwargs): # real signature unknown pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timestampfromlocal(local):\n return local.timestamp()", "def timestamp_is_before_local(\n embed: Callable,\n local_timestamp: onp.ndarray,\n secondary_timestamp: onp.ndarray,\n) -> bool:\n local_time_embedded = embed(local_timestamp)\n return secondary_timestamp < local_time_embedded", "d...
[ "0.6997585", "0.6967058", "0.66853213", "0.6566322", "0.6535712", "0.6528898", "0.64547545", "0.6394515", "0.60960734", "0.6095024", "0.60651433", "0.6044485", "0.604086", "0.593185", "0.58869535", "0.58466005", "0.5819469", "0.581358", "0.576106", "0.5724257", "0.57239234", ...
0.0
-1
Return proleptic Gregorian ordinal. January 1 of year 1 is day 1.
def toordinal(self, *args, **kwargs): # real signature unknown pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def julianToGregorian(self, p_int): # real signature unknown; restored from __doc__\r\n pass", "def to_ordinal(self):\n return ((self.month - 1) * 20) + self.day - 1", "def toordinal(self):\n return _ymd2ord(self._year, self._month, self._day)", "def gregorianToJulian(self, p_int, p_int...
[ "0.6466345", "0.631926", "0.6233899", "0.6228471", "0.6173051", "0.6150309", "0.6133009", "0.59502536", "0.5886168", "0.58656853", "0.58656853", "0.58238685", "0.5791321", "0.5787395", "0.5765665", "0.5756547", "0.57496387", "0.57271993", "0.57270604", "0.57225347", "0.566607...
0.5088389
80
Makes a deep copy of this container config
def clone(self) -> 'ContainerConfig': return deepcopy(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy(self):\n new = super().copy()\n new.drip_cal_config = deepcopy(self.drip_cal_config)\n new.drip_config = deepcopy(self.drip_config)\n new.pipecal_config = deepcopy(self.pipecal_config)\n return new", "def copy(self, **kwargs):\n # type: (...) -> SalusConfig\n ...
[ "0.7458181", "0.7380167", "0.6833713", "0.6630874", "0.6623427", "0.6479937", "0.64012116", "0.6397228", "0.63911694", "0.6381171", "0.6361091", "0.6315942", "0.62218344", "0.6202327", "0.61978906", "0.6178656", "0.6171051", "0.616696", "0.613601", "0.61263317", "0.61247706",...
0.826103
0
Get Continuous Eod Spread
def get_continuous_eod_spread_r( self, headers: t.Dict[str, str] = None, body: JSONEncodable = None, fields_data: t.Dict[str, str] = None, **kwargs ): r = self._do_call( method='GET', url=f'{self.API_BASE_URL}/prices/eod/co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_e(self):\n return self.e_min + self.e_ * self.e_range", "def _Ep(self):\n return np.logspace(np.log10(self.Epmin.to('GeV').value),np.log10(self.Epmax.to('GeV').value),\n self.nEpd * (np.log10(self.Epmax/self.Epmin)))", "def getEnergyEvolution(self):\n\n\t\tEBefore = [0.5*np...
[ "0.6191864", "0.6097517", "0.6094706", "0.5804405", "0.5789028", "0.5713299", "0.57118237", "0.5691484", "0.56884813", "0.56820315", "0.56798816", "0.56701005", "0.5669353", "0.5667375", "0.56474084", "0.5642463", "0.5642463", "0.5634387", "0.5631602", "0.56239885", "0.562240...
0.5815469
3
Return True if Join GitHub is found on the Sign up page of Github.
def test_github_signup(self): driver = self.driver driver.get(self.base_url) search_box = driver.find_element_by_link_text("Sign up") search_box.send_keys(Keys.RETURN) time.sleep(2) assert "Join GitHub" in driver.page_source
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verifyLogin():\n global HUB\n\n loginInfo = FloatingTools.userData()['Login']\n if loginInfo['username'] is None or loginInfo['password'] is None:\n FloatingTools.Dashboard.setDashboardVariable('logged_in', False)\n return False\n try:\n HUB = Github(loginInfo['username'], logi...
[ "0.642282", "0.6232943", "0.6021595", "0.58653253", "0.5845641", "0.5739789", "0.5729379", "0.55512524", "0.55493534", "0.5535537", "0.548289", "0.5459835", "0.54589456", "0.54444194", "0.5428135", "0.5403289", "0.5397567", "0.53968155", "0.53659683", "0.5358906", "0.5343683"...
0.67247707
0
Returns the age data associated with this widget
def age(self): return self._age
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_age(self):\n\t\treturn self.age", "def getAge(self):\n return self.age", "def get_age(self):\r\n return self.age", "def get_age(self):\n return self.__age", "def get_age(self):\n return self._age", "def get_age(self):\n return self._age", "def get_age(self):\n...
[ "0.78726625", "0.7839264", "0.7828237", "0.77901477", "0.7775453", "0.7775453", "0.7775453", "0.7768722", "0.7713467", "0.76327825", "0.7616466", "0.75815964", "0.7427087", "0.7189556", "0.7122518", "0.7086804", "0.7086804", "0.70808375", "0.70277196", "0.7015795", "0.7007959...
0.7775168
7
Returns the height data associated with this widget
def height(self): return self._height
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def height(self):\n return self[\"height\"]", "def height(self):\n return self[\"height\"]", "def get_height(self):\r\n return self._height", "def get_height(self):\r\n return self._height", "def get_height(self):\r\n return self._height", "def get_height(self):\r\n ...
[ "0.80621004", "0.80621004", "0.7782747", "0.7782747", "0.7782747", "0.77548146", "0.77494687", "0.772865", "0.7712051", "0.7712051", "0.7712051", "0.7712051", "0.76399", "0.76399", "0.7626774", "0.760368", "0.760368", "0.760368", "0.760368", "0.760368", "0.760368", "0.76036...
0.7640551
12
Compute the sigmoid of x
def sigmoid(x): s = 1 / (1 + np.exp(-x)) return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid(x):\n return 1 / (1 + exp(-x))", "def sigmoid(x):\n return 1 / (1 + exp(-x))", "def sigmoid(x):\n\treturn 1 / (1 + m.exp(-x))", "def sigmoid(x):\r\n\r\n return 1 / (1 + np.exp(-x))", "def sigmoid(x):\n return 1 / (1 + math.exp(-x))", "def sigmoid(x):\r\n return 1 / (1 + np.exp(-x...
[ "0.91649485", "0.91649485", "0.9146934", "0.91416234", "0.9098982", "0.9098954", "0.9096067", "0.9096067", "0.9090962", "0.9057544", "0.9049889", "0.90487975", "0.90487975", "0.90487975", "0.90487975", "0.90487975", "0.90487975", "0.90481615", "0.90456223", "0.9031282", "0.90...
0.9035827
19
Compute the gradient (also called the slope or derivative) of the sigmoid function with respect to its input x. You can store the output of the sigmoid function into variables and then use it to calculate the gradient.
def sigmoid_derivative(x): s = sigmoid(x) ds = s * (1 - s) return ds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gradient(cls, x):\n y = Sigmoid.apply(x)\n return np.multiply(y, 1 - y)", "def sigmoid_grad(x):\n sig = sigmoid(x)\n return np.multiply(sig, 1 - sig)", "def sigmoid_grad(self, X):\n var=self.sigmoid(X)\n return var*(1-var)", "def gradient(cls, x):\n return 1 - Tan...
[ "0.86749613", "0.82202786", "0.7997545", "0.7830427", "0.7808094", "0.7778524", "0.77593434", "0.7721575", "0.7715675", "0.76948535", "0.7551081", "0.7517939", "0.7514641", "0.7502627", "0.7479357", "0.7479357", "0.74773", "0.7400833", "0.7389306", "0.73755866", "0.73224217",...
0.7789024
5
Implement a function that normalizes each row of the matrix x (to have unit length).
def normalize(x): x_norm = np.linalg.norm(x, axis=1, keepdims=True) print(x_norm) x = x / x_norm ### END return x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalizeRows(x):\n\n ### YOUR CODE HERE\n norm2 = np.linalg.norm(x,2,axis = 1).reshape(x.shape[0],-1)\n x = x/norm2\n ### END YOUR CODE\n\n return x", "def normalizerows(x):\n # Compute x_norm as the norm 2 of x. Use np.linalg.norm(..., ord=2, axis= ..., keepdims=True)\n x_norm = np.lin...
[ "0.85183054", "0.847961", "0.8414071", "0.8388186", "0.83319604", "0.81966865", "0.802723", "0.7895032", "0.7587747", "0.7577033", "0.75136364", "0.7495747", "0.7425624", "0.73915094", "0.7375276", "0.7375276", "0.7357788", "0.726229", "0.7220906", "0.7220707", "0.7135632", ...
0.7980486
7
Calculates the softmax for each row of the input x. Your code should work for a row vector and also for matrices of shape (n, m).
def softmax(x): x_exp = np.exp(x) x_sum = np.sum(x_exp, axis=1, keepdims=True) s = x_exp / x_sum return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(x):\n x = np.array(x)\n if x.ndim == 1:\n return column_softmax(x)\n else:\n ret_arr = np.array([column_softmax(col) for col in x.T])\n return ret_arr.T", "def softmax(x: npt.NDArray) -> npt.NDArray:\n row_wise_max = np.max(x, axis=1).reshape(-1, 1)\n exp_x = np.exp(x - row_wise_max...
[ "0.8461606", "0.84332174", "0.84124285", "0.826018", "0.8238853", "0.8201691", "0.81545997", "0.8123755", "0.8107039", "0.8070828", "0.805601", "0.8039965", "0.7986176", "0.79257214", "0.7900216", "0.7885437", "0.7880941", "0.784582", "0.7839799", "0.78244543", "0.78222156", ...
0.7623629
65
Start the timer initially or resume after pause
def start(self): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self):\n try:\n self.sec_start = time.clock()\n self.sec_stop = None\n self.sec_elapse = None\n self.duration_pause = 0\n\n # Will stop pausing if it's still pausing\n if self.timer_pause is not None \\\n and self...
[ "0.79759616", "0.7755206", "0.77232015", "0.76916087", "0.7588209", "0.75860226", "0.7370617", "0.7281194", "0.7147269", "0.714165", "0.6978051", "0.6814842", "0.67937624", "0.67835015", "0.67765814", "0.6745298", "0.66952235", "0.66427815", "0.66000843", "0.6596054", "0.6579...
0.0
-1
Stop the timer. Should only be called once when stopping the timer.
def stop(self) -> float: raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop(self):\n self._stopped.set()\n if self._timer:\n self._timer.cancel()\n self._timer = None", "def stop_timer(self):\r\n self.countdownTimer.stop()", "def stop(self):\n with self._lock:\n self._running.clear()\n if self._timer:\n ...
[ "0.8605103", "0.8485784", "0.84359574", "0.83089644", "0.8286813", "0.81736267", "0.77284306", "0.7671783", "0.76246554", "0.7557234", "0.75548923", "0.7441744", "0.74321175", "0.742442", "0.74047184", "0.73507845", "0.7248575", "0.72437745", "0.72333676", "0.72333676", "0.72...
0.0
-1
Returns the set of all atoms occurring in a formula. For example, observe the piece of code below. my_formula = Implies(Atom('p'), Or(Atom('p'), Atom('s')))
def atoms(formula): pass # ======== YOUR CODE HERE ========
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_formula(formula):\n return [set(clause) for clause in formula]", "def list_formulae():\n return _list_tindyb_unique_values(\"formula\", dbpath=__dbpath__)", "def extract_variables(cnf_formula: str) -> list[str]:\n variables = set()\n cnf_notation = identify_notation(cnf_formula)\n\n ...
[ "0.68975025", "0.6250088", "0.59558207", "0.5950655", "0.58994687", "0.589394", "0.5832335", "0.5824471", "0.5806455", "0.57920134", "0.573408", "0.56522334", "0.55874336", "0.5479919", "0.5382377", "0.5347508", "0.53465325", "0.53203654", "0.5313321", "0.5307027", "0.5293551...
0.56363386
12
hide every label on the field
def hideallstate(self): if self.hideallcheck.isChecked() == True: self.field.setOwnRobotsVisibility(False, self.index) self.field.setPathVisibility(False, self.index) self.field.setBallVisibility(False, self.index) self.field.setTeammateVisibility(False, self.inde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _hide_labels(self):\n pass", "def _hide_labels(self):\n for x in 'xy':\n # \"Shared\" axis and tick labels\n axis = getattr(self, x + 'axis')\n share = getattr(self, '_share' + x)\n if share is not None:\n level = getattr(self.figure, '...
[ "0.79736483", "0.702127", "0.6688048", "0.6608013", "0.6567723", "0.6316029", "0.6239746", "0.61185616", "0.6117501", "0.60907024", "0.6053555", "0.6046761", "0.6013626", "0.6009839", "0.5959108", "0.59445316", "0.59326863", "0.59202397", "0.5919227", "0.5895274", "0.58394104...
0.5673115
26
Returns the neutral map.
def mempty(self): return identity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __get_neutral_tiles(self) -> List[List[int]]:\n neutral_tiles = []\n for x in range(self.num_columns):\n for y in range(self.num_rows):\n if self.is_flippable_tile([y, x]):\n neutral_tiles.append([y, x])\n return neutral_tiles", "def _default_...
[ "0.59595937", "0.5752214", "0.57395196", "0.5697402", "0.5557552", "0.55375993", "0.55110705", "0.5503844", "0.54780257", "0.54651994", "0.5443325", "0.54125565", "0.54019755", "0.5389424", "0.5371902", "0.5362126", "0.5344892", "0.5327584", "0.5326536", "0.53259444", "0.5321...
0.0
-1
Returns the transport used by the client instance.
def transport(self) -> WebSecurityScannerTransport: return self._client.transport
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transport(self):\n return self._transport", "def transport(self) -> TraceServiceTransport:\n return self._client.transport", "def transport(self) -> ServiceControllerTransport:\n return self._client.transport", "def transport(self) -> MetadataServiceTransport:\n return self._c...
[ "0.82946277", "0.7887542", "0.773594", "0.773068", "0.76806635", "0.7674273", "0.76357967", "0.7551682", "0.75303864", "0.74958986", "0.7488142", "0.7436853", "0.7423566", "0.7368433", "0.73340607", "0.721926", "0.7109823", "0.7102308", "0.68808985", "0.68144", "0.6671675", ...
0.7558095
7
r"""Updates a ScanConfig. This method support partial update of a ScanConfig.
async def update_scan_config(self, request: web_security_scanner.UpdateScanConfigRequest = None, *, scan_config: gcw_scan_config.ScanConfig = None, update_mask: field_mask_pb2.FieldMask = None, retry: retries.Retry = gapic_v1.method.DEFAULT, timeou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_config(self, config):\n return self._update_config(\"config\", config)", "def update_config(self):\n if self.integration is None:\n return\n self.enabled = self.integration.has_option(self.get_config_name())\n self.pedantic = self.integration.configuration.get_bool(\...
[ "0.6499381", "0.6221208", "0.6172283", "0.6084719", "0.6070703", "0.6052935", "0.59297204", "0.59078205", "0.5885652", "0.58774275", "0.58774275", "0.58466107", "0.58459216", "0.5844726", "0.5829971", "0.5797705", "0.578494", "0.5748994", "0.5735893", "0.5692788", "0.56856894...
0.63198954
1
Takes in a df, list of cf column headers then returns pairwise plots
def plot_cf_target(df, columns, hue = "default_payment_next_month"): loc = 1 numplots = ((len(columns)*(len(columns)-1))/2)+len(columns) fig = plt.figure(figsize = (40,60)) for i, ycol in enumerate(columns): for j, xcol in enumerate(columns): if j < i: continue ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_all_df_columns(df, col_nums, title='', xlabel=''):\n i = 1\n values = df.values\n for col in col_nums:\n plt.subplot(len(col_nums), 1, i)\n plt.plot(values[:, col])\n plt.title(title)\n plt.ylabel(dr_df.columns[col])\n plt.xlabel(xlabel)\n i += 1\n plt...
[ "0.6661865", "0.64127696", "0.6326994", "0.6296105", "0.6226387", "0.61778414", "0.6177841", "0.61708844", "0.60962313", "0.60951406", "0.605261", "0.60147613", "0.6004868", "0.5991807", "0.59844476", "0.5981476", "0.598104", "0.5944551", "0.5936741", "0.5932301", "0.59096026...
0.70675445
0
Look for a band.
def iter_band_search(self, pattern): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def band(self):\n return self._band", "def calculate_band(value, bands):\n for band in bands:\n if band > value:\n return band", "def _bandNumber(self, band, exc=True): # TODO: use super method?\n if hasattr(self, '_netcdf') and (':' in str(band) or str(band).isdigit()):\n ...
[ "0.6500203", "0.62789935", "0.57520497", "0.5747303", "0.56264955", "0.56244916", "0.55898196", "0.5551565", "0.5512027", "0.5479513", "0.54779047", "0.5442203", "0.5441626", "0.54250336", "0.5407197", "0.53749365", "0.53565323", "0.53506964", "0.5319547", "0.5294914", "0.529...
0.6282506
1
Create a row of buttons. buttons is a list of dictionaries containing the properties of each button.
def createButtons (self,buttons): assert(self.frame) self.buttonsFrame = f = Tk.Frame(self.top) f.pack(side="top",padx=30) # Buttons is a list of dictionaries, with an empty dictionary at the end if there is only one entry. buttonList = [] for d in buttons: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createButtons(self):\r\n buttonsPosition = {\r\n \"BROWSE\": (3, 2),\r\n \"CALCULATE\": (13, 2),\r\n \"SAVE\": (14, 0),\r\n \"CLEAR\": (14, 1),\r\n \"DELETE\": (14, 2),\r\n \"PRINT\": (13, 3),\r\n \"GENERATE BILL\": (14, 3)\r\n...
[ "0.71601856", "0.70929414", "0.69266677", "0.68716264", "0.6869818", "0.6782597", "0.6779524", "0.6750514", "0.6739588", "0.669428", "0.66930676", "0.66853094", "0.6653693", "0.66404855", "0.6561893", "0.654575", "0.64557403", "0.6399822", "0.63862854", "0.63604045", "0.63543...
0.7411397
0
Create a frame containing a Tk.Label widget.
def createMessageFrame (self,message): label = Tk.Label(self.frame,text=message) label.pack(pady=10)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_main_label_frame(self):\r\n # frame for storage\r\n main_label_frame = Frame(master=self)\r\n main_label_frame.pack()\r\n\r\n # canvas for circle\r\n self.canvas = Canvas(master=main_label_frame, width=100, height=100)\r\n self.canvas.pack(side=LEFT)\r\n\r\n ...
[ "0.73475033", "0.7027426", "0.6988283", "0.6939528", "0.6847909", "0.6809049", "0.67860276", "0.6725269", "0.66808265", "0.66590595", "0.6547794", "0.6541421", "0.6489484", "0.64648515", "0.6437415", "0.6434093", "0.64308584", "0.63861275", "0.6307793", "0.6228364", "0.621347...
0.7096806
1
Create a dialog having yes and no buttons.
def __init__ (self,title,message=None,resizeable=False): leoTkinterDialog.__init__(self,title,resizeable) # Initialize the base class. self.createTopFrame() self.top.bind("<Key>",self.onKey) if message: self.createMessageFrame(message) buttons =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yes_no_cancel_popup(title=None,\n text=None):\n d = gtk.Dialog(title=title,\n parent=None,\n flags=gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,\n buttons=( gtk.STOCK_YES, gtk.RESPONSE_YES,\n gtk.ST...
[ "0.7922838", "0.7887579", "0.76024395", "0.7583439", "0.73689646", "0.72079366", "0.710198", "0.6986705", "0.6938445", "0.68699825", "0.68188363", "0.6791159", "0.6773812", "0.67273194", "0.6692747", "0.6676279", "0.66656095", "0.6663175", "0.6606504", "0.6599451", "0.6585515...
0.6283064
34
Hide a list box dialog.
def hide (self): self.top.withdraw()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hide_form(self):\n\n # hide details\n if hasattr(self, '_details'): self._details.hide()\n\n # show the buttons, only if the they exists:\n toolbar = [self.toolbar] if isinstance(self.toolbar, str) else self.toolbar\n if toolbar:\n for o in toolbar:\n ...
[ "0.7026025", "0.6756906", "0.63823503", "0.6229442", "0.6221582", "0.6199078", "0.61461043", "0.60745925", "0.60484797", "0.60405403", "0.60215425", "0.60070974", "0.5970347", "0.59408426", "0.5912181", "0.59056944", "0.59005207", "0.5899464", "0.5886272", "0.5866871", "0.586...
0.5814425
30
This will provide an iterator for the sector given by id.
def iter_sector(self, id): # hard coded because I suck at math. # this is a map of sector id to tuples of points: # (starting row, starting column), (ending row, ending column) # where the end values are inclusive. sector_map = { 0: ((0, 0), (2, 2)), 1: (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_disks(self, oid):\n pool = await self.query([('id', '=', oid)], {'get': True})\n if not pool['is_decrypted']:\n yield\n async for i in await self.middleware.call('zfs.pool.get_disks', pool['name']):\n yield i", "def get_read_by_id(id_list, bam):\n\n for...
[ "0.55995375", "0.52690184", "0.52163905", "0.5160411", "0.5143821", "0.50893855", "0.5034575", "0.50223005", "0.5016814", "0.495041", "0.4857982", "0.48325124", "0.48296878", "0.47888067", "0.47803864", "0.47771695", "0.47749352", "0.47502574", "0.47460315", "0.4740054", "0.4...
0.8133958
0
The intercept term (alpha). Technically defined as the coefficient to a column vector of ones.
def _alpha(self): return _handle_ab(self.solution, self.use_const)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intercept(self):\n return self.core.fmlayer.b.numpy()", "def intercept_(self):\n return self.regression.intercept_", "def intercept(self) -> np.ndarray:\n return self._intercept", "def coef(self):\n return self._coef", "def xintercept(self):\n if self.slope() == 0:\n ...
[ "0.66101354", "0.62400764", "0.62318707", "0.6106237", "0.6096498", "0.6059444", "0.60117567", "0.59873927", "0.5931438", "0.59311104", "0.592589", "0.5920921", "0.5853009", "0.5803821", "0.5799087", "0.57744694", "0.57580703", "0.57569593", "0.5746759", "0.5730497", "0.57065...
0.54984444
28
The parameters (coefficients), excl. the intercept.
def _beta(self): return _handle_ab(self.solution, self.use_const)[1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_coefficients(self):\n return self.coefficients", "def get_coefficients(self):\n return self.coefficients", "def coefficients(self):\r\n return self.coef_['x']", "def coefficients(self) :\n return self.__coefficients", "def coefficients(self) :\n raise NotImplement...
[ "0.77190876", "0.77190876", "0.74551207", "0.7425345", "0.7313964", "0.7183233", "0.7183233", "0.69458616", "0.69105834", "0.6793081", "0.6681144", "0.66729426", "0.66631496", "0.658464", "0.6498116", "0.64882094", "0.6482376", "0.6408639", "0.6400737", "0.6381249", "0.637809...
0.0
-1
Standard error of the estimate (SEE). A scalar. For standard errors of parameters, see _se_all, se_alpha, and se_beta.
def _std_err(self): return np.sqrt(np.sum(np.square(self._resids), axis=-2) / self._df_err)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calcSE(self):\n # Make sure the Variance is already calculated\n if not hasattr(self,'ZmAreaVar'):\n self.calcZmAreaVar()\n # Standard Error = Square Root of Variance\n self.SE = self.ZmAreaVar ** 0.5\n # Should I be returning the value also?\n # Or just set...
[ "0.7411503", "0.7411503", "0.71832216", "0.70934427", "0.7087837", "0.7011565", "0.68213147", "0.6787768", "0.6685589", "0.66614795", "0.65728956", "0.6526832", "0.6521399", "0.6488981", "0.6466296", "0.64542437", "0.64450115", "0.64389014", "0.6429518", "0.64068216", "0.6405...
0.66661364
9
Standard errors (SE) of the intercept (alpha) only.
def _se_alpha(self): return _handle_ab(self._se_all, self.use_const)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inrse(self) -> float:\n return float(np.sqrt(np.sum(np.square(self._error())) / np.sum(np.square(self.true - np.mean(self.true)))))", "def stderr(predicted, actual):\n return np.sqrt(mse(predicted, actual))", "def calcSE(self):\n # Make sure the Variance is already calculated\n if n...
[ "0.6868574", "0.66326535", "0.65912676", "0.65912676", "0.6554754", "0.6521084", "0.63746834", "0.63495344", "0.6343663", "0.6311726", "0.63005245", "0.6246057", "0.6226251", "0.6158948", "0.61299706", "0.6094158", "0.6082092", "0.60280573", "0.59483105", "0.5947861", "0.5946...
0.6710183
1
Standard error of the estimate (SEE). A scalar. For standard errors of parameters, see _se_all, se_alpha, and se_beta.
def std_err(self): return self._std_err
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calcSE(self):\n # Make sure the Variance is already calculated\n if not hasattr(self,'ZmAreaVar'):\n self.calcZmAreaVar()\n # Standard Error = Square Root of Variance\n self.SE = self.ZmAreaVar ** 0.5\n # Should I be returning the value also?\n # Or just set...
[ "0.74100775", "0.74100775", "0.71827066", "0.70934886", "0.70871806", "0.7011712", "0.6819478", "0.67875093", "0.6683913", "0.666691", "0.6661523", "0.6570878", "0.65252215", "0.65210646", "0.64907444", "0.6465488", "0.6453945", "0.64433694", "0.6437442", "0.6430619", "0.6406...
0.59279215
74
The coefficent of determination, Rsquared.
def rsq(self): return np.squeeze(self._rsq)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coherence(self):\r\n return np.abs(self.coherency) ** 2", "def R_squared(self):\n return 1 - ((self.y - self.y_hat(self.x))**2).sum() / ((self.y - self.y.mean())**2).sum()", "def coeff_determination(y_true, y_pred):\n # Assertions\n # assert y_true.shape[0] = y_pred.shape[0], \\...
[ "0.6853738", "0.68452215", "0.66449404", "0.65658695", "0.6516001", "0.64739573", "0.6467061", "0.6465879", "0.6410858", "0.63933194", "0.6361207", "0.6308788", "0.63036865", "0.63020194", "0.62853956", "0.62288666", "0.62218666", "0.6201027", "0.6183531", "0.6154839", "0.611...
0.5711325
85
Standard errors (SE) of the intercept (alpha) only.
def se_alpha(self): return self._se_alpha
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inrse(self) -> float:\n return float(np.sqrt(np.sum(np.square(self._error())) / np.sum(np.square(self.true - np.mean(self.true)))))", "def _se_alpha(self):\n return _handle_ab(self._se_all, self.use_const)[0]", "def stderr(predicted, actual):\n return np.sqrt(mse(predicted, actual))", "d...
[ "0.68700576", "0.67093706", "0.66328686", "0.6593003", "0.6593003", "0.6556188", "0.65224326", "0.6375219", "0.634467", "0.6312481", "0.6300764", "0.62465405", "0.62263435", "0.61582834", "0.61323357", "0.6094051", "0.6083283", "0.6027986", "0.5949926", "0.59475034", "0.59460...
0.6348921
8
Returns the default collector settings
def get_default_config(self): config = super(NvidiaGPUCollector, self).get_default_config() config.update({ 'path': 'nvidia', 'bin': '/usr/bin/nvidia-smi', 'stats': [ 'index', 'memory.total', 'memory.used', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_default_config(self):\r\n config = super(CMDCollector, self).get_default_config()\r\n config.update({\r\n 'enabled': 'True',\r\n 'fs': ',',\r\n 'timeout': 300,\r\n })\r\n return config", "def getDefaultSettings():\n return {}", "def ge...
[ "0.70514023", "0.7008024", "0.69490683", "0.6713433", "0.65743333", "0.65309024", "0.6521635", "0.6515402", "0.6466526", "0.6447688", "0.641337", "0.6397818", "0.6380512", "0.63683224", "0.6357208", "0.63517016", "0.6331759", "0.63120294", "0.62353724", "0.6231899", "0.620749...
0.58790654
47
Checks whether the given user is a prime member. A prime member must have a name starting with "W".
def is_prime_member(user: User) -> bool: if not user: raise TypeError('user should not be None') return user.name.startswith('W')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_member(user: User) -> bool:\n if not user:\n raise TypeError('user should not be None')\n return user.name.startswith('L')", "def is_member(self, username):\n usernames = [user.username for user in self.members]\n return True if username in usernames else False", "def memberch...
[ "0.7031883", "0.6452702", "0.6178463", "0.6020494", "0.5966895", "0.5874124", "0.58240306", "0.5812485", "0.57723707", "0.5752286", "0.57423496", "0.5709559", "0.57048184", "0.570026", "0.569219", "0.56901926", "0.5687716", "0.5670567", "0.56685334", "0.56570965", "0.5650564"...
0.8702818
0
Return package version as listed in `__version__` in `init.py`.
def get_version(package): init_py = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.path.join(package, '__init__.py'))).read() return re.search("__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.8379423", "0.8370828", "0.8370828", "0.8370828", "0.8370828", "0.8370828", "0.8370828", "0.8370828", "0.83582735", "0.8357903", "0.835638", "0.8078477", "0.7975143", "0.7938866", "0.78928864", "0.78928864", "0.78928864...
0.83694756
12
Create a new empty email message object.
def __init__(self, smtp_server='localhost', smtp_port=None, smtp_ssl=False, smtp_user=None, smtp_password=None): self._text_body = None self._html_body = None self._subject = "" self._reply_to = None self._smtp_server = smtp_server self._smtp_port = smtp_port ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createMessage( self, *args, **kw ):\n return MailMessage( *args, **kw )", "def _create_email(\n to_field=\"to_user@test1.com\",\n from_field=\"from_user@test2.com\",\n subject=\"This is a test email\",\n body=\"Almost empty text message\",\n attachment=None,\n maintype=None,\n sub...
[ "0.7954551", "0.6886577", "0.6860105", "0.6822612", "0.6811571", "0.6770799", "0.67545676", "0.67475533", "0.66796744", "0.65480614", "0.65268", "0.64353305", "0.63659376", "0.63572526", "0.6249842", "0.6173206", "0.61498415", "0.6143475", "0.6142634", "0.6136329", "0.6127921...
0.0
-1
Set the subject of the email message.
def set_subject(self, subject): self._subject = subject
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_subject(self):\n\t\tfrom email.errors import HeaderParseError\n\t\ttry:\n\t\t\t_subject = decode_header(self.mail.get(\"Subject\", \"No Subject\"))\n\t\t\tself.subject = _subject[0][0] or \"\"\n\t\t\n\t\t\tif _subject[0][1]:\n\t\t\t\tself.subject = self.subject.decode(_subject[0][1])\n\t\t\telse:\n\t\t\t\t...
[ "0.7846771", "0.7493892", "0.7471735", "0.7471735", "0.7085536", "0.7043361", "0.6950219", "0.68925816", "0.68925816", "0.68925816", "0.67665654", "0.67512393", "0.6651311", "0.6642925", "0.6642925", "0.6423623", "0.63688487", "0.6286229", "0.6276982", "0.6265675", "0.6265675...
0.7472959
2
Set the email sender.
def set_from(self, address): if not self.validate_email_address(address): raise Exception("Invalid email address '%s'" % address) self._from = address
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def define_sender(self, email=\"\", name=\"\"):\n if not email:\n return\n if not name:\n name = False\n self.from_who = _email.formataddr( (name, email) )", "def sender(self, sender: Address) -> None:\n enforce(\n isinstance(sender, str), f\"Sender mu...
[ "0.76826143", "0.72352886", "0.71983135", "0.6901213", "0.68920124", "0.67680264", "0.66775936", "0.6657046", "0.6657046", "0.6657046", "0.6657046", "0.6657046", "0.6657046", "0.6657046", "0.6657046", "0.6657046", "0.6657046", "0.6594795", "0.6594795", "0.65843356", "0.655834...
0.66560674
17
Filter given query by the specified category. If toplevel category given, then filter by all sub categories.
def _filter_by_category(query, type, category_id): sub_cats = list(models.Category.query.filter_by(parent=category_id). values(models.Category.id)) cat_ids = zip(*sub_cats)[0] if sub_cats else [category_id] return query.filter(type.category.in_(cat_ids))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter( self, trans, user, query, column_filter ):\n if column_filter == \"All\":\n return query\n return query.filter( model.Category.name == column_filter )", "def filter( self, trans, user, query, column_filter ):\n if column_filter == \"All\":\n ...
[ "0.629224", "0.629224", "0.5976908", "0.5891369", "0.5746748", "0.5557027", "0.5548413", "0.54855055", "0.54057306", "0.53971064", "0.52995056", "0.52810174", "0.52659917", "0.52430934", "0.52367544", "0.5202147", "0.5172446", "0.5151943", "0.5143933", "0.5132387", "0.5110582...
0.7592493
0
Return a string representation of the object.
def __str__(self): return f"OPA of {self.data}"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return str(self.__dict__['_obj'])", "def to_string(self):\r\n return self.__str__()", "def __str__(self):\n return str(self.obj)", "def as_string(self):\n return self.__repr__()", "def __str__(self):\n return str(self.serialize())", "def __s...
[ "0.82716775", "0.8229119", "0.8224927", "0.81780547", "0.81267965", "0.807037", "0.80628353", "0.80387276", "0.80387276", "0.80346024", "0.80346024", "0.80346024", "0.80346024", "0.80346024", "0.80011606", "0.7970061", "0.7970061", "0.7970061", "0.7970061", "0.7970061", "0.79...
0.0
-1
Return a representation of the object.
def __repr__(self): return f'OPA("{self.data}")'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_representation(self) -> str:\n raise NotImplementedError()", "def __repr__(self) -> str:\n return str(self.as_dict())", "def __repr__(self):\n return repr(self.__dict__['_obj'])", "def __repr__(self):\n return json.dumps(self.__dict__)", "def __repr__(self):\n ...
[ "0.78727806", "0.7668644", "0.76516104", "0.75705904", "0.7518613", "0.7518613", "0.7518613", "0.7518613", "0.7518613", "0.7506125", "0.74930704", "0.74640274", "0.7457539", "0.74347013", "0.74347013", "0.74347013", "0.74347013", "0.74347013", "0.74347013", "0.74347013", "0.7...
0.0
-1
Add headers to both force latest IE rendering engine or Chrome Frame, and also to cache the rendered page for 10 minutes.
def add_header(response): response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1' response.headers['Cache-Control'] = 'public, max-age=0' return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, max-age=60'\n return response", "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, m...
[ "0.82229453", "0.8222136", "0.8222136", "0.8222136", "0.8222136", "0.81953955", "0.8112386", "0.8086546", "0.79726315", "0.7865568", "0.76608396", "0.7236549", "0.71591944", "0.71521765", "0.71521765", "0.71501815", "0.71501815", "0.714096", "0.7136288", "0.71274537", "0.7127...
0.81629556
12
The base path of the workflow file definition and the input and output datasets.
def base_path(self): return self._base_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base_path(self):\n return self.setup.base_path", "def base_dir():\n return os.path.join(TrainFile.base_dir(), 'model')", "def get_base_dir(self):\n return self._config_dict['output']['@baseDirectory']", "def get_input_data_folder(self):\n return self.config['input_folder_path'...
[ "0.73117745", "0.71058905", "0.6813719", "0.67751867", "0.6755779", "0.6677986", "0.66406035", "0.65244675", "0.6416518", "0.6401157", "0.6394585", "0.6393112", "0.6388356", "0.6373598", "0.63680905", "0.63614225", "0.6344815", "0.6297331", "0.62887126", "0.6279583", "0.62446...
0.6698668
5
The filename (relative to ``base_paht``) of the workflow definition.
def filename(self): return self._filename
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filename(self) -> str:\n return self.definition.slug", "def base_filename(self):\n return self.filename.split('.')[0]", "def generate_workflow_name(self) -> str:\n workflow_name = None\n if self._parsed_url.basename in WORKFLOW_SPEC_FILENAMES:\n # We omit the name of ...
[ "0.7505453", "0.73529285", "0.72778296", "0.7144979", "0.7114226", "0.7044392", "0.7034888", "0.6980852", "0.69263655", "0.6919861", "0.6891802", "0.68485546", "0.68314475", "0.68051815", "0.6805048", "0.6770081", "0.6766309", "0.6752633", "0.6747525", "0.67074144", "0.670731...
0.65431046
42
Return the dictionary which defines the mapping between workflow inputs and test datasets.
def inputs(self): return self._inputs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def teststeps_map(self):\n workbook = self._get_workbook(config_key='test_steps_file')\n teststeps_map = {}\n\n # set up testing_scenarios with different teststeps\n for testing_scenario in workbook.sheet_names:\n teststeps_map[testing_scenario] = pd.read_excel(\n ...
[ "0.6633306", "0.63249815", "0.62189543", "0.6128222", "0.60363525", "0.5979196", "0.59380776", "0.5907683", "0.59018654", "0.58986205", "0.58584094", "0.58394617", "0.5820671", "0.5790637", "0.5725481", "0.572396", "0.57036895", "0.5665171", "0.56651455", "0.56572", "0.564837...
0.0
-1
Add a new expected output to the workflow test configuration.
def add_expected_output(self, name, filename, comparator="filecmp.cmp"): if not name: raise ValueError("Input name not defined") self._expected_outputs[name] = {"name": name, "file": filename, "comparator": comparator}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Checktest(self, expectedoutput):\n\n if expectedoutput == 0:\n result = self.runner.invoke(yoda.cli, [\"setup\", \"check\"])\n self.assertEqual(result.exit_code, 0)\n self.assertIn(\"The configuration file does not exist.\", result.output)\n return\n\n ...
[ "0.61844456", "0.6065057", "0.60069716", "0.5997723", "0.58988076", "0.58773917", "0.5865909", "0.58405405", "0.5712713", "0.5711833", "0.5708084", "0.57073045", "0.56994945", "0.56813186", "0.56494915", "0.5648082", "0.56340086", "0.56207275", "0.5615238", "0.5588759", "0.55...
0.63367724
0
Return a dictionary representation of the current class instance.
def to_dict(self): return dict({ "name": self.name, "file": self.filename, "inputs": {name: input_["file"][0] for name, input_ in _iteritems(self.inputs)}, "params": self.params, "expected": self.expected_outputs })
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dict(self):\n return self.__dict__", "def dict(self):\n return self.__dict__", "def dict(self):\n return self.__dict__", "def dict(self):\n return self.__dict__", "def dict(self):\n return self.__dict__", "def dict(self):\n return self.__dict__", "def dict(...
[ "0.8095239", "0.8095239", "0.8095239", "0.8095239", "0.8095239", "0.8095239", "0.8095239", "0.8035642", "0.80052865", "0.79428476", "0.7871267", "0.77396584", "0.7732261", "0.7732261", "0.7732261", "0.7732261", "0.7732261", "0.7732261", "0.7722014", "0.7699533", "0.7686565", ...
0.0
-1
Calculate area of all boxes in current object, in pixels. Returns
def area(self): bbox = self.bbox area = Box.calculate_bbox_area(bbox, bbox_type=self.bbox_type) return area
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def box_area(boxes):\n return (boxes[:, 2] - boxes[:, 0]) * (boxes[:, 3] - boxes[:, 1])", "def box_area(boxes):\n return (boxes[:, 2] - boxes[:, 0]) * (boxes[:, 3] - boxes[:, 1])", "def calculatearea(self):\r\n return self.width * self.height", "def area(boxes):\n y_min, x_min, y_max, x_max = n...
[ "0.7752234", "0.7752234", "0.76342493", "0.76321", "0.7578329", "0.757298", "0.7557231", "0.7544807", "0.74526334", "0.74520963", "0.74295056", "0.74241173", "0.7405829", "0.7381305", "0.7381305", "0.7381305", "0.7381305", "0.7381305", "0.73741513", "0.73688257", "0.73649764"...
0.7033303
58