query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Sets the is_qty_decimal of this CatalogInventoryDataStockItemInterface.
def is_qty_decimal(self, is_qty_decimal): if is_qty_decimal is None: raise ValueError("Invalid value for `is_qty_decimal`, must not be `None`") self._is_qty_decimal = is_qty_decimal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_qty_decimal(self):\n return self._is_qty_decimal", "def set_qty(self, qty):\n self.__qty = qty", "def is_decimal_divided(self, is_decimal_divided):\n if is_decimal_divided is None:\n raise ValueError(\"Invalid value for `is_decimal_divided`, must not be `None`\")\n\n ...
[ "0.67001706", "0.5596766", "0.53608686", "0.5295025", "0.5200474", "0.49881557", "0.49435446", "0.49435446", "0.4876795", "0.48469752", "0.4779541", "0.467411", "0.46484822", "0.46352366", "0.45805246", "0.45805246", "0.45367914", "0.45214263", "0.44761866", "0.44493854", "0....
0.80375946
0
Gets the show_default_notification_message of this CatalogInventoryDataStockItemInterface.
def show_default_notification_message(self): return self._show_default_notification_message
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_default_notification_message(self, show_default_notification_message):\n if show_default_notification_message is None:\n raise ValueError(\"Invalid value for `show_default_notification_message`, must not be `None`\")\n\n self._show_default_notification_message = show_default_notif...
[ "0.6954748", "0.5848639", "0.5407291", "0.53462595", "0.53364253", "0.5273157", "0.5273157", "0.52681565", "0.51727825", "0.5130436", "0.5130436", "0.5116534", "0.5116534", "0.5109583", "0.5089221", "0.50722516", "0.5057267", "0.5052001", "0.50501794", "0.50127727", "0.497723...
0.7587421
0
Sets the show_default_notification_message of this CatalogInventoryDataStockItemInterface.
def show_default_notification_message(self, show_default_notification_message): if show_default_notification_message is None: raise ValueError("Invalid value for `show_default_notification_message`, must not be `None`") self._show_default_notification_message = show_default_notification_mes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_default_notification_message(self):\n return self._show_default_notification_message", "def restore_default(self):\n msg = \"Restore the default {:s} and save under the label 'default'?\".format(self.clas.__name__)\n msg += \" Note: this will overwrite any changes made to the 'defau...
[ "0.74313354", "0.5503608", "0.5396629", "0.5352926", "0.53229517", "0.5307273", "0.5307273", "0.5244387", "0.5201929", "0.5192925", "0.5154197", "0.5082959", "0.50399536", "0.4976087", "0.4945798", "0.4945798", "0.4945798", "0.49242833", "0.49140605", "0.48864546", "0.4834297...
0.81213665
0
Gets the use_config_min_qty of this CatalogInventoryDataStockItemInterface.
def use_config_min_qty(self): return self._use_config_min_qty
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_config_min_sale_qty(self):\n return self._use_config_min_sale_qty", "def use_config_min_qty(self, use_config_min_qty):\n if use_config_min_qty is None:\n raise ValueError(\"Invalid value for `use_config_min_qty`, must not be `None`\")\n\n self._use_config_min_qty = use_con...
[ "0.75107247", "0.7331953", "0.70602125", "0.6948258", "0.66138196", "0.65944165", "0.65808034", "0.65354764", "0.63395035", "0.5843245", "0.58031017", "0.57402474", "0.5702002", "0.56617075", "0.56596357", "0.5641124", "0.5625463", "0.5625463", "0.5625463", "0.562135", "0.558...
0.820707
0
Sets the use_config_min_qty of this CatalogInventoryDataStockItemInterface.
def use_config_min_qty(self, use_config_min_qty): if use_config_min_qty is None: raise ValueError("Invalid value for `use_config_min_qty`, must not be `None`") self._use_config_min_qty = use_config_min_qty
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_config_min_sale_qty(self, use_config_min_sale_qty):\n if use_config_min_sale_qty is None:\n raise ValueError(\"Invalid value for `use_config_min_sale_qty`, must not be `None`\")\n\n self._use_config_min_sale_qty = use_config_min_sale_qty", "def use_config_min_qty(self):\n ...
[ "0.79686546", "0.75229484", "0.732698", "0.67751604", "0.6675", "0.66562974", "0.6379789", "0.6297307", "0.6267702", "0.6223948", "0.59108585", "0.57473695", "0.5741506", "0.5681249", "0.56029445", "0.56029445", "0.56029445", "0.5545748", "0.5523189", "0.5506294", "0.5497136"...
0.84857273
0
Gets the min_qty of this CatalogInventoryDataStockItemInterface. Minimal quantity available for item status in stock
def min_qty(self): return self._min_qty
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_sale_qty(self):\n return self._min_sale_qty", "def min_qty(self, min_qty):\n if min_qty is None:\n raise ValueError(\"Invalid value for `min_qty`, must not be `None`\")\n\n self._min_qty = min_qty", "def stock_min(stock):\n min_price=1000000\n for i in stock['Close...
[ "0.72986776", "0.68550694", "0.6684764", "0.63179725", "0.61397886", "0.6100927", "0.6100927", "0.6100927", "0.60917044", "0.60917044", "0.60797507", "0.60661614", "0.60589147", "0.6036733", "0.6036733", "0.603581", "0.603581", "0.603581", "0.600831", "0.59964406", "0.5933336...
0.8082381
0
Sets the min_qty of this CatalogInventoryDataStockItemInterface. Minimal quantity available for item status in stock
def min_qty(self, min_qty): if min_qty is None: raise ValueError("Invalid value for `min_qty`, must not be `None`") self._min_qty = min_qty
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_qty(self):\n return self._min_qty", "def min_sale_qty(self, min_sale_qty):\n if min_sale_qty is None:\n raise ValueError(\"Invalid value for `min_sale_qty`, must not be `None`\")\n\n self._min_sale_qty = min_sale_qty", "def min_sale_qty(self):\n return self._min_s...
[ "0.7595528", "0.7366096", "0.6927646", "0.658498", "0.6495474", "0.6495474", "0.64186794", "0.64136064", "0.64136064", "0.64136064", "0.6359455", "0.6359455", "0.62468743", "0.6221941", "0.6211036", "0.61785007", "0.6107971", "0.6019469", "0.6005829", "0.58942974", "0.5843411...
0.82357305
0
Gets the use_config_min_sale_qty of this CatalogInventoryDataStockItemInterface.
def use_config_min_sale_qty(self): return self._use_config_min_sale_qty
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_config_min_sale_qty(self, use_config_min_sale_qty):\n if use_config_min_sale_qty is None:\n raise ValueError(\"Invalid value for `use_config_min_sale_qty`, must not be `None`\")\n\n self._use_config_min_sale_qty = use_config_min_sale_qty", "def use_config_min_qty(self):\n ...
[ "0.7821748", "0.7712043", "0.7621654", "0.71335274", "0.68857634", "0.6689871", "0.66651833", "0.6584132", "0.62349856", "0.609468", "0.5906832", "0.58387905", "0.5834341", "0.5790302", "0.5720976", "0.55363756", "0.55112475", "0.5503969", "0.5441415", "0.5394598", "0.5364909...
0.84555334
0
Sets the use_config_min_sale_qty of this CatalogInventoryDataStockItemInterface.
def use_config_min_sale_qty(self, use_config_min_sale_qty): if use_config_min_sale_qty is None: raise ValueError("Invalid value for `use_config_min_sale_qty`, must not be `None`") self._use_config_min_sale_qty = use_config_min_sale_qty
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_config_min_qty(self, use_config_min_qty):\n if use_config_min_qty is None:\n raise ValueError(\"Invalid value for `use_config_min_qty`, must not be `None`\")\n\n self._use_config_min_qty = use_config_min_qty", "def use_config_min_sale_qty(self):\n return self._use_config_m...
[ "0.80395955", "0.8029431", "0.745835", "0.69414145", "0.6608911", "0.6501826", "0.64327663", "0.63395625", "0.62943727", "0.62275076", "0.62031126", "0.609965", "0.58456475", "0.58116585", "0.5774046", "0.570901", "0.5511456", "0.54958266", "0.543882", "0.53184426", "0.531550...
0.88242275
0
Gets the min_sale_qty of this CatalogInventoryDataStockItemInterface. Minimum Qty Allowed in Shopping Cart or NULL when there is no limitation
def min_sale_qty(self): return self._min_sale_qty
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_qty(self):\n return self._min_qty", "def min_sale_qty(self, min_sale_qty):\n if min_sale_qty is None:\n raise ValueError(\"Invalid value for `min_sale_qty`, must not be `None`\")\n\n self._min_sale_qty = min_sale_qty", "def min_qty(self, min_qty):\n if min_qty is ...
[ "0.7650938", "0.72675097", "0.6810143", "0.66649544", "0.6397469", "0.6185169", "0.6185169", "0.6185169", "0.61424685", "0.60746974", "0.5998286", "0.5980995", "0.59705144", "0.5956591", "0.5956591", "0.5952004", "0.5874129", "0.5869076", "0.586044", "0.5825728", "0.5825728",...
0.8183282
0
Sets the min_sale_qty of this CatalogInventoryDataStockItemInterface. Minimum Qty Allowed in Shopping Cart or NULL when there is no limitation
def min_sale_qty(self, min_sale_qty): if min_sale_qty is None: raise ValueError("Invalid value for `min_sale_qty`, must not be `None`") self._min_sale_qty = min_sale_qty
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_qty(self, min_qty):\n if min_qty is None:\n raise ValueError(\"Invalid value for `min_qty`, must not be `None`\")\n\n self._min_qty = min_qty", "def min_sale_qty(self):\n return self._min_sale_qty", "def use_config_min_sale_qty(self, use_config_min_sale_qty):\n if...
[ "0.7987579", "0.7829949", "0.74293876", "0.7156712", "0.69618285", "0.66193926", "0.64706814", "0.6294964", "0.6294964", "0.6181889", "0.6175409", "0.6047664", "0.5958283", "0.5958283", "0.5958283", "0.5935139", "0.5935139", "0.5931817", "0.5931817", "0.5927788", "0.58416617"...
0.85106367
0
Gets the use_config_max_sale_qty of this CatalogInventoryDataStockItemInterface.
def use_config_max_sale_qty(self): return self._use_config_max_sale_qty
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_config_max_sale_qty(self, use_config_max_sale_qty):\n if use_config_max_sale_qty is None:\n raise ValueError(\"Invalid value for `use_config_max_sale_qty`, must not be `None`\")\n\n self._use_config_max_sale_qty = use_config_max_sale_qty", "def max_sale_qty(self):\n return...
[ "0.7945521", "0.7777834", "0.6774273", "0.64231634", "0.6269388", "0.6095916", "0.5981711", "0.59203804", "0.5587079", "0.5545319", "0.5540212", "0.54844373", "0.5443779", "0.5420074", "0.5398573", "0.5380503", "0.53690964", "0.5354183", "0.53355193", "0.53260773", "0.5316411...
0.8456487
0
Sets the use_config_max_sale_qty of this CatalogInventoryDataStockItemInterface.
def use_config_max_sale_qty(self, use_config_max_sale_qty): if use_config_max_sale_qty is None: raise ValueError("Invalid value for `use_config_max_sale_qty`, must not be `None`") self._use_config_max_sale_qty = use_config_max_sale_qty
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_config_max_sale_qty(self):\n return self._use_config_max_sale_qty", "def max_sale_qty(self, max_sale_qty):\n if max_sale_qty is None:\n raise ValueError(\"Invalid value for `max_sale_qty`, must not be `None`\")\n\n self._max_sale_qty = max_sale_qty", "def max_sale_qty(se...
[ "0.79361004", "0.7640049", "0.67819506", "0.6642271", "0.6379616", "0.6010543", "0.5852633", "0.58097565", "0.5803766", "0.5791512", "0.5742869", "0.56894684", "0.56527036", "0.56438863", "0.55495405", "0.55441004", "0.55390024", "0.55300355", "0.54867697", "0.5484948", "0.54...
0.8826084
0
Gets the max_sale_qty of this CatalogInventoryDataStockItemInterface. Maximum Qty Allowed in Shopping Cart data wrapper
def max_sale_qty(self): return self._max_sale_qty
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_sale_qty(self, max_sale_qty):\n if max_sale_qty is None:\n raise ValueError(\"Invalid value for `max_sale_qty`, must not be `None`\")\n\n self._max_sale_qty = max_sale_qty", "def use_config_max_sale_qty(self):\n return self._use_config_max_sale_qty", "def get_max_quantit...
[ "0.73920643", "0.69052464", "0.67862225", "0.666768", "0.6414186", "0.6399103", "0.6184137", "0.617159", "0.6117752", "0.6084312", "0.60067147", "0.59880155", "0.5982263", "0.5919704", "0.58022517", "0.5757366", "0.5710101", "0.5666613", "0.56602937", "0.56525666", "0.5645879...
0.84282595
0
Sets the max_sale_qty of this CatalogInventoryDataStockItemInterface. Maximum Qty Allowed in Shopping Cart data wrapper
def max_sale_qty(self, max_sale_qty): if max_sale_qty is None: raise ValueError("Invalid value for `max_sale_qty`, must not be `None`") self._max_sale_qty = max_sale_qty
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_sale_qty(self):\n return self._max_sale_qty", "def use_config_max_sale_qty(self, use_config_max_sale_qty):\n if use_config_max_sale_qty is None:\n raise ValueError(\"Invalid value for `use_config_max_sale_qty`, must not be `None`\")\n\n self._use_config_max_sale_qty = use_...
[ "0.77883494", "0.76374805", "0.70894253", "0.70450205", "0.69269645", "0.62647825", "0.6199926", "0.6131636", "0.6066426", "0.60603845", "0.597246", "0.5932348", "0.5922667", "0.5856507", "0.5833697", "0.5833697", "0.58172995", "0.580521", "0.5792621", "0.5792621", "0.5792621...
0.85864216
0
Gets the use_config_backorders of this CatalogInventoryDataStockItemInterface.
def use_config_backorders(self): return self._use_config_backorders
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_config_backorders(self, use_config_backorders):\n if use_config_backorders is None:\n raise ValueError(\"Invalid value for `use_config_backorders`, must not be `None`\")\n\n self._use_config_backorders = use_config_backorders", "def backorders(self):\n return self._backord...
[ "0.67589754", "0.6081023", "0.54047453", "0.5075316", "0.50422245", "0.49623704", "0.49046612", "0.4625348", "0.46033418", "0.45896438", "0.44412062", "0.44382414", "0.44351077", "0.44351077", "0.44146067", "0.4401581", "0.4392468", "0.43826216", "0.43651536", "0.432197", "0....
0.69926345
0
Sets the use_config_backorders of this CatalogInventoryDataStockItemInterface.
def use_config_backorders(self, use_config_backorders): if use_config_backorders is None: raise ValueError("Invalid value for `use_config_backorders`, must not be `None`") self._use_config_backorders = use_config_backorders
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_config_backorders(self):\n return self._use_config_backorders", "def backorders(self, backorders):\n if backorders is None:\n raise ValueError(\"Invalid value for `backorders`, must not be `None`\")\n\n self._backorders = backorders", "def use_config_manage_stock(self):\...
[ "0.6853844", "0.57597065", "0.49032074", "0.4787117", "0.4717252", "0.46311563", "0.46266088", "0.4622912", "0.4580479", "0.4539539", "0.4535014", "0.4487738", "0.4401186", "0.43022475", "0.42567566", "0.42522794", "0.42348298", "0.4228151", "0.42218578", "0.42146245", "0.414...
0.78031427
0
Gets the backorders of this CatalogInventoryDataStockItemInterface. Backorders status
def backorders(self): return self._backorders
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def backorders(self, backorders):\n if backorders is None:\n raise ValueError(\"Invalid value for `backorders`, must not be `None`\")\n\n self._backorders = backorders", "def exit_orders(self):\n return store.orders.get_exit_orders(self.exchange, self.symbol)", "def get_borders(...
[ "0.61378366", "0.57629573", "0.5618701", "0.54451984", "0.5351541", "0.5250665", "0.5244985", "0.5224406", "0.51515025", "0.51515025", "0.5088647", "0.5087514", "0.5074754", "0.4976994", "0.49682644", "0.495421", "0.49524453", "0.4937377", "0.49363822", "0.49328107", "0.49323...
0.79006803
0
Sets the backorders of this CatalogInventoryDataStockItemInterface. Backorders status
def backorders(self, backorders): if backorders is None: raise ValueError("Invalid value for `backorders`, must not be `None`") self._backorders = backorders
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def backorders(self):\n return self._backorders", "def use_config_backorders(self, use_config_backorders):\n if use_config_backorders is None:\n raise ValueError(\"Invalid value for `use_config_backorders`, must not be `None`\")\n\n self._use_config_backorders = use_config_backord...
[ "0.6637649", "0.5678586", "0.5329803", "0.51731503", "0.49872035", "0.49442303", "0.48412484", "0.4830012", "0.48143616", "0.46432012", "0.4610033", "0.45956668", "0.45792934", "0.45667285", "0.45097965", "0.4472718", "0.44705057", "0.444751", "0.44219998", "0.44057822", "0.4...
0.7502411
0
Gets the use_config_notify_stock_qty of this CatalogInventoryDataStockItemInterface.
def use_config_notify_stock_qty(self): return self._use_config_notify_stock_qty
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_config_notify_stock_qty(self, use_config_notify_stock_qty):\n if use_config_notify_stock_qty is None:\n raise ValueError(\"Invalid value for `use_config_notify_stock_qty`, must not be `None`\")\n\n self._use_config_notify_stock_qty = use_config_notify_stock_qty", "def notify_stoc...
[ "0.7682253", "0.7055387", "0.61873746", "0.6080721", "0.6053293", "0.60518545", "0.58323705", "0.58111656", "0.57816184", "0.5658591", "0.5624093", "0.55084866", "0.5423069", "0.52667016", "0.52667016", "0.52667016", "0.5204002", "0.519297", "0.51832485", "0.51817346", "0.517...
0.84576875
0
Sets the use_config_notify_stock_qty of this CatalogInventoryDataStockItemInterface.
def use_config_notify_stock_qty(self, use_config_notify_stock_qty): if use_config_notify_stock_qty is None: raise ValueError("Invalid value for `use_config_notify_stock_qty`, must not be `None`") self._use_config_notify_stock_qty = use_config_notify_stock_qty
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_config_notify_stock_qty(self):\n return self._use_config_notify_stock_qty", "def notify_stock_qty(self, notify_stock_qty):\n if notify_stock_qty is None:\n raise ValueError(\"Invalid value for `notify_stock_qty`, must not be `None`\")\n\n self._notify_stock_qty = notify_st...
[ "0.80241096", "0.70293", "0.6163025", "0.6033151", "0.6024414", "0.59888744", "0.5840182", "0.5804829", "0.5783059", "0.56759006", "0.5622144", "0.5471777", "0.54570466", "0.53156775", "0.5294554", "0.5289611", "0.50676215", "0.49348068", "0.48440835", "0.4771281", "0.4729514...
0.88670284
0
Gets the notify_stock_qty of this CatalogInventoryDataStockItemInterface. Notify for Quantity Below data wrapper
def notify_stock_qty(self): return self._notify_stock_qty
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def notify_stock_qty(self, notify_stock_qty):\n if notify_stock_qty is None:\n raise ValueError(\"Invalid value for `notify_stock_qty`, must not be `None`\")\n\n self._notify_stock_qty = notify_stock_qty", "def Q_stock(self):\n return self._Q_stock", "def use_config_notify_stock...
[ "0.7110552", "0.65983623", "0.6443911", "0.62304544", "0.6141293", "0.6069425", "0.6004401", "0.59521884", "0.59308213", "0.58033377", "0.5784422", "0.5767025", "0.57492846", "0.57073045", "0.56339127", "0.56339127", "0.56339127", "0.56272113", "0.56063265", "0.55710375", "0....
0.8322343
0
Sets the notify_stock_qty of this CatalogInventoryDataStockItemInterface. Notify for Quantity Below data wrapper
def notify_stock_qty(self, notify_stock_qty): if notify_stock_qty is None: raise ValueError("Invalid value for `notify_stock_qty`, must not be `None`") self._notify_stock_qty = notify_stock_qty
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def notify_stock_qty(self):\n return self._notify_stock_qty", "def use_config_notify_stock_qty(self, use_config_notify_stock_qty):\n if use_config_notify_stock_qty is None:\n raise ValueError(\"Invalid value for `use_config_notify_stock_qty`, must not be `None`\")\n\n self._use_co...
[ "0.7537356", "0.68201524", "0.638318", "0.5815552", "0.5599029", "0.54602003", "0.5419372", "0.54101807", "0.5347898", "0.534743", "0.5347049", "0.53052", "0.52803034", "0.52487665", "0.52243656", "0.519865", "0.5173245", "0.5133975", "0.5093093", "0.508822", "0.508114", "0...
0.8486126
0
Gets the use_config_qty_increments of this CatalogInventoryDataStockItemInterface.
def use_config_qty_increments(self): return self._use_config_qty_increments
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_config_enable_qty_inc(self):\n return self._use_config_enable_qty_inc", "def use_config_notify_stock_qty(self):\n return self._use_config_notify_stock_qty", "def qty_increments(self):\n return self._qty_increments", "def use_config_qty_increments(self, use_config_qty_increments):...
[ "0.69232136", "0.69101334", "0.6683889", "0.66183597", "0.65290916", "0.6186518", "0.607349", "0.5841012", "0.5742144", "0.55539304", "0.5529741", "0.5517741", "0.54586464", "0.54586464", "0.54586464", "0.53881276", "0.536902", "0.53231794", "0.51854956", "0.5057323", "0.5054...
0.78774846
0
Sets the use_config_qty_increments of this CatalogInventoryDataStockItemInterface.
def use_config_qty_increments(self, use_config_qty_increments): if use_config_qty_increments is None: raise ValueError("Invalid value for `use_config_qty_increments`, must not be `None`") self._use_config_qty_increments = use_config_qty_increments
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_config_enable_qty_inc(self, use_config_enable_qty_inc):\n if use_config_enable_qty_inc is None:\n raise ValueError(\"Invalid value for `use_config_enable_qty_inc`, must not be `None`\")\n\n self._use_config_enable_qty_inc = use_config_enable_qty_inc", "def use_config_qty_incremen...
[ "0.73730284", "0.73501223", "0.6864444", "0.6842255", "0.6569402", "0.64735246", "0.64100724", "0.6134211", "0.61118096", "0.5951922", "0.58260125", "0.5811385", "0.5562119", "0.55222654", "0.5442239", "0.5355109", "0.52191645", "0.50168896", "0.49944305", "0.4931322", "0.484...
0.7939727
0
Gets the qty_increments of this CatalogInventoryDataStockItemInterface. Quantity Increments data wrapper
def qty_increments(self): return self._qty_increments
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qty_increments(self, qty_increments):\n if qty_increments is None:\n raise ValueError(\"Invalid value for `qty_increments`, must not be `None`\")\n\n self._qty_increments = qty_increments", "def stocks(self):\n return self.quantity - self.reserved", "def qty(self):\n ...
[ "0.6021436", "0.59711444", "0.59573627", "0.59573627", "0.59573627", "0.5838856", "0.57741046", "0.5711481", "0.56457055", "0.55893624", "0.5569342", "0.55688065", "0.5551582", "0.5479424", "0.54616416", "0.5343095", "0.53011113", "0.52977", "0.52810895", "0.5259881", "0.5180...
0.7844806
0
Sets the qty_increments of this CatalogInventoryDataStockItemInterface. Quantity Increments data wrapper
def qty_increments(self, qty_increments): if qty_increments is None: raise ValueError("Invalid value for `qty_increments`, must not be `None`") self._qty_increments = qty_increments
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qty_increments(self):\n return self._qty_increments", "def enable_qty_increments(self, enable_qty_increments):\n if enable_qty_increments is None:\n raise ValueError(\"Invalid value for `enable_qty_increments`, must not be `None`\")\n\n self._enable_qty_increments = enable_qty...
[ "0.6804403", "0.62046486", "0.5727688", "0.5697208", "0.56844765", "0.5483662", "0.53350043", "0.52962285", "0.52962285", "0.52338386", "0.5167066", "0.5096669", "0.50627536", "0.5020713", "0.49705178", "0.4933947", "0.4933947", "0.4933947", "0.49288884", "0.49038512", "0.488...
0.76781124
0
Gets the use_config_enable_qty_inc of this CatalogInventoryDataStockItemInterface.
def use_config_enable_qty_inc(self): return self._use_config_enable_qty_inc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_config_enable_qty_inc(self, use_config_enable_qty_inc):\n if use_config_enable_qty_inc is None:\n raise ValueError(\"Invalid value for `use_config_enable_qty_inc`, must not be `None`\")\n\n self._use_config_enable_qty_inc = use_config_enable_qty_inc", "def use_config_qty_incremen...
[ "0.7733284", "0.7533526", "0.7425849", "0.7190961", "0.6848171", "0.6808476", "0.6302289", "0.6257067", "0.6192714", "0.610447", "0.5882795", "0.5730698", "0.56524956", "0.54553896", "0.5348798", "0.53108764", "0.5212174", "0.5212174", "0.5212174", "0.5193729", "0.5124678", ...
0.83398443
0
Sets the use_config_enable_qty_inc of this CatalogInventoryDataStockItemInterface.
def use_config_enable_qty_inc(self, use_config_enable_qty_inc): if use_config_enable_qty_inc is None: raise ValueError("Invalid value for `use_config_enable_qty_inc`, must not be `None`") self._use_config_enable_qty_inc = use_config_enable_qty_inc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_config_enable_qty_inc(self):\n return self._use_config_enable_qty_inc", "def use_config_min_qty(self, use_config_min_qty):\n if use_config_min_qty is None:\n raise ValueError(\"Invalid value for `use_config_min_qty`, must not be `None`\")\n\n self._use_config_min_qty = use...
[ "0.78644663", "0.69375974", "0.69138205", "0.6836203", "0.6792984", "0.676364", "0.66481584", "0.6624361", "0.64533067", "0.636707", "0.6201474", "0.5638421", "0.5491562", "0.54871964", "0.52963865", "0.51310796", "0.49511835", "0.4942863", "0.49418437", "0.48649043", "0.4803...
0.85307586
0
Gets the enable_qty_increments of this CatalogInventoryDataStockItemInterface. Whether Quantity Increments is enabled
def enable_qty_increments(self): return self._enable_qty_increments
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qty_increments(self):\n return self._qty_increments", "def use_config_enable_qty_inc(self):\n return self._use_config_enable_qty_inc", "def use_config_qty_increments(self):\n return self._use_config_qty_increments", "def enable_qty_increments(self, enable_qty_increments):\n if...
[ "0.7088805", "0.68563145", "0.66860163", "0.66753775", "0.6062115", "0.5985736", "0.59809554", "0.5674054", "0.5524086", "0.5499014", "0.5403797", "0.53936166", "0.5364486", "0.53584826", "0.53286034", "0.5234566", "0.5203133", "0.51515996", "0.5150812", "0.5093466", "0.50934...
0.8379674
0
Sets the enable_qty_increments of this CatalogInventoryDataStockItemInterface. Whether Quantity Increments is enabled
def enable_qty_increments(self, enable_qty_increments): if enable_qty_increments is None: raise ValueError("Invalid value for `enable_qty_increments`, must not be `None`") self._enable_qty_increments = enable_qty_increments
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enable_qty_increments(self):\n return self._enable_qty_increments", "def qty_increments(self, qty_increments):\n if qty_increments is None:\n raise ValueError(\"Invalid value for `qty_increments`, must not be `None`\")\n\n self._qty_increments = qty_increments", "def use_con...
[ "0.77378863", "0.6530458", "0.64305294", "0.62575936", "0.60236984", "0.5852447", "0.57267094", "0.5262692", "0.5104665", "0.50545305", "0.5001433", "0.4997494", "0.49965456", "0.49061543", "0.48858902", "0.48727942", "0.48003712", "0.47972265", "0.47949412", "0.47798333", "0...
0.8167716
0
Gets the use_config_manage_stock of this CatalogInventoryDataStockItemInterface.
def use_config_manage_stock(self): return self._use_config_manage_stock
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_config_manage_stock(self, use_config_manage_stock):\n if use_config_manage_stock is None:\n raise ValueError(\"Invalid value for `use_config_manage_stock`, must not be `None`\")\n\n self._use_config_manage_stock = use_config_manage_stock", "def manage_stock(self):\n return...
[ "0.7722031", "0.6634055", "0.64792544", "0.56358236", "0.5609813", "0.5483396", "0.53463215", "0.5197978", "0.518479", "0.5044359", "0.50356466", "0.49315503", "0.49222347", "0.49119765", "0.48890865", "0.4875227", "0.4848512", "0.483922", "0.48281258", "0.48262256", "0.48252...
0.81873
0
Sets the use_config_manage_stock of this CatalogInventoryDataStockItemInterface.
def use_config_manage_stock(self, use_config_manage_stock): if use_config_manage_stock is None: raise ValueError("Invalid value for `use_config_manage_stock`, must not be `None`") self._use_config_manage_stock = use_config_manage_stock
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_config_manage_stock(self):\n return self._use_config_manage_stock", "def manage_stock(self, manage_stock):\n if manage_stock is None:\n raise ValueError(\"Invalid value for `manage_stock`, must not be `None`\")\n\n self._manage_stock = manage_stock", "def use_config_noti...
[ "0.7483275", "0.6988898", "0.62703776", "0.5642566", "0.56055176", "0.5460204", "0.52470833", "0.50941235", "0.5078502", "0.4991745", "0.49582088", "0.49325264", "0.4917303", "0.4881806", "0.4769797", "0.47531044", "0.473849", "0.4635192", "0.45788714", "0.456648", "0.446885"...
0.87394184
0
Gets the manage_stock of this CatalogInventoryDataStockItemInterface. Can Manage Stock
def manage_stock(self): return self._manage_stock
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def manage_stock(self, manage_stock):\n if manage_stock is None:\n raise ValueError(\"Invalid value for `manage_stock`, must not be `None`\")\n\n self._manage_stock = manage_stock", "def use_config_manage_stock(self):\n return self._use_config_manage_stock", "def C_stock(self):\...
[ "0.6881231", "0.6521614", "0.6236363", "0.6009876", "0.5975593", "0.5918671", "0.58005553", "0.55728483", "0.554656", "0.5491721", "0.5357871", "0.5247811", "0.52374095", "0.5160055", "0.515678", "0.51029384", "0.5047415", "0.5001422", "0.4988294", "0.49183485", "0.49002066",...
0.7978457
0
Sets the manage_stock of this CatalogInventoryDataStockItemInterface. Can Manage Stock
def manage_stock(self, manage_stock): if manage_stock is None: raise ValueError("Invalid value for `manage_stock`, must not be `None`") self._manage_stock = manage_stock
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_config_manage_stock(self, use_config_manage_stock):\n if use_config_manage_stock is None:\n raise ValueError(\"Invalid value for `use_config_manage_stock`, must not be `None`\")\n\n self._use_config_manage_stock = use_config_manage_stock", "def manage_stock(self):\n return...
[ "0.7088886", "0.65902215", "0.591225", "0.5660078", "0.5646257", "0.5558466", "0.52345127", "0.5119925", "0.50646347", "0.48185107", "0.47935167", "0.475518", "0.47545946", "0.47239235", "0.4701477", "0.46004668", "0.45928398", "0.4530429", "0.45266962", "0.45141485", "0.4506...
0.8597801
0
Gets the low_stock_date of this CatalogInventoryDataStockItemInterface.
def low_stock_date(self): return self._low_stock_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def low_stock_date(self, low_stock_date):\n if low_stock_date is None:\n raise ValueError(\"Invalid value for `low_stock_date`, must not be `None`\")\n\n self._low_stock_date = low_stock_date", "def Low(self, symbol, period, shift):\n data = self.get_latest_bars_values(symbol, 'Cl...
[ "0.7487333", "0.6070521", "0.60656935", "0.6063821", "0.59985596", "0.5986065", "0.5822193", "0.58211124", "0.57022965", "0.56410384", "0.562056", "0.5601489", "0.5533842", "0.5518615", "0.55094385", "0.5493798", "0.548363", "0.54642093", "0.54154986", "0.53582734", "0.533083...
0.88675076
0
Sets the low_stock_date of this CatalogInventoryDataStockItemInterface.
def low_stock_date(self, low_stock_date): if low_stock_date is None: raise ValueError("Invalid value for `low_stock_date`, must not be `None`") self._low_stock_date = low_stock_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def low_stock_date(self):\n return self._low_stock_date", "def price_low(self, price_low):\n\n self._price_low = price_low", "def in_stock(self, in_stock):\n\n self._in_stock = in_stock", "def low(self, low):\n\n self._low = low", "def low(self, low: float):\n if low is N...
[ "0.7624595", "0.62775105", "0.615145", "0.5946738", "0.5824942", "0.5797409", "0.5565986", "0.5549107", "0.5488351", "0.54764533", "0.5405144", "0.53744406", "0.5302945", "0.5276078", "0.5271436", "0.52097684", "0.5099577", "0.5049714", "0.5018856", "0.50139743", "0.50062746"...
0.8726675
0
Gets the is_decimal_divided of this CatalogInventoryDataStockItemInterface.
def is_decimal_divided(self): return self._is_decimal_divided
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_decimal_divided(self, is_decimal_divided):\n if is_decimal_divided is None:\n raise ValueError(\"Invalid value for `is_decimal_divided`, must not be `None`\")\n\n self._is_decimal_divided = is_decimal_divided", "def is_qty_decimal(self):\n return self._is_qty_decimal", "d...
[ "0.7146539", "0.6905951", "0.6211766", "0.55566233", "0.5521789", "0.5459875", "0.53326005", "0.48865214", "0.48435044", "0.48435044", "0.48435044", "0.48360842", "0.48350382", "0.4821519", "0.48111823", "0.47678158", "0.470468", "0.46775508", "0.46718267", "0.4657417", "0.46...
0.7739817
0
Sets the is_decimal_divided of this CatalogInventoryDataStockItemInterface.
def is_decimal_divided(self, is_decimal_divided): if is_decimal_divided is None: raise ValueError("Invalid value for `is_decimal_divided`, must not be `None`") self._is_decimal_divided = is_decimal_divided
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_decimal_divided(self):\n return self._is_decimal_divided", "def is_qty_decimal(self, is_qty_decimal):\n if is_qty_decimal is None:\n raise ValueError(\"Invalid value for `is_qty_decimal`, must not be `None`\")\n\n self._is_qty_decimal = is_qty_decimal", "def is_qty_decima...
[ "0.64764005", "0.62388057", "0.5587734", "0.50110537", "0.48736382", "0.47936502", "0.47781336", "0.4770498", "0.47323722", "0.4542831", "0.44505528", "0.4449099", "0.44179592", "0.4380944", "0.43666062", "0.43666062", "0.43493482", "0.432707", "0.4323585", "0.42861187", "0.4...
0.77922887
0
Gets the stock_status_changed_auto of this CatalogInventoryDataStockItemInterface.
def stock_status_changed_auto(self): return self._stock_status_changed_auto
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stock_status_changed_auto(self, stock_status_changed_auto):\n if stock_status_changed_auto is None:\n raise ValueError(\"Invalid value for `stock_status_changed_auto`, must not be `None`\")\n\n self._stock_status_changed_auto = stock_status_changed_auto", "def get_status_change(self)...
[ "0.74216986", "0.58079106", "0.5505004", "0.5447445", "0.54373705", "0.5285315", "0.5236189", "0.52336174", "0.52195394", "0.518701", "0.50662106", "0.50322956", "0.5011498", "0.5004688", "0.49897513", "0.49808118", "0.4975052", "0.49741334", "0.49739566", "0.49697", "0.49696...
0.85692155
0
Sets the stock_status_changed_auto of this CatalogInventoryDataStockItemInterface.
def stock_status_changed_auto(self, stock_status_changed_auto): if stock_status_changed_auto is None: raise ValueError("Invalid value for `stock_status_changed_auto`, must not be `None`") self._stock_status_changed_auto = stock_status_changed_auto
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stock_status_changed_auto(self):\n return self._stock_status_changed_auto", "def _on_status_change(\n self, entity: Union[str, dict], attribute: str, old: str, new: str, kwargs: dict\n ) -> None:\n if self.enabled and new == self.app.States.clean.value:\n self._start_notifi...
[ "0.76181364", "0.512375", "0.505129", "0.49343935", "0.4895544", "0.4784588", "0.47424608", "0.47155228", "0.469739", "0.469739", "0.46763486", "0.4667132", "0.4607493", "0.4595551", "0.4570285", "0.4552204", "0.4520205", "0.451351", "0.45017666", "0.44996908", "0.4497387", ...
0.8528601
0
check if inpt is divisible by i
def is_divisible(inpt:int, i:int) -> bool: return inpt%i == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_prime(inpt:int) -> bool:\n inpt_sqrt = int(math.sqrt(inpt))\n prime_flag = True\n for i in range(2,inpt_sqrt):\n if is_divisible(inpt,i):\n prime_flag = False\n break\n return prime_flag", "def is_divisible(num, n):\n return num % n == 0", "def is_prime(in...
[ "0.7124748", "0.70380265", "0.6893672", "0.68124294", "0.6719287", "0.660558", "0.66046536", "0.6550762", "0.6550762", "0.65166146", "0.6458611", "0.64167964", "0.64091724", "0.6372205", "0.63592786", "0.63218004", "0.6306962", "0.6302807", "0.6260565", "0.6198655", "0.616406...
0.89308107
1
check if a is smaller than or equal to b
def is_small(a:int, b:int) -> bool: return a <= b
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def less_equal(value, other):\n return value >= other", "def __le__(self,b):\n\n if (MODE_RELAXED_WITH_ERROR_CHECKING):\n if (isinstance(b,int) | isinstance(b,float)):\n return(self.val() <= b)\n return (self.val() <= b.val())", "def __ge__(self,b):\n\n if (MODE_RELAXED_WIT...
[ "0.7730232", "0.7686292", "0.7552178", "0.7542734", "0.7495968", "0.7386028", "0.7369707", "0.7366221", "0.71685845", "0.7168405", "0.7152617", "0.71494806", "0.71086264", "0.7095443", "0.7086574", "0.7077701", "0.7076827", "0.706681", "0.70481384", "0.7044137", "0.7039846", ...
0.7720289
1
prime numbers always take the form of 6n1 or 6n+1. This function generates the probable prime numbers closet to n
def get_probable_prime(n: int) -> [int]: return [6*n-1, 6*n+1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_prime_less_than_n(n):\n\tif n <= 1:\n\t\treturn []\n\tlist_of_primes = [2]\n\tfor i in range(3, n, 2):\n\t\tis_prime = True\n\t\tfor j in list_of_primes:\n\t\t\tif i%j == 0:\n\t\t\t\tis_prime = False\n\t\t\t\tbreak\n\t\tif is_prime:\n\t\t\tlist_of_primes.append(i)\n\treturn list_of_primes", "def pri...
[ "0.77707016", "0.77372646", "0.77033544", "0.7528576", "0.75274915", "0.7521642", "0.74514866", "0.7443196", "0.7402754", "0.7367272", "0.73592633", "0.73122007", "0.73020935", "0.72997165", "0.7276363", "0.726544", "0.72315097", "0.7227568", "0.72053105", "0.71984684", "0.71...
0.8130297
0
In Ecdsa, both the key and the algorithm define the curve. Therefore, we must cross check them to make sure they're the same.
def _cross_check(self, pub_key): if self.curve_name != pub_key.curve.name: raise ValueError( "The curve in private key {} and in algorithm {} don't " "match".format(pub_key.curve.name, self.curve_name) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_curve(curve):\n # What follows is the implementation of the verification algorithm\n # described in \"The Elliptic Curve Digital Signature Algorithm (ECDSA)\",\n # from Certicom. There just a few difference between the original algorithm\n # and the implementation:\n #\n # * a few vari...
[ "0.69966555", "0.6396786", "0.62817574", "0.62024045", "0.6101042", "0.6004728", "0.59993035", "0.5965947", "0.59402853", "0.5920437", "0.5841999", "0.5837382", "0.5837382", "0.5814975", "0.5814385", "0.5777221", "0.5756495", "0.574122", "0.57200557", "0.5719173", "0.57122946...
0.70180726
0
Split raw signature into components
def _split_raw_signature(sig): c_length = len(sig) // 2 r = int.from_bytes(sig[:c_length], byteorder="big") s = int.from_bytes(sig[c_length:], byteorder="big") return r, s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split(self, encoded):\n maxlen = len(encoded) - self.sig_size\n message = encoded[:maxlen]\n signature = encoded[-self.sig_size:]\n return message, signature", "def read_signature(self):\n sig = []\n for i in range(7):\n self.writecmd(self.APP, self.WRITE3...
[ "0.71689254", "0.6163025", "0.6060242", "0.59594434", "0.5925653", "0.5814993", "0.57588875", "0.5754469", "0.5746558", "0.57071865", "0.5704409", "0.57011765", "0.56883764", "0.56661487", "0.56457096", "0.5630938", "0.56128746", "0.55236655", "0.55210525", "0.54760534", "0.5...
0.7471651
0
Plot chain behaviour note burnin; lec2p84
def plot_chain(chain): labels = ['a', 'b'] plt.figure(figsize=(20,6)) for i_dim in range(2): plt.subplot(2,1,i_dim+1) plt.ylabel(labels[i_dim]) for i in range(100): plt.plot(chain[i,:,i_dim],color='black', alpha=0.5) plt.show()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showCl(ell,temps,title='CAMB ISWout power spectrum'):\n plt.plot(ell,temps*ell*(ell+1)/(2*np.pi) *1e12) #1e12 to convert to microK**2\n plt.xlabel('multipole moment l')\n plt.ylabel('l(l+1)C_l/(2pi) [microK**2]')\n plt.title(title)\n plt.show()", "def test_lightcurve_seismology_plot():\n KeplerLightC...
[ "0.6630017", "0.61266357", "0.6058459", "0.60341555", "0.60057837", "0.59446126", "0.59037614", "0.58821213", "0.582717", "0.5826227", "0.5821024", "0.58198303", "0.57920265", "0.5771428", "0.57407886", "0.5730576", "0.5723885", "0.5718329", "0.57050085", "0.5674537", "0.5667...
0.6172355
1
Downloads latest World Bank data about inflation (Inflation, consumer prices (annual %).
def get_inflation_country(): print(">> Downloading WORLD BANK inflation / country data...") url = source_config.inflation_data_url['latest'] output_file = source_config.inflation_data_files['raw']['latest'] download_insee_excel(url, output_file, check=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download(self, verbose):\n # Download datasets\n if verbose:\n print(\"Retrieving datasets from Our World In Data https://github.com/owid/covid-19-data/\")\n # Vaccinations\n v_rec_cols = [\n \"date\", \"location\", \"iso_code\", \"total_vaccinations\", \"peopl...
[ "0.60911626", "0.60792255", "0.58782333", "0.58365494", "0.5690431", "0.5673184", "0.56617993", "0.56413186", "0.5636891", "0.55494046", "0.5541937", "0.5482949", "0.5473343", "0.54609346", "0.53968143", "0.53869134", "0.53431237", "0.5323014", "0.5309729", "0.5308688", "0.52...
0.70141035
0
Remove entry which has the exact match fo the provided entry id
def delete(self, entry_id: str): try: return self.entries.pop(entry_id) except KeyError as error: raise errors.NoEntryFound(f'No entries found which match {entry_id}') from error
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_entry(self, id, **args):\n args.update(id=id)\n return self.fetch(\"/entry/delete\", post_args=args)", "def delete(self, entry): # Hashmap.delete\n\n entry.delete()\n\n # remove the entry from the hashmap\n list=self.contentHash[entry.hexdigest]\n ...
[ "0.69431645", "0.6742094", "0.67380154", "0.650732", "0.6404718", "0.633647", "0.6330609", "0.6325838", "0.63038117", "0.6279447", "0.6248761", "0.6226974", "0.62159073", "0.61948925", "0.614364", "0.6136389", "0.6119748", "0.61185694", "0.6102266", "0.60815126", "0.6055276",...
0.75094396
0
Sends a request for create bucket.
def create_bucket(request: Dict) -> Dict: global config body = { "user_name": request.get("user_name"), "prefix": request.get("bucket_name")[0:5], "bucket_name": request.get("bucket_name"), "region": request.get("region") } response = requests.post(url=config.api_url('b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_bucket() -> None:\n try:\n client.make_bucket(DATASETS_BUCKET)\n except BucketAlreadyOwnedByYou:\n logger.debug(f\"Not creating bucket {DATASETS_BUCKET}: Bucket already exists\")\n pass\n else:\n logger.debug(f\"Successfully created bucket {DATASETS_BUCKET}\")", "d...
[ "0.7268917", "0.72350144", "0.71917516", "0.7178929", "0.7134123", "0.7132841", "0.71156895", "0.7039842", "0.7039621", "0.6998525", "0.6974917", "0.69291985", "0.688214", "0.68154687", "0.6755411", "0.6670716", "0.6648014", "0.6583582", "0.6572932", "0.6542685", "0.65272015"...
0.80620974
0
Try multiple times to delete a folder.
def delete_with_retry(folder): for _i in range(0, 5): try: if os.path.exists(folder): shutil.rmtree(folder) return except: time.sleep(0.1) print("Could not delete directory after 5 attempts: %s" % folder) sys.exit(1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deleteImageFolder(pause=5):\n try:\n shutil.rmtree(imageFolder)\n except PermissionError:\n # Still busy creating the montage or something. Try once more\n time.sleep(pause)\n shutil.rmtree(imageFolder)\n except FileNotFoundError:\n # Folder already gone\n pas...
[ "0.7173457", "0.66229296", "0.6606876", "0.65943515", "0.657908", "0.65214545", "0.63630116", "0.63613534", "0.6338868", "0.63102597", "0.63082224", "0.62873816", "0.62683487", "0.62346834", "0.620311", "0.618517", "0.6168157", "0.6117375", "0.6092481", "0.6092467", "0.608041...
0.77605695
0
Produces a readable string from a metric function. Update when adding more metrics.
def function_name_to_string(func): if func == statistical_parity_difference: return "Statistical Parity Difference" if func == theil_index: return "Theil Index" if func == equal_opportunity_difference: return "Equal Opportunity Difference" if func == disparate_impact: ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_metric_fn(metric):\n metrics = {'accuracy': accuracy, 'acc': accuracy, 'mean_squared_error': mean_squared_error, 'mse': mean_squared_error, 'sum_squared_error': sum_squared_error, 'sse': sum_squared_error, 'mean_absolute_error': mean_absolute_error, 'mae': mean_absolute_error, 'r_squared': r_squared, 'r...
[ "0.71861994", "0.65279025", "0.6446059", "0.63854593", "0.63517827", "0.62838453", "0.6222288", "0.62014765", "0.6174949", "0.6087177", "0.6081736", "0.6036288", "0.6035076", "0.6002334", "0.5998853", "0.5989892", "0.5972227", "0.5947451", "0.59400344", "0.59315836", "0.59074...
0.6936505
1
Already normalized URLs should not change
def test_normalized_urls(): assert normalize_url("http://example.com/") == "http://example.com/"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_url(self, url):\n pass", "def test_non_ideal_inputs():\n assert normalize_url(\"example.com\") == \"http://example.com/\"\n assert normalize_url(\"example.com/abc\") == \"http://example.com/abc\"\n assert normalize_url(\"//example.com/abc\") == \"http://example.com/abc\"", "def ca...
[ "0.80936056", "0.7450277", "0.7390457", "0.71778667", "0.71492064", "0.7061588", "0.7039615", "0.6993132", "0.69782037", "0.6913933", "0.6855782", "0.67926526", "0.67904544", "0.6787183", "0.6767318", "0.6761049", "0.6731012", "0.67292196", "0.6699599", "0.669248", "0.6653924...
0.7806277
1
Normalized URL scheme and host are lower case
def test_lower_case(): assert normalize_url("HTTP://examPle.cOm/") == "http://example.com/" assert normalize_url("http://example.com/A") == "http://example.com/A"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_parse_url_lowercase_host() -> None:\n assert indieauth._parse_url(\"http://ex.com/hello\").path == \"/hello\"\n assert indieauth._parse_url(\"http://EX.COM/hello\").hostname == \"ex.com\"\n\n parts = indieauth._parse_url(\"http://EX.COM:123/HELLO\")\n assert parts.netloc == \"ex.com:123\"\n ...
[ "0.75291586", "0.70413584", "0.68873245", "0.68859047", "0.68198794", "0.67194057", "0.66475123", "0.65861493", "0.6548922", "0.6519325", "0.6510496", "0.650889", "0.64106107", "0.6396952", "0.63965863", "0.63908243", "0.6380599", "0.6366126", "0.636042", "0.63571966", "0.635...
0.75430727
0
All letters in percentencoded triplets should be capitalized
def test_capitalize_escape_sequence(): assert (normalize_url("http://www.example.com/a%c2%b1b") == "http://www.example.com/a%C2%B1b")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def not_capitalized(): # noqa: D416", "def proper_title_case(s):\n nocaps = [\"the\"] # This needs to be extended.", "def capitalize(result):\n\treturn result.upper()", "def capify(text):\n return text[0].upper() + text[1:]", "def UPPER(text):\n return text.upper()", "def mixed_pascal_case(value:...
[ "0.695694", "0.672936", "0.66558266", "0.6606252", "0.6600608", "0.6508914", "0.64711314", "0.64304394", "0.64255404", "0.6423257", "0.63985324", "0.63876307", "0.6382943", "0.6378602", "0.63733494", "0.6337887", "0.6305954", "0.6282613", "0.6280531", "0.6273028", "0.6266303"...
0.6890168
1
Unreserved characters should not be percent encoded. If they are, they should be decoded back; except in case of `/`, `?` and ``
def test_unreserved_percentencoding(): assert (normalize_url("http://www.example.com/%7Eusername/") == "http://www.example.com/~username") assert (normalize_url('http://example.com/foo%23bar') == 'http://example.com/foo%23bar') assert (normalize_url('http://example.com/foo%2fbar') ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dont_percent_encode_safe_chars_query():\n assert (normalize_url(\"http://example.com/a/?face=(-.-)\") ==\n \"http://example.com/a?face=(-.-)\")", "def test_normalize_percent_encoding_in_querystring():\n assert (normalize_url(\"http://example.com/?a=b%c2\") ==\n \"http://examp...
[ "0.73239917", "0.71723187", "0.6829424", "0.67798036", "0.6701131", "0.6680733", "0.66560006", "0.6631045", "0.6615315", "0.6614577", "0.65428436", "0.6474398", "0.64709854", "0.6377269", "0.6363291", "0.6333265", "0.6272042", "0.62531614", "0.6245407", "0.6200029", "0.614628...
0.79426664
0
Remove the default port for the scheme if it's present in the URL
def test_remove_default_port(): assert (normalize_url("http://www.example.com:80/bar.html") == "http://www.example.com/bar.html") assert (normalize_url("HTTPS://example.com:443/abc/") == "https://example.com/abc")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_remove_empty_port():\n assert (normalize_url(\"http://www.example.com:/\") ==\n \"http://www.example.com/\")", "def _update_url_scheme(self, url):\n if self.base_scheme and not url.startswith(\"%s://\" % self.base_scheme):\n # url_split = urlparse.urlsplit(url)\n ...
[ "0.6817882", "0.6635306", "0.6620428", "0.6325559", "0.6234725", "0.61439985", "0.60767", "0.5947704", "0.590194", "0.5691487", "0.56874627", "0.5683027", "0.5659535", "0.565335", "0.56129", "0.5600814", "0.55720544", "0.55204403", "0.5507017", "0.54987186", "0.5437835", "0...
0.7702838
0
Remove empty port from URL
def test_remove_empty_port(): assert (normalize_url("http://www.example.com:/") == "http://www.example.com/")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_remove_default_port():\n assert (normalize_url(\"http://www.example.com:80/bar.html\") ==\n \"http://www.example.com/bar.html\")\n assert (normalize_url(\"HTTPS://example.com:443/abc/\") ==\n \"https://example.com/abc\")", "def url_unsplit(parts):\n if parts[2] == default_...
[ "0.78728104", "0.7017148", "0.66559845", "0.66160035", "0.6599198", "0.65612745", "0.6547301", "0.65447694", "0.6487588", "0.6444705", "0.6418775", "0.6393693", "0.63416445", "0.6330125", "0.6289558", "0.62707484", "0.62571645", "0.62467927", "0.62220925", "0.6221152", "0.621...
0.82335514
0
Remove any extra slashes if present in the URl
def test_remove_extra_slash(): # TODO: Should we actually do this? # TODO: See https://webmasters.stackexchange.com/questions/8354/what-does-the-double-slash-mean-in-urls/8381#8381 assert (normalize_url("http://www.example.com/foo//bar.html") == "http://www.example.com/foo/bar.html") assert(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strip_beginning_slashes(url):\n find = re.search(r\"^/+\", url)\n if find:\n url = re.sub(find.group(0), \"\", url)\n return url", "def cleanUri(uri):\n if not uri.startswith(\"/\") and not uri.startswith('http'):\n uri = \"/\" + uri\n\n if 'http://' in ur...
[ "0.7646147", "0.7558966", "0.7331258", "0.7244849", "0.7211935", "0.7194954", "0.71456826", "0.70143455", "0.70108616", "0.69648534", "0.69269395", "0.6919664", "0.688389", "0.687376", "0.68683535", "0.68037844", "0.6799505", "0.6799505", "0.6752015", "0.67402303", "0.6711772...
0.7617896
1
Query strings should be handled properly
def test_query_string(): assert (normalize_url("http://example.com/?a=1") == "http://example.com/?a=1") assert (normalize_url("http://example.com?a=1") == "http://example.com/?a=1") assert (normalize_url("http://example.com/a?b=1") == "http://example.com/a?b=1") asser...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_query_string(self):\r\n pass", "def test_additional_query_args():\n assert (normalize_url(\"http://example.com?c=d\", [(\"a\", \"b\")]) ==\n \"http://example.com/?a=b&c=d\")\n assert (normalize_url(\"http://example.com\", [(\"a\", \"b\")]) ==\n \"http://example.com/?a=b...
[ "0.70629734", "0.6607377", "0.6477855", "0.6382781", "0.63372815", "0.62849826", "0.6153934", "0.60916984", "0.60639215", "0.6032231", "0.6032231", "0.59980375", "0.59662795", "0.5912838", "0.5911675", "0.5906835", "0.5902635", "0.5895102", "0.58852124", "0.58743584", "0.5873...
0.6636974
1
Don't percentencode safe characters in querystring
def test_dont_percent_encode_safe_chars_query(): assert (normalize_url("http://example.com/a/?face=(-.-)") == "http://example.com/a?face=(-.-)")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_percent_encode_querystring():\n assert (normalize_url(\"http://example.com/?a=hello{}\") ==\n \"http://example.com/?a=hello%7B%7D\")", "def test_normalize_percent_encoding_in_querystring():\n assert (normalize_url(\"http://example.com/?a=b%c2\") ==\n \"http://example.com/?a=b...
[ "0.7838242", "0.7604944", "0.7220336", "0.7061399", "0.7060529", "0.70427585", "0.6982615", "0.6802842", "0.67837054", "0.67530596", "0.67517877", "0.6700344", "0.66819686", "0.6653729", "0.6521748", "0.6473394", "0.64714706", "0.6408597", "0.64064276", "0.63948035", "0.63916...
0.76571053
1
Query strings should be sorted
def test_query_sorting(): assert (normalize_url('http://example.com/a?b=1&c=2') == 'http://example.com/a?b=1&c=2') assert (normalize_url('http://example.com/a?c=2&b=1') == 'http://example.com/a?b=1&c=2')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_urlencode(data):\n return urlencode(sorted(data.items(), key=lambda v: v[0]), doseq=True)", "def normalize_params(url, params):\n # parse the url\n parse = urlparse(url)\n\n # Get the query list\n qs_list = parse_qsl(parse.query, keep_blank_values=True)\n must_encode = False if parse.q...
[ "0.638539", "0.6298537", "0.6269837", "0.61539626", "0.6091813", "0.60124403", "0.5911215", "0.59000266", "0.58928496", "0.5869989", "0.5843703", "0.5842816", "0.5842816", "0.58353937", "0.57198036", "0.5705789", "0.5694268", "0.5652529", "0.5650955", "0.5645522", "0.56145656...
0.7346649
0
Spaces should be handled properly in query strings
def test_query_string_spaces(): assert (normalize_url("http://example.com/search?q=a b&a=1") == "http://example.com/search?a=1&q=a+b") assert (normalize_url("http://example.com/search?q=a+b&a=1") == "http://example.com/search?a=1&q=a+b") assert (normalize_url("http://example.com/sear...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encoded_query_str(request):\n return updated_query_str(request)", "def get_query_string(self):\r\n pass", "def _get_query_part(params: dict) -> str:\n params_cleaned = {k: v for k, v in params.items() if v is not None}\n return ('?' + urlencode(params_cleaned, quote_via=quote, safe=...
[ "0.693126", "0.663083", "0.6332608", "0.62282026", "0.6212742", "0.6075841", "0.6020288", "0.6011464", "0.6000209", "0.599031", "0.59864056", "0.5967066", "0.5967066", "0.5965967", "0.59395134", "0.59291124", "0.591009", "0.5899856", "0.5899014", "0.58780706", "0.5855681", ...
0.7148496
0
Nonsafe characters in query string should be percentencoded
def test_percent_encode_querystring(): assert (normalize_url("http://example.com/?a=hello{}") == "http://example.com/?a=hello%7B%7D")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dont_percent_encode_safe_chars_query():\n assert (normalize_url(\"http://example.com/a/?face=(-.-)\") ==\n \"http://example.com/a?face=(-.-)\")", "def test_normalize_percent_encoding_in_querystring():\n assert (normalize_url(\"http://example.com/?a=b%c2\") ==\n \"http://examp...
[ "0.75836927", "0.752747", "0.71601546", "0.69156283", "0.68220234", "0.67968655", "0.6755427", "0.67004645", "0.66996515", "0.6671481", "0.6576877", "0.6541245", "0.6490959", "0.6478959", "0.63890654", "0.63871044", "0.63544774", "0.63260144", "0.63013357", "0.62914425", "0.6...
0.771994
0
Percentencoded querystring should be uppercased
def test_normalize_percent_encoding_in_querystring(): assert (normalize_url("http://example.com/?a=b%c2") == "http://example.com/?a=b%C2")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_percent_encode_querystring():\n assert (normalize_url(\"http://example.com/?a=hello{}\") ==\n \"http://example.com/?a=hello%7B%7D\")", "def test_dont_percent_encode_safe_chars_query():\n assert (normalize_url(\"http://example.com/a/?face=(-.-)\") ==\n \"http://example.com/a?f...
[ "0.7606251", "0.7257009", "0.71933436", "0.68995583", "0.689189", "0.67764246", "0.67158705", "0.6649388", "0.650465", "0.6495439", "0.6454537", "0.63059634", "0.6280331", "0.62521416", "0.62027097", "0.61813676", "0.6092861", "0.6085483", "0.6077384", "0.6069134", "0.6059161...
0.76406443
0
Unicode path should be converted to bytes using utf8 encoding and then percentencoded
def test_unicode_path(): assert (normalize_url("http://example.com/résumé") == "http://example.com/r%C3%A9sum%C3%A9")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_path_percent_encoding():\n assert (normalize_url(\"http://example.com/hello world{}\") ==\n \"http://example.com/hello%20world%7B%7D\")", "def normalizeNativePath(path: unicode) -> unicode:\n ...", "def safe_path(path, encoding=\"utf8\"):\n return ensure_unicode(path, encoding)...
[ "0.700023", "0.6611255", "0.6537133", "0.650093", "0.6413428", "0.6353395", "0.6317766", "0.62798023", "0.625372", "0.62475395", "0.61970717", "0.5990364", "0.59868205", "0.5970357", "0.59674084", "0.59631145", "0.59512985", "0.5949845", "0.59106404", "0.59105504", "0.589329"...
0.690183
1
Nonstring input should produce None as result
def test_non_string_input(): assert normalize_url(None) is None assert normalize_url([]) is None assert normalize_url(123) is None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_typeerror_in_case_of_string(self):\n eq_(None,grepit(\"\",\"\",\"\"))", "def changenonetoNone(s):\r\n if s=='None':\r\n return None\r\n else:\r\n return s", "def process(self, value):\n return six.text_type(value) if value is not None else None", "def test_none_inpu...
[ "0.6584048", "0.6451131", "0.64066213", "0.63871485", "0.63837194", "0.6346811", "0.6340591", "0.62146676", "0.62050724", "0.6202448", "0.6184388", "0.6177943", "0.6156243", "0.6134517", "0.61243534", "0.6118167", "0.6085184", "0.6080812", "0.606949", "0.6043982", "0.60369635...
0.65122545
1
Set up entity graphics/physics usig a gym_render.Viewer and a pm.Space. Only gets called once.
def setup(self, viewer, space, phys_vars): self.shapes = [] self.bodies = [] self.viewer = weakref.proxy(viewer) self.space = weakref.proxy(space) self.phys_vars = weakref.proxy(phys_vars)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setupWidget(self):\r\n self.generateCoordinates()\r\n self.modifyCoordinateLists()\r\n self.settings.movementMatrix = self.movementMatrix\r\n self.settings.ghostIntersectionList = self.ghostIntersectionList\r\n self.createBodies()\r\n print(\"GameW set\")", "def run(...
[ "0.6658661", "0.6633929", "0.6459061", "0.6443518", "0.63135004", "0.6300007", "0.62696075", "0.6229478", "0.620265", "0.6172429", "0.6163641", "0.6128417", "0.61179525", "0.61125684", "0.6073528", "0.6056664", "0.6046358", "0.5996895", "0.5961263", "0.59228784", "0.590066", ...
0.7057456
0
Produce signature necessary to reconstruct this entity in its current pose. This is useful for creating new scenarios out of existing world states.
def reconstruct_signature(self): raise NotImplementedError( f"no .reconstruct_signature() implementation for object " f"'{self}' of type '{type(self)}'")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSignature(self):\n if self.uniqueId is None:\n error_msg = (\n f'No id has been defined for elementary '\n f'expression {self.name}.'\n )\n raise excep.biogemeError(error_msg)\n if self.rvId is None:\n error_msg = (\n ...
[ "0.5937074", "0.5895051", "0.5895051", "0.5862878", "0.58125865", "0.57615745", "0.5758363", "0.5747716", "0.5729969", "0.570098", "0.5696568", "0.5696568", "0.5696568", "0.56790686", "0.5652782", "0.5647823", "0.559355", "0.55804163", "0.5532407", "0.55293965", "0.55129504",...
0.7482861
0
Generate a new, unique group ID. Intended to be called from `.setup()` when creating `ShapeFilter`s.
def generate_group_id(self): if not hasattr(self.space, '_group_ctr'): self.space._group_ctr = 999 self.space._group_ctr += 1 return self.space._group_ctr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_new_group_id():\n new_group = data_types.TestcaseGroup()\n new_group.put()\n return new_group.key.id()", "def gen_id(self) -> str:\n self._id += 1\n return str(self._id)", "def group_id(self):\n # type: () -> string_types\n return self._group_id", "def make_id():\n ...
[ "0.7083022", "0.6904719", "0.6866619", "0.6860459", "0.6840841", "0.6840841", "0.6734212", "0.67269933", "0.6719995", "0.6708607", "0.6661025", "0.6633402", "0.6606178", "0.6594278", "0.6578165", "0.65651894", "0.65359145", "0.65204656", "0.6500551", "0.65003645", "0.6498613"...
0.7447955
0
Stringformat a reconstruction signature. Makes things as easy to cutandpaste as possible.
def format_reconstruct_signature(cls, kwargs): prefix = " " kwargs_sig_parts = [] for k, v in sorted(kwargs.items()): v_str = str(v) if isinstance(v, pm.vec2d.Vec2d): v_str = "(%.5g, %.5g)" % (v.x, v.y) elif isinstance(v, float): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_signature(sig: inspect.Signature, colon: bool) -> str:\n # First get a list with all params as strings.\n result = pdoc.doc._PrettySignature._params(sig) # type: ignore\n return_annot = pdoc.doc._PrettySignature._return_annotation_str(sig) # type: ignore\n\n multiline = (\n sum(len(...
[ "0.647762", "0.6295296", "0.6062271", "0.60274816", "0.5892908", "0.58807266", "0.5876426", "0.58379126", "0.58050066", "0.5756533", "0.5734407", "0.572193", "0.5605265", "0.5602256", "0.55908644", "0.55876124", "0.5567836", "0.55375737", "0.5536726", "0.5465144", "0.54495764...
0.7134458
0
For adding a body or shape to the Pymunk 'space'. Keeps track of shapes/bodies so they can be used later. Should be called instead of space.add().
def add_to_space(self, *objects): for obj in objects: self.space.add(obj) if isinstance(obj, pm.Body): self.bodies.append(obj) elif isinstance(obj, pm.Shape): self.shapes.append(obj) elif isinstance(obj, pm.Constraint): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_body(self,body):\n if body.id == 0:\n body.update_id(len(self.bodies)+1)\n else:\n body_ids = [b.id for b in self.bodies]\n if body.id in body_ids:\n print(\"Error: specified body id has already been assigned\")\n print(\"Assignin...
[ "0.66220504", "0.66193455", "0.64473313", "0.6223459", "0.6192691", "0.6186771", "0.6166839", "0.6090288", "0.5950262", "0.5947756", "0.58840626", "0.585172", "0.58295333", "0.56849504", "0.5619962", "0.5575787", "0.5553358", "0.55424637", "0.552969", "0.545505", "0.54473245"...
0.7037855
0
Build a reverse index mapping shapes to entities. Assumes that all the shapes which make up an entity are stored as attributes on the shape, or are attached to bodies which are stored as attributes on the shape.
def __init__(self, entities): self._shape_to_ent = dict() self._ent_to_shapes = dict() for entity in entities: shapes = entity.shapes self._ent_to_shapes[entity] = shapes for shape in shapes: assert shape not in self._shape_to_ent, \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_index(shapes_with_props):\n index = rtree.index.Index()\n for id, shape_with_props in enumerate(shapes_with_props):\n index.insert(id, shape_with_props.shape.bounds)\n return index", "def makeIndexMap(self):\n\t\tn = self.numRects\n\t\thalfList = [[(j,n-1-i+j) for j in range(i+1)] for ...
[ "0.6454739", "0.5900447", "0.5767752", "0.5571386", "0.54612595", "0.5460997", "0.5456802", "0.5382273", "0.5353853", "0.53060925", "0.5254972", "0.5196915", "0.51967275", "0.5191382", "0.51094687", "0.50944465", "0.5081444", "0.50772876", "0.5053751", "0.5049261", "0.5006448...
0.6232867
1
Look up the entity associated with a particular shape. Raises `KeyError` if no known entity owns the shape.
def entity_for(self, shape): return self._shape_to_ent[shape]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_entity_by_key(cls, key):\n db_key = \"entity:\" + str(key)\n result = cls.db.hgetall(db_key)\n return (Entity.build(result) if type(result) is dict else None)", "def __getitem__(self, key):\n if isinstance(key, str):\n phone = EntityDatabase.parse_phone(key)\n ...
[ "0.59317636", "0.5680782", "0.5509411", "0.5478308", "0.54487187", "0.53354627", "0.53105116", "0.52741706", "0.5255828", "0.52513313", "0.52487326", "0.52347624", "0.51512223", "0.513411", "0.5109643", "0.5065446", "0.50578374", "0.5040191", "0.5040191", "0.5040191", "0.5014...
0.752408
0
Return a set of shapes associated with the given entity. Raises `KeyError` if the given entity is not in the index.
def shapes_for(self, ent): return self._ent_to_shapes[ent]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entity_for(self, shape):\n return self._shape_to_ent[shape]", "def get_overlapping_ents(self,\n ent_index,\n contained=False,\n com_overlap=False):\n\n # first look up all overlapping shapes\n shape_resul...
[ "0.5066684", "0.4831198", "0.47776592", "0.47655448", "0.47344264", "0.47162902", "0.46960396", "0.4667619", "0.46639523", "0.46452275", "0.46302116", "0.45944044", "0.4550667", "0.45101157", "0.4498719", "0.44973597", "0.4494919", "0.44940457", "0.44487733", "0.44425076", "0...
0.69238263
0
Make annoying finger polygons coordinates. Corresponding composite shape will have origin at root of upper arm, with upper arm oriented straight upwards and forearm above it.
def make_finger_vertices(upper_arm_len, forearm_len, thickness, side_sign): up_shift = upper_arm_len / 2 upper_arm_vertices = gtools.rect_verts(thickness, upper_arm_len) forearm_vertices = gtools.rect_verts(thickness, forearm_len) # now rotate upper arm into place & then move it to correct position ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_main_shape(self):\n\n a, b = gc( self.size/2,\n self._ZERO_DEGREES - self.angle,\n self._180_DEGREES + self.angle)\n self.wafer_points = zip(a,b)\n self.wafer_polygon = gdspy.Polygon(self.wafer_points, self.WAFER_LAYER)\n self.cell.add(self.wafe...
[ "0.6419428", "0.6267348", "0.60706836", "0.6067298", "0.59864885", "0.57714915", "0.5734308", "0.57114834", "0.56954986", "0.56725013", "0.56681293", "0.56552523", "0.5653419", "0.5640796", "0.563211", "0.56195414", "0.5607822", "0.5585548", "0.5562158", "0.55480707", "0.5514...
0.6484623
0
Called when a UDP send or receive operation fails.
def error_received(self, exc: Exception) -> None: _log.exception('UDP operation failed')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error_received(self, exc: Optional[Exception]) -> None:\n if exc:\n logger.error(f\"udp client received error {exc}\")\n else:\n warn(\"udp client received error\")", "def connection_lost(self, exc: Optional[Exception]) -> None:\n _log.error('UDP connection lost: %s...
[ "0.6693878", "0.65745896", "0.6178659", "0.61000025", "0.6083509", "0.60036427", "0.59986514", "0.59436136", "0.59216225", "0.5836974", "0.58261806", "0.5768924", "0.5767345", "0.57544637", "0.5730706", "0.5682008", "0.5677033", "0.56735796", "0.5585505", "0.5568424", "0.5552...
0.7921559
0
Yield all CIFAR models.
def cifar_models(cls, n=(1, 3, 5, 7, 9, 18), **kwargs): for kwargs in iter_args(n=n, **kwargs): yield cls.cifar_model(**kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_model_instances(self) -> Iterator['panda_core_data.model.Model']:\n for current_type in self.all_models:\n for current_instance in current_type.all_instances:\n yield current_instance", "def iter_models(self):\n return iter(self.model_list)", "def iter_all_atoms(...
[ "0.6118586", "0.6040329", "0.5969244", "0.5802256", "0.56980544", "0.56973696", "0.5682258", "0.56334466", "0.55769765", "0.5483144", "0.5449158", "0.54275596", "0.53856874", "0.5357949", "0.53150994", "0.5312735", "0.52937406", "0.5288699", "0.5283068", "0.5279897", "0.52506...
0.6916726
0
Yield all combinations of classes. This iterator will yield every class constructed by using the classes in ``classes`` as bases. Therefor every permutation is used,except for those in ``blacklist``.
def iter_cls(*classes, blacklist=tuple()): for bases in permutations(classes): if bases not in blacklist: yield type('_'.join(c.__name__ for c in bases), bases, {})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iter_classes(base_class, *modules, class_filter=None):\n for root_module in modules:\n try:\n module_repo = walk_modules(root_module)\n except:\n continue\n for module in module_repo:\n for obj in vars(module).values():\n if inspect.isclas...
[ "0.6291246", "0.62573457", "0.62293345", "0.6193518", "0.61564445", "0.5899157", "0.58592594", "0.56422627", "0.5612561", "0.5609776", "0.5607033", "0.5599381", "0.5584719", "0.55144477", "0.55086356", "0.5493373", "0.5419266", "0.54187065", "0.5331383", "0.5300703", "0.52835...
0.782913
0
Check if the shape of two layer's attributes are equal.
def check_shape(layer1, layer2, attr): attr1 = getattr(layer1, attr, None) attr2 = getattr(layer2, attr, None) if not attr1: return not attr2 return all(attr1.shape.eval() == attr2.shape.eval())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_has_same_shape(first_obj, second_obj, attr):\n # Support legacy `lace.mesh.Mesh`, where attrs are set to `None` instead\n # of empty arrays.\n first, second = getattr(first_obj, attr), getattr(second_obj, attr)\n if first is None or second is None:\n return first is second\n else:\n ...
[ "0.7566622", "0.7217309", "0.707955", "0.7047277", "0.6908663", "0.68247074", "0.67450213", "0.6636978", "0.6615113", "0.65929115", "0.65574336", "0.6513594", "0.638343", "0.63770235", "0.63256437", "0.6319151", "0.62722737", "0.6268737", "0.62417793", "0.6224943", "0.6216101...
0.8462539
0
Check if the attributes of two layers have the same values.
def check_values(layer1, layer2, attr): attr1 = getattr(layer1, attr, None) attr2 = getattr(layer2, attr, None) if not attr1: return not attr2 return numpy.allclose(attr1.eval(), attr2.eval())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compare_attributes_of_interpolate1(self, first: Node, second: Node) -> bool:\n # If some of attributes 'mode', 'align_corners', 'antialias', 'pads_begin', 'pads_end' are different,\n # then attributes of nodes are not identical.\n op = Interpolate(graph=first.graph, attrs={})\n for...
[ "0.7313786", "0.7280166", "0.72727317", "0.6993547", "0.6987774", "0.6683126", "0.667661", "0.6628342", "0.6596604", "0.6583598", "0.64989346", "0.6444834", "0.6414683", "0.6379242", "0.6368914", "0.63592577", "0.6356517", "0.63281304", "0.6325872", "0.6317631", "0.6317531", ...
0.80315936
0
Combines two IntSets in one IntSet from digits of their sum
def merge(self, other): result = IntSet(0) len_first = len(self) len_second = len(other) if len_first >= len_second: for i in range(len_second): num = self._nums[i] + other[i] for digit in self._digits(num): result.append(di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def int_sets(set_1, set_2):\n sets = [set_1, set_2]\n\n # Changing numbers to int\n for set_number in sets:\n for number in range(len(set_number)):\n set_number.append(int(set_number[0]))\n set_number.remove(set_number[0])\n \n return set_1, set_2", "def union(set1, se...
[ "0.74064505", "0.6692085", "0.6616193", "0.6325094", "0.6035918", "0.5878318", "0.5870363", "0.5787526", "0.5768754", "0.5756436", "0.57377356", "0.5736777", "0.57215214", "0.5670144", "0.56505495", "0.55900174", "0.55898786", "0.55898786", "0.5585727", "0.55690634", "0.55422...
0.75679064
0
Joins a voice channel
async def join(ctx): channel = ctx.message.author.voice.channel if ctx.voice_client is not None: return await ctx.voice_client.move_to(channel) await channel.connect()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def join(self, ctx, *, channel: discord.VoiceChannel):\n \n if ctx.voice_client is not None:\n return await ctx.voice_client.move_to(channel)\n else:\n return await ctx.voice_client.move_to(bot.get_channel(247531960488951815))\n \n await channel.co...
[ "0.7855269", "0.78503644", "0.7845743", "0.77792126", "0.76722926", "0.7640289", "0.7626071", "0.7569231", "0.7540894", "0.75228244", "0.747141", "0.7458129", "0.73575187", "0.71777314", "0.71629083", "0.710966", "0.7098173", "0.70384675", "0.68363094", "0.6814906", "0.675819...
0.80329084
0
Stops and disconnects the bot from voice
async def stop(ctx): await ctx.voice_client.disconnect()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def stop(self, ctx):\n\n await ctx.voice_client.disconnect()", "async def stop(self, ctx):\n\n await ctx.voice_client.disconnect()", "async def stop(self, ctx):\n if ctx.voice_client != None:\n await ctx.voice_client.disconnect()", "async def disconnect(ctx):\n if ctx...
[ "0.8160133", "0.8160133", "0.8103641", "0.7832356", "0.78208613", "0.7730885", "0.7346226", "0.7139643", "0.7118765", "0.7109819", "0.6940987", "0.693769", "0.685061", "0.67579037", "0.6684182", "0.66471213", "0.66324794", "0.6596318", "0.65958595", "0.6570528", "0.6538629", ...
0.8496473
0
Print metrics for a trained classifier to stdout. This will print the classification report from scikitlearn for the test and training sample and the confusion matrix for the test and training sample. The pvalue for the twosample KolmogorovSmirnov test performed on the test and training samples will b given for the sig...
def print_metrics(mva, df_train, df_test, y_train, y_test, mva_response_train=None, mva_response_test=None, w_train=None, w_test=None): train_prediction = mva.predict(df_train) test_prediction = mva.predict(df_test) if mva_response_train is None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_score(classifier,X_test,y_test):\n print(\"Test results:\\n\")\n print('Accuracy Score: {0:.4f}\\n'.format(accuracy_score(y_test,classifier.predict(X_test))))\n print('Classification Report:\\n{}\\n'.format(classification_report(y_test,classifier.predict(X_test))))\n print('Confusion Matrix:\...
[ "0.7152303", "0.7105801", "0.6804485", "0.6763374", "0.6641915", "0.65742904", "0.64732355", "0.63817567", "0.63688743", "0.6362646", "0.6361954", "0.6324825", "0.6295061", "0.6282431", "0.6277282", "0.62668425", "0.62559533", "0.62425554", "0.62197816", "0.62166834", "0.6192...
0.7810818
0
Testing retrieve all datetimes between a start and end date when aws cron expressing is set to run every 23 minutes. cron(Minutes Hours Dayofmonth Month Dayofweek Year)
def test_get_all_schedule_bw_dates(self): expected_list = [datetime.datetime(2021, 8, 7, 8, 46, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 8, 7, 9, 0, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 8, 7, 9, 23, tzinfo=datetime.timezone.utc), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_schedule(self):\n\n year = 2019\n month = 3\n day = 25 \n hour = 0\n\n mydate = datetime.datetime(year, month, day,hour)\n\n lower_boundary = mydate - timedelta(hours=3)\n upper_boundary = mydate + timedelta(hours=3)\n\n s1 = Schedule()\n s1.h...
[ "0.6355969", "0.6239835", "0.6202171", "0.6195869", "0.6186916", "0.61330086", "0.6074735", "0.60411584", "0.60411584", "0.6025535", "0.59950465", "0.593852", "0.593222", "0.5877867", "0.5870352", "0.58504814", "0.5843401", "0.5840758", "0.58323246", "0.5831292", "0.582972", ...
0.70289725
0
Testing retrieve n number of datetimes after start date when aws cron expressing is set to run every 23 minutes. cron(Minutes Hours Dayofmonth Month Dayofweek Year)
def test_get_next_n_schedule(self): expected_list = [datetime.datetime(2021, 8, 7, 8, 46, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 8, 7, 9, 0, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 8, 7, 9, 23, tzinfo=datetime.timezone.utc), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_prev_n_schedule_1(self):\n expected_list = [datetime.datetime(2021, 8, 7, 11, 46, tzinfo=datetime.timezone.utc),\n datetime.datetime(2021, 8, 7, 11, 23, tzinfo=datetime.timezone.utc),\n datetime.datetime(2021, 8, 7, 11, 0, tzinfo=datetime.timezone...
[ "0.6759647", "0.6636367", "0.6363794", "0.616004", "0.6140015", "0.6130691", "0.6127423", "0.6108642", "0.59846866", "0.5977118", "0.5943261", "0.59351647", "0.5881593", "0.5881593", "0.5876264", "0.5801353", "0.57978046", "0.57921964", "0.577581", "0.577063", "0.5768446", ...
0.6882878
0
Testing retrieve n number of datetimes before start date when aws cron expressing is set to run every 23 minutes. cron(Minutes Hours Dayofmonth Month Dayofweek Year)
def test_get_prev_n_schedule_1(self): expected_list = [datetime.datetime(2021, 8, 7, 11, 46, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 8, 7, 11, 23, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 8, 7, 11, 0, tzinfo=datetime.timezone.utc), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_prev_n_schedule_2(self):\n expected_list = [datetime.datetime(2021, 8, 16, 8, 45, tzinfo=datetime.timezone.utc),\n datetime.datetime(2021, 8, 16, 8, 40, tzinfo=datetime.timezone.utc),\n datetime.datetime(2021, 8, 16, 8, 35, tzinfo=datetime.timezon...
[ "0.7060921", "0.6800632", "0.61680037", "0.61093366", "0.60723025", "0.6063537", "0.6006717", "0.5977737", "0.5950346", "0.5895382", "0.5888992", "0.5885549", "0.585212", "0.5829197", "0.58039516", "0.58039516", "0.57916796", "0.577506", "0.5722183", "0.5711278", "0.5637655",...
0.7170238
0
Testing retrieve n number of datetimes before start date when aws cron expressing is set to
def test_get_prev_n_schedule_2(self): expected_list = [datetime.datetime(2021, 8, 16, 8, 45, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 8, 16, 8, 40, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 8, 16, 8, 35, tzinfo=datetime.timezone.utc), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_prev_n_schedule_1(self):\n expected_list = [datetime.datetime(2021, 8, 7, 11, 46, tzinfo=datetime.timezone.utc),\n datetime.datetime(2021, 8, 7, 11, 23, tzinfo=datetime.timezone.utc),\n datetime.datetime(2021, 8, 7, 11, 0, tzinfo=datetime.timezone...
[ "0.72844285", "0.6639654", "0.61234534", "0.6070025", "0.5999438", "0.5934432", "0.5803547", "0.5797079", "0.577028", "0.5704389", "0.5687544", "0.56647825", "0.56645274", "0.5654837", "0.5629759", "0.5628537", "0.56249386", "0.5601441", "0.55870426", "0.5582098", "0.55773395...
0.71570456
1
Shows setup form for course import.
def get_import_course(self): template_values = {} template_values['page_title'] = self.format_title('Import Course') annotations = ImportCourseRESTHandler.SCHEMA_ANNOTATIONS_DICT() if not annotations: template_values['main_content'] = 'No courses to import from.' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_form():\n\n prompts = story.prompts\n\n return render_template(\"base.html\", prompts = prompts )", "def show_add_student_form():\n\n return render_template(\"add_student_form.html\")", "def _show_setup_form(self, user_input=None, errors=None):\n if user_input is None:\n use...
[ "0.56671005", "0.5478239", "0.54478216", "0.54261065", "0.5402414", "0.5342084", "0.5338006", "0.51969016", "0.5164126", "0.51188606", "0.5115217", "0.5105489", "0.5078342", "0.5062522", "0.5053526", "0.5039535", "0.50374144", "0.5009344", "0.500288", "0.50028086", "0.4991822...
0.6048296
0
Shows editor for the list of unit and lesson titles.
def get_edit_unit_lesson(self): key = self.request.get('key') exit_url = self.canonicalize_url('/dashboard') rest_url = self.canonicalize_url(UnitLessonTitleRESTHandler.URI) form_html = oeditor.ObjectEditor.get_html_for( self, UnitLessonTitleRESTHandler.SCHEMA_J...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def overview():\n # TODO: fix ajax https://groups.google.com/d/msg/web2py/YyVilc2ywdg/ZLtN3Gg3Ft0J\n # TODO: fix ?plain link in results\n from plugin_introspect import get_task_code\n lesson = request.args[0] # controller with lesson contents\n # lesson = request.vars.lesson_controller # controller...
[ "0.5678457", "0.55465746", "0.5464319", "0.54618376", "0.54339266", "0.54273474", "0.54123616", "0.53683156", "0.5359419", "0.5353171", "0.534512", "0.53427917", "0.53418916", "0.5329176", "0.52664524", "0.52608544", "0.5253168", "0.5234427", "0.5217702", "0.5217702", "0.5157...
0.64366746
0
Adds new lesson to a first unit of the course.
def post_add_lesson(self): course = courses.Course(self) first_unit = None for unit in course.get_units(): if unit.type == verify.UNIT_TYPE_UNIT: first_unit = unit break if first_unit: lesson = course.add_lesson(first_unit) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_lessons(self):\n self.unit = self.course.add_unit()\n self.unit.title = 'Test Unit'\n self.lesson1 = self.course.add_lesson(self.unit)\n self.lesson1.title = 'Test Lesson 1'\n self.lesson2 = self.course.add_lesson(self.unit)\n self.lesson2.title = 'Test Lesson ...
[ "0.6592109", "0.6410707", "0.6111103", "0.5869602", "0.5810536", "0.5490168", "0.5481879", "0.5408769", "0.5406653", "0.53995997", "0.5388689", "0.5371851", "0.53431517", "0.5311308", "0.5307389", "0.5262052", "0.52542657", "0.52517307", "0.5243876", "0.5174791", "0.5099966",...
0.7636539
0
Adds new unit to a course.
def post_add_unit(self): course = courses.Course(self) unit = course.add_unit() course.save() self.redirect(self.get_action_url( 'edit_unit', key=unit.unit_id, extra_args={'is_newly_created': 1}))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_course_with_unit():\r\n world.clear_courses()\r\n course = world.CourseFactory.create()\r\n world.scenario_dict['COURSE'] = course\r\n section = world.ItemFactory.create(parent_location=course.location)\r\n world.ItemFactory.create(\r\n parent_location=section.location,\r\n ...
[ "0.76492965", "0.696005", "0.68043363", "0.6776585", "0.6589733", "0.6569345", "0.6558218", "0.64767474", "0.6371256", "0.6348", "0.6270813", "0.6258006", "0.6248667", "0.61720675", "0.602112", "0.60207057", "0.5990421", "0.5989375", "0.59686464", "0.5841342", "0.5799532", ...
0.7756238
0
Adds new link to a course.
def post_add_link(self): course = courses.Course(self) link = course.add_link() link.href = '' course.save() self.redirect(self.get_action_url( 'edit_link', key=link.unit_id, extra_args={'is_newly_created': 1}))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_link(self, link):\n raise NotImplementedError", "def add_course(self, course):\n if course == isinstance(course, list):\n self.courses.extend(course)\n else:\n self.courses.append(course)", "def add_link(self, **kwgs):\n self.links.append(kwgs)", "def...
[ "0.6644764", "0.64385754", "0.64037013", "0.6396685", "0.6315996", "0.6180957", "0.61610305", "0.6042703", "0.5976529", "0.5911578", "0.5910711", "0.5904912", "0.5879108", "0.5877521", "0.58420247", "0.5822886", "0.5748416", "0.5737826", "0.57296646", "0.5708448", "0.5699284"...
0.7643654
0
Adds new assessment to a course.
def post_add_assessment(self): course = courses.Course(self) assessment = course.add_assessment() course.save() self.redirect(self.get_action_url( 'edit_assessment', key=assessment.unit_id, extra_args={'is_newly_created': 1}))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_course(self, course):\n if course in self.courses:\n raise NameError('This student is already enrolled in that course')\n else:\n self.courses[course] = 0\n\n return self", "def add_course(self, course: 'Course'):\n\n new_diff = self._total_diff + course....
[ "0.7151995", "0.6625985", "0.6622476", "0.660693", "0.6501048", "0.64134264", "0.62065154", "0.6200288", "0.61025655", "0.6099459", "0.6071891", "0.5838845", "0.5676526", "0.5676526", "0.56468844", "0.55956006", "0.5575223", "0.55406266", "0.5496529", "0.5484189", "0.54768366...
0.7487632
0
Renders an editor form for a given REST handler class.
def _render_edit_form_for( self, rest_handler_cls, title, annotations_dict=None, delete_xsrf_token='delete-unit', page_description=None): if not annotations_dict: annotations_dict = rest_handler_cls.SCHEMA_ANNOTATIONS_DICT key = self.request.get('key') extra_args = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preview_handler(self, _, __):\r\n template = self.system.render_template('lti_form.html', self.get_context())\r\n return Response(template, content_type='text/html')", "def get_form(self, rest_handler, key=''):\n rest_url = self.canonicalize_url(rest_handler.URI)\n exit_url = self...
[ "0.65016", "0.64726025", "0.6246321", "0.6010805", "0.59896237", "0.5803694", "0.56939304", "0.56423974", "0.5575796", "0.5539493", "0.5531501", "0.5529906", "0.54694355", "0.5440833", "0.54365414", "0.54303694", "0.5378569", "0.5375155", "0.5320521", "0.53054225", "0.5270013...
0.6602482
0
Converts a unit to a dictionary representation.
def unit_to_dict(self, unused_unit): raise Exception('Not implemented')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unit_to_dict(self, unit):\n assert unit.type == 'A'\n\n path = self._get_assessment_path(unit)\n fs = self.app_context.fs\n if fs.isfile(path):\n content = fs.get(path)\n else:\n content = ''\n\n review_form_path = self._get_review_form_path(unit)...
[ "0.7587487", "0.72640556", "0.6578508", "0.6519553", "0.65143585", "0.65096855", "0.64466125", "0.6338267", "0.6237695", "0.6186894", "0.6079581", "0.599574", "0.59576243", "0.59406996", "0.5938384", "0.5934619", "0.59259", "0.5910009", "0.590698", "0.58714944", "0.58562183",...
0.7898045
0
Schema annotations are dynamic and include a list of courses.
def SCHEMA_ANNOTATIONS_DICT(cls): # pylint: disable-msg=g-bad-name course_list = cls._get_course_list() if not course_list: return None # Format annotations. return [ (['title'], 'Import Course'), ( ['properties', 'course', '_inputex'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_courses(self):\n\n self.search([]).unlink()\n token = self.env['odoo.moodle'].search([('create_uid', '=', self.env.user.id)]).token\n domain = \"http://localhost:8888\"\n webservice_url = \"/webservice/rest/server.php?\"\n parameters = {\n \"wstoken\":token,\n ...
[ "0.6021015", "0.59781986", "0.5967723", "0.5933028", "0.5928425", "0.58039546", "0.57375234", "0.56972253", "0.56824136", "0.55962616", "0.55420697", "0.5486629", "0.54748285", "0.54621655", "0.5441055", "0.5419749", "0.54188645", "0.53563774", "0.53538626", "0.53485054", "0....
0.67544234
0
Handles GET REST verb and returns lesson object as JSON payload.
def get(self): if not CourseOutlineRights.can_view(self): transforms.send_json_response(self, 401, 'Access denied.', {}) return key = self.request.get('key') course = courses.Course(self) lesson = course.find_lesson_by_id(None, key) assert lesson ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, id):\n\n lesson = Lesson.get_by_id(int(id))\n if lesson:\n t = jinja_env.get_template(\"lesson.html\")\n response = t.render(lesson=lesson)\n else:\n error = \"there is no lesson with id %s\" % id\n t = jinja_env.get_template(\"404.html...
[ "0.6564688", "0.62094915", "0.62094915", "0.60671294", "0.6003742", "0.60015124", "0.5985556", "0.59131974", "0.589638", "0.5892824", "0.58326644", "0.5830856", "0.5829169", "0.58290637", "0.58206123", "0.5803783", "0.5786761", "0.577182", "0.5749207", "0.57244927", "0.571400...
0.7311771
0
Handles PUT REST verb to save lesson and associated activity.
def put(self): request = transforms.loads(self.request.get('request')) key = request.get('key') if not self.assert_xsrf_token_or_fail( request, 'lesson-edit', {'key': key}): return if not CourseOutlineRights.can_edit(self): transforms.send_json_r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put(self, id):\n activity = Activity().get(id)\n if not activity:\n abort(404, \"Activity not found\")\n\n return activity._update(request.json)", "def put(self,request, pk =None):\n return Response({'method': 'PUT'})", "def put(self, request, pk=None):\n\n return ...
[ "0.59743", "0.5786072", "0.5775688", "0.5773262", "0.5756577", "0.5756577", "0.5756577", "0.5750275", "0.574359", "0.5741087", "0.56987846", "0.56938607", "0.56280434", "0.56240195", "0.5620811", "0.5606885", "0.55927944", "0.5587585", "0.5562244", "0.5558443", "0.55389553", ...
0.76168776
0