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
Get news summaries for user
def get_news_summaries_for_user(self, user_id, page_num): # pylint: disable=no-self-use print 'get summaries for user is called! with %s and %s' % (user_id, page_num) return operations.get_news_summaries_for_user(user_id, page_num)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_news_summaries_for_user(user_id, page_num):\n LOGGER.debug('get_news_summaries_for_user is called with %s and %s', user_id, str(page_num))\n return operations.get_news_summaries_for_user(user_id, page_num)", "def getNewsFeed(self, userId: int) -> List[int]:\n news = []\n for posts in ...
[ "0.8280784", "0.6733929", "0.6724858", "0.66080564", "0.6577181", "0.65227485", "0.6511483", "0.64573556", "0.645486", "0.6422935", "0.64102906", "0.63754475", "0.633218", "0.6303468", "0.627628", "0.6270833", "0.6261432", "0.6200072", "0.61192656", "0.6112744", "0.6112427", ...
0.8474866
0
log news click for user
def log_news_click_for_user(self, user_id, news_id): # pylint: disable=no-self-use print 'log news click for user is called with %s and %s' % (user_id, news_id) return operations.log_news_click_for_user(user_id, news_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_news_click_for_user(user_id, news_id):\n LOGGER.debug('log_news_click_for_user is called with %s and %s', user_id, news_id)\n return operations.log_news_click_for_user(user_id, news_id)", "def click(cls, user, link):\r\n pass", "def click(cls, user, link):\n pass", "def log_succes...
[ "0.7703432", "0.65589684", "0.64338", "0.6382208", "0.62468106", "0.6230457", "0.60436696", "0.5973681", "0.59569526", "0.5947858", "0.58712655", "0.5857679", "0.5771925", "0.5771925", "0.5735387", "0.5714753", "0.5699279", "0.56922024", "0.5637997", "0.5601566", "0.5588085",...
0.7882628
0
recursively print 1 char from myString global Int > None
def print_a_char(i): if i == len(myString): # base case: end of string, just return print("debuggin base case ... now i = " + str(i)) return else: print("debuggin recursion ... now i = " + str(i)) # recursive case: # print char at current index # in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strprint(self, mystr):\n if self.is_verbose is True:\n print(mystr)\n else:\n pass\n return", "def _print_with_depth(self, string, depth):\n print(\"{0}{1}\".format(\" \" * depth, string))", "def simple(self, string):\n\n temp = self\n i = 0\n w...
[ "0.55965906", "0.5496015", "0.5463261", "0.54267794", "0.5329273", "0.5281513", "0.52523005", "0.5160701", "0.5143802", "0.5138744", "0.5135421", "0.5116006", "0.5073823", "0.5069713", "0.504991", "0.5034474", "0.50065297", "0.50034696", "0.49649817", "0.49551603", "0.4927775...
0.7064136
0
Sets the web handler from browserHandler.browserHandler.WebHandler
def connect_browser_handler(self, wh): self.web_handler = wh
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_handler(self, handler):\n self._handler = handler", "def setup_handlers(web_app):\n\n mlw_handlers = [\n ('/mlw/load_workspace', MLW_load_workspace_handler),\n ('/mlw/save_workspace', MLW_save_workspace_handler),\n ('/mlw/install_requirements', MLW_install_requirements_hand...
[ "0.6446334", "0.57812834", "0.57771283", "0.5610197", "0.5610197", "0.5527198", "0.54383373", "0.54195005", "0.5405691", "0.5367285", "0.5364556", "0.53571427", "0.53558046", "0.53449744", "0.532374", "0.53024596", "0.52624846", "0.52460796", "0.52252847", "0.5213725", "0.519...
0.7992587
0
Opens float chat if not available Closes float chat if already opened
def toggle_chat(self): if not self.float_chat_on: self.float_chat_toplevel = tk.Toplevel(self) # toplevel for float chat self.float_chat_toplevel.title('Float chat') self.float_chat_toplevel.protocol('WM_DELETE_WINDOW', self.on_float_chat_close) self.float_chat_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_float_chat_close(self):\n self.web_handler.stop_listening() # stops web handler from listening\n self.float_chat_toplevel.destroy() # close float chat\n self.buttons['float_chat'].config(text='Start float chat') # change button text\n self.float_chat_on = False # change float...
[ "0.7377202", "0.64777136", "0.6359903", "0.6113372", "0.58211136", "0.57748777", "0.5760266", "0.5738265", "0.57245386", "0.5675755", "0.5588814", "0.55749667", "0.5561621", "0.55025995", "0.5502298", "0.54930097", "0.5478247", "0.54635215", "0.54177946", "0.5400971", "0.5396...
0.76807743
0
Called when float chat is to be closed
def on_float_chat_close(self): self.web_handler.stop_listening() # stops web handler from listening self.float_chat_toplevel.destroy() # close float chat self.buttons['float_chat'].config(text='Start float chat') # change button text self.float_chat_on = False # change float chat on ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_chat_close(self, request, trigger_context):\n raise NotImplementedError", "def CloseForum(self, event):\n pass", "def handle_close(self, msg):\n self.log.debug(\"handle_close[%s](%s)\", self.comm_id, msg)\n if self._close_callback:\n self._close_callback(msg)", "de...
[ "0.78410995", "0.6853194", "0.68365043", "0.67821735", "0.6760789", "0.67238986", "0.67188543", "0.67052376", "0.66676116", "0.6519735", "0.6502221", "0.6502221", "0.6502221", "0.6484066", "0.6447902", "0.64328486", "0.64257556", "0.64257556", "0.64257556", "0.64257556", "0.6...
0.8624791
0
Fetch the list of favourited projects for the currently logged in user
def get(self): # fetch parameter get_parser = reqparse.RequestParser(bundle_errors=True) get_parser.add_argument("user_id", required=True, help="User ID required to fetch favourite projects") args = get_parser.parse_args(strict=True) # get user_id user_id = args["user_id...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_returns_projects_favourited_by_user_if_favourited_by_me_is_true(self):\n # Arrange\n # Make all projects to be accessible for user\n self.test_project_2.private = False\n self.test_project_2.save()\n self.test_project_3.status = ProjectStatus.PUBLISHED.value\n sel...
[ "0.7222293", "0.6640633", "0.662446", "0.65211076", "0.64192235", "0.6397125", "0.6359353", "0.62913567", "0.6281064", "0.6238408", "0.62245435", "0.62229395", "0.62035525", "0.6191851", "0.61816716", "0.61535966", "0.6113703", "0.61077994", "0.6061517", "0.60476655", "0.6047...
0.7558755
0
Add the selected project to the user's favourites list
def post(self): # fetch parameter get_parser = reqparse.RequestParser(bundle_errors=True) get_parser.add_argument("user_id", required=True, help="User ID required to ad to their favourite projects") get_parser.add_argument("project_id", required=True, help="Project ID required to add to ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def favourite(self, favourite):\n\n self._favourite = favourite", "def post(self, project_id):\n project_model = ProjectDBModel.query.get(project_id)\n if not project_model:\n ns.abort(404, status=PROJECT_NOT_FOUND_ERROR)\n try:\n data = request.get_json()\n ...
[ "0.65495306", "0.65230185", "0.64037746", "0.6359352", "0.63081443", "0.620794", "0.6202838", "0.61783636", "0.6137469", "0.60920554", "0.60460544", "0.5985217", "0.5984209", "0.59489393", "0.5923535", "0.58728683", "0.58598346", "0.58549684", "0.58362305", "0.5825522", "0.58...
0.67139345
0
Donations to Wikimedia come in discrete units due the radio boxes with suggested donation amounts. The vast majority of impressions do not lead to a donation. This object encapsulates a multinomial distribution that is parameterized in a slightly unusual way. You specify the positive values, a distribution over positiv...
def __init__(self, p_donate, pos_amounts=[1.0,], pos_amounts_distribution=[1.0,]): self.p_donate = p_donate self.pos_amounts = pos_amounts self.pos_amounts_distribution = pos_amounts_distribution zero = np.array([0,]) p_donate = np.array([p_donate],) pos_amounts = np.arra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_discrete_distribution():\n rng = utils.RandomState(0)\n distribution = dist.DiscreteDistribution(rng)\n with pytest.raises(NotImplementedError):\n distribution.sample([])\n with pytest.raises(NotImplementedError):\n distribution.log_probability([], None)\n with pytest.raises(NotImplementedError...
[ "0.5947847", "0.5744744", "0.5591083", "0.55679595", "0.5545277", "0.5531983", "0.55294925", "0.55198205", "0.54576534", "0.544243", "0.5440499", "0.54399353", "0.5424996", "0.54166985", "0.5410182", "0.5375491", "0.53508025", "0.5302159", "0.5289846", "0.5281966", "0.5268068...
0.6726229
0
Returns a DonationProb object whose donation rate was increased by lift percent
def lift(self, lift): p_donate = self.p_donate + self.p_donate * lift return DonationProb(p_donate, self.pos_amounts, self.pos_amounts_distribution)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_p_donate(self, p_donate):\n return DonationProb(p_donate, self.pos_amounts, self.pos_amounts_distribution)", "def get_opinion_percent(self):\n return (self.get_percent()+100)/2", "def pct(self):\n\t\treturn self.bottle.pct()", "def priceit(self):\n paytree = np.zeros((self.ste...
[ "0.6890115", "0.59565574", "0.58431065", "0.5806238", "0.5804415", "0.5795312", "0.57341367", "0.5695293", "0.5571195", "0.55701756", "0.55421734", "0.553602", "0.55187565", "0.55174226", "0.55142564", "0.54630965", "0.5456505", "0.5456421", "0.54472786", "0.5411732", "0.5405...
0.7925812
0
Returns a DonationProb object whose donation rate was changed to p_donate but the positive values and the distribution over positive values is unchanged
def change_p_donate(self, p_donate): return DonationProb(p_donate, self.pos_amounts, self.pos_amounts_distribution)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lift(self, lift):\n p_donate = self.p_donate + self.p_donate * lift\n return DonationProb(p_donate, self.pos_amounts, self.pos_amounts_distribution)", "def __init__(self, p_donate, pos_amounts=[1.0,], pos_amounts_distribution=[1.0,]):\n self.p_donate = p_donate\n self.pos_amounts ...
[ "0.7298788", "0.62568116", "0.6176293", "0.57929885", "0.56549275", "0.556", "0.55039704", "0.5481789", "0.5442987", "0.54265326", "0.54142517", "0.5376003", "0.53016835", "0.52867156", "0.528147", "0.524017", "0.5222751", "0.5217876", "0.52153885", "0.5213066", "0.51969784",...
0.8732032
0
ShiftTradeSettings a model defined in Swagger
def __init__(self): self.swagger_types = { 'enabled': 'bool', 'auto_review': 'bool', 'allow_direct_trades': 'bool', 'min_hours_in_future': 'int', 'unequal_paid': 'str', 'one_sided': 'str', 'weekly_min_paid_violations': 'str', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def settings(self) -> SchemaActionModel:\n from whyqd.models import SchemaActionModel\n\n action_settings = {\n \"name\": self.name,\n \"title\": self.title,\n \"description\": self.description,\n \"structure\": self.structure,\n }\n if self.m...
[ "0.56864434", "0.5336318", "0.5249357", "0.51228476", "0.4982549", "0.48665702", "0.48596522", "0.47971547", "0.4786752", "0.4769292", "0.47213194", "0.47105515", "0.47027385", "0.469973", "0.46692365", "0.46668038", "0.46638718", "0.46509078", "0.46421686", "0.46204582", "0....
0.5606454
1
Gets the auto_review of this ShiftTradeSettings. Whether automatic shift trade review is enabled according to the rules defined in for this management unit
def auto_review(self): return self._auto_review
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def auto_review(self, auto_review):\n \n self._auto_review = auto_review", "def review(self):\n return self._review", "def auto(self):\n return self._auto", "def auto_mode(self):\n return self._auto_mode", "def review(self) -> object:\n return self._review", "def...
[ "0.62337404", "0.5877003", "0.58669287", "0.5605534", "0.55631214", "0.5485725", "0.5485725", "0.54195344", "0.53595024", "0.53475046", "0.5258285", "0.52451265", "0.520811", "0.5148728", "0.5148728", "0.5133972", "0.51075655", "0.5106319", "0.5101208", "0.5100062", "0.509978...
0.7241317
0
Sets the auto_review of this ShiftTradeSettings. Whether automatic shift trade review is enabled according to the rules defined in for this management unit
def auto_review(self, auto_review): self._auto_review = auto_review
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setAuto(self, auto):\n # type: (bool)->None\n\n self._validator.validate_one(\n 'auto', VALID_OPTS['auto'], auto)\n self._ifAttributes['auto'] = auto", "def auto_review(self):\n return self._auto_review", "def auto(self, auto):\n self._auto = auto", "def set_...
[ "0.629535", "0.62901366", "0.6205562", "0.59484947", "0.586132", "0.5606449", "0.55544823", "0.5457604", "0.5437223", "0.5340885", "0.5207839", "0.51955974", "0.51841444", "0.5166985", "0.51591945", "0.5131413", "0.50916165", "0.50884414", "0.50818217", "0.5068563", "0.506516...
0.81262857
0
Gets the allow_direct_trades of this ShiftTradeSettings. Whether direct shift trades between agents are allowed
def allow_direct_trades(self): return self._allow_direct_trades
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allow_direct_trades(self, allow_direct_trades):\n \n self._allow_direct_trades = allow_direct_trades", "def allow_gateway_transit(self) -> pulumi.Output[Optional[bool]]:\n return pulumi.get(self, \"allow_gateway_transit\")", "def allow_gateway_transit(self) -> Optional[pulumi.Input[boo...
[ "0.747426", "0.53346044", "0.5100105", "0.5100105", "0.5003391", "0.49880004", "0.49498343", "0.49094033", "0.48874655", "0.48220852", "0.47878334", "0.47765717", "0.47406754", "0.47323847", "0.47250593", "0.4720025", "0.4684115", "0.46295232", "0.46295232", "0.46295232", "0....
0.79995286
0
Sets the allow_direct_trades of this ShiftTradeSettings. Whether direct shift trades between agents are allowed
def allow_direct_trades(self, allow_direct_trades): self._allow_direct_trades = allow_direct_trades
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allow_direct_trades(self):\n return self._allow_direct_trades", "def set_direct(self, direct):\n self._direct = direct", "def setDirect(self, direct):\n self._direct = direct", "def allow_purchase_order(self, allow_purchase_order):\n\n self._allow_purchase_order = allow_purcha...
[ "0.7494934", "0.54587704", "0.51661927", "0.4795799", "0.47381973", "0.4686422", "0.4665296", "0.46351576", "0.46070793", "0.46070793", "0.45323443", "0.44950825", "0.4449625", "0.44402674", "0.43935964", "0.4376929", "0.4340441", "0.43230873", "0.43227234", "0.4282742", "0.4...
0.8692463
0
Gets the min_hours_in_future of this ShiftTradeSettings. The minimum number of hours in the future shift trades are allowed
def min_hours_in_future(self): return self._min_hours_in_future
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_hours_in_future(self, min_hours_in_future):\n \n self._min_hours_in_future = min_hours_in_future", "def min_myproxy_hours(self):\n return int(self.__get_option('min_myproxy_valid_hours'))", "def min_voms_proxy_hours(self):\n return int(self.__get_option('min_voms_proxy_valid...
[ "0.7420574", "0.6219645", "0.62086207", "0.58073217", "0.55174065", "0.5414188", "0.53939056", "0.53677446", "0.529913", "0.5277726", "0.52073365", "0.5196492", "0.51657456", "0.51279366", "0.51175094", "0.50999427", "0.50849766", "0.5078288", "0.50627273", "0.5060968", "0.50...
0.8458117
0
Sets the min_hours_in_future of this ShiftTradeSettings. The minimum number of hours in the future shift trades are allowed
def min_hours_in_future(self, min_hours_in_future): self._min_hours_in_future = min_hours_in_future
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_hours_in_future(self):\n return self._min_hours_in_future", "def min_time(self, min_time: str):\n\n self._min_time = min_time", "def min_voms_proxy_hours(self):\n return int(self.__get_option('min_voms_proxy_valid_hours'))", "def min_myproxy_hours(self):\n return int(self....
[ "0.7488132", "0.5778957", "0.55238605", "0.5499553", "0.5439674", "0.53993577", "0.5261042", "0.5257334", "0.5257334", "0.52563965", "0.5238442", "0.5238442", "0.5238442", "0.5131546", "0.512785", "0.512785", "0.5121968", "0.509475", "0.5084545", "0.5068271", "0.50552446", ...
0.8711309
0
Gets the unequal_paid of this ShiftTradeSettings. How to handle shift trades which involve unequal paid times
def unequal_paid(self): return self._unequal_paid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unequal_paid(self, unequal_paid):\n allowed_values = [\"Allow\", \"Disallow\", \"AdminReview\"]\n if unequal_paid.lower() not in map(str.lower, allowed_values):\n # print(\"Invalid value for unequal_paid -> \" + unequal_paid)\n self._unequal_paid = \"outdated_sdk_version\"\n...
[ "0.6139955", "0.53387636", "0.49372396", "0.49044767", "0.48526916", "0.47926265", "0.47427806", "0.4700392", "0.46879274", "0.46879274", "0.46811366", "0.46606246", "0.4617068", "0.46066138", "0.45941156", "0.45581588", "0.45421192", "0.45329323", "0.45126745", "0.4495702", ...
0.73930126
0
Sets the unequal_paid of this ShiftTradeSettings. How to handle shift trades which involve unequal paid times
def unequal_paid(self, unequal_paid): allowed_values = ["Allow", "Disallow", "AdminReview"] if unequal_paid.lower() not in map(str.lower, allowed_values): # print("Invalid value for unequal_paid -> " + unequal_paid) self._unequal_paid = "outdated_sdk_version" else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unequal_paid(self):\n return self._unequal_paid", "def unpaid_interest(self, unpaid_interest):\n\n self._unpaid_interest = unpaid_interest", "def unpaid_interest(self, unpaid_interest):\n\n self._unpaid_interest = unpaid_interest", "def unapproved(self, unapproved):\n\n self._...
[ "0.66380477", "0.5880214", "0.5880214", "0.51383543", "0.500558", "0.49487096", "0.48211223", "0.47970998", "0.47960222", "0.47937986", "0.47918844", "0.47356665", "0.47185376", "0.4710121", "0.46704188", "0.4662278", "0.46506834", "0.46480542", "0.46471024", "0.46138376", "0...
0.7029199
0
Gets the one_sided of this ShiftTradeSettings. How to handle onesided shift trades
def one_sided(self): return self._one_sided
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def side(self):\n return self._side.copy()", "def dwarsdoorsnede(self):\n return self._dwarsdoorsnede.get_waarde()", "def get_wl(self, strict=True):\n ax, wl, ds, ss = self.get_response()\n if (ax is True) and (strict is True):\n wl = None\n return wl", "def __re...
[ "0.5588246", "0.4999655", "0.49308547", "0.49244335", "0.49237114", "0.49048492", "0.4892378", "0.4798444", "0.4798198", "0.47741646", "0.4773227", "0.47707933", "0.4730155", "0.46796873", "0.4664128", "0.46336004", "0.46076268", "0.45964298", "0.4591801", "0.45813593", "0.45...
0.6997625
0
Sets the one_sided of this ShiftTradeSettings. How to handle onesided shift trades
def one_sided(self, one_sided): allowed_values = ["Allow", "Disallow", "AdminReview"] if one_sided.lower() not in map(str.lower, allowed_values): # print("Invalid value for one_sided -> " + one_sided) self._one_sided = "outdated_sdk_version" else: self._one_si...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_sided(self):\n return self._one_sided", "def set_side(self, side):\n raise RuntimeError(\"the 'set_side' method must be overriden\")", "def setSide(self, side):\r\n self.pack(side=side)", "def setSide(self, side):\r\n self.pack(side=side)", "def setSide(self, side):\r\n ...
[ "0.5757493", "0.569288", "0.5436307", "0.5436307", "0.5436307", "0.5415714", "0.5269162", "0.5172204", "0.508731", "0.50309396", "0.4948026", "0.49474117", "0.49171144", "0.48586398", "0.48435292", "0.47978467", "0.47255656", "0.47182512", "0.47144097", "0.47002354", "0.46988...
0.614867
0
Gets the weekly_min_paid_violations of this ShiftTradeSettings. How to handle shift trades which result in violations of weekly minimum paid time constraint
def weekly_min_paid_violations(self): return self._weekly_min_paid_violations
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weekly_min_paid_violations(self, weekly_min_paid_violations):\n allowed_values = [\"Allow\", \"Disallow\", \"AdminReview\"]\n if weekly_min_paid_violations.lower() not in map(str.lower, allowed_values):\n # print(\"Invalid value for weekly_min_paid_violations -> \" + weekly_min_paid_vi...
[ "0.69751316", "0.67295474", "0.64157695", "0.5974583", "0.564592", "0.528988", "0.526266", "0.5223079", "0.5202363", "0.5194301", "0.519075", "0.51646215", "0.51646215", "0.5089577", "0.50641555", "0.4979813", "0.49489027", "0.49106267", "0.48645687", "0.4855907", "0.4828529"...
0.84837914
0
Sets the weekly_min_paid_violations of this ShiftTradeSettings. How to handle shift trades which result in violations of weekly minimum paid time constraint
def weekly_min_paid_violations(self, weekly_min_paid_violations): allowed_values = ["Allow", "Disallow", "AdminReview"] if weekly_min_paid_violations.lower() not in map(str.lower, allowed_values): # print("Invalid value for weekly_min_paid_violations -> " + weekly_min_paid_violations) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weekly_min_paid_violations(self):\n return self._weekly_min_paid_violations", "def weekly_max_paid_violations(self, weekly_max_paid_violations):\n allowed_values = [\"Allow\", \"Disallow\", \"AdminReview\"]\n if weekly_max_paid_violations.lower() not in map(str.lower, allowed_values):\n ...
[ "0.7291479", "0.6118862", "0.6029776", "0.5733139", "0.5726334", "0.57095027", "0.5663417", "0.55886453", "0.5575012", "0.5281766", "0.5271762", "0.51604384", "0.50848013", "0.49081635", "0.4861198", "0.48589855", "0.48533848", "0.48374414", "0.48121262", "0.47811553", "0.477...
0.7584628
0
Gets the weekly_max_paid_violations of this ShiftTradeSettings. How to handle shift trades which result in violations of weekly maximum paid time constraint
def weekly_max_paid_violations(self): return self._weekly_max_paid_violations
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weekly_max_paid_violations(self, weekly_max_paid_violations):\n allowed_values = [\"Allow\", \"Disallow\", \"AdminReview\"]\n if weekly_max_paid_violations.lower() not in map(str.lower, allowed_values):\n # print(\"Invalid value for weekly_max_paid_violations -> \" + weekly_max_paid_vi...
[ "0.71017396", "0.6778176", "0.56508315", "0.5590555", "0.5535422", "0.5526067", "0.5260225", "0.5252201", "0.5142804", "0.51288325", "0.5119122", "0.5046455", "0.4955736", "0.49338713", "0.49301615", "0.48914012", "0.48864976", "0.4871266", "0.48201635", "0.47905493", "0.4787...
0.84426326
0
Sets the weekly_max_paid_violations of this ShiftTradeSettings. How to handle shift trades which result in violations of weekly maximum paid time constraint
def weekly_max_paid_violations(self, weekly_max_paid_violations): allowed_values = ["Allow", "Disallow", "AdminReview"] if weekly_max_paid_violations.lower() not in map(str.lower, allowed_values): # print("Invalid value for weekly_max_paid_violations -> " + weekly_max_paid_violations) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weekly_max_paid_violations(self):\n return self._weekly_max_paid_violations", "def weekly_limit(self, weekly_limit):\n\n self._weekly_limit = weekly_limit", "def weekly_min_paid_violations(self, weekly_min_paid_violations):\n allowed_values = [\"Allow\", \"Disallow\", \"AdminReview\"]\...
[ "0.72136927", "0.6369418", "0.6363601", "0.58544475", "0.5277122", "0.51809937", "0.51373297", "0.49580207", "0.49343422", "0.49329597", "0.4872632", "0.4870285", "0.48624778", "0.4831024", "0.47729272", "0.47707817", "0.47574925", "0.47397655", "0.47320494", "0.47287974", "0...
0.7683507
0
Gets the requires_matching_queues of this ShiftTradeSettings. Whether to constrain shift trades to agents with matching queues
def requires_matching_queues(self): return self._requires_matching_queues
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def requires_matching_queues(self, requires_matching_queues):\n \n self._requires_matching_queues = requires_matching_queues", "def requires_matching_planning_groups(self):\n return self._requires_matching_planning_groups", "def requires_matching_skills(self):\n return self._require...
[ "0.74711424", "0.6019627", "0.5670279", "0.56513906", "0.56271684", "0.5523794", "0.5453449", "0.5273352", "0.5258663", "0.5240057", "0.5237409", "0.5223872", "0.52098256", "0.5192199", "0.51543", "0.5153797", "0.5139222", "0.513476", "0.49981728", "0.49849987", "0.49849987",...
0.81816566
0
Sets the requires_matching_queues of this ShiftTradeSettings. Whether to constrain shift trades to agents with matching queues
def requires_matching_queues(self, requires_matching_queues): self._requires_matching_queues = requires_matching_queues
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def requires_matching_queues(self):\n return self._requires_matching_queues", "def requires_matching_planning_groups(self, requires_matching_planning_groups):\n \n self._requires_matching_planning_groups = requires_matching_planning_groups", "def requires_matching_skills(self, requires_mat...
[ "0.7026056", "0.626371", "0.6080613", "0.5387939", "0.4977356", "0.4948154", "0.48699456", "0.48108634", "0.47921792", "0.4688709", "0.4672739", "0.46499202", "0.46497968", "0.4629668", "0.46294284", "0.46173754", "0.45999214", "0.45791215", "0.45584536", "0.455672", "0.45474...
0.82478404
0
Gets the requires_matching_languages of this ShiftTradeSettings. Whether to constrain shift trades to agents with matching languages
def requires_matching_languages(self): return self._requires_matching_languages
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def requires_matching_languages(self, requires_matching_languages):\n \n self._requires_matching_languages = requires_matching_languages", "def requires_matching_skills(self):\n return self._requires_matching_skills", "def best_match_language(self):\n if not self.accept_language:\n ...
[ "0.7019373", "0.58443666", "0.5455803", "0.53113437", "0.5213689", "0.51799524", "0.50188375", "0.50188375", "0.50188375", "0.501323", "0.49779373", "0.49723494", "0.49723494", "0.49723494", "0.49518347", "0.49059954", "0.48904064", "0.4838629", "0.48077455", "0.47781244", "0...
0.7820583
0
Sets the requires_matching_languages of this ShiftTradeSettings. Whether to constrain shift trades to agents with matching languages
def requires_matching_languages(self, requires_matching_languages): self._requires_matching_languages = requires_matching_languages
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def requires_matching_languages(self):\n return self._requires_matching_languages", "def allows_language_choice(self, allows_language_choice):\n\n self._allows_language_choice = allows_language_choice", "def requires_matching_skills(self, requires_matching_skills):\n \n self._requir...
[ "0.660035", "0.5910095", "0.5873693", "0.5462056", "0.4720534", "0.46974784", "0.46014965", "0.4505857", "0.44450456", "0.4354574", "0.4335083", "0.43275222", "0.4273099", "0.42656523", "0.42637634", "0.42247966", "0.41790164", "0.41742778", "0.41720313", "0.41189757", "0.411...
0.81081593
0
Gets the requires_matching_skills of this ShiftTradeSettings. Whether to constrain shift trades to agents with matching skills
def requires_matching_skills(self): return self._requires_matching_skills
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def requires_matching_skills(self, requires_matching_skills):\n \n self._requires_matching_skills = requires_matching_skills", "def check_skill_requirements(self, skill_string):\r\n requirements_met = True\r\n # Shortened for easier usage, same practice in other functions\r\n #...
[ "0.7397422", "0.58501714", "0.52970845", "0.52919626", "0.52800035", "0.52033305", "0.52033305", "0.52033305", "0.5199282", "0.51981103", "0.51299804", "0.51299804", "0.51299804", "0.5121373", "0.5107792", "0.5013068", "0.5012293", "0.49951705", "0.4964476", "0.4931047", "0.4...
0.7993277
0
Sets the requires_matching_skills of this ShiftTradeSettings. Whether to constrain shift trades to agents with matching skills
def requires_matching_skills(self, requires_matching_skills): self._requires_matching_skills = requires_matching_skills
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def requires_matching_skills(self):\n return self._requires_matching_skills", "def required_skills(self, required_skills):\n\n self._required_skills = required_skills", "def requires_matching_languages(self, requires_matching_languages):\n \n self._requires_matching_languages = requ...
[ "0.67894024", "0.6205574", "0.58606046", "0.56571096", "0.55566597", "0.521438", "0.5066747", "0.4984988", "0.46794915", "0.46336862", "0.45962888", "0.45614943", "0.45473316", "0.4485718", "0.44463813", "0.44048196", "0.4387923", "0.43499947", "0.43493375", "0.43269297", "0....
0.82426614
0
Gets the requires_matching_planning_groups of this ShiftTradeSettings. Whether to constrain shift trades to agents with matching planning groups
def requires_matching_planning_groups(self): return self._requires_matching_planning_groups
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def requires_matching_planning_groups(self, requires_matching_planning_groups):\n \n self._requires_matching_planning_groups = requires_matching_planning_groups", "def enable_groups(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"enable_groups\")", "def match_constraints...
[ "0.78293633", "0.5144219", "0.4976061", "0.49256355", "0.48759344", "0.48727217", "0.47323728", "0.47321418", "0.46929336", "0.46308273", "0.46221137", "0.45919544", "0.45839018", "0.4579318", "0.45729378", "0.45659393", "0.45462197", "0.4495398", "0.44463462", "0.44000325", ...
0.8434141
0
Sets the requires_matching_planning_groups of this ShiftTradeSettings. Whether to constrain shift trades to agents with matching planning groups
def requires_matching_planning_groups(self, requires_matching_planning_groups): self._requires_matching_planning_groups = requires_matching_planning_groups
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def requires_matching_planning_groups(self):\n return self._requires_matching_planning_groups", "def requires_matching_queues(self, requires_matching_queues):\n \n self._requires_matching_queues = requires_matching_queues", "def requires_matching_skills(self, requires_matching_skills):\n ...
[ "0.7490272", "0.4813987", "0.47733462", "0.4771342", "0.46703315", "0.45196325", "0.44602185", "0.44554698", "0.44414607", "0.44335997", "0.44194436", "0.43835708", "0.43758637", "0.43642312", "0.43547672", "0.43463677", "0.4340733", "0.4329243", "0.43282712", "0.42960754", "...
0.8618694
0
Gets the activity_category_rules of this ShiftTradeSettings. Rules that specify what to do with activity categories that are part of a shift defined in a trade
def activity_category_rules(self): return self._activity_category_rules
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def activity_category_rules(self, activity_category_rules):\n \n self._activity_category_rules = activity_category_rules", "def get_rules_for_category(category):\n\n rules = get_db().execute('SELECT * FROM ruleset WHERE category_id = ?', (category,)).fetchall()\n\n return rules", "def get_r...
[ "0.65764445", "0.56854343", "0.5613786", "0.5561689", "0.55392265", "0.55276525", "0.55239964", "0.5513118", "0.54814136", "0.5451201", "0.53944457", "0.53867567", "0.53611493", "0.53129584", "0.52809757", "0.5203807", "0.51137215", "0.5097135", "0.50868076", "0.50547934", "0...
0.81497526
0
Sets the activity_category_rules of this ShiftTradeSettings. Rules that specify what to do with activity categories that are part of a shift defined in a trade
def activity_category_rules(self, activity_category_rules): self._activity_category_rules = activity_category_rules
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def activity_category_rules(self):\n return self._activity_category_rules", "def set_device_rules(self, rules, rule_objs):\n self.logger.debug(\"set_device_rules: rules: {}\".format(rules))\n self._load_device_rules(rules, rule_objs=rule_objs)\n self._determine_cli_command_list()\n ...
[ "0.5965316", "0.49182183", "0.47771955", "0.4753459", "0.47052824", "0.46763086", "0.45752648", "0.4574007", "0.4574007", "0.4574007", "0.4574007", "0.4553582", "0.4497546", "0.44832736", "0.4482188", "0.4435759", "0.43805346", "0.43805346", "0.43805346", "0.43805346", "0.438...
0.8358281
0
_createSourceName_ dccp takes a local path, so all we have to do is return the pfn asis
def createSourceName(self, protocol, pfn): return pfn
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPFCName(path, inputpoolfcstring):\n\n _tmp_fcname = inputpoolfcstring.split(':')[-1]\n if os.path.isabs(_tmp_fcname):\n pfc_name = _tmp_fcname\n else:\n pfc_name = os.path.join(os.path.abspath(path), _tmp_fcname)\n\n return pfc_name", "def name_from_dist(dist_func):\n return s...
[ "0.5489577", "0.5397066", "0.53578424", "0.5325086", "0.52370214", "0.5161669", "0.5159798", "0.5158864", "0.5138597", "0.5134293", "0.51239634", "0.5101735", "0.5097504", "0.506354", "0.50249326", "0.49959907", "0.49909014", "0.49875447", "0.49866307", "0.4985442", "0.498232...
0.7818806
0
_createStageOutCommand_ Build a dccp command with a pnfs mkdir to generate the directory
def createStageOutCommand(self, sourcePFN, targetPFN, options = None, checksums = None): try: import dcap except ImportError as ie: raise StageOutError("Python dCap wrappers not found on this host.") optionsStr = "" if options != None: optionsStr = st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mkdirout():\n #pdbid=os.path.splitext(os.path.basename(PDB_PATH))[0]\n #outdir = os.path.join(OUTPUT_DIR, pdbid(),\"\") # OUTPUT DIRECTORY WHERE OUTPUT FILES WILL GO\n\n if os.path.exists(output_dir()):\n sys.exit(\"ERROR. Unable to create output directory. %s already exists. Please, make sur...
[ "0.6048934", "0.5826364", "0.5755246", "0.5728969", "0.5728202", "0.56315583", "0.56039834", "0.55505246", "0.5518401", "0.54481965", "0.5429", "0.5413144", "0.5412861", "0.5367991", "0.53583246", "0.5355196", "0.53349096", "0.53324974", "0.53165174", "0.5314745", "0.53089845...
0.68755096
0
_removeFile_ CleanUp pfn provided
def removeFile(self, pfnToRemove): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanUp(self, f):\n os.system('rm ' + f)", "def cleanup(fname):\n if os.path.isfile(fname):\n try:\n os.remove(fname)\n print \"Cleaned up\", fname\n except OSError:\n print \"Failed to clean up\", fname", "def remove_file(self, path):\n pass", ...
[ "0.7110942", "0.6926332", "0.6837502", "0.67880255", "0.66312337", "0.65511507", "0.65271634", "0.6437142", "0.6406541", "0.6383176", "0.63297075", "0.63115835", "0.629489", "0.6281163", "0.6279226", "0.62617594", "0.626105", "0.6258333", "0.6251337", "0.6229411", "0.6194104"...
0.8349402
0
homepage redirects to list of users
def home_page(): return redirect('/users')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def homepage():\n if g.user:\n return redirect(f\"/user/{g.user.id}\")\n else:\n return redirect(\"/landing\")", "def users_page(request):", "def index(request):\n\n\tif request.user.is_authenticated:\n\t\treturn HttpResponseRedirect('home')\n\treturn HttpResponseRedirect('login')", "def ...
[ "0.7494506", "0.7432099", "0.7120991", "0.69668645", "0.6889106", "0.68814206", "0.6858822", "0.6828226", "0.68036246", "0.6792592", "0.67875254", "0.67855155", "0.67843896", "0.67843896", "0.67843896", "0.67843896", "0.67843896", "0.67843896", "0.6780509", "0.6769911", "0.67...
0.7679901
0
renders template to add new user
def add_new_user(): return render_template('new.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_user():\n\n return render_template('register-form.html')", "def add_user_form():\n\n return render_template(\"add_user.html\", headline=\"Add New Blogly User\")", "def new_users():\n\n return render_template(\"new_user.html\")", "def render_create_user_page():\n\n return render_template(\...
[ "0.87503904", "0.8419606", "0.80858696", "0.7989216", "0.79065436", "0.7873468", "0.78427976", "0.7788214", "0.7762511", "0.7753578", "0.7438695", "0.73353076", "0.7235222", "0.721587", "0.71043146", "0.70694435", "0.70558715", "0.70520866", "0.6944675", "0.6933298", "0.68825...
0.8767982
0
adds new user to db
def add_new_user_to_db(): first_name = request.form['first_name'] last_name = request.form['last_name'] img_url = request.form['img_url'] new_user = User(first_name=first_name,last_name=last_name, img_url=img_url) db.session.add(new_user) db.session.commit() return redirect('/users')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_user(self):\n query = \"INSERT INTO users (first_name, last_name, email, password) VALUES (%s, %s, %s, %s)\"\n self.cursor.execute(query,(\n self.first_name, \n self.last_name, \n self.email, \n self.password))", "def handle_add_user():\n new_u...
[ "0.83477956", "0.82241684", "0.8169616", "0.81505746", "0.80565304", "0.79970205", "0.7881901", "0.7866157", "0.78567743", "0.7816866", "0.7795224", "0.77623284", "0.77358586", "0.7726013", "0.7695807", "0.7691027", "0.7687878", "0.76473737", "0.7645796", "0.76421", "0.761879...
0.8355208
0
displays form where user can edit info
def show_edit_form(user_id): user = User.query.get_or_404(user_id) return render_template('edit.html', user=user)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_form():\n return template (\"edit\")", "def show_edit_form(user_id):\n\n user = User.query.get_or_404(user_id)\n\n return render_template(\"users/edit_user.html\", user=user)", "def edit(self):\n\n pass", "def show_edit_user_form(user_id):\r\n user = User.query.get_or_404(user_id)...
[ "0.7944607", "0.76103383", "0.7417197", "0.7322191", "0.73178375", "0.7314002", "0.7090248", "0.70597273", "0.7043498", "0.70094925", "0.6948445", "0.69112897", "0.68536806", "0.6801866", "0.6767648", "0.67107993", "0.6693232", "0.66814184", "0.6656329", "0.6631694", "0.66315...
0.7746406
1
shows form by which user can add new post
def show_form_to_add_new_post(user_id): user = User.query.get_or_404(user_id) tags = Tag.query.all() return render_template('posts/new.html', user=user, tags=tags)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_new_post_form(user_id):\n\n user = User.query.get_or_404(user_id)\n\n return render_template('new_post_form.html', user=user)", "def new_post_form(user_id):\n user = User.query.get_or_404(user_id)\n tags = Tag.query.all()\n return render_template('posts/new.html', user=user, tags=tags)", ...
[ "0.7803368", "0.77031416", "0.76967293", "0.7611464", "0.7593046", "0.75702906", "0.7559357", "0.75396353", "0.7437009", "0.74052477", "0.7396248", "0.73693126", "0.7366067", "0.7362356", "0.7318585", "0.7317058", "0.7299925", "0.7257682", "0.72130656", "0.72055334", "0.71996...
0.7992803
0
shows individual post based on ID of post
def show_post(post_id): post = Post.query.get_or_404(post_id) tags = post.tags return render_template('posts/post.html', post=post, tags=tags)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_post(post_id):\n\n post = Post.query.get_or_404(post_id)\n user = post.user\n \n return render_template(\"posts/post_details.html\", post=post, user=user)", "def view_post(post_id):\n\n posts = models.Post.select().where(models.Post.id == post_id)\n if posts.count() == 0:\n abor...
[ "0.80884796", "0.7809729", "0.7766649", "0.76972395", "0.7675512", "0.75907516", "0.7551688", "0.73931134", "0.73359364", "0.73324984", "0.73168266", "0.72386354", "0.72310734", "0.72155094", "0.72065705", "0.7182989", "0.7161204", "0.7115597", "0.71091795", "0.70830536", "0....
0.7998874
1
shows individual post form to be edited
def show_edit_post_form(post_id): post = Post.query.get_or_404(post_id) return render_template('posts/edit.html', post=post)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_edit_post_form(user_id, post_id):\n\n post = Post.query.get_or_404(post_id)\n user = post.user\n\n return render_template('edit_post.html', post=post, user=user)", "def show_post_form(request, pk=None):\n post = get_object_or_404(Post, pk=pk) if pk else None\n header = \"Edit \\\"{0}\\\"\...
[ "0.80158204", "0.790066", "0.7776901", "0.7769089", "0.7762255", "0.7487989", "0.74165535", "0.7331607", "0.714657", "0.71126884", "0.70684004", "0.70555127", "0.6985439", "0.6881445", "0.68796444", "0.68688715", "0.6858047", "0.68471867", "0.6838015", "0.6833424", "0.6778794...
0.79917425
1
Show edit form for a tag
def show_edit_tag_form(tag_id): tag = Tag.query.get_or_404(tag_id) posts = Post.query.all() return render_template('tags/edit_tag.html', tag=tag, posts=posts)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_edit_tag_form(tag_id):\n tag = Tag.query.get_or_404(tag_id)\n \n return render_template('edit-tag.html', tag=tag)", "def show_edit_tag_form(user_id, tag_id):\n\n tag = Tag.query.get_or_404(tag_id)\n user = tag.user\n\n return render_template('edit_tag.html', tag=tag, user=user)", "de...
[ "0.8776973", "0.8398177", "0.82558274", "0.80214214", "0.77986705", "0.7691515", "0.7521986", "0.72903264", "0.707884", "0.6930865", "0.6884716", "0.6647438", "0.66433793", "0.6603262", "0.65803325", "0.649248", "0.6481094", "0.6407203", "0.6392679", "0.6370153", "0.6313979",...
0.85679936
1
This function will break up words for us.
def break_words(stuff): # triple quotes turn to be the document of ex25 help words = stuff.split(' ') # listing the parts of breaking return words
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def break_words(stuff):\n\twords = stuff.split(' ')\n\treturn words", "def break_words(stuff):\n\twords = stuff.split(' ')\n\treturn words", "def break_words(stuff):\r\n #parte la cadena cada vez que encuentra un espacio\r\n words = stuff.split(' ') \r\n return words", "def break_words(stuff):\r\n ...
[ "0.80394965", "0.80394965", "0.8015403", "0.7988996", "0.786715", "0.786715", "0.786715", "0.786715", "0.786715", "0.7849892", "0.7849892", "0.7701187", "0.75530666", "0.7530405", "0.72611374", "0.7182393", "0.7165535", "0.70521915", "0.7007744", "0.69567066", "0.68832916", ...
0.80425274
0
report root wallet balance metrics to statsd.
def report_balance(root_address, channel_addresses=[]): try: wallet = Blockchain.get_wallet(root_address) statsd.gauge('root_wallet.kin_balance', wallet.kin_balance, tags=['address:%s' % root_address]) except Exception: pass # don't fail
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def report_balance(self):\n print(f\"\\nThe current balance in your account is ${self.balance}.\\n\")", "def show_balance(self):\n\t\tbalance = 0\n\t\tfor acct in self.wallet:\n\t\t\tutxos = get_unspent(acct[\"address\"], self.testnet)\n\t\t\tbalance += sum(i['value'] for i in utxos)\n\t\treturn f\"{self....
[ "0.61463773", "0.6089032", "0.5850805", "0.5772713", "0.5758199", "0.56520957", "0.5570537", "0.5546814", "0.55428386", "0.55103374", "0.5492825", "0.54784095", "0.54520524", "0.5406334", "0.5402505", "0.5397196", "0.53325844", "0.5331363", "0.5331347", "0.5328559", "0.531444...
0.7062899
0
JavaScript specific to gizmo to be placed in the {% block scripts %} block
def get_gizmo_js(): return ( "tethys_gizmos/js/gizmo_utilities.js", "tethys_gizmos/js/cesium_map_view.js", "tethys_gizmos/js/DrawHelper.min.js", )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_javascripts_subscriber(event):\n c = event.request.tmpl_context\n c.javascripts = [\n ('spline', 'lib/jquery-1.7.1.min'),\n ('spline', 'lib/jquery.cookies-2.2.0.min'),\n ('spline', 'lib/jquery.ui-1.8.4.min'),\n ('spline', 'core'),\n ('pokedex', 'pokedex-suggestions'...
[ "0.7191042", "0.6449665", "0.6252366", "0.6234498", "0.6112128", "0.61028486", "0.60693014", "0.6015799", "0.6015799", "0.59201545", "0.58840746", "0.58380616", "0.57780325", "0.57507026", "0.57086045", "0.5698426", "0.5633011", "0.56101644", "0.55908453", "0.5570004", "0.555...
0.70864314
1
CSS specific to gizmo to be placed in the {% block content_dependent_styles %} block
def get_gizmo_css(): return ( "tethys_gizmos/css/cesium_map_view.min.css", "tethys_gizmos/css/DrawHelper.min.css", )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generateInlineCSS():", "def get_stylesheet():\n\n #ss_dict\n ss_dict = {'header_image' : HEADER_IMAGE,\n 'icon_true' : ICON_TRUE,\n 'icon_false' : ICON_FALSE,\n 'futura_lt_light' : FUTURA_LT_LIGHT,\n 'bright_orange' : BRIGHT_ORANGE.name(),\n ...
[ "0.5841171", "0.54973793", "0.5384116", "0.5379654", "0.5354501", "0.53334975", "0.52722573", "0.52624387", "0.52198005", "0.51025265", "0.50930065", "0.49965754", "0.4979057", "0.4951599", "0.4907853", "0.4872566", "0.48463085", "0.4835834", "0.4820844", "0.48029348", "0.478...
0.6296576
0
Check admin permissions on jwt identity Wrap flask blueprint endpoints
def admin_required(fn): @wraps(fn) def wrapper(*args, **kwargs): identity = get_jwt_identity() if identity['role'] != 'admin': return jsonify({'message': 'Permission denied'}), 403 else: return fn(*args, **kwargs) return wrapper
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def admin_required(func):\n @wraps(func)\n def wrapper(*args, **kwargs):\n isAdmin = get_current_user()[\"isAdmin\"]\n if isAdmin == False:\n return jsonify({\"messsage\": \"Only admin can access this route\"}), 401\n return func(*args, **kwargs)\n return wrapper", "def a...
[ "0.7161469", "0.70733166", "0.70655507", "0.6944064", "0.68472445", "0.6795886", "0.6738831", "0.665472", "0.6586904", "0.65524095", "0.6508487", "0.6495549", "0.6462605", "0.6440125", "0.6429783", "0.6428201", "0.641124", "0.63652575", "0.63415575", "0.633403", "0.6315441", ...
0.73043376
0
Assert that bust_fragments applies with the minimum args.
def test_min_args(self): bust_fragments(self.resp, '/foo/bar') self.assert_header_set('["/foo/bar"]')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_fail_missing_signature_fragment_underflow(self):\n # Adjust bundle balance, since we will also remove the change\n # transaction.\n self.bundle[0].value += self.bundle[-1].value\n\n # Remove the last input's second signature fragment, and the change\n # transaction.\n del self.bundle.tra...
[ "0.60589397", "0.5724343", "0.5696273", "0.5563291", "0.5479956", "0.54702187", "0.5453022", "0.5393938", "0.5370606", "0.53701276", "0.53657234", "0.5336989", "0.5317501", "0.5313356", "0.5251449", "0.52381754", "0.52079916", "0.5144766", "0.51337266", "0.51300526", "0.51300...
0.6328368
0
Assert that bust_fragments applies a list properly.
def test_list(self): bust_fragments(self.resp, ['/foo/bar', '/zip/zap']) self.assert_header_set('["/foo/bar", "/zip/zap"]')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_list(self):\n pass", "def test_list(self):\n pass", "def test_list_field():", "def verify_response_block_list(self, response):\n self.assertSetEqual(\n {block['id'] for block in response.data},\n self.non_orphaned_block_usage_keys,\n )", "def test_...
[ "0.58295023", "0.58295023", "0.581594", "0.5727991", "0.56551546", "0.5616029", "0.5605433", "0.5574228", "0.54922616", "0.5477983", "0.5477703", "0.5476501", "0.5475215", "0.5468897", "0.5465023", "0.5427141", "0.5424886", "0.54224586", "0.5414302", "0.5377393", "0.53766316"...
0.6258605
0
Terms is a list of dictionaries representing a disjunction (or) of conjunctions (and). Alternatively, you can specify kwargs only, resulting in a single term.
def __init__(self, *terms, **kwargs): self.missing = kwargs.pop('_key_missing_', False) if terms and kwargs: raise ValueError("You must specify terms or kwargs, not both") self.terms = [] for t in terms: self.add_term(t) self.add_term(kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def terms(self) -> Tuple[Term, ...]:\n ...", "def build_search_terms(self, kwds):\n combined_keywords = \"\"\n for i in range(len(kwds)):\n if i != len(kwds)-1:\n combined_keywords += kwds[i] + ' OR '\n else:\n combined_keywords += kwds[i] ...
[ "0.63574696", "0.62927365", "0.6289394", "0.6186162", "0.6161904", "0.6108699", "0.60665464", "0.58098257", "0.5766303", "0.57403225", "0.5638852", "0.5626199", "0.5621384", "0.55921006", "0.55164593", "0.55002266", "0.54936963", "0.54462075", "0.54355145", "0.54318094", "0.5...
0.671826
0
Method that returns the error calculated for the cost function which is equal to the crossentropy error + L2 Regularization penalty term.
def cost(self, x, y): return self.cross_entropy_error(x,y) + self.l2_regularization_penalty()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def l2_reg_cost(cost):\n return cost + tf.losses.get_regularization_losses()", "def l2_reg_cost(cost):\n return cost + tf.losses.get_regularization_losses()", "def l2_reg_cost(cost):\n return cost + tf.losses.get_regularization_losses()", "def l2_reg_cost(cost):\n\n return cost + tf.losses.get_re...
[ "0.7168252", "0.7168252", "0.7168252", "0.7110235", "0.67353547", "0.6554512", "0.6539384", "0.6533157", "0.6518578", "0.6460937", "0.6451485", "0.6346614", "0.6325323", "0.63039505", "0.63011825", "0.6289162", "0.62576413", "0.624856", "0.62276816", "0.62257445", "0.62255144...
0.75452334
0
Implementation of Gradient Descent Returns the best set of weights for a model
def gradient_descent(self, x, y): # Initialize weights vector self.weights = np.zeros(len(x[0])) # Storing number of training example in a variable n = len(x) # Initiate variables to keep track of the current and smallest loss recorded lowest_loss = sys.float_info.max ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def learning_by_gradient_descent(y, tx, w, gamma):\n loss = calculate_loss(y,tx,w)\n grad = calculate_gradient(y,tx,w)\n w = w-gamma*grad\n return w, loss", "def train_gradient_descent(self, X, y, learning_rate=0.01, n_iters=100):\r\n # Step 0: Initialize the parameters\r\n n_samples, n...
[ "0.69018984", "0.6838119", "0.68109965", "0.680312", "0.67406446", "0.6740553", "0.66947246", "0.6646846", "0.664137", "0.66060346", "0.65947324", "0.6593397", "0.6561884", "0.6527356", "0.6517943", "0.65154314", "0.6514863", "0.6511061", "0.64937884", "0.6486011", "0.6478711...
0.6886186
1
Method that computes the crossentropy error
def cross_entropy_error(self, x, y): return -1 * sum([y[i] * np.log(self.logistic_function(self.weights.dot(x[i]))) + (1-y[i]) * np.log(1-self.logistic_function(self.weights.dot(x[i]))) for i in range(len(y))])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cross_entropy(self):\n return self._cross_entropy_func", "def cross_entropy(y_pred,y):\n \n epsilon = 0.001 # To prevent overflow and ensure numerical stability\n return sum(-y*np.log(y_pred+epsilon))", "def test_cross_entropy(self):\n loss = losses.cross_entropy_with_logits(\n lo...
[ "0.7317789", "0.7193637", "0.716187", "0.7155573", "0.71354103", "0.69392055", "0.6925359", "0.6868344", "0.6839562", "0.68295264", "0.68244743", "0.6810189", "0.6806863", "0.6792568", "0.679048", "0.6756376", "0.67161447", "0.671162", "0.6709578", "0.67024356", "0.6697486", ...
0.78930825
0
Method that computes and returns the L2 Regularization term
def l2_regularization_penalty(self): return self.l2 * (np.linalg.norm(self.weights)**2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def l2_regularization(cg, rate=0.01):\n W = VariableFilter(roles=[WEIGHT])(cg.variables)\n L2_cost = rate * l2_norm(W)\n\n return L2_cost", "def l2_regularization(W, reg_strength):\n # TODO: Copy from the previous assignment\n loss = reg_strength*np.sum(W*W)\n grad = 2*reg_strength*W\n retur...
[ "0.77305657", "0.7178578", "0.7126942", "0.7085765", "0.70743436", "0.70743436", "0.70743436", "0.7026239", "0.70200115", "0.70168245", "0.68394643", "0.6777604", "0.67379314", "0.67117363", "0.6709994", "0.66848576", "0.6656158", "0.6496867", "0.6441608", "0.64246273", "0.64...
0.79802835
0
Creates a warning if the price falls below min_price.
def price_too_low(cls, min_price: int): def eval_fn(p: Posting): if p.price < min_price: return f"The price (${p.price}) is suspiciously low." return cls(eval_fn)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_min_value(self, tracked_price):\n if tracked_price < self.min_value and self.warning_calls <= 2:\n print(f'Warning! Price dropeed under {self.min_value} pln {tracked_price}')\n self.make_phone_call()\n self.warning_calls += 1\n elif tracked_price < self.min_...
[ "0.7942152", "0.67987967", "0.642869", "0.6229255", "0.6202904", "0.61763763", "0.6161802", "0.60979813", "0.59673613", "0.59450233", "0.59405667", "0.5903012", "0.581013", "0.5708258", "0.56505924", "0.56133443", "0.5591867", "0.55732036", "0.55653024", "0.5558609", "0.55510...
0.7976325
0
Creates a warning if the posting is unfurnished.
def unfurnished(cls): def eval_fn(p: Posting): if 'furnished' not in p.attrs: return "The posting appears to be unfurnished." return cls(eval_fn)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def warning(self, warning):\n pass", "def hearWarning(self, warnlvl, screenname):\n print screenname,\"warned us\"", "def warning(self, msg, *args, **kwargs):\n pass", "def notice(self, warning):\n pass", "def warning(self, *args, **kwargs):", "def warn():\n pas...
[ "0.6197715", "0.60206753", "0.59842765", "0.5926007", "0.58933556", "0.5834593", "0.58117014", "0.5683251", "0.56700027", "0.56301874", "0.5621875", "0.56208336", "0.56013507", "0.56013507", "0.5592754", "0.55814165", "0.5532438", "0.5514373", "0.5513407", "0.5507845", "0.548...
0.6347684
0
Applies each of the warnings to the posting. Returns the posting after it's been modified
def run_on(self, p: Posting) -> Posting: p.warnings = [] for warning in self.pipeline: w = warning.evaluate(p) if w: p.warnings.append(w) return p
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eval_warnings(self):\n\n # Ensure the minimum number of warnings were raised.\n assert len(self.war) >= len(self.warn_msgs)\n\n # Test the warning messages, ensuring each attribute is present.\n testing.eval_warnings(self.war, self.warn_msgs)\n return", "def warnings(self) ...
[ "0.59168273", "0.57546896", "0.5613459", "0.5539314", "0.55158526", "0.54893833", "0.54492897", "0.54224324", "0.5386594", "0.5370216", "0.5369238", "0.5328996", "0.52466166", "0.5223718", "0.51754683", "0.51736605", "0.5168381", "0.5153321", "0.5140546", "0.51151484", "0.510...
0.65688336
0
inConnectionLost! stdin is closed! (we probably did it)
def inConnectionLost(self): self.logger('stdin closed by process %d' % self._pid)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def outConnectionLost(self):\n self.logger('stdout closed by process %d' % self._pid)", "def stdin(self):\n pass", "def test_eofReceived(self):\n stdio = FakeStdio()\n channel = SSHSession()\n channel.stdio = stdio\n channel.eofReceived()\n self.assertTrue(stdio...
[ "0.66580963", "0.6314382", "0.62261367", "0.6172009", "0.6104817", "0.6060875", "0.6025757", "0.60071176", "0.59619147", "0.59474856", "0.59413564", "0.5915416", "0.58921003", "0.5865144", "0.5861129", "0.57965195", "0.5780947", "0.5778603", "0.57679284", "0.57531106", "0.573...
0.8422832
0
outConnectionLost! The child closed their stdout!
def outConnectionLost(self): self.logger('stdout closed by process %d' % self._pid)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def errConnectionLost(self):\n self.logger('stderr closed by process %d' % self._pid)", "def inConnectionLost(self):\n self.logger('stdin closed by process %d' % self._pid)", "def __exit__(self, exc_type, exc_val, exc_tb):\n sys.stdout.flush()\n sys.stdout.close()\n sys.stdou...
[ "0.7060092", "0.70072204", "0.63617283", "0.6230432", "0.622997", "0.60452706", "0.5994969", "0.59138", "0.58624", "0.5796713", "0.57916695", "0.5784154", "0.5778169", "0.5777894", "0.57502854", "0.57466835", "0.5744456", "0.5728837", "0.5717156", "0.5651574", "0.5649623", ...
0.8288977
0
errConnectionLost! The child closed their stderr.
def errConnectionLost(self): self.logger('stderr closed by process %d' % self._pid)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def outConnectionLost(self):\n self.logger('stdout closed by process %d' % self._pid)", "def connection_closed(self, exc):\n _logger.info(\"Connection lost: %s\", str(exc))\n super().close()", "def inConnectionLost(self):\n self.logger('stdin closed by process %d' % self._pid)", "...
[ "0.75290006", "0.70639664", "0.68610656", "0.67444515", "0.65324247", "0.64623815", "0.64605296", "0.64530504", "0.64157903", "0.64110464", "0.63686746", "0.6255252", "0.6241299", "0.6238995", "0.62332237", "0.6221207", "0.6165477", "0.6143464", "0.6114373", "0.61118823", "0....
0.8708799
0
Evaluates the poem based on how similar the description words are
def evaluate(poem): score = 0 sentence_list = poem.split("\n") for d1 in sentence_list: d1 = d1.split() if (len(d1) > 2): if (len(wordnet.synsets(d1[-1])) > 1): w1 = wordnet.synsets(d1[-1])[0] w2 = wordnet.synsets(d1[-2])[0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_find_phrase_matches1(self):\n\t\ttest = sentiment.LibraryRun(self.text1, self.lib)\n\t\tobj_ut = test.find_phrase_matches(self.tokens_generator1)[0]\n\t\tself.assertEqual(dict(obj_ut),\n\t\t\t{'not good': [[2, -1, 0]]})", "def test_find_phrase_matches2(self):\n\t\ttest = sentiment.LibraryRun(self.text2,...
[ "0.6371693", "0.63224393", "0.6299222", "0.61357975", "0.60748553", "0.6043327", "0.6035676", "0.60105914", "0.5973418", "0.59562", "0.5948996", "0.5945075", "0.5931568", "0.59273475", "0.59270376", "0.5922571", "0.59209543", "0.5900297", "0.5843136", "0.5840886", "0.5836197"...
0.7116603
0
updates designated x and y fields with coordinates, reprojecting current cs to to_cs. to_cs = .prj or cs name or factory code (wkid).
def convert_and_update_xyfield(workspace,fc,xfield,yfield,to_cs,transformationname = None): # http://desktop.arcgis.com/en/arcmap/10.4/analyze/arcpy-classes/pdf/geographic_coordinate_systems.pdf # http://desktop.arcgis.com/en/arcmap/latest/map/projections/pdf/geographic_transformations.pdf arcpy.env.wo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_xy_field(workspace,fc,xfield,yfield):\n arcpy.env.workspace = workspace\n errorcount = 0\n with arcpy.da.UpdateCursor(fc,['SHAPE@X','SHAPE@Y',xfield,yfield]) as cursor:\n for row in cursor:\n try:\n row[2] = row[0] # xfield = SHAPE@X\n row[3] = ro...
[ "0.58174837", "0.5648159", "0.55298245", "0.55191374", "0.5506121", "0.53981173", "0.537714", "0.53376645", "0.5320438", "0.53062177", "0.5266959", "0.52519304", "0.5230742", "0.5226363", "0.5222849", "0.5222461", "0.5218819", "0.5186922", "0.51763636", "0.5170673", "0.516810...
0.7161199
0
VotingUser a model defined in Swagger
def __init__(self, voting_token: str=None, user_org_id: str=None): # noqa: E501 self.swagger_types = { 'voting_token': str, 'user_org_id': str } self.attribute_map = { 'voting_token': 'voting_token', 'user_org_id': 'user_org_id' } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def obj_create(self, bundle, request=None, **kwargs):\n return super(VoteResource, self).obj_create(bundle, request, user=request.user)", "def get_for_user(self, obj, user):\n if not user.is_authenticated:\n return None\n content_object = ContentType.objects.get_for_model(obj)\n ...
[ "0.6134873", "0.58559036", "0.5683679", "0.5661734", "0.56304413", "0.560258", "0.553985", "0.54510254", "0.54231775", "0.539229", "0.53908366", "0.53908366", "0.5388102", "0.5358371", "0.535237", "0.5326526", "0.5316479", "0.53155357", "0.5293799", "0.5286143", "0.524816", ...
0.5859945
1
Gets the voting_token of this VotingUser.
def voting_token(self) -> str: return self._voting_token
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_token(self):\n token_model = TokenModel.find_by_user_id(self.id)\n return token_model.token if token_model else None", "def _get_token(self):\n return user.get_token()", "def get_token(self):\n\n return self._token", "def token(self):\n if not self._token:\n ...
[ "0.6720019", "0.6619114", "0.65700465", "0.63307583", "0.6300595", "0.6300595", "0.62598306", "0.6192554", "0.6192554", "0.6192554", "0.6187039", "0.6184881", "0.6184881", "0.6184881", "0.6169354", "0.61598897", "0.6079098", "0.6042822", "0.6042822", "0.6042822", "0.6038956",...
0.8317904
0
Sets the voting_token of this VotingUser.
def voting_token(self, voting_token: str): if voting_token is None: raise ValueError("Invalid value for `voting_token`, must not be `None`") # noqa: E501 self._voting_token = voting_token
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def voting_token(self) -> str:\n return self._voting_token", "def __init__(self, voting_token: str=None, user_org_id: str=None): # noqa: E501\n self.swagger_types = {\n 'voting_token': str,\n 'user_org_id': str\n }\n\n self.attribute_map = {\n 'voting...
[ "0.6830911", "0.6465393", "0.595013", "0.595013", "0.5531626", "0.5400101", "0.53767824", "0.53420585", "0.53248674", "0.53226763", "0.5282861", "0.5255783", "0.5218371", "0.5135403", "0.5127925", "0.51046884", "0.5068379", "0.5013884", "0.5013884", "0.50131935", "0.49514234"...
0.84230316
0
Gets the user_org_id of this VotingUser.
def user_org_id(self) -> str: return self._user_org_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def org_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"org_id\")", "def get_user_id(self):\n return self.id_user", "def org_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"org_id\")", "def org_id(self) -> pulumi.Input[str]:\n return pulumi.get(sel...
[ "0.6899005", "0.6897272", "0.68779665", "0.67156845", "0.6661198", "0.6661198", "0.6661198", "0.6661198", "0.6661198", "0.6648258", "0.66482234", "0.66482234", "0.6560425", "0.6552495", "0.6548865", "0.6532151", "0.64681876", "0.64505225", "0.6379392", "0.6378247", "0.6376733...
0.83588845
0
Sets the user_org_id of this VotingUser.
def user_org_id(self, user_org_id: str): if user_org_id is None: raise ValueError("Invalid value for `user_org_id`, must not be `None`") # noqa: E501 self._user_org_id = user_org_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def org_id(self, org_id):\n\n self._org_id = org_id", "def user_id(self, user_id):\n\n self._user_id = user_id", "def user_id(self, user_id):\n\n self._user_id = user_id", "def user_id(self, user_id):\n\n self._user_id = user_id", "def user_id(self, user_id):\n\n self._us...
[ "0.6810901", "0.62934107", "0.62934107", "0.62934107", "0.62934107", "0.62934107", "0.62934107", "0.62934107", "0.62934107", "0.62934107", "0.62934107", "0.62934107", "0.62934107", "0.62934107", "0.62934107", "0.62673724", "0.6159892", "0.5727693", "0.5723272", "0.5714084", "...
0.74308753
0
Check classes listed in Implemented_Targets are derived from Target
def test_implemented_targets_derived_from_target(self): for key in forcebalance.objective.Implemented_Targets.keys(): self.logger.debug("Assert %s is subclass of target\n" % str(forcebalance.objective.Implemented_Targets[key])) assert issubclass(forcebalance.objective.Implemented_Targets...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_implemented_targets_derived_from_target(self):\n for key in forcebalance.objective.Implemented_Targets.keys():\n self.logger.debug(\"Assert %s is subclass of target\\n\" % str(forcebalance.objective.Implemented_Targets[key]))\n self.assertTrue(issubclass(forcebalance.objective...
[ "0.86741906", "0.796275", "0.7916209", "0.6642787", "0.64910054", "0.64711076", "0.6310859", "0.6294609", "0.62178797", "0.6209579", "0.6149524", "0.5955374", "0.5882046", "0.5872212", "0.5858272", "0.5815201", "0.58059925", "0.58059925", "0.57850796", "0.5773781", "0.5770892...
0.8581047
1
Check for unknown omissions from Implemented_Targets Check to make sure any classes derived from Target are either listed in Implemented_Targets or in the exclusion list in this test case
def test_no_unlisted_classes_derived_from_Target(self): forcebalance_modules=[module[:-3] for module in os.listdir(forcebalance.__path__[0]) if re.compile(".*\.py$").match(module) and module not in ["__init__.py"]] for module in forcebalance_modules: #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_no_unlisted_classes_derived_from_Target(self):\n self.skipTest(\"Not sure if test is working properly.\")\n forcebalance_modules=[module[:-3] for module in os.listdir(forcebalance.__path__[0])\n if re.compile(\".*\\.py$\").match(module)\n and module no...
[ "0.8121008", "0.7501856", "0.736171", "0.6360859", "0.59526706", "0.5948528", "0.59097034", "0.5747231", "0.57119584", "0.57119584", "0.57095045", "0.560901", "0.559652", "0.55962926", "0.5539723", "0.5533668", "0.5523853", "0.55037796", "0.5490197", "0.5490197", "0.54899144"...
0.82257766
0
Check penalty computation functions
def test_penalty_compute(self): objective = {'G': numpy.zeros((9)), 'H': numpy.diag((1,)*9), 'X': 1} for penalty in self.penalties: result = penalty.compute([1]*self.np, objective) assert isinstance(result,tuple) # more tests go here
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_penalty_compute(self):\n objective = {'G': numpy.zeros((9)),\n 'H': numpy.diag((1,)*9),\n 'X': 1}\n for penalty in self.penalties:\n result=penalty.compute([1]*self.np, objective)\n self.assertEqual(tuple, type(result))\n # more tests go here"...
[ "0.7188831", "0.704875", "0.6502529", "0.6319194", "0.6253688", "0.6040241", "0.60105747", "0.5938388", "0.59152675", "0.5900038", "0.5884319", "0.5855779", "0.5855779", "0.5855779", "0.5843721", "0.5841484", "0.5834948", "0.58325404", "0.58152175", "0.57859385", "0.57823145"...
0.7320431
0
Check zero order target terms
def test_target_zero_order_terms(self): obj = self.objective.Target_Terms(numpy.array([.5]*self.ff.np), Order=0) assert isinstance(obj, dict) assert "X" in obj assert "G" in obj assert "H" in obj assert int(obj["X"]) != 0 assert obj["G"].any() == False ass...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_target_zero_order_terms(self):\n obj = self.objective.Target_Terms(numpy.array([.5]*self.ff.np), Order=0)\n self.assertEqual(type(obj),dict)\n self.assertTrue(\"X\" in obj)\n self.assertNotEqual(int(obj[\"X\"]), 0)\n \n self.assertTrue(\"G\" in obj)\n self....
[ "0.7730585", "0.65473384", "0.65343684", "0.6058782", "0.604456", "0.601732", "0.5878453", "0.58585846", "0.58449787", "0.57668084", "0.57624483", "0.57577574", "0.5672885", "0.5633333", "0.5599019", "0.5590405", "0.55601686", "0.5526151", "0.55170417", "0.55007845", "0.54980...
0.78727204
0
Check first order target terms
def test_target_first_order_terms(self): obj = self.objective.Target_Terms(numpy.array([.5]*self.ff.np), Order=1) assert isinstance(obj, dict) assert "X" in obj assert "G" in obj assert "H" in obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_target_first_order_terms(self):\n obj = self.objective.Target_Terms(numpy.array([.5]*self.ff.np), Order=1)\n self.assertEqual(type(obj),dict)\n self.assertTrue(\"X\" in obj)\n self.assertTrue(\"G\" in obj)\n self.assertTrue(\"H\" in obj)", "def test_target_second_order...
[ "0.7594869", "0.69414026", "0.6917484", "0.6709718", "0.6650869", "0.5694065", "0.5567757", "0.5471913", "0.5433634", "0.53689086", "0.52868193", "0.52829295", "0.5240539", "0.5240539", "0.52094805", "0.51635295", "0.5076618", "0.50554353", "0.50218064", "0.50205237", "0.5012...
0.7671157
0
Check second order target terms
def test_target_second_order_terms(self): obj = self.objective.Target_Terms(numpy.array([.5]*self.ff.np), Order=2) assert isinstance(obj, dict) assert "X" in obj assert "G" in obj assert "H" in obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_target_second_order_terms(self):\n obj = self.objective.Target_Terms(numpy.array([.5]*self.ff.np), Order=2)\n self.assertEqual(type(obj),dict)\n self.assertTrue(\"X\" in obj)\n self.assertTrue(\"G\" in obj)\n self.assertTrue(\"H\" in obj)", "def test_target_first_order...
[ "0.74371237", "0.6681502", "0.66587096", "0.59809166", "0.5927252", "0.58840847", "0.5625534", "0.55692434", "0.5549024", "0.5514033", "0.5510398", "0.54905486", "0.546219", "0.53917503", "0.5349499", "0.5327487", "0.53227705", "0.5288182", "0.5278594", "0.5258623", "0.523307...
0.75028914
0
Check objective.indicate() runs without errors
def test_indicate(self): self.objective.Indicate()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def objective(self):\n pass", "def prove_NI() -> Proof:\n # Optional Task 6.7e", "def check(self, runtime):", "def violated(self) -> bool:\n ...", "def experiment3():\n raise FAKE_ERROR", "def prove_NN() -> Proof:\n # Optional Task 6.7c", "def check():", "def check_optimization...
[ "0.57647496", "0.5661307", "0.55599916", "0.5370101", "0.5358906", "0.53583854", "0.53413033", "0.53176993", "0.52501816", "0.5248551", "0.5248551", "0.52420944", "0.52360874", "0.5224271", "0.52124524", "0.51895326", "0.5175995", "0.51721793", "0.51585484", "0.515155", "0.51...
0.8210446
0
Modulate (map) an array of bits to constellation symbols.
def modulate(self, input_bits): index_list = map(lambda i: self.table[tuple((input_bits[i:i+self.num_bits_symbol]))], \ xrange(0, len(input_bits), self.num_bits_symbol)) baseband_symbols = self.constellation[index_list] return baseband_symbols
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, bits=8):\n\n self.map = {}\n self.bits = bits\n for r, g, b in itertools.product(range(2 ** bits), repeat=3):\n self.map[(r << 2 * bits) + (g << bits) + b] = rgb2lab(r << (8 - bits), g << (8 - bits), b << (8 - bits))", "def encode(bits, nt_to_bits=None):\r\n ...
[ "0.58877903", "0.55004615", "0.54638433", "0.5388877", "0.53436345", "0.53311616", "0.5254693", "0.52274746", "0.5226104", "0.52138996", "0.51705074", "0.51263374", "0.5111572", "0.50981164", "0.5097587", "0.50909793", "0.5069528", "0.50634634", "0.505401", "0.5018951", "0.49...
0.6858786
0
Find the Paulirepresentation of InteractionOperator for BravyiKitaev Super fast (BKSF) algorithm. Paulirepresentation of general FermionOperator is not possible in BKSF. Also, the InteractionOperator given as input must be Hermitian. In future we might provide a transformation for a restricted set of fermion operator.
def bravyi_kitaev_fast(operator: InteractionOperator) -> QubitOperator: if isinstance(operator, InteractionOperator): return bravyi_kitaev_fast_interaction_op(operator) else: raise TypeError("operator must be an InteractionOperator.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fermion_operator(operator):\n fermion_operator = FermionOperator()\n\n if isinstance(operator, PolynomialTensor):\n for term in operator:\n fermion_operator += FermionOperator(term, operator[term])\n return fermion_operator\n\n raise TypeError(\"Unsupported type of oeprato...
[ "0.5818381", "0.5716979", "0.570891", "0.567657", "0.562116", "0.562116", "0.562116", "0.5613257", "0.5463698", "0.539848", "0.53607637", "0.5300279", "0.52566344", "0.5202197", "0.5202183", "0.5198091", "0.51973337", "0.51899695", "0.51859266", "0.51655465", "0.5154106", "...
0.5804373
1
r""" Transform from InteractionOperator to QubitOperator for BravyiKitaev fast algorithm. The electronic Hamiltonian is represented in terms of creation and annihilation operators. These creation and annihilation operators could be
def bravyi_kitaev_fast_interaction_op(iop: InteractionOperator ) -> QubitOperator: n_qubits = count_qubits(iop) # Initialize qubit operator as constant. qubit_operator = QubitOperator((), iop.constant) edge_matrix = bravyi_kitaev_fast_edge_matrix(iop) edge_matri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, transition: tuple = (0, 1), energies: tuple = (1,), pauli='X', code=qubit, graph=None,\n IS_subspace=False):\n self.transition = transition\n self.energies = energies\n assert pauli in ['X', 'Y', 'Z']\n self.pauli = pauli\n self.code = code\n ...
[ "0.6446214", "0.6210634", "0.620553", "0.61128324", "0.60487795", "0.5991503", "0.59252745", "0.5920399", "0.5836899", "0.58049667", "0.58037627", "0.5781532", "0.57572883", "0.5695401", "0.56880194", "0.5616026", "0.5606468", "0.5605433", "0.5605308", "0.5558584", "0.5546773...
0.64617664
0
Calculate the edge operator B_i. The definitions used here are
def edge_operator_b(edge_matrix_indices: numpy.ndarray, i: int) -> QubitOperator: B_i = QubitOperator() qubit_position_matrix = numpy.array(numpy.where(edge_matrix_indices == i)) qubit_position = qubit_position_matrix[1][:] qubit_position = numpy.sort(qubit_position) operator = t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_bksf_edge_op_bi(self):\n edge_matrix = np.triu(np.ones((4, 4)))\n edge_list = np.array(np.nonzero(np.triu(edge_matrix) - np.diag(np.diag(edge_matrix))))\n qterm_b0 = _edge_operator_bi(edge_list, 0)\n qterm_b1 = _edge_operator_bi(edge_list, 1)\n qterm_b2 = _edge_operator_...
[ "0.7364842", "0.6461306", "0.59544754", "0.5885427", "0.567442", "0.5663807", "0.56600136", "0.563404", "0.5605291", "0.5598879", "0.55930614", "0.5551441", "0.55461", "0.5524313", "0.54962194", "0.5494069", "0.5489764", "0.54446363", "0.5434897", "0.54333586", "0.53780913", ...
0.679432
1
Calculate the edge operator A_ij. The definitions used here are
def edge_operator_aij(edge_matrix_indices: numpy.ndarray, i: int, j: int) -> QubitOperator: a_ij = QubitOperator() operator = tuple() position_ij = -1 qubit_position_i = numpy.array(numpy.where(edge_matrix_indices == i)) for edge_index in range(numpy.size(edge_matrix_indices[0,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_bksf_edge_op_aij(self):\n edge_matrix = np.triu(np.ones((4, 4)))\n edge_list = np.array(np.nonzero(np.triu(edge_matrix) - np.diag(np.diag(edge_matrix))))\n qterm_a01 = _edge_operator_aij(edge_list, 0, 1)\n qterm_a02 = _edge_operator_aij(edge_list, 0, 2)\n qterm_a03 = _ed...
[ "0.645519", "0.62153924", "0.5992542", "0.58474886", "0.5774487", "0.56838363", "0.5668433", "0.566825", "0.56331223", "0.56207055", "0.5588716", "0.5560463", "0.55506945", "0.55056185", "0.5448718", "0.5444221", "0.54131556", "0.5394625", "0.538959", "0.5291665", "0.5259175"...
0.6783255
0
Find the qubit operator for the number operator in bravyi_kitaev_fast representation
def number_operator(iop, mode_number=None): n_qubit = iop.n_qubits num_operator = QubitOperator() edge_matrix = bravyi_kitaev_fast_edge_matrix(iop) edge_matrix_indices = numpy.array( numpy.nonzero( numpy.triu(edge_matrix) - numpy.diag(numpy.diag(edge_matrix)))) if mode_number is ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_exact_classical_binary_solution(qubit_operator, offset):\n result = get_classical_solver_result(qubit_operator, offset)\n return result.x", "def Q_i(params):\n Q = params['Q'].value\n Qe = Q_e(params)\n return (Q ** -1 - np.real(Qe ** -1)) ** -1", "def get_quant(q):\n\n try:\n ...
[ "0.59903646", "0.5763858", "0.5735831", "0.5710417", "0.56848425", "0.566386", "0.5656029", "0.56033295", "0.56028676", "0.55861324", "0.55652666", "0.5559749", "0.5528611", "0.5506494", "0.5478781", "0.5472446", "0.5444578", "0.54406655", "0.5435226", "0.54314655", "0.542751...
0.6643483
0
Create a JupyterHubUser This is idempotent. It will create a Sirepo email user if none exists for the email before creating a jupyterhub user It will update the user's display_name if the one supplied is different than the one in the db.
def create_user(email, display_name): import pyisemail import sirepo.auth import sirepo.auth_db import sirepo.server import sirepo.sim_api.jupyterhublogin import sirepo.template def maybe_create_sirepo_user(module, email, display_name): u = module.unchecked_user_by_user_name(email) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_user(username=None, password=None, email=None, is_admin=False, display_name=None):\n\tif not username or not password or not email:\n\t\treturn None # @todo: exception handling \n\tuser = User(username=username, password=password, email=email, is_admin=is_admin, display_name=display_name)\n\ttry:\n\t\tu...
[ "0.740493", "0.7294818", "0.71817297", "0.7068116", "0.7059704", "0.70219904", "0.70201594", "0.70180523", "0.6983611", "0.6978325", "0.6924951", "0.6922734", "0.6911578", "0.6899807", "0.6899595", "0.689836", "0.6889405", "0.68889606", "0.6876101", "0.6872222", "0.6862059", ...
0.80022687
0
Wrap a model that should run on CPU, transferring inputs and outputs as necessary.
def with_cpu(ops, model): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(model: nn.Module, inputs: torch.Tensor, device: torch.device):\n\n model.eval()\n model.to(device)\n\n with torch.no_grad():\n inputs = inputs.to(device)\n return model(inputs)", "def cpu(self, *args, **kwargs):\n self._tensor = self._tensor.cpu(*args, **kwargs)\n ...
[ "0.6402771", "0.6401", "0.6344216", "0.63228977", "0.62614536", "0.6219543", "0.60333186", "0.6002807", "0.5994314", "0.5940613", "0.59332347", "0.5912314", "0.5864584", "0.58230406", "0.5788221", "0.5746694", "0.5739335", "0.5731383", "0.5720366", "0.57131535", "0.5707247", ...
0.76973623
0
Build a simple CNN text classifier, given a tokentovector model as inputs. If exclusive_classes=True, a softmax nonlinearity is applied, so that the outputs sum to 1. If exclusive_classes=False, a logistic nonlinearity is applied instead, so that outputs are in the range [0, 1].
def build_simple_cnn_text_classifier( tok2vec, nr_class, exclusive_classes: bool = ..., **cfg ): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def classify(text):\n # TODO Wonder if there's a better way of doing this so the model persists across fucn calls. Will see once I get\n # Heroku running\n\n sentences = sent_tokenize(text)\n clean_sentences = list(map(clean_text, sentences))\n word_tokenizer = BertTokenizerFast.from_pretrained('be...
[ "0.6299664", "0.6254263", "0.6134055", "0.604031", "0.6039286", "0.59022474", "0.58584005", "0.5856348", "0.5843683", "0.5827657", "0.5826641", "0.58193755", "0.5802258", "0.5767329", "0.5765888", "0.57630885", "0.5753324", "0.5748217", "0.5743231", "0.5742967", "0.5705073", ...
0.8247789
0
Compose two or more models `f`, `g`, etc, such that their outputs are concatenated, i.e. `concatenate(f, g)(x)` computes `hstack(f(x), g(x))`
def concatenate_lists(*layers, **kwargs): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def concat_model():\n x = tf.keras.Input(shape=[10, 10, 3, ])\n x1 = tf.keras.layers.Conv2D(5, (2, 2))(x)\n x2 = tf.keras.layers.Conv2D(6, (2, 2))(x)\n x3 = tf.keras.layers.Conv2D(7, (2, 2))(x)\n z = tf.keras.layers.concatenate([x2, x1, x3], axis=-1)\n z1 = tf.keras.layers.Conv2D(10, (2, 2))(z)\n...
[ "0.70515543", "0.5997107", "0.5982442", "0.5935776", "0.5935776", "0.58978873", "0.5835013", "0.5824077", "0.5802191", "0.5802128", "0.5802128", "0.5794551", "0.5778237", "0.57725596", "0.57704157", "0.5757591", "0.5691272", "0.5679168", "0.5676331", "0.5657232", "0.56446177"...
0.6018841
1
Convert a model into a BERTstyle masked language model
def masked_language_model(vocab, model, mask_prob=...): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_model():\n global model_tok, model_mlm, model, model_cls\n if model is None:\n model_name_or_path = os.getenv('TRANSFORMER_MODEL', default='distilbert-base-multilingual-cased')\n # 'bert-base-multilingual-cased'\n model_tok = AutoTokenizer.from_pretrained(model_name_or_path)\n ...
[ "0.6321037", "0.61176497", "0.60473555", "0.59833467", "0.59296566", "0.59263337", "0.58409685", "0.58396", "0.5774077", "0.57682884", "0.57416177", "0.5726364", "0.57068795", "0.5675471", "0.56682515", "0.5662315", "0.5658786", "0.5653014", "0.5638642", "0.5619386", "0.56193...
0.7494484
0
Interpolates over image using a mask. The `func` parameter defines the function used for interpolation within the aperture. This can be either a statistical or interpolation
def maskinterp(image, func=spline_interp_2dfunc, mask=None, apstep=1, maxap=9, cval=np.nan, minfrac=0.2, minpoints=4, cdis=1, statistical=False, creep=False, coplanar=None, **kwargs): if mask is None: mask = ~np.isnan(image) if not mask.any(): log.err...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(cls, image, mask,\n interp_mask=DEFAULT_INTERP_MASK,\n BADPIX_INTERP=maskbits.BADPIX_INTERP,\n min_cols=DEFAULT_MINCOLS,\n max_cols=DEFAULT_MAXCOLS,\n invalid_mask=DEFAULT_INVALID_MASK,\n add_noise=DEFAULT_...
[ "0.5979875", "0.596896", "0.58975315", "0.5509023", "0.5382732", "0.538206", "0.5352394", "0.5333508", "0.5331767", "0.5311795", "0.5311795", "0.5161992", "0.51591897", "0.514953", "0.5132063", "0.5104912", "0.5066806", "0.5038082", "0.503342", "0.50329393", "0.5016978", "0...
0.69919026
0
Fills in NaN values in an image Uses the CloughTocher scheme to construct a piecewise cubic interpolating Bexier polynomial on Delaunay triangulation.
def image_naninterp(data): if not isinstance(data, np.ndarray) or len(data.shape) != 2: log.error("data must be a 2D %s" % np.ndarray) return mask = np.isnan(data) if not mask.any(): return data if mask.all(): log.error("data are all NaN") return yy, xx = np....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fill_blind_pores(im):\n holes = find_disconnected_voxels(im)\n im[holes] = False\n return im", "def fill_nan(array):\n idx = np.arange(array.shape[0])\n good = np.where(np.isfinite(array))\n interp = interpolate.interp1d(idx[good], array[good], bounds_error=False)\n ...
[ "0.60985243", "0.60102165", "0.5806957", "0.58024496", "0.578654", "0.57636756", "0.5724484", "0.56875443", "0.5679379", "0.5644574", "0.5640386", "0.56197864", "0.5557094", "0.552808", "0.5472851", "0.5463112", "0.54055804", "0.53835154", "0.53573185", "0.53321165", "0.53060...
0.6175499
0
Clip a polygon to a square unit pixel Uses the SutherlandHodgman polygon clipping algorithm. Pixel centers for pixel (i, j) is at (i + 0.5, j + 0.5).
def polyclip(i, j, pol_x, pol_y, area=False): n = len(pol_x) nout = n + 4 px_out, py_out = [0] * nout, [0] * nout clip_vals = [i, i + 1, j + 1, j] for ctype in range(4): cv = clip_vals[ctype] if ctype == 0: inside = [px > i for px in pol_x] elif ctype == 1: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shrink_polygon(self,polygon, offset = 1):\r\n \r\n import numpy as np\r\n import copy\r\n import math\r\n \r\n def angle(x1, y1, x2, y2):\r\n numer = (x1*x2 + y1*y2)\r\n denom = np.sqrt((x1**2 + y1**2) * (x2**2 + y2**2))\r\n print(numer)\r\...
[ "0.5896273", "0.5896273", "0.5873075", "0.57877976", "0.573683", "0.56885505", "0.568509", "0.56691444", "0.5591874", "0.5561925", "0.5535751", "0.5516805", "0.5503301", "0.55026895", "0.54918116", "0.5490103", "0.54314256", "0.5428148", "0.54224825", "0.5398284", "0.53432286...
0.6021302
0
Set document comment. Raise CardinalityError if comment already set.
def set_doc_comment(self, doc, comment): if not self.doc_comment_set: self.doc_comment_set = True doc.comment = comment else: raise CardinalityError('Document::Comment')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_doc_comment(self, doc, comment):\n if not self.doc_comment_set:\n self.doc_comment_set = True\n if validations.validate_doc_comment(comment):\n doc.comment = str_from_text(comment)\n return True\n else:\n raise SPDXValueEr...
[ "0.83034164", "0.77773416", "0.7719323", "0.7694882", "0.7687957", "0.7328972", "0.7308246", "0.7308246", "0.7308246", "0.7308246", "0.7308246", "0.7308246", "0.7308246", "0.7308246", "0.7308246", "0.7308246", "0.7109099", "0.7056695", "0.70507073", "0.70507073", "0.6976152",...
0.8777668
0
Set license name. Raise SPDXValueError if name is not str or utils.NoAssert Raise CardinalityError if it is already set Raise OrderError if no license id defined.
def set_lic_name(self, doc, name): if self.has_extr_lic(doc): if not self.extr_lic_name_set: self.extr_lic_name_set = True if validations.validate_extr_lic_name(name, True): self.extr_lic(doc).full_name = name return True ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_lic_name(self, doc, name):\n if self.has_extr_lic(doc):\n if not self.extr_lic_name_set:\n self.extr_lic_name_set = True\n if validations.validate_extr_lic_name(name):\n self.extr_lic(doc).full_name = name\n return True\n...
[ "0.74007356", "0.6421445", "0.6295538", "0.62915987", "0.62772936", "0.62594885", "0.62594885", "0.62465584", "0.6132982", "0.6127764", "0.6125195", "0.6125195", "0.6125195", "0.6125195", "0.6112782", "0.6059133", "0.605745", "0.605508", "0.605508", "0.60507804", "0.602856", ...
0.7390864
1
Set license comment. Raise CardinalityError if it is already set. Raise OrderError if no license ID defined.
def set_lic_comment(self, doc, comment): if self.has_extr_lic(doc): if not self.extr_lic_comment_set: self.extr_lic_comment_set = True self.extr_lic(doc).comment = comment return True else: raise CardinalityError('ExtractedL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_file_license_comment(self, doc, text):\n if self.has_package(doc) and self.has_file(doc):\n if not self.file_license_comment_set:\n self.file_license_comment_set = True\n if validations.validate_file_lics_comment(text):\n self.file(doc).lic...
[ "0.7798254", "0.7691525", "0.7654628", "0.73221135", "0.65885866", "0.63827676", "0.63612866", "0.63207686", "0.6265315", "0.6208042", "0.6165672", "0.6093353", "0.6088788", "0.60350615", "0.60108227", "0.6003148", "0.5956488", "0.5906547", "0.5886418", "0.5884168", "0.587860...
0.77002937
1
Set file notice Raise OrderError if no package or file defined. Raise CardinalityError if more than one.
def set_file_notice(self, doc, text): if self.has_package(doc) and self.has_file(doc): if not self.file_notice_set: self.file_notice_set = True self.file(doc).notice = text return True else: raise CardinalityError('File::Not...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_file_notice(self, doc, text):\n if self.has_package(doc) and self.has_file(doc):\n if not self.file_notice_set:\n self.file_notice_set = True\n if validations.validate_file_notice(text):\n self.file(doc).notice = str_from_text(text)\n ...
[ "0.7263729", "0.5780258", "0.56514925", "0.56100523", "0.55981684", "0.5560745", "0.54180616", "0.54094934", "0.5397283", "0.5335834", "0.52749735", "0.52060634", "0.51867205", "0.5160868", "0.5109503", "0.5107595", "0.50973636", "0.50885445", "0.5056448", "0.5054006", "0.505...
0.69790244
1
Wrap rdfbuilders.FileBuilder.set_file_type to match the different fileType representations.
def set_file_type(self, doc, type_value): type_dict = { 'fileType_source': 'SOURCE', 'fileType_binary': 'BINARY', 'fileType_archive': 'ARCHIVE', 'fileType_other': 'OTHER' } return super(FileBuilder, self).set_file_type(doc, type_dict.get(type_val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_file_type(self, doc, type_value):\n type_dict = {\n 'SOURCE': file.FileType.SOURCE,\n 'BINARY': file.FileType.BINARY,\n 'ARCHIVE': file.FileType.ARCHIVE,\n 'OTHER': file.FileType.OTHER\n }\n if self.has_package(doc) and self.has_file(doc):\n ...
[ "0.70331025", "0.6612077", "0.6341896", "0.58677274", "0.58193064", "0.5770286", "0.5716289", "0.57154566", "0.5662334", "0.56170815", "0.5595489", "0.5595484", "0.55319166", "0.547541", "0.541627", "0.5346825", "0.53068495", "0.5305302", "0.528279", "0.5267061", "0.52635944"...
0.795146
0
Set the annotation comment. Raise CardinalityError if already set. Raise OrderError if no annotator defined before.
def add_annotation_comment(self, doc, comment): if len(doc.annotations) != 0: if not self.annotation_comment_set: self.annotation_comment_set = True doc.annotations[-1].comment = comment return True else: raise CardinalityEr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_annotation_comment(self, doc, comment):\n if len(doc.annotations) != 0:\n if not self.annotation_comment_set:\n self.annotation_comment_set = True\n if validations.validate_annotation_comment(comment):\n doc.annotations[-1].comment = str_fr...
[ "0.7566029", "0.65002567", "0.64751667", "0.63237065", "0.6311318", "0.63018346", "0.621435", "0.6135042", "0.61078835", "0.60896176", "0.6081147", "0.6053388", "0.6053388", "0.6053388", "0.6053388", "0.6053388", "0.6053388", "0.6053388", "0.6053388", "0.6053388", "0.6053388"...
0.75879556
0
Reset builder's state for building new documents. Must be called between usage with different documents.
def reset(self): # FIXME: this state does not make sense self.reset_creation_info() self.reset_document() self.reset_package() self.reset_file_stat() self.reset_reviews() self.reset_annotations() self.reset_extr_lics()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_document(self):\n # FIXME: this state does not make sense\n self.doc_version_set = False\n self.doc_comment_set = False\n self.doc_namespace_set = False\n self.doc_data_lics_set = False\n self.doc_name_set = False\n self.doc_spdx_id_set = False", "def re...
[ "0.73523873", "0.6907559", "0.66045606", "0.6456777", "0.62394756", "0.622441", "0.6222067", "0.6208838", "0.6202436", "0.6202436", "0.6202436", "0.6202436", "0.6202436", "0.6202436", "0.6202436", "0.6202436", "0.6202436", "0.6202436", "0.6202436", "0.6202436", "0.6202436", ...
0.6995418
1