query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
return dotdict object or list
def to_dotdict(data): if isinstance(data, dict): return dotdict(data) elif isinstance(data, list): return list_to_dotdict(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dict(self):\n\n return DotDict(self.__iter__())", "def test_dotwiz_plus_get_item():\n dd = DotWizPlus()\n dd.a = [{'one': 1, 'two': {'key': 'value'}}]\n\n item = dd['a'][0]\n assert isinstance(item, DotWizPlus)\n assert item['one'] == 1\n\n assert item['two']['key'] == 'value'", ...
[ "0.5945943", "0.5873352", "0.5810061", "0.5800588", "0.5748407", "0.57315344", "0.5581501", "0.5569949", "0.5481885", "0.5452426", "0.54393417", "0.540381", "0.53734374", "0.5339806", "0.5307873", "0.5281563", "0.5272191", "0.5243142", "0.5223164", "0.5220962", "0.51968324", ...
0.6615638
0
Yield successive nsized chunks from l.
def chunks(l, n): return[ l[i:i + n] for i in range(0, len(l), n)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]", "def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def get_chunks(self, ...
[ "0.8038813", "0.79248375", "0.7923423", "0.7885103", "0.78773195", "0.7815877", "0.77655786", "0.77556044", "0.77441615", "0.7731815", "0.77288336", "0.772473", "0.77028215", "0.76889825", "0.76889825", "0.7664208", "0.76570904", "0.7655856", "0.7655856", "0.76458347", "0.764...
0.0
-1
Converts decimal number into sexagesimal number parts. ``deci`` is the decimal number to be converted. ``precision`` is how close the multiple of 60 and 3600, for example minutes and seconds, are to 60.0 before they are rounded to the higher quantity, for example hours and minutes.
def decimal_to_base60(deci,precision=1e-8): sign = "+" # simple putting sign back at end gives errors for small # deg. This is because -00 is 00 and hence ``format``, # that constructs the delimited string will not add '-' # sign. So, carry it as a character. if deci < 0: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision(self):\n string = self.ask('od;E;') # get the actual output\n i1 = string.find('.')\n # find the indices of the dot before the decimal part and the E before\n # the exponent\n i2 = string.find('E', i1)\n # calculate the number of digit in the...
[ "0.5545609", "0.54595983", "0.5409595", "0.5327562", "0.5315469", "0.52859825", "0.52043194", "0.519569", "0.5193756", "0.51741165", "0.515108", "0.515045", "0.5112662", "0.500345", "0.49701056", "0.49647292", "0.4951426", "0.49483728", "0.49165738", "0.48891824", "0.4876071"...
0.62166643
0
Given mjd return calendar date. Retrns a tuple (year,month,day,hour,minute,second). The last is a floating point number and others are integers. The precision in seconds is about 1e4. To convert jd to mjd use jd 2400000.5. In this module 2400000.5 is stored in MJD0.
def caldate(mjd): MJD0 = 2400000.5 # 1858 November 17, 00:00:00 hours modf = math.modf a = long(mjd+MJD0+0.5) # Julian calendar on or before 1582 October 4 and Gregorian calendar # afterwards. if a < 2299161: b = 0 c = a + 1524 else: b = long((a-1867216.25)/36524.25) c = a+ b - long(modf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cmjd_to_mjd( cmjd):\n # only accurate to digits\n days = (cmjd.real+EPSILON) * FACTOR\n days = np.round(days, decimals=0)\n idays = np.int(days)\n fdays = np.float(idays)/FACTOR\n partdays = cmjd.imag # rest of days is in the hours part\n mjd = fdays + partdays\n return mjd", "def ge...
[ "0.7360819", "0.73290575", "0.7209902", "0.7089714", "0.7082776", "0.7072075", "0.7059237", "0.7000371", "0.6946869", "0.693835", "0.69068015", "0.68661994", "0.6851522", "0.6851298", "0.67647004", "0.6752787", "0.6722145", "0.6657841", "0.65992653", "0.6596479", "0.6561866",...
0.7805427
0
Parse an AIML text version of an aiml file and return all the cateogeries found in the file
def parse_from_text(self, text): start = datetime.datetime.now() aiml = ET.fromstring(text) _, namespace = AIMLParser.check_aiml_tag(aiml) num_categories = self.parse_aiml(aiml, namespace) stop = datetime.datetime.now() diff = stop - start YLogger.info(self, "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_cuewords(self, cuewords, xml_file_path):\n\n # Create output files\n if not os.path.exists(CUEWORDS_DATA_PATH):\n self.create_directories(CUEWORDS_DATA_PATH)\n try:\n file_output = open(CUEWORDS_DATA_PATH+CUEWORDS_FILE, 'w', encoding='utf8')\n file_...
[ "0.57388943", "0.57380986", "0.5733026", "0.5705951", "0.5672007", "0.56505924", "0.56093127", "0.5518221", "0.5507609", "0.5495509", "0.5464741", "0.54594886", "0.5425296", "0.53971124", "0.5390651", "0.5387091", "0.53832227", "0.53830737", "0.5381347", "0.53734255", "0.5347...
0.62207997
0
This is using recursion
def printLevelOrder(root): print("---- printing below the level traversal of the tree -----") print("=========================================================")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recursive():\n with Local() as tun:\n tun.call(recursive)", "def lis_recursive(array):\n\n #TODO", "def step(tree):\n if type(tree) == list and type(tree[0]) == tuple:#This basically looks for any applications it can do directly. These applications are the ones where the function is already...
[ "0.6281366", "0.6184275", "0.6161105", "0.5972983", "0.59151673", "0.5840482", "0.58125156", "0.57481784", "0.5735028", "0.5651724", "0.5645178", "0.564305", "0.56316143", "0.5594576", "0.55691177", "0.5567865", "0.5564364", "0.5540909", "0.5538929", "0.55160964", "0.550145",...
0.0
-1
This is using recursion
def printLevelOrder(root): print("---- printing below the level traversal of the tree -----") h = height(root) for i in range(1, h+1): printGivenLevel(root, i) print("=========================================================")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recursive():\n with Local() as tun:\n tun.call(recursive)", "def lis_recursive(array):\n\n #TODO", "def step(tree):\n if type(tree) == list and type(tree[0]) == tuple:#This basically looks for any applications it can do directly. These applications are the ones where the function is already...
[ "0.6281366", "0.6184275", "0.6161105", "0.5972983", "0.59151673", "0.5840482", "0.58125156", "0.57481784", "0.5735028", "0.5651724", "0.5645178", "0.564305", "0.56316143", "0.5594576", "0.55691177", "0.5567865", "0.5564364", "0.5540909", "0.5538929", "0.55160964", "0.550145",...
0.0
-1
The Beta API is deprecated for 0.15.0 and later. It is recommended to use the GA API (classes and functions in this file not marked beta) for all further purposes. This function was generated only to ease transition from grpcio=0.15.0
def beta_create_SpiderServer_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): request_deserializers = { ('DistributeSpider.SpiderServer', 'keepalive'): Register.FromString, ('DistributeSpider.SpiderServer', 'req'): Request.FromString, ('DistributeSpider.Spid...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_sdk():", "def patch_sdk():", "def patch_sdk():", "def api(self) -> str:", "def Version(self, request, context):\r\n context.set_code(grpc.StatusCode.UNIMPLEMENTED)\r\n context.set_details('Method not implemented!')\r\n raise NotImplementedError('Method not implemented!')", "def _rpc(ht...
[ "0.5614376", "0.5614376", "0.5614376", "0.5231222", "0.516678", "0.5120239", "0.51101154", "0.51041496", "0.5075347", "0.5075347", "0.5021301", "0.50079757", "0.49987736", "0.49987736", "0.49885666", "0.49841118", "0.49763408", "0.49653295", "0.49615303", "0.49615303", "0.496...
0.0
-1
The Beta API is deprecated for 0.15.0 and later. It is recommended to use the GA API (classes and functions in this file not marked beta) for all further purposes. This function was generated only to ease transition from grpcio=0.15.0
def beta_create_SpiderServer_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): request_serializers = { ('DistributeSpider.SpiderServer', 'keepalive'): Register.SerializeToString, ('DistributeSpider.SpiderServer', 'req'): Request.SerializeToString, ('DistributeSpider.S...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_sdk():", "def patch_sdk():", "def patch_sdk():", "def api(self) -> str:", "def Version(self, request, context):\r\n context.set_code(grpc.StatusCode.UNIMPLEMENTED)\r\n context.set_details('Method not implemented!')\r\n raise NotImplementedError('Method not implemented!')", "def _rpc(ht...
[ "0.5615912", "0.5615912", "0.5615912", "0.52349323", "0.5166791", "0.5120645", "0.51126444", "0.5103273", "0.5074809", "0.5074809", "0.5021775", "0.5010595", "0.50012255", "0.50012255", "0.49892133", "0.49836612", "0.49777785", "0.49678397", "0.496399", "0.496399", "0.496399"...
0.0
-1
A convenient string representation that contains the current yaml map of this yamlizable
def __repr__(self) -> str: yaml_map = yamlmapper.yaml_map(self) yaml_map_items = [f"{k}={v!r}" for k, v in sorted(yaml_map.items())] return f"{self.__class__.__name__}({', '.join(yaml_map_items)})"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yaml(self):\n return str(self.data)", "def __str__(self):\n _dict = self._def.default.copy()\n _dict.update(self.__dict__)\n #return '%s(%r)' % (self.__class__, _dict)\n # If the yaml is too slow revert to the line above\n name = '%s <%s>' % (self.__class__.__name__,...
[ "0.7816891", "0.7704461", "0.7668333", "0.74728835", "0.74209595", "0.7258811", "0.7217699", "0.71320325", "0.71031713", "0.70095026", "0.6967369", "0.69200975", "0.6897495", "0.6850851", "0.6836524", "0.6836524", "0.6836524", "0.6836524", "0.6836524", "0.6836524", "0.6836524...
0.7610701
3
Set up a helical state in two meshes (one expressed in SI units the other expressed in nanometers) and compute energies and fields.
def test_dmi_uses_unit_length_2dmesh(): A = 8.78e-12 # J/m D = 1.58e-3 # J/m^2 Ms = 3.84e5 # A/m energies = [] # unit_lengths 1e-9 and 1 are common, let's throw in an intermediate length # just to challenge the system a little: for unit_length in (1, 1e-4, 1e-9): radius = 200e-9...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_hf_state(n_electrons, m_spin_orbitals, exp_init_state):\n\n res_init_state = qchem.hf_state(n_electrons, m_spin_orbitals)\n\n assert len(res_init_state) == len(exp_init_state)\n assert np.allclose(res_init_state, exp_init_state)", "def test_set_hs(self):\n s = State(substance=\"water\")\...
[ "0.6196272", "0.5871681", "0.57966113", "0.57727325", "0.57367516", "0.5681394", "0.56623125", "0.56580096", "0.56530404", "0.56218076", "0.55827063", "0.5560695", "0.5558276", "0.55430007", "0.55098903", "0.55060786", "0.55020607", "0.54688966", "0.54660153", "0.54400545", "...
0.51074696
57
Check that the interaction accepts a 'name' argument and has a 'name' attribute.
def test_interaction_accepts_name(): dmi = DMI(1) assert hasattr(dmi, 'name')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_interaction_accepts_name():\n demag = ThinFilmDemag()\n assert hasattr(demag, 'name')", "def _check_name(self):\n\t\tpass", "def test_should_name_field(self):\n self.assertIn(\"name\", self.fields)", "def test_name(self):\n self.assertTrue(type(x.name) == str)", "def test_name_...
[ "0.75773394", "0.7110944", "0.6599535", "0.6579234", "0.6573439", "0.6570425", "0.6569371", "0.65498203", "0.65390664", "0.6503915", "0.649423", "0.64581394", "0.64467174", "0.64241993", "0.6411254", "0.6389162", "0.6389162", "0.63616997", "0.6347092", "0.6335511", "0.6291245...
0.7530854
1
This method used for display login page
def home(): return render_template('login.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n self.render(\"login.html\")", "def login(self):", "def login():", "def login():", "def ShowLogin():\n current_user = helpers.get_current_user()\n if current_user is None:\n return render_template('login.html')\n else:\n return redirect('/')...
[ "0.7951904", "0.7758108", "0.77333164", "0.77333164", "0.7718853", "0.7666449", "0.7618106", "0.7531756", "0.75076485", "0.7502553", "0.7496109", "0.7496109", "0.74952745", "0.7480008", "0.7454812", "0.74520165", "0.7410382", "0.7389123", "0.7388959", "0.7370175", "0.7340623"...
0.6831181
60
this method used for admin login
def do_admin_login(): if request.form['password'] == 'admin' and request.form['username'] == 'admin': teams = get_team() if teams: return render_template('team-players.html', teams=teams) else: return render_template('team-players.html') else: flash('Inval...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login(self):\n\t\treturn", "def login(self):", "def login(self):\n #raise NotImplementedError(\"This method must be overridden\")", "def log_in(self):\n\t\tpass", "def login():", "def login():", "def _login(self, *args, **kwargs):\n pass", "def login_user():\n pass", "def login...
[ "0.82168025", "0.8136677", "0.7885547", "0.7831707", "0.7738362", "0.7738362", "0.77056754", "0.72187483", "0.7209008", "0.7152261", "0.7055392", "0.7018007", "0.699722", "0.68738675", "0.68244404", "0.6804018", "0.68002194", "0.6776731", "0.6769224", "0.6765747", "0.67484957...
0.66606766
24
This method used for display add team /player button
def add_team_player(): if request.form['add_template'] == 'Add Team': return render_template('addteam.html') elif request.form['add_template'] == 'Add Player': teams = get_team() return render_template('addplayer.html', teams=teams) else: return getAllPlayers()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_player_button():\r\n global state\r\n if not state == \"add\":\r\n clear_frames()\r\n\r\n \"\"\"Changing state global variable and subtitle and showing on screen\"\"\"\r\n state = \"add\"\r\n sub_title[\"text\"] = \"ADD PLAYER\"\r\n sub_title.pack()\r\n \"\"\...
[ "0.70463204", "0.6276204", "0.6261729", "0.62551904", "0.62009877", "0.61738485", "0.6087262", "0.6075263", "0.60548", "0.5982238", "0.59647626", "0.5960139", "0.5945807", "0.59443206", "0.59304005", "0.5914881", "0.58859", "0.58651036", "0.5848743", "0.5823961", "0.58157766"...
0.7212078
0
This method used for create player record
def add_team(): if request.method == 'POST': result = request.form teamImage = request.files['teamImage'].read() team = Team.query.filter_by(team_name=result['team_name']).first() if not team: team1 = Team(team_name=result['team_name'], team_image=teamImage) d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_player (self, username = None):\n # Get unique username if needed\n if (username == None):\n username = \"default_username\" + str (time.time ())\n self.username = username\n r = requests.post (self.url_endpoint, data = {\"new_player\": self.username})\n if ...
[ "0.6840854", "0.68380654", "0.6787083", "0.67529166", "0.66954476", "0.66239595", "0.6558398", "0.65532523", "0.6532968", "0.6459993", "0.6442115", "0.6412653", "0.63584226", "0.6342014", "0.6304426", "0.6299078", "0.6295376", "0.6277291", "0.623482", "0.62126124", "0.6199378...
0.0
-1
This method used for display team player details
def player_information(): if request.method == 'POST': result = request.form if request.files: playerImage = request.files['playerImage'].read() else: playerImage = None player = Player(player_image=playerImage, player_fname=result['player_first_name'], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_players_specific_tournament(self) -> None:\n id_choice = check.request_id(TOURNAMENTS)\n tournament_data = TOURNAMENTS.get(doc_id=id_choice)\n if tournament_data.get(\"players\") == {}:\n print(\"\\n This tournaments has no players yet\")\n else:\n players...
[ "0.7354015", "0.7117312", "0.69317603", "0.68635464", "0.68605345", "0.6838008", "0.67840564", "0.6766929", "0.6623634", "0.65735716", "0.65706027", "0.6545617", "0.6501806", "0.6447435", "0.63882464", "0.6384302", "0.63785684", "0.6371603", "0.63430077", "0.6341268", "0.6331...
0.66942006
8
This method used for get all team information
def get_team(): teams = Team.query.all() for each in teams: if each.team_image is not None: each.team_image = b64encode(each.team_image) return teams
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_teams():", "def get_all_team_info():\n # hit this url in browser or postman like http://127.0.0.1:5000/getAllTeamInfo and it will return json data\n final_team_list = []\n if request.method == 'GET':\n teams = Team.query.all()\n for rec in range(len(teams)):\n final_tea...
[ "0.83387434", "0.7830692", "0.77320063", "0.7586736", "0.7578475", "0.73616064", "0.7339716", "0.73322433", "0.729617", "0.72424203", "0.72424203", "0.7144458", "0.7142989", "0.71325344", "0.71232694", "0.70133734", "0.7008123", "0.6986277", "0.69839996", "0.6940332", "0.6920...
0.0
-1
This method used for edit team information
def team_edit(team_id): if request.method == 'GET': team = Team.query.filter_by(team_id=team_id).one() return render_template('edit_team.html', team=team)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_owners_can_edit_team_data(self):\n\n data = {\n 'description': 'Edited description',\n 'name': 'Edited Name'\n }\n response = self.client.patch(reverse('api:teams-detail', kwargs={'pk': self.team.id}), data)\n self.assertEqual(response.status_code, status....
[ "0.7191018", "0.709394", "0.7048175", "0.680195", "0.66895694", "0.6678483", "0.6646838", "0.66090715", "0.64634645", "0.6432834", "0.6409257", "0.6398768", "0.63267934", "0.6316041", "0.63043207", "0.6287093", "0.62806153", "0.6216511", "0.6209136", "0.61889", "0.61805123", ...
0.7488611
0
This method used for update team information
def updateteam(): if request.method == 'POST': result = request.form teamImage = request.files['teamImage'].read() team = Team.query.filter_by(team_id=result.get('team_id')).one() team.team_name = result.get('team_name') team.team_image = teamImage db.session.commit()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_team(self):\n pass", "def update(self, request, pk):\n print(\"Update a team\")\n serializer = data_serializers.UpdateTeamSerializer(data=request.data)\n if serializer.is_valid(raise_exception=True):\n request_data = serializer.save()\n new_team_e...
[ "0.78725547", "0.724243", "0.7214727", "0.7058914", "0.6833528", "0.6831357", "0.6818724", "0.67664814", "0.6736137", "0.67109764", "0.6687826", "0.66369903", "0.65911585", "0.65373755", "0.64549565", "0.6447125", "0.64403397", "0.6366431", "0.632347", "0.6323166", "0.6313954...
0.6851629
4
This method used for delete the Team record from database
def delete_team(team_id): if request.method == 'GET': Team.query.filter_by(team_id=team_id).delete() db.session.commit() teams = get_team() if teams: return render_template('team-players.html', teams=teams) else: return render_template('team-players.ht...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_team(self):\n pass", "async def delete(self):\n return await self._state.delete_team(self.id)", "def test_teams_delete_team_v1(self):\n pass", "async def delete_team(team_id: str = Path(..., description=\"ID value of the desired team\"),\n db_handler:...
[ "0.7857183", "0.7828139", "0.77602565", "0.7557753", "0.74525476", "0.74125135", "0.73758745", "0.72441757", "0.7106591", "0.71004575", "0.7047551", "0.6960293", "0.6867318", "0.6826918", "0.6826918", "0.6826918", "0.6826918", "0.68234664", "0.68062544", "0.6723711", "0.66972...
0.74472725
5
Display selected team Details
def display_selected_team(team_id): if request.method == 'GET': result_dict = {} teams = get_team() players = Player.query.join(Team, Player.team_id==team_id).\ add_columns(Player.player_fname,Player.player_lname,Team.team_name,Player.player_id) result_dict['teams'] = teams ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_team_page(request, team_pk):\n\t\n\tselected_team = ChallengeTeam.objects.get(pk = team_pk)\n\t\n\tusers = selected_team.team_members.all()\n\t\n\tteam_name = selected_team.team_name\n\t\n\tall_results = get_team_results(users, selected_team.challenge.schedule)\n\tteam_consistency = all_results[\"consiste...
[ "0.7378892", "0.7202127", "0.7011595", "0.6845789", "0.6786297", "0.6735039", "0.6540119", "0.64731157", "0.6464473", "0.6359951", "0.6321422", "0.6250159", "0.62016064", "0.6165804", "0.61371464", "0.61025214", "0.6068967", "0.60541105", "0.6038926", "0.60297716", "0.6023512...
0.7938968
0
This method used for delete the player record from database
def delete_player(player_id): if request.method == 'GET': Player.query.filter_by(player_id=player_id).delete() db.session.commit() return getAllPlayers()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, player_id):\n current_player = DBPlayer.query.get(player_id)\n if not current_player:\n return get_response(404, 'Not exists.')\n try:\n db.session.delete(current_player)\n db.session.commit()\n except Exception as e:\n db.ses...
[ "0.79688334", "0.79618365", "0.76981676", "0.76781356", "0.76715004", "0.76693827", "0.763336", "0.7630587", "0.76232153", "0.7562153", "0.7543041", "0.75104153", "0.74908626", "0.7459501", "0.7441687", "0.74217176", "0.7401913", "0.73951644", "0.7351567", "0.7345215", "0.733...
0.7211305
23
This method pull all player information from player table
def getAllPlayers(): result_dict = {} teams = get_team() players = db.session.query(Player, Team).join(Team, Player.team_id == Team.team_id) for each in players: if each.Player.player_image is not None: each.Player.player_image = b64encode(each.Player.player_image) result_dict['t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def players_list(self):\n self.db = TinyDB('Models/db.json')\n self.query = Query()\n player_table = self.db.table('player_table')\n return player_table", "def _get_player_info(self):\n return [player._player_info() for player in self.players.values()]", "async def get_player...
[ "0.724439", "0.71141773", "0.69476527", "0.68183863", "0.67419237", "0.6687014", "0.6661582", "0.66249704", "0.66111124", "0.6560406", "0.65440094", "0.6526902", "0.65245336", "0.64350224", "0.6427198", "0.6422903", "0.64129514", "0.6401265", "0.6377747", "0.6361764", "0.6349...
0.61114275
33
This method used for edit player information
def player_edit(player_id): if request.method == 'GET': result = {} player = Player.query.filter_by(player_id=player_id).one() player.player_image = b64encode(player.player_image) teams = get_team() result['player'] = player result['teams'] = teams return rend...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, player_info):\n self.seat = player_info.get(\"seat\", -1)\n self.name = player_info.get(\"name\", \"unknown\")\n self.sit_out = player_info.get(\"sit_out\", True)", "def edit_user(self):\n from editWindow import EditPlayer\n self.edit = EditPlayer(self.lang, se...
[ "0.70508623", "0.691375", "0.6630395", "0.6581151", "0.6499907", "0.6449183", "0.64047134", "0.63949656", "0.6385882", "0.6316389", "0.63095105", "0.63081056", "0.62880075", "0.6282538", "0.6196724", "0.6143135", "0.6126377", "0.61088145", "0.6087335", "0.6076133", "0.6074033...
0.7211967
0
This method return all team information
def get_all_team_info(): # hit this url in browser or postman like http://127.0.0.1:5000/getAllTeamInfo and it will return json data final_team_list = [] if request.method == 'GET': teams = Team.query.all() for rec in range(len(teams)): final_team = {} final_team['Te...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_teams():", "def getAllTeams(self):\n return []", "def getTeam(self):\n return [\"The A-Team\", \"some other bloke\"]", "def get_people(team):", "def get_teams(self):\n url = 'teams'\n result = self.get(url)\n return result.get('teams', result)", "def get_team_li...
[ "0.8226794", "0.75884455", "0.7483768", "0.74514127", "0.73995537", "0.7057975", "0.7048445", "0.70254403", "0.6986613", "0.6854374", "0.67867225", "0.67421323", "0.6741827", "0.67249024", "0.66893196", "0.668395", "0.6670714", "0.6653283", "0.6628329", "0.6627309", "0.662307...
0.7789952
1
This method return all players based on team name
def get_players_info(team_name): # hit this url in browser or postman like http://127.0.0.1:5000/getPlayersInfo/TeamName and it will return json data final_player_list = [] if request.method == 'GET': team_res = Team.query.filter_by(team_name=team_name).first() if team_res: playe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def players(self):\n return Player.objects.filter(team=self)", "def get_contracted_players(self, team):\n # setting up empty list of players\n players = list()\n\n # getting html document with team's contracted players\n doc = self.get_html_document(team, 'contracts')\n\n ...
[ "0.77261233", "0.76394296", "0.7557019", "0.7309519", "0.7277449", "0.72452086", "0.72448725", "0.7179656", "0.7172564", "0.7118045", "0.70307726", "0.7022754", "0.6972246", "0.69710726", "0.69181055", "0.689715", "0.68528575", "0.68509346", "0.68254", "0.6812624", "0.6722899...
0.6573771
28
This method used for display all player information for read only user
def display_read_only_user(): # hit this url in browser. if request.method == 'GET': result_dict = {} teams = get_team() players = db.session.query(Player, Team).join(Team, Player.team_id == Team.team_id) for each in players: if each.Player.player_image is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_player_info(self):\n\t\tclear_screen()\n\n\t\tprint(\"# PLAYER INFO #\\n\")\n\t\tprint(\"Name{:.>17} \".format(self.info['Name']))\n\t\tprint(\"Race{:.>17} \".format(self.info['Race']))\n\t\tprint(\"Level{:.>16} \".format(self.stats['Level']))\n\t\tprint(\"Hit Points{:.>11} \".format(self.stats['HP...
[ "0.6989941", "0.68834287", "0.6581664", "0.65732765", "0.6539903", "0.6517564", "0.64415467", "0.64375114", "0.6384573", "0.63242304", "0.6293608", "0.62828076", "0.62666297", "0.624345", "0.6231377", "0.6223611", "0.61990607", "0.61758673", "0.61674625", "0.6142857", "0.6140...
0.753156
0
Creates a Cell from a JSON dictionary.
def from_json(self, _json: Dict) -> "Cell": cell = Cell(content=_json["content"], data=_json["data"]) cell.id = _json["id"] return cell
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_json(cls, _json: Dict) -> \"Page\":\n\n page = cls(\n cells=[Cell.from_json(cell_json) for cell_json in _json[\"cells\"]],\n data=_json[\"data\"],\n )\n page.id = _json[\"id\"]\n return page", "def from_dict(self, d):\n return Grid(**d)", "def f...
[ "0.6552123", "0.6535798", "0.6277082", "0.6269054", "0.6266621", "0.61997414", "0.61492914", "0.6125334", "0.5983177", "0.5935195", "0.58735913", "0.58735913", "0.58735913", "0.58735913", "0.58735913", "0.58735913", "0.58735913", "0.58735913", "0.58735913", "0.58735913", "0.5...
0.82266605
0
Converts the Cell to a JSON dictionary.
def json(self) -> CellJson: return {"id": self.id, "content": self.content, "data": self.data}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_dict(self) -> Dict[str, Any]:\n return {\n column_title: cell.get_value()\n for column_title, cell in self.column_title_to_cell.items()\n }", "def as_dict(self) -> Dict[str, Any]:\n return {\n column_title: cell.value\n for column_title, cel...
[ "0.6867866", "0.67923075", "0.66359794", "0.6611153", "0.64058787", "0.6400758", "0.6392397", "0.6365426", "0.6365426", "0.6365426", "0.6361674", "0.63474494", "0.63334906", "0.63334906", "0.6331991", "0.6330032", "0.6330032", "0.6330032", "0.6330032", "0.6330032", "0.6330032...
0.80724275
0
Do the basic methods work?
def test_basic(): spec = IGRINSSpectrum(file=file, order=10) assert spec is not None assert isinstance(spec, Spectrum1D) assert isinstance(spec.flux, np.ndarray) assert len(spec.flux) == len(spec.wavelength) assert spec.mask.sum() > 0 new_spec = spec.remove_nans() assert new_spec.sha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(self):\r\n pass", "def main(self):", "def basic(self):\n pass", "def Run():\r\n pass", "def main():\n pass", "def RUN(self):", "def simple():", "def simple():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", ...
[ "0.7232877", "0.7179099", "0.69246185", "0.692093", "0.6905209", "0.6823088", "0.67499316", "0.67499316", "0.6743324", "0.6743324", "0.6743324", "0.6743324", "0.6743324", "0.6743324", "0.6743324", "0.6743324", "0.6743324", "0.6743324", "0.6743324", "0.6743324", "0.6743324", ...
0.0
-1
Does uncertainty propagation work?
def test_uncertainty(): spec = IGRINSSpectrum(file=file, order=10) assert spec.uncertainty is not None assert hasattr(spec.uncertainty, "array") assert len(spec.flux) == len(spec.uncertainty.array) assert spec.flux.unit == spec.uncertainty.unit new_spec = spec.remove_nans() assert len(ne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uncertainty_ee(self,e1,e2):\n # reco\n unc = (self._eleRecoWeight[(e1.pt(),e1.eta())][1]/self._eleRecoWeight[(e1.pt(),e1.eta())][0] + \\\n self._eleRecoWeight[(e2.pt(),e2.eta())][1]/self._eleRecoWeight[(e2.pt(),e2.eta())][0])**2\n # id-isolation\n unc += (self._eleIdIsoWeight[(e1....
[ "0.7023033", "0.6477262", "0.6477262", "0.64747536", "0.64158547", "0.61617506", "0.6103972", "0.59602594", "0.59567297", "0.591283", "0.591283", "0.591283", "0.5810102", "0.5810102", "0.5810102", "0.57871217", "0.57767254", "0.5772044", "0.57681143", "0.57503945", "0.5740525...
0.0
-1
Can we measure equivalent widths?
def test_equivalent_width(): spec = IGRINSSpectrum(file=file) mu = np.median(spec.wavelength.value) equivalent_width = spec.measure_ew(mu) assert equivalent_width is not None assert type(equivalent_width) is not int assert type(equivalent_width) is astropy.units.quantity.Quantity new_unit ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def width(self) -> int:", "def width(self) -> int:", "def widths(self):\n return self._widths", "def estimate_width(start, end, numlabels=None, char_width=None):\n return 0, 0", "def test_check_width(self):\n r1 = Rectangle(10, 2)\n self.assertEqual(r1.width, 10)\n\n r2 = Rec...
[ "0.7498377", "0.7498377", "0.72372097", "0.69278175", "0.67874897", "0.67776704", "0.6722984", "0.6679934", "0.66486084", "0.6464722", "0.6442885", "0.6399709", "0.6371484", "0.6366305", "0.6364684", "0.6364684", "0.6364684", "0.6364684", "0.6364684", "0.6364684", "0.6364684"...
0.7152717
3
Does smoothing and outlier removal work?
def test_smoothing(): spec = IGRINSSpectrum(file=file) new_spec = spec.remove_outliers(threshold=3) assert len(new_spec.flux) > 0 assert new_spec.shape[0] <= spec.shape[0] assert new_spec.shape[0] > 0 assert new_spec.mask is not None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def outlier(arr, as_nan=True, thresh=0.05, show=False, report=False):\n if len(arr) < 3:\n return arr\n if show:\n plt.subplot(1,2,1) # Plot part 1 first\n plt.plot(np.random.random(len(arr)), thing1, 'o', color='blue',\n markeredgecolor='none', alpha=0.4)\n plt.title('With outliers')\n ...
[ "0.69179946", "0.6402754", "0.63572776", "0.62770617", "0.62203604", "0.61959535", "0.6186184", "0.6164992", "0.6164357", "0.61016166", "0.6089655", "0.60500485", "0.60478014", "0.6020404", "0.6016225", "0.6007301", "0.6002241", "0.597885", "0.5976333", "0.5957397", "0.594395...
0.6860557
1
Does RV shifting work
def test_RV(): spec = IGRINSSpectrum(file=file) assert spec.uncertainty is not None assert hasattr(spec, "barycentric_correct") correction_velocity = spec.estimate_barycorr() assert isinstance(spec.RA, astropy.units.quantity.Quantity) assert isinstance(spec.DEC, astropy.units.quantity.Quanti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def right_shift_quirk(self):\n register = self.return_middle_registers(self.opcode)\n bits = self.registers[register[1]]\n self.registers[0xF] = bits & 0b1\n self.registers[register[0]] = self.registers[register[1]] >> 1\n logger.info(\"Shifted register V{} to the right into V{}(...
[ "0.69488525", "0.68362254", "0.67707986", "0.67707986", "0.66768026", "0.6673234", "0.66563946", "0.66563946", "0.64938307", "0.64050066", "0.63850296", "0.6352056", "0.6345997", "0.6341593", "0.62932235", "0.62932235", "0.62131655", "0.61368865", "0.6103431", "0.6093303", "0...
0.0
-1
Does uncertainty propagation work?
def test_deblaze(): spec = IGRINSSpectrum(file=file) new_spec = spec.remove_nans().deblaze() assert new_spec is not None assert isinstance(new_spec, Spectrum1D)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uncertainty_ee(self,e1,e2):\n # reco\n unc = (self._eleRecoWeight[(e1.pt(),e1.eta())][1]/self._eleRecoWeight[(e1.pt(),e1.eta())][0] + \\\n self._eleRecoWeight[(e2.pt(),e2.eta())][1]/self._eleRecoWeight[(e2.pt(),e2.eta())][0])**2\n # id-isolation\n unc += (self._eleIdIsoWeight[(e1....
[ "0.7023033", "0.6477262", "0.6477262", "0.64747536", "0.64158547", "0.61617506", "0.6103972", "0.59602594", "0.59567297", "0.591283", "0.591283", "0.591283", "0.5810102", "0.5810102", "0.5810102", "0.57871217", "0.57767254", "0.5772044", "0.57681143", "0.57503945", "0.5740525...
0.0
-1
Does the Spectrum List work?
def test_spectrumlist_performance(precache_hdus): t0 = time.time() spec_list = IGRINSSpectrumList.read(file, precache_hdus=precache_hdus) t1 = time.time() net_time = t1 - t0 print(f"\n\t Precached HDUs {precache_hdus}: {net_time:0.5f} seconds", end="\t") assert spec_list is not None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spect(self):\n return 1", "def getAllSpectrumMeasurements(self): \n return self.spectrum", "def spectate(self):\n pass", "def find_spectra(self):\r\n\r\n #### Begin functionality here\r\n\r\n return()", "def isSpectrumRequested(self) -> bool:\n while True:\n ...
[ "0.6561537", "0.6362145", "0.6324333", "0.63095045", "0.61777866", "0.6138286", "0.6097585", "0.60474753", "0.6045568", "0.601384", "0.5990894", "0.59334475", "0.59300584", "0.592409", "0.5922526", "0.59224993", "0.5907508", "0.58886427", "0.5878402", "0.58668196", "0.5860067...
0.6077373
7
Return CPU Usage in %
def cpuusage(request, host_id): if not request.user.is_authenticated(): return HttpResponseRedirect('/login') host = Host.objects.get(id=host_id) try: conn = ConnServer(host) except: conn = None if conn: cpu_usage = conn.cpu_get_usage() return HttpResponse(cpu_u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cpu_usage():\n return psutil.cpu_percent()", "def cpu_usage():\n return str(_cpu_usage())", "def get_cpu_use():\n cpu_cent = psutil.cpu_percent()\n return str(cpu_cent)", "def getcpuusage(self):\n return ord(self.reg(0x11, write=1))", "def cpu():\n sin = psutil.cpu_percent...
[ "0.87442744", "0.8629406", "0.858648", "0.84777236", "0.8238267", "0.82277244", "0.8201909", "0.8173694", "0.78069717", "0.7805571", "0.777815", "0.77320904", "0.76780444", "0.76228017", "0.7590143", "0.75805867", "0.7517144", "0.7472642", "0.7344525", "0.7236686", "0.7229302...
0.63918686
87
Return Memory Usage in %
def memusage(request, host_id): if not request.user.is_authenticated(): return HttpResponseRedirect('/login') host = Host.objects.get(id=host_id) try: conn = ConnServer(host) except: conn = None if conn: mem_usage = conn.memory_get_usage() return HttpResponse(me...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_memory_percent(self):\r\n rss = self.get_memory_info()[0]\r\n try:\r\n return (rss / float(TOTAL_PHYMEM)) * 100\r\n except ZeroDivisionError:\r\n return 0.0", "def MemoryUsage(cls):\n\t\tmeminfo = cls.MemoryInfo()\n\t\treturn (meminfo[\"MemTotal\"] - meminfo[\"M...
[ "0.82312447", "0.8034054", "0.7917152", "0.78094107", "0.7602421", "0.75550836", "0.7521147", "0.7441002", "0.7327086", "0.72985727", "0.72715676", "0.72538465", "0.72340304", "0.7212965", "0.7159357", "0.7099024", "0.70843774", "0.7078243", "0.7077288", "0.7062136", "0.70602...
0.0
-1
\brief Default constructor, it initializes the databaseWiki variable.
def __init__(self): ##type:databaseWiki = access to the database self.db = databaseWiki()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, host='localhost', user='wikiwsd', passwd='wikiwsd', database='wikiwsd3'):\n self._host = host\n self._user = user\n self._passwd = passwd\n self._database = database", "def __init__(self, wiki_conn=None):\n self.wiki_conn = wiki_conn\n if self.wiki_con...
[ "0.708437", "0.69342434", "0.69288975", "0.6805751", "0.6754723", "0.65667826", "0.6545131", "0.65421885", "0.65306705", "0.6463664", "0.6458318", "0.6417798", "0.6396213", "0.6387407", "0.6325784", "0.6324736", "0.6317163", "0.62913865", "0.62650484", "0.62550473", "0.622171...
0.83109426
0
\brief The function write a pickle file storing the element given in input.
def writeFile(self, f, fname): with open(self.PATH + fname, 'wb') as handle: pickle.dump(f, handle, protocol = pickle.HIGHEST_PROTOCOL)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store (input, filename) :\n cout = open (filename, 'w')\n pickle.dump (input, cout)\n cout.close ()", "def write_to_file(name, obj):\n\n print 'writing structures to pickle'\n print '----------------------------'\n\n path = os.getcwd() + '/pickles/' + name + '.pkl'\n file = open(path, 'w...
[ "0.80946714", "0.73514223", "0.7174753", "0.7043321", "0.6871412", "0.6861126", "0.6785245", "0.67609954", "0.6739979", "0.6728062", "0.66913444", "0.6677265", "0.666801", "0.66588134", "0.6634674", "0.6615443", "0.6602087", "0.65985113", "0.6567265", "0.65144295", "0.648098"...
0.0
-1
\brief The function read a pickle file and return the related structure.
def readFile(self, fname): res = None with open(self.PATH + fname, 'rb') as handle: res = pickle.load(handle) return res
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_from_file(name):\n print 'reading structures from pickle'\n print '------------------------------'\n\n path = os.getcwd() + '/pickles/' + name + '.pkl'\n file = open(path, 'rb')\n new_obj = pickle.load(file)\n file.close()\n\n return new_obj", "def read_pickle(file_name):\n with ...
[ "0.8217308", "0.80409527", "0.78461426", "0.7821366", "0.77141094", "0.7711124", "0.76885915", "0.7572694", "0.75610256", "0.7456856", "0.74414194", "0.74295825", "0.740508", "0.7398977", "0.73620373", "0.7164559", "0.7153945", "0.71497643", "0.7147033", "0.7104803", "0.71043...
0.6882876
40
\brief The function computes the vector representation for all the Wikipedia pages contained in the dataset. \return dict = Dictionary containing the vectors representaion of the pages.
def getVectors(self): vectors = dict() i = 0 N = len(self.db.invertedIndex) for w, (idf, docs) in self.db.invertedIndex.items(): for doc, tf in docs.items(): try: vectors[doc][i] = tf * idf except KeyError as k: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getVector(self, p):\n vector = {}\n i = 0\n tr = ParseDumpWiki.normName(p)\n if(self.db.isInPage(tr)):\n for w, (idf, docs) in self.db.invertedIndex.items():\n if (p in docs):\n vector[i] = idf * docs[p]\n i += 1\n e...
[ "0.6587773", "0.58068377", "0.57203215", "0.5535077", "0.5424847", "0.53094625", "0.5303565", "0.5172667", "0.5141664", "0.514158", "0.5138805", "0.5123758", "0.5084756", "0.5056258", "0.5039636", "0.5034146", "0.503222", "0.50316185", "0.5027339", "0.5025092", "0.5025092", ...
0.58590835
1
\brief The function receives as input a and b which are the vector representions of two pages and computes the cosine distance between them.
def cosin_sim_pairs(a, b): wordsA = set(a.keys()) wordsB = set(b.keys()) inter = wordsA.intersection(wordsB) if(len(inter) == 0): return 0.0 aa, bb, ab = 0, 0, 0 for k in inter: aa += a[k] ** 2 bb += b[k] ** 2 ab += a[k] * b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cosine_sim_counters(a, b):\n union_ab = sorted((a | b).keys())\n veca = np.array([a[element] if element in a else 0 for element in union_ab])\n vecb = np.array([b[element] if element in b else 0 for element in union_ab])\n return np.dot(veca, vecb) / (np.linalg.norm(veca) * np.linalg.norm(vecb))", ...
[ "0.7354454", "0.7341037", "0.73363996", "0.7245744", "0.70223963", "0.69380355", "0.6905679", "0.6857959", "0.68225634", "0.67990756", "0.6796523", "0.6744453", "0.6743802", "0.67340875", "0.66509485", "0.6621326", "0.65913004", "0.65491676", "0.65478724", "0.6521512", "0.648...
0.71980083
4
\brief The function create all the centroids of the categories with at least inferior_limit number of pages.
def getAllCentroids(self, inferior_limit = 5, withPrint = True, saveFile = True, test = []): i = 0 if(withPrint): print("I'm creating the page-categories dictionary") pageCat = self.db.getAllCategoriesGivenAllPages(inferior_limit) if(len(test) > 0): for p in test:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_clusters(self):\n ex = 0\n print 'Iter - Purity Gini Index'\n while ex < self.MAX_ITERATION:\n new_clusters = np.zeros(self.centroids.shape)\n distances = euclidean_distances(self.vectors, self.centroids).argmin(axis=1)\n for i in ran...
[ "0.591679", "0.58336884", "0.58054376", "0.5760245", "0.5747278", "0.5706009", "0.5687512", "0.56336176", "0.56279874", "0.5624772", "0.559929", "0.55759454", "0.5550014", "0.5542134", "0.5538682", "0.55276316", "0.5519205", "0.55120516", "0.5507998", "0.55051845", "0.5486359...
0.80864805
0
\brief The function goes through the Wikipedia vectors and computes the clustering over them.
def getCluster(self, eps = None, minPts = None): #D = getDistanceMatrix() #print("Distance matrix completed, clustering in process") clusters = DBSCAN(metric=Categorization.cosin_sim_pairs).fit_predict(np.arange(186696).reshape(-1, 1)) print("Clustering completed, writing pickle file") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_clusters(self, documents):\n ###TODO\n for d in range(0, len(documents)):\n maxi = 999999999\n for cid in range(0, len(self.means)):\n dist = self.distance(documents[d], self.means[cid], self.norms[cid])\n if dist < maxi:\n ...
[ "0.6328683", "0.595852", "0.59465694", "0.59238094", "0.5897435", "0.5855392", "0.5817326", "0.5804965", "0.5793152", "0.57682014", "0.57520354", "0.57100016", "0.57018745", "0.5690092", "0.56882155", "0.5674623", "0.5670595", "0.5640571", "0.56251144", "0.5584446", "0.557590...
0.0
-1
\brief The function computes the matrix containing the distances between the vector representations of the wikipedia pages. \return matrix = Matrix containing the Wikipedia pages distances.
def getDistanceMatrix(self): v = self.getVectors() vLis = v.keys() N = len(v.keys()) D = np.zeros([N, N], dtype=np.float32) print(N) for i in range(N): print("%d/%d" %(i, N)) D[i, i] = 1 for j in range(i + 1, N): dist = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cal_distances(embeddings):\n # calculate\n dist = np.zeros([len(embeddings), len(embeddings)], dtype=float)\n for ii in xrange(len(embeddings)):\n for jj in xrange(ii + 1, len(embeddings)):\n dist[ii, jj] = np.linalg.norm(embeddings[ii] - embeddings[jj])\n dist[jj, ii] = d...
[ "0.63889927", "0.6071922", "0.6015121", "0.5982461", "0.5942183", "0.58543384", "0.57427573", "0.57176197", "0.56639916", "0.55544895", "0.5540237", "0.55395204", "0.5484299", "0.54806894", "0.5416728", "0.54155767", "0.54121035", "0.53967595", "0.5396559", "0.53624177", "0.5...
0.5844763
6
\brief The function receives as input p which is a Wikipedia page name and it computes its vector representation.
def getVector(self, p): vector = {} i = 0 tr = ParseDumpWiki.normName(p) if(self.db.isInPage(tr)): for w, (idf, docs) in self.db.invertedIndex.items(): if (p in docs): vector[i] = idf * docs[p] i += 1 else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vector(word, model):\n return model.wv[word]", "def geo2vec(p):\n ra, dec = map(radians, p)\n return numpy.array([cos(dec) * cos(ra),\n cos(dec) * sin(ra),\n sin(dec)])", "def compute_paraphrase_vector(w1, w2, paraphrase, model, word2index, UNK):\n...
[ "0.5726636", "0.5670378", "0.56148446", "0.5528788", "0.55178714", "0.54855853", "0.5459716", "0.5454969", "0.5435176", "0.5347205", "0.5257061", "0.5244839", "0.5174825", "0.5163313", "0.5160711", "0.5157782", "0.51471853", "0.5105118", "0.5097582", "0.50825983", "0.5060565"...
0.7949694
0
\brief The function receives as input page which is the name of the page to be recommended. Additionally, it returns the boolean, fractional and hierarchical measures.
def recommendCategory(self, page, randomWeb, centroids = None, nSugg = None, printRes = True): if(centroids is None): try: centroids = self.readFile("centroids.pickle") except: centroids = self.getAllCentroids() if(randomWeb): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_page(self, page, lang):\n\n sql = text(\n \"select tfd.tid, tfd.name, tfd.description__value \"\n \"from taxonomy_term_field_data tfd \"\n \"where tfd.langcode = :lang and tfd.tid = :tid \"\n \"order by tfd.name;\")\n\n results = self.conn.execute...
[ "0.5150827", "0.5136092", "0.51097214", "0.502858", "0.5004379", "0.4993655", "0.49898502", "0.4927899", "0.4912906", "0.48907775", "0.48756838", "0.48688158", "0.48327056", "0.48163545", "0.48052007", "0.47910896", "0.4765261", "0.47638354", "0.47518128", "0.4677516", "0.467...
0.44206786
68
\brief The function receives as input actual, top and nSugg which are the real categories, the suggested categories and the number of suggested categories. Then, it returns the boolean, fractional and hierarchical measures.
def measures(self, actual, top, nSugg): m2 = 0.0 m3 = 0.0 for categorySug, count in top: if categorySug in actual: m2 += 1.0 else: for cR in actual: if self.getFatherSon(cR, categorySug) != None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printStats(m2, m3, actual, top):\n print(\"\\nThe actual categories for this page are: %s\" % \", \".join(sorted(actual)))\n print(\"\\nThe suggested categories for this page are: %s\" % \", \".join(sorted([v for v, count in top])))\n print(\"\\nBOOLEAN MEASURE = %s\" %(m2 != 0))\n ...
[ "0.6279863", "0.5812435", "0.57591397", "0.5720849", "0.56757563", "0.55937576", "0.55148196", "0.545167", "0.54158485", "0.53934085", "0.53467155", "0.5326005", "0.529815", "0.52958894", "0.5240811", "0.5219415", "0.52064973", "0.5205301", "0.5186157", "0.5183564", "0.516829...
0.7087484
0
\brief The function receives as input m2, m3, actual and top which are the fractional measure, the hierarchical measure, the real categories and the recommended categories. Then, it prints the reccomendation results.
def printStats(m2, m3, actual, top): print("\nThe actual categories for this page are: %s" % ", ".join(sorted(actual))) print("\nThe suggested categories for this page are: %s" % ", ".join(sorted([v for v, count in top]))) print("\nBOOLEAN MEASURE = %s" %(m2 != 0)) print("FRACTIONAL MEAS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def measures(self, actual, top, nSugg):\n m2 = 0.0\n m3 = 0.0\n for categorySug, count in top:\n if categorySug in actual:\n m2 += 1.0\n else:\n for cR in actual:\n if self.getFatherSon(cR, categorySug) != None:\n ...
[ "0.6225919", "0.6079369", "0.60408586", "0.58891267", "0.58619076", "0.5833258", "0.58032775", "0.57549334", "0.5747019", "0.57380384", "0.57230663", "0.56918466", "0.56778634", "0.560007", "0.55710596", "0.55510956", "0.5533128", "0.55227405", "0.5505769", "0.5481364", "0.54...
0.7809993
0
\brief The function receives as input catR and catS which are the name of the real and suggested category respectively. Then, it returns a list containing the brother categories.
def getBrothers(self, catR, catS): c = self.db.db.cursor() c.execute('SELECT * FROM catsub WHERE ? IN (SELECT cat_name FROM cat_name_sub WHERE cat_name_sub = ?)', [catS, catR]) return c.fetchall()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFatherSon(self, catR, catS):\n c = self.db.db.cursor()\n c.execute('SELECT * FROM catsub WHERE (cat_name_sub = ? AND cat_name = ?) OR (cat_name_sub = ? AND cat_name = ?)', [catS, catR, catR, catS])\n return c.fetchall()", "def get_categories(race_name, event_discipline):\n # FIXME ...
[ "0.594012", "0.591181", "0.58667684", "0.5775641", "0.56613356", "0.56484073", "0.56390023", "0.5602293", "0.5578761", "0.5563652", "0.553586", "0.551049", "0.5499992", "0.54530984", "0.54503536", "0.542002", "0.54172385", "0.5377499", "0.5368948", "0.53368497", "0.53361046",...
0.73143184
0
\brief The function receives as input catR and catS which are the name of the real and suggested category respectively. Then, it returns a list containing the father/son category.
def getFatherSon(self, catR, catS): c = self.db.db.cursor() c.execute('SELECT * FROM catsub WHERE (cat_name_sub = ? AND cat_name = ?) OR (cat_name_sub = ? AND cat_name = ?)', [catS, catR, catR, catS]) return c.fetchall()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getBrothers(self, catR, catS):\n c = self.db.db.cursor()\n c.execute('SELECT * FROM catsub WHERE ? IN (SELECT cat_name FROM cat_name_sub WHERE cat_name_sub = ?)', [catS, catR])\n return c.fetchall()", "def getCatParent(mode, cat):\n rta = set([])\n if mode == 'n':\n cat = ge...
[ "0.62573487", "0.6106083", "0.60577494", "0.56528056", "0.5651913", "0.558147", "0.5531332", "0.55153984", "0.54351413", "0.54163444", "0.53731084", "0.53554934", "0.5351091", "0.5313431", "0.5312579", "0.5300816", "0.52691513", "0.5245465", "0.52395195", "0.52258575", "0.522...
0.67822933
0
\brief The function receives as input npages which is the number of Wikipedia pages to be evaluated and pageWeb which is the page to be recommended. It computes the boolean, fractional and hierarchical measures and prints them.
def evaluation(self, npages, centroids = None, randomWeb = False, pageWeb = None): if(centroids is None): try: centroids = self.readFile("centroids.pickle") except: centroids = self.getAllCentroids(5) if(randomWeb): pages = [pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _huge_math_page_to_pages( env_dict ):\n import _math\n wiki_xml_math_output = env_dict[\"wiki\"][\"xml_math_output_big\"]\n #wiki_xml_math_output = env_dict[\"wiki\"][\"xml_math_output_test\"]\n\n from indexer.egomath.interface import egomath_inst\n\n egomath_inst.reset_logging()\n\n wiki_pag...
[ "0.59357786", "0.5932471", "0.5842498", "0.578283", "0.57478404", "0.5516917", "0.5436369", "0.5406314", "0.5350473", "0.53293777", "0.5325934", "0.53164136", "0.52994996", "0.5296685", "0.5255585", "0.52087426", "0.520245", "0.51963955", "0.5173262", "0.5158161", "0.5156993"...
0.6455389
0
\brief The function receives as input nPageRacc and percentageTest which are the number of pages to be recommended for each step and the dataset fraction to use as test set. It computes several test recommending every time nPageRacc pages. For each step it considers a different number of categories. Specifically, it st...
def measurements(self, minPag = 4, maxPag = 50, nPagesRacc = 100, percentageTest = 0.20): allPages = self.db.getPages() test = random.sample(allPages, int(len(allPages) * percentageTest)) avg = [] centroids = self.getAllCentroids(inferior_limit = minPag, withPrint = False, saveFile = Fal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluation(self, npages, centroids = None, randomWeb = False, pageWeb = None):\n if(centroids is None):\n try:\n centroids = self.readFile(\"centroids.pickle\")\n except:\n centroids = self.getAllCentroids(5)\n \n if(randomWeb):\n ...
[ "0.6586228", "0.54735696", "0.5389025", "0.53873664", "0.5326797", "0.52404207", "0.52213144", "0.5221267", "0.52032757", "0.5190112", "0.51853114", "0.5179685", "0.5139516", "0.5075939", "0.5066819", "0.5063224", "0.5048917", "0.4999439", "0.49959165", "0.4967029", "0.495851...
0.7285168
0
\brief The function reads a pickle file containing the results of a precomputed recommendation and creates a plot.
def createGraph(self): self.measurements(45,50,10) avg = self.readFile("avg.pickle") table = [] for a in avg: table.append((a[0], a[1], a[2], a[3], a[4], "Boolean")) table.append((a[0], a[1], a[2], a[5], a[6], "Fractional")) table.append((a[0], a[1], a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_predicted_results(self):\n print(\"\\n\\nLoad prediction answers : \")\n with open(\"predicted_results\", \"rb\") as predicted_results:\n self.predicted_results = pickle.load(predicted_results)", "def load_and_plot(file_name):\n data = loadtxt(file_name, delimiter=',') \n ...
[ "0.63101786", "0.6110959", "0.60890526", "0.5957507", "0.593092", "0.57316566", "0.5674381", "0.5673797", "0.5620238", "0.5561095", "0.55385715", "0.5532282", "0.55145824", "0.54861766", "0.5467465", "0.54420614", "0.54209906", "0.5416908", "0.5400912", "0.53858835", "0.53719...
0.0
-1
Create a new TestProperty.
def __init__(self, name: str, value: str, prompt_on_start: bool): self._name = name self._value = value self._prompt_on_start = prompt_on_start
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_property(self, key, prop):\n\n setting = self.new_property(key, prop)\n setting.create()\n return setting", "def _makeProperty( key, value ):\r\n property = PropertyValue()\r\n property.Name = key\r\n property.Value = value\r\n return property", "def ...
[ "0.7377541", "0.69545835", "0.66893363", "0.6443179", "0.6308621", "0.6186396", "0.6117073", "0.5987714", "0.59646297", "0.594769", "0.59302294", "0.59260756", "0.5924119", "0.59083", "0.5882198", "0.5846983", "0.5811372", "0.5779722", "0.57644075", "0.57415414", "0.57031035"...
0.0
-1
The name of the property.
def name(self) -> str: return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def property_name(self) -> str:\n return str(self.prop_name)", "def PropertyName(self) -> str:", "def name(self):\n return self.prop.key", "def name(self):\n return self.properties.get('name')", "def name(self):\n return self.properties.get('name')", "def name(self):\n ...
[ "0.90803915", "0.87418354", "0.8487143", "0.8374365", "0.8374365", "0.8319438", "0.8217758", "0.8098709", "0.80601984", "0.8012581", "0.7849445", "0.78423166", "0.7655662", "0.7542669", "0.7353873", "0.7339226", "0.72947204", "0.72669065", "0.7232947", "0.72147584", "0.721475...
0.7171753
72
The value of the property.
def value(self) -> str: return self._value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n return self._value", "def get_value(self):\n return self._value", "def get_value(self):\n return self._value", "def value(self):\n return self.__value", "def value(self):\n return self.__value", "def get_value(self):\n return self._value"...
[ "0.82087135", "0.81645244", "0.81645244", "0.81625575", "0.81625575", "0.8161171", "0.8161171", "0.8161171", "0.8132177", "0.8132177", "0.8132177", "0.8080328", "0.8080328", "0.8080328", "0.8080328", "0.8080328", "0.8080328", "0.8080328", "0.8080328", "0.8080328", "0.8080328"...
0.80432713
44
Whether this property should be set when the test session starts. If this is set to true, the operator should be prompted to define this property when the test session starts.
def prompt_on_start(self) -> bool: return self._prompt_on_start
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_in_test_console(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"use_in_test_console\")", "def use_in_test_console(self) -> pulumi.Output[Optional[bool]]:\n return pulumi.get(self, \"use_in_test_console\")", "def setUp(self):\n self._value = True", "def get_prog...
[ "0.6495761", "0.6205219", "0.61119777", "0.59335816", "0.587958", "0.58611184", "0.57824", "0.57824", "0.576163", "0.5717222", "0.56998116", "0.5685739", "0.56485736", "0.5592741", "0.55852425", "0.55688953", "0.55402637", "0.5536345", "0.5528514", "0.55212355", "0.5498861", ...
0.59922504
3
Ordered dictionary of all objects to be simulated, keyed by their names.
def all_objects(self): if self._all_objs is None: objs = OrderedDict() for o in self._objects: if not o.enabled: continue for k,v in o.all_objects().items(): if k in objs: raise NameError('Mul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_obs_dict(self):\n arm_state = self.robot.get_state('arm')\n gripper_state = self.robot.get_state('gripper')\n # obj_state = self.robot.get_state('object')\n obs_dict = collections.OrderedDict((\n ('t', self.robot.time),\n ('qp', np.concatenate([gripper_stat...
[ "0.6220388", "0.614904", "0.6138726", "0.5957999", "0.58871627", "0.5881679", "0.5880597", "0.58215386", "0.5781062", "0.5751646", "0.57378966", "0.57372427", "0.563681", "0.563681", "0.56242007", "0.5596013", "0.55933994", "0.5520634", "0.54944223", "0.5470333", "0.5457086",...
0.5380367
28
Run the simulation until a number of samples have been acquired. Extra keyword arguments are passed to `scipy.integrate.odeint()`.
def run(self, samples=1000, **kwds): opts = self.odeint_args.copy() opts.update(kwds) # reset all_objs cache in case some part of the sim has changed self._all_objs = None all_objs = self.all_objects().values() # check that there is something to simulate...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _handler_sample(self, *args, **kwargs):\n next_state = None\n timeout = time.time() + SAMPLE_TIMEOUT\n\n for i in self._units:\n self._do_command(Command.READ, i)\n\n particles = self.wait_for_particles([DataParticleType.D1000_PARSED], timeout)\n\n return next_stat...
[ "0.5956003", "0.5825392", "0.5583392", "0.5566894", "0.551333", "0.5512972", "0.5506972", "0.54876196", "0.5475039", "0.5444503", "0.541932", "0.5412775", "0.5398358", "0.53285867", "0.53178716", "0.53102845", "0.5306154", "0.5300801", "0.5299684", "0.52944416", "0.5291731", ...
0.5799795
2
Return the last values of all state variables in a SimState object.
def last_state(self): return self._simstate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_final_state(self):\n state = {}\n s = self.copy()\n clip = not np.isscalar(self['t'])\n if clip:\n # only get results for the last timepoint\n s.set_state(self.state[:, -1])\n \n for k in self.difeq_vars:\n state[k] = s[k]\n ...
[ "0.70501053", "0.68264186", "0.6813396", "0.67094797", "0.66886044", "0.6674428", "0.6615974", "0.6521614", "0.6480747", "0.64383215", "0.6368001", "0.6361215", "0.63596594", "0.63395506", "0.6314231", "0.6235604", "0.6213478", "0.6176815", "0.61695874", "0.6163223", "0.61559...
0.7101281
0
Return a dictionary of all diff. eq. state variables and dependent variables for all objects in the simulation.
def get_final_state(self): state = {} s = self.copy() clip = not np.isscalar(self['t']) if clip: # only get results for the last timepoint s.set_state(self.state[:, -1]) for k in self.difeq_vars: state[k] = s[k] for k in self.d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state_dict(self):\n return {k: getattr(self, k) for k in self.VARS}", "def _map_state_vars_and_eqs(self):\n\n def get_used_eqs_and_state_vars(eq_to_expand, equations):\n \"\"\" Returns used equations and state vars for a given equation\n\n :param eq_to_expand: list contain...
[ "0.64888316", "0.64769936", "0.63034874", "0.6238616", "0.6224518", "0.62226665", "0.6172798", "0.6081283", "0.6061411", "0.60162264", "0.59225005", "0.59200466", "0.58960044", "0.58875316", "0.58743876", "0.58677685", "0.5862905", "0.5849392", "0.5827908", "0.58276117", "0.5...
0.6228365
4
SimObjects are organized in a hierarchy. This method returns an ordered dictionary of all enabled SimObjects in this branch of the hierarchy, beginning with self.
def all_objects(self): objs = OrderedDict() objs[self.name] = self for o in self._sub_objs: if not o.enabled: continue objs.update(o.all_objects()) return objs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_all_objects(self):\n level_objects = Group()\n mobs_objects = Group()\n for sprite_group in self.sprite_level_blocks:\n for object_ in sprite_group:\n if str(object_) == 'Mob':\n mobs_objects.add(object_)\n elif str(object_) ...
[ "0.61496246", "0.61296856", "0.608513", "0.5893054", "0.5893054", "0.58513844", "0.58347917", "0.576784", "0.5687896", "0.5657026", "0.56417245", "0.55909324", "0.5588757", "0.55806464", "0.55752224", "0.5573823", "0.5544128", "0.5508163", "0.54780394", "0.54708326", "0.54590...
0.6703417
0
An ordered dictionary of all variables required to solve the diff. eq. for this object.
def difeq_state(self): return self._current_state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def variables(self) -> OrderedDict:\n return OrderedDict({'mu': self.mu, 'sig': self.sig})", "def variables(self) -> OrderedDict:\n return OrderedDict({'m': self.m, 'c': self.c})", "def variables(self) -> OrderedDict:\n return OrderedDict({'a': self.a, 'b': self.b, 'c': self.c})", "def v...
[ "0.7248682", "0.71558905", "0.6962569", "0.6884791", "0.6548065", "0.6319755", "0.629784", "0.6287567", "0.62830275", "0.6226725", "0.6188233", "0.6133646", "0.61116743", "0.6098625", "0.6093391", "0.60918874", "0.6050224", "0.6036763", "0.6020341", "0.6014623", "0.60084933",...
0.0
-1
Update diffeq state variables with their last simulated values. These will be used to initialize the solver when the next simulation begins.
def update_state(self, result): for i,k in enumerate(self._current_state.keys()): self._current_state[k] = result[i]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_feq(self):\n\n sim = self.sim\n\n self.sim.kernels.update_feq_fluid(\n sim.queue, sim.two_d_global_size, sim.two_d_local_size,\n sim.feq.data,\n sim.rho.data,\n sim.u_bary.data, sim.v_bary.data,\n sim.w, sim.cx, sim.cy, sim.cs,\n ...
[ "0.63552344", "0.6078575", "0.6056346", "0.5823179", "0.5814604", "0.5757745", "0.5711599", "0.5698494", "0.5692954", "0.5635986", "0.5575828", "0.5563461", "0.5553724", "0.5535413", "0.55197155", "0.55178094", "0.5513537", "0.55110824", "0.54964936", "0.54838675", "0.5473986...
0.0
-1
Return derivatives of all state variables. Must be reimplemented in subclasses. This is used by the ODE solver to integrate during the simulation; should be as fast as possible.
def derivatives(self, state): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _derivatives(self, state, forces_moments):\n # extract the states\n pn = state.item(0)\n pe = state.item(1)\n pd = state.item(2)\n u = state.item(3)\n v = state.item(4)\n w = state.item(5)\n e0 = state.item(6)\n e1 = state.item(7)\n e2 = sta...
[ "0.7683193", "0.7318128", "0.7000159", "0.68565035", "0.67524266", "0.67374635", "0.6591703", "0.6397337", "0.6300758", "0.6288592", "0.6209557", "0.6207909", "0.618478", "0.61518556", "0.61518556", "0.6109665", "0.6108", "0.60804623", "0.6070026", "0.6070026", "0.5987634", ...
0.78107053
0
The Sim instance in which this object is being used.
def sim(self): return self._sim
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sim(self) -> Sim:\n\n return self._sim", "def get_simulator(self) -> Game:\n return self.__sim", "def sim(self):\n return self.mujoco_simulation.sim", "def sim_info(self) -> SimInfo:\n return self._sim_info", "def getSimulation(self):\r\n raise NotImplementedError()",...
[ "0.8274302", "0.76091176", "0.74165684", "0.7305126", "0.6934737", "0.6901099", "0.6809698", "0.6788061", "0.6562603", "0.65560406", "0.65333664", "0.64729905", "0.64492494", "0.64492494", "0.63692015", "0.63296455", "0.6318461", "0.63045615", "0.62786096", "0.62221605", "0.6...
0.79484886
1
do action and return state.
def newstate(env, trigger, state, action): if trigger(env): if state: return True else: result = action(env) print "%s\t%r -> [%r] => %r" % (nowf(), trigger, action, result) return bool(result) else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def take_action(self, state):", "def result(self, state, action):\n print \"Ashish\"\n return 1", "def result(self, state, action):\n\t\traise NotImplementedError", "def act(self, state):\n return", "def __call__(self, state, action):\n pass", "def result(self, state, acti...
[ "0.7944721", "0.76809496", "0.750748", "0.74055165", "0.73374164", "0.7325363", "0.70580524", "0.7040232", "0.7018546", "0.6981787", "0.69742656", "0.6899508", "0.68732816", "0.67997473", "0.67997473", "0.6712618", "0.6712618", "0.6696641", "0.66902274", "0.6675269", "0.66181...
0.0
-1
Put trigger and action
def push(self, trigger, action): self.queue.append((trigger, action))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trigger(self, type, event):", "def fire_trigger(self, trigger):\n if not self.exists():\n return\n if trigger in self.events:\n for action in self.events[trigger]:\n action(requestor=self)", "def __call__(self, trigger, type, event):", "def changeTrigger...
[ "0.7347315", "0.6795273", "0.67381936", "0.6464891", "0.64134777", "0.6370419", "0.6218917", "0.61916995", "0.6181925", "0.6171602", "0.6161308", "0.6034554", "0.60305524", "0.59762686", "0.59295934", "0.59295934", "0.59295934", "0.59295934", "0.59207004", "0.59207004", "0.59...
0.6640422
3
Given a pair of dates, creates iterator that returns (aMonday,theNextMonday) such that the first returned pair defines an interval holding minDate the last returned pair defines an interval holding maxDate if minDate or maxDate are not instances of datetime.date, raises TypeError if maxDate > minDate, raises ValueError
def mondayPairsIteratorFactory(minDate, maxDate): if not (isinstance(minDate,dt.date) and isinstance(maxDate,dt.date)): raise TypeError("minDate and maxDate must be instances of datetime.date") if maxDate < minDate: raise ValueError("minDate must be <= maxDate") def anIterator(): oneWeek = dt.timedelt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def daterange(date1, date2):\n for n in range(int ((date2 - date1).days)+1):\n yield date1 + timedelta(n)", "def iter_dates(start, end):\n one_day = timedelta(days=1)\n date = start\n while date <= end:\n yield date\n date += one_day", "def _drange(start: Da...
[ "0.6606035", "0.6605835", "0.64703006", "0.63616943", "0.62733585", "0.6229436", "0.62277454", "0.6221993", "0.61602044", "0.6106471", "0.60732347", "0.6054331", "0.603127", "0.5957231", "0.58339053", "0.5806204", "0.57963264", "0.57677", "0.5739298", "0.56889385", "0.5613047...
0.8523642
0
A helper function to get the correct order to create tables during setup. whichTables is a list of Tables, possibly empty, or None If not whichTables, then all the known tables are visited
def getOrderedSetupList(whichTables = None): # if whichTables is None, then databaseDependenciesForSetup.keys() is used return socorro_pri.dependencyOrder(databaseDependenciesForSetup,whichTables)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getOrderedPartitionList(whichTables):\n if not whichTables:\n return []\n order = socorro_pri.dependencyOrder(databaseDependenciesForPartition,whichTables)\n return order", "def create_all_tables(self):\n pass", "def create_tables( self ) :\n return self._create_tables", "def init_tab...
[ "0.6438581", "0.6068337", "0.5827515", "0.5818468", "0.57141715", "0.5701556", "0.5697819", "0.5639476", "0.5597376", "0.5596786", "0.5568101", "0.5547983", "0.55355597", "0.55066556", "0.54814607", "0.54805577", "0.54765683", "0.5469697", "0.53908694", "0.5388238", "0.537485...
0.7382621
0
A helper function to get the needed PartionedTables for a given set of PartitionedTables
def getOrderedPartitionList(whichTables): if not whichTables: return [] order = socorro_pri.dependencyOrder(databaseDependenciesForPartition,whichTables) return order
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_partitions(self, table_name):\n partition_result = self.query(\n sql.fetch_partition,\n (\n self._current_db,\n table_name,\n ),\n )\n # If a table doesn't have partition schema the \"PARTITION_NAME\"\n # will be s...
[ "0.6315098", "0.6028243", "0.58734983", "0.58222467", "0.5769109", "0.57545966", "0.56962395", "0.56682754", "0.5640412", "0.5635037", "0.5578057", "0.55250573", "0.5516319", "0.5486221", "0.548598", "0.5465969", "0.53857803", "0.5384892", "0.5357559", "0.5334161", "0.5330704...
0.65810615
0
Helper function to examine partitionCreationHistory
def partitionWasCreated(partitionTableName): return partitionTableName in partitionCreationHistory
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def markPartitionCreated(partitionTableName):\n global partitionCreationHistory\n partitionCreationHistory.add(partitionTableName)", "def _get_partition_list(self):\n raise NotImplementedError('Must be implemented in subclasses.')", "def partition_book(self):\n ...", "def _createOwnPartition(...
[ "0.65855694", "0.59157133", "0.5605107", "0.5602883", "0.5564097", "0.55443454", "0.5337288", "0.53309625", "0.5256756", "0.511385", "0.50445294", "0.5031911", "0.5025408", "0.5014135", "0.5008548", "0.5005736", "0.5003711", "0.4998482", "0.49464095", "0.4941047", "0.49375242...
0.73551816
0
Helper function to update partitionCreationHistory
def markPartitionCreated(partitionTableName): global partitionCreationHistory partitionCreationHistory.add(partitionTableName)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def partitionWasCreated(partitionTableName):\n return partitionTableName in partitionCreationHistory", "def on_partition_change(self, new_partitions):\n if new_partitions is None:\n self.conn.create(self.partition_path, value=self.partitions)\n return\n\n if new_partitions !=...
[ "0.6277444", "0.5867328", "0.5753557", "0.57449204", "0.5468491", "0.54188854", "0.5398478", "0.5376595", "0.5308092", "0.52885246", "0.52048874", "0.5138754", "0.5134442", "0.51240784", "0.5119822", "0.49873483", "0.49679628", "0.49415168", "0.4938052", "0.49107817", "0.4885...
0.7366289
0
Internal method that assumes all precursor partitions are already in place before creating this one. Called from createPartitions(same parameters) to avoid bottomless recursion. Creates one or more partitions for this particular table, (more if uniqueItems has more than one element)
def _createOwnPartition(self, databaseCursor, uniqueItems): self.logger.debug("%s - in createOwnPartition for %s",threading.currentThread().getName(),self.name) for x in uniqueItems: #self.logger.debug("DEBUG - item value is %s",x) partitionCreationParameters = self.partitionCreationParameters(x) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createPartitions(self, databaseCursor, iterator):\n self.logger.debug(\"%s - in createPartitions\", threading.currentThread().getName())\n partitionTableClasses = getOrderedPartitionList([self.__class__])\n #self.logger.debug(\"DEBUG - Classes are %s\",partitionTableClasses)\n uniqueItems = [x for ...
[ "0.64606357", "0.5514394", "0.5317253", "0.5310833", "0.5189379", "0.51807606", "0.5172232", "0.51274365", "0.50877345", "0.5060848", "0.49768895", "0.49730808", "0.49422514", "0.49221748", "0.49219945", "0.49001914", "0.48978415", "0.48882595", "0.48838842", "0.48623025", "0...
0.7701096
0
Create this table's partition(s) and all the precursor partition(s) needed to support this one
def createPartitions(self, databaseCursor, iterator): self.logger.debug("%s - in createPartitions", threading.currentThread().getName()) partitionTableClasses = getOrderedPartitionList([self.__class__]) #self.logger.debug("DEBUG - Classes are %s",partitionTableClasses) uniqueItems = [x for x in iterator...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _createOwnPartition(self, databaseCursor, uniqueItems):\n self.logger.debug(\"%s - in createOwnPartition for %s\",threading.currentThread().getName(),self.name)\n for x in uniqueItems:\n #self.logger.debug(\"DEBUG - item value is %s\",x)\n partitionCreationParameters = self.partitionCreationPar...
[ "0.72625685", "0.6556742", "0.64865416", "0.64796466", "0.6260575", "0.6234208", "0.6183316", "0.6067094", "0.6047013", "0.60348827", "0.59451205", "0.592884", "0.5903982", "0.58994883", "0.58899176", "0.58500534", "0.57829833", "0.57518965", "0.5745148", "0.5699041", "0.5686...
0.72230065
1
Create a set of partitions for all the tables known to be efficient when they are created prior to being needed. see the list databaseObjectClassListForWeeklyParitions above
def createPartitions(config, logger): databaseConnection, databaseCursor = connectToDatabase(config, logger) try: for aDatabaseObjectClass in databaseObjectClassListForWeeklyPartitions: weekIterator = mondayPairsIteratorFactory(config.startDate, config.endDate) aDatabaseObject = aDatabaseObjectClass...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createPartitions(self, databaseCursor, iterator):\n self.logger.debug(\"%s - in createPartitions\", threading.currentThread().getName())\n partitionTableClasses = getOrderedPartitionList([self.__class__])\n #self.logger.debug(\"DEBUG - Classes are %s\",partitionTableClasses)\n uniqueItems = [x for ...
[ "0.78974897", "0.6525179", "0.6408025", "0.6380735", "0.62772876", "0.6232555", "0.6150809", "0.60966617", "0.60484344", "0.59169513", "0.59100777", "0.5902835", "0.5898807", "0.5858238", "0.58435506", "0.58283883", "0.57975763", "0.5755997", "0.5744674", "0.57172894", "0.571...
0.7650467
1
Read a commaseparated values (.csv) file into DataFrame.
def makeDF(csv_path): import pandas as pd DF = pd.read_csv(csv_path) # DF['height'] = DF.apply(lambda DF: abs(DF['ymax'] - DF['ymin']), axis=1) # DF['width'] = DF.apply(lambda DF: abs(DF['xmax'] - DF['xmin']), axis=1) # DF['objArea'] = DF.apply(lambda DF: (DF['width'] * DF['height']), axis=1) H...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_csv(csv_file: str) -> pd.DataFrame:\n return pd.read_csv(csv_file, header=0)", "def data_from_csv(self, filepath):\n self.dataframe = pd.load_csv(filepath, separator='')", "def read_in_values(path: str) -> DataFrame:\n sep = _check_suffix(path)\n return pd.read_csv(_is_valid_file...
[ "0.7560159", "0.72104675", "0.7131028", "0.70655996", "0.7017841", "0.69729435", "0.6923881", "0.6913294", "0.68825763", "0.6852916", "0.6849474", "0.67877716", "0.67647284", "0.67601335", "0.67601335", "0.67601335", "0.67507124", "0.674601", "0.67313546", "0.6713945", "0.667...
0.0
-1
generated from code7.py. However, is not compatible with the 25, in convert_to_coco_json coco_dict = convert_to_coco_dict(dataset_name) File "/Users/mac7/opt/anaconda3/envs/myenvpy/lib/python3.7/sitepackages/detectron20.1.1py3.7macosx10.9x86_64.egg/detectron2/data/datasets/coco.py", line 314, in convert_to_coco_dict
def data_dict0(): # 0- Sample from detectron2 -> 5 different sections. info_val0 = [{"date_created": "2020-03-15 04:59:45.442988", "description": "Automatically generated COCO json file for Detectron2."}] images0 = [{"id": "image", "width": 100, "height": 100, "file_name":...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_coco_dataset():\n ds = AttrDict()\n # classes = [\n # '__background__', 'person', 'bicycle', 'car', 'motorcycle', 'airplane',\n # 'bus', 'train', 'truck', 'boat', 'traffic light', 'fire hydrant',\n # 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse',\n # ...
[ "0.7177033", "0.6570015", "0.6285049", "0.6221178", "0.611349", "0.6035911", "0.57440627", "0.5730883", "0.55947363", "0.5550295", "0.55144775", "0.55096453", "0.5449006", "0.54164267", "0.54066616", "0.5378364", "0.5358252", "0.53523004", "0.5315025", "0.53006166", "0.527519...
0.56904554
8
Register a new strategy for generating data for specific string "format".
def register_string_format(name: str, strategy: st.SearchStrategy) -> None: if not isinstance(name, str): raise TypeError(f"name must be of type {str}, not {type(name)}") if not isinstance(strategy, st.SearchStrategy): raise TypeError(f"strategy must be of type {st.SearchStrategy}, not {type(str...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_data_format(format_name,parser):\n\n data_format_parser[format_name] = parser", "def register_str_format(\n tag: Tag, conformer: Optional[Conformer] = None\n) -> Callable[[ValidatorFn], ValidatorFn]:\n\n def create_str_format(f: ValidatorFn) -> ValidatorFn:\n with _STR_FORMAT_LOCK:\n...
[ "0.67097753", "0.56974983", "0.55908847", "0.55496186", "0.5468228", "0.5330458", "0.52871567", "0.5243602", "0.52405083", "0.51500815", "0.51046956", "0.51046956", "0.5070095", "0.4967492", "0.4967349", "0.49556667", "0.49543664", "0.49472272", "0.49290946", "0.49174467", "0...
0.7103577
0
Register all default "format" strategies.
def init_default_strategies() -> None: register_string_format("binary", st.binary()) register_string_format("byte", st.binary().map(lambda x: b64encode(x).decode())) def make_basic_auth_str(item: Tuple[str, str]) -> str: return _basic_auth_str(*item) latin1_text = st.text(alphabet=st.character...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_formats(cls):\n if cls._format_to_serializer is None:\n cls._register_subclasses()\n formats = ['auto']\n formats.extend(cls._format_to_serializer)\n return formats", "def register_format(recipe):\n afr = AFMFormatRecipe(recipe)\n formats_available.append(afr)...
[ "0.67433965", "0.62260413", "0.6008091", "0.5960222", "0.5885646", "0.58462405", "0.57293695", "0.5707574", "0.5638043", "0.5609508", "0.5559438", "0.5524077", "0.5505028", "0.5505028", "0.54933727", "0.547053", "0.54281515", "0.53969175", "0.53580284", "0.5356706", "0.534757...
0.57387257
6
Verify if the generated headers are valid.
def is_valid_header(headers: Dict[str, Any]) -> bool: for name, value in headers.items(): if not utils.is_latin_1_encodable(value): return False if utils.has_invalid_characters(name, value): return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_build_headers(self):\n\n headers = self_signed.build_headers()\n assert 'Content-Length' in headers\n assert 'X-Amz-Date' in headers\n assert 'Host' in headers\n assert 'X-Amz-Security-Token' in headers\n assert 'Content-Type' in headers\n assert 'Authoriza...
[ "0.73248684", "0.71754396", "0.71661705", "0.69765127", "0.6962748", "0.6939488", "0.6889487", "0.68174773", "0.68034554", "0.6791674", "0.6682548", "0.6604471", "0.6590226", "0.6554132", "0.6513857", "0.6459408", "0.6422941", "0.640519", "0.640519", "0.63898265", "0.6378792"...
0.6863574
7
Surrogates are not allowed in a query string. `requests` and `werkzeug` will fail to send it to the application.
def is_valid_query(query: Dict[str, Any]) -> bool: for name, value in query.items(): if is_illegal_surrogate(name) or is_illegal_surrogate(value): return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query_params_sanitize(query_params):\n def allow_func(n, v):\n # This gets rid of any params beginning with \"oauth_\"\n if not n.startswith(\"oauth_\"):\n return True\n else:\n logging.warning(\"Protocol parameter ignored from URL query parameters: `%r`\", n)\n ...
[ "0.65669465", "0.65147066", "0.6183156", "0.6004749", "0.5999434", "0.5922218", "0.59101033", "0.5864199", "0.5864199", "0.57987845", "0.57948476", "0.5750507", "0.57338244", "0.5732014", "0.5732014", "0.57237566", "0.5696393", "0.5689057", "0.56888187", "0.5682486", "0.56790...
0.0
-1
A strategy that creates `Case` instances. Explicit `path_parameters`, `headers`, `cookies`, `query`, `body` arguments will be used in the resulting `Case` object.
def get_case_strategy( # pylint: disable=too-many-locals draw: Callable, endpoint: Endpoint, hooks: Optional[HookDispatcher] = None, feedback: Optional[Feedback] = None, data_generation_method: DataGenerationMethod = DataGenerationMethod.default(), path_parameters: Any = NOT_SET, headers: A...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_case(self, casenum, case):\n # Anonymous or authenticated session?\n is_mod_request = case['method'].upper() in self.modification_methods\n needs_user = case.get('user', is_mod_request)\n if needs_user:\n session = self.user_session\n else:\n ses...
[ "0.575196", "0.57027084", "0.5673386", "0.5494484", "0.54804766", "0.5334432", "0.5334432", "0.52071553", "0.51731235", "0.51614434", "0.51614434", "0.50898486", "0.50793946", "0.5054101", "0.5024315", "0.5018465", "0.50131065", "0.50022775", "0.49648806", "0.49112797", "0.48...
0.5888172
0
Create a new strategy for the case's component from the endpoint parameters.
def get_parameters_strategy( endpoint: Endpoint, to_strategy: Callable[[Dict[str, Any]], st.SearchStrategy], location: str ) -> st.SearchStrategy: parameters = getattr(endpoint, LOCATION_TO_CONTAINER[location]) if parameters: schema = parameters_to_json_schema(parameters) strategy = to_strat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_case_strategy( # pylint: disable=too-many-locals\n draw: Callable,\n endpoint: Endpoint,\n hooks: Optional[HookDispatcher] = None,\n feedback: Optional[Feedback] = None,\n data_generation_method: DataGenerationMethod = DataGenerationMethod.default(),\n path_parameters: Any = NOT_SET,\n ...
[ "0.6418826", "0.5800213", "0.5728096", "0.5714733", "0.5632045", "0.5582534", "0.55530953", "0.5522158", "0.5477194", "0.53526986", "0.5237057", "0.5194271", "0.5176202", "0.512805", "0.5121639", "0.5117651", "0.51095563", "0.510309", "0.50945157", "0.5078439", "0.5024108", ...
0.6061061
1
Single "." chars and empty strings "" are excluded from path by urllib3. A path containing to "/" or "%2F" will lead to ambiguous path resolution in many frameworks and libraries, such behaviour have been observed in both WSGI and ASGI applications. In this case one variable in the path template will be empty, which wi...
def is_valid_path(parameters: Dict[str, Any]) -> bool: path_parameter_blacklist = (".", SLASH, "") return not any( (value in path_parameter_blacklist or is_illegal_surrogate(value) or isinstance(value, str) and SLASH in value) for value in parameters.values() )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_path(path):\r\n while path[len(path) - 1] == '/' or path[len(path) - 1] == '\\\\':\r\n path = path[0:-1]\r\n\r\n return path", "def _get_full_path(self, path, environ):\n if path.startswith('//'):\n path = path[1:]\n elif path.startswith('/'):\n path =...
[ "0.6272722", "0.6118131", "0.59735245", "0.5902947", "0.5849248", "0.58329684", "0.57983935", "0.57708544", "0.57563895", "0.5733279", "0.5692304", "0.5686826", "0.5673544", "0.5606747", "0.55980134", "0.559067", "0.55775833", "0.5570223", "0.55601454", "0.55497587", "0.55495...
0.0
-1
Apply URL quotation for all values in a dictionary.
def quote_all(parameters: Dict[str, Any]) -> Dict[str, Any]: return {key: quote_plus(value) if isinstance(value, str) else value for key, value in parameters.items()}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def urllib_quote_parameters(inputdictionary):\r\n if type(inputdictionary) is not dict:\r\n raise TypeError(\"urllib_quote_parameters' inputstringdictionary parameter must be a dict, not '\"+str(type(inputstring))+\"'\")\r\n\r\n quoted_keyvals = []\r\n for key, val in inputdictionary.items():\r\n quoted_k...
[ "0.62306243", "0.5637293", "0.5618359", "0.55986035", "0.555752", "0.55488056", "0.5539878", "0.5492487", "0.548568", "0.54376", "0.5426715", "0.5394386", "0.53836554", "0.53630733", "0.5343481", "0.5332934", "0.5330379", "0.53290695", "0.5296179", "0.5293168", "0.5288468", ...
0.5998401
1
Apply all `before_generate_` hooks related to the given location.
def apply_hooks( endpoint: Endpoint, context: HookContext, hooks: Optional[HookDispatcher], strategy: st.SearchStrategy[Case], location: str, ) -> st.SearchStrategy[Case]: strategy = _apply_hooks(context, GLOBAL_HOOK_DISPATCHER, strategy, location) strategy = _apply_hooks(context, endpoint.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _apply_hooks(\n context: HookContext, hooks: HookDispatcher, strategy: st.SearchStrategy[Case], location: str\n) -> st.SearchStrategy[Case]:\n container = LOCATION_TO_CONTAINER[location]\n for hook in hooks.get_all_by_name(f\"before_generate_{container}\"):\n strategy = hook(context, strategy)\...
[ "0.66052645", "0.54367757", "0.5335337", "0.5200875", "0.514125", "0.5092376", "0.50201553", "0.49951658", "0.49630007", "0.49584186", "0.4955014", "0.49404222", "0.491867", "0.4910777", "0.48239407", "0.4786473", "0.4785765", "0.47504947", "0.47237763", "0.47235417", "0.4710...
0.42714888
87
Apply all `before_generate_` hooks related to the given location & dispatcher.
def _apply_hooks( context: HookContext, hooks: HookDispatcher, strategy: st.SearchStrategy[Case], location: str ) -> st.SearchStrategy[Case]: container = LOCATION_TO_CONTAINER[location] for hook in hooks.get_all_by_name(f"before_generate_{container}"): strategy = hook(context, strategy) return s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_hooks(self):\n pass", "def process_before_request_hooks(self):\n\n hooks = []\n\n if self.resource:\n hooks.extend(self.resource.api.before_all_hooks)\n hooks.extend(self.resource.before_all_hooks)\n\n hooks.extend(self.before_all_hooks)\n hooks....
[ "0.56037354", "0.5500859", "0.5223152", "0.52164966", "0.5215929", "0.5108552", "0.5066924", "0.5015762", "0.49975643", "0.4935562", "0.49342433", "0.49167737", "0.48724824", "0.48304024", "0.48257065", "0.48113218", "0.48091397", "0.4805462", "0.47963923", "0.47690478", "0.4...
0.6157746
0
Enables enriching test items with more properties to be used for grouping or other purposes. The goal is for whoever needs to be able to add item.test_group field
def pytest_before_group_items(session, config, items):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_test_inline_additional_properties(self):\n pass", "def pytest_after_group_items(session, config, items):", "def pytest_collection_modifyitems(config, items):\n # check if studio tests myst be skipped\n run_study = config.getoption(\"--runstudy\")\n # 'all' will match all studies, '' wi...
[ "0.5947742", "0.5900158", "0.5774352", "0.573061", "0.5615433", "0.55916494", "0.5568033", "0.5543221", "0.55160785", "0.55160785", "0.55108106", "0.54705465", "0.5394397", "0.5350562", "0.5348308", "0.5344149", "0.52992165", "0.5255538", "0.52473474", "0.5215013", "0.5209653...
0.668921
0
receives 2 items and decides if they can run together. returns bool
def pytest_can_run_together(item1, item2):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def got_both(self):\r\n if Item.A in self.items and Item.B in self.items:\r\n return True", "def valid_multiple_in_request(self):\n return self._repeatable[0] is True", "def adaptable( item1, item2 ) :\n\n if( item2 is None ) : return( True )\n return re.fullmatch(item2, ...
[ "0.73054934", "0.6250203", "0.62348914", "0.61885935", "0.60863423", "0.6018422", "0.6008905", "0.5933993", "0.591542", "0.5821401", "0.58169997", "0.5744042", "0.57171375", "0.57098925", "0.5701733", "0.570071", "0.5699882", "0.5689656", "0.5678437", "0.5675575", "0.56661355...
0.6191703
3
Allows doing manipulations or enriching with other data on test items (after grouping) Items have a test_group field.
def pytest_after_group_items(session, config, items):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pytest_before_group_items(session, config, items):", "def test_add_group(self):\n pass", "def test_grouping(self):\n s = self.create(ComponentItem, UML.Component)\n uc1 = self.create(UseCaseItem, UML.UseCase)\n uc2 = self.create(UseCaseItem, UML.UseCase)\n\n self.group(s,...
[ "0.684022", "0.66695523", "0.6552354", "0.6369141", "0.63321984", "0.63281184", "0.62650174", "0.6235142", "0.61431545", "0.61334264", "0.61311626", "0.61311626", "0.6118693", "0.60952663", "0.60952663", "0.6080429", "0.6080429", "0.6024302", "0.60169107", "0.5959551", "0.591...
0.660266
2
This is the place to provision if grouper is invoked
def pytest_started_handling_group(session, worker):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __on_group_created(self, logger, *args):", "def test_create_group(self):\n pass", "def test_create_group(self):\n pass", "def pre_security_group_create(self, resource_dict):\n pass", "def test_create_device_group(self):\n pass", "def _make_group(self, _rk, _group_hint):\n\...
[ "0.6569253", "0.62589484", "0.62589484", "0.6143284", "0.6102148", "0.6084975", "0.5941392", "0.59400153", "0.58592314", "0.585574", "0.58110565", "0.5778987", "0.5748649", "0.5700932", "0.5689231", "0.56728923", "0.5657217", "0.5652605", "0.560312", "0.5590086", "0.5553873",...
0.5379457
37
This is the place to release if grouper is invoked (ie if hardware still exists on this hook call)
def pytest_finished_handling_group(session, worker):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __exit__(self, *_):\r\n\t\tself.ueye.is_FreeImageMem(self.hCam, self.pcImageMemory, self.MemID)\r\n\r\n\t\t# Disables the hCam camera handle and releases the data structures and memory areas taken up by the uEye camera\r\n\t\tself.ueye.is_ExitCamera(self.hCam)", "def __del__(self):\n self.p.sleep()\n ...
[ "0.64408547", "0.63653266", "0.6343562", "0.6335266", "0.63285846", "0.62338746", "0.61478007", "0.6144899", "0.6130134", "0.61175394", "0.6112023", "0.6108773", "0.61039203", "0.60399", "0.60207015", "0.5983089", "0.5948264", "0.59431905", "0.5941086", "0.5926044", "0.592394...
0.0
-1
Define the toolbox (the name of the toolbox is the name of the .pyt file).
def __init__(self): self.label = "PFRR Tools" self.alias = "PFRR Tools" # List of tool classes associated with this toolbox self.tools = [Ending_Point, Range_Distance, PFRR]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_toolbox(self, engine_name, task_name, toolbox_name):\n pass", "def __init__(self):\n self.label = \"Python ToolBox\"\n self.alias = \"\"\n\n # List of tool classes associated with this toolbox\n self.tools = [Tool]", "def __init__(self):\n self.label = \"Crea...
[ "0.8001657", "0.76821536", "0.7338371", "0.7278725", "0.7259962", "0.7148503", "0.7061571", "0.67234725", "0.66628635", "0.6649481", "0.6587418", "0.6583463", "0.65043044", "0.64949065", "0.6422432", "0.6311597", "0.62550175", "0.62525314", "0.62455046", "0.6217126", "0.61207...
0.64769334
14
Define the tool (tool name is the name of the class).
def __init__(self): self.label = "Ending Point" self.description = "This tool calculates the final point given" + \ "the initial point, range and bearing." self.canRunInBackground = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, toolName):\n\t\tself.toolName = toolName", "def __init__(self):\n self.label = \"Create\"\n self.alias = \"\"\n\n # List of tool classes associated with this toolbox\n if core.get_pass():\n self.tools = [Fbound, Roads, Diekdikisi]\n else:\n ...
[ "0.78886044", "0.74191546", "0.73680484", "0.7317306", "0.72275203", "0.7022156", "0.6999495", "0.6988887", "0.6932704", "0.6919116", "0.6890748", "0.68180656", "0.6817103", "0.67857397", "0.6773338", "0.6738541", "0.6737494", "0.673033", "0.6693258", "0.6666185", "0.6644223"...
0.0
-1
Set whether tool is licensed to execute.
def isLicensed(self): return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isLicensed(self):\r\n try:\r\n if arcpy.CheckExtension(\"Spatial\") != \"Available\":\r\n raise Exception\r\n except Exception:\r\n return False # tool cannot be executed\r\n return True ...
[ "0.67727894", "0.67727894", "0.65478224", "0.65478224", "0.65478224", "0.65478224", "0.65478224", "0.65478224", "0.65478224", "0.65478224", "0.64847887", "0.64847887", "0.64847887", "0.64847887", "0.64847887", "0.64847887", "0.64847887", "0.64847887", "0.64847887", "0.63919765"...
0.63335377
57
Modify the values and properties of parameters before internal validation is performed. This method is called whenever a parameter has been changed.
def updateParameters(self, parameters): return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateParameters(self, parameters):\n # if parameters[0].altered:\n # parameters[1].value = arcpy.ValidateFieldName(parameters[1].value,\n # parameters[0].value)\n return", "def parameters_changed(self):\n pass", "def ...
[ "0.7688436", "0.75183314", "0.70699507", "0.7068056", "0.70668334", "0.6885432", "0.6881135", "0.6881135", "0.6881135", "0.6881135", "0.6881135", "0.6881135", "0.6881135", "0.6881135", "0.684654", "0.6841016", "0.68276924", "0.68104416", "0.6776473", "0.67577714", "0.67530274...
0.6615761
25