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
r"""Updates an existing workload. Currently allows updating of workload display_name and labels. For force updates don't set etag field in the Workload. Only one update operation per workload can be in progress.
def Patch(self, request, global_params=None): config = self.GetMethodConfig('Patch') return self._RunMethod( config, request, global_params=global_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self):\n args = {attr: getattr(self, attr) for attr in self.to_update}\n args[\"id\"] = self.id\n _perform_command(self.owner, \"label_update\", args)", "def update(self, **kwargs):\n context = self.to_dict().copy()\n data = {**context, **kwargs}\n self.client...
[ "0.60368", "0.57779825", "0.57664436", "0.57486206", "0.5702707", "0.5667231", "0.56320196", "0.5496742", "0.54772955", "0.5448119", "0.5373693", "0.5372198", "0.5372198", "0.5369777", "0.53455836", "0.5313196", "0.5312252", "0.5301365", "0.5271846", "0.5271296", "0.5257425",...
0.0
-1
Loads data for the specified city and filters by month and day if applicable.
def load_data(city, month, day): #This reads a csv and creates a new month, day_of_week, and hour columns in df df = pd.read_csv(CITY_DATA[city]) df['Start Time'] = pd.to_datetime(df['Start Time']) df['month'] = df['Start Time'].dt.month df['day_of_week'] = df['Start Time'].dt.weekday_name df['h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_city_data(city, month, day):\n df = pd.read_csv(CITY_DATA[city])\n #extract month, day, hour from start time\n df['month'] = pd.to_datetime(df['Start Time']).dt.month_name()\n df['day'] = pd.to_datetime(df['Start Time']).dt.weekday\n df['hour'] = pd.to_datetime(df['Start Time']).dt.hour\n\n...
[ "0.8318127", "0.8226955", "0.81508285", "0.80795246", "0.8042501", "0.8018084", "0.80014104", "0.7990341", "0.7979312", "0.7977746", "0.797241", "0.79569995", "0.7955985", "0.79487103", "0.79313254", "0.7919122", "0.791271", "0.7911742", "0.79051673", "0.79030436", "0.7902508...
0.77214533
72
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() # TO DO: display the most common month common_month = df['month'].mode()[0] count_month = df['month'].value_counts().max() print('Most common month: ', common_month, ' / ', count_month) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_stats(df):\r\n\r\n print('\\nThese are the statistics of the most frequent times of travel:\\n')\r\n start_time = time.time()\r\n\r\n # Display the most common month\r\n common_month = df['month'].mode()[0]\r\n print(\"- That's the most common month based on your selection: \" +\r\n ...
[ "0.7974609", "0.7851373", "0.7800278", "0.77821916", "0.7775073", "0.7762475", "0.77532375", "0.77384645", "0.77262247", "0.7718093", "0.7685153", "0.7683606", "0.76808155", "0.7679881", "0.7650141", "0.7644975", "0.7643931", "0.76428497", "0.7629725", "0.76246285", "0.762423...
0.7458433
42
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() # TO DO: display most commonly used start station common_start_station = df['Start Station'].mode()[0] count_start_station = df['Start Station'].value_counts().max() print('Most commo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def station_stats(df):\n\n print('\\033[1m' + 'Calculating the most popular stations and trip...\\n' + '\\033[0m')\n start_time = time.time()\n\n # display the most commonly used start station\n\n start_stn = df['Start Station'].mode()[0]\n print('Most popular start station is {}.'.format(start_stn)...
[ "0.7809938", "0.76727635", "0.7538624", "0.74982685", "0.7490305", "0.74887866", "0.7436869", "0.7429845", "0.74274427", "0.7425571", "0.74126786", "0.7404592", "0.7382532", "0.7379482", "0.73747545", "0.7365935", "0.73561436", "0.7351966", "0.7324152", "0.7304813", "0.729985...
0.7066387
83
Displays statistics on the total and average trip duration.
def trip_duration_stats(df): print('\nCalculating Trip Duration...\n') start_time = time.time() # TO DO: display total travel time total_travel = df['Trip Duration'].sum() / 3600 print('Total travel time (in hours): {}'.format(total_travel)) count_travel = df['Trip Duration'].count() print...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trip_duration_stats(df):\r\n\r\n print('\\nThese are the statistics related to the trips durations:\\n')\r\n start_time = time.time()\r\n\r\n # Display total travel time\r\n total_travel_time = df['Trip Duration'].sum()\r\n print(\"\\n- The total travel time based on your selection is: \" +\r\n ...
[ "0.8272131", "0.8120133", "0.8049951", "0.80492353", "0.7980685", "0.7965037", "0.7961538", "0.79485166", "0.7938607", "0.79317796", "0.7929999", "0.7929175", "0.79267067", "0.7921867", "0.79179937", "0.791769", "0.7915405", "0.7909771", "0.79061294", "0.7904489", "0.7894493"...
0.77828634
57
Get scores for some user item pairs.
def get_scores_for_user_item_pairs(self, users, items): selected_emb_users = self.emb_users(users) selected_emb_items = self.emb_items(items) selected_bias_items = self.bias_items(items) scores = torch.sum(torch.mul(selected_emb_users, selected_emb_items), 1) + selected_bias_items ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getRecommendedItems(prefs, itemMatch, user):\n\tuserRatings = prefs[user]\n\tscores = collections.defaultdict(float)\n\ttotalSim = collections.defaultdict(float)\n\n\tfor item, rating in list(userRatings.items()):\n\t\tfor similarity, item2 in itemMatch[item]:\n\t\t\t#ignore of this user has already rated item...
[ "0.7015698", "0.7010581", "0.6962305", "0.68592334", "0.68343973", "0.6804744", "0.6710049", "0.66739815", "0.66463464", "0.6606759", "0.6602559", "0.657593", "0.65091556", "0.64786583", "0.64122605", "0.64004976", "0.63141984", "0.6306975", "0.6284984", "0.61735004", "0.6143...
0.81051326
0
Apply annealed softmax on scores to obtain probabilities
def annealed_softmax(self, scores, temperature = 1): annealed_scores = scores / temperature probs = torch.softmax(annealed_scores, dim=1) return probs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax_function(scores):\n\n exp_scores = np.exp(scores)\n probabilities = exp_scores / np.sum(exp_scores, axis=0, keepdims=True)\n\n return probabilities", "def softmaxEquation(self, scores):\r\n scores -= np.max(scores)\r\n prob = (np.exp(scores).T / np.sum(np.exp(scores), axis=1))....
[ "0.84833366", "0.8179917", "0.77365404", "0.7471259", "0.7471259", "0.73826593", "0.7334873", "0.731082", "0.72497153", "0.71541953", "0.71282214", "0.7103324", "0.70768553", "0.70750135", "0.707245", "0.70693547", "0.7054816", "0.7054816", "0.7054816", "0.7054816", "0.705481...
0.78401005
2
Get scores for useritem pairs.
def forward(self, users, items): selected_emb_users = self.emb_users(users) selected_emb_items = self.emb_items(items) selected_bias_items = self.bias_items(items).squeeze() scores = torch.sum(torch.mul(selected_emb_users, selected_emb_items), 1) + selected_bias_items return torc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_scores_for_user_item_pairs(self, users, items):\n selected_emb_users = self.emb_users(users)\n selected_emb_items = self.emb_items(items)\n selected_bias_items = self.bias_items(items)\n scores = torch.sum(torch.mul(selected_emb_users, selected_emb_items), 1) + selected_bias_ite...
[ "0.8078968", "0.7096716", "0.70653504", "0.6946888", "0.6915511", "0.68712306", "0.6765241", "0.6757569", "0.6756279", "0.6750459", "0.6719943", "0.6633152", "0.65910065", "0.65480286", "0.65415287", "0.65094596", "0.64604247", "0.6397831", "0.6386337", "0.6366057", "0.622474...
0.0
-1
Return recipe detail url
def detail_url(recipe_id): return reverse('recipe:recipe-detail', args=[recipe_id])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recipe_detail_url(recipe_id):\n return reverse('recipe:recipe-detail', args=[recipe_id])", "def detail_url(recipe_id):\r\n return reverse('recipe:recipe-detail', args=[recipe_id])", "def detail_url(recipe_id):\n \n return reverse('recipe:recipe-detail', args=[recipe_id])", "def detail_url(rec...
[ "0.85224116", "0.85189116", "0.84500086", "0.83119076", "0.78332156", "0.69384086", "0.68106294", "0.6687019", "0.6650367", "0.663163", "0.65686995", "0.6567431", "0.6538007", "0.65344054", "0.6524976", "0.6505839", "0.6505839", "0.6505839", "0.65009946", "0.65009946", "0.649...
0.8516094
6
Get a Spark session in a way that supports running locally or in Data Flow.
def get_dataflow_spark_session( app_name="DataFlow", file_location=None, profile_name=None, spark_config={} ): if in_dataflow(): spark_builder = SparkSession.builder.appName(app_name) else: # Import OCI. try: import oci except: raise Exception( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_session(master='yarn', app_name='wmfdata', spark_config={}):\n \n # Ensure the user has valid Kerberos credentials; if not, the next step will hang indefinitely\n check_kerberos_auth()\n\n builder = (\n SparkSession.builder\n .master(master)\n .appName(app_name)\n .c...
[ "0.77416426", "0.7686283", "0.7446865", "0.74222744", "0.73955524", "0.7380627", "0.7364311", "0.7287227", "0.7277361", "0.7238826", "0.7235666", "0.7140208", "0.7073588", "0.70415485", "0.7039686", "0.7039686", "0.7039686", "0.7039686", "0.7039686", "0.7039686", "0.70306486"...
0.73933953
5
Determine if we are running in OCI Data Flow by checking the environment.
def in_dataflow(): if os.environ.get("HOME") == "/home/dataflow": return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_env_defined():\n try:\n _ = os.environ['DB_HOST']\n _ = os.environ['DB_USER']\n _ = os.environ['DB_PASS']\n _ = os.environ['DB_DB']\n _ = os.environ['DB_PORT']\n except KeyError:\n return False\n else:\n return True", "def check_environment():\n ...
[ "0.5930977", "0.5876957", "0.58668363", "0.5864129", "0.5863165", "0.58274513", "0.5815584", "0.5752931", "0.5677327", "0.56753796", "0.56697077", "0.564432", "0.5583881", "0.5555119", "0.554524", "0.5542163", "0.5517244", "0.54816186", "0.5479023", "0.54533535", "0.54488415"...
0.66190976
0
Get the delegation token path when we're running in Data Flow.
def get_delegation_token_path(spark): if not in_dataflow(): return None token_key = "spark.hadoop.fs.oci.client.auth.delegationTokenPath" token_path = spark.sparkContext.getConf().get(token_key) if not token_path: raise Exception(f"{token_key} is not set") return token_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_path_token(self):\n return self.path_token", "def token_store_path(self) -> str:\n return pulumi.get(self, \"token_store_path\")", "def token_store_path(self) -> str:\n return pulumi.get(self, \"token_store_path\")", "def token_store_path(self) -> str:\n return pulumi.get(...
[ "0.69572437", "0.6265018", "0.62638545", "0.62638545", "0.6263791", "0.6216698", "0.62158084", "0.6215354", "0.62152475", "0.62152475", "0.62152475", "0.62152475", "0.621516", "0.5916053", "0.584425", "0.584425", "0.584425", "0.584425", "0.5748706", "0.5710091", "0.57096785",...
0.7878378
0
Creates an argparse type for a list of strings. The passed argument is declared valid if it is a valid string which exists in the passed list valid_strings. If case_sensitive is False, all input strings and strings in valid_strings are processed as lowercase. Leading and trailing whitespace is ignored in all strings.
def string_type_check(valid_strings, case_sensitive = True, metavar = None): metavar = 'value' if metavar is None else metavar valid_strings = [x.strip() for x in valid_strings] if not case_sensitive: valid_strings = [x.lower() for x in valid_strings] def _type_checker(value): value = st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fromstringlist(strings, parser=None): # real signature unknown; restored from __doc__\n pass", "def verify_strs(str_values):\n\n def verify_str(str_value):\n if isinstance(str_value, str):\n return str_value\n raise CyError(f'\"{str_value}\" is not a valid string.',\n ...
[ "0.581637", "0.53053284", "0.52892214", "0.5281845", "0.5055308", "0.5038739", "0.5009826", "0.50021", "0.49608564", "0.49258244", "0.4911852", "0.48664725", "0.48647082", "0.48267663", "0.4810963", "0.481078", "0.47518843", "0.47335684", "0.4720237", "0.47154075", "0.4694003...
0.6980054
0
Returns the dict as a model
def from_dict(cls, dikt: dict) -> 'WorkingRestrictionHoursOfWork': return util.deserialize_model(dikt, cls)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dikt) -> 'Model':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'ModelOutput':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'ModelStat':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt):\n ...
[ "0.73100865", "0.7226481", "0.68927467", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67388964", "0.66993856", "0.6698291", "0.6698291", "0.6698291", "0.6650225", "...
0.0
-1
Gets the tue of this WorkingRestrictionHoursOfWork.
def tue(self): return self._tue
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tuition(self):\n return self._tuition", "def thu(self):\n return self._thu", "def get_hours(self):\n return self.hours", "def hours(self):\n return self._hoys", "def get_traj(self):\n return self._traj;", "def get_traj(self):\n\n\t\treturn self._traj", "def hours(...
[ "0.623518", "0.61842406", "0.61343884", "0.60261744", "0.60259795", "0.59536743", "0.58887535", "0.58666176", "0.5865814", "0.5865814", "0.5840746", "0.5780222", "0.57782805", "0.57562935", "0.5748439", "0.5702864", "0.57020074", "0.5687821", "0.5612996", "0.5607786", "0.5540...
0.674062
0
Gets the wed of this WorkingRestrictionHoursOfWork.
def wed(self): return self._wed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ee_w(self):\n return self._ee_w", "def wkst(self):\n return Weekday(self.rule._wkst)", "def wwid(self) -> str:\n return pulumi.get(self, \"wwid\")", "def getWorkedHours(self):\n hours = 0\n for log in self.context:\n hours += self.context[log].hours\n\n ...
[ "0.6592366", "0.63665056", "0.6301177", "0.6297361", "0.62679386", "0.61996764", "0.612401", "0.61226815", "0.60284454", "0.6001257", "0.59781194", "0.5963887", "0.59361833", "0.5852081", "0.579832", "0.5780663", "0.5750448", "0.5726769", "0.57026625", "0.5699529", "0.5688815...
0.7054572
0
Sets the wed of this WorkingRestrictionHoursOfWork.
def wed(self, wed): self._wed = wed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wed(self):\n return self._wed", "def war_day_wins(self, war_day_wins):\n\n self._war_day_wins = war_day_wins", "def setDwell(self, idx, val):\n WbDefs.checkRange(idx, 0, WbDefs.DWELLCOUNT)\n self.DwellTime[idx] = val", "def set_weight(self, weigth: dict):\n\n self._weig...
[ "0.6107244", "0.60366166", "0.56610894", "0.55760795", "0.5343527", "0.53423923", "0.5100327", "0.5088004", "0.50614375", "0.5058635", "0.505568", "0.50272465", "0.501998", "0.49862427", "0.49649653", "0.49471262", "0.49211794", "0.49123666", "0.48639354", "0.48527673", "0.48...
0.7593325
0
Gets the fri of this WorkingRestrictionHoursOfWork.
def fri(self): return self._fri
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_officehours(self):\n return OfficeHours.objects.current().filter(user=self.user)", "def get_actual_forening(self):\n forening = self.enrollment.forening\n if forening.id == Forening.DNT_OSLO_ID and self.applicable_for_dnt_ung_oslo():\n forening = cache.get('forening.%s' % ...
[ "0.5704329", "0.5501795", "0.53797233", "0.5364582", "0.53410965", "0.53148025", "0.5284719", "0.5207708", "0.5200722", "0.51918715", "0.51507694", "0.5148207", "0.5106669", "0.5106412", "0.5075411", "0.5073202", "0.50192297", "0.5013701", "0.50031924", "0.4934997", "0.493340...
0.66387975
0
Gets the sat of this WorkingRestrictionHoursOfWork.
def sat(self): return self._sat
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compute_work_hour_value(self):\n if self.month_workdays == 0 or self.workday_hours == 0:\n self.work_hour_value = 0\n else:\n self.work_hour_value = round((self.wage + self.variable_salary + self.allowances + self.other_earnings ) / self.month_workdays / self.workday_hours,...
[ "0.6050853", "0.59064245", "0.59043", "0.5764899", "0.5604458", "0.5600704", "0.5598145", "0.55728763", "0.5558976", "0.55068254", "0.54955155", "0.5495335", "0.54813546", "0.54792494", "0.5450632", "0.5416754", "0.5413722", "0.5409507", "0.5401321", "0.53446305", "0.53345597...
0.70614827
0
Sets the sat of this WorkingRestrictionHoursOfWork.
def sat(self, sat): self._sat = sat
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sat(self):\n return self._sat", "def sat(self):\n return self._sat", "def sat_score(self, sat_score):\n\n self._sat_score = sat_score", "def set_saturation_bits(self):\n bits = {\n \"TM\": [0, 1, 2, 3, 4, 5, 7],\n \"ETM+\": [0, 1, 2, 3, 4, 5, 6, 7],\n ...
[ "0.5632684", "0.5632684", "0.5598708", "0.5339557", "0.5192187", "0.5055835", "0.50124055", "0.5007517", "0.4975304", "0.48795512", "0.48575404", "0.48362887", "0.48054066", "0.47777864", "0.47602746", "0.47592393", "0.4751797", "0.4736741", "0.4692432", "0.4680134", "0.46624...
0.72438556
0
Gets the sun of this WorkingRestrictionHoursOfWork.
def sun(self): return self._sun
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def R_SUN(self):\n return self._R_SUN", "def _calculate_sun(self):\n\n daystart = self.config['env']['day_start']\n dayend = self.config['env']['day_end']\n daylen = dayend - daystart\n sun = 0\n if daystart <= self.basetime <= dayend:\n sun = truncate(sin((se...
[ "0.6600755", "0.6318614", "0.62688094", "0.6240594", "0.6015584", "0.59204245", "0.5829589", "0.5817884", "0.57341105", "0.563973", "0.55999094", "0.5574173", "0.55625594", "0.55583686", "0.5550557", "0.5534982", "0.5518591", "0.5514087", "0.54966915", "0.54669213", "0.545489...
0.723405
0
Returns the string representation of the model
def to_str(self): return pprint.pformat(self.to_dict())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _repr_model_(self):\n return str(self)", "def __str__(self):\n\n return str(self.model)", "def get_model_string(self):\n raise NotImplementedError()", "def __str__(self):\n return self.model", "def serialize_model(self):\n return dill.dumps(self.model)", "def __str_...
[ "0.8602178", "0.8509178", "0.82356834", "0.80495524", "0.8011123", "0.79336935", "0.7877631", "0.7789918", "0.7789225", "0.7745271", "0.7629439", "0.760794", "0.7581855", "0.7514664", "0.75062877", "0.75031793", "0.74870557", "0.7443237", "0.7434521", "0.7426648", "0.7407079"...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, CommonHostForensicSettings): return True return self.to_dict() != other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n return not self == other", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other):\n return self.__dict__ != other.__dict__", "def __eq__(self, other):\n return not self.__ne__(other)", ...
[ "0.8411268", "0.83923674", "0.81723326", "0.81407183", "0.8092415", "0.8089446", "0.8067915", "0.80427635", "0.80427635", "0.80427635", "0.80427635", "0.80427635", "0.80427635", "0.80427635", "0.80427635", "0.80427635", "0.80427635", "0.80427635", "0.80427635", "0.80427635", ...
0.0
-1
Set to the ID of the found API Gateway VPC Link.
def id(self) -> str: return pulumi.get(self, "id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def link_id(self, link_id):\n\n self._link_id = link_id", "def gateway_id(self, gateway_id):\n self._gateway_id = gateway_id", "def id(self, value):\r\n self.logger.warn(\"Setting values on id will NOT update the remote Canvas instance.\")\r\n self._id = value", "def id(self, id):...
[ "0.5976201", "0.5888198", "0.54830444", "0.5434257", "0.5434257", "0.5434257", "0.5434257", "0.5434257", "0.54331857", "0.54300195", "0.5394217", "0.5394217", "0.5394217", "0.5394217", "0.5394217", "0.5394217", "0.5394217", "0.5394217", "0.5394217", "0.5394217", "0.5394217", ...
0.0
-1
provides the currently playing song
def np(): return jsonify({"Current": playlist.current_song})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_current_song(self):\n async with self.client_session.get(f\"{self.backend_url}/api/playing\") as response:\n if response.status == 200:\n data = await response.json()\n return data\n else:\n return None", "def __getCurrentSon...
[ "0.8366566", "0.8127663", "0.8075994", "0.7881762", "0.7638349", "0.7518323", "0.73468214", "0.71859354", "0.70048535", "0.6940885", "0.6914795", "0.6905133", "0.69008005", "0.68525684", "0.6846812", "0.6783808", "0.6766236", "0.67643154", "0.6752939", "0.6698326", "0.6679398...
0.6285944
54
votes by users to skip currently playing song
def skip(): if playlist.current_song == None: raise MethodNotAllowed votetoskip(request.args.get('username'), request.remote_addr) return jsonify({"Skip": "200"})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def skip(self, ctx):\r\n\r\n state = self.get_voice_state(ctx.message.server)\r\n if not state.is_playing():\r\n await self.bot.say('Not playing any music right now...')\r\n return\r\n\r\n voter = ctx.message.author\r\n if voter == state.current.requester:\r\...
[ "0.7528159", "0.75187075", "0.73352945", "0.71536607", "0.7053643", "0.69468856", "0.6820535", "0.6085493", "0.60461843", "0.5902705", "0.5894804", "0.57934725", "0.57852477", "0.57625884", "0.5753236", "0.5744074", "0.57382053", "0.5738115", "0.57258236", "0.570847", "0.5628...
0.61740863
7
Extract sliding local blocks from a batched input.
def _unfold(x: np.ndarray, kernel_size: int, padding: int) -> np.ndarray: # Do padding shape = tuple(np.array(x.shape[2:]) + padding * 2) x_pad = np.zeros(x.shape[:2] + shape) x_pad[:, :, padding : (shape[0] - padding), padding : (shape[1] - padding)] = x # Do unfolding ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_blocks(vggish_features, window, repeat, hop):\n index_window = np.tile(np.arange(window), repeat)\n # index_hop = np.arange(0,vggish_features.shape[0] - hop - (10 - vggish_features.shape[0]%window) - 1, hop)[:, np.newaxis]\n index_hop = np.arange(0, vggish_features.shape[0] - window + 1, hop)[:, np...
[ "0.61383724", "0.6128067", "0.6060206", "0.6039229", "0.58618414", "0.57763225", "0.5748457", "0.55547494", "0.54933107", "0.54537606", "0.5402776", "0.5387434", "0.53783876", "0.53674644", "0.5363104", "0.5356941", "0.5348548", "0.5336477", "0.5324961", "0.53082824", "0.5280...
0.0
-1
Sum scalar value to vector magnitude.
def vector_magnitude_sum(self, vector, scalar): vector = np.asarray(vector) x, y = vector vector_magnitude = math.sqrt(x**2 + y**2) if vector_magnitude > 0: vector_unit = vector/vector_magnitude else: vector_unit = [1, 0] return vector + (vector_un...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def magnitude(vector: Vec3) -> float:\n return m.sqrt(sum(x * x for x in vector))", "def magnitude(vec):\n return np.sqrt(np.sum(vec**2))", "def vector_magnitude(vec):\n magnitude = np.sqrt(np.sum(vec**2))\n return(magnitude)", "def vector_magnitude(vec):\n magnitude = np.sqrt(np.sum(vec**2))\...
[ "0.72223014", "0.70298344", "0.69401073", "0.69401073", "0.68630236", "0.684423", "0.668263", "0.6551018", "0.6524293", "0.64288074", "0.64101934", "0.63492054", "0.6332292", "0.62723553", "0.6255986", "0.6212872", "0.62062234", "0.62037706", "0.6202203", "0.6156881", "0.6130...
0.82189924
0
Returns the type of collision of the car and the circuit. Can be NONE or WALL.
def collision_car(self, car): return self.collision(car.get_points())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collidePlatform(self, platform):\n if 'noCollide' in platform.prop:\n return\n if 'beer' in platform.prop:\n return 'beer'\n if 'win' in platform.prop:\n return 'win'\n if 'death' in platform.prop:\n return 'death'\n\n collRules = p...
[ "0.6194045", "0.6100371", "0.60693467", "0.6059002", "0.6009015", "0.57722485", "0.56977826", "0.56238323", "0.559679", "0.5553257", "0.5532021", "0.54650635", "0.542398", "0.5325562", "0.5311379", "0.53060734", "0.53051955", "0.5297606", "0.5282734", "0.5241659", "0.5239644"...
0.67993194
0
Returns a list of types of collisions, each position corresponding to each car in list_cars.
def batch_collision_car(self, list_cars): if collisions_wrapper.collisions: ret = [] segs = [] for car in list_cars: pts = car.get_points() last_x, last_y = pts[-1] for x, y in pts: segs.extend([last_x, last_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _checkCollisions(self, ):\n collisions = []\n for dog in self._dogs:\n if collide(self._cat, dog):\n collisions.append(\"dog\")\n if collide(self._cat, self._goal):\n collisions.append(\"goal\")\n return collisions", "def collision_car(self, ca...
[ "0.6030393", "0.57359165", "0.57152444", "0.5694991", "0.5576437", "0.54590446", "0.5400033", "0.52948976", "0.5281104", "0.52406675", "0.512705", "0.50231826", "0.49745667", "0.49637648", "0.49260655", "0.49028718", "0.48909938", "0.48743734", "0.48618588", "0.48610178", "0....
0.7031128
0
Generate a new network by using the last network and adding 1 to it
def new_network(self): previous = self.network network = previous.split(".") new_network = int(network[1]) * 256 + int(network[2]) + 1 network = ".".join([network[0], str(new_network / 256), str(new_network % 256), str(0)]) ip = network.split('.') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_network(self, network):\n raise NotImplementedError", "def __createNetwork__(self, amount_nodes, amount_links):\n random.seed()\n\n for i in range(0, 3):\n AbstractNetwork.appendNode(self, node=Node(i))\n\n n0 = AbstractNetwork.getNode(self, 0)\n n1 = Ab...
[ "0.67312366", "0.6498237", "0.6407455", "0.6299766", "0.62799037", "0.61743313", "0.61274725", "0.60212463", "0.5978217", "0.5959207", "0.5950817", "0.5913124", "0.5893887", "0.58495617", "0.5799138", "0.577308", "0.5762524", "0.5703593", "0.5689935", "0.5689041", "0.5671348"...
0.6623325
1
Waits for a job to complete.
def poll_job(bigquery, job): print('Waiting for job to finish...') request = bigquery.jobs().get( projectId=job['jobReference']['projectId'], jobId=job['jobReference']['jobId']) while True: result = request.execute(num_retries=2) if result['sta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait_complete(jobname_synthax):\n # time.sleep(120)\n while not check_complete(jobname_synthax):\n time.sleep(120)", "def wait_until_jobs_finished(self, jobName):\n data = self.get_job_info(jobName)\n curJobNum = data['number']\n timeStamp = datetime.fromtimestamp(data['time...
[ "0.7237139", "0.71631783", "0.70019495", "0.69296", "0.6855199", "0.68505657", "0.6848231", "0.6824574", "0.6801281", "0.67325646", "0.67325646", "0.67325646", "0.67325646", "0.67103684", "0.67079765", "0.6687382", "0.665031", "0.6645352", "0.663115", "0.6579357", "0.6569875"...
0.72919375
0
Safely merge multiple dictionaries into one Merges an iterable of dictionaries into a new single dictionary, checking that there are no key collisions
def safe_dictionary_merge(dictionaries): kv_pairs = list(itertools.chain(*[d.iteritems() for d in dictionaries])) keys, values = zip(*kv_pairs) assert_no_duplicates(keys, 'Key collision while merging dictionarys') return dict(kv_pairs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge(*dicts):\n\treturn {k : reduce(lambda d,x: x.get(k, d), dicts, None) for k in reduce(or_, map(lambda x: x.keys(), dicts), set()) }", "def mergeDicts(*dict_args):\n\tresult = dict({})\n\tfor dictionary in dict_args:\n\t\ttry:\n\t\t\tresult.update(dictionary)\n\t\texcept Exception:\n\t\t\tcontinue\n\tret...
[ "0.7597412", "0.7499645", "0.73513937", "0.73500586", "0.72298795", "0.71548164", "0.7076098", "0.70719814", "0.7071725", "0.7063167", "0.69933695", "0.6977538", "0.69753885", "0.69623655", "0.6955447", "0.69553304", "0.6954476", "0.69507754", "0.6934752", "0.69153637", "0.69...
0.7673297
0
Returns the SHA1 hexdigest of a file
def file_sha1_hexdigest(filename): f = open(filename, 'rb') hashhex = hashlib.sha1(f.read()).hexdigest() f.close() return hashhex
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_sha1(file_path):\n\n return file_hash(file_path, hashlib.sha1())", "def _sha1_for_file(filename):\n with open(filename, \"rb\") as fileobj:\n contents = fileobj.read()\n return hashlib.sha1(contents).hexdigest()", "def file_hash(filename):\n # Open the file, read contents as byt...
[ "0.81794363", "0.8178801", "0.80654997", "0.80328184", "0.7965701", "0.7944955", "0.78492236", "0.7612342", "0.75669056", "0.738341", "0.7382095", "0.73642766", "0.7359903", "0.73472106", "0.7192275", "0.7153875", "0.7068177", "0.7055041", "0.70288306", "0.69928026", "0.69703...
0.88093466
0
Calculation threshold of T2 staticstic based on the Fisher distribution
def hotelling_treshold(self, alpha): mult = (((self.n**2) - 1) * self.a) / (self.n * (self.n - self.a)) crit_val = stats.f.ppf(q=1-alpha/2, dfn=self.a, dfd=self.n-self.a) # Critical value for F distribution return mult * crit_val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def threshold2(self):\r\n return self.__threshold2", "def _compute_threshold(self,z=2.0):\n scoretally = []\n for seq in self.seqs:\n matches,endpoints,scores = self.scan(seq,-100)\n scoretally.append(scores[0])\n ave,std = avestd(scoretally)\n self.thresh...
[ "0.6494936", "0.6389304", "0.60937", "0.6056592", "0.5952956", "0.59384507", "0.5852532", "0.5845614", "0.58443254", "0.57979614", "0.5773298", "0.5768133", "0.57207686", "0.5712549", "0.5704515", "0.5694107", "0.5661939", "0.565985", "0.56586546", "0.56516546", "0.56356525",...
0.5748093
12
Returns the root directory of the git repository, assuming this script is run from within the repository.
def get_git_root(): result = subprocess.run(['git', 'rev-parse', '--show-toplevel'], stdout=subprocess.PIPE, check=True) if result.stdout is None: # TODO: concrete exception raise Exception('Did not get any output from git: stderr is "{}"'.format(result.stderr)) return result.stdout.decode('...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_git_root_folder():\n init_repo_object()\n return os.path.dirname(repo.git_dir)", "def repo_root() -> str:\n repo = git.Repo(search_parent_directories=True)\n return repo.working_dir", "def get_repo_root():\n dir_in_repo = os.path.dirname(os.path.abspath('__file__'))\n return subproces...
[ "0.90916795", "0.9067228", "0.8674014", "0.8274579", "0.82677656", "0.8115655", "0.8107301", "0.8107301", "0.8107301", "0.8107301", "0.80913496", "0.80788064", "0.79911757", "0.79389673", "0.792807", "0.7800046", "0.77729523", "0.7754034", "0.7713082", "0.7592667", "0.7524258...
0.7668085
19
Fetch one config object
def fetch_config(self, url, etag=None, session=None): self.log.info("Fetching %s", url) if session == None: session = requests.Session() t_start = time.time() try: req_headers = self.rhead.copy() if self.config_etag: r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def fetch_config(self):\n async with aiohttp.ClientSession() as session:\n async with session.get(f\"{self.service_url}/config\") as response:\n data = await response.json()\n return data[\"config\"], data[\"schema\"]", "def fetchConfig(self, *args, **kwargs)...
[ "0.7033803", "0.6851875", "0.6716694", "0.6716694", "0.6716694", "0.6716694", "0.6716694", "0.6716694", "0.6716694", "0.6716694", "0.6716694", "0.6716694", "0.6716694", "0.6716694", "0.6716694", "0.6716694", "0.6716694", "0.6716694", "0.6716694", "0.6716694", "0.6716694", "...
0.0
-1
Return Flask test client that is configured for testing. Testing configuration should be placed in `tests/.env` file.
def client(): from tululbot import app app.config['TESTING'] = True return app.test_client()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def client():\n app = create_app('TESTING')\n client = app.test_client()\n return client", "def client(app): # pylint: disable=redefined-outer-name\n return app.test_client()", "def client():\n return app.test_client()", "def client():\n from main import create_app\n app = create_app()\...
[ "0.81976235", "0.7992821", "0.78431165", "0.77813", "0.7773771", "0.7720463", "0.7622202", "0.76015854", "0.7601454", "0.75724095", "0.75724095", "0.75724095", "0.75285167", "0.7332908", "0.73224473", "0.73196894", "0.73143", "0.72849256", "0.7100981", "0.6866913", "0.6866913...
0.7217341
18
Creates equivalent Darknet (YOLO) annotation files corresponding to a dataset with KITTI annotations.
def kitti_to_darknet( images_dir: str, kitti_dir: str, darknet_dir: str, darknet_labels: str, ): _logger.info("Converting annotations in KITTI format to Darknet format equivalents") # create the Darknet annotations directory in case it doesn't yet exist os.makedirs(darknet_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_yolo(img_data, img_width, img_height, stairs_only, target_dir, output_prefix=''):\n # Create yolo folder (if it does not exist already)\n Path(target_dir + f'/{output_prefix}YoloData').mkdir(exist_ok=True)\n\n # Define labels and their class integer\n labels = ['None', 'up', 'down']\n ...
[ "0.6634469", "0.62707645", "0.62023354", "0.61442345", "0.60503006", "0.5996516", "0.59931153", "0.5887218", "0.57702976", "0.57546675", "0.5745168", "0.5740674", "0.5739575", "0.57277244", "0.5715759", "0.5708", "0.5671551", "0.56633264", "0.5662424", "0.56542695", "0.564951...
0.6790772
0
Get all localized financial markets and languages they support.
def list_localized_financial(include_aliases=True) -> Dict[str, List[str]]: return _list_localized_entities(EntityLoader.get_financial_codes(include_aliases))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_all_languages(self):\n pass", "def get_all_languages():\n if not _languages:\n load_all_languages()\n return _languages", "def get_available_languages():\n return list(implemented_languages.keys())", "def list_supported_financial(include_aliases=True) -> Dict[str, List[str]]:\...
[ "0.66084325", "0.62129384", "0.6180974", "0.60680526", "0.605698", "0.58997655", "0.58997655", "0.58732414", "0.5841988", "0.574746", "0.5647552", "0.5647552", "0.5632526", "0.55952346", "0.5562096", "0.5539917", "0.5529418", "0.5524996", "0.551558", "0.5492203", "0.54888326"...
0.6232633
1
Efficiently compute mean L2 norm between trajectories and ground truths (pairwise over states).
def mean_distances(stacked_trajs: np.ndarray, stacked_ground_truth: np.ndarray) -> np.ndarray: return np.mean(np.linalg.norm(stacked_trajs - stacked_ground_truth, axis=-1), axis=-1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def avg_l2_dist(orig, adv):\n l2_dist = 0.0\n num_ = orig.shape[0]\n if num_ > 0:\n for i in range(orig.shape[0]):\n l2_dist+= np.linalg.norm(orig[i] - adv[i])\n return l2_dist/orig.shape[0]\n else:\n return np.nan", "def l2_norm(w, scope_prefix=''):\r\n # tf.norm i...
[ "0.67246926", "0.6625809", "0.6586715", "0.6419243", "0.64166814", "0.6411874", "0.64100426", "0.64037144", "0.63037854", "0.62633306", "0.6231129", "0.6213928", "0.61984605", "0.6195675", "0.6169094", "0.61587447", "0.61210036", "0.6079593", "0.6076504", "0.6064596", "0.6060...
0.5537816
73
Compute the miss rate over the top k modes.
def miss_rate_top_k(stacked_trajs: np.ndarray, stacked_ground_truth: np.ndarray, mode_probabilities: np.ndarray, tolerance: float) -> np.ndarray: miss_rate = miss_max_distances(stacked_trajs, stacked_ground_truth, tolerance) return rank_metric_over_top_k_modes(miss_rate,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top_k_acc(y_true, y_pred, k):\r\n sample_count = len(y_pred)\r\n hit_count = 0.\r\n for line_index, line_pred in enumerate(y_pred):\r\n line_true = y_true[line_index]\r\n top_k_pred_index = line_pred.argsort()[::-1][:k]\r\n for y_true_index in np.argwhere(line_true == 1):\r\n ...
[ "0.59078926", "0.5770868", "0.5639589", "0.5588001", "0.55828315", "0.5482735", "0.5477512", "0.5451571", "0.5427587", "0.54127103", "0.541202", "0.5398121", "0.5386846", "0.53573006", "0.5351113", "0.53475106", "0.53409606", "0.5327138", "0.53269964", "0.5319861", "0.5285297...
0.73507375
0
Computes the minimum average displacement error over the top k predictions.
def __init__(self, k_to_report: List[int], aggregators: List[Aggregator]): super().__init__() self.k_to_report = k_to_report self._aggregators = aggregators
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top_k_acc(y_true, y_pred, k):\r\n sample_count = len(y_pred)\r\n hit_count = 0.\r\n for line_index, line_pred in enumerate(y_pred):\r\n line_true = y_true[line_index]\r\n top_k_pred_index = line_pred.argsort()[::-1][:k]\r\n for y_true_index in np.argwhere(line_true == 1):\r\n ...
[ "0.6691219", "0.64178133", "0.6345562", "0.63150275", "0.6187186", "0.6062834", "0.6059934", "0.6058668", "0.6032575", "0.6030283", "0.59937125", "0.59661233", "0.5964347", "0.5926443", "0.5926443", "0.5926443", "0.5907907", "0.58822554", "0.5867667", "0.58326733", "0.5812775...
0.0
-1
Computes the minimum final displacement error over the top k predictions.
def __init__(self, k_to_report, aggregators: List[Aggregator]): super().__init__() self.k_to_report = k_to_report self._aggregators = aggregators
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top_k_acc(y_true, y_pred, k):\r\n sample_count = len(y_pred)\r\n hit_count = 0.\r\n for line_index, line_pred in enumerate(y_pred):\r\n line_true = y_true[line_index]\r\n top_k_pred_index = line_pred.argsort()[::-1][:k]\r\n for y_true_index in np.argwhere(line_true == 1):\r\n ...
[ "0.6474618", "0.64556533", "0.61482614", "0.61119944", "0.5993642", "0.59887743", "0.58960503", "0.5892024", "0.589116", "0.5816113", "0.5796498", "0.5729875", "0.57121617", "0.57033217", "0.5700665", "0.5673661", "0.5671219", "0.5651609", "0.5650944", "0.5645119", "0.5632102...
0.0
-1
If any point in the prediction is more than tolerance meters from the ground truth, it is a miss. This metric computes the fraction of predictions that are misses over the top k most likely predictions.
def __init__(self, k_to_report: List[int], aggregators: List[Aggregator], tolerance: float = 2.): self.k_to_report = k_to_report self._aggregators = aggregators self.tolerance = tolerance
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision_at_k(actual, predicted, k=10):\n num_hits = 0.0\n predicted = predicted[:k]\n\n for i, p in enumerate(predicted):\n if p in actual and p not in predicted[:i]:\n num_hits += 1.0\n if not actual or not predicted:\n return 0.0\n return num_hits / len(predicted)", ...
[ "0.7175595", "0.6756821", "0.6615227", "0.66024894", "0.6503685", "0.64466226", "0.64274275", "0.64272624", "0.6410988", "0.6408077", "0.6378482", "0.63769346", "0.6364007", "0.63561594", "0.63414556", "0.6340682", "0.63342553", "0.6330174", "0.63210636", "0.6291598", "0.6284...
0.0
-1
Return ucs containing 'pipe codes' with terminal color sequences. These are sometimes known as LORD codes, as they were used in the DOS Door
def decode_pipe(ucs): # simple optimization, no '|' ? exit early! if u'|' not in ucs: return ucs term = getterminal() outp = u'' ptr = 0 match = None ANSI_PIPE = re.compile(r'\|(\d{2,3}|\|)') for match in ANSI_PIPE.finditer(ucs): val = match.group(1) # allow esca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode_pipe(ucs):\n # (dead url ...)\n # http://wiki.mysticbbs.com/mci_codes\n #\n # TODO: Support all kinds of terminal color sequences,\n # such as kermit or avatar or some such, something non-emca,\n # upstream blessed project is looking for a SequenceIterator\n # class, https://github....
[ "0.7622092", "0.62753665", "0.6268141", "0.62197834", "0.61707187", "0.6106943", "0.6032593", "0.6031164", "0.5952507", "0.5915768", "0.5839415", "0.5789093", "0.57863164", "0.5778295", "0.57495195", "0.57401526", "0.5737518", "0.57273126", "0.5701432", "0.5671523", "0.566201...
0.7518292
1
Returns a specified number (`num_trees`) of random trees from the nexus.
def run_random(num_trees, nexus_obj, do_print=False): check_for_valid_NexusReader(nexus_obj, required_blocks=['trees']) try: num_trees = int(num_trees) except ValueError: raise ValueError("num_trees should be an integer") if num_trees > nexus_obj.trees.ntrees: raise ValueError(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_tree_random(cls, num_nodes, start=0, end=100):\n\n tree = BinaryTree()\n for x in range(num_nodes):\n tree.build(val=random.randrange(start, end))\n\n return tree", "def get_random_tree(n: int, seed: Optional[int] = None) -> nx.Graph:\n return nx.generators.trees.rand...
[ "0.6390643", "0.62705934", "0.6202953", "0.58929026", "0.57926613", "0.5770132", "0.57677376", "0.5730253", "0.5652112", "0.56514484", "0.5589146", "0.5582757", "0.5568069", "0.55102855", "0.54952025", "0.5481387", "0.54778504", "0.54608154", "0.5431724", "0.5423064", "0.5406...
0.74189043
0
Set the name of this data; prints to plot title.
def setDataName(self, name): self.dataName = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def title(self, l=''):\n self.gnuplot.title(str(l))", "def set_name(self, name):\n self._frame.SetTitle('%s: %s' % (self._name, name) if name else self._name)", "def update_title(self):\n name = \"\"\n \n # Create an appropriate name for whatever is selected.\n tab = s...
[ "0.7566226", "0.7466253", "0.7399515", "0.71508324", "0.7074076", "0.68697655", "0.6841113", "0.6816783", "0.6741561", "0.6738229", "0.67262363", "0.67032075", "0.66932243", "0.6689519", "0.6664489", "0.66576254", "0.66487956", "0.6646437", "0.6631025", "0.6614714", "0.661471...
0.71087086
4
Get the binary representation of the input (most significant to the right >>> get_binary_string(7) '111' >>> get_binary_string(2) '01' >>> get_binary_string(26) '01011' >>> get_binary_string(0) ''
def get_binary_string(number): remaining = number binary_string = "" while remaining > 0: binary_string += str(remaining % 2) remaining = remaining >> 1 return binary_string
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def int_to_binary(int_in: int) -> str:\n bin_out: str = bin(int_in)[2:].zfill(8)\n return bin_out", "def str_to_binary(string_in: str) -> str:\n bin_chars = [int_to_binary(ord(c)) for c in string_in]\n bin_str: str = \"\".join(bin_chars)\n return bin_str", "def binToStr(binary):\n string = ''\...
[ "0.78316027", "0.7614237", "0.75006163", "0.73650336", "0.73544866", "0.7344009", "0.7183792", "0.71099305", "0.70491016", "0.7017082", "0.7005634", "0.7000646", "0.69825083", "0.69736236", "0.69070774", "0.6901845", "0.6857481", "0.6846651", "0.6846639", "0.6838572", "0.6790...
0.7674804
1
3x3 convolution with padding. Original code has had bias turned off, because Batch Norm would remove the bias either way
def conv3x3(in_channels, out_channels, stride=1): return nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=stride, padding=1, bias=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conv3x3(in_planes, out_planes, stride=1, padding=1, groups=1, dilation=1, zero_init=False):\n conv = nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=padding, groups=groups, bias=False, dilation=dilation)\n if zero_init:\n conv.weight.data.zero_()\n return conv", "def co...
[ "0.7369475", "0.72055405", "0.71047175", "0.7099978", "0.70750976", "0.7044537", "0.7034055", "0.70120955", "0.7001741", "0.6997747", "0.6996105", "0.69586605", "0.6953979", "0.6925761", "0.6905403", "0.6905403", "0.68953586", "0.6890279", "0.6889231", "0.6889155", "0.6889037...
0.0
-1
Method to transform the output dictionary of the time series information into a pandas DataFrame
def dict_to_df(output): result_dict = { "Date": [], "dep": [], "total_occupancy": [], "icu_occupancy": [], "acute_occupancy": [], "total_patients": [], "icu_patients": [], "acute_patients": [], } for Date, val in output.items(): for no...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataframe(self):\n \n series = []\n for r in self._output_history:\n series.append(pd.Series(r))\n df = pd.concat(series, axis=1, ignore_index=True).transpose()\n df = df.reset_index(drop=True)\n self._dataframe = df.infer_objects()\n return df", "d...
[ "0.69800615", "0.6887166", "0.686084", "0.6655451", "0.653923", "0.65067476", "0.6492017", "0.647387", "0.64736474", "0.64662975", "0.64624584", "0.64231706", "0.6379415", "0.63779825", "0.6326013", "0.6322006", "0.631816", "0.63006216", "0.62936974", "0.62878245", "0.6286627...
0.66600955
3
Write the feature text. If headerText is provided it will inserted after the ``feature kern {`` line.
def write(self, headerText=None): if not self.pairs: return "" glyphGlyph, glyphGroupDecomposed, groupGlyphDecomposed, glyphGroup, groupGlyph, groupGroup = self.getSeparatedPairs(self.pairs) # write the classes groups = dict(self.side1Groups) groups.update(self.side2G...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetHeaderText(*args, **kwargs):\n return _richtext.RichTextPrinting_SetHeaderText(*args, **kwargs)", "def draw_header(screen: pg.Surface, text: str, offset=48, thick=5) -> None:\n \n write_text(screen, text, get_font(), TEXT, \n (offset, 23))\n pg.draw.rect(screen, TEXT, (offset...
[ "0.6287056", "0.56987387", "0.56399995", "0.55285335", "0.5325563", "0.53213906", "0.53144205", "0.53144205", "0.5277528", "0.52706283", "0.5263508", "0.5239029", "0.5236316", "0.523128", "0.51955664", "0.5189806", "0.51892054", "0.51794714", "0.5173104", "0.5159399", "0.5150...
0.72170377
0
Set up a dictionary containing all kerning pairs. This should filter out pairs containing empty groups and groups/glyphs that are not in the font. You should not call this method directly.
def getPairs(self): pairs = self.pairs = {} for (side1, side2), value in self.font.kerning.items(): # skip missing glyphs if side1 not in self.side1Groups and side1 not in self.font: continue if side2 not in self.side2Groups and side2 not in self.font:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def com_google_fonts_check_gpos_kerning_info(ttFont):\n if ttFont[\"post\"].isFixedPitch == 0 and not has_kerning_info(ttFont):\n yield WARN,\\\n Message(\"lacks-kern-info\",\n \"GPOS table lacks kerning information.\")\n else:\n yield PASS, \"GPOS table check ...
[ "0.57438767", "0.5708101", "0.5650138", "0.55640024", "0.54947555", "0.5419337", "0.5336204", "0.533042", "0.5149357", "0.5131506", "0.50741476", "0.5034646", "0.4985743", "0.49349204", "0.48468092", "0.48258466", "0.47921798", "0.47621804", "0.47456965", "0.47390547", "0.473...
0.7200989
0
Returns writingDir for the pair writingDir may be "LTR", "RTL", "MIX" or False
def getPairData(self, pair): side1writingDir, side2writingDir = [self.getPairItemDirection(side) for side in pair] if not side1writingDir or not side2writingDir: # Filtered/Removed writingDir = False elif side1writingDir in ['LTR', 'RTL']...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_writable_dir(self):\n return os.path.dirname(self.get_writable_file())", "def windDir(self) -> str:\n return self.period[\"windDir\"]", "def get_dir(self, delta):\n\n if delta[1] < 0:\n direction = 'n'\n elif delta[1] > 0:\n direction = 's'\n els...
[ "0.6030824", "0.5948773", "0.5858598", "0.5664179", "0.5661714", "0.5625283", "0.5522489", "0.5506234", "0.5498709", "0.543179", "0.5402165", "0.5402165", "0.5382989", "0.5382989", "0.5382989", "0.5382989", "0.5382989", "0.5382989", "0.5382989", "0.5382989", "0.5382989", "0...
0.70812434
0
Write the feature text. If headerText is provided it will inserted after the ``feature kern {`` line.
def write(self, headerText=None): if not self.pairs: return '' lineFormat = ' {0}' # get the classes groups = dict(self.side1Groups) groups.update(self.side2Groups) classes = self.getClassDefinitionsForGroups(groups) # get the rules looku...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write(self, headerText=None):\n if not self.pairs:\n return \"\"\n glyphGlyph, glyphGroupDecomposed, groupGlyphDecomposed, glyphGroup, groupGlyph, groupGroup = self.getSeparatedPairs(self.pairs)\n # write the classes\n groups = dict(self.side1Groups)\n groups.updat...
[ "0.7218695", "0.6288176", "0.56991315", "0.5640835", "0.5528064", "0.5326902", "0.5322819", "0.5277461", "0.5267442", "0.52649933", "0.52375215", "0.5233626", "0.5227994", "0.5195801", "0.518877", "0.518802", "0.5178771", "0.5171664", "0.5160348", "0.51507795", "0.51477575", ...
0.53171134
7
Returns this thread's context. If this thread does not yet have a context, returns a new context and sets this thread's context. New contexts are copies of DefaultContext.
def getcontext(): try: return threading.current_thread().__decimal_context__ except AttributeError: context = Context() threading.current_thread().__decimal_context__ = context return context
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_context() -> Context:\n ctx = _current_context.get()\n if ctx is None:\n raise NoCurrentContext\n\n return ctx", "def get_current(self) -> Context:\n return self._current_context.get()", "def getContext(self):\n return self.__context", "def context(self, *args, **kwa...
[ "0.71283185", "0.70048314", "0.68576795", "0.68257725", "0.67052764", "0.6621429", "0.6617681", "0.66073906", "0.6587544", "0.65758306", "0.65051883", "0.65051883", "0.64772105", "0.6470611", "0.6454244", "0.64345485", "0.6395533", "0.6384804", "0.63594645", "0.6347419", "0.6...
0.72250414
0
Returns this thread's context. If this thread does not yet have a context, returns a new context and sets this thread's context. New contexts are copies of DefaultContext.
def getcontext(_local=local): try: return _local.__decimal_context__ except AttributeError: context = Context() _local.__decimal_context__ = context return context
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getcontext():\n try:\n return threading.current_thread().__decimal_context__\n except AttributeError:\n context = Context()\n threading.current_thread().__decimal_context__ = context\n return context", "def current_context() -> Context:\n ctx = _cu...
[ "0.72247416", "0.71281946", "0.70048606", "0.6858007", "0.68254155", "0.6705117", "0.66212296", "0.66171706", "0.6607052", "0.658767", "0.6575669", "0.6504737", "0.6504737", "0.6476913", "0.6470233", "0.6454053", "0.64344", "0.6395253", "0.6384247", "0.63582176", "0.63477606"...
0.5766898
57
Return a context manager for a copy of the supplied context Uses a copy of the current context if no context is specified The returned context manager creates a local decimal context
def localcontext(ctx=None): if ctx is None: ctx = getcontext() return _ContextManager(ctx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getcontext(_local=local):\n try:\n return _local.__decimal_context__\n except AttributeError:\n context = Context()\n _local.__decimal_context__ = context\n return context", "def getcontext():\n try:\n return threading.current_thread...
[ "0.75088346", "0.72782516", "0.6772718", "0.65282893", "0.6517784", "0.6446353", "0.6256504", "0.62351286", "0.6215153", "0.6176901", "0.61186206", "0.60122", "0.6005168", "0.59614676", "0.58738136", "0.58604133", "0.5840601", "0.5829148", "0.58083177", "0.58083177", "0.57836...
0.6962517
2
Returns whether the number is not actually one. 0 if a number 1 if NaN 2 if sNaN
def _isnan(self): if self._is_special: exp = self._exp if exp == 'n': return 1 elif exp == 'N': return 2 return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isnan(num):\n\n return num != num", "def is_nan(value):\n\n return value != value", "def isNan(num):\n if ((num < 10.0) == False and (num > -10.0) == False):\n return True\n\n else:\n return False", "def is_number(val):\n try:\n return not math.isnan(float(val))\n e...
[ "0.7652898", "0.7520659", "0.7488504", "0.74588245", "0.74521923", "0.7252339", "0.72381777", "0.7194524", "0.71451217", "0.7135962", "0.7089204", "0.70826745", "0.7081299", "0.69351715", "0.6894236", "0.6858463", "0.68482745", "0.6835539", "0.6819", "0.67915154", "0.6786777"...
0.7077437
13
Returns whether the number is infinite 0 if finite or not a number 1 if +INF 1 if INF
def _isinfinity(self): if self._exp == 'F': if self._sign: return -1 return 1 return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isinf(x):\n from amath.DataTypes.Infinity import Infinity\n if isinstance(x, Infinity):\n return True\n elif x == float(\"inf\"):\n return True\n elif x == float(\"-inf\"):\n return True\n else:\n return False", "def is_infinite(space, f):\n return space.wrap(mat...
[ "0.7794203", "0.7693483", "0.76514995", "0.74963385", "0.73795635", "0.7362287", "0.7333311", "0.7312842", "0.72646344", "0.7248705", "0.72303677", "0.72142047", "0.720861", "0.71792686", "0.71613747", "0.7154394", "0.7142135", "0.7141319", "0.7133419", "0.71197987", "0.71059...
0.714565
16
Version of _check_nans used for the signaling comparisons compare_signal, __le__, __lt__, __ge__, __gt__. Signal InvalidOperation if either self or other is a (quiet or signaling) NaN. Signaling NaNs take precedence over quiet NaNs. Return 0 if neither operand is a NaN.
def _compare_check_nans(self, other, context): if context is None: context = getcontext() if self._is_special or other._is_special: if self.is_snan(): return context._raise_error(InvalidOperation, 'comparison involving ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_nans(self, other=None, context=None):\n\n self_is_nan = self._isnan()\n if other is None:\n other_is_nan = False\n else:\n other_is_nan = other._isnan()\n\n if self_is_nan or other_is_nan:\n if context is None:\n context = getco...
[ "0.8045677", "0.594173", "0.5931618", "0.5902381", "0.5800969", "0.57973903", "0.5739353", "0.5646639", "0.5637077", "0.56176925", "0.5579124", "0.5579124", "0.55628914", "0.5529238", "0.55203557", "0.55031645", "0.5498377", "0.5473189", "0.5460531", "0.54504436", "0.53997254...
0.8050385
0
Return True if self is nonzero; otherwise return False. NaNs and infinities are considered nonzero.
def __bool__(self): return self._is_special or self._int != '0'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __nonzero__(self):\n\n if self.times.sum() == 0:\n return False\n return True", "def __nonzero__(self):\n\n if not self.A:\n return False\n return True", "def __nonzero__(self):\r\n # This could be arbitrarily complex:\r\n return bool(self.val...
[ "0.7833936", "0.76386046", "0.7406849", "0.73995316", "0.7352256", "0.7335201", "0.73236847", "0.7320123", "0.72730446", "0.72684914", "0.7253926", "0.7242643", "0.7208822", "0.7194224", "0.71408975", "0.7117663", "0.7102493", "0.70927745", "0.7086882", "0.70668155", "0.70441...
0.0
-1
Compare the two nonNaN decimal instances self and other. Returns 1 if self other. This routine is for internal use only.
def _cmp(self, other): if self._is_special or other._is_special: self_inf = self._isinfinity() other_inf = other._isinfinity() if self_inf == other_inf: return 0 elif self_inf < other_inf: return -1 else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n if not isinstance(other, DecimalVersion):\n return False\n return self._value == other.value", "def compare_total(self, other, context=None):\n other = _convert_other(other, raiseit=True)\n\n # if one is negative and the other is positive, it's ea...
[ "0.6866002", "0.6860478", "0.68080074", "0.6804258", "0.6765086", "0.6745962", "0.66428465", "0.6610787", "0.66024524", "0.6538891", "0.64990383", "0.6473891", "0.6469555", "0.64281344", "0.63928425", "0.6383293", "0.636727", "0.6357227", "0.6354121", "0.63430935", "0.6322897...
0.69103855
0
Express a finite Decimal instance in the form n / d. Returns a pair (n, d) of integers. When called on an infinity or NaN, raises OverflowError or ValueError respectively. >>> Decimal('3.14').as_integer_ratio() (157, 50) >>> Decimal('123e5').as_integer_ratio() (12300000, 1) >>> Decimal('0.00').as_integer_ratio() (0, 1)
def as_integer_ratio(self): if self._is_special: if self.is_nan(): raise ValueError("cannot convert NaN to integer ratio") else: raise OverflowError("cannot convert Infinity to integer ratio") if not self: return 0, 1 # Find n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_integer_ratio(self): # real signature unknown; restored from __doc__\n pass", "def as_integer_ratio(self): # real signature unknown; restored from __doc__\n pass", "def as_integer_ratio(self): # real signature unknown; restored from __doc__\n pass", "def as_integer_ratio(self): # ...
[ "0.6353803", "0.6353803", "0.6353803", "0.6353803", "0.6353803", "0.6353803", "0.6353803", "0.6353803", "0.6353803", "0.6353803", "0.6353803", "0.6151479", "0.5894065", "0.58879024", "0.57462996", "0.5725446", "0.5614033", "0.5488543", "0.5437611", "0.5372466", "0.5317026", ...
0.73493433
0
Return string representation of the number in scientific notation. Captures all of the information in the underlying representation.
def __str__(self, eng=False, context=None): sign = ['', '-'][self._sign] if self._is_special: if self._exp == 'F': return sign + 'Infinity' elif self._exp == 'n': return sign + 'NaN' + self._int else: # self._exp == 'N' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scientific_number(x,d):\n X = (\"{:.{:d}e}\".format(x,d)).split(\"e\")\n return X[0],\"{:d}\".format(int(X[1]))", "def latex_exp(num):\n if (isinstance(num, int)):\n # integer type, don't reformat\n return str(num)\n else:\n float_str = \"{:.1E}\".format(num)\n if \"E\" in...
[ "0.6896609", "0.68631536", "0.67952645", "0.61537516", "0.61146766", "0.6109661", "0.59983283", "0.5965029", "0.59524864", "0.5874346", "0.58518326", "0.58195376", "0.58171326", "0.58080834", "0.5804607", "0.57976073", "0.5792569", "0.578461", "0.5760363", "0.5756811", "0.574...
0.6615058
3
Return self / other.
def __truediv__(self, other, context=None): other = _convert_other(other) if other is NotImplemented: return NotImplemented if context is None: context = getcontext() sign = self._sign ^ other._sign if self._is_special or other._is_special: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def other(self):\n return self._other", "def other(self):\n return self._other", "def __ror__(self, other):\n return self.wrap(other)", "def __rsub__(self, other):\n return other - self", "def __sub__(self, other):\n return self.spawn(self.values - other.values)", "def ...
[ "0.7671826", "0.7671826", "0.722536", "0.7168786", "0.71291554", "0.7123579", "0.7060198", "0.7026491", "0.70071864", "0.693591", "0.6928962", "0.6918083", "0.68608594", "0.6846195", "0.6833084", "0.6823704", "0.67555773", "0.67451507", "0.6719447", "0.6718029", "0.67177653",...
0.0
-1
Normalize strip trailing 0s, change anything equal to 0 to 0e0
def normalize(self, context=None): if context is None: context = getcontext() if self._is_special: ans = self._check_nans(context=context) if ans: return ans dup = self._fix(context) if dup._isinfinity(): return dup ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _normalize0(self): #return None\n if self._mantissa[0]: #nothing to do\n return self\n first = 0\n m0 = self._mantissa[0]\n for d in self._mantissa:\n if d: #d!= 0\n break\n else:\n first += 1\n self._expo...
[ "0.72477514", "0.63784707", "0.6284638", "0.61791074", "0.6114479", "0.6088582", "0.6049178", "0.6035754", "0.60213786", "0.59663033", "0.5955372", "0.5953929", "0.593979", "0.59181666", "0.59139675", "0.5866983", "0.58440846", "0.58374876", "0.58290267", "0.5800327", "0.5747...
0.5160296
100
Quantize self so its exponent is the same as that of exp. Similar to self._rescale(exp._exp) but with error checking.
def quantize(self, exp, rounding=None, context=None): exp = _convert_other(exp, raiseit=True) if context is None: context = getcontext() if rounding is None: rounding = context.rounding if self._is_special or exp._is_special: ans = self._check_nans(e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _rescale(self, exp, rounding):\n if self._is_special:\n return Decimal(self)\n if not self:\n return _dec_from_triple(self._sign, '0', exp)\n\n if self._exp >= exp:\n # pad answer with zeros if necessary\n return _dec_from_triple(self._sign,\n ...
[ "0.7165346", "0.6755583", "0.6502892", "0.636936", "0.6229593", "0.621329", "0.6131308", "0.6062212", "0.6036229", "0.5993929", "0.58956516", "0.5892394", "0.58834124", "0.5851354", "0.58121", "0.57965755", "0.5787704", "0.57463694", "0.56588763", "0.56188273", "0.55987114", ...
0.7597742
0
Return True if self and other have the same exponent; otherwise return False.
def same_quantum(self, other, context=None): other = _convert_other(other, raiseit=True) if self._is_special or other._is_special: return (self.is_nan() and other.is_nan() or self.is_infinite() and other.is_infinite()) return self._exp == other._exp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def equal(self, other):\n return self.num * other.den == self.den * other.num", "def __ge__(self, other: \"Fraction\") -> bool:\n f1: float = self.num / self.denom\n f2: float = other.num / other.denom\n\n if f1 >= f2:\n return True\n else:\n return False"...
[ "0.707047", "0.67917365", "0.67225766", "0.67005336", "0.6686922", "0.6574685", "0.6563646", "0.6502646", "0.64825654", "0.64778817", "0.6467053", "0.6443969", "0.64398456", "0.64385545", "0.6392581", "0.6376194", "0.6373773", "0.6361563", "0.6345612", "0.6341972", "0.6326443...
0.6918826
1
Rescale self so that the exponent is exp, either by padding with zeros or by truncating digits, using the given rounding mode. Specials are returned without change. This operation is
def _rescale(self, exp, rounding): if self._is_special: return Decimal(self) if not self: return _dec_from_triple(self._sign, '0', exp) if self._exp >= exp: # pad answer with zeros if necessary return _dec_from_triple(self._sign, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def round(self, num: float) -> float:\n exponent_len = len(str(num // 1.0)[:-2])\n rounding_len = min(self.maxlen - exponent_len, 4)\n return round(num, rounding_len)", "def quantize(self, exp, rounding=None, context=None):\n exp = _convert_other(exp, raiseit=True)\n\n if conte...
[ "0.5954245", "0.59319663", "0.58891016", "0.58586305", "0.5515852", "0.54699403", "0.542891", "0.5428122", "0.53970444", "0.5268476", "0.5227669", "0.52214026", "0.5208919", "0.5182061", "0.5160033", "0.5150214", "0.514488", "0.5139114", "0.51385266", "0.5133885", "0.51056445...
0.69965947
0
Rounds to a nearby integer. If no rounding mode is specified, take the rounding mode from the context. This method raises the Rounded and Inexact flags when appropriate.
def to_integral_exact(self, rounding=None, context=None): if self._is_special: ans = self._check_nans(context=context) if ans: return ans return Decimal(self) if self._exp >= 0: return Decimal(self) if not self: return _...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rounding():\n return int(parameters['rounding'])", "def rounding_direction(self, x, mode):\n d = decimal\n cmp = 1 if x.compare_total(d.Decimal(\"+0\")) >= 0 else -1\n\n if mode in (d.ROUND_HALF_EVEN, d.ROUND_HALF_UP, d.ROUND_HALF_DOWN):\n return 0\n elif mode == d.R...
[ "0.6497434", "0.62670636", "0.61490506", "0.6034546", "0.597533", "0.56978714", "0.56748927", "0.56321603", "0.5631486", "0.5608075", "0.5602122", "0.5581286", "0.55811775", "0.5559716", "0.5548197", "0.5460107", "0.54501027", "0.5441578", "0.54398924", "0.5424392", "0.541768...
0.5618841
9
Returns the smaller value. Like min(self, other) except if one is not a number, returns NaN (and signals if one is sNaN). Also rounds.
def min(self, other, context=None): other = _convert_other(other, raiseit=True) if context is None: context = getcontext() if self._is_special or other._is_special: # If one operand is a quiet NaN and the other is number, then the # number is always returned...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def minimum(self, other):\n return math_funcs.minimum(self, other)", "def min(self, a, b):\n a = _convert_other(a, raiseit=True)\n return a.min(b, context=self)", "def minimum(self, other):\n return self.tocsr().minimum(other)", "def get_min(self):\n if self.min == float('inf')...
[ "0.7400019", "0.7075339", "0.68902045", "0.6808516", "0.6806972", "0.6706961", "0.66788125", "0.66503245", "0.6635309", "0.6539208", "0.65291", "0.65291", "0.6518048", "0.6518048", "0.6518048", "0.6518048", "0.6487278", "0.6455486", "0.64407015", "0.64086586", "0.63703555", ...
0.7534895
0
Returns True if self is even. Assumes self is an integer.
def _iseven(self): if not self or self._exp > 0: return True return self._int[-1+self._exp] in '02468'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_even(self):\n if self(-1) == -1:\n return False\n else:\n return True", "def is_even(num: int) -> bool:\n pass", "def is_even(number):\n assert isinstance(number, int), 'Input is not instance of int'\n return number % 2 == 0", "def is_even(number):\r\n r...
[ "0.8439596", "0.7886398", "0.7726573", "0.7704142", "0.76814216", "0.76334393", "0.75966895", "0.75654614", "0.75101215", "0.7509021", "0.7471753", "0.7456785", "0.7434121", "0.73667955", "0.7289438", "0.72505486", "0.72471863", "0.6899662", "0.68698233", "0.67475545", "0.664...
0.5623264
55
Return the adjusted exponent of self
def adjusted(self): try: return self._exp + len(self._int) - 1 # If NaN or Infinity, self._exp is string except TypeError: return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exponent(self):\n if hasattr(self, '_exponent'): # ?\n return self._exponent\n else:\n return 0", "def exp(self):\n if self._exponent > 0: \n raise ValueError(\"Todo(?) - case if exponent (== {}) is positive.\".format(self.exponent))\n \n ...
[ "0.7724295", "0.6921504", "0.6654309", "0.66334456", "0.64522475", "0.6450144", "0.6377662", "0.6364808", "0.62708396", "0.62236166", "0.61977506", "0.61976844", "0.61796314", "0.61487323", "0.6091869", "0.6079309", "0.6064294", "0.6059696", "0.60519075", "0.6051", "0.6028641...
0.6532484
4
Compares self to other using the abstract representations. This is not like the standard compare, which use their numerical value. Note that a total ordering is defined for all possible abstract representations.
def compare_total(self, other, context=None): other = _convert_other(other, raiseit=True) # if one is negative and the other is positive, it's easy if self._sign and not other._sign: return _NegativeOne if not self._sign and other._sign: return _One sign ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compare(self, other):\n # all redefinitions of __cmp__ method should start with the\n # following three lines:\n if self is other: return 0\n c = cmp(self.__class__, other.__class__)\n if c: return c\n #\n st = self._hashable_content()\n ot = other._hasha...
[ "0.7755141", "0.76493466", "0.74170285", "0.7388083", "0.738404", "0.7340101", "0.73251647", "0.7324946", "0.7290522", "0.7278077", "0.72599906", "0.723568", "0.7234621", "0.7215799", "0.7196573", "0.7171722", "0.71607167", "0.7124596", "0.7075639", "0.70670384", "0.70212424"...
0.6236499
94
Returns a copy with the sign inverted.
def copy_negate(self): if self._sign: return _dec_from_triple(0, self._int, self._exp, self._is_special) else: return _dec_from_triple(1, self._int, self._exp, self._is_special)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invert(self):\r\n inv = (each * -1 for each in self)\r\n return Vector(inv)", "def copy_sign(self, a, b):\n a = _convert_other(a, raiseit=True)\n return a.copy_sign(b)", "def __invert__(self):\n return arithmetics.invert(self)", "def __invert__(self):\n return se...
[ "0.682683", "0.67969203", "0.6676529", "0.6582948", "0.65426385", "0.64957726", "0.64856976", "0.6434687", "0.6420709", "0.6414818", "0.63769436", "0.6365402", "0.6343486", "0.63154674", "0.62627584", "0.62627584", "0.62600654", "0.6245746", "0.6237619", "0.62302893", "0.6206...
0.6675135
3
Return True if self is canonical; otherwise return False. Currently, the encoding of a Decimal instance is always canonical, so this method returns True for any Decimal.
def is_canonical(self): return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_canonical(self, a):\n if not isinstance(a, Decimal):\n raise TypeError(\"is_canonical requires a Decimal as an argument.\")\n return a.is_canonical()", "def isdecimal(self): # real signature unknown; restored from __doc__\n return False", "def __get_has_canonical_format(s...
[ "0.81738365", "0.66329145", "0.64941746", "0.64876074", "0.64711314", "0.6187487", "0.6132696", "0.60875154", "0.59202397", "0.5888656", "0.5888656", "0.57888603", "0.5747339", "0.57244754", "0.56390375", "0.561874", "0.5608978", "0.55525815", "0.5516211", "0.55120623", "0.54...
0.6581366
2
Return True if self is finite; otherwise return False. A Decimal instance is considered finite if it is neither infinite nor a NaN.
def is_finite(self): return not self._is_special
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_finite(self):\n return True", "def isfinite(self):\n return True", "def is_finite(self):\n return False", "def isfinite(self):\n return False", "def is_finite(self, a):\n a = _convert_other(a, raiseit=True)\n return a.is_finite()", "def is_finite(self):\n\...
[ "0.795403", "0.79454595", "0.78617924", "0.7832701", "0.7621671", "0.754849", "0.74996066", "0.72709596", "0.712708", "0.70923114", "0.70802975", "0.70320886", "0.69828975", "0.6876231", "0.68303615", "0.6796824", "0.67818034", "0.66575795", "0.66352075", "0.6630075", "0.6604...
0.782118
4
Return True if self is infinite; otherwise return False.
def is_infinite(self): return self._exp == 'F'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_infinite(self):\n\t\tpass", "def is_infinite(self, a):\n a = _convert_other(a, raiseit=True)\n return a.is_infinite()", "def isfinite(self):\n return False", "def isfinite(self):\n return True", "def is_infinite(self):\n points = self.points()\n for ...
[ "0.82745385", "0.7993563", "0.79383284", "0.7925136", "0.7910982", "0.778674", "0.77298826", "0.772567", "0.76786774", "0.75319314", "0.73582363", "0.7229842", "0.7166023", "0.7157449", "0.708037", "0.707152", "0.69152176", "0.68755466", "0.6802727", "0.67650884", "0.67111", ...
0.7990143
2
Return True if self is a qNaN or sNaN; otherwise return False.
def is_nan(self): return self._exp in ('n', 'N')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_qnan(self, a):\n a = _convert_other(a, raiseit=True)\n return a.is_qnan()", "def is_qnan(self):\n return self._exp == 'n'", "def is_nan(self, a):\n a = _convert_other(a, raiseit=True)\n return a.is_nan()", "def __bool__(self):\n if self._SSE is None: return Tr...
[ "0.7749599", "0.7463467", "0.7028396", "0.67261505", "0.6527631", "0.6523176", "0.650985", "0.6464539", "0.64445275", "0.6432381", "0.64047414", "0.6375971", "0.6371492", "0.6357138", "0.63302165", "0.63232404", "0.63204044", "0.6299645", "0.6273944", "0.6261681", "0.62205476...
0.6916319
3
Return True if self is a quiet NaN; otherwise return False.
def is_qnan(self): return self._exp == 'n'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_qnan(self, a):\n a = _convert_other(a, raiseit=True)\n return a.is_qnan()", "def is_nan(self, a):\n a = _convert_other(a, raiseit=True)\n return a.is_nan()", "def is_nan(self):\n return self._exp in ('n', 'N')", "def isnan(self):\n return math_funcs.isnan(self)", ...
[ "0.78534895", "0.78171235", "0.76778936", "0.73635083", "0.7299901", "0.7286066", "0.72633016", "0.70589644", "0.7009574", "0.69684213", "0.6950465", "0.69371146", "0.69264096", "0.6882455", "0.6869748", "0.6846881", "0.68401587", "0.6804473", "0.6782145", "0.6748897", "0.672...
0.75613564
3
Return True if self is a signaling NaN; otherwise return False.
def is_snan(self): return self._exp == 'N'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_nan(self, a):\n a = _convert_other(a, raiseit=True)\n return a.is_nan()", "def is_nan(self):\n return self._exp in ('n', 'N')", "def is_nan(x):\n if not isinstance(x, float):\n return False\n return not (x <= 0 or x >= 0)", "def is_qnan(self, a):\n ...
[ "0.8075992", "0.797428", "0.7784057", "0.75843316", "0.75831866", "0.747649", "0.74045485", "0.73862374", "0.7383534", "0.7376785", "0.73455507", "0.73352325", "0.72844756", "0.72713697", "0.7243873", "0.72134095", "0.71832484", "0.71813375", "0.71465003", "0.7056432", "0.705...
0.0
-1
Return True if self is subnormal; otherwise return False.
def is_subnormal(self, context=None): if self._is_special or not self: return False if context is None: context = getcontext() return self.adjusted() < context.Emin
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_subnormal(self, a):\n a = _convert_other(a, raiseit=True)\n return a.is_subnormal(context=self)", "def isNormalized(self):\n return self.getLength() == 1", "def is_normal(self, a):\n a = _convert_other(a, raiseit=True)\n return a.is_normal(context=self)", "def is_nor...
[ "0.8379707", "0.6881542", "0.6848396", "0.6824733", "0.66202927", "0.6288153", "0.6272157", "0.62324154", "0.6175187", "0.6161753", "0.596088", "0.596088", "0.5937436", "0.59256923", "0.58587456", "0.5802711", "0.57856447", "0.57247066", "0.5717017", "0.56998634", "0.56981355...
0.75966614
1
Return True if self is a zero; otherwise return False.
def is_zero(self): return not self._is_special and self._int == '0'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_zero(self, a):\n a = _convert_other(a, raiseit=True)\n return a.is_zero()", "def __nonzero__(self):\n\n if self.times.sum() == 0:\n return False\n return True", "def is_zero(self):\n return self.degree() == 0", "def isZero(self):\n\n return self.x =...
[ "0.8275882", "0.7803227", "0.7742648", "0.763464", "0.74145913", "0.7371592", "0.7351162", "0.73439157", "0.73172307", "0.7278827", "0.72175467", "0.7216739", "0.7205279", "0.7203353", "0.7180375", "0.715563", "0.7127346", "0.7108486", "0.7064092", "0.6999314", "0.6972151", ...
0.81753284
1
Invert all its digits.
def logical_invert(self, context=None): if context is None: context = getcontext() return self.logical_xor(_dec_from_triple(0,'1'*context.prec,0), context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reinverted(n, r):\n result = 0\n r = 1 << (r - 1)\n while n:\n if not n & 1:\n result |= r\n r >>= 1\n n >>= 1\n if r:\n result |= (r << 1) - 1\n return result", "def invert(self):\n pass # TODO", "def __invert__(self):\n return arithmetic...
[ "0.6070215", "0.5809768", "0.58044446", "0.57893926", "0.5649631", "0.5627844", "0.56204414", "0.56021816", "0.5601699", "0.5595808", "0.55841696", "0.54929644", "0.54686683", "0.5468503", "0.54679316", "0.54318565", "0.54036915", "0.5390247", "0.53693604", "0.5366001", "0.53...
0.48896918
65
Returns the number closest to self, in the direction towards other. The result is the closest representable number to self (excluding self) that is in the direction towards other, unless both have the same value. If the two operands are numerically equal, then the result is a copy of self with the sign set to be the sa...
def next_toward(self, other, context=None): other = _convert_other(other, raiseit=True) if context is None: context = getcontext() ans = self._check_nans(other, context) if ans: return ans comparison = self._cmp(other) if comparison == 0: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _cmp(self, other):\n\n if self._is_special or other._is_special:\n self_inf = self._isinfinity()\n other_inf = other._isinfinity()\n if self_inf == other_inf:\n return 0\n elif self_inf < other_inf:\n return -1\n else:\...
[ "0.69449097", "0.6321927", "0.62865204", "0.62846273", "0.6273069", "0.62066317", "0.61905897", "0.6142205", "0.6123702", "0.6111375", "0.609823", "0.6097177", "0.607007", "0.6069468", "0.6065727", "0.60394335", "0.59689873", "0.5934428", "0.5928894", "0.58801764", "0.5867763...
0.66657925
1
Returns a shallow copy from self.
def _shallow_copy(self): nc = Context(self.prec, self.rounding, self.Emin, self.Emax, self.capitals, self.clamp, self.flags, self.traps, self._ignored_flags) return nc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy(self):\r\n return copy.deepcopy(self)", "def copy(self):\n return copy.deepcopy(self)", "def copy(self):\n return copy.deepcopy(self)", "def copy(self):\n return copy.deepcopy(self)", "def copy(self):\n return copy.deepcopy(self)", "def copy(self):\n ret...
[ "0.8746695", "0.8733794", "0.8733794", "0.8733794", "0.8733794", "0.8733794", "0.8733794", "0.8733794", "0.8733794", "0.8733794", "0.8733794", "0.8733794", "0.8733794", "0.8733794", "0.8717837", "0.87128425", "0.86986345", "0.86986345", "0.86943907", "0.8691307", "0.8684045",...
0.0
-1
Returns a deep copy from self.
def copy(self): nc = Context(self.prec, self.rounding, self.Emin, self.Emax, self.capitals, self.clamp, self.flags.copy(), self.traps.copy(), self._ignored_flags) return nc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deepcopy(self):\n return self.clone()", "def deepcopy(self):\n return copy.deepcopy(self)", "def Copy(self):\r\n\r\n return copy.deepcopy(self)", "def deepcopy(self):\n return deepcopy(self)", "def deepcopy(self):\n return self.__copy__()", "def copy(self):\r\n ...
[ "0.8896822", "0.8887302", "0.8873807", "0.8869522", "0.8851984", "0.8845097", "0.8845097", "0.8838028", "0.8832555", "0.8832555", "0.8825782", "0.8825782", "0.8825782", "0.8825782", "0.8825782", "0.8825782", "0.8825782", "0.8825782", "0.8825782", "0.8825782", "0.8825782", "...
0.0
-1
Creates a new Decimal instance from a float but rounding using self as the context. >>> context = Context(prec=5, rounding=ROUND_DOWN) >>> context.create_decimal_from_float(3.1415926535897932) Decimal('3.1415') >>> context = Context(prec=5, traps=[Inexact]) >>> context.create_decimal_from_float(3.1415926535897932)
def create_decimal_from_float(self, f): d = Decimal.from_float(f) # An exact conversion return d._fix(self) # Apply the context rounding
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_float(cls, f):\n if isinstance(f, int): # handle integer inputs\n return cls(f)\n if not isinstance(f, float):\n raise TypeError(\"argument must be int or float.\")\n if _math.isinf(f) or _math.isnan(f):\n return cls(repr(f))\n if...
[ "0.6262966", "0.606405", "0.5845096", "0.58262104", "0.5789749", "0.5511273", "0.52682036", "0.524746", "0.5164344", "0.51574504", "0.51131177", "0.50633067", "0.5044807", "0.5009185", "0.49635804", "0.4862452", "0.48082924", "0.4796772", "0.4781723", "0.4771481", "0.47252068...
0.77637297
0
Returns a copy of the decimal object. >>> ExtendedContext.copy_decimal(Decimal('2.1')) Decimal('2.1') >>> ExtendedContext.copy_decimal(Decimal('1.00')) Decimal('1.00') >>> ExtendedContext.copy_decimal(1) Decimal('1')
def copy_decimal(self, a): a = _convert_other(a, raiseit=True) return Decimal(a)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _shallow_copy(self):\n nc = Context(self.prec, self.rounding, self.Emin, self.Emax,\n self.capitals, self.clamp, self.flags, self.traps,\n self._ignored_flags)\n return nc", "def _convert_decimal(self, value):\n return self._convert_default(value)"...
[ "0.5764373", "0.57139", "0.56553185", "0.55526054", "0.55389774", "0.5472192", "0.5463204", "0.5417392", "0.5330731", "0.5330058", "0.5300898", "0.529765", "0.5296354", "0.52929723", "0.52918863", "0.5290606", "0.5288799", "0.5282644", "0.5282644", "0.5282644", "0.5281893", ...
0.8103404
0
Returns e a. >>> c = ExtendedContext.copy() >>> c.Emin = 999 >>> c.Emax = 999 >>> c.exp(Decimal('Infinity')) Decimal('0') >>> c.exp(Decimal('1')) Decimal('0.367879441') >>> c.exp(Decimal('0')) Decimal('1') >>> c.exp(Decimal('1')) Decimal('2.71828183') >>> c.exp(Decimal('0.693147181')) Decimal('2.00000000') >>> c.exp(De...
def exp(self, a): a =_convert_other(a, raiseit=True) return a.exp(context=self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exp(self, out=None):\n return exponential.exp(self, out)", "def exponential(self):\r\n result = self.number()\r\n while self.current_token is not None and self.current_token.type is TokenType.EXPONENT:\r\n self.advance()\r\n result = ExponentialNode(result, self.num...
[ "0.7461241", "0.72185135", "0.7168145", "0.6965883", "0.6950719", "0.68874323", "0.6870154", "0.68419313", "0.67651063", "0.67613876", "0.67268777", "0.66905284", "0.66784126", "0.6596573", "0.6557667", "0.6524156", "0.65207136", "0.64947814", "0.64857733", "0.64776635", "0.6...
0.6977682
3
Returns a multiplied by b, plus c. The first two operands are multiplied together, using multiply, the third operand is then added to the result of that multiplication, using add, all with only one final rounding. >>> ExtendedContext.fma(Decimal('3'), Decimal('5'), Decimal('7')) Decimal('22') >>> ExtendedContext.fma(De...
def fma(self, a, b, c): a = _convert_other(a, raiseit=True) return a.fma(b, c, context=self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fma(self, other, third, context=None):\n\n other = _convert_other(other, raiseit=True)\n third = _convert_other(third, raiseit=True)\n\n # compute product; raise InvalidOperation if either operand is\n # a signaling NaN or if the product is zero times infinity.\n if self._is_...
[ "0.68436897", "0.5416807", "0.53062177", "0.5302462", "0.52238196", "0.5217056", "0.5216245", "0.5216195", "0.517895", "0.51773447", "0.5161419", "0.5160038", "0.5150514", "0.51501775", "0.514853", "0.51474047", "0.51330435", "0.51175946", "0.5117493", "0.5110987", "0.5110442...
0.8010674
0
Return True if the operand is canonical; otherwise return False. Currently, the encoding of a Decimal instance is always canonical, so this method returns True for any Decimal. >>> ExtendedContext.is_canonical(Decimal('2.50')) True
def is_canonical(self, a): if not isinstance(a, Decimal): raise TypeError("is_canonical requires a Decimal as an argument.") return a.is_canonical()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iscanonical(self):\n return self._iscanonical", "def is_canonical(self):\n return True", "def canonical(self, a):\n if not isinstance(a, Decimal):\n raise TypeError(\"canonical requires a Decimal as an argument.\")\n return a.canonical()", "def isdecimal(self): # re...
[ "0.63832116", "0.6265229", "0.61336017", "0.5946216", "0.5793815", "0.57909995", "0.5535601", "0.5506391", "0.5506391", "0.5490384", "0.5463449", "0.54617995", "0.54087746", "0.53014445", "0.5244844", "0.5243418", "0.52248937", "0.52139705", "0.52096796", "0.5164633", "0.5154...
0.80570596
0
Return True if the operand is finite; otherwise return False. A Decimal instance is considered finite if it is neither infinite nor a NaN. >>> ExtendedContext.is_finite(Decimal('2.50')) True >>> ExtendedContext.is_finite(Decimal('0.3')) True >>> ExtendedContext.is_finite(Decimal('0')) True >>> ExtendedContext.is_finite...
def is_finite(self, a): a = _convert_other(a, raiseit=True) return a.is_finite()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_finite(self):\n return True", "def is_finite(self):\n return not self._is_special", "def isfinite(self):\n return True", "def is_finite(self):\n return False", "def is_finite(x, name=None):\n result = _op_def_lib.apply_op(\"IsFinite\", x=x, name=name)\n return result", ...
[ "0.7669932", "0.7620324", "0.7531688", "0.7517803", "0.7398994", "0.73952514", "0.73246783", "0.7322082", "0.7285026", "0.7138305", "0.7111313", "0.70078224", "0.6939796", "0.6937014", "0.689625", "0.6878568", "0.669136", "0.6655863", "0.6649485", "0.65965927", "0.6536998", ...
0.75141525
4
Return True if the operand is infinite; otherwise return False. >>> ExtendedContext.is_infinite(Decimal('2.50')) False >>> ExtendedContext.is_infinite(Decimal('Inf')) True >>> ExtendedContext.is_infinite(Decimal('NaN')) False >>> ExtendedContext.is_infinite(1) False
def is_infinite(self, a): a = _convert_other(a, raiseit=True) return a.is_infinite()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_infinite(self):\n return self._exp == 'F'", "def isinf(x):\n from amath.DataTypes.Infinity import Infinity\n if isinstance(x, Infinity):\n return True\n elif x == float(\"inf\"):\n return True\n elif x == float(\"-inf\"):\n return True\n else:\n return Fal...
[ "0.7984179", "0.7595423", "0.73295254", "0.7318208", "0.7237378", "0.7201428", "0.71608996", "0.7042569", "0.6962031", "0.69541436", "0.6952423", "0.69504505", "0.6938373", "0.69304335", "0.68924004", "0.6890672", "0.67615265", "0.674433", "0.6734223", "0.6683587", "0.6572399...
0.76751804
1
Return True if the operand is a qNaN or sNaN; otherwise return False. >>> ExtendedContext.is_nan(Decimal('2.50')) False >>> ExtendedContext.is_nan(Decimal('NaN')) True >>> ExtendedContext.is_nan(Decimal('sNaN')) True >>> ExtendedContext.is_nan(1) False
def is_nan(self, a): a = _convert_other(a, raiseit=True) return a.is_nan()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_nan(x):\n return _func(\"isnan\", TBoolean(), x)", "def is_nan(self):\n return self._exp in ('n', 'N')", "def is_qnan(self):\n return self._exp == 'n'", "def is_nan(value):\n\n return value != value", "def is_nan(x, name=None):\n result = _op_def_lib.apply_op(\"IsNan\", x=x, nam...
[ "0.77872145", "0.76198816", "0.7426308", "0.7353272", "0.7342", "0.7237033", "0.7226328", "0.7072808", "0.7036255", "0.6928004", "0.6903426", "0.68105537", "0.67927086", "0.6718253", "0.66823405", "0.6681884", "0.6600874", "0.6546323", "0.64704424", "0.645008", "0.6405082", ...
0.7312411
5
Return True if the operand is a normal number; otherwise return False. >>> c = ExtendedContext.copy() >>> c.Emin = 999 >>> c.Emax = 999 >>> c.is_normal(Decimal('2.50')) True >>> c.is_normal(Decimal('0.1E999')) False >>> c.is_normal(Decimal('0.00')) False >>> c.is_normal(Decimal('Inf')) False >>> c.is_normal(Decimal('Na...
def is_normal(self, a): a = _convert_other(a, raiseit=True) return a.is_normal(context=self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_normal(self, context=None):\n if self._is_special or not self:\n return False\n if context is None:\n context = getcontext()\n return context.Emin <= self.adjusted()", "def is_normal(self, a):\n return a >= 0", "def is_subnormal(self, context=None):\n ...
[ "0.7149704", "0.6965391", "0.6362623", "0.62874675", "0.5884001", "0.5827425", "0.57607573", "0.5749383", "0.56423986", "0.55953646", "0.5534687", "0.543557", "0.54126894", "0.53638595", "0.53428453", "0.5340313", "0.533195", "0.5295169", "0.52694327", "0.52548087", "0.523565...
0.70131636
1
Return True if the operand is a quiet NaN; otherwise return False. >>> ExtendedContext.is_qnan(Decimal('2.50')) False >>> ExtendedContext.is_qnan(Decimal('NaN')) True >>> ExtendedContext.is_qnan(Decimal('sNaN')) False >>> ExtendedContext.is_qnan(1) False
def is_qnan(self, a): a = _convert_other(a, raiseit=True) return a.is_qnan()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_qnan(self):\n return self._exp == 'n'", "def isnan(q):\n return np.any(np.isnan(q), axis=-1)", "def is_nan(self):\n return self._exp in ('n', 'N')", "def is_nan(x):\n return _func(\"isnan\", TBoolean(), x)", "def isfinite(q):\n return np.all(np.isfinite(q), axis=-1)", "def i...
[ "0.8234607", "0.7368728", "0.7279199", "0.7189671", "0.7095255", "0.6889242", "0.6790585", "0.6788333", "0.6722622", "0.6634189", "0.64943004", "0.6461325", "0.6436535", "0.6335241", "0.63221335", "0.6306988", "0.6299849", "0.62907064", "0.62515444", "0.6235078", "0.6184624",...
0.8166544
1
Returns the exponent of the magnitude of the operand's MSD. The result is the integer which is the exponent of the magnitude of the most significant digit of the operand (as though the operand were truncated to a single digit while maintaining the value of that digit and without limiting the resulting exponent). >>> Ex...
def logb(self, a): a = _convert_other(a, raiseit=True) return a.logb(context=self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logb(self, context=None):\n # logb(NaN) = NaN\n ans = self._check_nans(context=context)\n if ans:\n return ans\n\n if context is None:\n context = getcontext()\n\n # logb(+/-Inf) = +Inf\n if self._isinfinity():\n return _Infinity\n\n ...
[ "0.71792245", "0.61425287", "0.6022978", "0.5950608", "0.57349813", "0.57208306", "0.5695725", "0.5552675", "0.5494579", "0.5465444", "0.54653466", "0.5440781", "0.543691", "0.5434374", "0.5428446", "0.54180086", "0.5381295", "0.5381071", "0.53577185", "0.534132", "0.5335393"...
0.5412301
16
Invert all the digits in the operand. The operand must be a logical number. >>> ExtendedContext.logical_invert(Decimal('0')) Decimal('111111111') >>> ExtendedContext.logical_invert(Decimal('1')) Decimal('111111110') >>> ExtendedContext.logical_invert(Decimal('111111111')) Decimal('0') >>> ExtendedContext.logical_invert...
def logical_invert(self, a): a = _convert_other(a, raiseit=True) return a.logical_invert(context=self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logical_invert(self, context=None):\n if context is None:\n context = getcontext()\n return self.logical_xor(_dec_from_triple(0,'1'*context.prec,0),\n context)", "def __invert__(self):\n return self.logicalNegation(self)", "def invert(x, out=No...
[ "0.82576346", "0.6740827", "0.6680087", "0.6279406", "0.6276496", "0.6265565", "0.61541164", "0.5970236", "0.5954347", "0.5907071", "0.5886896", "0.585125", "0.57012916", "0.5683451", "0.5657739", "0.5629026", "0.5618328", "0.56160575", "0.56027406", "0.5598243", "0.5588108",...
0.77592015
1