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
Gets the minimum_subtotal of this Customer. Minimum subtotal
def minimum_subtotal(self): return self._minimum_subtotal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def minimum_subtotal(self, minimum_subtotal):\n\n self._minimum_subtotal = minimum_subtotal", "def min_qty(self):\n return self._min_qty", "def min_sale_qty(self):\n return self._min_sale_qty", "def _get_minimum(self):\n return self._minimum", "def min(self):\n return sel...
[ "0.762988", "0.63574404", "0.62578213", "0.6119958", "0.609414", "0.6035749", "0.6033182", "0.5990075", "0.59808767", "0.59447646", "0.593769", "0.5923251", "0.5911233", "0.5893297", "0.5893297", "0.58926266", "0.5891071", "0.5867106", "0.5867106", "0.58617187", "0.5806587", ...
0.8682387
0
Sets the minimum_subtotal of this Customer. Minimum subtotal
def minimum_subtotal(self, minimum_subtotal): self._minimum_subtotal = minimum_subtotal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def minimum_subtotal(self):\n return self._minimum_subtotal", "def min_value(self, min_value):\n\n self._min_value = min_value", "def min_value(self, min_value):\n\n self._min_value = min_value", "def min_value(self, min_value):\n\n self._min_value = min_value", "def min_sale_qt...
[ "0.75220066", "0.6253324", "0.6253324", "0.6253324", "0.62453973", "0.619761", "0.6030935", "0.59983313", "0.5970749", "0.59042466", "0.59042466", "0.59038216", "0.59038216", "0.58876675", "0.58567154", "0.5769353", "0.56948346", "0.5668504", "0.5617014", "0.5616412", "0.5605...
0.91217035
0
Gets the no_coupons of this Customer. No coupons
def no_coupons(self): return self._no_coupons
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def no_coupons(self, no_coupons):\n\n self._no_coupons = no_coupons", "def get_customer_count(self):\n return self._df_invoice_original.CustomerID.unique().shape[0]", "def count_codon_all(self):\n return Counter(list(self))", "def coupons(self):\r\n return coup.Coupons(self)", "de...
[ "0.6109418", "0.6065169", "0.600353", "0.5981188", "0.59681046", "0.58282405", "0.58179194", "0.5759666", "0.5717092", "0.56691134", "0.5622092", "0.55998003", "0.559923", "0.55969113", "0.5569218", "0.5562735", "0.5544317", "0.5513898", "0.5458888", "0.5443288", "0.5426624",...
0.76301444
0
Sets the no_coupons of this Customer. No coupons
def no_coupons(self, no_coupons): self._no_coupons = no_coupons
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def no_coupons(self):\n return self._no_coupons", "def nic_num_not(self, nic_num_not):\n\n self._nic_num_not = nic_num_not", "def nics_none(self, nics_none):\n\n self._nics_none = nics_none", "def setNoCheckout(self) -> None:\n ...", "def _setbeneficiary_customer_no_option_59(se...
[ "0.6798268", "0.56734955", "0.5639737", "0.56070703", "0.5552857", "0.5457696", "0.543087", "0.5282103", "0.5178031", "0.5104693", "0.50901735", "0.504551", "0.498055", "0.49425092", "0.4910478", "0.4806957", "0.47794423", "0.47633263", "0.47601724", "0.47454318", "0.47357714...
0.8192381
0
Sets the orders of this Customer. Orders associated with this customer profile
def orders(self, orders): self._orders = orders
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def on_orders_replaced(self, orders: List[MetatraderOrder]):\n self._orders = orders", "def setOrder(self, order):\n\t\tself.orderInData = order", "def set_order(self, order):\n self.order = order", "def set_order(self, order):\n self.order = order", "def affected_orders(self, af...
[ "0.6170456", "0.60221905", "0.6002594", "0.6002594", "0.59244764", "0.5896776", "0.5889775", "0.57909524", "0.57447034", "0.57447034", "0.57447034", "0.5681902", "0.5602448", "0.55998385", "0.5557742", "0.5378232", "0.53428847", "0.53143555", "0.53033465", "0.5286973", "0.526...
0.7560337
1
Sets the password of this Customer. Password (may only be set, never read)
def password(self, password): if password is not None and len(password) > 30: raise ValueError("Invalid value for `password`, length must be less than or equal to `30`") self._password = password
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_password(self, password):\n self.password = password", "def set_password(self, password):\n self.PASSWORD = password", "def setpassword(self, pwd):\n pass", "def set_password(self, password):\n self.PASS = password", "def set_password(self, password):\n self.cloud...
[ "0.8232579", "0.8111093", "0.80999184", "0.7986677", "0.794187", "0.7928852", "0.79287934", "0.7916805", "0.79127324", "0.7889815", "0.7847484", "0.78387654", "0.78387654", "0.78387654", "0.78387654", "0.77690464", "0.77282506", "0.77282506", "0.77240914", "0.7717393", "0.770...
0.7228913
36
Gets the qb_class of this Customer. QuickBooks class to import this customer as
def qb_class(self): return self._qb_class
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_query_builder_class(self):\n assert self.query_builder_class is not None, (\n \"'%s' should either include a `query_builder_class` attribute, \"\n \"or override the `get_query_builder_class()` method.\" % self.__class__.__name__\n )\n return self.query_builder_cla...
[ "0.61396956", "0.5806494", "0.57493824", "0.5713907", "0.5713612", "0.5540221", "0.5487067", "0.5426593", "0.5388942", "0.5372061", "0.5346787", "0.533198", "0.5316744", "0.5269363", "0.5269363", "0.51829964", "0.5177156", "0.51753557", "0.51194644", "0.5113043", "0.5076741",...
0.7880745
0
Gets the qb_code of this Customer. QuickBooks name to import this customer as
def qb_code(self): return self._qb_code
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def customer_name(self):\n return self._customer_name", "def get_asx_code(self):\n # Connect to the database and return cursor\n database = DatabaseMySQL()\n\n # Query database.\n sql = \"Select short_name from companies where id =\" + str(self.company_id)\n df = databas...
[ "0.6488982", "0.607789", "0.60215694", "0.57430094", "0.55977136", "0.5554987", "0.5529009", "0.5529009", "0.55076325", "0.54610777", "0.54610777", "0.54303706", "0.54169154", "0.54012626", "0.5359292", "0.535751", "0.535751", "0.5312546", "0.53049797", "0.53049797", "0.53049...
0.71089536
0
Sets the qb_code of this Customer. QuickBooks name to import this customer as
def qb_code(self, qb_code): self._qb_code = qb_code
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qb_code(self):\n return self._qb_code", "def customer_name(self, customer_name):\n self._customer_name = customer_name", "def set_vendor_name(self, vendor_name_prefix):\n global vendor_name\n self.vendor_unique_id = self.random_string_generator(6)\n vendor_name = vendor_n...
[ "0.61895883", "0.5890012", "0.57990825", "0.56052274", "0.55832756", "0.5481956", "0.5417983", "0.54019964", "0.53624874", "0.5277678", "0.52601445", "0.52298826", "0.52298826", "0.52252555", "0.5164064", "0.5092281", "0.5086345", "0.5085653", "0.5085653", "0.50834346", "0.50...
0.7676602
0
Sets the quotes of this Customer. Quotes associated with this customer profile
def quotes(self, quotes): self._quotes = quotes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quotes(self):\n return self._quotes", "def quotes(self):\n return self._quotes", "async def quotes(self, ctx):\n\n\t\tawait self.message_leaderboard(ctx, \"quotes\")", "def set_quotes_properties(self, target_properties = 'nsl1opvkj' ):\n self.cur_quotes_property_str = target_properti...
[ "0.5903956", "0.5903956", "0.58998775", "0.58332413", "0.5320316", "0.51927716", "0.51484543", "0.51184916", "0.49805704", "0.49743798", "0.49639794", "0.49601328", "0.49334046", "0.49334046", "0.48992035", "0.4794737", "0.4780808", "0.4745896", "0.47412536", "0.47398895", "0...
0.77030873
0
Sets the referral_source of this Customer. Referral Source
def referral_source(self, referral_source): if referral_source is not None and len(referral_source) > 50: raise ValueError("Invalid value for `referral_source`, length must be less than or equal to `50`") self._referral_source = referral_source
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def source_contact(self, source_contact):\n \n self._source_contact = source_contact", "def referral_source(self):\n return self._referral_source", "def setAddressSource(self, address_source):\n # type: (str)->None\n\n self._validator.validate_one(\n 'source', VALI...
[ "0.67669284", "0.6725081", "0.61584383", "0.6062122", "0.60146266", "0.5965083", "0.5965083", "0.59629184", "0.5939816", "0.5939816", "0.5939816", "0.5939816", "0.5939816", "0.5939816", "0.5939816", "0.5845459", "0.5810408", "0.5809826", "0.5802448", "0.57876754", "0.5769534"...
0.7728845
0
Gets the shipping of this Customer. Shipping addresses for this customer
def shipping(self): return self._shipping
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shipping_address(self) -> 'outputs.ShippingAddressResponse':\n return pulumi.get(self, \"shipping_address\")", "def shipping_address(self) -> 'outputs.ShippingAddressResponse':\n return pulumi.get(self, \"shipping_address\")", "def shipping_address(self) -> 'outputs.ShippingAddressResponse':\...
[ "0.7763449", "0.7763449", "0.7763449", "0.767562", "0.67779243", "0.6644838", "0.64475065", "0.6420661", "0.6348562", "0.59039724", "0.5735479", "0.5734318", "0.5546499", "0.55390173", "0.54865503", "0.548645", "0.5476888", "0.5474502", "0.54233736", "0.54111916", "0.5390986"...
0.7878591
0
Gets the signup_dts of this Customer. Signup date
def signup_dts(self): return self._signup_dts
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def signup_dts(self, signup_dts):\n\n self._signup_dts = signup_dts", "def getUserSignupDate(self):\r\n userinfo = self.getUserInfo()\r\n timestamp = int(float(userinfo[\"signupTimeSec\"]))\r\n return time.strftime(\"%m/%d/%Y %H:%M\", time.gmtime(timestamp))", "def get_account_creat...
[ "0.65081435", "0.63510865", "0.59054834", "0.5811228", "0.5504573", "0.53848994", "0.5384413", "0.53592855", "0.52790797", "0.52790797", "0.52790797", "0.52769595", "0.52705914", "0.5242916", "0.5242916", "0.5242916", "0.51934034", "0.5191108", "0.51809996", "0.51764023", "0....
0.80204034
0
Gets the suppress_buysafe of this Customer. Suppress buySAFE
def suppress_buysafe(self): return self._suppress_buysafe
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def suppress_buysafe(self, suppress_buysafe):\n\n self._suppress_buysafe = suppress_buysafe", "def suppress(self):\n return Suppress(self)", "def tax_exempt(self):\n return self._tax_exempt", "def getSilence(self):\n return self.__silence", "def suppress(self):\n return s...
[ "0.7212473", "0.59909064", "0.5460177", "0.5459144", "0.5428537", "0.53602356", "0.5354851", "0.5318312", "0.5275436", "0.5254636", "0.52455634", "0.5209804", "0.52009916", "0.51474416", "0.509824", "0.5074139", "0.5060088", "0.5060088", "0.5060088", "0.5019574", "0.501508", ...
0.77869606
0
Gets the tax_exempt of this Customer. True if the customer is tax exempt
def tax_exempt(self): return self._tax_exempt
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tax_exempt(self, tax_exempt):\n\n self._tax_exempt = tax_exempt", "def tax_included(self):\n return self._tax_included", "def is_exempt(self) -> bool:\n\n if self.exempt_when:\n return self.exempt_when()\n return False", "def is_taxable(self) -> bool:\n retur...
[ "0.6794746", "0.66627544", "0.63433504", "0.6306556", "0.6255803", "0.5895082", "0.58804166", "0.5858941", "0.5854297", "0.5771094", "0.5757708", "0.5583154", "0.5568775", "0.5542933", "0.5397456", "0.53434366", "0.5254393", "0.52244526", "0.5212916", "0.52091277", "0.5167711...
0.8298218
0
Sets the tax_exempt of this Customer. True if the customer is tax exempt
def tax_exempt(self, tax_exempt): self._tax_exempt = tax_exempt
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tax_exempt(self):\n return self._tax_exempt", "def tax_included(self, tax_included):\n\n self._tax_included = tax_included", "def tax_override(self, tax_override):\n\n self._tax_override = tax_override", "def tax_amount(self, tax_amount):\n\n self._tax_amount = tax_amount", ...
[ "0.74209034", "0.595756", "0.59306157", "0.592274", "0.592274", "0.57438374", "0.56471366", "0.5608581", "0.5532864", "0.5427848", "0.5369421", "0.53670645", "0.5366274", "0.53470767", "0.5332247", "0.532157", "0.51891", "0.5170744", "0.51624745", "0.5158186", "0.51524717", ...
0.8613695
0
Sets the tax_id of this Customer. Tax ID
def tax_id(self, tax_id): if tax_id is not None and len(tax_id) > 15: raise ValueError("Invalid value for `tax_id`, length must be less than or equal to `15`") self._tax_id = tax_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tax_id(self, tax_id):\n\n self._tax_id = tax_id", "def tax_id(self, tax_id: str):\n\n self._tax_id = tax_id", "def set_tax_id_value(self, tax_id_value):\n self.tax_id_value = tax_id_value", "def set_tax_id_label(self, tax_id_label):\n self.tax_id_label = tax_id_label", "def ...
[ "0.87590045", "0.8662352", "0.80013734", "0.74551654", "0.7168562", "0.7168562", "0.70510966", "0.7036523", "0.69102764", "0.6771935", "0.63606834", "0.63157976", "0.6217136", "0.62159896", "0.617953", "0.6139053", "0.6138699", "0.6069116", "0.6018205", "0.59747994", "0.59716...
0.78828615
3
Gets the track_separately of this Customer. True if the customer should be tracked separately in QuickBooks
def track_separately(self): return self._track_separately
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_track(self):\n for account in self.accounts:\n if not account.on_track:\n return False\n return True", "def on_track(self):\n for account in self.accounts.all():\n if not account.on_track:\n return False\n return True", "def...
[ "0.5785258", "0.57484245", "0.5503403", "0.54018587", "0.53501976", "0.5269997", "0.5265373", "0.5162521", "0.51327646", "0.5125616", "0.5111509", "0.49465573", "0.49465573", "0.49436694", "0.49197856", "0.49194705", "0.4916178", "0.49089986", "0.4897925", "0.48731837", "0.48...
0.7027527
0
Gets the unapproved of this Customer. Unapproved
def unapproved(self): return self._unapproved
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_unapproved(self, guild_id, user):\n doc = await self.db[str(guild_id)].find_one({'id': user.id})\n if doc is None or len(doc['unapproved']) == 0:\n return -1\n else:\n return doc['unapproved']", "def unapproved(self, unapproved):\n\n self._unapprove...
[ "0.68862796", "0.6682904", "0.6192706", "0.55028456", "0.5488881", "0.5446353", "0.53884095", "0.53799593", "0.53354764", "0.53019124", "0.5245403", "0.51704144", "0.51652676", "0.5092612", "0.50110024", "0.50084156", "0.50083715", "0.50002396", "0.4994726", "0.49889553", "0....
0.82201564
0
Sets the unapproved of this Customer. Unapproved
def unapproved(self, unapproved): self._unapproved = unapproved
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unapproved(self):\n return self._unapproved", "def set_unauthorized_mode(unauthorized):\n BonsaiWS._UNAUTHORIZED = unauthorized", "def unequal_paid(self, unequal_paid):\n allowed_values = [\"Allow\", \"Disallow\", \"AdminReview\"]\n if unequal_paid.lower() not in map(str.lower, allo...
[ "0.6685284", "0.58883953", "0.57462066", "0.566149", "0.566149", "0.562006", "0.550862", "0.5459612", "0.5207823", "0.51709485", "0.5163259", "0.50850445", "0.505899", "0.505744", "0.5033902", "0.50197905", "0.49518418", "0.49372715", "0.49184358", "0.49184358", "0.49184358",...
0.8636987
0
Gets the ups_account_number of this Customer. UPS account number
def ups_account_number(self): return self._ups_account_number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account_number(self):\n return self.__account_number", "def account_id(self) -> pulumi.Output[int]:\n return pulumi.get(self, \"account_id\")", "def fedex_account_number(self):\n return self._fedex_account_number", "def dhl_account_number(self):\n return self._dhl_account_numb...
[ "0.72434944", "0.63800204", "0.63280016", "0.62756574", "0.6243746", "0.6039854", "0.6039854", "0.6039854", "0.6039854", "0.6039854", "0.6039854", "0.6039854", "0.6039854", "0.6014761", "0.6014761", "0.6014761", "0.5931466", "0.5894432", "0.58716", "0.58716", "0.58613265", ...
0.87114334
0
Gets the website_url of this Customer. Website url
def website_url(self): return self._website_url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_website_url(self):\n if self.website:\n return self.website.get_absolute_url()\n elif self.external_url:\n return self.external_url.url\n elif self.parent:\n # try\n return self.parent.get_website_url()\n else: # except\n ...
[ "0.7666433", "0.7439449", "0.7200491", "0.709269", "0.709269", "0.7063683", "0.6974808", "0.6974808", "0.6973805", "0.6973805", "0.6923577", "0.6919077", "0.6878103", "0.68396145", "0.6757848", "0.67456084", "0.6742248", "0.67288554", "0.6726163", "0.67114943", "0.6692765", ...
0.82670254
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, Customer): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.8457179", "0.8393067", "0.81457263", "0.8140635", "0.8133462", "0.8094992", "0.8093376", "0.8093376", "0.8093376", "0.80863357", "0.80863357", "0.8077303", "0.8077303", "0.8066831" ]
0.0
-1
In the constructor we instantiate two nn.Linear modules and assign them as member variables.
def __init__(self, in_features): super(AddBias, self).__init__() self.in_features =in_features self.bias = Parameter(torch.Tensor(in_features))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args):\n super(LinearND, self).__init__()\n self.fc = nn.Linear(*args)", "def __init__(self, linear_args, activation_functions, softmax=False):\n super(NN, self).__init__()\n assert len(activation_functions) == len(linear_args) - 1\n k = len(linear_args)\n ...
[ "0.7740845", "0.75491226", "0.7507384", "0.74351764", "0.7366187", "0.7335458", "0.7315035", "0.72868973", "0.7273689", "0.72728837", "0.72728837", "0.72682863", "0.7243211", "0.7221085", "0.7202836", "0.7167876", "0.71118164", "0.70775396", "0.7065539", "0.7063421", "0.70532...
0.0
-1
Override save to set the expire_date field.
def save(self, *args, **kwargs): self.expire_date = self.sent_date + timedelta(days=self.period) super(Referral, self).save(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expire_date(self, expire_date):\n\n self._expire_date = expire_date", "def save(self, *args, **kwargs):\n self.modify_ts = datetime.now()\n super(ModelBase, self).save(*args, **kwargs)", "def expire(self, expire):\n\n self._expire = expire", "def save(self, *args, **kwargs):\n...
[ "0.72531503", "0.6751157", "0.6709668", "0.67068225", "0.66698235", "0.6593257", "0.6593257", "0.6570706", "0.65098894", "0.64543635", "0.64344317", "0.64227086", "0.6394009", "0.6288463", "0.6288463", "0.62290776", "0.62290776", "0.62101007", "0.616072", "0.616072", "0.61278...
0.7848873
0
p, n = planeFit(points) Given an array, points, of shape (d,...) representing points in ddimensional space, fit an ddimensional plane to the points. Return a point, p, on the plane (the pointcloud centroid), and the normal, n.
def plane_fit(points): points = np.reshape(points, (np.shape(points)[0], -1)) # Collapse trialing dimensions assert points.shape[0] <= points.shape[1], "There are only {} points in {} dimensions.".format(points.shape[1], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def planeFit(points):\n import numpy as np\n from numpy.linalg import svd\n points = np.reshape(points, (np.shape(points)[0], -1)) # Collapse trialing dimensions\n assert points.shape[0] <= points.shape[1], \"There are only {} points in {} dimensions.\".format(points.shape[1], points.shape[0])\n ctr...
[ "0.74842775", "0.7459086", "0.7351473", "0.7334644", "0.71488965", "0.69940245", "0.67285067", "0.67285067", "0.65457124", "0.6474771", "0.6442741", "0.6409273", "0.63591313", "0.6330643", "0.626703", "0.626703", "0.626103", "0.6156615", "0.61215425", "0.6113213", "0.6098571"...
0.74275154
2
Return current syringe position in ml.
async def get_current_volume(self) -> pint.Quantity: syringe_pos = await self.send_command_and_read_reply( Protocol1Command(command="YQP") ) current_steps = (int(syringe_pos) - self._offset_steps) * ureg.step return current_steps / self._steps_per_ml
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_stig_xy(self):\n raise NotImplementedError", "def getPos(self):\n return self.__current_pos", "def getLinescanPos(self):\n return self.handle.pos().toPoint()", "def getLPos(self):\n c = 0\n while c <= ALIENS_IN_ROW-1:\n i = 0\n for a in range(A...
[ "0.6802213", "0.6498631", "0.6412411", "0.640127", "0.63590926", "0.62950504", "0.6248771", "0.62295616", "0.6217019", "0.6196817", "0.6167762", "0.61197615", "0.611496", "0.61082417", "0.60912526", "0.6080588", "0.6080588", "0.60716474", "0.6068857", "0.60621226", "0.6046875...
0.0
-1
Return the current firmware version reported by the pump.
async def version(self) -> str: return await self.send_command_and_read_reply(Protocol1Command(command="U"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def firmware_version(self):\n return self._get_system_status()[\"firmware\"]", "def firmware_version(self):\n return self.data.get('fw_ver')", "def firmware_version(self):\n return self._read(MX_FIRMWARE_VERSION)", "def firmware_version(self) -> str:\n return self._firmware_version", ...
[ "0.85099614", "0.8340618", "0.8138581", "0.7956162", "0.7860083", "0.78461266", "0.7817271", "0.77458894", "0.7622092", "0.7555154", "0.7525543", "0.7479105", "0.74680084", "0.74258685", "0.7408459", "0.7353371", "0.73360205", "0.7335943", "0.7322615", "0.730427", "0.7304198"...
0.0
-1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, BaseCommitAllOfSummary): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Tests getting a missing study.
def test_get_study_missing(self): self.assertIsNone(self.storage.get_study('missing'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_study_missing(self):\n study_spec = sample_study_spec()\n with self.assertRaises(ValueError):\n self.storage.update_study(study_spec)", "def test_returns_all_studies_with_no_query(self):\n url = self.get_url()\n response = self.client.get(url)\n pks = get_autocompl...
[ "0.71964467", "0.68617964", "0.68617964", "0.68524545", "0.67670447", "0.6757489", "0.6757489", "0.6757489", "0.6757489", "0.6753798", "0.67430204", "0.66788816", "0.6668998", "0.6668998", "0.6660492", "0.66139245", "0.6612867", "0.66102505", "0.6548558", "0.6548558", "0.6522...
0.81518245
0
Tests updating the state of a study.
def test_update_study_state(self): study_spec = sample_study_spec() study_id = self.storage.create_study(study_spec) self.assertEqual(study_pb2.StudySpec.STATE_ENABLED, study_spec.state) # Update the state. self.storage.update_study_state(study_id, study_pb2.Stud...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_study(self):\n study_spec = sample_study_spec()\n study_id = self.storage.create_study(study_spec)\n self.assertEqual(study_pb2.StudySpec.STATE_ENABLED, study_spec.state)\n self.assertEqual('test', study_spec.name)\n creation_time = study_spec.creation_time.ToDatetime()\n\n study_...
[ "0.78230596", "0.7498204", "0.7435541", "0.7234746", "0.71625173", "0.70140386", "0.681868", "0.66858053", "0.662168", "0.6595936", "0.6593869", "0.6506648", "0.6506648", "0.6506648", "0.6370141", "0.6320166", "0.6292186", "0.6292186", "0.6262718", "0.6188326", "0.61799145", ...
0.7922583
0
Tests updating the state of a missing study.
def test_update_study_state_missing(self): with self.assertRaises(ValueError): self.storage.update_study_state('missing', study_pb2.StudySpec.STATE_ENABLED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_study_missing(self):\n study_spec = sample_study_spec()\n with self.assertRaises(ValueError):\n self.storage.update_study(study_spec)", "def test_update_study_state(self):\n study_spec = sample_study_spec()\n study_id = self.storage.create_study(study_spec)\n self.assertEqual(...
[ "0.7876338", "0.756133", "0.74866223", "0.68596566", "0.67913425", "0.6691316", "0.66512007", "0.66417116", "0.6551547", "0.6285016", "0.6227183", "0.618581", "0.6152985", "0.6152985", "0.61153185", "0.610636", "0.6090624", "0.6064854", "0.60633194", "0.60519874", "0.59716755...
0.8176927
0
Tests updating a missing study.
def test_update_study_missing(self): study_spec = sample_study_spec() with self.assertRaises(ValueError): self.storage.update_study(study_spec)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_study(self):\n study_spec = sample_study_spec()\n study_id = self.storage.create_study(study_spec)\n self.assertEqual(study_pb2.StudySpec.STATE_ENABLED, study_spec.state)\n self.assertEqual('test', study_spec.name)\n creation_time = study_spec.creation_time.ToDatetime()\n\n study_...
[ "0.7637461", "0.7224611", "0.6900326", "0.6744525", "0.6623599", "0.6599874", "0.64857274", "0.6452709", "0.6452709", "0.6424584", "0.6424584", "0.6424584", "0.6419779", "0.638175", "0.6346849", "0.6325708", "0.6312447", "0.625581", "0.62455684", "0.6214897", "0.6214801", "...
0.8167678
0
Tests creating an episode with missing fields.
def test_create_episode_missing_field(self, field_name): study_id, session_id = self.init_session() episode = sample_episode(study_id=study_id, session_id=session_id) episode.ClearField(field_name) with self.assertRaises(ValueError): self.storage.create_episode(episode)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_existing_episode(self):\n episode = self._create_sample_episode()\n with self.assertRaises(ValueError, msg='Episode already exists.'):\n self.storage.create_episode(episode)", "def test_create_episode_missing_study(self):\n _, session_id = self.init_session()\n episode = sample_e...
[ "0.7780633", "0.75854033", "0.7560356", "0.7390913", "0.68898857", "0.682119", "0.6709671", "0.66966206", "0.6624257", "0.6579809", "0.6525769", "0.64436567", "0.6408738", "0.63982606", "0.639607", "0.6393368", "0.6376112", "0.6350394", "0.63224113", "0.63161665", "0.629348",...
0.73737454
4
Tests creating an episode for a missing session.
def test_create_episode_missing_session(self): study_id = self.storage.create_study(sample_study_spec()) episode = sample_episode(study_id=study_id, session_id='missing') with self.assertRaises(ValueError): self.storage.create_episode(episode)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_episode_missing_study(self):\n _, session_id = self.init_session()\n episode = sample_episode(study_id='missing', session_id=session_id)\n with self.assertRaises(ValueError):\n self.storage.create_episode(episode)", "def test_create_existing_episode(self):\n episode = self._creat...
[ "0.81493276", "0.76721245", "0.75123125", "0.7170817", "0.68798655", "0.68144184", "0.6751232", "0.6561961", "0.65390486", "0.65072423", "0.6253223", "0.6202442", "0.61001486", "0.6073128", "0.6072587", "0.5989172", "0.59625196", "0.5948455", "0.59400785", "0.59313756", "0.59...
0.85375804
0
Tests creating an episode for a missing study.
def test_create_episode_missing_study(self): _, session_id = self.init_session() episode = sample_episode(study_id='missing', session_id=session_id) with self.assertRaises(ValueError): self.storage.create_episode(episode)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_episode_missing_session(self):\n study_id = self.storage.create_study(sample_study_spec())\n episode = sample_episode(study_id=study_id, session_id='missing')\n with self.assertRaises(ValueError):\n self.storage.create_episode(episode)", "def test_create_existing_episode(self):\n ...
[ "0.8137882", "0.78032833", "0.75689256", "0.6792931", "0.67500323", "0.6686436", "0.66267246", "0.6594826", "0.6574101", "0.65016884", "0.64614993", "0.645196", "0.640829", "0.6402761", "0.63559407", "0.6352517", "0.6350069", "0.6259453", "0.6259453", "0.6259453", "0.6259453"...
0.8455071
0
Tests atomic update of an episode without any changes.
def test_atomic_update_episode_no_update(self): episode = self._create_sample_episode() study_id, session_id, episode_id = (episode.study_id, episode.session_id, episode.id) def callback(read_episode): # Make a change but return false. read_episode.num_st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_atomic_update_episode(self):\n episode = self._create_sample_episode()\n study_id, session_id, episode_id = (episode.study_id, episode.session_id,\n episode.id)\n\n def callback(read_episode):\n # Read episode should match the stored one.\n self.as...
[ "0.84660435", "0.7890779", "0.71040875", "0.6888165", "0.6645462", "0.664114", "0.664114", "0.664114", "0.65186656", "0.6496286", "0.6428055", "0.64232314", "0.6407289", "0.63487357", "0.6339075", "0.63161963", "0.624167", "0.62241834", "0.61784154", "0.61751306", "0.6154144"...
0.89119446
0
Tests atomic update of a missing episode.
def test_atomic_update_missing_episode(self): def callback(unused_episode): # Callback should not be called. assert False self.assertFalse( self.storage.atomic_update_episode('study', 'session', 'missing', callback))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_atomic_update_episode_no_update(self):\n episode = self._create_sample_episode()\n study_id, session_id, episode_id = (episode.study_id, episode.session_id,\n episode.id)\n\n def callback(read_episode):\n # Make a change but return false.\n read_ep...
[ "0.8667964", "0.7754999", "0.693362", "0.65994745", "0.6509191", "0.64592224", "0.64587677", "0.64382136", "0.63946396", "0.62582344", "0.6234301", "0.622272", "0.6222256", "0.61955893", "0.61854947", "0.6182698", "0.61460924", "0.61211073", "0.60616493", "0.6056387", "0.6053...
0.85606474
1
Returns the default collector settings
def get_default_config(self): config = super(DiskSpaceCollector, self).get_default_config() config.update({ 'path': 'diskspace', # filesystems to examine 'filesystems': 'ext2, ext3, ext4, xfs, glusterfs, nfs, nfs4, ' + ' ntfs, hfs, fat32, fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_default_config(self):\r\n config = super(CMDCollector, self).get_default_config()\r\n config.update({\r\n 'enabled': 'True',\r\n 'fs': ',',\r\n 'timeout': 300,\r\n })\r\n return config", "def getDefaultSettings():\n return {}", "def ge...
[ "0.70514023", "0.7008024", "0.69490683", "0.6713433", "0.65743333", "0.65309024", "0.6521635", "0.6466526", "0.6447688", "0.641337", "0.6397818", "0.6380512", "0.63683224", "0.6357208", "0.63517016", "0.6331759", "0.63120294", "0.62353724", "0.6231899", "0.62074906", "0.62016...
0.6515402
7
Take file path as string; return text as string. Takes a string that is a file path, opens the file, and turns the file's contents as one string of text.
def open_and_read_file(file_path1, file_path2): # your code goes here file_object1 = open(file_path1) file_object2 = open(file_path2) contents = file_object1.read() + " " + file_object2.read() file_object1.close() file_object2.close() return contents
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_and_read_file(file_path):\n\n # your code goes here\n text_file = open(file_path)\n text_string= text_file.read()\n text_file.close()\n return text_string", "def open_and_read_file(file_path):\n\n text_file = open(file_path)\n full_text = text_file.read()\n\n return full_text", ...
[ "0.80701673", "0.8048426", "0.80146885", "0.79927737", "0.7922294", "0.7866254", "0.7800041", "0.76798844", "0.7659898", "0.7614667", "0.7608646", "0.7570947", "0.75405455", "0.7529626", "0.75042224", "0.75037545", "0.74999714", "0.7412953", "0.7371709", "0.73616654", "0.7330...
0.0
-1
Find part in control and add to end of its list of parts. Update the control with the new parts otherwise error.
def _add_to_parts(self, control: cat.Control, id_: str, new_parts: List[common.Part]) -> None: for part in control.parts: if self._add_to_part(part, id_, new_parts): return True raise TrestleError(f'Unable to add parts for control {control.id} and part {id_}')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_parts(self, parts):\r\n self.board.insert_parts(parts)\r\n self.set_changed(parts)", "def add_part(self, part: dict, part_index: int) -> bool:\n\n if 'var' in part and self.pdf:\n part['text'] = str(self.pdf.context.get(part['var'], ''))\n\n words = part.get('tex...
[ "0.62499577", "0.59578145", "0.58590984", "0.5846495", "0.5685902", "0.55897236", "0.55784607", "0.5573609", "0.5350638", "0.53003", "0.5275361", "0.5239615", "0.5175999", "0.51183426", "0.5102686", "0.5068479", "0.5031264", "0.49884614", "0.4970463", "0.4953555", "0.49500462...
0.7302594
0
Find application's Info.plist and read it
def _get_app_info(self): info_plist = None for data in self.filelist: if re.match(self.info_plist_regex, data.filename): info_plist = data if not info_plist: self._raise_ipa_error() info_plist = self.read(info_plist) self.app_info = read...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_appdata():\n try:\n with FNAME.open() as _in:\n appdata = json.load(_in)\n except FileNotFoundError:\n return None\n return appdata", "def _fetch_app_info(app_id):\n try:\n assert len(app_id), \"Empty string\"\n lookup_url = \"https://itunes...
[ "0.67179626", "0.61157334", "0.6103222", "0.6021488", "0.59885883", "0.58451647", "0.5811156", "0.5763978", "0.5756686", "0.57552415", "0.5709742", "0.5630683", "0.56235945", "0.560948", "0.55377525", "0.54912055", "0.54805106", "0.54598397", "0.54539883", "0.5452242", "0.543...
0.7715055
0
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): import itertools if normalize: cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis] print("Normalized confusion m...
{ "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.81920755", "0.8093736", "0.8028212", "0.8017333", "0.79923165", "0.7989431", "0.79789335", "0.7974398", "0.795948", "0.79555666", "0.7935652", "0.7932704", "0.7932632", "0.7929465", "0.7924336", "0.7922666", "0.79221356", "0.7921299", "0.79209703", "0.7920307", "0.7916008"...
0.0
-1
Initializes a serialized data timestamp table.
def __init__(self, zip_file, stream_name): super(_SerializedDataTimestampTable, self).__init__() self._stream_name = stream_name self._timestamps = [] self._zip_file = zip_file
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args):\n _snap.TTable_swiginit(self, _snap.new_TTable(*args))", "def _init_table(self, table: \"Table\"):\n if not self.columns:\n self.columns = table.columns\n self._data = table.data", "def __init__(self, zip_file, stream_name):\n super(_SerializedDataO...
[ "0.66112685", "0.6446181", "0.63456225", "0.6272627", "0.6269339", "0.6222892", "0.62099767", "0.6158057", "0.6113965", "0.60865355", "0.6086482", "0.6065679", "0.6065679", "0.6065679", "0.6065679", "0.6065679", "0.6065679", "0.6065679", "0.6065679", "0.6065679", "0.6065679",...
0.72924495
0
Retrieves a specific timestamp.
def GetTimestamp(self, entry_index): return self._timestamps[entry_index]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_timestamp(self):\r\n return self.__public_request('GET', '/api/v1/timestamp')", "def getTimestamp(self, key, time):\n return self.get(\"timestamp\", key, time)", "def get_one(self, timestamp):\n return self._connection.get(self._dbname + '/' + timestamp).json()", "def get_times...
[ "0.7596311", "0.7222062", "0.6904715", "0.6886559", "0.6774648", "0.67623913", "0.6716956", "0.6696896", "0.6628128", "0.6593423", "0.6579199", "0.6577597", "0.65765285", "0.65704864", "0.646979", "0.6456953", "0.6449899", "0.6442099", "0.63960296", "0.63704973", "0.63336766"...
0.68944854
3
Retrieves a value from the config parser.
def _GetConfigValue(self, config_parser, section_name, value_name): try: return config_parser.get(section_name, value_name).decode('utf-8') except (configparser.NoOptionError, configparser.NoSectionError): return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _GetConfigValue(self, config_parser, section_name, value_name):\n try:\n return config_parser.get(section_name, value_name).decode('utf-8')\n except configparser.NoOptionError:\n return", "def get_config_value(self, name):\r\n if name in self.config_values:\r\n return self.c...
[ "0.7828994", "0.72632587", "0.72562516", "0.7231387", "0.7180348", "0.7152527", "0.7135673", "0.70670396", "0.6819385", "0.68079066", "0.6805623", "0.6791728", "0.6755313", "0.6745314", "0.6717178", "0.67007136", "0.6682381", "0.66780645", "0.66668546", "0.6644024", "0.663696...
0.7771524
1
Retrieves a specific attribute container.
def _GetAttributeContainerByIndex(self, container_type, index): last_stream_number = self._last_stream_numbers[container_type] stream_number = 1 while stream_number < last_stream_number: if stream_number <= len(self._event_sources_in_stream): number_of_entries = self._event_sources_in_stream[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetAttributeContainerByIdentifier(self, container_type, identifier):\n return self._storage_file.GetAttributeContainerByIdentifier(\n container_type, identifier)", "def _GetAttributeContainer(\n self, container_type, stream_number, entry_index=NEXT_AVAILABLE_ENTRY):\n serialized_data, entry...
[ "0.7201345", "0.69232327", "0.6458138", "0.63092786", "0.63070136", "0.62809426", "0.6199895", "0.6087409", "0.6054785", "0.6012052", "0.5990689", "0.5985078", "0.5973306", "0.5963387", "0.59299284", "0.59262854", "0.59101933", "0.58990765", "0.589869", "0.58899254", "0.58855...
0.56452686
45
Returns a cardinal direction (``'NORTH'``, ``'WEST'``, ``'SOUTH'``, and ``'EAST'``) that corresponds to a cartesian point `pt1 (tuple), pointing TOWARDS a second point `pt2`
def get_direction(pt1, pt2): dx, dy = pt2[0]-pt1[0], pt2[1]-pt1[1] if abs(dx)<=TOL and dy>0: return "NORTH" elif abs(dy)<=TOL and dx<0: return "WEST" elif abs(dx)<=TOL and dy<0: return "SOUTH" else: return "EAST"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_direction(self, c1, c2):\n \n if c2[0] == c1[0]+1: return NORTH\n elif c2[1] == c1[1]+1: return EAST\n elif c2[0] == c1[0]-1: return SOUTH\n elif c2[1] == c1[1]-1: return WEST\n\n raise ValueError", "def direction(point0, point1):\n d = [0, 0, 0]\n vect...
[ "0.67694086", "0.6562339", "0.6437842", "0.6371046", "0.63692033", "0.6339243", "0.610926", "0.60857844", "0.6046521", "0.6014199", "0.5969566", "0.59546286", "0.5938745", "0.5931146", "0.5860227", "0.583957", "0.58263224", "0.58075404", "0.57712764", "0.5770579", "0.576815",...
0.76247746
0
Returns the opposite of `direction`, where each direction is either ``'NORTH'``, ``'WEST'``, ``'SOUTH'``, or ``'EAST'``
def flip_direction(direction): if direction=="NORTH": return "SOUTH" if direction=="SOUTH": return "NORTH" if direction=="WEST": return "EAST" if direction=="EAST": return "WEST" elif isinstance(direction, float): return (direction + np.pi)%(2*np.pi)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def opposite(self):\n if self == self.EAST:\n return self.WEST\n elif self == self.WEST:\n return self.EAST\n elif self == self.NORTH:\n return self.SOUTH\n elif self == self.SOUTH:\n return self.NORTH", "def opposite(self):\n if self...
[ "0.74402463", "0.7385512", "0.7021604", "0.6977132", "0.6633077", "0.63618517", "0.6056636", "0.5993679", "0.5988896", "0.5988611", "0.5957516", "0.59094435", "0.5907862", "0.5899518", "0.5866495", "0.58596176", "0.58256704", "0.5760609", "0.57241213", "0.57189405", "0.567944...
0.71970755
2
Returns the point (tuple) corresponding to `pt` translated by distance `length` in direction `direction` where each direction is either ``'NORTH'``, ``'WEST'``, ``'SOUTH'``, or ``'EAST'``
def translate_point(pt, length, direction): if isinstance(direction,float): # direction is a float (in radians) return (pt[0]+length*np.cos(direction), pt[1]+length*np.sin(direction)) elif str(direction)=="NORTH": return (pt[0], pt[1]+length) elif str(direction)=="SOUTH": ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def point (p, direction: str):\n def wrap (magnitude: int):\n change = changes [direction]\n return (\n p [0] + (change [0] * magnitude),\n p [1] + (change [1] * magnitude),\n )\n return wrap", "def point(pt, angle, dist):\n x, y = pt\n return dist * cos(ang...
[ "0.61325675", "0.5985042", "0.57694566", "0.56129307", "0.55129373", "0.5511356", "0.5483419", "0.5347633", "0.5319454", "0.52783155", "0.526859", "0.5253147", "0.52256113", "0.52186066", "0.5215894", "0.5181785", "0.5146408", "0.5129545", "0.5102451", "0.5100147", "0.5081336...
0.8260877
0
Initilize duration predictor module.
def __init__(self, idim, n_layers=2, n_chans=384, kernel_size=3, dropout_rate=0.1, offset=1.0, padding="SAME", dur_loss="mse"): super(DurationPredictor, self).__init__() self.offset = offset self.conv = torch.nn.ModuleList() self.kernel_size = kernel_size self.padding = padding ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n super().__init__()\n self.dynamic = True # from base class, indicates time-dependence is handled internally\n self.numBins = None # integer number of bins to use in creating the duration curve. TODO default?\n self.targets = None # list of strings, variables to apply postprocessor...
[ "0.69986475", "0.61163104", "0.60729116", "0.6063754", "0.6039804", "0.6020458", "0.60147893", "0.5951327", "0.5939011", "0.5933372", "0.5922974", "0.59147674", "0.59132683", "0.59078056", "0.58097047", "0.58097047", "0.57952625", "0.57948214", "0.57569635", "0.57538295", "0....
0.59932846
8
shortcut for pipeline to Prep, Tokenize, and get Word Vectors for a single column of text
def PrepAndVectorize(d, wvec_path = WVEC_PATH__): return(Pipeline([ ('prep', TwitterPrep()), ('tknzr', TokenizeTransformer(word_tokenize, rejoin_angle=True)), ('wordvec', WordvecTransformer(topdir=wvec_path+'/'+str(d)+'d', d=d)) ]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_text(self):\n prp1 = preprocessor.Preprocess()\n processed_text = prp1.clean_data(self.text)\n self.vec1 = self.vec.transform(pd.Series(processed_text))", "def vectorize_text(corpus):\n bag_of_words_model = CountVectorizer()\n\n # performs the above described three tasks on...
[ "0.6909709", "0.65117645", "0.63968825", "0.6382087", "0.63247985", "0.6266119", "0.6254178", "0.61925185", "0.6192102", "0.6191083", "0.6181551", "0.61075115", "0.60965115", "0.6076338", "0.60326713", "0.60187006", "0.5990371", "0.598479", "0.5983527", "0.59766054", "0.59602...
0.60152495
16
Computes the euclidean distance between two points.
def euclidean_distance(a: Tuple[float, ...], b: Tuple[float, ...]) -> float: assert len(a) == len(b) return sqrt(sum(pow(x[0] - x[1], 2) for x in zip(a, b)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def euclidean_distance(point1, point2):\n\n return math.sqrt(sum([(x - y) ** 2 for x, y in zip(point1, point2)]))", "def euclidean_distance(point_one, point_two):\n return np.linalg.norm(point_one-point_two)", "def euclidean_distance(point1, point2):\n return np.linalg.norm(np.array(point1) - np.array...
[ "0.861983", "0.8555233", "0.85458523", "0.85220337", "0.8513014", "0.8377946", "0.8369024", "0.83560175", "0.8286742", "0.8283353", "0.82787377", "0.8255781", "0.8241966", "0.8237065", "0.81821513", "0.80594367", "0.8045384", "0.8037021", "0.80301577", "0.80163467", "0.800762...
0.7754808
35
Initializes a new instance of the TokenizedMarkdown class.
def __init__(self, resource_path=None): ( self.tokenized_document, self.stack, self.source_provider, self.__parse_properties, ) = (None, None, None, None) if not resource_path: resource_path = os.path.join(os.path.split(__file__)[0], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_markdown(self):\n renderer = MyRenderer()\n md = mistune.Markdown(renderer=renderer)\n md.render(self._markdown_text)\n self._bash_commands = renderer._bash_commands", "def __init__(\n self, text: str = \"\", path: Optional[pathlib.Path] = None, **kwargs,\n ):\n ...
[ "0.69312423", "0.67770624", "0.67398816", "0.6627868", "0.66079646", "0.6607169", "0.6452785", "0.6346775", "0.62703085", "0.6140011", "0.6094223", "0.6062648", "0.60566396", "0.6042024", "0.6013433", "0.6013433", "0.6013433", "0.5973729", "0.58815753", "0.5855892", "0.579477...
0.5813889
20
Returns whether front matter parsing is enabled.
def is_front_matter_enabled(self): return self.__front_matter_enabled
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_preprocessing(self):\r\n return conf.lib.clang_isPreprocessing(self)", "def is_comprehensive_theming_enabled():\n ENABLE_COMPREHENSIVE_THEMING = SettingToggle(\"ENABLE_COMPREHENSIVE_THEMING\", default=False)\n\n if ENABLE_COMPREHENSIVE_THEMING.is_enabled() and current_request_has_associated_s...
[ "0.62514204", "0.5768051", "0.57448626", "0.5679302", "0.55469245", "0.5536452", "0.552237", "0.55181825", "0.5471888", "0.54673195", "0.546557", "0.54616", "0.5419903", "0.5361117", "0.53372157", "0.5282104", "0.5276461", "0.5269326", "0.52571386", "0.5195801", "0.5194547", ...
0.80138654
0
Returns whether pragma parsing is enabled.
def is_pragmas_enabled(self): return self.__pragmas_enabled
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pragma(self):\n initial_pos = self.pos\n try:\n self.match_value(Identifier, \"pragma\")\n expr = self.tokens[self.pos:]\n self.pos = len(self.tokens)\n\n return PragmaNode(expr)\n except ParseError:\n self.pos = initial_pos\n ...
[ "0.5830434", "0.54803693", "0.53693527", "0.5305556", "0.51940244", "0.51645476", "0.50622195", "0.5047295", "0.5031789", "0.5024937", "0.49353558", "0.4871321", "0.48240516", "0.4808786", "0.47958007", "0.4747869", "0.47380838", "0.47360966", "0.47341162", "0.47271025", "0.4...
0.6409369
0
updates the sprite to match the camera position
def update(self, dt): x, y = self.pos cx, cy = self.camera.pos tx, ty = self.camera.target self.sprite.x = ((x-tx) * self.camera.zoom) + (cx * self.dist)+ (tx) self.sprite.y = ((y-ty) * self.camera.zoom) + (cy * self.dist)+ (ty) self.sprite.scale = self.camera.zoom * self.radius
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self):\n self.moving_sprites.update() \n self.static_sprites.update()\n self.camera.update(self.player)", "def update(self):\n self.syncSpriteCoordinates()\n self.moveBasedOnCurrentMomentum()\n #self.decelerate()\n self.checkCanvasBoundsAndWrap()", "d...
[ "0.77708364", "0.7135605", "0.6989129", "0.6885165", "0.6780152", "0.67463005", "0.67295384", "0.6697945", "0.6697789", "0.667911", "0.6638797", "0.6618048", "0.66064084", "0.65962285", "0.6586995", "0.656958", "0.6563384", "0.6524323", "0.65242493", "0.65108246", "0.650665",...
0.76551634
1
Get the coordinates of the cell that pt = (x,y) falls in.
def get_cell_coords(self, pt): return int(pt[0] // self.a), int(pt[1] // self.a)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cell_coords(pt):\n\n return int(pt[0] // a), int(pt[1] // a)", "def get_xy(self, x, y):\r\n\t\treturn self.grid[y, x]", "def cell_index(self, coord):\n\n for x in range(len(self.cell_x)):\n if coord[0] >= self.cell_x[x] and coord[0] <= self.cell_x[x] + self.cell_size:\n ...
[ "0.8011303", "0.7618935", "0.75055915", "0.7366091", "0.7238822", "0.71133727", "0.7108227", "0.6990128", "0.6972853", "0.69670075", "0.69417137", "0.68902224", "0.6863175", "0.68588525", "0.68542373", "0.6847495", "0.68400073", "0.68253475", "0.6804576", "0.6797296", "0.6751...
0.82759666
0
Convert (list of )+ tokens to a padded LongTensor.
def get_long_tensor(tokens_list, batch_size, pad_id=constant.PAD_ID): sizes = [] x = tokens_list while isinstance(x[0], list): sizes.append(max(len(y) for y in x)) x = [z for y in x for z in y] tokens = torch.LongTensor(batch_size, *sizes).fill_(pad_id) for i, s in enumerate(tokens_l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_long_tensor(tokens_list, batch_size, pad_id=PAD_ID):\r\n sizes = []\r\n x = tokens_list\r\n while isinstance(x[0], list):\r\n sizes.append(max(len(y) for y in x))\r\n x = [z for y in x for z in y]\r\n tokens = torch.LongTensor(batch_size, *sizes).fill_(pad_id)\r\n for i, s in e...
[ "0.8210955", "0.8012064", "0.741115", "0.645929", "0.6339111", "0.6146659", "0.6094179", "0.60548025", "0.5995981", "0.5975593", "0.59623677", "0.59397143", "0.59219885", "0.5850022", "0.575946", "0.57324886", "0.5686426", "0.5680188", "0.56618726", "0.563921", "0.5634147", ...
0.8199274
1
Convert (list of )+ tokens to a padded LongTensor.
def get_cuda_long_tensor(tokens_list, batch_size, pad_id=constant.PAD_ID): sizes = [] x = tokens_list while isinstance(x[0], list): sizes.append(max(len(y) for y in x)) x = [z for y in x for z in y] tokens = torch.cuda.LongTensor(batch_size, *sizes).fill_(pad_id) for i, s in enumerat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_long_tensor(tokens_list, batch_size, pad_id=PAD_ID):\r\n sizes = []\r\n x = tokens_list\r\n while isinstance(x[0], list):\r\n sizes.append(max(len(y) for y in x))\r\n x = [z for y in x for z in y]\r\n tokens = torch.LongTensor(batch_size, *sizes).fill_(pad_id)\r\n for i, s in e...
[ "0.8211459", "0.81998223", "0.80128103", "0.64573216", "0.63375175", "0.6145874", "0.60938615", "0.605486", "0.5994699", "0.59761363", "0.5959464", "0.5938784", "0.59210825", "0.5847328", "0.57590795", "0.5733154", "0.568618", "0.56813693", "0.5661387", "0.56379473", "0.56366...
0.7411618
3
Join components of url into a relative url Use to prevent double slash when joining subpath. This will leave the initial and final / in place
def url_path_join(*pieces): initial = pieces[0].startswith("/") final = pieces[-1].endswith("/") stripped = [s.strip("/") for s in pieces] result = "/".join(s for s in stripped if s) if initial: result = "/" + result if final: result = result + "/" if result == "//": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def urljoin(base, *path):\n return reduce(_join, path, base)", "def _url_join(self, *parts):\n return \"/\".join(map(lambda fragment: fragment.rstrip('/'), parts))", "def full_url(self, path):\n if path[0] == '/':\n path = path[1:]\n return urljoin(self.absolute_root, path)",...
[ "0.750273", "0.74749786", "0.7463351", "0.7461864", "0.74336535", "0.73645765", "0.73354805", "0.73094445", "0.73057014", "0.72956157", "0.7289869", "0.71865994", "0.7186508", "0.7176108", "0.71693957", "0.7166752", "0.71409905", "0.70767", "0.70707947", "0.7021509", "0.70210...
0.7498108
1
Set up sensors for a Nexia device.
async def async_setup_entry( hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: AddEntitiesCallback, ) -> None: coordinator: NexiaDataUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id] nexia_home = coordinator.nexia_home entities = [] for thermostat_id in nexia_ho...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_sensors(self, configs):\n self.__sensors = self.setup_components(configs, 'scale_client.sensors')", "def setup_sensors(self):\n super(EddRoach2ProductController, self).setup_sensors()\n self._firmware_server_sensor = Sensor.string(\n \"firmware-server\",\n des...
[ "0.71166885", "0.68951654", "0.6810018", "0.66295713", "0.6500889", "0.64948434", "0.6445575", "0.64080334", "0.6401887", "0.63890195", "0.6367999", "0.6366648", "0.63163877", "0.62818736", "0.6257839", "0.60829073", "0.60514086", "0.6047544", "0.60457945", "0.60385656", "0.6...
0.0
-1
Initialize the nexia sensor.
def __init__(self, coordinator, thermostat, sensor_call, translation_key): super().__init__( coordinator, thermostat, unique_id=f"{thermostat.thermostat_id}_{sensor_call}", ) self._call = sensor_call self._state = None self._attr_translation_ke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _initialize(self):\n self.flush()\n print(\"Initializing sensor...\")\n try:\n self.get_sample()\n print('Initialization successful')\n except:\n print('Initialization failed. Please disconnect and reconnect sensor.')", "def __init__(self):\n ...
[ "0.6737987", "0.67229134", "0.6640202", "0.64845777", "0.63069576", "0.63032186", "0.624056", "0.6221448", "0.6213541", "0.61965877", "0.61783564", "0.6168396", "0.6148784", "0.61420655", "0.6123758", "0.61189204", "0.6106654", "0.61001", "0.6032134", "0.6030373", "0.6017771"...
0.0
-1
Mock config file with erroneous data.
def mocked_config_file_error(): data = """ LOGIN = 06501234567 PASSWD = MySecre3tPassw0rd """ with mock.patch( "configparser.open", # "builtins.open", mock.mock_open(read_data=data), ): yield
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_config__invalid_datafile(self):\n\n test_datafile = json.dumps(self.config_dict_with_features)\n mock_logger = mock.Mock()\n mock_notification_center = mock.Mock()\n\n with mock.patch('optimizely.config_manager.BaseConfigManager._validate_instantiation_options'):\n ...
[ "0.7730992", "0.7496227", "0.7395642", "0.7386029", "0.7376061", "0.7355063", "0.7342643", "0.7338819", "0.7295874", "0.72808695", "0.72607595", "0.72263473", "0.72111607", "0.7208132", "0.71791977", "0.7141326", "0.7137899", "0.7129651", "0.71215516", "0.71083426", "0.710012...
0.7843521
0
Test error handling of faulty login.
def test_login_error( config, ): with requests_mock.Mocker() as m: sms = YesssSMS.YesssSMS("0000000000", "2d4faa0ea6f55813") m.register_uri( "POST", # pylint: disable=protected-access sms._login_url, status_code=200, text="<strong>Login...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_valid_login_form_but_failed_authentication(self):\n\n\n\t\tpass", "def test_login_errors(self):\n login = '/login?user_name=nobody&password=wrong&login=Login'\n response = self.app.get(login)\n assert \"<title>Login</title>\" in response\n assert \"session cookies\" in respon...
[ "0.7903521", "0.78291804", "0.778343", "0.7679951", "0.7656635", "0.76280516", "0.75250405", "0.74581337", "0.74570626", "0.74407774", "0.7414321", "0.74062663", "0.7405083", "0.7393456", "0.7388761", "0.73611295", "0.7312414", "0.7262598", "0.72426337", "0.7237841", "0.71794...
0.0
-1
Test error handling of empty login.
def test_login_empty_login_error(invalid_login): # xxxxxx sms = YesssSMS.YesssSMS("", "2d4faa0ea6f55813") with pytest.raises(sms.LoginError): sms.send(YESSS_TO, "test")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_login_wrong_credentials(self):\n\t\tdata = {'username' : 'nonexistentuser', 'password' : 'nopasswordlol'}\n\t\tresponse = self.login(data)\n\n\t\terror_text = \"Unable to log in with provided credentials.\"\n\n\t\tself.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)\n\t\ttry:\n\t\t\tif erro...
[ "0.7879435", "0.7876575", "0.7859142", "0.7782351", "0.7629133", "0.7611455", "0.7567672", "0.75102794", "0.7459506", "0.74534845", "0.74365264", "0.7414557", "0.740338", "0.73842686", "0.73816365", "0.7376297", "0.73733264", "0.7367449", "0.7332835", "0.7282413", "0.72754437...
0.719064
35
Test error handling of no recipient.
def test_no_recipient_error( config, ): sms = YesssSMS.YesssSMS("0000000000", "2d4faa0ea6f55813") with pytest.raises(sms.NoRecipientError): sms.send("", "test")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_error_mail(recipient, sender, journal_id):\n\n if recipient in ['', None]:\n #: Simpley Error Mail!\n #: TODO: error marking...\n return True\n\n try:\n param = return_path_from_address(recipient)\n assert param['message_id'] != \"\"\n assert param['domai...
[ "0.66603416", "0.63928294", "0.63049114", "0.6230597", "0.618594", "0.61749613", "0.60234547", "0.5970546", "0.59641874", "0.5958361", "0.5920763", "0.5877465", "0.58457184", "0.5845083", "0.5776097", "0.57675093", "0.57137966", "0.5700097", "0.56931126", "0.5679962", "0.5643...
0.7460001
0
Test default config file paths.
def test_default_config_file_paths( config, ): assert "~/.config/yessssms.conf" in CONFIG_FILE_PATHS assert "/etc/yessssms.conf" in CONFIG_FILE_PATHS
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_default_settings_path():\n\n root_path = application_services.get_pyrin_main_package_path()\n default_settings_path = os.path.abspath(os.path.join(root_path, 'settings', 'default'))\n assert application_services.get_default_settings_path() == default_settings_path", "def list_default_paths(...
[ "0.73817647", "0.7176939", "0.7159993", "0.71310896", "0.7041495", "0.7004619", "0.69044274", "0.6887526", "0.6828872", "0.68284243", "0.67880553", "0.6772448", "0.6759647", "0.67325926", "0.67237264", "0.6695618", "0.6694504", "0.6691137", "0.6690136", "0.6688755", "0.668745...
0.87389934
0
Load the rendered YAML which is passed in to the `check` method.
def _load_rendered_yaml(self, rendered: str) -> dict: return [d for d in yaml.safe_load_all(rendered)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_yaml(content):\n from yaml import load, FullLoader\n return load(content, Loader=FullLoader)", "def _load_yaml_file(yaml_file):\n with io.open(yaml_file, 'r', encoding='utf-8') as stream:\n yaml_content = yaml.load(stream)\n FileUtils._check_format(yaml_file, yaml_cont...
[ "0.65524626", "0.6546556", "0.6523975", "0.64938307", "0.6391137", "0.63572615", "0.62872785", "0.6274688", "0.6263665", "0.6245961", "0.6244714", "0.62390745", "0.6223321", "0.6193768", "0.6176689", "0.6162097", "0.61616564", "0.61478096", "0.6135383", "0.6125504", "0.611504...
0.68567806
0
Check for resource constraints in nested Helm values.
def _check_values_flat_resources(self, documents: list) -> str: if len(documents) > 1: return "We only support flat Helm values! Please provide a single YAML document."
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_stack(self, _stack):\n\n if len(_stack) == 0 or \"resources\" not in _stack.keys():\n self.status = \"na: no resource in stack\"\n self.logger.warning(\"non-applicable to valet: no resource in stack\")\n return {}\n\n stack = {}\n\n for rk, r in _...
[ "0.6248823", "0.580413", "0.5796752", "0.5781491", "0.5767138", "0.57460046", "0.56416166", "0.5641036", "0.5636497", "0.5636497", "0.55847204", "0.55157745", "0.5513028", "0.5465535", "0.54504126", "0.544074", "0.54362106", "0.5421874", "0.54103893", "0.5409143", "0.54001695...
0.5802061
2
Ensures a valid API key returns True, and an invalid key returns False.
def test_validate_api_key(app, seed_data, key, result): user_id, api_key = seed_data if key == 'use-valid-key': key = api_key with app.app_context(): assert auth.validate_api_key(user_id, key) == result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkKey(self):\n # TO DO for checking API authentication\n if self.apikey is None:\n return False\n else:\n return True", "def isValidKey(key):\n return True", "def check_api_key(x_api_key: str = Security(api_key_header_auth)):\n\n if x_api_key != API_KEY:\n ...
[ "0.80504006", "0.7674221", "0.7524238", "0.7414995", "0.7326697", "0.71604687", "0.7145435", "0.7134343", "0.7029839", "0.6960646", "0.6953446", "0.6754927", "0.6754927", "0.6735039", "0.67219913", "0.66981936", "0.66935235", "0.6690072", "0.6686523", "0.6626834", "0.6624551"...
0.7356187
4
Return True if given n is already the biggest number possible to be formed of n's digits.
def is_biggest(n): return True if int(''.join(sorted([d for d in str(n)], reverse=True))) == n else False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_small_digits(n,maxdigit):\n digits = [int(num) for num in str(n)]\n return all([num <= maxdigit for num in digits])", "def isReversible(n): \n if n % 10 == 0:\n return False\n s = n + reverseNum(n)\n while s > 0:\n digit = s % 10\n if not digit in [1,3,5,7,9]:\n ...
[ "0.71942073", "0.6877328", "0.6774127", "0.65988797", "0.6590628", "0.65312386", "0.6525664", "0.6517685", "0.6496512", "0.64802724", "0.6467701", "0.6457774", "0.6432592", "0.6403123", "0.62918633", "0.6277351", "0.62575203", "0.62530875", "0.6212425", "0.6211562", "0.618213...
0.8055396
0
Restores model and optimizer checkpoints and ensures global step is in sync.
def _restore_models_and_step(self): global_step_D = global_step_G = 0 if self.netD_ckpt_file: assert os.path.exists(self.netD_ckpt_file) print("INFO: Restoring checkpoint for D...") global_step_D = self.netD.restore_checkpoint( ckpt_file=self.netD_ckp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def restore(self):\n # For multi-worker training, it should not restore a model in certain\n # worker setting (e.g. non-chief worker in ParameterServerStrategy).\n # pylint: disable=protected-access\n if self._model._in_multi_worker_mode() and not multi_worker_util.should_load_checkpoin...
[ "0.7332104", "0.7265741", "0.711985", "0.68864655", "0.68834347", "0.6876512", "0.68629396", "0.68622905", "0.68423074", "0.682174", "0.6775043", "0.6742713", "0.6707705", "0.669616", "0.6691548", "0.6646148", "0.65750563", "0.6553457", "0.6545299", "0.6536125", "0.6514447", ...
0.7249277
2
Convert excel file to the regular list in python.
def convert_excel_file(excel_file: str, sheet_name: str) -> list: workbook = xlrd.open_workbook(excel_file) sheet = workbook.sheet_by_name(sheet_name) book_list = [] for row in range(1, sheet.nrows): books = OrderedDict() row_values = sheet.row_values(row) books["author"] = row_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_data(self):\n wb = load_workbook(filename=self.file_path)\n ws = wb.active\n data = []\n\n for i, row in enumerate(ws.rows):\n if len(row) != self.max_columns:\n print(len(row))\n return []\n\n if i == 0:\n # skip...
[ "0.68098074", "0.67064244", "0.6490532", "0.6436667", "0.6356518", "0.6334197", "0.6322425", "0.624131", "0.620288", "0.6183244", "0.61808234", "0.6175971", "0.61544317", "0.6123336", "0.6112346", "0.5990437", "0.59709984", "0.591867", "0.5908782", "0.58885264", "0.58105695",...
0.73590165
0
Randomly chooses trump color from cards of own hand
def get_trump_color(self): return random.choice(Card.colors[1:])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_color():\n return random.choice(colors)", "def get_trump_color(self):\n color_counter = collections.Counter()\n for card in self.hand:\n color = card.color\n if color == \"White\":\n continue\n color_counter[color] += 1\n if not c...
[ "0.7180077", "0.692395", "0.6867298", "0.6762564", "0.66311836", "0.6629565", "0.66207784", "0.65926397", "0.6585948", "0.65722585", "0.65379435", "0.65024084", "0.65023965", "0.6496322", "0.64912546", "0.64856356", "0.64598596", "0.6437486", "0.6437164", "0.64346325", "0.641...
0.7728462
0
Given user_id, return the associated User object.
def user_loader(user_id): return User.query.get(user_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_by_id(user_id):\n\n return User.query.get(user_id)", "def get(self, user_id):\n return User.get(user_id)", "def get_user_from_id(user_id):\n return Users.query.filter_by(id=user_id).first()", "def get_user(self, user_id):\n User = get_user_model()\n try:\n ...
[ "0.84723973", "0.8393383", "0.83698905", "0.8285045", "0.8247994", "0.8244847", "0.82433355", "0.82264954", "0.8179295", "0.8178196", "0.8178196", "0.8151988", "0.8151988", "0.8151988", "0.8151988", "0.7943583", "0.7909672", "0.787124", "0.78475416", "0.78186816", "0.77860373...
0.0
-1
Convert a sorted iterable into lower/upper values of batches of size n.
def make_batch_limits(iterable, n): l = len(iterable) for ndx in range(0, l, n): chunk = iterable[ndx : min(ndx + n, l)] yield (chunk[0], chunk[-1] + 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_to_batches(iterable, n=1):\n l = len(iterable)\n for ndx in range(0, l, n):\n yield iterable[ndx:min(ndx + n, l)]", "def batches(l, n):\n for i in range(0, l, n):\n yield range(i,min(l,i+n))", "def chunk(iterable, n):\n iterable = [e for e in iterable]\n avg_length = int(...
[ "0.7196513", "0.7016247", "0.6730679", "0.66578823", "0.66578823", "0.66578823", "0.661883", "0.6568515", "0.6491408", "0.6399317", "0.6300084", "0.629686", "0.62917894", "0.62872493", "0.6286754", "0.625501", "0.625501", "0.625501", "0.625501", "0.625501", "0.6254961", "0....
0.7059446
1
View function for home page of the site.
def index(request): # Generate counts of some of the main objects num_books = Book.objects.all().count() num_authors = Author.objects.count() # The 'all()' is implied by default. num_publishers = Publisher.objects.all().count() num_visits = request.session.get('num_visits', 0) request.session[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home(request):\n\treturn render(request, \"compta/home.html\")", "def home_page(request):\r\n return render(request, 'ez_main/home_page.html')", "def home(request):\r\n return render(request, 'home.html')", "def homepage(request):\n\treturn render(request, 'core/homepage.html')", "def home():\n\n ...
[ "0.85341", "0.8428982", "0.8375485", "0.8352984", "0.8350206", "0.83421737", "0.83094066", "0.8286094", "0.8243959", "0.82330734", "0.822364", "0.8212744", "0.81851834", "0.81851834", "0.81851834", "0.81851834", "0.81851834", "0.81851834", "0.81851834", "0.81851834", "0.81851...
0.0
-1
Initialize the media player.
def __init__(self, volumio, uid, name, info): self._volumio = volumio self._uid = uid self._name = name self._info = info self._state = {} self._playlists = [] self._currentplaylist = None self.thumbnail_cache = {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, handler: mediaHandler):\n\n self.handler = handler", "def __init__(self, session_type):\n\n self._media_session = MediaSession(session_type)\n\n self._signals = []\n self._signals.append(self._media_session.connect(\"prepared\",\n self.on_media_sessio...
[ "0.6440089", "0.6396291", "0.63616276", "0.63616276", "0.63549334", "0.63490015", "0.625473", "0.6210626", "0.6193414", "0.6107897", "0.6090716", "0.60669965", "0.6059084", "0.59884375", "0.5985775", "0.59350544", "0.59149337", "0.58745784", "0.5859796", "0.5834392", "0.58286...
0.0
-1
Return the unique id for the entity.
def unique_id(self): return self._uid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entity_id(self) -> str:\n return self._entity_id", "def entity_id(self):\n return self._entity_id", "def entity_id(self):\n return self._entity_id", "def entity_id(self):\n return self._entity_id", "def entity_id(self):\n return self._entity_id", "def entity_id(self...
[ "0.8107885", "0.78878474", "0.78878474", "0.78878474", "0.78878474", "0.78878474", "0.78051823", "0.78051823", "0.7799596", "0.7792595", "0.7754964", "0.7754964", "0.7754964", "0.7754964", "0.7754964", "0.7754964", "0.7754964", "0.7754964", "0.76560926", "0.76560926", "0.7652...
0.7497616
54
Artist of current playing media (Music track only).
def media_artist(self): return self._state.get("artist", None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def media_artist(self):\n return self.coordinator.data.nowplaying[self.zone.SourceID].CurrSong.Artists", "def media_artist(self):\n media_status = self._media_status()[0]\n return media_status.artist if media_status else None", "def media_artist(self):\n return self._media_artist", ...
[ "0.85988027", "0.85100645", "0.8364579", "0.8364579", "0.8197227", "0.81845474", "0.7796168", "0.7759904", "0.7709477", "0.7638341", "0.76134145", "0.7604214", "0.7216594", "0.70622", "0.69644237", "0.664528", "0.6623426", "0.6593583", "0.6548443", "0.6520028", "0.6481482", ...
0.86874646
0
Artist of current playing media (Music track only).
def media_album_name(self): return self._state.get("album", None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def media_artist(self):\n return self._state.get(\"artist\", None)", "def media_artist(self):\n return self.coordinator.data.nowplaying[self.zone.SourceID].CurrSong.Artists", "def media_artist(self):\n media_status = self._media_status()[0]\n return media_status.artist if media_stat...
[ "0.8687323", "0.85988134", "0.8509157", "0.83637434", "0.83637434", "0.8196336", "0.8183605", "0.77955586", "0.7759012", "0.7709448", "0.7638554", "0.76132107", "0.7603828", "0.7216902", "0.70617723", "0.6964165", "0.664448", "0.6623835", "0.65933233", "0.6547524", "0.6482023...
0.6519635
20
Time in seconds of current song duration.
def media_duration(self): return self._state.get("duration", None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duration_in_seconds(self):\n \"Should not set track length\"\n return self.duration / float(self.samplerate)", "def duration(self):\n self._current_duration = time.perf_counter() - self._duration_start\n return round(self._current_duration, 4)", "def duration_in_seconds(self):\n...
[ "0.81876254", "0.7938716", "0.78988636", "0.78473353", "0.7823681", "0.77341574", "0.7634641", "0.7622908", "0.7622372", "0.7618472", "0.75984764", "0.75961554", "0.7574814", "0.7574814", "0.7574814", "0.7574814", "0.7574814", "0.7574814", "0.7574814", "0.7574814", "0.7517420...
0.7100783
61
Boolean if volume is currently muted.
def is_volume_muted(self): return self._state.get("mute", None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_volume_muted(self):\n return self._isMuted", "def is_volume_muted(self):\n return self._muted", "def is_volume_muted(self):\n return self._muted", "def is_volume_muted(self):\n return self._muted", "def is_volume_muted(self) -> bool:\n return int(self._state.get(\"...
[ "0.88940346", "0.88759947", "0.88759947", "0.88759947", "0.8814027", "0.87869483", "0.8236034", "0.8190068", "0.7936686", "0.78640896", "0.7704961", "0.76758885", "0.6825323", "0.6755305", "0.65662944", "0.65392035", "0.64557403", "0.6447418", "0.64046997", "0.63986605", "0.6...
0.88506025
4
Send mute command to media player.
async def async_mute_volume(self, mute: bool) -> None: if mute: await self._volumio.mute() else: await self._volumio.unmute()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mute():\n request_command(tv_command=TVCommand.mute)", "async def async_mute_volume(self, mute: bool) -> None:\n await self._projector.send_command(MUTE)", "def mute_volume(self, mute):\n mute_numeric = '1' if mute else '0'\n self._lms.query(self._id, 'mixer', 'muting', mute_numeric...
[ "0.8351864", "0.7610174", "0.73645294", "0.72703284", "0.72499573", "0.7218573", "0.72066677", "0.71777207", "0.71752316", "0.71414465", "0.7125538", "0.70837677", "0.708093", "0.70565724", "0.70256376", "0.7021446", "0.70199054", "0.6984963", "0.6965777", "0.67242646", "0.66...
0.6908538
19
Choose an available playlist and play it.
async def async_select_source(self, source: str) -> None: await self._volumio.play_playlist(source) self._currentplaylist = source
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def play(pre, choice, post=\"\"):\n # pylint: disable=R0914\n # too many local variables\n\n if g.browse_mode == \"ytpl\":\n\n if choice.isdigit():\n return plist(g.ytpls[int(choice) - 1]['link'])\n else:\n g.message = \"Invalid playlist selection: %s\" % c.y + choice +...
[ "0.72042555", "0.6966726", "0.6878524", "0.67394876", "0.6735221", "0.67186755", "0.6657361", "0.65717185", "0.6561803", "0.6560952", "0.655475", "0.653221", "0.6528147", "0.6426419", "0.64082843", "0.6353288", "0.6352037", "0.63145936", "0.62931883", "0.627785", "0.6275521",...
0.6530211
12
Send the play_media command to the media player.
async def async_play_media( self, media_type: MediaType | str, media_id: str, **kwargs: Any ) -> None: await self._volumio.replace_and_play(json.loads(media_id))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_media_play(self) -> None:\n await self._projector.send_command(PLAY)", "def _send_start_play(self, media=None, **kwargs):\n msg = media_to_chromecast_command(\n media, requestiId=self._inc_request(), **kwargs\n )\n self.logger.debug(\"Create command: \\n%r\\...
[ "0.8395478", "0.7840275", "0.7768703", "0.7667638", "0.75681293", "0.7500104", "0.7500104", "0.7420948", "0.740788", "0.7272308", "0.70983255", "0.70977795", "0.707564", "0.7057172", "0.7050097", "0.69550174", "0.6920429", "0.68830705", "0.6785371", "0.6701337", "0.6699859", ...
0.7307245
9
Given a filename like 'dirA/dirB/filename.ext', returns 'dirA/dirB/$prefixfilename.ext'
def addPathPrefix(prefix, pathname): new_pathname = os.path.join(os.path.dirname(pathname), prefix + os.path.basename(pathname)) return new_pathname
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prefix_file(filename, prefix):\n path, file_or_dir = os.path.split(filename)\n new_filename = os.path.join(path, prefix + file_or_dir)\n os.rename(filename, new_filename)", "def _GetRelPath(self, filename):\n assert filename.startswith(self.subdir), (filename, self.subdir)\n return filename[le...
[ "0.73172355", "0.6754017", "0.6481695", "0.636711", "0.62931895", "0.6269986", "0.6253476", "0.6196698", "0.61768484", "0.6157078", "0.6145018", "0.6067755", "0.60424834", "0.6041382", "0.60332406", "0.6012091", "0.6002487", "0.5995359", "0.599438", "0.5990542", "0.5963619", ...
0.67522657
2
The `(left, right)` padding required for the IFFT
def padding(self): pad = self.ntiles - self.windowsize return (int((pad - 1)/2.), int((pad + 1)/2.))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def padding(self) -> Tuple[int, int, int, int]:\n return (self.ipadding[0].to_pixels(self.width),\n self.ipadding[1].to_pixels(self.width),\n self.ipadding[2].to_pixels(self.height),\n self.ipadding[3].to_pixels(self.height))", "def padding(self):\n\t\treturn s...
[ "0.6507085", "0.6441506", "0.63539886", "0.61706245", "0.61002773", "0.5890281", "0.58514357", "0.5795316", "0.57882065", "0.5773338", "0.5708867", "0.5700763", "0.5682644", "0.5667075", "0.5655253", "0.5635127", "0.5617207", "0.55957866", "0.5593418", "0.5590209", "0.5564513...
0.6638898
0
Return (batch) action embedding which is the concatenation of the embeddings of the traversed edge and the target node.
def get_action_embedding(self, action: Action, kg: KnowledgeGraph): relation_embedding = kg.get_relation_embeddings(action.rel) if self.relation_only: action_embedding = relation_embedding else: entity_embedding = kg.get_entity_embeddings(action.ent) action_em...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def combined_emb(self) -> Tensor:\n return self._combined_emb", "def _get_word_tensor(embedding_op: tf.Operation) -> tf.Tensor:\n assert embedding_op.type == 'AddV2'\n add = embedding_op.inputs[0].op\n assert add.type == 'AddV2'\n identity = add.inputs[0].op\n assert ide...
[ "0.60153514", "0.5904948", "0.58927727", "0.5781083", "0.5692151", "0.5674533", "0.56136405", "0.55874205", "0.55434144", "0.5531833", "0.55285585", "0.55158997", "0.5508879", "0.54888654", "0.548679", "0.54677886", "0.5460174", "0.5394147", "0.53601515", "0.5356663", "0.5355...
0.7001667
0
Randomly generates a 1dimensional NumPy array containing nonnegative real numbers which add up to exactly 1, of the given size. The marginal probability distribution of each item in the array is beta(1, size 1).
def rand_p(size): a = np.random.random(size - 1) a.sort() return np.diff(np.concatenate(((0,), a, (1,))))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_distribution():\n b = np.random.uniform(0.0, 1.0, size=[1, vocabulary_size])\n return b / np.sum(b, 1)[:, None]", "def random_distribution():\n b = np.random.uniform(0.0, 1.0, size=[1, vocabulary_size])\n return b/np.sum(b, 1)[:,None]", "def random_distribution():\n b = np.random.unif...
[ "0.6513029", "0.64537627", "0.64537627", "0.6272509", "0.61719406", "0.6130689", "0.61090344", "0.6055923", "0.60308003", "0.60234123", "0.59978753", "0.59184915", "0.5840195", "0.5822725", "0.5779461", "0.57785386", "0.5757625", "0.57511437", "0.5704598", "0.5691803", "0.567...
0.6186031
4
Returns the left edge of the rect
def x(self): return self.left
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _rect_left(self):\n\treturn min(self.x, self.x + self.w)", "def left(self):\n x, y = (self.loc[0] - 1, self.loc[1])\n\n if x < 0:\n return None # None\n\n return self.garden.cells[y][x]", "def getLeft(self):\n return self.left", "def getupperleft(self):\n re...
[ "0.86006856", "0.7585846", "0.7440086", "0.741373", "0.74052733", "0.74052733", "0.7383918", "0.73120195", "0.72417325", "0.7221223", "0.7174246", "0.71672237", "0.71672237", "0.71617967", "0.7129328", "0.7064332", "0.7043794", "0.7042532", "0.70215225", "0.70016", "0.6995689...
0.65466636
53
Returns the top edge of the rect
def y(self): return self.top
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _rect_top(self):\n\treturn max(self.y, self.y + self.h)", "def getupperleft(self):\n return (self.rect.x, self.rect.y)", "def top(self):\n return self.points['topRight'].y", "def top(self):\n return self.points['topRight'].y", "def get_top_cell(self):\n return self._top_cell...
[ "0.8270514", "0.7256896", "0.72479004", "0.72479004", "0.7077", "0.6969833", "0.69664925", "0.6937057", "0.6929643", "0.68851054", "0.6822272", "0.6769056", "0.6763707", "0.6726194", "0.6667652", "0.66243327", "0.6619696", "0.6589319", "0.65376157", "0.6529901", "0.65111667",...
0.6294161
32
Returns the x value which is the right edge of the rect
def right(self): return self.left + self.width
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _rect_right(self):\n\treturn max(self.x, self.x + self.w)", "def _rect_left(self):\n\treturn min(self.x, self.x + self.w)", "def right(self):\n return self.points['topRight'].x", "def right(self):\n return self.points['topRight'].x", "def getupperleft(self):\n return (self.rect.x, ...
[ "0.84452915", "0.79230076", "0.787274", "0.787274", "0.750614", "0.71870947", "0.7092904", "0.699564", "0.696628", "0.6911899", "0.6898351", "0.6881939", "0.6881939", "0.68396276", "0.6811167", "0.67940587", "0.67750615", "0.67750615", "0.67601407", "0.67491525", "0.67350435"...
0.75660396
4
Returns the y value of the bottom edge of the rect
def bottom(self): return self.top + self.height
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _rect_bottom(self):\n\treturn min(self.y, self.y + self.h)", "def bottom_y(self):\r\n return self.position.y - self.size.y - self.bulk", "def bottom(self):\n return self.points['bottomRight'].y", "def bottom(self):\n return self.points['bottomRight'].y", "def _rect_top(self):\n\tretu...
[ "0.8805093", "0.8051866", "0.79904914", "0.79904914", "0.79467046", "0.7712718", "0.74993527", "0.74695987", "0.735016", "0.7347175", "0.72841567", "0.7186302", "0.7104309", "0.71026164", "0.7064471", "0.6959684", "0.6943852", "0.6942228", "0.69254243", "0.6912166", "0.691216...
0.7736985
5
Returns a point (x, y) which is the top, left corner of the rect.
def topleft(self): return (self.left, self.top)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top_left(self):\n return Point(self.left, self.top)", "def topleft(self, x=0, y=0):\n topleft = self.rect.topleft\n if x or y:\n return (topleft[0]+x, topleft[1]+y)\n return topleft", "def get_pos(self) -> tuple:\n return self.rect.center", "def get_pos(self)...
[ "0.7615435", "0.73522216", "0.7328254", "0.7280965", "0.7234981", "0.7155766", "0.7029561", "0.70282614", "0.7008412", "0.690158", "0.6862395", "0.6836018", "0.6780747", "0.6679095", "0.66712946", "0.66573036", "0.6583718", "0.6580749", "0.6580749", "0.6565925", "0.65483946",...
0.6531546
21
Returns a point (x, y) which is the bottom, left corner of the rect.
def bottomleft(self): return (self.left, self.bottom)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bottomLeftCorner(self):\n self._updateExtents()\n return (self._mMinX,self._mMaxY)", "def getupperleft(self):\n return (self.rect.x, self.rect.y)", "def bottom_right(self):\n return Point(self.right, self.bottom)", "def _rect_left(self):\n\treturn min(self.x, self.x + self.w)"...
[ "0.76496786", "0.7357598", "0.71578914", "0.70442766", "0.6905601", "0.6887942", "0.6774521", "0.6761503", "0.6718211", "0.6691041", "0.6682143", "0.6613044", "0.6594628", "0.65572333", "0.65572333", "0.6500128", "0.647712", "0.6408398", "0.64050466", "0.6383551", "0.63834256...
0.68953097
5
Returns a point (x, y) which is the top, right corner of the rect.
def topright(self): return (self.right, self.top)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def topRightCorner(self):\n self._updateExtents()\n return (self._mMaxX,self._mMinY)", "def _rect_right(self):\n\treturn max(self.x, self.x + self.w)", "def right(self):\n return self.points['topRight'].x", "def right(self):\n return self.points['topRight'].x", "def getupperleft...
[ "0.7436057", "0.7358436", "0.7146118", "0.7146118", "0.6997922", "0.68999165", "0.68880117", "0.6833478", "0.6721036", "0.6704991", "0.6647245", "0.6591932", "0.64858204", "0.64475834", "0.6435427", "0.64032483", "0.6401734", "0.6401734", "0.63608927", "0.6354798", "0.6303522...
0.62258637
22