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
A limited number of items is in the feed.
def test_limit_items(self): AnnouncementFactory( title="Not going to be there", expires_at=timezone.now() - datetime.timedelta(days=1), ) for i in range(5): AnnouncementFactory() response = self.get("announcements:feed") assert "Not going to ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def limit(requestContext, seriesList, n):\n return seriesList[0:n]", "def limit(self, count):\n self._limit = count\n return self", "def test_max_items(self):\r\n timeline = Timeline(connection=self.c1, bucket=self.bucket, max_items=3)\r\n now = datetime.utcnow()\r\n\r\n tim...
[ "0.66845256", "0.6452016", "0.64328825", "0.63778573", "0.63408464", "0.6280421", "0.6278055", "0.62466717", "0.62423396", "0.6150281", "0.6145422", "0.61124396", "0.6075904", "0.60351187", "0.6013344", "0.5996759", "0.59329146", "0.5901975", "0.5897077", "0.5894792", "0.5893...
0.7206275
0
Check the mandatory services.
def check_services(self): for service in self.services: try: self.cloud.search_services(service)[0] except Exception: # pylint: disable=broad-except self.is_skipped = True break
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_services_ready(self, services):\n for ser in services:\n services[ser] = False\n response = self.bus.wait_for_response(Message(\n 'mycroft.{}.is_ready'.format(ser)))\n if response and response.data['status']:\n services...
[ "0.68495893", "0.68265027", "0.67144567", "0.6654075", "0.6653682", "0.66230726", "0.64997345", "0.6361119", "0.6352509", "0.62955403", "0.6243788", "0.6225547", "0.6216019", "0.6185492", "0.6181142", "0.61648095", "0.6110558", "0.60903686", "0.60701483", "0.60660607", "0.604...
0.7447906
0
Check the mandatory network extensions.
def check_extensions(self): extensions = self.cloud.get_network_extensions() for network_extension in self.neutron_extensions: if network_extension not in extensions: LOGGER.warning( "Cannot find Neutron extension: %s", network_extension) s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_whole_network(self):\n if not self.network.check_network():\n # check_network has failed, issue error\n self._display_semantic_error(\"network\")", "def _sanityCheckExtensions(other):\n if other.useEncryptThenMAC not in (True, False):\n raise ValueError(\...
[ "0.63620454", "0.6263202", "0.59751266", "0.5877078", "0.5833472", "0.5802308", "0.57483894", "0.5673013", "0.56446946", "0.56413287", "0.5634714", "0.5619895", "0.5614505", "0.559705", "0.55942374", "0.5593726", "0.55906713", "0.5572346", "0.5547773", "0.55424345", "0.553969...
0.7781191
0
Copy config file to tempest results directory
def backup_tempest_config(conf_file, res_dir): if not os.path.exists(res_dir): os.makedirs(res_dir) shutil.copyfile(conf_file, os.path.join(res_dir, 'tempest.conf'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_config(RESULTSDIR, main_config, io_config):\n print(\"Saving results to: {}\".format(RESULTSDIR))\n\n if not os.path.exists(RESULTSDIR):\n os.makedirs(RESULTSDIR)\n\n mconfig = os.path.join(\n RESULTSDIR, \"copy_main_config_\" + main_config.split(os.sep)[-1]\n )\n dconfig = os...
[ "0.72231483", "0.6721714", "0.6498246", "0.6410498", "0.6409924", "0.6284228", "0.6280437", "0.62706035", "0.6260962", "0.6219964", "0.61791456", "0.6174911", "0.61536056", "0.61037135", "0.6049953", "0.6039108", "0.6026846", "0.6011455", "0.59960604", "0.5987644", "0.5975415...
0.7394381
0
Returns verifier id for current Tempest
def get_verifier_id(): cmd = ("rally verify list-verifiers | awk '/" + getattr(config.CONF, 'tempest_verifier_name') + "/ {print $2}'") with subprocess.Popen( cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) as proc: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_verifier_id():\n cmd = (\"rally verify list-verifiers | awk '/\" +\n getattr(config.CONF, 'tempest_verifier_name') +\n \"/ {print $2}'\")\n proc = subprocess.Popen(cmd, shell=True,\n stdout=subprocess.PIPE,\n stderr=subprocess....
[ "0.6726382", "0.5993047", "0.5835138", "0.57405263", "0.571625", "0.56476825", "0.5630613", "0.5571045", "0.5566842", "0.5514997", "0.5463051", "0.53477794", "0.5343376", "0.5300335", "0.5232395", "0.52306646", "0.52277946", "0.52036935", "0.51771", "0.5170933", "0.5119616", ...
0.6849755
0
Returns installed verifier repo directory for Tempest
def get_verifier_repo_dir(verifier_id): return os.path.join(getattr(config.CONF, 'dir_rally_inst'), 'verification', f'verifier-{verifier_id}', 'repo')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_verifier_repo_dir(verifier_id):\n return os.path.join(getattr(config.CONF, 'dir_rally_inst'),\n 'verification',\n 'verifier-{}'.format(verifier_id),\n 'repo')", "def get_verifier_deployment_dir(verifier_id, deployment_id):\n retur...
[ "0.7211886", "0.6550398", "0.6523984", "0.6448193", "0.6078293", "0.6072598", "0.60545844", "0.6008985", "0.59839743", "0.5949114", "0.591674", "0.58978075", "0.57718587", "0.57658106", "0.57482255", "0.57396054", "0.57301205", "0.57203543", "0.5713774", "0.5703848", "0.56487...
0.71335983
1
Returns Rally deployment directory for current verifier
def get_verifier_deployment_dir(verifier_id, deployment_id): return os.path.join(getattr(config.CONF, 'dir_rally_inst'), 'verification', f'verifier-{verifier_id}', f'for-deployment-{deployment_id}')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_verifier_deployment_dir(verifier_id, deployment_id):\n return os.path.join(getattr(config.CONF, 'dir_rally_inst'),\n 'verification',\n 'verifier-{}'.format(verifier_id),\n 'for-deployment-{}'.format(deployment_id))", "def get_verifie...
[ "0.8431518", "0.70921344", "0.7018849", "0.6559742", "0.6509258", "0.6363346", "0.63590264", "0.6337463", "0.62616277", "0.6258049", "0.6232877", "0.618148", "0.6174993", "0.6173079", "0.6141118", "0.613199", "0.61280704", "0.61003804", "0.61003804", "0.6097256", "0.60898834"...
0.8463894
0
Add/update needed parameters into tempest.conf file
def configure_tempest_update_params( tempest_conf_file, image_id=None, flavor_id=None, compute_cnt=1, image_alt_id=None, flavor_alt_id=None, admin_role_name='admin', cidr='192.168.120.0/24', domain_id='default'): # pylint: disable=too-many-branches,too-many-argume...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure_tempest_update_params(\n tempest_conf_file, image_id=None, flavor_id=None,\n compute_cnt=1, image_alt_id=None, flavor_alt_id=None,\n admin_role_name='admin', cidr='192.168.120.0/24',\n domain_id='default'):\n # pylint: disable=too-many-branches,too-many-arguments,too-ma...
[ "0.6802182", "0.64552474", "0.6451729", "0.63806546", "0.63676286", "0.6205747", "0.6151945", "0.6128843", "0.6123329", "0.6080413", "0.6043109", "0.60316396", "0.60109645", "0.60026515", "0.6000327", "0.5974877", "0.59499687", "0.59417", "0.5926952", "0.5922703", "0.5922703"...
0.67729205
1
Execute rally verify configureverifier, which generates tempest.conf
def configure_verifier(deployment_dir): cmd = ['rally', 'verify', 'configure-verifier', '--reconfigure', '--id', str(getattr(config.CONF, 'tempest_verifier_name'))] output = subprocess.check_output(cmd) LOGGER.info("%s\n%s", " ".join(cmd), output.decode("utf-8")) LOGGER.d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure_verifier(deployment_dir):\n cmd = ['rally', 'verify', 'configure-verifier', '--reconfigure',\n '--id', str(getattr(config.CONF, 'tempest_verifier_name'))]\n output = subprocess.check_output(cmd)\n LOGGER.info(\"%s\\n%s\", \" \".join(cmd), output)\n\n LOGGER.debug(\"Looking for t...
[ "0.7838847", "0.622833", "0.62158334", "0.6102185", "0.5732694", "0.5659994", "0.5577749", "0.5537725", "0.55346674", "0.5523457", "0.55181223", "0.54858464", "0.545961", "0.5390529", "0.5359512", "0.53589606", "0.53571224", "0.53334934", "0.5332391", "0.53290427", "0.5324495...
0.77928317
1
Generate test list based on the test mode.
def generate_test_list(self, **kwargs): LOGGER.debug("Generating test case list...") self.backup_tempest_config(self.conf_file, '/etc') if kwargs.get('mode') == 'custom': if os.path.isfile(self.tempest_custom): shutil.copyfile( self.tempest_custom,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_test_list(tdir):\n\n # Skip this if it already exists\n if os.path.exists(os.path.join(tdir.name, \"kstest-list\")):\n return\n\n kstest_log = os.path.join(tdir.name, \"kstest.log\")\n with open(kstest_log) as f:\n for line in f.readlines():\n if not line.startswit...
[ "0.7224584", "0.7033538", "0.7009234", "0.6971499", "0.6883801", "0.6699291", "0.6692297", "0.66435987", "0.6586937", "0.65175205", "0.64307505", "0.6429683", "0.6429683", "0.64266276", "0.63944846", "0.63704103", "0.6363472", "0.6362816", "0.6362721", "0.6325249", "0.6308668...
0.77115947
0
Parse and save test results.
def parse_verifier_result(self): stat = self.get_verifier_result(self.verification_id) try: num_executed = stat['num_tests'] - stat['num_skipped'] try: self.result = 100 * stat['num_success'] / num_executed except ZeroDivisionError: sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_parse(self): \n\n results = self.parser.parse()\n self.assertEqual(results, test_case_data['parse_output'])", "def __parse(self, results):\n in_doc = False\n document_txt = None\n cases = []\n for line in results:\n line = line.rstrip()\n ...
[ "0.6879487", "0.6688299", "0.6649461", "0.6597607", "0.6562047", "0.64070547", "0.62938046", "0.6256871", "0.611408", "0.61135256", "0.6107557", "0.6100069", "0.60896564", "0.60574466", "0.6056988", "0.6002144", "0.6000668", "0.59979934", "0.5993954", "0.5988928", "0.5985693"...
0.70347
0
Detect and update the default role if required
def update_default_role(self, rally_conf='/etc/rally/rally.conf'): role = self.get_default_role(self.cloud) if not role: return rconfig = configparser.RawConfigParser() rconfig.read(rally_conf) if not rconfig.has_section('openstack'): rconfig.add_section('...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _overrideRole(self, newRole, args):\n oldRole = args.get('role', None)\n args['role'] = newRole\n return oldRole", "def changeRole(self, node, role):", "def _set_override_role_called(self):\n self.__override_role_called = True", "async def temprole(self, ctx: commands.Context,...
[ "0.7115389", "0.66387266", "0.65806973", "0.6452636", "0.6433589", "0.6405648", "0.6374333", "0.63238055", "0.6319324", "0.630769", "0.630502", "0.6269636", "0.6241185", "0.61868477", "0.6167082", "0.61618745", "0.61153567", "0.6087079", "0.6085021", "0.60780394", "0.60377514...
0.6722509
1
Update auth section in tempest.conf
def update_auth_section(self): rconfig = configparser.RawConfigParser() rconfig.read(self.conf_file) if not rconfig.has_section("auth"): rconfig.add_section("auth") if env.get("NEW_USER_ROLE").lower() != "member": tempest_roles = [] if rconfig.has_opti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def override_config(self):\n super(AuthedConfigFixture, self).override_config()\n self.conf.register_opts(auth_token._OPTS, group='keystone_authtoken')\n self.conf.set_override('auth_uri', 'http://127.0.0.1:35357',\n group='keystone_authtoken')", "def set_auth_c...
[ "0.7055258", "0.6269132", "0.6093893", "0.60797375", "0.6063509", "0.6012555", "0.59593356", "0.59593356", "0.59572875", "0.5940929", "0.5885352", "0.58571965", "0.5832692", "0.5775332", "0.5770373", "0.57187825", "0.5698276", "0.56846017", "0.5671843", "0.563528", "0.5626709...
0.767204
0
Update network section in tempest.conf
def update_network_section(self): rconfig = configparser.RawConfigParser() rconfig.read(self.conf_file) if self.ext_net: if not rconfig.has_section('network'): rconfig.add_section('network') rconfig.set('network', 'public_network_id', self.ext_net.id) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_compute_section(self):\n rconfig = configparser.RawConfigParser()\n rconfig.read(self.conf_file)\n if not rconfig.has_section('compute'):\n rconfig.add_section('compute')\n rconfig.set(\n 'compute', 'fixed_network_name',\n self.network.name if...
[ "0.696991", "0.6750749", "0.63753676", "0.6196263", "0.59945536", "0.5972814", "0.59464866", "0.5930914", "0.590459", "0.5895841", "0.58937216", "0.58452964", "0.5844862", "0.5843245", "0.5838263", "0.5832796", "0.5832103", "0.5824422", "0.5822572", "0.5797349", "0.57946074",...
0.7767487
0
Update compute section in tempest.conf
def update_compute_section(self): rconfig = configparser.RawConfigParser() rconfig.read(self.conf_file) if not rconfig.has_section('compute'): rconfig.add_section('compute') rconfig.set( 'compute', 'fixed_network_name', self.network.name if self.networ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure_tempest_update_params(\n tempest_conf_file, image_id=None, flavor_id=None,\n compute_cnt=1, image_alt_id=None, flavor_alt_id=None,\n admin_role_name='admin', cidr='192.168.120.0/24',\n domain_id='default'):\n # pylint: disable=too-many-branches,too-many-arguments,too-ma...
[ "0.68594015", "0.6751863", "0.6320202", "0.6044343", "0.6011546", "0.58627504", "0.58251506", "0.5803778", "0.579407", "0.57885367", "0.57636315", "0.5726174", "0.5714447", "0.5692595", "0.56901807", "0.5688542", "0.56050336", "0.55926406", "0.5581348", "0.5575753", "0.555043...
0.7990638
0
Update validation section in tempest.conf
def update_validation_section(self): rconfig = configparser.RawConfigParser() rconfig.read(self.conf_file) if not rconfig.has_section('validation'): rconfig.add_section('validation') rconfig.set( 'validation', 'connect_method', 'floating' if self.ext_n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_config(self):\n pass", "def validate_config(self):\n pass", "def _validate_config(self):\n pass", "def validate_settings(_cfg, _ctx):\n pass", "def validate_config():\n\n # diff/sync settings, not including templates (see below)\n nori.setting_check_list('action', [...
[ "0.65538985", "0.65538985", "0.6428385", "0.6422519", "0.6317255", "0.62712306", "0.62712306", "0.58824056", "0.58824056", "0.58192813", "0.57234484", "0.56826675", "0.5652729", "0.5652712", "0.56522995", "0.56318414", "0.5625317", "0.5567985", "0.55444556", "0.55250084", "0....
0.7201769
0
Update scenario section in tempest.conf
def update_scenario_section(self): rconfig = configparser.RawConfigParser() rconfig.read(self.conf_file) filename = getattr( config.CONF, f'{self.case_name}_image', self.filename) if not rconfig.has_section('scenario'): rconfig.add_section('scenario') rcon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure(self, section):", "def test_update_scenario(self):\n pass", "def test_set_new_section_property():\n\n value = '1'\n testutils.deploy_config_raw(\"\")\n\n prop.set_prop('info', 'sdk', value)\n assert prop.get_prop('info', 'sdk') == value\n\n testutils.undeploy()\n\n return...
[ "0.61347264", "0.60817313", "0.60120815", "0.5875747", "0.5773806", "0.5770869", "0.57243615", "0.5709222", "0.5686607", "0.5598393", "0.5580826", "0.5557054", "0.55527663", "0.551544", "0.5515208", "0.54568624", "0.54538155", "0.5447713", "0.5440486", "0.5423029", "0.5410496...
0.6915758
0
Update dashboard section in tempest.conf
def update_dashboard_section(self): rconfig = configparser.RawConfigParser() rconfig.read(self.conf_file) if env.get('DASHBOARD_URL'): if not rconfig.has_section('dashboard'): rconfig.add_section('dashboard') rconfig.set('dashboard', 'dashboard_url', env.g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dashboards_v2_update(self):\n pass", "def dashboard():", "def conf_update(self):\n pass", "def configure(self, section):", "def dashboard(self):\r\n return {}", "def put_cloudwatch_dashboard(self):\n\n cloudwatch_config = self.provider_config[\"cloudwatch\"]\n dash...
[ "0.6211464", "0.6072598", "0.5836697", "0.57798123", "0.5621353", "0.5581383", "0.5558267", "0.547862", "0.54553175", "0.53960663", "0.53905696", "0.53771514", "0.5368407", "0.53436995", "0.53193396", "0.53101474", "0.5291737", "0.5288086", "0.5276987", "0.52725184", "0.52718...
0.7722257
0
Turns a waze linestring into a geojson linestring
def get_linestring(value): line = value['line'] coords = [(x['x'], x['y']) for x in line] return geojson.Feature( geometry=geojson.LineString(coords), properties=value )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lineToPolygon(geom):\n assert(geom[\"type\"] == \"LineString\")\n # LineString is only the exterior line of a polygon (no holes possible)\n return geojson.Polygon(coordinates=[geom[\"coordinates\"]], validate=True)", "def parse_point(line):\n return json.loads(line)", "def ways2geometry(overpas...
[ "0.67091656", "0.6261151", "0.6204115", "0.61178505", "0.6099191", "0.5865695", "0.5834806", "0.5778352", "0.57694143", "0.5755196", "0.5703966", "0.5692615", "0.568841", "0.56757134", "0.5596205", "0.5546677", "0.55370474", "0.54986805", "0.54589975", "0.54281527", "0.537382...
0.73890424
0
Given a dict with keys of segment id, and val a list of waze jams (for now, just jams), the properties of a road segment, and the total number of snapshots we're looking at, update the road segment's properties to include features
def get_features(waze_info, properties, num_snapshots): # Waze feature list # jam_percent - percentage of snapshots that have a jam on this segment if properties['segment_id'] in waze_info: # only count one jam per snapshot on a road num_jams = len(set([x['properties']['snapshotId'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_segmentation_map(segmap, object_map):\n obj_pix = object_map != 0\n segmap[obj_pix] = object_map[obj_pix]\n return segmap", "def map_segments(datadir, filename):\n items = json.load(open(filename))\n\n # Only look at jams for now\n items = [get_linestring(x) for x in items if x['even...
[ "0.5607581", "0.547822", "0.5368693", "0.5272165", "0.51953465", "0.5120909", "0.51085174", "0.5026395", "0.4963226", "0.4891959", "0.48770952", "0.48622277", "0.48405787", "0.48178878", "0.48024377", "0.4794791", "0.47820604", "0.47804672", "0.47776642", "0.47595677", "0.473...
0.5887457
0
Map a set of waze segment info (jams) onto segments drawn from
def map_segments(datadir, filename): items = json.load(open(filename)) # Only look at jams for now items = [get_linestring(x) for x in items if x['eventType'] == 'jam'] items = util.reproject_records(items) # Get the total number of snapshots in the waze data num_snapshots = max([x['propertie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def watershed_segment(M,xM=None,yM=None):\n\n if xM != None and yM != None:\n sel = np.ones((int(ceil(23.9*xM)),int(ceil(23.9*yM)))) # for opening\n sel2 = np.ones((int(ceil(127.2*xM)),int(ceil(127.2*yM)))) # for local thresholding\n sel3 = np.ones((int(ceil(11.9*xM)),int(ceil(11.9*yM)))) #...
[ "0.55145633", "0.5488799", "0.544273", "0.5393466", "0.53590786", "0.5282899", "0.52790564", "0.52568614", "0.5226479", "0.5168571", "0.51627374", "0.5147692", "0.5122647", "0.5085006", "0.507419", "0.5074113", "0.5067044", "0.5063809", "0.50582534", "0.50517637", "0.50384414...
0.67416376
0
change self.O to index of V
def trans_o(self): temp_array = [] for j in range(self.O.shape[1]): for i in range(self.V.shape[1]): if self.V[0, i] == self.O[0, j]: temp_array.append(i) self.O = mat(temp_array)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_v_item(self, vindex, new_val):\n\n i = [((0, 0),),\n ((1, 1),),\n ((2, 2),),\n ([1, 2], [2, 1]),\n ([2, 0], [0, 2]),\n ([0, 1], [1, 0])]\n\n for j, k in i[vindex]:\n self[j, k] = new_val", "def position(self, u, v):\n ...
[ "0.616067", "0.5951123", "0.5940856", "0.59249765", "0.589935", "0.58980864", "0.5833399", "0.5831099", "0.57763237", "0.57763237", "0.5732142", "0.5729264", "0.571432", "0.5690176", "0.5676093", "0.56725025", "0.5644405", "0.56342834", "0.5614423", "0.55696946", "0.5519098",...
0.7162628
0
This method is so that child classes can define additional object state checks before cloning (e.g. see ModelWrapperBase which should not clone if the modelcaching manager has already been set)
def additional_cloning_checks(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _try_clone_model(model):\n try:\n return copy.deepcopy(model)\n except Exception:\n warnings.warn(\n \"Failed to clone model. Model state might be mutated during verification.\"\n )\n return model", "def sanitize_clone(self):\n pass", "def clone(self):\n ...
[ "0.622249", "0.6182846", "0.6147965", "0.61453974", "0.60161626", "0.60104495", "0.5994128", "0.5990812", "0.5983475", "0.5928679", "0.5925357", "0.59229016", "0.58280325", "0.581751", "0.5797897", "0.57970923", "0.5795579", "0.5782216", "0.57797414", "0.5779336", "0.57745355...
0.73478645
0
Saves the computed kernel for easy lookup as .npz file
def create_kernel(ktype='sph-anarchy'): kernel = get_kernel(ktype) header = np.array([{'kernel': ktype, 'bins': kernsize}]) np.savez('kernel_{}.npz'.format(ktype), header=header, kernel=kernel) print (header) return kernel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, filename):\n np.savez(temp_dir + '/' + filename + '.npz', chip_ids=self.chip_ids, core_ids=self.core_ids, cx_ids=self.cx_ids)", "def save(self, model_out_file):\n\t\tvariables_dict = {v.name: v for v in tf.global_variables()}\n\t\tvalues_dict = self.sess.run(variables_dict)\n\t\tnp.savez(op...
[ "0.6442163", "0.6418604", "0.6242592", "0.62161463", "0.6036001", "0.59375066", "0.5916903", "0.5870925", "0.5862356", "0.58407557", "0.582576", "0.5815789", "0.58025026", "0.5755386", "0.5704577", "0.5699239", "0.5672944", "0.56612027", "0.56331027", "0.5628472", "0.5596223"...
0.6803789
0
Custom save method to autoset the phs field.
def save(self, *args, **kwargs): self.phs = self.set_phs() super(Study, self).save(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, *args, **kwargs):\n if not self.pkhash:\n self.pkhash = compute_hash(self.script)\n super(DataOpener, self).save(*args, **kwargs)", "def save(self, *args, **kwargs):\n super().save(*args, **kwargs)", "def save(self, *args, **kwargs):\n super().save(*args, *...
[ "0.6665393", "0.6541349", "0.6541349", "0.6539829", "0.63699436", "0.6302961", "0.627035", "0.62583447", "0.62583447", "0.62583447", "0.62583447", "0.62583447", "0.62433136", "0.6223159", "0.6214938", "0.61958426", "0.6168871", "0.61671007", "0.6163853", "0.613194", "0.61283"...
0.7240601
0
Automatically set phs from the study's accession number. Properly format the phs number for this study, so it's easier to get to in templates.
def set_phs(self): return 'phs{:06}'.format(self.i_accession)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_spondaic(self, scansion: str) -> str:\n mark_list = string_utils.mark_list(scansion)\n vals = list(scansion.replace(\" \", \"\"))\n new_vals = self.SPONDAIC_PENTAMETER[:-1] + vals[-1]\n corrected = \"\".join(new_vals)\n new_line = list(\" \" * len(scansion))\n for...
[ "0.51352465", "0.5065886", "0.50378156", "0.49864033", "0.49230617", "0.4835675", "0.4805406", "0.4756666", "0.47290546", "0.4711049", "0.46981743", "0.46366873", "0.45931435", "0.45776656", "0.4569041", "0.45661506", "0.4560519", "0.45518896", "0.4550762", "0.45448464", "0.4...
0.59272975
0
Gets the absolute URL of the detail page for a given Study instance.
def get_absolute_url(self): return reverse('trait_browser:source:studies:pk:detail', kwargs={'pk': self.pk})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_absolute_url(self):\n return ('publication_detail', (), {'slug': self.slug})", "def exam_url(self, obj):\n request = self.context.get(\"request\")\n return reverse(\"exam-detail\", args=[obj.id], request=request)", "def details_url(self):\n if self._data.get('details_url'):\...
[ "0.6810438", "0.6689379", "0.6567158", "0.64550245", "0.64396584", "0.64053893", "0.63963675", "0.6392365", "0.63474274", "0.63005847", "0.62952244", "0.6280981", "0.62611544", "0.62428", "0.62371224", "0.6232598", "0.62293047", "0.6219801", "0.62155926", "0.6194746", "0.6167...
0.7098282
0
Produce a url to initially populate checkboxes in the search page based on the study.
def get_search_url(self): return reverse('trait_browser:source:studies:pk:traits:search', kwargs={'pk': self.pk})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dataset_search_url(self):\n return reverse('trait_browser:source:studies:pk:datasets:search', kwargs={'pk': self.pk})", "def form_search_url(self):\r\n self.reformat_search_for_spaces()\r\n self.target_yt_search_url_str = self.prefix_of_search_url + self.yt_search_key + self.filter_u...
[ "0.5623152", "0.5556928", "0.55449784", "0.5331433", "0.52878296", "0.52027786", "0.5178475", "0.51745033", "0.51574606", "0.51473963", "0.5132062", "0.51022416", "0.51008046", "0.5066496", "0.50376517", "0.5019615", "0.501772", "0.50154096", "0.5013686", "0.50117487", "0.500...
0.60279405
0
Produce a url to search datasets wtihin the study.
def get_dataset_search_url(self): return reverse('trait_browser:source:studies:pk:datasets:search', kwargs={'pk': self.pk})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dataset_url(self, dataset: Dict) -> str:\n return f\"{self.site_url}/dataset/{dataset['name']}\"", "def url(self) -> str:\n return self.DATASET_URLS[self.name]", "def get_search_url(free_text_search):\n url = baseUrl + \"data/\"\n if not free_text_search:\n url += \"warehouse...
[ "0.7010941", "0.66344947", "0.6386537", "0.6122667", "0.60913324", "0.60644984", "0.5981221", "0.5981221", "0.5922729", "0.58895314", "0.5875229", "0.58479536", "0.5847596", "0.5828358", "0.5824677", "0.5810934", "0.5793076", "0.5771518", "0.57501584", "0.57501584", "0.573606...
0.765159
0
Get html for study's name linking to study detail page.
def get_name_link_html(self): url_text = "{{% url 'trait_browser:source:studies:pk:detail' pk={} %}} ".format(self.pk) return URL_HTML.format(url=url_text, name=self.i_study_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def study():\n return render_template('study.html')", "def get_study_info(study_link):\n template = \"https://clinicaltrials.gov{}\"\n study_link = study_link.replace(' ', '+')\n return template.format(study_link)", "def get_study_name_from_id(self, study_id: int) -> str:\n raise NotImplemente...
[ "0.68769675", "0.6697346", "0.61508894", "0.60814106", "0.60482645", "0.6036819", "0.588089", "0.58306956", "0.5795159", "0.57281035", "0.56913704", "0.5666021", "0.5664573", "0.5647374", "0.5640818", "0.5606993", "0.56017995", "0.559533", "0.5540547", "0.5521373", "0.5483745...
0.8060419
0
Return a count of the number of tags for which current traits are tagged, but archived, in this study.
def get_archived_tags_count(self): return apps.get_model('tags', 'TaggedTrait').objects.archived().filter( trait__source_dataset__source_study_version__study=self ).current().aggregate( models.Count('tag', distinct=True))['tag__count']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_archived_traits_tagged_count(self):\n return apps.get_model('tags', 'TaggedTrait').objects.archived().filter(\n trait__source_dataset__source_study_version__study=self\n ).current().aggregate(\n models.Count('trait', distinct=True)\n )['trait__count']", "def get...
[ "0.85525626", "0.8337307", "0.808836", "0.7484111", "0.7208109", "0.6977215", "0.6822008", "0.6755481", "0.66966176", "0.6484534", "0.63340545", "0.62938446", "0.6283145", "0.6265508", "0.6221511", "0.6198768", "0.6086896", "0.6075747", "0.6005409", "0.5969021", "0.59272254",...
0.84307426
1
Return a queryset of all of the current TaggedTraits from this study.
def get_all_tagged_traits(self): return apps.get_model('tags', 'TaggedTrait').objects.filter( trait__source_dataset__source_study_version__study=self, ).current()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_archived_tagged_traits(self):\n return apps.get_model('tags', 'TaggedTrait').objects.archived().filter(\n trait__source_dataset__source_study_version__study=self\n ).current()", "def get_all_traits_tagged_count(self):\n return SourceTrait.objects.filter(\n sourc...
[ "0.6514019", "0.6437152", "0.6416004", "0.6301729", "0.61813736", "0.61287004", "0.61267114", "0.6058266", "0.5956338", "0.59383553", "0.5782794", "0.5782794", "0.57523257", "0.568733", "0.5643809", "0.5636289", "0.55189633", "0.5469623", "0.5362374", "0.53501254", "0.5303839...
0.8149221
0
Return a queryset of the current archived TaggedTraits from this study.
def get_archived_tagged_traits(self): return apps.get_model('tags', 'TaggedTrait').objects.archived().filter( trait__source_dataset__source_study_version__study=self ).current()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def archived_tags(self):\n archived_tagged_traits = apps.get_model('tags', 'TaggedTrait').objects.archived().filter(trait=self)\n return apps.get_model('tags', 'Tag').objects.filter(\n pk__in=archived_tagged_traits.values_list('tag__pk', flat=True))", "def get_non_archived_tagged_traits(...
[ "0.77290195", "0.75084317", "0.72397757", "0.71252674", "0.65865415", "0.64593077", "0.64155614", "0.62145716", "0.61490464", "0.60586834", "0.6027033", "0.58406144", "0.5763332", "0.56548536", "0.5611018", "0.5603707", "0.5603707", "0.5603707", "0.55999005", "0.5566254", "0....
0.8213264
0
Return a queryset of the current nonarchived TaggedTraits from this study.
def get_non_archived_tagged_traits(self): return apps.get_model('tags', 'TaggedTrait').objects.current().non_archived().filter( trait__source_dataset__source_study_version__study=self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_archived_tagged_traits(self):\n return apps.get_model('tags', 'TaggedTrait').objects.archived().filter(\n trait__source_dataset__source_study_version__study=self\n ).current()", "def get_all_tagged_traits(self):\n return apps.get_model('tags', 'TaggedTrait').objects.filter...
[ "0.775637", "0.73766696", "0.708502", "0.68280214", "0.6783516", "0.6571693", "0.6464671", "0.6396007", "0.63075525", "0.611397", "0.6077231", "0.60213524", "0.59917337", "0.590065", "0.5870306", "0.58424973", "0.5763946", "0.57431793", "0.56793123", "0.56793123", "0.56793123...
0.82755035
0
Return the count of all current traits that have been tagged in this study.
def get_all_traits_tagged_count(self): return SourceTrait.objects.filter( source_dataset__source_study_version__study=self ).current().exclude(all_tags=None).count()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_non_archived_traits_tagged_count(self):\n return apps.get_model('tags', 'TaggedTrait').objects.current().non_archived().filter(\n trait__source_dataset__source_study_version__study=self).aggregate(\n models.Count('trait', distinct=True))['trait__count']", "def get_archived_tr...
[ "0.7672161", "0.7633912", "0.7162639", "0.7084544", "0.67033195", "0.66352296", "0.6590511", "0.64851606", "0.6463744", "0.63729537", "0.6240862", "0.6184167", "0.6182421", "0.60347986", "0.60346127", "0.6001969", "0.6001855", "0.5997859", "0.5997859", "0.5991083", "0.5980368...
0.85028684
0
Return the count of current traits that have been tagged (and the tag archived) in this study.
def get_archived_traits_tagged_count(self): return apps.get_model('tags', 'TaggedTrait').objects.archived().filter( trait__source_dataset__source_study_version__study=self ).current().aggregate( models.Count('trait', distinct=True) )['trait__count']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_non_archived_traits_tagged_count(self):\n return apps.get_model('tags', 'TaggedTrait').objects.current().non_archived().filter(\n trait__source_dataset__source_study_version__study=self).aggregate(\n models.Count('trait', distinct=True))['trait__count']", "def get_archived_ta...
[ "0.8268371", "0.80618906", "0.79486185", "0.75812364", "0.7075274", "0.6992174", "0.69508713", "0.66764146", "0.6522477", "0.6356951", "0.63389266", "0.62884736", "0.6141169", "0.6141169", "0.6046133", "0.5984525", "0.5980168", "0.5971963", "0.5918252", "0.5876502", "0.586792...
0.85503507
0
Return the count of current traits that have been tagged (and the tag not archived) in this study.
def get_non_archived_traits_tagged_count(self): return apps.get_model('tags', 'TaggedTrait').objects.current().non_archived().filter( trait__source_dataset__source_study_version__study=self).aggregate( models.Count('trait', distinct=True))['trait__count']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_traits_tagged_count(self):\n return SourceTrait.objects.filter(\n source_dataset__source_study_version__study=self\n ).current().exclude(all_tags=None).count()", "def get_archived_traits_tagged_count(self):\n return apps.get_model('tags', 'TaggedTrait').objects.archive...
[ "0.823464", "0.8140047", "0.7480824", "0.7419102", "0.71749496", "0.70208025", "0.6762968", "0.67440826", "0.65510833", "0.6394683", "0.63454866", "0.6240015", "0.6186335", "0.6186335", "0.615093", "0.615016", "0.6122516", "0.6041667", "0.59720755", "0.5931473", "0.58819157",...
0.8264949
0
Return the most recent SourceStudyVersion linked to this study.
def get_latest_version(self): try: version = self.sourcestudyversion_set.filter( i_is_deprecated=False ).order_by( # We can't use "latest" since it only accepts one field in Django 1.11. '-i_version', '-i_date_added' ).first() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_latest_version(self):\n study = self.source_study_version.study\n current_study_version = self.source_study_version.study.get_latest_version()\n if current_study_version is None:\n return None\n # Find the same dataset associated with the current study version.\n ...
[ "0.7559727", "0.7077481", "0.6922376", "0.68969524", "0.6865629", "0.6647644", "0.6573123", "0.64721805", "0.6470273", "0.6398663", "0.6269095", "0.6241272", "0.62055796", "0.61247975", "0.61089414", "0.61071545", "0.61031723", "0.6082287", "0.60816973", "0.60259306", "0.5994...
0.7674174
0
Return a dbGaP link to the page for the latest SourceStudyVersion.
def get_latest_version_link(self): return self.get_latest_version().dbgap_link
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def version_link(self):\n release_link = url_for('data.data', selected_release=self.DATASET_RELEASE)\n return Markup(f\"<a href='{release_link}'>{self.DATASET_RELEASE}</a>\")", "def set_dbgap_link(self):\n return self.STUDY_VERSION_URL.format(self.full_accession)", "def get_latest_version(...
[ "0.6841118", "0.6463157", "0.6224093", "0.57410735", "0.56654507", "0.5629362", "0.55557", "0.5552489", "0.5513178", "0.5491778", "0.54240173", "0.53660846", "0.5361276", "0.53601146", "0.5352483", "0.53248584", "0.52955514", "0.5282903", "0.5276562", "0.5262418", "0.5259679"...
0.6467567
1
Automatically set full_accession from the study's phs value.
def set_full_accession(self): return self.STUDY_VERSION_ACCESSION.format(self.study.phs, self.i_version, self.i_participant_set)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_full_accession(self):\n return self.DATASET_ACCESSION.format(\n self.i_accession, self.i_version, self.source_study_version.i_participant_set)", "def set_full_accession(self):\n return self.VARIABLE_ACCESSION.format(\n self.i_dbgap_variable_accession, self.i_dbgap_vari...
[ "0.69272184", "0.6779552", "0.5763856", "0.51321983", "0.50852907", "0.5062284", "0.5008536", "0.49571142", "0.46755826", "0.46588916", "0.46557772", "0.46504992", "0.46206248", "0.45762715", "0.45750052", "0.4568539", "0.4559341", "0.4549361", "0.45215124", "0.44915038", "0....
0.72539365
0
Return an ordered queryset of previous versions.
def get_previous_versions(self): return self.study.sourcestudyversion_set.filter( i_version__lte=self.i_version, i_date_added__lt=self.i_date_added ).order_by( '-i_version', '-i_date_added' )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_previous_version(self):\n return self.get_previous_versions().first()", "def update_previous_all_versions():\n\n # get all the ids\n version_ids = m.meta.Session.query(distinct(tst.TestVersion.id)).filter_by(archived=False).\\\n join('methods').filter_by(short_name='Online').\\\n ...
[ "0.6681544", "0.65478915", "0.6312672", "0.6222891", "0.6191354", "0.61462396", "0.60991406", "0.5949714", "0.5930343", "0.59164745", "0.58782697", "0.587286", "0.5844892", "0.58411556", "0.57994163", "0.57472384", "0.5726047", "0.57105625", "0.5678144", "0.5673545", "0.56406...
0.8416572
0
Return the previous version of this study.
def get_previous_version(self): return self.get_previous_versions().first()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_previous_version(self):\n previous_study_version = self.source_dataset.source_study_version.get_previous_version()\n if previous_study_version is not None:\n try:\n previous_trait = SourceTrait.objects.get(\n source_dataset__source_study_version=pr...
[ "0.76663053", "0.7525812", "0.7337205", "0.7286422", "0.72301817", "0.71594524", "0.7139116", "0.7111315", "0.710192", "0.7072759", "0.7060298", "0.70384383", "0.70250046", "0.69853616", "0.6982506", "0.6953244", "0.69062996", "0.690354", "0.6884494", "0.68721044", "0.6863742...
0.85586053
0
Return a queryset of SourceTraits that are new in this version compared to past versions.
def get_new_sourcetraits(self): previous_study_version = self.get_previous_version() SourceTrait = apps.get_model('trait_browser', 'SourceTrait') if previous_study_version is not None: qs = SourceTrait.objects.filter( source_dataset__source_study_version=self ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_previous_versions(self):\n return self.study.sourcestudyversion_set.filter(\n i_version__lte=self.i_version,\n i_date_added__lt=self.i_date_added\n ).order_by(\n '-i_version',\n '-i_date_added'\n )", "def get_new_sourcedatasets(self):\n ...
[ "0.6562757", "0.6290495", "0.6281095", "0.6281095", "0.6224384", "0.61902857", "0.6117538", "0.60669696", "0.59755343", "0.59755343", "0.59755343", "0.59755343", "0.59755343", "0.59755343", "0.59033275", "0.58881015", "0.5698667", "0.5668605", "0.5618832", "0.5610577", "0.560...
0.7811303
0
Return a queryset of SourceDatasets that are new in this version compared to past versions.
def get_new_sourcedatasets(self): previous_study_version = self.get_previous_version() SourceDataset = apps.get_model('trait_browser', 'SourceDataset') if previous_study_version is not None: qs = SourceDataset.objects.filter(source_study_version=self) # We can probably wr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_previous_versions(self):\n return self.study.sourcestudyversion_set.filter(\n i_version__lte=self.i_version,\n i_date_added__lt=self.i_date_added\n ).order_by(\n '-i_version',\n '-i_date_added'\n )", "def test_no_deprecated_datasets_in_quer...
[ "0.6738969", "0.6347704", "0.6347704", "0.6347704", "0.6267281", "0.6221294", "0.6144477", "0.58199567", "0.58199567", "0.58199567", "0.55291677", "0.5501097", "0.5491006", "0.5466397", "0.5387165", "0.5362838", "0.5351967", "0.5326075", "0.5303191", "0.52874905", "0.528596",...
0.7908077
0
Apply tags from traits in the previous version of this Study to traits from this version.
def apply_previous_tags(self, user): previous_study_version = self.get_previous_version() if previous_study_version is not None: SourceTrait = apps.get_model('trait_browser', 'SourceTrait') TaggedTrait = apps.get_model('tags', 'TaggedTrait') DCCReview = apps.get_model...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_previous_tags(self, creator):\n TaggedTrait = apps.get_model('tags', 'TaggedTrait')\n DCCReview = apps.get_model('tags', 'DCCReview')\n StudyResponse = apps.get_model('tags', 'StudyResponse')\n previous_trait = self.get_previous_version()\n if previous_trait is not None...
[ "0.67002356", "0.5798329", "0.5789118", "0.5662857", "0.5602511", "0.5436931", "0.53949434", "0.53218657", "0.53102833", "0.52779347", "0.5261458", "0.51905525", "0.5164367", "0.5156515", "0.5149465", "0.51158303", "0.50836796", "0.50706464", "0.5012632", "0.49430275", "0.494...
0.7317276
0
Custom save method to autoset full_accession and dbgap_link.
def save(self, *args, **kwargs): self.full_accession = self.set_full_accession() self.dbgap_link = self.set_dbgap_link() super(SourceDataset, self).save(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, *args, **kwargs):\n self.full_accession = self.set_full_accession()\n self.dbgap_link = self.set_dbgap_link()\n super(SourceTrait, self).save(*args, **kwargs)", "def save(self, *args, **kwargs):\n self.full_accession = self.set_full_accession()\n self.dbgap_link ...
[ "0.7209021", "0.71559155", "0.6393143", "0.6363915", "0.6306047", "0.62788814", "0.5810558", "0.57993186", "0.5722098", "0.57087", "0.570662", "0.56933665", "0.567312", "0.5658324", "0.5658324", "0.56490225", "0.56343424", "0.56319344", "0.56160986", "0.56087613", "0.5595003"...
0.73582214
0
Gets the absolute URL of the detail page for a given SourceDataset instance.
def get_absolute_url(self): return reverse('trait_browser:source:datasets:detail', kwargs={'pk': self.pk})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_absolute_url(self):\n\t\treturn reverse('source-detail', args=[str(self.id)])", "def get_absolute_url(self):\n return reverse('trait_browser:source:studies:pk:detail', kwargs={'pk': self.pk})", "def get_absolute_url(self):\n return ('publication_detail', (), {'slug': self.slug})", "def ...
[ "0.7320892", "0.71635264", "0.6769658", "0.66936725", "0.6665065", "0.66157633", "0.66050607", "0.658594", "0.65774614", "0.65592086", "0.6530993", "0.6519312", "0.6510253", "0.65062296", "0.65050864", "0.64783823", "0.64783823", "0.6441861", "0.6411554", "0.6410512", "0.6402...
0.75452507
0
Automatically set full_accession from the dataset's dbGaP identifiers.
def set_full_accession(self): return self.DATASET_ACCESSION.format( self.i_accession, self.i_version, self.source_study_version.i_participant_set)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_full_accession(self):\n return self.VARIABLE_ACCESSION.format(\n self.i_dbgap_variable_accession, self.i_dbgap_variable_version,\n self.source_dataset.source_study_version.i_participant_set)", "def set_full_accession(self):\n return self.STUDY_VERSION_ACCESSION.format(...
[ "0.69682556", "0.6225129", "0.5945919", "0.54449517", "0.5160533", "0.5116956", "0.5025976", "0.49088228", "0.47938767", "0.47933", "0.4758362", "0.47100648", "0.4704993", "0.46769676", "0.4670057", "0.46583503", "0.46069586", "0.46018344", "0.45937777", "0.45649543", "0.4514...
0.72782624
0
Automatically set dbgap_link from dbGaP identifier information.
def set_dbgap_link(self): return self.DATASET_URL.format(self.source_study_version.full_accession, self.i_accession)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_dbgap_link(self):\n return self.VARIABLE_URL.format(\n self.source_dataset.source_study_version.full_accession, self.i_dbgap_variable_accession)", "def update_gpdbid_file(array):\n \n standby_datadir = os.path.normpath(array.standbyMaster.getSegmentDataDirectory())\n\n # MPP-13...
[ "0.59333754", "0.5608507", "0.55640787", "0.5525023", "0.5480624", "0.5438552", "0.5386511", "0.52137035", "0.5121944", "0.49963725", "0.49718344", "0.49320933", "0.4931212", "0.49076504", "0.4907363", "0.48347703", "0.48316193", "0.4791243", "0.4774549", "0.47308743", "0.469...
0.56734145
1
Get html for the dataset name linked to the dataset's detail page, with description as popover.
def get_name_link_html(self, max_popover_words=80): if not self.i_dbgap_description: description = '&mdash;' else: description = Truncator(self.i_dbgap_description).words(max_popover_words) return POPOVER_URL_HTML.format(url=self.get_absolute_url(), popover=description, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dataset_details(name, analyst):\n\n template = None\n allowed_sources = user_sources(analyst)\n dataset_object = Dataset.objects(name = name,\n source__name__in=allowed_sources).first()\n if not dataset_object:\n error = (\"Either no data exists for this dataset...
[ "0.6402002", "0.6215334", "0.6196248", "0.6154834", "0.5915565", "0.58727175", "0.5843847", "0.5768029", "0.57574415", "0.57549495", "0.57196856", "0.57194483", "0.5701436", "0.56974375", "0.5693088", "0.5690996", "0.5678522", "0.5666621", "0.5646503", "0.56364393", "0.562901...
0.67517895
0
Find the most recent version of this dataset.
def get_latest_version(self): study = self.source_study_version.study current_study_version = self.source_study_version.study.get_latest_version() if current_study_version is None: return None # Find the same dataset associated with the current study version. try: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_version(self):\n version = self.get_current_version()\n\n # read the recent file list\n if version is None:\n version = self.get_version_from_recent_files()\n\n return version", "def get_latest_version(self):\n try:\n version = self.sourcestud...
[ "0.72924036", "0.7165979", "0.7094863", "0.689178", "0.68007094", "0.67894995", "0.6763486", "0.67255384", "0.67026746", "0.6646939", "0.66431236", "0.66066355", "0.6586733", "0.658399", "0.6573558", "0.6563115", "0.6465068", "0.64497256", "0.6445124", "0.64347154", "0.640898...
0.789287
0
Gets a list of trait_flavor_names for harmonized traits in this trait set version.
def get_trait_names(self): return self.harmonizedtrait_set.values_list('trait_flavor_name', flat=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_trait_flavor_name(self):\n return '{}_{}'.format(self.i_trait_name, self.harmonized_trait_set_version.harmonized_trait_set.i_flavor)", "def all_trait_names ( self ):\n return self.__class_traits__.keys()", "def trait_names ( self, **metadata ):\n return self.traits( **metadata ).ke...
[ "0.67714554", "0.6423445", "0.62995416", "0.6120722", "0.60873955", "0.5738161", "0.5715752", "0.57114977", "0.5705768", "0.56979", "0.56829286", "0.564801", "0.5582354", "0.55700886", "0.5551664", "0.5513089", "0.54857224", "0.54564124", "0.5443423", "0.5440488", "0.54381365...
0.8556329
0
Gets the absolute URL of the detail page for a given HarmonizedTraitSet instance.
def get_absolute_url(self): return reverse('trait_browser:harmonized:traits:detail', kwargs={'pk': self.pk})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_absolute_url(self):\n return self.harmonized_trait_set_version.get_absolute_url()", "def get_absolute_url(self):\n return reverse('trait_browser:source:traits:detail', kwargs={'pk': self.pk})", "def get_absolute_url(self):\n return reverse('trait_browser:source:studies:pk:detail', ...
[ "0.72508293", "0.70623827", "0.6548072", "0.64680207", "0.59867966", "0.59867966", "0.59520835", "0.59289813", "0.592246", "0.5918289", "0.58953965", "0.58434725", "0.5838052", "0.5814749", "0.57711065", "0.57669204", "0.57653147", "0.575038", "0.57430536", "0.5742923", "0.57...
0.7418204
0
Get a queryset of all the SourceTraits components for this harmonization unit (age, batch, or source).
def get_all_source_traits(self): return self.component_source_traits.all() | self.component_batch_traits.all() | self.component_age_traits.all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_new_sourcetraits(self):\n previous_study_version = self.get_previous_version()\n SourceTrait = apps.get_model('trait_browser', 'SourceTrait')\n if previous_study_version is not None:\n qs = SourceTrait.objects.filter(\n source_dataset__source_study_version=sel...
[ "0.6352468", "0.60128826", "0.57998437", "0.56801885", "0.5599534", "0.5557096", "0.5557096", "0.52780604", "0.52433515", "0.5181923", "0.5181923", "0.5181923", "0.5181923", "0.5181923", "0.5181923", "0.5181923", "0.5181923", "0.5181923", "0.49282494", "0.49022794", "0.490198...
0.71494865
0
Get a list containing all of the studies linked to component traits for this unit.
def get_source_studies(self): return list(set([trait.source_dataset.source_study_version.study for trait in self.get_all_source_traits()]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def studies(self):\n return self._study_queryset", "def get_all_tagged_traits(self):\n return apps.get_model('tags', 'TaggedTrait').objects.filter(\n trait__source_dataset__source_study_version__study=self,\n ).current()", "def orthanc_studies(self):\n return [orthanc.stu...
[ "0.6521775", "0.631228", "0.6173921", "0.5707282", "0.5669657", "0.5585801", "0.557777", "0.5572094", "0.5565817", "0.5506995", "0.5487372", "0.54773843", "0.5472401", "0.5445943", "0.5405772", "0.53850967", "0.537402", "0.53681386", "0.53642213", "0.5360461", "0.53498906", ...
0.66928583
0
Get html for a panel of component traits for the harmonization unit. Includes an inline list of included studies if applicable.
def get_component_html(self): study_list = '\n'.join([study.get_name_link_html() for study in self.get_source_studies()]) age_list = '\n'.join([trait.get_name_link_html() for trait in self.component_age_traits.all()]) component_html = '\n'.join([ trait.get_component_html(harmonizatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_component_html(self, harmonization_unit):\n source = [tr.get_name_link_html() for tr in (\n self.component_source_traits.all() & harmonization_unit.component_source_traits.all())]\n harmonized_trait_set_versions = [trait_set_version for trait_set_version in (\n self.comp...
[ "0.73980016", "0.71138966", "0.5560296", "0.5343086", "0.5249588", "0.5139348", "0.51112926", "0.5068411", "0.5066079", "0.5065291", "0.4935733", "0.48982418", "0.48671803", "0.48227435", "0.4816911", "0.47910064", "0.47818005", "0.47653103", "0.47544286", "0.47376806", "0.46...
0.8093886
0
Custom save method to autoset full_accession and dbgap_link.
def save(self, *args, **kwargs): self.full_accession = self.set_full_accession() self.dbgap_link = self.set_dbgap_link() super(SourceTrait, self).save(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, *args, **kwargs):\n self.full_accession = self.set_full_accession()\n self.dbgap_link = self.set_dbgap_link()\n super(SourceDataset, self).save(*args, **kwargs)", "def save(self, *args, **kwargs):\n self.full_accession = self.set_full_accession()\n self.dbgap_lin...
[ "0.73582214", "0.71559155", "0.6393143", "0.6363915", "0.6306047", "0.62788814", "0.5810558", "0.57993186", "0.5722098", "0.57087", "0.570662", "0.56933665", "0.567312", "0.5658324", "0.5658324", "0.56490225", "0.56343424", "0.56319344", "0.56160986", "0.56087613", "0.5595003...
0.7209021
1
Automatically set full_accession from the variable's dbGaP identifiers.
def set_full_accession(self): return self.VARIABLE_ACCESSION.format( self.i_dbgap_variable_accession, self.i_dbgap_variable_version, self.source_dataset.source_study_version.i_participant_set)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_full_accession(self):\n return self.DATASET_ACCESSION.format(\n self.i_accession, self.i_version, self.source_study_version.i_participant_set)", "def set_full_accession(self):\n return self.STUDY_VERSION_ACCESSION.format(self.study.phs, self.i_version, self.i_participant_set)", ...
[ "0.66088516", "0.6157562", "0.53482604", "0.5188747", "0.51160794", "0.5022504", "0.50135124", "0.49394724", "0.49343747", "0.48210892", "0.47820124", "0.4719237", "0.4669664", "0.4625832", "0.46101683", "0.4575124", "0.45396692", "0.45073032", "0.45045888", "0.4492379", "0.4...
0.722903
0
Automatically set dbgap_link from dbGaP identifier information.
def set_dbgap_link(self): return self.VARIABLE_URL.format( self.source_dataset.source_study_version.full_accession, self.i_dbgap_variable_accession)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_dbgap_link(self):\n return self.DATASET_URL.format(self.source_study_version.full_accession, self.i_accession)", "def update_gpdbid_file(array):\n \n standby_datadir = os.path.normpath(array.standbyMaster.getSegmentDataDirectory())\n\n # MPP-13245, use single mechanism to manage gp_dbid f...
[ "0.56734145", "0.5608507", "0.55640787", "0.5525023", "0.5480624", "0.5438552", "0.5386511", "0.52137035", "0.5121944", "0.49963725", "0.49718344", "0.49320933", "0.4931212", "0.49076504", "0.4907363", "0.48347703", "0.48316193", "0.4791243", "0.4774549", "0.47308743", "0.469...
0.59333754
0
Gets the absolute URL of the detail page for a given SourceTrait instance.
def get_absolute_url(self): return reverse('trait_browser:source:traits:detail', kwargs={'pk': self.pk})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_absolute_url(self):\n\t\treturn reverse('source-detail', args=[str(self.id)])", "def get_absolute_url(self):\n return reverse('trait_browser:source:studies:pk:detail', kwargs={'pk': self.pk})", "def get_absolute_url(self):\n return reverse('trait_browser:harmonized:traits:detail', kwargs=...
[ "0.7119291", "0.7097896", "0.6950301", "0.6894759", "0.6431965", "0.63921607", "0.636551", "0.635845", "0.62975645", "0.62486935", "0.6246613", "0.62231576", "0.6212547", "0.6189846", "0.6181484", "0.6181484", "0.61728066", "0.6160209", "0.6159289", "0.615591", "0.6154543", ...
0.7710777
0
Return queryset of archived tags linked to this trait.
def archived_tags(self): archived_tagged_traits = apps.get_model('tags', 'TaggedTrait').objects.archived().filter(trait=self) return apps.get_model('tags', 'Tag').objects.filter( pk__in=archived_tagged_traits.values_list('tag__pk', flat=True))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def non_archived_tags(self):\n non_archived_tagged_traits = apps.get_model('tags', 'TaggedTrait').objects.non_archived().filter(trait=self)\n return apps.get_model('tags', 'Tag').objects.filter(\n pk__in=non_archived_tagged_traits.values_list('tag__pk', flat=True))", "def get_archived_ta...
[ "0.7533448", "0.74357784", "0.6842906", "0.6513351", "0.6450949", "0.63617426", "0.6330386", "0.630018", "0.6280889", "0.62478477", "0.6202606", "0.610521", "0.60856485", "0.6033715", "0.60267216", "0.60267216", "0.60267216", "0.60267216", "0.60267216", "0.60267216", "0.60267...
0.8736017
0
Return queryset of nonarchived tags linked to this trait.
def non_archived_tags(self): non_archived_tagged_traits = apps.get_model('tags', 'TaggedTrait').objects.non_archived().filter(trait=self) return apps.get_model('tags', 'Tag').objects.filter( pk__in=non_archived_tagged_traits.values_list('tag__pk', flat=True))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_non_archived_tagged_traits(self):\n return apps.get_model('tags', 'TaggedTrait').objects.current().non_archived().filter(\n trait__source_dataset__source_study_version__study=self)", "def archived_tags(self):\n archived_tagged_traits = apps.get_model('tags', 'TaggedTrait').object...
[ "0.80429226", "0.7348492", "0.6551791", "0.6469715", "0.64208716", "0.63318914", "0.63318914", "0.6299178", "0.6227882", "0.6208177", "0.6100119", "0.6100119", "0.6100119", "0.6100119", "0.6100119", "0.6100119", "0.6100119", "0.6100119", "0.60505265", "0.60505265", "0.6050489...
0.8711702
0
Get html for the trait name linked to the trait's detail page, with description as popover.
def get_name_link_html(self, max_popover_words=80): if not self.i_description: description = '&mdash;' else: description = Truncator(self.i_description).words(max_popover_words) return POPOVER_URL_HTML.format(url=self.get_absolute_url(), popover=description, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name_link_html(self, max_popover_words=80):\n url_text = \"{{% url 'trait_browser:harmonized:traits:detail' pk={} %}} \".format(\n self.harmonized_trait_set_version.pk)\n if not self.i_description:\n description = '&mdash;'\n else:\n description = Trunc...
[ "0.7173213", "0.5908587", "0.58575296", "0.58464485", "0.57854205", "0.5763104", "0.5562001", "0.55412966", "0.5497627", "0.54678494", "0.5463515", "0.5406294", "0.5376284", "0.5343716", "0.5327474", "0.5324101", "0.5305742", "0.5296317", "0.5279121", "0.5275096", "0.52688044...
0.64885026
1
Return the most recent version of a trait.
def get_latest_version(self): current_study_version = self.source_dataset.source_study_version.study.get_latest_version() if current_study_version is None: return None # Find the same trait associated with the current study version. try: current_trait = SourceTrai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def latest_version(self):\n from leonardo_system.pip import check_versions\n return check_versions(True).get(self.name, None).get('new', None)", "def latest_version(self):\n state = self.coordinator.data\n\n try:\n # fake a new update\n # return \"foobar\"\n ...
[ "0.6343139", "0.6289052", "0.61462194", "0.605551", "0.6044234", "0.5944283", "0.59256196", "0.589782", "0.578745", "0.5734667", "0.56906104", "0.5669337", "0.5609379", "0.5605236", "0.55892533", "0.5564086", "0.555119", "0.5531066", "0.5506513", "0.5503882", "0.549832", "0...
0.7126002
0
Returns the version of this SourceTrait from the previous study version.
def get_previous_version(self): previous_study_version = self.source_dataset.source_study_version.get_previous_version() if previous_study_version is not None: try: previous_trait = SourceTrait.objects.get( source_dataset__source_study_version=previous_stu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_latest_version(self):\n current_study_version = self.source_dataset.source_study_version.study.get_latest_version()\n if current_study_version is None:\n return None\n # Find the same trait associated with the current study version.\n try:\n current_trait =...
[ "0.7203941", "0.7022413", "0.6539211", "0.6528101", "0.64088005", "0.64069474", "0.6406507", "0.6177494", "0.6143733", "0.6135707", "0.6052708", "0.60357195", "0.5994113", "0.5994113", "0.5989174", "0.5963759", "0.5963759", "0.5963759", "0.5963759", "0.5931803", "0.5931803", ...
0.84758323
0
Apply tags from the previous version of this SourceTrait to this version.
def apply_previous_tags(self, creator): TaggedTrait = apps.get_model('tags', 'TaggedTrait') DCCReview = apps.get_model('tags', 'DCCReview') StudyResponse = apps.get_model('tags', 'StudyResponse') previous_trait = self.get_previous_version() if previous_trait is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_previous_tags(self, user):\n previous_study_version = self.get_previous_version()\n if previous_study_version is not None:\n SourceTrait = apps.get_model('trait_browser', 'SourceTrait')\n TaggedTrait = apps.get_model('tags', 'TaggedTrait')\n DCCReview = apps...
[ "0.67532045", "0.560491", "0.53911746", "0.5234013", "0.5228578", "0.5195925", "0.5186795", "0.51826936", "0.51673084", "0.51250494", "0.5079544", "0.5074929", "0.50660247", "0.49464282", "0.4945864", "0.49275744", "0.49202943", "0.4895651", "0.48858866", "0.48719358", "0.486...
0.61335063
1
Custom save method for making the trait flavor name. Automatically sets the value for the harmonized trait's trait_flavor_name.
def save(self, *args, **kwargs): self.trait_flavor_name = self.set_trait_flavor_name() # Call the "real" save method. super(HarmonizedTrait, self).save(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_trait_flavor_name(self):\n return '{}_{}'.format(self.i_trait_name, self.harmonized_trait_set_version.harmonized_trait_set.i_flavor)", "def save(self, *args, **kwargs):\n self.name = unique_slugify(\n self.name,\n instance=self,\n queryset=AccountTeam.object...
[ "0.7468916", "0.55278254", "0.5415232", "0.51928246", "0.5119848", "0.511083", "0.5096135", "0.5090444", "0.5069976", "0.5035967", "0.50008094", "0.49549702", "0.49256065", "0.4919068", "0.49156654", "0.48997", "0.48877004", "0.48810652", "0.48521546", "0.4827719", "0.4825961...
0.86165404
0
Automatically set trait_flavor_name from the trait's i_trait_name and the trait set's flavor name. Properly format the trait_flavor_name for this harmonized trait so that it's available for easy use later.
def set_trait_flavor_name(self): return '{}_{}'.format(self.i_trait_name, self.harmonized_trait_set_version.harmonized_trait_set.i_flavor)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, *args, **kwargs):\n self.trait_flavor_name = self.set_trait_flavor_name()\n # Call the \"real\" save method.\n super(HarmonizedTrait, self).save(*args, **kwargs)", "def get_trait_names(self):\n return self.harmonizedtrait_set.values_list('trait_flavor_name', flat=True)"...
[ "0.6485175", "0.572448", "0.52455056", "0.5239741", "0.5102045", "0.50971866", "0.5092614", "0.5031202", "0.50118196", "0.49256253", "0.48779806", "0.48407742", "0.47497308", "0.47167596", "0.4700613", "0.46749374", "0.46679375", "0.4615291", "0.45903933", "0.4571786", "0.455...
0.85946906
0
Get html for the trait name linked to the harmonized trait's detail page, with description as popover.
def get_name_link_html(self, max_popover_words=80): url_text = "{{% url 'trait_browser:harmonized:traits:detail' pk={} %}} ".format( self.harmonized_trait_set_version.pk) if not self.i_description: description = '&mdash;' else: description = Truncator(self.i_d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name_link_html(self, max_popover_words=80):\n if not self.i_description:\n description = '&mdash;'\n else:\n description = Truncator(self.i_description).words(max_popover_words)\n return POPOVER_URL_HTML.format(url=self.get_absolute_url(), popover=description,\n ...
[ "0.65362686", "0.5995364", "0.5972799", "0.5874273", "0.58588713", "0.582794", "0.58238804", "0.56961626", "0.5597435", "0.55740833", "0.5513988", "0.5506095", "0.5495636", "0.549422", "0.5491055", "0.54814446", "0.5465395", "0.54473466", "0.5423525", "0.54104114", "0.5383758...
0.73566204
0
Get html for inline lists of source and harmonized component phenotypes for the harmonized trait.
def get_component_html(self, harmonization_unit): source = [tr.get_name_link_html() for tr in ( self.component_source_traits.all() & harmonization_unit.component_source_traits.all())] harmonized_trait_set_versions = [trait_set_version for trait_set_version in ( self.component_har...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_component_html(self):\n return '\\n'.join([hunit.get_component_html() for hunit in self.harmonizationunit_set.all()])", "def get_component_html(self):\n study_list = '\\n'.join([study.get_name_link_html() for study in self.get_source_studies()])\n age_list = '\\n'.join([trait.get_nam...
[ "0.70497555", "0.69843435", "0.5943376", "0.59310067", "0.5700649", "0.5586195", "0.5549065", "0.5441129", "0.5421613", "0.54212123", "0.54004914", "0.5393318", "0.53882074", "0.53824496", "0.5381582", "0.5377059", "0.5372054", "0.53646225", "0.53409606", "0.53304595", "0.531...
0.707962
0
Pretty printing of HarmonizedTraitEncodedValue objects.
def __str__(self): return 'encoded value {} for {}\nvalue = {}'.format(self.i_category, self.harmonized_trait, self.i_value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pprint(self):\r\n for i in self.items():\r\n print '%s => %r'%i", "def pprint(self):\n\t\tPrettyPrintUnicode().pprint(self.data)", "def PrettyPrint(self):\r\n print(self.data)\r\n return", "def __str__(self):\n return '\\n'+'\\n'.join([\"%-15s: %s\" % (qq(w), str(v)...
[ "0.64984983", "0.62469554", "0.6195777", "0.61902934", "0.6169539", "0.6151282", "0.6125573", "0.6070319", "0.6042068", "0.6039289", "0.6027863", "0.597896", "0.5963519", "0.59448206", "0.59373057", "0.59328187", "0.5917587", "0.5878207", "0.58527887", "0.585157", "0.58463466...
0.70111173
0
generate images using the latest saved check points and the images will be saved in 'save_path/images/'
def generate_image(noise_list, save_path): check_points_path = os.path.join(save_path, 'check_points') output_image_path = os.path.join(save_path, 'images') components.create_folder(output_image_path, False) latest_checkpoint = tf.train.latest_checkpoint(check_points_path) assert...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_img(self):\r\n self.extract_info_from_file()\r\n path_0 = os.path.join(self.output_path, self.field_id, self.patient_id + self.ext)\r\n path_1 = os.path.join(self.output_path, self.field_id + '_' + self.instance, self.patient_id + self.ext)\r\n if self.shot == '0': # first sho...
[ "0.711237", "0.67032856", "0.6631163", "0.6493553", "0.6490636", "0.64827114", "0.64728135", "0.64322054", "0.64124805", "0.64074713", "0.63913244", "0.63624316", "0.63335747", "0.6307022", "0.630442", "0.62582576", "0.62520474", "0.6236078", "0.6206135", "0.6205042", "0.6150...
0.71468616
0
Build personalization instance from a dict
def create_personalization(self, **kwargs): personalization = Personalization() _diff = set(emailconf.PERSONALIZATION_KEYS).intersection(set(kwargs.keys())) if _diff: for key in _diff: item = kwargs.get(key) if item: if key in email...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(cls, dictionary):\n return cls(**dictionary)", "def create(cls, dictionary):\n return cls(**dictionary)", "def build_personalization(personalization):\n mock_personalization = Personalization()\n for to_addr in personalization['to_list']:\n personalization.add_to(to_addr)\...
[ "0.63244694", "0.63244694", "0.6232753", "0.6030198", "0.5900351", "0.58583313", "0.5845706", "0.58420676", "0.58329755", "0.5826959", "0.58106136", "0.579965", "0.5711809", "0.57004213", "0.57004213", "0.57004213", "0.57004213", "0.57004213", "0.57004213", "0.57004213", "0.5...
0.6677979
0
Returns a list of all Server Emojis
async def emojis(self, ctx): server = ctx.message.server await self.bot.say('This may take some time, generating list...') data = discord.Embed(description="Emojilist") for ej in server.emojis: data.add_field( name=ej.name, value=str(ej) + " " + ej.id, inline=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_slack_emoji():\n all_slack_emoji = []\n\n # load stock emoji from file\n with app.open_resource('../static/emoji-names.json') as f:\n stock_emojis = json.load(f)\n all_slack_emoji += stock_emojis\n\n # concat custom emoji by slack API call\n all_slack_emoji += sc.api_call('emoj...
[ "0.6829809", "0.67620057", "0.6723042", "0.66201127", "0.66025", "0.65196496", "0.6501168", "0.6340955", "0.62791866", "0.6245136", "0.60249436", "0.5856114", "0.57686776", "0.57601565", "0.56315124", "0.56029534", "0.55517876", "0.55233794", "0.55045164", "0.5494092", "0.549...
0.73602945
0
Coinflip, defaults to Kopf/Zahl if no players are given
async def coinflip(self, ctx, player1=None, *, player2=None): rng = randint(1, 10) if player1 is None and player2 is None: if rng < 5: return await self.bot.say("Kopf gewinnt!") else: return await self.bot.say("Zahl gewinnt!") else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def flipcoin(self, ctx):\n flip = random.choice([True, False])\n if flip == True:\n msg = 'It\\'s heads!'\n await ctx.send(msg)\n elif flip == False:\n msg = 'It\\'s tails!'\n await ctx.send(msg)", "def flip_player(cls):\n cls.current_...
[ "0.67842084", "0.66972786", "0.6554809", "0.65462387", "0.6510231", "0.6505744", "0.6217337", "0.61918855", "0.6128844", "0.6107027", "0.60780925", "0.6042313", "0.6022117", "0.60063225", "0.5861973", "0.57754767", "0.57477665", "0.5738534", "0.5674234", "0.5642496", "0.56303...
0.71466845
0
Moves all clients randomly in other channels for duration seconds. After the whirpool event, all clients will be in the same channel as before. Between the whirlpool cycles, the programm will sleep for relax_time seconds.
def whirlpool(ts3conn, duration=10, relax_time=0.5): # Countdown till whirlpool for i in range(5, 0, -1): ts3conn.sendtextmessage( targetmode=ts3.definitions.TextMessageTargetMode.SERVER, target=0, msg="Whirpool in {}s".format(i)) time.sleep(1) # Fetch the clientlist...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def client_send(state):\n while state.running:\n disconnected_users = []\n time.sleep(0.05)\n for nick in users:\n nick, queue = nick, users[nick].queue\n while len(queue) > 0:\n sender, msg = queue.pop(0)\n message = '{}> {}'.format(sende...
[ "0.5521252", "0.5468559", "0.5398658", "0.532204", "0.5318605", "0.5243049", "0.521927", "0.52137786", "0.5190527", "0.51749384", "0.5163204", "0.51520616", "0.5127868", "0.50814927", "0.5065982", "0.5059794", "0.5046238", "0.5038621", "0.501738", "0.5005819", "0.4993451", ...
0.7218653
0
Converts all seat strings into seat IDs and returns the highest seat ID found.
def highest_seat_id(raw_seat_string): seat_list = raw_seat_string.split('\n') return max(list(map(find_seat, seat_list)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_highest_seat_id(seat_ids):\n\n return max(seat_ids)", "def get_max_seat_id(boarding_passes: list) -> int:\n return max(get_seat_id(boarding_pass) for boarding_pass in boarding_passes)", "def part2(data: str):\n seat_ids = sorted(\n [bp.seat_id for bp in map(lambda row: BoardingPass(row)...
[ "0.74634355", "0.668236", "0.6261357", "0.62445736", "0.6111793", "0.6099611", "0.60279304", "0.587468", "0.5664313", "0.5655479", "0.55966735", "0.5484212", "0.53893024", "0.5317917", "0.5312065", "0.52949077", "0.5271475", "0.52611125", "0.5253164", "0.52044994", "0.5197342...
0.8179302
0
All seats start out empty
def __init__(self): self.empty_seats = [row * 8 + col for row in self.rows for col in self.cols]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def empty_seats(seats, seat_numbers):\n\n for seat in seat_numbers:\n seats[seat] = None\n\n return seats", "def fill_empty_seats(seats_names_dict, seats):\n for seat in seats:\n if seat not in seats_names_dict:\n seats_names_dict[seat] = 'empty'\n\n return seats_names_dict",...
[ "0.6661953", "0.603927", "0.603626", "0.5855473", "0.5745834", "0.55990493", "0.55397326", "0.55388844", "0.55323654", "0.5485067", "0.5471141", "0.5468245", "0.5461583", "0.54550487", "0.54510456", "0.5441734", "0.5439312", "0.5425242", "0.5423252", "0.54135686", "0.53805137...
0.64161956
1
Each time a passenger is seated, the seat_id is removed from the empty seats list
def seat_passenger(self, seat_id): self.empty_seats.remove(seat_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_player(self, seat_id):\n player_id = seat_id\n try:\n idx = self._seats.index(self._player_dict[player_id])\n self._seats[idx] = Player(0, stack=0, emptyplayer=True)\n del self._player_dict[player_id]\n self.emptyseats += 1\n except ValueError:\n pass", "def empty_sea...
[ "0.6723246", "0.67226124", "0.62767714", "0.587385", "0.58325046", "0.57876456", "0.5778089", "0.5708203", "0.5675765", "0.5618063", "0.5579411", "0.5568858", "0.5519024", "0.5517418", "0.54689866", "0.54673475", "0.5445841", "0.54018897", "0.5352401", "0.5350176", "0.5329276...
0.830451
0
Puts the skips in sequential cut
def put_skips_in_seq_cut(self): # first, put skips when in some cut there is an ending activity in_end_act = set(self.initial_end_activities) i = 0 while i < len(self.children) - 1: activities_set = set(self.children[i].activities) intersection = activities_set.in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def skipp(self):\n for x in range(4):\n self.fwd(right=100, left=100)\n time.sleep(.5)\n self.servo(1000)\n time.sleep(.1)\n self.servo(2000)\n time.sleep(.1)\n self.fwd(right=-100, left=-100)\n time.sleep(.1)\n ...
[ "0.6081469", "0.59631395", "0.590605", "0.59015036", "0.59015036", "0.563135", "0.5596978", "0.5508532", "0.550615", "0.5485905", "0.54270315", "0.54068", "0.5339759", "0.53249735", "0.52994674", "0.5296712", "0.5285578", "0.5242751", "0.52426267", "0.5176084", "0.5173648", ...
0.7369221
0
Start the monitoring loop for the downloads.
def start(self): self._logger.info("Starting download monitor (interval: %d seconds)" % self.interval) self.monitor_lc = ensure_future(looping_call(0, self.interval, self.monitor_downloads))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n self.monitor.start()", "def start_download(self) -> NoReturn:\n if self.threaded:\n self.threaded_download()\n else:\n self.regular_download()", "def monitor_downloads(self):\n return self.request_manager.get_downloads().addCallback(self.on_dow...
[ "0.7030247", "0.6881864", "0.681746", "0.6760977", "0.6704339", "0.66790855", "0.6652548", "0.66350824", "0.6631739", "0.66223013", "0.65687346", "0.65481055", "0.65054774", "0.6494747", "0.64725673", "0.64176327", "0.6264444", "0.6254806", "0.62482595", "0.62001854", "0.6194...
0.8476433
0
Returns true if the cooldown is ready.
def ready(self): return self.time >= self.cooldown
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_cooldown(self) -> bool:\n return self.cooldown_counter > 0", "def is_ready(self) -> bool:\n return self._ready.is_set()", "def cooldown_checker(self):\n self.cooldown_tick += 1\n if self.cooldown_tick == self.pattern_cooldown:\n self.wait = False\n self....
[ "0.80361766", "0.73155785", "0.7213164", "0.7167499", "0.7148745", "0.7121509", "0.71099555", "0.7094376", "0.70895165", "0.7063325", "0.70395815", "0.7003874", "0.69981563", "0.69766104", "0.69766104", "0.6975192", "0.69604623", "0.69585705", "0.69414705", "0.6909078", "0.68...
0.87662184
0
Get api_key in metadata, raise error if does not exist
def get_api_key(context) -> str: provided_api_key = "" for key, value in context.invocation_metadata(): if key == "api_key": provided_api_key = str(value) return provided_api_key return provided_api_key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_api_key(api_key):\n api.get(api_key)", "def resolve_apikey(self):\n # check the instance variable\n apikey = self.apikey\n if apikey is not None:\n return apikey\n\n # check the class variable and environment\n apikey = resolve_apikey()\n if apikey ...
[ "0.7678791", "0.6980334", "0.6893777", "0.67977744", "0.6746311", "0.67275006", "0.6724428", "0.6724428", "0.67214483", "0.6710168", "0.6701964", "0.66950274", "0.6663174", "0.6648977", "0.66346925", "0.6588155", "0.6586956", "0.65624505", "0.65600836", "0.6558815", "0.655764...
0.7251901
1
Update prefix with operator with best price.
def _update_prefix(self, prefix: str, operator: Operator): cached_operator: Optional[Operator] = self.lookup(prefix) if cached_operator: cached_price = cached_operator.price_for_prefix(prefix) if cached_price: if operator.has_better_price_for_prefix(prefix, cached...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_with_operator(self, operator: Operator):\n if not isinstance(operator, Operator):\n raise TypeError(\n f\"operator expected to be of type `Operator` but got type \"\n f\"{type(operator)}\"\n )\n\n for prefix in operator.rates.keys():\n ...
[ "0.6310741", "0.57850754", "0.57514006", "0.54723537", "0.54526275", "0.5421909", "0.53711325", "0.5362892", "0.5342558", "0.52658045", "0.5223748", "0.5185856", "0.51810634", "0.51768", "0.5171346", "0.5168897", "0.5147008", "0.50996333", "0.50994164", "0.50994164", "0.50835...
0.7551244
0
Updates `PrefixCache` with data from given operator.
def update_with_operator(self, operator: Operator): if not isinstance(operator, Operator): raise TypeError( f"operator expected to be of type `Operator` but got type " f"{type(operator)}" ) for prefix in operator.rates.keys(): self._up...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_prefix(self, prefix: str, operator: Operator):\n cached_operator: Optional[Operator] = self.lookup(prefix)\n if cached_operator:\n cached_price = cached_operator.price_for_prefix(prefix)\n if cached_price:\n if operator.has_better_price_for_prefix(pref...
[ "0.7683273", "0.6553203", "0.64049375", "0.52432764", "0.51866513", "0.51246953", "0.5072463", "0.5072463", "0.5058224", "0.50360274", "0.5033406", "0.49451602", "0.49146992", "0.48742005", "0.4850131", "0.4843754", "0.47898152", "0.47546908", "0.47544464", "0.47422978", "0.4...
0.68408626
1
Given a prefix, returns operator with best price in `PrefixCache`
def lookup(self, prefix: str) -> Optional[Operator]: return self.data.get(prefix, None) # noqa
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_prefix(self, prefix: str, operator: Operator):\n cached_operator: Optional[Operator] = self.lookup(prefix)\n if cached_operator:\n cached_price = cached_operator.price_for_prefix(prefix)\n if cached_price:\n if operator.has_better_price_for_prefix(pref...
[ "0.7023152", "0.57442355", "0.56952125", "0.5672677", "0.5581838", "0.5468779", "0.5468779", "0.5460756", "0.5382311", "0.5373651", "0.5297867", "0.52763575", "0.5276098", "0.52464044", "0.5244506", "0.52335495", "0.51884717", "0.51734436", "0.51672626", "0.5148878", "0.51332...
0.6808338
1
map given prefix to operator, overwriting exsisting cache for prefix entry.
def add_prefix(self, prefix: str, operator: Operator): if not isinstance(operator, Operator): raise TypeError( f"`operator` expected to be of type `str` but got type " f"`{type(operator)}`" ) if not isinstance(prefix, str): raise TypeE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_prefix(self, prefix: str, operator: Operator):\n cached_operator: Optional[Operator] = self.lookup(prefix)\n if cached_operator:\n cached_price = cached_operator.price_for_prefix(prefix)\n if cached_price:\n if operator.has_better_price_for_prefix(pref...
[ "0.74195033", "0.6135819", "0.59976494", "0.56019163", "0.55027753", "0.54626215", "0.5361422", "0.53344727", "0.5287824", "0.5260219", "0.525283", "0.5196512", "0.5168845", "0.5155864", "0.5117644", "0.511022", "0.508657", "0.5071373", "0.5030445", "0.49908844", "0.49615845"...
0.63900906
1
Return prefix for `phone_number`. Use `lookup` to fetch operator.
def find_prefix(self, phone_number: str) -> Optional[str]: if not isinstance(phone_number, str): raise TypeError( f"`phone_number` expected to be of type `str` " f"but got type `{type(phone_number)}`" ) if not phone_number.isdigit(): r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strip_phone_prefix(self, phone_num):\n # FIXME more accurate check\n if phone_num.startswith('+86'):\n return phone_num.replace('+86', '')\n if len(phone_num) != 11:\n return None\n return phone_num", "def phone_number_organizer(self, key):\n\t\ttry:\n\t\t\tp...
[ "0.6136778", "0.596885", "0.586732", "0.5830663", "0.58184695", "0.58184695", "0.5758761", "0.5758761", "0.5729075", "0.56406903", "0.56264126", "0.56246763", "0.5618058", "0.5616657", "0.5613042", "0.56065995", "0.5562532", "0.5562178", "0.5562178", "0.5562178", "0.55411625"...
0.6957184
0
Build a `PrefixCache` from a tuple of `Operators`.
def build_cache(klass: "PrefixCache", operators: Tuple[Operator, ...]) -> "PrefixCache": prefix_cache = klass() for operator in operators: prefix_cache.update_with_operator(operator) return prefix_cache
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buildOperatorCache(ham: Dict[str, Any]) -> None:\n sysLevel = ham[\"circuit\"][\"sys_level\"]\n qubitNum = ham[\"circuit\"][\"qubits\"]\n\n # Generator the operator for all of the drift terms\n for key in ham[\"drift\"]:\n drifts = ham[\"drift\"][key]\n operator = generateOperator(dri...
[ "0.55122936", "0.5408634", "0.50833046", "0.50592685", "0.49883533", "0.493835", "0.4874338", "0.48739326", "0.48162144", "0.47007602", "0.46888414", "0.4669612", "0.46306923", "0.46295217", "0.46244913", "0.46051258", "0.46014902", "0.4598839", "0.45586753", "0.45210305", "0...
0.8065964
0
Plots the latest COVID19 status of the country if name is not given then it plots the top10
def plot(self, context=None): response = requests.get(self.url).content table = pd.read_html(response, attrs={"id": "main_table_countries_today"}) df = table[0].fillna(0) # df.drop(df.index[0], inplace=True) # World df.drop(["ActiveCases", 'Serious,Critical', 'Serious,Critical'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_country(name, case):\n click.echo(click.style(\n \"Generating Plot....\", fg='cyan', bold='true'))\n plot_time_series.TimeSeriesPloTs.plot_country(case, name)\n click.echo(click.style(\n \"Done....\", fg='green', bold='true'))", "def plot_country_representation():\n\n # Get all...
[ "0.5984105", "0.5937387", "0.5841578", "0.56083816", "0.5559453", "0.54571724", "0.54451543", "0.5368691", "0.5362344", "0.5346326", "0.53422797", "0.52614784", "0.52426875", "0.52363175", "0.5218532", "0.5201958", "0.5179261", "0.51773536", "0.51521355", "0.5141482", "0.5134...
0.6362874
0
Create the luis api query url from a csv. Requires the csv to contain the endpoint url, app id and primary key
def get_luis_url(folder: WindowsPath = None) -> str: if folder is None: folder = Path.cwd().joinpath('CONFIG') path = folder.joinpath('luis_keys.csv') df = pd.read_csv(path, index_col='key') endpoint = df.loc['endpoint', 'value'] app_id = df.loc['app_id', 'value'] prim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_urls(csvfile):\n result = []\n with open(csvfile, 'rU') as infile: \n reader = csv.DictReader(infile, dialect=csv.excel,\n fieldnames=['ID','URL','Latitude','Longitude'])\n for row in reader:\n idnum = row['ID']\n url = row['URL']\n ...
[ "0.62318754", "0.5654017", "0.5514315", "0.5352997", "0.5324021", "0.5324021", "0.51919746", "0.51832896", "0.5166666", "0.5166666", "0.5151871", "0.5135357", "0.5133279", "0.512845", "0.50671405", "0.50671405", "0.5013714", "0.5009945", "0.49635574", "0.4927147", "0.49232295...
0.6092655
1
Sends student comments to the LUIS.ai API in batches and saves the intemediate results into the OUTPUT folder
def request_api( student_comments: pd.Series, url: str, chunk_size: int = 50 ) -> pd.Series: for i, chunk in enumerate(chunks(student_comments, chunk_size)): print(f'Processing batch {i} of size {len(chunk)}') response = chunk.apply(lambda x: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\r\n \r\n data_dir = Path.cwd().joinpath('OUTPUT')\r\n config_dir = Path.cwd().joinpath('CONFIG')\r\n \r\n # Load deduplicated comments\r\n data = utils.load(data_dir, 'student_comment_deduplicated')\r\n \r\n # Get the luis API url\r\n with open(config_dir.joinpath('luis_url.t...
[ "0.62581986", "0.56374973", "0.55773365", "0.5480655", "0.54645246", "0.5297529", "0.52373004", "0.52115196", "0.5190923", "0.5185241", "0.51840454", "0.5158123", "0.51344043", "0.5082114", "0.50543535", "0.50502497", "0.50455976", "0.5043005", "0.5015503", "0.49875677", "0.4...
0.6514273
0
Merging the results from the luis response with the lemmatised comments.
def merge_comments(df1: pd.DataFrame, df2: pd.DataFrame, out_dir: str) -> pd.DataFrame: nlp = spacy.load('en_core_web_lg') df1 = pd.DataFrame(load_pickles(out_dir)) df1.columns = ['response'] df1['student_comment_apostrophe'] = df1.response.apply(lambda x: x['query'] if x is not None else No...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _proc(dat):\n def lemma(text):\n lemmatizer = WordNetLemmatizer()\n w_tokenizer = WhitespaceTokenizer()\n return [lemmatizer.lemmatize(w) for w in w_tokenizer.tokenize(text)]\n\n dat['text_lemmatized'] = dat['clean_comments'].apply(lemma)\n dat['text_lemmat...
[ "0.5736245", "0.57142824", "0.5411729", "0.540935", "0.54072136", "0.5370507", "0.5283631", "0.5237631", "0.5222202", "0.52172023", "0.52092206", "0.5151312", "0.5109762", "0.5085416", "0.5063539", "0.5046727", "0.49920905", "0.49881884", "0.4975726", "0.49670464", "0.4951924...
0.6131447
0
Extract the element, e.g. topScoringIntent, from the LUIS.api json response s the pd.Series of the unravelled json response element the elements, such as "sentiment" or "intent"
def get_luis_element(s: pd.Series, element: str) -> pd.Series: result = 0 if element == 'intent': result = s.apply(lambda x: x['topScoringIntent']['intent']) elif element == 'entities': result = s.apply(lambda x: x['entities']) elif element == 'sentiment': valence = s.appl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_response(self, response):\n\t\tself.context = response['context']\n\t\ttext = response['output']['text']\n\t\tintents = response['intents'] #is a list, should filter\n\t\tif len(intents) > 0:\n\t\t\tintent = intents[0]['intent'] #get the intent of the message\n\t\telse:\n\t\t\tintent = \"\"\n\t\t\t\n\t\t...
[ "0.5717776", "0.55163515", "0.5311165", "0.52464586", "0.5228804", "0.52271056", "0.52187705", "0.52037966", "0.5090575", "0.50477314", "0.5046301", "0.5021355", "0.500153", "0.49620596", "0.49437866", "0.4942395", "0.4940954", "0.49293894", "0.4871135", "0.4847061", "0.48190...
0.6376146
0
Load the deduplicated comments Get the luis url Call the API in batches Aggregate the batched pickled files with 'luis_result' in the filename, Extract the top scoring intent, entities and the sentiment of each row Save each of the three series as separate pickle files
def main(): data_dir = Path.cwd().joinpath('OUTPUT') config_dir = Path.cwd().joinpath('CONFIG') # Load deduplicated comments data = utils.load(data_dir, 'student_comment_deduplicated') # Get the luis API url with open(config_dir.joinpath('luis_url.txt'), 'r') as f: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_api(\r\n student_comments: pd.Series, \r\n url: str, \r\n chunk_size: int = 50\r\n ) -> pd.Series:\r\n \r\n for i, chunk in enumerate(chunks(student_comments, chunk_size)):\r\n print(f'Processing batch {i} of size {len(chunk)}')\r\n \r\n response =...
[ "0.6615366", "0.5831273", "0.57000536", "0.56970143", "0.5684071", "0.5569833", "0.5552695", "0.5543285", "0.55414546", "0.55375046", "0.5494917", "0.5487292", "0.5479934", "0.54722214", "0.54708064", "0.54343843", "0.54299", "0.54090136", "0.5354556", "0.53511345", "0.534945...
0.59263885
1
Create table from csv file to input into database.
def create_table(engine, csv_filename, tablename): # Read csv file and changes all column names to be lowercase csv_df = pd.read_csv(f'./data/{csv_filename}.csv') csv_df.columns = [c.lower() for c in csv_df.columns] # Change date types to datetime todateformat = [] for c in csv_df.columns: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_table_from_csv (sqlite_db_file):\n files = [f for f in os.listdir(os.curdir) if f.endswith(\".csv\")]\n name_df = [re.findall('(.*)\\.csv',f)[0] for f in files ]\n engine = create_engine('sqlite:///' + sqlite_db_file)\n for n, f_n in zip(name_df, files):\n try:\n df = pd.re...
[ "0.78636694", "0.766007", "0.74412394", "0.7296567", "0.72548956", "0.71277964", "0.6920125", "0.6874775", "0.6822775", "0.68040115", "0.678773", "0.674541", "0.67439973", "0.6684536", "0.66534555", "0.66475165", "0.6639408", "0.6621663", "0.66060764", "0.65959024", "0.659466...
0.77351403
1
Returns args including etcd endpoint and certificates if necessary. As dcosetcdctl and etcdctl share the same arguments, such as endpoints, ever considering the certificates involved, we group these arguments to generate the basic items to execute either etcdctl or dcosetcdctl
def get_etcdctl_with_base_args( cert_type: str = "root", endpoint_ip: str = LOCAL_ETCD_ENDPOINT_IP, ) -> List[str]: return [ETCDCTL_PATH, "--endpoints=http://{}:2379".format(endpoint_ip)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_args():\n\n parser = argparse.ArgumentParser(description=\"Get DC, Clusters, Hosts and VM in JSON.\")\n parser.add_argument('-H', '--host', nargs=1, required=True, help='The vCenter to connect to',\n dest='host', type=str)\n parser.add_argument('-p', '--password', nargs=1, r...
[ "0.5863232", "0.57427984", "0.57362777", "0.5711436", "0.5671684", "0.5665155", "0.56511855", "0.5629644", "0.5586884", "0.55581784", "0.5516893", "0.5515851", "0.5509923", "0.5477983", "0.5474129", "0.546462", "0.5454525", "0.54045254", "0.5360767", "0.53578204", "0.53573877...
0.7312782
0
assigns the value to the key. etcd is not exposed outside of the DC/OS cluster,so we have to execute etcdctl inside the DC/OS cluster, on a master in our case.
def put(self, key: str, value: str) -> None: master = list(self.masters)[0] etcdctl_with_args = get_etcdctl_with_base_args(endpoint_ip=MASTER_DNS) etcdctl_with_args += ["put", key, value] master.run(args=etcdctl_with_args, output=Output.LOG_AND_CAPTURE)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set(self, key, value, cb=None):\n _log.analyze(self.node.id, \"+ CLIENT\", {'key': key, 'value': value})\n self.send(cmd='SET',msg={'key':key, 'value': value}, cb=cb)", "async def set(self, key, value):\n trace_log(\"PersistantStorage: setting key \", key, \" to value \", value)\n ...
[ "0.6925788", "0.6801668", "0.6539463", "0.6499346", "0.64941585", "0.64688677", "0.6442703", "0.6442703", "0.64351684", "0.6388835", "0.6360207", "0.6353308", "0.6348998", "0.6324563", "0.6311069", "0.6296948", "0.6296282", "0.62657654", "0.6252633", "0.6233048", "0.62180454"...
0.7933066
0
gets the value of the key on given master node
def get_key_from_node( self, key: str, master_node: Node, ) -> str: etcdctl_with_args = get_etcdctl_with_base_args( endpoint_ip=str(master_node.private_ip_address)) etcdctl_with_args += ["get", key, "--print-value-only"] result = master_node.ru...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, key):\n dkey = digest(key)\n _log.debug(\"Server:get %s\" % base64.b64encode(dkey))\n # if this node has it, return it\n exists, value = self.storage.get(dkey)\n if exists:\n return defer.succeed(value)\n node = Node(dkey)\n nearest = self.p...
[ "0.7126619", "0.70644236", "0.700838", "0.7002999", "0.69473535", "0.68663204", "0.68588144", "0.68588144", "0.68452597", "0.677081", "0.672349", "0.6679185", "0.6676274", "0.6670105", "0.663204", "0.66137815", "0.66084397", "0.6582573", "0.6569191", "0.65402824", "0.65248156...
0.79159415
0
Separate train or validation annotations to single video annotation.
def separate_annotations(): data_root = '/home/ubuntu/datasets/YT-VIS/' ann_file = data_root + 'annotations/instances_train_sub.json' import json with open(ann_file, 'r') as f: ann = json.load(f) # ann['videos'] = ann['videos'][15] # video_id = [0] from tqdm import tqdm ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def AnnotateVideo(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)", "def load_annotations(self):\n assert self.ann_file.endswith('.pkl')\n ann_info = hload_pkl(self.ann_file)\n\n video_infos = []\n for i, video_info in enumerate(ann_info):\n ...
[ "0.65230966", "0.6502994", "0.6373923", "0.6358761", "0.63245064", "0.62168384", "0.60723543", "0.5980911", "0.5978949", "0.59094423", "0.5880484", "0.5861228", "0.5837445", "0.5835894", "0.5835894", "0.58234775", "0.58234775", "0.58179194", "0.581608", "0.5808023", "0.577818...
0.7296973
0