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
Add a given link, spotify uri or search query to the playlist.
async def add(self, ctx, query): if ctx.guild is None: await ctx.reply("This command can only be used in a server, not in DMs.") raise commands.CommandError("Invoker not in a guild.") if ctx.voice_client is None or ctx.voice_client.channel is None: await ctx.reply(f"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_song_to_playlist(self):\n #populate our songs dictionary\n self.get_liked_videos()\n\n #collect all of uri\n uris = []\n for song,info in self.all_song_info.items():\n uris.append(info[\"spotify_uri\"])\n\n #create a new playlist\n playlist_id = s...
[ "0.6873652", "0.6739851", "0.66961676", "0.659382", "0.6515537", "0.63964", "0.63560104", "0.6281478", "0.6257828", "0.62303734", "0.6160009", "0.6157226", "0.615214", "0.60442173", "0.60360575", "0.60338485", "0.5958648", "0.5953574", "0.5943431", "0.59420663", "0.59142315",...
0.66718644
3
Clear the room playlist
async def clear(self, ctx): if ctx.voice_client is None or ctx.voice_client.channel is None: await ctx.reply(f"I am not in a voice channel, invite me first with `{self.bot_config['prefix']}join`.") raise commands.CommandError("Bot not connected to a voice channel.") if ctx.autho...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_playlist(self, playlist_name):\n print(\"clears_playlist needs implementation\")", "async def async_clear_playlist(self):\n await self._player.async_clear_playlist()", "def clear_playlist(self, playlist_name):\n if playlist_name.upper() in self.playlist.keys():\n self....
[ "0.7909573", "0.7636616", "0.73560184", "0.73386073", "0.717823", "0.7138321", "0.70262676", "0.69797724", "0.6840525", "0.67152655", "0.63804007", "0.6246091", "0.6234555", "0.6192164", "0.61881953", "0.6153968", "0.6127805", "0.61052036", "0.60422516", "0.6005125", "0.60042...
0.6908344
8
Show the currently playing song
async def now_playing(self, ctx): if ctx.guild is None: await ctx.reply("This command can only be used in a server, not in DMs.") raise commands.CommandError("Invoker not in a guild.") if ctx.voice_client is None or ctx.voice_client.channel is None: await ctx.reply(f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_playing(self):\n\n print(\"show_playing needs implementation\")", "def show_playing(self):\n if self.is_playing() is not None:\n currplayed = self.is_playing()._tags\n print(\"Currently playing: {} ({}) [{}]\".format(self.is_playing()._title, self.is_playing()._video_...
[ "0.7722673", "0.7453179", "0.7398915", "0.7375667", "0.7312139", "0.7251846", "0.723973", "0.7140814", "0.69674504", "0.68361825", "0.68276167", "0.66068745", "0.6597223", "0.64924115", "0.64774835", "0.6453549", "0.644456", "0.64071244", "0.63893205", "0.6368869", "0.6358669...
0.61242604
33
Start playing the room playlist
async def start(self, ctx): if ctx.guild is None: await ctx.reply("This command can only be used in a server, not in DMs.") raise commands.CommandError("Invoker not in a guild.") if ctx.voice_client is None or ctx.voice_client.channel is None: await ctx.reply(f"I am ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self):\n gv.logger.info(\"Started playing new playlist\")\n thread = Thread(target=self.run, args=())\n thread.daemon = True\n self.thread = thread\n thread.start()", "def play_next(self):\n self.stop()\n play_flag = True\n if self.playlist:\n ...
[ "0.74985003", "0.69871664", "0.6981441", "0.68703204", "0.67883384", "0.67791086", "0.67515475", "0.67425054", "0.66611314", "0.6573882", "0.6475358", "0.6315773", "0.6276613", "0.62280256", "0.6226545", "0.6223181", "0.6217674", "0.61872447", "0.6159366", "0.613671", "0.6131...
0.66087157
9
To calculate the present value.
def P_Tn(self, yn:float, n:int) -> float: return 1 / ((1 + yn * 0.5) **n)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value(self) -> float:", "def calc(self):\n return None", "def get_value(self):\r\n return 0", "def value(self) -> float:\n ...", "def value(self) -> float:\n ...", "def value(self) -> float:\n ...", "def value(self):\n return 0", "def calculate(self) -> f...
[ "0.7384616", "0.7147055", "0.7130279", "0.7118198", "0.7118198", "0.7118198", "0.69997495", "0.69863176", "0.69126004", "0.6701968", "0.6676662", "0.6659527", "0.6606538", "0.66004246", "0.65992", "0.65992", "0.65961075", "0.6540622", "0.6518207", "0.6514551", "0.64674115", ...
0.0
-1
If we want to get yield to maturity we must make solve the equation and the analytical solution is a little complex so we decide to use bisection methed to solve the equation. And this is the funtion we want to make it equal 0 and if we solve it we can get Yield to maturity.
def f(self, yn: float, n: int, Rmn: dict, ytm: dict) -> float: numerator = 1 - Bootstrapping.P_Tn(self,yn, n) denominator = 0 for i in ytm.keys(): denominator += 0.5 * Bootstrapping.P_Tn(self,ytm[i], i) ym = ytm[list(ytm.keys())[-1]] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bisezione(f,a,b,toll=10**-5):\n m = (a+b)/2\n f_m = f(m)\n while abs(f_m) > toll:\n if f(a)*f_m < 0:\n b = m\n elif f(b)*f_m < 0:\n a = m\n elif f_m == 0:\n print(\"Trovata solzione esatta\")\n return m\n else:\n print(...
[ "0.6327313", "0.6063239", "0.6062176", "0.59563226", "0.5932767", "0.5855101", "0.58416086", "0.5822899", "0.5821857", "0.5800906", "0.58003914", "0.5794121", "0.5782499", "0.57809675", "0.57791865", "0.5744518", "0.5727213", "0.5673561", "0.5672811", "0.5665442", "0.56600136...
0.0
-1
This is the bisection and by setting the low bound,up bound and the error we can solve the equaiton and get the yield to maturity.
def bisection(self, low_bound: float, up_bound: float, epsilon: float, n: int, Rmn: dict, ytm: dict) -> float: for i in range(100): y = (low_bound + up_bound) / 2 if abs(Bootstrapp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def brentq(x1, b, U, gamma, idens, ixmom, iymom, iener,\n TOL=1.e-6, ITMAX=100):\n\n # initialize variables\n a = x1\n c = 0.0\n d = 0.0\n fa = f(a, U, gamma, idens, ixmom, iymom, iener)\n fb = f(b, U, gamma, idens, ixmom, iymom, iener)\n fc = 0.0\n\n # root found\n if fa * fb ...
[ "0.63730067", "0.61498183", "0.5975701", "0.5962321", "0.59481627", "0.59143233", "0.5898006", "0.5895016", "0.5864597", "0.5854654", "0.5833312", "0.58214873", "0.5797121", "0.5793564", "0.577962", "0.57187355", "0.56916434", "0.5665881", "0.56550866", "0.5651986", "0.563628...
0.5847501
10
This function will get the whole dictionary of ytm. Here we set the low bound 0.001 and the high boung 0.1, the episilon 1e10.
def get_ytm_dict(self): ytm=self.ytm for term in self.Rmn.keys(): ytm = Bootstrapping.bisection(self,0.001, 0.1, 1e-10, 2 * term, self.Rmn, ytm) return ytm
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yvals(self):\n return self.germs", "def yvals(self):\n return self.germs", "def bisection(self,\n low_bound: float,\n up_bound: float,\n epsilon: float,\n n: int,\n Rmn: dict,\n ytm: dict) ->...
[ "0.5608724", "0.5608724", "0.54514956", "0.52048004", "0.51582503", "0.51236594", "0.5118129", "0.511333", "0.51034176", "0.49981782", "0.49807763", "0.49765843", "0.4958691", "0.49550095", "0.49406016", "0.4939153", "0.49358478", "0.49011344", "0.4895696", "0.48733735", "0.4...
0.715156
0
This funtion is to get the dataframe of yield to maturity and discount rate value.
def get_ytm_discount_data(self): ytm=Bootstrapping.get_ytm_dict(self) data = pd.DataFrame() for i in ytm.keys(): data.loc[i / 2, 'Yield to maturity'] = ytm[i] data.loc[i / 2, 'discount_rate'] = Bootstrapping.P_Tn(self,ytm[i], i) return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_treasury_yield(interval: str, maturity: str) -> pd.DataFrame:\n d_interval = {\"d\": \"daily\", \"w\": \"weekly\", \"m\": \"monthly\"}\n d_maturity = {\"3m\": \"3month\", \"5y\": \"5year\", \"10y\": \"10year\", \"30y\": \"30year\"}\n\n url = f\"https://www.alphavantage.co/query?function=TREASURY_Y...
[ "0.6506243", "0.61616105", "0.5973585", "0.59033316", "0.57318133", "0.5705728", "0.568607", "0.56644547", "0.5616574", "0.55478776", "0.55426395", "0.5541117", "0.5517417", "0.55045354", "0.55006254", "0.5484498", "0.54590946", "0.54367566", "0.5420372", "0.53916895", "0.539...
0.6999018
0
Because get_ytm_dict will get a dictionary and get_ytm_discount_data will get dataframe but we want a function that we can input the term and then it give the yield to maturity. So this is that function.
def get_ytm_function(self,x: float): ytm = Bootstrapping.get_ytm_dict(self) if x<1: return ytm[1] if x>=1 and x<=4: return ytm[1]+((ytm[4]-ytm[1])/(4-1))*(x-1) elif x>4 and x<=6: return ytm[4]+((ytm[6]-ytm[4])/(6-4))*(x-4) elif x>6 and x<=8: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_ytm_discount_data(self):\n ytm=Bootstrapping.get_ytm_dict(self)\n data = pd.DataFrame()\n for i in ytm.keys():\n data.loc[i / 2, 'Yield to maturity'] = ytm[i]\n data.loc[i / 2, 'discount_rate'] = Bootstrapping.P_Tn(self,ytm[i], i)\n return data", "def get...
[ "0.6612359", "0.6315614", "0.5558291", "0.5326362", "0.53192323", "0.522467", "0.5178853", "0.51154274", "0.50927544", "0.50200963", "0.50007993", "0.49872208", "0.49824378", "0.49748078", "0.49716398", "0.4961965", "0.4944351", "0.4918494", "0.49126098", "0.49069852", "0.490...
0.51852024
6
Because get_ytm_discount_data will get dataframe but we want a function that we can input the term and then it give the discount rate. So this is that function. parameter
def get_discount_rate_function(self,x: float): discount_rate = Bootstrapping.P_Tn(self,Bootstrapping.get_ytm_function(self,x), x) return discount_rate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_ytm_discount_data(self):\n ytm=Bootstrapping.get_ytm_dict(self)\n data = pd.DataFrame()\n for i in ytm.keys():\n data.loc[i / 2, 'Yield to maturity'] = ytm[i]\n data.loc[i / 2, 'discount_rate'] = Bootstrapping.P_Tn(self,ytm[i], i)\n return data", "def get...
[ "0.66182184", "0.6007628", "0.5676188", "0.5622315", "0.5424499", "0.53397036", "0.53334564", "0.5288079", "0.52863705", "0.5247682", "0.5206629", "0.52029026", "0.51883996", "0.51745844", "0.51648027", "0.5149084", "0.5111866", "0.5102101", "0.5075223", "0.5066884", "0.50492...
0.6481532
1
This function is used to draw the zerocoupon bond yield curve.
def draw_yield_curve(self): data = Bootstrapping.get_ytm_discount_data(self) fig = plt.figure(figsize=[10, 6]) ax = fig.add_subplot(1, 1, 1) ax.plot(data['Yield to maturity']) ax.set_xlabel('year') ax.set_ylabel('rate') ax.set_title('Zero-coupon yield curve') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_discount_curve(self):\n data=Bootstrapping.get_ytm_discount_data(self)\n fig = plt.figure(figsize=[10, 6])\n ax = fig.add_subplot(1, 1, 1)\n ax.plot(data['discount_rate'])\n ax.set_xlabel('Term')\n ax.set_ylabel('value')\n ax.set_title('Discount Curves')\n ...
[ "0.63446325", "0.5719501", "0.54202026", "0.53648794", "0.5319175", "0.53174984", "0.53135353", "0.53053623", "0.53045815", "0.5267609", "0.52351516", "0.52285373", "0.5218341", "0.5210886", "0.5180416", "0.5146694", "0.51120013", "0.50831884", "0.5078383", "0.5071085", "0.50...
0.7843739
0
This function is used to draw the zerocoupon bond yield curve.
def draw_discount_curve(self): data=Bootstrapping.get_ytm_discount_data(self) fig = plt.figure(figsize=[10, 6]) ax = fig.add_subplot(1, 1, 1) ax.plot(data['discount_rate']) ax.set_xlabel('Term') ax.set_ylabel('value') ax.set_title('Discount Curves') plt.sh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_yield_curve(self):\n data = Bootstrapping.get_ytm_discount_data(self)\n fig = plt.figure(figsize=[10, 6])\n ax = fig.add_subplot(1, 1, 1)\n ax.plot(data['Yield to maturity'])\n ax.set_xlabel('year')\n ax.set_ylabel('rate')\n ax.set_title('Zero-coupon yield ...
[ "0.7844901", "0.57200205", "0.5420235", "0.5364439", "0.531805", "0.5317455", "0.5312386", "0.5305822", "0.5303851", "0.52682483", "0.52347237", "0.52280426", "0.5218469", "0.52114904", "0.5181944", "0.51469964", "0.51128083", "0.508417", "0.5077651", "0.50719845", "0.5051411...
0.6344681
1
Create logger. Output to file and console.
def __init__(self, logfilename='logfile.log'): # Create file handler (output to file) # "%(asctime)s - %(name)s - %(levelname)s - %(message)s" # "[%(asctime)s %(process)d] %(message)s" # fileFormatter = logging.Formatter("%(asctime)s : %(threadName)-12.12s : %(levelname)-5.5s : %(message...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_logger():\r\n global logger\r\n logger = logging.getLogger(logger_name)\r\n\r\n formatter = logging.Formatter(fmt='%(asctime)s %(levelname)s %(message)s')\r\n \r\n handler = logging.StreamHandler()\r\n handler.setFormatter(formatter)\r\n logger.addHandler(handler)\r\n \r\n ret...
[ "0.7532494", "0.742732", "0.7345848", "0.73430514", "0.7258522", "0.7255411", "0.72414166", "0.7216692", "0.72023225", "0.71971697", "0.71704555", "0.7163259", "0.71248853", "0.71200293", "0.7105047", "0.70947397", "0.70875716", "0.70841235", "0.7044458", "0.70319575", "0.699...
0.0
-1
test that a 'unauthorized' response (http 401) is returned when doing a request with an incorrect api key
def test_filter_wrong_api_key_expect_unauthorized_response(session_stream, path): session_stream.headers.update({'api-key': 'wrong key'}) params = {LOCATION_CONCEPT_ID: geo.stockholm} expected_http_code = requests.codes.unauthorized try: get_stream_expect_error(session_stream, params, expected_h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_incorrect_api_key(self):\n with self.subTest(\"Missing API key\"):\n response = self.client.get(\n self.url, HTTP_AUTHORIZATION=f\"ApiKey {self.web_user.username}:\"\n )\n self.assertEqual(response.status_code, 401)\n\n with self.subTest(\"Miss...
[ "0.82850015", "0.8072468", "0.8039055", "0.8037536", "0.79810125", "0.796687", "0.79512525", "0.79512525", "0.7869238", "0.7855653", "0.7835723", "0.7777454", "0.7749252", "0.76528376", "0.76375806", "0.7606968", "0.7559815", "0.75589436", "0.7528576", "0.7527643", "0.7497882...
0.7447739
24
test that a 'bad request' response (http 400) is returned when doing a request without date parameter
def test_filter_without_date_expect_bad_request_response(session_stream, type, value): get_stream_expect_error(session_stream, params={type: value}, expected_http_code=requests.codes.bad_request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_GET_startdate_error(self):\n self.register_user()\n result = self.login_user()\n access_token = json.loads(result.data.decode())['access_token']\n res = self.client().post('/expenses/', headers=dict(Authorization=\"Bearer \" + access_token), data=self.expense)\n self.ass...
[ "0.77888143", "0.7680683", "0.757144", "0.75589854", "0.7493942", "0.74357533", "0.7431725", "0.74137115", "0.73940873", "0.7284682", "0.72209555", "0.7100021", "0.7095673", "0.7079107", "0.7077526", "0.7027701", "0.7026709", "0.7008976", "0.6985253", "0.6983918", "0.6933023"...
0.69333655
20
compare correct concept_id with a lower case version
def test_filter_with_lowercase_concept_id(session_stream, work, expected_number_of_hits): params = {'date': DAWN_OF_TIME, OCCUPATION_CONCEPT_ID: work} get_stream_check_number_of_results(session_stream, expected_number_of_hits, params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_id_case_without_prefix(self):\n td = self.create_testdata()\n res = self.filter([unicode(td[\"cv2\"].case.id)])\n\n self.assertEqual(res.get().name, \"CV 2\")", "def test_correct_trait_found_by_case_insensitive_name(self):\n query_trait = self.source_traits[0]\n url = ...
[ "0.60297316", "0.5839952", "0.5839952", "0.5752094", "0.57278955", "0.5570918", "0.5554302", "0.5506492", "0.54555273", "0.53079313", "0.5271894", "0.526881", "0.52042997", "0.52042997", "0.51996195", "0.51992166", "0.51965636", "0.51938576", "0.5193501", "0.5171169", "0.5150...
0.5584447
5
Check that param 'arbeteutomlands' returns http 400 BAD REQUEST for stream
def test_work_abroad(session, abroad): get_stream_expect_error(session, {ABROAD: abroad}, expected_http_code=requests.codes.bad_request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_bad_request(self):\n self._error_test(fitbit_exceptions.HTTPBadRequest)", "def test_bad_parameter(self):\n\n request = service.get_request('POST', {u'bad_parameter': []})\n x = self.start_request_tests(request)\n self.assertTrue(x.status_code == 400)\n m = x.json().get...
[ "0.637701", "0.6185492", "0.60905147", "0.6067267", "0.6013375", "0.5976316", "0.59702724", "0.5826165", "0.58236337", "0.57347447", "0.5724405", "0.5722734", "0.5716697", "0.56791025", "0.5668877", "0.5666924", "0.56155807", "0.56111395", "0.55984074", "0.55952317", "0.55887...
0.6079605
3
Test create maze with properties.
def test_create_maze(self): maze = Maze(4, 4) self.assertEqual(maze.row_count, 4) self.assertEqual(maze.col_count, 4) self.assertEqual(maze.size, 16) self.assertTrue(isinstance(maze.entrance, list)) self.assertTrue(isinstance(maze.exit, list))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testMazeExists(self):\n pass", "def testMazeExists(self):\n\n pass", "def test_ctor(self):\r\n cols = 5\r\n rows = 5\r\n maze = Maze(rows, cols)\r\n\r\n self.assertEqual(maze.num_cols, cols)\r\n self.assertEqual(maze.num_rows, rows)\r\n self.assertEqu...
[ "0.74951434", "0.74755657", "0.7341924", "0.7205087", "0.7166509", "0.7000492", "0.6800368", "0.65627474", "0.6447256", "0.6320677", "0.63178104", "0.6252976", "0.6162495", "0.6116535", "0.60331357", "0.60119486", "0.59742117", "0.59120816", "0.59075636", "0.5906564", "0.5855...
0.78807545
0
Test create maze gets type error with noninteger.
def test_create_maze_non_integer(self): try: _ = Maze('I am not an integer', 4) self.assertEqual(True, False, 'should not have got here: ' 'maze created with non-integer index.') except TypeError: self.assertEqual(True, True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_maze(self):\n maze = Maze(4, 4)\n self.assertEqual(maze.row_count, 4)\n self.assertEqual(maze.col_count, 4)\n self.assertEqual(maze.size, 16)\n self.assertTrue(isinstance(maze.entrance, list))\n self.assertTrue(isinstance(maze.exit, list))", "def testMaze...
[ "0.7993788", "0.72578806", "0.72363365", "0.7099285", "0.7063041", "0.6861209", "0.68212044", "0.65768915", "0.6436121", "0.63770556", "0.6309218", "0.608427", "0.6020378", "0.5984016", "0.5975598", "0.5941816", "0.58987296", "0.58849007", "0.5789791", "0.57807946", "0.576970...
0.8117515
0
Test create maze gets type error with float.
def test_create_maze_with_float(self): try: _ = Maze(4.0, 4) self.assertEqual(True, False, 'should not have got here: ' 'maze created with float index.') except TypeError: self.assertEqual(True, True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_maze(self):\n maze = Maze(4, 4)\n self.assertEqual(maze.row_count, 4)\n self.assertEqual(maze.col_count, 4)\n self.assertEqual(maze.size, 16)\n self.assertTrue(isinstance(maze.entrance, list))\n self.assertTrue(isinstance(maze.exit, list))", "def test_cre...
[ "0.7523571", "0.6837212", "0.66139513", "0.6609147", "0.6563737", "0.6271226", "0.62683207", "0.6265946", "0.6129293", "0.60552156", "0.5967328", "0.5800113", "0.5795364", "0.5794256", "0.57674694", "0.5756952", "0.57135016", "0.56914604", "0.5667238", "0.5618049", "0.5579303...
0.83329034
0
Test maze creates entrance as list of two integers.
def test_create_entrance_is_list(self): maze = Maze(4, 4) self.assertTrue(isinstance(maze.entrance[0], int)) self.assertTrue(isinstance(maze.entrance[1], int))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_entrance_is_list(self):\n maze = Maze(4, 4)\n self.assertTrue(isinstance(maze.exit[0], int))\n self.assertTrue(isinstance(maze.exit[1], int))", "def init_maze(width: int, height: int) -> list[int]:\n return [0] * width * height", "def mazeTest():\r\n\tmyMaze = Maze()\r\n...
[ "0.76696694", "0.6474169", "0.64016163", "0.63518304", "0.63174134", "0.63174134", "0.62914747", "0.62676936", "0.6032349", "0.59382766", "0.59230834", "0.5911689", "0.58982056", "0.58766043", "0.5766839", "0.57373405", "0.57052636", "0.5697641", "0.5694257", "0.5687101", "0....
0.7438955
1
Test mazes creates exit as list of two integers
def test_create_entrance_is_list(self): maze = Maze(4, 4) self.assertTrue(isinstance(maze.exit[0], int)) self.assertTrue(isinstance(maze.exit[1], int))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_exit_reached(minimum: int, maximum: int) -> list:\n the_exit = [minimum - 1, maximum - 1]\n return the_exit", "def test_list_int(self):\n result = mul(2, 4)\n self.assertEqual(result, 8)", "def test_list_int2(self):\n inp = [(0, 0), (10, 1), (1, 2)]\n expected = 19\n...
[ "0.62346864", "0.60159165", "0.57737637", "0.5748641", "0.5747704", "0.57114", "0.56058764", "0.56034714", "0.5573308", "0.5560567", "0.5557499", "0.55546963", "0.55476743", "0.55161655", "0.5508791", "0.5507034", "0.5499264", "0.54853886", "0.5477175", "0.54638946", "0.54615...
0.6633522
0
Test maze creates random indices between 0 and len(row) and 0 and len(column).
def test_get_random_indices_in_range(self): maze = Maze(10, 10) for test in range(1000): position = maze._Maze__get_random_indices() self.assertTrue(-1 < position[0] < 10) self.assertTrue(-1 < position[1] < 10)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_maze_created_traversed_from_indices(self):\n maze = Maze(100, 100)\n\n for test in range(20):\n self.assertTrue(maze.can_reach_exit([random.randint(0, 99),\n random.randint(0, 99)]))", "def testMazeExists(self):\n\n pass", ...
[ "0.76525325", "0.69647396", "0.69635177", "0.6832171", "0.6793682", "0.6792029", "0.6658967", "0.66427785", "0.66094947", "0.65932906", "0.6544248", "0.6461002", "0.6455614", "0.6413605", "0.63796437", "0.63742", "0.6348787", "0.6320797", "0.63205516", "0.6318752", "0.6299780...
0.7503006
1
Test maze creates random entrance and exit with enough distance between them. 10 x 10 maze, distance should never be less than 9.
def test_indices_distance(self): maze = Maze(10, 10) for test in range(1000): self.assertTrue( (abs(maze.entrance[0] - maze.exit[0]) + abs(maze.entrance[1] - maze.exit[1])) >= 9)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_maze_created_traversed_from_indices(self):\n maze = Maze(100, 100)\n\n for test in range(20):\n self.assertTrue(maze.can_reach_exit([random.randint(0, 99),\n random.randint(0, 99)]))", "def mazeTest():\r\n\tmyMaze = Maze()\r\n\tmyM...
[ "0.7701256", "0.7275362", "0.69734615", "0.6947883", "0.69432425", "0.68207437", "0.6741944", "0.66318315", "0.63993394", "0.6284988", "0.62773734", "0.62601644", "0.62576604", "0.62330973", "0.6180996", "0.61512756", "0.61509037", "0.6121502", "0.609569", "0.6069404", "0.602...
0.7088978
2
Test that a maze exit can be can be found at creation using private method __verify_exit_path.
def test_maze_created_can_be_traversed(self): maze = Maze(100, 100) self.assertTrue(maze._Maze__verify_exit_path())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testMazeExists(self):\n pass", "def testMazeExists(self):\n\n pass", "def test_maze_exit_pointers_are_none(self):\n maze = Maze(100, 100)\n\n row, col = maze.exit\n if maze.grid[row][col].up:\n maze.grid[row][col].up.down = None\n if maze.grid[row][col]....
[ "0.7718954", "0.7711811", "0.7170441", "0.6457077", "0.64257324", "0.63298804", "0.6325129", "0.6186493", "0.6110823", "0.60940695", "0.6087242", "0.5893084", "0.58477277", "0.57537746", "0.56882125", "0.56534946", "0.5650642", "0.5640697", "0.56240755", "0.56226784", "0.5569...
0.7800023
0
Test that a maze exit can be found at creation from random positions.
def test_maze_created_traversed_from_indices(self): maze = Maze(100, 100) for test in range(20): self.assertTrue(maze.can_reach_exit([random.randint(0, 99), random.randint(0, 99)]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testMazeExists(self):\n pass", "def testMazeExists(self):\n\n pass", "def test_maze_created_can_be_traversed(self):\n maze = Maze(100, 100)\n\n self.assertTrue(maze._Maze__verify_exit_path())", "def test_get_random_indices_in_range(self):\n maze = Maze(10, 10)\n\n ...
[ "0.7603047", "0.75861", "0.70993465", "0.70667547", "0.68742085", "0.6755556", "0.67491025", "0.67421407", "0.67201865", "0.6700757", "0.66145056", "0.6428856", "0.630201", "0.61533684", "0.6113033", "0.60697323", "0.6057306", "0.599535", "0.59817874", "0.59677285", "0.596192...
0.81655616
0
Test that maze can not be exited when entrance pointers are set to None.
def test_maze_entrance_pointers_are_none(self): maze = Maze(100, 100) row, col = maze.entrance maze.grid[row][col].up = None maze.grid[row][col].right = None maze.grid[row][col].down = None maze.grid[row][col].left = None self.assertFalse(maze.can_reach_exit([ro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_maze_exit_pointers_are_none(self):\n maze = Maze(100, 100)\n\n row, col = maze.exit\n if maze.grid[row][col].up:\n maze.grid[row][col].up.down = None\n if maze.grid[row][col].right:\n maze.grid[row][col].right.left = None\n if maze.grid[row][col].do...
[ "0.8649427", "0.7370002", "0.73293865", "0.6856556", "0.68072176", "0.62326103", "0.61708444", "0.61359787", "0.6099684", "0.60358566", "0.5930605", "0.59018624", "0.5899554", "0.587606", "0.5869301", "0.58278805", "0.57988024", "0.5797692", "0.5775867", "0.5741775", "0.57401...
0.8637258
1
Test that a maze cannot be exited when rooms adjacent to the exit have their pointers set to None.
def test_maze_exit_pointers_are_none(self): maze = Maze(100, 100) row, col = maze.exit if maze.grid[row][col].up: maze.grid[row][col].up.down = None if maze.grid[row][col].right: maze.grid[row][col].right.left = None if maze.grid[row][col].down: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_maze_entrance_pointers_are_none(self):\n maze = Maze(100, 100)\n\n row, col = maze.entrance\n maze.grid[row][col].up = None\n maze.grid[row][col].right = None\n maze.grid[row][col].down = None\n maze.grid[row][col].left = None\n\n self.assertFalse(maze.can_...
[ "0.84921086", "0.7337513", "0.7119611", "0.6680111", "0.6654044", "0.6379823", "0.62804466", "0.61869204", "0.61617595", "0.61408913", "0.6139881", "0.61133355", "0.6019866", "0.5997094", "0.5945427", "0.593739", "0.5920975", "0.5908153", "0.5904515", "0.59022844", "0.5888381...
0.86979586
0
Test that a maze cannot be exited when rooms adjacent to the entrance are blocked.
def test_maze_entrance_adjacent_are_blocked(self): maze = Maze(100, 100) row, col = maze.entrance if row - 1 >= 0: maze.grid[row - 1][col].blocked = True if col + 1 < 100: maze.grid[row][col + 1].blocked = True if row + 1 < 100: maze.grid[row ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_maze_exit_adjacent_are_blocked(self):\n maze = Maze(100, 100)\n\n row, col = maze.exit\n if row - 1 >= 0:\n maze.grid[row - 1][col].blocked = True\n if col + 1 < 100:\n maze.grid[row][col + 1].blocked = True\n if row + 1 < 100:\n maze.gri...
[ "0.81660235", "0.73107517", "0.7274399", "0.69842875", "0.68054783", "0.656764", "0.65411395", "0.63449854", "0.61716986", "0.6112959", "0.60910326", "0.60790956", "0.6052811", "0.600987", "0.6005713", "0.6005683", "0.5965321", "0.5943916", "0.59438556", "0.5941174", "0.59009...
0.81951046
0
Test that a maze cannot be exited when rooms adjacent to the exit are blocked.
def test_maze_exit_adjacent_are_blocked(self): maze = Maze(100, 100) row, col = maze.exit if row - 1 >= 0: maze.grid[row - 1][col].blocked = True if col + 1 < 100: maze.grid[row][col + 1].blocked = True if row + 1 < 100: maze.grid[row + 1][col...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_maze_entrance_adjacent_are_blocked(self):\n maze = Maze(100, 100)\n\n row, col = maze.entrance\n if row - 1 >= 0:\n maze.grid[row - 1][col].blocked = True\n if col + 1 < 100:\n maze.grid[row][col + 1].blocked = True\n if row + 1 < 100:\n ...
[ "0.80039895", "0.7448992", "0.7195284", "0.6965521", "0.6831383", "0.66254824", "0.659395", "0.6501339", "0.6198514", "0.61660945", "0.61389726", "0.60900736", "0.60867363", "0.60384566", "0.6005758", "0.59558624", "0.59533626", "0.59515226", "0.593887", "0.5937304", "0.59134...
0.82839954
0
Linear position at time t linear uniform accelerated motion along z
def rcm(t): x0 = 0 # initial position return np.array([ 0, 0, x0 + self.v0x * t + 1 / 2 * self.ax * t ** 2 ])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def position(x,v,t,a):\n return x + v*t + 0.5*a*t**2 # pos = initial position + velocity*time + .5(acceleration)(time squared)", "def acceleration(v,u,t):\n return ((v-u)/t)", "def linear_tween(t, b, c, d):\n return c * t / d + b", "def position(self, t):\n return vector_add(self.origin, self...
[ "0.6647135", "0.6517095", "0.64763117", "0.64639425", "0.6362107", "0.6319829", "0.6287856", "0.6237222", "0.6232011", "0.62270737", "0.62228096", "0.62213963", "0.62023896", "0.6149938", "0.60852146", "0.6061688", "0.5994449", "0.5978224", "0.5957989", "0.5945578", "0.591055...
0.0
-1
Angular position at time t uniform circular motion around z
def thetacm(t): return np.array([ 0, 0, self.wz * t ])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_angular_velocity(r, T):\n # http://www.hep.fsu.edu/~berg/teach/phy2048/0918.pdf\n # velocity = 2(pi)r/T\n return (2*math.pi*r)/T", "def move(self, t):\n if self.visible == True:\n self.x += self.vx * t\n self.y += self.vy * t # Maybe do this to the end?!...
[ "0.6157029", "0.61538386", "0.6140294", "0.61287075", "0.6061779", "0.6051919", "0.60001576", "0.59386694", "0.59374785", "0.58405554", "0.58057797", "0.5800365", "0.5778631", "0.57635623", "0.5752686", "0.57312965", "0.5714458", "0.5714033", "0.5710248", "0.56881386", "0.568...
0.0
-1
Returns 3xn numpy array describing motion accelerations Those acceleration are analytical calculated and aren't susceptible to errors
def get_analytical_accelerations(self): # create empty numpy array for accelerations accelerations = np.zeros((3, len(self.times))) # radial accelerations is equal to angular velocity^2 / radius but radius is unitary is this trajectory radial_acceleration = self.wz ** 2 # decompo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def acceleration(R,M,G):\r\n N = R.shape[0]\r\n a = np.zeros((N,3)) # initialize accelerations\r\n for n in range(N):\r\n for nn in range(N):\r\n if n!=nn:\r\n a[n,:] += G*M[nn] * (R[nn,:]-R[n,:]) / util.enod(R[nn,:],R[n,:])**(3) \r\n return a", "def calculate_acce...
[ "0.67607427", "0.6659853", "0.65132993", "0.6360973", "0.6349496", "0.6343993", "0.62899894", "0.62222946", "0.6102571", "0.6017444", "0.6007366", "0.599949", "0.59906644", "0.5926159", "0.5886498", "0.5861928", "0.5837955", "0.5786055", "0.5779665", "0.57683545", "0.5741493"...
0.74758273
0
Returns 3xn numpy array describing motion velocities Those velocities are analytical calculated and aren't susceptible to errors
def get_analytical_velocities(self): # create empty numpy array for accelerations velocities = np.zeros((3, len(self.times))) # tangential velocity is angular velocity multiplied by radius but radius is one vt = self.wz # decompose tangential velocity in x and y components ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def motor_velocities(self):\n return np.asarray(self._robot_state.velocity)", "def get_velocities(self):\n\n return np.array([p.velocity for p in self.particles])", "def velocities(self, return_np=False):\n if return_np:\n return self.si_values()[3:]\n return [self.v_x, self....
[ "0.7477564", "0.71334136", "0.6991451", "0.6933057", "0.67952305", "0.66930515", "0.66805524", "0.6625498", "0.6615499", "0.6569754", "0.6533391", "0.64655375", "0.6296626", "0.6216558", "0.6187872", "0.6160401", "0.6115366", "0.6099247", "0.6098212", "0.6074818", "0.6048958"...
0.7648973
0
Returns new array of times and a 3xn numpy array of accelerations derived numerically from trajectory
def get_numerical_derived_accelerations(self): # calculate numerical 2° order derivative and return it return np.gradient(np.gradient(self.trajectory,axis=1),axis=1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_analytical_accelerations(self):\n # create empty numpy array for accelerations\n accelerations = np.zeros((3, len(self.times)))\n # radial accelerations is equal to angular velocity^2 / radius but radius is unitary is this trajectory\n radial_acceleration = self.wz ** 2\n ...
[ "0.7065685", "0.6982724", "0.66747206", "0.6550669", "0.61960965", "0.5970131", "0.5966213", "0.59588355", "0.59548384", "0.5842092", "0.57867384", "0.57496256", "0.57020986", "0.5693269", "0.56879735", "0.56510234", "0.5611596", "0.5600513", "0.55970985", "0.5581884", "0.556...
0.5778027
11
return 3x1 numpy array describing motion initial position
def get_start_velocity(self): # uniform circular motion have a start velocity of omega # TODO generate from start position and rotation direction return np.array([0, self.wz, 0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def origin():\n\n # indices: [axis, point]\n return numpy.zeros((3, 1))", "def position(self):\n return self.atoms.reshape((1,-1))", "def position(self) -> np.ndarray:\n return self._state[0:2]", "def start_state(self):\r\n return np.zeros((3, 3), dtype=np.int8)", "def initial(self) ...
[ "0.67479354", "0.6695683", "0.64842665", "0.63341457", "0.624631", "0.61460716", "0.6119645", "0.61145616", "0.6102252", "0.6092131", "0.6071062", "0.6059867", "0.601122", "0.6004215", "0.59984624", "0.598873", "0.5980925", "0.59365016", "0.59132206", "0.5881117", "0.58495903...
0.58873963
19
Check an external generated trajectory against the internally one
def check_trajectory(self, external_trajectory): # Create empty array for error measure error = np.zeros((3, external_trajectory.shape[1])) # loop over external trajectory for i, external_x in enumerate(external_trajectory.T): # get trajectory coordinates at step i ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_trajectory(self):\n raise NotImplementedError", "def test_object_with_trajectory() -> None:\n system_name = \"Octanol2\"\n system = database.system(system_name)\n parser = FlatfileParser()\n simulation_data = parser.get_simulation_data(\n units=system.un...
[ "0.6346247", "0.61815774", "0.5947306", "0.58746684", "0.58349323", "0.5784224", "0.575642", "0.5685432", "0.56115633", "0.56095415", "0.5555707", "0.5527303", "0.54907143", "0.5460359", "0.5445118", "0.5434387", "0.5405169", "0.53977865", "0.5394035", "0.53772044", "0.536921...
0.65443593
0
For a given liaison and set of DLCs, update all unsent EmailMessages associated with those DLCs to have that Liaison. We can't make this part of, e.g., the save() method on DLC, because the liaison.dlc_set.update() commands used in views.py go straight to SQL, bypassing the ORM save() doesn't get hit, and neither do pr...
def update_emails_with_dlcs(dlcs, liaison=None): for dlc in dlcs: EmailMessage.objects.filter( record__author__dlc=dlc, date_sent__isnull=True).update(_liaison=liaison)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_attributes_by_domains(etl, update_kwargs):\r\n import arcetl\r\n func = functools.partial(\r\n etl.transform, transformation=arcetl.attributes.update_by_domain_code,\r\n )\r\n tuple(func(**kwargs) for kwargs in update_kwargs)", "def update_data(self):\n staff = Staff.obje...
[ "0.52795607", "0.5235836", "0.5187958", "0.50904024", "0.50034666", "0.48836243", "0.48716804", "0.48288625", "0.47948357", "0.4792678", "0.47558114", "0.47519177", "0.47414127", "0.47377956", "0.4734942", "0.46482447", "0.46457776", "0.4619367", "0.4618994", "0.46182483", "0...
0.7852708
0
Analytic expression for the normalized inverse cumulative mass function. The argument ms is normalized mass fraction [0,1]
def _icmf(self, ms): return self._pot.a * numpy.sqrt(ms) / (1 - numpy.sqrt(ms))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mass(query, ts):\n\n m = len(query)\n q_mean = np.mean(query)\n q_std = np.std(query)\n mean, std = mov_mean_std(ts, m)\n dot = sliding_dot_product(query, ts)\n return 2 * m * (1 - (dot - m * mean * q_mean) / (m * std * q_std))", "def normalize(X, m, s):\n return (X - m) / s", "def nor...
[ "0.6188651", "0.61184984", "0.6113977", "0.6110041", "0.60532564", "0.60418516", "0.6002625", "0.59949887", "0.59357876", "0.5919308", "0.5904984", "0.5893741", "0.5891592", "0.5873965", "0.58559597", "0.5819413", "0.58134836", "0.5808183", "0.5798541", "0.57581913", "0.57415...
0.68552166
0
get a string with all the text after the command
def get_params_as_text(self, context): try: command, *params = context.message.content.split(' ') params = ' '.join(params) return params except Exception as error: print(error)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_output_string(command):\n out_put = command.replace(\"\\n\", \"\")\n return out_put", "def extract_command(text):\n return text.split()[0].split('@')[0][1:] if is_command(text) else None", "def extract_command(text):\n return text.split()[0].split('@')[0][1:] if is_command(text) else None",...
[ "0.7112573", "0.70431376", "0.70431376", "0.6817466", "0.68168163", "0.68133545", "0.6588434", "0.65005463", "0.6358557", "0.6324116", "0.630135", "0.6297677", "0.62693876", "0.61335003", "0.6126625", "0.6101863", "0.606878", "0.60594255", "0.60581064", "0.6043088", "0.602708...
0.0
-1
this method add a nex participant
async def join(self, context): try: if Tournament.persons < 32: name_participant = self.get_params_as_text(context) self.tournament.register_participant(name_participant[:20]) await context.send(f'{name_participant} se anoto en el torneo. Participante ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addParticipant(self, participant):\n if len(self.participants) < self.maxParticipants:\n self.participants[participant.discordId] = participant\n else:\n raise ValueError('Max number of participants has been reached')", "def add_participant(self, address):\n if addr...
[ "0.76422566", "0.6660983", "0.6510777", "0.6351783", "0.6243235", "0.60898423", "0.6070195", "0.6013595", "0.5920754", "0.58482397", "0.5790679", "0.57704395", "0.5753774", "0.5684616", "0.56583226", "0.56527185", "0.5641114", "0.5641114", "0.5609375", "0.55831796", "0.555573...
0.0
-1
this method clear all the participants
async def clear(self, context): try: if context.author.is_mod: self.tournament.clear_file() await context.send('vaciando la lista...') except Exception as error: print(error)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear(self):\n self.__attendees = []\n self._track_changes()", "def clear(self) -> None:\n logger.info(\"destroying all registered mutants\")\n try:\n uuids = list(self)\n for uuid in uuids:\n del self[uuid]\n except Exception:\n ...
[ "0.6944092", "0.6938088", "0.688058", "0.67977434", "0.67690104", "0.6761196", "0.6745327", "0.6739101", "0.6706613", "0.66968316", "0.6687944", "0.6662833", "0.6610197", "0.6569381", "0.6569381", "0.6569381", "0.6569381", "0.6569381", "0.6569381", "0.6569381", "0.6542556", ...
0.6134849
61
this method show the finally url of the tournament
async def stop(self, context): try: if context.author.is_mod: self.tournament.start = False Tournament.persons = 0 bracket_url = self.tournament.create_bracket() print(bracket_url) await context.send(bracket_url) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_absolute_url(self):\n return reverse('tournament-details', args=[self.uuid])", "def show_orion_url(self, obj):\n return obj.orion_url", "def get_absolute_url(self):\n return reverse('GameplanUser_detail', args=[str(self.id)])", "def get_absolute_url(self):\n return reverse...
[ "0.75147563", "0.667408", "0.6668852", "0.6625459", "0.6625186", "0.66190785", "0.66131896", "0.65649813", "0.6556861", "0.6507283", "0.64903605", "0.648492", "0.64646083", "0.6404303", "0.63940734", "0.63914484", "0.6362367", "0.63503087", "0.63423556", "0.6322751", "0.63127...
0.0
-1
this method show the finally url of the tournament
async def stop(self, context): try: if context.author.is_mod: name_participant = self.get_params_as_text(context) with open('ranking', 'a') as f: position = exist(f, participante) if position: update(posi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_absolute_url(self):\n return reverse('tournament-details', args=[self.uuid])", "def show_orion_url(self, obj):\n return obj.orion_url", "def get_absolute_url(self):\n return reverse('GameplanUser_detail', args=[str(self.id)])", "def get_absolute_url(self):\n return reverse...
[ "0.75147563", "0.667408", "0.6668852", "0.6625459", "0.6625186", "0.66190785", "0.66131896", "0.65649813", "0.6556861", "0.6507283", "0.64903605", "0.648492", "0.64646083", "0.6404303", "0.63940734", "0.63914484", "0.6362367", "0.63503087", "0.63423556", "0.6322751", "0.63127...
0.0
-1
this method show the finally url of the tournament
async def stop(self, context): try: if context.author.is_mod: self.tournament.start = False Tournament.persons = 0 bracket_url = self.tournament.create_bracket() print(bracket_url) await context.send(bracket_url) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_absolute_url(self):\n return reverse('tournament-details', args=[self.uuid])", "def show_orion_url(self, obj):\n return obj.orion_url", "def get_absolute_url(self):\n return reverse('GameplanUser_detail', args=[str(self.id)])", "def get_absolute_url(self):\n return reverse...
[ "0.75147563", "0.667408", "0.6668852", "0.6625459", "0.6625186", "0.66190785", "0.66131896", "0.65649813", "0.6556861", "0.6507283", "0.64903605", "0.648492", "0.64646083", "0.6404303", "0.63940734", "0.63914484", "0.6362367", "0.63503087", "0.63423556", "0.6322751", "0.63127...
0.0
-1
this method start the bot
async def start(self, context): try: if context.author.is_mod: self.tournament.start = True self.tournament.clear_file() await context.send('Arrancando el torneo manda !yo y tu nombre') except Exception as error: print(error)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_bot(self):\n self.proc = subprocess.Popen(\"./start\", stdin=subprocess.PIPE,\n\t\t\t\t\t\t\t\t\t stdout=subprocess.PIPE,\n\t\t\t\t\t\t\t\t\t cwd=os.path.abspath(self.path))", "def _do_start(self, chat_id, user_id, args, update):\n \n self.tclient.send_message('Hallo! Ich bin ein B...
[ "0.7722923", "0.76069283", "0.75742465", "0.7509508", "0.7472191", "0.73300457", "0.71897817", "0.71811247", "0.71430236", "0.71419936", "0.71026933", "0.71026933", "0.7100877", "0.7021874", "0.7015782", "0.70014167", "0.69925666", "0.69834596", "0.69834596", "0.6942283", "0....
0.6878883
34
remove one person to tournament
async def remove(self, context): try: if context.author.is_mod: name_to_remove = self.get_params_as_text(context) self.tournament.remove(name_to_remove) except Exception as error: print(error)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_person(self, per: str):\n if per in self._people:\n self._people.remove(per)\n else:\n raise IDDoesNotExist", "def rm_person():\n # get person name from user\n responses = accept_inputs([\"Person name\"])\n person_name = responses[\"Person name\"]\n # check for ...
[ "0.72774655", "0.72388893", "0.7220232", "0.6952967", "0.6876557", "0.6762859", "0.6732808", "0.66982037", "0.66925883", "0.6682448", "0.6664118", "0.6633303", "0.66025966", "0.65952206", "0.65458536", "0.6530784", "0.6524228", "0.65071386", "0.649021", "0.64630795", "0.64176...
0.69056845
4
remove one person to tournament
async def remove(self, context): try: url_tournament = Tournament.last_url_tournament await context.send(url_tournament) except Exception as error: print(error)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_person(self, per: str):\n if per in self._people:\n self._people.remove(per)\n else:\n raise IDDoesNotExist", "def rm_person():\n # get person name from user\n responses = accept_inputs([\"Person name\"])\n person_name = responses[\"Person name\"]\n # check for ...
[ "0.72774655", "0.72388893", "0.7220232", "0.6952967", "0.69056845", "0.6876557", "0.6762859", "0.6732808", "0.66982037", "0.66925883", "0.6682448", "0.6664118", "0.6633303", "0.66025966", "0.65458536", "0.6530784", "0.6524228", "0.65071386", "0.649021", "0.64630795", "0.64176...
0.65952206
14
this method show info of the bot
async def info(self, context): await context.send('creador: debellisnahuel@gmail.com\ncolabs:\n emi: https://twitter.com/emilianosce/ o https://www.instagram.com/emilianosce/ \n garza: https://twitter.com/Matias_Garcia00 o https://www.twitch.tv/garzangb')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __bot_info(self):\n log.debug(\"Displaying __bot_info\")\n self.bot.send_message(self.chat.id, self.loc.get(\"bot_info\"))", "async def info(self, ctx):\n\t\tembed = discord.Embed(\n\t\t\tdescription=\"Created By Seperoph#1399 and AkaBaka#4654\",\n\t\t\tcolor=config[\"success\"]\n\t\t)\n\t\temb...
[ "0.8381583", "0.7937538", "0.78882134", "0.7880321", "0.78645843", "0.7819159", "0.78096575", "0.77810854", "0.77136576", "0.76380116", "0.7629331", "0.7558184", "0.7451685", "0.7386708", "0.7359875", "0.7226554", "0.7160067", "0.7122098", "0.7105532", "0.70358866", "0.699892...
0.78617454
5
Obtaining bearer token for authorized user
def get(self): # Login of authorized user stores in Flask g object user = User.query.filter_by(username=g.user.username).first() # Generate token token = user.generate_auth_token() # Send token in ASCII format return {'token': token.decode('ascii')}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_token(self):\n\t\tself.client.post('/api/v1/auth/signup', data=json.dumps(self.signup_user), content_type='application/json')\n\t\tresponse = self.client.post('/api/v1/auth/login', data=json.dumps(self.login_user), content_type='application/json')\n\t\tresp = json.loads(response.data.decode())\n\t\treturn ...
[ "0.7860842", "0.76284677", "0.7599394", "0.7591203", "0.7467385", "0.7460234", "0.7451384", "0.7451384", "0.7426554", "0.740905", "0.73147017", "0.7261665", "0.7257923", "0.721116", "0.72013485", "0.71661544", "0.7151343", "0.71375066", "0.71375066", "0.70976734", "0.70619357...
0.7188754
15
A Flask view to serve the main dashboard page.
def index(): return render_template("charts.html")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dashboard():\n return render_template(\"home/dashboard.html\", title=\"Dashboard\")", "def dashboard():\n return render_template('home/dashboard.html')", "def dashboard():\n return render_template('home/dashboard.html', title=\"Dashboard\")", "def dashboard():\r\n return render_template('{}/d...
[ "0.8031703", "0.8007228", "0.79883116", "0.78120196", "0.77524966", "0.76967824", "0.76680106", "0.7498574", "0.7447865", "0.7439597", "0.74210584", "0.741471", "0.7398166", "0.7398166", "0.7357347", "0.7272332", "0.72679293", "0.72622377", "0.7234864", "0.71152544", "0.71129...
0.0
-1
A Flask view to serve the project data from MongoDB in JSON format.
def lifedata_hpi(): # A constant that defines the record fields that we wish to retrieve. FIELDS = { '_id': False, 'Country': True, 'CountryCode': True, 'Life Expectancy': True, 'Well-being(0-10)': True, 'Happy Life Years': True, 'Happy Planet Index': True, 'Population': True, 'GDP/capita': Tru...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_projects_route():\n response_object = {'status': 'success'}\n if request.method == 'POST':\n post_data = request.get_json()\n if post_data is not None:\n add_project(post_data)\n response_object['message'] = 'Project added!'\n else:\n response_object['pro...
[ "0.6565862", "0.6430693", "0.6395227", "0.63753456", "0.63501894", "0.6327006", "0.6311924", "0.61719203", "0.6141743", "0.61133546", "0.61053944", "0.6072554", "0.60713667", "0.60586774", "0.60483384", "0.6038452", "0.6013065", "0.6010805", "0.60094917", "0.59949154", "0.599...
0.5466392
68
Creates a zip file for testing, destroys upon exit
def zip_to_test(prepend_path=""): module_path = 'test_data/example_module' with tempfile.TemporaryDirectory(prefix='zipload-py-test') as tmp_dir: zip_path = os.path.join(tmp_dir, 'test.zip') with zipfile.ZipFile(zip_path, 'w') as created_zip: for root, _, files in os.walk(module_path...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_zip_file():\n shutil.make_archive(os.path.join(DIST_DIR, \"build\"), \"zip\", BUILD_DIR)", "def make_zip(self):\n shutil.make_archive(self.name, 'zip', self.name)", "def make_empty_zip(self):\n buffer = BytesIO()\n file = ZipFile(buffer, 'w')\n file.close()\n ...
[ "0.77357143", "0.76956785", "0.7463426", "0.70405084", "0.69906664", "0.6920596", "0.69139874", "0.6822988", "0.6786961", "0.6765615", "0.67345035", "0.66566676", "0.6651829", "0.65511256", "0.6529786", "0.64627403", "0.6442971", "0.6429177", "0.64003265", "0.6389823", "0.638...
0.0
-1
Split up seq in pieces of size
def split_seq(seq,size): return [seq[i:i+size] for i in range(0, len(seq), size)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_seq(seq, size):\n return [seq[ii:ii + size] for ii in range(0, len(seq), size)]", "def split_seq(seq,size):\n for i in range(0,len(seq),size):\n if i+size<len(seq) and seq[i+size] - seq[i] == size:\n yield seq[i:i+size]", "def _chunker(self, seq, size):\n return (se...
[ "0.83308667", "0.80712384", "0.7818045", "0.77790713", "0.7623721", "0.7519637", "0.74383765", "0.7353186", "0.7353124", "0.731081", "0.72468454", "0.7198315", "0.713888", "0.71279585", "0.705325", "0.7039897", "0.7039241", "0.70042735", "0.69883114", "0.69418406", "0.694126"...
0.8370639
0
instance="prod/phys03" cmd='das_client limit=0 query="file dataset=%s"'%(dataset) print "Executing ",cmd cmd_out = getoutput( cmd ) tmpList = cmd_out.split(os.linesep) files = []
def createLists(listDirectory, dataset, name=""): if name=="": name = getDatasetNameFromPath(dataset) files = getFileListDAS(dataset) fileName = listDirectory+"/"+name+".txt" with open(fileName, "w") as f: for l in files: f.write("%s\n" % l) print "Wrote file list: ", fileName retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFileListDAS(dataset,blacklist=[ ]):\n dataset = dataset.replace('__','/')\n if dataset[0]!='/':\n dataset = '/'+dataset\n instance = 'prod/global'\n if 'USER' in dataset:\n instance = 'prod/phys03'\n #cmd='das_client --limit=0 --query=\"file dataset=%s instance=%s\"'%(dataset,i...
[ "0.6257712", "0.6218158", "0.6023102", "0.60000557", "0.5747368", "0.57171243", "0.5644192", "0.55536133", "0.55395603", "0.5501458", "0.5482287", "0.5469518", "0.54569805", "0.54368114", "0.5435524", "0.53941613", "0.53337973", "0.53291094", "0.5311987", "0.5307314", "0.5291...
0.0
-1
Initializes instances of PythonTag().
def __init__(self, type, name, fullName, lineNumber, indentLevel): # DOC {{{ # }}} # CODE {{{ # remember the settings {{{ self.type = type self.name = name self.fullName = fullName self.lineNumber = lineNumber...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.tag = None", "def __init__(self, tag):\n self.tag = tag", "def __init__(self, tag):\n self.tag = tag.lower()\n self.attrs = {}\n self.contents = ()", "def __init__(self, tags=''):\n self.tags = tags", "def __init__(self):\n self.__...
[ "0.6987507", "0.66290337", "0.65996826", "0.64921933", "0.6433544", "0.6367373", "0.62950975", "0.6232964", "0.61520916", "0.6135283", "0.61038953", "0.60898864", "0.6069083", "0.6056815", "0.60530764", "0.6043852", "0.60089153", "0.59769243", "0.59732854", "0.5969999", "0.59...
0.0
-1
Returns a string representation of the tag.
def __str__(self): # DOC {{{ # }}} # CODE {{{ return "%s (%s) [%s, %u, %u]" % (self.name, PythonTag.TAG_TYPE_NAME[self.type], self.fullName, self.lineNumber, self.indentLevel,) # }}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return str(self.tag)", "def __repr__(self):\n\n p = self\n\n return f\"<tag_name = {p.tag_name}\"", "def __str__(self):\n out = str(self.tag_pairs)\n if self.comment:\n out += \"{\" + self.comment + \"} \"\n out += self.format_body()\n ...
[ "0.8027974", "0.75340533", "0.74675786", "0.7440137", "0.74278444", "0.7376444", "0.7172313", "0.6902624", "0.687977", "0.67505157", "0.673114", "0.6651263", "0.66313094", "0.66244364", "0.6621004", "0.66137564", "0.6597395", "0.6589004", "0.6566107", "0.65616584", "0.6561255...
0.6643421
12
Initializes instances of SimplePythonTagsParser().
def __init__(self, source): # DOC {{{ # }}} # CODE {{{ # make sure source has readline() method {{{ if ((hasattr(source, 'readline') == 0) or (callable(source.readline) == 0)): raise AttributeError("Source must have callable readline method.") # }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, parser=None):", "def __init__(self, *args, **kw):\n self.parser = Parser(*args, **kw)", "def __init__(self, tags=''):\n self.tags = tags", "def setup_parser(self, parser):", "def __init__(self, parser: Any = None):", "def __init__(self, tag):\n self.tag = tag.lower...
[ "0.6713345", "0.6590369", "0.6569999", "0.6547255", "0.64754957", "0.6448336", "0.6433067", "0.638849", "0.6324368", "0.6274636", "0.62640715", "0.62124467", "0.6207272", "0.61866015", "0.6120731", "0.61126554", "0.6102014", "0.6069079", "0.6043864", "0.6024685", "0.5994862",...
0.0
-1
Determines all the tags for the buffer. Returns a tuple in format (tagLineNumbers, tags,).
def getTags(self): # DOC {{{ # }}} # CODE {{{ # initialize the resulting list of the tag line numbers and the tag information {{{ tagLineNumbers = [] tags = {} # }}} # initalize local auxiliary variables {{{ tagsStack = [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getTags(bufferNumber, changedTick):\n # DOC {{{\n # }}}\n\n # CODE {{{\n # define global variables\n global TAGLINENUMBERS, TAGS, BUFFERTICKS\n\n # return immediately if there's no need to update the tags {{{\n if (BUFFERTICKS.get(bufferNumber, None) == changedTick):\n return (TAGLI...
[ "0.77355045", "0.69929993", "0.6691693", "0.66626006", "0.6556801", "0.6425055", "0.6398969", "0.6252607", "0.605418", "0.6030553", "0.59721065", "0.5971722", "0.59300894", "0.59279287", "0.59207106", "0.5914798", "0.5828291", "0.58269495", "0.58139163", "0.58090603", "0.5800...
0.69091666
2
Returns the parent/enclosing tag (instance of PythonTag()) from the specified tag list. If no such parent tag exists, returns None.
def getParentTag(self, tagsStack): # DOC {{{ # }}} # CODE {{{ # determine the parent tag {{{ if (len(tagsStack)): parentTag = tagsStack[-1] else: parentTag = None # }}} # return the tag return parentTag # }}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findTypeParent(element, tag):\n \n p = element\n while True:\n p = p.getparent()\n if p.tag == tag:\n return p\n \n # Not found\n return None", "def parent(self):\n if not self._parents:\n return None\n el...
[ "0.66215205", "0.62002236", "0.61979115", "0.5927018", "0.58290815", "0.5811783", "0.57534534", "0.566354", "0.5655644", "0.5645672", "0.5637724", "0.56282586", "0.5618066", "0.5561548", "0.5546117", "0.553552", "0.5524999", "0.5514182", "0.55125684", "0.5498307", "0.5488604"...
0.72540027
0
Computes the indentation level from the specified string.
def computeIndentationLevel(indentChars): # DOC {{{ # }}} # CODE {{{ # initialize the indentation level indentLevel = 0 # compute the indentation level (expand tabs) {{{ for char in indentChars: if (char == '\t'): indentLevel += Simpl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def indent(str, level):\n if level == 0: return str\n return \"\\n\".join(\"\\t\" * level + line for line in str.splitlines())", "def indent(string, level=1):\n spaces = ' ' * (level * 4)\n return \"%s%s\" % (spaces, string)", "def find_nesting_levels(string, beg, end, fst, snd):\n beg_level = 0...
[ "0.6839068", "0.66582286", "0.63916695", "0.6382215", "0.6194246", "0.6100255", "0.6056314", "0.5990422", "0.5990277", "0.59635806", "0.5787235", "0.5760301", "0.5721536", "0.57096744", "0.5614263", "0.555781", "0.5548886", "0.5532298", "0.55011415", "0.54683316", "0.54461807...
0.6446273
2
Returns instance of PythonTag() based on the specified data.
def getPythonTag(self, tagsStack, lineNumber, indentChars, tagName, tagTypeDecidingMethod): # DOC {{{ # }}} # CODE {{{ # compute the indentation level indentLevel = self.computeIndentationLevel(indentChars) # get the parent tag parentTag = self.getParentTag(tagsS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getNodeClassFromData(self, data: OrderedDict):\n return Node if self.node_class_selector is None else self.node_class_selector(data)", "def tag(self) -> 'Tag':\n # project/lineage must exist so let's fetch it outside of try-except\n project = self.project.key\n lineage = self.line...
[ "0.5189606", "0.5115586", "0.5112532", "0.51076484", "0.51050496", "0.5092901", "0.508095", "0.5072821", "0.50573117", "0.5042166", "0.49817452", "0.4949033", "0.49404618", "0.49232757", "0.49211174", "0.49181822", "0.4915639", "0.48730016", "0.4843272", "0.47862923", "0.4766...
0.5681472
0
Returns tag type of the current tag based on its previous tag (super tag) for classes.
def tagClassTypeDecidingMethod(self, parentTagType): # DOC {{{ # }}} # CODE {{{ # is always class no matter what return PythonTag.TT_CLASS # }}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_class_for(self, elem):\r\n\t\treturn self.__tag_to_cls.get(elem.tag, self.__default_cls)", "def get_type(self, ):\n return self.attrs.get(self.AttributeNames.TYPE, None)", "def get_class_for_tag(self, tag):\r\n return self._mapping[tag]", "def nic_tag_type(self):\n # return type ...
[ "0.582632", "0.57994694", "0.57834005", "0.5781188", "0.5757738", "0.5732667", "0.5722571", "0.56800544", "0.56718004", "0.5639041", "0.55776334", "0.5570752", "0.5524703", "0.5488256", "0.54447544", "0.542426", "0.5419941", "0.5353941", "0.5353941", "0.5353941", "0.5353941",...
0.67080295
0
Returns tag type of the current tag based on its previous tag (super tag) for functions/methods.
def tagFunctionTypeDecidingMethod(self, parentTagType): # DOC {{{ # }}} # CODE {{{ if (parentTagType == PythonTag.TT_CLASS): return PythonTag.TT_METHOD else: return PythonTag.TT_FUNCTION # }}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_tag(self):\n return self.__tag", "def get_tag(self, tag_type: str) -> str:\n if tag_type in self.tags:\n return self.tags[tag_type]\n return None", "def nic_tag_type(self):\n # return type of the nictag or empty string if self.nic_tag is not found in Node.all_nictags...
[ "0.6046639", "0.5874162", "0.5833042", "0.5807177", "0.5753416", "0.57458633", "0.5724362", "0.56941104", "0.56460464", "0.56113297", "0.55841863", "0.55154127", "0.55130136", "0.54260707", "0.5419026", "0.5407151", "0.5407151", "0.5407151", "0.5407151", "0.5407151", "0.54071...
0.5995309
1
Initializes instances of VimReadlineBuffer().
def __init__(self, vimBuffer): # DOC {{{ # }}} # CODE {{{ # remember the settings self.vimBuffer = vimBuffer # initialize instance attributes {{{ self.currentLine = -1 self.bufferLines = len(vimBuffer) # }}} # }}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, buf):\n self.lines = buf.splitlines()\n self.col_offs = [OffsetList() for i in range(len(self.lines))]\n self.col_lens = [len(line) for line in self.lines]", "def init_readline():\n if g.command_line:\n return\n\n if has_readline:\n g.READLINE_FILE = os...
[ "0.648197", "0.6288714", "0.61934733", "0.6109114", "0.60832447", "0.592465", "0.58992684", "0.58968043", "0.5819736", "0.5803652", "0.58010024", "0.5799181", "0.5773363", "0.5733199", "0.5715456", "0.56676733", "0.56251436", "0.56089485", "0.5603505", "0.55618817", "0.556059...
0.79332894
0
Returns next line from the buffer. If all the buffer has been read, returns empty string.
def readline(self): # DOC {{{ # }}} # CODE {{{ # increase the current line counter self.currentLine += 1 # notify end of file if we reached beyond the last line {{{ if (self.currentLine == self.bufferLines): return '' # }}} # return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readline( self ):\n self.readbuf += self.read( 1024 )\n if '\\n' not in self.readbuf:\n return None\n pos = self.readbuf.find( '\\n' )\n line = self.readbuf[ 0 : pos ]\n self.readbuf = self.readbuf[ pos + 1: ]\n return line", "def readline(self):\n ...
[ "0.79515207", "0.7604164", "0.7576829", "0.74454296", "0.7393395", "0.71006423", "0.7093291", "0.7088161", "0.70382166", "0.6965394", "0.69549024", "0.6935343", "0.6934373", "0.6884797", "0.6884797", "0.6858097", "0.684937", "0.68425554", "0.6836626", "0.68244475", "0.6755449...
0.68967944
13
Returns the index of line in 'tagLineNumbers' list that is nearest to the specified cursor row.
def getNearestLineIndex(row, tagLineNumbers): # DOC {{{ # }}} # CODE {{{ # initialize local auxiliary variables {{{ nearestLineNumber = -1 nearestLineIndex = -1 # }}} # go through all tag line numbers and find the one nearest to the specified row {{{ for lineIndex, lineNumber ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getLinescanPos(self):\n return self.handle.pos().toPoint()", "def index_tag_in_lines(lines, tag):\n for index, line in enumerate(lines):\n if tag in line:\n return index\n raise ValueError(f'{tag} not found.')", "def get_corresponding_lineno(self, lineno: int) -> int:\n ...
[ "0.649168", "0.6456299", "0.6421644", "0.6305069", "0.6262338", "0.62518704", "0.6186208", "0.61382073", "0.6082272", "0.6054712", "0.60263366", "0.5928631", "0.59212524", "0.5885107", "0.5832795", "0.5810198", "0.57756764", "0.57733077", "0.57636684", "0.5742054", "0.5691415...
0.8415959
0
Reads the tags for the specified buffer number. Returns a tuple (taglinenumber[buffer], tags[buffer],).
def getTags(bufferNumber, changedTick): # DOC {{{ # }}} # CODE {{{ # define global variables global TAGLINENUMBERS, TAGS, BUFFERTICKS # return immediately if there's no need to update the tags {{{ if (BUFFERTICKS.get(bufferNumber, None) == changedTick): return (TAGLINENUMBERS[buffe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findTag(bufferNumber, changedTick):\n # DOC {{{\n # }}}\n\n # CODE {{{\n # try to find the best tag {{{\n try:\n # get the tags data for the current buffer\n tagLineNumbers, tags = getTags(bufferNumber, changedTick)\n\n # link to vim's internal data {{{\n currentBuffe...
[ "0.67446077", "0.6337529", "0.6291825", "0.61587244", "0.5640741", "0.5421108", "0.5401528", "0.53968465", "0.53458995", "0.53208137", "0.5273067", "0.52147645", "0.51437765", "0.5076457", "0.5067522", "0.5062207", "0.50597274", "0.5055507", "0.4999549", "0.49994224", "0.4990...
0.7614175
0
Tries to find the best tag for the current cursor position.
def findTag(bufferNumber, changedTick): # DOC {{{ # }}} # CODE {{{ # try to find the best tag {{{ try: # get the tags data for the current buffer tagLineNumbers, tags = getTags(bufferNumber, changedTick) # link to vim's internal data {{{ currentBuffer = vim.current....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_max_tag(self, word):\n count = []\n for tag in self.pos_tags:\n count.append(self.tag_word_data.count((tag, word)))\n max_index = np.argmax(np.asarray(count))\n return self.pos_tags[max_index]", "def find_first_tag(self, tag):\n for lm, _ in self.search(tag=...
[ "0.5941577", "0.5846168", "0.5729062", "0.552021", "0.54697645", "0.54619795", "0.54302764", "0.53901774", "0.53870636", "0.5386353", "0.5366242", "0.53650975", "0.5352395", "0.5349397", "0.534793", "0.53451484", "0.5316854", "0.5307668", "0.530126", "0.5299683", "0.52880454"...
0.6160137
0
Removes tags data for the specified buffer number.
def deleteTags(bufferNumber): # DOC {{{ # }}} # CODE {{{ # define global variables global TAGS, TAGLINENUMBERS, BUFFERTICKS # try to delete the tags for the buffer {{{ try: del TAGS[bufferNumber] del TAGLINENUMBERS[bufferNumber] del BUFFERTICKS[bufferNumber] exc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def port_buffer_drop():", "def _remove_buffer(self):\n if self._buffer is not None:\n self._engine.remove_window(self._buffer)\n self._buffer = None\n self._region = None", "def remove_tag(self, index):\n\n model_index = self.GetItemData(index)\n self.Delet...
[ "0.57889014", "0.5715625", "0.57064915", "0.569658", "0.56588185", "0.5638952", "0.5633699", "0.5570281", "0.55377984", "0.5502692", "0.54355866", "0.5407464", "0.5381097", "0.53683925", "0.5340239", "0.5336506", "0.53318745", "0.53140545", "0.53066534", "0.52959603", "0.5267...
0.8191595
0
When a resource record is deleted, delete all related attachments. When a bucket or collection is deleted, it removes the attachments of every underlying records.
def on_delete_record(event): keep_old_files = asbool(utils.setting_value(event.request, 'keep_old_files', default=False)) # Retrieve attachments for these records using links. resource_name = event.payload['resource_name'] filter_field = '%s_uri' % resource_name uri = event.payload['uri'] utils...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unlink(self):\n if not self:\n return True\n \n # for recomputing fields\n self.modified(self._fields)\n \n self._check_concurrency()\n \n self.check_access_rig...
[ "0.6843386", "0.67490435", "0.6740739", "0.66893613", "0.66396093", "0.65184605", "0.64819264", "0.6070061", "0.60316944", "0.59595275", "0.5957353", "0.59099954", "0.5882116", "0.5862595", "0.5855745", "0.5803972", "0.57956177", "0.577427", "0.5731602", "0.5699655", "0.56986...
0.7568625
0
Query all rows in the tasks table
def select_all_report(conn): cur = conn.cursor() cur.execute("SELECT * FROM report") rows = cur.fetchall() for row in rows: print(row)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_get_all_tasks():\n sql = \"SELECT * FROM {};\".format(TABLE_NAME)\n return db_query(sql)", "def select_all_tasks(conn, query):\n cur = conn.cursor()\n cur.execute(\"SELECT * FROM tasks\")\n\n rows = cur.fetchall()\n\n for row in rows: print(row)", "def select_all_tasks(conn):\n cur ...
[ "0.8042043", "0.79395276", "0.77436715", "0.77436715", "0.7598681", "0.74344116", "0.70559746", "0.70294774", "0.6893741", "0.6889357", "0.67937475", "0.6743304", "0.6510235", "0.6424856", "0.6377583", "0.6342489", "0.6311544", "0.63108444", "0.6304351", "0.6279372", "0.62731...
0.0
-1
Query all rows in the tasks table
def select_all_students(conn): cur = conn.cursor() cur.execute("SELECT * FROM students") rows = cur.fetchall() print(rows) for row in rows: print(row)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_get_all_tasks():\n sql = \"SELECT * FROM {};\".format(TABLE_NAME)\n return db_query(sql)", "def select_all_tasks(conn, query):\n cur = conn.cursor()\n cur.execute(\"SELECT * FROM tasks\")\n\n rows = cur.fetchall()\n\n for row in rows: print(row)", "def select_all_tasks(conn):\n cur ...
[ "0.8042043", "0.79395276", "0.77436715", "0.77436715", "0.7598681", "0.74344116", "0.70559746", "0.70294774", "0.6893741", "0.6889357", "0.67937475", "0.6743304", "0.6510235", "0.6424856", "0.6377583", "0.6342489", "0.6311544", "0.63108444", "0.6304351", "0.6279372", "0.62731...
0.0
-1
Refresh the index by recomputing the embeddings for all points.
def refresh_index(self): synchronize() # TODO: add logger call here self._compute_embeddings()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reindex(self):\n self._index = {w: i for i, w in enumerate(self._words)}\n self.n, self.d = self._vecs.shape\n assert self.n == len(self._words) == len(self._index)\n self._neighbors = None", "def _index(self, corpus):\n\n # Transform documents to embeddings vectors\n ...
[ "0.6858606", "0.68463606", "0.657868", "0.6389719", "0.6132686", "0.60244477", "0.593333", "0.593333", "0.5909812", "0.5907422", "0.5894825", "0.5894825", "0.5894825", "0.5868806", "0.58638215", "0.5859926", "0.5838459", "0.5817189", "0.5815836", "0.581031", "0.581031", "0....
0.8449123
0
Consider all points in index when answering the query.
def get_knn_all(self, query_idxs, k=None): k = self.args.k if k is None else k assert get_rank() == 0 in_query_mask = np.isin(self.idxs, query_idxs) assert np.sum(in_query_mask) == query_idxs.size in_query_X = self.X[in_query_mask] _, I = self._build_and_query_knn(self.X,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query(self, points):\n return self.locate_points(points)", "def test_index_start(self):\n sp_file = os.path.join(\"tests\", \"data\", \"geolife\", \"geolife_staypoints.csv\")\n sp = ti.read_staypoints_csv(sp_file, tz=\"utc\", index_col=\"id\", crs=\"epsg:4326\")\n\n # reproject to...
[ "0.5953971", "0.5778475", "0.57568663", "0.57309234", "0.56595033", "0.55941635", "0.5581838", "0.5543626", "0.55414015", "0.55296826", "0.5516923", "0.5502424", "0.54406995", "0.5440179", "0.5405453", "0.53735083", "0.53164524", "0.5299192", "0.5261156", "0.52556044", "0.523...
0.0
-1
Consider restricted (+shared) points when answering the query.
def get_knn_restricted(self, query_idxs, restriction_map, shared_idxs=[]): assert get_rank() == 0 # compute unrestricted knn buffer_const = 3 query_idxs = np.asarray(query_idxs) unrestricted_knn = self.get_knn_all(query_idxs, k=buffer_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query(self, points):\n return self.locate_points(points)", "def test_same_point_not_submitted(self):\n self.c.force_login(self.u)\n data = {'lat': 34.0, 'lng': 45.3, 'zoom': 13}\n response = self.c.get(reverse(submit_point), data)\n response = self.c.get(reverse(submit_poin...
[ "0.5404895", "0.5294949", "0.5271932", "0.4997003", "0.49783412", "0.4962014", "0.4953756", "0.4933668", "0.4929635", "0.49247083", "0.48987606", "0.4893534", "0.4880048", "0.48775095", "0.4870257", "0.48637962", "0.48444113", "0.48398978", "0.4828735", "0.4828026", "0.482371...
0.4869563
15
Consider only out of cluster points when awnsering the query.
def get_knn_limited_index(self, query_idxs, include_index_idxs=None, exclude_index_idxs=None, k=None): assert get_rank() == 0 assert (include_index_idxs is None) ^ (exclude_index_idxs ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def no_collisions(data, affected_points):\n return", "def is_valid_cluster(self, cluster):\n return (cluster - 1) < self.max_clusters", "def cluster(self):\n assert False", "def _check_no_empty_cluster(labels, n_clusters):\n\n for k in range(n_clusters):\n if np.sum(labels == k) ==...
[ "0.5962403", "0.5897048", "0.5728407", "0.550378", "0.54429865", "0.5440065", "0.53747004", "0.53425586", "0.5278285", "0.5259343", "0.5240149", "0.5238275", "0.5221392", "0.5220381", "0.52146494", "0.5192154", "0.5188614", "0.5170243", "0.5164817", "0.5120952", "0.51203704",...
0.0
-1
Checking whom will show
def test_whom_will_show(self): must_be_first = About_me.objects.first() response = self.client.get(reverse('index')) self.assertContains(response, must_be_first.name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def should_show():", "def visible(self, show):", "def is_visible_to(self, user):\n return True", "def can_show(self):\n return self.can_show", "def test_func(self):\n member_to_view = self.get_object()\n is_self = self.request.user.rfid == member_to_view.rfid\n view_other...
[ "0.6460791", "0.6222103", "0.62075245", "0.615101", "0.60954314", "0.60724443", "0.6061941", "0.5959687", "0.5959687", "0.5947766", "0.5821209", "0.5791814", "0.57910264", "0.5712121", "0.5705235", "0.56800646", "0.56609124", "0.56550324", "0.56477785", "0.5640885", "0.563962...
0.5649831
18
Test index value limit
def test_index_value_limit(self): About_me.objects.create(name='Goro', surname='Moro', birth_date='1995-01-22', bio='qwe', email='s_brin@gmail.com', jab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_maxIndex(self):\t\t\n self.assertEqual(attempt.maxIndexZ, 113)\n self.assertEqual(attempt.maxIndexW, 134)", "def ge(value, limit):\n return value >= limit", "def test_search_result_limit(self):\n results = self.searcher.search(\"crossfit\", 1)\n expected_results = 6\n\n ...
[ "0.68881065", "0.6564061", "0.62668943", "0.62494713", "0.6248431", "0.61881816", "0.61628884", "0.6153753", "0.6060004", "0.60404766", "0.60282886", "0.59904337", "0.5951805", "0.58911216", "0.5885915", "0.58667177", "0.5835754", "0.58134377", "0.57997984", "0.5789212", "0.5...
0.6418333
2
Test data on index
def test_data_index(self): response = self.client.get(reverse('index')) contacts = About_me.objects.all() self.assertEqual(response.status_code, 200) contact = contacts[0] self.assertContains(response, contact.name, 1) self.assertContains(response, contact.surname, 1) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_index(self):", "def test_index_1(self):\n self.insert()\n data = self.tbl[2]\n assert self.check(self.idata[:1], data)", "def test_index_12(self):\n self.insert()\n data = self.tbl[2:6]\n assert self.check(self.idata[:2], data)", "def index(self, data) -> No...
[ "0.7166318", "0.6860663", "0.6748695", "0.66822624", "0.66455626", "0.64820504", "0.6481012", "0.6464026", "0.6410718", "0.6402955", "0.6351595", "0.6257811", "0.6222863", "0.6171792", "0.61600935", "0.61552656", "0.61526006", "0.614832", "0.6077984", "0.6056383", "0.6048749"...
0.60891175
18
Draw a plot of the MSE against lambda. Draw a plot of the MSE of the learning curve for lambda = 0,1.
def plot_mse(mse, lambda0, lambda1, scale, loc='lower right'): import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(211) ax.plot(*zip(*mse)) plt.xlabel('$\lambda$') plt.ylabel('MSE') plt.yticks(scale) ax = fig.add_subplot(212) ax.plot(*zip(*lambda0), label='$\lam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cross_validation_visualization(lambdas, loss_train, loss_test):\n plt.semilogx(lambdas, loss_train, marker=\".\", color='b', label='train error')\n plt.semilogx(lambdas, loss_test, marker=\".\", color='r', label='test error')\n plt.xlabel(\"lambda\")\n plt.ylabel(\"rmse\")\n plt.title(\"cross va...
[ "0.6702873", "0.65018433", "0.64510727", "0.6430095", "0.63851696", "0.63240314", "0.62314105", "0.6179983", "0.6178999", "0.6125472", "0.61104375", "0.6096812", "0.6083498", "0.60187566", "0.5927236", "0.59271985", "0.5897805", "0.5864213", "0.58363026", "0.5832725", "0.5800...
0.7470588
0
! Brief Gets the binary and source files from the Github Release server [in] `tag_name` Git tag of the current release [in] `config` confi metadata set in main.py `List[ReleaseFile]` List of release files `Dict[str, SourceFile]` Dictionary of source files Sends an `HTTP GET` request to github using their REST API to re...
def get_release_files(tag_name, config) -> Tuple[List[ReleaseFile], Dict[str, SourceFile]]: @retry_multi(5) # retry at most 5 times def execute_request(path): """! @brief Performs a GET request with the given path. To be used with Github's REST API. @returns If successful, returns a .JS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(docker_hub_client, args):\n resp = docker_hub_client.get_tags(args.orgname, args.reponame, args.page)\n if resp['code'] == 200:\n if resp['content']['count'] > 0:\n rows = []\n for repo in resp['content']['results']:\n formatted_date = ''\n i...
[ "0.59825385", "0.58761805", "0.57182723", "0.5670623", "0.5653557", "0.56310666", "0.5565626", "0.55542344", "0.5533877", "0.5509498", "0.5492166", "0.5470247", "0.5463593", "0.5457297", "0.54524344", "0.54264504", "0.54025966", "0.53729427", "0.53684837", "0.5364324", "0.535...
0.80856
0
! Performs a GET request with the given path. To be used with Github's REST API. If successful, returns a .JSON object
def execute_request(path): headers = { "Accept": "application/vnd.github.v3+json" } url = "https://api.github.com" + path # GET https://api.github.com/<path> Accept: "application/vnd.github.v3+json" response = requests.get(url, headers=headers, timeout=GLOBAL_TIMEOU...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get(self, path):\n r = requests.get(self._url(path))\n assert r.status_code == 200\n return r.json", "def get(self, path):\n url = urljoin(self.api_endpoint, path)\n response = requests.get(url, headers=self.headers)\n if response.status_code == requests.codes.ok:\n...
[ "0.781501", "0.742558", "0.73796403", "0.7367606", "0.7359657", "0.7286444", "0.7283974", "0.7187162", "0.7146045", "0.7120918", "0.70935255", "0.7091099", "0.7059631", "0.7059341", "0.7053496", "0.70428777", "0.6986437", "0.69172233", "0.6824876", "0.6779515", "0.6770286", ...
0.78895104
0
! Gets file metadata for nightlies hosted on FTP, as determined by config["ftp"] attributes [in] `build_type` Unknown str [in] `tag_name` Github tag name of the release [in] `config` config metadata set in main.py
def get_ftp_files(build_type, tag_name, config) -> List[ReleaseFile] : tag_regex = re.compile("nightly_(.*)") build_group_regex = re.compile("nightly_.*-builds-([^.]+).*") files = [] try: with FTP(config["ftp"]["host"], config["ftp"]["user"], config["ftp"]["pass"]) as ftp: # extrac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clowder_file_metadata(session, url, fileid):\n try:\n ret = session.get(posixpath.join(url, \"api/files\", fileid, \"metadata.jsonld\"))\n except session.exceptions.RequestException as e:\n print(e)\n sys.exit(1)\n\n return ret", "def get_file_info(filename):\n info = {'build...
[ "0.58197266", "0.5817729", "0.57113373", "0.5679368", "0.5664209", "0.56055725", "0.5591246", "0.5514646", "0.54909694", "0.5488954", "0.5428965", "0.5408972", "0.5381461", "0.5341084", "0.5333622", "0.529747", "0.5256132", "0.5247465", "0.5238741", "0.52325314", "0.5205857",...
0.7348779
0
transfer stone move to position
def stone_to_position(self, stone): h = stone // self.width w = stone % self.width return [h, w]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_to_position2(self):", "def move_to_position1(self):", "def move(self):\n \n self.position = self.wander()", "def move(self, t, s):\n raise NotImplementedError", "def move(self):\n pass", "def _move(self, pos):\n self.put_par(\"drive\", pos)", "def move(self):\n ...
[ "0.7110552", "0.7046049", "0.68517804", "0.6788332", "0.6739552", "0.6662191", "0.66159", "0.6607741", "0.66004556", "0.6589189", "0.65886235", "0.6587148", "0.6581044", "0.6569676", "0.6508204", "0.6483405", "0.6483405", "0.64587206", "0.6450576", "0.6410704", "0.6390484", ...
0.0
-1
transfer position to stone move
def position_to_stone(self, position): if len(position) != 2: stone = -1 return stone h = position[0] w = position[1] stone = h * self.width + w if stone not in self.blanks: stone = -1 # -1 means the current position is blank. return s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_to_position2(self):", "def move_to_position1(self):", "def move(self, t, s):\n raise NotImplementedError", "def move(self, p):\r\n self.position.setvalue(p)", "def _move(self, pos):\n self.put_par(\"drive\", pos)", "def move(self):\n \n self.position = self.wander()", "d...
[ "0.7238608", "0.72178644", "0.7068272", "0.70608205", "0.70526797", "0.70513964", "0.69838834", "0.68845105", "0.6855295", "0.68376124", "0.6799809", "0.6792228", "0.67120403", "0.67116183", "0.66968364", "0.6694802", "0.6694802", "0.6679238", "0.6672615", "0.6611989", "0.657...
0.6144595
85
serialize triples to chosen format supported by rdflib, e.g. xml, turtle, n3, etc
def serialize(triples, format='xml'): g = Graph() for k, v in NAMESPACES.iteritems(): g.bind(k, v) for triple in triples: g.add(triple) return g.serialize(format=format)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize_nx_node_to_triples(g, key, node=None):\n\n node = node or g and g.node.get(key) # <curie/key> # ... precis\n\n yield (key, 'a', node.get('type')) # <> a <type>\n\n for attr,value in node.items():\n yield (key, attr, value)\n\n # MultiDiGraph\n for edge in g.edge.get(key):\n ...
[ "0.6063675", "0.5935797", "0.5933383", "0.5895876", "0.5845123", "0.5759756", "0.5708165", "0.5590648", "0.5548313", "0.55361754", "0.553367", "0.54797417", "0.54766667", "0.5440754", "0.5416236", "0.5388414", "0.53399545", "0.52932197", "0.52865195", "0.52275985", "0.522483"...
0.7633531
0
Returns an unbound port number on 127.0.0.1.
def find_unbound_port(): while True: port = random.randint(*PORT_RANGE) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: sock.bind(("127.0.0.1", port)) return port except socket.error: print("randomly generated port %d is bound. Trying...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_unused_port():\n sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)\n sock.bind(('127.0.0.1', 0))\n sock.listen(socket.SOMAXCONN)\n ipaddr, port = sock.getsockname()\n sock.close()\n return port", "def GetUnreservedAvailableLocalPort():\n tmp = socket.socket()\n tmp.bind((''...
[ "0.79000366", "0.7862578", "0.7742362", "0.7707025", "0.7701062", "0.7686607", "0.75873804", "0.75825536", "0.7564691", "0.7556933", "0.75550276", "0.7499802", "0.7461294", "0.74481964", "0.74385625", "0.7360805", "0.7261695", "0.71875924", "0.7181387", "0.7119721", "0.705185...
0.7919572
0
Sends an email to a single recipient straight to his MTA. Looks up for the MX DNS records of the recipient SMTP server and attempts the delivery through them.
def send(self): answers = dns.resolver.query(self.domain, 'MX') try: for answer in answers: ex = answer.exchange.to_text() server = smtplib.SMTP(ex) server.set_debuglevel(self.verbose) server.sendmail(self.sender, [self.recipien...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sendmail(self, message=None, subject=None, recipients=None):\n\n if not recipients:\n recipients = self.recipients\n if len(recipients) == 0:\n return False\n if not message:\n message = self.message\n if len(message) == 0:\n return False\...
[ "0.6710717", "0.6321565", "0.6236836", "0.62081426", "0.61137784", "0.6100117", "0.60243607", "0.6002686", "0.5987678", "0.59080464", "0.58790296", "0.5877092", "0.5850349", "0.584703", "0.5835367", "0.5779802", "0.5771508", "0.57684636", "0.5767812", "0.5765022", "0.5761345"...
0.7115084
0
Draw the balls with the instance variables we have.
def draw(self): arcade.draw_circle_filled(self.position_x, self.position_y, self.radius,self.player_color)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_balls():\n for ball in balls:\n circle(screen, ball[0], (ball[1], ball[2]), ball[3]) # Unpacking the list\n for super_ball in super_balls:\n\n # Indexes here are standing for attributes of a particular ball\n circle(screen, super_ball[0][0], (super_ball[1], super_ball[2]), supe...
[ "0.7544497", "0.72717285", "0.7104858", "0.70471215", "0.70353675", "0.7035234", "0.6977276", "0.69484216", "0.69450027", "0.6867404", "0.68497777", "0.6833817", "0.68177646", "0.6770142", "0.6718174", "0.6679501", "0.6672409", "0.66307396", "0.6562075", "0.6561223", "0.65567...
0.603697
69
Returns the URL patterns for the tasks in this module.
def getDjangoURLPatterns(): patterns = [ (r'^tasks/role_conversion/update_references', 'soc.tasks.updates.role_conversion.updateReferences'), (r'^tasks/role_conversion/update_project_references', 'soc.tasks.updates.role_conversion.updateStudentProjectReferences'), (r'^tasks/role_con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_urls(self):\n return patterns('')", "def urlpatterns(self) -> list:\n raise NotImplementedError()", "def urls(self):\n patterns = []\n for sitecomp in self.modules():\n patterns.append(sitecomp.urls)\n pass\n return patterns", "def get_urlpatte...
[ "0.806488", "0.79019696", "0.77767736", "0.77457875", "0.7669496", "0.7257227", "0.72470206", "0.7222794", "0.71079546", "0.7099592", "0.6999091", "0.69696224", "0.69434714", "0.6820142", "0.6814898", "0.67137235", "0.65810347", "0.6568117", "0.65677214", "0.6508116", "0.6471...
0.73678994
5
Retrieves Host entities and updates them.
def _process(self, start_key, batch_size): query = Host.all() if start_key: query.filter('__key__ > ', start_key) try: entities = query.fetch(batch_size) if not entities: # all entities has already been processed return for entity in entities: sponsor = en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, host, values):\n body = dict(host=values)\n return self._update(\"/os-hosts/%s\" % host, body, response_key='host')", "def update_entities(self):\n raise NotImplementedError()", "def _update(self, host):\n pass", "def updateHosts(request):\n\n updater = HostUpdat...
[ "0.6378616", "0.637841", "0.6262044", "0.6146535", "0.60497653", "0.6021344", "0.58923185", "0.5851923", "0.58246833", "0.58228207", "0.5775934", "0.57606995", "0.5750943", "0.57176685", "0.5707864", "0.5696682", "0.5694041", "0.56620866", "0.56598765", "0.5636623", "0.561254...
0.58728397
7
Retrieves entities and creates or updates a corresponding Profile entity.
def _process(self, start_key, batch_size): query = self.MODEL.all() if start_key: query.filter('__key__ > ', start_key) try: entities = query.fetch(batch_size) if not entities: # all entities has already been processed return for entity in entities: try: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_or_update_profile(sender, instance, created, **kwargs):\n if created:\n Profile.objects.get_or_create(user=instance)\n instance.profile.save()", "def put(self, entity, schema):\n profile = entity.profiles.get_or_404(schema=schema)\n try:\n update_data ...
[ "0.64870405", "0.62552613", "0.6051115", "0.59239256", "0.58894616", "0.5819506", "0.57753414", "0.5726608", "0.57217103", "0.57153684", "0.57094496", "0.5592464", "0.555779", "0.5557362", "0.55442387", "0.54769784", "0.54611975", "0.5444246", "0.54428214", "0.543341", "0.541...
0.0
-1
Starts a task which updates Host entities.
def updateHosts(request): updater = HostUpdater() updater.run() return http.HttpResponse("Ok")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def task_update(self):\n try:\n self.task_stop()\n except:\n pass\n self.update()\n self.task_start()", "def run(self, host=None):\n host = self.getFogHost(host)\n num = str(self.getHostNumber(host))\n url = self.baseURL+'host/'+num+'/task'\n...
[ "0.61557513", "0.61262894", "0.60907644", "0.6084399", "0.60169274", "0.5933414", "0.5857732", "0.5823845", "0.576409", "0.57177854", "0.5690923", "0.5690923", "0.5689642", "0.5662928", "0.56366426", "0.5623573", "0.5619283", "0.5595351", "0.5566154", "0.5556766", "0.55332905...
0.5953224
5
Starts a task which updates a particular role.
def updateRole(role_name): if role_name == 'gsoc_mentor': updater = RoleUpdater(GSoCMentor, GSoCProfile, 'program', 'mentor_for') elif role_name == 'gsoc_org_admin': updater = RoleUpdater( GSoCOrgAdmin, GSoCProfile, 'program', 'org_admin_for') elif role_name == 'gsoc_student': updater = RoleU...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_task_role(self, task_role):\n self._task_role = task_role", "async def add_role_task(request, role_id):\n required_fields = [\"id\"]\n utils.validate_fields(required_fields, request.json)\n\n txn_key, txn_user_id = await utils.get_transactor_key(request)\n proposal_id = str(uuid4())\n ...
[ "0.6109319", "0.59435666", "0.58605534", "0.57885265", "0.57772356", "0.5693943", "0.5665209", "0.5475637", "0.54697657", "0.5401682", "0.53825456", "0.53809744", "0.53789586", "0.53748226", "0.53713715", "0.5354459", "0.53443176", "0.5344153", "0.53337634", "0.5329121", "0.5...
0.57943815
3
Starts a bunch of iterative tasks which update particular roles. In order to prevent issues with concurrent access to entities, we set ETA so that each role is processed in separation.
def updateRoles(request): # update org admins #updateRole('gsoc_org_admin') # update mentors #updateRole('gsoc_mentor') # update students # we can assume that students cannot have any other roles, so we do not # need to set ETA updateRole('gsoc_student')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_all_tasks(self) -> None:\n for task in self.tasks:\n task.update()", "def bulk_sync_roles(self, roles: Iterable[dict[str, Any]]) -> None:\n existing_roles = self._get_all_roles_with_permissions()\n non_dag_perms = self._get_all_non_dag_permissions()\n\n for conf...
[ "0.5936855", "0.58089596", "0.5703131", "0.56316984", "0.5559666", "0.554634", "0.54972273", "0.5481171", "0.5464615", "0.54554266", "0.54547334", "0.5449495", "0.5407823", "0.5405636", "0.5350179", "0.5303881", "0.52390707", "0.521869", "0.5204585", "0.5203818", "0.5200803",...
0.52185994
18
Starts an iterative task which update mentors.
def updateMentors(request): return updateRole('gsoc_mentor')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_participants(self, information):\r\n for i in self.participants:\r\n self.send_function(information, i)", "def send_webmentions(self):\n logger.info(f'Starting {self.entity.label()}')\n\n try:\n self.do_send_webmentions()\n except:\n logger.info('Propagate task fai...
[ "0.5744302", "0.56678116", "0.56569344", "0.55961376", "0.54410976", "0.54232866", "0.5415032", "0.5403762", "0.53956664", "0.5371097", "0.5243041", "0.5193886", "0.51354474", "0.5118692", "0.5092727", "0.5062105", "0.50341845", "0.5032638", "0.5004585", "0.49946293", "0.4980...
0.0
-1
Starts an iterative task which update org admins.
def updateOrgAdmins(request): return updateRole('gsoc_org_admin')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def actualize(self):\r\n for guild, settings in self.bot.settings.items():\r\n # Grab the roles and their requirements\r\n guild = self.bot.get_guild(guild)\r\n base_member = settings.get(\"rank_basic_member_role_id\")\r\n base_member = guild.get_role(base_m...
[ "0.56836027", "0.5528564", "0.53884643", "0.5359931", "0.53472096", "0.5343001", "0.53295594", "0.53265554", "0.5268255", "0.5263433", "0.5232607", "0.52205235", "0.5219957", "0.52131385", "0.5176218", "0.5130246", "0.5106985", "0.50729245", "0.50512886", "0.50468695", "0.504...
0.59802717
0
Starts an iterative task which update students.
def updateStudents(request): return updateRole('gsoc_student')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self, update=lambda:None):\n for none in iter(self):\n update()", "def StartIteration(self):\n self._start_lock.set()", "def _create_students(self):\n def mktime(str_date):\n return time.mktime(time.strptime(\n str_date, CountSkillCompletion.DATE_...
[ "0.5711551", "0.55837", "0.5566305", "0.55462897", "0.5541314", "0.54941446", "0.5450676", "0.54401565", "0.5386207", "0.5259321", "0.5257888", "0.5240172", "0.5212263", "0.5201786", "0.51891994", "0.5165347", "0.5165258", "0.51381665", "0.51311505", "0.511731", "0.51140714",...
0.0
-1