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
Creates a Ddimensional grid of n linearly spaced points
def linear_grid(D, n = 100, min_max = (-100, 100)): g = np.linspace(min_max[0], min_max[1], n) G = np.ones((n, D)) return G*g[:,None]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_grid(N):\n\n x = np.linspace(-2. , 2 , N)\n y = np.linspace(-2. , 2 , N)\n # two evenly spaced grids from -2 to 2\n\n return x, y", "def linear_grid(D, n = 100, min_max = (-100, 100)):\r\n\r\n g = np.linspace(min_max[0], min_max[1], n)\r\n G = np.ones((n, D))\r\n\r\n return G*g[:,No...
[ "0.76228786", "0.75158966", "0.7254434", "0.69516516", "0.69320124", "0.68234044", "0.6809387", "0.67894524", "0.66963047", "0.6670365", "0.6624484", "0.6593824", "0.6564381", "0.65498596", "0.6515209", "0.6436385", "0.63669217", "0.6316191", "0.63046896", "0.62997156", "0.62...
0.7520031
1
Loop through values adding primes to prime list
def loop(): num = 1 while(len(primes) < didget ): if(isprime(num) == True): primes.append(num) num = num + 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def primes(count):\n\n prime_list = []\n num = 2\n\n while count > 0:\n\n if prime_checker(num):\n prime_list.append(num)\n count -= 1\n num += 1\n\n return prime_list", "def primes(n: int) -> list:\n primes = [2]\n pot_primes = list(range(2,n+1))\n fo...
[ "0.74510336", "0.73934203", "0.7249243", "0.72461367", "0.72006875", "0.7161539", "0.7046149", "0.70427114", "0.69698906", "0.69434154", "0.6931499", "0.6900146", "0.68452644", "0.6791465", "0.6770901", "0.6701058", "0.6679706", "0.6668923", "0.6667527", "0.66657245", "0.6650...
0.6958069
9
returns guassian density given x on log scale
def log_normal_density(self, x, mean, log_std, std): variance = std.pow(2) log_density = -(x - mean).pow(2) / (2 * variance) - 0.5 * \ np.log(2 * np.pi) - log_std # num_env * frames * act_size log_density = log_density.sum(dim=-1, keepdim=True) # num_env * frames * 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_density_gaussian(x, mu, logvar):\n norm = - 0.5 * (math.log(2 * math.pi) + logvar)\n log_density = norm - 0.5 * ((x - mu) ** 2 * torch.exp(-logvar))\n return log_density", "def log_density_gaussian(x: torch.Tensor, mu: torch.Tensor, logvar: torch.Tensor):\n norm = -0.5 * (math.log(2 * math.pi...
[ "0.7565519", "0.7503947", "0.69597495", "0.69120324", "0.68328094", "0.68210346", "0.6795797", "0.6787948", "0.6735831", "0.67035735", "0.67035735", "0.66731095", "0.6644659", "0.66355366", "0.656607", "0.6562923", "0.65562403", "0.65554374", "0.6536779", "0.6531345", "0.6527...
0.62150073
61
Set the finish month for certificates
def set_finish_month(self, month): return self.form.set_value("output period \"month to\"", MONTHS[month - 1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_month(self, month: int, year: int, bill: Bill) -> None:\n self.bill = bill\n self.bill.set_rates(\"TERM\", TERM_MINS_COST)\n self.bill.add_fixed_cost(TERM_MONTHLY_FEE)\n if not ((self.end.month < month and self.end.year <= year) or\n self.end.year < year):\n ...
[ "0.61762846", "0.61280257", "0.60646594", "0.5875881", "0.5733086", "0.5729553", "0.5658201", "0.5614031", "0.5562677", "0.5558146", "0.5543753", "0.54753804", "0.545213", "0.5451844", "0.54499245", "0.54149026", "0.541394", "0.5410662", "0.54101086", "0.54056174", "0.5387887...
0.7110114
0
Filter stations based on name. The search will return all stations containing the supplied name.
def filter_name(self, name): return self.form.set_value("generating station search", name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def station_by_name(self, name):\n for station in self.stations:\n if name.lower() in station.stationname.lower():\n return station\n\n print(str.format(\"Could not find station with name '{0}'\", name))", "def search_by_name(self, name):\r\n return self.__filter(se...
[ "0.7011877", "0.6723853", "0.6520272", "0.6080978", "0.60456336", "0.6042563", "0.5951579", "0.590254", "0.5863565", "0.5847021", "0.56821316", "0.5674226", "0.56469357", "0.56359357", "0.56311", "0.55817884", "0.5569548", "0.5542532", "0.55174375", "0.5508504", "0.5496334", ...
0.7042624
0
Return a friendly HTTP greeting.
def hello(): plays = filter(lambda p: p.user == users.get_current_user(), Play.all()) print(plays) logout_url = users.create_logout_url('/home') logout_url_linktext = 'Logout' login_url = users.create_login_url('/home') login_url_linktext = 'Login' plays = sorted(plays, key=lambda x: x.time)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_greeting(name):\n\n greeting = (f\"Hello, {name.title()}. It's nice to meet you!\")\n return greeting", "def welcome():\n return 'Welcome to Flask!'", "def greeting_message(name):\n print('My name is ' + name)", "def Welcome():\n return (\n f\"Welcome to the Surf's Up API!\...
[ "0.67860854", "0.6719625", "0.67095745", "0.6680697", "0.6663219", "0.6638394", "0.6633062", "0.6628187", "0.6556032", "0.6536937", "0.64776874", "0.6477268", "0.64715713", "0.64644194", "0.6443056", "0.6435385", "0.6400719", "0.6400167", "0.637615", "0.637615", "0.6367243", ...
0.0
-1
Return a custom 404 error.
def page_not_found(e): return 'Sorry, nothing at this URL.', 404
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def not_found():\n return HttpError(404)", "def error_404(error):\n return '404 Error'", "def error_404(error):\n return 'Bummer, there is nothing at this URL.'", "def error_not_found(error):\n return 'No page here, dood. 404!', 404", "def not_found(self, error):\n return jsonify({'error': 'NO...
[ "0.81159586", "0.80410045", "0.7738874", "0.77369535", "0.77182025", "0.7689595", "0.7670471", "0.76112473", "0.7602477", "0.7570698", "0.75528365", "0.7545827", "0.751882", "0.74745256", "0.7458403", "0.7455682", "0.74548143", "0.74505144", "0.7442062", "0.7428278", "0.74065...
0.72672606
31
Create the table/columnfamily if it doesn't already exist.
def ensure_schema(client, table_name): query = ''.join([ 'CREATE TABLE {cf} ', '("lockId" ascii, "claimId" timeuuid, PRIMARY KEY("lockId", "claimId"));']) def errback(failure): failure.trap(InvalidRequestException) return client.execute(query.format(cf=table...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_and_create_table(self) -> None:\n table_ids = [t.table_id for t in self.instance.list_tables()]\n\n if not self.table_id in table_ids:\n self.table.create()\n f = self.table.column_family(self.family_id)\n f.create()\n\n f_inc = self.table.column_...
[ "0.7745784", "0.68932956", "0.6822353", "0.6703091", "0.66774803", "0.6661229", "0.6603831", "0.6575945", "0.6539651", "0.6539651", "0.6407549", "0.64062476", "0.6391076", "0.63803196", "0.6374782", "0.63691497", "0.6299321", "0.6295349", "0.62940973", "0.6289812", "0.6264458...
0.0
-1
Whether a given world position is on the lane.
def on_lane(self, position: np.ndarray, longitudinal: float = None, lateral: float = None, margin: float = 0) -> bool: if not longitudinal or not lateral: longitudinal, lateral = self.local_coordinates(position) return np.abs(l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_reach(self, position: tuple) -> bool:\n x = position[0]\n y = position[1]\n dist_to_shoulder = math.sqrt(x**2 + y**2)\n max_dist = self.bicep_length + self.forearm_length\n if dist_to_shoulder > max_dist:\n return False\n return True", "def _is_valid_l...
[ "0.67187107", "0.6603079", "0.6420876", "0.63983667", "0.6354372", "0.6285472", "0.627441", "0.6240657", "0.6235772", "0.6234093", "0.62326586", "0.6221681", "0.6185796", "0.6181252", "0.61717224", "0.61404264", "0.61356753", "0.6125642", "0.61218387", "0.6104374", "0.6088298...
0.71192163
0
Return longitudinal distance to position
def s(self, position: Vector) -> float: return self.local_coordinates(position)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(self, position):\n s, r = self.local_coordinates(position)\n return abs(r) + max(s - self.length, 0) + max(0 - s, 0)", "def distance(self):\n return Distance(length_of(self.position.au))", "def longitud_traza(self):\n ret = 0\n for p in range(len(self.trazado) - ...
[ "0.65672475", "0.6434347", "0.63579684", "0.6354008", "0.6337078", "0.6325193", "0.62847817", "0.6269536", "0.6182617", "0.61693347", "0.6167535", "0.612782", "0.6115904", "0.6112405", "0.61075836", "0.60757786", "0.6072561", "0.6069178", "0.6053234", "0.6038783", "0.6037587"...
0.0
-1
Return longitudinal distance to position
def s_path(self, position: Vector) -> float: return self.path_coordinates(position)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(self, position):\n s, r = self.local_coordinates(position)\n return abs(r) + max(s - self.length, 0) + max(0 - s, 0)", "def distance(self):\n return Distance(length_of(self.position.au))", "def longitud_traza(self):\n ret = 0\n for p in range(len(self.trazado) - ...
[ "0.65672475", "0.6434347", "0.63579684", "0.6354008", "0.6337078", "0.6325193", "0.62847817", "0.6269536", "0.6182617", "0.61693347", "0.6167535", "0.612782", "0.6115904", "0.6112405", "0.61075836", "0.60757786", "0.6072561", "0.6069178", "0.6053234", "0.6038783", "0.6037587"...
0.0
-1
Return longitudinal distance to position
def r(self, position: Vector) -> float: return self.local_coordinates(position)[1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(self, position):\n s, r = self.local_coordinates(position)\n return abs(r) + max(s - self.length, 0) + max(0 - s, 0)", "def distance(self):\n return Distance(length_of(self.position.au))", "def longitud_traza(self):\n ret = 0\n for p in range(len(self.trazado) - ...
[ "0.65672475", "0.6434347", "0.63579684", "0.6354008", "0.6337078", "0.6325193", "0.62847817", "0.6269536", "0.6182617", "0.61693347", "0.6167535", "0.612782", "0.6115904", "0.6112405", "0.61075836", "0.60757786", "0.6072561", "0.6069178", "0.6053234", "0.6038783", "0.6037587"...
0.0
-1
Return coin addresses and keys.
def get_coin_address(self, coin, idx=0): return self.coins[coin][idx]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_coins(self):\n if self.coins:\n return self.coins.keys()\n else:\n return []", "def coin_info(self):\n res = r.get(self.url + self.coin)\n return self.execute(res)", "def derive_wallets(self, mnemonic, coin, number_keys=10):\n command = f'derive ...
[ "0.69095945", "0.6835071", "0.64046997", "0.6274613", "0.6221056", "0.6094602", "0.6091707", "0.6038172", "0.6033023", "0.6026853", "0.6023023", "0.6012718", "0.5897465", "0.58751374", "0.5818749", "0.581759", "0.5810738", "0.58047175", "0.57991254", "0.57669425", "0.5757658"...
0.61624074
5
Return coin addresses and keys.
def get_coin_privkey(self, coin, idx=0): return self.get_coin_address(coin=coin, idx=idx)["privkey"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_coins(self):\n if self.coins:\n return self.coins.keys()\n else:\n return []", "def coin_info(self):\n res = r.get(self.url + self.coin)\n return self.execute(res)", "def derive_wallets(self, mnemonic, coin, number_keys=10):\n command = f'derive ...
[ "0.69095945", "0.6835071", "0.64046997", "0.6274613", "0.6221056", "0.61624074", "0.6094602", "0.6091707", "0.6038172", "0.6033023", "0.6026853", "0.6012718", "0.5897465", "0.58751374", "0.5818749", "0.581759", "0.5810738", "0.58047175", "0.57991254", "0.57669425", "0.5757658...
0.6023023
11
Return the full metadata object for the given timeseries (by its ID), if available.
def get_metadata(self, tsid): return self._metadata.get(tsid)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def series_metadata(series_id, **kwargs):\n\n instance = Ceic._get_instance()\n\n kwargs[\"id\"] = series_id\n get_series_method = instance._series_facade.get_series_metadata\n result = instance._make_request(get_series_method, **kwargs)\n\n return result", "def get_meta(_id):\...
[ "0.7596756", "0.71405804", "0.6620177", "0.6345488", "0.6211664", "0.6198132", "0.6175653", "0.61720866", "0.6139353", "0.60621643", "0.60227144", "0.60011643", "0.5937554", "0.59227675", "0.58920753", "0.58731914", "0.58703643", "0.586539", "0.5859682", "0.5834022", "0.57553...
0.7499768
1
turns a midi note off. Note must be on. Output.note_off(note, velocity=0, channel=0) note is an integer from 0 to 127 velocity is an integer from 0 to 127 (release velocity) channel is an integer from 0 to 15 Turn a note off in the output stream. The note must already be on for this to work correctly.
def note_off(self, note, velocity=0, channel=0): if not 0 <= channel <= 15: raise ValueError("Channel not between 0 and 15.") self.write_short(0x80 + channel, note, velocity)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_note_off(self, note=60, velocity=0, ch=None):\n self.send_channel_message(NOTE_OFF, note, velocity, ch=ch)", "def send_all_notes_off(self, ch=None):\n self.send_control_change(ALL_NOTES_OFF, 0, ch=ch)", "def note_off(self, channel, key, velocity):\n log.debug(\"WinchMIDILogic rece...
[ "0.79659575", "0.6555073", "0.6434429", "0.6037967", "0.5972276", "0.59586877", "0.5936766", "0.5906997", "0.58888584", "0.58817726", "0.58514315", "0.5849906", "0.57724184", "0.5766596", "0.57500625", "0.5740246", "0.57222235", "0.5715646", "0.5582674", "0.5579068", "0.55757...
0.7337855
1
returns the Ansi Note name for a midi number.
def midi_to_ansi_note(midi_note): notes = ["A", "A#", "B", "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#"] num_notes = 12 note_name = notes[int((midi_note - 21) % num_notes)] note_number = (midi_note - 12) // num_notes return f"{note_name}{note_number}"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _midi_to_note(self, midi_note: int) -> str:\n return constants.MIDI_TO_NOTES[midi_note][0]", "def getNoteLetter(self):\n if self.noteName != None and self.noteName != \"\":\n return self.noteName[0]\n else:\n return \"\"", "def getNoteName(self):\n return s...
[ "0.7424283", "0.64719594", "0.6344131", "0.6218995", "0.6144893", "0.6049338", "0.6036549", "0.6022637", "0.5914489", "0.5914489", "0.5914489", "0.5755851", "0.5745317", "0.5737554", "0.57128763", "0.56990564", "0.56805706", "0.56452733", "0.56289667", "0.5602271", "0.5559806...
0.7344328
1
Sets the id of this ZacksEPSSurpriseSummary.
def id(self, id): self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetId(self, id):\n self.id = int(id)", "def set_id(self, id):\n self.__id = id", "def set_id(self, id_):\n\n self.id_ = id_", "def set_id(self, id):\n self.data['id'] = id", "def id(self, id):\n \n self._id = id", "def id(self, id):\n \n self._i...
[ "0.6705742", "0.6648998", "0.66245824", "0.65638924", "0.651038", "0.651038", "0.651038", "0.651038", "0.651038", "0.6504727", "0.6504727", "0.6504727", "0.6504727", "0.6504727", "0.6504727", "0.6504727", "0.6504727", "0.6504727", "0.6504727", "0.6467074", "0.6467074", "0.6...
0.0
-1
Sets the actual_reported_date of this ZacksEPSSurpriseSummary.
def actual_reported_date(self, actual_reported_date): self._actual_reported_date = actual_reported_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def actual_reported_time(self, actual_reported_time):\n\n self._actual_reported_time = actual_reported_time", "def actual_reported_desc(self, actual_reported_desc):\n\n self._actual_reported_desc = actual_reported_desc", "def actual_reported_code(self, actual_reported_code):\n\n self._actu...
[ "0.68168414", "0.66969454", "0.5711135", "0.545208", "0.54077923", "0.54045695", "0.5323684", "0.5323684", "0.53009677", "0.5259019", "0.5259019", "0.524832", "0.5241506", "0.522606", "0.51777023", "0.51777023", "0.51777023", "0.51777023", "0.51777023", "0.51777023", "0.51777...
0.8531986
0
Sets the actual_reported_time of this ZacksEPSSurpriseSummary.
def actual_reported_time(self, actual_reported_time): self._actual_reported_time = actual_reported_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def actual_reported_date(self, actual_reported_date):\n\n self._actual_reported_date = actual_reported_date", "def actual_reported_desc(self, actual_reported_desc):\n\n self._actual_reported_desc = actual_reported_desc", "def set_umeastime(self, time):\n self.utime = time", "def rejected...
[ "0.701044", "0.6810117", "0.5564027", "0.55543506", "0.5522467", "0.54617625", "0.539025", "0.53619623", "0.53619623", "0.53264856", "0.5311299", "0.509753", "0.5055156", "0.50488114", "0.50488114", "0.502645", "0.502645", "0.502645", "0.5001926", "0.49952546", "0.49857408", ...
0.84131885
0
Sets the eps_actual of this ZacksEPSSurpriseSummary.
def eps_actual(self, eps_actual): self._eps_actual = eps_actual
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setTolerance(self, eps):\n self._simulator_.update(eps=eps)\n return", "def actual(self, actual):\n\n self._actual = actual", "def actual(self, actual):\n\n self._actual = actual", "def eps_std_dev_estimate(self, eps_std_dev_estimate):\n\n self._eps_std_dev_estimate = e...
[ "0.6466235", "0.61367756", "0.61367756", "0.6084746", "0.595881", "0.5838524", "0.58198535", "0.5746944", "0.572031", "0.56509256", "0.55779433", "0.53765965", "0.53148246", "0.51251", "0.51141983", "0.49583092", "0.49133393", "0.48819152", "0.4800654", "0.4739398", "0.473750...
0.85233676
0
Sets the eps_count_estimate of this ZacksEPSSurpriseSummary.
def eps_count_estimate(self, eps_count_estimate): self._eps_count_estimate = eps_count_estimate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eps_mean_estimate(self, eps_mean_estimate):\n\n self._eps_mean_estimate = eps_mean_estimate", "def esxi_host_count(self, esxi_host_count):\n\n self._esxi_host_count = esxi_host_count", "def set_article_count(cls, count):\n return cls.db.set(\"article_count\", count)", "def eps_std_de...
[ "0.61652166", "0.5902981", "0.5884286", "0.5620953", "0.5486185", "0.53570443", "0.52857256", "0.5270576", "0.52693754", "0.5226665", "0.5221407", "0.52161694", "0.5169238", "0.5168896", "0.51224285", "0.51224285", "0.51224285", "0.51224285", "0.5118172", "0.51125413", "0.507...
0.8626549
0
Sets the eps_std_dev_estimate of this ZacksEPSSurpriseSummary.
def eps_std_dev_estimate(self, eps_std_dev_estimate): self._eps_std_dev_estimate = eps_std_dev_estimate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_stddev(self):\r\n for i in range(1,len(self.data[0])):\r\n self.stddev.append(np.std(self.data[:,i]))", "def set_stdeviations(self, sigma):\n stdeviations = np.ones(len(self.phenotypes)) * sigma\n self.data['stdeviations'] = stdeviations\n return self", "d...
[ "0.60742307", "0.6068721", "0.603017", "0.5816552", "0.57548743", "0.5689732", "0.56560314", "0.56022733", "0.55775946", "0.55485165", "0.5539166", "0.5505066", "0.5477183", "0.5408408", "0.53998953", "0.53989637", "0.5375006", "0.5372551", "0.534882", "0.53399366", "0.533617...
0.8798974
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, ZacksEPSSurpriseSummary): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Account's Organization ID property is fetched.
def test_org_id(api: API): org_id = 123456 api.user.login.return_value = [{"orgId": org_id}] account = Account(api, "USERNAME", "PASSWORD") assert account._org_id is None api.user.login.reset_mock() account.org_id assert account.org_id == org_id api.user.login.assert_called_once()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def organization_id(self):\n return self._organization_id", "def organization_id(self) -> str:\n return pulumi.get(self, \"organization_id\")", "def organization_id(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"organization_id\")", "def find_organization(self):\n ...
[ "0.7128527", "0.7055206", "0.67133105", "0.66713405", "0.6504657", "0.6379013", "0.6379013", "0.63188624", "0.62676734", "0.6211185", "0.61949676", "0.6192463", "0.6142035", "0.6114156", "0.6065943", "0.6064904", "0.60637575", "0.6024701", "0.60176945", "0.601413", "0.5974296...
0.6422186
5
Should raise IndexError when no owner or more than one.
def test_no_owner_exception(api: API, owners: list): api.candlepin.get_owners.return_value = owners account = Account(api, "USERNAME", "PASSWORD") with pytest.raises(IndexError): account.owner_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_owner(data=None, **kw):\n if data and 'owner_id' in data and not data['owner_id'] == current_user.id:\n raise ProcessingException(description=\"No write privileges\",\n code=401)", "def test_list_members_with_owner_rights(self):\n url = '/api/v1/communities/4/retrieve_member...
[ "0.63105494", "0.606564", "0.60498", "0.59998184", "0.5988194", "0.5969196", "0.59655756", "0.59643877", "0.5904818", "0.58963203", "0.58249295", "0.58106273", "0.57679254", "0.5754556", "0.5741087", "0.5721135", "0.5715831", "0.5684382", "0.56795704", "0.5620101", "0.5575554...
0.7116809
0
Yield items from iterable until a time duration has passed. itime yields items from seq until more time than 'seconds' has passed. It always yields at least one item. This does nothing to stop a longrunning sequence operation; it is possible that itime will take considerably longer than 'seconds' to yield, but it will ...
def itime(iterable, seconds): items = iter(iterable) end = time.time() + seconds yield items.next() for item in itertools.takewhile(lambda _: time.time() < end, items): yield item
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sleep(seconds: typing.Union[float, int]):\n if seconds == 0:\n yield\n elif seconds == inf:\n yield from sleepinf()\n else:\n end = monotonic() + seconds\n while end >= monotonic():\n yield", "def delay(iterator, wait = 1, every = 1):\n for i, photo in enume...
[ "0.6236014", "0.5961773", "0.58764493", "0.58764493", "0.5751974", "0.5680032", "0.56157696", "0.55930865", "0.5568368", "0.5401637", "0.53974783", "0.5389004", "0.5352733", "0.5337134", "0.5284676", "0.5275748", "0.52442247", "0.52269316", "0.522643", "0.5218658", "0.5174768...
0.7524734
0
Get a wall iterator object.
def list() -> Iterator['Wall']: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self) -> object:\n return LinkedListIterator(self)", "def getIter(object):\n iterator = None\n try:\n iterator = iter(object)\n except TypeError:\n pass\n return iterator", "def __next__(self):\n return next(self.iterator)", "def __iter__(self) -> object:\...
[ "0.60317326", "0.56871676", "0.56780714", "0.5581569", "0.55719656", "0.556267", "0.5545944", "0.55420893", "0.55420893", "0.5537623", "0.5521231", "0.5521231", "0.5521231", "0.5510939", "0.5422368", "0.5414866", "0.5411225", "0.54066217", "0.5403787", "0.53720677", "0.533234...
0.671326
0
() > bool. Get the convexity status. The wall must also be closed to be convex.
def convex(self, *args, **kwargs) -> Any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convex(self):\n # Convex has positive curvature (2nd derivative)\n # f\"(x) = 2a, so a > 0 corresponds to convex\n return (self.a > 0)", "def closed_v(self):\n sa = ShapeAnalysis_Surface(self.surface())\n return sa.IsVClosed()", "def comprobar_colision(self):\n ret...
[ "0.6898476", "0.6235601", "0.592507", "0.5906559", "0.5805142", "0.58048207", "0.5763753", "0.5587436", "0.54327667", "0.5358236", "0.5349329", "0.5347917", "0.5342573", "0.5314318", "0.5305815", "0.52530354", "0.5226104", "0.5225733", "0.522544", "0.52055585", "0.5205003", ...
0.58094496
4
() > vec. Get the wall displacement (vector).
def disp(self, *args, **kwargs) -> Any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wind_vector(v_total, v_aircraft, mag_angle=True):\n # wind = total - aircraft\n\n\n vwind = v_total - v_aircraft\n if mag_angle:\n return np.linalg.norm(vwind), head360(np.arctan2(vwind[1], vwind[0]))\n else:\n return vwind", "def vector(self) -> Vector:\n return self._normal...
[ "0.6224175", "0.5939877", "0.59024817", "0.5864084", "0.58582634", "0.5853964", "0.57996976", "0.57802194", "0.57482725", "0.5742215", "0.5728932", "0.57113206", "0.5706278", "0.5704774", "0.5692985", "0.56876785", "0.56875956", "0.56763506", "0.5659987", "0.56547344", "0.564...
0.0
-1
() > float. Get the xcomponent of the wall displacement.
def disp_x(self, *args, **kwargs) -> Any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_x(self):\n\t\treturn self._collision_rect.x + 14", "def _get_x(self):\n return self.position.x", "def x_coord(self):\n\n return self.x0 + np.arange(self.nx) * self.dx", "def get_x(self):\n return self.coords[0]", "def get_ship_x(self):\n return self.x", "def x(self):\n...
[ "0.74706626", "0.73020965", "0.7184606", "0.7088355", "0.70499843", "0.70326936", "0.70077795", "0.69591296", "0.695036", "0.69430107", "0.6936672", "0.69250476", "0.6912408", "0.69088185", "0.6887386", "0.68730545", "0.6849947", "0.6778123", "0.66565055", "0.6642609", "0.658...
0.0
-1
() > float. Get the ycomponent of the wall displacement.
def disp_y(self, *args, **kwargs) -> Any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_y(self):\n\t\treturn self._collision_rect.y + 25", "def __get_y__(self):\n return self.Direction['y']", "def y_coord(self):\n\n return self.y0 + np.arange(self.ny) * self.dy", "def get_y(self):\n return self.coords[1]", "def _get_y(self):\n return self.position.y", "de...
[ "0.74068475", "0.7171285", "0.7116237", "0.70455", "0.70232403", "0.6989615", "0.6975394", "0.6974551", "0.6916728", "0.68973166", "0.68973166", "0.6886731", "0.68781024", "0.68559664", "0.6848864", "0.68477756", "0.6734545", "0.67291254", "0.668517", "0.66662633", "0.6647230...
0.0
-1
() > Facet iterator object. Get the facets of the wall.
def facets(self, *args, **kwargs) -> Any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facets(self):\n return self._facets", "def facet_with_holes(self,):\n return self.facet_with_holes_", "def facets(self) -> list[Polytope]:\n first_polygon_index = self.rank - max(self.pdim - 1, 1) - 1\n slices = (slice(None),) * first_polygon_index\n return [self._cast_po...
[ "0.6280974", "0.60779077", "0.6032516", "0.5883611", "0.58661383", "0.5797664", "0.5782849", "0.57489246", "0.5744401", "0.5701825", "0.5657243", "0.5655332", "0.56355864", "0.56233317", "0.55976784", "0.55571175", "0.55554414", "0.5513439", "0.5511666", "0.550874", "0.547957...
0.5566549
15
() > vec. Get the wall contact force (vector).
def force_contact(self, *args, **kwargs) -> Any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_force_vector(self) -> NDArray:\n\n forces = flatten(\n [[node.force.fx, node.force.fy] for node in self.nodes]\n )\n return np.array(forces, dtype=np.float64).reshape(\n self.get_number_of_dofs(), 1\n )", "def force_vec(x, y, z):\n npts = x.size\n\n ...
[ "0.6585395", "0.653294", "0.59939665", "0.59491163", "0.59065646", "0.58145255", "0.5724359", "0.560295", "0.5570669", "0.5518169", "0.5495252", "0.5489391", "0.548903", "0.54811573", "0.54778683", "0.5437795", "0.5424427", "0.5408871", "0.5392216", "0.53897613", "0.5374668",...
0.0
-1
() > float. Get the xcomponent of the wall contact force.
def force_contact_x(self, *args, **kwargs) -> Any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_x(self):\n\t\treturn self._collision_rect.x + 14", "def meshx(self):\n if self._meshx is None:\n self._meshx = self.get_mesh_coord(1)\n\n return self._meshx", "def _get_x(self):\n return self.position.x", "def get_x(self):\n return self.coords[0]", "def x(self...
[ "0.72568417", "0.70376354", "0.6943432", "0.6783288", "0.6661554", "0.66605264", "0.6651339", "0.66349953", "0.6610258", "0.6605144", "0.660354", "0.6602773", "0.6576795", "0.65394825", "0.65210897", "0.65099704", "0.64690405", "0.6403037", "0.639221", "0.63839227", "0.638059...
0.60653305
69
() > float. Get the ycomponent of the wall contact force.
def force_contact_y(self, *args, **kwargs) -> Any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_y(self):\n\t\treturn self._collision_rect.y + 25", "def meshy(self):\n if self._meshy is None:\n self._meshy = self.get_mesh_coord(2)\n\n return self._meshy", "def getY(self):\n return self.components[1]", "def getY(self):\n return self.components[1]", "def __...
[ "0.70550585", "0.6869239", "0.6782376", "0.6782376", "0.6622112", "0.66108686", "0.6569134", "0.653353", "0.6490925", "0.6488635", "0.64389586", "0.63822395", "0.6381248", "0.6376718", "0.637364", "0.6362668", "0.6353543", "0.63176405", "0.63176405", "0.63168687", "0.6302178"...
0.58790785
74
() > float. Get the xcomponent of the wall location.
def pos_x(self, *args, **kwargs) -> Any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_x(self):\n return self.position.x", "def get_x(self):\n return self.coords[0]", "def x(self):\n return self.coords[0]", "def get_x(self):\n\t\treturn self._collision_rect.x + 14", "def x(self):\n return self._coords[0]", "def Getxcoord(self):\n return self.x_co...
[ "0.7680517", "0.7604602", "0.75347817", "0.75214434", "0.75099665", "0.740468", "0.73987067", "0.73864615", "0.73223615", "0.7315249", "0.7269881", "0.72563225", "0.7230882", "0.7166776", "0.7120091", "0.7097732", "0.7044006", "0.7020607", "0.6986002", "0.68578154", "0.682210...
0.0
-1
() > float. Get the ycomponent of the wall location.
def pos_y(self, *args, **kwargs) -> Any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_y(self):\n\t\treturn self._collision_rect.y + 25", "def get_y(self):\n return self.coords[1]", "def _get_y(self):\n return self.position.y", "def __get_y__(self):\n return self.Direction['y']", "def y(self):\n return self.coords[1]", "def getYCoordinate(self) -> float:...
[ "0.7485223", "0.743734", "0.7381422", "0.73317033", "0.7314091", "0.73011124", "0.72982925", "0.72736025", "0.7212403", "0.71569115", "0.70441824", "0.70441824", "0.70157206", "0.70143765", "0.69891894", "0.69693416", "0.69601876", "0.69601876", "0.69584227", "0.69406366", "0...
0.0
-1
() > float. Get the ycomponent of the wall center of rotation.
def rotation_center_y(self, *args, **kwargs) -> Any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def y(self) -> int:\n return self.data.y_centre >> 4", "def center(self):\n return self.pos + self.axis / 2.0", "def get_y(self):\n\t\treturn self._collision_rect.y + 25", "def center(self):\n return (self.upper_right + self.lower_left) * 0.5", "def get_ly(self):\r\n return self...
[ "0.7139358", "0.6812508", "0.67421776", "0.66988766", "0.66586465", "0.65992194", "0.6565008", "0.65630996", "0.6554871", "0.65501976", "0.6548346", "0.6530891", "0.6529784", "0.6529784", "0.64847934", "0.6480366", "0.64669913", "0.6447535", "0.6439091", "0.6434639", "0.64346...
0.7037135
1
() > float. Get the wall servo cap velocity.
def servo_vmax(self, *args, **kwargs) -> Any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_velocity(self):\n return (self._I85_msg_from_device(self.node.sdo[0x606c].phys)) / 10 # rad/s", "def velocity(self):\n return self.base_platform.velocity", "def v(self):\n\n # TODO This translation formula works, but needs simplified.\n\n # PWM duration can go from 0 to 4095 wit...
[ "0.72953326", "0.72366923", "0.72223437", "0.72120464", "0.72091067", "0.6995999", "0.6995999", "0.6919806", "0.68906176", "0.6831061", "0.67403567", "0.66936356", "0.6675522", "0.66306967", "0.661316", "0.6601191", "0.6597746", "0.6591298", "0.6569652", "0.65283686", "0.6430...
0.0
-1
() > float. Get the xcomponent of the wall velocity.
def vel_x(self, *args, **kwargs) -> Any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getXVelocity(self):\n return self.xvelocity", "def getVelX(self):\n return self.posvel.getX()", "def getXVelocity(self):\n return self._vx", "def get_x(self):\n\t\treturn self._collision_rect.x + 14", "def get_speed_x(self):\n return self.__speed_x", "def _get_x(self):\n ...
[ "0.75399595", "0.7366147", "0.7285119", "0.7054074", "0.6978753", "0.690405", "0.68617094", "0.6853181", "0.67167425", "0.67044723", "0.6649126", "0.6637395", "0.66089165", "0.6603193", "0.65410364", "0.6533002", "0.65251386", "0.6522925", "0.6520926", "0.6510428", "0.6510379...
0.66781986
10
() > float. Get the ycomponent of the wall velocity.
def vel_y(self, *args, **kwargs) -> Any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getYVelocity(self):\n return self.yvelocity", "def getYVelocity(self):\n return self._vy", "def getVelY(self):\n return self.posvel.getY()", "def get_speed_y(self):\r\n return self.__y_speed", "def get_speed_y(self):\n return self.__speed_y", "def get_y(self):\n\t\t...
[ "0.7757967", "0.76523584", "0.7433482", "0.7405905", "0.72896373", "0.7093733", "0.7058527", "0.7015598", "0.6954075", "0.6937417", "0.6856297", "0.6856297", "0.6801032", "0.68001324", "0.6780442", "0.6768924", "0.67525524", "0.67232746", "0.67232746", "0.67230254", "0.671578...
0.7200923
5
Gets the version of this Problem.
def version(self) -> int: return self._version
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_version(self):\n return self.version", "def get_version(self):\n return self._version", "def get_version(self):\n return self._version", "def get_version(self):\n return version.__version__", "def get_version(self):\n return version.__version__", "def get(self):...
[ "0.80967134", "0.80827403", "0.80827403", "0.7924125", "0.7924125", "0.79217106", "0.7911584", "0.7807025", "0.77549684", "0.77348715", "0.7722226", "0.7719727", "0.7684752", "0.76686037", "0.7640391", "0.7640391", "0.7640391", "0.7640391", "0.7640391", "0.7640391", "0.764039...
0.7331858
73
Split a string on null characters.
def zsplit(s: str) -> List[str]: s = s.strip("\0") if s: return s.split("\0") else: return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_split_string_empty_string(self):\n self.assertFalse(split_string(\"\"))", "def try_split(text, chars=(u'—', '-')):\n for c in chars:\n segments = text.split(c)\n if len(segments) > 1:\n return [s.strip() for s in segments]", "def split_or_none(fld):\n if fld i...
[ "0.6682414", "0.6545063", "0.63807505", "0.6359497", "0.62307394", "0.6226817", "0.6053231", "0.601666", "0.60003495", "0.59911466", "0.594573", "0.59279126", "0.59255487", "0.58801824", "0.587283", "0.5721435", "0.56918263", "0.56338483", "0.5610692", "0.56016564", "0.557036...
0.6647786
1
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues): if normalize: cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis] print("Normalized confusio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n...
[ "0.8194862", "0.80949175", "0.8029915", "0.8019153", "0.79941195", "0.7991258", "0.7980955", "0.7976606", "0.79610753", "0.79590565", "0.79378676", "0.7934962", "0.7934504", "0.79313844", "0.7926313", "0.79241234", "0.7923211", "0.7923023", "0.7921931", "0.7917871", "0.791609...
0.7924577
15
Return the reverse rule. At this stage, reverse rules can only be created for equivalence rules.
def to_equivalence_rule(self) -> "EquivalenceRule": assert ( self.is_equivalence() ), f"EquivalenceRule can only be created for equivalence rules\n{self}" return EquivalenceRule(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_reverse_rule(self) -> \"ReverseRule\":\n assert (\n self.is_equivalence()\n ), \"reverse rule can only be created for equivalence rules\"\n return ReverseRule(self)", "def reversed_edge(self):\n reverse = Edge(id=self.id,\n start_node=self.end_n...
[ "0.8749442", "0.701795", "0.6923783", "0.68340147", "0.68269473", "0.66056406", "0.65946716", "0.6501034", "0.6430362", "0.64122367", "0.64060086", "0.6389224", "0.63062704", "0.623758", "0.6226799", "0.6149912", "0.61382943", "0.6093404", "0.60657674", "0.60492027", "0.60124...
0.60024023
22
Return the reverse rule. At this stage, reverse rules can only be created for equivalence rules.
def to_reverse_rule(self) -> "ReverseRule": assert ( self.is_equivalence() ), "reverse rule can only be created for equivalence rules" return ReverseRule(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reversed_edge(self):\n reverse = Edge(id=self.id,\n start_node=self.end_node,\n end_node=self.start_node,\n cost=self.reverse_cost,\n reverse_cost=self.cost,\n reversed=not self.reversed)\n ...
[ "0.701795", "0.6923783", "0.68340147", "0.68269473", "0.66056406", "0.65946716", "0.6501034", "0.6430362", "0.64122367", "0.64060086", "0.6389224", "0.63062704", "0.623758", "0.6226799", "0.6149912", "0.61382943", "0.6093404", "0.60657674", "0.60492027", "0.6012407", "0.60054...
0.8749442
0
`Resource` object that represents the `resource` property in `io.argoproj.workflow.v1alpha1.Template`.
def resource(self): return self._resource
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource(self):\n return self.properties.get('resource',\n Entity(self.context, ResourcePath(\"resource\", self.resource_path)))", "def resource(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"resource\")", "def resource(self) -> Optional[pu...
[ "0.7202855", "0.7166151", "0.7166151", "0.7166151", "0.6523865", "0.6426623", "0.6387373", "0.635301", "0.6308206", "0.6268019", "0.62651926", "0.61796653", "0.6106182", "0.6059936", "0.6059936", "0.6059936", "0.6059936", "0.6059936", "0.6059936", "0.6059936", "0.6059936", ...
0.6576444
9
`Resource` object that represents the `resource` property in `io.argoproj.workflow.v1alpha1.Template`.
def resource(self): return self._resource
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource(self):\n return self.properties.get('resource',\n Entity(self.context, ResourcePath(\"resource\", self.resource_path)))", "def resource(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"resource\")", "def resource(self) -> Optional[pu...
[ "0.72062236", "0.71678215", "0.71678215", "0.71678215", "0.65227765", "0.64285666", "0.6385131", "0.63562524", "0.6305826", "0.6269993", "0.6262465", "0.61771417", "0.6104658", "0.6060945", "0.6060945", "0.6060945", "0.6060945", "0.6060945", "0.6060945", "0.6060945", "0.60609...
0.65788156
8
This test was originally built with djangononrel 1.6 which had an error when flushing the database after each test. So the flush is performed manually with this custom tearDown()
def wipe_test_data(db='default'): import ikwen_shavida.movies.models import ikwen_shavida.reporting.models import ikwen_shavida.sales.models import ikwen_shavida.shavida.models import ikwen.partnership.models import ikwen.core.models for name in ('Category', 'Trailer', 'Movie', 'SeriesEpisod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tearDown(self):\r\n testing.tearDown()\r\n empty_db()", "def tearDown(self):\r\n testing.tearDown()\r\n empty_db()", "def tearDown(self):\r\n testing.tearDown()\r\n empty_db()", "def tearDown(self):\r\n testing.tearDown()\r\n empty_db()", "def tea...
[ "0.835734", "0.835734", "0.835734", "0.835734", "0.835734", "0.835734", "0.835734", "0.835734", "0.835734", "0.8139241", "0.8139241", "0.8139241", "0.8139241", "0.8139241", "0.8139241", "0.80715996", "0.79661006", "0.79362744", "0.790229", "0.790229", "0.78844255", "0.78611...
0.0
-1
This test was originally built with djangononrel 1.6 which had an error when flushing the database after each test. So the flush is performed manually with this custom tearDown()
def tearDown(self): for name in ('Config', 'FlatPage'): model = getattr(shavida.models, name) model.objects.all().delete() # def test_is_first_refill_with_member_who_never_refilled(self): # customer = Member.objects.create_user(account_type=Member.CUSTOMER, u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tearDown(self):\r\n testing.tearDown()\r\n empty_db()", "def tearDown(self):\r\n testing.tearDown()\r\n empty_db()", "def tearDown(self):\r\n testing.tearDown()\r\n empty_db()", "def tearDown(self):\r\n testing.tearDown()\r\n empty_db()", "def tea...
[ "0.83561087", "0.83561087", "0.83561087", "0.83561087", "0.83561087", "0.83561087", "0.83561087", "0.83561087", "0.83561087", "0.81388044", "0.81388044", "0.81388044", "0.81388044", "0.81388044", "0.81388044", "0.80704635", "0.79652935", "0.7936042", "0.7901099", "0.7901099", ...
0.0
-1
This function takes two integers and returns the L.C.M.
def lcm(x, y): # choose the greater number if x > y: greater = x else: greater = y while (True): if ((greater % x == 0) and (greater % y == 0)): lcm = greater break greater += 1 return lcm
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lcmu(a, b):\n return (abs(a)*abs(b))//gcdi(a, b)", "def main():\n num_1 = 12\n num_2 = 76\n print(find_lcm(num_1, num_2))", "def lcms(argg: range) -> int:\n l = 1\n for arg in argg:\n l = lcm(l, arg)\n return l", "def lcmm(*args): \n return functools.reduce(lcm, args) ...
[ "0.70547134", "0.6673959", "0.64242965", "0.63771755", "0.62594885", "0.6247478", "0.62116", "0.62116", "0.62116", "0.6197844", "0.6145786", "0.60987806", "0.603726", "0.60279113", "0.6026516", "0.60098547", "0.60025394", "0.5975837", "0.5971994", "0.59695655", "0.59519047", ...
0.0
-1
The size of the square.
def size(self): return self.width
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSize(self):\n return self.__width * self.__height;", "def size(self):\n return (self.width)", "def size(self) -> Point:\n\t\treturn self._size", "def size(self):\n\n return self.width", "def __len__(self) -> int:\n return self.width * self.height", "def __len__(self):\n...
[ "0.82243115", "0.79573005", "0.77987725", "0.7789006", "0.7752895", "0.7725954", "0.77150583", "0.77004164", "0.7643583", "0.76431185", "0.7585037", "0.7551754", "0.7522248", "0.749531", "0.7488594", "0.74738073", "0.7441529", "0.74314916", "0.7431062", "0.7420518", "0.740649...
0.7936446
8
String representation of a square instance.
def __str__(self): return "[Square] ({:d}) {:d}/{:d} - {:d}".format( self.id, self.x, self.y, self.width)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n string = \"[Square] ({}) {}/{} - {}\".format(\n self.id, self.x, self.y, self.width)\n return string", "def __str__(self):\n string = \"[Square] ({}) {}/{} - {}\"\\\n .format(self.id, self.x, self.y, self.width)\n return(string)", "def __st...
[ "0.87614", "0.8754021", "0.8673985", "0.86061716", "0.8572117", "0.8566691", "0.8541423", "0.8536344", "0.8467408", "0.83911073", "0.8368878", "0.836661", "0.779268", "0.77175385", "0.7687338", "0.76623744", "0.757954", "0.7494825", "0.7487963", "0.7443961", "0.74392617", "...
0.8297757
12
Updates the rectangle instance.
def update(self, *args, **kwargs): if args: arg_order = ["id", "size", "x", "y"] for index, arg in enumerate(args): setattr(self, arg_order[index], arg) elif kwargs: for key, value in kwargs.items(): if hasattr(self, key): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self):\n self.rect = (self.x, self.y, self.width, self.height)", "def update_rect(self):\n self._update_vertex_list()", "def update_rect(self):\n self._update_tiles()", "def update(self):\r\n self.rect = pygame.Rect(self.x, self.y, self.width, self.height)", "def set_...
[ "0.79394966", "0.7811028", "0.7473065", "0.74336785", "0.7144201", "0.71288186", "0.71288186", "0.7060831", "0.6909748", "0.6899092", "0.685372", "0.6825702", "0.6792024", "0.6585319", "0.65658146", "0.6442892", "0.63723063", "0.6355014", "0.6330307", "0.6317672", "0.6243667"...
0.0
-1
InlineResponse201 a model defined in Swagger
def __init__(self, ns_id: str=None): # noqa: E501 self.swagger_types = { "ns_id": str } self.attribute_map = { "ns_id": "nsId" } self._ns_id = ns_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def opt_model_create_rest_api():\n request_json = request.get_json()\n OptimModelRequestAPI(request_json).validate()\n return create_model_data(request_json)", "def _create_response_model(self, data):\n pass", "def test_basic_api_inline_openapi(self):\n self.create_and_verify_stack(\"sin...
[ "0.5989621", "0.580162", "0.57909155", "0.5753123", "0.5727388", "0.5697784", "0.5688931", "0.5681504", "0.5654229", "0.563743", "0.56268144", "0.5619129", "0.54649264", "0.54621583", "0.5425548", "0.5380274", "0.5321659", "0.52964556", "0.52725905", "0.52725905", "0.52725905...
0.0
-1
Sets the ns_id of this InlineResponse201.
def ns_id(self, ns_id: str): if ns_id is None: raise ValueError("Invalid value for `ns_id`, must not be `None`") # noqa: E501 self._ns_id = ns_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, ns_id: str=None): # noqa: E501\n self.swagger_types = {\n \"ns_id\": str\n }\n\n self.attribute_map = {\n \"ns_id\": \"nsId\"\n }\n\n self._ns_id = ns_id", "def response_id(self, response_id):\n\n self._response_id = response_id"...
[ "0.61780965", "0.5512151", "0.53878105", "0.5316241", "0.53150743", "0.52578086", "0.5142433", "0.51382846", "0.5131659", "0.5129715", "0.5065332", "0.50602263", "0.4927254", "0.4926404", "0.49076232", "0.49036375", "0.48710322", "0.4857789", "0.48565874", "0.48386243", "0.48...
0.6571293
0
Test case for ipam_aggregates_delete
def test_ipam_aggregates_delete(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ipam_aggregates_create(self):\n pass", "def test_delete_derived_metric(self):\n pass", "def test_ipam_aggregates_update(self):\n pass", "def test_delete_records(self):\n pass", "def test_ipam_rirs_delete(self):\n pass", "def test_delete_collection_group(self):\...
[ "0.70798033", "0.70438576", "0.7024303", "0.67659044", "0.66888255", "0.66610384", "0.66531944", "0.660948", "0.657511", "0.6525161", "0.65070975", "0.65064913", "0.6501194", "0.64994925", "0.6488492", "0.64842564", "0.64842564", "0.64422244", "0.630343", "0.6285729", "0.6258...
0.938244
0
Test case for ipam_ip_addresses_create
def test_ipam_ip_addresses_create(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ipam_ip_addresses_list(self):\n pass", "def test_ipam_ip_addresses_read(self):\n pass", "def test_ipam_ip_addresses_update(self):\n pass", "def test_ip_addresses_exists():\n load_ips()\n validate_names()", "def test_ipam_prefixes_available_ips_create(self):\n pass", ...
[ "0.82808876", "0.7831449", "0.77437305", "0.7548137", "0.74714524", "0.74468184", "0.69926816", "0.6946564", "0.6914378", "0.6869155", "0.6746963", "0.6728086", "0.6711488", "0.66043824", "0.65606475", "0.6547258", "0.65107965", "0.65100193", "0.6469459", "0.6468395", "0.6449...
0.9459937
0
Test case for ipam_ip_addresses_partial_update
def test_ipam_ip_addresses_partial_update(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ipam_ip_addresses_update(self):\n pass", "def test_client_address_partial_update(self):\n pass", "def test_ipam_services_partial_update(self):\n pass", "def test_ipam_vlans_partial_update(self):\n pass", "def test_ipam_aggregates_partial_update(self):\n pass", ...
[ "0.8339371", "0.7886014", "0.75330853", "0.7243439", "0.71379566", "0.70831835", "0.68122435", "0.66551894", "0.6644185", "0.6627974", "0.65195924", "0.6472143", "0.62300867", "0.6177525", "0.61126584", "0.60810363", "0.6052762", "0.6038097", "0.60198456", "0.5959115", "0.594...
0.9464286
0
Test case for ipam_prefixes_available_ips_create
def test_ipam_prefixes_available_ips_create(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ipam_prefixes_available_prefixes_create(self):\n pass", "def test_ipam_prefixes_available_ips_read(self):\n pass", "def test_ipam_prefixes_create(self):\n pass", "def test_ipam_prefixes_available_prefixes_read(self):\n pass", "def test_ipam_prefixes_list(self):\n ...
[ "0.8504896", "0.8286987", "0.77604014", "0.75081974", "0.71642566", "0.7090549", "0.6792215", "0.6585768", "0.6482139", "0.64628816", "0.6428612", "0.6420105", "0.61440593", "0.600998", "0.5896196", "0.57991415", "0.5774098", "0.5765244", "0.5746875", "0.57380694", "0.5659199...
0.93921536
0
Test case for ipam_services_partial_update
def test_ipam_services_partial_update(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ipam_services_update(self):\n pass", "def test_ipam_vrfs_partial_update(self):\n pass", "def test_client_partial_update(self):\n pass", "def test_ipam_rirs_partial_update(self):\n pass", "def test_ipam_aggregates_partial_update(self):\n pass", "def test_partial...
[ "0.7770778", "0.7709954", "0.75247055", "0.7373111", "0.7219698", "0.7214335", "0.7100145", "0.70857716", "0.6967914", "0.69674456", "0.6927653", "0.6895124", "0.6730524", "0.6658923", "0.6604704", "0.6598725", "0.6481544", "0.6411723", "0.6370745", "0.63416916", "0.63271624"...
0.93644553
0
Test case for ipam_services_update
def test_ipam_services_update(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ipam_services_partial_update(self):\n pass", "def test_modify_virtual_service(self):\n pass", "def test_update_vpnservice(self):\r\n resource = 'vpnservice'\r\n cmd = vpnservice.UpdateVPNService(test_cli20.MyApp(sys.stdout), None)\r\n self._test_update_resource(resou...
[ "0.8236926", "0.76386976", "0.73734957", "0.70296514", "0.7015333", "0.6986483", "0.67292815", "0.66827095", "0.6630699", "0.6540319", "0.65233463", "0.65117294", "0.6463316", "0.6448871", "0.6426391", "0.6393547", "0.6391673", "0.6356453", "0.6207556", "0.6184405", "0.609205...
0.91758585
0
The Amazon Resource Name (ARN) of this auto scaling configuration.
def auto_scaling_configuration_arn(self) -> Optional[str]: return pulumi.get(self, "auto_scaling_configuration_arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def auto_scaling_configuration_arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"auto_scaling_configuration_arn\")", "def auto_scaling_configuration_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"auto_scaling_configuration_arn\")", "def auto_scaling_configuration...
[ "0.8340543", "0.8165822", "0.8165822", "0.7433724", "0.7433724", "0.7336617", "0.7091512", "0.6819985", "0.6819985", "0.6819985", "0.6819985", "0.6819985", "0.6819985", "0.6819985", "0.6819985", "0.6819985", "0.6819985", "0.6819985", "0.6819985", "0.6819985", "0.6819985", "...
0.8287464
1
It's set to true for the configuration with the highest Revision among all configurations that share the same AutoScalingConfigurationName. It's set to false otherwise. App Runner temporarily doubles the number of provisioned instances during deployments, to maintain the same capacity for both old and new code.
def latest(self) -> Optional[bool]: return pulumi.get(self, "latest")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def auto_scaling_enabled(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"auto_scaling_enabled\")", "def auto_scaling(self, auto_scaling):\n\n self.container['auto_scaling'] = auto_scaling", "def auto_scaling(self):\n return self.container['auto_scaling']", "def allowUp...
[ "0.5924027", "0.59166676", "0.58902484", "0.58554554", "0.5825714", "0.57846963", "0.57392687", "0.57052445", "0.56574816", "0.56277037", "0.55454695", "0.5522593", "0.55145127", "0.542091", "0.5406166", "0.5386858", "0.5361837", "0.5337547", "0.5319795", "0.52949566", "0.529...
0.0
-1
Generate a random string of letters, digits and special characters
def random_str(l=10): password_characters = string.ascii_letters + string.digits return ''.join(random.choice(password_characters) for i in range(l))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_random_alphanumeric_string():\n return get_random_string(char_choice=string.ascii_letters + string.digits)", "def rand_string():\n out = ''\n for _ in range(24):\n out += choice(ascii_letters)\n return out", "def random_string():\n return \"\".join(random.choice(string.ascii_lette...
[ "0.846762", "0.81559694", "0.7920509", "0.7876258", "0.77858824", "0.77266", "0.7724137", "0.7707932", "0.76983076", "0.7659456", "0.76339835", "0.7620218", "0.7609873", "0.75422925", "0.75417304", "0.75369745", "0.7524378", "0.7523902", "0.75107896", "0.7495423", "0.74860233...
0.7153042
63
Construct a new deconvolution block.
def __init__(self, in_channels, out_channels, kernel_size, num_layers=3, use_conv_transpose=True): super().__init__() _validate_args(in_channels, out_channels, kernel_size, num_layers) self.kernel_size = kernel_size self.use_conv_transpose = use_conv_transpose ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, incoming, W=None, b=tf.zeros, ksize: int = None, num_outputs: int = None,\n weight_initializer=None, a=tf.nn.elu, output_shape=None, strides=(1, 2, 2, 1), padding='SAME',\n data_format='NHWC',\n name='DeConvLayer'):\n super(DeConvLayer, self...
[ "0.6396073", "0.638185", "0.63781834", "0.62106174", "0.6180158", "0.61681384", "0.6147948", "0.6120221", "0.6053116", "0.6021787", "0.59478825", "0.59339094", "0.58946866", "0.5885409", "0.5883201", "0.5868247", "0.5825844", "0.5822174", "0.5751718", "0.5741875", "0.57374364...
0.5372519
66
Return a string representation of this stack
def __repr__(self): return 'Stack({})'.format(self.length())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n return str(self.stack)", "def __repr__(self):\n return str(self._stack_items)", "def __str__(self):\n stackStr = \"Stack: <- \"\n if self.size <= 3:\n for val in self.data:\n stackStr = stackStr + str(val) + \" \"\n else:\n ...
[ "0.88021517", "0.8512891", "0.8345638", "0.83416456", "0.83416456", "0.83317596", "0.82302666", "0.8212493", "0.81768715", "0.80605805", "0.7728859", "0.7728859", "0.7728859", "0.7728859", "0.75519186", "0.7246458", "0.7197881", "0.7185586", "0.71225804", "0.7104178", "0.7060...
0.79534423
11
Return the number of items in this stack
def length(self): return self.list.length
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size(self): #returns the size or number of items in the stack\n if self.is_empty():\n return 0\n else:\n return self.num_items", "def size(self):\n return self.N # Number of items in the stack", "def size(self):\n return len(self._stack_items...
[ "0.894053", "0.8612715", "0.8552268", "0.8211338", "0.8211338", "0.819122", "0.8098103", "0.8073792", "0.8066449", "0.8057558", "0.796744", "0.796744", "0.79004467", "0.7882437", "0.7825743", "0.7793427", "0.7789325", "0.757674", "0.7571483", "0.75673604", "0.75519484", "0....
0.7011045
90
Return the top item on this stack without removing it, or None if this stack is empty
def peek(self): return self.list.head
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top(self):\n try:\n if self.size() > 0:\n return self.items[len(self.items) - 1]\n else:\n raise IndexError('Cannot get top item, stack is empty.')\n except IndexError as err:\n print(err)\n raise", "def top(self):\n ...
[ "0.8429175", "0.8386014", "0.8373037", "0.8361007", "0.8316925", "0.8236558", "0.8166721", "0.812626", "0.80653256", "0.80612326", "0.80612326", "0.8048559", "0.80352163", "0.8033176", "0.8030213", "0.8000031", "0.7992901", "0.7961362", "0.79477185", "0.78576213", "0.7849552"...
0.0
-1
Return the top item and remove it from this stack, or raise ValueError if this stack is empty
def pop(self): if self.is_empty(): raise ValueError('stack is empty') else: val = self.list.head.data self.list.delete(val) return val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pop(self):\n try:\n if self.size() > 0:\n top = self.top()\n self.items.pop()\n return top\n else:\n raise IndexError('Cannot pop item, stack is empty.')\n except IndexError as err:\n print(err)\n ...
[ "0.8317962", "0.8118133", "0.79350066", "0.7909736", "0.7877539", "0.7830187", "0.7814436", "0.77917266", "0.7735623", "0.77264434", "0.76868576", "0.76760757", "0.76719135", "0.76673764", "0.76625746", "0.7597333", "0.7593962", "0.7572603", "0.75130045", "0.7468597", "0.7458...
0.7878401
4
This builder creates an awscrt.mqtt.Connection, configured for an mTLS MQTT connection to AWS IoT. TLS arguments are passed as inmemory bytes.
def mtls_from_bytes(cert_bytes, pri_key_bytes, **kwargs): _check_required_kwargs(**kwargs) tls_ctx_options = awscrt.io.TlsContextOptions.create_client_with_mtls(cert_bytes, pri_key_bytes) return _builder(tls_ctx_options, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_connection(args):\n\n event_loop_group = io.EventLoopGroup(1)\n host_resolver = io.DefaultHostResolver(event_loop_group)\n client_bootstrap = io.ClientBootstrap(event_loop_group, host_resolver)\n\n if args.use_websocket is True:\n proxy_options = None\n if args.proxy_host:\n ...
[ "0.671798", "0.589207", "0.5850942", "0.57943445", "0.5774898", "0.5588634", "0.558025", "0.53611964", "0.5199994", "0.5188784", "0.51824486", "0.5173533", "0.5156784", "0.51475334", "0.5143801", "0.51150066", "0.50710064", "0.4991794", "0.4987656", "0.49577805", "0.49405175"...
0.57084966
5
Plot and export loss history.
def plot_loss_history(data=None, title=None, name=None, path=None): # TODO: add labels to loss history plt.figure(random.randint(a=1, b=100)) plt.title(title) plt.plot(data) plt.savefig('{}/{}.png'.format(path, name))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_loss(history, name):\n\n plt.plot(history.history['loss'])\n plt.plot(history.history['val_loss'])\n plt.title('model loss')\n plt.ylabel('loss')\n plt.xlabel('epoch')\n plt.legend(['train', 'val'], loc='upper left')\n # plt.show()\n plt.savefig(name, format=\"png\")", "def plot_...
[ "0.7981323", "0.7624024", "0.7433869", "0.7406804", "0.7398628", "0.72234327", "0.71911234", "0.71801317", "0.71626985", "0.7115393", "0.71093327", "0.7078133", "0.70390433", "0.7034216", "0.70000875", "0.69829816", "0.69766355", "0.6951487", "0.6897597", "0.68970644", "0.689...
0.7839726
1
Returns dataset item at a given 'idx'
def __getitem__(self, idx: int) -> Tuple[torch.Tensor, torch.LongTensor]: _class, _img = self.dataset[idx] _img = Image.open(_img) _img = self.ops(_img) return _img, _class
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, idx):\n assert(isinstance(idx, int))\n nidx = self._normalize_idx(idx)\n if nidx >= len(self.data):\n raise IndexError\n return self.data[nidx]", "def __getitem__(self, index):\n return self.dataset[index]", "def __getitem__ (self, idx):\n ...
[ "0.813817", "0.8034823", "0.7987386", "0.78769886", "0.7846872", "0.78379524", "0.7672227", "0.7634509", "0.7619609", "0.7533727", "0.7516168", "0.74954134", "0.74698865", "0.7448419", "0.7422299", "0.7384355", "0.7384355", "0.7357587", "0.7323201", "0.72545373", "0.7236759",...
0.0
-1
Getter for the training dataloader
def train_dataloader(self) -> data.DataLoader: # Random weighted sampler to approach the imbalanced dataset self.weights = [1.0 / i for i in self.weights] _sample_weights = [0] * len(self.datasets['train']) for idx, (_, label) in enumerate(self.datasets['train']): _weight =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataloader(self):\n return DataLoader", "def train_dataloader(self) -> torch.utils.data.DataLoader: \n return torch.utils.data.DataLoader(self.dataset_train, **self.dl_kwargs)", "def get_dataloader(self):\n shuffle = True if self.mode == \"train\" else False\n return Dat...
[ "0.806039", "0.8059836", "0.80100703", "0.79540026", "0.7761696", "0.76195425", "0.7566371", "0.75249887", "0.7367396", "0.7347897", "0.71228075", "0.7031968", "0.70306385", "0.7020662", "0.69703716", "0.6892423", "0.6882508", "0.6801701", "0.6776097", "0.6767861", "0.6755929...
0.6846826
17
Get a reference to the Player object that is stored at this node.
def getPlayer(self): return self.__player__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def player(self):\n return self._node._player", "def get_player(self):\n return self.player", "def get_player(self):\n return self.player", "def get_player(self):\n\n return self._player", "def get_player(self):\r\n return self.player_control.get_player()", "def get...
[ "0.8167049", "0.8137024", "0.8137024", "0.80869734", "0.8013026", "0.7934076", "0.788203", "0.7812071", "0.7750096", "0.7732342", "0.7633459", "0.7576358", "0.7490069", "0.74441004", "0.7410997", "0.7358482", "0.73308706", "0.7313096", "0.72900695", "0.7235823", "0.7220934", ...
0.81638724
1
Get the node that is in front of this node.
def getNext(self): return self.__next__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def front_node(self):\n return self.sentinel.next if self.N != 0 else None", "def back_node(self):\n return self.sentinel.prev if self.N != 0 else None", "def previous(self):\n if len(self.stack) == 1:\n return None\n self.stack.pop()\n return self.get_node()", "...
[ "0.7328063", "0.7144379", "0.70686567", "0.6991975", "0.68961203", "0.68113863", "0.6717892", "0.6707875", "0.66887903", "0.65483713", "0.65192735", "0.647944", "0.64579105", "0.64355594", "0.6429487", "0.6422001", "0.63592243", "0.6353761", "0.63403726", "0.6335887", "0.6328...
0.0
-1
Creates the rotator. Initializes the linked list to have no nodes.
def __init__(self): self.__currentnode__ = None self.__colordict__ = {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotate():\n if counter == counter.max - 1:\n rotator.next = concat(rotator[3:], rotator[3])\n counter.next = 0\n else:\n counter.next = counter + 1\n\n # set initial bits\n if rotator == 0:\n rotator.next = 1", "def __init__(self):\n ...
[ "0.6327691", "0.6319855", "0.62945443", "0.6219352", "0.6134424", "0.59514993", "0.5925681", "0.59148675", "0.5910177", "0.59001666", "0.59001666", "0.5868724", "0.5845009", "0.5842787", "0.58349097", "0.58338904", "0.58096445", "0.579599", "0.579599", "0.5790962", "0.5778207...
0.0
-1
Inserts a player at a given index of the linked list. Index based on the current node in the rotator.
def insertPlayer(self, player_to_insert, index): if type(player_to_insert) is not player.Player: raise TypeError("The first input to insertPlayer must be of type Player.") elif player_to_insert.getColor() in self.__colordict__: raise ValueError("The player to insert has color " +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self, index, item):\n \n # Create a new node\n new_code = Node(item)\n \n # Go to node (index - 1)\n curr = self.first\n for i in range(index - 1):\n curr = curr.next\n \n old_next_node = curr.next \n # Update curr's next attribute\n curr.next = new_node\n \...
[ "0.6746756", "0.66824883", "0.6655358", "0.6649492", "0.65597695", "0.646736", "0.64672905", "0.6439435", "0.64367497", "0.6404763", "0.63344413", "0.63304937", "0.63191634", "0.63115674", "0.6285811", "0.62856776", "0.6224067", "0.6201135", "0.62010837", "0.6174868", "0.6150...
0.8299688
0
Return a reference to the current player.
def getCurrentPlayer(self): if self.__currentnode__ is None: return None else: return self.__currentnode__.getPlayer()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_player(self) :\n return self.current_player", "def get_current_player(self):\n return self.current_player", "def player(self):\n return self.current.player", "def getCurrentPlayer(self):\r\n return self.currentPlayer", "def current_player(self) -> Player:\n ...
[ "0.8881476", "0.8878842", "0.8791126", "0.8749216", "0.87406135", "0.8726862", "0.863938", "0.8488647", "0.8472192", "0.8472192", "0.8380923", "0.83807266", "0.83501464", "0.8344164", "0.8281813", "0.8013517", "0.7901664", "0.77658474", "0.7753161", "0.770097", "0.7299225", ...
0.8193338
15
Return the color of the current player.
def getCurrentColor(self): if self.__currentnode__ is None: return None else: return self.__currentnode__.getPlayer().getColor()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def player(self):\n return self._color", "def get_color(self):\n return self.color", "def get_color(self):\n\n return self.color", "def get_color(self):\r\n if self.color:\r\n return \"RED\"\r\n else:\r\n return \"BLACK\"", "def getTurn(self):\r\n ...
[ "0.887242", "0.7769796", "0.773395", "0.7628914", "0.76187915", "0.75915945", "0.7585518", "0.7585495", "0.7585495", "0.7580637", "0.7549666", "0.74911374", "0.7473557", "0.7471987", "0.74684536", "0.74063176", "0.74026126", "0.7393071", "0.7393071", "0.7372746", "0.7335303",...
0.8330503
1
Determines whether or not the rotation contains the input color.
def hasColor(self, color): if type(color) is not int: raise TypeError( "Color must be of type int." ) else: return color in self.__colordict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isColor(self,color):\n return self.color==color", "def is_color(self, color: ColorLike) -> bool:\n\n if isinstance(color, Color):\n return self.color == color\n elif isinstance(color, str):\n return str(self.color) == color\n elif isinstance(color, int):\n ...
[ "0.7632322", "0.6853061", "0.68446946", "0.6713104", "0.66789967", "0.6584735", "0.654394", "0.65426993", "0.64411867", "0.6439629", "0.6418472", "0.63832796", "0.6372706", "0.63362575", "0.62745297", "0.6258238", "0.6251041", "0.6243719", "0.6134679", "0.61269027", "0.607104...
0.70988774
1
Sets the value of ``q_dict[column][key]`` with ``[Q, upper.shape, lower.shape]`` Merge two tile rows, take their QR, and apply it to the trailing process This will modify ``a`` and set the value of the ``q_dict[column][key]`` with ``[Q, upper.shape, lower.shape]``.
def __split0_merge_tile_rows( pr0: int, pr1: int, column: int, rank: int, r_tiles: SquareDiagTiles, diag_process: int, key: str, q_dict: Dict, ) -> None: if rank not in [pr0, pr1]: return pr0 = pr0.item() if isinstance(pr0, torch.Tensor) else pr0 pr1 = pr1.item() if i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __split0_global_q_dict_set(\n q_dict_col: Dict,\n col: Union[int, torch.Tensor],\n r_tiles: SquareDiagTiles,\n q_tiles: SquareDiagTiles,\n global_merge_dict: Dict = None,\n) -> None:\n # q is already created, the job of this function is to create the group the merging q's together\n # it t...
[ "0.65911615", "0.5716903", "0.515681", "0.51294225", "0.51085675", "0.50433844", "0.49287245", "0.4904307", "0.48996258", "0.489382", "0.48669422", "0.48497057", "0.47885162", "0.47799572", "0.47600874", "0.47455096", "0.47062793", "0.47058487", "0.46743733", "0.4632957", "0....
0.5259935
2
Function for Calculating Q for ``split=0`` for QR. ``col`` is the index of the tile column. The assumption here is that the diagonal tile is ``(col, col)``.
def __split0_q_loop( col: int, r_tiles: SquareDiagTiles, proc_tile_start: torch.Tensor, active_procs: torch.Tensor, q0_tiles: SquareDiagTiles, q_dict: Dict, q_dict_waits: Dict, ) -> None: tile_columns = r_tiles.tile_columns diag_process = ( torch.nonzero(input=proc_tile_start...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __split1_qr_loop(\n dcol: int, r_tiles: SquareDiagTiles, q0_tiles: SquareDiagTiles, calc_q: bool\n) -> None:\n r_torch_device = r_tiles.arr.larray.device\n q0_torch_device = q0_tiles.arr.larray.device if calc_q else None\n # ==================================== R Calculation - single tile =========...
[ "0.68651175", "0.60364515", "0.587353", "0.5871066", "0.5771765", "0.56619024", "0.5616466", "0.5609807", "0.56039083", "0.55200505", "0.5484076", "0.5481977", "0.54797125", "0.54506445", "0.5445756", "0.5440374", "0.5436096", "0.54179573", "0.54145116", "0.5382789", "0.53505...
0.5631875
6
Copy params in torch enc/dec modules to equivalent quantizable enc/dec modules
def copy_params_helper(src_module: Union[torch.nn.TransformerEncoderLayer, torch.nn.TransformerDecoderLayer], dest_module: Union[QuantizableTransformerEncoderLayer, QuantizableTransformerDecoderLayer]): if isinstance(src_module, torch.nn.TransformerEncoderLayer): assert isinstance(des...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _quantize_dequantize_params(self, inputs=None) -> Dict[str, torch.Tensor]:\n quantized_params = dict()\n shadow_params = {name: param.detach().clone() for name, param in self.named_parameters(recurse=False)}\n\n if self._mode != QcQuantizeOpMode.LEARN_ENCODINGS:\n quantizer_par...
[ "0.5870018", "0.5863496", "0.5846493", "0.57170206", "0.5648641", "0.5619291", "0.5612991", "0.5595354", "0.5577201", "0.5541977", "0.551577", "0.55136937", "0.54773694", "0.5475649", "0.54494977", "0.5401601", "0.5396617", "0.53936434", "0.5381224", "0.53808457", "0.5379783"...
0.70530415
0
Create QuantizableTransformerEncoderLayer using existing torch.nn.TransformerEncoderLayer module
def create_quantizable_transformer_encoder_layer( transformerEncoderLayer: torch.nn.TransformerEncoderLayer) -> QuantizableTransformerEncoderLayer: if isinstance(transformerEncoderLayer.activation, (torch.nn.modules.activation.ReLU, torch.nn.functional.relu)): activation = 'relu' elif isinstance...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_quantizable_transformer_decoder_layer(\n transformerDecoderLayer: torch.nn.TransformerDecoderLayer) -> QuantizableTransformerDecoderLayer:\n if isinstance(transformerDecoderLayer.activation, (torch.nn.modules.activation.ReLU, torch.nn.functional.relu)):\n activation = 'relu'\n elif i...
[ "0.70781934", "0.70162743", "0.6731187", "0.66876096", "0.6673275", "0.66444963", "0.6559612", "0.64045185", "0.64026624", "0.6397527", "0.639162", "0.6375698", "0.6288753", "0.6215724", "0.6215724", "0.6181808", "0.6100169", "0.6073622", "0.6068329", "0.6037959", "0.5962546"...
0.7957517
0
Create QuantizableTransformerDecoderLayer using existing torch.nn.TransformerDecoderLayer module
def create_quantizable_transformer_decoder_layer( transformerDecoderLayer: torch.nn.TransformerDecoderLayer) -> QuantizableTransformerDecoderLayer: if isinstance(transformerDecoderLayer.activation, (torch.nn.modules.activation.ReLU, torch.nn.functional.relu)): activation = 'relu' elif isinstance...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self,\n input_dim,\n dec_seq_len,\n out_seq_len,\n d_model=512,\n nhead=8,\n num_encoder_layers=6,\n num_decoder_layers=6,\n dim_feedforward=2048,\n dropout=0...
[ "0.702472", "0.70195657", "0.6886643", "0.6745618", "0.6719266", "0.67005277", "0.6604023", "0.6594004", "0.6535458", "0.65032774", "0.64818937", "0.6135744", "0.6094426", "0.6070778", "0.60691684", "0.6042012", "0.603544", "0.5981115", "0.5966625", "0.59493333", "0.5927086",...
0.7868481
0
Register a group with a missing user.
def test_register_group_missing_user(self): with self.assertRaises(UserNotFoundException): self._storage.register_group("group1", "user1")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_new_user_group(self, token, userGroup):\n requestUser = self.get_username_from_token(token)\n dataBase = self.read_database()\n userGroups = dataBase['userGroups']\n if userGroup not in userGroups:\n newGroup = dict()\n newGroup['owners'] = [requestUser]...
[ "0.6906637", "0.6822164", "0.67328525", "0.66948164", "0.6683261", "0.66260225", "0.6606365", "0.6603444", "0.6590585", "0.65744084", "0.6480749", "0.64576936", "0.63995737", "0.630923", "0.62902427", "0.62659585", "0.625644", "0.62553716", "0.625332", "0.6244452", "0.6216296...
0.84940636
0
Get a list of registered platforms from Volttron Central.
def list_platforms(self): return self.do_rpc('list_platforms')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def platforms(self):\n logger.debug(\"Get platforms\")\n return self._raw_api.platforms.get()", "def platforms(self) -> Any:\n\n return search_api(\"platforms\")", "def get_platforms(self):\n _log.debug(\"Passing platforms back: {}\".format(\n self._registered_platforms.k...
[ "0.79559594", "0.78949493", "0.78682095", "0.77720857", "0.7327511", "0.72999084", "0.718141", "0.7091689", "0.7069216", "0.6976398", "0.68963903", "0.6848046", "0.6713361", "0.6490465", "0.63321245", "0.6299962", "0.62283295", "0.6188314", "0.6154324", "0.61413777", "0.60337...
0.8353335
0
Finds long sentences and outputs a dataframe with values.
def most_wordy(data_sent): #initialize lists sylls = [] words = [] sents = [] fkgs = [] #looping through sentences to find lengthy sentences for sent in data_sent: token = word_tokenize(sent) word = len(token) if word > 40: #appending to lists ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_whole_and_per_sentence_flair_sentiments():\n long_comments = [\"This was a really sucky movie. I will probably never go see this movie ever again. I am going to \"\n \"tell my whole family never to watch this movie. I very much enjoyed the special cameo in it \"\n ...
[ "0.6625469", "0.62335074", "0.6214064", "0.6162199", "0.6007197", "0.5869864", "0.58293146", "0.58021885", "0.5748174", "0.5744882", "0.5743208", "0.57314664", "0.57242036", "0.56326777", "0.5632538", "0.5625482", "0.562373", "0.55449075", "0.5538236", "0.5518597", "0.5512576...
0.61427814
4
rounds the square root to higher int. returns int.
def sqrt_round(num): out = math.ceil(math.sqrt(num)) return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def integer_sqrt(x: int):\n\n assert x > 0\n\n _1_40 = 1 << 40 # 2**40\n\n if x < _1_40:\n return int(sqrt(x)) # use math's sqrt() for small parameters\n\n n = int(x)\n\n if n <= 1:\n return n # handle sqrt(0)==0, sqrt(1)==1\n\n # Make a high initial estimate of the result (a lit...
[ "0.7209296", "0.6826553", "0.678231", "0.6611084", "0.6572727", "0.6488083", "0.6460941", "0.64030486", "0.6401382", "0.6398851", "0.6390073", "0.6384372", "0.6370736", "0.63555676", "0.6288819", "0.6260557", "0.6235235", "0.619943", "0.6164964", "0.61187875", "0.6098584", ...
0.67696595
3
Checks if an object is an iterable. Strings also do return True.
def isiter(obj): try: iter(obj) return True except TypeError: pass return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isiterable(obj, strings=False, isinstance=isinstance, Iterable=Iterable):\n return (isinstance(obj, Iterable) and\n not (isinstance(obj, str) and not strings))", "def is_iterable(obj):\n if isinstance(obj, (str, bytes, bytearray)):\n return False\n return isinstance(obj, Iterable)"...
[ "0.8684489", "0.8667297", "0.85712105", "0.8477392", "0.8436645", "0.8380801", "0.8314853", "0.8307778", "0.824173", "0.8167089", "0.8095805", "0.8082279", "0.8077915", "0.8071243", "0.80650127", "0.8058266", "0.8047387", "0.8043366", "0.7993377", "0.7920457", "0.79056495", ...
0.77667856
29
r"""Apply softmax and compute mean square error between two model outputs.
def softmax_mse_loss(input_logits, target_logits, reduction='sum'): assert input_logits.size() == target_logits.size() input_softmax = F.softmax(input_logits, dim=1) target_softmax = F.softmax(target_logits, dim=1) num_classes = input_logits.size()[1] return F.mse_loss(input_softmax, target_softmax,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax_mse(y_true, softmax_pred):\n return np.mean((y_true - softmax_pred)**2)", "def softmax(inputs):\n return np.exp(inputs) / float(sum(np.exp(inputs)))", "def softmax(inputs):\n return np.exp(inputs) / float(sum(np.exp(inputs)))", "def softmax(x):\n return np.exp(x) / np.sum(np.exp(x), a...
[ "0.69368887", "0.6738721", "0.6738721", "0.6546974", "0.65343475", "0.6498997", "0.64884156", "0.648081", "0.6477309", "0.64619297", "0.64614254", "0.6439666", "0.6427421", "0.6416778", "0.64032495", "0.64032495", "0.64032495", "0.64032495", "0.6389897", "0.6383962", "0.63700...
0.0
-1
Get preferred name for using as a key by model storage
def GetPreferredStorageKey(self): return "mdl_friends"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_key (self, name):\n return self + name", "def key_name(self) -> str:\n return pulumi.get(self, \"key_name\")", "def key_name(self) -> Optional[str]:\n return pulumi.get(self, \"key_name\")", "def name(self):\n return self.key", "def key(self) -> str:\n return f\"{self...
[ "0.68959767", "0.6870932", "0.6852627", "0.6851945", "0.6849994", "0.67879385", "0.6762851", "0.67600083", "0.6661966", "0.66231483", "0.66197383", "0.66002184", "0.6580626", "0.6497617", "0.64958966", "0.64958966", "0.6460994", "0.64602405", "0.645461", "0.6452825", "0.64399...
0.656644
13
Tokenize a txt file given into sentences where each token is seperated by a whitespace and return a list of these sentences.
def txt_to_sentences(file_title): with open(file_title, "r") as text: # Preprocessing from text text = str(text.read()) text=textacy.preprocess.normalize_whitespace(text) text=textacy.preprocess.fix_bad_unicode(text, normalization=u'NFKC') text=textacy.preprocess.unpack_contr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_sentences(file_path):\n\n with open(file_path, \"r\") as file:\n\n lines = list()\n\n for line in file:\n line_stripped = line.strip()\n\n if line_stripped == \"\":\n continue\n\n lines.append(line_stripped)\n\n text = \" \".join(l...
[ "0.7992048", "0.75088614", "0.7504721", "0.73326737", "0.7303468", "0.7119897", "0.7119897", "0.7105234", "0.7066728", "0.70517737", "0.69290024", "0.69195163", "0.6854726", "0.6854695", "0.68462324", "0.6845401", "0.6841652", "0.68097705", "0.6792721", "0.6780636", "0.676547...
0.7129236
5
Return absolute path to data dir. Use the local data dir if found, otherwise, return the system dir.
def get_data_dir(): if not _datadir: local_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'data')) if os.path.isdir(local_dir): logger.debug("Using local data dir in {}".format(local_dir)) return local_dir if not _datadir: logging.error("No da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def local_data_dir():\r\n assert sys.argv\r\n prefix_path = os.path.dirname(sys.argv[0])\r\n local_data = os.path.join(prefix_path, \"data\")\r\n return local_data", "def get_data_dir():\n return Path(current_app.config[\"USER_DIR\"]) / \"data\"", "def get_data_path():\n return os.getcwd() + ...
[ "0.811405", "0.81019694", "0.80959576", "0.8002524", "0.7980776", "0.7823071", "0.77971315", "0.7728985", "0.7722332", "0.7665467", "0.7637193", "0.7569919", "0.75658673", "0.75316304", "0.75137234", "0.7454674", "0.7447632", "0.74426234", "0.7441112", "0.743956", "0.743956",...
0.8236648
0
Test that users cannot login with invalid credentials
def test_invalid_credentials(self): self.user = {"username": "testuserother", "password": "testpassword"} response = self.app.post("/auth/login/", data=self.user) self.assertEqual(response.status_code, 403) output = json.loads(response.data.decode('utf-8')) self.assertIn("Error:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_login_wrong_credentials(self):\n\t\tdata = {'username' : 'nonexistentuser', 'password' : 'nopasswordlol'}\n\t\tresponse = self.login(data)\n\n\t\terror_text = \"Unable to log in with provided credentials.\"\n\n\t\tself.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)\n\t\ttry:\n\t\t\tif erro...
[ "0.8150442", "0.81207293", "0.7986644", "0.79142475", "0.7876093", "0.78559786", "0.7840712", "0.7828555", "0.78165203", "0.7786241", "0.77404696", "0.77232844", "0.7697325", "0.7693282", "0.7644226", "0.76063013", "0.75874186", "0.7578479", "0.75685513", "0.7517236", "0.7515...
0.8051824
2
Asks user to specify a city, month, and day to analyze.
def get_filters(): print('Hello! Let\'s explore some US bikeshare data!') # TO DO: get user input for city (chicago, new york city, washington). # HINT: Use a while loop to handle invalid inputs while True: try: city = str(input("You may see stats from either Chicago, New York 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.5932027
39
Loads data for the specified city and filters by month and day if applicable.
def load_data(city, month, day): if city == 'chicago': city_df = pd.read_csv('chicago.csv') elif city == 'new york city': city_df = pd.read_csv('new_york_city.csv') else: # city_df = pd.read_csv('washington.csv') print("else is running") print(city_df.head()) return...
{ "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.8132439", "0.81092066", "0.80460113", "0.80428666", "0.80092704", "0.80078983", "0.79997176", "0.7999047", "0.7989329", "0.7979842", "0.7973761", "0.79617316", "0.7956702", "0.79477483", "0.7946521", "0.7908704", "0.7908281", "0.79049814", "0.7901444", "0.7893375", "0.7889...
0.75419974
84