query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
I don't think we need utc/lv aren't all grib files one time? but it is here to enable compatibility with other get() APIs.
def get(self,vrbl,idx=0,utc=None,level=None,lons=None,lats=None): # TODO: look up level in available fields array, return index vrblkey = self.lookup_vrbl(vrbl) print("Variable {0} has key {1} in Grib data.".format(vrbl,vrblkey)) # gg = self.get_record(vrblkey,idx=idx) # idx look...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def svn_info_t_prop_time_get(svn_info_t_self): # real signature unknown; restored from __doc__\n pass", "def get(self, filename, from_time, to_time):\n raise NotImplementedError()", "def get():", "def get():", "def _get_time_info(self, keys: list[str]):\n if self.is_info_v2:\n i...
[ "0.552266", "0.53847766", "0.5327144", "0.5327144", "0.5288795", "0.5284251", "0.51308817", "0.5111512", "0.5103746", "0.5102246", "0.50884247", "0.5059077", "0.50417954", "0.50307804", "0.4973795", "0.4973238", "0.49729574", "0.49729574", "0.4964048", "0.49491337", "0.494704...
0.55045795
1
Look for record entries based on a keyword.
def search_keyword(self,keyword): for entry in self.available_fields_list: for x in entry: if keyword in x: print(entry) break return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def searchRecords(self, filterChoice, keyword):\r\n session = wx.GetApp().session\r\n model = getattr(db, self.modelName)\r\n\r\n result = None\r\n if filterChoice == \"Person\":\r\n qry = session.query(model)\r\n logging.debug(qry)\r\n result = qry.filt...
[ "0.6326545", "0.6215973", "0.6141149", "0.60207176", "0.59056956", "0.58672076", "0.58531576", "0.58378905", "0.58213276", "0.5780427", "0.57540876", "0.57399154", "0.571995", "0.5706627", "0.5669257", "0.5653376", "0.5625087", "0.5598351", "0.559667", "0.55940646", "0.556526...
0.7411851
0
Perform the BLASTing of the proteins in an input file (inputFile) against those in another file (databaseFile). Returns a dictionary of the similarities between proteins, as determined by BLAST. The dictionary is indexed by a alphanumerically ordered tuple (index[0] < index[1]), and the entry for each index is a dictio...
def main(inputFile, databaseFile, blastOperationID, SEG=False, cores=2, minAlignLength=20, maxEValue=1.0, verboseOutput=False): # Get the location of the BLAST executables. srcLocation = os.path.abspath(__file__) srcLocation = '\\'.join(srcLocation.split('\\')[:-1]) BLASTExecutables = srcLocation +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addBlastFilesToStream(fileMap,fragIndex,inputFragment):\n # TODO: return False if output files are missing completely\n\n # get list of reads from input fragment\n records={}\n fastaRecordRE=fileTypeMap['fasta'].sepRE\n with open(inputFragment,'rt') as f:\n for line in f:\n m=f...
[ "0.57911015", "0.57641923", "0.5724841", "0.56280184", "0.55734056", "0.5516204", "0.5510528", "0.54538035", "0.5439656", "0.5411389", "0.5381811", "0.5352944", "0.534707", "0.534198", "0.52927357", "0.5241423", "0.5195701", "0.5192132", "0.5173747", "0.5169282", "0.51647925"...
0.5815675
0
Returns a path to a fixture via the given fname and label
def fixture(fname, label="reference"): return os.path.join(FIXTURES, label, fname)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fixture_file(*path):\n return os.path.join(os.path.dirname(__file__), 'fixtures', *path)", "def get_test_fname(fname):\n path = get_test_path()\n full_path = os.path.join(path, fname)\n return full_path", "def get_filename(label):\n return op.splitext(op.splitext(op.basename(label))[0])[0]",...
[ "0.6520794", "0.6382769", "0.63656783", "0.6110005", "0.5983235", "0.5950241", "0.5911903", "0.59048057", "0.59048057", "0.59048057", "0.5869462", "0.5829332", "0.5817864", "0.58178484", "0.58095974", "0.5808435", "0.57983226", "0.57849145", "0.5742818", "0.5695899", "0.56913...
0.8895459
0
Creates a meta_data instance for the model at the time point (appointment) for the given registered_subject. might return None and meta data not created based on visit reason (e.g. missed).
def create_meta_data(self): if self.visit_instance.reason not in self.skip_create_visit_reasons: try: entry = self.entry_model.objects.get( app_label=self.model._meta.app_label.lower(), model_name=self.model._meta.object_name.lower(), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def informed_consent_on_post_save(sender, instance, raw, created, **kwargs):\n if not raw:\n if created:\n pass\n # instance.registration_update_or_create()\n # update_model_fields(instance=instance,\n # model_cls=['subject_identifier', inst...
[ "0.5472681", "0.52024764", "0.512791", "0.48788267", "0.48686114", "0.48406184", "0.47583947", "0.4736606", "0.47161746", "0.47055674", "0.46937343", "0.46804252", "0.46649593", "0.46285155", "0.4618309", "0.45941997", "0.4592607", "0.45912987", "0.45581073", "0.45331988", "0...
0.772739
0
Delete an organization Schedules an organization for deletion. {method} {path}
def delete(self, request, organization): if organization.is_default: return Response({'detail': ERR_DEFAULT_ORG}, status=400) logging.getLogger('sentry.deletions').info( 'Organization %s (id=%s) removal requested by user (id=%s)', organization.slug, organization.id, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_organization(self):\n pass", "def delete(self, organization_id):\n if organization_id is not None:\n # fetch org to delete\n try:\n org = Organization.query.filter_by(id=organization_id).first()\n # return 404 if org does not exist...
[ "0.70051813", "0.6944466", "0.67821133", "0.65625185", "0.6549952", "0.6258782", "0.6244123", "0.6154723", "0.6129886", "0.6023895", "0.59733737", "0.59061176", "0.58606285", "0.58501047", "0.58364564", "0.58216476", "0.56640875", "0.56540847", "0.5620168", "0.5593044", "0.55...
0.7104207
0
Test wether or not `path` is absolute url.
def is_absolute_url(path): return path.startswith("http")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_absolute_path(path: str) -> bool:\n # This is a rather weak test, may be enhanced if desired\n return \"//\" in path \\\n or \":\" in path \\\n or path.startswith(\"/\")", "def isabs(path):\n # If detected as storage path, it is an absolute path.\n return True", "def is_a...
[ "0.85445476", "0.8208567", "0.73892355", "0.736103", "0.72351986", "0.68886465", "0.6864662", "0.6810893", "0.67265016", "0.6722769", "0.6581062", "0.6573491", "0.65669185", "0.6557852", "0.6554364", "0.65135294", "0.6481539", "0.64398235", "0.64357907", "0.64325374", "0.6398...
0.8398912
1
Return version number applicable to the run_id. Most plugins just have a single version (in .__version__) but some may be at different versions for different runs (e.g. timedependent corrections).
def version(self, run_id=None): return self.__version__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def version_id(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"version_id\")", "def get_version(self):\r\n\r\n return self.versions[0].number", "def plugin_version(self):\n return self.__plugin_version", "def get_version(self):\n return self.cur_config['version'...
[ "0.6729067", "0.6524676", "0.64457977", "0.64410496", "0.6421774", "0.638525", "0.6285096", "0.6263206", "0.6241869", "0.62201875", "0.62045753", "0.61937886", "0.6150016", "0.61450565", "0.61103964", "0.6099586", "0.6094055", "0.6089521", "0.60501593", "0.6048226", "0.604449...
0.8039038
1
Return whether the chunk chunk_i is ready for reading. Returns True by default; override if you make an online input plugin.
def is_ready(self, chunk_i): return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isComplete(self):\n return self.bytesToRead == 0", "def readable(self):\n self._check_not_closed()\n return False", "def readable(self):\n return self.interface.in_waiting", "def wantsReadEvent(self):\r\n if self.result != None:\r\n return self.result == 0\r\...
[ "0.69202155", "0.66135347", "0.64482975", "0.6399048", "0.6347218", "0.63396084", "0.6247333", "0.6240271", "0.6226292", "0.6206879", "0.61784005", "0.61481017", "0.6137742", "0.6130014", "0.6119764", "0.6119764", "0.6114823", "0.61147493", "0.61111355", "0.61077726", "0.6064...
0.8069259
0
returns number of 'instagram' stickers needed to make a phrase
def stickers_for(phrase): stic_dict = {} for ltr in 'instagram': if ltr not in stic_dict: stic_dict[ltr] = 1 else: stic_dict[ltr] += 1 print(ltr) phr_dict = {} for ltr in phrase: if ltr not in phr_dict: phr_dict[ltr] = 1 else:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count(text):\n return len(text)", "def total_phrases(target_text):\n\n nbphrase = 0\n separators = '.!?;'\n for char in target_text:\n if char in separators:\n nbphrase = nbphrase + 1\n return nbphrase", "def loop_through_text(phrase_length):\n\n # get text\n tanach =...
[ "0.6402699", "0.62502104", "0.62345266", "0.61822414", "0.6158409", "0.61361337", "0.6079605", "0.6060118", "0.6012842", "0.6003197", "0.59709525", "0.5940616", "0.58799154", "0.5834511", "0.5813628", "0.5810768", "0.5804959", "0.5762326", "0.57615393", "0.57399106", "0.57376...
0.7720326
0
Loads config from the given paths. A handful of seed values will be set to act as if specified in the loaded config file's DEFAULT section, and be available for use in substitutions. The caller may override some of these seed values.
def load(cls, configpaths, seed_values=None): if not configpaths: return _EmptyConfig() single_file_configs = [] for configpath in configpaths: parser = cls._create_parser(seed_values) with open(configpath, 'r') as ini: parser.readfp(ini) single_file_configs.append(_SingleFi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(paths):\n if not paths:\n raise ConfigException(message='No configuration file specified',\n reason=paths)\n yaml_dict = {}\n if type(paths) == str:\n paths = [paths]\n # for every filename in list...\n for path in paths:\n # read config fil...
[ "0.7207116", "0.6690684", "0.6671056", "0.6507221", "0.62847865", "0.61621714", "0.6146892", "0.6069338", "0.6026834", "0.60224783", "0.59600526", "0.5925976", "0.5920861", "0.58888274", "0.58582234", "0.58458626", "0.58401996", "0.5825556", "0.582437", "0.58228505", "0.58212...
0.7786894
0
Creates a config parser that supports %([keyname])s value substitution. A handful of seed values will be set to act as if specified in the loaded config file's DEFAULT section, and be available for use in substitutions. The caller may override some of these seed values.
def _create_parser(cls, seed_values=None): seed_values = seed_values or {} buildroot = seed_values.get('buildroot', get_buildroot()) all_seed_values = { 'buildroot': buildroot, 'homedir': os.path.expanduser('~'), 'user': getpass.getuser(), 'pants_bootstrapdir': get_pants_cachedir(),...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _new():\n\treturn ConfigParser(\n\tdelimiters = ('=',),\n\tcomment_prefixes = ('#', ';'),\n\tdefault_section = 'default',\n\tallow_no_value = False,\n\tstrict = False,\n\tinterpolation = ExtendedInterpolation(),\n\tdefaults = {\n\t\t'debug': False,\n\t\t'datadir': path.join(path.expanduser('~'), '.local', 'ros...
[ "0.5458247", "0.5408141", "0.5199554", "0.50978345", "0.5079219", "0.4990985", "0.497882", "0.49530998", "0.49407214", "0.49386162", "0.49364063", "0.49315286", "0.4930387", "0.49081331", "0.4890862", "0.48780882", "0.4861418", "0.48542067", "0.48509136", "0.48480615", "0.483...
0.5753604
0
Retrieves option from the specified section (or 'DEFAULT') and attempts to parse it as type. If the specified section does not exist or is missing a definition for the option, the value is looked up in the DEFAULT section. If there is still no definition found, the default value supplied is returned.
def get(self, section, option, type_=six.string_types, default=None): return self._getinstance(section, option, type_, default)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, section, option, default=None, **kwargs):\n section = section.lower()\n option = option.lower()\n if self.has_section(section) and self.has_option(section, option):\n # Super does not work for ConfigParser as not inherited from object\n out = configparser.Co...
[ "0.73788524", "0.7365858", "0.7304894", "0.7237488", "0.71810937", "0.6949195", "0.6876211", "0.686278", "0.6829772", "0.67827827", "0.67400485", "0.6720243", "0.6594856", "0.6542349", "0.65182227", "0.64763665", "0.6465788", "0.64603096", "0.64568794", "0.64402354", "0.64163...
0.7418041
0
Returns the path to the source file the given option was defined in.
def get_source_for_option(self, section, option): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def source_file_path(self) -> str:\n return self._source_file_path", "def _get_source_path(self, docmeta: DocMetadata) -> Optional[str]:\n identifier = docmeta.arxiv_identifier\n version = docmeta.version\n file_noex = identifier.filename\n if not docmeta.is_latest:\n ...
[ "0.70683277", "0.6915933", "0.68622655", "0.6847837", "0.66117984", "0.6302336", "0.6269676", "0.6259663", "0.6240513", "0.6234616", "0.6230491", "0.6221738", "0.62008744", "0.6191012", "0.6189371", "0.61713874", "0.6149972", "0.61361355", "0.6125448", "0.60671276", "0.604563...
0.74370855
0
Tests the ability to submit machine flags
def test_machine_flags(mock_htb_client: HTBClient): # Create a fake machine to test with machine = Machine({ "id": 1, "name": "Lame", "os": "Linux", "points": 0, "release": "2021-02-27T17:00:00.000000Z", "user_owns_count": 0, "root_owns_count": 0, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_checkFlags(self):\n self.failUnlessEqual(self.nice.opts['aflag'], 1)\n self.failUnlessEqual(self.nice.opts['flout'], 0)", "def test_handle_flag_error(self):\n pass", "def test_fortress_flags(mock_htb_client: HTBClient):\n # Create a fake fortress to test with\n fortress = Fo...
[ "0.6605318", "0.65299326", "0.64944285", "0.64357823", "0.6367936", "0.62655514", "0.6254911", "0.62415195", "0.60922045", "0.6091679", "0.60882485", "0.60709053", "0.6067145", "0.60066473", "0.5954045", "0.59530026", "0.5952983", "0.59263897", "0.59212893", "0.5817619", "0.5...
0.79896796
0
Tests the ability to submit challenge flags
def test_challenge_flags(mock_htb_client: HTBClient): # Create a fake challenge to test with challenge = Challenge({ "id": 1, "name": "Crack This", "retired": True, "points": 0, "difficulty_chart": "0", "release_date": "2018-04-25", "solves": 0, "a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_fortress_flags(mock_htb_client: HTBClient):\n # Create a fake fortress to test with\n fortress = Fortress({\n \"id\": 1,\n \"name\": \"Jet\",\n \"ip\": \"10.13.37.10\",\n \"image\": \"https://www.hackthebox.eu/storage/companies/3.png\",\n \"number_of_flags\": 11\n ...
[ "0.7046961", "0.6523449", "0.6378727", "0.615151", "0.59990907", "0.5966798", "0.59481794", "0.594684", "0.5943263", "0.5833452", "0.58245754", "0.5815917", "0.5809349", "0.5805617", "0.5789382", "0.57777566", "0.5737647", "0.5709123", "0.5697028", "0.56850445", "0.5678845", ...
0.82451797
0
Tests the ability to submit endgame flags
def test_endgame_flags(mock_htb_client: HTBClient): # Create a fake endgame to test with endgame = Endgame({ "id": 1, "name": "P.O.O.", "avatar_url": "nothing.png", "cover_image_url": "nothing.png", "retired": True, "vip": True, "creators": [{ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_challenge_flags(mock_htb_client: HTBClient):\n # Create a fake challenge to test with\n challenge = Challenge({\n \"id\": 1,\n \"name\": \"Crack This\",\n \"retired\": True,\n \"points\": 0,\n \"difficulty_chart\": \"0\",\n \"release_date\": \"2018-04-25\",\...
[ "0.6466769", "0.63374233", "0.62643325", "0.61247206", "0.61133975", "0.61104405", "0.609314", "0.60709924", "0.59978354", "0.58942944", "0.5889562", "0.5853111", "0.58342797", "0.5833326", "0.58182824", "0.5808839", "0.580797", "0.5788669", "0.5773043", "0.57706904", "0.5754...
0.77757776
0
Tests the ability to submit fortress flags
def test_fortress_flags(mock_htb_client: HTBClient): # Create a fake fortress to test with fortress = Fortress({ "id": 1, "name": "Jet", "ip": "10.13.37.10", "image": "https://www.hackthebox.eu/storage/companies/3.png", "number_of_flags": 11 }, mock_htb_client, summar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_checkFlags(self):\n self.failUnlessEqual(self.nice.opts['aflag'], 1)\n self.failUnlessEqual(self.nice.opts['flout'], 0)", "def test_flags(self):\n self.check_search(\n dict(flag_contact=u'yes'),\n [u'Tackle', u'DoubleSlap', u'Ice Punch', u'Bite', u'Fly'],\n ...
[ "0.6779397", "0.6575178", "0.64314836", "0.6311009", "0.620359", "0.61329275", "0.6104035", "0.6099779", "0.6085823", "0.6070564", "0.60327524", "0.60288745", "0.60206354", "0.59562874", "0.5912869", "0.5899586", "0.5886937", "0.5829158", "0.57350963", "0.57208604", "0.571990...
0.77798915
0
Assert the user cannot retrieve a thumbnail.
def assert_user_cannot_retrieve_thumbnail(self, user, thumbnail): jwt_token = UserAccessTokenFactory(user=user) response = self.client.get( self._get_url(thumbnail.video, thumbnail), HTTP_AUTHORIZATION=f"Bearer {jwt_token}", ) self.assertEqual(response.status_co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_api_thumbnail_retrieve_by_random_user(self):\n user = UserFactory()\n\n self.assert_user_cannot_retrieve_thumbnail(user, self.some_thumbnail)", "def assert_user_can_retrieve_thumbnail(self, user, thumbnail):\n jwt_token = UserAccessTokenFactory(user=user)\n\n response = self....
[ "0.7858373", "0.6750369", "0.67265964", "0.66662884", "0.6562147", "0.65335554", "0.6521999", "0.6404572", "0.63752455", "0.63744694", "0.6354989", "0.6335756", "0.6335132", "0.63183075", "0.6306187", "0.62036556", "0.6201066", "0.6169549", "0.6157951", "0.61430115", "0.60936...
0.8417783
0
Assert the user can retrieve a thumbnail.
def assert_user_can_retrieve_thumbnail(self, user, thumbnail): jwt_token = UserAccessTokenFactory(user=user) response = self.client.get( self._get_url(thumbnail.video, thumbnail), HTTP_AUTHORIZATION=f"Bearer {jwt_token}", ) self.assertEqual(response.status_code,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_api_thumbnail_retrieve_by_random_user(self):\n user = UserFactory()\n\n self.assert_user_cannot_retrieve_thumbnail(user, self.some_thumbnail)", "def assert_user_cannot_retrieve_thumbnail(self, user, thumbnail):\n jwt_token = UserAccessTokenFactory(user=user)\n\n response = se...
[ "0.7861407", "0.76095414", "0.75132185", "0.71113604", "0.70641714", "0.68966985", "0.68929076", "0.6885267", "0.68603885", "0.6830988", "0.6725639", "0.67165977", "0.66617674", "0.66551024", "0.661036", "0.6549719", "0.65310204", "0.6513257", "0.6444996", "0.6356796", "0.634...
0.79718024
0
Anonymous users should not be allowed to retrieve a thumbnail.
def test_api_thumbnail_read_detail_anonymous(self): video = VideoFactory() thumbnail = ThumbnailFactory(video=video) response = self.client.get(self._get_url(video, thumbnail)) self.assertEqual(response.status_code, 401) content = json.loads(response.content) self.assertE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_home_as_anonymous(self):\n response = self.client.get(\"/images/contents/\")\n self.assertEqual(response.status_code, 401)", "def test_home_as_anonymous(self):\n response = self.client.get(\"/images/contents/\")\n self.assertEqual(response.status_code, 401)", "def assert_us...
[ "0.68530566", "0.68530566", "0.67204446", "0.6701233", "0.63773066", "0.6366298", "0.6249894", "0.624031", "0.6135416", "0.6123689", "0.6103045", "0.6043306", "0.5995901", "0.59817123", "0.59473157", "0.58821845", "0.5838749", "0.58223754", "0.57953495", "0.5790194", "0.57737...
0.7287502
0
Authenticated user without access cannot retrieve a thumbnail.
def test_api_thumbnail_retrieve_by_random_user(self): user = UserFactory() self.assert_user_cannot_retrieve_thumbnail(user, self.some_thumbnail)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert_user_cannot_retrieve_thumbnail(self, user, thumbnail):\n jwt_token = UserAccessTokenFactory(user=user)\n\n response = self.client.get(\n self._get_url(thumbnail.video, thumbnail),\n HTTP_AUTHORIZATION=f\"Bearer {jwt_token}\",\n )\n\n self.assertEqual(res...
[ "0.75183046", "0.70896447", "0.6801665", "0.6583585", "0.6538382", "0.6501151", "0.6361877", "0.6343528", "0.633494", "0.6316429", "0.63046277", "0.6302587", "0.61078155", "0.6107007", "0.6094753", "0.6094753", "0.6067809", "0.60633063", "0.60210025", "0.6020656", "0.60054046...
0.71911126
1
Organization students cannot retrieve a thumbnail.
def test_api_thumbnail_retrieve_by_organization_student(self): organization_access = OrganizationAccessFactory( organization=self.some_organization, role=STUDENT, ) self.assert_user_cannot_retrieve_thumbnail( organization_access.user, self.some_thumbnail ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert_user_cannot_retrieve_thumbnail(self, user, thumbnail):\n jwt_token = UserAccessTokenFactory(user=user)\n\n response = self.client.get(\n self._get_url(thumbnail.video, thumbnail),\n HTTP_AUTHORIZATION=f\"Bearer {jwt_token}\",\n )\n\n self.assertEqual(res...
[ "0.6759956", "0.6608878", "0.6606777", "0.65997195", "0.63853014", "0.6371965", "0.62514627", "0.61948556", "0.61474854", "0.6042091", "0.60399956", "0.59651506", "0.58786523", "0.5877402", "0.5835692", "0.58111465", "0.5799567", "0.5793276", "0.5775071", "0.5764711", "0.5759...
0.73315066
0
Organization instructors cannot retrieve a thumbnail.
def test_api_thumbnail_retrieve_by_organization_instructor(self): organization_access = OrganizationAccessFactory( organization=self.some_organization, role=INSTRUCTOR, ) self.assert_user_cannot_retrieve_thumbnail( organization_access.user, self.some_thumbnai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_api_thumbnail_retrieve_by_organization_student(self):\n organization_access = OrganizationAccessFactory(\n organization=self.some_organization,\n role=STUDENT,\n )\n\n self.assert_user_cannot_retrieve_thumbnail(\n organization_access.user, self.some_th...
[ "0.6952235", "0.6369274", "0.6285176", "0.6232424", "0.6225232", "0.61745995", "0.6172444", "0.61498815", "0.6121853", "0.6116987", "0.594136", "0.58232135", "0.5762892", "0.57019526", "0.56708616", "0.5668787", "0.5641343", "0.5612725", "0.5612397", "0.5575803", "0.5553606",...
0.75101215
0
Organization administrators can retrieve a thumbnail.
def test_api_thumbnail_retrieve_by_organization_administrator(self): organization_access = OrganizationAccessFactory( organization=self.some_organization, role=ADMINISTRATOR, ) self.assert_user_can_retrieve_thumbnail( organization_access.user, self.some_thumb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_thumbnail_url():", "def test_api_thumbnail_retrieve_by_playlist_admin(self):\n playlist_access = PlaylistAccessFactory(\n playlist=self.some_video.playlist,\n role=ADMINISTRATOR,\n )\n\n self.assert_user_can_retrieve_thumbnail(\n playlist_access.user,...
[ "0.69568473", "0.6949048", "0.69144523", "0.6782628", "0.67104197", "0.66854703", "0.65969235", "0.6590126", "0.6586846", "0.6573921", "0.65533423", "0.64994305", "0.6378205", "0.636926", "0.6366648", "0.6348245", "0.62879926", "0.6287473", "0.62491494", "0.62364477", "0.6232...
0.71771973
0
Consumer site roles cannot retrieve a thumbnail.
def test_api_thumbnail_retrieve_by_consumer_site_any_role(self): consumer_site_access = ConsumerSiteAccessFactory( consumer_site=self.some_video.playlist.consumer_site, ) self.assert_user_cannot_retrieve_thumbnail( consumer_site_access.user, self.some_thumbnail )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert_user_cannot_retrieve_thumbnail(self, user, thumbnail):\n jwt_token = UserAccessTokenFactory(user=user)\n\n response = self.client.get(\n self._get_url(thumbnail.video, thumbnail),\n HTTP_AUTHORIZATION=f\"Bearer {jwt_token}\",\n )\n\n self.assertEqual(res...
[ "0.68565124", "0.6401451", "0.62354344", "0.6173921", "0.6166922", "0.6150965", "0.6077196", "0.60095006", "0.59961003", "0.5961394", "0.59391886", "0.5873697", "0.5857408", "0.56985843", "0.5674253", "0.56423765", "0.56163293", "0.55962807", "0.55887306", "0.5585544", "0.558...
0.75406796
0
Playlist student cannot retrieve a thumbnail.
def test_api_thumbnail_retrieve_by_playlist_student(self): playlist_access = PlaylistAccessFactory( playlist=self.some_video.playlist, role=STUDENT, ) self.assert_user_cannot_retrieve_thumbnail( playlist_access.user, self.some_thumbnail )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_thumbnail(self):\r\n raise Exception('get_thumbnail is Not Implemented in base class \"Video\"')", "def test_api_thumbnail_read_detail_student(self):\n video = VideoFactory()\n thumbnail = ThumbnailFactory(video=video)\n\n jwt_token = StudentLtiTokenFactory(playlist=video.play...
[ "0.72964805", "0.7294963", "0.7204757", "0.66731846", "0.661595", "0.6610957", "0.65946805", "0.6585006", "0.6512752", "0.6450439", "0.63490075", "0.63181674", "0.6197807", "0.6148186", "0.61198866", "0.6115284", "0.609608", "0.6090407", "0.60756737", "0.60405296", "0.6007919...
0.76357526
0
Playlist administrator can retrieve a thumbnail.
def test_api_thumbnail_retrieve_by_playlist_admin(self): playlist_access = PlaylistAccessFactory( playlist=self.some_video.playlist, role=ADMINISTRATOR, ) self.assert_user_can_retrieve_thumbnail( playlist_access.user, self.some_thumbnail )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_thumbnail(self):\r\n raise Exception('get_thumbnail is Not Implemented in base class \"Video\"')", "def test_api_thumbnail_retrieve_by_playlist_instructor(self):\n playlist_access = PlaylistAccessFactory(\n playlist=self.some_video.playlist,\n role=INSTRUCTOR,\n ...
[ "0.7072114", "0.7043516", "0.7031702", "0.70205593", "0.68750274", "0.6830887", "0.67835605", "0.67505544", "0.669611", "0.66419655", "0.66401845", "0.66229904", "0.6611108", "0.66012394", "0.6589992", "0.65843177", "0.6499029", "0.6455152", "0.6356071", "0.63520384", "0.6281...
0.7956929
0
Instructor should not be able to read thumbnails in a read_only mode.
def test_api_thumbnail_instructor_read_detail_in_read_only(self): thumbnail = ThumbnailFactory() jwt_token = InstructorOrAdminLtiTokenFactory( playlist=thumbnail.video.playlist, permissions__can_update=False, ) response = self.client.get( self._get_u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_api_thumbnail_administrator_read_detail_in_read_only(self):\n thumbnail = ThumbnailFactory()\n\n jwt_token = InstructorOrAdminLtiTokenFactory(\n playlist=thumbnail.video.playlist,\n permissions__can_update=False,\n )\n\n response = self.client.get(\n ...
[ "0.7128775", "0.6064049", "0.5956134", "0.59525853", "0.5946476", "0.5924403", "0.5898635", "0.58588713", "0.5841984", "0.5751428", "0.5735692", "0.57163644", "0.5715092", "0.5666382", "0.56368256", "0.56359357", "0.5584379", "0.55173814", "0.55173814", "0.54943883", "0.54872...
0.6774711
1
Admin should not be able to read thumbnails in a read_only mode.
def test_api_thumbnail_administrator_read_detail_in_read_only(self): thumbnail = ThumbnailFactory() jwt_token = InstructorOrAdminLtiTokenFactory( playlist=thumbnail.video.playlist, permissions__can_update=False, ) response = self.client.get( self._ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_api_thumbnail_instructor_read_detail_in_read_only(self):\n thumbnail = ThumbnailFactory()\n\n jwt_token = InstructorOrAdminLtiTokenFactory(\n playlist=thumbnail.video.playlist,\n permissions__can_update=False,\n )\n\n response = self.client.get(\n ...
[ "0.661828", "0.6382733", "0.6356342", "0.6159073", "0.6037804", "0.6037804", "0.5990374", "0.59651357", "0.59140724", "0.5866006", "0.58399206", "0.5734935", "0.5719596", "0.5685072", "0.5679178", "0.56767166", "0.5566921", "0.5552464", "0.5542619", "0.55314493", "0.55218256"...
0.71898
0
Admin should be able to read details of thumbnail associated to their video.
def test_api_thumbnail_read_detail_admin_user(self): video = VideoFactory( uploaded_on=datetime(2018, 8, 8, tzinfo=timezone.utc), upload_state="ready" ) thumbnail = ThumbnailFactory(video=video, upload_state="pending") jwt_token = InstructorOrAdminLtiTokenFactory( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_thumbnail(self):\r\n raise Exception('get_thumbnail is Not Implemented in base class \"Video\"')", "def get_thumbnail_url(self):\n if self.thumbnail_url:\n return self.thumbnail_url\n \n if not self.get_video_id() or not self.get_username():\n return ''\n \n ...
[ "0.7471359", "0.68928635", "0.68879104", "0.68605113", "0.683838", "0.679808", "0.6788042", "0.6787663", "0.67236894", "0.67226833", "0.66978943", "0.66908675", "0.66846454", "0.6566404", "0.6513157", "0.64605933", "0.64442825", "0.64260656", "0.6422254", "0.641737", "0.64100...
0.7063691
1
Trying to retrieve a thumbnail using an other video in the url should return a 404.
def test_api_thumbnail_retrieve_from_another_video(self): thumbnail = ThumbnailFactory() other_video = VideoFactory(playlist=thumbnail.video.playlist) jwt_token = InstructorOrAdminLtiTokenFactory(playlist=thumbnail.video.playlist) response = self.client.get( self._get_url(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_url(self, video, thumbnail):\n return f\"/api/videos/{video.pk}/thumbnails/{thumbnail.id}/\"", "def test_video_thumbnail(self):\n data = TestData().load_users().load_galleries()\n album = data.gallery_b7w.top_album\n\n video1 = Video.objects.create(album=album, uid='56433514'...
[ "0.7110042", "0.7059349", "0.70160884", "0.6730062", "0.666879", "0.6634168", "0.6619411", "0.6557481", "0.6487372", "0.6479977", "0.6477736", "0.6452395", "0.644955", "0.63289744", "0.6300859", "0.62483877", "0.6219747", "0.6173391", "0.6165181", "0.61574286", "0.6088163", ...
0.78344685
0
Check if the line has already an active route
def pre_save_route(sender, **kwargs): instance = kwargs.get('instance') if instance.is_active and RouteModel.objects.filter(line_id=instance.line_id, is_active=True)\ .exclude(id=instance.id or -1).exists(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def visited(self, route=[], connection=None):\r\n\r\n visited_airports = [self.flights[flight].source for flight in route]\r\n\r\n if self.flights[connection].source in visited_airports:\r\n # find index of connection source in visited airports on route\r\n segment_start = visit...
[ "0.65387857", "0.6377769", "0.6372641", "0.6372641", "0.6365585", "0.62267476", "0.6223022", "0.6218845", "0.619473", "0.6103653", "0.6094104", "0.6076136", "0.6058769", "0.60385406", "0.599384", "0.5954393", "0.59505534", "0.58803916", "0.5868137", "0.5857777", "0.5817007", ...
0.6748292
0
Plot an arrow or arrows based on 2D state (x, y, yaw) All optional settings of matplotlib.pyplot.arrow can be used.
def plot_arrow(x, y, yaw, arrow_length=1.0, origin_point_plot_style="xr", head_width=0.1, fc="r", ec="k", **kwargs): if not isinstance(x, float): for (i_x, i_y, i_yaw) in zip(x, y, yaw): plot_arrow(i_x, i_y, i_yaw, head_width=head_width, fc=fc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _plot(self, **kwargs):\n XY = self.positions\n plt.plot(XY[0,:], XY[1,:], 'o')\n plt.gca().set_aspect('equal')\n SS = np.abs(self.S)\n SS /= SS.max()\n\n for i in range(self.N):\n for j in range(self.N):\n if i == j or SS[i,j] < 1e-2:\n ...
[ "0.6329709", "0.6254767", "0.6178017", "0.5998989", "0.5936659", "0.59270495", "0.5884406", "0.58207273", "0.5796814", "0.57445866", "0.5731595", "0.5682117", "0.56536233", "0.5604874", "0.5574216", "0.5567082", "0.54870504", "0.5486324", "0.54488695", "0.54224336", "0.542128...
0.73107964
0
Detects harris corners. Make sure the returned coordinates are x major!!!
def harris_corner_detector(im): Ix = derivative(im, axis=0) Iy = derivative(im, axis=1) Ixy = sol4_utils.blur_spatial(Ix * Iy, BLUR_KERNEL_SIZE) Ixx = sol4_utils.blur_spatial(Ix * Ix, BLUR_KERNEL_SIZE) Iyy = sol4_utils.blur_spatial(Iy * Iy, BLUR_KERNEL_SIZE) det = Ixx * Iyy - Ixy*Ixy trace...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def harris_corner_detector(im):\n\n conv_vec = np.array([[1, 0, -1]])\n\n x_der = convolve(im, conv_vec)\n y_der = convolve(im, conv_vec.transpose())\n\n x_der_2 = sol4_utils.blur_spatial(x_der * x_der, 3)\n\n y_der_2 = sol4_utils.blur_spatial(y_der*y_der, 3)\n x_y_der = sol4_utils.blur_spatial(x...
[ "0.7338353", "0.7133686", "0.7005946", "0.6849036", "0.6735868", "0.66729707", "0.66553104", "0.6582876", "0.6573205", "0.6538724", "0.6484621", "0.6438694", "0.63991416", "0.636579", "0.63362527", "0.6308946", "0.62801975", "0.62695485", "0.62327456", "0.6218055", "0.6199252...
0.7379283
0
Detects and extracts feature points from a pyramid.
def find_features(pyr): feature_pnts = spread_out_corners(pyr[0], SPREAD_N, SPREAD_M ,SPREAD_CORNERS_RADIUS) descriptors = sample_descriptor(pyr[2], feature_pnts, SAMPLE_RAD) return feature_pnts, descriptors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_features(pyr):\n\n feature_lst = spread_out_corners(pyr[0], 3, 3, 3)\n descriptors = sample_descriptor(pyr[2],feature_lst/4,3)\n return [feature_lst,descriptors]", "def find_features(pyr):\n descriptor_radius = DESC_RAD\n patch_amount = PATCH_AM\n min_distance_from_edge = DIST_FROM_EDG...
[ "0.7035094", "0.669588", "0.6503971", "0.63814044", "0.6307368", "0.61140066", "0.6062323", "0.6053611", "0.60419255", "0.59824055", "0.59824055", "0.59658", "0.59382474", "0.59103197", "0.5740096", "0.5705487", "0.57028913", "0.569599", "0.56659395", "0.5660129", "0.5603166"...
0.7127179
0
Warps a 2D image with a given homography.
def warp_channel(image, homography): ## calc canvas top, bottom = compute_bounding_box(homography, image.shape[1], image.shape[0]) canvas_shape = tuple(np.diff([top,bottom], axis=0).flatten()[::-1]) ## create index map x,y = np.meshgrid(np.arange(top[0], bot...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def warp_channel(image, homography):\n\n\n boundings = compute_bounding_box(homography,image.shape[1],image.shape[0])\n x_vals = np.arange(boundings[0][0], boundings[1][0])\n y_vals = np.arange(boundings[0][1], boundings[1][1])\n x_vals,y_vals = np.meshgrid(x_vals,y_vals)\n\n x_vals_f, y_vals_f = x_...
[ "0.7345839", "0.6907998", "0.682956", "0.6758212", "0.6758212", "0.66904014", "0.6446177", "0.6243719", "0.6226596", "0.62007666", "0.61647147", "0.61616576", "0.6121813", "0.6111707", "0.59788084", "0.59439003", "0.59374386", "0.5885356", "0.58439845", "0.58154804", "0.57919...
0.70242566
1
Convert a number to unicode, with appropriate substitutions.
def unicode_number(x): output = u"%g" % x if output[0] == u"-": output = u"\u2012" + output[1:] index = output.find(u"e") if index != -1: uniout = unicode(output[:index]) + u"\u00d710" saw_nonzero = False for n in output[index+1:]: if n == u"+": pass # uniout += u"\u207a" elif n =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_u(val, encoding='utf-8'):\r\n if isinstance(val, text_type):\r\n return val\r\n elif isinstance(val, numeric_types):\r\n return text_type(val)\r\n\r\n return val.decode(encoding)", "def translate_number(number):\n return NUMBER_TRANSLATOR[number]", "def _to_cn(number):\n\n c...
[ "0.64799064", "0.6462614", "0.6408784", "0.61651", "0.6087401", "0.59796566", "0.5951445", "0.58721507", "0.58155435", "0.5808134", "0.57698685", "0.5736867", "0.57064986", "0.5688757", "0.5659142", "0.56527704", "0.56455475", "0.56412405", "0.5638056", "0.56291896", "0.56287...
0.7085641
0
Return a function that can be used to set standard tick marks.
def tickmarks(major=-10, minor=True, logbase=0, format=unicode_number): if not callable(format): tmp = format format = lambda x: tmp % x format.func_name = tmp def linear_tickmarks(low, high): if low >= high: raise ValueError, "To compute tick-marks, 'low' must be l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_style(func):\n def wrapper(*args, **kwargs):\n fig = plt.figure(figsize=(18,18))\n sns.set_context(\"talk\", font_scale=0.9)\n plt.xlim(-3, 3)\n plt.tick_params(grid_alpha=0.2)\n func(*args, **kwargs)\n plt.clf()\n return wrapper", "def create_tick_mark(\n fmin: f...
[ "0.6055695", "0.5834575", "0.5709799", "0.5684322", "0.56447107", "0.5592472", "0.5586648", "0.55707574", "0.55437565", "0.55194885", "0.54999316", "0.5466122", "0.5416735", "0.539491", "0.53574145", "0.5304559", "0.5293611", "0.5277207", "0.52736354", "0.5267641", "0.524143"...
0.60170686
1
Load the ui file for the applet drawer, which we own.
def initAppletDrawerUic(self): with Tracer(traceLogger): # Load the ui file (find it in our own directory) localDir = os.path.split(__file__)[0]+'/' # (We don't pass self here because we keep the drawer ui in a separate object.) self.drawer = uic.loadUi(localDir+"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_gui():\r\n\r\n print(\"\\nLoading graphical user interface...\\n\")\r\n SongStorageGUI().mainloop()", "def loadUI(self,factory={'GLOB':Glob,'BOOK':Book,'SCPT':Scpt,'CELL':Cell}):\n FileRep.loadUI(self,factory)", "def loadForm(self):\n\n formUI = os.path.join(sys.path[0], 'views/acq...
[ "0.63236564", "0.60985297", "0.6043393", "0.6038417", "0.5976114", "0.5816129", "0.57881004", "0.5724756", "0.57222754", "0.5704641", "0.5683649", "0.5668115", "0.56456685", "0.56370246", "0.5625678", "0.5599373", "0.5575998", "0.55754936", "0.5525895", "0.5523762", "0.551148...
0.7867472
0
The user clicked the "Add File" button. Ask him to choose a file (or several) and add them to both the GUI table and the toplevel operator inputs.
def handleAddFileButtonClicked(self): # Find the directory of the most recently opened image file mostRecentImageFile = PreferencesManager().get( 'DataSelection', 'recent image' ) if mostRecentImageFile is not None: defaultDirectory = os.path.split(mostRecentImageFile)[0] els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_file_input(\n self,\n name: str,\n label: Optional[str] = None,\n source: Optional[str] = None,\n file_type: Optional[str] = None,\n multiple: bool = False,\n ) -> None:\n\n def on_pick_result(event: FilePickerResultEvent):\n if event.files:\n ...
[ "0.64918983", "0.6431509", "0.6418309", "0.6305412", "0.61918384", "0.61420715", "0.610769", "0.60797346", "0.6059743", "0.6056999", "0.60375744", "0.59630734", "0.5940347", "0.5890774", "0.5878446", "0.5872943", "0.5860542", "0.58562905", "0.5852387", "0.5851146", "0.5833489...
0.69240236
0
The user clicked the "Import Stack Directory" button.
def handleAddStackButtonClicked(self): # Find the directory of the most recently opened image file mostRecentStackDirectory = PreferencesManager().get( 'DataSelection', 'recent stack directory' ) if mostRecentStackDirectory is not None: defaultDirectory = os.path.split(mostRecentStac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handleAddStackFilesButtonClicked(self):\n # Find the directory of the most recently opened image file\n mostRecentStackImageFile = PreferencesManager().get( 'DataSelection', 'recent stack image' )\n if mostRecentStackImageFile is not None:\n defaultDirectory = os.path.split(most...
[ "0.63807386", "0.60662997", "0.596505", "0.59516096", "0.59324336", "0.5866149", "0.5780327", "0.5672773", "0.5672773", "0.5672773", "0.5588122", "0.55458176", "0.5526395", "0.5451664", "0.53536344", "0.5325478", "0.53163785", "0.52934563", "0.5268285", "0.52584463", "0.51927...
0.7046417
0
The user clicked the "Import Stack Files" button.
def handleAddStackFilesButtonClicked(self): # Find the directory of the most recently opened image file mostRecentStackImageFile = PreferencesManager().get( 'DataSelection', 'recent stack image' ) if mostRecentStackImageFile is not None: defaultDirectory = os.path.split(mostRecentSta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handleAddStackButtonClicked(self):\n # Find the directory of the most recently opened image file\n mostRecentStackDirectory = PreferencesManager().get( 'DataSelection', 'recent stack directory' )\n if mostRecentStackDirectory is not None:\n defaultDirectory = os.path.split(mostR...
[ "0.7401952", "0.60361826", "0.5968294", "0.5963187", "0.5903095", "0.5903095", "0.5903095", "0.5888331", "0.58152413", "0.57804424", "0.5680004", "0.56641406", "0.5612863", "0.55243236", "0.54665464", "0.5428981", "0.54050756", "0.53769785", "0.5372776", "0.53452855", "0.5321...
0.7355732
1
Add the given filenames to both the GUI table and the toplevel operator inputs.
def addFileNames(self, fileNames): with Tracer(traceLogger): infos = [] oldNumFiles = len(self.topLevelOperator.Dataset) # HACK: If the filePath isn't valid, replace it # This is to work around the scenario where two independent data selection applets are coupled...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_files(self):\n file_paths = tkinter.filedialog.askopenfilenames(parent=self)\n\n if not file_paths:\n return\n for file_path in file_paths:\n self.files_treeview.insert(\"\", \"end\", values=(file_path,))\n self.files_treeview.selection_set(self.files_treev...
[ "0.6075016", "0.6000558", "0.596491", "0.58751535", "0.5829462", "0.57028913", "0.5648508", "0.56384313", "0.56383616", "0.5623524", "0.5554015", "0.55150545", "0.54891205", "0.5437899", "0.53998584", "0.53493977", "0.5336115", "0.5292974", "0.5270632", "0.525856", "0.524532"...
0.6710461
0
The user (un)checked the "allow labels" checkbox in one of the table rows. Update the corresponding dataset info in the operator (which is given in the parameter 'slot')
def handleAllowLabelsCheckbox(self, slot, checked): with Tracer(traceLogger): # COPY the dataset so we trigger the slot to be dirty newDatasetInfo = copy.copy(slot.value) newDatasetInfo.allowLabels = ( checked == Qt.Checked ) # Only update if necessary ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateTableForSlot(self, slot, *args):\n with Tracer(traceLogger):\n\n # Don't update anything if the slot doesn't have data yet\n if not slot.connected():\n return\n\n # Which index is this slot?\n row = -1\n for i in range( len(self...
[ "0.6179488", "0.5845522", "0.58064353", "0.5581023", "0.55638903", "0.5357033", "0.52947384", "0.5255203", "0.5205964", "0.518046", "0.51680946", "0.5164398", "0.5143642", "0.5132615", "0.5130291", "0.5119018", "0.51143825", "0.50607854", "0.5041646", "0.4999295", "0.4979582"...
0.6519952
0
Create and add the combobox for storage location options
def updateStorageOptionComboBox(self, row, filePath): assert threading.current_thread().name == "MainThread" with Tracer(traceLogger): # Determine the relative path to this file absPath, relPath = getPathVariants(filePath, self.topLevelOperator.WorkingDirectory.value) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_combo_box(self, name, value=None, options=None, label=None, add_indicator=None):\n widget=QtWidgets.QComboBox(self)\n widget.setObjectName(_fromUtf8(self.name+\"_\"+name))\n if options:\n widget.addItems(options)\n if value is not None:\n widget.set...
[ "0.63493586", "0.57815427", "0.5772928", "0.57538795", "0.5747907", "0.5733699", "0.5682541", "0.56459165", "0.5585773", "0.5577615", "0.5562045", "0.55241734", "0.548213", "0.543225", "0.54069054", "0.5350624", "0.53404826", "0.5329477", "0.53247994", "0.5262176", "0.5246481...
0.6170078
1
The user clicked the "Remove" button. Remove the currently selected row(s) from both the GUI and the toplevel operator.
def handleRemoveButtonClicked(self): with Tracer(traceLogger): # Figure out which dataset to remove rowsToDelete = set() selectedRanges = self.fileInfoTableWidget.selectedRanges() for rng in selectedRanges: for row in range(rng.topRow(), rng.bottom...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_row(self):\n if len(self.columns[\"rows\"].children) > 0:\n self.selects.pop()\n self.button_groups.pop()\n self.buttons[\"edit\"].pop()\n self.columns[\"rows\"].children.pop()", "def removeObject(self):\n\t\tfor SelectedItem in self.objects_lw.select...
[ "0.75775635", "0.73554677", "0.69494325", "0.68314517", "0.6789492", "0.6658385", "0.6601661", "0.6563126", "0.65295523", "0.6529164", "0.6499993", "0.6471326", "0.64638305", "0.6461784", "0.6439678", "0.64392084", "0.63918245", "0.638411", "0.6379691", "0.6368745", "0.635695...
0.7852163
0
Handles changes to any combo change in the table (either external path or internal path)
def handleComboSelectionChanged(self, combo, index): with Tracer(traceLogger): logger.debug("Combo selection changed: " + combo.itemText(1) + str(index)) # Figure out which row this combo is in tableWidget = self.fileInfoTableWidget changedRow = -1 fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def comboBoxChanged(self):\n new_action = self.ui.comboBoxAction.currentText().lower()\n self.parameters['action'] = new_action\n\n self.changed.emit()", "def _callback_combo_cell(self, cell, path, row, position, treemodel):\r\n\r\n _model = cell.get_property('model')\r\n _text...
[ "0.6172025", "0.5913377", "0.58997405", "0.5888051", "0.58503884", "0.58247435", "0.57801026", "0.57432413", "0.5640571", "0.563494", "0.5616561", "0.56068355", "0.5606437", "0.5573447", "0.5563066", "0.55510837", "0.54804873", "0.54715496", "0.5466768", "0.5444184", "0.54320...
0.60713905
1
Any time the user selects a new item, select the whole row.
def handleTableSelectionChange(self): self.selectEntireRow() self.showSelectedDataset()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def people_item_select(self):\n # Whenever the people table subjects have been selected\n # grey out the checkin button\n self.row_i = self.people_table.currentRow()\n # TODO: okay to return DF of empty?\n # might want to clear other things when no results\n if self.row_i...
[ "0.7052263", "0.70413625", "0.6938748", "0.6933411", "0.6897258", "0.6846295", "0.66692257", "0.66188014", "0.6579844", "0.65542483", "0.65015703", "0.649491", "0.6468015", "0.6384764", "0.63539386", "0.63495123", "0.63334334", "0.63334334", "0.6275927", "0.6255295", "0.62136...
0.72043216
0
Register model to resource mappings. Subclasses must override this to do any registration they may need.
def register_resources(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_resource_for_model(model, resource):\n _model_to_resources[model] = resource", "def register_model(self, model):\n\n self._model = model", "def register(cls, model):\n cls.models[model] = True", "def register(self, *model):\n for m in model:\n m.Register()\n self.mo...
[ "0.7501223", "0.6653077", "0.65550554", "0.6108307", "0.6104962", "0.59786534", "0.5913898", "0.58804697", "0.57783335", "0.57450867", "0.5733444", "0.56834364", "0.56577826", "0.5607221", "0.555102", "0.55320704", "0.5526848", "0.5526848", "0.5513127", "0.54973423", "0.54528...
0.6685671
1
Register a resource as the official location for a model.
def register_resource_for_model(model, resource): _model_to_resources[model] = resource
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _register_resource(self, name):\n GlobalClass.register(self)\n tag = self.module.name.lower()\n group = self.config.xpath(self.xpath + \"/\" + tag)[0]\n group_mysql4 = group.tag + \"_mysql4\"\n resource_model = find_or_create(group, \"resourceModel\")\n resource_model....
[ "0.6097805", "0.6078597", "0.6000599", "0.59710836", "0.596382", "0.5836003", "0.58176094", "0.58176094", "0.5783218", "0.5745019", "0.5735456", "0.5614592", "0.5565347", "0.55405563", "0.5499648", "0.5370664", "0.5360497", "0.53290606", "0.52897364", "0.5284575", "0.5260971"...
0.73618525
0
Return the resource for an object.
def get_resource_for_object(obj): from djblets.webapi.resources.base import WebAPIResource cls = obj.__class__ # Deferred models are a subclass of the actual model that we want to look # up. if getattr(obj, '_deferred', False): cls = cls.__bases__[0] resource = _model_to_resources.get...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_object ( self, object ):\n return object", "def resource(self):\n return self._resource", "def resource(self):\n return self._resource", "def resource(self):\n return self._resource", "def resource(self):\n return self._resource", "def resource(self):\n r...
[ "0.7132309", "0.70808786", "0.70808786", "0.70808786", "0.70808786", "0.70808786", "0.70808786", "0.70808786", "0.69478905", "0.6892674", "0.6882015", "0.6850975", "0.6826252", "0.680579", "0.6796926", "0.67565787", "0.6696587", "0.66093224", "0.6583387", "0.6565771", "0.6481...
0.7670397
0
Return the resource of the specified name.
def get_resource_from_name(name): return _name_to_resources.get(name, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_resource(self, name: str) -> Resource:\n return self.get_session.query(self.resource_model).filter_by(name=name).one_or_none()", "def GetResource(self, name):\r\n matches = [x for x in self.resources if x.name == name]\r\n if len(matches) == 1:\r\n return matches[0]\r\n elif len(matc...
[ "0.82805157", "0.80796313", "0.796345", "0.78018993", "0.7711447", "0.72921443", "0.727059", "0.7054507", "0.7051002", "0.7009372", "0.6961014", "0.69041646", "0.68261045", "0.6757441", "0.67551", "0.67448837", "0.67232054", "0.6704062", "0.6703346", "0.6686181", "0.6673515",...
0.88857186
0
Return the resource with the specified resource class.
def get_resource_from_class(klass): return _class_to_resources.get(klass, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_class(self):\n resource_module = '.'.join(self.resource_class_path.split('.')[:-1])\n resource_class_name = self.resource_class_path.split('.')[-1]\n return getattr(import_module(resource_module), resource_class_name)", "def resource_class(self):\n resource_module = '.'.j...
[ "0.7832141", "0.7832141", "0.7712705", "0.6950276", "0.68987846", "0.66122043", "0.6541201", "0.6495036", "0.6437813", "0.6411328", "0.6365627", "0.63542414", "0.6345779", "0.63337135", "0.6322805", "0.63152754", "0.62987596", "0.62941813", "0.62185717", "0.6204819", "0.62022...
0.8665222
0
Unregister a resource from the caches.
def unregister_resource(resource): del _name_to_resources[resource.name] del _name_to_resources[resource.name_plural] del _class_to_resources[resource.__class__]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unregister(self, resource):\n for item in self.resources:\n if resource == item[\"resource\"]:\n item[\"status\"] = UNREGISTER", "def unregister(self):\r\n self._unregister()", "def _cache_drop(self, metric_name):\n with self._lock:\n del self.__cac...
[ "0.695629", "0.64772457", "0.6466498", "0.64457786", "0.6288041", "0.6288041", "0.61837035", "0.6126617", "0.6099737", "0.6067333", "0.6057097", "0.6050785", "0.60381985", "0.59959465", "0.59620714", "0.5961482", "0.5955716", "0.59399253", "0.5935144", "0.59329534", "0.586909...
0.7239517
0
Connect to trade server.
def connect_trade(self): self.trade_client = TradeClient(self.client_config) try: self.add_task(self.query_order) self.add_task(self.query_position) self.add_task(self.query_account) except ApiException: self.write_log("交易接口连接失败") retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connectToServer(self):\n self.client = Client(base_url = self.server)\n self.ping()", "def connect(self):\n self.conn.connect()", "def connect(self):\n\n symbol = self.order.symbol\n\n if self.test:\n host = 'wss://testnet.bitmex.com/realtime'\n else:\n ...
[ "0.67305315", "0.66895556", "0.6657646", "0.6608166", "0.6548882", "0.6479017", "0.6472146", "0.64224577", "0.63764036", "0.63736725", "0.62640786", "0.6244553", "0.62354064", "0.6216869", "0.6200346", "0.61953896", "0.6190848", "0.61894286", "0.6174592", "0.6170257", "0.6144...
0.7262335
0
Connect to push server.
def connect_push(self): protocol, host, port = self.client_config.socket_host_port self.push_client = PushClient(host, port, (protocol == "ssl")) self.push_client.quote_changed = self.on_quote_change self.push_client.asset_changed = self.on_asset_change self.push_client.position...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _connect(self):\r\n self.sock = socket.socket()\r\n host = \"pubsub.pubnub.com\"\r\n port = 80\r\n if self.use_ssl:\r\n self.sock = ssl.wrap_socket(self.sock)\r\n port = 443\r\n self.sock.connect((host, port))\r\n self.connected = True", "def co...
[ "0.7291151", "0.6847644", "0.67866546", "0.67768633", "0.6661692", "0.6655104", "0.6596576", "0.6536159", "0.65285504", "0.6524723", "0.65192074", "0.65151745", "0.6496408", "0.6478729", "0.6464252", "0.6449753", "0.6418711", "0.6414711", "0.63653946", "0.63524014", "0.635009...
0.79299897
0
Process trade data for both query and update.
def process_deal(self, data): for i in data: if i.status == OrderStatus.PARTIALLY_FILLED or i.status == OrderStatus.FILLED: symbol, exchange = convert_symbol_tiger2vt(str(i.contract)) self.tradeid += 1 trade = TradeData( symbol=sym...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def process_trade(self, data):\n for item in data:\n symbol = item[\"symbol\"]\n trade = {\n \"platform\": self._platform,\n \"symbol\": symbol,\n \"action\": ORDER_ACTION_BUY if item[\"side\"] == \"Buy\" else ORDER_ACTION_SELL,\n ...
[ "0.68010473", "0.6513125", "0.6495422", "0.6462116", "0.6318342", "0.6311736", "0.63095254", "0.6301807", "0.62855184", "0.6077452", "0.6056953", "0.603197", "0.60087824", "0.59963775", "0.59963775", "0.59963775", "0.59963775", "0.59313375", "0.591776", "0.5892385", "0.588439...
0.6608865
1
Convert symbol from vt to tiger.
def convert_symbol_tiger2vt(symbol): if symbol.encode("UTF-8").isalpha(): exchange = Exchange.SMART else: if len(symbol) < 6: exchange = Exchange.SEHK elif symbol.startswith("6"): exchange = Exchange.SSE elif symbol.endswith(".SH"): exchange = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_symbol_vt2tiger(symbol, exchange):\n if exchange == Exchange.SSE and symbol.startswith(\"0\"):\n symbol = symbol + \".SH\"\n else:\n symbol = symbol\n return symbol", "def to_symbol(text):\n text = text.upper()\n if text in (\"BGM\", \"BANGUMI\"):\n return \"bgm\"\...
[ "0.808804", "0.60368603", "0.5791044", "0.56720763", "0.5637549", "0.55791175", "0.55277675", "0.5505299", "0.5419636", "0.54013735", "0.53962946", "0.5395829", "0.53817433", "0.5333906", "0.5278394", "0.52763736", "0.5265407", "0.5249531", "0.52154344", "0.52097255", "0.5201...
0.81928307
0
Convert symbol from vt to tiger.
def convert_symbol_vt2tiger(symbol, exchange): if exchange == Exchange.SSE and symbol.startswith("0"): symbol = symbol + ".SH" else: symbol = symbol return symbol
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_symbol_tiger2vt(symbol):\n if symbol.encode(\"UTF-8\").isalpha():\n exchange = Exchange.SMART\n else:\n if len(symbol) < 6:\n exchange = Exchange.SEHK\n elif symbol.startswith(\"6\"):\n exchange = Exchange.SSE\n elif symbol.endswith(\".SH\"):\n ...
[ "0.81928307", "0.60368603", "0.5791044", "0.56720763", "0.5637549", "0.55791175", "0.55277675", "0.5505299", "0.5419636", "0.54013735", "0.53962946", "0.5395829", "0.53817433", "0.5333906", "0.5278394", "0.52763736", "0.5265407", "0.5249531", "0.52154344", "0.52097255", "0.52...
0.808804
1
Config symbol to corresponding currency
def config_symbol_currency(symbol): if symbol.encode("UTF-8").isalpha(): currency = Currency.USD else: if len(symbol) < 6: currency = Currency.HKD else: currency = Currency.CNH return currency
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getCurrencySymbol():", "def currency_symbol(self, init):\r\n\r\n c2 = CurrencyCodes()\r\n c_symbol = c2.get_symbol(init)\r\n return c_symbol", "def getCurrencySymbol(id=None):", "def getDefaultCurrency():", "def quote_currencies(self):\n pass", "def currency(self, currency...
[ "0.79462665", "0.74198484", "0.66513836", "0.6561869", "0.64658445", "0.6448337", "0.6419649", "0.6266505", "0.61048144", "0.6058995", "0.60494053", "0.6024492", "0.5996669", "0.5974246", "0.58935475", "0.5873423", "0.5847701", "0.5830133", "0.5808687", "0.58026433", "0.57539...
0.79219276
1
Strip the leading and trailing whitespace of a given text
def strip_whitespace(self, text): return text.strip()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_whitespaces(text: str) -> str:\n return text.lstrip().rstrip()", "def remove_leading_whitespace_and_empty_lines(text: str) -> str:\n # We call lstrip() twice on the same line. This is inefficient but ok for small unit tests.\n # Please change it if you want to.\n return '\\n'.join([lin...
[ "0.80575657", "0.78265435", "0.77780694", "0.7634085", "0.7620508", "0.7521066", "0.7518481", "0.74882275", "0.74422944", "0.73665917", "0.7358045", "0.73027694", "0.7300915", "0.7294546", "0.7215683", "0.71842605", "0.71270746", "0.71270746", "0.709766", "0.7091407", "0.7085...
0.8302335
0
Format the output of a course
def format_course_output(self, course, schedule): # handle schedule str_list = schedule.schedule.strip().split(' ') sch_res = '' if (len(str_list) >= 6): val_list = str_list[:6] val_list[5] = val_list[5][:3] # time time = val_list[0] + ' ' + val_list[1] + ' ' + val_list[2] + ' ' + val_list[3]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_output(filtered_courses_list):\n\n if not filtered_courses_list:\n print(\"No courses matched the query.\")\n return\n\n max_name_length = max([len(course.name) for course in filtered_courses_list])\n\n print(\" Sem | Course ID | Pts | \" +\n \" \" * ((max_name_length - 1...
[ "0.6944422", "0.6730091", "0.6578019", "0.6519152", "0.6504523", "0.6474363", "0.642245", "0.6395715", "0.6341537", "0.61744756", "0.6163076", "0.6133065", "0.6130324", "0.6114346", "0.60810196", "0.60802037", "0.59981614", "0.5904079", "0.5876718", "0.5844278", "0.5802319", ...
0.7844055
0
Given the input string (course code), return the course
def get_course_by_code(input): res = None user_input = input input = str(input) # clean input input = util.strip_whitespace(input) input = util.del_whitespace(input) input = util.to_upper(input) print input course = query_cat.filter(Course.course_code == input).first() schedule = query_sch.filter(Schedule...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def course_name(input):\n for course in config.current_courses:\n if strip_string(course) == strip_string(input):\n return course\n\n return input", "def _parse_course_id_from_string(input_str):\r\n m_obj = re.match(r'^/courses/(?P<course_id>[^/]+/[^/]+/[^/]+)', input_str)\r\n if m_...
[ "0.7170098", "0.7058149", "0.70250374", "0.67529607", "0.67248166", "0.6541851", "0.6528558", "0.6477524", "0.64641935", "0.64081264", "0.6382256", "0.6375246", "0.62365013", "0.6080567", "0.60732913", "0.6056371", "0.60557353", "0.6053482", "0.6018583", "0.5958772", "0.59036...
0.76620525
0
Given the input string (key words), return the course
def get_course_by_key_words(input):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def course_name(input):\n for course in config.current_courses:\n if strip_string(course) == strip_string(input):\n return course\n\n return input", "def _course_key_from_string(self, string):\r\n return self.course_locations[string].course_key", "def get_courses(std):\n retur...
[ "0.693951", "0.6872825", "0.6350646", "0.6082056", "0.60421014", "0.6014495", "0.5844915", "0.57037026", "0.5657913", "0.5654991", "0.5654512", "0.5646173", "0.56458086", "0.56419003", "0.55879545", "0.55596834", "0.55547255", "0.5543785", "0.553146", "0.5529814", "0.5440121"...
0.85511416
0
Run new owl server for given `pipeline` Returns port of the created server
def new_server(self, name, pipeline, port=None): if port is None: port = self.next_port self.next_port += 1 self.servers[name] = port args = ["owl-server","--port", str(port)] + pipeline.split() proc = subprocess.Popen(args) self.processes[port] = proc ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(port):\n ps = PathologicalServer(\"localhost\", port, _responses)\n ps.start()", "def run(*port):\n print(port)\n if port:\n port = port[0]\n else:\n port = 8000\n external_ip = '0.0.0.0:{}'.format(port)\n _manage('runserver %s' % external_ip)", "async def net_server(pip...
[ "0.6003155", "0.56016594", "0.55983025", "0.5577207", "0.55736977", "0.5468409", "0.5451809", "0.54441744", "0.5419513", "0.5376845", "0.5339203", "0.5296844", "0.5291677", "0.5291677", "0.5290636", "0.5287376", "0.5261708", "0.52436334", "0.5235279", "0.5222004", "0.52121824...
0.79979473
0
Terminate server for listening on given `port`.
def terminate_server(self, port): proc = self.processes.pop(port, None) if proc is None: raise ValueError(f"Server for port {port} does not exists." "It might have been closed already." ) proc.terminate()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kill_process_by_port(port):\n port = int(port)\n pid = get_pid_by_port(port)\n if pid:\n return kill(pid)", "def stop_echo_server(self, ip_addr='localhost',\n port=zephyr_constants.DEFAULT_ECHO_PORT):\n out = None\n if (port in self.echo_server_procs and\...
[ "0.6641947", "0.6628325", "0.6453124", "0.6397097", "0.63918346", "0.63025546", "0.6299923", "0.6299426", "0.6281496", "0.6214558", "0.6181251", "0.6174334", "0.61625504", "0.6139271", "0.61364913", "0.61274475", "0.6123971", "0.6084454", "0.60776997", "0.60655427", "0.603590...
0.8301901
0
Loads ports from file Loaded servers cannot be terminated
def load_ports_from_file(self, filename): lines = open(filename, "r").readlines() for line in lines: name, port = line.split(":") self.servers[name] = port.rstrip()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(self):\n\t\tpath = input(\"Please enter the file name, with full path if needed, to load hosts and open ports -> \")\n\t\ttry:\n\t\t\tf = open(path)\n\t\t\tlines = f.read()\n\t\t\tentries = lines.split('\\n\\n')\n\t\t\tfor entry in entries:\n\t\t\t\thost_ports = entry.split('\\n')\n\t\t\t\tif host_ports[0...
[ "0.72574246", "0.67828935", "0.59317714", "0.56775075", "0.56608295", "0.5643025", "0.56103486", "0.56080896", "0.55767304", "0.55763936", "0.54733366", "0.5434388", "0.54177946", "0.5403998", "0.5392675", "0.5375731", "0.5347649", "0.5315801", "0.5302954", "0.52818924", "0.5...
0.78676033
0
Computes the GANnotation encoding for a video.
def compute_video_encoding(video): video_points = [] while True: ret, frame = video.read() if not ret: break # Find landmarks/points in frame. gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) rects = face_detector(gray, 1) if (len(rects) == 0): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(data_dir):\n\n face2face_dir = '{}/manipulated_sequences/Face2Face/c0/videos'.format(data_dir)\n orig_dir = '{}/original_sequences/c0/videos'.format(data_dir)\n base_dir = '{}/manipulated_sequences/GANnotation'.format(data_dir)\n output_enc_dir = '{}/encodings'.format(base_dir)\n output_vid...
[ "0.6518178", "0.6104392", "0.59964246", "0.5801031", "0.5739885", "0.5585433", "0.55486244", "0.5478121", "0.5309508", "0.53071237", "0.52854246", "0.5283544", "0.5250905", "0.52124584", "0.5192007", "0.5182117", "0.51523244", "0.5151299", "0.5132689", "0.5113917", "0.5107428...
0.64678127
1
Generates videos with GANnotation using the same driving video and source video combinations used with Face2Face.
def main(data_dir): face2face_dir = '{}/manipulated_sequences/Face2Face/c0/videos'.format(data_dir) orig_dir = '{}/original_sequences/c0/videos'.format(data_dir) base_dir = '{}/manipulated_sequences/GANnotation'.format(data_dir) output_enc_dir = '{}/encodings'.format(base_dir) output_vid_dir = '{}/...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode_videos(self):\n\t\t\n\t\tself.face_detector = MTCNN()\n\t\tencoder = MyVGGFace(self.vgg_l, self.vgg_v)\n\t\t\n\t\tfolder = self.folders['raw_video_folder']\n\t\t\n\t\tfor (dirpath, _, filenames) in os.walk(folder):\n\t\t\tif platform == 'linux' or platform == 'linux2' or platform == 'darwin':\n\t\t\t\t#...
[ "0.6596629", "0.64612806", "0.63377756", "0.6288337", "0.6274383", "0.6232385", "0.61546236", "0.6031003", "0.6000362", "0.5978761", "0.5973133", "0.59620225", "0.59196764", "0.5911529", "0.5893759", "0.5874103", "0.5867773", "0.58625805", "0.58521277", "0.5817486", "0.580820...
0.7005335
0
Saves all model and tokenizer to path
def save(self, path): if path is None: return logging.info("Save model to {}".format(path)) self.model.save_pretrained(path) self.tokenizer.save_pretrained(path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, path: utils.URLPath):\n save_somclassifier_config(self.config, path / \"config.json\")\n self.model.save(str(path / \"model.h5\"))\n io_functions.save_joblib(self.binarizer, path / \"binarizer.joblib\")\n\n io_functions.save_json(self.data_ids[\"validation\"], path / \"id...
[ "0.7375198", "0.73201835", "0.7275228", "0.72446775", "0.71978945", "0.7173624", "0.71645725", "0.71221966", "0.71123177", "0.7020637", "0.69833195", "0.6982963", "0.69592774", "0.6959015", "0.690435", "0.68858427", "0.6864155", "0.6848267", "0.684122", "0.6808882", "0.679161...
0.7410444
0
method to create entries
def creating_entry(self): response = "" today = str(date.today()) curent_time = str(datetime.time(datetime.now())) entry = Diary(self.entry_id, self.title, self.body) lst = {} lst["entry_id"] = entry.entry_id lst["title"] = entry.title lst["date"] = today ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_entry(entry):\n Entry.create(**entry)\n return entry", "def create_and_add_entry(self, **attrs):\n return self.add_entry(self.create_entry(**attrs))", "def create(self):", "def new_entry():\n clear_screen()\n entry = {}\n entry['id'] = get_next_id()\n entry['name'] = input...
[ "0.74073875", "0.7049438", "0.673739", "0.6715712", "0.66536736", "0.66536736", "0.6581046", "0.65393996", "0.6529814", "0.6471664", "0.6468275", "0.6409988", "0.64099157", "0.64099157", "0.64099157", "0.6397284", "0.6391721", "0.6385852", "0.63849086", "0.6370306", "0.634165...
0.717518
1
Forward twisted logs to the python stdlib logger.
def twistedLogObserver(eventDict): n = 2 module = 'twisted' while True: try: caller = sys._getframe(n) except ValueError: break name = caller.f_globals.get('__name__') if name not in (None, 'twisted.python.log'): module = name b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _alter_logger(*args, **kwargs):\n\n # TODO: dress up root logger here under Celery\n # configure_logging()\n pass", "def Log(message):\n log_mod = sys.modules.get('twisted.python.log')\n if log_mod:\n log_mod.msg(message)\n else:\n print message", "def setup_logger():\n root = logging....
[ "0.6573398", "0.6544858", "0.6533331", "0.6466651", "0.6412817", "0.6195713", "0.61682737", "0.61235356", "0.6119762", "0.6104155", "0.60603535", "0.60477364", "0.60468274", "0.6032671", "0.60320276", "0.60292095", "0.60277015", "0.6025815", "0.6004273", "0.60029143", "0.5961...
0.660194
0
Log a Twisted Failure object with traceback. Suitable for use as an errback.
def logFailure(failure, msg='Unhandled exception in deferred:'): logging.error('%s\n%s', msg, failure.getTraceback())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _logError(self, failure):\r\n try:\r\n failure.printTraceback()\r\n except:\r\n print('Could not print traceback of failure, print error '\r\n 'message instead:')\r\n print(failure.getErrorMessage())", "def traceback_hook(type, value, traceback)...
[ "0.6952767", "0.65461653", "0.65011835", "0.63761", "0.6218661", "0.6216443", "0.61358964", "0.6120387", "0.60622317", "0.6036452", "0.6007453", "0.60013145", "0.5989881", "0.5825196", "0.57672983", "0.5751573", "0.5717206", "0.56846493", "0.56739634", "0.5663092", "0.5657386...
0.7511296
0
Calculate Flux limits for given current and magneticfield angle
def _flux_limit(self, omega=0, eps_mag=0, u_q_max=0.0, u_rq_max=0.0): mp = self.motor_parameter l_s = mp['l_m'] + mp['l_sigs'] l_r = mp['l_m'] + mp['l_sigr'] l_mr = mp['l_m'] / l_r sigma = (l_s * l_r - mp['l_m'] ** 2) / (l_s * l_r) # limiting flux for a low omega ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def magnet_limits(self):\n max_currents = self.pv_monitor.get_max_currents()\n\n strengths = [np.array([max_currents[0],\n -max_currents[1],\n max_currents[2], 0, 0]),\n np.array([0, 0, max_currents[2],\n ...
[ "0.67609036", "0.6139057", "0.6093792", "0.60318834", "0.5932127", "0.5922429", "0.58925015", "0.58271277", "0.57542443", "0.57087165", "0.56882066", "0.5674291", "0.5637041", "0.56301844", "0.559757", "0.5552885", "0.55398893", "0.5495456", "0.5447273", "0.5438389", "0.54375...
0.6304191
1
Loads, scales, add sum and returns the card's ratings per archetype
def get_ratings(self): df = pd.read_csv(IoManager.CARD_RATINGS_FILE_PATH) df = IoManager.scale_ratings(df) df = IoManager.normalize_ratings_per_archetype(df) df = self.add_ratings_sum(df) # print(df[["name", "monogreen", "simic_ramp", "general"]].tail(60)) # print(d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate(self):\n\n rating = 0\n\n props = ['aroma', 'appearance', 'taste', 'palate', 'bottle_style']\n for item in props:\n rating += getattr(self, item, 0)\n\n self.overall = (rating / self.total) / .2", "def normalize_ratings_per_archetype(ratings):\n archety...
[ "0.6380344", "0.61968863", "0.5909384", "0.55840695", "0.5580369", "0.55455184", "0.55112666", "0.5488847", "0.54406595", "0.5376693", "0.5336506", "0.5311914", "0.53039163", "0.5274228", "0.5263589", "0.52398807", "0.5232894", "0.521996", "0.521996", "0.52112716", "0.5173465...
0.6660048
0
Divides each rating by a value proportional to the sum of all the ratings in the archetype
def normalize_ratings_per_archetype(ratings): archetype_cols = [c for c in ratings.columns if c != "name"] n_cards = len(ratings["monored"]) for arch_col in archetype_cols: ratings[arch_col] = ratings[arch_col] / (ratings[arch_col].sum() / n_cards) return ratings
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate(self):\n\n rating = 0\n\n props = ['aroma', 'appearance', 'taste', 'palate', 'bottle_style']\n for item in props:\n rating += getattr(self, item, 0)\n\n self.overall = (rating / self.total) / .2", "def average_rating(self):\n return ( self.rating_1 + se...
[ "0.6732126", "0.6466219", "0.6354308", "0.6154052", "0.6071842", "0.60431087", "0.601784", "0.59927374", "0.59915966", "0.59524244", "0.5936136", "0.5898596", "0.58605075", "0.5803156", "0.5800903", "0.5756226", "0.573754", "0.5710812", "0.56885886", "0.56883645", "0.56880826...
0.6568107
1
Returns which cards we have downloaded images for (of the specified language, en or fr)
def get_downloaded_images(lang="en"): path = IoManager.CARD_IMAGES_PATH_EN if lang == "en" else IoManager.CARD_IMAGES_PATH_FR Path(path).mkdir(parents=True, exist_ok=True) file_names_en = [f for f in listdir(path) if isfile(join(path, f))] card_names = [f[:-4] fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_card_images(self, card_names, lang=\"en\"):\n for card_name in card_names:\n print(\"Dowloading card imgs for \\'\" + card_name + \"\\' (\" + lang + \")\")\n output_file_name = card_name + \".jpg\"\n output_file_path = IoManager.CARD_IMAGES_PATH_EN + \"/\" + out...
[ "0.6827145", "0.67701286", "0.65849847", "0.5614944", "0.55986357", "0.55533844", "0.5530028", "0.5465683", "0.54479086", "0.5424347", "0.5316803", "0.5239201", "0.5239081", "0.52309775", "0.5227534", "0.519252", "0.51657206", "0.515859", "0.514055", "0.51235837", "0.5105135"...
0.7632202
0
Returns which cards we miss images for
def get_missing_images(self): downloaded_images_en = IoManager.get_downloaded_images(lang="en") downloaded_images_fr = IoManager.get_downloaded_images(lang="fr") complete_list = self.cube_list + IoManager.BASIC_LANDS missing_images_en = [card for card in complete_list if card not in down...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def image_comparison(self):\n for result in self.cards:\n if result.image_status:\n return True\n return False", "def get_images_bytesize_match(self, images):\r\n cnt = 0\r\n MAX_BYTES_SIZE = 15728640\r\n good_images = []\r\n for image in images...
[ "0.6058513", "0.57476836", "0.57151556", "0.5685657", "0.5677294", "0.56010586", "0.55934155", "0.5563497", "0.5537158", "0.55090606", "0.5498323", "0.549093", "0.54860824", "0.5450436", "0.5446004", "0.54443866", "0.5434272", "0.54127556", "0.53991973", "0.53977275", "0.5389...
0.692412
0
Downloads the en and fr card image of each card
def download_card_images(self, card_names, lang="en"): for card_name in card_names: print("Dowloading card imgs for \'" + card_name + "\' (" + lang + ")") output_file_name = card_name + ".jpg" output_file_path = IoManager.CARD_IMAGES_PATH_EN + "/" + output_file_name if lang =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_downloaded_images(lang=\"en\"):\n path = IoManager.CARD_IMAGES_PATH_EN if lang == \"en\" else IoManager.CARD_IMAGES_PATH_FR\n Path(path).mkdir(parents=True, exist_ok=True)\n file_names_en = [f for f in listdir(path) if\n isfile(join(path, f))]\n card_name...
[ "0.6921706", "0.6450962", "0.6377", "0.6337459", "0.60916305", "0.60854703", "0.5967566", "0.5942896", "0.58616376", "0.58562416", "0.5838658", "0.57420564", "0.5741461", "0.57366806", "0.57327133", "0.57137054", "0.56456494", "0.5644481", "0.5608249", "0.56000626", "0.558310...
0.80364513
0
Generate images using pretrained network pickle.
def generate_images( network_pkl, seeds, truncation_psi, noise_mode, outdir ): print('Loading networks from "%s"...' % network_pkl) # device = torch.device('cuda') device = torch.device('cpu') with dnnlib.util.open_url(network_pkl) as f: G = legacy.load_network_pkl(f)['G_e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data(self):\n # make sure preprocessing is same as preprocessing as the network\n # reduce mean, and divide by a value to do scaling\n self.train_datagen = ImageDataGenerator(\n rescale=1./ 255,\n shear_range=0.05,\n rotation_range=20, # randomly rota...
[ "0.6521632", "0.64640135", "0.6414876", "0.6319254", "0.62962353", "0.62662005", "0.6203831", "0.61933243", "0.6185996", "0.6172128", "0.61563635", "0.6125293", "0.610219", "0.6065702", "0.60526216", "0.60506034", "0.6046957", "0.6046304", "0.60312176", "0.60269386", "0.60013...
0.6844513
0
Generates a 'learning curve' i.e. the analysis for each data size 0 to full. Obsolete function.
def learning_curve(): loss = [] val_loss = [] data_size = [] x_slid, y_slid = sliding_window_main(x, y) x_train, y_train, x_val, y_val, x_test, y_test = data_splitting_main(x_slid, y_slid) m_tot = x_train.shape[0] batch_step = 50 try: for m in range(batch_size, m_tot, batch_ste...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def finetune_learningrate_createData():\n acc,auc = [],[]\n for i in tqdm([j*0.005 for j in range(1,31)],desc='Progress(max_depth)',ncols=70,smoothing=0.5):\n X_train, X_test, y_train, y_test, X, y_binary = initializing()\n XGBCla = get_XGBmodel(lr=i)\n XGBCla = XGBCla.fit(X_train, y_tra...
[ "0.65476876", "0.652535", "0.63539034", "0.63355064", "0.62676394", "0.6246775", "0.61720693", "0.6154492", "0.61399", "0.6103736", "0.60872924", "0.60743475", "0.6020889", "0.60129255", "0.6007138", "0.59935564", "0.59641993", "0.5947333", "0.5942775", "0.59299177", "0.59045...
0.66602564
0
Function to update the values of a TreeSplits object.
def updateTreeValues ( self, feature_column, feature_value, node_type, nodes, children = [ ] ): self.feature_column = feature_column self.feature_value = feature_value self.node_type = node_type self.nodes = nodes self.children = children # End updateTreeValues()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetSplitValues(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_SplitCurve_SetSplitValues(self, *args)", "def split(self):\n pos_median = len(self.keys)/2\n key_median = self.keys[pos_median]\n value_median = self.values[pos_median]\n keys_left = self.keys[:pos_median]\n ...
[ "0.5888695", "0.56457704", "0.5637454", "0.55085474", "0.5473264", "0.54514945", "0.54263914", "0.53565776", "0.53152966", "0.52939975", "0.5229411", "0.5209243", "0.5178123", "0.5173258", "0.5074526", "0.50700766", "0.5065914", "0.5059103", "0.50479466", "0.5044793", "0.5040...
0.57885617
1
Function to get the midpoints between values of the feature array to score in determining best split.
def get_valid_midpoints ( feature_array: np.ndarray, target_array: np.ndarray ): # Get sorted indices indices = np.argsort ( feature_array ) # Get sorted feature array sorted_feature_array = feature_array [ indices ] # Get the differences between adjacent values feature...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def midpoints(self):\n return self.bins[:, 1]", "def split(self, X, y, feature_array):\n n, p = X.shape\n\n best_gain = 0\n best_split_point = 0\n best_feature_id = -1\n for feature_id in feature_array:\n cur_gain, cur_split_point = self.find_best_split(\n ...
[ "0.7009221", "0.66867995", "0.6500667", "0.6397656", "0.6387852", "0.6146362", "0.6117075", "0.6101361", "0.60497683", "0.60440624", "0.6034719", "0.60301876", "0.6004744", "0.59204274", "0.58992785", "0.5869794", "0.5834895", "0.58053046", "0.57847375", "0.5784375", "0.57631...
0.70583206
0
Function to evaluate the goodness of the continuous split value.
def get_split_goodness_fit_continuous ( feature_array: np.ndarray, target_array: np.ndarray, split: float, evaluate_function: Callable ): # Get above and below the split value above = feature_array >= split below = feature_array < split # Get weighted average evaluate_functi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_split_goodness_fit_continuous(\n arr: np.ndarray, y: np.ndarray, split: float, eval_func: Callable\n ):\n # Get above and below the split value\n above = arr >= split\n below = arr < split\n\n # get weighted average eval_func on the splits\n n_above = np.sum(abo...
[ "0.71865433", "0.6572121", "0.6329187", "0.5955071", "0.59270036", "0.5801792", "0.5749482", "0.57275933", "0.5726107", "0.5710863", "0.5676883", "0.5616585", "0.56147176", "0.56091195", "0.5603875", "0.5592451", "0.55882514", "0.5582341", "0.5575127", "0.5549959", "0.5546042...
0.6943928
1
Function to get the value of making a discrete split.
def get_discrete_split_value ( feature_array: np.ndarray, target_array: np.ndarray, evaluate_function: Callable ): # First element is the weighted average evaluate_function of the split # Second term is the intrinsic value to penalize many splits. return ( sum ( [ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_discrete_split_value(arr: np.ndarray, y: np.ndarray, eval_func: Callable):\n\n # First element is the weighted average eval_func of the split\n # Second term is the intrinsic value to penalize many splits.\n return (\n sum(\n [\n eval_func(y...
[ "0.65154564", "0.5932024", "0.5635929", "0.56241894", "0.5608168", "0.5515022", "0.5504383", "0.54864615", "0.53911495", "0.5371303", "0.53537226", "0.5306154", "0.5295001", "0.5242035", "0.5230267", "0.5224207", "0.52195615", "0.52148545", "0.5210651", "0.5210651", "0.521065...
0.64066917
1
Function to prune a tree.
def prune_tree ( self ): tree = copy.deepcopy ( self.tree ) change_made = True # As long as changes are made, recursively prune from the root node. while change_made: change_made = self.prune_node ( tree, tree.root ) return tree # End prune_tree()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prune_tree(self):\n tree = copy.deepcopy(self.tree)\n change_made = True\n # As long as changes are made, recursively prune from the root node.\n while change_made:\n change_made = self.prune_node(tree, tree.root)\n return tree", "def prune(self, n_leaves):\n ...
[ "0.76428306", "0.757985", "0.74307483", "0.7363779", "0.73275864", "0.732632", "0.7228591", "0.72047454", "0.7031705", "0.6908371", "0.6862588", "0.6833638", "0.676064", "0.67177105", "0.67132443", "0.6611636", "0.6551961", "0.65180445", "0.65033764", "0.64932555", "0.6482528...
0.77864975
0
Given the split indices, function obtains one of the training splits
def _get_one_split ( split_indices, number_of_split ): # Given the split indices, get the `number_of_split` element of the indices. return ( np.delete ( np.concatenate ( split_indices ), split_indices [ number_of_split ] ), # Drops the test from the train split_indices [ number_of_spli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def indices_of_split(self, split_name='train'):\n return self.indices_of('split', split_name)", "def train_valid_index_split(all_index, train_size = None, valid_split = 0.3):\n\tall_index = np.arange(all_index) if isinstance(all_index, int) else np.array(all_index)\n\ttrain_size = len(all_index) if train_size...
[ "0.6946859", "0.680867", "0.6726826", "0.66065216", "0.62583315", "0.6195574", "0.6195574", "0.61884665", "0.618018", "0.61747795", "0.6159418", "0.61322176", "0.61260164", "0.60440093", "0.6012981", "0.6004573", "0.5996648", "0.5986898", "0.59850836", "0.59788764", "0.593213...
0.80875164
1
Function splits the indices by the number of folds
def _get_indices_split ( indices, number_of_folds ): # Split the indicies by the number of folds return np.array_split ( indices, indices_or_sections = number_of_folds ) # End get_indices_split()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fold(nb_splits, dataset):\r\n index = np.arange(np.shape(dataset)[0])\r\n splits = np.split(index, nb_splits)\r\n\r\n index = []\r\n\r\n for n_fold in np.arange(nb_splits):\r\n index.append((splits[n_fold].tolist(),(np.concatenate([x for i,x in enumerate(splits) if i!=n_fold])).tolist()))\r\...
[ "0.78790355", "0.7600039", "0.71495384", "0.7104353", "0.6637206", "0.6535842", "0.6340548", "0.6302971", "0.6302251", "0.62954754", "0.62954754", "0.62938744", "0.6240823", "0.62392235", "0.6203992", "0.6193665", "0.6119545", "0.61134005", "0.60917705", "0.6089957", "0.60720...
0.8309637
1
>>> s = Solution() >>> s.numSpecial([[1,0,0],[0,0,1],[1,0,0]]) 1
def numSpecial(self, mat: list[list[int]]) -> int: ans = 0 col_cache = {} for row in mat: # print(row) ones = [] for i, n in enumerate(row): if n == 1: ones.append(i) # print(ones) if len(ones) == 1: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nits(self):", "def J (self, n):", "def __len__(self):\n if self.solution is None:\n return 0\n elif isinstance(self.solution, list):\n return len(self.solution)\n else:\n return 1", "def double_nums(num_list):", "def __init__(self, nums):\n d...
[ "0.5634397", "0.533418", "0.52352107", "0.5177232", "0.50461686", "0.50198936", "0.50171566", "0.5002507", "0.49893063", "0.49433863", "0.49368918", "0.49326292", "0.49240553", "0.4905042", "0.48826474", "0.485887", "0.4855875", "0.48495466", "0.48342177", "0.48332715", "0.48...
0.6581576
0
Retrieve experiment specific phoneme information
def get_experiment_phn_info(): phone_list = ['##', 'aa', 'ae', 'ao', 'aw', 'ax', 'ay', 'bb', 'br', 'ch', 'dd', 'dh', 'eh', 'er', 'ey', 'ff', 'gg', 'hh', 'ih', 'iy', 'jh', 'kk', 'll', 'mm', 'ng', 'nn', 'ow', 'oy', 'pp', 'rr', 'sh', 'sp', 'ss', 'th', 'tt', 'uh', '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getexperimentinfo(expid):\n rdata = {}\n rdata['expId'] = expid\n res = requests.get(scbd_server_address + '/experiments/get_details', json=rdata)\n if res.status_code == 200:\n outstr = ''\n for cres in res.json()['details']:\n outstr += cres[0] + ':' + cres[1] + '<br>'\n ...
[ "0.5790809", "0.5501423", "0.5499727", "0.5498819", "0.54900473", "0.54471534", "0.53917515", "0.5380888", "0.5365359", "0.53366756", "0.5317841", "0.52648", "0.5258462", "0.52435106", "0.5186929", "0.5146196", "0.5093818", "0.50938", "0.50878394", "0.50823444", "0.5073125", ...
0.6426803
0
return a tuple containing all the experiment specific speaker related information
def get_experiment_speaker_info(db_root): seen_speakers = ['VCTK-speaker-p225-female', 'VCTK-speaker-p226-male', 'VCTK-speaker-p227-male', 'VCTK-speaker-p228-female', 'VCTK-speaker-p229-female', 'VCTK-speaker-p230-female', 'VCTK-speaker-p231-female', 'VCTK-speaker-p232-male', 'VCTK-speaker-p233-female', 'V...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def speaker_list(self):\n return \", \".join(str(speaker.person) for speaker in self.speakers.all())", "def extract_speaker_data(self, X, y):\r\n\r\n speaker_names = []\r\n global_idx = 0\r\n curr_speaker_num = -1\r\n old_speaker = ''\r\n\r\n # Crawl the base and all sub...
[ "0.6471933", "0.6339277", "0.63172996", "0.629798", "0.61967725", "0.60992134", "0.60636175", "0.5926962", "0.580786", "0.575381", "0.5750333", "0.5709002", "0.5697383", "0.56863433", "0.564128", "0.55814594", "0.5512268", "0.54673225", "0.54642814", "0.5446318", "0.5411513",...
0.72033405
0
sort `regions` in a descending order self The object regions A list of region which is in tuple form `regions` in a descending order.
def reverse_sort_regions(self, regions): return sorted(regions, key=lambda region: region[0], reverse=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def concatregions(in_regions):\n out_regions = []\n if len(in_regions) == 0: # if no regions, then return empty\n return np.asarray(out_regions)\n for strand in [0,1]:\n # sort by left position\n on_strand = in_regions[in_regions[:,0] == strand]\n if len(on_strand) <= 1: # if 0...
[ "0.5818421", "0.5711712", "0.55216634", "0.54087275", "0.537096", "0.5370231", "0.5354793", "0.5290695", "0.51466596", "0.5135079", "0.5049498", "0.49889728", "0.49651736", "0.495241", "0.49407768", "0.49245477", "0.4892419", "0.48727", "0.48430598", "0.48423144", "0.48328733...
0.8506791
0
get the syntax file name and the syntax name which is on the bottomright corner of ST self The object view The view The current syntax.
def get_current_syntax(self, view): syntaxFile = view.settings().get('syntax') if syntaxFile not in syntaxInfos: syntaxInfos[syntaxFile] = { 'fileName' : os.path.splitext(os.path.basename(syntaxFile))[0], 'syntaxName' : self.find_syntax_name(syntaxFile), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_syntax_name(self, syntaxFile):\n\n content = sublime.load_resource(syntaxFile).strip()\n\n # .tmLanguage (XML)\n if content.startswith('<'):\n matches = self.nameXmlRegex.search(content)\n # .sublime-syntax (YAML)\n else:\n matches = self.nameYamlRe...
[ "0.60397613", "0.59165514", "0.5733196", "0.57180023", "0.57087535", "0.5576404", "0.5452801", "0.5322473", "0.5300614", "0.5289165", "0.5253225", "0.52486515", "0.5197351", "0.5190645", "0.5080132", "0.5079527", "0.50793636", "0.4998947", "0.4986166", "0.49765286", "0.494739...
0.69336903
0
find the name section in the give syntax file path self The object syntaxFile The path of a syntax file The syntax name of `syntaxFile` or None.
def find_syntax_name(self, syntaxFile): content = sublime.load_resource(syntaxFile).strip() # .tmLanguage (XML) if content.startswith('<'): matches = self.nameXmlRegex.search(content) # .sublime-syntax (YAML) else: matches = self.nameYamlRegex.search(con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getSyntaxBySourceFileName(self, name, formatConverterFunction):\n for regExp, xmlFileName in self._extensionToXmlFileName.items():\n if regExp.match(name):\n return self._getSyntaxByXmlFileName(xmlFileName, formatConverterFunction)\n else:\n raise KeyError(\"...
[ "0.62873906", "0.6136943", "0.5446002", "0.5399976", "0.53163207", "0.5222896", "0.52083194", "0.5134081", "0.5114007", "0.5108348", "0.50795096", "0.5013631", "0.5010836", "0.5007915", "0.49805075", "0.49515027", "0.49298373", "0.49222234", "0.49050725", "0.48783788", "0.487...
0.7932906
0
get_aws_iam returns a dict with id and secret
def test_get_aws_iam(mock_system): config = voithos.lib.config.DEFAULT_CONFIG config["license"] = "11111111111111111111-2222222222222222222222222222222222222222" mock_system.get_file_contents.return_value = json.dumps(config) iam = aws.get_aws_iam() assert "id" in iam assert "secret" in iam ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_aws_secret(role):\n global AWS_ID\n AWS_ID += 1\n request.data\n return jsonify({\n \"request_id\": f\"a-request-id-{AWS_ID}\",\n \"lease_id\": f\"aws/creds/{role}/a-lease-id-{AWS_ID}\",\n \"renewable\": True,\n \"lease_duration\": 3600,\n \"data\": {\n ...
[ "0.725023", "0.6431359", "0.6358747", "0.6328489", "0.63060457", "0.6280029", "0.6222176", "0.61839336", "0.61627704", "0.61163086", "0.609", "0.60536736", "0.6049167", "0.6023562", "0.6014561", "0.6012974", "0.587488", "0.5873585", "0.5872633", "0.58578235", "0.578888", "0...
0.7496777
0
Fit model with MCMC, starting from MAP as initial value, and plot results
def fit_model(model): print "Fitting vars:" print model.vars.describe() import time start_time = time.time() model.map = mc.MAP(model.vars) model.map.fit(method='fmin_powell', verbose=1) model.mcmc = mc.MCMC(model.vars) model.mcmc.use_step_method(mc.AdaptiveMetropolis, mode...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def robust_lin_reg(df, var_map, \n steps=2000, mcmc='metropolis',\n plot_trace=True, plot_vars=True):\n import pymc3 as pm\n import pandas as pd\n import matplotlib.pyplot as plt\n import numpy as np\n import theano \n \n # Get cols\n df = df[var_map.valu...
[ "0.64326185", "0.6002663", "0.59082", "0.5907472", "0.5891982", "0.58877134", "0.5886521", "0.58731794", "0.57898426", "0.5746489", "0.5707085", "0.5540485", "0.5530723", "0.55105585", "0.5510401", "0.54991907", "0.54921657", "0.5474497", "0.53770715", "0.5369792", "0.5352105...
0.62368906
1
Configure wrapper to use SPI.
def use_spi(): _LIB.oled_click_use_spi()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SPIsetup(self):\n self.writecmd(0x01,0x10,0,self.data); #SPI/SETUP", "def _init_config(self, width, height, spi=None, spiMosi= None, spiDC=None, spiCS=None, spiReset=None, spiClk=None):\n self._spi = spi\n self._spi_mosi = spiMosi\n self._spi_dc = spiDC\n self._spi_cs = spi...
[ "0.64581645", "0.60692745", "0.57994145", "0.5797513", "0.5785946", "0.57624316", "0.57624316", "0.57624316", "0.57624316", "0.575913", "0.5678284", "0.5665971", "0.56648326", "0.56648326", "0.56648326", "0.563461", "0.563461", "0.5623664", "0.5560134", "0.55506355", "0.54671...
0.63154364
1
Configure wrapper to use I2C.
def use_i2c(): _LIB.oled_click_use_i2c()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, machine):\n super().__init__(machine)\n self.features['has_i2c'] = True", "def __init__(self, machine):\n super().__init__(machine)\n self.features['has_i2c'] = True", "def ensureI2C(i2c=None):\n if i2c is None:\n logger.info('Initializing I2C.')\n ...
[ "0.66162145", "0.66162145", "0.65949684", "0.63167465", "0.6111046", "0.6078323", "0.58250207", "0.5788781", "0.5767513", "0.5689637", "0.5681065", "0.55661315", "0.5519384", "0.55006874", "0.5482283", "0.5454556", "0.5420815", "0.5417926", "0.53746414", "0.53718674", "0.5340...
0.7479867
0
Enable the OLED click.
def enable(mikrobus_index): ret = _LIB.oled_click_enable(mikrobus_index) if ret < 0: raise Exception("oled click enable failed")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _led_enable():\n # type: () -> None\n GPIO.output(LED_nOE, GPIO.LOW)", "def turn_on(self):\n GPIO.output(self.gpio, True) # turn on light", "def enable(self):\n self.switch.enable()\n self._enabled = True", "def enable():\n ret = _LIB.led_matrix_click_enable()\n if ret <...
[ "0.7803562", "0.71197575", "0.71039397", "0.69039017", "0.67663074", "0.6755123", "0.6752181", "0.6694265", "0.6667028", "0.6605703", "0.6582292", "0.6561643", "0.6561643", "0.6537502", "0.65163743", "0.64581394", "0.6453925", "0.64473325", "0.6443345", "0.64403516", "0.64364...
0.74189276
1