query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Return requested conference (by websafeConferenceKey).
def getConference(self, request): # Get Conference object from request; bail if not found conf = _getEntityByWebsafeKey(request.websafeConferenceKey, 'Conference') prof = conf.key.parent().get() # Return ConferenceForm return self._copyConfer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getConference(self, request):\n # get Conference object from request; bail if not found\n conf = ndb.Key(urlsafe=request.websafeConferenceKey).get()\n if not conf:\n raise endpoints.NotFoundException(\n 'No conference found with key: %s' % request.websafeConferenceKey)\n prof = co...
[ "0.78688127", "0.7338922", "0.6852561", "0.66271746", "0.6565396", "0.6170011", "0.59663105", "0.59223247", "0.58999187", "0.58343786", "0.57726926", "0.57710207", "0.56881297", "0.5676969", "0.56550586", "0.55980533", "0.5535486", "0.5489521", "0.5484447", "0.5409856", "0.53...
0.73678344
1
Get list of conferences matching one or more of the given topics.
def getConferencesByTopicSearch(self, request): conferences = self._getConferencesByTopicSearch(request) # Need to fetch organiser displayName from profiles # Get all keys and use get_multi for speed organisers = [ (ndb.Key(Profile, conf.organizerUserId)) for conf in conferen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getConferencesByTopicSearch(self, request):\n # Generate list of filters from the topic arguments\n filters = [Conference.topics == topic for topic in request.topics]\n if not filters:\n raise endpoints.BadRequestException(\n 'At least one topic must be specified...
[ "0.80247796", "0.6207768", "0.6082327", "0.60714567", "0.60658276", "0.5967323", "0.5963362", "0.59466356", "0.59359396", "0.59351933", "0.5891676", "0.5859516", "0.5841561", "0.5830634", "0.57371825", "0.5714454", "0.57058376", "0.56997335", "0.5605298", "0.54814893", "0.542...
0.67396516
1
Return conferences created by user.
def getConferencesCreated(self, request): # Make sure user is authenticated user = endpoints.get_current_user() if not user: raise endpoints.UnauthorizedException('Authorization required') user_id = user.email() # Create ancestor query for all key matches for this use...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_conferences_created(self, request):\n # make sure user is authed\n user = endpoints.get_current_user()\n if not user:\n raise endpoints.UnauthorizedException('Authorization required')\n user_id = self.auth.get_user_id(user)\n\n # create ancestor query for all k...
[ "0.7426375", "0.7422197", "0.7139423", "0.6520319", "0.6444673", "0.6380157", "0.6170725", "0.6110125", "0.6106259", "0.58488816", "0.58413064", "0.5712337", "0.56976974", "0.56128216", "0.55150616", "0.5484686", "0.54634756", "0.54023856", "0.539838", "0.5397218", "0.5395133...
0.736354
2
Get list of conferences for which the user has registered.
def getConferencesToAttend(self, request): prof = self._getProfileFromUser() # get user Profile conf_keys = [ ndb.Key(urlsafe=wsck) for wsck in prof.conferenceKeysToAttend ] conferences = ndb.get_multi(conf_keys) # Get organizers organisers = [ ndb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conferences(self):\r\n return conferences.Conferences(self)", "def get_conferences():\n conferences = []\n for confId in range(1, 8):\n c = requests.get(CONFERENCES_URL.format(confId)).json()\n conf_list = c.get('conferences')\n if conf_list is None or len(conf_list) == 0:\n...
[ "0.8020829", "0.74782985", "0.691444", "0.6898903", "0.6854732", "0.6811999", "0.6588752", "0.6450787", "0.6318484", "0.61732143", "0.5985208", "0.5971348", "0.5906679", "0.5899746", "0.5890189", "0.5807684", "0.57925874", "0.5785232", "0.57073826", "0.57045716", "0.56997824"...
0.6654006
6
Register user for selected conference.
def registerForConference(self, request): return self._conferenceRegistration(request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_for_conference(self, request):\n return self.conference_registration(request)", "def register_user():\n pass", "def conference_registration(self, request, reg=True):\n prof = self.profile_service.get_profile_from_user() # get user Profile\n\n # check if conf exists given w...
[ "0.7278912", "0.6624827", "0.6584575", "0.65791625", "0.6362521", "0.61771995", "0.61010563", "0.6078329", "0.6028847", "0.60168606", "0.6004366", "0.60029817", "0.59709775", "0.5970334", "0.5965763", "0.59528124", "0.5946669", "0.5870501", "0.5858669", "0.58469427", "0.58424...
0.70775634
1
Unregister user for selected conference.
def unregisterFromConference(self, request): return self._conferenceRegistration(request, reg=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unregister_from_conference(self, request):\n return self.conference_registration(request, reg=False)", "async def unregister(self):\n\t\tif self.group != None:\n\t\t\tif self.group.in_game:\n\t\t\t\tfor team in self.group.game.teams:\n\t\t\t\t\tif self in team:\n\t\t\t\t\t\tself.group.game.teams.remov...
[ "0.7598682", "0.6543255", "0.6435641", "0.63821507", "0.63548124", "0.63164395", "0.61379206", "0.6102971", "0.60985017", "0.6050816", "0.59991133", "0.597415", "0.59388", "0.5870086", "0.5869279", "0.58567876", "0.5786231", "0.57730377", "0.5772766", "0.5762881", "0.5759947"...
0.7392909
1
Update conference with provided fields and return updated info.
def updateConference(self, request): return self._updateConferenceObject(request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateConference(self, request):\n return self._updateConferenceObject(request)", "def update_conference(self, request):\n return self.conference_service.update_conference_object(request)", "def _createConferenceObject(self, request):\n # Preload necessary data items\n user = endpoi...
[ "0.758331", "0.74960595", "0.56102973", "0.5389422", "0.53092176", "0.5298347", "0.52690583", "0.5262601", "0.5237994", "0.52372456", "0.5190294", "0.51562655", "0.5151782", "0.5141383", "0.5108595", "0.51068795", "0.5103918", "0.5081992", "0.50674534", "0.5066077", "0.503872...
0.7384815
2
Copy relevant fields from Speaker to SpeakerForm.
def _copySpeakerToForm(self, speaker): sf = SpeakerForm() for field in sf.all_fields(): if hasattr(speaker, field.name): setattr(sf, field.name, getattr(speaker, field.name)) elif field.name == "websafeKey": setattr(sf, field.name, speaker.key.urls...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copyform(form, settings):\r\n for name, value in form.iteritems():\r\n setattr(settings, name, value)\r\n settings.commit()", "def _copySessionToForm(self, session):\n sf = SessionForm()\n for field in sf.all_fields():\n if hasattr(session, field.name):\n ...
[ "0.5991479", "0.5911988", "0.58958936", "0.5770801", "0.57492906", "0.5703371", "0.56609124", "0.5593124", "0.5583714", "0.5578275", "0.55456966", "0.5397008", "0.53902537", "0.5387579", "0.5369967", "0.53496546", "0.5334173", "0.5330454", "0.530139", "0.5282616", "0.51898223...
0.8053849
0
Create a speaker, returning SpeakerForm/request.
def _createSpeakerObject(self, request): # Preload necessary data items user = endpoints.get_current_user() if not user: raise endpoints.UnauthorizedException('Authorization required') user_id = user.email() if not request.name: raise endpoints.BadRequestE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(self, validated_data):\n return Speaker.objects.create(**validated_data)", "def _copySpeakerToForm(self, speaker):\n sf = SpeakerForm()\n for field in sf.all_fields():\n if hasattr(speaker, field.name):\n setattr(sf, field.name, getattr(speaker, field.nam...
[ "0.7516256", "0.6617961", "0.6517369", "0.60076547", "0.58922905", "0.58491045", "0.5713825", "0.57095647", "0.5580512", "0.5575898", "0.5537071", "0.54411596", "0.54135704", "0.54083437", "0.53903764", "0.5356573", "0.53268087", "0.5320126", "0.5311113", "0.53081363", "0.529...
0.7869294
0
Check if the specified speaker is speaking at multiple sessions in the specified conference, and create memcache entry if so.
def _updateFeaturedSpeaker(websafeSpeakerKey, websafeConferenceKey): # Validate the websafe key arguments. Exception is raised if either # call fails. speaker = _getEntityByWebsafeKey(websafeSpeakerKey, 'Speaker') confKey = _raiseIfWebsafeKeyNotValid(websafeConferenceKey, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getSessionsBySpeaker(self, request):\n # Ensure that the speaker key is valid and that the speaker exists\n speaker = _getEntityByWebsafeKey(request.websafeSpeakerKey, 'Speaker')\n # Return all of the speaker's sessions\n return ndb.get_multi(speaker.sessions)", "def _getConferen...
[ "0.5446472", "0.51810056", "0.5084203", "0.5033835", "0.49242762", "0.48869962", "0.4859192", "0.48236132", "0.4786593", "0.47050533", "0.46819773", "0.46688312", "0.46350497", "0.45954737", "0.45568752", "0.4550118", "0.45501018", "0.4542919", "0.45304805", "0.452583", "0.45...
0.56610495
0
Return the current featured speaker message from memcache.
def getFeaturedSpeaker(self, request): message = memcache.get(MEMCACHE_FEATURED_SPEAKER_KEY) or "" return StringMessage(data=message)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_featured_speaker(self, request):\n return StringMessage(\n data=memcache.get(MEMCACHE_FEATURED_SPEAKER_KEY) or \"\")", "def _updateFeaturedSpeaker(websafeSpeakerKey, websafeConferenceKey):\n # Validate the websafe key arguments. Exception is raised if either\n # call fails...
[ "0.7784476", "0.58692867", "0.58229965", "0.5695719", "0.56409705", "0.5568219", "0.54920876", "0.54669094", "0.5427401", "0.5424601", "0.5384481", "0.5369317", "0.5333994", "0.5280963", "0.5277826", "0.5231841", "0.5128428", "0.50919986", "0.50889385", "0.50869083", "0.50726...
0.7579103
1
Return requested speaker (by websafeSpeakerKey).
def getSpeaker(self, request): # Get Speaker object from request; bail if not found speaker = _getEntityByWebsafeKey(request.websafeSpeakerKey, 'Speaker') # Return SpeakerForm return self._copySpeakerToForm(speaker)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_speaker(self):\n return self._speaker", "def get_speaker(self):\n if self._speaker == None:\n self._speaker = self.get_best_speaker()\n return self._speaker", "def getFeaturedSpeaker(self, request):\n message = memcache.get(MEMCACHE_FEATURED_SPEAKER_KEY) or \"\"\n...
[ "0.7760669", "0.7620859", "0.67306876", "0.64560616", "0.59528273", "0.5847423", "0.5846053", "0.5844817", "0.5813224", "0.56656796", "0.55755717", "0.55755717", "0.556649", "0.54978883", "0.5484221", "0.5462861", "0.5461837", "0.54197496", "0.5388767", "0.53737676", "0.53307...
0.7046036
2
Get list of all speakers in the system.
def getSpeakers(self, request): speakers = Speaker.query().order(Speaker.name).fetch() # Return individual SpeakerForm object per Speaker return SpeakerForms( items=[self._copySpeakerToForm(speaker) for speaker in speakers] )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_speakers(self, request):\n return self.speaker_service.get_speakers()", "def speakers(self):\n return self._speakers", "def list_speaker(request, template=\"core/list_speaker.html\"):\n speakers = Speaker.objects.all()\n response = { 'speakers': speakers, 'show_all_info': False }\n ...
[ "0.84661525", "0.83643174", "0.7133389", "0.661066", "0.6588881", "0.64534485", "0.6366197", "0.63607436", "0.63581705", "0.6350021", "0.60030264", "0.59532773", "0.59065694", "0.5903705", "0.58986825", "0.589644", "0.58819747", "0.5877112", "0.5862711", "0.58491725", "0.5789...
0.6570793
5
Add a session to the user's wishlist, returning a boolean.
def _addSessionToWishlist(self, request): # Preload necessary data items user = endpoints.get_current_user() if not user: raise endpoints.UnauthorizedException('Authorization required') # Verify that the session actually exists session = _getEntityByWebsafeKey(request...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_session_to_wishlist(self, request):\n return self.wishlist_service.add_session_to_wishlist(\n request.websafeSessionKey, endpoints.get_current_user())", "def add_session_to_wishlist(self, websafe_session_key, user):\n wl_key = self.get_wishlist_key(user)\n\n wishlist = wl_...
[ "0.8124176", "0.7818929", "0.7583546", "0.6178471", "0.6127408", "0.5941033", "0.5855412", "0.581283", "0.57922465", "0.57513714", "0.57402354", "0.56839013", "0.5678189", "0.56736964", "0.5617717", "0.5528249", "0.5518363", "0.5493492", "0.54671645", "0.54640555", "0.5460476...
0.83459866
0
Create a session, returning SessionForm/request.
def _createSessionObject(self, request): # Preload necessary data items user = endpoints.get_current_user() if not user: raise endpoints.UnauthorizedException('Authorization required') user_id = user.email() # Get the conference entity conf = _getEntityByWebsa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_session(\n self,\n environ: str,\n session_request_to_use: typing.Optional[SessionRequest] = None,\n ) -> Session:\n self.poll_sessions() # make sure there is an up to date picture of Sessions before proceeding\n self.check_session_can_start(session_request_to_use)...
[ "0.7286548", "0.7119273", "0.7006085", "0.69913393", "0.69766575", "0.69718444", "0.69162", "0.68441635", "0.682855", "0.6828313", "0.6804701", "0.6702148", "0.66709447", "0.66621274", "0.66581345", "0.66455007", "0.664158", "0.66088223", "0.6524842", "0.64846593", "0.6434405...
0.7054775
2
Copy relevant fields from Session to SessionForm.
def _copySessionToForm(self, session): sf = SessionForm() for field in sf.all_fields(): if hasattr(session, field.name): # Convert date field to date string if field.name == 'date': setattr(sf, field.name, str(getattr(session, field.name)))...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def form_valid(self, form):\n label = form.cleaned_data[\"label\"]\n\n if \"objects\" not in self.request.session:\n self.request.session[\"objects\"] = OrderedDict()\n if \"forms\" not in self.request.session:\n self.request.session[\"forms\"] = OrderedDict()\n\n ...
[ "0.6098217", "0.6088412", "0.6072761", "0.60642654", "0.6026982", "0.59829164", "0.5759055", "0.5618044", "0.561432", "0.55417347", "0.5487526", "0.54755", "0.544686", "0.5294741", "0.52286774", "0.52258146", "0.5166349", "0.5164965", "0.51523036", "0.51498306", "0.5126769", ...
0.85230947
0
Retrieve all sessions associated with a conference.
def _getConferenceSessions(self, request): # Ensure that websafeConferenceKey is a valid conference key confKey = _raiseIfWebsafeKeyNotValid(request.websafeConferenceKey, 'Conference') # Retrieve all sessions that have a matching conference key ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_conference_sessions(self, request):\n return self.session_service.get_conference_sessions(\n request.websafeConferenceKey)", "def get_sessions_by_type(self, request):\n return self.session_service.get_conference_sessions_by_type(\n request.websafeConferenceKey, request...
[ "0.8155603", "0.72048026", "0.7024871", "0.7000029", "0.69593084", "0.6693818", "0.66356134", "0.66315794", "0.65811247", "0.6544365", "0.64583755", "0.643887", "0.64130956", "0.63868886", "0.63120866", "0.62812674", "0.6271837", "0.6205866", "0.6112134", "0.6100491", "0.6069...
0.800364
1
Retrieve all sessions associated with a conference, by type.
def _getConferenceSessionsByType(self, request): # Ensure that websafeConferenceKey is a valid conference key confKey = _raiseIfWebsafeKeyNotValid(request.websafeConferenceKey, 'Conference') # Retrieve all sessions that have a matching conference key,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sessions_by_type(self, request):\n return self.session_service.get_conference_sessions_by_type(\n request.websafeConferenceKey, request.sessionType)", "def get_sessions_by_type_and_filters(self, request):\n return self.session_service.get_sessions_by_type_and_filters(\n ...
[ "0.839267", "0.76810974", "0.74179673", "0.72810936", "0.7257645", "0.6629272", "0.6575053", "0.6291302", "0.61481535", "0.60031515", "0.59337205", "0.5886013", "0.5719723", "0.57138413", "0.57089686", "0.5639327", "0.5602851", "0.5507092", "0.5500614", "0.54822844", "0.54750...
0.83530176
1
Retrieve all sessions matching one or more given highlights.
def _getSessionsByHighlightSearch(self, request): # Generate list of filters from the highlight arguments filters = [Session.highlights == hl for hl in request.highlights] if not filters: raise endpoints.BadRequestException( 'At least one highlight must be specified' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSessionsByHighlightSearch(self, request):\n sessions = self._getSessionsByHighlightSearch(request)\n # Return individual SessionForm object per Session\n return SessionForms(\n items=[self._copySessionToForm(session) for session in sessions]\n )", "def get(self, requ...
[ "0.64075655", "0.51973224", "0.5143006", "0.5126674", "0.49887824", "0.49578515", "0.49377143", "0.48807254", "0.48346448", "0.47855932", "0.47821313", "0.47626352", "0.47079334", "0.4697971", "0.46542692", "0.46254164", "0.46242422", "0.4623829", "0.46137628", "0.45952874", ...
0.80607086
0
Retrieve all sessions given by a particular speaker.
def _getSessionsBySpeaker(self, request): # Ensure that the speaker key is valid and that the speaker exists speaker = _getEntityByWebsafeKey(request.websafeSpeakerKey, 'Speaker') # Return all of the speaker's sessions return ndb.get_multi(speaker.sessions)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_speaker_sessions(self, request):\n return self.session_service.get_speaker_sessions(\n request.websafeSpeakerKey)", "def getSessionsBySpeaker(self, request):\n sessions = self._getSessionsBySpeaker(request)\n # Return individual SessionForm object per Session\n retu...
[ "0.78710306", "0.7094641", "0.67780095", "0.67494416", "0.67155963", "0.6615327", "0.64614207", "0.6425885", "0.6333383", "0.6315707", "0.6194976", "0.61806315", "0.6179548", "0.61346084", "0.61164176", "0.60324794", "0.60129184", "0.5877937", "0.58242875", "0.5822374", "0.58...
0.8179627
0
Demonstrates my solution to the doubleinequality query problem.
def _getSessionsDoubleInequalityDemo(self, request): # Convert request.maxStartTime from string to Time object try: maxStartTime = datetime.strptime( request.maxStartTime, '%H:%M').time() except: raise endpoints.BadRequestException( "Invali...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dq_subquery_filter(self):\n # import ipdb; ipdb.set_trace()\n len1 = len(list(DQ('(b.id, b.name) Book{b.id in [\"(Book.id)\"]} b').dicts()))\n len2 = len(list(DQ(\"(Book.id)\").dicts()))\n self.assertEqual(len1, len2)", "def query3() :", "def test_multiple_iterations_work_p...
[ "0.62650895", "0.61998206", "0.6114937", "0.60249525", "0.6004869", "0.5909111", "0.58909786", "0.5840364", "0.58223784", "0.57433224", "0.57068557", "0.5687743", "0.5659272", "0.5618641", "0.5598052", "0.55531514", "0.55465287", "0.5494882", "0.54774994", "0.54695725", "0.54...
0.0
-1
Retrieve all sessions in the user's wishlist.
def _getSessionsInWishlist(self): user = endpoints.get_current_user() if not user: raise endpoints.UnauthorizedException('Authorization required') profile = self._getProfileFromUser() # Fetch the entities and return them return ndb.get_multi(profile.sessionWishlist)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wishlist_sessions(self, user):\n wishlist_key = self.get_wishlist_key(user)\n session_keys = [ndb.Key(urlsafe=wsck) for wsck in\n wishlist_key.get().sessionKeys]\n sessions = ndb.get_multi(session_keys)\n return sessions", "def get_sessions_in_wishlist(self,...
[ "0.851661", "0.79517555", "0.7718727", "0.7539904", "0.74082303", "0.69785184", "0.6908265", "0.6861531", "0.6479205", "0.6430566", "0.61952454", "0.6161288", "0.61303025", "0.6128384", "0.6097037", "0.6083551", "0.60752475", "0.5979322", "0.59384423", "0.5929593", "0.5898026...
0.8228693
1
Removes a session from the user's wishlist, returning a boolean.
def _removeSessionFromWishlist(self, request): # Preload necessary data items user = endpoints.get_current_user() if not user: raise endpoints.UnauthorizedException('Authorization required') profile = self._getProfileFromUser() # Get actual session key from websafe ke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_session_from_wishlist(self, request):\n return self.wishlist_service.remove_session_from_wishlist(\n request.websafeSessionKey, endpoints.get_current_user())", "def removeSessionFromWishlist(self, request):\n return self._removeSessionFromWishlist(request)", "def remove_sess...
[ "0.81915665", "0.76984537", "0.76317555", "0.6835183", "0.6607075", "0.6478658", "0.6209266", "0.61053085", "0.6085781", "0.6084388", "0.6060252", "0.5823839", "0.57571155", "0.57422817", "0.57323414", "0.57050776", "0.5699716", "0.56986994", "0.5697193", "0.5694112", "0.5676...
0.8256191
0
Get list of sessions associated with a conference.
def getConferenceSessions(self, request): sessions = self._getConferenceSessions(request) # Return individual SessionForm object per Session return SessionForms( items=[self._copySessionToForm(session) for session in sessions] )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_conference_sessions(self, request):\n return self.session_service.get_conference_sessions(\n request.websafeConferenceKey)", "def _getConferenceSessions(self, request):\n # Ensure that websafeConferenceKey is a valid conference key\n confKey = _raiseIfWebsafeKeyNotValid(re...
[ "0.81798553", "0.80553985", "0.7398432", "0.70670617", "0.69621783", "0.6918743", "0.6725701", "0.67132723", "0.6662291", "0.6658466", "0.6619637", "0.66083187", "0.66049355", "0.6575915", "0.64666444", "0.6356312", "0.62984157", "0.6294037", "0.628976", "0.62862515", "0.6215...
0.7115856
3
Get list of sessions associated with a conference (by type).
def getConferenceSessionsByType(self, request): sessions = self._getConferenceSessionsByType(request) # Return individual SessionForm object per Session return SessionForms( items=[self._copySessionToForm(session) for session in sessions] )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sessions_by_type(self, request):\n return self.session_service.get_conference_sessions_by_type(\n request.websafeConferenceKey, request.sessionType)", "def _getConferenceSessionsByType(self, request):\n # Ensure that websafeConferenceKey is a valid conference key\n confKey...
[ "0.84242547", "0.8401543", "0.7662441", "0.7524862", "0.74432117", "0.6784176", "0.6719207", "0.6384199", "0.6341055", "0.62116015", "0.6180524", "0.61600953", "0.61047417", "0.5998957", "0.59904486", "0.59777117", "0.5891309", "0.58634335", "0.5858132", "0.58035517", "0.5781...
0.7440639
5
Get list of sessions matching one or more of the given highlights.
def getSessionsByHighlightSearch(self, request): sessions = self._getSessionsByHighlightSearch(request) # Return individual SessionForm object per Session return SessionForms( items=[self._copySessionToForm(session) for session in sessions] )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getSessionsByHighlightSearch(self, request):\n # Generate list of filters from the highlight arguments\n filters = [Session.highlights == hl for hl in request.highlights]\n if not filters:\n raise endpoints.BadRequestException(\n 'At least one highlight must be s...
[ "0.79675597", "0.5494635", "0.5191284", "0.5032431", "0.5007258", "0.49804562", "0.48610216", "0.4822324", "0.48123288", "0.47999722", "0.47981682", "0.47678235", "0.47661048", "0.47624898", "0.47622135", "0.47583574", "0.4731185", "0.4729603", "0.46977532", "0.4695372", "0.4...
0.6377008
1
Get list of sessions given by particular speaker.
def getSessionsBySpeaker(self, request): sessions = self._getSessionsBySpeaker(request) # Return individual SessionForm object per Session return SessionForms( items=[self._copySessionToForm(session) for session in sessions] )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getSessionsBySpeaker(self, request):\n # Ensure that the speaker key is valid and that the speaker exists\n speaker = _getEntityByWebsafeKey(request.websafeSpeakerKey, 'Speaker')\n # Return all of the speaker's sessions\n return ndb.get_multi(speaker.sessions)", "def get_speaker_...
[ "0.8030544", "0.7973326", "0.7104441", "0.69166255", "0.673275", "0.65312284", "0.6531105", "0.6509404", "0.6405679", "0.63847744", "0.63358986", "0.63214326", "0.6302489", "0.62991273", "0.6233415", "0.62318295", "0.62300605", "0.6215419", "0.61713797", "0.61546844", "0.6126...
0.7022974
3
Demonstrates my solution to the doubleinequality query problem.
def getSessionsDoubleInequalityDemo(self, request): sessions = self._getSessionsDoubleInequalityDemo(request) # Return individual SessionForm object per Session return SessionForms( items=[self._copySessionToForm(session) for session in sessions] )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dq_subquery_filter(self):\n # import ipdb; ipdb.set_trace()\n len1 = len(list(DQ('(b.id, b.name) Book{b.id in [\"(Book.id)\"]} b').dicts()))\n len2 = len(list(DQ(\"(Book.id)\").dicts()))\n self.assertEqual(len1, len2)", "def query3() :", "def test_multiple_iterations_work_p...
[ "0.62650895", "0.61998206", "0.6114937", "0.60249525", "0.6004869", "0.5909111", "0.58909786", "0.5840364", "0.58223784", "0.57433224", "0.57068557", "0.5687743", "0.5659272", "0.5618641", "0.5598052", "0.55531514", "0.55465287", "0.5494882", "0.54774994", "0.54695725", "0.54...
0.0
-1
Add a session to the user's wishlist.
def addSessionToWishlist(self, request): return self._addSessionToWishlist(request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_session_to_wishlist(self, request):\n return self.wishlist_service.add_session_to_wishlist(\n request.websafeSessionKey, endpoints.get_current_user())", "def _addSessionToWishlist(self, request):\n # Preload necessary data items\n user = endpoints.get_current_user()\n ...
[ "0.8530634", "0.8458863", "0.81653136", "0.6810031", "0.67090017", "0.63394535", "0.6139774", "0.6027772", "0.60204995", "0.5996146", "0.5977719", "0.5972456", "0.5959016", "0.5953108", "0.59510666", "0.5943294", "0.59401596", "0.5762732", "0.5690296", "0.5678126", "0.5637029...
0.8111066
3
Removes a session from the user's wishlist.
def removeSessionFromWishlist(self, request): return self._removeSessionFromWishlist(request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_session_from_wishlist(self, request):\n return self.wishlist_service.remove_session_from_wishlist(\n request.websafeSessionKey, endpoints.get_current_user())", "def _removeSessionFromWishlist(self, request):\n # Preload necessary data items\n user = endpoints.get_curren...
[ "0.84345704", "0.82142437", "0.7982269", "0.73392826", "0.7275828", "0.6940655", "0.6902034", "0.68524104", "0.6489267", "0.6463578", "0.6454186", "0.6400235", "0.6364037", "0.6338972", "0.6291613", "0.6269491", "0.62286496", "0.61994463", "0.61216974", "0.6110082", "0.608531...
0.81691545
2
Get list of sessions in the user's wishlist.
def getSessionsInWishlist(self, request): sessions = self._getSessionsInWishlist() # Return individual SessionForm object per Session return SessionForms( items=[self._copySessionToForm(session) for session in sessions] )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wishlist_sessions(self, user):\n wishlist_key = self.get_wishlist_key(user)\n session_keys = [ndb.Key(urlsafe=wsck) for wsck in\n wishlist_key.get().sessionKeys]\n sessions = ndb.get_multi(session_keys)\n return sessions", "def get_sessions_in_wishlist(self,...
[ "0.85226977", "0.82395834", "0.8173087", "0.79181445", "0.76891893", "0.74976784", "0.699512", "0.6882785", "0.6687631", "0.65706885", "0.64425933", "0.6409108", "0.63482064", "0.6346672", "0.62671506", "0.6256981", "0.6236997", "0.61917496", "0.60747415", "0.6055168", "0.600...
0.7137369
6
Copy relevant fields from Profile to ProfileForm.
def _copyProfileToForm(self, prof): pf = ProfileForm() for field in pf.all_fields(): if hasattr(prof, field.name): # Convert t-shirt string to Enum; just copy others if field.name == 'teeShirtSize': setattr(pf, field.name, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_form_kwargs(self):\n kwargs = super(ProfileUpdate, self).get_form_kwargs()\n self.profile = self.get_object()\n extra_kwargs = {'profile': self.profile}\n kwargs.update(extra_kwargs)\n return kwargs", "def _doProfile(self, save_request=None):\n prof = self._getPr...
[ "0.6958025", "0.68784887", "0.64856434", "0.63592464", "0.6284996", "0.6272869", "0.6269607", "0.6214233", "0.62111384", "0.6183875", "0.6135155", "0.612614", "0.61004287", "0.6085827", "0.60856766", "0.6062952", "0.59629256", "0.58970684", "0.5893775", "0.5886109", "0.587434...
0.79479015
0
Get Profile and return to user, possibly updating it first.
def _doProfile(self, save_request=None): prof = self._getProfileFromUser() # If saveProfile(), process user-modifyable fields if save_request: for field in ('displayName', 'teeShirtSize'): if hasattr(save_request, field): val = getattr(save_request...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getProfile(self):\n # GET /profile\n debugMain('getProfile')\n return self._genericGet('/profile')", "def get_user_profile(self):\n return self.user.profile", "def _getProfileFromUser(self):\n # Make sure user is authenticated\n user = endpoints.get_current_user()\...
[ "0.7561392", "0.7465786", "0.7449008", "0.740987", "0.728692", "0.72677916", "0.71766216", "0.71651495", "0.70508856", "0.7031329", "0.695271", "0.6945094", "0.6902091", "0.68805087", "0.6845255", "0.6826616", "0.6815199", "0.6798655", "0.6770665", "0.67508954", "0.67319983",...
0.0
-1
Return Profile from datastore, creating new one if nonexistent.
def _getProfileFromUser(self): # Make sure user is authenticated user = endpoints.get_current_user() if not user: raise endpoints.UnauthorizedException('Authorization required') # Get Profile from datastore user_id = user.email() p_key = ndb.Key(Profile, user_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, name='default'):\r\n if name not in self._cache:\r\n full_path = os.path.join(self._base_folder, name)\r\n self._create_if_needed(full_path)\r\n self._cache[name] = Profile(full_path, name)\r\n return self._cache[name]", "def create_or_update_profile(s...
[ "0.67713064", "0.6432612", "0.638044", "0.6346034", "0.6343368", "0.62816966", "0.6173148", "0.61137223", "0.61025006", "0.61001056", "0.6060391", "0.6048729", "0.60413766", "0.601181", "0.5955292", "0.5921494", "0.5829891", "0.58183765", "0.5805473", "0.5801193", "0.5772561"...
0.70515484
0
Update and return user profile.
def saveProfile(self, request): return self._doProfile(request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_profile():\n logger.debug(\"entering function update_profile\")\n response = update_user_profile(request.json)\n logger.debug(\"exiting function update_profile\")\n return jsonify(response)", "def user_update_profile():\n \n if 'userid' and 'email' not in request.forms:\n retu...
[ "0.8200483", "0.7872713", "0.7602561", "0.7440959", "0.74367917", "0.742381", "0.74070036", "0.7404673", "0.7179691", "0.7177466", "0.71583205", "0.71186864", "0.71023077", "0.709356", "0.70908636", "0.7064532", "0.70350313", "0.70142615", "0.7012082", "0.69845295", "0.696759...
0.6357891
89
Create our CRITsDBAPI object. You may specify a full mongodb uri or the arguments individually.
def __init__(self, mongo_uri='', mongo_host='localhost', mongo_port=27017, mongo_user='', mongo_pass='', db_name='crits'): # If the user provided a URI, we will use that. Otherwise we will build # a URI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_mongodb(config):\n\n \n mongo_url = \"mongodb://\"\n mongo_url += \",\".join(map(lambda srv: srv['host'] + \":\" + str(srv['port']), config['data']['mongoServers']))\n \n if 'replica' in config['data']:\n mongo_url += \"/?replicaSet={0}\".format(config['data']['replica'])\n\n ...
[ "0.66846025", "0.6621965", "0.65577734", "0.6492812", "0.64823735", "0.6253829", "0.61448485", "0.6078013", "0.5876883", "0.5867382", "0.58658755", "0.5850278", "0.58107173", "0.5787932", "0.57878685", "0.57876056", "0.5785224", "0.5769064", "0.5743249", "0.57387024", "0.5737...
0.6649437
1
Starts the mongodb connection. Must be called before anything else will work.
def connect(self): self.client = MongoClient(self.mongo_uri) self.db = self.client[self.db_name]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self) -> None:\n if not self._mongo_available:\n return\n operations_thread = threading.Thread(target=self._run, args=())\n operations_thread.setDaemon(True)\n operations_thread.start()", "def start(self):\r\n \r\n if self.is_mongod_running():\r\n ...
[ "0.80308026", "0.7978816", "0.7448088", "0.72025234", "0.70190024", "0.70040756", "0.6830691", "0.68217134", "0.67718107", "0.67625594", "0.67552036", "0.66018426", "0.65349174", "0.65215963", "0.65146446", "0.6464562", "0.64335114", "0.64177436", "0.639432", "0.6392853", "0....
0.7607241
2
Search a collection for the query provided. Just a raw interface to mongo to do any query you want.
def find(self, collection, query): obj = getattr(self.db, collection) result = obj.find(query) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find(self, collection, query=None, filter=None):\n return self.__db[collection].find(query, filter)", "def find_document(collection: str, query: dict = None, regex: list = None) -> dict:\n if query is not None:\n return DB[collection].find_one(query)\n if regex is not None:\n r...
[ "0.7252133", "0.7012578", "0.6853299", "0.6789239", "0.66799027", "0.6665288", "0.6664408", "0.65937394", "0.6434959", "0.6420416", "0.6398617", "0.62957525", "0.628199", "0.6266347", "0.625643", "0.62044865", "0.6122247", "0.6091136", "0.6090586", "0.60842377", "0.6064155", ...
0.76442003
0
Search a collection for all available items.
def find_all(self, collection): obj = getattr(self.db, collection) result = obj.find() return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all(collection):\n data = []\n for item in collection.find({}):\n data.append(item)\n return data", "def searchItems(name, allPages = False):\n return Gw2Spidy._paginatedRequest(allPages, 'item-search', name)", "def searchCollection(self, limit=100, **kwargs):\n ...
[ "0.66130906", "0.6577022", "0.6503677", "0.64557165", "0.62310874", "0.61904126", "0.6143242", "0.6072285", "0.60007083", "0.59808266", "0.5948115", "0.59253854", "0.58733493", "0.5871716", "0.5857312", "0.58287", "0.582313", "0.5817589", "0.57799107", "0.57534194", "0.575075...
0.6775198
0
Search a collection for the query provided and return one result. Just a raw interface to mongo to do any query you want.
def find_one(self, collection, query): obj = getattr(self.db, collection) result = obj.find_one(query) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find(self, collection, query):\n obj = getattr(self.db, collection)\n result = obj.find(query)\n return result", "def find(self, collection, query=None, filter=None):\n return self.__db[collection].find(query, filter)", "def find_document(collection: str, query: dict = None,...
[ "0.79049706", "0.75223446", "0.7400582", "0.7219015", "0.7148035", "0.7044073", "0.70365006", "0.6900449", "0.68693525", "0.6687954", "0.66815037", "0.6643801", "0.6433155", "0.6354233", "0.6272778", "0.62644094", "0.61989784", "0.61437243", "0.6137244", "0.612182", "0.609625...
0.7865692
1
Search a collection for the distinct key values provided.
def find_distinct(self, collection, key): obj = getattr(self.db, collection) result = obj.distinct(key) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _filter_search_values(key: str, values: list, collection: list):\n return_data = []\n for item in collection:\n if any(val in values for val in item[key]):\n return_data.append(item)\n return return_data", "def distinct(self, key):\n return self.database.command({'distinct':...
[ "0.69668233", "0.58777803", "0.5819709", "0.5781459", "0.5655128", "0.5622824", "0.56214416", "0.56086063", "0.5562973", "0.5557258", "0.5502194", "0.5408141", "0.5392551", "0.53712016", "0.5323929", "0.5288685", "0.5286743", "0.52866507", "0.5135332", "0.51346934", "0.513088...
0.72450334
0
Adds an embedded campaign to the TLO.
def add_embedded_campaign(self, id, collection, campaign, confidence, analyst, date, description): if type(id) is not ObjectId: id = ObjectId(id) # TODO: Make sure the object does not already have the campaign # Return if it does. Add it if it doesn't ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_campaign(self, campaign):\n self._campaigns += [campaign]", "def _set_campaign(self, campaign):\n if isinstance(campaign, str):\n campaign = TrackedCampaign.objects.create(name=campaign)\n\n campaign.save()\n\n self.campaign = campaign", "def campaign(self, campai...
[ "0.7053185", "0.55294055", "0.5502619", "0.53983206", "0.53974485", "0.53938943", "0.5390333", "0.5346445", "0.51280814", "0.51132816", "0.5100033", "0.5023265", "0.4961767", "0.49532866", "0.49409008", "0.49400547", "0.49252018", "0.49178767", "0.48796228", "0.48726276", "0....
0.7287195
0
Removes an item from the bucket list
def remove_bucket_list_item(self, id, collection, item): if type(id) is not ObjectId: id = ObjectId(id) obj = getattr(self.db, collection) result = obj.update( {'_id': id}, {'$pull': {'bucket_list': item}} ) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove(self, item):\n try:\n entry = self.set.pop(item)\n entry[-1] = self.REMOVED\n except KeyError:\n print(\"Can't remove a non-existing item\")", "def remove(self, item):\n del self._dict[item]", "def _bucket_delitem(self, j, k):\n pass", "def ...
[ "0.791302", "0.7706514", "0.7652778", "0.75784016", "0.7561372", "0.7506943", "0.74443907", "0.7405826", "0.7405826", "0.73899317", "0.73899317", "0.73878163", "0.73668784", "0.7335001", "0.7286636", "0.7273813", "0.72560424", "0.72402847", "0.72392786", "0.72225547", "0.7219...
0.8045885
0
Adds an item to the bucket list
def add_bucket_list_item(self, id, collection, item): if type(id) is not ObjectId: id = ObjectId(id) obj = getattr(self.db, collection) result = obj.update( {'_id': id}, {'$addToSet': {'bucket_list': item}} ) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, item):", "def add_item(self, item):\n self.items.append(item)", "def add_to_bag(self, item):\n self._bag.append(item)", "def add(self, item):\n\n if item not in self:\n self._index_map[item] = len(self._list)\n self._list.append(item)", "def add(self...
[ "0.7640922", "0.75756705", "0.751956", "0.74900144", "0.7369312", "0.7361309", "0.7332356", "0.7283963", "0.7280235", "0.72764546", "0.72698563", "0.7263061", "0.72285056", "0.72285056", "0.72285056", "0.72285056", "0.72285056", "0.71988684", "0.7163348", "0.7156221", "0.7156...
0.77858466
0
Returns a list of all valid campaign names
def get_campaign_name_list(self): campaigns = self.find('campaigns', {}) campaign_names = [] for campaign in campaigns: if 'name' in campaign: campaign_names.append(campaign['name']) return campaign_names
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_existent_campaigns_returns_campaigns_list(self):\n test_campaign = return_canned_campaign()\n test_campaign.create()\n response = self.client.get(self.endpoint_url)\n response_body = response.get_json()\n self.assertEqual(response.status_code, 200)\n self.asse...
[ "0.5988995", "0.5805326", "0.5684534", "0.5676261", "0.5601181", "0.55940896", "0.5530269", "0.5515312", "0.5460801", "0.5450627", "0.5449519", "0.54434097", "0.54434097", "0.54434097", "0.542792", "0.5424966", "0.54231083", "0.54181385", "0.53910905", "0.5375468", "0.5351693...
0.7925846
0
Whether DDP is activated
def is_distributed(args: dict) -> bool: return args.local_rank != -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _ison(self):\n return self.dp.state()==PyTango.DevState.ON", "def is_on(self) -> bool:\n return self.tuya_device.status.get(DPCODE_SWITCH, False)", "def _is_device_active(self):\n return self.power_mode == STATE_ON", "def is_active():\n return True", "def is_active(self) -> ...
[ "0.7000938", "0.6990944", "0.68319756", "0.6827091", "0.6824075", "0.6731119", "0.6713643", "0.6683036", "0.66403025", "0.6593317", "0.6593317", "0.6593317", "0.6593317", "0.6593317", "0.6593317", "0.6593317", "0.6593317", "0.6593317", "0.6593317", "0.6593317", "0.6593317", ...
0.0
-1
Whether the process is running as the main process
def is_main_process(args: dict): return not is_distributed(args) or args.local_rank == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_main_process() -> bool:\n return multiprocessing.current_process().name == 'MainProcess' and os.environ['main_process_pid'] == str(os.getpid())", "def _isSubProcessRunning(self): \n # Check if child process has terminated. Set and return returncode attribute.\n if self.__process.poll()...
[ "0.8799151", "0.7497712", "0.7343165", "0.7201382", "0.7150669", "0.7103503", "0.7073254", "0.7026223", "0.70111364", "0.6951164", "0.6927277", "0.6923171", "0.68789256", "0.68608314", "0.68460107", "0.68151265", "0.6789779", "0.67896146", "0.67687416", "0.6764666", "0.674240...
0.7922667
1
Initializes the DDP process pool and sets the default device
def init_distributed(args: dict): if is_distributed(args): dist.init_process_group(backend="nccl") torch.cuda.set_device(args.local_rank)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n super().setUp()\n self.devices = _DEVICE_STRATEGY()\n command_line = [\"pool\", \"create\", self._POOLNAME] + self.devices\n RUNNER(command_line)", "def setup_device(device):\n try:\n # Gets around \"Resource busy\" errors\n device.detach_kernel_dri...
[ "0.6002063", "0.5892538", "0.58575326", "0.5846637", "0.5833589", "0.58189595", "0.57568073", "0.5730799", "0.55829", "0.55799645", "0.55763", "0.55616033", "0.55581534", "0.5522597", "0.5496948", "0.5489952", "0.54753715", "0.54609555", "0.5448769", "0.544637", "0.5446346", ...
0.56588197
8
Gets the default device
def get_device(args: dict) -> torch.device: if is_distributed(args): device = torch.device("cuda", args.local_rank) else: if torch.cuda.is_available(): device = torch.device("cuda", 0) else: device = torch.device("cpu") return device
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_default_device():\n global _default_device\n\n if _default_device is None:\n import wgpu.backends.rs # noqa\n\n adapter = wgpu.request_adapter(canvas=None, power_preference=\"high-performance\")\n _default_device = adapter.request_device()\n return _default_device", "def ge...
[ "0.85560495", "0.8509156", "0.81830615", "0.7949495", "0.7936597", "0.7936597", "0.7936597", "0.7936597", "0.765728", "0.75626457", "0.7489031", "0.74441177", "0.7370417", "0.73445976", "0.72786206", "0.72608113", "0.72608113", "0.72608113", "0.72608113", "0.72608113", "0.722...
0.0
-1
Cleanups ddp process group
def deinit_distributed(args: dict): if is_distributed(args): dist.destroy_process_group()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_up(self):\n dist.destroy_process_group()", "def cleanup():\n dist.destroy_process_group()", "def dist_cleanup():\n dist.destroy_process_group()", "def destroy(self, process_group: ProcessGroup = None):\n dist.destroy_process_group(process_group)", "def clean_all(self):\n fo...
[ "0.7584239", "0.73850125", "0.70272577", "0.66014636", "0.64747924", "0.6219315", "0.6033827", "0.5908748", "0.5872821", "0.58509606", "0.5828625", "0.5803862", "0.5777883", "0.5747657", "0.5744301", "0.5668658", "0.5653742", "0.563985", "0.5636443", "0.5628545", "0.5613895",...
0.6236989
5
print the character frequency in a file
def character_frequency(filename): try: f = open(filename) except OSError: return None characcters = {} for line in f: for char in line: characcters[char] = characcters.get(char, 0) +1 f.close() return characcters
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cnt_freq(filename):\n freq = [0] * 256\n try:\n f_in = open(filename,'r')\n except:\n raise FileNotFoundError\n for line in f_in:\n for char in line:\n freq[ord(char)] = freq[ord(char)] + 1\n f_in.close()\n return freq", "def cnt_freq(filename):\r\n counts...
[ "0.7926811", "0.78219485", "0.75066334", "0.74771833", "0.7068149", "0.69391334", "0.69081545", "0.6878811", "0.686783", "0.68351465", "0.67606854", "0.6759828", "0.67133343", "0.6663235", "0.6577101", "0.64824665", "0.64137924", "0.641095", "0.63741547", "0.6366009", "0.6353...
0.7556631
2
Initialize the WorkshopAdapter object. This constructor initializes the WorkshopAdapter object.
def __init__(self, **kwargs): # Intialise superclass super(FileInterfaceAdapter, self).__init__(**kwargs) self.abs_directory = str(self.options.get('absolute_directory')) self.fileInterface = FileInterface(self.abs_directory) logging.debug('FileInterface Adapter loaded')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.currencies = {\n currency.code: currency for currency in Currency.objects.all()\n }\n self.channels = {\n channel.sub_source: channel.channel\n for channel in LinnworksChannel.objects.all()\n }\n self.countries = {\n ...
[ "0.5742074", "0.571112", "0.5694404", "0.5597881", "0.5553317", "0.55303854", "0.5501522", "0.5488599", "0.54834014", "0.54664266", "0.5454657", "0.54337347", "0.54020715", "0.5397585", "0.5397585", "0.538841", "0.5384996", "0.53681713", "0.53575194", "0.529976", "0.5297414",...
0.0
-1
Handle an HTTP GET request. This method handles an HTTP GET request, returning a JSON response.
def get(self, path, request): try: response = self.fileInterface.get(path) status_code = 200 except ParameterTreeError as e: response = {'error': str(e)} status_code = 400 content_type = 'application/json' return ApiAdapterResponse(respon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_GET(self):\r\n self._send_handler_response('GET')", "def do_GET(self):\n self._try_to_process_request(self._handle_get_request)", "def do_GET(self):\n self.http_method = 'GET'\n self.response()", "def get(self, *args, **kwargs):\n return self.handle_get_request()", ...
[ "0.73754185", "0.72471803", "0.7157816", "0.70633495", "0.692195", "0.6795289", "0.6795289", "0.67720217", "0.67569727", "0.67546445", "0.6660707", "0.6651187", "0.65724033", "0.65541583", "0.65337265", "0.651263", "0.6496506", "0.6482216", "0.6457152", "0.6453102", "0.642113...
0.0
-1
Handle an HTTP PUT request. This method handles an HTTP PUT request, returning a JSON response.
def put(self, path, request): content_type = 'application/json' try: data = json_decode(request.body) self.fileInterface.set(path, data) response = self.fileInterface.get(path) status_code = 200 except FileInterfaceError as e: respons...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_PUT(self,):\n self.http_method = 'PUT'\n # Nothing to do for now.\n pass", "def put(self, *args, **kwargs):\n return self.handle_put_request()", "def handle_put(self, api, command):\n return self._make_request_from_command('PUT', command)", "def PUT(self):\n r...
[ "0.7208754", "0.7198427", "0.70180017", "0.70172656", "0.68714666", "0.6849794", "0.6794865", "0.6794865", "0.6794865", "0.6720018", "0.67168677", "0.6708451", "0.66553783", "0.6645579", "0.6639994", "0.6630718", "0.65911204", "0.6553887", "0.65157974", "0.64955133", "0.64950...
0.6513424
19
Handle an HTTP DELETE request. This method handles an HTTP DELETE request, returning a JSON response.
def delete(self, path, request): response = 'FileInterfaceAdapter: DELETE on path {}'.format(path) status_code = 200 logging.debug(response) return ApiAdapterResponse(response, status_code=status_code)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self):\r\n return http.Request('DELETE', '{0}'.format(\r\n self.get_url())), parsers.parse_json", "def do_DELETE(self,):\n self.http_method = 'DELETE'\n self.response()", "def httpDelete(self, url='', data='', params={}, headers={}):\n\n return ...
[ "0.7570553", "0.753795", "0.7233657", "0.72140676", "0.7095827", "0.69700193", "0.69198775", "0.6910894", "0.69087464", "0.6906033", "0.68964475", "0.6865279", "0.6833366", "0.68176347", "0.66972923", "0.66895145", "0.6677972", "0.6655997", "0.66559964", "0.6639792", "0.66364...
0.60661227
77
Initialise the FileInterface object. This constructor initlialises the FileInterface object, building a parameter tree.
def __init__(self, abs_directory): # Save arguments self.fp_config_files = [] self.txt_files = [] self.fr_config_files = [] self.abs_directory = abs_directory # Store initialisation time self.init_time = time.time() # Get package version information ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, **kwargs):\n # Intialise superclass\n super(FileInterfaceAdapter, self).__init__(**kwargs)\n self.abs_directory = str(self.options.get('absolute_directory'))\n self.fileInterface = FileInterface(self.abs_directory)\n\n logging.debug('FileInterface Adapter loade...
[ "0.7568297", "0.6816404", "0.6792019", "0.67573327", "0.66559887", "0.6599961", "0.65831435", "0.650752", "0.6437159", "0.64053744", "0.6384164", "0.6318538", "0.6318299", "0.63178724", "0.6264322", "0.62354314", "0.622551", "0.622551", "0.62203366", "0.6199047", "0.6189019",...
0.59067506
75
Get the uptime for the ODIN server. This method returns the current uptime for the ODIN server.
def get_server_uptime(self): return time.time() - self.init_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uptime(self):\n return self._uptime", "def uptime(self):\n if self._uptime is None:\n version_data = self._raw_version_data()\n uptime_full_string = version_data[\"uptime\"]\n self._uptime = self._uptime_to_seconds(uptime_full_string)\n\n return self._upt...
[ "0.8274161", "0.80681056", "0.8065809", "0.7863143", "0.74871224", "0.7299963", "0.7203934", "0.7076993", "0.7023769", "0.7021257", "0.69755334", "0.68817836", "0.68444324", "0.68224293", "0.67419744", "0.6637767", "0.65656966", "0.6540984", "0.6523476", "0.65107214", "0.6489...
0.794025
3
Get the parameter tree. This method returns the parameter tree for use by clients via the FileInterface adapter.
def get(self, path): return self.param_tree.get(path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parameters(self) -> PyTree:\n return self._parameters", "def filetree(self) -> P:\n ...", "def parameterNode(self):\r\n # framework\r\n profbox()\r\n return self.parameterNode", "def parameterNode(self):\n #framework\n profbox()\n return self.parameterNode", "def get_par...
[ "0.75262344", "0.6833905", "0.65000045", "0.6114677", "0.6060483", "0.6060483", "0.6060483", "0.6060483", "0.6060483", "0.60557586", "0.59406596", "0.59071493", "0.58923465", "0.58923465", "0.5843873", "0.58284414", "0.5816218", "0.5750005", "0.5725853", "0.5725853", "0.57237...
0.5403514
81
Set parameters in the parameter tree. This method simply wraps underlying ParameterTree method so that an exceptions can be reraised with an appropriate FileInterfaceError.
def set(self, path, data): try: self.param_tree.set(path, data) except ParameterTreeError as e: raise FileInterfaceError(e)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setParameterNode(self, parameterNode):\r\n # framework\r\n profbox()\r\n self.parameterNode = parameterNode", "def setParameterNode(self, parameterNode):\n #framework\n profbox()\n self.parameterNode = parameterNode", "def setParams(self, paramSet):\r\n pass", "def set_params(self):\...
[ "0.6985717", "0.67060566", "0.6683662", "0.66480035", "0.6634291", "0.66082174", "0.65245366", "0.6508125", "0.64559436", "0.6373968", "0.6365402", "0.63510525", "0.63371843", "0.62663895", "0.6263053", "0.6206298", "0.6145241", "0.6132779", "0.609262", "0.6084063", "0.608083...
0.7035647
0
Retrieve all of the txt configuration files in the absolute directory path Clears the internal lists first to prevent circular appending at every "GET"
def get_config_files(self): self.clear_lists() print self.abs_directory for file in os.listdir(self.abs_directory): print file if file.endswith('.json') and "qemii" in file: self.txt_files.append(file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_path(self, conf):\n\t\tpass", "def get_cfg_files(self):\n\t\tcfg_files = []\n\t\tfor config_object, config_value in self.maincfg_values:\n\t\t\t\n\t\t\t## Add cfg_file objects to cfg file list\n\t\t\tif config_object == \"cfg_file\" and os.path.isfile(config_value):\n\t\t\t\t\tcfg_files.append(config...
[ "0.67695117", "0.6177163", "0.617072", "0.59774256", "0.59301084", "0.5873713", "0.58602625", "0.58550894", "0.58476", "0.58326143", "0.57421196", "0.5723155", "0.57174045", "0.5698926", "0.56854516", "0.56496686", "0.5622283", "0.56196785", "0.5619165", "0.55947644", "0.5593...
0.7291427
0
gets the frame processor config files from the list of text files found
def get_fp_config_files(self): self.get_config_files() for file in self.txt_files: if "fp" in file: self.fp_config_files.append(file) return self.fp_config_files
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fr_config_files(self):\n self.get_config_files()\n for file in self.txt_files:\n if \"fr\" in file:\n self.fr_config_files.append(file)\n return self.fr_config_files", "def get_config_files(self):\n self.clear_lists()\n print self.abs_directory...
[ "0.6520556", "0.63628197", "0.63615507", "0.6221763", "0.5962912", "0.5892015", "0.5830065", "0.5739405", "0.57229286", "0.56986266", "0.5679086", "0.5662258", "0.5656805", "0.5652418", "0.5599099", "0.5556959", "0.5527652", "0.5507178", "0.5476617", "0.5443827", "0.5414869",...
0.68645674
0
gets the frame receiver config files from the list of text files found
def get_fr_config_files(self): self.get_config_files() for file in self.txt_files: if "fr" in file: self.fr_config_files.append(file) return self.fr_config_files
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config_files(self):\n self.clear_lists()\n print self.abs_directory\n for file in os.listdir(self.abs_directory):\n print file\n if file.endswith('.json') and \"qemii\" in file:\n self.txt_files.append(file)", "def get_fp_config_files(self):\n ...
[ "0.7247125", "0.68345076", "0.662452", "0.6256014", "0.61033165", "0.60573196", "0.6044879", "0.5955532", "0.59343725", "0.5895655", "0.5890608", "0.5874388", "0.58420765", "0.5819668", "0.5817432", "0.5767008", "0.57370996", "0.5723543", "0.57066727", "0.5687508", "0.5678910...
0.6701927
2
clears the text file, fr and fp config file lists
def clear_lists(self): self.fp_config_files = [] self.txt_files = [] self.fr_config_files = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear():", "def clean_files(self):\n self.filenames.clear()", "def clear_specific(self):\n self.specific_file = None\n self.specific_parser = None\n\n self.specific_box.delete(0, END)", "def _clear_variables( self ):\r\n self.navigation = None\r\n self.resPath = ...
[ "0.6580808", "0.656783", "0.6490422", "0.64671326", "0.6438465", "0.64325815", "0.6405157", "0.63748187", "0.6326406", "0.63253486", "0.6313617", "0.6293512", "0.6253082", "0.6251729", "0.62491286", "0.6137878", "0.61237454", "0.6122098", "0.6118917", "0.6106766", "0.61034346...
0.8425523
0
Initialize the object, getting the overlap integral matrix.
def __init__(self, cbins=None, rbins=None, thbins=None, file=None): if isinstance(cbins, str) or isinstance(cbins, File): file = cbins rbins, thbins = None, None if cbins and rbins and thbins: self.cbins = cbins self.rbins = rbins self.thbins = thbins rs, ths, xs, ys, vals = self.get_overlap_v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Initialize(self):\n return _gmat_py.Integrator_Initialize(self)", "def __init__(self):\n self.Robot = Robot()\n self.Omega = matrix()\n # self.Omega.value[0][0] = 1.0\n # self.Omega.value[1][1] = 1.0\n self.Xi = matrix()\n # Xi.value[0][0] = 0.0\n # Xi....
[ "0.6030348", "0.58474874", "0.57042056", "0.5693674", "0.5682293", "0.56683475", "0.56358224", "0.554552", "0.5544686", "0.55268455", "0.55076176", "0.5495157", "0.5480548", "0.54716593", "0.54712325", "0.54395574", "0.5426868", "0.5418678", "0.541668", "0.54087013", "0.53720...
0.0
-1
Get the radii (in pixels) corresponding to each radial bin.
def R(self): return (arange(self.rbins) + 0.5) * (self.cbins - 0.5) / self.rbins
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_radii(self) -> np.ndarray:\n return np.array([self._radii[p] for p in self.particles])", "def radii(self):\n dim_half = (self.shape[0] + 1) // 2\n x = np.arange(dim_half)\n if self.step is None:\n return x\n else:\n xmax = x.max()\n x2 =...
[ "0.69543964", "0.6813362", "0.6594828", "0.6583719", "0.6409623", "0.6281537", "0.6247055", "0.6237292", "0.6164095", "0.61313295", "0.6103718", "0.6100923", "0.60824674", "0.60633904", "0.60296583", "0.5983751", "0.59354424", "0.59351385", "0.59231746", "0.5907882", "0.59038...
0.67343485
2
Get the angles (in radians) corresponding to each angular bin.
def TH(self, full=False): return (arange(self.thbins + 3*self.thbins*(full==True)) + 0.5) * (pi / 2) / self.thbins
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def angles(self):\n self._sort_measurements()\n return self._angles", "def angles(self):\n return self._angles", "def angles(self):\n penult = self._coordinates[-2]\n last = self._coordinates[-1]\n angles = []\n for c in self._coordinates:\n angle = (...
[ "0.7416226", "0.72830087", "0.7281555", "0.7212214", "0.70486593", "0.7032604", "0.6986233", "0.69393504", "0.6924365", "0.66856015", "0.6669014", "0.66409254", "0.6580863", "0.65750813", "0.6529892", "0.65235746", "0.6478025", "0.6461709", "0.6380902", "0.63770735", "0.63730...
0.0
-1
Rebin cartesian image or cartesian quadrant to polar data or polar quadrant.
def cart2pol(self, cart, x0=None, y0=None): if x0 and y0: return hstack((fliplr(self.cart2pol(resizeFolded(foldQuadrant(cart, x0, y0, [1,0,0,0]), self.cbins))), self.cart2pol(resizeFolded(foldQuadrant(cart, x0, y0, [0,1,0,0]), self.cbins)), fliplr(self.cart2pol(resizeFolded(foldQuadrant(cart, x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reproject_image_into_polar(data, origin=None):\r\n ny, nx = data.shape[:2]\r\n if origin is None:\r\n origin = (nx//2, ny//2)\r\n\r\n # Determine that the min and max r and theta coords will be...\r\n x, y = index_coords(data, origin=origin)\r\n r, theta = cart2polar(x, y)\r\n\r\n # Ma...
[ "0.6475095", "0.6117494", "0.6110443", "0.60577464", "0.60224247", "0.5961014", "0.5882974", "0.5875506", "0.58316296", "0.5820953", "0.5778836", "0.57175505", "0.5717419", "0.56958276", "0.5621838", "0.55780774", "0.5545729", "0.55400836", "0.54864264", "0.5484192", "0.54762...
0.0
-1
Rebin polar image or polar quadrant to cartesian image or cartesian quadrant.
def pol2cart(self, pol): if pol.shape[1]==self.thbins: areas = 2 * pi * self.R() / 4 / self.thbins return self.overlap_values.T.dot((pol.T/areas).T.reshape(self.rbins*self.thbins, -1)).reshape(self.cbins, self.cbins, *pol.shape[2:]) elif pol.shape[1]==self.thbins*4: cart = zeros((self.cbins*2 - 1, self.cb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cartesian2polar(x, y):\n r = (x**2+y**2)**.5\n phi = atan2(y, x)\n return phi, r", "def cartesian_to_polar(cart: np.ndarray, radial_step: float, azimuth_step : float, radial_bins: int,\n azimuth_bins: int, cart_resolution: float) -> np.ndarray:\n max_range = radial_step * radial_bins\n ...
[ "0.61145186", "0.60511214", "0.6048923", "0.6003735", "0.5971528", "0.59478134", "0.5923697", "0.5781841", "0.5757597", "0.5742307", "0.57259274", "0.57149446", "0.5707129", "0.5706045", "0.5620117", "0.5614398", "0.5573024", "0.5547646", "0.5528825", "0.5497579", "0.5455968"...
0.47288632
81
Save the overlap integral values to file.
def save(self, rs, ths, xs, ys, vals, file=None): if file is None: file = 'PR_c%d_r%d_th%d.h5' % (self.cbins, self.rbins, self.thbins) with File(file, 'w') as file: file.create_dataset('cbins' , data=self.cbins) file.create_dataset('rbins' , data=self.rbins) file.create_dataset('thbins', data=self.thb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_enu(self, filename):\n x, y, z = self.get_coords_enu()\n coords = np.vstack([x, y, z]).T\n np.savetxt(filename, coords, fmt=b'%.12e')", "def save(self, fname):\n fmt = \" %7.1f %7.1f %8.2f %8.2f %8.2f %8.3f %8.3f %8.3f %8.3f %6.1f\"\n with open(fname, 'wb') as fid:\n ...
[ "0.6437546", "0.6042619", "0.5867301", "0.58298796", "0.57658714", "0.5632551", "0.56270516", "0.5551496", "0.5534138", "0.55244094", "0.5514841", "0.5507916", "0.5505046", "0.549569", "0.5495044", "0.5490334", "0.54699355", "0.54660064", "0.54602015", "0.54510903", "0.545045...
0.0
-1
Find the overlap areas between each cartesian bin and each polar bin.
def get_overlap_values(self, cbins, rbins, thbins): dr = (cbins - 0.5) / rbins dth = (pi / 2) / thbins thbins_reduced = int(ceil(thbins / 2)) def overlap_value(x, y, r, th): """ Find the overlap area between a cartesian and a polar bin. """ thmin = max(th - dth/2, atan2(y - 0.5, x + 0.5)) thma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def face_area(lon_b, lat_b, r_sphere = 6.375e6):\n \n # Convert inputs to radians\n lon_b_rad = lon_b * np.pi / 180.0\n lat_b_rad = lat_b * np.pi / 180.0\n \n r_sq = r_sphere * r_sphere\n n_cs = lon_b.shape[1] - 1\n \n # Allocate output array\n cs_area = np.zeros((n_cs,n_cs))\n \n ...
[ "0.6044802", "0.5895329", "0.58889174", "0.58684486", "0.5833127", "0.58256036", "0.5822762", "0.58167046", "0.5789582", "0.5789443", "0.57723266", "0.5764114", "0.5745368", "0.57442003", "0.57348084", "0.57329583", "0.56990653", "0.56981635", "0.5677911", "0.5641722", "0.564...
0.72021544
0
Find the overlap area between a cartesian and a polar bin.
def overlap_value(x, y, r, th): thmin = max(th - dth/2, atan2(y - 0.5, x + 0.5)) thmax = min(th + dth/2, atan2(y + 0.5, x - 0.5)) rin = lambda theta: maximum(r - dr/2, maximum((x - 0.5) / npcos(theta), (y - 0.5) / npsin(theta))) rout = lambda theta: minimum(r + dr/2, minimum((x + 0.5) / npcos(theta), (y ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_overlap_values(self, cbins, rbins, thbins):\n\n\t\tdr = (cbins - 0.5) / rbins\n\t\tdth = (pi / 2) / thbins\n\t\tthbins_reduced = int(ceil(thbins / 2))\n\n\t\tdef overlap_value(x, y, r, th):\n\t\t\t\"\"\"\n\t\t\tFind the overlap area between a cartesian and a polar bin.\n\t\t\t\"\"\"\n\n\t\t\tthmin = max(th...
[ "0.7028766", "0.59871954", "0.5846108", "0.58240885", "0.5822711", "0.5804281", "0.57852316", "0.5781865", "0.5740109", "0.5740109", "0.57282335", "0.57139766", "0.56880105", "0.56870973", "0.5682105", "0.56815344", "0.5678309", "0.56728154", "0.5672636", "0.5653654", "0.5644...
0.5345977
55
Construct the sparse overlap integral matrix from the nonzero elements.
def make_matrix(self, rs, ths, xs, ys, vals): ps = ravel_multi_index((hstack((rs, rs)), hstack((ths, self.thbins - ths - 1))), (self.rbins, self.thbins)) cs = ravel_multi_index((hstack((xs, ys)), hstack((ys, xs))), (self.cbins, self.cbins)) return csr_matrix((hstack((vals, vals)), (ps, cs)), (self.rbins*self.th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makesparse(matrix):\n n = matrix[0].size\n elements = []\n for i in range(n):\n for j in range(n):\n if matrix[i][j] != 0 :\n temp = MatrixElement(i, j, matrix[i][j])\n elements.append(temp)\n return SparseMatrix(n, elements)", "def ident_zeros(A):\...
[ "0.66588247", "0.6175007", "0.6145749", "0.612834", "0.6091433", "0.60378534", "0.598065", "0.5979184", "0.5858971", "0.585185", "0.58418506", "0.583919", "0.5835888", "0.5825546", "0.5802874", "0.57908213", "0.57894164", "0.5752835", "0.5750317", "0.57402164", "0.57259", "...
0.0
-1
Method to toggle the is_running boolean in the game
def pause(self, _): if not self.is_ended: self.canvas.create_text(self.game.width // 2, self.game.height // 2, text="Paused", font=(Game.FONT, 50), fill=Gam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop_running(self):\n self.running = False", "def toggle(self):\n self._state.is_on = not self._state.is_on\n self.send_command(Command.TOGGLE, [])", "def toggle_run_button(self, event):\n if not self.running:\n self.start_thread()\n else:\n self.stop_thread...
[ "0.70615935", "0.6840273", "0.6838203", "0.6742316", "0.6737016", "0.6685446", "0.6516571", "0.6506268", "0.6505636", "0.6505636", "0.6505636", "0.6497265", "0.64862645", "0.64459693", "0.64438826", "0.64438826", "0.6413608", "0.64024734", "0.63971186", "0.6395969", "0.639596...
0.0
-1
Simply a setter for the switch_state variable
def switch_to_state(self, state): self.switch_state = state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_state(self, state: int):", "def set_state(self,s):\n self.state = s", "def set_state(self, value):\n self.state = value", "def set_state( self ):", "def __change_state(self, state):\n self.state = state", "def _set_state(self, state):\n #print(\"** set state from %d to...
[ "0.7938014", "0.77415305", "0.77284354", "0.7591089", "0.7483043", "0.74070084", "0.74032426", "0.73946637", "0.7236219", "0.722214", "0.72149825", "0.7191996", "0.71756476", "0.7167509", "0.7059652", "0.7028504", "0.70257914", "0.69464743", "0.6940021", "0.69133204", "0.6864...
0.7992266
0
Used for resetting everything currently on the game window. This is used for switching between states. The code is small, but commonly used, so I made it a function.
def reset_frame(self): if self.frame is not None: self.frame.destroy() self.frame = Frame(self.root, width=self._width, height=self._height, bg=Game.BACKGROUND_COLOUR) self.frame.pack()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\n\n game.reset()\n sm.get_screen('game_screen').reset()", "def reset_game():\n global x_pos, o_pos, frames, count\n\n count = 0\n x_pos = []\n o_pos = []\n result.set(\"Your Turn!\")\n for x in frames:\n for y in x.winfo_children():\n y.config(te...
[ "0.7740354", "0.7462945", "0.7380994", "0.70991206", "0.7090645", "0.7058696", "0.69993645", "0.6983626", "0.6981798", "0.69441324", "0.69441324", "0.6944032", "0.6944032", "0.6944032", "0.6941165", "0.6921576", "0.691852", "0.6903168", "0.68667805", "0.6865117", "0.6856101",...
0.0
-1
preprocess the "NEW" Best Buy review data frame
def write_bestbuy_review_data(engine, api = 'http://api.remix.bestbuy.com/v1/reviews?format=json&pageSize=100&apiKey=q3yfbu6smh6bzydeqbjv9kas'): # delete the unnecesssary records reviews_data = preproc.getData_API(api, 'reviews') if('aboutMe' in reviews_data.columns): del reviews_data['aboutMe'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def single_review_prep(text):\n clean_test = data_cleaner(text)\n dummy_dict= {'star': [clean_test]}\n clean_test_df = pd.DataFrame(dummy_dict)\n return clean_test_df", "def preprocess_data(df, min_vote_count=1000):\n # note that order matters!\n df = remove_rows_without_feature(df, 'budget')\n...
[ "0.6396756", "0.59188193", "0.58962667", "0.5809514", "0.5796008", "0.5783609", "0.5739264", "0.5638419", "0.56384134", "0.56228554", "0.56181115", "0.55560744", "0.551565", "0.54739445", "0.54389805", "0.5418286", "0.5389239", "0.53320706", "0.53245866", "0.5295883", "0.5290...
0.5433427
15
preprocess the "NEW" Best Buy review data frame
def write_bestbuy_product_data(engine, api = 'http://api.remix.bestbuy.com/v1/products?format=json&pageSize=100&apiKey=q3yfbu6smh6bzydeqbjv9kas'): # delete the unnecesssary records products_data = preproc.getData_API(api, 'products') del products_data['videoChapters'] del products_data['videoLanguages']...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def single_review_prep(text):\n clean_test = data_cleaner(text)\n dummy_dict= {'star': [clean_test]}\n clean_test_df = pd.DataFrame(dummy_dict)\n return clean_test_df", "def preprocess_data(df, min_vote_count=1000):\n # note that order matters!\n df = remove_rows_without_feature(df, 'budget')\n...
[ "0.6396756", "0.59188193", "0.58962667", "0.5809514", "0.5796008", "0.5783609", "0.5739264", "0.5638419", "0.56384134", "0.56228554", "0.56181115", "0.55560744", "0.551565", "0.54739445", "0.54389805", "0.5433427", "0.5418286", "0.5389239", "0.53320706", "0.53245866", "0.5295...
0.0
-1
uses the USA Today API in order to extract the list of the subAPIs for music reviews
def obtain_USAToday_APIs(api="http://api.usatoday.com/open/reviews/music?count=1000&api_key=mhph6f4afgvetbqtex4rs22a"): import requests r = requests.get(api) jsonfile = r.json() key = jsonfile.keys() data = jsonfile[key[0]] keys = jsonfile[key[0]].keys() api_dict = {} nData =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, request, format=None):\n albums = MusicAlbum.objects.all()\n # trending = \n # popular = albums[6:]\n recommendations = serializers.ReadMusicAlbumSerializer(\n albums[:2], many=True, context={'request': request}\n )\n trending = serializers.ReadMus...
[ "0.5990308", "0.5970837", "0.576632", "0.5740902", "0.5699372", "0.5680496", "0.5655822", "0.55319315", "0.5443329", "0.54422873", "0.5438654", "0.5432013", "0.5431028", "0.5429935", "0.54219544", "0.5420579", "0.54025465", "0.5399872", "0.5391939", "0.5383238", "0.5366309", ...
0.66950834
0
convert any item to a numpy ndarray
def to_ndarray(item): return type(item), sp.array(item, sp.float64, ndmin=1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _to_ndarray(data):\n return np.atleast_1d(getattr(data, 'values', data))", "def convert_to_ndarray(entity):\n if isinstance(entity, np.ndarray) and entity.dtype.kind in set('biufc'):\n # entity is numerical ndarray already\n return entity\n if isinstance(entity, np.ndarray) and isinsta...
[ "0.7383202", "0.712074", "0.70498645", "0.70083153", "0.69416726", "0.69294995", "0.6854728", "0.6834907", "0.6817344", "0.6804671", "0.6770331", "0.66576916", "0.6650874", "0.6647591", "0.6646724", "0.6613207", "0.6582173", "0.6582173", "0.65404516", "0.6507793", "0.64623237...
0.7740508
0
convert any numpy array back to its original item type
def from_ndarray(itemtype, *items): if itemtype in [IntType, LongType, FloatType]: val = tuple(i.flat[0] for i in items) elif itemtype is ListType: val = tuple(i.tolist() for i in items) elif itemtype is TupleType: val = tuple(tuple(i.tolist()) for i in items) elif itemtype is s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _convert_data(self, data):\n if isinstance(data, Tensor):\n data = data.asnumpy()\n elif isinstance(data, list):\n data = np.array(data)\n elif isinstance(data, np.ndarray):\n pass\n else:\n raise TypeError('Input data type must be tensor,...
[ "0.6909233", "0.6677645", "0.65852803", "0.6516039", "0.6478485", "0.64684", "0.64437616", "0.63853025", "0.6327636", "0.632323", "0.62723", "0.62629884", "0.61994326", "0.6190795", "0.61809444", "0.61559033", "0.61377347", "0.610936", "0.6108303", "0.6102446", "0.6083558", ...
0.598934
30
Compute the ROUGEN score of a peer with respect to one or more models, for a given value of `n`.
def rouge_n(peer, models, n, alpha=1): matches = 0 recall_total = 0 peer_counter = _ngram_counts(peer, n) for model in models: model_counter = _ngram_counts(model, n) matches += _counter_overlap(peer_counter, model_counter) recall_total += _ngram_count(model, n) precision_tot...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_score(self, n_episodes=5):\n\n # Score is computed via aggregate over multiple episodes\n score = 0\n\n for _ in range(n_episodes):\n score += play_episode(self.model, self.env)\n\n return score / n_episodes", "def compute_rouge_n(output, reference, n=1, mode='f...
[ "0.6221026", "0.61857086", "0.59200484", "0.5913296", "0.58413684", "0.58119303", "0.5691505", "0.56906444", "0.5665036", "0.5646627", "0.5615947", "0.5566597", "0.55650103", "0.55646986", "0.55566496", "0.5514124", "0.5488513", "0.5460889", "0.545565", "0.54523516", "0.54460...
0.7420437
0
Compute the ROUGE1 (unigram) score of a peer with respect to one or more models.
def rouge_1(peer, models, alpha=1): return rouge_n(peer, models, 1, alpha)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rouge_l(peer, models, alpha=1):\n matches = 0\n recall_total = 0\n for model in models:\n matches += lcs(model, peer)\n recall_total += len(model)\n precision_total = len(models) * len(peer)\n return _safe_f1(matches, recall_total, precision_total, alpha)", "def rouge_2(peer, mod...
[ "0.6404512", "0.6164474", "0.61226386", "0.57171863", "0.56591094", "0.56569135", "0.5644448", "0.5607102", "0.5510303", "0.5491259", "0.5481637", "0.547529", "0.54537225", "0.5388831", "0.52865225", "0.52846694", "0.52558506", "0.52415675", "0.52409685", "0.5237391", "0.5225...
0.69222933
0
Compute the ROUGE2 (bigram) score of a peer with respect to one or more models.
def rouge_2(peer, models, alpha=1): return rouge_n(peer, models, 2, alpha)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rouge_n(peer, models, n, alpha=1):\n matches = 0\n recall_total = 0\n peer_counter = _ngram_counts(peer, n)\n for model in models:\n model_counter = _ngram_counts(model, n)\n matches += _counter_overlap(peer_counter, model_counter)\n recall_total += _ngram_count(model, n)\n ...
[ "0.63647765", "0.6264367", "0.6048327", "0.56891185", "0.559623", "0.5595172", "0.55653435", "0.5532778", "0.5503071", "0.5493627", "0.54738057", "0.54648376", "0.5429727", "0.54142624", "0.5363083", "0.53563017", "0.53514856", "0.53496987", "0.5347989", "0.53299314", "0.5326...
0.68937504
0
Compute the ROUGE3 (trigram) score of a peer with respect to one or more models.
def rouge_3(peer, models, alpha=1): return rouge_n(peer, models, 3, alpha)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rouge_l(peer, models, alpha=1):\n matches = 0\n recall_total = 0\n for model in models:\n matches += lcs(model, peer)\n recall_total += len(model)\n precision_total = len(models) * len(peer)\n return _safe_f1(matches, recall_total, precision_total, alpha)", "def rouge_n(peer, mod...
[ "0.6201271", "0.59838575", "0.56443214", "0.563465", "0.5621777", "0.56136626", "0.5591619", "0.551658", "0.5460007", "0.5452518", "0.54252064", "0.5394155", "0.53527737", "0.5327824", "0.531235", "0.5268596", "0.5262611", "0.5215765", "0.5202057", "0.518789", "0.518238", "...
0.6721017
0
Compute the length of the longest common subsequence between two sequences.
def lcs(a, b): # This is an adaptation of the standard LCS dynamic programming algorithm # tweaked for lower memory consumption. # Sequence a is laid out along the rows, b along the columns. # Minimize number of columns to minimize required memory if len(a) < len(b): a, b = b, a # Sequen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def longestCommonSubsequence(self, text1: str, text2: str) -> int:\n if len(text1) == 0 or len(text2) == 0:\n return 0\n if text1[0] == text2[0]:\n return 1 + self.longestCommonSubsequence(text1[1:], text2[1:])\n else:\n return max(self.longestCommonSubsequence...
[ "0.80766463", "0.77502847", "0.7713622", "0.7646066", "0.7540484", "0.7536629", "0.72903633", "0.717842", "0.71512765", "0.7116953", "0.70604825", "0.6989596", "0.6979806", "0.6972248", "0.69665587", "0.6891922", "0.6855986", "0.68384045", "0.68181574", "0.6776346", "0.675722...
0.6458489
44
Compute the ROUGEL score of a peer with respect to one or more models.
def rouge_l(peer, models, alpha=1): matches = 0 recall_total = 0 for model in models: matches += lcs(model, peer) recall_total += len(model) precision_total = len(models) * len(peer) return _safe_f1(matches, recall_total, precision_total, alpha)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def score(self, params):\n\n if self.use_sqrt:\n return self.score_sqrt(params)\n else:\n return self.score_full(params)", "def score(self, model, probe):\n return scipy.spatial.distance.euclidean(model, probe)", "def rouge_1(peer, models, alpha=1):\n return rouge_n(pe...
[ "0.64376223", "0.61849993", "0.6173057", "0.6096087", "0.6008323", "0.5948405", "0.59441435", "0.5903325", "0.5891097", "0.5812651", "0.5770408", "0.5759025", "0.573958", "0.5702037", "0.5636004", "0.5603585", "0.55869937", "0.5549397", "0.5543058", "0.5512206", "0.5507263", ...
0.6972612
0
This function actually applies the translation table to the data.
def translate(table, data, compress=True): out=data point=START_CHR for conv in table: out=out.replace(*((conv, chr(point)) if compress else (chr(point), conv))) point+=1 return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def translate(self):\n self.clean_data()\n self.clean_symbols()\n self.translate_line_by_line()", "def apply_translation(self, translation_table, fromcolumn=None,\n tocolumn=None, clipvalue=65535.0 ):\n translation_table = np.asarray(translation_table)\n ...
[ "0.6654487", "0.6397048", "0.63600653", "0.63000005", "0.6274757", "0.6105659", "0.60185516", "0.6017183", "0.6017183", "0.5999535", "0.5927593", "0.5778712", "0.57606953", "0.5715766", "0.56984544", "0.5659792", "0.56475574", "0.5623773", "0.56182456", "0.5615333", "0.561191...
0.6044234
6
Runs the python code on the data (either preprocessing or postprocessing).
def process_python(data, code): x=data return eval(code)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self, data):\n\t\t# no processing here\n\t\treturn data", "def main():\n p = DataPreprocessor()\n p.preprocess_and_save_data(p.path_to_file)", "def run_data (arguments):\n if arguments.define_labels:\n data.define_labels()\n elif arguments.preprocess:\n # Preprocess from data_raw --> data...
[ "0.6739296", "0.66835475", "0.6407259", "0.6377818", "0.63762534", "0.6327601", "0.62914467", "0.62914467", "0.6246008", "0.62302923", "0.6209348", "0.61613804", "0.6066117", "0.60660374", "0.60589004", "0.6053382", "0.60187465", "0.60002595", "0.59653044", "0.59533066", "0.5...
0.6572977
2
Given a list of graphs in networkx format, write each of them in its own little gml file in a folder named name in the data_root folder. Create the folder, if necessary. This function is very hacky, parsing node labels on the go for datasets obtained from the Dortmund collection at
def write_graph_list(name, graph_list, data_root): data_path = os.path.join(data_root, name) if not os.path.exists(data_path): os.makedirs(data_path) # compute right number of trailing zeros for file names format_positions = ceil(log10(len(graph_list))) for i, g in enumerate(graph_list): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_layout(root_dir, subsets):\n _create_folder(os.path.join(root_dir, \"images\"))\n _create_folder(os.path.join(root_dir, \"labels\"))\n\n for subset in subsets:\n _create_folder(os.path.join(root_dir, \"images\", subset))\n _create_folder(os.path.join(root_dir, \"labels\", subset)...
[ "0.6296529", "0.6196926", "0.6115122", "0.60457796", "0.60432667", "0.6025473", "0.6017168", "0.6001553", "0.5972465", "0.5906791", "0.5901544", "0.585161", "0.58406854", "0.5752646", "0.5749147", "0.57461995", "0.5728297", "0.5697866", "0.5691245", "0.56871533", "0.5682423",...
0.77036434
0
Very very hacky. Works for BZR and DHFR to remove attributes and make labels compliant.
def dumpLabel(g): for v in g.nodes(): g.node[v]['label'] = getLabel(g.node[v]) if 'attribute' in g.node[v]: del g.node[v]['attribute'] for e in g.edges(): g.edge[e[0]][e[1]]['label'] = getLabel(g.edge[e[0]][e[1]]) if 'attribute' in g.edge[e[0]][e[1]]: del...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strip_useless_attributes(self):\n graph_dict = self.graph.graph\n if \"node\" in graph_dict and \"label\" in graph_dict[\"node\"]:\n graph_dict[\"node\"].pop(\"label\")\n if \"graph\" in graph_dict:\n graph_dict.pop(\"graph\")", "def remove_label(self, ):\n i...
[ "0.6855171", "0.67771274", "0.63467556", "0.63325405", "0.6005318", "0.5989882", "0.59445316", "0.59248656", "0.5919599", "0.59110916", "0.5872996", "0.5867377", "0.5824793", "0.5820824", "0.5725552", "0.57142097", "0.5713263", "0.565817", "0.5647423", "0.56366366", "0.562795...
0.5637095
19
print a main menu and the commands
def showInstructions(): print(""" RPG Game ======== Commands: go [direction] get [item] """)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printMenu():\n # tWelc = PrettyTable(['Welcome to the CLI-of the repository classifier'])\n print('Welcome to the CLI of the repository classifier')\n print(strStopper1)\n t = PrettyTable(['Action', ' Shortcut '])\n t.add_row(['Show Menu', '- m -'])\n t.add_row([' Predict repositori...
[ "0.85980755", "0.82323325", "0.8142767", "0.813813", "0.8126603", "0.81215715", "0.7886918", "0.78196526", "0.7761626", "0.772209", "0.7706884", "0.762542", "0.761819", "0.7607258", "0.7597612", "0.7591094", "0.75864893", "0.7538107", "0.751255", "0.7507642", "0.7492476", "...
0.65656286
66
fetches tweets and wraps them in Tweet objects
def get_tweets(self): now = datetime.datetime.now() tweet_json = self.api.get_tweets(self.last, now) self.last = now return [Tweet(x) for x in tweet_json]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tweets():\n clean_tweetdb.delay()\n db_tweets = Tweet.objects.all()\n max_id = min([tweet.tweet_id for tweet in db_tweets])\n tweets = api.search(\n q='#python',\n max_id=max_id,\n count=100\n )\n tweets_id = [tweet.id for tweet in tweets]\n tweets_date = [tweet.cr...
[ "0.76285994", "0.7314002", "0.72527397", "0.7232973", "0.7203812", "0.72006255", "0.71095735", "0.7069534", "0.70468444", "0.70431787", "0.70248395", "0.70181644", "0.70125926", "0.70005286", "0.69737434", "0.69352496", "0.6934322", "0.68964857", "0.688853", "0.68642783", "0....
0.73902327
1
constructor for Tweet class
def __init__(self, tweet_json): self.tweet = tweet_json self.date = datetime.datetime.strptime(self.tweet["date"], "%Y-%m-%dT%H:%M:%S.000Z") self.processed = False self.max_importance = 0 try: text = re.sub(self.tweet["keywords"][0], '', self.tweet["text"]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, id_: str, bio: str) -> None:\n\n # YOUR CODE HERE\n self.userid = id_\n self.bio = bio\n self.tweets = []", "def __init__(self):\n self.tweets = {}\n self.followees = {}\n self.timestamp = 0", "def __init__(self, tweet_data):\n _hashtag...
[ "0.73487216", "0.70724875", "0.7051352", "0.70227826", "0.69214594", "0.6850634", "0.6793486", "0.6756056", "0.6675334", "0.66327745", "0.66132927", "0.66100866", "0.65269214", "0.6500472", "0.6484132", "0.6462133", "0.64041936", "0.6386881", "0.6380593", "0.6349382", "0.6297...
0.6826531
6
get language of tweet according to polyglot
def get_language(self): return self.language
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_translated_tweet(tweet, language='it'):\n translated = GoogleTranslator(source='auto', target=language)\n return translated.translate(tweet)", "def get_language(self, text):\n try:\n post_lang = detect(text)\n except:\n post_lang = 'N/A'\n return post_lang...
[ "0.72462946", "0.7083339", "0.6802315", "0.6707334", "0.6658513", "0.66378605", "0.65683573", "0.6546926", "0.65229803", "0.65075666", "0.64140195", "0.6395052", "0.6386839", "0.63669634", "0.63650763", "0.6354169", "0.6340496", "0.63091576", "0.62775445", "0.6255256", "0.621...
0.6484868
10
updates max_importance value if importance is higher then max_importance
def update_importance(self, importance): if importance > self.max_importance: self.max_importance = importance
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_importance(self, importance):\r\n self.importance = importance\r\n for tweet in self.tweets:\r\n tweet.update_importance(importance)", "def change_max(self, level, value):\n if value < 0:\n raise AttributeError('max value should be greater than zero')\n i...
[ "0.6120561", "0.5990391", "0.56675154", "0.56649125", "0.5598316", "0.5463613", "0.5463613", "0.5452502", "0.541491", "0.5413382", "0.5384408", "0.5384408", "0.53646934", "0.53610283", "0.53610283", "0.53610283", "0.5323976", "0.53171647", "0.5316251", "0.5280184", "0.5269162...
0.86922395
0
constructor for the AbstractAPI
def __init__(self, region): self.region = region
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, base_api: BaseApi):\n super().__init__(base_api, self.__class__.__name__)", "def __init__(self):\n raise NotImplementedError", "def __init__(self):\n raise NotImplementedError", "def __init__(self):\n raise NotImplementedError", "def __init__(self):\n r...
[ "0.80145794", "0.78466344", "0.78466344", "0.78466344", "0.78466344", "0.78052104", "0.7794079", "0.77604795", "0.773415", "0.77304065", "0.7708006", "0.7698352", "0.762925", "0.76172245", "0.76172245", "0.7611515", "0.7587762", "0.75137764", "0.74682426", "0.7432127", "0.743...
0.0
-1
fetches tweets from start date till end date
def get_tweets(self, start_date, end_date): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tweets(self, start_date, end_date):\r\n # get tweets from api\r\n config = crawler.APIConfig()\r\n config.set_api_key(\"8e1618e9-419f-4239-a2ee-c0680740a500\")\r\n config.set_end_time(end_date)\r\n config.set_filter(self.region)\r\n config.set_start_time(start_date...
[ "0.7896825", "0.76824534", "0.7510762", "0.7041128", "0.6890227", "0.6792959", "0.6664002", "0.66307527", "0.65022916", "0.6492793", "0.64922196", "0.6477469", "0.6452656", "0.6447653", "0.6434829", "0.6408373", "0.6390277", "0.63862234", "0.6347076", "0.6342707", "0.6322864"...
0.8704661
0
fetches tweets from start date till end date
def get_tweets(self, start_date, end_date): # get tweets from api config = crawler.APIConfig() config.set_api_key("8e1618e9-419f-4239-a2ee-c0680740a500") config.set_end_time(end_date) config.set_filter(self.region) config.set_start_time(start_date) return c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tweets(self, start_date, end_date):\r\n pass", "def getTweets(self, query, start, end):\n gettweets = Twitter.GetTweets(self.rootpath, self.folderpath,\n start, end, query)\n gettweets.start_getTweets()", "def get_tweets_in_date_range(start, end...
[ "0.8704661", "0.76824534", "0.7510762", "0.7041128", "0.6890227", "0.6792959", "0.6664002", "0.66307527", "0.65022916", "0.6492793", "0.64922196", "0.6477469", "0.6452656", "0.6447653", "0.6434829", "0.6408373", "0.6390277", "0.63862234", "0.6347076", "0.6342707", "0.6322864"...
0.7896825
1
Get Seconds from time.
def get_sec(time_str): h, m, s = time_str.split(':') return int(h) * 3600 + int(m) * 60 + int(s)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_seconds(time):\n return 3600 * time", "def time_to_int(self):\n minutes = self.hour * 60 + self.minute\n seconds = minutes * 60 + self.second\n return seconds", "def time_to_int(time):\n minutes = time.hour * 60 + time.minute\n seconds = minutes * 60 + time.second\n retu...
[ "0.78827816", "0.7511598", "0.74796194", "0.73971415", "0.7275454", "0.7262169", "0.718104", "0.71555495", "0.7036447", "0.69965965", "0.6980901", "0.6879055", "0.6844431", "0.6838192", "0.6817343", "0.67910403", "0.67888385", "0.6770099", "0.67639846", "0.67639846", "0.67117...
0.70772296
9
Check the give word is palindrome.
def isPalindrome(word): input_str = IGNORE_NON_ALPHA_CHARACTER.sub("", str(word)).casefold() return input_str == input_str[::-1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def palindrome(word):\n reverse = word[::-1]\n return word == reverse", "def is_palindrome(word):\n if word == word[::-1]:\n return True\n else:\n return False", "def is_palindrome(word: str) -> bool:\n\n # Todo\n return False", "def check_palindrome():", "def string_palidro...
[ "0.89213616", "0.8837968", "0.8779761", "0.87497747", "0.86763763", "0.85616016", "0.83406484", "0.83270764", "0.8197752", "0.8196361", "0.8171091", "0.8113323", "0.8112018", "0.8089886", "0.80283785", "0.80139244", "0.79979086", "0.79918855", "0.7983047", "0.79630023", "0.79...
0.8555572
6