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
Return the number of keys that can be used to receive passwordsets.
def __len__(self): return self.cli.passwords.len()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getNumberOfKeys(self) -> int:\n ...", "def num_keys(self):\n return len(self.counter.keys())", "def size(self, key):\n return self.cli.passwords.size(key)", "def getNoOfKeys(self):\n return len(self.__keyList)", "def num_keys(self):\r\n return len(self.keys)", "def ...
[ "0.80143", "0.7404593", "0.7390622", "0.7356278", "0.72153085", "0.714571", "0.714571", "0.69845414", "0.69658417", "0.67957836", "0.67728084", "0.6747977", "0.6741438", "0.6704789", "0.6704789", "0.6704121", "0.6684287", "0.667624", "0.66170293", "0.66080844", "0.65987736", ...
0.6993771
7
Return the number of ESSIDs currently stored.
def __len__(self): with SessionContext(self.SessionClass) as session: return session.query(ESSID_DBObject).count()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keycount(self, essid):\n if essid not in self.essids:\n raise KeyError(\"ESSID not in store.\")\n return len(self.essids[essid][1])", "def keycount(self, essid):\n return self.cli.essids.keycount(essid)", "def __len__(self):\n return self.cli.essids.len()", "def cou...
[ "0.7487046", "0.7227436", "0.68750715", "0.6811783", "0.67542565", "0.669554", "0.66645426", "0.662965", "0.65655565", "0.6549831", "0.6452546", "0.6444286", "0.6414019", "0.63826793", "0.63724375", "0.63692725", "0.6349159", "0.6337664", "0.6337297", "0.633663", "0.633002", ...
0.7134951
2
Return the number of keys that can be used to receive passwordsets.
def __len__(self): with SessionContext(self.SessionClass) as session: return session.query(PAW2_DBObject).count()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getNumberOfKeys(self) -> int:\n ...", "def num_keys(self):\n return len(self.counter.keys())", "def size(self, key):\n return self.cli.passwords.size(key)", "def getNoOfKeys(self):\n return len(self.__keyList)", "def num_keys(self):\r\n return len(self.keys)", "def ...
[ "0.80135465", "0.74047214", "0.7391079", "0.73557043", "0.72150433", "0.71461225", "0.71461225", "0.69943446", "0.69855064", "0.69653976", "0.6795644", "0.6773246", "0.674713", "0.6741121", "0.670482", "0.670482", "0.67037684", "0.6683842", "0.66759443", "0.6616894", "0.66073...
0.0
-1
Given latitude and longitude strings, return a (station_name, distance) tuple for the nearest MBTA station to the given coordinates.
def get_nearest_station(latitude, longitude): url1 = "http://realtime.mbta.com/developer/api/v2/stopsbylocation" params1 = {'api_key':'lm1M_mXgq0O6dsH9xduPAQ','lat':latitude,'lon':longitude,'format':'json'} req1 = requests.get(url1,params=params1) stat1 = req1.status_code stop_name = req1.json()['st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_nearest_station(latitude, longitude):\n urlbase = \"http://realtime.mbta.com/developer/api/v2/stopsbylocation?api_key=wX9NwuHnZU2ToO7GmGR9uw&lat=\"\n urlbase += str(latitude)\n urlbase += '&lon='\n urlbase += str(longitude)\n urlbase += '&format=json'\n response_data = get_json(urlbase)\n...
[ "0.77814513", "0.7383807", "0.663286", "0.64480966", "0.6446219", "0.62455356", "0.62298775", "0.62252617", "0.6216188", "0.6166792", "0.61266774", "0.6102662", "0.600416", "0.5968217", "0.58777344", "0.5823358", "0.57914865", "0.5769209", "0.57691586", "0.5753524", "0.570794...
0.74133044
1
Handles text and tokenises it. By default lowercases, removes all HTML tags and escaped characters such as , etc. Has options for removing punctuation, numbers, stopwords and also for stemming.
def tokenise_stem_punkt_and_stopword(text, punkt_to_remove=PUNKT, remove_numbers=True , stopword_set=STOPWORDS, do_stem = True, ngrams=1): if (text is None): return [] # Lowercases the whole text. text = text.lower() # Tokenises and removes punctuation. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess_text(text, tokenize=False, ner=False, stem=False, stopw=False, all_lower=False, strip_punct=True):\n\n # Clean the text\n text = re.sub(r\"what's\", \"what is \", text)\n text = re.sub(r\"\\'s\", \" \", text)\n text = re.sub(r\"\\'ve\", \" have \", text)\n text = re.sub(r\"can't\", \"...
[ "0.7395769", "0.7256253", "0.72417367", "0.72355396", "0.7207605", "0.7201045", "0.71128625", "0.71106637", "0.71063673", "0.7100442", "0.7068302", "0.70634055", "0.70499676", "0.7039693", "0.7039693", "0.7039693", "0.7039693", "0.7039693", "0.7039693", "0.7039525", "0.700137...
0.0
-1
Create an array of learning rates conforming to the cosine decay mode.
def _generate_cosine_lr(lr_init, lr_max, total_steps, warmup_steps): decay_steps = total_steps - warmup_steps lr_each_step = [] lr_inc = (float(lr_max) - float(lr_init)) / float(warmup_steps) for i in range(total_steps): if i < warmup_steps: lr = float(lr_init) + lr_inc * (i + 1) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cosine_decay(base_lr, max_iteration, cur_step):\n return base_lr * (math.cos( (7*math.pi*cur_step) / (16*max_iteration) ))", "def decay_learning_rate(initial_learning_rate, i, n_iterations):\n return initial_learning_rate * np.exp(-i / n_iterations)", "def learning_rate(epoch):\n return alpha ...
[ "0.62541157", "0.59125054", "0.5772891", "0.5772891", "0.574539", "0.5706132", "0.56706285", "0.5663655", "0.5634791", "0.5622778", "0.55360043", "0.5527785", "0.5520776", "0.55097693", "0.544129", "0.54369116", "0.54209816", "0.54209816", "0.53902346", "0.53722125", "0.53374...
0.6149093
1
Lowest Ask Returns the Lowest Ask Rate in Json. The Amount is in Paisa. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response.
def v1exchangeasklow(self, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.v1exchangeasklow_with_http_info(**kwargs) else: (data) = self.v1exchangeasklow_with_http_info(**kwargs) return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_lowest_ask(self):\n orders = self.returnOrderBook(1)\n return orders[\"asks\"][0]", "def lowest_ask(self):\n (price_eur, volume, _) = self._order_book['asks'][0]\n price_usd = Decimal(price_eur) * self._eurusd_rate\n return {\n 'price': Decimal(price_usd)...
[ "0.7291597", "0.707484", "0.57054144", "0.5693149", "0.5669552", "0.5547174", "0.5547174", "0.55139256", "0.55139256", "0.55091864", "0.55021185", "0.5501173", "0.54356915", "0.5401512", "0.53999656", "0.5399132", "0.5387671", "0.538228", "0.538228", "0.538228", "0.538228", ...
0.60127336
2
Lowest Ask Returns the Lowest Ask Rate in Json. The Amount is in Paisa. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response.
def v1exchangeasklow_with_http_info(self, **kwargs): all_params = ['accept'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_lowest_ask(self):\n orders = self.returnOrderBook(1)\n return orders[\"asks\"][0]", "def lowest_ask(self):\n (price_eur, volume, _) = self._order_book['asks'][0]\n price_usd = Decimal(price_eur) * self._eurusd_rate\n return {\n 'price': Decimal(price_usd)...
[ "0.72919744", "0.70755905", "0.6010231", "0.57045907", "0.56966394", "0.5671335", "0.5550525", "0.5550525", "0.55170745", "0.55170745", "0.55130583", "0.55036193", "0.5502919", "0.543981", "0.54031587", "0.5400881", "0.5390021", "0.53856045", "0.53856045", "0.53856045", "0.53...
0.5398907
16
Min 24 Hour Rate Returns the lowest rate over the last 24 hours with the 10 minutely difference. The values are in paisa. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response.
def v1exchangemin24_hr(self, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.v1exchangemin24_hr_with_http_info(**kwargs) else: (data) = self.v1exchangemin24_hr_with_http_info(**kwargs) return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def v1exchangemin24_hr_with_http_info(self, **kwargs):\n\n all_params = ['accept']\n all_params.append('callback')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n\n params = locals()\n f...
[ "0.5950892", "0.52588356", "0.5203574", "0.51758295", "0.51504904", "0.5082386", "0.508152", "0.50483316", "0.49034727", "0.46979052", "0.46444127", "0.4617143", "0.4543994", "0.45430392", "0.45430392", "0.4537564", "0.45269248", "0.45220023", "0.45220023", "0.44928655", "0.4...
0.53895366
1
Min 24 Hour Rate Returns the lowest rate over the last 24 hours with the 10 minutely difference. The values are in paisa. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response.
def v1exchangemin24_hr_with_http_info(self, **kwargs): all_params = ['accept'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def v1exchangemin24_hr(self, **kwargs):\n kwargs['_return_http_data_only'] = True\n if kwargs.get('callback'):\n return self.v1exchangemin24_hr_with_http_info(**kwargs)\n else:\n (data) = self.v1exchangemin24_hr_with_http_info(**kwargs)\n return data", "def M...
[ "0.5389434", "0.52559614", "0.520328", "0.5174744", "0.51496387", "0.5081443", "0.50801736", "0.50484294", "0.49041256", "0.469695", "0.4644877", "0.46177703", "0.45443833", "0.45423394", "0.45423394", "0.45373616", "0.45265964", "0.45210353", "0.45210353", "0.4494272", "0.44...
0.59497434
0
Initialize the Resnet block A resnet block is a conv block with skip connections We construct a conv block with build_conv_block function, and implement skip connections in function.
def __init__(self, dim, padding_type, norm_layer, use_dropout, use_bias, last=False): super(ResnetBlock, self).__init__() self.conv_block = self.build_conv_block(dim, padding_type, norm_layer, use_dropout, use_bias, last)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, dim, padding_type, norm_layer, use_dropout, use_bias):\r\n super(ResnetBlock, self).__init__()\r\n self.conv_block = self.build_conv_block(dim, padding_type, norm_layer, use_dropout, use_bias)", "def __init__(self, dim, padding_type, norm_layer, use_dropout, use_bias):\n s...
[ "0.7650301", "0.76019293", "0.76019293", "0.6529652", "0.63241935", "0.62781745", "0.62737346", "0.6171611", "0.6155827", "0.6148659", "0.61460924", "0.61289954", "0.6043638", "0.6029992", "0.5984177", "0.59725165", "0.5970178", "0.59340334", "0.59286463", "0.5925233", "0.592...
0.7466808
3
a new feature of v1.1 creates an HMAC hash from a given endpoint the endpoint needs to already be formatted with all its necessary arguments already urlencoded
def _gen_api_sig(self, endpoint: str) -> str: return hmac.new(self._api_secret.encode(), endpoint.encode(), hashlib.sha512).hexdigest()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_hmac(self, secret: str, input: float) -> str:\n\n input_str = repr(input).encode(\"ascii\")\n input_hash = hashlib.sha1(secret + input_str).hexdigest().encode(\"ascii\")\n return hashlib.sha1(secret + input_hash).hexdigest()", "def auth_request_as_hmac(relative_url: str, params: d...
[ "0.68590856", "0.6692824", "0.6406161", "0.6367905", "0.6340287", "0.63096505", "0.63020027", "0.62555385", "0.6252444", "0.6243512", "0.62080085", "0.61847943", "0.61543417", "0.61503524", "0.6057553", "0.597215", "0.59667194", "0.59667194", "0.59667194", "0.59667194", "0.59...
0.74860305
0
Return a formatted date time.
def time_stamp(): today = datetime.datetime.now() return today.strftime("%Y-%m-%d %a %H:%M")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFormattedDate(self, dt):\n if DATE_FORMAT_STRING == '':\n return time.strftime('%Y-%m-%d %H:%M:%S', dt.timetuple())\n else:\n return time.strftime(DATE_FORMAT_STRING, dt.timetuple())", "def get_time_date(self):\n return time.strftime(\"%m-%d-%Y %H:%M\")", "def ...
[ "0.79114026", "0.78955597", "0.7859908", "0.7852963", "0.77128", "0.76887155", "0.7611864", "0.7603578", "0.74432683", "0.7435938", "0.7391644", "0.73721564", "0.7315903", "0.72575533", "0.7205047", "0.7164852", "0.7160862", "0.7156588", "0.71539867", "0.71378267", "0.7130451...
0.66337883
78
Test TypeError is raised when exog is not a pandas Series or DataFrame.
def test_exog_to_direct_TypeError_when_exog_not_pandas_series_or_dataframe(): exog = np.arange(7) err_msg = re.escape(f"`exog` must be a pandas Series or DataFrame. Got {type(exog)}.") with pytest.raises(TypeError, match = err_msg): exog_to_direct(exog=exog, steps=2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_non_pd_type_error(self):\n\n df = d.create_df_1()\n\n x = BaseTransformer(columns=\"a\")\n\n with pytest.raises(ValueError):\n\n x.fit(X=df, y=[1, 2, 3, 4, 5, 6])", "def test_non_pd_type_error(self):\n\n x = BaseTransformer(columns=\"a\")\n\n with pytest.rai...
[ "0.74132186", "0.7396781", "0.68800366", "0.6879349", "0.670547", "0.6659578", "0.65584236", "0.6534613", "0.646168", "0.642465", "0.63928187", "0.6389023", "0.6385688", "0.6377185", "0.6338939", "0.63383865", "0.6336522", "0.6334895", "0.63044286", "0.6295376", "0.62908083",...
0.84111255
0
Creates a copy of the model fitter, overridding any argument that is not None. Preserves the userspecified settings and the results of bootstrapping.
def copy(self, isKeepLogger=False, isKeepOptimizer=False, **kwargs): def setValues(names): """ Sets the value for a list of names. Parameters ---------- names: list-str Returns ------- list...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new(self, **kwargs):\n return self.__model__(**self._preprocess_params(kwargs))", "def __init__(self, params, config=None):\n super(NizzaModel, self).__init__(\n model_fn=self.nizza_model_fn, \n params=params, \n config=config)", "def bootstrap(self, working_dir):\n estima...
[ "0.57812816", "0.5774646", "0.5658763", "0.5576243", "0.5534109", "0.54914385", "0.54298383", "0.5429835", "0.5429239", "0.5414275", "0.54099876", "0.54097545", "0.5395008", "0.53761834", "0.5374005", "0.5373915", "0.5373451", "0.53631645", "0.53474385", "0.5324586", "0.53222...
0.5029786
98
Create placeholders for input
def __create_placeholders(self): with tf.name_scope("data"): self.x = tf.placeholder(tf.float32, [self.batch_size, self.input_dim], 'x')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_placeholders(self):\n raise NotImplementedError", "def placeholders(self):\n x = [i.placeholder for i in self._input_desc]\n return x[0] if len(x) == 1 else x", "def build_user_input(self):\n pass", "def register_input(self, arg_):\n self.input_placeholder_ids +...
[ "0.7259612", "0.6739133", "0.64976764", "0.6360326", "0.6353619", "0.62647545", "0.6070418", "0.60123986", "0.597949", "0.5841627", "0.57708603", "0.5761368", "0.5760165", "0.5755568", "0.56396645", "0.5621236", "0.5585077", "0.55457866", "0.5535374", "0.5493838", "0.54808515...
0.52098686
50
Close the connection to the database. It currently does nothing.
def close(cls): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_database(self):\n if self._conn is not None:\n self._conn.close()\n self._conn = None", "def close_db_connection(cls):\n db.close()", "def close(self):\n if self._conn is not None:\n self._close_database()", "def close(self):\n if self._d...
[ "0.8753956", "0.8683274", "0.8546844", "0.84627205", "0.8409828", "0.84034306", "0.83702594", "0.83411944", "0.8255686", "0.8213114", "0.817787", "0.817787", "0.817787", "0.81633174", "0.81599313", "0.8159321", "0.8132708", "0.8098185", "0.80773926", "0.8005812", "0.8004499",...
0.0
-1
return a GML representation of the feature as a string
def toGML(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _linked_feature_label(linked_feature):\n\treturn \"\"\"<\n <B>{name}</B><BR />\n F={num_features} D={projected_dim}<BR />\n {fml}<BR />\n <U>{source_translator}</U><BR />\n <I>{source_layer}</I>\n >\"\"\".format(\n\t\tname=linked_feature.name, num_features=linked_feature.size, projected_dim=linked_featur...
[ "0.6639931", "0.65453666", "0.6418131", "0.6410936", "0.6380465", "0.63034683", "0.62450576", "0.6222809", "0.6198387", "0.61509037", "0.60903376", "0.6084359", "0.60688686", "0.6033667", "0.601372", "0.5997713", "0.59350884", "0.5929988", "0.59264886", "0.59237534", "0.59065...
0.6794014
0
Creates a grid consisting of pairs of columns, where the first column in each pair contains images source images and the second column in each pair contains images generated by the CycleGAN from the corresponding images in the first column.
def merge_images(sources, targets, opts, k=10): _, _, h, w = sources.shape row = int(np.sqrt(opts.batch_size)) merged = np.zeros([3, row*h, row*w*2]) for idx, (s, t) in enumerate(zip(sources, targets)): i = idx // row j = idx % row merged[:, i*h:(i+1)*h, (j*2)*h:(j*2+1)*h] = s ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grid_image(output):\n grid = []\n for data in output:\n grid += [make_grid(data, nrow=5, normalize=True)]\n return grid", "def generate_image_grid(sess, df, filenames,op, op2):\n #x_points = np.arange(0, 1, 1.5).astype(np.float32)\n #y_points = np.arange(0, 1, 1.5).astype(np.float32)\n\...
[ "0.6939934", "0.6737551", "0.67261696", "0.65113366", "0.6475628", "0.63411963", "0.6204131", "0.6199426", "0.6181086", "0.6095413", "0.6093281", "0.60611993", "0.5936547", "0.5912302", "0.589062", "0.5871619", "0.5806349", "0.5790446", "0.57723725", "0.57450706", "0.57393676...
0.0
-1
Return the array indices corresponding to the testing data based on the supplied parameters.
def testing_index(self, dt_plus=None, dt_minus=0.): assert dt_minus >= 0., "dt_minus must be positive" bottom = self.cutoff_t + dt_minus if dt_plus: assert dt_plus >= 0., "dt_plus must be positive" # ind = (self.t > bottom) & (self.t <= (self.cutoff_t + dt_plus)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_indexes(self, dataset: BaseDataset) -> int:\n\n index = [np.random.randint(0, len(dataset)) for _ in range(1)]\n\n return index", "def _iter_test_indices(self, X=None, y=None, groups=None):\n raise NotImplementedError", "def _get_indexes(self, participants):\n tr_idx = int(n...
[ "0.66128397", "0.6519496", "0.64890563", "0.6451042", "0.6426351", "0.6270527", "0.6181768", "0.61560994", "0.61345905", "0.6113762", "0.61053455", "0.6068312", "0.6018385", "0.5914432", "0.58626246", "0.5850154", "0.58470434", "0.58300394", "0.5813507", "0.58051014", "0.5796...
0.0
-1
Test setUp decorator to add fixture reloading.
def test_setup(funct): def decorated_setup(): """Decorated test setup.""" testdb.reload_db() funct() return decorated_setup
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUpFixture(self):\n pass", "def _fixture_setup(self):\n pass", "def add_fixtures(ctest):\n\n def test_setup(funct):\n \"\"\"Test setUp decorator to add fixture reloading.\"\"\"\n\n def decorated_setup():\n \"\"\"Decorated test setu...
[ "0.7940377", "0.77695286", "0.7568991", "0.7439672", "0.73701257", "0.7100149", "0.70817244", "0.7026126", "0.70040166", "0.6977081", "0.69602406", "0.69602406", "0.69602406", "0.69602406", "0.69602406", "0.69602406", "0.69602406", "0.69602406", "0.69602406", "0.69602406", "0...
0.7059128
7
Compute the aspect ratio of all gts.
def AspectRatio(gt_rbboxes): pt1, pt2, pt3, pt4 = gt_rbboxes[..., :8].chunk(4, 1) edge1 = torch.sqrt( torch.pow(pt1[..., 0] - pt2[..., 0], 2) + torch.pow(pt1[..., 1] - pt2[..., 1], 2)) edge2 = torch.sqrt( torch.pow(pt2[..., 0] - pt3[..., 0], 2) + torch.pow(pt2[..., 1] - pt3[....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aspectRatios(self):\n return np.array([f.aspectRatio() for f in self])", "def aspectRatio(self):\n self._updateExtents()\n return self.mAspectRatio", "def aspect_ratio(self) -> float:\n return self._aspect_ratio", "def image_aspect_ratio(self, index):\n\t\tbbox \t= self.annota...
[ "0.68344736", "0.66984564", "0.6673546", "0.65892833", "0.65418345", "0.64346206", "0.6316812", "0.6218754", "0.62172836", "0.61066794", "0.5918649", "0.58777994", "0.5874747", "0.5874747", "0.5858977", "0.5700441", "0.5614964", "0.55867004", "0.5568379", "0.55642307", "0.553...
0.65043133
5
Check if the current process is the last process (rank is world size 1). It can accept a sub process group to check the last rank with respect to the process.
def is_last_process(self, process_group: ProcessGroup = None) -> bool: rank = dist.get_rank(group=process_group) world_size = dist.get_world_size(group=process_group) return rank == world_size - 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_group(self):\n return BaseLayer.groups-1", "def is_last(self) -> Optional[bool]:\n return pulumi.get(self, \"is_last\")", "def is_last(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"is_last\")", "def is_master(self, process_group: ProcessGroup = None) -> bool...
[ "0.57895625", "0.57473147", "0.5722725", "0.57058805", "0.5624445", "0.56114054", "0.5580098", "0.5385393", "0.5380359", "0.5379081", "0.53159815", "0.5282526", "0.5213764", "0.51966006", "0.51273006", "0.5117031", "0.5105424", "0.5094255", "0.50268096", "0.5012383", "0.49857...
0.8058162
0
Constructor It initializes the utility classes that captures and saves layeroutputs
def __init__(self, model: onnx_pb.ModelProto, dir_path: str): self.model = model # Utility to capture layer-outputs self.layer_output = LayerOutput(model=model, dir_path=dir_path) # Utility to save model inputs and their corresponding layer-outputs self.save_input_output = Save...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.layer_scope = None\n self.out = None", "def __init__(self, layers):\n\n\t\tself.layers = layers", "def __init__(self, input, output):\n # init classes\n self.input = input\n self.output = output", "def __init__(self, **kwargs):\n base.Layer...
[ "0.7334955", "0.70054275", "0.67603105", "0.67411584", "0.65204734", "0.6475604", "0.6415885", "0.64007795", "0.63812536", "0.6335571", "0.6298726", "0.62755126", "0.62705165", "0.62649256", "0.62619483", "0.62565875", "0.6255602", "0.62547106", "0.62489516", "0.6241967", "0....
0.6342871
9
Constructor It initializes few lists that are required for capturing and naming layeroutputs.
def __init__(self, model: onnx_pb.ModelProto, dir_path: str): self.model = copy.deepcopy(model) self.activation_names = LayerOutput.get_activation_names(self.model) quantized_activation_names = [name for name in self.activation_names if name.endswith('_updated')] if quantized_activation...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.layer_scope = None\n self.out = None", "def __init__(self, layers):\n\n\t\tself.layers = layers", "def __init__(self, **kwargs):\n base.Layer.__init__(self, **kwargs)\n self._num_output = self.spec.get('num_output', 0)\n if self._num_output <= 0:\n ...
[ "0.7173162", "0.7062952", "0.69797623", "0.6808247", "0.6777871", "0.66511655", "0.6639475", "0.6631878", "0.65181583", "0.6486179", "0.6486179", "0.6486179", "0.64743", "0.6462163", "0.64485484", "0.64340496", "0.6429751", "0.6383079", "0.6382053", "0.6365204", "0.63622814",...
0.0
-1
This function fetches the activation names (layeroutput names) of the given onnx model.
def get_activation_names(model: onnx_pb.ModelProto) -> List[str]: activation_names = get_graph_intermediate_activations(model.graph) activation_names.extend([node.name for node in model.graph.output]) return activation_names
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_layer_activations(network, y_in):\r\n extractor=get_layer_activation_extractor(network)\r\n layer_features = extractor(y_in)\r\n return(layer_features)", "def getOutputsNames(net):\r\n # Get the names of all the layers in the network\r\n layersNames = net.getLayerNames()\r\n # Get the names o...
[ "0.6536636", "0.6367588", "0.6359682", "0.62395877", "0.62272286", "0.61097807", "0.58588034", "0.5854507", "0.57746017", "0.5752854", "0.5744422", "0.5729552", "0.56711596", "0.5660362", "0.5621908", "0.56108373", "0.56011987", "0.55855787", "0.5578671", "0.55440587", "0.554...
0.82280034
0
Returns the start and end position of the first match of regex.
def get_regex_position(self, regex) -> Tuple[int, int]: match: Optional[Match[str]] = re.search(regex, self.to_text()) if match: return match.span() return 0, 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def re_search(pattern, text: str, start_indx: int = 0) -> Optional[int]:\n # \n match = pattern.search(text, start_indx)\n if match is not None:\n indx = match.start()\n else:\n indx = None\n return indx", "def get_pos(data, regex, cur, ignore_cur=False, count=0):\n # List of the ...
[ "0.7118286", "0.6580749", "0.64482737", "0.6231231", "0.62295765", "0.622431", "0.6152438", "0.61437184", "0.60586166", "0.6020938", "0.60147506", "0.60133374", "0.5959284", "0.5956716", "0.59542525", "0.5937631", "0.5915262", "0.5899717", "0.5892897", "0.58900905", "0.583244...
0.79071736
0
Get start and end position of the word in the report.
def get_word_postion(self, word: Word) -> Tuple[int, int]: text: str = self.to_text() words: List[Word] = self.get_words() current_position: int = 0 for w in words: current_position = text.find(w.text, current_position) if w == word: return (curr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_offsets(word, raw_text):\n try:\n match = re.search(word, raw_text)\n return (match.start(), match.end())\n except AttributeError: #could not find word\n return (0, 0)", "def get_words_position(self, words: List[Word]) -> Tuple[int, int]:\n start: int = self.get_word_pos...
[ "0.7596718", "0.7247073", "0.67280245", "0.65044403", "0.64823365", "0.6480464", "0.6442303", "0.6409912", "0.6394689", "0.63008124", "0.62935126", "0.6260184", "0.62390274", "0.62320733", "0.61957216", "0.6189579", "0.60937995", "0.6078251", "0.60654545", "0.60631096", "0.60...
0.66718996
3
Asks user to specify a city, month, and day to analyze.
def get_filters(): print('Hello! Let\'s explore some US bikeshare data!') # get user input for city (chicago, new york city, washington). HINT: Use a while loop to handle invalid inputs city = '' while city != 'all' and city != 'chicago' and city != 'new york city' and city != 'washington': city...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Raw_Data(city,month,day):\n print(\"The city you have entered is: \",city)\n print(\"The month you have entered is: \",month)\n print(\"The day you have entered is: \",day)", "def get_filters():\n city = None\n month = None\n day = None\n while day == None:\n # TO DO: get user input f...
[ "0.66714007", "0.65354675", "0.64593667", "0.6374057", "0.6348314", "0.63097656", "0.62868035", "0.6259136", "0.62316", "0.62130964", "0.62050414", "0.6181105", "0.6171822", "0.61686903", "0.6158568", "0.61582303", "0.61532456", "0.61444426", "0.6131269", "0.610484", "0.61025...
0.57194877
88
Loads data for the specified city and filters by month and day if applicable.
def load_data(city, month, day): if city == 'all': df = pd.read_csv(CITY_DATA['chicago']) df['city'] = 'chicago' ny = pd.read_csv(CITY_DATA['new york city']) ny['city'] = 'new york city' df = df.append(ny,sort = True) wa = pd.read_csv(CITY_DATA['washington']) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data(city, month, day):\n df = pd.read_csv(CITY_DATA [city])\n \n # convert the Start Time column to datetime\n df['Start Time'] = pd.to_datetime(df['Start Time'])\n \n # extract month and day of week from Start Time to create new columns\n df['month'] = df['Start Time'].dt.month\n ...
[ "0.8133254", "0.8109751", "0.8046614", "0.804365", "0.8009928", "0.8008326", "0.8000499", "0.7999591", "0.79899186", "0.7980696", "0.7974759", "0.7962582", "0.795736", "0.7948513", "0.7947427", "0.79095644", "0.7909091", "0.7905773", "0.7902028", "0.7894143", "0.7890243", "...
0.0
-1
Displays statistics on the most frequent times of travel.
def time_stats(df): print('\nCalculating The Most Frequent Times of Travel...\n') start_time = time.time() # display the most common month most_common_month = df['month'].mode()[0] print('The most common month is: {}'.format(str(most_common_month))) # display the most common day of week m...
{ "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.80247396", "0.80233026", "0.7915788", "0.78266186", "0.7822246", "0.78143597", "0.77659196", "0.7740343", "0.773628", "0.77344066", "0.76867086", "0.7668633", "0.7651731", "0.7644636", "0.76399267", "0.76367253", "0.7625196", "0.7623158", "0.7612803", "0.76002145", "0.7583...
0.7541971
26
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 most_common_start_station = df['Start Station'].mode()[0] print('The most start station is: {}'.format(most_common_start_station)) # displa...
{ "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.7815675", "0.7662213", "0.7553417", "0.74914914", "0.74748665", "0.7446617", "0.7428588", "0.74237514", "0.74177027", "0.7400495", "0.7387161", "0.7385634", "0.73647535", "0.735934", "0.73566747", "0.73548365", "0.7351854", "0.7351274", "0.735057", "0.73421645", "0.7340198...
0.71269757
61
Displays statistics on the total and average trip duration.
def trip_duration_stats(df): print('\nCalculating Trip Duration...\n') start_time = time.time() df['trip_duration'] = (df['End Time'] - df['Start Time']) # display total travel time total_travel_time = df['trip_duration'].sum() print('The total travel time is: {}'.format(str(total_travel_time...
{ "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.814274", "0.8025143", "0.80041367", "0.79496753", "0.7937415", "0.79312176", "0.7926815", "0.7915187", "0.79142886", "0.7908032", "0.79055744", "0.7900715", "0.7891682", "0.78894734", "0.7886722", "0.78851086", "0.7884266", "0.7882474", "0.78738385", "0.78686154", "0.78664...
0.76188046
84
Send an invalid course ID instead of "org.0/course_0/Run_0" when saving, and verify that it fails.
def test_save_invalid_course_id(self): data = { 'user': str(self.course_enrollment.user.id), 'course': 'invalid-course-id', 'is_active': 'true', 'mode': self.course_enrollment.mode, } with override_waffle_switch(COURSE_ENROLLMENT_ADMIN_SWITCH, act...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_course_id(self):\r\n cleaned_id = self.cleaned_data[\"course_id\"]\r\n try:\r\n course_key = CourseKey.from_string(cleaned_id)\r\n except InvalidKeyError:\r\n try:\r\n course_key = SlashSeparatedCourseKey.from_deprecated_string(cleaned_id)\r\n ...
[ "0.73413545", "0.7080848", "0.70122254", "0.69959325", "0.6867179", "0.68383527", "0.65980333", "0.6594696", "0.65730757", "0.65299135", "0.64558995", "0.643873", "0.6424638", "0.6403408", "0.6365974", "0.632279", "0.6321768", "0.6314552", "0.6311981", "0.6309528", "0.6289711...
0.7681787
0
Test form with email which has wrong email domain.
def test_form_with_invalid_domain_name(self): self._update_site_configuration() error, _ = self._assert_form(self.site, self.email_with_wrong_domain) assert error == f"Email doesn't have {self.email_domain_name} domain name."
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_form_with_invalid_user(self):\n self._update_site_configuration()\n error, _ = self._assert_form(self.site, self.other_valid_email)\n assert error == \"User with this email doesn't exist in system.\"", "def test_email_form(self):\r\n dummy_email = 'dummy@d.c'\r\n main_...
[ "0.747352", "0.73565996", "0.73424137", "0.7173431", "0.7008049", "0.69132674", "0.6809247", "0.67958283", "0.67847425", "0.6776309", "0.67761075", "0.67631215", "0.6726696", "0.6713313", "0.66649115", "0.66367126", "0.66023934", "0.65918946", "0.65517926", "0.65299684", "0.6...
0.81302154
0
Test form with an email which is not associated with any user.
def test_form_with_invalid_user(self): self._update_site_configuration() error, _ = self._assert_form(self.site, self.other_valid_email) assert error == "User with this email doesn't exist in system."
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_email_form(self):\r\n dummy_email = 'dummy@d.c'\r\n main_page = DogMainPage(self.driver)\r\n main_page.populate_email(dummy_email)\r\n self.assertEqual(dummy_email, main_page.get_value_email(), 'Expected conditions failed.')", "def test_no_email(self):\n user = self.ma...
[ "0.7377144", "0.70650125", "0.70256156", "0.6887421", "0.684861", "0.68154967", "0.6805348", "0.6755651", "0.67241293", "0.6645018", "0.66206586", "0.6611209", "0.6607743", "0.657267", "0.65535164", "0.650603", "0.64972967", "0.64920866", "0.647534", "0.64314866", "0.64239365...
0.7589811
0
Get the value of the indexth node in the linked list. If the index is invalid, return 1.
def get(self, index): cur = self.head i = 0 while i < index and cur: cur = cur.nxt i+=1 # self.display("get , fetching the value at index "+str(index)) if cur: print("found value %d" %cur.val) return cur.val else...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, index: int) -> int:\n node = self.get_node(index)\n if node:\n return node.val\n else:\n return -1", "def get(self, index: int) -> int:\n cnt = 0\n cur = self.head \n while cur != None:\n if(cnt == index):\n r...
[ "0.8309071", "0.8223403", "0.81012017", "0.79819065", "0.7971722", "0.79658747", "0.7951939", "0.79492354", "0.79279983", "0.7905674", "0.7799605", "0.7734565", "0.77311933", "0.76516724", "0.758455", "0.7507213", "0.74742204", "0.7386918", "0.7386918", "0.7384269", "0.733699...
0.7455023
17
Add a node of value val before the first element of the linked list. After the insertion, the new node will be the first node of the linked list.
def addAtHead(self, val): tmp = Node(val) tmp.nxt = self.head self.head = tmp if not self.tail: self.tail = self.head
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self, val):\n new_node = Node(val)\n new_node.next = self.head\n self.head = new_node", "def addAtHead(self, val):\n node = ListNode(val)\n if self.head == None:\n self.head = node\n else:\n node.next = self.head\n self.head = ...
[ "0.7888693", "0.7811856", "0.7666559", "0.7633319", "0.7595646", "0.758606", "0.75703543", "0.75016534", "0.7493103", "0.74779594", "0.74625516", "0.7428768", "0.7407754", "0.7381638", "0.73484814", "0.73484814", "0.72836316", "0.7247032", "0.72358435", "0.71726114", "0.71457...
0.7714778
2
Append a node of value val to the last element of the linked list.
def addAtTail(self, val): tmp = Node(val) if self.tail: self.tail.nxt = tmp k = self.tail self.tail = tmp else: self.head = tmp self.tail = tmp k = tmp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append(self, val):\n inserted_node = DblNode(val, previous_node=self.tail)\n self.tail.next_node = inserted_node\n self.tail = inserted_node", "def addAtTail(self, val):\n if self.head is None:\n self.addAtHead(val)\n else:\n new_node = Node(val)\n ...
[ "0.80130863", "0.79794717", "0.78928936", "0.7879162", "0.7879162", "0.7782996", "0.7744707", "0.77368987", "0.7721728", "0.76904315", "0.7632201", "0.76267153", "0.7550089", "0.7530205", "0.7521708", "0.74483246", "0.7416057", "0.73196465", "0.72394246", "0.7223336", "0.7216...
0.7856019
5
Add a node of value val before the indexth node in the linked list. If index equals to the length of linked list, the node will be appended to the end of linked list. If index is greater than the length, the node will not be inserted.
def addAtIndex(self, index, val): if index > 0 and not self.head: return tmp = Node(val) if index == 0 and not self.head: self.head = tmp self.tail = self.head return if index == 0 and self.head: tmp.nxt = self.head ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addAtIndex(self, index, val):\n if index < 0:\n new_node = ListNode(val)\n new_node.next = self.head\n self.head = new_node\n\n if index <= self.length:\n prev = None\n curr = self.head\n for i in range(1, index + 1):\n ...
[ "0.8006054", "0.7842535", "0.7801831", "0.77572143", "0.7742919", "0.7742469", "0.7730488", "0.7709319", "0.76185584", "0.7613067", "0.7613067", "0.7597048", "0.75025475", "0.7281727", "0.7211141", "0.71554494", "0.709006", "0.70246476", "0.70239407", "0.7018553", "0.6930896"...
0.7905112
1
Tests whether a new profile object is created on registration
def test_create_profile(self): resp = self.client.post(self.register_url, self.user, format="json") current_users = User.objects.count() self.assertEqual(resp.status_code, status.HTTP_201_CREATED) self.assertEqual(User.objects.count(), current_users) self.assertEqual(Profile.obje...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_is_instance(self):\n self.assertTrue(isinstance(self.new_user.profile, Profile))", "def test_user_profile_created(self):\n\t\tself.assertTrue(\n\t\t\thasattr(self.user, 'profile'),\n\t\t\t\"User profile does not exist.\"\n\t\t)\n\n\t\tself.assertTrue(\n\t\t\tisinstance(self.user.profile, UserProf...
[ "0.7427131", "0.7259844", "0.7220055", "0.7176402", "0.70967805", "0.70422864", "0.6943376", "0.6907736", "0.68919605", "0.6832839", "0.6811152", "0.66722745", "0.66612417", "0.66529256", "0.6623067", "0.6620948", "0.66026974", "0.6553103", "0.65314406", "0.6523362", "0.64953...
0.7068258
5
Create a new dataset.
def create(self, name=None, description=None): uri = URITemplate(self.baseuri + '/{owner}').expand( owner=self.username) return self.session.post(uri, json=self._attribs(name, description))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_dataset():\n\n dataset_id = \"{}.airflow\".format(client.project)\n dataset = bigquery.Dataset(dataset_id)\n dataset.location = \"US\"\n dataset = client.create_dataset(dataset, exists_ok=True)\n print(\"Created dataset {}.{}\".format(client.project, dataset.dataset_id))\n return datas...
[ "0.7704742", "0.76188034", "0.7503104", "0.7499535", "0.74934757", "0.74894565", "0.7456105", "0.7451268", "0.7431409", "0.7327347", "0.73260087", "0.7275244", "0.72527486", "0.72508687", "0.7238621", "0.72041047", "0.72005194", "0.71947813", "0.71559924", "0.70869136", "0.70...
0.0
-1
Update the name and description of a dataset.
def update_dataset(self, dataset, name=None, description=None): uri = URITemplate(self.baseuri + '/{owner}/{id}').expand( owner=self.username, id=dataset) return self.session.patch(uri, json=self._attribs(name, description))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_description(self, data):\n self._description = self._uni(data)", "def update(self, name, cache_dir=None, data_dir=None, tasks=None):\n assert name, \"Must input a valid dataset name.\"\n self.manager.update_data(name, cache_dir, data_dir, tasks)", "def update_data(self, name, cache...
[ "0.6498981", "0.64028114", "0.63239783", "0.6292552", "0.6279751", "0.6207128", "0.61882645", "0.606425", "0.60536134", "0.6048151", "0.60215545", "0.59957004", "0.5916959", "0.5908523", "0.5890152", "0.587291", "0.58666486", "0.58638996", "0.5861304", "0.5839068", "0.5825919...
0.7594766
0
Get features of a dataset.
def list_features(self, dataset, reverse=False, start=None, limit=None): uri = URITemplate(self.baseuri + '/{owner}/{id}/features').expand( owner=self.username, id=dataset) params = {} if reverse: params['reverse'] = 'true' if start: params['start'] =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(dataset):\n handle = dataset.open()\n data = dataset.get_data(handle, slice(0, dataset.num_examples))\n features = data[0]\n targets = data[1]\n dataset.close(handle)\n\n return features, targets", "def extractFeatures(self, datum):\n abstract", "def get_dataset_features(t...
[ "0.70921665", "0.7030363", "0.68858427", "0.6808652", "0.6681798", "0.66383743", "0.6561492", "0.6558764", "0.6551736", "0.653365", "0.6532745", "0.6530758", "0.6517447", "0.64586323", "0.6449786", "0.6437327", "0.6349487", "0.6344743", "0.63261443", "0.63098735", "0.62979823...
0.72489923
0
Create or update a dataset feature.
def update_feature(self, dataset, fid, feature): uri = URITemplate( self.baseuri + '/{owner}/{did}/features/{fid}').expand( owner=self.username, did=dataset, fid=fid) return self.session.put(uri, json=feature)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(self, new_feature):\n\n all_data = self._load()\n\n if self.id_field not in new_feature and\\\n self.id_field not in new_feature['properties']:\n new_feature['properties'][self.id_field] = str(uuid.uuid4())\n\n all_data['features'].append(new_feature)\n\n ...
[ "0.66059583", "0.6592549", "0.6541474", "0.6518502", "0.6424882", "0.63817", "0.6240326", "0.62133896", "0.6193617", "0.6043589", "0.60413086", "0.59617126", "0.59189945", "0.59066063", "0.5855307", "0.58257324", "0.5773833", "0.5759742", "0.5668785", "0.5659901", "0.5659901"...
0.7078828
0
Builds the data loader objects for retrieving images from a specific directory
def get_data_loaders(img_dir, img_height, img_width, batch_size=8): total_count = sum([len(files) for r, d, files in os.walk(img_dir)]) data_transform = torchvision.transforms.Compose( [ transforms.Resize((img_height, img_width)), transforms.ToTensor(), transforms.No...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data_loader(image_type, image_dir, \n image_size=128, batch_size=16, num_workers=0):\n \n # resize and normalize the images\n transform = transforms.Compose([transforms.Resize(image_size), # resize to 128x128\n transforms.ToTensor()])\n\n # ...
[ "0.7200583", "0.71684796", "0.7125484", "0.7043964", "0.7029134", "0.695073", "0.6937365", "0.6879694", "0.6818884", "0.6772821", "0.67585385", "0.6699127", "0.6699024", "0.6551313", "0.65314054", "0.65236896", "0.6497367", "0.64924127", "0.64783037", "0.64640754", "0.6461713...
0.7210832
0
Generate presigned url for each part
def generate_aws_presigned_url_for_part(key, uploadId, partNumber, expires_in): try: bucket = flask.current_app.config["DATA_UPLOAD_BUCKET"] except KeyError: raise InternalError( "fence not configured with data upload bucket; can't create signed URL" )...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def presigned_url():\n return 'https://presignedurl.test.com'", "def generate_presigned_url(ClientMethod=None, Params=None, ExpiresIn=None, HttpMethod=None):\n pass", "def generate_presigned_url(ClientMethod=None, Params=None, ExpiresIn=None, HttpMethod=None):\n pass", "def generate_presigned_url(Cl...
[ "0.74483395", "0.734923", "0.734923", "0.734923", "0.734923", "0.734923", "0.734923", "0.734923", "0.734923", "0.734923", "0.734923", "0.734923", "0.734923", "0.734923", "0.734923", "0.734923", "0.734923", "0.734923", "0.7012834", "0.69818753", "0.69818753", "0.69818753", ...
0.7039549
18
Generate presigned url for uploading object part given uploadId and part number
def generate_presigned_url_for_part_upload(self, uploadId, partNumber, expires_in): aws_creds = get_value( config, "AWS_CREDENTIALS", InternalError("credentials not configured") ) credential = S3IndexedFileLocation.get_credential_to_access_bucket( self.bucket_name(), aws_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_aws_presigned_url_for_part(key, uploadId, partNumber, expires_in):\n try:\n bucket = flask.current_app.config[\"DATA_UPLOAD_BUCKET\"]\n except KeyError:\n raise InternalError(\n \"fence not configured with data upload bucket; can't create signed URL\"...
[ "0.83486396", "0.7364068", "0.69146067", "0.66105473", "0.6343888", "0.62641245", "0.62545305", "0.6249648", "0.62076324", "0.62076324", "0.62076324", "0.62076324", "0.62076324", "0.62076324", "0.62076324", "0.62076324", "0.62076324", "0.62076324", "0.62076324", "0.62076324", ...
0.8304759
1
Generate an Azure Blob Storage SAS URL
def _generate_azure_blob_storage_sas( self, container_name, blob_name, expires_in, azure_creds, permission, ): blob_service_client = BlobServiceClient.from_connection_string(azure_creds) converted_url = self._get_converted_url() # if the stor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_blob_sas_url():\r\n\r\n from azure.storage.blob import BlockBlobService, ContainerPermissions\r\n #new file name\r\n blob_name='configfile'\r\n accountkey=list_keys()\r\n #from azure.keyvault import SecretId\r\n\r\n # create the blob sas definition template\r\n # the sas template uri ...
[ "0.8085095", "0.78231376", "0.7281599", "0.67227453", "0.656756", "0.6305779", "0.6184361", "0.5808634", "0.5736069", "0.5674862", "0.56722736", "0.56289905", "0.56197107", "0.5489611", "0.5416446", "0.5416446", "0.5416446", "0.54076993", "0.53044415", "0.5295746", "0.5266102...
0.7740185
2
Get the bucket name. In this case it's the Azure Storage Blob Container name.
def bucket_name(self): container_name, _ = self._get_container_and_blob() return container_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bucket_name(self) -> str:\n return pulumi.get(self, \"bucket_name\")", "def bucket_name(self) -> str:\n return jsii.get(self, \"bucketName\")", "def bucket_name(self) -> str:\n return jsii.get(self, \"bucketName\")", "def bucket_name(self) -> str:\n return self._values.get('bu...
[ "0.87080437", "0.85682476", "0.85682476", "0.8566388", "0.8167915", "0.8167915", "0.8167915", "0.8167915", "0.8167915", "0.8167915", "0.8167915", "0.8167915", "0.8167915", "0.8167915", "0.81488985", "0.81262237", "0.81262237", "0.81262237", "0.81262237", "0.81262237", "0.8106...
0.8922359
0
Check if there's a current user authenticated or if request is anonymous
def _is_anonymous_user(auth_info): auth_info = auth_info or _get_auth_info_for_id_or_from_request() return str(auth_info.get("user_id")) == ANONYMOUS_USER_ID
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logged_in(request):\n return request.current_user is not None", "def is_authenticated(self, request, **kwargs):\r\n return True", "def is_authenticated(self):\n return True", "def is_authenticated(self):\n return True", "def is_authenticated(self):\n return True", "def ...
[ "0.81020284", "0.80461884", "0.76513284", "0.76513284", "0.76513284", "0.76513284", "0.76513284", "0.76513284", "0.76513284", "0.76014495", "0.75994647", "0.7588035", "0.75771004", "0.7507921", "0.7444819", "0.7377566", "0.73682123", "0.73648727", "0.7363557", "0.73305506", "...
0.74286026
15
Return a short date string from a full date string.
def _dateFmt(self, string): return time.strftime('%m/%d', time.strptime(string, '%B %d, %Y'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shortDate(self, date):\n return u'%s %02i' % (date.pMonth(), date.day())", "def date(string): \n return string[17:19]+\"/\"+string[15:17]+\"/\"+string[11:15]", "def str_date(date):\n d = str(date).split('-')\n string_date = \"\"\n for i in range(len(d)):\n string_date += d[i]\n...
[ "0.72611165", "0.6994765", "0.69641936", "0.695086", "0.694582", "0.691384", "0.6893432", "0.6635932", "0.6550161", "0.6543825", "0.65290725", "0.6505729", "0.6465715", "0.64445376", "0.64236164", "0.64199144", "0.6407423", "0.63839304", "0.6351995", "0.6332398", "0.63138765"...
0.5950169
61
Initialization for the test cases This is executed prior to each test.
def setUp(self): application.config['TESTING'] = True application.config['WTF_CSRF_ENABLED'] = False application.config['DEBUG'] = False self.app = application.test_client() # setup plaid client self.client = Client( ENV_VARS["PLAID_CLIENT_ID"], EN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testInit(self):\n self.globalInit()\n self.test.start()", "def test_01_Init(self):\n pass", "def setUp(self):\r\n # nothing to do, all tests use different things\r\n pass", "def setUp(self):\n assert COMMANDS.keys() == EXPCT_RESULTS.keys()\n self.tests = [...
[ "0.779927", "0.7743143", "0.77395856", "0.7714575", "0.76335835", "0.76094085", "0.7535864", "0.75279826", "0.75150496", "0.75075203", "0.7485075", "0.748507", "0.7475835", "0.7472118", "0.74501073", "0.74276125", "0.74276125", "0.74274445", "0.74080926", "0.740783", "0.74035...
0.0
-1
Return the first_name plus the last_name, with a space in between.
def get_full_name(self): full_name = '%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.83421856", "0.82273436", "0.80990887", "0.8067676", "0.80525744", "0.8043721", "0.7993416", "0.7992513", "0.7992513", "0.7992513", "0.7978309", "0.7963202", "0.7957057", "0.79399455", "0.7936728", "0.79338795", "0.79154027", "0.7901051", "0.7892942", "0.787005", "0.7855431...
0.7785957
38
String for representing the Model object
def __str__(self): return '{0} ({1})'.format(self.id, self.book.title)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self):\n return \"DataModel(name={},attributes={},description={})\".format(\n self.name, {a.name: str(a) for a in self.attributes}, self.description\n )", "def __str__(self):\n \n res =...
[ "0.8219232", "0.8020793", "0.77580154", "0.7699273", "0.7683828", "0.7678613", "0.7568337", "0.7568337", "0.75642484", "0.75642484", "0.75589746", "0.75219977", "0.75219977", "0.7509915", "0.75078505", "0.7363909", "0.73598325", "0.7340365", "0.73359716", "0.73188025", "0.731...
0.0
-1
test if user is created with normalized email
def test_create_user_with_email_normalized_succesfully(self): email = 'yamaha@GMAIL.COM' user = get_user_model().objects.create_user( email=email, password='Open@12') self.assertEqual(user.email, email.lower())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_new_user_email_normalized(self):\n email = 'test@GOOGLE.COM'\n user = get_user_model().objects.create_user(email, '212ds')\n\n self.assertEqual(user.email, email.lower())", "def test_new_user_email_normalize(self):\n email = \"test@TadfhaafGRGS.pl\"\n user = get_user_m...
[ "0.7945027", "0.7877712", "0.786418", "0.7851973", "0.7851973", "0.7851973", "0.7851731", "0.7849827", "0.7848643", "0.7838842", "0.78377324", "0.78113735", "0.78053594", "0.7787332", "0.7769644", "0.7761761", "0.7712407", "0.76882136", "0.7555286", "0.7233085", "0.7209747", ...
0.7935843
1
test if user cant be created with incalid email
def test_create_use_with_invalid_email(self): with self.assertRaises(ValueError): get_user_model().objects.create_user(None, password='open@123')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_private_create_user_without_email(self):\n with pytest.raises(ValueError) as exinfo:\n EmailUser.objects._create_user(None, None, False, False)\n self.assertIn('email must be set', str(exinfo.value))", "def test_create_no_email(self):\n\n self.portal.portal_properties.sit...
[ "0.75604266", "0.7526077", "0.738637", "0.7230545", "0.72252345", "0.72041637", "0.71896386", "0.7172107", "0.7170756", "0.71646357", "0.7164309", "0.7159112", "0.7159112", "0.7159112", "0.7159112", "0.7159112", "0.71207434", "0.71047884", "0.7080186", "0.7073913", "0.7066842...
0.71423775
16
test if create super user is crateng users with is_staff and is_superuser set to true
def test_create_superuser(self): user = get_user_model().objects.create_superuser( 'mail@domain.com', 'password@123' ) self.assertEqual(user.is_superuser, True) self.assertEqual(user.is_staff, True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_super_user(self):\n user = get_user_model().objects.create_superuser(\"test@asd.com\", \"test123\")\n\n self.assertTrue(user.is_superuser)\n self.assertTrue(user.is_staff)", "def test_create_super_user(self):\n user = get_user_model().objects.create_superuser(\n ...
[ "0.83412874", "0.8179343", "0.8150469", "0.8092165", "0.80857104", "0.8085598", "0.8048018", "0.80450684", "0.8016717", "0.7942509", "0.79403865", "0.79369146", "0.79289323", "0.79203314", "0.79135317", "0.7909849", "0.78797114", "0.7879316", "0.78678113", "0.7866551", "0.786...
0.7859862
21
test the string representation of created model
def test_tag_str(self): tag = models.Tag.objects.create( user=sample_user(), name='vegan' ) self.assertEqual(str(tag), tag.name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_model_returns_readable_representation(self):\n response = CreateArticle().create_article()\n self.assertIn(str(response), \"My awesome title\")", "def test_car_model_str_representation(car_model):\n assert str(car_model) == \"Golf\"", "def test_recipe_model_str(self):\n ...
[ "0.7801283", "0.75575227", "0.7550629", "0.7499251", "0.7494169", "0.73468864", "0.7243786", "0.7207104", "0.7182525", "0.71568143", "0.7102635", "0.70779854", "0.70584756", "0.7030895", "0.7010178", "0.7001172", "0.6998946", "0.6976965", "0.6974469", "0.6965202", "0.69576716...
0.6645574
49
test string representation of recipe model
def test_recipe_model_str(self): recipe = models.Recipe.objects.create( user=sample_user(), title='Mushrooome sause with Steak', time_minutes=5, price=5.00 ) self.assertEqual(str(recipe), recipe.title)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_car_model_str_representation(car_model):\n assert str(car_model) == \"Golf\"", "def test_recipe_str(self):\n\n recipe = models.Recipe.objects.create(\n user=sample_user(),\n # These 3 fields below are mandatory entries\n title=\"Creamy Baked Potato\",\n ...
[ "0.77457446", "0.75018805", "0.7436098", "0.74162537", "0.7297583", "0.71496004", "0.7002446", "0.69036496", "0.6897095", "0.6866117", "0.6866117", "0.677744", "0.6761289", "0.67512065", "0.67484146", "0.67319465", "0.6717907", "0.66640913", "0.662951", "0.6566583", "0.654238...
0.771091
1
Fetch the global configuration of the VSF stack.
def get_global_config(baseurl, cookie_header): url = baseurl + 'stacking/vsf/global_config' headers = {'cookie': cookie_header} response = requests.get(url, verify=False, headers=headers) if response.status_code == 200: return response.json() else: return response.status_code
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_global_config(self, **kwargs):\n return {}", "def get_config(cls) -> GlobalConfig:\n if cls.config is None:\n raise ValueError(\"Config is not loaded\")\n return cls.config", "def get_config():\n return _config", "def fusion_api_get_global_settings(self, uri=None, a...
[ "0.6527499", "0.64748985", "0.63209414", "0.63208824", "0.6278249", "0.6266795", "0.62666446", "0.62666446", "0.62666446", "0.62666446", "0.62666446", "0.62666446", "0.62666446", "0.62666446", "0.62666446", "0.62666446", "0.62666446", "0.62666446", "0.62666446", "0.62666446", ...
0.6862089
0
This tests correct creation of Datamap object.
def test_datamap_class(datamap): dm = Datamap() dm.cell_map_from_csv(datamap) assert dm.cell_map[1].cell_reference == 'B49'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testMapConstructor(self):\n # We only use one map type since they all share the same implementation for\n # this logic.\n with self.assertRaises(AssertionError):\n data_types.StepBuildStatsMap({1: 2})\n m = data_types.StepBuildStatsMap({'step': data_types.BuildStats()})\n self.assertEqual(m...
[ "0.70256096", "0.7021467", "0.65483075", "0.6330103", "0.63115597", "0.6278257", "0.62448883", "0.62212384", "0.62091744", "0.61734927", "0.6168931", "0.6168453", "0.61505115", "0.6107867", "0.61063874", "0.6105496", "0.6093215", "0.6052131", "0.60498595", "0.60291106", "0.60...
0.68832767
2
Return the name of the zone.
def name(self): return self._output_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zone_name(self):\n return self._zone_name", "def name(self):\n return f\"{self.zone_name} {self.zone_variable}\"", "def name(self) -> str | None:\n if self.zone.GroupName is not None:\n return self.zone.GroupName\n\n return self.zone.Name", "def zone(self) -> str:\n...
[ "0.9054484", "0.8391442", "0.8277205", "0.81044877", "0.81044877", "0.7961145", "0.78477615", "0.7459326", "0.7459326", "0.7459326", "0.7459326", "0.7459326", "0.7383181", "0.7383181", "0.7383181", "0.7383181", "0.7365331", "0.724029", "0.72371566", "0.7154684", "0.71479297",...
0.0
-1
Return the user's date of birth.
def date_of_birth(self, instance): return instance.user.profile.date_of_birth
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def date_of_birth(self) -> str:\n return self._date_of_birth.strftime('%Y-%m-%d')", "def date_of_birth(self):\n return self.__date_of_birth", "def birth_date(self) -> str:\n return self._birth_date", "def birthdate_date(self):\n\n bday = self.birthdate\n if bday:\n ...
[ "0.83164316", "0.8213778", "0.8197678", "0.80990034", "0.73747015", "0.73432046", "0.72216946", "0.71897864", "0.7132627", "0.6976907", "0.6882057", "0.6864334", "0.6831886", "0.6823029", "0.65475994", "0.6385019", "0.6373491", "0.635364", "0.62632024", "0.6237877", "0.621158...
0.84230185
0
Return the user's US citizen status.
def us_citizen(self, instance): return instance.user.profile.us_citizen
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def civil_status(self) -> str:\n return self._civil_status", "def get_status(self):\n if self.cancelled:\n return \"Cancelled\"\n elif self.is_active():\n s = \"Active\"\n if self.is_paid():\n return \"{0} - Paid\".format(s)\n else:\...
[ "0.6760604", "0.6177232", "0.6090589", "0.6055336", "0.6051816", "0.6026138", "0.60235435", "0.6016732", "0.5976178", "0.59552014", "0.5942364", "0.59290653", "0.5919042", "0.5919042", "0.5919042", "0.5919042", "0.5919042", "0.5919042", "0.5919042", "0.5919042", "0.5919042", ...
0.7071234
0
Return the user's employment status.
def employment(self, instance): return instance.user.profile.employment
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n\n return self.get_request_handler(request.headers).get_all_employment_status()", "def post(self):\n return self.get_request_handler(request.headers).create_new_employment_status(request)", "def user_facing_status(self) -> 'Tuple[UserFacingStatus, str]':\n applicability, de...
[ "0.7284013", "0.6485835", "0.6077649", "0.60487276", "0.5932551", "0.5930877", "0.5826906", "0.5792108", "0.57537556", "0.5709419", "0.570766", "0.56666434", "0.5666638", "0.56501734", "0.5641045", "0.5612947", "0.55475783", "0.5537402", "0.55245304", "0.54931754", "0.5490813...
0.78932554
0
Return the user's military status.
def military(self, instance): return instance.user.profile.military
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status(self):\n return STATUSES.get(self._mower_status, {}).get('message', self._mower_status)", "def get_status(self):\n status = self._status.get_message()\n \n if status == \"N\":\n return \"offline\"\n \n elif status == \"Y\":\n return \"onl...
[ "0.6424464", "0.6245521", "0.60852176", "0.60839933", "0.5913529", "0.58479524", "0.58372056", "0.581512", "0.5801884", "0.57414573", "0.5699368", "0.56794024", "0.567918", "0.5678438", "0.56648254", "0.5630489", "0.5630489", "0.5630489", "0.5630489", "0.5630489", "0.5630489"...
0.7791582
0
Return the user's primary email.
def email(self, instance): return mark_safe('<a href="mailto:{0}">{1}</a>'.format( instance.user.email, instance.user.email, ))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def email(self):\n # Look for a primary address\n useremail = UserEmail.query.filter_by(user_id=self.id, primary=True).first()\n if useremail:\n return useremail\n # No primary? Maybe there's one that's not set as primary?\n useremail = UserEmail.query.filter_by(user_i...
[ "0.840449", "0.8181544", "0.8109822", "0.77915424", "0.767789", "0.7607077", "0.7524723", "0.7520904", "0.7519233", "0.7510127", "0.74514127", "0.74483615", "0.7387477", "0.7387477", "0.73769194", "0.72964203", "0.72964203", "0.72964203", "0.7264366", "0.7264366", "0.7264366"...
0.0
-1
Return the user's secondary email.
def email_auxiliary(self, instance): return get_email_auxiliary(instance.user)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_email(self):\n member = self.get_user()\n if member:\n return member.getProperty('email')", "def email(self):\n # Look for a primary address\n useremail = UserEmail.query.filter_by(user_id=self.id, primary=True).first()\n if useremail:\n retur...
[ "0.7450758", "0.72319734", "0.7136817", "0.70093125", "0.6964193", "0.69591826", "0.69027615", "0.6897587", "0.68011034", "0.677343", "0.677343", "0.677343", "0.67683744", "0.67683744", "0.67683744", "0.67683744", "0.67532074", "0.6728818", "0.6724921", "0.672215", "0.6689593...
0.60102
88
Return the user's registration type.
def registration_type(self, instance): try: reg_type = mark_safe('<a href="{0}">{1}</a>'.format( reverse( 'admin:registration_{0}_change'.format( instance.user.profile.registration_type.lower(), ), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_type(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"user_type\")", "def user_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"user_type\")", "def user_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"user_type\")", ...
[ "0.74413455", "0.74224526", "0.74224526", "0.7165605", "0.71558166", "0.71558166", "0.70929027", "0.65847105", "0.6559235", "0.6559235", "0.6559235", "0.6559235", "0.6559235", "0.6559235", "0.6559235", "0.6559235", "0.65090305", "0.64329046", "0.63755226", "0.62907547", "0.62...
0.7510419
0
Return the user's WSGC affiliate organization.
def wsgc_affiliate(self, instance): reggie = instance.user.profile.get_registration() try: wsgc_affiliate = reggie.wsgc_affiliate except Exception: wsgc_affiliate = None try: if wsgc_affiliate.name == 'Other': wsgc_affiliate = r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_organization(self):\n return self.reference[REF_ORGANIZATION][REF_VALUE]", "def users_organizations(user):\n if not user or not user.is_authenticated():\n return None\n else:\n return get_users_organizations(user)", "def organization(self):\n return self._tower.get_org...
[ "0.6929004", "0.6409155", "0.63638186", "0.62043583", "0.6201337", "0.6156216", "0.61247605", "0.6089248", "0.60781044", "0.60781044", "0.60415107", "0.6026217", "0.6023374", "0.5972484", "0.59243155", "0.5915984", "0.5913203", "0.59127736", "0.59098077", "0.5848868", "0.5841...
0.6623938
1
Return the user's biography file.
def biography_file(self, instance): try: return admin_display_file(instance.user.user_files, 'biography') except Exception: return mark_safe('<i class="fa fa-times-circle red" aria-hidden="true"></i>')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_short_bio(self, instance):\n try:\n short_bio = instance.bio[:40]\n except:\n short_bio = \"No bio available\"\n return short_bio", "def bioinfo():\n\n pass", "def app_avatar(self):\n with open(self.AVATAR_PATH, 'rb') as handle:\n return h...
[ "0.6260814", "0.6143732", "0.60387397", "0.6022467", "0.5885942", "0.5798261", "0.5659066", "0.56589353", "0.56381506", "0.5581809", "0.55259", "0.54812306", "0.546956", "0.54420924", "0.5434395", "0.5351442", "0.53238857", "0.53237116", "0.52605826", "0.52605826", "0.5260582...
0.7792178
0
Return the user's media release file.
def media_release_file(self, instance): try: return admin_display_file(instance.user.user_files, 'media_release') except Exception: return mark_safe('<i class="fa fa-times-circle red" aria-hidden="true"></i>')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def media_path(self):\n return self._path", "def get_media_directory():\n\treturn _paths[_MEDIA_DIRECTORY_KEY]", "def video_path(self):\n return self.file_path", "def video_path(self):\n return self.file_path", "def get_media_path(self, filename):\n return join(settings.CMS_PAGE...
[ "0.6425959", "0.6273921", "0.6182364", "0.6182364", "0.61814475", "0.61765146", "0.6153773", "0.599794", "0.5954751", "0.590565", "0.5820483", "0.5787989", "0.5768619", "0.5767481", "0.5758664", "0.57022345", "0.56779546", "0.5664794", "0.56332296", "0.5630828", "0.5611609", ...
0.7175682
0
Return the user's last name.
def last_name(self, instance): return instance.user.last_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_name(self) -> str:\n return self.last_name", "def get_last_name(self):\n return self._last_name", "def last_name(self) -> str:\n return self._last_name", "def get_user_lastname():\n if not is_authenticated() or 'samlUserdata' not in session:\n return None\n\n la...
[ "0.8807615", "0.871526", "0.85778874", "0.8560807", "0.85562664", "0.85562664", "0.85562664", "0.85562664", "0.84469604", "0.84155", "0.84155", "0.84091836", "0.840857", "0.84065497", "0.83318794", "0.83318794", "0.83318794", "0.83318794", "0.83318794", "0.8268821", "0.823129...
0.8890986
0
Return the user's first name.
def first_name(self, instance): return instance.user.first_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_first_name(self) -> str:\n return self.first_name", "def get_first_name(self):\n return self._first_name", "def get_user_firstname():\n if not is_authenticated() or 'samlUserdata' not in session:\n return None\n\n first_name = session.get('samlUserdata', {}).get(SAML_ATTRIBUT...
[ "0.87717766", "0.8648493", "0.85681915", "0.85661626", "0.85255307", "0.8441657", "0.8441657", "0.8441657", "0.8346067", "0.83239853", "0.8319113", "0.82983285", "0.8288768", "0.8255768", "0.82471806", "0.82263714", "0.82263714", "0.8195127", "0.8167058", "0.81336606", "0.813...
0.8821824
0
Return the user's email.
def email(self, instance): return instance.user.email
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_email(self):\n member = self.get_user()\n if member:\n return member.getProperty('email')", "def user_email(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"user_email\")", "def log_useremail(self):\n return self.user.email", "def get_email(self):\n...
[ "0.90758497", "0.86339486", "0.85095155", "0.83614326", "0.82576764", "0.82378113", "0.81521684", "0.8100732", "0.8100732", "0.8100732", "0.8067508", "0.80381215", "0.79830235", "0.79724693", "0.79450226", "0.7901038", "0.7895263", "0.78938466", "0.78938466", "0.78938466", "0...
0.8411572
3
Get the current service enablement_state
def enablement_state(self): return self.__enablement_state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_state(self):\n _, state, _, _, _, _, _ = win32serviceutil.QueryServiceStatus(self.name)\n return state", "def get_service_status(self):\n return self.service.status()", "def get_state(self):\r\n alarm = self._alarm()\r\n return alarm.state", "def get_state(self):\n ...
[ "0.7155378", "0.68581325", "0.6755263", "0.66132617", "0.65125823", "0.6506057", "0.64321154", "0.6428278", "0.63989544", "0.6364898", "0.63569194", "0.63199866", "0.63199866", "0.6318667", "0.6288315", "0.628258", "0.6277042", "0.6272042", "0.62647176", "0.6243962", "0.62439...
0.77999526
0
Strip out any "exotic" chars and whitespaces.
def normalize_name(name): return PUNCT_RE.sub('-', name.lower()).strip('-')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def removeSpecialChars(self) -> None:\n self.text = re.sub('[^a-zA-z0-9\\n\\.\\s]', '', self.text)", "def strip_other_charcter():\n pass", "def _removeWhitespaces(self, s):\n return s.translate({ord(c): None for c in string.whitespace})", "def _strip_invalid_xml(s):\n if _badchars_re.search...
[ "0.72122425", "0.7131181", "0.71172386", "0.70950645", "0.70950645", "0.70594746", "0.70594746", "0.69886506", "0.6980312", "0.69571376", "0.69228566", "0.69062465", "0.69062465", "0.69047517", "0.69015676", "0.68979645", "0.6861669", "0.6850225", "0.68365884", "0.6827175", "...
0.0
-1
Return a list of given lines wrapped with fold marks. If 'line_end' is not specified it is determined from the last line given. It is designed to provide an adequate result by default. That is, the
def fold_lines(self, lines, name='', line_end=None, force=None): if not self.is_fold_enabled(force): return lines line_end = detect_nl(lines, line_end) start_mark, end_mark = new_section_marks(name, line_end) ret = [start_mark, end_mark] ret[1:1] = lines retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_lines(parent: str, begin: Predicate, end: Predicate) -> str:\n lines = parent.splitlines()\n\n begin_line = find_line(lines, begin)\n end_line = find_line(lines, end, begin_line+1)\n\n new_lines = lines[begin_line+1:end_line]\n\n return \"\\n\".join(new_lines)", "def section_marks(sect...
[ "0.60914844", "0.5963913", "0.58668196", "0.58540714", "0.5781562", "0.5736326", "0.57243466", "0.56027025", "0.55688995", "0.5538931", "0.55374473", "0.54967827", "0.5438219", "0.5433123", "0.54195166", "0.5412226", "0.53487694", "0.5309893", "0.530176", "0.52898014", "0.528...
0.7996535
0
Initializes a new RougeScorer.
def __init__(self, rouge_types): self.rouge_types = rouge_types
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(self):\n self.gc1.reset_parameters()\n self.gc2.reset_parameters()\n\n for s in self.scores:\n stdv = 1. / math.sqrt(s.size(1))\n s.data.uniform_(-stdv, stdv)\n for b in self.bias:\n # fill in b with postive value to make\n # sc...
[ "0.59581774", "0.5897942", "0.57204056", "0.5684845", "0.55538446", "0.55469054", "0.5539663", "0.55017924", "0.5450091", "0.54483104", "0.542107", "0.53921753", "0.5382322", "0.5364561", "0.5363393", "0.53562796", "0.53506523", "0.5346942", "0.5346731", "0.5343395", "0.53336...
0.0
-1
Creates ngrams from the given list of tokens.
def _create_ngrams(tokens, n): ngrams = collections.Counter() for ngram in (tuple(tokens[i:i + n]) for i in xrange(len(tokens) - n + 1)): ngrams[ngram] += 1 return ngrams
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_ngrams(self, tokens):\n ngrams = []\n for i in range(len(tokens)- self.N + 1):\n ngrams.append(tuple(tokens[i:i+self.N]))\n return ngrams", "def build_ngrams(tokens, n=2):\n ngrams = zip(*(islice(group, idx, None) for idx, group in enumerate(tee(tokens, n))))\n re...
[ "0.8290662", "0.79008526", "0.75598544", "0.7428636", "0.7192195", "0.7147241", "0.7107056", "0.7017507", "0.69576705", "0.6862321", "0.6818451", "0.68030536", "0.6753985", "0.6747704", "0.6710258", "0.67051077", "0.6663761", "0.6661808", "0.6557038", "0.6552482", "0.6508236"...
0.7240869
4
Makes sure a test can override a management signal handler
def test_allows_mgmt_signal_handler_override(self): self._management_notified = False b1 = Block() self.configure_block(b1, {}) self.assertFalse(self._management_notified) b1.notify_management_signal(BlockStatusSignal(RunnerStatus.error)) self.assertTrue(self._management...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_allows_signal_handler_override(self):\n self._signals_notified = False\n b1 = Block()\n self.configure_block(b1, {})\n\n self.assertFalse(self._signals_notified)\n b1.notify_signals([Signal()])\n self.assertTrue(self._signals_notified)", "def management_signal_n...
[ "0.7557959", "0.67974746", "0.6700957", "0.66342205", "0.6374035", "0.62833494", "0.6276752", "0.6215962", "0.616038", "0.61569273", "0.6153929", "0.6096442", "0.60713524", "0.60272264", "0.60072905", "0.5993832", "0.59833854", "0.5956525", "0.5955409", "0.59466577", "0.59415...
0.8165956
0
Asserts that no exception is raised when output is invalid. This is an intentionally added feature added to the block unit test to prevent test writers from having to explicitly have to add outputs to testing blocks if they want to notify signals to a different output.
def test_invalid_output(self): b1 = Block() self.configure_block(b1, {}) b1.notify_signals([Signal()], "invalid_output") self.assert_num_signals_notified(1, b1, "invalid_output")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_wrong_output_provided(self):\n with self.assertRaises(VisualizationError):\n circuit_drawer(None, output='wrong_output')", "def test_exit_on_output_cb_error(output_block, kwargs):\n output_block.side_effect = Exception()\n with pytest.raises(SystemExit) as exc_info:\n crea...
[ "0.7156702", "0.6935068", "0.6864712", "0.67471904", "0.6703436", "0.65894246", "0.6575736", "0.6452162", "0.63947046", "0.63829154", "0.6378205", "0.6354628", "0.63508093", "0.6274341", "0.6202525", "0.61779565", "0.6148675", "0.6143646", "0.61360323", "0.61301005", "0.61241...
0.8472184
0
THIRDPARTY.md provides an overview of thirdparty licenses that will apply to the binary distribution.
def write_listing(listing, dep, pom): print(f'| {dep.groupId} | {dep.artifactId} | {dep.version} ', end='', file=listing) print(f'| {pom.authors} ', end='', file=listing) print(f'| {pom.license.name} | {pom.license.url} ', end='', file=listing) print(f'|', file=listing)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_licenses(licenses):\n #print(\"Available licenses:\\n\")\n for license in licenses:\n print(\"{0}: {name} {ver} ({url})\".format(license, **licenses[license]))", "def get_license():\n repo_fs()\n return LICENSE", "def custom_licenses(self):\n buf = (ctypes.c_char * self.MAX_B...
[ "0.6238224", "0.59817857", "0.58766884", "0.5786553", "0.55892843", "0.5441604", "0.5386215", "0.53816015", "0.5374845", "0.53678644", "0.53589493", "0.5328017", "0.5327009", "0.5197952", "0.5184771", "0.51275736", "0.512728", "0.51087505", "0.51087505", "0.51087505", "0.5108...
0.0
-1
Returns all products as an array from Product Table.
def get_all_products(): products = app.session.query(models.Product).all() return products
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def products(self):\n return list(Product.select())", "def get_all_products():\n data = order_obj.get_all_products()\n return data", "def get_all_products(self):\n\t\tpass", "def get(self):\n return Product.query.all()", "def get_all_product():\r\n\r\n with mysql.db_session() as sess...
[ "0.79283607", "0.7622894", "0.75175965", "0.74180704", "0.7354174", "0.7280472", "0.7259349", "0.7129951", "0.69914925", "0.6949781", "0.6940288", "0.69330454", "0.69272864", "0.6901979", "0.68730867", "0.68409705", "0.68293124", "0.6808366", "0.6805835", "0.6732724", "0.6718...
0.78707296
1
In the constructor we instantiate two nn.Linear modules and assign them as member variables.
def __init__(self, D_in, H, D_out): super(FeedForwardNet, self).__init__() self.linear1 = torch.nn.Linear(D_in, H) self.linear2 = torch.nn.Linear(H, H) self.linear3 = torch.nn.Linear(H, D_out)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args):\n super(LinearND, self).__init__()\n self.fc = nn.Linear(*args)", "def __init__(self, linear_args, activation_functions, softmax=False):\n super(NN, self).__init__()\n assert len(activation_functions) == len(linear_args) - 1\n k = len(linear_args)\n ...
[ "0.77401125", "0.75483596", "0.75074446", "0.74346", "0.7366003", "0.7335429", "0.73152226", "0.7286699", "0.7273464", "0.72729063", "0.72729063", "0.7268201", "0.72429734", "0.72211164", "0.7167753", "0.7111596", "0.7077496", "0.7065618", "0.7063983", "0.7053454", "0.7018263...
0.72030157
14
In the constructor we instantiate two nn.Linear modules and assign them as member variables.
def __init__(self, D_in): super(ExplainEven, self).__init__() self.linear1 = torch.nn.Linear(D_in, 10) self.linear2 = torch.nn.Linear(10, 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args):\n super(LinearND, self).__init__()\n self.fc = nn.Linear(*args)", "def __init__(self, linear_args, activation_functions, softmax=False):\n super(NN, self).__init__()\n assert len(activation_functions) == len(linear_args) - 1\n k = len(linear_args)\n ...
[ "0.7740035", "0.75485957", "0.7506749", "0.74343014", "0.7366208", "0.7335571", "0.73144513", "0.72861767", "0.72730076", "0.7272271", "0.7272271", "0.72678465", "0.72425723", "0.72200733", "0.7202108", "0.7166431", "0.7110935", "0.7065075", "0.7062705", "0.7052624", "0.70176...
0.7076567
17
Reads in yaml (.yml) file
def read_yaml(file): with open(file, mode='r') as stream: out = yaml.load(stream) return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_yaml(yaml_path):\n with open(yaml_path) as f:\n yaml_data = yaml.load(f, Loader=yaml.FullLoader)\n\n return yaml_data", "def load_yaml(yml_file):\n with open(yml_file) as src:\n cfg = yaml.load(src, Loader=yaml.Loader)\n return cfg", "def load_yml(yml_file):\n with open(ym...
[ "0.7781761", "0.7633922", "0.76303715", "0.75445145", "0.7509987", "0.7507649", "0.74455655", "0.73498154", "0.7343808", "0.7322305", "0.73167044", "0.7282349", "0.7265744", "0.72563106", "0.7254326", "0.723643", "0.72083426", "0.71808773", "0.7170963", "0.7151263", "0.714659...
0.75516963
3
Converts TAI time to UTC time
def tai_to_utc(tai, config, time_format="%Y/%j-%H:%M:%S"): epoch = dt.datetime.strptime(config.config['runtime']['epoch'], "%m/%d/%Y-%H:%M:%S") try: utc = epoch + dt.timedelta(seconds=int(tai)) except OverflowError: utc = epoch return utc.strftime(time_format)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def utcTime():\r\n return calendar.timegm(time.gmtime())", "def itow2utc(itow: int) -> datetime.time:\r\n\r\n utc = datetime(1980, 1, 6) + timedelta(seconds=(itow / 1000) - (35 - 19))\r\n return utc.time()", "def convert_time(t):\n return datetime.fromtimestamp(t / 1e7 - 11644473600)", "def utcti...
[ "0.6474099", "0.634522", "0.6339539", "0.6275563", "0.6170377", "0.6117167", "0.5978823", "0.59585494", "0.5903301", "0.58623", "0.58462834", "0.58369577", "0.58129203", "0.57555556", "0.57555556", "0.57550174", "0.5754278", "0.57135016", "0.57121164", "0.56998396", "0.569798...
0.704843
0
Constructs a LayerwiseShardablePipelined object.
def __init__(self, params: InstantiableParams) -> None: super().__init__(params) p = self.params assert p.name assert p.single_stage_body repeat_prefix = (p.repeat_prefix or []) + [p.num_stages] assert len(p.weight_split_dims_mapping.stages) == 1 repeat_prefix_split_dims_mapping = tuple( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pipeline(self, transaction=True, shard_hint=None):\n p = Pipeline(\n connection_pool=self.connection_pool,\n response_callbacks=self.response_callbacks,\n transaction=transaction,\n shard_hint=shard_hint)\n return p", "def pipeline(self, transaction=T...
[ "0.5620544", "0.52030367", "0.5170377", "0.51270556", "0.5104094", "0.5076902", "0.50551784", "0.5032362", "0.48940864", "0.48815376", "0.48634782", "0.48607194", "0.48462868", "0.48190755", "0.48119187", "0.48117578", "0.4810363", "0.48066106", "0.47885254", "0.47834224", "0...
0.44025335
83
Set up a grid of 100 x 100 cells
def setUp(self): self.gameBoard = Grid((100, 100), Cell)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_grid(grid):\r\n for i in range(4):\r\n grid.append([0,0,0,0])", "def fill_grid(self):\n\n for row_margin, row in enumerate(range(self.rows)):\n self.grid.append([])\n\n for col_margin, col in enumerate(range(self.cols)):\n x = col*self.cell_size + ...
[ "0.76046914", "0.757904", "0.7453111", "0.7445106", "0.74349236", "0.73436016", "0.7276141", "0.7264188", "0.72585505", "0.7211308", "0.7167712", "0.7088006", "0.70624304", "0.7054887", "0.70407003", "0.69975567", "0.6981178", "0.6970429", "0.68844855", "0.68518585", "0.68289...
0.696798
18
Capture open in new window and send url to os default browser.
def handle_new_window(event): url = event.GetURL() webbrowser.open(url)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def newwindow(url):\n\n # Open the URL\n webbrowser.open_new(url)", "def browser_open(url):\n FNULL = open(os.devnull, 'w')\n subprocess.Popen([udata.browser, url], stdout=FNULL, stderr=subprocess.STDOUT )", "def open_browser_window(url):\n logger.debug('about to open url \"{url}\" in browse...
[ "0.7576627", "0.75473374", "0.73908955", "0.71722555", "0.7165614", "0.7102926", "0.69876915", "0.69634604", "0.68365943", "0.68135303", "0.670249", "0.66876054", "0.66620636", "0.6652533", "0.6639944", "0.6617876", "0.6576921", "0.6563956", "0.6552006", "0.6486125", "0.64289...
0.7691621
0
Deserialize datetime object into string form for JSON processing.
def dump_date(data): if data is None: return None return data.strftime("%Y-%m-%d")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize_datetime(self, obj):\r\n if isinstance(obj, datetime.datetime):\r\n return obj.isoformat()\r\n raise TypeError(\"Type not serializable\")", "def json_datetime_serializer(obj):\n\n if isinstance(obj, datetime):\n serial = obj.isoformat()\n return serial\n ...
[ "0.6994827", "0.6983484", "0.6900362", "0.68625224", "0.68153036", "0.6750824", "0.66519916", "0.66356194", "0.6595477", "0.65483314", "0.65418214", "0.6537647", "0.64853007", "0.64840287", "0.6440954", "0.63958555", "0.63667345", "0.6358736", "0.63390857", "0.631359", "0.629...
0.0
-1
Deserialize datetime object into string form for JSON processing.
def dump_time(data): if data is None: return None return data.strftime("%H:%M:%S")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize_datetime(self, obj):\r\n if isinstance(obj, datetime.datetime):\r\n return obj.isoformat()\r\n raise TypeError(\"Type not serializable\")", "def json_datetime_serializer(obj):\n\n if isinstance(obj, datetime):\n serial = obj.isoformat()\n return serial\n ...
[ "0.6995824", "0.6982557", "0.69000393", "0.6865064", "0.68128496", "0.6749708", "0.6649493", "0.66324556", "0.65954465", "0.65469813", "0.6542357", "0.6538773", "0.6487021", "0.6480456", "0.64397836", "0.63939315", "0.6364729", "0.6356435", "0.633706", "0.63110447", "0.629170...
0.0
-1
Retrieve, update or delete a user.
def user_detail_csrf(request, pk, format=None): try: user = User.objects.get(pk=pk) except user.DoesNotExist: return HttpResponse(status=404) if request.method == 'GET': serializer = UserSerializer(user, context={'request': request}) return JsonResponse(serializer.data) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n\n user_id = get_jwt_identity()\n user = user_crud.get(user_id)\n if not user:\n abort(404, message=\"User not Found\")\n\n return user", "def user(user_id):\n user = storage.get('User', user_id)\n if user is None:\n abort(404)\n\n # GET\n ...
[ "0.731158", "0.72595394", "0.7206996", "0.701415", "0.6982818", "0.69689083", "0.6968303", "0.6937616", "0.69292706", "0.68606716", "0.68459177", "0.684417", "0.68367815", "0.67933816", "0.6780776", "0.67706686", "0.6732614", "0.67249274", "0.6716095", "0.67111987", "0.670436...
0.0
-1
Retrieve, update or delete a user.
def user_detail_apiview(request, pk, format=None): try: user = User.objects.get(pk=pk) except user.DoesNotExist: return Response(status=status.HTTP_404_NOT_FOUND) if request.method == 'GET': serializer = UserSerializer(user, context={'request': request}) return Response(seri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n\n user_id = get_jwt_identity()\n user = user_crud.get(user_id)\n if not user:\n abort(404, message=\"User not Found\")\n\n return user", "def user(user_id):\n user = storage.get('User', user_id)\n if user is None:\n abort(404)\n\n # GET\n ...
[ "0.731158", "0.72595394", "0.7206996", "0.701415", "0.6982818", "0.69689083", "0.6968303", "0.6937616", "0.69292706", "0.68606716", "0.68459177", "0.684417", "0.68367815", "0.67933816", "0.6780776", "0.67706686", "0.6732614", "0.67249274", "0.6716095", "0.67111987", "0.670436...
0.0
-1
Get all word ngrams from the splitted string
def get_all(splitted_string, word_ngram, sort_ngrams=False): for ngram in range(1, word_ngram + 1): for word_pos in range(len(splitted_string) - ngram + 1): if sort_ngrams: yield ("_".join(sorted(splitted_string[word_pos:word_pos + ngram]))) else: yiel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def word_ngrams(sent, n):\n\t\n\t# EXAMPLES \n\t# > word_ngrams(tokenize('hello world'), 1)\n\t# [('hello',), ('world',)]\n\t# > word_ngrams(tokenize('hello world'), 2)\n\t# [('<s>', 'hello'), ('hello', 'world'), ('world', '</s>')]\n\n\t# YOUR CODE HERE\n\ttokenized_sent = tokenize(sent)\n\tif n != 1:\n\t\ttokeniz...
[ "0.7779938", "0.77231485", "0.7716925", "0.7635062", "0.7545396", "0.75184405", "0.751229", "0.74473", "0.7429956", "0.73954654", "0.72402257", "0.7221249", "0.7169436", "0.71431106", "0.71045", "0.7015108", "0.70060843", "0.7001726", "0.7001726", "0.6987701", "0.69837284", ...
0.7131912
14
Conversion of iDoG spatial constants to extents.
def idog_conv(sc): return math.sqrt(sc*2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_extent(self):\n geot = self.geotransform()\n return (geot[0], geot[3] + self.YSize() * geot[5],\n geot[0] + self.XSize() * geot[1], geot[3])", "def extent(self):\n if self.x is not None:\n if self.y is not None:\n if self.z is not None:\n ...
[ "0.600665", "0.58601326", "0.5783797", "0.5783224", "0.5750921", "0.5750921", "0.57362247", "0.5704828", "0.5660872", "0.56443113", "0.5628553", "0.5612897", "0.54797626", "0.5438923", "0.54387885", "0.54351133", "0.5416766", "0.5361769", "0.5352126", "0.5346152", "0.5342634"...
0.0
-1
Convert spatial frequency to spatial constant.
def fr2sp(fr): return (math.sqrt(2)/(2*math.pi*fr))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_scale_freq():\n return sf / 2 / (num_freq-1)", "def _calculate_spatial_frequency_cutoff(self):\n \n # unused \n self.spatial_cutoff = (self.unit_actuators / self.telescope_diameter)/2", "def normalizing_constant(self):\n\t\tdim = self.train_data.shape[1]\n\t\treturn 1 / (2 * np....
[ "0.63742495", "0.62101144", "0.6113003", "0.60040444", "0.585105", "0.5759264", "0.5759264", "0.5757528", "0.56110466", "0.56110466", "0.55948424", "0.55714905", "0.55702215", "0.55399776", "0.5510573", "0.5508824", "0.5508824", "0.55024046", "0.5495227", "0.54706156", "0.546...
0.52056915
41
Configures the FastAPI app and returns it
def create_app(): app = FastAPI() configure_rest_server(app=app, router_configs=WEB_SERVICES_ROUTER_CONFIGS, db_configs=DB_CONFIGS) return app
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app(app_environment: EnvVarsDict) -> FastAPI:\n return init_app()", "def create_app():\n\n app = FastAPI()\n add_root_route(app)\n\n return app", "def _init_fast_api_app(self):\n app = FastAPI(\n title=\"Opal Server\",\n description=\"OPAL is an administration layer...
[ "0.81226754", "0.777971", "0.7672783", "0.747336", "0.73901534", "0.7328129", "0.7272732", "0.7205298", "0.7181947", "0.7169826", "0.71549755", "0.7095538", "0.70886546", "0.70714355", "0.70400006", "0.7019702", "0.695147", "0.6924023", "0.69100636", "0.6902655", "0.6856348",...
0.798637
1