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"""Current Owner PE of the BFD session.
def currentownerpe(self) : try : return self._currentownerpe except Exception as e: raise e
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def owner(self):\n answer = self._call('owner')\n return answer.owner", "def owner(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"owner\")", "def owner(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"owner\")", "def get_owner(self):\n return self.__owner"...
[ "0.7098942", "0.7021614", "0.7021614", "0.6925314", "0.69234353", "0.69234353", "0.69234353", "0.69234353", "0.69234353", "0.6905942", "0.68967485", "0.6883733", "0.6883733", "0.6846282", "0.68393534", "0.67832464", "0.66524816", "0.66091853", "0.65807694", "0.65040416", "0.6...
0.6437283
27
Utility function that returns a MatrixProfile data structure with a calculated annotation vector that has been applied to correct the matrix profile.
def apply_av(profile, av="default", custom_av=None): if not core.is_mp_obj(profile): raise ValueError('apply_av expects profile as an MP data structure') temp_av = None av_type = None if av == "default": temp_av = make_default_av(profile['data']['ts'], profile['w']) av_type = a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_attitude_profile_matrix(self):\n ref = np.array([[1.0, 0.0],\n [0.0, 0.0],\n [0.0, 1.0]])\n obs = np.array([[0.0, 0.0],\n [1.0, 0.0],\n [0.0, 1.0]])\n B = wahba.attitude_profile_matrix(obs = ob...
[ "0.58199733", "0.57918364", "0.5485197", "0.54530543", "0.5451324", "0.5282798", "0.5069492", "0.50570256", "0.5051597", "0.50416625", "0.50102544", "0.500022", "0.49900544", "0.49530387", "0.495086", "0.49318773", "0.4911598", "0.4892316", "0.48764974", "0.48733866", "0.4855...
0.47646758
26
Buy shares up to a purchase price limit defined by buyLimit, starting at an initial date defined by buyDate, and repeated never/daily/monthly/quarterly. Returns nothing, just updates the stock details.
def buy(self, buyDate, sellDate, buyLimit, unitLimit, repeat): startDate, startPrice = self.getOpeningPrice() maxAmount = int(buyLimit)/int(startPrice) # If you've selected a one-off stock purchase if repeat == 'never' and maxAmount > 0: self.purchased = (maxAmount * startPrice) self.units = maxAmoun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buy(self):\n\n from_symbol = self.symbol\n to_symbol = self.currency\n price = self.data[0].close\n amount = self.portfolio['buy_sell_amount'][self.currency]\n date = self.date\n\n if self.slippage:\n slip_factor = (self.data[-1].high - self.data[-1].close)*...
[ "0.6620864", "0.66012025", "0.6393654", "0.6378676", "0.6198525", "0.60787106", "0.6022374", "0.5965275", "0.5860537", "0.5827464", "0.5821357", "0.5779313", "0.5757538", "0.57499915", "0.5732122", "0.5714582", "0.570333", "0.57015985", "0.56838834", "0.5669411", "0.56515336"...
0.734988
0
Gets the next date, depending on the input, i.e., quartely, monthly, weekly or daily.
def getNextDate(self, currentDate, startDate, repeat): if repeat.lower() == 'quarterly': updatedDate = currentDate + relativedelta(months=3) updatedDate = self.checkValidDate(updatedDate, startDate) elif repeat.lower() == 'monthly': updatedDate = currentDate + relativedelta(months=1) updatedDate = self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_next_day(self):\n pass", "def next_day(date):\n return date + datetime.timedelta(days=1)", "def next_day(date):\n return date + datetime.timedelta(days=1)", "def next_date(date):\n #For this function, I just created as many if else statements as I could to cover every situation I coul...
[ "0.758791", "0.7128873", "0.7128873", "0.7044229", "0.69297045", "0.6808675", "0.6745384", "0.6705606", "0.6659262", "0.66587615", "0.6629653", "0.6610862", "0.6577382", "0.6566302", "0.6533175", "0.649507", "0.6475922", "0.64489305", "0.64093673", "0.6407312", "0.63996214", ...
0.6874753
5
Returns if the word is in the trie.
def search(self, word: 'str') -> 'bool': p = self.root for ch in word: if ch in p: p = p[ch] else: return False if '#' in p: return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_trie(self, trie, word):\n current_dict = trie\n for letter in word:\n if letter in current_dict:\n current_dict = current_dict[letter]\n else:\n return False\n else:\n if '_end_' in current_dict:\n return curr...
[ "0.838632", "0.8150416", "0.8123471", "0.7856802", "0.7830664", "0.77935004", "0.7792806", "0.77642965", "0.7753436", "0.7747724", "0.7711298", "0.76816714", "0.7677101", "0.7664614", "0.76506114", "0.76338875", "0.7628353", "0.76114196", "0.7577657", "0.75695884", "0.756079"...
0.70872915
56
Abort any ongoing transaction (at the database level).
def abort(self) -> None: self._connector.abort_transaction()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def abort_transaction(self) -> None:\n pass", "def abort(self, transaction):\n raise NotImplementedError", "def abort(self):\n if self.transaction:\n token = self.transaction\n self.transaction = None\n self.client.abort(self.creds, token, self.environment)...
[ "0.86475945", "0.81431043", "0.7892522", "0.768434", "0.75079095", "0.74629664", "0.72372913", "0.70501405", "0.70483804", "0.700633", "0.69700766", "0.69644755", "0.6964316", "0.6853886", "0.67994297", "0.6794079", "0.6698169", "0.66607016", "0.6650938", "0.66473156", "0.656...
0.83558124
1
Tests if `dims`'s are all in a certain datapoint or event
def has_all_dims(dp_or_event, dims): return dims.items() <= {d.key: d.value for d in dp_or_event.dimensions}.items()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_datapoint_with_all_dims(fake_ingest, dims):\n for datapoint in fake_ingest.datapoints:\n if has_all_dims(datapoint, dims):\n return True\n return False", "def has_dims(xobj, dims, kind):\n if isinstance(dims, str):\n dims = [dims]\n\n if not all(dim in xobj.dims for d...
[ "0.8156239", "0.68704474", "0.6826349", "0.65650713", "0.65379494", "0.64003754", "0.63909525", "0.63733774", "0.62324965", "0.6057415", "0.6051803", "0.60475516", "0.59331596", "0.59127384", "0.5875175", "0.5873567", "0.5860001", "0.58521855", "0.58350545", "0.58019334", "0....
0.81528336
1
Generate a presigned URL to share an S3 object
def create_presigned_url(bucket_name, object_name, expiration=3600): # Generate a presigned URL for the S3 object s3_client = boto3.client('s3') try: response = s3_client.generate_presigned_url('get_object', Params={'Bucket': b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_presigned_url(bucket_name, object_name):\n\n logger = logging.getLogger(\"SimpleReplayLogger\")\n\n s3_client = boto3.client('s3')\n try:\n response = s3_client.generate_presigned_url('get_object',\n Params={'Bucket': bucket_name,\n ...
[ "0.781944", "0.78191537", "0.77588147", "0.76814914", "0.765886", "0.7652143", "0.76489365", "0.7648256", "0.76100934", "0.7571346", "0.73623234", "0.73535985", "0.73304003", "0.7310247", "0.7161862", "0.71146256", "0.70968693", "0.7060428", "0.7051806", "0.7022448", "0.70078...
0.764653
8
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues): plt.imshow(cm, interpolation='nearest', cmap=cmap) plt.title(title) plt.colorbar() tick_marks = np.arange(len(classes)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n...
[ "0.8194862", "0.80949175", "0.8029915", "0.8019153", "0.79941195", "0.7991258", "0.7980955", "0.7976606", "0.79610753", "0.79590565", "0.79378676", "0.7934962", "0.7934504", "0.79313844", "0.7926313", "0.7924577", "0.79241234", "0.7923211", "0.7923023", "0.7921931", "0.791787...
0.0
-1
Sets the first_name of this CustomersCustomerDetails.
def first_name(self, first_name): self._first_name = first_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_first_name(self, first_name):\n self.first_name = first_name", "def first_name(self, name):\n self._first_name = name", "def first_name(self, first_name):\n if first_name is None:\n raise ValueError(\"Invalid value for `first_name`, must not be `None`\") # noqa: E501\n\...
[ "0.8305615", "0.7958499", "0.790787", "0.785923", "0.7624185", "0.76192254", "0.76192254", "0.70801145", "0.7042829", "0.6825898", "0.6822573", "0.66803163", "0.66803163", "0.658114", "0.6570034", "0.65158415", "0.65158415", "0.65158415", "0.64734155", "0.64638466", "0.636971...
0.8084701
7
Sets the middle_name of this CustomersCustomerDetails.
def middle_name(self, middle_name): self._middle_name = middle_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def payee_middle_name(self, payee_middle_name):\n\n self._payee_middle_name = payee_middle_name", "def candidate_middle_name(self, candidate_middle_name):\n\n self._candidate_middle_name = candidate_middle_name", "def treasurer_middle_name(self, treasurer_middle_name):\n\n self._treasurer_...
[ "0.7838598", "0.7674446", "0.7421287", "0.66799533", "0.66398764", "0.61246294", "0.58798045", "0.57855934", "0.5725253", "0.56356424", "0.56013435", "0.5597218", "0.5597218", "0.5597218", "0.5597218", "0.5597218", "0.5597218", "0.5597218", "0.5597218", "0.5597218", "0.557826...
0.8255347
1
Sets the last_name of this CustomersCustomerDetails.
def last_name(self, last_name): self._last_name = last_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_last_name(self, last_name):\n self.last_name = last_name", "def setLastname(self, lastname):\n self.lastname = lastname\n return self", "def lastname(self, lastname):\n\n self._lastname = lastname", "def last_name(self, last_name: str):\n if last_name is None:\n ...
[ "0.79111814", "0.747516", "0.74227566", "0.7416875", "0.72741055", "0.7096699", "0.6786067", "0.6786067", "0.677398", "0.6721251", "0.6571933", "0.63721734", "0.6322141", "0.6307508", "0.6277102", "0.6277102", "0.6277102", "0.6277102", "0.61329526", "0.60873127", "0.6084744",...
0.7684941
7
Sets the gender of this CustomersCustomerDetails.
def gender(self, gender): self._gender = gender
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gender(self, gender):\n if gender is None:\n raise ValueError(\"Invalid value for `gender`, must not be `None`\") # noqa: E501\n\n self._gender = gender", "def gender(self, gender: str):\n allowed_values = [\"male\", \"female\", \"unknown\"] # noqa: E501\n if gender n...
[ "0.74795514", "0.7230272", "0.65180004", "0.62566483", "0.61059487", "0.60287803", "0.59729916", "0.59523076", "0.59523076", "0.5890485", "0.58326703", "0.5783696", "0.5783696", "0.5763776", "0.56508315", "0.5633348", "0.5559526", "0.55252856", "0.53633034", "0.53289926", "0....
0.7440196
3
Sets the nationality of this CustomersCustomerDetails.
def nationality(self, nationality): self._nationality = nationality
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def national_id_number(self, national_id_number):\n if national_id_number is None:\n raise ValueError(\"Invalid value for `national_id_number`, must not be `None`\") # noqa: E501\n\n self._national_id_number = national_id_number", "def fix_nationality_field(self):\n where = self....
[ "0.55606663", "0.5252327", "0.5056462", "0.50123334", "0.50123334", "0.4835465", "0.48059845", "0.4804781", "0.4784518", "0.4779932", "0.47406495", "0.47338793", "0.4603641", "0.45996222", "0.45830825", "0.45790747", "0.45350283", "0.45350283", "0.45350283", "0.45350283", "0....
0.80893993
0
Sets the email_address of this CustomersCustomerDetails.
def email_address(self, email_address): self._email_address = email_address
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def email_address(self, email_address: str):\n if email_address is None:\n raise ValueError(\"Invalid value for `email_address`, must not be `None`\") # noqa: E501\n\n self._email_address = email_address", "def email_address(self, email_address: \"str\"):\n self._attrs[\"emailAdd...
[ "0.77724594", "0.7656315", "0.74749684", "0.7094188", "0.6948076", "0.6948076", "0.68792194", "0.6862985", "0.6734624", "0.66809696", "0.66809696", "0.66809696", "0.66809696", "0.66809696", "0.66809696", "0.66809696", "0.66809696", "0.66809696", "0.66809696", "0.65836924", "0...
0.74234605
3
Sets the mobile_phone_number of this CustomersCustomerDetails.
def mobile_phone_number(self, mobile_phone_number): self._mobile_phone_number = mobile_phone_number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def phone_number(self, phone_number):\n\n self._phone_number = phone_number", "def phone_number(self, phone_number):\n\n self._phone_number = phone_number", "def phone_number(self, phone_number):\n\n self._phone_number = phone_number", "def phone_number(self, phone_number):\n\n se...
[ "0.6851552", "0.6851552", "0.6851552", "0.6851552", "0.6745689", "0.64554965", "0.6227442", "0.6222927", "0.61977", "0.6170905", "0.6033617", "0.6027896", "0.60239834", "0.60163236", "0.5977869", "0.5976034", "0.5944747", "0.59215564", "0.59024084", "0.5820556", "0.575636", ...
0.8076317
0
Sets the business_phone_number of this CustomersCustomerDetails.
def business_phone_number(self, business_phone_number): self._business_phone_number = business_phone_number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def business_phone(self, business_phone):\n\n self._business_phone = business_phone", "def mobile_phone_number(self, mobile_phone_number):\n\n self._mobile_phone_number = mobile_phone_number", "def phone_number(self, phone_number):\n\n self._phone_number = phone_number", "def phone_numbe...
[ "0.80043817", "0.689726", "0.6703501", "0.6703501", "0.6703501", "0.6703501", "0.6525445", "0.6285492", "0.62703913", "0.62146056", "0.6212233", "0.61882114", "0.6081038", "0.60771227", "0.59615356", "0.59452933", "0.5857713", "0.5794768", "0.5755674", "0.5736023", "0.5700322...
0.83947057
0
Sets the country_of_residence of this CustomersCustomerDetails.
def country_of_residence(self, country_of_residence): self._country_of_residence = country_of_residence
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def country_of_taxation(self, country_of_taxation):\n\n self._country_of_taxation = country_of_taxation", "def country(self, country):\n\n self._country = country", "def country(self, country):\n\n self._country = country", "def country(self, country):\n\n self._country = country"...
[ "0.62134326", "0.5904537", "0.5904537", "0.5904537", "0.5904537", "0.5904537", "0.578149", "0.578149", "0.5609486", "0.54422235", "0.5323554", "0.52635247", "0.52225703", "0.52034926", "0.5157898", "0.50283104", "0.49988803", "0.49264026", "0.4876317", "0.4834468", "0.4757307...
0.8604215
0
Sets the country_of_taxation of this CustomersCustomerDetails.
def country_of_taxation(self, country_of_taxation): self._country_of_taxation = country_of_taxation
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def country(self, country):\n\n self._country = country", "def country(self, country):\n\n self._country = country", "def country(self, country):\n\n self._country = country", "def country(self, country):\n\n self._country = country", "def country(self, country):\n\n self...
[ "0.64811593", "0.64811593", "0.64811593", "0.64811593", "0.64811593", "0.62914026", "0.6145983", "0.59439754", "0.5926139", "0.5926139", "0.57574946", "0.5606053", "0.5584508", "0.5584508", "0.55298877", "0.54650354", "0.54129255", "0.5390453", "0.52840394", "0.5247013", "0.5...
0.869901
0
Sets the accessibility of this CustomersCustomerDetails.
def accessibility(self, accessibility): self._accessibility = accessibility
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def customer(self, customer):\n\n self._customer = customer", "def customer(self, customer):\n\n self._customer = customer", "def _setbeneficiary_customer_59A(self, val):\n self.swift_obj.BeneficiaryCustomer_A = val\n self.swift_obj.BeneficiaryCustomer_A.swiftTag = '59A'", "def cu...
[ "0.59854394", "0.59854394", "0.5873079", "0.5492937", "0.5467153", "0.52366567", "0.52243924", "0.5103308", "0.5044263", "0.5037117", "0.5037117", "0.5037117", "0.5037117", "0.49964228", "0.49942473", "0.49654508", "0.49488732", "0.4945913", "0.49363002", "0.4928246", "0.4891...
0.65838456
0
Sets the external_customer_id of this CustomersCustomerDetails.
def external_customer_id(self, external_customer_id): self._external_customer_id = external_customer_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def customer_id(self, customer_id: str):\n self._customer_id = customer_id", "def external_id(self, external_id):\n\n self._external_id = external_id", "def external_id(self, external_id):\n\n self._external_id = external_id", "def external_id(self, external_id):\n\n self._externa...
[ "0.7305953", "0.72004163", "0.72004163", "0.72004163", "0.71991354", "0.71991354", "0.71991354", "0.71991354", "0.6935778", "0.6787273", "0.6744312", "0.6579409", "0.6579409", "0.6507669", "0.64287794", "0.64287794", "0.63784736", "0.627573", "0.6219224", "0.61938924", "0.607...
0.90074754
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, CustomersCustomerDetails): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.80891633", "0.80891633", "0.8055254", "0.7983334", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Yield successive nsized chunks from lst.
def chunks(lst, n): for i in range(0, len(lst), n): yield lst[i : i + n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chunks(self, lst, n):\n for i in range(0, len(lst), n):\n yield lst[i:i + n]", "def chunks(lst: list, n: int):\n for i in range(0, len(lst), n):\n yield lst[i : i + n]", "def chunks(lst, n):\n for i in range(0, len(lst), n):\n yield lst[i:i + n]", "de...
[ "0.83071756", "0.81939614", "0.81910837", "0.81910837", "0.8190213", "0.81267184", "0.81218547", "0.81218547", "0.80773693", "0.80533457", "0.80533457", "0.80533457", "0.80533457", "0.80533457", "0.80533457", "0.80533457", "0.80533457", "0.80533457", "0.80533457", "0.80533457",...
0.80526286
34
Creates a new integration application with the given predefined fields. > Since integration applications are not globally cached, this method is only used for testing.
def precreate(cls, integration_application_id, **keyword_parameters): integration_application_id = validate_id(integration_application_id) if keyword_parameters: processed = process_precreate_parameters_and_raise_extra(keyword_parameters, PRECREATE_FIELDS) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_application(name=None, description=None):\n pass", "def create_application(self, application_name): \n self.__obj = GenericModel({ x:None for x in self.swagger_map.values()}, self.swagger_types, self.swagger_map)\n self.application_name = application_name", "def create_app(self):\n...
[ "0.68866974", "0.6697084", "0.6682052", "0.6564417", "0.6527781", "0.6510537", "0.63067305", "0.62577343", "0.62473416", "0.6241801", "0.62334615", "0.6186646", "0.6166283", "0.616213", "0.6150492", "0.61045074", "0.6075559", "0.6040139", "0.60330874", "0.60062313", "0.597440...
0.5483432
73
Creates a new integration application with it's defaults attributes set.
def _create_empty(cls, integration_application_id): self = object.__new__(cls) self.bot = ZEROUSER self.description = None self.icon_type = ICON_TYPE_NONE self.icon_hash = 0 self.id = integration_application_id self.name = '' return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_application(name=None, description=None):\n pass", "def create_app(self):\n raise NotImplementedError", "def _create_app_instance(script_info):\n return create_app()", "def create_app(self):\n\n app = create_app()\n app.config.from_object('project.config.TestingConfig')\...
[ "0.7422211", "0.7268302", "0.704719", "0.70204574", "0.6914714", "0.6884702", "0.6862294", "0.68266577", "0.6822985", "0.6797056", "0.678786", "0.67686033", "0.67582315", "0.67528623", "0.66682214", "0.66651165", "0.66542053", "0.6631574", "0.66305363", "0.6569495", "0.653342...
0.0
-1
Returns whether the two integration applications not equal.
def __ne__(self, other): if type(self) is not type(other): return NotImplemented return not self._is_equal_same_type(other)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other):\n if not isinstance(other, V1alpha1ApplicationStatus):\n return True\n\n return self.to_dict() != other.to_dict()", "def __ne__(self, other):\n if not isinstance(other, WhatsApp):\n return True\n\n return self.to_dict() != other.to_dict()...
[ "0.66759926", "0.65329367", "0.64395505", "0.6405106", "0.6316059", "0.62460166", "0.6228284", "0.6162229", "0.6098838", "0.6093962", "0.60642713", "0.60609746", "0.6057121", "0.60545933", "0.6020248", "0.59985596", "0.5993945", "0.599142", "0.5974639", "0.597298", "0.5972888...
0.0
-1
Helper method for ``.__eq__``
def _is_equal_same_type(self, other): # id self_id = self.id other_id = other.id if (self_id and other_id) and (self_id != other_id): return False # bot if self.bot != other.bot: return False # description if self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self,*args):\r\n pass", "def __eq__(self,*args):\r\n pass", "def __eq__(self,*args):\r\n pass", "def __eq__(self,*args):\r\n pass", "def __eq__(self,*args):\r\n pass", "def __eq__(self,*args):\r\n pass", "def __eq__(self,*args):\r\n pass", "def __eq__(self,*args):\r\n pass", "def...
[ "0.85704577", "0.85704577", "0.85704577", "0.85704577", "0.85704577", "0.85704577", "0.85704577", "0.85704577", "0.85704577", "0.85704577", "0.85704577", "0.85704577", "0.85704577", "0.85704577", "0.85704577", "0.85704577", "0.85704577", "0.85704577", "0.85704577", "0.85704577"...
0.0
-1
check if the user is an admin or not!!!
def check_if_admin(connection,username): with connection: c = connection.execute(SELECT_USER_BY_ADMIN_PREVILAGES,(username,)) return c.fetchone()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_is_admin(user):\n return user in admins", "def isAdmin(user):\n return isUserType(user, Admin)", "def is_admin(user):\n return user.is_authenticated and user.id == app.config.get('ADMIN')", "def check_admin() -> bool:\n return ctypes.windll.shell32.IsUserAnAdmin() == 1", "def i...
[ "0.8573213", "0.8475101", "0.8473043", "0.84493524", "0.84264785", "0.84081405", "0.83872586", "0.833915", "0.83320326", "0.8329772", "0.8310006", "0.8286416", "0.8284868", "0.8265757", "0.82645243", "0.8262248", "0.8239181", "0.8239181", "0.82000273", "0.81895196", "0.808622...
0.0
-1
Calculate ngram frequencies and produce a dictionary of ngrams and their corresponding number of occurrences
def calculate_ngram_frequencies(text, n): import re # Create a new dictionary ngram_dict = {} # Find all sentences sentences_list = re.findall(r'[^\.\?!"]+', text) # Iterate over sentences in the list for sentence in sentences_list: # Split words by a whitespace character ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def construct_ngrams_dict(ngrams_list):\n counts = {}\n\n for t in ngrams_list:\n key = hash_function(t)\n if key in counts:\n counts[key] += 1\n else:\n counts[key] = 1\n return counts", "def term_frequency(ngrams,lang):\n token_dictionary = {}\n for ng in ngrams:\n try:\n ...
[ "0.79891557", "0.7857336", "0.7783312", "0.77044034", "0.76469004", "0.7638157", "0.762675", "0.7568774", "0.75609875", "0.7554546", "0.7539285", "0.7391873", "0.73289806", "0.73245054", "0.7268549", "0.723006", "0.7177322", "0.716242", "0.709203", "0.7089071", "0.70752305", ...
0.8058038
0
This view function would make relation between two tables {course, student}
def join_course(request, username, course_code): #get data from post if request.method == 'GET': # if user log in try: user = User.objects.get(username=username) if ensure_login(user) == False: return JsonResponse({'login': 'User must login'}, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def completed_course()->str:\r\n try:\r\n db: sqlite3.Connection = sqlite3.connect(DB_FILE)\r\n query: str = \"SELECT s.Name, s.CWID, g.Course, g.Grade, i.Name AS 'Instructor' \" \\\r\n \"FROM grades2 g JOIN students2 s ON g.StudentCWID = s.CWID \" \\\r\n ...
[ "0.59009725", "0.5735704", "0.56924784", "0.5623209", "0.5613662", "0.55026543", "0.54459375", "0.5301102", "0.52688026", "0.5267228", "0.52559483", "0.52368224", "0.5234847", "0.5228516", "0.5210882", "0.51934314", "0.5160771", "0.51443815", "0.512921", "0.5109042", "0.51052...
0.5107789
20
Connection name of the Cloud SQL instance used in connection strings.
def connection_name(self) -> str: return pulumi.get(self, "connection_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connection_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"connection_name\")", "def connection_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"connection_name\")", "def database_name(self) -> str:\n return pulumi.get(self, \"database_name\")", "d...
[ "0.7578365", "0.7495166", "0.7066039", "0.7023311", "0.6915121", "0.68364185", "0.67796266", "0.6760535", "0.6710732", "0.66921216", "0.66772515", "0.6676848", "0.66679984", "0.65840596", "0.65778583", "0.653352", "0.6490825", "0.6488062", "0.64445394", "0.64014375", "0.63923...
0.8180838
0
This field is deprecated and will be removed from a future version of the API. Use the `settings.settingsVersion` field instead.
def etag(self) -> str: warnings.warn("""This field is deprecated and will be removed from a future version of the API. Use the `settings.settingsVersion` field instead.""", DeprecationWarning) pulumi.log.warn("""etag is deprecated: This field is deprecated and will be removed from a future version of th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def settings_version(self) -> str:\n return pulumi.get(self, \"settings_version\")", "def output_version_format(self) -> str:\n warnings.warn(\"\"\"Deprecated. This field is unused.\"\"\", DeprecationWarning)\n pulumi.log.warn(\"\"\"output_version_format is deprecated: Deprecated. This field...
[ "0.71056426", "0.57814825", "0.57646996", "0.57646996", "0.5756316", "0.5720282", "0.56936365", "0.5636769", "0.5512045", "0.5453071", "0.5451519", "0.5387966", "0.5338438", "0.5281644", "0.51921695", "0.5164179", "0.5159576", "0.5150706", "0.51228905", "0.5107623", "0.510261...
0.5757715
4
The current software version on the instance.
def maintenance_version(self) -> str: return pulumi.get(self, "maintenance_version")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def software_version(self) -> str:\n return self.data.get(Attribute.SOFTWARE_VERSION)", "def version(self):\n return self.get_current_version()", "def software_version(self) -> str:\n return self.camera_info[\"main_sw_version\"]", "def sw_version(self) -> str | None:\n return self...
[ "0.8517211", "0.8213725", "0.82053864", "0.80839765", "0.80575514", "0.80145174", "0.7984864", "0.7929071", "0.78002846", "0.78002846", "0.78002846", "0.78002846", "0.77896225", "0.77896225", "0.77896225", "0.7777845", "0.77438027", "0.7736233", "0.76651967", "0.7648641", "0....
0.0
-1
The name of the instance which will act as primary in the replication setup.
def master_instance_name(self) -> str: return pulumi.get(self, "master_instance_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def primary_name_server(self) -> str:\n return pulumi.get(self, \"primary_name_server\")", "def master_instance_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"master_instance_name\")", "def master_instance_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, ...
[ "0.7978969", "0.79443485", "0.77534837", "0.73839325", "0.7220999", "0.71795344", "0.71286964", "0.70841205", "0.7050748", "0.7050748", "0.70285773", "0.6989401", "0.69086534", "0.6898071", "0.6873269", "0.6859762", "0.68521506", "0.68521506", "0.68521506", "0.68521506", "0.6...
0.82035476
0
The maximum disk size of the instance in bytes.
def max_disk_size(self) -> str: return pulumi.get(self, "max_disk_size")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_disk_size(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"max_disk_size\")", "def max_disk_size(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"max_disk_size\")", "def max_size_bytes(self) -> Optional[float]:\n return pulumi.get(self, \"max_size_bytes\")"...
[ "0.8789356", "0.84711045", "0.806168", "0.80428505", "0.80195016", "0.79826194", "0.79826194", "0.7939504", "0.79164445", "0.77908987", "0.7760818", "0.7760818", "0.7721978", "0.7719844", "0.7706931", "0.76886636", "0.7660995", "0.7658464", "0.7597128", "0.7510604", "0.747562...
0.9081589
0
Name of the Cloud SQL instance. This does not include the project ID.
def name(self) -> str: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self._client.project_name + '/instances/' + self.instance_id", "def cloud_name(self):\n return self._cloud_name", "def name(self):\n _LOGGER.debug(self._shelly_cloud_device_name + ' >>> ' +\n self._shelly_cloud_entity_name + ' >>> name() >>> ' ...
[ "0.8241332", "0.7281119", "0.7165251", "0.714144", "0.70118266", "0.7008288", "0.6999755", "0.69459665", "0.69459665", "0.6933721", "0.69153196", "0.69146127", "0.6870695", "0.6865202", "0.6862345", "0.6860159", "0.6777417", "0.6777417", "0.6777417", "0.6777417", "0.6752142",...
0.67018473
95
The start time of any upcoming scheduled maintenance for this instance.
def scheduled_maintenance(self) -> 'outputs.SqlScheduledMaintenanceResponse': return pulumi.get(self, "scheduled_maintenance")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maintenance_window_start_time(self) -> pulumi.Output['outputs.BrokerMaintenanceWindowStartTime']:\n return pulumi.get(self, \"maintenance_window_start_time\")", "def start_time(self):\n return self.__start", "def start_time(self):\n pass", "def maintenance_window_start_time(self) -> ...
[ "0.74400115", "0.73701787", "0.7295396", "0.72721374", "0.72721374", "0.7230234", "0.72214323", "0.72214323", "0.72214323", "0.72214323", "0.72214323", "0.72214323", "0.72214323", "0.72214323", "0.7218906", "0.7218906", "0.71962094", "0.7183786", "0.71649396", "0.71412766", "...
0.0
-1
The URI of this resource.
def self_link(self) -> str: return pulumi.get(self, "self_link")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uri(self) -> str:\n return self._uri", "def uri(self):\n return self._uri", "def uri(self):\n return self._uri", "def uri(self):\n return self._uri", "def uri(self):\n return self._uri", "def uri(self):\n return self._uri", "def uri(self):\n return s...
[ "0.8812683", "0.8718146", "0.8718146", "0.8718146", "0.8718146", "0.8718146", "0.8718146", "0.8695291", "0.8589555", "0.8529888", "0.83778185", "0.8267541", "0.82543814", "0.81543136", "0.8079777", "0.80435663", "0.8043164", "0.8011471", "0.7937294", "0.786632", "0.786632", ...
0.0
-1
The service account email address assigned to the instance.\\This property is readonly.
def service_account_email_address(self) -> str: return pulumi.get(self, "service_account_email_address")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def service_account_email_address(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"service_account_email_address\")", "def service_account_email_address(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"service_account_email_address\")", "def email_address(self) -> str:\n ...
[ "0.83406913", "0.8234184", "0.7929402", "0.780462", "0.7664471", "0.7594189", "0.7594189", "0.7594189", "0.7594189", "0.75925606", "0.7534449", "0.7515774", "0.7507855", "0.7493686", "0.7493686", "0.74833745", "0.74733686", "0.7444991", "0.7444991", "0.7444991", "0.74355906",...
0.8541408
0
The current serving state of the Cloud SQL instance.
def state(self) -> str: return pulumi.get(self, "state")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status(self):\n return self.microblaze.state", "def state(self) -> str:\n return str(self.coordinator.server_status)", "def get_status(self):\n return self._conn_state", "def server_status(self):\n return self._server_status", "def status(self):\n return self.state", ...
[ "0.7107327", "0.66442436", "0.65739805", "0.65454876", "0.6507662", "0.64906347", "0.63984823", "0.63689315", "0.6310545", "0.6296189", "0.62279505", "0.62262386", "0.62054956", "0.6194882", "0.6148098", "0.61463165", "0.6121624", "0.6107632", "0.6106236", "0.6083054", "0.606...
0.0
-1
What Operating System (and subsystem like glibc / musl)
def get_platform(): system_name = platform.system() if system_name == "Linux": # Previously we'd use either "-gnu" or "-musl" indicate which version # of libc we were built against. We now default to musl since it # reliably works on all platforms. return "unknown-linux-musl" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def known_os_type():\n return 'Linux'", "def kern():\n return platform.uname()", "def identify_system() -> str:\n system = platform.system()\n if system not in [\"Linux\", \"Darwin\"]:\n raise ValueError(f\"Unsupported system {system}\")\n return system", "def get_os():\n\n os_platfo...
[ "0.82733005", "0.80446076", "0.7926044", "0.7875094", "0.7826965", "0.78214175", "0.7788717", "0.7762154", "0.7761913", "0.7761913", "0.7640118", "0.75874496", "0.7577642", "0.75635034", "0.75508714", "0.7542637", "0.74925375", "0.7449908", "0.7442454", "0.73649895", "0.73423...
0.8034302
2
Calculate backward variables, beta
def backwardVariableGeneration(self): self.beta = zeros((self.noOfEmmittingStates+2, self.T + 1)) # initialisation for j in range(self.noOfEmmittingStates+1): self.beta[j,-1] = self.transitionMatrix[j,-1] self.beta[-1,-1] = 1.0 # main recursion for t in range(self.T, 1, -1): for j ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_backward_variables(self, normalized_logits, target):\n\n target_length = target.shape[0]\n num_time_steps = normalized_logits.shape[0]\n\n\t\t######################\n\t\t### YOUR CODE HERE ###\n\t\t######################\n\n blank_label = normalized_logits.shape[1] - 1\n l = add_blanks(targ...
[ "0.7600645", "0.7175207", "0.6988643", "0.69643766", "0.693024", "0.69014424", "0.6851599", "0.6828256", "0.6827102", "0.6827102", "0.67804056", "0.6713795", "0.6698114", "0.6691583", "0.6668204", "0.6661083", "0.66240364", "0.6602664", "0.65791625", "0.6574539", "0.6564472",...
0.75941527
1
Update the estimate of the means by most likely state sequence
def viterbiMeansEstimate(self): for i in range(self.noOfEmmittingStates): self.outputProbabilities[i,0] = \ self.observationSequence[0, nonzero(self.mostLikelyPath == i+1)[1]-1].mean()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def BWMeansEstimate(self):\n for i in range(self.noOfEmmittingStates):\n self.outputProbabilities[i,0] = ((self.L[i,:] *\n self.observationSequence).sum() /\n self.L[i,:].sum())", "def update(self,x): #update the estimate of rew...
[ "0.702312", "0.6723062", "0.66803205", "0.6574336", "0.6315462", "0.62802726", "0.62591046", "0.6211821", "0.61975795", "0.6075116", "0.6057215", "0.6030276", "0.6020416", "0.6011865", "0.59668756", "0.59221566", "0.5915007", "0.59119415", "0.5909659", "0.59086126", "0.590659...
0.6997723
1
To check behaviour outside assumptions (only non zero values present in the value array).
def test_null_value(transf_type: str, sample_size: int, array_input: np.ndarray) -> None: calculated_entropy = _entropy(transf_type, array_input, sample_size) assert np.isnan(calculated_entropy)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_correct_p_values_empty(self):\r\n exp = []\r\n obs = self.mc._correct_p_values([])\r\n assert_almost_equal(obs, exp)", "def check_none_zero_values(self):\n hits = -1\n if (len(self.data.shape) == 3):\n hits = 0\n frames = self.data.shape[0]\n ...
[ "0.704151", "0.7010622", "0.67766255", "0.66620517", "0.66324633", "0.65897065", "0.6588676", "0.64770323", "0.64769727", "0.6462951", "0.6459503", "0.64378023", "0.6425688", "0.639491", "0.6377455", "0.63636255", "0.63585263", "0.634342", "0.6333039", "0.63285303", "0.631572...
0.0
-1
Set the value of the field named `name`
def set(self, block, name, value): self._kvs.set(self._key(block, name), value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setName(self, name):\n self.name = str(name)", "def setName(self, name): \n\n self._name = name", "def setName(self, name):\n # type: (str)->None\n self._validator.validate_one('name', VALID_OPTS['name'], name)\n self._ifAttributes['name'] = str(name)", "def setN...
[ "0.83291584", "0.8215365", "0.8170925", "0.8158544", "0.8158544", "0.8158544", "0.8158544", "0.80777335", "0.80777335", "0.79417807", "0.79240745", "0.78924996", "0.7888099", "0.7888099", "0.7863152", "0.78591704", "0.7853768", "0.77348673", "0.7711768", "0.76391464", "0.7639...
0.0
-1
Reset the value of the field named `name` to the default
def delete(self, block, name): self._kvs.delete(self._key(block, name))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self, name: str = None):\n if name is None:\n self._settings = dict(**DEFAULTS)\n else:\n if name not in DEFAULTS:\n raise KeyError(\"No setting name '%s'\" % (name,))\n\n self._settings.pop(name, None)\n if name in DEFAULTS:\n ...
[ "0.73151505", "0.71024376", "0.69275767", "0.69275767", "0.67324024", "0.64915645", "0.64795375", "0.64506096", "0.64506096", "0.6422404", "0.64194", "0.63846135", "0.638185", "0.6352338", "0.63272524", "0.63272524", "0.63272524", "0.63272524", "0.63205564", "0.62738657", "0....
0.0
-1
Retrieve the XBlock `usage_id` associated with this aside usage id.
def get_usage_id_from_aside(self, aside_id): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_usage_id_from_aside(self, aside_id):\n return aside_id.usage_id", "def find_usage(cls, usage_id):\n return cls._usage_index[usage_id]", "def get_definition_id(self, usage_id):\n try:\n return self._usages[usage_id]\n except KeyError:\n raise NoSuchUsage...
[ "0.7758011", "0.72278583", "0.64360005", "0.5950501", "0.59241974", "0.5887003", "0.5800017", "0.56733704", "0.56495035", "0.56250805", "0.554048", "0.55207425", "0.54712385", "0.5428823", "0.53993464", "0.5372639", "0.5342543", "0.5338152", "0.53200084", "0.5308408", "0.5287...
0.70452815
2
Retrieve the XBlock `definition_id` associated with this aside definition id.
def get_definition_id_from_aside(self, aside_id): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_definition_id_from_aside(self, aside_id):\n return aside_id.definition_id", "def get_definition_id(self, usage_id):\r\n return usage_id.definition_key", "def get_definition_id(self, usage_id):\n raise NotImplementedError()", "def get_definition(self, course_key, definition_guid):...
[ "0.79421026", "0.72368866", "0.65804136", "0.6521845", "0.64925605", "0.64839524", "0.6339115", "0.6278169", "0.6278169", "0.6244461", "0.618396", "0.6138995", "0.6039859", "0.59404963", "0.588665", "0.58811927", "0.5878892", "0.583891", "0.5823166", "0.5808129", "0.5792293",...
0.71588004
2
Retrieve the XBlockAside `aside_type` associated with this aside usage id.
def get_aside_type_from_usage(self, aside_id): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_aside_type_from_usage(self, aside_id):\n return aside_id.aside_type", "def get_aside_type_from_definition(self, aside_id):\n return aside_id.aside_type", "def get_aside_from_xblock(xblock, aside_type):\n return xblock.runtime.get_aside_of_type(xblock, aside_type)", "def get_aside_of_...
[ "0.8583418", "0.8076896", "0.78638333", "0.7550033", "0.7312473", "0.70443755", "0.6547722", "0.6357063", "0.6218048", "0.58316195", "0.56430614", "0.5473934", "0.5430183", "0.54080695", "0.5381477", "0.5381477", "0.5374741", "0.537455", "0.5064285", "0.49807513", "0.4925944"...
0.7842348
3
Access the FieldData passed in the constructor. Deprecated in favor of a 'fielddata' service.
def field_data(self): warnings.warn("Runtime.field_data is deprecated", FieldDataDeprecationWarning, stacklevel=2) return self._deprecated_per_instance_field_data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def field_data(self, field_data):\n warnings.warn(\"Runtime.field_data is deprecated\", FieldDataDeprecationWarning, stacklevel=2)\n self._deprecated_per_instance_field_data = field_data", "def getDataField(self, name): \n if name not in self.__examples: \n raise ValueError(\"Fiel...
[ "0.68837225", "0.6424844", "0.6270142", "0.62539226", "0.6159358", "0.6159358", "0.6159358", "0.6037586", "0.603509", "0.6027825", "0.6027825", "0.6027825", "0.6027825", "0.600641", "0.60039747", "0.5993337", "0.59855485", "0.59672326", "0.5962135", "0.5962135", "0.5962135", ...
0.74714136
0
Set the current user ID. Deprecated in favor of a 'user' service.
def user_id(self, user_id): warnings.warn("Runtime.user_id is deprecated", UserIdDeprecationWarning, stacklevel=2) self._deprecated_per_instance_user_id = user_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_user_id(uid):\n local.user_id = uid", "def set_userId(self, userId):\n self.authentication.userId = userId", "def id_user(self, id_user):\n\n self._id_user = id_user", "def user(self, user):\n self.user_id = user.get_id()", "def userid(self, userid):\n\n self._userid ...
[ "0.7938785", "0.7769784", "0.75011295", "0.7175245", "0.7160245", "0.71352917", "0.71352917", "0.71352917", "0.71352917", "0.71352917", "0.71352917", "0.71352917", "0.71352917", "0.71352917", "0.71352917", "0.71352917", "0.71352917", "0.71352917", "0.71352917", "0.6780253", "...
0.71398705
5
Create an XBlock instance in this runtime. The `usage_id` is used to find the XBlock class and data.
def get_block(self, usage_id, for_parent=None): def_id = self.id_reader.get_definition_id(usage_id) try: block_type = self.id_reader.get_block_type(def_id) except NoSuchDefinition: raise NoSuchUsage(repr(usage_id)) # pylint: disable= raise-missing-from keys = Sco...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_xblock(usage, student_id=None):\n block_cls = XBlock.load_class(usage.block_name)\n runtime = StuviewRuntime(block_cls, student_id, usage)\n model = DbModel(SCOPED_KVS, block_cls, student_id, usage)\n block = block_cls(runtime, model)\n return block", "def get_a_block(self, usage_id=Non...
[ "0.76471823", "0.7514667", "0.6623194", "0.65381235", "0.64809114", "0.63301814", "0.63223976", "0.62157744", "0.6134866", "0.61307055", "0.606519", "0.6044189", "0.5939296", "0.5902435", "0.5809827", "0.5807884", "0.57990485", "0.5783026", "0.5744557", "0.56991005", "0.56639...
0.6345367
5
Create a new usage id from an XML dom node.
def _usage_id_from_node(self, node, parent_id, id_generator=None): if id_generator is not None: warnings.warn( "Passing an id_generator directly is deprecated " "in favor of constructing the Runtime with the id_generator", DeprecationWarning, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_xml_node(cls, xml_node):\n num_id = get_xml_int_value(xml_node, Elements.ID)\n return cls(num_id)", "def from_xml_node(cls, xml_node):\n num_id = get_xml_int_value(xml_node, xml_tags.Elements.ID)\n code = get_xml_text_value(xml_node, xml_tags.Elements.CODE)\n name = ge...
[ "0.6371269", "0.6049929", "0.5878882", "0.5818626", "0.58085644", "0.5799599", "0.57901216", "0.5776098", "0.57418257", "0.5712618", "0.5634056", "0.5417328", "0.53826225", "0.53826225", "0.5323692", "0.5311761", "0.53018266", "0.53018266", "0.53018266", "0.52426976", "0.5200...
0.67137915
0
Return instances for all of the asides that will decorate this `block`.
def get_asides(self, block): aside_instances = [ self.get_aside_of_type(block, aside_type) for aside_type in self.applicable_aside_types(block) ] return [ aside_instance for aside_instance in aside_instances if aside_instance.should_apply_to_block(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all(cls):\n for x in cls._dbag:\n yield cls(**cls._dbag[x])", "def __iter__(self):\n\n return [self]", "def __iter__(self):\n\n return [self]", "def getinstances(cls):\n\t\t\tdead = set()\n\t\t\tfor ref in cls._instances:\n\t\t\t\tobj = ref()\n\t\t\t\tif obj is not None:\n...
[ "0.56513435", "0.55858827", "0.55858827", "0.54629815", "0.54489243", "0.5424294", "0.5411907", "0.54080003", "0.5395361", "0.53692824", "0.5352983", "0.5323484", "0.5268873", "0.52532274", "0.52332526", "0.5225097", "0.52216053", "0.521371", "0.51980096", "0.51901674", "0.51...
0.63061476
0
Return the aside of the given aside_type which might be decorating this `block`.
def get_aside_of_type(self, block, aside_type): # TODO: This function will need to be extended if we want to allow: # a) XBlockAsides to statically indicated which types of blocks they can comment on # b) XBlockRuntimes to limit the selection of asides to a subset of the installed asides ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_aside_from_xblock(xblock, aside_type):\n return xblock.runtime.get_aside_of_type(xblock, aside_type)", "def get_aside_type_from_usage(self, aside_id):\n return aside_id.aside_type", "def get_aside_type_from_definition(self, aside_id):\n return aside_id.aside_type", "def get_aside_typ...
[ "0.7896758", "0.71537155", "0.706774", "0.68641186", "0.6752555", "0.6706851", "0.6083649", "0.5765583", "0.5576364", "0.55277556", "0.5527143", "0.5435288", "0.5389746", "0.504856", "0.48576647", "0.48488268", "0.4807231", "0.4807231", "0.4662693", "0.4596836", "0.4545115", ...
0.76510596
1
Handles any calls to the specified `handler_name`. Provides a fallback handler if the specified handler isn't found.
def handle(self, block, handler_name, request, suffix=''): handler = getattr(block, handler_name, None) if handler and getattr(handler, '_is_xblock_handler', False): # Cache results of the handler call for later saving results = handler(request, suffix) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error_handler(self, e, name, handler):\n msg = '' if handler else ' (no handler)'\n LOGGER.debug('Monitoring error handling %s %s: %s', name, msg, e)\n if handler:\n try:\n handler(e)\n except Exception as handler_exception:\n LOGGER.erro...
[ "0.6269601", "0.60956556", "0.59843504", "0.59441805", "0.58619446", "0.58327657", "0.58169", "0.5816621", "0.5782106", "0.57263947", "0.5712578", "0.5675827", "0.5673483", "0.56482244", "0.56310713", "0.55748713", "0.55747414", "0.5569639", "0.55649185", "0.55390835", "0.551...
0.6300936
0
Query for data in the tree, starting from `block`. Returns a Query object with methods for navigating the tree and retrieving information.
def query(self, block): raise NotImplementedError("Querying is an experimental feature")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def querypath(self, block, path):\n\n class BadPath(Exception):\n \"\"\"Bad path exception thrown when path cannot be found.\"\"\"\n\n results = self.query(block)\n ROOT, SEP, WORD, FINAL = range(4) # pylint: disable=C0103\n state = ROOT\n lexer = RegexLexer(\n ...
[ "0.5971489", "0.57624656", "0.5457333", "0.5435106", "0.53858924", "0.525556", "0.5243837", "0.5209347", "0.51643944", "0.51634365", "0.5157472", "0.51526695", "0.5067893", "0.49828783", "0.4978797", "0.49713552", "0.49528736", "0.4936563", "0.49121588", "0.48703235", "0.4845...
0.6875884
0
Iterator that tokenizes `text` and yields up tokens as they are found
def lex(self, text): for match in self.regex.finditer(text): name = match.lastgroup yield (name, match.group(name))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_text(self, text):\n\n for match in self.word_pattern.finditer(text):\n word = match.group(0)\n yield word.lower()", "def tokenize(text):\n return tokens_re.findall(text)", "def generate_tokenlist(text):\r\n for paragraph in text.find_all('p'):\r\n paragraph_s...
[ "0.7068761", "0.69617236", "0.6926864", "0.6902314", "0.6900396", "0.68888336", "0.6883105", "0.68530685", "0.6820278", "0.68167007", "0.67917883", "0.67813146", "0.67766625", "0.67563444", "0.67188275", "0.66937095", "0.6693036", "0.66860807", "0.6657734", "0.6629646", "0.66...
0.65617883
26
Get all Agents for an Account.
def get_agents(self, account_id, filters=None): return self.rest_request.get('accounts/' + str(account_id) + '/agents', filters)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_accounts(self, session: \"Session\") -> List[Account]:\n\n self.__get_dn(session)\n\n result = session.soapclient.get_accounts_by_owner(self.dn)\n return [Account(session, account=r) for r in result]", "def get_accounts(self):\n return self.accounts.all()", "def get_all_acco...
[ "0.59961605", "0.59441656", "0.5861199", "0.5848032", "0.5844847", "0.58298874", "0.57276475", "0.57118624", "0.5671839", "0.5639285", "0.5635771", "0.5625765", "0.56173086", "0.5608358", "0.55644363", "0.55444694", "0.55366045", "0.5517207", "0.5495683", "0.5494268", "0.5466...
0.63724303
0
Constructs a ResNet50 model.
def resnet50(bitW, bitA, pretrained=False, **kwargs): model = ResNet(Bottleneck, [3, 4, 6, 3], bitW, bitA, **kwargs) if pretrained: load_dict = torch.load('./resnet50.pth') load_state_dict(model, load_dict) else: load_dict = torch.load('./full_precision_records/weights/model_best.pth...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resnet50(pretrained=False, **kwargs):\n model = ResNet(Bottleneck, [3, 4, 6, 3], **kwargs)\n if pretrained:\n model.load_state_dict(model_zoo.load_url(model_urls['resnet50']))\n fc = transfer_fc(model.fc)\n model.fc = fc\n return model", "def resnet50(**kwargs):\n model = ResNet(...
[ "0.7557751", "0.75548905", "0.74759895", "0.74759895", "0.74759895", "0.74759895", "0.74557495", "0.7386862", "0.7386862", "0.73601955", "0.7355623", "0.724254", "0.724254", "0.7191571", "0.7158499", "0.7101107", "0.70165247", "0.69687796", "0.68687624", "0.6822836", "0.68010...
0.65116143
27
Test that making a request without credentials returns an error.
def test_without_credentials(self, api_client): order = OrderFactory() url = reverse( 'api-v3:public-omis:payment:collection', kwargs={'public_token': order.public_token}, ) response = api_client.post(url, data={}) assert response.status_code == status.HT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_authentication_is_not_required(self):\n # Act\n response = self.client.get(self.url)\n self.assertEqual(response.status_code, 200)", "def test_call_unauthenticated(self):\n\n with Client('username', 'password') as client:\n self.setSessionResponse(401)\n ...
[ "0.76834047", "0.7580964", "0.7548029", "0.7492346", "0.73547703", "0.7311838", "0.72872835", "0.7266877", "0.7266877", "0.72648716", "0.7245739", "0.7245739", "0.7225133", "0.72181296", "0.72181296", "0.7207371", "0.71722025", "0.7159647", "0.7152177", "0.71133715", "0.70791...
0.0
-1
Test that making a request without the whitelisted client IP returns an error.
def test_without_whitelisted_ip(self, public_omis_api_client): order = OrderFactory() url = reverse( 'api-v3:public-omis:payment:collection', kwargs={'public_token': order.public_token}, ) public_omis_api_client.set_http_x_forwarded_for('1.1.1.1') respons...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_request_failure(self, api_client):\n runner = CliRunner()\n\n api_client.ip.side_effect = RequestFailure(\n 401, {\"error\": \"forbidden\", \"status\": \"error\"}\n )\n expected = \"API error: forbidden\\n\"\n\n result = runner.invoke(subcommand.ip, [\"0.0.0.0...
[ "0.71329945", "0.7048689", "0.7009928", "0.6852092", "0.6828968", "0.6817714", "0.67207855", "0.66665757", "0.6645594", "0.66363966", "0.663225", "0.6615574", "0.661419", "0.651803", "0.6503831", "0.6492607", "0.64659625", "0.64466906", "0.64456666", "0.64052135", "0.63671494...
0.7089949
1
Test that if the order doesn't exist, the endpoint returns 404.
def test_404_if_order_doesnt_exist(self, public_omis_api_client): url = reverse( 'api-v3:public-omis:payment:collection', kwargs={'public_token': ('1234-abcd-' * 5)}, # len(token) == 50 ) response = public_omis_api_client.get(url) assert response.status_code == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_order_not_found(self):\n with mock_order_endpoint(order_number=self.ORDER_NUMBER, status=404):\n response = self.client.get(self.path)\n assert response.status_code == 404", "def test_get_order_not_found(self):\n resp = self.app.get('/orders/0')\n self.assertEqual(...
[ "0.8645534", "0.85581493", "0.85581493", "0.8315565", "0.80223227", "0.7815422", "0.7406854", "0.7243161", "0.7233888", "0.72086084", "0.71683776", "0.7116842", "0.70938146", "0.6939156", "0.68123424", "0.6807663", "0.68064237", "0.6761023", "0.6728476", "0.67253214", "0.6682...
0.8285757
4
Test that if the order is not in an allowed state, the endpoint returns 404.
def test_404_if_in_disallowed_status(self, order_status, public_omis_api_client): order = OrderFactory(status=order_status) url = reverse( 'api-v3:public-omis:payment:collection', kwargs={'public_token': order.public_token}, ) response = public_omis_api_client.ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_order_not_found(self):\n with mock_order_endpoint(order_number=self.ORDER_NUMBER, status=404):\n response = self.client.get(self.path)\n assert response.status_code == 404", "def test_404_if_order_doesnt_exist(self, public_omis_api_client):\n url = reverse(\n '...
[ "0.72447544", "0.7141826", "0.70186913", "0.70186913", "0.70097524", "0.6926317", "0.6702969", "0.66441876", "0.63968515", "0.6361119", "0.6322541", "0.6246056", "0.62384236", "0.623619", "0.6233009", "0.62329876", "0.62031615", "0.6186357", "0.6157161", "0.6086669", "0.60585...
0.78816575
0
Returns two ``(lineno, col_offset)`` tuples for the start and end of the given node. If the positions can't be determined, or the nodes don't correspond to any particular text, returns ``(1, 0)`` for both. ``padded`` corresponds to the ``padded`` argument to ``ast.get_source_segment()``. This means that if ``padded`` i...
def get_text_positions(self, node, padded): # type: (AstNode, bool) -> Tuple[Tuple[int, int], Tuple[int, int]] raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_text_positions(self, node, padded):\n # type: (AstNode, bool) -> Tuple[Tuple[int, int], Tuple[int, int]]\n if not hasattr(node, 'first_token'):\n return (1, 0), (1, 0)\n\n start = node.first_token.start\n end = node.last_token.end\n if padded and any(match_token(t, token.NEWLINE) for t ...
[ "0.7613213", "0.712093", "0.6876001", "0.68570465", "0.5050924", "0.4976951", "0.4957857", "0.49526757", "0.48910186", "0.48901916", "0.48655295", "0.48281074", "0.47816372", "0.47567505", "0.4664858", "0.4634707", "0.46186876", "0.45755643", "0.45272633", "0.44824618", "0.44...
0.68340755
4
The filename that was parsed
def filename(self): # type: () -> str return self._filename
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getfilename(self):\n pass", "def filename(self):\n filename, ext = os.path.splitext(self.file.name)\n return filename.split('/')[-1]", "def filename(self):\r\n return self._filename", "def get_filename(self):\n return self.filename", "def filename(self):\n return ...
[ "0.78871846", "0.77411497", "0.76536465", "0.757722", "0.7566554", "0.7566554", "0.7566554", "0.7566554", "0.7535803", "0.75262773", "0.7520206", "0.7485077", "0.74766815", "0.7417852", "0.74166214", "0.7396382", "0.7389725", "0.7387223", "0.73798007", "0.73798007", "0.737980...
0.71176994
44
Returns two ``(lineno, col_offset)`` tuples for the start and end of the given node. If the positions can't be determined, or the nodes don't correspond to any particular text, returns ``(1, 0)`` for both. ``padded`` corresponds to the ``padded`` argument to ``ast.get_source_segment()``. This means that if ``padded`` i...
def get_text_positions(self, node, padded): # type: (AstNode, bool) -> Tuple[Tuple[int, int], Tuple[int, int]] if not hasattr(node, 'first_token'): return (1, 0), (1, 0) start = node.first_token.start end = node.last_token.end if padded and any(match_token(t, token.NEWLINE) for t in self.get_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_text_range(self, node, padded=True):\n # type: (AstNode, bool) -> Tuple[int, int]\n start, end = self.get_text_positions(node, padded)\n return (\n self._line_numbers.line_to_offset(*start),\n self._line_numbers.line_to_offset(*end),\n )", "def _get_text_positions_tokenless(self, no...
[ "0.7121393", "0.68775433", "0.6858732", "0.68359655", "0.5048872", "0.49797606", "0.49556705", "0.4952399", "0.48919713", "0.4891382", "0.4862992", "0.48273867", "0.47827742", "0.47550952", "0.46643692", "0.4636216", "0.46174127", "0.45772454", "0.45282903", "0.44812423", "0....
0.7614878
0
Returns two ``(lineno, col_offset)`` tuples for the start and end of the given node. If the positions can't be determined, or the nodes don't correspond to any particular text, returns ``(1, 0)`` for both. ``padded`` corresponds to the ``padded`` argument to ``ast.get_source_segment()``. This means that if ``padded`` i...
def get_text_positions(self, node, padded): # type: (AstNode, bool) -> Tuple[Tuple[int, int], Tuple[int, int]] if getattr(node, "_broken_positions", None): # This node was marked in util.annotate_fstring_nodes as having untrustworthy lineno/col_offset. return (1, 0), (1, 0) if supports_tokenles...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_text_positions(self, node, padded):\n # type: (AstNode, bool) -> Tuple[Tuple[int, int], Tuple[int, int]]\n if not hasattr(node, 'first_token'):\n return (1, 0), (1, 0)\n\n start = node.first_token.start\n end = node.last_token.end\n if padded and any(match_token(t, token.NEWLINE) for t ...
[ "0.7613213", "0.712093", "0.6876001", "0.68340755", "0.5050924", "0.4976951", "0.4957857", "0.49526757", "0.48910186", "0.48901916", "0.48655295", "0.48281074", "0.47816372", "0.47567505", "0.4664858", "0.4634707", "0.46186876", "0.45755643", "0.45272633", "0.44824618", "0.44...
0.68570465
3
Controls the IQ gain trim over a range from 0.5 to 0.5 dB.
def iq_gain_trim(self): return self._read(0x11, 2, 0xFC)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_playback_gain(self, val):\n self.playbackGain = 10**(5.0*(val - self.speedDial.maximum()/2)/self.speedDial.maximum())", "def gain(self, value: int):\n self._gain = value", "def gaindb(self, value):\n self._logger.debug(\"setting gain: %7.2f\", value)\n self._gaindb = valu...
[ "0.6397116", "0.63239473", "0.59188634", "0.57702553", "0.5760457", "0.5730897", "0.5646702", "0.5614922", "0.557427", "0.55321383", "0.5526878", "0.5516378", "0.5513648", "0.54951537", "0.54736984", "0.54729307", "0.54448986", "0.5441061", "0.54317546", "0.54021925", "0.5395...
0.6556339
0
r"""Exports mentor schedule CSV file. Args
def export_mentor_schedule(self, r_id, matches=None, update_flow=True, print_idle=True): if matches is None: matches = self.get_matches(update_flow) m_matches = self.get_mentor_centered_view(matches, print_idle) out_strs = [] for mentor_email i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def genScheduleCSV():\r\n try: \r\n printSchedule()\r\n save_class_list()\r\n print(\"\\nSchedule generated, check working directory\")\r\n except Exception as e:\r\n print(\"Exception found\" + str(e))", "def create_csv_file(self):\r\n # Create a new csv-file\r\n ...
[ "0.7239752", "0.6597585", "0.64198995", "0.6349476", "0.6309529", "0.6306237", "0.6295962", "0.62842685", "0.62080544", "0.618555", "0.61667824", "0.6153778", "0.6129584", "0.6103896", "0.60934186", "0.6075212", "0.60714626", "0.6067669", "0.60539705", "0.6053714", "0.6044705...
0.0
-1
Transform route to a URL string with the given url and query parameters.
def to_url(self, parameters: dict = {}, query_params: dict = {}) -> str: # Split the url into a list split_url = self.url.split("/") # Start beginning of the new compiled url compiled_url = "/" # Iterate over the list for url in split_url: if url: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Url(route, params):\n out = route\n if params:\n # sorting ensures a unique filename for each query\n sorted_params = sorted(six.iteritems(params))\n out += '?' + urllib.urlencode(sorted_params)\n return out", "def to_url(request):\r\n scheme, netloc, path, query, fragment = urlsplit(to_ut...
[ "0.7437549", "0.6625053", "0.65596825", "0.6208792", "0.6196825", "0.61550367", "0.61385447", "0.5994257", "0.5937162", "0.5922733", "0.58541536", "0.583377", "0.58200955", "0.5802566", "0.57911074", "0.5769753", "0.5756", "0.5756", "0.5743795", "0.5739435", "0.570777", "0....
0.6291562
3
Returns True if the stack is empty; False otherwise
def empty(self): return len(self.stack) == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return len(self.the_stack) == 0", "def empty(self) -> bool:\n if len(self.stack)==0:\n return True\n else:\n return False", "def is_empty(self):\n return len(self.stack) == 0", "def empty(self):\r\n return len(self.stack) == 0", ...
[ "0.92037237", "0.9180508", "0.91406024", "0.91275316", "0.9116923", "0.90550864", "0.9052511", "0.8943755", "0.89294434", "0.8924256", "0.8862904", "0.8841065", "0.8835616", "0.8835616", "0.8822036", "0.87964004", "0.8790472", "0.87837857", "0.8738746", "0.86769456", "0.86769...
0.90786946
6
Returns True if the queue is empty; False otherwise
def empty(self): return self.queue.empty()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return self.queue == []", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.__queue) > 0", "def is_empty(self):\n return len(self.the_queue) == 0", "def ...
[ "0.91906184", "0.9106868", "0.9106868", "0.91054034", "0.90929186", "0.9089246", "0.90318966", "0.90305626", "0.8976901", "0.8976538", "0.8973808", "0.88919264", "0.88877845", "0.8872881", "0.88220835", "0.88220835", "0.8801634", "0.8798873", "0.87174255", "0.86821836", "0.86...
0.7996516
41
Returns the active item
def active_item(self, remove=True): self.sleeping.reveille() # wake items whose sleep timer has expired if not self.stack.empty(): pass elif not self.backlog.empty(): # feed the stack the top priority item from the queue self.stack.push(self.backlog.get()) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_active(self):\n return self.__active", "def _get_active(self):\n return self.__active", "def _get_active(self):\n return self.__active", "def _get_active(self):\n return self.__active", "def get_active(self):\n return self._active", "def GetCurrentItem(self):\r\n\r\n re...
[ "0.74419355", "0.74419355", "0.74419355", "0.74419355", "0.7421165", "0.7326577", "0.7323334", "0.7132318", "0.7132318", "0.7111639", "0.69387925", "0.6937808", "0.68554187", "0.68554187", "0.678091", "0.6652583", "0.6652024", "0.66221154", "0.6580986", "0.6566904", "0.655792...
0.6017014
59
Returns the current task without removing it from the stack
def current_task(self): try: return self.active_item(remove=False) except queue.Empty: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_current_task():\r\n return current_task", "def _get_current_task():\r\n return current_task", "def get_previous_task():\n return _tasks[0] if len(_tasks) != 0 else None", "def get_current_task(self):\n return self.get_current_step().get_last_task()", "def current_task() -> Task:\n ...
[ "0.8184563", "0.8184563", "0.7669096", "0.75990134", "0.75904626", "0.7282467", "0.7191658", "0.69429064", "0.69429064", "0.69429064", "0.69429064", "0.69429064", "0.69291824", "0.69046277", "0.6863734", "0.6845726", "0.68107516", "0.67989314", "0.674292", "0.6586547", "0.656...
0.83684415
0
Returns a string representation of HEREModel. By default this is the same as as_json_string().
def __str__(self): return self.as_json_string()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_json(self) -> str:\n return json.dumps(model_to_dict(self))", "def __str__(self):\n return self.asJsonString()", "def to_string(self):\n return json.dumps(self.to_json(), cls=ObjectEncoder)", "def to_string(self) -> str:\n return json.dumps(self.to_json())", "def to_strin...
[ "0.7772324", "0.7586851", "0.75795597", "0.7560939", "0.7560939", "0.75006235", "0.74918807", "0.727085", "0.7259125", "0.7201628", "0.7168366", "0.7161533", "0.7161533", "0.7161533", "0.7161533", "0.7161533", "0.7161533", "0.7161533", "0.7161533", "0.7161533", "0.7161533", ...
0.7589163
1
Create a new instance based on a JSON dict. Any kwargs should be supplied by the inherited, calling class.
def new_from_jsondict(cls, data, **kwargs): json_data = data.copy() if kwargs: for key, val in kwargs.items(): json_data[key] = val c = cls(**json_data) c._json = data return c
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __json_init__(cls, **kwargs):\n return cls(**kwargs)", "def fromJson(json):\r\n raise NotImplementedError(\"Returns instance\")", "def from_json(cls: Type[T], value: JsonResponse, **kwargs) -> 'BaseModel':\n attr_names = [a.lstrip('_') for a in fields_dict(cls)]\n if cls.temp_at...
[ "0.8324179", "0.72269773", "0.72127616", "0.7211281", "0.7205846", "0.69819576", "0.6978607", "0.6957752", "0.6957752", "0.6957752", "0.6912844", "0.68905836", "0.6869268", "0.6865999", "0.68384755", "0.6837064", "0.6837064", "0.6837064", "0.6837064", "0.6837064", "0.6837064"...
0.7854041
1
Create a new instance based on a JSON dict. Any kwargs should be supplied by the inherited, calling class.
def new_from_jsondict(cls, data, param_defaults, **kwargs): json_data = data.copy() if kwargs: for key, val in kwargs.items(): json_data[key] = val c = cls(param_defaults, **json_data) c._json = data return c
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __json_init__(cls, **kwargs):\n return cls(**kwargs)", "def new_from_jsondict(cls, data, **kwargs):\n\n json_data = data.copy()\n if kwargs:\n for key, val in kwargs.items():\n json_data[key] = val\n\n c = cls(**json_data)\n c._json = data\n ...
[ "0.83253974", "0.7853526", "0.7226002", "0.7213214", "0.7205354", "0.6980891", "0.6977916", "0.69576895", "0.69576895", "0.69576895", "0.69103247", "0.6891212", "0.6870051", "0.68661606", "0.68384963", "0.6834707", "0.6834707", "0.6834707", "0.6834707", "0.6834707", "0.683470...
0.72114956
4
This is a simple use for any driver. The url may encode the scheme to choose the driver, otherwise it will use the default one.
def open(url, *args, **kwargs): scheme = DEFAULT_SCHEME if '://' in url: scheme, url = url.split('://') return DRIVERS[scheme](url, *args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_default_driver(uri: str) -> str:\n parts = uri.split(\"://\", 1)\n if \"+\" in parts[0]:\n return uri\n else:\n driver = default_drivers.get(parts[0], None)\n if driver:\n parts[0] += f\"+{driver}\"\n return \"://\".join(parts)", "def get_driver(url='neo4j', ne...
[ "0.6490953", "0.6073188", "0.5887861", "0.57911825", "0.5647161", "0.56092966", "0.5596016", "0.5469282", "0.5338693", "0.52964175", "0.5259368", "0.5253535", "0.5246862", "0.52280605", "0.52275074", "0.52264553", "0.5185059", "0.51845527", "0.51452476", "0.5123311", "0.51232...
0.64531296
1
Checks product URL format for this scraper instance is valid.
def check_url_format(self): m = re.match(r"^http://www\.flipkart\.com/.*/p/.*$", self.product_page_url) return not not m
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_url_format(self):\r\n m = re.match(\"^http://www.tesco.com/direct/[0-9a-zA-Z-]+/[0-9-]+\\.prd$\", self.product_page_url)\r\n n = re.match(\"^http://www.tesco.com/.*$\", self.product_page_url)\r\n return (not not m) or (not not n)", "def validate_url(self):\n pass", "def ch...
[ "0.74237686", "0.69638944", "0.6621842", "0.6447235", "0.6317951", "0.6262852", "0.61665505", "0.6132594", "0.6129728", "0.61058044", "0.60950494", "0.60522604", "0.60082245", "0.59717137", "0.596899", "0.5958545", "0.5957772", "0.592074", "0.5893412", "0.58432484", "0.582849...
0.773419
0
Given a word, return the first onset and last coda. word wordlength token (as a string) to be parsed. Returns tuple consisting of first onset and last coda.
def parse(self, word): son_map = self._sonority_map(word) ons_son = self._initial_onset(son_map) cod_son = self._final_coda(son_map) ons = self.from_map(ons_son, word) cod = self.from_reverse_map(cod_son, word) return (ons, cod)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(self, word):\n word = self.son.segs(word)\n son_map = self._sonority_map(word)\n son_map = self._mark_offglides(son_map)\n son_map = self._adjust_anom_fric_cod(son_map)\n son_map = self._adjust_anom_fric_ons(son_map)\n ons_son = self._initial_onset(son_map)\n ...
[ "0.6705851", "0.6090394", "0.60118496", "0.5939784", "0.587222", "0.5806324", "0.57107127", "0.56693965", "0.5668625", "0.56522405", "0.56342864", "0.56331456", "0.56329733", "0.5623904", "0.5599231", "0.55851895", "0.54834336", "0.5472344", "0.54613686", "0.54551", "0.544664...
0.7014094
0
Given a word, return the first onset and last coda. word wordlength token (as a string) to be parsed. Returns tuple consisting of first onset and last coda.
def parse(self, word): word = self.son.segs(word) son_map = self._sonority_map(word) son_map = self._mark_offglides(son_map) son_map = self._adjust_anom_fric_cod(son_map) son_map = self._adjust_anom_fric_ons(son_map) ons_son = self._initial_onset(son_map) cod_son ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(self, word):\n son_map = self._sonority_map(word)\n ons_son = self._initial_onset(son_map)\n cod_son = self._final_coda(son_map)\n ons = self.from_map(ons_son, word)\n cod = self.from_reverse_map(cod_son, word)\n return (ons, cod)", "def get_word_postion(self, ...
[ "0.70137626", "0.60917956", "0.60117054", "0.5940242", "0.58720136", "0.5807405", "0.57118523", "0.56696093", "0.5667671", "0.56524855", "0.56355464", "0.56328315", "0.5631227", "0.5623632", "0.5598229", "0.55855936", "0.54834896", "0.54721445", "0.5461418", "0.545575", "0.54...
0.6705349
1
Creates a transpose convolutional layer, with optional batch normalization.
def deconv(in_channels, out_channels, kernel_size, stride=2, padding=1, normalization=True, norm_type='instance_norm'): layers = [] # append transpose conv layer layers.append(nn.ConvTranspose2d(in_channels, out_channels, kernel_size, stride, padding, bias=False)) # optional normalization layer if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transpose(incoming, conv, nonlinearity, *args, **kwargs):\n return TransposedConv2DLayer(incoming, conv.input_shape[1],\n conv.filter_size, stride=conv.stride,\n crop=conv.pad, W=conv.W,\n flip_filters=not conv.f...
[ "0.7461155", "0.73468494", "0.708482", "0.70811796", "0.70408463", "0.7025", "0.69208527", "0.69168323", "0.6877133", "0.6840369", "0.68396986", "0.68199533", "0.6751397", "0.6663342", "0.66554505", "0.6619359", "0.66144425", "0.6569245", "0.65642184", "0.65393883", "0.653219...
0.5611899
79
Fills the input Tensor with values drawn from a truncated normal distribution.
def trunc_normal_(tensor, mean=0.0, std=1.0, a=-2.0, b=2.0): return _no_grad_trunc_normal_(tensor, mean, std, a, b)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _truncated_normal_init(tensor, mean=0, stddev=1):\n\n total_size = tensor.numel()\n\n # determine the scipy random state from the torch seed\n # the numpy seed can be between 0 and 2**32-1\n np_seed = torch.randint(0, 2**32-1, (1, 1)).view(-1).item()\n np_state = RandomState(np_seed)\n # trun...
[ "0.68335545", "0.6820871", "0.6677048", "0.6677048", "0.65054333", "0.6387188", "0.60703975", "0.60413134", "0.5951866", "0.5925373", "0.5920319", "0.59181076", "0.59148264", "0.59148264", "0.5899481", "0.58042073", "0.5788339", "0.5775336", "0.57611173", "0.57421774", "0.573...
0.6554195
4
Forward function for RSTBWithInputConv.
def forward(self, x): return self.main(x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, input):\n\n x = self.conv(input)\n x = self.bn(x)\n out = self.act(x)\n return out", "def forward(self, input):\n sl, bs = input.size()\n if bs != self.bs:\n self.bs = bs\n self.reset()\n with set_grad_enabled(self.training)...
[ "0.7021191", "0.69806397", "0.6886363", "0.6869562", "0.6855901", "0.6854136", "0.68250126", "0.68167174", "0.6815", "0.67716396", "0.67714065", "0.6767677", "0.6755188", "0.6753085", "0.6753085", "0.6752486", "0.6743255", "0.6740206", "0.67159706", "0.6715583", "0.6705854", ...
0.0
-1
Init weights for models.
def init_weights(self, pretrained=None, strict=True): if isinstance(pretrained, str): logger = get_root_logger() load_checkpoint(self, pretrained, strict=strict, logger=logger) elif pretrained is not None: raise TypeError(f'"pretrained" must be a str or None. But rece...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_weights(model):\n ...", "def init_weights(self):\n # Initialize weights\n self.apply(self._init_weights)\n # Tie weights if needed\n self.tie_weights()", "def _initialize_weights(self):\n pass", "def init_weights(self):\n # Initialize weights\n ...
[ "0.8984091", "0.8641805", "0.86267096", "0.86172", "0.85792875", "0.85725594", "0.84296715", "0.8325935", "0.8232147", "0.8045925", "0.8013931", "0.8010816", "0.79973304", "0.7983617", "0.7977511", "0.7962253", "0.7962253", "0.7962253", "0.7959221", "0.79509515", "0.7947236",...
0.0
-1
Encode the variances from the priorbox layers into the ground truth boxes we have matched (based on jaccard overlap) with the prior boxes.
def encode(matched, priors, variances): g_cxcy = (matched[:, :2] + matched[:, 2:]) / 2 - priors[:, :2] g_cxcy /= variances[0] * priors[:, 2:] g_wh = (matched[:, 2:] - matched[:, :2]) / priors[:, 2:] g_wh = torch.log(g_wh) / variances[1] return torch.cat([g_cxcy, g_wh], 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode(predictions, priors, variances):\n\n boxes = np.concatenate((\n priors[:, :2] + predictions[:, :2] * variances[0] * priors[:, 2:4],\n priors[:, 2:4] * np.exp(predictions[:, 2:4] * variances[1])), 1)\n boxes[:, :2] = boxes[:, :2] - (boxes[:, 2:4] / 2)\n boxes[:, 2:4] = boxes[:, 2:4...
[ "0.6235257", "0.5658466", "0.5565145", "0.55338675", "0.55313486", "0.5494903", "0.5465958", "0.54217523", "0.53959715", "0.5362389", "0.5340697", "0.53281265", "0.5271463", "0.5257666", "0.52557886", "0.52517486", "0.522925", "0.5208523", "0.51988745", "0.5143706", "0.513749...
0.48748165
56
Encode the variances from the priorbox layers into the ground truth boxes we have matched (based on jaccard overlap) with the prior boxes.
def encode_landm(matched, priors, variances): matched = torch.reshape(matched, (matched.size(0), 5, 2)) priors_cx = priors[:, 0].unsqueeze(1).expand(matched.size(0), 5).unsqueeze(2) priors_cy = priors[:, 1].unsqueeze(1).expand(matched.size(0), 5).unsqueeze(2) priors_w = priors[:, 2].unsqueeze(1).expand(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode(predictions, priors, variances):\n\n boxes = np.concatenate((\n priors[:, :2] + predictions[:, :2] * variances[0] * priors[:, 2:4],\n priors[:, 2:4] * np.exp(predictions[:, 2:4] * variances[1])), 1)\n boxes[:, :2] = boxes[:, :2] - (boxes[:, 2:4] / 2)\n boxes[:, 2:4] = boxes[:, 2:4...
[ "0.6234259", "0.5660315", "0.5567395", "0.5538085", "0.55339146", "0.5497187", "0.5469487", "0.54250485", "0.5396358", "0.5363414", "0.53424776", "0.53301036", "0.5275891", "0.5260728", "0.5258463", "0.52534086", "0.5230127", "0.5210229", "0.5199591", "0.51451266", "0.5139138...
0.47383144
84
Convert prior_boxes to (xmin, ymin, xmax, ymax) representation for comparison to point form ground truth data.
def point_form(boxes): return torch.cat((boxes[:, :2] - boxes[:, 2:] / 2, boxes[:, :2] + boxes[:, 2:] / 2), 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_prior_boxes(self):\n # value of k for each feature map to create k^2 boxes for each feature map\n feature_map_dims = {'conv4_3': 38, 'conv7': 19, 'conv8_2': 10, 'conv9_2': 5}\n\n # scale for boxes across different feature maps. boxes for inner feature maps\n # are scaled much...
[ "0.6725058", "0.66532594", "0.64312464", "0.63890076", "0.6330887", "0.6244093", "0.6211704", "0.60598165", "0.59242463", "0.5915014", "0.58319116", "0.58136916", "0.58081603", "0.58081603", "0.57952434", "0.57759565", "0.57605946", "0.57117975", "0.5710929", "0.56834435", "0...
0.0
-1
Match each prior box with the ground truth box of the highest jaccard overlap, encode the bounding boxes, then return the matched indices corresponding to both confidence and location preds.
def match(threshold, truths, priors, variances, labels, landms, loc_t, conf_t, landm_t, idx): overlaps = jaccard(truths, point_form(priors)) best_prior_overlap, best_prior_idx = overlaps.max(1, keepdim=True) valid_gt_idx = best_prior_overlap[:, 0] >= 0.2 best_prior_idx_filter = best_prior_idx[valid_gt_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_matches(gt_boxes, gt_class_ids, gt_masks,\n pred_boxes, pred_class_ids, pred_scores, pred_masks,\n iou_threshold=0.5, score_threshold=0.0):\n # Trim zero padding\n # TODO: cleaner to do zero unpadding upstream\n gt_boxes = trim_zeros(gt_boxes)\n gt_mask...
[ "0.64954555", "0.6426992", "0.6242716", "0.620002", "0.61827576", "0.6160322", "0.61498445", "0.60834885", "0.596623", "0.5880973", "0.58795214", "0.58585274", "0.57878023", "0.57507145", "0.57475", "0.57229817", "0.57144845", "0.57128614", "0.56988883", "0.56869", "0.5665365...
0.55013496
37
Returns shared parameters for all ResNet50 benchmarks.
def _shared_params(self): return BenchmarkBase._shared_params(self)._replace( num_gpus=1, model='resnet50', num_warmup_batches=5, num_batches=50, distortions=False, forward_only=True, device='cpu', data_format='NHWC', num_intra_threads=0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _shared_params(self):\n return BenchmarkBase._shared_params(self)._replace(\n model='resnet50', batch_size=128, distortions=False,\n optimizer='momentum')", "def _shared_params(self):\n return BenchmarkBase._shared_params(self)._replace(\n num_gpus=1, model='resnet50', distortions=...
[ "0.8093189", "0.7843872", "0.74811083", "0.7224232", "0.70979655", "0.6943283", "0.6727507", "0.6321282", "0.6168939", "0.5949951", "0.5940708", "0.5933771", "0.58331233", "0.5770217", "0.5692783", "0.566573", "0.566573", "0.5655511", "0.5622129", "0.5596944", "0.5570784", ...
0.81118906
0
Returns shared parameters for all ResNet50 benchmarks.
def _shared_params(self): return BenchmarkBase._shared_params(self)._replace( num_gpus=1, model='resnet50', distortions=False, forward_only=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _shared_params(self):\n return BenchmarkBase._shared_params(self)._replace(\n num_gpus=1,\n model='resnet50',\n num_warmup_batches=5,\n num_batches=50,\n distortions=False,\n forward_only=True,\n device='cpu',\n data_format='NHWC',\n num_intra_t...
[ "0.81118906", "0.8093189", "0.74811083", "0.7224232", "0.70979655", "0.6943283", "0.6727507", "0.6321282", "0.6168939", "0.5949951", "0.5940708", "0.5933771", "0.58331233", "0.5770217", "0.5692783", "0.566573", "0.566573", "0.5655511", "0.5622129", "0.5596944", "0.5570784", ...
0.7843872
2
Returns shared parameters for all ResNet50 benchmarks.
def _shared_params(self): return BenchmarkBase._shared_params(self)._replace( model='resnet50', batch_size=128, distortions=False, optimizer='momentum')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _shared_params(self):\n return BenchmarkBase._shared_params(self)._replace(\n num_gpus=1,\n model='resnet50',\n num_warmup_batches=5,\n num_batches=50,\n distortions=False,\n forward_only=True,\n device='cpu',\n data_format='NHWC',\n num_intra_t...
[ "0.81118906", "0.7843872", "0.74811083", "0.7224232", "0.70979655", "0.6943283", "0.6727507", "0.6321282", "0.6168939", "0.5949951", "0.5940708", "0.5933771", "0.58331233", "0.5770217", "0.5692783", "0.566573", "0.566573", "0.5655511", "0.5622129", "0.5596944", "0.5570784", ...
0.8093189
1
Returns shared parameters for all ResNet50 FP16 benchmarks.
def _shared_params_fp16(self): return BenchmarkBase._shared_params(self)._replace( model='resnet50', batch_size=256, distortions=False, use_fp16=True, optimizer='momentum', loss_type_to_report='base_loss', compute_lr_on_cpu=True, single_l2_loss_op=True...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _shared_params(self):\n return BenchmarkBase._shared_params(self)._replace(\n num_gpus=1,\n model='resnet50',\n num_warmup_batches=5,\n num_batches=50,\n distortions=False,\n forward_only=True,\n device='cpu',\n data_format='NHWC',\n num_intra_t...
[ "0.7731678", "0.7656216", "0.75924444", "0.74081016", "0.7034538", "0.69508904", "0.6873029", "0.6867763", "0.6575514", "0.5854035", "0.584752", "0.5802204", "0.5588528", "0.557693", "0.5540908", "0.5514811", "0.5499431", "0.5483211", "0.5476246", "0.5476246", "0.5475894", ...
0.7360173
4
Tests 1 gpu with synthetic data.
def benchmark_synth_1gpu_gpuparams(self): params = self._shared_params()._replace(num_gpus=1) self._run_benchmark(params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_nvidia_driver2():\r\n a = numpy.random.rand(10000).astype(\"float32\")\r\n cuda.shared_constructor(a)\r\n assert theano.sandbox.cuda.use.device_number is not None", "def benchmark_fake_1gpu_gpuparams(self):\n params = self._shared_params()._replace(\n num_gpus=1, data_dir=self.fake_da...
[ "0.68693227", "0.68644226", "0.6670029", "0.6670029", "0.6670029", "0.6513355", "0.6339023", "0.6307369", "0.6302433", "0.62930727", "0.628481", "0.6263361", "0.6261016", "0.6261016", "0.6261016", "0.62364423", "0.6221056", "0.61878484", "0.61514795", "0.6134151", "0.61246085...
0.6409363
6
Tests 8 gpu with synthetic data with parameters replicated.
def benchmark_synth_8gpu_gpureplicated(self): params = self._shared_params()._replace( num_gpus=8, variable_update='replicated', all_reduce_spec='nccl', gradient_repacking=2) self._run_benchmark(params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def benchmark_fake_8gpu_gpureplicated(self):\n params = self._shared_params()._replace(\n num_gpus=8,\n data_dir=self.fake_data_dir,\n data_name='imagenet',\n variable_update='replicated',\n all_reduce_spec='nccl',\n gradient_repacking=2)\n self._run_benchmark(params...
[ "0.7032033", "0.69963396", "0.6776914", "0.6776914", "0.6776914", "0.66615206", "0.66254723", "0.66057956", "0.6542688", "0.6514595", "0.64651054", "0.6460251", "0.6460251", "0.6460251", "0.6424654", "0.6421601", "0.6421601", "0.6421601", "0.64193594", "0.640392", "0.636337",...
0.65189254
9
Tests 1 gpu with synthetic data with parameters on the gpu.
def benchmark_fp16_synth_1gpu_gpuparams(self): params = self._shared_params_fp16()._replace( num_gpus=1, variable_update='parameter_server') self._run_benchmark(params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def benchmark_xla_fake_1gpu_gpuparams(self):\n params = self._shared_params()._replace(\n num_gpus=1,\n data_dir=self.fake_data_dir,\n data_name='imagenet',\n variable_update='parameter_server',\n xla=True)\n self._run_benchmark(params)", "def benchmark_xla_fake_1gpu_gpup...
[ "0.68138134", "0.68138134", "0.68138134", "0.68003327", "0.67727077", "0.65793663", "0.65793663", "0.65793663", "0.6554631", "0.64648366", "0.6462202", "0.6436592", "0.6396781", "0.6396781", "0.6396781", "0.6394387", "0.6394387", "0.6394387", "0.6322726", "0.6307132", "0.6287...
0.6126789
25
Tests 1 gpu with synthetic data with parameters on the gpu.
def benchmark_fp16_synth_1gpu_gpuparams_batch128(self): params = self._shared_params_fp16()._replace( num_gpus=1, batch_size=128, variable_update='parameter_server') self._run_benchmark(params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def benchmark_xla_fake_1gpu_gpuparams(self):\n params = self._shared_params()._replace(\n num_gpus=1,\n data_dir=self.fake_data_dir,\n data_name='imagenet',\n variable_update='parameter_server',\n xla=True)\n self._run_benchmark(params)", "def benchmark_xla_fake_1gpu_gpup...
[ "0.68138134", "0.68138134", "0.68138134", "0.68003327", "0.67727077", "0.65793663", "0.65793663", "0.65793663", "0.6554631", "0.64648366", "0.6462202", "0.6436592", "0.6396781", "0.6396781", "0.6396781", "0.6394387", "0.6394387", "0.6394387", "0.6322726", "0.6307132", "0.6287...
0.5696595
76
Returns shared parameters for all ResNet50v1.5 FP16 benchmarks.
def _shared_params_fp16(self): return BenchmarkBase._shared_params(self)._replace( model='resnet50_v1.5', batch_size=256, distortions=False, use_fp16=True, optimizer='momentum', loss_type_to_report='base_loss', compute_lr_on_cpu=True, single_l2_loss_op...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _shared_params(self):\n return BenchmarkBase._shared_params(self)._replace(\n num_gpus=1,\n model='resnet50',\n num_warmup_batches=5,\n num_batches=50,\n distortions=False,\n forward_only=True,\n device='cpu',\n data_format='NHWC',\n num_intra_t...
[ "0.76316136", "0.7544761", "0.74272466", "0.72657585", "0.69159615", "0.67190754", "0.66939676", "0.666763", "0.6411092", "0.579886", "0.56886077", "0.5589944", "0.5470399", "0.54562384", "0.5445404", "0.5414948", "0.5396841", "0.53929985", "0.53914535", "0.53910893", "0.5391...
0.7368753
3