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
This function gives the weight between two given
def get_weight(ew1, ew2): dw = flu.delta_epiweeks(ew1, ew2) yr = 52.2 hl1, hl2, bw = yr, 1, 4 a = 0.05 #b = (np.cos(2 * np.pi * (dw / yr)) + 1) / 2 b = np.exp(-((min(dw % yr, yr - dw % yr) / bw) ** 2)) c = 2 ** -(dw / hl1) d = 1 - 2 ** -(dw / hl2) return (a + (1 - a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weight(self):", "def get_weight(self, val1, val2):\n\n\t\tnode1 = self.get_node(val1)\n\t\tnode2 = self.get_node(val2)\n\n\t\treturn node1.get_weight(node2)", "def get_weights(self):", "def weight(fragment_one, fragment_two):\n return overlap(fragment_one, fragment_two)[\"weight\"]", "def getWeight(...
[ "0.7597948", "0.749667", "0.7428421", "0.7412348", "0.74093145", "0.7255503", "0.7182084", "0.7080902", "0.7044499", "0.7044499", "0.7021739", "0.6966589", "0.6966368", "0.6955854", "0.68491995", "0.68452686", "0.68178153", "0.6802609", "0.6730282", "0.67078024", "0.66917276"...
0.75268966
1
Return a map from sensor names to sensor implementations.
def get_sensor_implementations(): return { 'cdc': SensorGetter.get_cdc, 'gft': SensorGetter.get_gft, 'ght': SensorGetter.get_ght, 'ghtj': SensorGetter.get_ghtj, 'twtr': SensorGetter.get_twtr, 'wiki': SensorGetter.get_wiki, 'epic': SensorGetter.get_epic, 'sar3': Sensor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sensor_classes(self):\n raise NotImplementedError", "def data_setup_sensors():\n sensor_list = []\n sensor_list.append(helper_setup_sensors(factory_type_constant=SENSOR_TYPE_NAME_BASIC, sensor_name=\"Sensor1\",\n interval_between_readings=0.5, gpio_pin_...
[ "0.6515089", "0.6204054", "0.6149236", "0.6029666", "0.58729976", "0.5745948", "0.56258994", "0.5501529", "0.5487855", "0.5483462", "0.5429596", "0.5414457", "0.5409554", "0.5395443", "0.5390384", "0.5390307", "0.537485", "0.536558", "0.53442913", "0.53433913", "0.5331139", ...
0.78985685
0
Return a new instance under the default configuration. If `test_mode` is True, database changes will not be committed. If `valid` is True, be punctilious about hiding values that were not known at the time (e.g. run the model with preliminary ILI only). Otherwise, be more lenient (e.g. fall back to final ILI when preli...
def new_instance(valid, test_mode): database = SensorsTable(test_mode=test_mode) implementations = SensorGetter.get_sensor_implementations() return SensorUpdate(valid, database, implementations, Epidata)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_init_sets_new_record_true(self):\n t = self.Test({'id': 1})\n self.assertEqual(t.new_record, True)", "def test_should_allow_override_new_record(self):\n t = self.Test({'id': 1}, False)\n self.assertEqual(t.new_record, False)", "def test_without_localsite_and_instance(self):...
[ "0.5668509", "0.5581067", "0.5511822", "0.54761374", "0.544532", "0.5387868", "0.51298994", "0.50898963", "0.50549924", "0.5037492", "0.5034233", "0.50265735", "0.50178486", "0.5004177", "0.49780762", "0.49308074", "0.4918332", "0.49153453", "0.48976803", "0.48928562", "0.488...
0.63489234
0
list of topics in a forum forum_id id of a Forum record
def topic_list(request, forum_id, pagination_id=1): try: topics = Topic.objects.order_by('-is_global', '-is_sticky', '-topic_modification_date').filter(Q(topic_forum=forum_id) | Q(is_global='1')) forum_name = Forum.objects.get(id=forum_id) forum_name = forum_name.forum_name except: return HttpResponseRedirect...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_topics(project_id):\n project_path = f\"projects/{project_id}\"\n for topic in PUBLISHER_CLIENT.list_topics(request={\"project\": project_path}):\n print(topic)", "def get_teacher_topic_all():\n topic_data = query_db(\n \"SELECT topics.id, topics.name, classes.name FROM topics JOI...
[ "0.71958566", "0.7154457", "0.7141806", "0.70193803", "0.68313867", "0.68131095", "0.6796887", "0.67777157", "0.66847396", "0.6667825", "0.6666503", "0.658895", "0.65878844", "0.64640737", "0.64293224", "0.64095646", "0.63564235", "0.6342142", "0.63283175", "0.6324823", "0.62...
0.8021172
0
list my topics show_user if not set will show current user topics
def my_topic_list(request, show_user=False): if not show_user: show_user = str(request.user) if request.user.is_authenticated(): topics = Topic.objects.order_by('-topic_modification_date').filter(topic_author=show_user)[:50] forum_name = _('User Topics') return render_to_response( 'myghtyboard/mytopics_lis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def my_posttopic_list(request, show_user=False):\n\tif not show_user:\n\t\tshow_user = str(request.user)\n\ttry:\n\t\ttopics = Post.objects.order_by('-post_date').filter(post_author=show_user).values('post_topic').distinct()[:50]\n\t\tposts = []\n\t\tfor i in topics:\n\t\t\tposts.append(int(i['post_topic']))\n\t\t...
[ "0.7587987", "0.68615746", "0.6584963", "0.6520831", "0.6474204", "0.641011", "0.6235148", "0.6221391", "0.621017", "0.61582536", "0.61340994", "0.61294705", "0.6119274", "0.6069664", "0.60405356", "0.5981129", "0.59676176", "0.59621197", "0.5931718", "0.59281045", "0.5925600...
0.8401827
0
list last active topics
def last_topic_list(request): topics = Topic.objects.order_by('-topic_modification_date')[:50] for i in topics: pmax = i.post_set.all().count()/10 pmaxten = i.post_set.all().count()%10 if pmaxten != 0: i.pagination_max = pmax+1 else: i.pagination_max = pmax forum_name = _('Last Active Topics') retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_topics(self):\r\n return [x[0] for x in get_published_topics()]", "def topics(ctx):\n pass", "def get_topics(self):\n try:\n with self.__db_lock:\n sql = \"SELECT * FROM 'topics' ORDER BY 'name' ASC\"\n self.__cursor.execute(sql)\n ...
[ "0.705034", "0.64365596", "0.64050555", "0.6391744", "0.6317153", "0.6284976", "0.6268085", "0.6266705", "0.6239917", "0.6173365", "0.61572224", "0.6146802", "0.6092059", "0.60849684", "0.60842997", "0.60330325", "0.5987122", "0.59789485", "0.59581673", "0.5916904", "0.588488...
0.790725
0
list topics with my posts show_user if not set will show current user topics
def my_posttopic_list(request, show_user=False): if not show_user: show_user = str(request.user) try: topics = Post.objects.order_by('-post_date').filter(post_author=show_user).values('post_topic').distinct()[:50] posts = [] for i in topics: posts.append(int(i['post_topic'])) topics = Topic.objects.order...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def my_topic_list(request, show_user=False):\n\tif not show_user:\n\t\tshow_user = str(request.user)\n\tif request.user.is_authenticated():\n\t\ttopics = Topic.objects.order_by('-topic_modification_date').filter(topic_author=show_user)[:50]\n\t\tforum_name = _('User Topics')\n\t\treturn render_to_response(\n\t\t\t...
[ "0.79176843", "0.68020207", "0.67652315", "0.6761055", "0.63410634", "0.6285622", "0.6211213", "0.61485666", "0.61334693", "0.61277074", "0.6119535", "0.61154777", "0.5989955", "0.5977707", "0.5962294", "0.5931599", "0.59149337", "0.5904821", "0.5894907", "0.58528423", "0.584...
0.803661
0
list post in topic with a generic pagination view topic_id id of a Topic entry
def post_list(request, topic_id, pagination_id): try: topic = Topic.objects.get(id=topic_id) except Topic.DoesNotExist: return HttpResponseRedirect('/forum/') if topic.is_locked: opened = False else: opened = True return object_list( request, topic.post_set.all().order_by('post_date'), paginate_by =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def topic(request, topic_id):\n posts = Post.objects.filter(topic=topic_id).order_by(\"created\")\n posts = mk_paginator(request, posts, DJANGO_SIMPLE_FORUM_REPLIES_PER_PAGE)\n topic = Topic.objects.get(pk=topic_id)\n return render_to_response(\"forum/topic.html\", add_csrf(request, posts=posts, pk=top...
[ "0.73865634", "0.7367165", "0.7171377", "0.69603044", "0.6776185", "0.6757272", "0.6622475", "0.66060674", "0.656054", "0.6419013", "0.6396373", "0.6345073", "0.6312444", "0.6294844", "0.6284002", "0.6277948", "0.62343496", "0.61232275", "0.60641515", "0.60380805", "0.6028233...
0.7904134
0
add topic forum_id ID of a Forum entry
def add_topic(request, forum_id): if request.POST: page_data = request.POST.copy() page_data['topic_author'] = str(request.user) tags = findall( r'(?xs)\[code\](.*?)\[/code\]''', page_data['text']) for i in tags: page_data['text'] = page_data['text'].replace(u'[code]'+i+u'[/code]', u'[code]'+base64.enco...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, project_id, forum):\n url = base_url + 'portal/' + str(self.portal_id) + '/projects/' + str(project_id) + '/forums/' \n data = parser.to_json(forum)\n if forum.get_upload_file():\n file_list = []\n for value in forum.get_upload_file():\n attac...
[ "0.6570903", "0.6472428", "0.6250559", "0.62304735", "0.6184321", "0.60586286", "0.60568684", "0.6007388", "0.6006287", "0.6000936", "0.5944206", "0.5922772", "0.58859265", "0.5834617", "0.5823592", "0.5787207", "0.57700557", "0.57238126", "0.5704046", "0.5689148", "0.5668062...
0.770152
0
add post topic_id id of a Topic entry post_id id of a Post entry to be quoted
def add_post(request, topic_id, post_id = False): topic = Topic.objects.values('is_locked').get(id=topic_id) if topic['is_locked']: return render_to_response('pages/bug.html', {'bug': _('Topic is closed')}, context_instance=RequestContext(request)) # check who made the last post. lastpost = Post.objects.order_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inputPostFormatter(post):\n\n post[\"ttl\"] = from_decimal(post[\"ttl\"])\n post[\"workToProve\"] = from_decimal(post.get(\"workToProve\", 0))\n post[\"priority\"] = from_decimal(post[\"priority\"])\n\n if not is_array(post.get(\"topics\")):\n post[\"topics\"] = [post[\"topics\"]] if post.ge...
[ "0.56744564", "0.558241", "0.5538942", "0.5525987", "0.55021226", "0.54626447", "0.5433334", "0.54127514", "0.5382309", "0.5327841", "0.5323823", "0.53021455", "0.528666", "0.5278014", "0.52204454", "0.51643574", "0.5163705", "0.5158911", "0.5143387", "0.51425105", "0.5131639...
0.61425745
0
delete a post post_id ID of a Post entry topic_id Topic entry ID that contain the Post entry
def delete_post(request, post_id, topic_id): if request.user.is_authenticated() and request.user.is_staff: Post.objects.get(id=post_id).delete() topic = Topic.objects.get(id=topic_id) topic.topic_posts = topic.topic_posts -1 topic.save() return HttpResponseRedirect("/forum/topic/1/" + topic_id +"/") else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_post(self, postid, publish=True):\n return self.execute('metaWeblog.deletePost', self.appkey, postid, self.username, self.password, publish)", "def deletePost(post_id):\n\n cur, con = initialise(1, True)\n cur.execute(\"DELETE FROM posts WHERE id = ?\", [post_id])\n finish(con)", "de...
[ "0.7290854", "0.71813744", "0.707189", "0.70144165", "0.6734157", "0.6705272", "0.66744095", "0.66170305", "0.65778816", "0.6540325", "0.6527792", "0.65232277", "0.6492486", "0.6463847", "0.6436576", "0.64360607", "0.6435728", "0.6426961", "0.64227504", "0.64221185", "0.63968...
0.7708023
0
delete a topic with all posts topic_id ID of a Topic entry forum_id ID of a Forum entry that contain the Topic entry
def delete_topic(request, topic_id, forum_id): if request.user.is_authenticated() and request.user.is_staff: posts = Post.objects.filter(post_topic=topic_id).count() Topic.objects.get(id=topic_id).delete() Post.objects.filter(post_topic=topic_id).delete() forum = Forum.objects.get(id=forum_id) forum.forum_to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_forum_delete_with_user_and_topic(topic, user):\n assert user.post_count == 1\n\n topic.forum.delete([user])\n\n forum = Forum.query.filter_by(id=topic.forum_id).first()\n\n assert forum is None\n\n assert user.post_count == 0", "def test_topic_delete(topic):\n assert topic.user.post_co...
[ "0.73016423", "0.7203841", "0.6963431", "0.69614524", "0.67349267", "0.67126554", "0.64723164", "0.646823", "0.64286953", "0.63918406", "0.6367718", "0.61540616", "0.6082416", "0.59594494", "0.5956341", "0.5948439", "0.59352607", "0.5894316", "0.5869952", "0.58637923", "0.582...
0.7847929
0
move topic topic_id ID of a Topic entry forum_id ID of a Forum entry that contain the Topic entry
def move_topic(request, topic_id, forum_id): if request.user.is_authenticated() and request.user.is_staff: if request.POST and len(request.POST['forum']) > 0: topic = Topic.objects.get(id=topic_id) topic.topic_forum=Forum.objects.get(id=request.POST['forum']) topic.save() t = Topic( topic_forum=Forum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_topic_move(topic):\n forum_other = Forum(title=\"Test Forum 2\", category_id=1)\n forum_other.save()\n\n forum_old = Forum.query.filter_by(id=topic.forum_id).first()\n\n assert topic.move(forum_other)\n\n assert forum_old.topics.all() == []\n assert forum_old.last_post_id is None\n\n ...
[ "0.7131075", "0.6714556", "0.6159936", "0.58648306", "0.560254", "0.54284686", "0.5379261", "0.53368664", "0.5330624", "0.52451175", "0.5174865", "0.5153713", "0.5137819", "0.5133269", "0.5069009", "0.49978033", "0.49439996", "0.49279928", "0.49038643", "0.4900711", "0.487935...
0.7425224
0
close topic topic_id ID of a Topic entry forum_id ID of a Forum entry that contain the Topic entry
def close_topic(request, topic_id, forum_id): if request.user.is_authenticated() and request.user.is_staff: topic = Topic.objects.get(id=topic_id) topic.is_locked=True topic.save() return HttpResponseRedirect("/forum/forum/" + forum_id +"/") else: return render_to_response('pages/bug.html', {'bug': _('You a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CloseForum(self, event):\n pass", "def delete_topic(request, topic_id, forum_id):\n\tif request.user.is_authenticated() and request.user.is_staff:\n\t\tposts = Post.objects.filter(post_topic=topic_id).count()\n\t\tTopic.objects.get(id=topic_id).delete()\n\t\tPost.objects.filter(post_topic=topic_id).dele...
[ "0.69265425", "0.62713945", "0.60562444", "0.5694666", "0.5645075", "0.5537677", "0.5536338", "0.5399221", "0.53810674", "0.53675985", "0.5337655", "0.5310567", "0.52487916", "0.51788086", "0.5140474", "0.5059159", "0.505236", "0.50319016", "0.5029529", "0.50178045", "0.49900...
0.7385165
0
open topic topic_id ID of a Topic entry forum_id ID of a Forum entry that contain the Topic entry
def open_topic(request, topic_id, forum_id): if request.user.is_authenticated() and request.user.is_staff: topic = Topic.objects.get(id=topic_id) topic.is_locked=False topic.save() return HttpResponseRedirect("/forum/forum/" + forum_id +"/") else: return render_to_response('pages/bug.html', {'bug': _('You a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_topic(request, topic_id, forum_id):\n\tif request.user.is_authenticated() and request.user.is_staff:\n\t\ttopic = Topic.objects.get(id=topic_id)\n\t\ttopic.is_locked=True\n\t\ttopic.save()\n\t\treturn HttpResponseRedirect(\"/forum/forum/\" + forum_id +\"/\")\n\telse:\n\t\treturn render_to_response('pages...
[ "0.64089066", "0.61834556", "0.608341", "0.59609735", "0.592506", "0.5805181", "0.5580653", "0.555434", "0.5401649", "0.53877735", "0.5352653", "0.5329012", "0.5293954", "0.52889127", "0.52800125", "0.5265754", "0.5243257", "0.5208003", "0.5203939", "0.517839", "0.5164468", ...
0.73087126
0
Generate a request and store it for a given proxy Chain
def generateDelegationRequest( self, proxyChain, userDN ): retVal = self._getConnection() if not retVal[ 'OK' ]: return retVal connObj = retVal[ 'Value' ] retVal = proxyChain.generateProxyRequest() if not retVal[ 'OK' ]: return retVal request = retVal[ 'Value' ] retVal = request....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_request(self, key):\n params = {'requestedKey': key}\n res = requests.get(url=self.proxy_url, params=params)\n return res", "def CraftREQ(target, data=None, method=\"\", cookies=None, proxy=None):\n\n if method == \"POST\":\n\n req = requests.post\n \n else:\n\n ...
[ "0.5822375", "0.5781705", "0.5694862", "0.56335956", "0.56069195", "0.5526165", "0.55199844", "0.55183387", "0.5507352", "0.5470857", "0.54103893", "0.54103893", "0.53639096", "0.5351645", "0.53144705", "0.5304702", "0.5300411", "0.5286486", "0.52729994", "0.5258008", "0.5246...
0.7016759
0
Purge expired requests from the db
def purgeExpiredRequests( self ): cmd = "DELETE FROM `ProxyDB_Requests` WHERE ExpirationTime < UTC_TIMESTAMP()" return self._update( cmd )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _purge_expired_user_tokens():\n expired = models.Token.query.filter_by(\n _user_fk=current_user.id).filter(\n models.Token.expiration_date <= datetime.utcnow()\n ).all()\n if expired:\n for token in expired:\n db.session.delete(token)\n db.session.commit()", "d...
[ "0.72050285", "0.7127917", "0.71021295", "0.7098698", "0.6926186", "0.6905672", "0.6820967", "0.6804602", "0.67834455", "0.6764798", "0.67552555", "0.6708928", "0.67059666", "0.67030096", "0.6676758", "0.6637986", "0.6602445", "0.6478992", "0.64710385", "0.6464518", "0.639524...
0.84799945
0
Delete a request from the db
def deleteRequest( self, requestId ): cmd = "DELETE FROM `ProxyDB_Requests` WHERE Id=%s" % requestId return self._update( cmd )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, request_id):\n request = RequestModel.select_by_id(request_id)\n if request:\n request.delete_from_db()\n return {'message': 'Request deleted'}, 200\n return {'message': 'Request not found'}, 404", "def delete(cls, request_id):\n try:\n ...
[ "0.8229804", "0.76968706", "0.76622194", "0.7454429", "0.72938126", "0.72398186", "0.7220319", "0.72123843", "0.7180326", "0.7139766", "0.7105021", "0.70788395", "0.69926", "0.692311", "0.6867637", "0.6867637", "0.6867637", "0.6867637", "0.6867637", "0.6867637", "0.6867637", ...
0.80820704
1
Complete a delegation and store it in the db
def completeDelegation( self, requestId, userDN, delegatedPem ): retVal = self.retrieveDelegationRequest( requestId, userDN ) if not retVal[ 'OK' ]: return retVal request = retVal[ 'Value' ] chain = X509Chain( keyObj = request.getPKey() ) retVal = chain.loadChainFromString( delegatedPem ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def complete(self):\n\t\tres = getattr(self._client, \"complete_\" + self.method)(self)\n\t\tself._create_fields(res)", "def done(self):\n self.status = 'completed'\n self.end = datetime.datetime.now()\n self.save()", "def complete(self):\n self.completed = peewee.datetime.date.toda...
[ "0.61047965", "0.5578747", "0.55091995", "0.55080706", "0.54306924", "0.5422218", "0.5386395", "0.53751755", "0.5360327", "0.5323545", "0.5306802", "0.5294053", "0.52203256", "0.5201263", "0.51974523", "0.51766515", "0.51766515", "0.5162817", "0.51593214", "0.51593214", "0.51...
0.5949987
1
Store user proxy into the Proxy repository for a user specified by his DN and group.
def storeProxy( self, userDN, userGroup, chain ): #Get remaining secs retVal = chain.getRemainingSecs() if not retVal[ 'OK' ]: return retVal remainingSecs = retVal[ 'Value' ] if remainingSecs < self._minSecsToAllowStore: return S_ERROR( "Cannot store proxy, remaining secs %s is less than...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def proxy_user(self, proxy_user):\n\n self._proxy_user = proxy_user", "def set_proxy(self, proxy, user=None):\n proxy_handler = urllib2.ProxyHandler({'http':proxy})\n proxy_auth_handler = urllib2.ProxyBasicAuthHandler()\n if user:\n proxy_auth_handler.add_password('realm', ...
[ "0.59217805", "0.58081776", "0.55733275", "0.5563239", "0.5543035", "0.5453733", "0.53007734", "0.52942115", "0.5285648", "0.5189838", "0.5182187", "0.5122461", "0.5121389", "0.50961834", "0.5095189", "0.50855327", "0.5082368", "0.5074877", "0.5065176", "0.5018182", "0.500882...
0.7082033
0
Get all the distinct users from the Proxy Repository. Optionally, only users with valid proxies within the given validity period expressed in seconds
def getUsers( self, validSecondsLeft = 0, dnMask = False, groupMask = False ): cmd = "SELECT UserDN, UserGroup, ExpirationTime, PersistentFlag FROM `ProxyDB_Proxies`" sqlCond = [] if validSecondsLeft: sqlCond.append( "( UTC_TIMESTAMP() + INTERVAL %d SECOND ) < ExpirationTime" % validSecondsLeft ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def online_users(room):\n threshold = datetime.now() - timedelta(seconds=10)\n authorizations = models.Authorization.gql(\"WHERE room = :room AND last_checked_in >= :threshold\", room=room, threshold=threshold).fetch(1000)\n return [x.user for x in authorizations]", "def get_all_users():", "def get_users(fi...
[ "0.57535833", "0.565889", "0.56535566", "0.56447166", "0.55493206", "0.55464524", "0.55074733", "0.5499751", "0.54948443", "0.5410248", "0.5405992", "0.53292644", "0.53161293", "0.5315384", "0.5276184", "0.5266737", "0.52615124", "0.52547234", "0.525417", "0.5224818", "0.5202...
0.70390385
0
Set the proxy PersistentFlag to the flag value
def setPersistencyFlag( self, userDN, userGroup, persistent = True ): if persistent: sqlFlag = "True" else: sqlFlag = "False" retVal = self._query( "SELECT PersistentFlag FROM `ProxyDB_Proxies` WHERE UserDN='%s' AND UserGroup='%s'" % ( userDN, userGroup ) ) sqlInsert = True if retVal[ 'O...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_flag(self, new):\n self.flag = new", "def setFlag(self, flag, value) -> None:\n ...", "def setpersist(self, v = True):\n\t\tif v:\n\t\t\tpservlet.pipe_set_flag(self._pipe_desc, pservlet.PIPE_PERSIST)\n\t\telse:\n\t\t\tpservlet.pipe_clr_flag(self._pipe_desc, pservlet.PIPE_PERSIST)", "def...
[ "0.65685695", "0.6513343", "0.6107199", "0.6105782", "0.605706", "0.5902015", "0.58990586", "0.58684254", "0.5772798", "0.56335574", "0.5555304", "0.554686", "0.54772735", "0.5459912", "0.54429626", "0.5432712", "0.5316736", "0.53020555", "0.5289182", "0.52507377", "0.5246892...
0.7167987
0
parses S3 URIs, seperating out buckets and keys from URI
def parse_s3_uri(URIs): buckets, keys = [], [] for URI in URIs: uri_path = path.normpath(URI).split("/") buckets.append(uri_path[1]) keys.append(uri_path[2:]) return buckets, keys
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_uri(uri):\n if not uri.startswith(\"s3://\"):\n raise ValueError(\"Expected S3 URI\")\n\n bucket_name, key = uri.replace(\"s3://\", \"\").split(\"/\", 1)\n return bucket_name, key", "def split_uri(s3_uri):\n if not s3_uri.startswith(\"s3://\"):\n # This is a local path, indica...
[ "0.7601655", "0.75760186", "0.74301505", "0.7424966", "0.7108844", "0.70691174", "0.7015538", "0.7009675", "0.7009675", "0.6822402", "0.6709821", "0.6485721", "0.64307153", "0.623975", "0.621792", "0.6195706", "0.61945844", "0.61888546", "0.6175611", "0.6159094", "0.61582816"...
0.86739224
0
Stores word2id dictionary from words in training vocabulary
def make_word2id(): with open("public_data/stats/stats_train.pkl", 'rb') as stats: stats = pickle.load(stats) vocab = stats["VOCAB"] word2id = {word: id for id, word in enumerate(["PAD"] + ["UNK"] + vocab)} with open('public_data/vocab/word2id.pkl', 'wb') as out: pickle.dump(word2i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vocab(self):\n word2id = {}\n for document in self.docs:\n for word in document:\n if word not in word2id.keys():\n word2id[word] = len(word2id)\n return word2id", "def construct_dict(self):\n i = 0\n self.word2idx = dict()\n...
[ "0.73038775", "0.7203376", "0.70576453", "0.6924759", "0.6815921", "0.6719704", "0.67111146", "0.6669637", "0.6546232", "0.65460104", "0.6448843", "0.64258194", "0.6423799", "0.64063257", "0.6365616", "0.63559467", "0.6345046", "0.63379437", "0.63323116", "0.63318515", "0.632...
0.7919803
0
Create asset array with all sizes of images for each product of lifecycle
def generate_assets(all_assets): assets = {} for lifecycle, products in all_assets.iteritems(): assets[lifecycle] = [] for product in products: asset_obj = OrderedDict() asset_obj["id"] = product[0] asset_obj["division"] = product[1] asset_obj["we...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _assign_sizes(self):", "def resize_images(self, images):\n \n img_list = []\n \n for img in images:\n \n yield np.resize(img, (64, 64, 3))", "def process_batch(self, image_batch):\n images = []\n for image_data in image_batch:\n image_resize = ...
[ "0.6172347", "0.5884541", "0.5736473", "0.56442803", "0.56417143", "0.55343497", "0.55309707", "0.55230796", "0.55127066", "0.54805094", "0.5476719", "0.54632604", "0.5457379", "0.54541683", "0.54203033", "0.54203033", "0.54203033", "0.5414684", "0.5413111", "0.53764224", "0....
0.6367673
0
Wake up every hour and log stats, and then reset them
def statsWorker(): logger.info('STATS: Starting. Will report out every {0:.1g} hours'.format( config.STATS_HOURS)) while True: gevent.sleep(timedelta(hours=config.STATS_HOURS).total_seconds()) logger.info('STATS: {0}'.format(stats)) stats.resetStats() return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_monitoring(self):\n full_delta = datetime.datetime.now() - datetime.timedelta(seconds=self.time_per_sample + 5)\n\n self.time_in = self.time_in[self.time_in.time > full_delta]\n self.time_out = self.time_out[self.time_out.time > full_delta]", "def shutdown_all(self, now=False):", ...
[ "0.6193402", "0.61183417", "0.61158735", "0.6086553", "0.6029186", "0.59815824", "0.59248847", "0.5893207", "0.588353", "0.5867332", "0.5845896", "0.57497585", "0.57359594", "0.5724779", "0.5697916", "0.5680231", "0.56749666", "0.5672578", "0.56719005", "0.56719005", "0.56623...
0.6350241
0
This converts the first entry on the line to an ahref
def _convert_first_href(line): x = line.split(',') x[0] = '<a href=%(url)s>%(url)s</a>' % {'url': x[0]} return ",".join(x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getanchor(self, line):\n m = anchor_re.match(line)\n if not m:\n return self._getsec(line)\n self.anchors.append(m.group(1))", "def ref_to_link(txt):\n text = txt.group(1) # because it was a match in a regular expression\n\n thecite, everythingelse = first_bracketed_st...
[ "0.63108945", "0.61250603", "0.6017764", "0.6002495", "0.5956088", "0.5952824", "0.5938942", "0.5931109", "0.5890632", "0.5864228", "0.58549714", "0.5852067", "0.58110666", "0.581035", "0.57908547", "0.5742307", "0.5735765", "0.5683315", "0.5677927", "0.5621661", "0.56175065"...
0.77906954
0
This prints out the CSV with a header added
def print_csv(): # read lines, and make the first a link show_played = request.args.get('showPlayed', 'true') == 'true' show_out_of_office = request.args.get('showOutOfOffice', 'true') == 'true' songs = database.load_songs(include_played=show_played, include_out_of_office=show_out_of_office) entries...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printCsvHeader(self):\n print \"SOURCE FILENAME, RECORD NUMBER, TIME GEN, \"\\\n \"TIME WRITE, CATEGORY, EVENTID, SOURCE, \"\\\n \"COMPUTER, SID, STRINGS, RAW DATA (HEX), \"\\\n \"DECODED DATA\"", "def printCsv(self):\n self.printCsvHeader()\n for r in se...
[ "0.77476895", "0.74596447", "0.7383138", "0.71409005", "0.69810814", "0.69635314", "0.69633526", "0.695496", "0.68683624", "0.6853501", "0.68518484", "0.6849127", "0.68360305", "0.6787503", "0.67758346", "0.6773313", "0.6755514", "0.67418337", "0.6713585", "0.6700836", "0.669...
0.763549
1
This gets the song name from the YouTube address
def get_song_name(): try: url = request.args.get('url') if url: return util.get_title_from_youtube_url(url) else: return '<URL was missing>' except Exception as ex: return str(ex.message)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_song_name_from_result(result):\n return result['metadata']['music'][0]['external_metadata']['spotify']['track']['name']", "async def yt_info(self, song):\n API_KEY = 'API_KEY'\n youtube = build('youtube', 'v3', developerKey=API_KEY)\n song_data = youtube.search().list(part='snippe...
[ "0.69615036", "0.6758768", "0.6587414", "0.6573831", "0.61943185", "0.6166351", "0.6151563", "0.61483437", "0.612491", "0.6116674", "0.6101847", "0.6078137", "0.60509545", "0.6022776", "0.59889394", "0.5975916", "0.59588563", "0.5937606", "0.58966094", "0.58892465", "0.588782...
0.7844623
0
Connects to database, creates tables and loads data from csv
def connect_db_and_load_data(cls): db.connect() db.create_tables([Product], safe=True) load_data(transform_data('./inventory.csv'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(csvfile, dbfile, verbose=False):\n CONN = sqlite3.connect(dbfile)\n cursor = CONN.cursor()\n create_schema(cursor)\n process_data(cursor, csvfile, verbose=verbose)\n CONN.commit()\n CONN.close()", "def load_data_to_db(self, path):\n table_names = ['train_transaction', 'train_ide...
[ "0.7633099", "0.7233952", "0.70024323", "0.6959611", "0.69234383", "0.68967825", "0.68423486", "0.6809061", "0.679033", "0.6757163", "0.6749312", "0.6674741", "0.66451144", "0.66323376", "0.6627188", "0.65659904", "0.6553499", "0.6547236", "0.6542627", "0.6540748", "0.6532193...
0.7798764
0
Closes connection to database
def close_db_connection(cls): db.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_database(self):\n if self._conn is not None:\n self._conn.close()\n self._conn = None", "def close_connection(exception):\n db = database()\n\n if db is not None:\n db.close()", "def close(self):\n Log.debug('DB -> close')\n # 关闭数据库连接\n s...
[ "0.85016555", "0.8405002", "0.82406324", "0.8214387", "0.8180319", "0.8176797", "0.8130337", "0.80947405", "0.8090644", "0.80654186", "0.80572706", "0.8053135", "0.80515546", "0.8043433", "0.8011985", "0.79536927", "0.79522735", "0.79410815", "0.7937091", "0.79334754", "0.791...
0.85548913
0
Adds a new product to the database based on user input. Conflict handling will check if the product name already exists. If it already exists, the price, quantity and date_updated values will update the existing product.
def add_product(cls, product_name, price, quantity): Product.insert(product_name=product_name, product_price=price, product_quantity=quantity, date_updated=date.today()).on_conflict( conflict_target=[Product.product_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_product():\n name = input(\"\\nPlease enter the name of the new product: \")\n\n quantity = input(\"Please enter the quantity of the new product: \")\n while quantity.isdigit() == False:\n print(\"Please enter a valid number.\")\n quantity = input(\"Please enter the quantity of the n...
[ "0.7842531", "0.76138026", "0.7161013", "0.7147513", "0.7056334", "0.69976074", "0.6955493", "0.686388", "0.68623877", "0.6830491", "0.6797156", "0.6791129", "0.67237514", "0.66988385", "0.66972744", "0.6694683", "0.6676686", "0.666991", "0.66635215", "0.6643723", "0.6605917"...
0.8031394
0
Extracts crater coordinates (in pixels) from a CNNpredicted target by iteratively sliding rings through the image via match_template from scikitimage.
def template_match_t(self, target, minrad=minrad_, maxrad=maxrad_, longlat_thresh2=longlat_thresh2_, rad_thresh=rad_thresh_, template_thresh=template_thresh_, target_thresh=target_thresh_, rw=rw_): # thickness of rings for template match #c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(image_path, wrapper):\n \"\"\"\n #Don't forget to store your prediction into ImgPred\n img_prediction = ImgPred(...)\n \"\"\"\n\n #This is where all of our code will probably go. Here are the steps to success\n\n \n #Step One: Make a list which will cont...
[ "0.5992719", "0.59377164", "0.59244645", "0.5877198", "0.5799066", "0.5745002", "0.57416475", "0.5725476", "0.56992644", "0.5695285", "0.56865203", "0.56704944", "0.5668689", "0.5619099", "0.55937564", "0.55932057", "0.5573753", "0.55696166", "0.55518115", "0.55396336", "0.54...
0.613752
0
Tests that the CLI can properly init a new project install packages and build it 1. `enamlnative init` works to create a new project 2. `enamlnative install ` properly installs and links modules 3. `enamlnative buildpython` succeeds 4. `enamlnative buildandroid` succeeds
def init_build(): if 'TRAVIS' in os.environ: return #: Doesn't work on travis try: enamlnative = sh.Command('enaml-native') bundle_id = 'com.mycompany.myapp' print(enamlnative('init', 'MyApp', bundle_id, 'tmp/test_cli/')) with cd('tmp/test_cli/MyApp'): #: Mak...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_native_SDK3_project(self):\n self.make_project()\n self.add_file(\"main.c\", SIMPLE_MAIN)\n self.compile()\n self.check_compile_success()\n\n # self.check_package_manifest(manifest, package_options={'dependencies': deps})", "def test_native_SDK2_project(self):\n ...
[ "0.6791964", "0.63297325", "0.6315993", "0.60872173", "0.60378206", "0.60377306", "0.60319066", "0.5935328", "0.59059525", "0.5905044", "0.58770114", "0.58520967", "0.58490705", "0.5831709", "0.58151686", "0.5778338", "0.57725954", "0.5745965", "0.56459093", "0.564228", "0.55...
0.79316795
0
The function takes a list of words as its argument. Returns a score generated as follows, > Start with a net score of 0 > If the element is a alphastring, +1 > If the element is a number, 1
def alphanum_score(words): #Our score variable. score = 0 #Iterating over the list for i in words: if i.isalpha(): #A method to check if the word contains only alphabets. score += 1 elif i.isdigit():#A method to check if the word contains...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def alphanum_score(words):\n\n\t# Add your code here\n\treturn", "def wordscore(word):\n return sum(letterscore[l] for l in word)", "def getWordScore(word, n):\n score = 0\n for letter in word:\n score += SCRABBLE_LETTER_VALUES[letter]\n score *= len(word)\n if len(word) == n:\n sc...
[ "0.7432295", "0.72729456", "0.6914699", "0.6846633", "0.68115157", "0.68013614", "0.6784953", "0.6776121", "0.6689199", "0.6604378", "0.6591572", "0.6557978", "0.6543751", "0.65320504", "0.64311683", "0.6414645", "0.6356937", "0.6258017", "0.6220672", "0.6216013", "0.62052256...
0.7487107
0
The function takes a list of words and a letter as its arguments. Returns a list sorted by the number of times the given letter occurs.
def occurences(words, letter): # Add your code here #An empty list that holds the number of occurences for each word. times = [] #Iterating over the list for i in words: times.append(i.count(letter)) #str.count(substr) is a method to find the occurence...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def letter_frequency(sentence, alphabet):\n sentence = sentence.lower()\n letter_frequency = []\n for char in alphabet:\n counter = sentence.count(char)\n letter_frequency.append((counter, char))\n sorted_frequency = sorted(letter_frequency)\n sorted_frequency.sort(reverse=True...
[ "0.78400177", "0.73378974", "0.7074989", "0.70550966", "0.70459694", "0.68162876", "0.6673813", "0.665069", "0.6647478", "0.6644844", "0.6631719", "0.65978014", "0.6554031", "0.6553464", "0.6523389", "0.65077704", "0.64865404", "0.6483174", "0.64714116", "0.6457109", "0.64385...
0.8560076
0
The functions takes two lists of 2tuples as its arguments. Returns a list of the form [tuples1 sorted by first element, tuples2 sorted by second element]
def function(tuples1, tuples2): # Add your code here #Main idea is to sort the tuples separately and concatenate them later. tuples1.sort() #Default argument is always the first element in a tuple. tuples2.sort(key = lambda x: x[1]) return tuples1 + tuples2 """ Altern...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_by_return(list_of_tuples):\n list_of_tuples = sorted(list_of_tuples, key=lambda item: item[0])\n left_side = list_of_tuples[0:2]\n right_side = list_of_tuples[2:4]\n left_side = sorted(left_side, key=lambda item: item[1])\n right_side = sorted(right_side, key=lambda item: item[1])\n resu...
[ "0.736006", "0.70949495", "0.7086582", "0.691162", "0.664975", "0.6569251", "0.6535565", "0.65042037", "0.6476197", "0.6445468", "0.64145356", "0.63522243", "0.6341892", "0.63319397", "0.63228965", "0.63190734", "0.6275016", "0.6194278", "0.6166531", "0.61547875", "0.61241627...
0.7919305
0
Update any speed/state based attributes
def _update_speed_attributes(self): self._attributes[ATTR_SPEED] = self._current_speed if self._current_speed is None: return coding = self._attributes[CONF_CONTROLLER_CODING] controller_config = LUNOS_CODING_CONFIG[coding] if not controller_config: LOG.e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self):\n bondState = self._bond.getDeviceState(self._deviceId)\n if 'power' in bondState:\n self._state = True if bondState['power'] == 1 else False\n if self._state and bondState['speed'] in self._speed_name_by_value:\n self._attributes['current_speed'...
[ "0.7656136", "0.7104007", "0.6732699", "0.66890204", "0.6628044", "0.66127306", "0.66127306", "0.6612705", "0.6576689", "0.6559547", "0.6549842", "0.6462424", "0.6423813", "0.635823", "0.6349929", "0.63344187", "0.63335216", "0.6323203", "0.6307892", "0.6307892", "0.6307892",...
0.74510974
1
Get the list of available preset modes.
def preset_modes(self) -> list: return self._preset_modes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preset_modes(self):\n return self._preset_modes", "def preset_modes(self) -> List[str]:\n return self._support_presets", "def preset_modes(self):\n return list(PRESET_MODE_TO_DPS_MODE.keys())", "def preset_modes(self) -> list[str]:\n # Use the Vallox profile names for the pres...
[ "0.85059565", "0.85046875", "0.8159078", "0.8132896", "0.780501", "0.76593965", "0.7572532", "0.75182325", "0.7515777", "0.7489958", "0.7480582", "0.74632555", "0.73047006", "0.72556746", "0.7186609", "0.71617156", "0.70367336", "0.6996852", "0.69910216", "0.69773203", "0.690...
0.8712399
0
Probe W1/W2 relays for current states and then match to a speed
def _determine_current_relay_speed(self): w1 = self.hass.states.get(self._relay_w1) if not w1: LOG.warning( f"W1 entity {self._relay_w1} not found, cannot determine {self._name} LUNOS speed." ) return None w2 = self.hass.states.get(self._relay...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def speed_detect(motion_first, motion_second, distance):\n if (GPIO.input(motion_first) == 1):\n # Determines if first motion sensor is triggered first.\n speed(timing(motion_second), distance)\n # Sends speed as message to server when corresponding sensor triggered.\n ensure_low(mot...
[ "0.6513912", "0.5851191", "0.5842303", "0.5761352", "0.57429296", "0.5655584", "0.5653277", "0.5639711", "0.56101817", "0.5596971", "0.55832094", "0.5499165", "0.5468255", "0.54663295", "0.5430599", "0.5424834", "0.5406324", "0.54036164", "0.5398869", "0.53947705", "0.5389341...
0.6577904
0
Update the current speed (+ refresh any dependent attributes)
def _update_speed(self, speed): if speed is None: return if speed == self._current_speed: return self._current_speed = speed self._update_speed_attributes() LOG.info( f"Updated LUNOS {self._name}: {self.percentage}% {self._current_speed}" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_speed_attributes(self):\n self._attributes[ATTR_SPEED] = self._current_speed\n if self._current_speed is None:\n return\n\n coding = self._attributes[CONF_CONTROLLER_CODING]\n controller_config = LUNOS_CODING_CONFIG[coding]\n if not controller_config:\n ...
[ "0.76170844", "0.7530956", "0.7251622", "0.7234627", "0.71615994", "0.70546925", "0.7049263", "0.70340717", "0.6993405", "0.69703823", "0.6955602", "0.693422", "0.6907308", "0.69017524", "0.6848571", "0.6830297", "0.6827584", "0.6826347", "0.68106616", "0.67763335", "0.676170...
0.7635065
0
Create a new empty Column with the same length and the same mask.
def column_empty_like_same_mask(column, dtype): data = cuda.device_array(shape=len(column), dtype=dtype) params = dict(data=Buffer(data)) if column.has_null_mask: params.update(mask=column.nullmask) return Column(**params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def column_empty_like(column, dtype, masked):\n data = cuda.device_array(shape=len(column), dtype=dtype)\n params = dict(data=Buffer(data))\n if masked:\n mask = utils.make_mask(data.size)\n params.update(dict(mask=Buffer(mask), null_count=data.size))\n return Column(**params)", "def _m...
[ "0.7123332", "0.60310805", "0.6025068", "0.5759655", "0.5578718", "0.5557745", "0.5551191", "0.5484889", "0.547497", "0.5465928", "0.5449626", "0.53719026", "0.5368725", "0.5352053", "0.52982235", "0.5274085", "0.52357614", "0.5221875", "0.5208956", "0.51223946", "0.5119306",...
0.6882463
1
Select by a boolean mask to a column. Returns (selected_column, selected_positions)
def column_select_by_boolmask(column, boolmask): from .numerical import NumericalColumn assert not column.has_null_mask boolbits = cudautils.compact_mask_bytes(boolmask.to_gpu_array()) indices = cudautils.arange(len(boolmask)) _, selinds = cudautils.copy_to_dense(indices, mask=boolbits) _, selva...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _select(self,X,y=None):\n return X.loc[:,self.columns], y", "def select_mask(cls, dataset, selection):\n mask = np.ones(len(dataset), dtype=np.bool_)\n for dim, sel in selection.items():\n if isinstance(sel, tuple):\n sel = slice(*sel)\n arr = cls.val...
[ "0.6214352", "0.61018", "0.59364384", "0.56666255", "0.55793685", "0.5498983", "0.54978466", "0.5472354", "0.5470962", "0.54663765", "0.54368514", "0.5411798", "0.53567463", "0.53495824", "0.5324205", "0.5319597", "0.53014255", "0.5246769", "0.51611763", "0.5132307", "0.51158...
0.8456476
0
Gets the contact_info of this StoreProfile.
def contact_info(self): return self._contact_info
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contact_details(self):\n return self.data.get(\"contactDetails\")", "def contact_information(self) -> ContactInformation:\n return self._contact_information", "def contact_details(self) -> 'outputs.ContactDetailsResponse':\n return pulumi.get(self, \"contact_details\")", "def contact...
[ "0.7382779", "0.7178758", "0.7069896", "0.7069896", "0.7069896", "0.6821688", "0.6670985", "0.6670985", "0.66625243", "0.6414609", "0.6294944", "0.60695684", "0.6056503", "0.6021642", "0.59559315", "0.5888848", "0.5851236", "0.5751502", "0.57204616", "0.57056797", "0.56871384...
0.78388166
0
Sets the contact_info of this StoreProfile.
def contact_info(self, contact_info): self._contact_info = contact_info
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contact(self, contact):\n\n self.logger.debug(\"In 'contact' setter.\")\n\n self._contact = contact", "def contact(self, contact):\n\n self._contact = contact", "def contact(self, contact):\n\n self._contact = contact", "def contact_information(self, contact_information: Conta...
[ "0.69299614", "0.67071474", "0.67071474", "0.65718716", "0.6284828", "0.61824167", "0.61538726", "0.61538726", "0.5976365", "0.5943649", "0.5943649", "0.58734804", "0.58734804", "0.58521116", "0.57365626", "0.57365626", "0.5732711", "0.57138306", "0.56584156", "0.5627489", "0...
0.7964371
0
Gets the billing_info of this StoreProfile.
def billing_info(self): return self._billing_info
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def billing_info(self):\r\n return BillingInfo(self)", "def billing(self):\n return self._billing", "def billing_account(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"billing_account\")", "def billing_account(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"bill...
[ "0.77087563", "0.71477145", "0.6761446", "0.6761446", "0.6761446", "0.6540891", "0.6534776", "0.64655393", "0.63661957", "0.63661957", "0.61825705", "0.61825705", "0.61659193", "0.61363465", "0.6119282", "0.61044437", "0.6019976", "0.5942303", "0.5787421", "0.55749315", "0.55...
0.8297777
0
Sets the billing_info of this StoreProfile.
def billing_info(self, billing_info): self._billing_info = billing_info
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def billing(self, billing):\n\n self._billing = billing", "def billing_contact(self, billing_contact):\n\n self._billing_contact = billing_contact", "def billing_currency(self, billing_currency):\n\n self._billing_currency = billing_currency", "def billing_info(self):\n return sel...
[ "0.6947018", "0.6334089", "0.59712374", "0.5709125", "0.56954914", "0.5641454", "0.52830344", "0.5201318", "0.5174602", "0.51457936", "0.5099419", "0.5058219", "0.5058219", "0.50350636", "0.50086355", "0.49812788", "0.49464315", "0.49219757", "0.49004814", "0.4897163", "0.485...
0.8221735
0
Gets the facebook of this StoreProfile.
def facebook(self): return self._facebook
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fb_profile(self):\n return FBProfile.objects.get(fb_id=self.fb_id)", "def facebook(self):\n try:\n from facebook import Facebook\n except ImportError:\n log.warning(\"PyFacebook is not installed!\")\n else:\n if self.user and self.user.profile.uses...
[ "0.72637475", "0.68482184", "0.5892476", "0.56854427", "0.55518615", "0.5514546", "0.5474069", "0.53818136", "0.52848524", "0.5200367", "0.51482517", "0.5139177", "0.49755865", "0.49698114", "0.49656677", "0.49522483", "0.49521646", "0.49469793", "0.49355954", "0.49290457", "...
0.7497802
0
Sets the facebook of this StoreProfile.
def facebook(self, facebook): self._facebook = facebook
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebook_url(self, facebook_url):\n\n self._facebook_url = facebook_url", "def facebook(self):\n try:\n from facebook import Facebook\n except ImportError:\n log.warning(\"PyFacebook is not installed!\")\n else:\n if self.user and self.user.profile...
[ "0.6374106", "0.5990116", "0.5905431", "0.54284465", "0.5185664", "0.5098087", "0.50038993", "0.4828573", "0.4786767", "0.4675968", "0.46523046", "0.46096033", "0.4588999", "0.45869476", "0.4569041", "0.4569041", "0.4555865", "0.4552569", "0.45499423", "0.4545021", "0.4514413...
0.7717775
0
Gets the twitter of this StoreProfile.
def twitter(self): return self._twitter
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_twitter():\n \n return TwitterAPI(consumer_key, consumer_secret, access_token, access_token_secret)", "def twitter_handle(self):\n return self.twitter.strip().strip('/').split('/')[-1]", "def get_twitter():\n return TwitterAPI(consumer_key, consumer_secret, access_token, access_token_se...
[ "0.6313362", "0.63018733", "0.6151999", "0.6151999", "0.6151999", "0.6151999", "0.59864783", "0.5978816", "0.5908569", "0.58812046", "0.5767627", "0.57602674", "0.56825304", "0.5620173", "0.5508046", "0.54835796", "0.54588556", "0.5448028", "0.5362051", "0.53491855", "0.53206...
0.81262565
0
Sets the twitter of this StoreProfile.
def twitter(self, twitter): self._twitter = twitter
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def twitter(self):\n return self._twitter", "def set_twitter_auth():\n auth = ty.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)\n auth.set_access_token(ACCESS_TOKEN, ACCESS_SECRET)\n api = ty.API(auth)\n return api", "def save_tweet(self, twitter) -> None:\n if isinstance(twitter, dict):...
[ "0.67886657", "0.5879685", "0.58475894", "0.5459259", "0.5391684", "0.53389937", "0.531319", "0.5291508", "0.5286032", "0.52285236", "0.5221684", "0.52161473", "0.5190828", "0.5125012", "0.508939", "0.50773615", "0.5071382", "0.5068609", "0.5046601", "0.5046601", "0.5046601",...
0.8175747
0
Gets the youtube of this StoreProfile.
def youtube(self): return self._youtube
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def youtube(self, youtube):\n\n self._youtube = youtube", "def get_youtube_api_key(self):\n key = self.bot_data_file[\"youtube\"][\"key\"]\n if self.check_empty_key(key):\n return key\n else:\n print(\n \"ERROR GETTING THE YOUTUBE KEY (check bot do...
[ "0.6090054", "0.5948142", "0.5814511", "0.57243747", "0.5691043", "0.5570341", "0.5460085", "0.54214174", "0.5418943", "0.5391258", "0.5333565", "0.5277207", "0.5272169", "0.5246922", "0.5221705", "0.5219989", "0.52189547", "0.5195068", "0.51844424", "0.51579475", "0.5124477"...
0.79352546
0
Sets the youtube of this StoreProfile.
def youtube(self, youtube): self._youtube = youtube
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def youtube(self):\n return self._youtube", "def isYouTube(self):\n if 'youtube' in self.link.split('.'):\n return True\n return None", "def play_youtube(self, media_id):\n pass", "def set_y(self, y):\n self._y = y", "def SetY(self, y):\r\n\r\n self._y =...
[ "0.6800553", "0.54981285", "0.52603334", "0.52439976", "0.5157042", "0.5153385", "0.5152133", "0.5151252", "0.5134109", "0.5134109", "0.50935537", "0.504834", "0.5020317", "0.4995652", "0.49926963", "0.49606714", "0.4948556", "0.49337053", "0.49234337", "0.49103868", "0.48708...
0.8214083
0
Gets the instagram of this StoreProfile.
def instagram(self): return self._instagram
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def self(self):\n\n url = \"https://api.instagram.com/v1/users/self/?access_token=\" + self.access_token\n request = requests.get(url)\n return request.json()", "def get_gallery_profile(self):\n url = (\"https://api.imgur.com/3/account/{0}/\"\n \"gallery_profile\".format...
[ "0.6358503", "0.5790814", "0.57500106", "0.5704466", "0.54454136", "0.54388595", "0.5421649", "0.5314913", "0.5236288", "0.52185434", "0.51092464", "0.5101984", "0.5048644", "0.5047885", "0.50447875", "0.50331956", "0.49664336", "0.49385908", "0.49379966", "0.4937163", "0.493...
0.80316
0
Sets the instagram of this StoreProfile.
def instagram(self, instagram): self._instagram = instagram
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instagram(self):\n return self._instagram", "def change_profile_img(self):\n get_photo = reddit_scrapper()\n get_photo.get_image()\n # Send image to instagram profile picture on the hidden input tag\n profile_pic_button = self.driver.find_elements_by_xpath(\n '//...
[ "0.6435948", "0.53311217", "0.51667714", "0.51479274", "0.5049256", "0.49257427", "0.48655903", "0.48561212", "0.48192295", "0.47847643", "0.47819746", "0.4762666", "0.47518057", "0.47216386", "0.47202426", "0.46568915", "0.4634103", "0.46039426", "0.4603206", "0.45948482", "...
0.8030566
0
Gets the pinterest of this StoreProfile.
def pinterest(self): return self._pinterest
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interests(self):\n if \"interests\" in self._prop_dict:\n return self._prop_dict[\"interests\"]\n else:\n return None", "def get_percent_interest(self):\n return self.__percentage_interest", "def get_profile(self):\n endpoint = '/profile'\n return se...
[ "0.65898913", "0.62914765", "0.58359545", "0.5743681", "0.5684692", "0.562656", "0.5506814", "0.5492201", "0.5492201", "0.53988117", "0.5398023", "0.53309345", "0.5324174", "0.5252778", "0.52367723", "0.52086645", "0.5199404", "0.51921695", "0.5150444", "0.5120884", "0.511402...
0.7561153
0
Sets the pinterest of this StoreProfile.
def pinterest(self, pinterest): self._pinterest = pinterest
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repaid_interest(self, repaid_interest):\n\n self._repaid_interest = repaid_interest", "def paid_interest(self, paid_interest):\n\n self._paid_interest = paid_interest", "def set_profile(self, profile: str):\n self._profile = profile", "def pinterest(self):\n return self._pinte...
[ "0.6722862", "0.66200674", "0.5696167", "0.5647955", "0.5599525", "0.5578526", "0.5578526", "0.5271597", "0.5177461", "0.5171312", "0.51635766", "0.5154178", "0.50973547", "0.50973547", "0.5083053", "0.5078245", "0.50472605", "0.500781", "0.49349016", "0.48526222", "0.4851890...
0.76808065
0
Gets the linkedin of this StoreProfile.
def linkedin(self): return self._linkedin
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_profile(self):\n return self.user.profile", "def customer_profile_oid(self):\n return self._customer_profile_oid", "def linkedin(self, linkedin):\n\n self._linkedin = linkedin", "def facebook(self):\n return self._facebook", "def spinnaker_link_id(self):\n re...
[ "0.5506056", "0.54694885", "0.5464488", "0.544704", "0.54469264", "0.54198897", "0.529772", "0.5277959", "0.52728975", "0.5262846", "0.52600217", "0.5232096", "0.5193333", "0.51623476", "0.51113135", "0.5104671", "0.5104671", "0.50951856", "0.5093852", "0.5092114", "0.5088513...
0.78746176
0
Sets the linkedin of this StoreProfile.
def linkedin(self, linkedin): self._linkedin = linkedin
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linkedin(self):\n return self._linkedin", "def set_profile(self, profile: str):\n self._profile = profile", "def ssl_profile_id(self, ssl_profile_id):\n\n self._ssl_profile_id = ssl_profile_id", "def bank_link_id(self, bank_link_id):\n\n self._bank_link_id = bank_link_id", "...
[ "0.58889306", "0.56160456", "0.53995335", "0.5340398", "0.52321786", "0.50734967", "0.50274986", "0.49676663", "0.4957416", "0.4908219", "0.4908219", "0.48871168", "0.48871168", "0.48871168", "0.48871168", "0.48871168", "0.48276922", "0.47811252", "0.47811252", "0.47811252", ...
0.7773678
0
Find StoreProfile Return single instance of StoreProfile by its ID. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.get_store_profile_by_id(store_profile_id, async=True) >>> result = thread.get()
def get_store_profile_by_id(cls, store_profile_id, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async'): return cls._get_store_profile_by_id_with_http_info(store_profile_id, **kwargs) else: (data) = cls._get_store_profile_by_id_with_http_info(store_pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_store_profile_by_id(cls, store_profile_id, store_profile, **kwargs):\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async'):\n return cls._update_store_profile_by_id_with_http_info(store_profile_id, store_profile, **kwargs)\n else:\n (data) = cls._u...
[ "0.63915527", "0.63843274", "0.6318377", "0.5724052", "0.5701306", "0.54446805", "0.53150785", "0.5143096", "0.4992562", "0.4986166", "0.4973808", "0.4719636", "0.4691104", "0.4680017", "0.4658049", "0.46112853", "0.45759177", "0.44076565", "0.44049278", "0.4393338", "0.42727...
0.8730352
0
Find StoreProfile Return single instance of StoreProfile by its ID. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.get_store_profile_by_id_with_http_info(store_profile_id, async=True) >>> result = thread.get()
def _get_store_profile_by_id_with_http_info(cls, store_profile_id, **kwargs): all_params = ['store_profile_id'] all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') query_param...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_store_profile_by_id(cls, store_profile_id, **kwargs):\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async'):\n return cls._get_store_profile_by_id_with_http_info(store_profile_id, **kwargs)\n else:\n (data) = cls._get_store_profile_by_id_with_http_inf...
[ "0.7816626", "0.64097476", "0.6147514", "0.6006541", "0.59723264", "0.53484225", "0.5099231", "0.5085659", "0.47771797", "0.46476695", "0.46338823", "0.44602963", "0.4456509", "0.44503453", "0.44325805", "0.4348327", "0.42658782", "0.42495495", "0.4229194", "0.419231", "0.417...
0.6877337
1
Replace StoreProfile Replace all attributes of StoreProfile This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.replace_store_profile_by_id(store_profile_id, store_profile, async=True) >>> result = thread.get()
def replace_store_profile_by_id(cls, store_profile_id, store_profile, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async'): return cls._replace_store_profile_by_id_with_http_info(store_profile_id, store_profile, **kwargs) else: (data) = cls._replace_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_store_profile_by_id(cls, store_profile_id, store_profile, **kwargs):\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async'):\n return cls._update_store_profile_by_id_with_http_info(store_profile_id, store_profile, **kwargs)\n else:\n (data) = cls._u...
[ "0.6885914", "0.67330694", "0.58773977", "0.52470475", "0.48954603", "0.48951447", "0.46389085", "0.46356404", "0.4261312", "0.42433482", "0.4155907", "0.41291982", "0.4085003", "0.40291345", "0.40245122", "0.3992258", "0.3954855", "0.39477804", "0.39375296", "0.39363688", "0...
0.90080243
0
Replace StoreProfile Replace all attributes of StoreProfile This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.replace_store_profile_by_id_with_http_info(store_profile_id, store_profile, async=True) >>> result = thread.get()
def _replace_store_profile_by_id_with_http_info(cls, store_profile_id, store_profile, **kwargs): all_params = ['store_profile_id', 'store_profile'] all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace_store_profile_by_id(cls, store_profile_id, store_profile, **kwargs):\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async'):\n return cls._replace_store_profile_by_id_with_http_info(store_profile_id, store_profile, **kwargs)\n else:\n (data) = cls....
[ "0.8170745", "0.68115836", "0.63280797", "0.5807022", "0.5075471", "0.48232785", "0.47805983", "0.46873397", "0.4332378", "0.4276011", "0.42586622", "0.4145666", "0.41445535", "0.40397325", "0.40256742", "0.3964165", "0.39558113", "0.39429614", "0.39224705", "0.38937378", "0....
0.75694054
1
Update StoreProfile Update attributes of StoreProfile This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.update_store_profile_by_id(store_profile_id, store_profile, async=True) >>> result = thread.get()
def update_store_profile_by_id(cls, store_profile_id, store_profile, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async'): return cls._update_store_profile_by_id_with_http_info(store_profile_id, store_profile, **kwargs) else: (data) = cls._update_stor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace_store_profile_by_id(cls, store_profile_id, store_profile, **kwargs):\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async'):\n return cls._replace_store_profile_by_id_with_http_info(store_profile_id, store_profile, **kwargs)\n else:\n (data) = cls....
[ "0.7230002", "0.6507754", "0.6222082", "0.5933953", "0.57766426", "0.5688438", "0.5120334", "0.50300246", "0.4894006", "0.48243746", "0.4710169", "0.45956504", "0.44562137", "0.44239208", "0.43874782", "0.436339", "0.43628344", "0.43378687", "0.43211722", "0.4285686", "0.4280...
0.9047932
0
Update StoreProfile Update attributes of StoreProfile This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.update_store_profile_by_id_with_http_info(store_profile_id, store_profile, async=True) >>> result = thread.get()
def _update_store_profile_by_id_with_http_info(cls, store_profile_id, store_profile, **kwargs): all_params = ['store_profile_id', 'store_profile'] all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_req...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_store_profile_by_id(cls, store_profile_id, store_profile, **kwargs):\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async'):\n return cls._update_store_profile_by_id_with_http_info(store_profile_id, store_profile, **kwargs)\n else:\n (data) = cls._u...
[ "0.7928884", "0.67196536", "0.6655126", "0.55981606", "0.5541704", "0.53547645", "0.52973676", "0.51050305", "0.5037265", "0.5022932", "0.49508855", "0.45662946", "0.44526258", "0.4443034", "0.44325635", "0.43953535", "0.43644917", "0.42962268", "0.4286784", "0.426136", "0.42...
0.722869
1
Get all movies route
def get_movies(jwt): movies = Movie.query.all() return jsonify({ 'success': True, 'movies': [movie.format() for movie in movies], }), 200
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_movies(request):\n if request.method == 'GET':\n movies = Movie.objects.order_by('name')\n serializer = MovieSerializer(movies, many=True)\n return Response(serializer.data)", "def movie_videos(request, pk):\n if request.method == 'GET':\n videos_list = MovieVideos.objec...
[ "0.7742146", "0.7230303", "0.7064236", "0.6997405", "0.6962273", "0.69121444", "0.68483716", "0.6779101", "0.6698465", "0.6678601", "0.6657824", "0.66232103", "0.6595847", "0.6585631", "0.6572597", "0.6547498", "0.6511486", "0.64866924", "0.642735", "0.6354116", "0.63046557",...
0.72856766
1
Calculate total stats of the team.
def get_team_stats(players: list[Player]) -> dict[int]: team_stats = {} total_reaction = 0 total_mechanical_skill = 0 total_tactical_skill = 0 total_game_knowledge = 0 total_xp = 0 for player in players: total_reaction += player.reaction total_mechanical_skill += player.me...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_stats(self):\n if self.stats is not None:\n return\n self.stats = np.zeros(STEPS_MAX + 1)\n for m in self.missions:\n m.compute_stats()\n self.stats += 100 * m.stats\n self.stats /= len(self.missions)", "def calculate_stats(team_id, current...
[ "0.6866724", "0.6516617", "0.6500267", "0.6473973", "0.6449329", "0.6411839", "0.6410906", "0.63989806", "0.63727915", "0.632475", "0.6292756", "0.62803626", "0.6275075", "0.6271541", "0.625797", "0.62562364", "0.6236313", "0.62358105", "0.6187147", "0.6176917", "0.6176071", ...
0.6613851
1
Calculate effective stats. Return sum of ("randomized") total stats.
def get_effective_team_stats(team_stats: dict) -> int: # TODO: Problem effective stats <-> value # value = int((reaction * 0.5 + technical_skill * 1.5 + tactical_skill * 1.5 + game_knowledge) * xp) stats_sum = 0 for value in team_stats.values(): stats_sum += value * random.uniform(0.5, 1.5) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_stats(self):\n if self.stats is not None:\n return\n self.stats = np.zeros(STEPS_MAX + 1)\n for m in self.missions:\n m.compute_stats()\n self.stats += 100 * m.stats\n self.stats /= len(self.missions)", "def advancedStats():", "def theore...
[ "0.65244913", "0.6386114", "0.6129381", "0.610131", "0.6085135", "0.60286623", "0.6028354", "0.5958826", "0.5949397", "0.5928458", "0.58879834", "0.58813953", "0.5875047", "0.5824438", "0.5799078", "0.5780108", "0.576829", "0.5763093", "0.5756476", "0.5743684", "0.5735743", ...
0.68073934
0
mol > SMARTS matching the Rgroup 'mol' contain a single wildcard atom ("") with one single bond to the rest of the Rgroup. The molecule will be modified. Pass in a copy if you do not want the modification.
def rgroup_mol_to_smarts(mol): wildcard_idx = -1 suffixes = [] n = len(Chem.GetMolFrags(mol)) if n > 1: raise ValueError("more than one fragment found") # Could also check for n == 0. Decided to leave that # for the check for no wildcard atom. for idx, atom in enumerate(mol.Ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_smarts(prefix, atom_idxs):\n\n offmol = Molecule.from_file(prefix + '.mol2')\n fix_carboxylate_bond_orders(offmol)\n remove_charge_and_bond_order_from_guanidinium(offmol)\n remove_charge_and_bond_order_from_imidazole(offmol)\n if prefix in prefix2pmd_struct:\n pmd_struct = prefix2pmd_struct[prefix]...
[ "0.57086635", "0.53255963", "0.52779776", "0.52594936", "0.5152631", "0.51259947", "0.51239645", "0.5014598", "0.5004343", "0.4995221", "0.49575746", "0.49478635", "0.4945811", "0.49111938", "0.49016553", "0.48735607", "0.48373216", "0.48363814", "0.4813805", "0.4777415", "0....
0.70200217
0
add keyword and definition
def add(self, keyword, definitions): for x_temp in definitions: self.query(term1='kd',term2=keyword,term3=x_temp.strip(),action='set')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_keyword(x):\n ParsingTmp.keywords.append(x)", "def addkeyword(self, line):\n self.__keywords.append(line)", "def _add_keyword(self, collection_id, name, doc, args):\n argstring = json.dumps(args)\n self.db.execute(\"\"\"\n INSERT INTO keyword_table\n (c...
[ "0.7283657", "0.6951977", "0.6501668", "0.637323", "0.627265", "0.6201769", "0.6195948", "0.6053392", "0.599446", "0.5979317", "0.5978442", "0.5872311", "0.58630645", "0.58427155", "0.58426094", "0.58192027", "0.581771", "0.5801726", "0.5795179", "0.5790755", "0.5788727", "...
0.7007009
1
Method to list articles
def list(): articles = [] if request.method == 'GET': # Get all articles response = table.scan() articles = response.get('Items') return render_template('article/articles.html', articles=articles, title='List Articles')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_articles():\n\n return template(\"index\", articles=get_articles())", "def list(request):\n assert isinstance(request, HttpRequest)\n login = request.user and request.user.is_authenticated()\n article_list = get_article_list('-released_at',login)\n page_no = request.GET.ge...
[ "0.81339246", "0.77708673", "0.77106726", "0.7600298", "0.7563043", "0.74696064", "0.7430495", "0.7395493", "0.7299747", "0.7248591", "0.71522486", "0.71458757", "0.7080076", "0.7039615", "0.70225227", "0.69767743", "0.6974272", "0.69250077", "0.68745464", "0.6824897", "0.674...
0.8311782
0
Using std to compute KLD
def _kld_gauss(self, mean_1, std_1, mean_2, std_2): kld_element = (2 * torch.log(std_2) - 2 * torch.log(std_1) + (std_1.pow(2) + (mean_1 - mean_2).pow(2)) / std_2.pow(2) - 1) return 0.5 * torch.sum(kld_element)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MyKLD(X,Y): \n mu1,mu2 = tuple(np.mean(X,axis=0))\n sigma1,sigma2 = tuple(np.std(X,axis=0))\n m1,m2 = tuple(np.mean(X,axis=0))\n s1,s2 = tuple(np.std(X,axis=0))\n rho = np.corrcoef(X,rowvar=False)[0,1]\n r = np.corrcoef(Y,rowvar=False)[0,1]\n \n return (\n ((mu1-m1)**2/s1**2 - 2*r...
[ "0.65608275", "0.6495427", "0.6388361", "0.6362294", "0.6353022", "0.62305105", "0.6116456", "0.603199", "0.5952262", "0.5912953", "0.59015536", "0.5883916", "0.58513033", "0.5816932", "0.5816932", "0.5814648", "0.58139706", "0.58111626", "0.57957405", "0.5779569", "0.5765859...
0.68209976
0
Defines the method of backing up a given source directory to a given destination directory. This can be cloud storage, or local storage. Extend as needed.
def backup_directory(self, source_directory, destination_directory): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upload(self, source, dest):\n if os.path.isdir(source):\n self.upload_dir(source, dest)\n else:\n self.upload_file(source, dest)", "def __init__(self, source, destination, to_exclude=None, backup_mode=False):\n self.source_path = Path(source)\n if not self.so...
[ "0.59127825", "0.56023175", "0.55130535", "0.54906297", "0.5483752", "0.5462733", "0.5449736", "0.5394394", "0.5329382", "0.5312164", "0.5284632", "0.5262213", "0.522391", "0.5159552", "0.51097876", "0.50974935", "0.50910157", "0.50833803", "0.50830215", "0.5079891", "0.50763...
0.76584774
0
Test for help quit command
def test_quit(self): _help = 'Quit method to exit form cmd ' _help += 'program (Usage: quit)\n' with patch('sys.stdout', new=StringIO()) as f: HBNBCommand().onecmd("help quit") self.assertEqual(f.getvalue(), _help)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help_quit(self):\n print(\"Quit command to exit the program\")", "def test_help_menu(run):\n out, _err = run(dork.cli.help_menu)\n assert 'Help' in out, 'Help wasnt found'", "def test_running_main_asking_for_help(exopy_qtbot):\n try:\n main(['-h'])\n # TODO make sure no window...
[ "0.7975989", "0.7809279", "0.7795099", "0.75589925", "0.7469315", "0.7389906", "0.7254667", "0.71827996", "0.7147187", "0.7124692", "0.71146154", "0.7090947", "0.7077401", "0.7061455", "0.7054729", "0.7033535", "0.70295733", "0.7015609", "0.70015436", "0.6989946", "0.6965797"...
0.78453577
1
Test for help EOF command
def test_EOF(self): _help = 'EOF method to exit cmd program\n' with patch('sys.stdout', new=StringIO()) as f: HBNBCommand().onecmd("help EOF") self.assertEqual(f.getvalue(), _help)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help_EOF(self):\n print(\"EOF command to exit the program\")", "def test_help():\n p = Popen([\"flake8\", \"-h\"], stdin=DEVNULL, stdout=PIPE)\n out, err = p.communicate()\n\n assert not p.returncode, err\n assert b\" --rst-\" in out, \"rst options should appear in help text\"\n assert ...
[ "0.7814861", "0.6840323", "0.682285", "0.6771325", "0.6691922", "0.66432154", "0.6638987", "0.65848243", "0.65820116", "0.65715337", "0.65700805", "0.6554623", "0.6478868", "0.6476633", "0.6472357", "0.64624023", "0.6448147", "0.6446672", "0.64462125", "0.6438984", "0.6373719...
0.7711327
1
Test for help all command
def test_all(self): _help = "[Usage: all <class name>]or [Usage: all] or "\ "[Usage: <class name>.all()]\n" with patch('sys.stdout', new=StringIO()) as f: HBNBCommand().onecmd("help all") self.assertEqual(f.getvalue(), _help)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_help_all():\n assert HELP.handle_msg(f'{KEY_HELP}', True)\n assert HELP.get_reply() == HELP.all()", "def _help(self):\n self.onecmd('help')", "def help():", "def test_help(self):\n run_nbgrader([\"fetch\", \"--help-all\"])", "def help():\n print(UI.HELP)", "def test_he...
[ "0.8296886", "0.78399265", "0.76488346", "0.75032806", "0.7473458", "0.74622065", "0.7453301", "0.7443302", "0.74311626", "0.74061614", "0.7388418", "0.7367555", "0.7358134", "0.7353398", "0.7353398", "0.7344077", "0.73254955", "0.73254955", "0.73225653", "0.7258732", "0.7248...
0.8111
1
Test for help count command
def test_count(self): _help = "[Usage: <class name>.count()]\n" with patch('sys.stdout', new=StringIO()) as f: HBNBCommand().onecmd("help count") self.assertEqual(f.getvalue(), _help)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def count(self, ctx):\r\n if ctx.invoked_subcommand is None:\r\n await self.bot.send_cmd_help(ctx)", "def test_get_help(self):\r\n subcommands = list(self.testcommand.subparser.choices.keys())\r\n help_message = self.testcommand.get_help()\r\n self.assertEqual(len(sub...
[ "0.75281185", "0.73635864", "0.73583245", "0.69102603", "0.68941146", "0.6889329", "0.68857396", "0.684668", "0.6831447", "0.68222845", "0.6820815", "0.677524", "0.6770784", "0.66523445", "0.65595186", "0.6530274", "0.6493138", "0.6479575", "0.64395267", "0.6424902", "0.64247...
0.7937025
0
Test for help create command
def test_create(self): _help = "[Usage: create <class name>]\n" with patch('sys.stdout', new=StringIO()) as f: HBNBCommand().onecmd("help create") self.assertEqual(f.getvalue(), _help)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help_create(self):\n print(CREATE)", "def test_createExplicitHelp(self):\n self.assertSuccessStatus(self._makeConfig(None), [\"create\", \"--help\"])\n self.assertSpacelessEqual(self._createHelpText, sys.stdout.getvalue())", "def test_createImplicitHelp(self):\n self.assertSucce...
[ "0.821615", "0.80362326", "0.7831576", "0.73222435", "0.71913487", "0.7164001", "0.7053205", "0.7050169", "0.7048808", "0.69262415", "0.6863194", "0.68171686", "0.67816836", "0.67768836", "0.6774403", "0.67573375", "0.6697847", "0.6696483", "0.6686176", "0.6676658", "0.664191...
0.80459565
1
Test for help show command
def test_show(self): _help = "[Usage: show <class name> <id>] or "\ "[Usage: <class name>.show(<id>)]\n" with patch('sys.stdout', new=StringIO()) as f: HBNBCommand().onecmd("help show") self.assertEqual(f.getvalue(), _help)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_help():\n pass", "def test_cli_help(self):\n output = self.update_command('-h')", "def test_help(self):\n rc, stdout, _, msg = OIM().request('--help')\n self.assertEqual(rc, 0, \"Bad return code when requesting help\\n%s\" % msg)\n self.assert_(re.search(r'[Uu]sage:', st...
[ "0.8180918", "0.8130957", "0.8068485", "0.79682034", "0.7954869", "0.7911351", "0.78816515", "0.7789425", "0.7738428", "0.7727183", "0.7686819", "0.76671684", "0.7662415", "0.7648457", "0.7632693", "0.76228017", "0.760799", "0.75646275", "0.75377357", "0.7522406", "0.752026",...
0.8166448
1
Test for help update command
def test_update(self): _help = "[Usage: update <class name> <id> <attribute name> "\ '"<attribute value>"] or [Usage: <class name>.update(<id>,'\ "<attribute name>, <attribute value>)]\n" with patch('sys.stdout', new=StringIO()) as f: HBNBCommand().onecmd("hel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help_command(update: Update) -> None:\n #update.message.reply_text('Help!')", "def test_cli_help(self):\n output = self.update_command('-h')", "def help_command(update: Update, context: CallbackContext) -> None:\n update.message.reply_text(messages.HELP_TEXT)", "def help_command(update, cont...
[ "0.8009928", "0.80061376", "0.78645617", "0.78326833", "0.7810123", "0.77930987", "0.77930987", "0.77930987", "0.77930987", "0.7790812", "0.77864474", "0.77864474", "0.77864474", "0.77864474", "0.77677536", "0.77677536", "0.7711605", "0.7607265", "0.74595445", "0.7458147", "0...
0.8465423
0
The Console code is PEP8 conformant?
def test_console_pep8_conformance(self): style = pep8.StyleGuide(quiet=True) result = style.check_files(['console.py']) self.assertEqual(result.total_errors, 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exercise_b2_106():\r\n pass", "def exercise_b2_107():\r\n pass", "def exercise_b2_27():\r\n pass", "def exercise_b2_113():\r\n pass", "def test_console_test_pep8_conformance(self):\n pep8style = pep8.StyleGuide(quiet=True)\n result = pep8style.check_files(\n ...
[ "0.63976634", "0.63633114", "0.63586324", "0.6333517", "0.62372625", "0.6214321", "0.6198205", "0.6192162", "0.61512053", "0.6126677", "0.6068211", "0.60681", "0.6059583", "0.6059583", "0.6059583", "0.6059583", "0.60431296", "0.59663385", "0.59333456", "0.59319454", "0.592013...
0.64043087
0
Console has some documentation?
def test_console_documented(self): self.assertTrue self.assertTrue (len(HBNBCommand.__doc__) >= 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_usage():\n print >> sys.stderr, __doc__", "def usage():\n print(__doc__.strip())", "def help():", "def info():\n print __doc__\n sys.exit(1)", "def help():\n \n pass", "def main():\n system('cls||clear')\n\n #Print a docstring.\n print (main.__doc__)", "def pr...
[ "0.7123195", "0.7117843", "0.7078036", "0.7023829", "0.69797957", "0.69652635", "0.69319", "0.6784893", "0.6784893", "0.676406", "0.6728578", "0.6728533", "0.6728533", "0.6699519", "0.6699519", "0.6619316", "0.661552", "0.661552", "0.6601918", "0.6577686", "0.6577686", "0.6...
0.738676
0
Analyses an entire sentence, parsing and counting words. Punctuation is ignored.
def anlSentence(self, sentence): cleanStr = re.sub(self._wrdSeps, " ", re.sub(self._stcSeps, "", sentence)) for word in cleanStr.split(): self._wordCounter[word] += 1 self._totalWords += 1 else: self._totalSentences += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_sentence(self, text):\n l = []\n tokens = word_tokenize(text)\n print(tokens)\n skip = 0\n i = -1 # index of token in tokens list\n for token in tokens:\n i += 1\n if skip:\n skip -= 1\n # CORONA TERMS:\n ...
[ "0.70589197", "0.69209796", "0.6828709", "0.6791208", "0.67304224", "0.66707826", "0.6661829", "0.6652238", "0.6629492", "0.66103625", "0.65925443", "0.64734167", "0.6472126", "0.64579594", "0.64431465", "0.6437404", "0.6429816", "0.64242053", "0.6423713", "0.64206934", "0.64...
0.72092193
0
Analyses all the text in inputFile, processing sentences as they are terminated. Returns when finished processing inputFile
def anlText(self, inputFile): strBuf = "" splitter = re.compile(self._stcSeps) for rawLine in inputFile: line = rawLine.replace("\n", "") if (not splitter.search(line)): # Don't have a full sentence yet strBuf += " " + line else: # Found a se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _process_input_file(filename, vocab, stats):\n tf.logging.info(\"Processing input file: %s\", filename)\n processed = []\n\n predecessor = None # Predecessor sentence (list of words).\n current = None # Current sentence (list of words).\n successor = None # Successor sentence (list of words).\n\n for ...
[ "0.65726054", "0.65164816", "0.62853193", "0.62791026", "0.6115081", "0.6024861", "0.60202426", "0.5978504", "0.5953397", "0.59255266", "0.59150344", "0.5895512", "0.58695745", "0.5869046", "0.58022076", "0.57821476", "0.5744696", "0.5698293", "0.5693778", "0.5682117", "0.568...
0.7031776
0
Generate client code for a method interface. \param method sexpression of the method's SIDL declaration \param symbol_table the symbol table of the SIDL file \param ci a ClassInfo object This is currently a noop, since the UPC calling convention is identical to the IOR.
def generate_client_method(self, symbol_table, method, ci, has_impl): (Method, Type, (MName, Name, Extension), Attrs, Args, Except, From, Requires, Ensures, DocComment) = method abstract = member_chk(sidlir.abstract, Attrs) #final = member_chk(sidlir.final, Attrs) static = mem...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_server_method(self, symbol_table, method, ci):\n\n def convert_arg((arg, attrs, mode, typ, name)):\n \"\"\"\n Extract name and generate argument conversions\n \"\"\"\n iorname = name\n return iorname, (arg, attrs, mode, typ, name)\n\n\n ...
[ "0.78004867", "0.54117334", "0.52709347", "0.5230398", "0.5158314", "0.51276183", "0.5121379", "0.5015564", "0.5001117", "0.4953076", "0.49037513", "0.48770258", "0.48766863", "0.4863278", "0.48568517", "0.47815692", "0.4779487", "0.47770593", "0.47039717", "0.46978799", "0.4...
0.79929334
0
Chapel Skeleton (clientside Chapel bindings) Generate a Skeleton in Chapel.
def generate_skeleton(self, ci, qname): symbol_table = ci.epv.symbol_table cls = ci.co # Skeleton (in Chapel) self.pkg_chpl_skel.gen(ir.Import('.'.join(symbol_table.prefix))) self.pkg_chpl_skel.new_def('use sidl;') objname = '.'.join(ci.epv.symbol_table.prefix+[ci.epv....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeSkeleton(self):\n model = \"phase_5/models/char/cog\" + string.upper(self.style.body) + \"_robot-zero\"\n anims = self.generateAnimDict()\n\n # remember the current anim\n anim = self.getCurrentAnim()\n\n # grab the drop shadow\n dropShadow = self.dropShadow\n ...
[ "0.66044444", "0.587571", "0.57283276", "0.5613182", "0.55756", "0.54531306", "0.54285294", "0.54172045", "0.5361487", "0.53608173", "0.52986", "0.52859664", "0.52261084", "0.52190334", "0.5209471", "0.51796484", "0.51643616", "0.514965", "0.513393", "0.5127358", "0.50976783"...
0.69149214
0
Chapel Impl (serverside Chapel implementation template) Start generating a module_Impl.chpl file in Chapel.
def begin_impl(self, qname): # new file for the toplevel package self.pkg_chpl_skel = ChapelFile(qname+'_Skel') #self.pkg_chpl_skel.main_area.new_def('proc __defeat_dce(){\n') # new file for the user implementation self.pkg_impl = ChapelFile(qname+'_Impl') self.pkg_impl....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GenPy(mod,fname):\n f = open(fname, 'w')\n title = \"\"\"#\n# This file is generated automatically\n# Author:IAN\n# http://www.iknot.org\n\"\"\"\n f.write(title)\n for i in mod.__dict__.keys():\n s = \"def \" + i + \"():\" + \"\\n\"\n f.write(s)\n s = \" return\"\n f....
[ "0.6240082", "0.62050146", "0.6026402", "0.5986625", "0.59765106", "0.588383", "0.58597726", "0.58080757", "0.5797474", "0.57337195", "0.5695626", "0.56927705", "0.5691082", "0.56275", "0.56160545", "0.55935496", "0.5569858", "0.5560001", "0.555906", "0.5548208", "0.55443746"...
0.6781022
0
Chapel Impl (serverside Chapel implementation template) Finish generating the module_Impl.chpl file in Chapel.
def end_impl(self, qname): # write the Chapel skeleton to disk self.pkg_chpl_skel.write() # deal with the impl file if self.pkg_enums_and_structs: self.pkg_impl._header.append(chpl_gen(ir.Import(qname))) impl = qname+'_Impl.chpl' # Preserve code written by ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def begin_impl(self, qname):\n # new file for the toplevel package\n self.pkg_chpl_skel = ChapelFile(qname+'_Skel')\n #self.pkg_chpl_skel.main_area.new_def('proc __defeat_dce(){\\n')\n\n # new file for the user implementation\n self.pkg_impl = ChapelFile(qname+'_Impl')\n s...
[ "0.6669867", "0.6221501", "0.6092544", "0.59780663", "0.5924718", "0.5749706", "0.57371974", "0.5709888", "0.56842494", "0.5661227", "0.55686927", "0.5557476", "0.5520124", "0.5503", "0.5470936", "0.5459828", "0.5390152", "0.53870183", "0.5374737", "0.53564644", "0.5333069", ...
0.679863
0
Generate server code for a method interface. This function generates a Ccallable skeleton for the method and generates a Skeleton of Chapel code complete with splicer blocks for the user to fill in. \param method sexpression of the method's SIDL declaration \param symbol_table the symbol table of the SIDL file \param c...
def generate_server_method(self, symbol_table, method, ci): def convert_arg((arg, attrs, mode, typ, name)): """ Extract name and generate argument conversions """ iorname = name return iorname, (arg, attrs, mode, typ, name) # Chapel skeleton...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_client_method(self, symbol_table, method, ci, has_impl):\n (Method, Type, (MName, Name, Extension), Attrs, Args,\n Except, From, Requires, Ensures, DocComment) = method\n\n abstract = member_chk(sidlir.abstract, Attrs)\n #final = member_chk(sidlir.final, Attrs)\n s...
[ "0.7590919", "0.6018988", "0.54044896", "0.5334083", "0.52877223", "0.51919335", "0.51591736", "0.51446867", "0.51081574", "0.5091529", "0.5066033", "0.49953592", "0.49737975", "0.491844", "0.4906915", "0.48684186", "0.4846144", "0.48234162", "0.47987446", "0.47579494", "0.46...
0.8426865
0
Extract name and generate argument conversions
def convert_arg((arg, attrs, mode, typ, name)): iorname = name return iorname, (arg, attrs, mode, typ, name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_arg_name(self, arg, variable_name):", "def convert_arg(node):\n if isinstance(node, ast.Name):\n return node.id\n else:\n return convert_literal_node(node)", "def _name_from_args(func, _, params):\n return \"{}_{}\".format(func.__name__, \"_\".join(str(arg) for arg in params.arg...
[ "0.66685903", "0.6599033", "0.65203696", "0.6483481", "0.6416871", "0.63621765", "0.63456565", "0.6166476", "0.60300237", "0.6014451", "0.60043615", "0.59995824", "0.5983003", "0.5949238", "0.5939162", "0.58347726", "0.58151877", "0.58072317", "0.5789486", "0.57871276", "0.57...
0.7363041
0
Calculate a Gaussianweighted histogram. Drop a gaussian kernel on top of each data point. For every point, calculate the probability that the point lies in each bin, by evaluating the CDF of the Gaussian associated with each point. Sum the results across all bins and return the result. Converges to an ordinary histogra...
def numpy_gw_hist(data, bins, scale): data = np.atleast_1d(data) bins = np.atleast_1d(bins) nbins, ndata = bins.size, data.size scale = np.zeros(ndata) + scale logsm_bin_matrix = np.repeat( bins, ndata).reshape((nbins, ndata)).astype('f4') data_matrix = np.tile(data, nbins).reshape((nb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cuda_gw_hist(data, bins, scale, gw_hist_out):\n # find where this job goes over\n start = cuda.grid(1)\n stride = cuda.gridsize(1)\n\n # define some useful things\n bot = bins[0]\n sqrt2 = math_sqrt(2.)\n\n # loop over the data set - each thread now looks at one data point.\n for i in r...
[ "0.68829334", "0.63679624", "0.6258546", "0.61666834", "0.61578655", "0.61466706", "0.61356294", "0.6091921", "0.6059925", "0.60129106", "0.6010567", "0.60052973", "0.59860414", "0.5970528", "0.5956114", "0.5942941", "0.59030044", "0.5894491", "0.58888406", "0.5884427", "0.58...
0.70027906
0
Increment weighted bin counts in gw_hist_out, given an array of bins
def cuda_gw_hist(data, bins, scale, gw_hist_out): # find where this job goes over start = cuda.grid(1) stride = cuda.gridsize(1) # define some useful things bot = bins[0] sqrt2 = math_sqrt(2.) # loop over the data set - each thread now looks at one data point. for i in range(start, dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def numpy_gw_hist(data, bins, scale):\n data = np.atleast_1d(data)\n bins = np.atleast_1d(bins)\n nbins, ndata = bins.size, data.size\n\n scale = np.zeros(ndata) + scale\n\n logsm_bin_matrix = np.repeat(\n bins, ndata).reshape((nbins, ndata)).astype('f4')\n data_matrix = np.tile(data, nbin...
[ "0.63970953", "0.63832986", "0.6286262", "0.62791854", "0.61924654", "0.61763406", "0.6149406", "0.6016555", "0.60134465", "0.5990124", "0.5987075", "0.5971388", "0.59386116", "0.59300625", "0.59142697", "0.5889856", "0.5870431", "0.5831633", "0.5780326", "0.57768726", "0.576...
0.6434656
0
the function makes a game of "7 Boom" it replace every number that contains "7" or divides by 7.
def seven_boom(end_number): all_nums = [] for n in range(1, end_number + 1): if n % 7 == 0 or "7" in str(n): all_nums.append("Boom") else: all_nums.append(n) return all_nums
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def problem():\n # First prime number>2 ends only with (1, 3, 5, 7, 9). Last digit cannot be\n # replaced.\n # Number of digits that need to be replaced are 3.\n\n masks = (\n \"{1}{2}{0}{0}{0}{3}\",\n \"{1}{0}{2}{0}{0}{3}\",\n \"{1}{0}{0}{2}{0}{3}\",\n \"{1}{0}{0}{0}{2}{3}\...
[ "0.6820968", "0.65721613", "0.59408474", "0.57117885", "0.57012874", "0.5686959", "0.56695634", "0.5645862", "0.562656", "0.55166095", "0.549958", "0.54770386", "0.54770386", "0.54770386", "0.54343045", "0.54297036", "0.5426893", "0.54231066", "0.5422682", "0.5420768", "0.541...
0.6623458
1
Add form prefix to errors
def add_prefix(self, errors, prefix): if not prefix: prefix = self.get_prefix() if prefix: return {"%s-%s" % (prefix, k): v for k, v in errors.items()} return errors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _post_clean(self):\r\n super(NgModelFormMixin, self)._post_clean()\r\n if self._errors and self.prefix:\r\n self._errors = ErrorDict((self.add_prefix(name), value) for name, value in self._errors.items())", "def render_errors(form):\n return {\n \"form\": form\n }", "d...
[ "0.7038696", "0.6208197", "0.6115108", "0.5996022", "0.5964648", "0.58308095", "0.5824564", "0.57793695", "0.57664406", "0.57629406", "0.5701787", "0.5659007", "0.5616956", "0.56133205", "0.56133205", "0.55535233", "0.5502182", "0.545413", "0.5441139", "0.542132", "0.52813584...
0.7227966
0
Open a dialog box and create a compliance list for a custom sweep. Will save the list so that it may be passed to the instruments. SLIGHTLY BUGGY BUT OK
def create_compliance_list(self): self.compliance_list = None self.list_label = ("Enter a list of compliance voltages (V) separated " "by commas (e.g. 1, 2, 3). Range is 0.1 to 105. Must " "have same number of points as current list or be " ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_current_designs_callback(self, ListTypesFull, check_button_ckList):\n\n if not self.check_for_residue_existance():\n return\n\n self.current_chainFull = self.current_residue.get().split(\":\")\n if len(self.current_chainFull) > 1:\n ResStart = int(self.current_...
[ "0.53039885", "0.5272541", "0.5164381", "0.5153914", "0.51034915", "0.507512", "0.5046017", "0.5033432", "0.5007332", "0.49825966", "0.49568945", "0.49487162", "0.49321654", "0.49084106", "0.490425", "0.4867304", "0.4857254", "0.48513114", "0.48159236", "0.4812841", "0.480814...
0.70281583
0
Open a dialog box and create a current list for a custom sweep. Will return the list as a string so that it may be passed to the instruments. SLIGHTLY BUGGY BUT OK
def create_I_list(self): self.I_list = ['0'] self.list_label = ("Enter a list of source currents (A) separated by " "commas (e.g., 1e-3, 2e-6, 3e-4). Range is -0.105 " "to 0.105. If empty list, sets 1-point list with " ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_compliance_list(self):\r\n self.compliance_list = None\r\n self.list_label = (\"Enter a list of compliance voltages (V) separated \"\r\n \"by commas (e.g. 1, 2, 3). Range is 0.1 to 105. Must \"\r\n \"have same number of points as current list or be...
[ "0.6108962", "0.55942416", "0.5566351", "0.5345901", "0.5332031", "0.53211814", "0.5315982", "0.5270236", "0.5257532", "0.5217911", "0.51774496", "0.51343507", "0.5105398", "0.51048917", "0.50571436", "0.5004678", "0.50045633", "0.50009185", "0.499991", "0.49909893", "0.49825...
0.58283496
1
Open a dialog box and create a cycle interval list for a custom sweep. Will return the list as a string so that it may be passed to the instruments. SLIGHTLY BUGGY BUT OK
def create_cycle_list(self): self.cycle_list = None self.list_label = ("Enter a list of cycle times (in integer PLC) " "separated by commas (e.g., 1, 5, 7). Must " "have same number of points as current list or be " "e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_I_list(self):\r\n self.I_list = ['0']\r\n self.list_label = (\"Enter a list of source currents (A) separated by \"\r\n \"commas (e.g., 1e-3, 2e-6, 3e-4). Range is -0.105 \"\r\n \"to 0.105. If empty list, sets 1-point list with \"\r\n ...
[ "0.5815914", "0.54718876", "0.5277732", "0.5244302", "0.5012473", "0.5012194", "0.5010573", "0.48528308", "0.47787085", "0.47195724", "0.46868253", "0.4671984", "0.4651609", "0.4645154", "0.46232212", "0.46119052", "0.45586553", "0.4554039", "0.45474464", "0.45366964", "0.453...
0.71184677
0
Calculate the number of points in a sweep.
def num_points_sweep(self, start, stop, step): return(abs((stop - start)//step) + 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def n_sweep(self):\n return self._n_sweep", "def n_points(self):\n\n if self.data_reduced:\n return len(self.data_reduced[0])\n else:\n return 0", "def numberOfPoints(self):\n return 20000", "def nr_points(self):\n return len(self.x)", "def GetNumber...
[ "0.67116016", "0.6710413", "0.64373267", "0.64242", "0.63951397", "0.6383078", "0.6207242", "0.617462", "0.617306", "0.61665", "0.6122303", "0.6066918", "0.60630375", "0.6040785", "0.6001944", "0.5952431", "0.5930012", "0.5926737", "0.58931786", "0.58931786", "0.58803296", ...
0.7976391
0
If instruments are connected, set the source range type based on the combo box selection and the measurement type. The function inside get() returns unique keys for all nondifferential conductance measurements. Since differential conductance automatically has 'best' ranging, its keys don't matter. WORKING
def update_source_range_type(self): self.source_range_type_index = self.SourceRangeType.currentIndex() self.cmd = None if self.current_tab: self.cmd = self.source_range_type_switch.get( self.current_tab + 3*self.source_range_type_index, None) if self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_default_tuner_range():\n return {65.41: 'C2',\n 69.30: 'C2#',\n 73.42: 'D2',\n 77.78: 'E2b',\n 82.41: 'E2',\n 87.31: 'F2',\n 92.50: 'F2#',\n 98.00: 'G2',\n 103.80: 'G2#',\n 110.00: 'A2',\n 116...
[ "0.56911653", "0.52945167", "0.51720303", "0.4946854", "0.4937591", "0.4891812", "0.4796071", "0.4778892", "0.47767597", "0.47518268", "0.47423512", "0.4717272", "0.47147053", "0.4697422", "0.46531144", "0.46339667", "0.46199188", "0.45852423", "0.45715055", "0.4561549", "0.4...
0.5822572
0
If instruments are connected and 'fixed' ranging is selected for the source, set the range for the current source. WORKING
def update_source_range(self): self.source_range_index = self.SourceRangeValue.currentIndex() self.cmd = None if self.source_range_type_index and self.connected: self.cmd = self.source_range_switch.get( self.source_range_index, None) self.I_sourc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateRange(self):\n if self.autoFollow:\n self.xrange = self.param.activeRange()\n self.xrange = self.xrange # call getter & setter again to verify limits", "def update_source_range_type(self):\r\n self.source_range_type_index = self.SourceRangeType.currentIndex()\r\n ...
[ "0.6363817", "0.60023093", "0.5866444", "0.582724", "0.5760188", "0.57191896", "0.5687571", "0.56715", "0.56542695", "0.55636144", "0.55159867", "0.5506243", "0.5476146", "0.5476146", "0.54492867", "0.54370373", "0.54271984", "0.54124457", "0.5391282", "0.53891414", "0.536108...
0.6765496
0