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
Class in dunar function.
def __contains__(self, arg): return arg in self.grfx[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __class__(self, ???):", "def lassh():", "def identify_class(self, cls):", "def type(cls):", "def w_class_a(self):\n return self._w_class_a", "def _class(self, class_):\r\n\r\n if class_:\r\n if hasattr(class_, '__mro__'):\r\n #this is a class\r\n ret...
[ "0.691717", "0.67608553", "0.674212", "0.6741443", "0.6691715", "0.65649325", "0.63822573", "0.6380451", "0.6362232", "0.6205461", "0.6199443", "0.6193164", "0.6174721", "0.6168058", "0.608061", "0.6079936", "0.60363096", "0.60309327", "0.60018873", "0.60018873", "0.599235", ...
0.0
-1
Initialises the node graphics on the canvas
def initBlock(self): self.std.Print('Setting up GrfNodeCore', fg, bg, style, src) tag = self.label + '-circle' obj = [] obj.append(gfxcircle.GfxCircle(sheetCanvas=self.sheetCanvas, tag=tag, center=self.center, size=self.__size, mode=self.mode, std=self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def define_nodes(self):\n\n self.canvas_nodes[0] = Ellipse(\n size=self.nodesize,\n pos=[100, 100]\n )\n\n self.canvas_nodes[1] = Ellipse(\n size=self.nodesize,\n pos=[200, 200]\n )", "def draw_nodes(self):\n pass", "def __init__(se...
[ "0.70612305", "0.69753975", "0.68284833", "0.6753001", "0.6705024", "0.66596115", "0.6518166", "0.6509332", "0.6471104", "0.6409078", "0.64070743", "0.639652", "0.63743687", "0.6328654", "0.6328654", "0.6316598", "0.6308856", "0.62833095", "0.6220094", "0.6220094", "0.6220094...
0.69362134
2
Updates the node bounding box
def update_bbox(self): centX, centY = self.center brush_thickness = self.brush[0] margin = self.__size + brush_thickness + BOUNDARY_MARGIN self.bbox = [int(centX - margin), int(centY - margin), int(centX + margin), int(centY + margin)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bbox(self, node):\n node_id = node.get('id')\n #inkex.utils.debug(\"Check if \" + str(node_id) + \" is in \" + str(self.node_info))\n info = self.node_info[node_id] \n \n x = info.x\n y = info.y\n width = info.width\n height = info.height\n\n ...
[ "0.687665", "0.65105706", "0.6498005", "0.6465831", "0.641638", "0.6379551", "0.63483", "0.63036704", "0.6291714", "0.6290422", "0.6238107", "0.6209221", "0.6204145", "0.61941063", "0.6172504", "0.61315244", "0.61048", "0.60585755", "0.6051173", "0.60298294", "0.60298294", ...
0.6619484
1
Updates the node center
def update_center(self): self.grfx[0].center = self.center self.update_bbox()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_node_centers(self):\n # Node positions\n self.node_centers = []\n\n if self.n_states == 2:\n self.figsize = (10, 4)\n self.xlim = (-5, 5)\n self.ylim = (-2, 2)\n self.node_centers = [[-4,0], [4,0]]\n elif self.n_states == 3:\n ...
[ "0.70560575", "0.6983045", "0.6964067", "0.69160515", "0.68689096", "0.6836963", "0.67228144", "0.6679501", "0.65991706", "0.6593941", "0.6592841", "0.65812576", "0.657037", "0.65615946", "0.6547778", "0.6541835", "0.6539385", "0.6529367", "0.652537", "0.65042", "0.64802927",...
0.78363216
0
Updates the connector color set (outline and filling colors for all different modes)
def update_color(self): colorset = self.colorset self.grfx[0].colorset = colorset pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_color(self):\n self.plot(update_traces=False, update_waveforms=True)", "def set_colors(self, ):\n try:\n odd = self._parent.settings.get_key('interface.odd_color')\n even = self._parent.settings.get_key('interface.even_color')\n self.dialog.instruments.se...
[ "0.6235561", "0.62288016", "0.62165153", "0.6197588", "0.61697716", "0.61198795", "0.60795707", "0.6046393", "0.602881", "0.5954413", "0.5944893", "0.5944547", "0.59150326", "0.5883077", "0.58579695", "0.5791961", "0.5767286", "0.56907225", "0.567721", "0.5672064", "0.5667342...
0.6424872
0
Updates the connector brush set (line thickness and style for all different modes)
def update_brush(self): brushset = self.brushset self.grfx[0].brushset = brushset pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_color(self):\r\n \r\n \r\n colorset = self.colorset\r\n \r\n self.grfx[0].colorset = colorset\r\n pass", "def SetConnectionPen(self, pen):\r\n\r\n self._dottedPen = pen\r\n self._dirty = True", "def update_lines(self):\n self._checkfigure()\n for ld in s...
[ "0.55857426", "0.55402994", "0.55136853", "0.5499298", "0.549224", "0.5472288", "0.5430496", "0.54174554", "0.54016674", "0.53672564", "0.52902114", "0.5260264", "0.51613456", "0.5153392", "0.51249695", "0.511491", "0.50836724", "0.50835735", "0.50830746", "0.5077155", "0.506...
0.713593
0
Returns a dict with valid tileset config test data. This config makes use of custom tile types, string values, integer values, and boolean values. Tile values 2, 3, 4, 5, 6, and 7 are basic tiles. Tile value 1 is a custom tile that faces right. Tile value 3 is a custom2 tile. Tile value 5 is positioned at 32, 128 Tile ...
def get_valid_config_data(): # Valid JSON config for testing JSON_config = '''{ "1": { "type": "custom", "faces": "right" }, "3": { "type": "custom2" }, "5": { "x": 32, "y": 128 }, "7": { "is_collidable": false } }''' # Expected values for the parsed tileset config expected_confi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fixture_tile_list():\n return {\n \"version\": 1,\n \"revision\": 1,\n \"timestamp\": \"2018-06-19T23:04:32.442Z\",\n \"timestamp_ms\": 1529449472442,\n \"result_code\": 0,\n \"result\": [\n {\n \"tileType\": \"TILE\",\n \"us...
[ "0.645837", "0.5994021", "0.57005423", "0.56361276", "0.5413695", "0.5405445", "0.5320153", "0.53163576", "0.52881116", "0.52785176", "0.52640116", "0.52409047", "0.5214152", "0.521286", "0.5201781", "0.5196488", "0.5195086", "0.51907146", "0.51883835", "0.5168212", "0.514945...
0.74695957
0
Initialize the TrainingSuite object.
def __init__(self, idx, testfile, trainfile, separator='_', props=''): # one-digit numbers should be prefaced with a leading zero self.idx = str(idx).rjust(2, '0') self.testfile = testfile self.trainfile = trainfile if props == '': self.props_name = 'props_{}.props'.f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_trainer(self):\n self.initialize_matrices()\n self.initialize_model()\n self.initialize_optimizers()\n return self", "def init(self, train):\n return", "def init(self, train):\n return", "def init(self, train):\n return", "def init(self, train...
[ "0.74477714", "0.7142713", "0.7142713", "0.7142713", "0.7142713", "0.7142713", "0.6926644", "0.68751514", "0.6755926", "0.6683353", "0.6660239", "0.66266024", "0.65882075", "0.6546412", "0.6532084", "0.6524574", "0.6500582", "0.648705", "0.64631784", "0.6461751", "0.6429086",...
0.0
-1
Write a props file to disk.
def write_props(self, props_name=None, model=None, train_file=None, tag_separator=None, encoding="UTF-8", verbose="true", verbose_results="true", tokenize="false", arch="generic", learn_closed_class_tags='', closed_class_tag_threshold=5): if props_name == None: pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dump(self, path):\r\n with open(path, 'w') as props:\r\n Properties.dump(self._props, props)", "def write_properties(self, inputfile):\n raise NotImplementedError(\n \"Writing to this file format is not yet implemented\")", "def write_properties(self, prop_filename):\n # Collect li...
[ "0.73421365", "0.7091733", "0.6978677", "0.6746073", "0.6525404", "0.6403566", "0.6388439", "0.6318198", "0.6286016", "0.6284872", "0.6284872", "0.6209266", "0.6127594", "0.60241556", "0.5989744", "0.59761465", "0.5904618", "0.58732486", "0.5853382", "0.5814863", "0.57836175"...
0.65287876
4
Resource does not exist
def __init__(self, context="Resource not found"): status_code = 404 AppExceptionCase.__init__(self, status_code, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ResourceExists(self, name):\n pass", "def test_get_not_exist(self):\n attempt_id = 9999\n _, err = self.resource.get(attempt_id)\n self.assertEqual(404, err)", "def test_get_non_existing(self):\n\n response = self.client.get('/auth/non-existing-resource')\n\n self.asse...
[ "0.7061364", "0.6804913", "0.6651982", "0.6555284", "0.64374006", "0.63773704", "0.63734704", "0.6368019", "0.63057864", "0.62904686", "0.62130564", "0.6202281", "0.6187814", "0.6170324", "0.61667585", "0.615916", "0.6143686", "0.6115909", "0.61144435", "0.60989124", "0.60874...
0.5730751
61
Key Cloak Error. Error with regards to Keycloak authentication
def __init__(self, context=None, status_code=400): AppExceptionCase.__init__(self, status_code, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_bad_client_key_secret(self):\n # this adds lti passports to system\n mocked_course = Mock(lti_passports=['test_id_test_client_test_secret'])\n modulestore = Mock()\n modulestore.get_course.return_value = mocked_course\n runtime = Mock(modulestore=modulestore)\n se...
[ "0.5632132", "0.5600104", "0.5544922", "0.5415454", "0.54143417", "0.5374657", "0.53704315", "0.53016126", "0.52433825", "0.5240946", "0.5231442", "0.52010244", "0.51984966", "0.5192179", "0.5154842", "0.51388204", "0.51376426", "0.510656", "0.5097937", "0.5095865", "0.509339...
0.0
-1
Shows you a user's info. Defaults to message author if user is not specified.
async def userinfo(self, ctx, user: discord.Member=None): if user is None: member = ctx.message.author else: member = user # user-friendly status if member.status == discord.Status.online: status = '<:online:314049328459022338>' elif member.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _user(\n self, ctx: Context, user: Union[discord.Member, discord.User] = None\n ) -> None:\n\n # TODO: Add comments\n\n user = user or ctx.author\n\n created = convert_date(user.created_at)\n joined = convert_date(user.joined_at)\n\n roles = user.roles[1:]\n\n...
[ "0.7817979", "0.74240613", "0.73358816", "0.73201436", "0.70985305", "0.70746315", "0.7062301", "0.7056473", "0.70420814", "0.7007846", "0.6932124", "0.6932124", "0.692926", "0.6917675", "0.67954487", "0.6789906", "0.6709936", "0.6700023", "0.6698432", "0.66610175", "0.665627...
0.7020608
9
Shows you the server's info.
async def serverinfo(self, ctx): guild = ctx.guild embed = discord.Embed() embed.title = str(guild) if guild.icon_url is not None: embed.description = '**ID**: {0.id}\n[Icon URL]({0.icon_url})'.format(guild) embed.set_thumbnail(url=guild.icon_url) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_serverinfo(self, server):\n print('QManager server:', self._server)\n server_info = self._qm.get_server_info()\n for k, v in server_info.items():\n print(' %s: %s' % (k, v))", "def server_info(ctx):\n data = ctx.obj.get_server_info()\n output_json_data(data)", "asy...
[ "0.81548536", "0.8013476", "0.79281116", "0.7830371", "0.7687823", "0.7542854", "0.74269855", "0.7064764", "0.699611", "0.6933578", "0.69029045", "0.6858991", "0.6823201", "0.6803628", "0.6789922", "0.67623603", "0.66861576", "0.6668273", "0.6664019", "0.66423666", "0.6621902...
0.66775817
17
Bans a member by their ID.
async def hackban(self, ctx, user_id: int): try: await self.liara.http.ban(str(user_id), str(ctx.guild.id)) await ctx.send('Done. Good riddance.') except discord.NotFound: await ctx.send('That user doesn\'t exist.') except discord.Forbidden: await ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def blacklist_member(self, ctx, *members):\n successes = []\n fails = []\n for member_arg in members:\n try:\n member = await commands.MemberConverter().convert(ctx, member_arg)\n except commands.errors.BadArgument:\n fails.append(f\"Ca...
[ "0.63070995", "0.60369503", "0.6014336", "0.59825325", "0.59800154", "0.5931326", "0.59076715", "0.5808218", "0.576421", "0.5656949", "0.5637696", "0.5594352", "0.5594352", "0.5577263", "0.55284536", "0.5513746", "0.54673755", "0.5456609", "0.54371774", "0.54202896", "0.53954...
0.51849204
33
Kicks a member, removing all their messages in the process.
async def softban(self, ctx, member: discord.Member, days_to_clean: int=1, reason: str=None): if not 0 <= days_to_clean <= 7: await ctx.send('Invalid clean value. Use a number from 0 to 7.') return _reason = 'Initiated by {}'.format(ctx.author) if reason is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kick_member(self, *args, **kwargs):\n return self.bot.kick_chat_member(self.id, *args, **kwargs)", "async def kick(ctx, member: discord.Member, *, reason=None):\n await member.kick(reason=reason)\n await ctx.send(f\"User {member} has been kicked\")", "async def kick(self, member: discord.Membe...
[ "0.6691964", "0.6401182", "0.6360286", "0.63516563", "0.6264079", "0.6246532", "0.6202057", "0.61851513", "0.61446947", "0.61362326", "0.6063388", "0.60518676", "0.6050591", "0.60048157", "0.59817153", "0.5973734", "0.596621", "0.59576553", "0.5944285", "0.59138596", "0.58660...
0.0
-1
Kicks a member from voice.
async def voicekick(self, ctx, member: discord.Member, reason: str=None): if not (member.voice is not None and member.voice.channel is not None): return await ctx.send('That user is not in a voice channel.') overwrite = discord.PermissionOverwrite(connect=False) overwrite = {ctx.guil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kick_member(self, *args, **kwargs):\n return self.bot.kick_chat_member(self.id, *args, **kwargs)", "async def kick(self, ctx, *, member):\n kickmsg = ['Poor %s is out!', 'These people don\\'t understand!', 'Seeya %s!']\n try:\n await self.Aya.kick(member)\n await se...
[ "0.70917535", "0.6701306", "0.66946244", "0.66391265", "0.6553563", "0.65528697", "0.6551806", "0.63521826", "0.634649", "0.6206999", "0.6151701", "0.6095203", "0.60931796", "0.60874003", "0.6033611", "0.60330963", "0.60183454", "0.6015031", "0.60025275", "0.59779143", "0.589...
0.71342415
0
Message clean up command group.
async def clean_cmd(self, ctx): await self.liara.send_command_help(ctx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup(self):\n self.msgmap.clear()\n self.droppedmsgs.clear()\n self.chan.stop_receiving_messages()\n\n # TODO: enable\n #self.cmdMap.clear()\n #self.cmdCliSubmitQueue.clear()\n #self.cmdSvrComputeQueue.clear()\n #self.droppedCommands.clear()\n #...
[ "0.6748752", "0.6615232", "0.6557783", "0.6448254", "0.6222241", "0.621399", "0.6112482", "0.6058285", "0.605482", "0.6047543", "0.60040253", "0.5927958", "0.59184146", "0.5871161", "0.5861241", "0.5858302", "0.58504015", "0.5810184", "0.5795903", "0.5794257", "0.5789208", ...
0.59801936
11
Cleans up a member's messages.
async def member(self, ctx, member: MemberIDConverter, limit: int=100, channel: discord.TextChannel=None): if channel is None: channel = ctx.channel if isinstance(member, discord.Member): def predicate(message): return message.author == member else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def clean_user(self, ctx, member: discord.Member, num_msg: int = 100):\n if num_msg > 100:\n return await ctx.error('Number of messages to be deleted must not exceed 100.')\n\n # Makes sure to only delete the member's messages\n def check(message):\n return message....
[ "0.6640742", "0.66265845", "0.66194063", "0.6547974", "0.6472929", "0.6375906", "0.6287656", "0.62689954", "0.61913925", "0.6176338", "0.6157418", "0.6145801", "0.610136", "0.6098785", "0.60144514", "0.5991168", "0.59559333", "0.59314257", "0.592768", "0.58436877", "0.5821889...
0.6195293
8
Cleans up the specified channel.
async def channel(self, ctx, limit: int=100, channel: discord.TextChannel=None): if channel is None: channel = ctx.channel # noinspection PyUnresolvedReferences messages = await channel.purge(limit=limit) messages = len(messages) plural = '' if messages == 1 else '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup(self, channel=None):\n # falls `channel` angegeben wurden, werden nur diese bereinigt,\n # ansonsten wird alles bereinigt\n if channel:\n # ueberpruefe, ob `channel` eine Zahl ist und erstelle eventuell eine Liste nur mit dieser Zahl\n # dies ist wichtig, weil...
[ "0.7938694", "0.7093363", "0.69889796", "0.69871527", "0.6925234", "0.68488103", "0.6747655", "0.66760796", "0.66299", "0.66278464", "0.6489136", "0.6410515", "0.63472587", "0.6228345", "0.62038255", "0.61459047", "0.6128768", "0.6066723", "0.60553163", "0.5989163", "0.598430...
0.6815028
6
Construct temporary .pylintrc search paths.
def pylintrc_search_paths(tmp_path_factory): search_paths = {dir_name: str(tmp_path_factory.mktemp(dir_name)) for dir_name in DIR_LIST} return search_paths
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_pylintrc_path(pylintrc_files, mocker):\n search_paths, expected_path, __ = pylintrc_files\n mocker.patch(\"pylint.config.os.path.expanduser\",\n return_value=search_paths[HOME_DIR])\n actual_path = get_pylintrc_path(\n search_paths=list(search_paths.values()),\n ...
[ "0.662011", "0.650711", "0.6226583", "0.5570983", "0.5460117", "0.54496396", "0.5440895", "0.5436888", "0.53861815", "0.53402513", "0.53386796", "0.53209335", "0.5306118", "0.5263746", "0.52620554", "0.5228226", "0.5217716", "0.52044374", "0.5197145", "0.51968545", "0.5183719...
0.737298
0
Write a script for testing Pylint to a temporary directory.
def pylint_test_script(pylintrc_search_paths): script_path = osp.join( pylintrc_search_paths[SCRIPT_DIR], "test_script.py") with open(script_path, mode="w", encoding="utf-8", newline="\n") as script_file: script_file.write(PYLINT_TEST_SCRIPT) return script_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_tests(project_name, root_dir):\r\n test_path = get_file_path(root_dir, \"tests\", \"%s_tests.py\" % project_name) #Get the path for setup.py\r\n test_content = get_test_text(project_name)\r\n \r\n test_file = open(test_path, 'w')\r\n test_file.write(test_content)\r\n test_file.close()\r...
[ "0.6096249", "0.6032377", "0.5950862", "0.593867", "0.5890548", "0.5798267", "0.5785909", "0.57421994", "0.5741357", "0.5741214", "0.572069", "0.56900096", "0.5683055", "0.5643151", "0.56162775", "0.5615845", "0.5593304", "0.5564635", "0.5535172", "0.55192435", "0.5500983", ...
0.7018658
0
Write scripts for testing Pylint to a temporary directory.
def _pylint_test_scripts(filenames): script_paths = [] for filename in filenames: script_path = osp.join( pylintrc_search_paths[SCRIPT_DIR], filename) with open(script_path, mode="w", encoding="utf-8", newline="\n") as script_file: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pylint_test_script(pylintrc_search_paths):\n script_path = osp.join(\n pylintrc_search_paths[SCRIPT_DIR], \"test_script.py\")\n with open(script_path, mode=\"w\",\n encoding=\"utf-8\", newline=\"\\n\") as script_file:\n script_file.write(PYLINT_TEST_SCRIPT)\n\n return script...
[ "0.69183147", "0.644066", "0.6048326", "0.595293", "0.5928533", "0.5804014", "0.5797535", "0.57699823", "0.57633626", "0.5738111", "0.5698035", "0.56932366", "0.56857955", "0.56565", "0.56419766", "0.5626994", "0.5617291", "0.55939287", "0.55837107", "0.55744535", "0.5528944"...
0.63962543
2
Store test .pylintrc files at the paths and determine the result.
def pylintrc_files(pylintrc_search_paths, request): search_paths = pylintrc_search_paths # Determine the bad names that should be reported pylintrc_locations = request.param bad_names = [ALL_DIR] for search_path_name, search_path in search_paths.items(): if search_path_name in pylintrc_loca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_pylintrc_path(pylintrc_files, mocker):\n search_paths, expected_path, __ = pylintrc_files\n mocker.patch(\"pylint.config.os.path.expanduser\",\n return_value=search_paths[HOME_DIR])\n actual_path = get_pylintrc_path(\n search_paths=list(search_paths.values()),\n ...
[ "0.66452694", "0.6459445", "0.6170688", "0.59876823", "0.582488", "0.5818325", "0.5776186", "0.568071", "0.56714493", "0.56066376", "0.56009126", "0.55990326", "0.5571086", "0.5561749", "0.5561562", "0.5551839", "0.5498108", "0.5487645", "0.5454416", "0.5452476", "0.54209703"...
0.7167423
0
Test that get_pylintrc_path finds the expected one in the hiearchy.
def test_get_pylintrc_path(pylintrc_files, mocker): search_paths, expected_path, __ = pylintrc_files mocker.patch("pylint.config.os.path.expanduser", return_value=search_paths[HOME_DIR]) actual_path = get_pylintrc_path( search_paths=list(search_paths.values()), home_path=sea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_pylintrc():\n # is there a pylint rc file in the current directory ?\n if exists('pylintrc'):\n return abspath('pylintrc')\n if isfile('__init__.py'):\n curdir = abspath(os.getcwd())\n while isfile(join(curdir, '__init__.py')):\n curdir = abspath(join(curdir, '..')...
[ "0.68032706", "0.6448468", "0.6284805", "0.6265563", "0.5905181", "0.5899702", "0.58623224", "0.5832469", "0.5802742", "0.5788268", "0.5768383", "0.5759849", "0.5758396", "0.57533956", "0.57498854", "0.5731606", "0.57209617", "0.57180184", "0.57164896", "0.5670219", "0.566472...
0.80268943
0
Test that pylint works without errors with no project open.
def test_pylint_widget_noproject(pylint_test_script, mocker, qtbot): main_window = MainWindowMock() main_window.projects.get_active_project_path = mocker.MagicMock( return_value=None) pylint_sw = Pylint(parent=main_window) pylint_widget = PylintWidget(parent=pylint_sw) pylint_widget.analyze(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_pylint(self):\n files_list = []\n\n for root, dirnames, filenames in os.walk(PROJECT_DIR):\n if ignore(root):\n continue\n\n for filename in fnmatch.filter(filenames, '*.py'):\n files_list.append(os.path.join(root, filename))\n\n for...
[ "0.73435986", "0.6972813", "0.69605803", "0.6926185", "0.689467", "0.66783124", "0.6634413", "0.6620255", "0.6610743", "0.65135115", "0.65071905", "0.65042174", "0.63952893", "0.635824", "0.6269281", "0.6260681", "0.6255265", "0.622976", "0.622349", "0.6208131", "0.6207678", ...
0.6069517
31
Test that entire pylint widget gets results depending on pylintrc.
def test_pylint_widget_pylintrc( pylint_test_script, pylintrc_files, mocker, qtbot): search_paths, __, bad_names = pylintrc_files mocker.patch("pylint.config.os.path.expanduser", return_value=search_paths[HOME_DIR]) mocker.patch("spyder.plugins.pylint.widgets.pylintgui.getcwd_or_hom...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_pylint_widget_noproject(pylint_test_script, mocker, qtbot):\n main_window = MainWindowMock()\n main_window.projects.get_active_project_path = mocker.MagicMock(\n return_value=None)\n pylint_sw = Pylint(parent=main_window)\n pylint_widget = PylintWidget(parent=pylint_sw)\n pylint_widg...
[ "0.67564845", "0.6632729", "0.64372236", "0.6360425", "0.631944", "0.62945527", "0.6275919", "0.62694365", "0.6235758", "0.6235356", "0.61929816", "0.6172255", "0.6162868", "0.6126283", "0.60482913", "0.5955209", "0.5931774", "0.5890925", "0.58670413", "0.58547294", "0.582058...
0.807906
0
Regression test for checking max_entries configuration. For further information see spyderide/spyder12884
def test_pylint_max_history_conf(pylint_test_scripts, mocker): # Create the pylint widget for code analysis main_window = MainWindowMock() main_window.projects.get_active_project_path = mocker.MagicMock( return_value=None) pylint_sw = Pylint(parent=main_window) pylint_widget = PylintWidget(p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_max_N_too_small(self):\n\t\t\n\t\t\n\t\tparams = DEFAULT_PARAMS.copy()\n\t\tparams[MAX_N] = DEFAULT_MAX_EVALS+1\n\t\t\n\t\titerator = self.watcher.make_layer_iterator(model=self.model, params=params)\n\t\tfor ww_layer in iterator:\n\t\t\tif ww_layer.N > params[MAX_N]:\n\t\t\t\tself.assertTrue(ww_layer.ski...
[ "0.6541958", "0.63695395", "0.6201048", "0.610613", "0.6067904", "0.6054037", "0.6046796", "0.6046103", "0.6041737", "0.5978871", "0.59747493", "0.5949322", "0.58765113", "0.5790502", "0.57711256", "0.5766153", "0.5758449", "0.5740867", "0.57294744", "0.5691222", "0.56880814"...
0.0
-1
Validates the given 1based page number.
def validate_number(self, number): try: number = int(number) except (TypeError, ValueError): raise PageNotAnInteger('That page number is not an integer') if number < 1: raise EmptyPage('That page number is less than 1') return number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_page_number(self, page_number):\n try:\n page_number = int(page_number)\n except ValueError:\n raise PageNotAnInteger('That page number is not an integer')\n if page_number < 1:\n raise EmptyPage('That page number is less than 1')\n if page_...
[ "0.78904337", "0.608078", "0.5907446", "0.58686286", "0.5767173", "0.57246196", "0.56576866", "0.5597573", "0.5579648", "0.55630326", "0.55414945", "0.5502022", "0.5393261", "0.53803545", "0.53577507", "0.5327163", "0.5299837", "0.5276072", "0.52355504", "0.5227572", "0.52175...
0.76098096
1
Don't evaluate orphans before slicing
def page(self, number): number = self.validate_number(number) bottom = (number - 1) * self.per_page top = bottom + self.per_page return self._get_page(self.object_list[bottom:top], number, self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slice(self, pred):\n return NotImplemented", "def test_slice_delslice_forbidden(self):\n global setVal\n class foo:\n def __delslice__(self, i, j, value):\n global setVal\n setVal = i, j, value\n def __delitem__(self, index):\n ...
[ "0.6031186", "0.5908705", "0.5887305", "0.57927936", "0.56562066", "0.56422794", "0.56190693", "0.5517379", "0.54102", "0.53190833", "0.5312345", "0.5291478", "0.52680624", "0.52655256", "0.5262022", "0.5225265", "0.52151316", "0.5203213", "0.51618236", "0.51421803", "0.51133...
0.0
-1
Retrieves an item or slice from the set of results.
def __getitem__(self, k): if not isinstance(k, (slice,) + six.integer_types): raise TypeError assert ((not isinstance(k, slice) and (k >= 0)) or (isinstance(k, slice) and (k.start is None or k.start >= 0) and (k.stop is None or k.stop >= 0))), \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, arg):\n data = None\n if isinstance(arg, int):\n data = self._handle_result_by_index(arg)\n elif isinstance(arg, (STRTYPE, list)):\n data = self._handle_result_by_key(arg)\n elif isinstance(arg, ResultByKey):\n data = self._handle_r...
[ "0.649364", "0.64015186", "0.62427884", "0.6176007", "0.6158988", "0.6123676", "0.60839933", "0.6079722", "0.60767406", "0.60656726", "0.60594094", "0.60469633", "0.60467464", "0.6046677", "0.6015883", "0.60063463", "0.60027295", "0.59725815", "0.5961375", "0.58989114", "0.58...
0.58286643
24
Prepare object points for a chessboard pattern
def get_obj_points_from_chessboard_dimensions(chessboard_dimensions: Tuple[int, int] = (9, 6)): # prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0) x, y = chessboard_dimensions object_points: np.ndarray = np.zeros((x * y, 3), np.float32) object_points[:, :2] = np.mgrid[0:x, 0:y].T.resha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pointsSetUp(self):\r\n self.background.draw(self.surface)\r\n for i in range(len(self.points)):\r\n self.points[i].organize()\r\n self.points[i].update()\r\n self.points[i].addNumber(i)\r\n self.points[i].setActiveTurn()", "def place_obj(self):\r\n ...
[ "0.64446527", "0.6197618", "0.61572576", "0.61388654", "0.61300224", "0.6035208", "0.6033167", "0.602081", "0.6014104", "0.6005579", "0.6002765", "0.59935117", "0.59837615", "0.5969495", "0.5947238", "0.5927367", "0.5891806", "0.58882946", "0.5868722", "0.5861847", "0.5855113...
0.6439109
1
Obtain camera calibration matrices given calibration files
def get_camera_calibration( chessboard_dimensions: Tuple[int, int], calibration_image_file_paths: List[str] = glob.glob('*.jpg'), show_images: bool = False, show_plot_wait_time_ms: int = 500, format_: str = 'BGR' ) -> Tuple: x, y = chessboard_dimensions obj_points = get_o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_calibration(self):\n #TODO add function to check if the folder exists because opencv points to other error rather than saying it doesnt exist\n cv_file = cv2.FileStorage(\"calib_images/calibration.yaml\", cv2.FILE_STORAGE_READ)\n camera_matrix = cv_file.getNode(\"camera_matrix\").m...
[ "0.71203774", "0.707494", "0.69774026", "0.69181615", "0.69110817", "0.6816427", "0.6705376", "0.63970345", "0.63588655", "0.63451743", "0.63045245", "0.6280474", "0.6273964", "0.6207426", "0.6129681", "0.6129681", "0.6089797", "0.60470915", "0.5982372", "0.5939119", "0.59259...
0.59838665
18
Get the vertices of an isosceles trapezoid starting from bottom left and moving clockwise
def get_isosceles_trapezoid_mask_vertices( m, n, x_proportion_bottom=1 / 10, x_proportion_top=4 / 10, y_proportion_bottom=1, y_proportion_top=3/5 ): bottom_y = int(m * y_proportion_bottom) top_y = int(m * y_proportion_top) left_lane_bottom_left_pt = (int(n * x_propor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vertexes(self):\n theta = self.orientation\n shifts = np.array([np.cos(theta), np.sin(theta)]) * self.a\n return self.coords + (shifts[:, None] * [-1, 1]).T", "def non_rotated_vertices(self):\n v0 = [self.pos.x - self.width / 2, self.pos.y - self.height / 2]\n v1 = [self.po...
[ "0.7171764", "0.65571797", "0.65322274", "0.608766", "0.6044231", "0.5974801", "0.5954909", "0.59464246", "0.59071857", "0.5898831", "0.5891321", "0.589034", "0.58841217", "0.5849459", "0.5848807", "0.5820009", "0.5812995", "0.5803164", "0.5803164", "0.57727724", "0.5768904",...
0.58171797
16
Load command history from a file
def load_from_file(self, known_tokens, known_types, filename: str) -> None: try: with open(filename) as f: as_json = json.load(f, known_types=known_types) except FileNotFoundError: return except: # sometimes bad things happen to good people ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_history_file(config):\n if not os.path.isfile(config.rh_get_data('historyFile')):\n open(config.rh_get_data('historyFile'), 'a').close()\n readline.read_history_file(config.rh_get_data('historyFile'))", "def cli(ctx, file_path=\"\", url=\"\"):\n return ctx.gi.histories.import_history(fil...
[ "0.74619347", "0.72604376", "0.7182214", "0.676043", "0.65699756", "0.64305735", "0.6342211", "0.6225961", "0.62065923", "0.61986715", "0.6197969", "0.61966974", "0.6191799", "0.61278045", "0.61079544", "0.6050733", "0.6006489", "0.6000674", "0.59908074", "0.59717906", "0.589...
0.0
-1
save command history to a file
def save_to_file(self, filename: str) -> None: channels = { 'channels': { channel: [self._command_entry_to_json(command) for command in commands] for (channel, commands) in self.history.items() } } # if we can't save it, exit early ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_history(histfile):\n readline.write_history_file(histfile)", "def _write_history(self):\n if self.data['history_file'] is None:\n return\n contents = '\\n'.join(self.data['history_lines'])\n history = self.data['history_file']\n write_text_file(\n his...
[ "0.7966322", "0.7617373", "0.7598796", "0.7544315", "0.7443768", "0.7310332", "0.7183351", "0.7068503", "0.70238644", "0.69773406", "0.6937527", "0.6860921", "0.67012703", "0.66893965", "0.6666324", "0.6657722", "0.6657628", "0.65587616", "0.6547355", "0.6530432", "0.65126705...
0.64265674
23
Convert lat/lon coordinates into a format readable by bokeh Return converted min and max extend of the map
def set_maprange(xmin, ymin, xmax, ymax, epsg_in='epsg:4326'): outProj = pyproj.Proj(init='epsg:3857') inProj = pyproj.Proj(init=epsg_in) xmin,ymin = 75, -55 xmax,ymax = 175, -5 x1,y1 = pyproj.transform(inProj,outProj,xmin,ymin) x2,y2 = pyproj.transform(inProj,outProj,xmax,ymax) return x1, y...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coords_to_min_max_lat_lon(self,coords):\n row = coords[0]\n col = coords[1]\n max_lat = self.max_lat - row*(self.lat_step)\n min_lat = max_lat - self.lat_step\n min_lon = self.min_lon + col*(self.lon_step)\n max_lon = min_lon + self.lon_step\n return min_lat,max...
[ "0.70025444", "0.6535177", "0.6387051", "0.6208858", "0.6041239", "0.60246575", "0.5981149", "0.5957852", "0.5921683", "0.58679163", "0.58393097", "0.5821164", "0.5791258", "0.57901835", "0.57851946", "0.57768005", "0.57754934", "0.5724911", "0.56577533", "0.5649122", "0.5611...
0.6524769
2
Get data for individual video.
def get_cstr_for_video( video_name, path_info='/sequoia/data2/gcheron/UCF101/detection/mytracksK5_600k', path_tracks='/sequoia/data2/gcheron/pytorch/diffrac_action_localization/UCF101/results/mytracksK5_600k/tracks/', groupby=8, n_actions=25, constr_fn=None, ignor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_video_info(self, id, **kwargs):\n kwargs['id'] = id\n return self.get('info/video.json', **kwargs)", "def get_video(self, video_id):\n uri = 'videos/' + video_id\n return self.make_request(uri)", "async def get_video_info(self, video_id: int) -> APIReturn:\n result = await se...
[ "0.72090256", "0.69935507", "0.6810411", "0.68068284", "0.6769184", "0.6755055", "0.6724601", "0.6637515", "0.66115624", "0.6596834", "0.65214664", "0.6473053", "0.6453924", "0.6433475", "0.6419705", "0.64166456", "0.63923687", "0.6360827", "0.6338368", "0.63210136", "0.62932...
0.0
-1
Get data for individual video.
def get_at_least_one_per_instance_unit_time_with_keyframes_cstr_for_video( id_tracklet, tbound_track, groupby, gt, tmp_cstr, extra_info): key_tracklet = 'tracklet_{}'.format(id_tracklet) # Spatial overlap with keyframes sp_overlap_keyframes = extra_info['track_info']['ann_iou'] ov_threshold = 0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_video_info(self, id, **kwargs):\n kwargs['id'] = id\n return self.get('info/video.json', **kwargs)", "def get_video(self, video_id):\n uri = 'videos/' + video_id\n return self.make_request(uri)", "async def get_video_info(self, video_id: int) -> APIReturn:\n result = await se...
[ "0.72090256", "0.69935507", "0.6810411", "0.68068284", "0.6769184", "0.6755055", "0.6724601", "0.6637515", "0.66115624", "0.6596834", "0.65214664", "0.6473053", "0.6453924", "0.6433475", "0.6419705", "0.64166456", "0.63923687", "0.6360827", "0.6338368", "0.63210136", "0.62932...
0.0
-1
Get data for individual video.
def get_at_least_one_clip_level_cstr_for_video( id_tracklet, tbound_track, groupby, gt, tmp_cstr, extra_info): key_tracklet = 'tracklet_{}'.format(id_tracklet) # Every GT label are considered as a positive has_constraint = True for idx_gt, i_gt in enumerate(gt): id_action = i_gt['label'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_video_info(self, id, **kwargs):\n kwargs['id'] = id\n return self.get('info/video.json', **kwargs)", "def get_video(self, video_id):\n uri = 'videos/' + video_id\n return self.make_request(uri)", "async def get_video_info(self, video_id: int) -> APIReturn:\n result = await se...
[ "0.72111183", "0.69979155", "0.6812642", "0.6809194", "0.6773183", "0.6759034", "0.6724313", "0.66365457", "0.6610607", "0.65964884", "0.6524277", "0.6474471", "0.6455582", "0.6436734", "0.642249", "0.6419765", "0.6394868", "0.63627505", "0.6341928", "0.6320811", "0.62935424"...
0.0
-1
Get data for individual video.
def get_at_least_one_shot_level_cstr_for_video( id_tracklet, tbound_track, groupby, gt, tmp_cstr, extra_info): key_tracklet = 'tracklet_{}'.format(id_tracklet) def get_corrected_shot(shot_path, vname): _shots = sio.loadmat(shot_path + '/' + vname + '.mp4.mat')['shots'] # fix the shots ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_video_info(self, id, **kwargs):\n kwargs['id'] = id\n return self.get('info/video.json', **kwargs)", "def get_video(self, video_id):\n uri = 'videos/' + video_id\n return self.make_request(uri)", "async def get_video_info(self, video_id: int) -> APIReturn:\n result = await se...
[ "0.7210361", "0.69955426", "0.68126553", "0.6807229", "0.6770269", "0.6756628", "0.6726619", "0.6637356", "0.6613131", "0.65979415", "0.6523975", "0.647374", "0.6453712", "0.64347273", "0.6421711", "0.6417888", "0.6394569", "0.6361935", "0.6341038", "0.6322356", "0.62927485",...
0.0
-1
Get data for individual video.
def get_at_least_one_per_instance_unit_time_cstr_for_video( id_tracklet, tbound_track, groupby, gt, tmp_cstr, extra_info): key_tracklet = 'tracklet_{}'.format(id_tracklet) # Check if it interacts with GT. has_constraint = False for idx_gt, i_gt in enumerate(gt): if is_inside(tbound_trac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_video_info(self, id, **kwargs):\n kwargs['id'] = id\n return self.get('info/video.json', **kwargs)", "def get_video(self, video_id):\n uri = 'videos/' + video_id\n return self.make_request(uri)", "async def get_video_info(self, video_id: int) -> APIReturn:\n result = await se...
[ "0.72090256", "0.69935507", "0.6810411", "0.68068284", "0.6769184", "0.6755055", "0.6724601", "0.6637515", "0.66115624", "0.6596834", "0.65214664", "0.6473053", "0.6453924", "0.6433475", "0.6419705", "0.64166456", "0.63923687", "0.6360827", "0.6338368", "0.63210136", "0.62932...
0.0
-1
This constraint takes the middle point of a GT interval and considers action happens during a fix interval center at this point
def get_at_least_one_per_temporal_point_unit_time_with_keyframes_cstr_for_video( id_tracklet, tbound_track, groupby, gt, tmp_cstr, extra_info): fixed_delta = 25 # Fixed delta frames before and after the middle point will be consider as GT key_tracklet = 'tracklet_{}'.format(id_tracklet) # Spatial...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bounds(self) -> Tensor:\n return torch.cat([self.mins, self.mins + self.ranges], dim=-2)", "def lower_bound(self) -> float:\n ...", "def upper_bound(self) -> float:\n ...", "def joint_limits_lower_constraint(q,ee_pos):\n return q - self.min_angles", "def condition_bounds...
[ "0.58106554", "0.56059194", "0.5585325", "0.5583757", "0.55040574", "0.5380183", "0.535776", "0.5315041", "0.5241237", "0.52311695", "0.52302086", "0.51736933", "0.5171115", "0.516707", "0.5166778", "0.5139581", "0.5130124", "0.51260746", "0.5116047", "0.51152027", "0.5105217...
0.0
-1
This constraint takes the middle point of a GT interval and considers action happens during a fix interval center at this point
def get_at_least_one_per_temporal_point_unit_time_cstr_for_video( id_tracklet, tbound_track, groupby, gt, tmp_cstr, extra_info): fixed_delta = 25 # fixed delta frames before and after the middle point will be consider as GT key_tracklet = 'tracklet_{}'.format(id_tracklet) has_one_cstr = Fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bounds(self) -> Tensor:\n return torch.cat([self.mins, self.mins + self.ranges], dim=-2)", "def lower_bound(self) -> float:\n ...", "def upper_bound(self) -> float:\n ...", "def joint_limits_lower_constraint(q,ee_pos):\n return q - self.min_angles", "def condition_bounds...
[ "0.5811746", "0.5607881", "0.55876034", "0.55838317", "0.5506009", "0.5381762", "0.5360179", "0.5313688", "0.5240531", "0.5230342", "0.5229289", "0.51767457", "0.5172492", "0.51690286", "0.51650316", "0.5141076", "0.5130264", "0.512628", "0.5118883", "0.51149064", "0.51037115...
0.0
-1
Get data for individual video.
def get_at_least_one_per_instance_cstr_for_video(id_tracklet, tbound_track, groupby, gt, tmp_cstr, extra_info): key_tracklet = 'tracklet_{}'.format(id_tracklet) # Check if it interacts with GT. has_constraint = False for idx_gt, i_gt in enumerate(gt): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_video_info(self, id, **kwargs):\n kwargs['id'] = id\n return self.get('info/video.json', **kwargs)", "def get_video(self, video_id):\n uri = 'videos/' + video_id\n return self.make_request(uri)", "async def get_video_info(self, video_id: int) -> APIReturn:\n result = await se...
[ "0.7210361", "0.69955426", "0.68126553", "0.6807229", "0.6770269", "0.6756628", "0.6726619", "0.6637356", "0.6613131", "0.65979415", "0.6523975", "0.647374", "0.6453712", "0.64347273", "0.6421711", "0.6417888", "0.6394569", "0.6361935", "0.6341038", "0.6322356", "0.62927485",...
0.0
-1
Get data for individual video.
def get_fully_supervised_cstr_for_video(id_tracklet, tbound_track, groupby, gt, tmp_cstr, extra_info): key_tracklet = 'tracklet_{}'.format(id_tracklet) if key_tracklet not in tmp_cstr: # note this field will remain empty here (since we know the exact class) tmp_cstr[key_tracklet] = set() # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_video_info(self, id, **kwargs):\n kwargs['id'] = id\n return self.get('info/video.json', **kwargs)", "def get_video(self, video_id):\n uri = 'videos/' + video_id\n return self.make_request(uri)", "async def get_video_info(self, video_id: int) -> APIReturn:\n result = await se...
[ "0.72090256", "0.69935507", "0.6810411", "0.68068284", "0.6769184", "0.6755055", "0.6724601", "0.6637515", "0.66115624", "0.6596834", "0.65214664", "0.6473053", "0.6453924", "0.6433475", "0.6419705", "0.64166456", "0.63923687", "0.6360827", "0.6338368", "0.63210136", "0.62932...
0.0
-1
Get data for individual video.
def get_spot_on_cstr_for_video(id_tracklet, tbound_track, groupby, gt, tmp_cstr, extra_info): key_tracklet = 'tracklet_{}'.format(id_tracklet) if key_tracklet not in tmp_cstr: # note this field will remain empty here (since we know the exact class) tmp_cstr[key_tracklet] = set() # in tmp_cs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_video_info(self, id, **kwargs):\n kwargs['id'] = id\n return self.get('info/video.json', **kwargs)", "def get_video(self, video_id):\n uri = 'videos/' + video_id\n return self.make_request(uri)", "async def get_video_info(self, video_id: int) -> APIReturn:\n result = await se...
[ "0.72090256", "0.69935507", "0.6810411", "0.68068284", "0.6769184", "0.6755055", "0.6724601", "0.6637515", "0.66115624", "0.6596834", "0.65214664", "0.6473053", "0.6453924", "0.6433475", "0.6419705", "0.64166456", "0.63923687", "0.6360827", "0.6338368", "0.63210136", "0.62932...
0.0
-1
Get data for individual video.
def get_data_for_video( video_name, path_info='/sequoia/data2/gcheron/UCF101/detection/mytracksK5_600k', path_tracks='/sequoia/data2/gcheron/pytorch/diffrac_action_localization/UCF101/results/mytracksK5_600k/tracks/', sp_iou_thresh=0.3, groupby=8, feat_type='RGB+OPF', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_video_info(self, id, **kwargs):\n kwargs['id'] = id\n return self.get('info/video.json', **kwargs)", "def get_video(self, video_id):\n uri = 'videos/' + video_id\n return self.make_request(uri)", "async def get_video_info(self, video_id: int) -> APIReturn:\n result = await se...
[ "0.72111183", "0.69979155", "0.6812642", "0.6809194", "0.6773183", "0.6759034", "0.6724313", "0.66365457", "0.6610607", "0.65964884", "0.6524277", "0.6474471", "0.6455582", "0.6436734", "0.642249", "0.6419765", "0.6394868", "0.63627505", "0.6341928", "0.6320811", "0.62935424"...
0.0
-1
Get data for individual video.
def write_eval_data( video_name, W, bias_value=100, path_root_out='/sequoia/data2/jalayrac/nips2017weakpose/UCF101', path_info='/sequoia/data2/gcheron/UCF101/detection/mytracksK5_600k', path_tracks='/sequoia/data2/gcheron/pytorch/diffrac_action_localization/UCF101/results...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_video_info(self, id, **kwargs):\n kwargs['id'] = id\n return self.get('info/video.json', **kwargs)", "def get_video(self, video_id):\n uri = 'videos/' + video_id\n return self.make_request(uri)", "async def get_video_info(self, video_id: int) -> APIReturn:\n result = await se...
[ "0.7210361", "0.69955426", "0.68126553", "0.6807229", "0.6770269", "0.6756628", "0.6726619", "0.6637356", "0.6613131", "0.65979415", "0.6523975", "0.647374", "0.6453712", "0.64347273", "0.6421711", "0.6417888", "0.6394569", "0.6361935", "0.6341038", "0.6322356", "0.62927485",...
0.0
-1
class to handles the models that use satellite and other features to predict indicator.
def __init__(self, model_list, sat_features=None): self.model_list = model_list self.scores = {'kNN': [], 'Kriging': [], 'RmSense': [], 'Ensamble': []} self.results = {'kNN': [], 'Kriging': [], 'RmSense': [], 'Ensamble': []} self.kNN = None self.Kriging = None self.RmSens...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict_only(self):", "def run():\n\n df = read_input() # the parameters\n df = add_time_period(df) # a feature\n df = is_holiday(df) # a feature\n df = scale_continous(df) # continous feature transformation\n df = encode_dummy(df) # categorical feature transformation\n df = order_columns(d...
[ "0.6074002", "0.60134465", "0.5998605", "0.59904325", "0.589351", "0.584803", "0.5836668", "0.57482916", "0.57444304", "0.56807435", "0.5657764", "0.5655203", "0.5654803", "0.5637645", "0.5595457", "0.55795395", "0.556176", "0.55550444", "0.5544546", "0.55351835", "0.5530522"...
0.55528283
18
Trains all the models listed in self.model_list on X and y. If you compute also a model on remote sensing features, it will use self.sat_features for that.
def compute(self, X, Y, n): inner_cv = KFold(5, shuffle=True, random_state=1673) print('-> grid searching and cross validation ...') for training, validation, j in self._k_fold_cross_validation(X, 5, n): x, y, valid_x, valid_y = X.loc[training, :], Y[training], X.loc[validation, :]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train(self, x_data, y_data):\n for model in self.list_of_models:\n model.fit(x_data, y_data)\n self.trained_models.append(model)", "def train(self, x, t):\n for i in range(self.number_model):\n curr_model = self.all_model[i]\n curr_model.fit(x, t)", ...
[ "0.7062569", "0.6632269", "0.63029474", "0.6144025", "0.60218513", "0.58185494", "0.5798708", "0.5777688", "0.57302237", "0.57217026", "0.57015175", "0.56994283", "0.566281", "0.5661027", "0.56046915", "0.56042093", "0.5594292", "0.5580856", "0.5578236", "0.5574985", "0.55524...
0.0
-1
return ``True`` if this object is initialized with current schema\ and return ``False`` otherwise.
def is_init(self): cur = self.connection.cursor() masterdata = list(cur.execute( 'SELECT * FROM sqlite_master WHERE name="metadata"' )) if len(masterdata) == 0: return False schema_version = list(cur.execute( 'SELECT value FROM metadata ' + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_initialised(self) -> bool:\n return _schema.has_schema(self._engine)", "def _is_initialized(self) -> bool:\n return len(self) > 0", "def isInitialized(self):\n\t\tif self.isTypeSet and self.isCfgSet:\n\t\t\treturn True\n\t\telse:\n\t\t\treturn False", "def initialize(self) -> bool:\n ...
[ "0.8566377", "0.70202136", "0.68050253", "0.6754496", "0.6735238", "0.6682235", "0.6647975", "0.66320235", "0.6615343", "0.661172", "0.6484367", "0.6484367", "0.6474015", "0.6436641", "0.6405033", "0.6385124", "0.63354135", "0.6331027", "0.6293815", "0.62921417", "0.62463856"...
0.80022717
1
Generates arp request and sends it out of 'port_out' of 'dp' forwarder
def _arp_send(dp, port_out, arp_code, ip_sender, ip_target, eth_dst='ff:ff:ff:ff:ff:ff',eth_src=None,eth_target='00:00:00:00:00:00'): ofp = dp.ofproto parser = dp.ofproto_parser pkt = packet.Packet() # HACK: to reply as real interface on virtual machine if dp.id in LAN_TYPE_FORWARDERS and dp.id =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_edge_inet_dp_join(self, dp, port, apn):\n\n ofp = dp.ofproto\n parser = dp.ofproto_parser\n\n ##All ARP requests that come from APN are forwarded to Controller which then handle them\n LOG.debug('TOPO MNGR: Redirecting all ARP req from APN: ' + apn.name + ' to controller by OFr...
[ "0.70389175", "0.68457484", "0.6765341", "0.66586983", "0.6375743", "0.6263277", "0.62261516", "0.62181216", "0.62036407", "0.619166", "0.6029766", "0.596769", "0.5959465", "0.5918179", "0.5871038", "0.5856786", "0.58424866", "0.57656527", "0.5752623", "0.57328135", "0.565906...
0.7966862
0
Generates ICMP packet and sends it out of 'port_out' on forwarder 'dp'
def _icmp_send(dp, port_out, ip_src=DISCOVERY_IP_SRC, ip_dst=DISCOVERY_IP_DST, eth_src='02:b0:00:00:00:b5', eth_dst='02:bb:bb:bb:bb:bb', icmp_type=8, icmp_code=0): ofp = dp.ofproto parser = dp.ofproto_parser pkt = packet.Packet() pkt.add_protocol(ethernet.ethernet(ethertyp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _arp_send(dp, port_out, arp_code, ip_sender, ip_target, eth_dst='ff:ff:ff:ff:ff:ff',eth_src=None,eth_target='00:00:00:00:00:00'):\n\n ofp = dp.ofproto\n parser = dp.ofproto_parser\n pkt = packet.Packet()\n\n # HACK: to reply as real interface on virtual machine\n if dp.id in LAN_TYPE_FORWARDERS...
[ "0.7209012", "0.6993463", "0.648588", "0.64849937", "0.64377546", "0.64139664", "0.62656873", "0.6234963", "0.6189293", "0.6100794", "0.6088297", "0.60644233", "0.59741366", "0.58863854", "0.5831862", "0.5823556", "0.58225137", "0.5741862", "0.57396793", "0.5738106", "0.56858...
0.8093102
0
Used to parse payload of ICMP packets used for selfdiscovery which contains dictionary
def _icmp_parse_payload(pkt): payload = '' icmp_pkt = pkt.get_protocol(icmp.icmp) for char in icmp_pkt.data.data: payload+=(chr(char)) parsed_payload = ast.literal_eval(payload.rstrip('\0')) return(parsed_payload)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_icmp(pkt, packets, i, start_point):\r\n icmp_type = int(pkt[start_point:start_point+2], 16)\r\n start_point = start_point + 2\r\n icmp_code = int(pkt[start_point:start_point+2], 16)\r\n start_point = start_point + 2\r\n icmp_checksum = pkt[start_point:start_point+4]\r\n packets[i][2].a...
[ "0.69481534", "0.68800527", "0.6696721", "0.6606795", "0.6302321", "0.61934835", "0.61117524", "0.6082407", "0.60768354", "0.60135335", "0.59729457", "0.59665066", "0.59422326", "0.5932177", "0.5875507", "0.58529854", "0.5764105", "0.57236487", "0.5700653", "0.5675754", "0.56...
0.72770196
0
Generator of Tunnel identifiers (in MAC addr. format)
def get_tid(): mac_char='0123456789abcdef' mac_addr='02:' available=0 while available == 0: for i in range(5): for y in range(2): mac_addr = mac_addr + random.choice(mac_char) mac_addr = mac_addr + ':' mac_addr = mac_addr[:-1] if mac_addr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enumerate_network(arg):\n\n network = ip_network(arg, strict=False)\n data = list(map(str, network.hosts()))\n data.insert(0, str(network.network_address))\n if network.prefixlen != network.max_prefixlen:\n data.append(str(network.broadcast_address))\n return data", "def get_unique_netw...
[ "0.5769114", "0.5737529", "0.55646247", "0.5467259", "0.5378289", "0.5342663", "0.53416985", "0.5327515", "0.5310284", "0.52937657", "0.5292094", "0.52841973", "0.52473617", "0.52334154", "0.519637", "0.5145079", "0.5144612", "0.5142393", "0.5127744", "0.5116163", "0.5108347"...
0.574784
1
Add special rules for forwader on edge (APNside) of network
def on_edge_inet_dp_join(self, dp, port, apn): ofp = dp.ofproto parser = dp.ofproto_parser ##All ARP requests that come from APN are forwarded to Controller which then handle them LOG.debug('TOPO MNGR: Redirecting all ARP req from APN: ' + apn.name + ' to controller by OFrule on forw...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_nat_rule(client_session, esg_name, nat_type, nat_vnic, original_ip, translated_ip, original_port, translated_port, protocol, description):\n#def add_nat_rule(client_session, esg_name, nat_type, original_ip, translated_ip):\n esg_id, esg_params = get_edge(client_session, esg_name)\n if not esg_id:\n ...
[ "0.63960314", "0.61395895", "0.58726925", "0.5827213", "0.5802656", "0.5798235", "0.57194966", "0.57034314", "0.5658087", "0.55328023", "0.5471317", "0.5471317", "0.54281473", "0.5383757", "0.53600585", "0.5333561", "0.53211987", "0.53159326", "0.5295491", "0.5289603", "0.527...
0.57607144
6
Add new inner (BSS side) forwarder joined our network.
def on_inner_dp_join(self, dp): ofp = dp.ofproto parser = dp.ofproto_parser #Deletion of already existing OF flows LOG.debug('TOPO MNGR: Deleting flow table configuration of newly added forwarder ID: ' + str(dp.id) ) dp.send_msg(parser.OFPFlowMod(datapath=dp, command=ofp.OFPFC_D...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addNeighbor(self, neighbor):", "def append_neighbour(self, neighbour):\n self.connected_to.append(neighbour)\n neighbour.connected_to.append(self)", "def add_neighbours(self, router1, router2):\n router1 = self.routers[router1]\n router2 = self.routers[router2]\n\n router...
[ "0.5993939", "0.596971", "0.5930252", "0.585118", "0.5838516", "0.57371885", "0.5717631", "0.5717378", "0.57051635", "0.56735325", "0.5652761", "0.56406254", "0.5629999", "0.5607531", "0.55954224", "0.55444705", "0.5523582", "0.55130565", "0.55095875", "0.55094314", "0.548756...
0.6400863
0
This method handles packets that arrive directly to Controller
def _packet_in(self, ev): dp = ev.msg.datapath ofp = dp.ofproto parser = dp.ofproto_parser match = ev.msg.match ##SNDCP packet with multiple fragments recieved - print warning, send ICMP fragmentation needed ##TODO: Not WOrking correctly ## File "/usr/local/lib/...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _pkt_handle(self, pkt):\n\n # snag any left over data from last read()\n # Parse the header to get type\n offset, payload_len, subtype, nxp_sniffer = lowpan.message.parse_header(pkt[0])\n\n\n # Extract the raw message bytes\n rawmsg = pkt[0][offset : offset + payload_len]\n ...
[ "0.7431854", "0.7004571", "0.6968693", "0.6897513", "0.68553996", "0.67665774", "0.67315924", "0.6724838", "0.6584879", "0.64885", "0.64722186", "0.6439397", "0.64298594", "0.6411857", "0.637959", "0.63752276", "0.63655406", "0.63479024", "0.63478315", "0.6294914", "0.6283297...
0.6905222
3
This method handles change of forwarders state target ev.enter is False Forwarder got disconnected
def forwarder_state_changed(self, ev): dp = ev.dp ofp = dp.ofproto parser = dp.ofproto_parser if ev.enter is True: # in plain MAC setup, this should install only ICMP and ARP re-route rules, watchout for hardcoded DP id self.on_inner_dp_join(dp) ##For evr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state_processing_enter(cfg, app, win):", "def _detected_relay_state_change(self, event):\n # ensure there is a delay if any additional state change occurs to\n # avoid confusing the LUNOS hardware controller\n self._record_relay_state_change()\n\n entity = event.data.get(\"entity_...
[ "0.5625857", "0.561023", "0.55520225", "0.55520225", "0.5507927", "0.5499831", "0.5485146", "0.5446665", "0.54091686", "0.539391", "0.5344798", "0.5336561", "0.5331514", "0.5331445", "0.5329964", "0.53298074", "0.5307046", "0.5276215", "0.5254924", "0.52535224", "0.52432555",...
0.80070484
0
This method is called when new APN is discovered to connect it with all BSS stations via MAC Tunnels
def add_plainMacTunnel(self, sApn, dApn, path): sApn = sApn dApn = dApn tid_out = get_tid() tid_in = get_tid() ##Attempt to find path between the two nodes ##If no path is found, tunnel is added to INACTIVE_TUNNELS and is attempted to recreate next time ##when ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect_ap(self):\n\n # scan passively now that the AP has started\n self.host.scan_passive(200)\n \n # connect to AP\n self.host.sta_connect(self.ap1.macaddr)\n\n # expect a management frame for the AP\n mpdu = self.ap1.rx_mpdu(wifi.AIR_MGMT)\n \n ...
[ "0.65814364", "0.6304596", "0.6273221", "0.6216016", "0.6186696", "0.60472965", "0.6028012", "0.6018356", "0.59549683", "0.59466463", "0.580473", "0.57689154", "0.57431227", "0.5727057", "0.57067156", "0.5678081", "0.56752884", "0.56600004", "0.55857277", "0.55680263", "0.551...
0.56338865
18
Serialize action into buffer.
def serialize(self, buf, offset): super(GPRSAction,self).serialize(buf, offset) ofproto_parser.msg_pack_into("!H", buf, offset+8, self.subtype)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize(self, buff):\n try:\n _x = self.name\n length = len(_x)\n if python3 or type(_x) == unicode:\n _x = _x.encode('utf-8')\n length = len(_x)\n buff.write(struct.pack('<I%ss'%length, length, _x))\n _x = self.type_name\n length = len(_x)\n if python3 or ...
[ "0.6001708", "0.57553136", "0.569683", "0.5632987", "0.55927765", "0.5574655", "0.5556825", "0.5542753", "0.549518", "0.54617316", "0.5395273", "0.53816247", "0.53811455", "0.53482443", "0.53440183", "0.53345907", "0.5328822", "0.53269553", "0.53243476", "0.531923", "0.531634...
0.6823138
0
Serialize PushGPRSNS action into buffer.
def serialize(self, buf, offset): super(GPRSActionPushGPRSNS,self).serialize(buf, offset) imsi_bytes = imsi_to_bytes(self.imsi) LOG.debug("push_gprsns.serialize self="+pprint.pformat(self)) ofproto_parser.msg_pack_into("!HxxIHBBHBBBBBBBBBx", buf, offset+8, self.subtype...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize(self, buf, offset):\n super(GPRSAction,self).serialize(buf, offset)\n ofproto_parser.msg_pack_into(\"!H\", buf, offset+8, self.subtype)", "def serialize(self, buf, offset):\n super(GPRSActionPushUDPIP,self).serialize(buf, offset)\n ofproto_parser.msg_pack_into(\"!Hxx4s4s...
[ "0.7202917", "0.66513556", "0.65017486", "0.5595762", "0.54294664", "0.5408272", "0.538384", "0.53148985", "0.5144256", "0.50898355", "0.5052901", "0.504501", "0.5036003", "0.50215316", "0.5021419", "0.4943677", "0.4918316", "0.49109283", "0.48899528", "0.48833308", "0.486870...
0.75911236
0
Serialize PushUDPIP action into buffer.
def serialize(self, buf, offset): super(GPRSActionPushUDPIP,self).serialize(buf, offset) ofproto_parser.msg_pack_into("!Hxx4s4sHH", buf, offset+8, self.subtype, self.da, self.sa, self.dp, self.sp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remote_pushSerialized(pNamespace):", "def serialize(self, buf, offset):\n super(GPRSAction,self).serialize(buf, offset)\n ofproto_parser.msg_pack_into(\"!H\", buf, offset+8, self.subtype)", "def serialize(self, buf, offset):\n super(GPRSActionPushGPRSNS,self).serialize(buf, offset)\n\n...
[ "0.6497084", "0.6239922", "0.60241103", "0.5547205", "0.5528384", "0.5382345", "0.5369563", "0.5329033", "0.52733326", "0.52644396", "0.5262801", "0.52563524", "0.52469605", "0.5224134", "0.52055746", "0.5179876", "0.51671505", "0.5147744", "0.50966257", "0.5049666", "0.50458...
0.7250111
0
Disassemble classes, methods, functions, or code. With no argument, disassemble the last traceback.
def dis(x=None): result = [] if x is None: distb() return if isinstance(x, types.InstanceType): x = x.__class__ if hasattr(x, 'im_func'): x = x.im_func if hasattr(x, 'func_code'): x = x.func_code if hasattr(x, '__dict__'): items = x.__dict__.items(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dis(x=None):\n if x is None:\n distb()\n return\n if isinstance(x, types.InstanceType):\n x = x.__class__\n if hasattr(x, 'im_func'):\n x = x.im_func\n if hasattr(x, 'func_code'):\n x = x.func_code\n if hasattr(x, '__dict__'):\n items = x.__dict__.items(...
[ "0.615091", "0.57982975", "0.57259184", "0.5615364", "0.55653363", "0.55528146", "0.5528827", "0.5510344", "0.54850596", "0.5462706", "0.5446093", "0.5377027", "0.5375238", "0.5354665", "0.5336946", "0.5331819", "0.5316269", "0.5284975", "0.52627206", "0.5256457", "0.5221092"...
0.6127796
1
Disassemble a code object.
def disassemble(co, lasti=-1): result = [] code = co.co_code labels = findlabels(code) linestarts = dict(findlinestarts(co)) n = len(code) i = 0 extended_arg = 0 free = None while i < n: c = code[i] op = ord(c) if i in linestarts: if i > 0: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dis(x=None):\n if x is None:\n distb()\n return\n if isinstance(x, types.InstanceType):\n x = x.__class__\n if hasattr(x, 'im_func'):\n x = x.im_func\n if hasattr(x, 'func_code'):\n x = x.func_code\n if hasattr(x, '__dict__'):\n items = x.__dict__.items(...
[ "0.71114105", "0.70877284", "0.70218164", "0.6603401", "0.6573713", "0.6520851", "0.64638", "0.64221185", "0.6097656", "0.6092416", "0.6090139", "0.60668784", "0.59100395", "0.5841735", "0.5825207", "0.5800588", "0.5720707", "0.5637784", "0.5633453", "0.56093746", "0.5575886"...
0.49318755
42
Detect all offsets in a byte code which are jump targets. Return the list of offsets.
def findlabels(code): labels = [] n = len(code) i = 0 while i < n: c = code[i] op = ord(c) i = i + 1 if op >= HAVE_ARGUMENT: oparg = ord(code[i]) + ord(code[i + 1]) * 256 i = i + 2 label = -1 if op in hasjrel: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def virtualize_jumps(instructions: List[Instruction]):\n jump_targets = {inst.offset: inst for inst in instructions}\n\n for inst in instructions:\n if inst.opcode in dis.hasjabs or inst.opcode in dis.hasjrel:\n for offset in (0, 2, 4, 6):\n if jump_targets[inst.argval + offs...
[ "0.6815735", "0.63695467", "0.62068564", "0.608357", "0.5974745", "0.58431286", "0.58154345", "0.57232815", "0.5539069", "0.5529409", "0.55057067", "0.54852265", "0.53783315", "0.5345074", "0.53169787", "0.52821726", "0.5227918", "0.5122745", "0.50687116", "0.5042281", "0.502...
0.5425844
12
Find the offsets in a byte code which are start of lines in the source. Generate pairs (offset, lineno) as described in Python/compile.c.
def findlinestarts(code): byte_increments = [ord(c) for c in code.co_lnotab[0::2]] line_increments = [ord(c) for c in code.co_lnotab[1::2]] result = [] lastlineno = None lineno = code.co_firstlineno addr = 0 for byte_incr, line_incr in zip(byte_increments, line_increments): if byte_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findlinestarts(code):\n byte_increments = [ord(c) for c in code.co_lnotab[0::2]]\n line_increments = [ord(c) for c in code.co_lnotab[1::2]]\n\n lastlineno = None\n lineno = code.co_firstlineno\n addr = 0\n for byte_incr, line_incr in zip(byte_increments, line_increments):\n if byte_inc...
[ "0.79010475", "0.6719782", "0.66840935", "0.66244036", "0.6570264", "0.6559854", "0.6527472", "0.63632685", "0.6142014", "0.613968", "0.60964674", "0.6068779", "0.6019877", "0.60187554", "0.60158813", "0.6015849", "0.5945159", "0.59155715", "0.58966374", "0.5891578", "0.57854...
0.8088187
0
Create a new screen instance
def __init__(self, *args, **kwargs): # ============================================= INITIALISATION ======================================== if args==(): self.master = Tk(); self.isFrame = False #Permet l'importation de la fenetre en tant que frame self.maste...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_screen(self, name):\n\n State.screen = Screen(name)\n State.save(name)", "def create_screen(self, width, height):", "def setup_screen():\n screen = Screen()\n screen.setup(width=600, height=600)\n screen.bgcolor(\"black\")\n screen.title(\"My Snake Game\")\n screen.trace...
[ "0.7654097", "0.755506", "0.7091903", "0.6914871", "0.681632", "0.6619558", "0.6564944", "0.64268595", "0.6417844", "0.6414711", "0.6413491", "0.6393493", "0.6381011", "0.63344324", "0.6318934", "0.6304597", "0.63033485", "0.6245823", "0.6212464", "0.61814135", "0.616455", ...
0.5475581
99
Return root Tk() instance or Frame. (if created as frame, return frame, else return master)
def getRoot(self): if self.isFrame: return self.frame else: return self.master
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def widget(self) -> tk.Frame:\r\n return self.main_frame", "def get_master_widget(self, top: Widget=None) -> Widget:\n if top is None:\n top = self.c.frame.top\n master = top.leo_master or top\n return master", "def _getTkWdg():\n global g_tkWdg\n if not g_tkWdg:\n ...
[ "0.7010709", "0.69224274", "0.6666383", "0.64904845", "0.6253199", "0.6125347", "0.60954154", "0.6086796", "0.6058302", "0.6010646", "0.5984231", "0.59828", "0.59828", "0.59828", "0.597996", "0.5928371", "0.5913232", "0.5887579", "0.58865285", "0.58780074", "0.58614576", "0...
0.72190964
0
On screen change set the 0,0 point to screen middle
def __reconfig__(self, event): x, y = event.width//2, event.height//2 self.canvas.config(scrollregion=(-x, -y, x, y))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def center(self):\r\n self.centerx = self.screen_rect.centerx \r\n self.centery = self.screen_rect.centery", "def center_mario(self):\n self.rect.midbottom = self.screen_rect.midbottom\n self.x, self.y = float(self.rect.x), float(self.rect.y)", "def move_to_start(self):\n self.pos ...
[ "0.74054617", "0.72713727", "0.704483", "0.70331234", "0.694131", "0.6795583", "0.6794062", "0.67364764", "0.67184234", "0.6668815", "0.65600693", "0.65558183", "0.65026337", "0.6493921", "0.6481472", "0.6475283", "0.6475283", "0.6434488", "0.6377164", "0.6375302", "0.6348706...
0.0
-1
Takes a color and set background color to it
def background(self, color): if isinstance(color, (int, int, int)): pass else: self.canvas.config(background=color)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setBackground(self, color = None):", "def new_background_color(self, color):\n self.canvas.configure(background = check_color(color))", "def _set_background(color):\r\n\r\n return BackgroundColor.get_color(color, add_reset=False)", "def set_background_color(self, color:()):\n self.__back...
[ "0.84380776", "0.8312991", "0.82937986", "0.8156818", "0.80000454", "0.7932432", "0.79028416", "0.7847814", "0.7826653", "0.77300507", "0.76538956", "0.7650514", "0.760169", "0.7572064", "0.7525419", "0.7414635", "0.74000263", "0.7393426", "0.72601366", "0.71698064", "0.71320...
0.803775
4
return True if canvas is empty
def c_empty(self): return self.canvas.find_all()==()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_buffer_empty(self): \n if self.buffer.shape == (0, 5):\n return True\n else:\n return False", "def empty(self):\n return len(self.layers) == 0", "def isBufferEmpty(self):\n return self.ecg_buffer.empty()", "def is_empty(self):\n return le...
[ "0.77237153", "0.76357627", "0.7319792", "0.729806", "0.72561604", "0.72561604", "0.72433543", "0.72324526", "0.7216406", "0.72047114", "0.72007596", "0.7191478", "0.71773005", "0.7171273", "0.7171273", "0.7171273", "0.7171273", "0.7171273", "0.7166267", "0.71652865", "0.7165...
0.8021844
0
remove the last item drawed on canvas
def c_undo(self): try: self.canvas.delete(self.canvas.find_all()[-1]) self.update() return True except: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def undraw(self):\n \n if not self.canvas: return\n if not self.canvas.isClosed():\n #self.canvas.delete(self.id)\n _tkExec(self.canvas.delete, self.id)\n if self.canvas.autoflush:\n #_root.update()\n _tkCall(_root.update)\n ...
[ "0.73996705", "0.7088066", "0.7041244", "0.69705874", "0.6903878", "0.686023", "0.6848304", "0.6843921", "0.68169755", "0.6808803", "0.6757331", "0.67393214", "0.6654051", "0.6647528", "0.66299224", "0.65866596", "0.6546326", "0.65115553", "0.648313", "0.648077", "0.648077", ...
0.7089448
1
create a head navigator
def __init__(self, pos=(0,0), dire = 0): self.initX = self.x = pos[0] self.initY = self.y = pos[1] self.initDir = self.dir = math.radians(dire)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_head(self):\n self.scenes[self.current_scene].add_object(Head())\n self.redraw()", "def create_head(self, head_L=0.5, head_dia=0.5, Ra=150.0, Cm=1.0):\n \n sec_name = 'spine_%d_head' % (self.id)\n head = h.Section(name=sec_name)\n \n ...
[ "0.65449524", "0.6341996", "0.62793964", "0.62405473", "0.62070954", "0.61963516", "0.61963516", "0.61963516", "0.61963516", "0.5889462", "0.5872695", "0.586809", "0.5842509", "0.5801802", "0.57694244", "0.5738347", "0.5738204", "0.5727768", "0.5667257", "0.5653266", "0.56532...
0.0
-1
return pos and dir in tuple as ((x,y), dir)
def get(self): return ((self.x, self.y), self.dir)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pos(self):\n return (self.x, self.y)", "def get_position(self):\n return (self.x_pos, self.y_pos)", "def get_pos(x, y):\r\n return normalize(x) // 2, normalize(y) // 4", "def get_pos(self):\n return (self.x/3, 3**0.5*self.y/3, self.r/3)", "def get_coord_in_direction(self, po...
[ "0.73528427", "0.71841997", "0.6858731", "0.685618", "0.6795162", "0.66718763", "0.66441745", "0.6634082", "0.65731037", "0.65377384", "0.65252733", "0.6496505", "0.6415428", "0.64131814", "0.6409765", "0.64024806", "0.63738513", "0.6352657", "0.6352657", "0.6352657", "0.6322...
0.8125648
0
Makes the point go forward by x pixels in dir
def forward(self, x): self.x = (self.x+(x*(math.cos(self.dir)))) self.y = (self.y+(x*(math.sin(self.dir)))) return (self.x, self.y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_forward(self):\n self.x, self.y = self.compute_positions()", "def forward_character():\r\n set_point(point()+1)", "def forward(self, amount):\n newX = self._x + round(amount * math.sin(math.radians(self._rotation)), 2)\n newY = self._y - round(amount * math.cos(math.radians(self....
[ "0.7059315", "0.6894002", "0.66802937", "0.667741", "0.6607247", "0.6591154", "0.6550676", "0.6534507", "0.64682215", "0.6462259", "0.64148843", "0.6414298", "0.6394705", "0.6365585", "0.63058364", "0.62997663", "0.62896514", "0.62759936", "0.6250437", "0.62298954", "0.619899...
0.7757055
0
Rotate dir by "angle" degrees left
def left(self, angle): self.dir -= math.radians(angle)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def left(self, angle: Degrees):\n prev = self.angle\n self.angle = self.angle - angle\n if self.angle < 0:\n self.angle += 360.0", "def left(self, angle):\r\n self.rotation -= angle", "def left(self, angle):\n self._rotate(angle)", "def right(self, angle):\r\n ...
[ "0.7691436", "0.7684255", "0.75198334", "0.7476443", "0.7369223", "0.733845", "0.7328095", "0.72798973", "0.72391224", "0.7205431", "0.7138064", "0.70180005", "0.69820297", "0.6977292", "0.69525814", "0.6881465", "0.6875089", "0.6872205", "0.6857804", "0.68568367", "0.6847976...
0.8165693
0
Same as left but by angle degrees right
def right(self, angle): self.dir += math.radians(angle)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def right(self, angle):\r\n self.rotation += angle", "def rotate_left_right(self):\n\t\treturn", "def rotate_right_left(self):\n\t\treturn", "def right(self, angle: Degrees):\n prev = self.angle\n self.angle = (self.angle + angle) % 360.0", "def left(self, angle):\n self.right(-...
[ "0.78844625", "0.7836506", "0.7820595", "0.7691349", "0.74083984", "0.7182636", "0.7090768", "0.7068519", "0.7015137", "0.7012727", "0.69686496", "0.69575316", "0.68744814", "0.6862696", "0.67455", "0.67438626", "0.6725787", "0.67244244", "0.6699518", "0.66730887", "0.6668584...
0.794279
0
reset the x, y and dir attributes set them to the given pos at creation (0 by default)
def reset(self): self.x = self.initX self.y = self.initY self.dir= self.initDir
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setPos(self,pos):\n self.Xpos,self.Ypos=pos", "def __init__(self, pos=(0,0), dire = 0):\r\n self.initX = self.x = pos[0]\r\n self.initY = self.y = pos[1]\r\n self.initDir = self.dir = math.radians(dire)", "def set_position(self, x, y):\n self.tx = -x\n self.ty = -y...
[ "0.7370828", "0.71187603", "0.6974645", "0.6962133", "0.69575024", "0.6955875", "0.6885961", "0.6853029", "0.683717", "0.67974186", "0.67750627", "0.6773557", "0.6759446", "0.67568797", "0.67138445", "0.66729176", "0.65741587", "0.6550942", "0.65407187", "0.65238667", "0.6523...
0.73692876
1
check if buffer is empty
def is_empty(self): return self.buff==[]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isBufferEmpty(self):\n return self.ecg_buffer.empty()", "def is_buffer_empty(self): \n if self.buffer.shape == (0, 5):\n return True\n else:\n return False", "def bufferIsFull(self):\n return len(self.buffer) == self.bufferSize", "def is_full(self)...
[ "0.8481212", "0.8138869", "0.81171405", "0.77690786", "0.77690786", "0.77690786", "0.77690786", "0.76674646", "0.74999297", "0.7459257", "0.740098", "0.7346949", "0.7346949", "0.7346949", "0.7346949", "0.7346949", "0.7346949", "0.7346949", "0.73412776", "0.7338832", "0.732243...
0.839308
1
remove an item from buffer and return it
def pop(self): return self.buff.pop(-1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pop(self):\n data = self.buffer.getvalue()\n self.buffer.seek(0)\n self.buffer.truncate()\n return data", "def pop_item(self, index):\n ix, obj = self.items\n if index < len(ix):\n self.d_buffer.pop(ix[index])\n else:\n raise IndexError('Buffer does not ...
[ "0.71644026", "0.7026645", "0.69669145", "0.69313484", "0.6892832", "0.6758544", "0.6690899", "0.66607386", "0.66448075", "0.6554949", "0.64810735", "0.6477074", "0.6459086", "0.64279103", "0.6414904", "0.641293", "0.634858", "0.6341995", "0.6341995", "0.6322717", "0.62970805...
0.7178539
0
add an item to the buffer
def add(self, item): if len(self.buff)==self.size: self.buff.pop(0) self.buff.append(item)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_item(self, item):\n self.items.append(item)\n self.length += 1", "def add_to_bag(self, item):\n self._bag.append(item)", "def push(self, item):\n self._data.append(item)", "def add(self, item):\n self.contents.append(item)", "def push(self, item: Any) -> None:\n ...
[ "0.7763345", "0.7459934", "0.74492633", "0.73964185", "0.7394174", "0.7379183", "0.73638815", "0.7354412", "0.73435956", "0.73304933", "0.73304933", "0.73304933", "0.73304933", "0.73304933", "0.7324654", "0.7315504", "0.7277273", "0.7221862", "0.72122985", "0.7211663", "0.720...
0.861456
0
Return a string representation of a Unreliable Car object.
def __str__(self): return "{}, fuel={}, odometer={} reliability= {}%".format(self.name, self.fuel, self.odometer, self.reliability)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return bytes_to_string(self._bytes)", "def __repr__(self):\n return \"<Carte {}>\".format(self.nom)", "def getData(self):\n\t\t\treturn str(self.car)", "def __str__(self):\n return \"{}, reliability={}\".format(super().__str__(),\n ...
[ "0.6223459", "0.6199881", "0.61724216", "0.6161052", "0.60597825", "0.6058081", "0.5918647", "0.59156865", "0.5902694", "0.5886212", "0.5859517", "0.5857611", "0.58563584", "0.58531994", "0.58398044", "0.5839384", "0.5836821", "0.5835044", "0.5827627", "0.58202", "0.5806698",...
0.60073763
6
Set the name for the slider
def setName(self, name): self.label.setText(name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(self, name):\n self.options['name'] = name", "def set_name(self, name):\n\t\tself.name_ = name", "def set_name(self, name):\n self.settings[\"name\"] = name", "def set_name(self, name):\n self.name = name\n self.labels.change_name(name)", "def set_name(self, name):\...
[ "0.7245413", "0.72082627", "0.7175868", "0.71171975", "0.7107551", "0.7107551", "0.7107551", "0.7107551", "0.7107551", "0.70956314", "0.70956314", "0.70956314", "0.70956314", "0.7082746", "0.70528257", "0.7050544", "0.7021297", "0.6976529", "0.6952984", "0.6952984", "0.693313...
0.75466573
0
Set the range for the value
def setRange(self, range): self.range = range self.slider.setMinimum(0.0) self.slider.setMaximum(100.0) self.spinbox.setRange(self.range[0], self.range[1]) diff = self.range[1] - self.range[0] if diff <= 1: self.spinbox.setSingleStep(0.01)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_range(self, value):\n self.gauge.SetRange(value)", "def range(self, value):\n self.value_range = tuple([float(x) for x in value.split(':')])", "def setRange(self, x_range, y_range):\n pass", "def set_visualization_range(self, start: int, end: int):\n self.__range = (start,...
[ "0.8287461", "0.8165992", "0.7818131", "0.7582979", "0.74553114", "0.7376524", "0.73240227", "0.73078847", "0.71140057", "0.71091056", "0.6999055", "0.69322026", "0.69310826", "0.69090384", "0.6892707", "0.6878438", "0.6857438", "0.6847443", "0.68081653", "0.67797905", "0.677...
0.774587
3
Set the value for the slider and the spinbox
def setValue(self, value): ratio = (value - self.range[0]) / (self.range[1] - self.range[0]) self._changed = False self.slider.setValue(ratio * 100) self._changed = False self.spinbox.setValue(value) self._changed = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetValue(self, val):\n self.spin.SetValue(val)\n self.slider.SetValue(100*(val-self.minval)/(self.maxval-self.minval))", "def valoresSpin():\n try:\n var.ui.spinEdad.setValue(16)\n except Exception as error:\n print('Error valores spin: %s' % str(error))", ...
[ "0.8019232", "0.7288955", "0.7197321", "0.701569", "0.69149137", "0.6797844", "0.6789823", "0.67501086", "0.67231417", "0.6673392", "0.66575426", "0.65889734", "0.6568332", "0.6533974", "0.65043247", "0.64979696", "0.6493205", "0.64843595", "0.6430149", "0.64179516", "0.64022...
0.79265803
1
Initialize with the API Key
def __init__(self, api_key: str): self.session: requests.Session = requests.Session() self.session.headers.update({'Authorization': api_key})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, key=None):\n self._key = key or os.environ['HERE_API_KEY']", "def __init__(self, api_key: str):\n self.api_key = api_key", "def __init__(self, api_key=None):\n self.api_key = api_key", "def __init__(self, api_key):\r\n self.api_key = api_key", "def __init__(se...
[ "0.83547544", "0.8173028", "0.8099521", "0.80829173", "0.79598755", "0.7817079", "0.76180947", "0.7599765", "0.75974107", "0.75172", "0.7434733", "0.73651415", "0.7356161", "0.73084694", "0.72623533", "0.7216557", "0.72150844", "0.72045577", "0.71730375", "0.71643966", "0.716...
0.6655067
58
Send the request to the apex legends api
def _make_request(self, additional_params: dict, new_base_url: str = None) -> list: if new_base_url: url: str = new_base_url params: dict = additional_params else: url: str = self.base_url params: dict = dict(self.base_params, **additional_params) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home():\n\n form = SubmissionForm(request.form)\n\n # Form has been submitted\n if request.method == 'POST' and form.validate():\n\n # Plug in the data into a dictionary object \n # - data from the input form\n # - text data must be converted to lowercase\n data = {\n \...
[ "0.56778884", "0.5207318", "0.51938343", "0.51890177", "0.5182485", "0.50155294", "0.4992753", "0.49824545", "0.49732897", "0.496537", "0.49525046", "0.4940978", "0.49371552", "0.49307173", "0.49263322", "0.4911524", "0.48984024", "0.48923543", "0.48888403", "0.48716536", "0....
0.0
-1
Retrieve a player's uid given they're name and platform
def nametouid(self, player: str, platform: ALPlatform) -> int: new_base_url: str = "https://api.mozambiquehe.re/nametouid?" additional_params = { 'player': player, 'platform': platform.value } result = self._make_request(additional_params=additional_params, new_b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_player(self, name=None, platform=None, uid=None):\n\n results = yield from self.get_players(name=name, platform=platform, uid=uid)\n return results[0]", "def get_player_by_uid(\n self, uid: str, platform: ALPlatform, skip_tracker_rank=False\n ) -> ALPlayer:\n basic_play...
[ "0.6880495", "0.67808336", "0.6429038", "0.6421816", "0.61491287", "0.6111204", "0.6078377", "0.60274875", "0.6017213", "0.5983376", "0.59329355", "0.5932323", "0.5906337", "0.5897506", "0.588646", "0.588646", "0.588646", "0.5871862", "0.5848459", "0.58467454", "0.58465564", ...
0.77609485
0
Retrieve the ALPlayer object populated with data from the api.
def get_player(self, name: str, platform: ALPlatform, skip_tracker_rank=False) -> ALPlayer: basic_player_stats: list = self.basic_player_stats(name, platform, skip_tracker_rank) assert len(basic_player_stats) == 1 event_info: list = self.events( player_name=name, platform...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_player(self) -> Optional[andesite.Player]:\n ...", "async def get_self(self) -> PlayerInfo:\n e = await self.request.request(url=f'https://users.roblox.com/v1/users/authenticated', method='get')\n a = PlayerInfo(player_id=e['id'], request=self.request)\n await a.update()...
[ "0.67135566", "0.6585449", "0.65201277", "0.6420934", "0.64123994", "0.6359362", "0.6288932", "0.6288932", "0.61246634", "0.6101677", "0.6024989", "0.6006343", "0.600117", "0.59851706", "0.5930705", "0.58900714", "0.58649504", "0.5855935", "0.58505946", "0.58325666", "0.58195...
0.59879375
13
Retrieve the ALPlayer object populated with data from the api.
def get_player_by_uid( self, uid: str, platform: ALPlatform, skip_tracker_rank=False ) -> ALPlayer: basic_player_stats: list = self.basic_player_stats_by_uid(uid, platform, skip_tracker_rank) assert len(basic_player_stats) == 1 event_info: list = self.events_by_uid( u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_player(self) -> Optional[andesite.Player]:\n ...", "async def get_self(self) -> PlayerInfo:\n e = await self.request.request(url=f'https://users.roblox.com/v1/users/authenticated', method='get')\n a = PlayerInfo(player_id=e['id'], request=self.request)\n await a.update()...
[ "0.6715293", "0.6585135", "0.65204173", "0.6421293", "0.641435", "0.63592935", "0.6290682", "0.6290682", "0.61249655", "0.61035603", "0.6027695", "0.6007488", "0.6003152", "0.5989015", "0.59873766", "0.5930425", "0.58902603", "0.5865511", "0.58557814", "0.5851137", "0.5833282...
0.53667
49
Adds the given player's UUID to the list of tracked players
def add_player_by_uid(self, player_uid: int, platform: ALPlatform) -> list: return self.events_by_uid(str(player_uid), platform=platform, action=ALAction.ADD)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_player(self, player):\n\t\tself.players.append(player)", "def addPlayer(self, playerID, playerElo, index):\n\n self.idList.insert(index, playerID)\n self.eloList.insert(index, playerElo)", "def add_player(self, player):\r\n self.players[player.id] = copy.copy(player)\r\n ret...
[ "0.71620226", "0.66145873", "0.6583641", "0.6421349", "0.6377049", "0.62434125", "0.62323105", "0.61883676", "0.6101932", "0.5872413", "0.58420855", "0.583317", "0.5813686", "0.57830197", "0.5776576", "0.57275444", "0.5726717", "0.57026947", "0.5688031", "0.56804264", "0.5636...
0.7141295
1
Query the server for the given player / platform and returns a dictionary of their stats.
def basic_player_stats( self, player_name: str, platform: ALPlatform, skip_tracker_rank=False) -> list: params: dict = {'platform': platform.value, 'player': player_name} if skip_tracker_rank: params.update({'skipRank': True}) return self._make_req...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_players_stats():\n players_scraper = PlayerStatsScraper(API_URL, API_HEADERS)\n result = players_scraper.save_objects()\n return result", "def get_players(self, name=None, platform=None, uid=None):\n\n if name is None and uid is None:\n raise TypeError(\"name and uid are both...
[ "0.62172526", "0.6088156", "0.59878635", "0.5970412", "0.5903543", "0.58191293", "0.57570857", "0.57197016", "0.5701975", "0.5647399", "0.5639708", "0.5634583", "0.560696", "0.55971074", "0.55927783", "0.5581158", "0.5577641", "0.5576214", "0.5568722", "0.55606216", "0.555142...
0.60714185
2
Query the server for the given player / platform and returns a dictionary of their stats.
def basic_player_stats_by_uid( self, uid: str, platform: ALPlatform, skip_tracker_rank=False) -> list: params: dict = {'platform': platform.value, 'uid': uid} if skip_tracker_rank: params.update({'skipRank': True}) return self._make_request(additio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_players_stats():\n players_scraper = PlayerStatsScraper(API_URL, API_HEADERS)\n result = players_scraper.save_objects()\n return result", "def get_players(self, name=None, platform=None, uid=None):\n\n if name is None and uid is None:\n raise TypeError(\"name and uid are both...
[ "0.6216425", "0.6088078", "0.6069298", "0.5985717", "0.5969447", "0.59026337", "0.5817098", "0.5758183", "0.572027", "0.5703029", "0.56465614", "0.56404275", "0.5634473", "0.56056285", "0.5597346", "0.559465", "0.55787355", "0.5577964", "0.5575017", "0.5568511", "0.55583", ...
0.53314966
36
Query the server for the given player / platform and return a list of their events
def events(self, player_name: str, platform: ALPlatform, action: ALAction) -> list: params: dict = { 'platform': platform.value, 'player': player_name, 'history': 1, 'action': action.value } return self._make_request(additional_params=params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def do_playerlist():\n\n download = urllib.request.urlopen(server_api2)\n data = json.loads(download.read())\n player_list = []\n try:\n for i in data['players']['sample']:\n player_list.append(i['name'])\n except KeyError:\n if data['on...
[ "0.59362257", "0.5845402", "0.5651614", "0.5641668", "0.5631598", "0.5601766", "0.5549841", "0.5540904", "0.54937965", "0.5475101", "0.54540646", "0.54217774", "0.53965926", "0.5361535", "0.5313909", "0.5260443", "0.52544105", "0.5245204", "0.5244015", "0.51975507", "0.518726...
0.73692006
0
Query the server for the given player's UID / platform and return a list of their events
def events_by_uid(self, uid: str, platform: ALPlatform, action: ALAction) -> list: params: dict = { 'platform': platform.value, 'uid': uid, 'history': 1, 'action': action.value } return self._make_request(additional_params=params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def events(self, player_name: str, platform: ALPlatform, action: ALAction) -> list:\n params: dict = {\n 'platform': platform.value,\n 'player': player_name,\n 'history': 1,\n 'action': action.value\n }\n return self._make_request(additional_params=p...
[ "0.69545186", "0.60738385", "0.59118974", "0.58794445", "0.5730681", "0.5725648", "0.5697164", "0.55760676", "0.5558568", "0.5488674", "0.5450456", "0.54442245", "0.5414193", "0.53970325", "0.53413105", "0.52829474", "0.5251254", "0.52501976", "0.5238327", "0.51965046", "0.51...
0.6309805
1
Query the server for the origin user and returns Origin UID, real username, PID and avatar for a given username
def get_player_origin(self, player_name: str, show_all_hits: bool = False) -> list: new_base_url: str = "https://api.mozambiquehe.re/origin?" new_base_url += f"&player={player_name}" if show_all_hits: new_base_url += "&showAllHits" return self._make_request(additional_params=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def requestAvatarId(self, credentials):\n return credentials.username", "def getPublicUserInfo(self, username):\r\n self.send_getPublicUserInfo(username)\r\n return self.recv_getPublicUserInfo()", "def get_remote_user(self, username):\n return 'ec2-user'", "def getPublicUserInfo(self, use...
[ "0.63479054", "0.63192934", "0.6289649", "0.62150705", "0.61417323", "0.6129159", "0.61252254", "0.5998344", "0.5976469", "0.5959038", "0.5932654", "0.5866114", "0.58442104", "0.5839441", "0.57970256", "0.57858187", "0.575703", "0.575703", "0.5718741", "0.57129365", "0.568976...
0.0
-1
Counts distance between two points.
def distance(self, other): return hypot(self.x - other.x, self.y - other.y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distanceTwoPoints(self, A, B):\r\n # productive\r\n # used by addNeedleToScene\r\n if frequent: profprint()\r\n length = ((A[0] - B[0]) ** 2 + (A[1] - B[1]) ** 2 + (A[2] - B[2]) ** 2) ** 0.5\r\n return length", "def distanceTwoPoints(self,A,B):\n #productive\n # used by addNeedleToScene\...
[ "0.73020613", "0.72713035", "0.7099387", "0.7076943", "0.70498616", "0.7037172", "0.6895176", "0.6892628", "0.6842358", "0.68416506", "0.68352175", "0.6799305", "0.67889106", "0.6777898", "0.67650604", "0.67611796", "0.6741186", "0.6736605", "0.6735865", "0.6714414", "0.67127...
0.0
-1
return a dictionary associating numeric_index > filepath
def find_all_infilepaths(in_dir): workdir = os.getcwd() os.chdir(in_dir) infiles_paths = dict() for infilename in glob.glob("[0-9]*_[0-9]*_[0-9]*.hdf5"): pos = infilename.split('_') pos[-1] = pos[-1].split('.')[0] pos = tuple(list(map(lambda s: int(s), pos))) num_pos = _...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_for_file (self):\n return self.family + '_' + self.filename # index for row of dataframe", "def get_header_indices(filepath):\n\theaders = get_header_list(filepath, sort=False)\n\treturn {h: i for i, h in enumerate(headers)}", "def _create_img_id_to_idx(self):\n with h5py.File(s...
[ "0.6225283", "0.61750776", "0.6064329", "0.6012616", "0.6008532", "0.6007092", "0.59824514", "0.58925724", "0.58880967", "0.588415", "0.587305", "0.5776976", "0.57705516", "0.57632804", "0.57622796", "0.5749247", "0.57479435", "0.57382214", "0.57237583", "0.5707313", "0.56905...
0.0
-1
Get arguments from console command.
def get_arguments(): parser = argparse.ArgumentParser(description="TODO") parser.add_argument('config_filepath', action='store', type=str, help='Path to configuration file containing paths of third parties libraries, projects, data directories, etc. See README for more informatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cli_arguments(self):\n pass", "def args(self):\n return self.cmd_args", "def command_args(self):\n return self._command_args", "def get_command_line_args():\n \n parser = argparse.ArgumentParser()\n parser.add_argument('-s', '--symbol', help='symbol query')\n...
[ "0.7695447", "0.7324153", "0.7260132", "0.7133265", "0.69353735", "0.68480676", "0.68203104", "0.67432755", "0.67044276", "0.66875386", "0.66205513", "0.65891606", "0.6538183", "0.6523511", "0.6522104", "0.6503042", "0.64861345", "0.647936", "0.6476478", "0.6474715", "0.64595...
0.0
-1