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
Delete all the processed files.
def clean(): clean_flatbuffer_binaries() clean_webp_textures()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup_files(self):\n\n self.backup_files()\n self.delete_files()", "def teardown():\n for filename in files_to_delete:\n delete_file(filename)", "def deleteAllFiles(self, flush=True): \n \n if flush: \n self.flush(False) \n \n for filePath i...
[ "0.8073947", "0.79849833", "0.77544034", "0.76999974", "0.7654225", "0.7631646", "0.75604534", "0.753863", "0.753267", "0.74747413", "0.74153626", "0.7402632", "0.74007124", "0.737596", "0.73452044", "0.7335899", "0.72531056", "0.72057813", "0.7180837", "0.71535826", "0.71242...
0.0
-1
Prints an error message to stderr for BuildErrors.
def handle_build_error(error): sys.stderr.write('Error running command `%s`. Returned %s.\n' % ( ' '.join(error.argv), str(error.error_code)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error(message):\n print(message, file=sys.stderr)", "def perror(message):\n print(message, file=sys.stderr)", "def error(*args, **kwargs): # pragma: nocover\n kwargs['file'] = sys.stderr\n print(\"\\n\\tERROR:\", *args, **kwargs)\n if args and args[0].startswith(\"[Errno 2] No such file or ...
[ "0.70509905", "0.6726131", "0.6711041", "0.6696196", "0.6692284", "0.6691786", "0.6670899", "0.6622568", "0.65966165", "0.65933764", "0.65801626", "0.65647084", "0.65214205", "0.65149754", "0.6462072", "0.6449125", "0.6441902", "0.64412487", "0.64282566", "0.6401715", "0.6378...
0.7691449
0
Builds or cleans the assets needed for the game. To build all assets, either call this script without any arguments. Or alternatively, call it with the argument 'all'. To just convert the flatbuffer json files, call it with 'flatbuffers'. Likewise to convert the png files to webp files, call it with 'webp'. To clean al...
def main(argv): target = argv[1] if len(argv) >= 2 else 'all' if target not in ('all', 'flatbuffers', 'webp', 'clean'): sys.stderr.write('No rule to build target %s.\n' % target) if target in ('all', 'flatbuffers'): try: generate_flatbuffer_binaries() except BuildError as error: handle_bu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n # Create / clean output dir\n if os.path.isdir(OUT_DIR):\n shutil.rmtree(OUT_DIR)\n os.mkdir(OUT_DIR)\n\n # Write all assets to the directory\n for fname, bb in create_assets().items():\n filename = os.path.join(OUT_DIR, fname)\n dirname = os.path.dirname(filename)...
[ "0.6964526", "0.66298175", "0.6555965", "0.6412335", "0.63683194", "0.62495744", "0.6218879", "0.61988807", "0.5852595", "0.5839395", "0.57132334", "0.56508654", "0.56002307", "0.55775255", "0.5536666", "0.5529399", "0.5503569", "0.54786825", "0.5461011", "0.54588944", "0.541...
0.6148051
8
Run this step of the test case
def run(self): config = self.config section = config['isomip_plus'] nx = section.getint('nx') nx_thin_film = section.getint('nx_thin_film') ny = section.getint('ny') dc = section.getfloat('dc') thin_film_present = self.thin_film_present # Add xOffset to r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def TestOneStep(self):\n pass", "def runtest(self):", "def run_one_step(self):\n pass", "def startTestRun(self):", "def runTests(self):\n \n pass", "def run_test(self):\n raise NotImplementedError", "def do_step(self) -> None:", "def test_run_started(self):", "def tes...
[ "0.8038066", "0.78981537", "0.76758826", "0.76324797", "0.76222134", "0.7562166", "0.7524746", "0.7261119", "0.721741", "0.71878743", "0.71847486", "0.71788085", "0.71688485", "0.71360976", "0.7106595", "0.7101748", "0.7101748", "0.7101748", "0.7101748", "0.7101748", "0.71017...
0.0
-1
Trace streamlines from the VAR files and integrate quantity 'intQ' along them.
def tracers(traceField = 'bb', hMin = 2e-3, hMax = 2e4, lMax = 500, tol = 1e-2, interpolation = 'weighted', trace_sub = 1, intQ = [''], varfile = 'VAR0', ti = -1, tf = -1, integration = 'simple', datadir = 'data/', destination = 'tracers.dat', nproc = 1): # returns t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main ():\n\n # interval ends\n a,b = -1.0, +1.0\n\n # List of trapezium counts\n NVals = numpy.logspace (1, 8, base=10.0, num=6, dtype=numpy.int)\n\n # List of implementations\n intFuncList = [ \n (integral.trapintPython, \"python.txt\")\n#\t\t (integral.trapintNumPy, \"numpy...
[ "0.5122127", "0.5042279", "0.50375813", "0.50055116", "0.49259466", "0.49082893", "0.49023333", "0.48582718", "0.4848228", "0.48448798", "0.48392555", "0.48325005", "0.48325005", "0.48318058", "0.48191267", "0.48185733", "0.48029333", "0.478208", "0.47781596", "0.47741887", "...
0.5018485
3
Reads the tracer files and composes a color map.
def read_tracers(datadir = 'data/', fileName = 'tracers.dat', zlim = [], head_size = 3, post = False): class data_struct: def __init__(self): self.xi = [] self.yi = [] self.xf = [] self.yf = [] self.zf = [] self.l = [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readColourMap (self):\r\n \r\n num = self.bih_vals [bih_ColorsUsed]\r\n\r\n if num > 0:\r\n self.colourmap = [BLACK_FOUR] * num\r\n \r\n for i in range (0, num):\r\n self.colourmap [i] = self.the_file.read (4)", "def ListColorMaps(self):\n ...
[ "0.60259837", "0.5459343", "0.5394355", "0.53032047", "0.52739567", "0.5265471", "0.52411604", "0.5181697", "0.5113824", "0.5103776", "0.50683075", "0.504613", "0.50393397", "0.4961276", "0.49567044", "0.4953596", "0.4949384", "0.49407956", "0.49344715", "0.4923586", "0.49077...
0.5387882
3
Plots the color mapping together with the fixed points. Creates a movie file.
def tracer_movie(datadir = 'data/', tracerFile = 'tracers.dat', fixedFile = 'fixed_points.dat', zlim = [], head_size = 3, hm = 1, imageDir = './', movieFile = 'fixed_points.mpg', fps = 5.0, bitrate = 1800): import pylab as plt # read the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show(self, view = None, save = False, savename = None, cmap = None):\n\n # define the style\n if cmap == None:\n style = PlotStyle(cmap_name = 'macplus')\n else:\n style = PlotStyle(cmap_name = cmap)\n \n # default is skymap\n if view == None:...
[ "0.66461504", "0.6347427", "0.6157591", "0.6120898", "0.6077686", "0.60383564", "0.6011217", "0.59548956", "0.59487545", "0.594416", "0.58821493", "0.5876597", "0.5861647", "0.58368415", "0.58342564", "0.58336323", "0.5828103", "0.5826117", "0.5800824", "0.57943434", "0.57858...
0.72189265
0
Plots an image and the projections (sums) of it on the x, y axes.
def plot_image_and_proj(image, title="", **kwargs): fig = plt.figure() gs = gridspec.GridSpec(3, 2, width_ratios=[3, 1], height_ratios=[0.2, 3, 1]) ax0 = plt.subplot(gs[1,0]) plt.title(title) ims = plt.imshow(image, aspect="auto", **kwargs) ax2 = plt.subplot(gs[2,0], sharex=ax0, ) plt....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show(image):\n fig = pyplot.figure()\n ax = fig.add_subplot(1,1,1)\n imgplot = ax.imshow(image, cmap=mpl.cm.Greys)\n imgplot.set_interpolation('nearest')\n ax.xaxis.set_ticks_position('top')\n ax.yaxis.set_ticks_position('left')\n pyplot.show()", "def show(image):\n fig = pyplot.figur...
[ "0.6885412", "0.6744014", "0.6729617", "0.6729617", "0.6729617", "0.66539717", "0.6561349", "0.6445221", "0.64222753", "0.6366756", "0.62954986", "0.62783086", "0.6277011", "0.6251577", "0.623828", "0.62100685", "0.62035716", "0.6173411", "0.6167177", "0.61653167", "0.6155882...
0.7413701
0
rebins a numpy array.
def rebin(a, *args): shape = a.shape lenShape = len(shape) factor = np.asarray(shape) / np.asarray(args) #print factor evList = ['a.reshape('] + ['args[%d],factor[%d],' % (i, i) for i in range(lenShape)] + [')'] + ['.mean(%d)' % (i + 1) for i in range(lenShape)] return eval(''.join(evList))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rebin(array, dimensions=None, scale=None):\n if dimensions is not None:\n if isinstance(dimensions, float):\n dimensions = [int(dimensions)] * len(array.shape)\n elif isinstance(dimensions, int):\n dimensions = [dimensions] * len(array.shape)\n elif len(dimensions)...
[ "0.7262481", "0.65253717", "0.65092903", "0.64562315", "0.63404644", "0.633843", "0.6212981", "0.62020236", "0.6028213", "0.5951686", "0.5910494", "0.5862693", "0.57666206", "0.57557595", "0.57353413", "0.5715855", "0.5715112", "0.5693231", "0.5686959", "0.56741536", "0.56739...
0.5666983
22
Request data for a list of block hashes.
def send_get_data(self, block_hashes): msg = msg_getdata() for x in block_hashes: msg.inv.append(CInv(MSG_BLOCK, x)) self.send_message(msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_blocks():\n chain_to_send = blockchain\n blocklist = \"\"\n for i in range(len(chain_to_send)):\n block = chain_to_send[i]\n block_index = str(block.index)\n block_timestamp = str(block.timestamp)\n block_data = str(block.data)\n block_hash = block.hash\n ...
[ "0.6409231", "0.6145271", "0.6124917", "0.59927475", "0.5951528", "0.5827728", "0.5783262", "0.57184494", "0.56973565", "0.56766754", "0.5650549", "0.5647434", "0.5635516", "0.56190014", "0.5569193", "0.5569193", "0.55531555", "0.55520594", "0.55443203", "0.5535596", "0.55184...
0.70251316
0
Test whether the last headers announcements received are right. Headers may be announced across more than one message.
def check_last_headers_announcement(self, headers): test_function = lambda: (len(self.recent_headers_announced) >= len(headers)) self.wait_until(test_function) with p2p_lock: assert_equal(self.recent_headers_announced, headers) self.block_announced = False sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_bad_headers(self):\n\n headers = [self.sender, self.reply_to] + self.recipients\n for header in headers:\n if _has_newline(header):\n return True\n\n if self.subject:\n if _has_newline(self.subject):\n for linenum, line in enumerate(s...
[ "0.65723264", "0.61208695", "0.6049333", "0.6003903", "0.59692436", "0.5896339", "0.5871474", "0.5851515", "0.57597494", "0.57581687", "0.57434636", "0.57434636", "0.573652", "0.57329977", "0.5717457", "0.5645279", "0.55954987", "0.55861056", "0.55829144", "0.555257", "0.5521...
0.8560445
0
Test whether the last announcement received had the right inv. inv should be a list of block hashes.
def check_last_inv_announcement(self, inv): test_function = lambda: self.block_announced self.wait_until(test_function) with p2p_lock: compare_inv = [] if "inv" in self.last_message: compare_inv = [x.hash for x in self.last_message["inv"].inv] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def InventoryReceived(self, inventory):\n if inventory.Hash.ToBytes() in self._MissedBlocks:\n self._MissedBlocks.remove(inventory.Hash.ToBytes())\n\n if inventory is MinerTransaction:\n return False\n\n if type(inventory) is Block:\n if BC.Default() is None:\n...
[ "0.61076456", "0.5824365", "0.5646299", "0.5420734", "0.5327307", "0.5240005", "0.5224036", "0.5191901", "0.51852673", "0.5120963", "0.51135236", "0.51021546", "0.506925", "0.5056993", "0.50302124", "0.49842632", "0.4932219", "0.4904889", "0.49018604", "0.48957723", "0.487126...
0.87524366
0
Mine count blocks and return the new tip.
def mine_blocks(self, count): # Clear out block announcements from each p2p listener [x.clear_block_announcements() for x in self.nodes[0].p2ps] self.generatetoaddress(self.nodes[0], count, self.nodes[0].get_deterministic_priv_key().address) return int(self.nodes[0].getbestblockhash(), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_blocks(self): # -> int:\n ...", "def getblocknumber(self):\n return self.getblockcount()", "def calculate_tip(meal_base, tip_rate):", "def getblockcount(self):\n return self.proxy.getblockcount()", "def parent_block_count(self):\n return self.block_count", "def parent_...
[ "0.5717195", "0.5667572", "0.56337124", "0.5575411", "0.5538822", "0.55174536", "0.54982716", "0.5473228", "0.53758806", "0.5342303", "0.53158927", "0.5282329", "0.521116", "0.52065545", "0.52049637", "0.5188872", "0.5170571", "0.5148232", "0.5138396", "0.50767654", "0.507296...
0.6711444
0
Mine a reorg that invalidates length blocks (replacing them with length+1 blocks).
def mine_reorg(self, length): # make sure all invalidated blocks are node0's self.generatetoaddress(self.nodes[0], length, self.nodes[0].get_deterministic_priv_key().address) for x in self.nodes[0].p2ps: x.wait_for_block_announcement(int(self.nodes[0].getbestblockhash(), 16)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simple_reorg(self, height, shift=0):\n hashes = []\n fee_delta = 1000000\n orig_len = self.rpc.getblockcount()\n old_hash = self.rpc.getblockhash(height)\n if height + shift > orig_len:\n final_len = height + shift\n else:\n final_len = 1 + orig_l...
[ "0.57378554", "0.5465236", "0.5457202", "0.5445514", "0.54246277", "0.5282873", "0.52699226", "0.5255896", "0.5254636", "0.52333164", "0.51682156", "0.5163101", "0.51473725", "0.5139157", "0.5117177", "0.5074714", "0.5061125", "0.50600505", "0.50330913", "0.50164944", "0.5009...
0.749667
0
Runs the whole wikipedia search, together with lyrics finding.
def run_wiki(self): if self._GUI: self._run_wiki_gui() else: self._run_wiki_nogui()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def wikipedia(self, ctx, *args):\n if args[0] == 'random':\n search_string = wp.random()\n else:\n search_string = ' '.join(args)\n try:\n page = wp.page(search_string)\n await ctx.send(page.url)\n self.logger.info(misolog.format_log...
[ "0.67166257", "0.6488033", "0.6475075", "0.64746183", "0.64621586", "0.6325236", "0.63031155", "0.6220119", "0.6122326", "0.6061428", "0.6002297", "0.5992761", "0.5969819", "0.59484017", "0.5912623", "0.58962756", "0.5869023", "0.58089393", "0.58037156", "0.5797445", "0.57879...
0.62240905
7
Runs wikipedia search with specifics of the GUI mode.
def _run_wiki_gui(self): # download wikipedia page and track progress for message in self._get_preload_progress(): self._log.info(message) # get error messages error_msg = self.get_wiki() if error_msg: self._log.exception(error_msg) return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_wiki(self):\n if self._GUI:\n self._run_wiki_gui()\n else:\n self._run_wiki_nogui()", "def _run_wiki_nogui(self):\n # start wikipedia page download\n self._log_print(msg_WHITE=\"Accessing Wikipedia...\")\n\n # download wikipedia page and track prog...
[ "0.76001346", "0.6732584", "0.66468334", "0.64920026", "0.637046", "0.6308497", "0.62137115", "0.61376846", "0.59760535", "0.58787346", "0.58726466", "0.5860763", "0.57994395", "0.5774797", "0.575818", "0.5740816", "0.57193905", "0.5642093", "0.55962086", "0.55757457", "0.556...
0.66015536
3
Runs wikipedia search with specifics of the CLI mode.
def _run_wiki_nogui(self): # start wikipedia page download self._log_print(msg_WHITE="Accessing Wikipedia...") # download wikipedia page and track progress for message in self._get_preload_progress(): if "Searching for" in message: print(f"Searching for: {GRE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\r\n\tlang = get_arguments()\r\n\twiki_analyzer(lang)", "def run_wiki(self):\n if self._GUI:\n self._run_wiki_gui()\n else:\n self._run_wiki_nogui()", "async def wikipedia(self, ctx, *args):\n if args[0] == 'random':\n search_string = wp.random()...
[ "0.69756997", "0.67441213", "0.6535245", "0.64060724", "0.63568765", "0.6059705", "0.6055238", "0.6047968", "0.6033085", "0.60146636", "0.5997462", "0.59583163", "0.5935665", "0.59245986", "0.5850023", "0.57979184", "0.5791227", "0.57871526", "0.57797074", "0.57765484", "0.57...
0.58614343
14
Runs only the lyrics search.
def run_lyrics(self): if self._GUI: self._run_lyrics_gui() else: self._run_lyrics_nogui()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _run_lyrics_gui(self):\n self._log.info(\"Searching for lyrics\")\n\n self.save_lyrics(find=True)\n Action(\"load\", load=True)\n\n self._log.info(\"Done\")", "def _run_lyrics_nogui(self):\n self.read_files()\n\n # find lyrics\n self._log_print(msg_GREEN=\"Sea...
[ "0.7195334", "0.6765707", "0.625291", "0.5987377", "0.595524", "0.5927061", "0.5899226", "0.5836227", "0.5817641", "0.5816498", "0.579893", "0.574689", "0.57248443", "0.56937945", "0.56414646", "0.56008506", "0.5592254", "0.55891544", "0.55754983", "0.5552696", "0.5535671", ...
0.67778045
1
Runs only lyrics search with specifics of the GUI mode.
def _run_lyrics_gui(self): self._log.info("Searching for lyrics") self.save_lyrics(find=True) Action("load", load=True) self._log.info("Done")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_lyrics(self):\n if self._GUI:\n self._run_lyrics_gui()\n else:\n self._run_lyrics_nogui()", "def _run_lyrics_nogui(self):\n self.read_files()\n\n # find lyrics\n self._log_print(msg_GREEN=\"Searching for lyrics\")\n\n self.save_lyrics()\n\n ...
[ "0.7300415", "0.66114295", "0.60927004", "0.5863751", "0.57411414", "0.5515903", "0.54406303", "0.54393154", "0.54014164", "0.53518796", "0.53172654", "0.5292283", "0.52921987", "0.52903503", "0.52819675", "0.52603555", "0.5241229", "0.5237763", "0.5199213", "0.5194571", "0.5...
0.7690281
0
Runs only lyrics search with specifics of the CLI mode.
def _run_lyrics_nogui(self): self.read_files() # find lyrics self._log_print(msg_GREEN="Searching for lyrics") self.save_lyrics() if not self.write_tags(): self._log_print(msg_WHITE="Cannot write tags because there are no " "coresponding...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_lyrics(self):\n if self._GUI:\n self._run_lyrics_gui()\n else:\n self._run_lyrics_nogui()", "def _run_lyrics_gui(self):\n self._log.info(\"Searching for lyrics\")\n\n self.save_lyrics(find=True)\n Action(\"load\", load=True)\n\n self._log.in...
[ "0.6299983", "0.61536944", "0.5727433", "0.56997216", "0.5563074", "0.5563074", "0.5563074", "0.5563074", "0.5563074", "0.5563074", "0.5563074", "0.5563074", "0.5563074", "0.5563074", "0.5563074", "0.5563074", "0.5563074", "0.5563074", "0.5563074", "0.5563074", "0.5563074", ...
0.57702047
2
Redirects the input to sandard print function and to logger.
def _log_print(self, msg_GREEN: str = "", msg_WHITE: str = "", level: str = "INFO"): if msg_GREEN != "": print(GREEN + "\n" + msg_GREEN) if msg_WHITE != "": print(msg_WHITE) if self.with_log: msg_GREEN = msg_GREEN + msg_WHITE i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log(self, *args):\n self.log_stdout(*args)\n print(*args, file=self.general_log_file.file)\n self.general_log_file.flush()", "def logd(*args,**kwargs):\n print(*args,**kwargs)", "def logi(*args,**kwargs):\n print(*args,**kwargs)", "def print_to_log(self, output):\n print...
[ "0.61365193", "0.5962254", "0.5897776", "0.5858442", "0.5809685", "0.58020663", "0.57541764", "0.57420594", "0.57316464", "0.57227707", "0.5666022", "0.56396466", "0.5610015", "0.559532", "0.55662394", "0.55633086", "0.5562591", "0.55440575", "0.55145746", "0.5485701", "0.544...
0.0
-1
Instantiates and returns the list of permissions that this view requires.
def get_permissions(self): from rest_framework.permissions import IsAuthenticated, IsAdminUser if self.action =='retrieve' or self.action == 'update': permission_classes = [IsAuthenticated] else: permission_classes = [IsAdminUser] return [permission() for permissi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_permissions(self):\n if self.action == 'list':\n permission_classes = [IsAuthenticated]\n else:\n permission_classes = [IsAdminUser]\n return [permission() for permission in permission_classes]", "def get_permissions(self):\n if self.action in ['list', 'r...
[ "0.77929497", "0.7738158", "0.76905394", "0.7635271", "0.7618894", "0.7523193", "0.7523193", "0.7523193", "0.7497525", "0.74957764", "0.74865115", "0.7463958", "0.7431705", "0.7407442", "0.7388661", "0.73826563", "0.73599124", "0.73599124", "0.7338907", "0.73276186", "0.73226...
0.7412355
13
Performs check of Batch Job Definition resources.
def validate_batch_jobdef(jobdef_name, jobdef_meta): jobdef_config = [ { 'field_name': 'job_definition_name', 'field_value': jobdef_name, 'prefix': '', 'validators': [ _validate_required_field ] }, { 'fie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check(job, logger, **kwargs):\n resources = Resource.objects.filter(\n attributes__field__name=\"health_check_config\",\n lifecycle='ACTIVE'\n ).distinct()\n set_progress(\n f\"Will run health checks for {resources.count()} resource(s): \"\n f\"{[resource.name for resource ...
[ "0.62273604", "0.6216369", "0.6215212", "0.6123421", "0.5834572", "0.5767516", "0.57664996", "0.57414484", "0.5740669", "0.5720601", "0.5710162", "0.5699154", "0.56262213", "0.56172216", "0.560389", "0.5580481", "0.5572657", "0.55699986", "0.5552269", "0.55290383", "0.5528586...
0.5939888
4
Performs check of Batch Job Definition container properties.
def _validate_container_properties(container_properties, prefix=None): if not prefix: prefix = 'container_properties' container_config = [ { 'field_name': 'image', 'field_value': container_properties.get('image'), 'prefix': prefix, 'required_type'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_batch_jobdef(jobdef_name, jobdef_meta):\n jobdef_config = [\n {\n 'field_name': 'job_definition_name',\n 'field_value': jobdef_name,\n 'prefix': '',\n 'validators': [\n _validate_required_field\n ]\n },\n {\n...
[ "0.5902173", "0.5750896", "0.56742275", "0.5597777", "0.5589587", "0.54979694", "0.5465641", "0.5424713", "0.5351139", "0.53396976", "0.5328847", "0.53148127", "0.5310186", "0.52777135", "0.5270606", "0.5264659", "0.526109", "0.52511007", "0.5231011", "0.52110624", "0.5206256...
0.5885001
1
Performs check of Batch Job Definition node properties.
def _validate_node_properties(node_properties): prefix = "node_properties" node_config = [ { 'field_name': 'num_nodes', 'field_value': node_properties.get('num_nodes'), 'prefix': prefix, 'required_type': int, 'validators': [ _v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_check(self):\n res = self.entity.do_check(self.context)\n if res:\n return self.RES_OK, 'Node check succeeded.'\n else:\n return self.RES_ERROR, 'Node check failed.'", "def testJobProperties(databases):\n\n def checkProperties(config):\n jobId = 'job0'\...
[ "0.5726081", "0.5479812", "0.5411448", "0.54105157", "0.5342148", "0.533808", "0.53298527", "0.53278095", "0.52813226", "0.5255622", "0.52098536", "0.51880246", "0.5187591", "0.51826173", "0.51661396", "0.5164461", "0.5122845", "0.50707555", "0.50669897", "0.5056435", "0.4971...
0.52965343
8
Checks whether a field contains value from options list.
def _validate_options_field(field_name, field_value, field_options, prefix='compute_resources', required=True, **kwargs): if prefix: field_name = prefix + '__' + field_name if not required and not field_value: return if required and not field_value: raise...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_field(self, field):\n return field in self.extra_fields", "def validate_list(self, field: str, valid_options: List[str]):\n val = getattr(self, field)\n if isinstance(val, list):\n for v in val:\n if v not in valid_options:\n raise ConfigE...
[ "0.6772843", "0.6770741", "0.65378916", "0.6467454", "0.64476067", "0.642903", "0.6388305", "0.63799673", "0.6366266", "0.6352894", "0.62737393", "0.62451977", "0.6222812", "0.61857563", "0.61797684", "0.6174338", "0.6145381", "0.61405945", "0.6127393", "0.6114891", "0.608521...
0.58903366
33
Checks whether a field is not empty.
def _validate_required_field(field_name, field_value, prefix='', **kwargs): if prefix: field_name = prefix + '__' + field_name if not field_value: raise AssertionError( "Missing required Job Definition field: {0}".format(field_name) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fields_not_empty(self, request, fields):\r\n for field in fields:\r\n if request.form.get(field) == \"\":\r\n return True", "def is_field_empty(*args):\n for field in args:\n if field == \"\" or field is None:\n return True\n return False\n retu...
[ "0.8196847", "0.8190954", "0.7810049", "0.76465976", "0.74038506", "0.7305314", "0.71583134", "0.7110507", "0.70736223", "0.7062157", "0.702601", "0.7011126", "0.6952208", "0.6849574", "0.684919", "0.6829089", "0.6820689", "0.67973214", "0.67973214", "0.6735313", "0.668302", ...
0.0
-1
Class to create sqlalchemy engine that creates a connection to the postgresql database
def __init__(self): with open('config.json') as config: data = json.load(config) password = self.decode_password(data['db']['password']) db_conn_string = 'postgresql://' + data['db']['username'] + ':' + password + '@' + \ data['db']['hostname'] + ':' + data['db'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_engine(self):\n connection_string = f'postgresql://{self.user}:{self.password}@{self.host}/{self.database_name}'\n return create_engine(connection_string)", "def postgres_engine():\n return create_engine(\n \"postgresql+psycopg2://postgres:postgres@localhost:5432/postgres\"\n ...
[ "0.85938287", "0.81512064", "0.7748867", "0.7690821", "0.76155734", "0.75913906", "0.75913906", "0.75913906", "0.75913906", "0.7512063", "0.75113755", "0.75113755", "0.75113755", "0.75113755", "0.75113755", "0.74599236", "0.74490184", "0.7440237", "0.7433673", "0.7428703", "0...
0.7128721
37
Create a new DB table for the DataFrame
def create_db_dataframe(self, df, table_name): try: print("-I- Writing " + table_name + " with DataFrame") df.to_sql(name=table_name, con=self.engine, if_exists='replace', index=True) print("-I- Write complete.") except Exception as e: print("-W- " + str(e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_from_dataframe(self):\n self.insert()\n data = self.tbl.select()\n data.index.name = None\n tbl = Table.create(':memory:', \"Foo_2\", data, verbose=True,\n primary_key='id', autoincrement=True)\n self.check(self.idata, tbl.select())", "...
[ "0.77422994", "0.7363433", "0.7361235", "0.73389554", "0.7315704", "0.7284163", "0.7265219", "0.71784484", "0.71592116", "0.7123823", "0.7109681", "0.7104714", "0.7104014", "0.70893764", "0.7065188", "0.7056585", "0.70464426", "0.7045202", "0.7043078", "0.70418227", "0.703520...
0.7874062
0
Appends DataFrame to the specified table
def append_db_dataframe(self, df, table_name): try: print("-I- Appending " + table_name + " with DataFrame") df.to_sql(name=table_name, con=self.engine, if_exists='append', index=True) print("-I- Append complete.") except Exception as e: print("-W- " + str...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append_data(self, table_name, df):\n\t\tself.__check_colnames(table_name, df)\n\t\tif self.__dbfile is not None:\n\t\t\tdf.to_sql(table_name, self._conn, index=False, if_exists=\"append\")", "def append_table(self, table):\n if not table:\n return\n\n indexes = []\n for idx in...
[ "0.7775088", "0.7292738", "0.71129256", "0.6842862", "0.67572284", "0.65789384", "0.6511594", "0.6447779", "0.6344674", "0.6329825", "0.6316417", "0.63103884", "0.63037944", "0.62382275", "0.6213505", "0.6189217", "0.6157169", "0.6135792", "0.60964775", "0.60880053", "0.60660...
0.7644748
1
Fetch table rows as DataFrame from DB
def fetch_db_dataframe(self, table_name): try: df = pd.read_sql("SELECT * from " + table_name, self.engine) print("-I- Completed read of DataFrame from " + table_name) return df except Exception as e: print("-W- " + str(e))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_df_from_db(self, query):\n cursor = self.conn.cursor()\n cursor.execute(query)\n data = cursor.fetchall()\n col_des = cursor.description\n col_des = [tuple([x[0].split('.')[1] if '.' in x[0] else x[0]] + list(x[1:])) for x in col_des]\n col_name = [col_des[i][0] fo...
[ "0.77204275", "0.7645398", "0.7582545", "0.75139314", "0.7212028", "0.71883446", "0.7178315", "0.71595347", "0.7121151", "0.71134925", "0.7097488", "0.7083992", "0.70649976", "0.70540386", "0.70290405", "0.7011723", "0.6963181", "0.6963087", "0.6963087", "0.6942861", "0.69389...
0.7459254
4
Function to drop a table from database
def delete_table(self, table_name): try: conn = self.engine.connect() conn.execute("DROP table " + table_name) print("-I- Deleted table " + table_name) except Exception as e: print("-W- " + str(e))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drop_table(database, table):\n sql = \"\"\"DROP TABLE %s\"\"\" % table\n print \"Dropping Table %s from the Database %s\" % (table, database)\n execute_and_commit_sql(database, sql)\n return None", "def drop_table(self, tablename):\n # print \"table dropped\"\n # return\n que...
[ "0.8561063", "0.8105781", "0.80805856", "0.80335814", "0.80307484", "0.80158985", "0.7943399", "0.7852007", "0.7827041", "0.7801511", "0.77916324", "0.7746427", "0.7729509", "0.7694827", "0.7643605", "0.7637667", "0.7588141", "0.7575856", "0.75757736", "0.7534007", "0.7496094...
0.74913865
22
Set up method to run before each test path. This method is what we will test against.
def setUp(self): # Below creating the new contact object to test. self.new_contact = Contact( "James", "Muriuki", "0712345678", "james@moringaschool.com")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n test_env_setup()", "def setUp(self):\n\n BaseTest.setUp(self)", "def before_run_tests(cls):\n pass", "def setUp(self):\n MainTests.setUp(self)", "def setUp(self):\r\n # nothing to do, all tests use different things\r\n pass", "def setUp(self):\...
[ "0.7800788", "0.7673815", "0.76113003", "0.7583631", "0.7572131", "0.7566645", "0.75313616", "0.7520116", "0.7492312", "0.7445783", "0.7420635", "0.7420635", "0.7404525", "0.7404525", "0.7394234", "0.73852617", "0.7367745", "0.7367745", "0.7335178", "0.7313432", "0.7313432", ...
0.0
-1
tearDown method that does clean up after each test case has run.
def tearDown(self): # Here the tearDown() method assigns the contact_list in the Contact class empty. This helps us get accurate test results everytime have a new test case Contact.contact_list = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tearDown(self):\n pass\n # teardown called after each test\n # e.g. maybe write test results to some text file", "def tearDown(self):\n\n BaseTest.tearDown(self)", "def tearDown(self):\r\n testing.tearDown()", "def tearDown(self):\n test_env_teardown()", "def t...
[ "0.902119", "0.85692024", "0.8544352", "0.85033065", "0.8487935", "0.8463634", "0.8455392", "0.83962137", "0.83711165", "0.83711165", "0.83711165", "0.8367389", "0.835362", "0.8340901", "0.8315141", "0.8311377", "0.8311377", "0.82752293", "0.82752293", "0.8262432", "0.8262432...
0.0
-1
has to be called test_init. This is to test if the object is initialized properly.
def test_init(self): # the self.assertEqual() checks fofr an expected result # We are checking if the name and description of our new object is what we actually put self.assertEqual(self.new_contact.first_name, "James") self.assertEqual(self.new_contact.last_name, "Muriuki") self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_01_Init(self):\n pass", "def test_constructor(self):\n pass", "def test_init(self):\n DummyCryptographicObject()", "def test_init_default(self):\n self._test_init_default()", "def _init(self):\n pass", "def test_init(self):\n self.assertIsNotNone(Databas...
[ "0.83787113", "0.8083209", "0.79607624", "0.77785724", "0.771468", "0.76992875", "0.769153", "0.7689209", "0.7689209", "0.7689209", "0.7689209", "0.7689209", "0.7689209", "0.7689209", "0.7689209", "0.7661461", "0.76603156", "0.7660213", "0.76516056", "0.76247585", "0.76247585...
0.7438927
38
test_save_contact test case to test if the contact object is saved into the contact list
def test_save_contact(self): # .save_contact() is the save to contact function. # Test would check if an addition has been made to our contact list self.new_contact.save_contact() self.assertEqual(len(Contact.contact_list), 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_save_contact(self):\n self.new_contact.save_contact() # saving the new contact\n self.assertEqual(len(Contact.contact_list), 1)", "def test_save_multiple_contacts(self):\n self.new_contact.save_contact() # saving the new contact\n test_contact = Contact(\"Test\", \"User\", ...
[ "0.90264815", "0.8396352", "0.8371293", "0.7489064", "0.73771274", "0.7365106", "0.7324921", "0.730443", "0.7194348", "0.7193277", "0.7079255", "0.70014966", "0.69934404", "0.6915084", "0.691342", "0.6848425", "0.68055904", "0.67810017", "0.67704403", "0.67631304", "0.6691770...
0.8957478
1
def test_save_multiple_contact to check if we can save multiple contacts to our contact_list
def test_save_multiple_contact(self): self.new_contact.save_contact() # new contact test_contact = Contact("Test", "user", "0798765432", "test@user.com") test_contact.save_contact() self.assertEqual(len(Contact.contact_list), 2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_save_multiple_contacts(self):\n self.new_contact.save_contact() # saving the new contact\n test_contact = Contact(\"Test\", \"User\", 254712345678, \"test@user.com\") # new user\n test_contact.save_contact() # saving the new contact\n self.assertEqual(len(Contact.contact_lis...
[ "0.91369456", "0.8120368", "0.80584645", "0.73653406", "0.70864254", "0.70563537", "0.7039114", "0.70254576", "0.6958467", "0.68221486", "0.68147147", "0.6792331", "0.66435987", "0.65641314", "0.6561918", "0.65477175", "0.6451238", "0.6439873", "0.64368606", "0.6408157", "0.6...
0.9152661
0
test_delete_contact to test if we can remove a contact from our contact list
def test_delete_contact(self): self.new_contact.save_contact() # new contact test_contact = Contact("Test", "user", "0745639300", "test@usr.com") # new contact saved test_contact.save_contact() # For deleting the new contact self.new_contact.delete_contact() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_contact(self):\n self.new_contact.save_contact()\n test_contact = Contact(\"Test\", \"User\", 254712345678, \"test@user.com\") # new contact\n test_contact.save_contact()\n self.new_contact.delete_contact() # delete a contact object\n self.assertEqual(len(Contac...
[ "0.87605715", "0.8085114", "0.766524", "0.73715454", "0.72436273", "0.7203849", "0.7119705", "0.6994788", "0.69293314", "0.6898616", "0.68878806", "0.6867588", "0.6844377", "0.6803209", "0.678051", "0.6768761", "0.67519003", "0.67358315", "0.67193764", "0.66907907", "0.668907...
0.88033223
0
Test to check if we can find a contact by phone nuber and display any information.
def test_find_by_number(self): self.new_contact.save_contact() # new contact test_contact = Contact("Test", "user", "0748363839", "test@user.com") test_contact.save_contact() # The number that we find in found_contact should be the same as the one in test_contact for the test to ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_contact():\n if request.method == 'GET':\n tel = request.args.get('tel')\n contact = io_client.get_contacts(urn=['tel:+52' + tel]).all()\n if contact:\n return jsonify({\"existe\": \"Si\"}), 201\n return jsonify({\"existe\": \"No\"}), 404", "def test_get_conta...
[ "0.712528", "0.6798059", "0.65811235", "0.64409727", "0.63759893", "0.62315255", "0.6139972", "0.60520345", "0.60456944", "0.6019896", "0.59364927", "0.5919249", "0.59148854", "0.5910279", "0.5864654", "0.5852436", "0.5850235", "0.58484715", "0.5841883", "0.5810253", "0.58101...
0.5991998
10
Test to check if we can return a Boolean if we cannot find the contact.
def test_contact_exists(self): self.new_contact.save_contact() # Test user test_contact = Contact("Test", "user", "0722334455", "test@user.com") # We save test_contact.save_contact() # variable that stores what we expect contact_exists = Contact.contact_exist("07...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_is_workshop_contact(self, obj):\n user = self.context['request'].user\n if not user.is_authenticated:\n return False\n # pylint: disable=no-member\n profile = UserProfile.objects.get(user=user)\n return profile in obj.contacts.all()", "def found(raise_error: ...
[ "0.6157852", "0.6054971", "0.60262066", "0.5897116", "0.58594185", "0.5804995", "0.5778651", "0.57772166", "0.56551945", "0.563208", "0.56082284", "0.5526532", "0.5509251", "0.5509251", "0.55092347", "0.55092347", "0.55092347", "0.5499786", "0.5489946", "0.5465567", "0.546275...
0.6327621
0
Method that returns a list of all contacts saved.
def test_display_all_contact(self): self.assertEqual(Contact.display_contacts(), Contact.contact_list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_contacts(self):\n return self.contacts", "def ListAllContacts(self):\n feed = self.gd_client.GetContacts()\n self.contacts = self.CleanPhoneNumbers(self.GetContactsInfo(feed))\n return self.contacts", "def get_contacts(self):\n\n\t\treturn self.__contacts", "def update_contacts(self)...
[ "0.8201797", "0.80560666", "0.78120834", "0.7591751", "0.75464964", "0.7476027", "0.745762", "0.74265754", "0.72620547", "0.724315", "0.7199225", "0.71166533", "0.70863086", "0.7026332", "0.6961944", "0.6945557", "0.6881635", "0.6696314", "0.66937345", "0.6691385", "0.6591449...
0.60417026
44
Test to confirm that we are copying the email address from a found contact
def test_copy_email(self): self.new_contact.save_contact() Contact.copy_email("0712345678") self.assertEqual(self.new_contact.email, pyperclip.paste()) # Below we are simply stating that if the module being tested is running we collect the test methods and execute them.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_copy_email(self):\n self.new_contact.save_contact()\n Contact.copy_email(254719702373)\n\n self.assertEqual(self.new_contact.email, pyperclip.paste())", "def test_copy_email(self):\n\n\n self.new_credential.save_credential()\n Credential.copy_email(\"Chris\")\n\n ...
[ "0.83343744", "0.7601879", "0.6900183", "0.6812739", "0.6561415", "0.6468561", "0.6455767", "0.64429235", "0.6356866", "0.6320259", "0.62970245", "0.62465024", "0.6236399", "0.6219535", "0.6197941", "0.6197167", "0.6179059", "0.6178218", "0.61507607", "0.6110539", "0.60834587...
0.7637972
1
partial_distance_covariance_test(x, y, z, num_resamples=0, exponent=1, random_state=None) Test of partial distance covariance independence. Compute the test of independence based on the partial distance covariance, for two random vectors conditioned on a third. The test is a permutation test where the null hypothesis i...
def partial_distance_covariance_test(x, y, z, **kwargs): # pylint:disable=too-many-locals random_state = _random_state_init(kwargs.pop("random_state", None)) # B num_resamples = kwargs.pop("num_resamples", 0) _check_kwargs_empty(kwargs) # Compute U-centered matrices u_x = _dcor_internals....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_coeffvar(self):\n self.assertEqual(coeffvar(list1, sample=False), np.std(list1) /\n np.mean(list1))\n self.assertEqual(coeffvar(list1), np.std(list1, ddof=1) /\n np.mean(list1))", "def test_exact_two_qubit_cnot_decompose_random(self, seed):\n...
[ "0.5698384", "0.53769475", "0.5372643", "0.52613395", "0.51615024", "0.5145563", "0.50757515", "0.50168383", "0.4970485", "0.4894757", "0.484348", "0.48419997", "0.48381978", "0.48207268", "0.48052663", "0.47089332", "0.470408", "0.46567678", "0.463776", "0.46216598", "0.4603...
0.8479564
0
Creates an SSL keyfile and returns the path.
def CreateKeyFile(): keyfile = tempfile.mkstemp()[1] cmd = [ 'openssl', 'genrsa', '-out', keyfile, '2048' ] _RunCommand(cmd) return keyfile
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _keypath(self) -> pathlib.Path:\n home = pathlib.Path.home()\n keyfile = home / \".cmdc\" / \"apikey\"\n keyfile.parent.mkdir(parents=True, exist_ok=True)\n return keyfile", "def generate_key():\r\n # generating key\r\n key = Fernet.generate_key()\r\n\r\n key_dir = os.pat...
[ "0.6690019", "0.640222", "0.63990533", "0.63100165", "0.6247914", "0.6236544", "0.622373", "0.61842155", "0.6159797", "0.6129716", "0.6111204", "0.6094071", "0.6050029", "0.60403", "0.60227233", "0.6010699", "0.5991577", "0.59733444", "0.59372234", "0.5916288", "0.5860859", ...
0.7345631
0
Creates an SSL CSR file and returns the path.
def CreateCsrFile(keyfile): csrfile = tempfile.mkstemp()[1] cmd = [ 'openssl', 'req', '-new', '-key', keyfile, '-out', csrfile, '-subj', '/C=NA/ST=NA/L=NA/O=Chromium/OU=Test/CN=chromium.org' ] _RunCommand(cmd) return csrfile
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CreateCrtFile(keyfile, csrfile):\n crtfile = tempfile.mkstemp()[1]\n cmd = [\n 'openssl',\n 'x509',\n '-req',\n '-days', '1',\n '-in', csrfile,\n '-signkey', keyfile,\n '-out', crtfile\n ]\n _RunCommand(cmd)\n return crtfile", "def create_csr(dn):\n tmp_file = f...
[ "0.76157844", "0.7091698", "0.682195", "0.66409546", "0.64632416", "0.64031243", "0.6295008", "0.6232049", "0.6201246", "0.6178768", "0.61259174", "0.61010826", "0.6063991", "0.5976694", "0.5963608", "0.5935446", "0.58889717", "0.58795524", "0.58761525", "0.5852114", "0.57947...
0.7676574
0
Creates an SSL CRT file and returns the path.
def CreateCrtFile(keyfile, csrfile): crtfile = tempfile.mkstemp()[1] cmd = [ 'openssl', 'x509', '-req', '-days', '1', '-in', csrfile, '-signkey', keyfile, '-out', crtfile ] _RunCommand(cmd) return crtfile
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _retrieve_crt_path(haproxy_base_dir, listener, primary_cn):\n confs_dir = os.path.abspath(os.path.normpath(haproxy_base_dir))\n confs_path = os.path.join(confs_dir, listener.id)\n if haproxy_base_dir and listener.id:\n if not os.path.isdir(confs_path):\n os.makedirs(confs_path, 0o755...
[ "0.6699168", "0.6504106", "0.6388449", "0.6253104", "0.62328863", "0.6191254", "0.6086789", "0.60492927", "0.6046661", "0.5963553", "0.5953179", "0.59513456", "0.57639164", "0.5744498", "0.5647329", "0.56415385", "0.56214416", "0.561746", "0.55993444", "0.55791825", "0.553878...
0.71155643
0
Creates an SSL PEM file and returns the path.
def CreatePemFile(): keyfile = CreateKeyFile() csrfile = CreateCsrFile(keyfile) crtfile = CreateCrtFile(keyfile, csrfile) pemfile = tempfile.mkstemp()[1] with open(keyfile) as k: with open(crtfile) as c: with open(pemfile, 'wb') as p: p.write('%s\n%s' % (k.read(), c.read())) return pemfile
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ca_file(tmpdir):\n key = rsa.generate_private_key(public_exponent=65537, key_size=2048)\n public_key = key.public_key()\n\n builder = x509.CertificateBuilder()\n builder = builder.subject_name(\n x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, \"pyopenssl.org\")])\n )\n builder = bu...
[ "0.66648823", "0.6361533", "0.62127554", "0.6201686", "0.61935896", "0.6074794", "0.6025097", "0.5998469", "0.5896556", "0.5884485", "0.5839449", "0.5786212", "0.5751437", "0.57417154", "0.5737081", "0.57288885", "0.57241213", "0.5713234", "0.56344074", "0.55794954", "0.55756...
0.7334299
0
Creates and returns a connection to an SSL RPC server.
def Connect(server, port=common_lib.SERVER_PORT): addr = 'https://%s:%d' % (server, port) logging.debug('Connecting to RPC server at %s', addr) return jsonrpclib.ServerProxy(addr, allow_none=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ConnectSSL(self):\n with open(self.DEFAULT_CLIENT_KEY_FILE, 'rb') as f:\n private_key = f.read()\n with open(self.DEFAULT_CLIENT_CHAIN_FILE, 'rb') as f:\n certificate_chain = f.read()\n with open(self.DEFAULT_ROOT_CERT_FILE, 'rb') as f:\n root_ca = f.read()...
[ "0.7047686", "0.70328885", "0.6644007", "0.64732254", "0.644927", "0.62140524", "0.61953074", "0.6174031", "0.6171852", "0.6162838", "0.6138797", "0.61199987", "0.61196625", "0.60930616", "0.6070115", "0.6068998", "0.60384196", "0.60375965", "0.60001844", "0.60000044", "0.599...
0.65039414
3
Convenience method to download data from S3 and return it as a string
def get_from_s3(s3_client, s3_url): url = urlparse(s3_url) # Split the bucket from the key bucket_name = urllib2.unquote(url.netloc).decode('utf8') key_name = urllib2.unquote(url.path[1:]).decode('utf8') # We're done parsing; start doing some S3 ops bucket = s3_client.get_bucket(bucket_name, v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_s3_object_text(s3_resource: boto3.session.Session.resource, bucket_name: str, key: str) -> str:\n obj = s3_resource.Object(bucket_name, key)\n return obj.get()['Body'].read().decode('utf-8')", "def retrieve_s3_contents ( s3_conn, bucket_name, key_name, stored_filename = None ) :\n bucket = s3_con...
[ "0.7161001", "0.7014146", "0.6936319", "0.67600614", "0.6748984", "0.67472315", "0.6715", "0.667104", "0.66632414", "0.66501606", "0.66501606", "0.6650045", "0.6590507", "0.65865976", "0.6584135", "0.65775824", "0.65639305", "0.6542722", "0.6508517", "0.64936024", "0.6488956"...
0.6910201
3
Creates a j1 float value for head_1_joint FollowJointTrajectoryGoal with the specified goal
def createTTSGoal(text, lang_id='', wait_before_speaking=rospy.Duration(0.0)): sound_goal = SoundGoal() sound_goal.text=text sound_goal.lang_id=lang_id sound_goal.wait_before_speaking=wait_before_speaking return sound_goal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_jerk(joint_trajectory):\r\n joint_vel = np.gradient(joint_trajectory, axis=1)\r\n joint_acc = np.gradient(joint_vel, axis=1)\r\n joint_jerk = np.gradient(joint_acc, axis=1)\r\n jerk = np.linalg.norm(joint_jerk)\r\n return jerk", "def _get_trajectory_parameters(self, joint_names, goal):...
[ "0.57482255", "0.5338517", "0.5250078", "0.52079666", "0.5205086", "0.5158983", "0.5120888", "0.5094038", "0.5089993", "0.50717366", "0.5035613", "0.50216293", "0.5004459", "0.4998951", "0.4990246", "0.49518824", "0.49275857", "0.49016118", "0.48945734", "0.4890885", "0.48699...
0.0
-1
Add a new connection variable test the connection save the variables
def add(self, name: str): print("Adding new connection object '{}'...\n".format(name)) drivername = input("Drivername: ") connector = self._load(drivername) try: config = connector.setup() except KeyboardInterrupt: return print("Setup cancelled.") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_connection(self, connection):\n self.connections[connection.id] = connection", "def add_connection(self, connection_id):\n self.connection_load = random.random() * 10 + 1\n self.connection = {connection_id: connection_load}\n self.connections.update(connection)", "def test_c...
[ "0.63593096", "0.61824965", "0.6128532", "0.6085057", "0.60615504", "0.60603815", "0.6047875", "0.5987283", "0.5913636", "0.5909906", "0.5907722", "0.58825845", "0.5882315", "0.5880187", "0.5871605", "0.58155376", "0.5778564", "0.5764854", "0.5759328", "0.575695", "0.57390064...
0.5462191
34
Parse a connection string and setup the manager for working with a connection
def connect(self, name: str): if name in self.config: config = self.config[name].copy() drivername = config.pop('drivername') connector = self._load(drivername) connection = connector(**config) else: raise ValueError("No connection referred t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_connection_string(self, connection_string):\n self.host = '127.0.0.1'\n self.port = 3306\n self.db = None\n self.user = None\n self.pwd = None\n for part in connection_string.split(';'):\n part = part.strip()\n if part != '':\n ...
[ "0.7421976", "0.6754677", "0.6019895", "0.5980538", "0.59241205", "0.5827837", "0.5811387", "0.5772588", "0.57364815", "0.5713465", "0.570279", "0.5649966", "0.56399196", "0.5631981", "0.5596738", "0.5589974", "0.5581357", "0.55780095", "0.5566211", "0.5550092", "0.55224144",...
0.0
-1
Transform from one radial coordinate to another. Note that this coordinate conversion is only strictly valid inside of the LCFS.
def rad_coord_transform(x,name_in,name_out, geqdsk): if name_in == name_out: return x if 'r_V' not in geqdsk['fluxSurfaces']['geo']: R0 = geqdsk['RMAXIS'] eq_vol = geqdsk['fluxSurfaces']['geo']['vol'] r_V = np.sqrt(eq_vol/(2*np.pi**2*R0)) geqdsk['fluxSurfaces']['geo']['r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deg2rad_inplace(a):", "def convert(self, lat, lon):\r\n a = self.a\r\n b = self.b\r\n long0 = self.long0\r\n k0 = self.k0\r\n dx = self.dx\r\n\r\n e = (1 - b ** 2 / a ** 2) ** 0.5\r\n e2 = e ** 2 / (1 - e ** 2)\r\n n = (a - b) / (a + b)\r\n nu = ...
[ "0.6106413", "0.5955033", "0.5679703", "0.5614722", "0.56037164", "0.55267453", "0.54864424", "0.5467077", "0.5389721", "0.5381061", "0.5360404", "0.535843", "0.535422", "0.5338711", "0.53266436", "0.5319456", "0.53012145", "0.52922064", "0.52901214", "0.52864665", "0.5284524...
0.6349656
0
Gets a JSON file from the PREP, saves it and extracts required data to a dict.
def get_prep(file_name): headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0"} url = "https://rp18.ine.mx/assets/JSON/PRESIDENTE/NACIONAL/Presidente_NACIONAL.json" with requests.get(url, headers=headers) as response: # Save a copy for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ingest_json_file(request):\n path = save_file(request) \n try:\n with open(path, encoding='utf-8') as f:\n data = json.loads(f.read())\n except Exception as e:\n log.error(log.exc(e))\n return None\n return data", "def get_relevant_dict(domain: str) -> dict:\n ...
[ "0.6347891", "0.62267184", "0.6123482", "0.6113618", "0.597682", "0.5953838", "0.5900119", "0.5893709", "0.5890557", "0.5878286", "0.5856924", "0.584468", "0.584468", "0.58373594", "0.581583", "0.5804766", "0.5803907", "0.57861716", "0.57676995", "0.5763947", "0.57342213", ...
0.57467836
20
initialize your data structure here.
def __init__(self): self.minheap = [] self.maxheap = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_empty(self):\n self._data = []", "def __init__(self):\n self.data = []\n self.record = {}", "def __init__(self):\n self.structure = {}", "def __init__(self):\n self._data = []", "def __init__(self):\n self._data = []", "def __init__(self):\n self...
[ "0.7761043", "0.76102185", "0.7555967", "0.7549892", "0.7549892", "0.7549892", "0.7549892", "0.7549892", "0.7549892", "0.752797", "0.7446006", "0.7446006", "0.7446006", "0.7446006", "0.7446006", "0.743338", "0.743338", "0.7408609", "0.7385719", "0.737986", "0.737986", "0.73...
0.0
-1
Transformation to apply on each notebook. You should return modified nb, resources. If you wish to apply your transform on each cell, you might want to overwrite transform_cell method instead.
def call(self, nb, resources): self.log.debug("Applying transform: %s", self.__class__.__name__) try : for worksheet in nb.worksheets: for index, cell in enumerate(worksheet.cells): worksheet.cells[index], resources = self.transform_cell(cell, resources, i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform_cell(self, cell, resources, index):\n\n raise NotImplementedError('should be implemented by subclass')\n return cell, resources", "def cell_preprocessor(function):\n\n @functools.wraps(function)\n def wrappedfunc(nb: NotebookNode, resources: dict) -> (NotebookNode, dict):\n ...
[ "0.585268", "0.57084334", "0.56029147", "0.5561479", "0.5502522", "0.5467713", "0.5347716", "0.52935684", "0.52670693", "0.5254548", "0.5215245", "0.52104896", "0.51687974", "0.5122487", "0.50810003", "0.50767034", "0.50586015", "0.5045944", "0.4984737", "0.49372816", "0.4937...
0.76527107
0
Overwrite if you want to apply a transformation on each cell. You should return modified cell and resource dictionary.
def transform_cell(self, cell, resources, index): raise NotImplementedError('should be implemented by subclass') return cell, resources
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def call(self, nb, resources):\n self.log.debug(\"Applying transform: %s\", self.__class__.__name__)\n try :\n for worksheet in nb.worksheets:\n for index, cell in enumerate(worksheet.cells):\n worksheet.cells[index], resources = self.transform_cell(cell, ...
[ "0.65440035", "0.5804093", "0.57728004", "0.57344264", "0.5611276", "0.5597317", "0.5579851", "0.5579851", "0.5579851", "0.55642366", "0.55408597", "0.54695153", "0.5432807", "0.5426063", "0.53927785", "0.53927785", "0.53927785", "0.53927785", "0.53927785", "0.53927785", "0.5...
0.70315164
0
Generate xml representation of self for upload to server. Returns
def _generate_flow_xml(self): model = self.model flow_dict = OrderedDict() flow_dict['oml:flow'] = OrderedDict() flow_dict['oml:flow']['@xmlns:oml'] = 'http://openml.org/openml' flow_dict['oml:flow']['oml:name'] = self._get_name() flow_dict['oml:flow']['oml:external_vers...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xml(self):\n raise NotImplementedError('must be implemented by all subclasses')", "def xml(self):\n raise NotImplementedError('This api does not return xml')", "def get_xml(self):\n return etree.tostring(self.get_etree())", "def toxml(self) :\n\t\treturn self.doc.toxml()", "def xml...
[ "0.7834428", "0.7579679", "0.7369056", "0.7199811", "0.7109393", "0.7109393", "0.7021206", "0.691179", "0.68817455", "0.6821038", "0.66802734", "0.6664244", "0.6604715", "0.66046584", "0.6604575", "0.6562038", "0.6549967", "0.65493363", "0.65181774", "0.6500574", "0.6483287",...
0.5766485
83
Publish flow to OpenML server. Returns
def publish(self): xml_description = self._generate_flow_xml() file_elements = {'description': xml_description} return_code, return_value = _perform_api_call( "flow/", file_elements=file_elements) self.flow_id = int(xmltodict.parse(return_value)['oml:upload_flow']['oml:id'])...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def publish(self):\n return", "def publish():\n pass", "def publish(self, waypoints): \n lane = Lane()\n lane.header.frame_id = '/world'\n lane.header.stamp = rospy.Time(0)\n lane.waypoints = waypoints\n self.final_waypoints_pub.publish(lane)", "def _generate_flow...
[ "0.637059", "0.6307481", "0.5872563", "0.5749436", "0.56772095", "0.56606215", "0.5617935", "0.55418754", "0.552572", "0.5460382", "0.54280865", "0.54070175", "0.53559107", "0.5355898", "0.5346886", "0.53458697", "0.5340997", "0.53381914", "0.53381914", "0.5327639", "0.529557...
0.7366736
0
Checks if a flow exists for the given model and possibly creates it. If the given flow exists on the server, the flowid will simply be returned. Otherwise it will be uploaded to the server. Returns
def _ensure_flow_exists(self): import sklearn flow_version = 'sklearn_' + sklearn.__version__ _, _, flow_id = _check_flow_exists(self._get_name(), flow_version) # TODO add numpy and scipy version! if int(flow_id) == -1: return_code, response_xml = self.publish() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def create_flow(self, flow: \"FlowObject\") -> UUID:\n return await self.create_flow_from_name(flow.name)", "async def create_flow_from_name(self, flow_name: str) -> UUID:\n flow_data = FlowCreate(name=flow_name)\n response = await self._client.post(\n \"/flows/\", json=flow...
[ "0.63103426", "0.5682208", "0.5225242", "0.513043", "0.49558088", "0.49539042", "0.48757178", "0.4860312", "0.48489386", "0.48403105", "0.4821129", "0.48097745", "0.48096967", "0.4789475", "0.47876206", "0.47869292", "0.47778752", "0.47659418", "0.4671119", "0.46696758", "0.4...
0.69185144
0
Helper function. Can be mocked for testing.
def _get_name(self): return self.name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _test(self):", "def _test(self):", "def _test(self):", "def _test(self):", "def _test(self):", "def test_get(self):\n pass", "def __call__(self) -> None:", "def test_4_4_1_1(self):\n pass", "def test_create_unexpected_problem(self):\n pass", "def unitary_test():", "def ...
[ "0.61880225", "0.61880225", "0.61880225", "0.61880225", "0.61880225", "0.60830206", "0.6077034", "0.60485405", "0.59680647", "0.59153825", "0.59080714", "0.59010756", "0.59010756", "0.59010756", "0.58822715", "0.58752346", "0.58752346", "0.5852382", "0.5852382", "0.5852382", ...
0.0
-1
Returns an app instance.
def create_app(instance_path=None, test_config=None): # create and configure the bit-wallet app = Flask(__name__, instance_path=instance_path) app.jinja_options["autoescape"] = None app.config.from_mapping( SECRET_KEY='dev', UPLOAD_FOLDER='upload', MYSQL_HOST=os.getenv('MYSQL_HO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_app(self):\n return Application()", "def get_app(self):\n\n app = APP\n return app", "def app(self):\n if self._application is None:\n self._application = Application(client=self)\n return self._application", "def get_app():\n\n global _app\n if _ap...
[ "0.85812575", "0.8342205", "0.8175058", "0.81618136", "0.8146952", "0.81320703", "0.7800049", "0.77903914", "0.7774205", "0.77098906", "0.765999", "0.7645297", "0.76180446", "0.7616076", "0.7611414", "0.7560359", "0.755171", "0.7541826", "0.74648577", "0.74374753", "0.7399785...
0.0
-1
Parse TFExample records and perform simple data augmentation.
def parse_fn(serialized_example): features = { 'video': tf.io.FixedLenFeature([], tf.string), 'label': tf.io.FixedLenFeature([], tf.int64), 'seq_len': tf.io.FixedLenFeature([], tf.int64), 'height': tf.io.FixedLenFeature([], tf.int64), 'width': tf.io.FixedLenFeature([], tf.in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parser(record):\n record_spec = {\n \"input\": tf.FixedLenFeature([seq_len], tf.int64),\n \"labels\": tf.FixedLenFeature([tgt_len], tf.int64),\n \"input_mask\": tf.FixedLenFeature([seq_len],tf.float32),\n \"target_mask\": tf.FixedLenFeature([tgt_len],tf.float32)\n }\n\n # r...
[ "0.68483853", "0.660834", "0.66064477", "0.641451", "0.6373467", "0.6352471", "0.63505834", "0.6334366", "0.63030005", "0.62588114", "0.6236913", "0.6209942", "0.61765295", "0.61758536", "0.61287767", "0.6117243", "0.611522", "0.60871506", "0.6077659", "0.6074646", "0.6071809...
0.5510347
95
Read the data in from xyz.csv add two new columns, one to calculate dollar flux, and the other to calculate percentage flux return as a list of tuples
def calculate_flux(XYZ: str) -> list: df = pd.read_csv(XYZ) df['Dollar Flux'] = df['12/31/20'] - df['12/31/19'] df['Percentage Flux'] = df['12/31/20'] / df['12/31/19'] - 1 return list(tuple(df.loc[i]) for i in range(df.shape[0]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_flux(XYZ: str) -> list:\n\n\n data = pd.read_csv(XYZ,dtype={'12/31/2020': int,'12/31/2019': int})\n\n data['dollar_flux'] = data.iloc[:,1].sub(data.iloc[:,2])\n data['pct_flux'] = data.iloc[:,[-2,1]].pct_change(axis=1).dropna(axis=1)\n\n\n return list(data.to_records(index=False))", "de...
[ "0.685175", "0.6411039", "0.62081707", "0.6109357", "0.60995525", "0.5916653", "0.5815268", "0.58103406", "0.5806701", "0.5740641", "0.57309264", "0.571921", "0.570458", "0.5695528", "0.5673751", "0.56716675", "0.5653346", "0.5641983", "0.5631174", "0.5611434", "0.56070626", ...
0.70332384
0
Load the list of tuples, iterate through each item and determine if it is above both thresholds. if so, add to the list
def identify_flux(xyz: list) -> list: flagged_lines = [tup for tup in xyz if abs(tup[3]) > THRESHOLDS[0] and abs(tup[4]) > THRESHOLDS[1]] return flagged_lines
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findAlternatives(sortedList):\n #zeroing the data below treshold\n global TRESHOLD\n # if THRESHOLD == 0:\n TRESHOLD = readsHistogram(sortedList)\n afterTresholdData = []\n print(len(sortedList))\n for i in range(len(sortedList)):\n if np.mean(sortedList[i].getSamples()) >= TRESHOLD...
[ "0.61527246", "0.5832117", "0.5770874", "0.5667276", "0.561511", "0.55497396", "0.54834783", "0.5480274", "0.5390675", "0.53718406", "0.5363759", "0.53632814", "0.5358989", "0.53322583", "0.53311914", "0.5315088", "0.5308043", "0.5296117", "0.52910286", "0.52749586", "0.52669...
0.0
-1
Makes sure begin/end pairs have length of at least zero.
def _validate_constants(verbose=False): d = globals() for from_key in d: if not from_key.endswith("_begin"): continue to_key = from_key[:-len("_begin")]+"_end" if not to_key in d: if verbose: print "%s has no matching %s" % (from_key, to_ke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def empty(self):\r\n if len(self.s1)==0 and len(self.s2)==0:\r\n return True", "def isEmpty(self):\n return self.start == -1 and self.end == -1", "def empty(self):\n return len(self.a) + len(self.b) == 0", "def empty(self) -> bool:\n return len(self.a) == 0 and len(self...
[ "0.65438414", "0.650208", "0.6418912", "0.6320043", "0.6155419", "0.61419684", "0.6141011", "0.61290944", "0.61186117", "0.6038338", "0.6038338", "0.6029582", "0.60150236", "0.599977", "0.5993547", "0.5993121", "0.59815663", "0.59691274", "0.5963844", "0.59615463", "0.5957896...
0.0
-1
Run gdal_merge using an external process.
def run_merge(*src, argv=None): tmpdir = tempfile.mkdtemp() inputs = [] for i, drv in enumerate(src): if type(drv) != str: tmppath = os.path.join(tmpdir, "input_%s.tif" % i) drv.write(tmppath) inputs.append(tmppath) else: inputs.append(src) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def call_gdal_util(util_name,\n gdal_path=None,\n src_files='',\n src_band=None,\n dst_file=None,\n options={}):\n # define specific options\n _opt_2b_in_quote = [\"-mo\", \"-co\"]\n\n # get the gdal installed path i...
[ "0.6366613", "0.6252653", "0.5960626", "0.59505725", "0.5807357", "0.5765494", "0.57650673", "0.5709829", "0.563321", "0.5595598", "0.55921483", "0.5452208", "0.5446093", "0.54422516", "0.5391504", "0.5345127", "0.5292853", "0.52140045", "0.5213958", "0.51817507", "0.5178978"...
0.7390473
0
Create inital launcher with angle 45 degrees and velocity 40 win is the GraphWin to draw the launcher in.
def __init__(self, win): # draw the base shot of the launcher base = Circle(Point(0,0), 3) base.setFill("red") base.setOutline("red") base.draw(win) # save the window and create initial angle and velocity self.win = win self.angle = radians(45.0)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, win): \r\n\r\n # draw the base shot of the launcher \r\n base = Circle(Point(0,0), 3) \r\n base.setFill('red')\r\n base.setOutline('red')\r\n base.draw(win) \r\n\r\n # save the window and create initial angle and velocity\r\n self.win = win \r\n ...
[ "0.73945683", "0.6352571", "0.5805394", "0.579472", "0.5572521", "0.55596024", "0.5541648", "0.5446335", "0.54389066", "0.5437201", "0.5429614", "0.54086167", "0.54053193", "0.5386864", "0.5362621", "0.53455466", "0.5335464", "0.53260404", "0.52860785", "0.52791184", "0.52733...
0.7478532
0
undraw the arrow and draw a new one for the current values of angle and velocity.
def redraw(self): self.arrow.undraw() pt2 = Point(self.vel*cos(self.angle), self.vel*sin(self.angle)) self.arrow = Line(Point(0,0), pt2).draw(self.win) self.arrow.setArrow("last") self.arrow.setWidth(3)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def redraw(self): \r\n\r\n self.arrow.undraw() \r\n pt2 = Point(self.vel*cos(self.angle), self.vel*sin(self.angle))\r\n self.arrow = Line(Point(0,0), pt2).draw(self.win) \r\n self.arrow.setArrow('last')\r\n self.arrow.setWidth(3)", "def get_quiver_arrows(self):\n dif_x =...
[ "0.77334005", "0.65644336", "0.6287359", "0.6213265", "0.61974335", "0.6153086", "0.5998839", "0.5908423", "0.5908423", "0.59016716", "0.5891196", "0.58837223", "0.5872633", "0.5846972", "0.58233887", "0.5820985", "0.5800393", "0.57933944", "0.5788004", "0.5777631", "0.575778...
0.7731802
1
change angle by amt degrees
def adjAngle(self, amt): self.angle = self.angle+radians(amt) self.redraw()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjAngle(self, amt): \r\n\r\n self.angle = self.angle + radians(amt)\r\n self.redraw()", "def angle(self) -> float:\n ...", "def angle(self, angle_deg) -> None:\n ...", "def rotateDegrees(angle):\n rotate(angle *2*math.pi / 360)", "def angle(self) -> int:", "def angle(s...
[ "0.8125653", "0.7635241", "0.7557885", "0.75281644", "0.751763", "0.7443927", "0.73215574", "0.7298224", "0.72973174", "0.7293998", "0.7246493", "0.72278506", "0.7201105", "0.7193929", "0.7187989", "0.7185721", "0.7136344", "0.71154463", "0.71035147", "0.7098545", "0.7091846"...
0.79394275
1
change velocity by amt
def adjVel(self, amt): self.vel = self.vel + amt self.redraw()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_velocity(self, delta):\n self.velocity += delta", "def change_velocity(self, delta):\n self.velocity += delta", "def adjVel(self, amt):\r\n\r\n self.vel = self.vel + amt \r\n self.redraw()", "def new_velocity(self):\n self.velocity = self.vafter", "def update_c...
[ "0.76103216", "0.76103216", "0.7526109", "0.73344684", "0.7196258", "0.7111217", "0.6884669", "0.6863433", "0.6834674", "0.6805781", "0.67380685", "0.6668846", "0.65749025", "0.65732276", "0.6555495", "0.6555495", "0.6544642", "0.6541888", "0.65295243", "0.64781934", "0.64715...
0.71967214
4
win is the GraphWin to display the shot, angle, velocity, and height are initial projectile parameters.
def __init__(self, win, angle, velocity, height): self.proj = Projectile(angle, velocity, height) self.marker = Circle(Point(0,height), 3) self.marker.setFill("red") self.marker.setOutline("red") self.marker.draw(win)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, win):\n \n # draw the base shot of the launcher\n base = Circle(Point(0,0), 3)\n base.setFill(\"red\")\n base.setOutline(\"red\")\n base.draw(win)\n\n # save the window and create initial angle and velocity\n self.win = win\n self.an...
[ "0.61466646", "0.611178", "0.60369253", "0.59023196", "0.58787185", "0.58351535", "0.5771538", "0.5740812", "0.5733873", "0.5672222", "0.5656955", "0.5644705", "0.563213", "0.55671704", "0.554327", "0.54865324", "0.54692745", "0.54463905", "0.5439828", "0.5418802", "0.5388303...
0.61944795
0
Move the shot dt seconds farther along its flight
def update(self, dt): self.proj.update(dt) center = self.marker.getCenter() dx = self.proj.getX() - center.getX() dy = self.proj.getY() - center.getY() self.marker.move(dx,dy)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move(self, dt):\n dt = dt", "def move(self,dt):\n raise NotImplementedError(\"Robot.move\")", "def move(self,dt):\n self.x_pos += self.x_vel*dt\n self.y_pos += self.y_vel*dt", "def move(self, frames_per_second):\n # tuple_add in one line\n position_delta = tuple(...
[ "0.7594908", "0.6922004", "0.6899571", "0.67924666", "0.65794265", "0.6302349", "0.62913513", "0.62547195", "0.6249593", "0.6245547", "0.62434554", "0.6196573", "0.61463386", "0.6144526", "0.6091334", "0.6084468", "0.6074786", "0.6065155", "0.6053467", "0.6045457", "0.6045279...
0.0
-1
return the current x coordinate of the shot's center
def getX(self): return self.proj.getX()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_x_position(self):\n return self.rect.x", "def _get_x(self):\n return self.position.x", "def centerx(self):\n return self.left + self.width / 2", "def get_x_position(self):\n return self.actual_coordinates[0]", "def get_x(self):\n return self.posX", "def get_x(se...
[ "0.8170842", "0.79965454", "0.7950228", "0.78056806", "0.7790852", "0.7761694", "0.7672446", "0.7604114", "0.75850916", "0.7479844", "0.74445426", "0.7407246", "0.74059206", "0.7337172", "0.7303859", "0.727023", "0.7150097", "0.71477306", "0.71369725", "0.71034396", "0.704470...
0.65873474
50
return the current y coordinate of the shot's center
def getY(self): return self.proj.getY()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_y_position(self): \n return self.rect.y", "def _get_y(self):\n return self.position.y", "def y(self):\r\n return self.position.y", "def get_y_position(self):\n return self.actual_coordinates[1]", "def get_y(self):\n\t\treturn self._collision_rect.y + 25", "def get_y...
[ "0.7937652", "0.7730214", "0.76843345", "0.76624733", "0.7574403", "0.7466444", "0.7450869", "0.7435911", "0.7431255", "0.73885834", "0.7357961", "0.73478985", "0.7332926", "0.7316668", "0.7212563", "0.71838593", "0.7172444", "0.7161277", "0.7153415", "0.7126375", "0.71033573...
0.68248624
30
Testing base class with validation method for correct number answer
def test_task_with_one_int_validation_parameter_validate_data(number, expected_value): assert algo.TaskWithOneIntValidationParameter.validate_data(number) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_non_numberic_validation(self):", "def test_non_numberic_validation(self):", "def test_validate_answer(self):\r\n problem = self.build_problem(answer=\"42\")\r\n responder = problem.responders.values()[0]\r\n self.assertTrue(responder.validate_answer('23.5'))\r\n self.assert...
[ "0.7708032", "0.7708032", "0.7614994", "0.7284501", "0.6842716", "0.6842716", "0.654897", "0.6433062", "0.6420513", "0.6344961", "0.63250494", "0.6312314", "0.62953454", "0.62856126", "0.62712264", "0.6270192", "0.6255088", "0.6236374", "0.62147146", "0.6166879", "0.61328876"...
0.61860913
19
Testing base class with validation method for exceptions
def test_task_with_one_int_validation_parameter_validate_exceptions(number, expected_value): with pytest.raises(expected_value): algo.TaskWithOneIntValidationParameter.validate_data(number)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_validation(self):\n self.validationFails()", "def test_should_not_be_callable(self):\n with self.assertRaises(NotImplementedError):\n BaseValidator()(\"any-value\")", "def test_validate(self):\n pass", "def test_validation(self):\r\n\r\n with self.assertRaises(...
[ "0.7366222", "0.7237699", "0.721509", "0.7119311", "0.7103784", "0.70534474", "0.7048264", "0.6987562", "0.6925039", "0.6916672", "0.6913254", "0.6906676", "0.68661255", "0.68530154", "0.68451655", "0.68323594", "0.68066764", "0.6797967", "0.6775788", "0.67419225", "0.6741922...
0.0
-1
Testing task 86b class main logic (must return sum of digits in number)
def test_task86a_main_logic(number, expected_value): assert algo.Task86a.main_logic(number) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sumDigit():", "def test_hackerrank_sample1(self):\n result = find_digits(12)\n self.assertEquals(result, 2)", "def test_hackerrank_sample2(self):\n result = find_digits(1012)\n self.assertEquals(result, 3)", "def test_get_digits():\n assert(get_digits(333) != (0, 0, 0))\n ...
[ "0.77551347", "0.73732257", "0.7041684", "0.68657595", "0.6788567", "0.6714662", "0.66381955", "0.662325", "0.65548384", "0.6548113", "0.65290594", "0.64524496", "0.64524496", "0.64524496", "0.6447197", "0.64175934", "0.6396727", "0.63797677", "0.63792557", "0.6335239", "0.63...
0.0
-1
Testing task 86b class main logic (must return sum of digits in number)
def test_task86b_main_logic(number, expected_value): assert algo.Task86b.main_logic(number) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sumDigit():", "def test_hackerrank_sample1(self):\n result = find_digits(12)\n self.assertEquals(result, 2)", "def test_hackerrank_sample2(self):\n result = find_digits(1012)\n self.assertEquals(result, 3)", "def test_get_digits():\n assert(get_digits(333) != (0, 0, 0))\n ...
[ "0.77525055", "0.73731494", "0.70414096", "0.68663913", "0.67888975", "0.6712753", "0.6635667", "0.6624555", "0.65572226", "0.65503895", "0.65295446", "0.64538836", "0.64538836", "0.64538836", "0.6445064", "0.6417594", "0.63978505", "0.6378056", "0.6377258", "0.6335412", "0.6...
0.0
-1
Testing task 330 class dividers func (must return set of all dividers of the number expect number itself)
def test_task330_main_logic(number, expected_value): assert list(algo.Task330.main_logic(number)) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetDivisions(self):\n ...", "def getDivisors(n):", "def _find_dividers(num: int) -> List[int]:\r\n\r\n dividers: List[int] = list()\r\n while num != 1:\r\n primes = PrimeHandler.find_all_primes(num)\r\n for prime in reversed(primes):\r\n if num % prime == 0:\r\n ...
[ "0.70083207", "0.7004219", "0.69399697", "0.67529577", "0.6682449", "0.66668093", "0.6562514", "0.64714795", "0.6187801", "0.60311484", "0.60079634", "0.60060436", "0.5940947", "0.58989966", "0.583094", "0.5802245", "0.5745088", "0.5736434", "0.5720355", "0.5699634", "0.56498...
0.0
-1
Testing task 178b class main logic (must find the least number, that is bigger than n and is degree of number 2)
def test_task178b_main_logic(sequence, expected_value): assert algo.Task178b.main_logic(sequence) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_n_best(self):\n pass", "def gcd1(n1, n2):\n\n best = 1\n\n for i in range(1,n2+1):\n if n1 % i == 0 and n2 % i == 0 and i > best:\n best = i \n \n return best", "def solution(n: int = 28123) -> int:\n\n nums = range(1, n+1)\n abundant = list...
[ "0.6518122", "0.6298077", "0.62705284", "0.62541515", "0.6244315", "0.62386656", "0.61806613", "0.61793435", "0.6156024", "0.61484855", "0.61337066", "0.60931796", "0.60901713", "0.60744053", "0.6061342", "0.60485005", "0.60432154", "0.6038558", "0.6019028", "0.601486", "0.60...
0.0
-1
Testing task 178c class main logic (must return amount of numbers which are the square of the even number)
def test_task178c_main_logic(sequence, expected_value): assert algo.Task178c.main_logic(sequence) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def six():\r\n \r\n sum_squared = 0\r\n squared_sum = 0\r\n \r\n for i in range(1, 101):\r\n sum_squared += i**2\r\n squared_sum += i\r\n squared_sum = squared_sum**2\r\n \r\n return squared_sum - sum_squared", "def test_suite():\n test(sum_of_squares([2, 3, 4]) == 29)\n ...
[ "0.70825744", "0.6971916", "0.6837792", "0.6805783", "0.6755617", "0.6698033", "0.6646547", "0.66414", "0.66411245", "0.66252494", "0.6544352", "0.650353", "0.64722973", "0.6471484", "0.6449431", "0.644104", "0.64404243", "0.64325464", "0.6417926", "0.6417473", "0.64026", "...
0.0
-1
Testing task 178d class main logic (find amount of elements, which satisfy the condition\nAk < (Ak1 + Ak+1) / 2.)
def test_task178d(input_value, expected_value): assert algo.Task178d.main_logic(input_value) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_suite():\n test(sum_all_elements([1,3,1,4,3,8]) == 5)\n test(sum_all_elements([1,3,5,7]) == 16)\n test(sum_all_elements([1, -7, 10, 23]) == -6)\n test(sum_all_elements(range(1,555,2)) == 76729)", "def test_3_basic(self):\n plan = list(astar(self.mapp_1_s,\n la...
[ "0.623159", "0.6213991", "0.613622", "0.6096122", "0.6004598", "0.59835726", "0.59410703", "0.591825", "0.5910919", "0.5905688", "0.58777785", "0.58679324", "0.58545166", "0.5842208", "0.58124423", "0.5808205", "0.5807517", "0.5783203", "0.5782953", "0.5779589", "0.5765961", ...
0.0
-1
Testing task 178e class main logic (find amount of elements, which satisfy the condition\n2k < Ak < k!)
def test_task178e(input_value, expected_value): assert algo.Task178e.main_logic(input_value) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_suite():\n test(sum_all_elements([1,3,1,4,3,8]) == 5)\n test(sum_all_elements([1,3,5,7]) == 16)\n test(sum_all_elements([1, -7, 10, 23]) == -6)\n test(sum_all_elements(range(1,555,2)) == 76729)", "def main():\n LIMIT = 600\n GOAL = 1000\n for i in range(1, LIMIT + 1):\n for j...
[ "0.61493313", "0.60819286", "0.6049005", "0.6046813", "0.6008328", "0.6006641", "0.59959704", "0.5975238", "0.5971036", "0.5952314", "0.5950891", "0.59478694", "0.5946964", "0.5891142", "0.5890752", "0.5879602", "0.58724064", "0.5866288", "0.58557177", "0.58525246", "0.583461...
0.0
-1
Testing task 555 class main logic (build first n rows of Pascal's triangle)
def test_task555(input_value, expected_value): assert list(algo.Task555.main_logic(input_value)) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pascal_triangle(n):\n if n > 0:\n triangle_rows = [[1]]\n for i in range(1, n):\n middle_numbers_list = []\n for pair in zip(triangle_rows[-1], triangle_rows[-1][1:]):\n middle_numbers_list.append(sum(pair))\n triangle_rows.append([1] + middle_nu...
[ "0.74002606", "0.72939163", "0.7154903", "0.70932907", "0.70524055", "0.7048367", "0.69987327", "0.6942326", "0.68898964", "0.682261", "0.6699336", "0.66957605", "0.6665082", "0.6664991", "0.65769607", "0.6509134", "0.6398329", "0.6390257", "0.6361467", "0.63577336", "0.63531...
0.0
-1
Testing task 554 class main logic (must return list of pythagorean triplets)
def test_task554_main_logic(number, expected_value): assert algo.Task554.main_logic(number + 1) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n # Since a < b < c, we have a + b + c = 1000 > a + a + a, making a < 334.\n for a in range(1, 334):\n # Then b + c = 1000 - a > b + b, making b < 500 - a/2.\n for b in range(a + 1, 501 - a // 2):\n c = 1000 - a - b\n\n # check for Pythagorean triplet\n ...
[ "0.80820906", "0.7876407", "0.765679", "0.7482243", "0.7481747", "0.7405778", "0.7372898", "0.72456163", "0.7105896", "0.70815045", "0.7053278", "0.7037538", "0.68017954", "0.67534345", "0.673594", "0.66925913", "0.66410345", "0.6318562", "0.62769186", "0.62421864", "0.620507...
0.0
-1
Testing task 107 class main logic (must return the largest integer k, at which 4 ^k < m)
def test_task107_main_logic(number, expected_value): assert algo.Task107.main_logic(number) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main() -> int:\n\n a = None\n for n, g in enumerate(gen_primes(100000, 1000000)):\n repeat, indices = check_if_has_3_repeated_digits(str(g))\n if repeat:\n a = check_for_family_of_primes(repeat, indices, list(str(g)))\n if len(a) > 7 and min(a) > 100000:\n ...
[ "0.6825895", "0.67128354", "0.6694615", "0.6600402", "0.659205", "0.65894896", "0.65685385", "0.64729345", "0.6467728", "0.64583665", "0.6435412", "0.6422708", "0.6354484", "0.6291198", "0.624428", "0.62414813", "0.62265134", "0.62159485", "0.618845", "0.61884433", "0.6183926...
0.0
-1
Testing task 243a class main logic (must return True if there are two numbers (x, y) that x ^2 + y ^2 = n)
def test_task243a_main_logic(number, expected_value): assert algo.Task243a.main_logic(number) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sat(nums: List[int]):\n a, b, c, n = nums\n return (a ** n + b ** n == c ** n) and min(a, b, c) > 0 and n > 2", "def test():\n Z = func.evaluate_circuit(F, e_x, e_y, e_xor)\n if Z == d[0]:\n return 0\n elif Z == d[1]:\n return 1", "def pythagorean_triples(n):\n pass"...
[ "0.6706456", "0.66754526", "0.6513662", "0.6498251", "0.6456267", "0.6443523", "0.64273536", "0.64265066", "0.639999", "0.6359324", "0.6353393", "0.63304996", "0.6319994", "0.6313225", "0.6308553", "0.63083005", "0.62622416", "0.6259431", "0.6248913", "0.62471896", "0.6246515...
0.0
-1
Testing task 243a class main logic (must return True if there are two numbers (x, y) that x ^2 + y ^2 = n)
def test_task243b_main_logic(number, expected_value): assert algo.Task243b.main_logic(number) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sat(nums: List[int]):\n a, b, c, n = nums\n return (a ** n + b ** n == c ** n) and min(a, b, c) > 0 and n > 2", "def test():\n Z = func.evaluate_circuit(F, e_x, e_y, e_xor)\n if Z == d[0]:\n return 0\n elif Z == d[1]:\n return 1", "def pythagorean_triples(n):\n pass"...
[ "0.67070174", "0.6674726", "0.6514928", "0.65001607", "0.64590937", "0.6443379", "0.643019", "0.6427951", "0.6402992", "0.6362123", "0.635343", "0.6330218", "0.63233894", "0.63132364", "0.63102883", "0.630757", "0.62614566", "0.62584585", "0.6249293", "0.6248185", "0.62469304...
0.0
-1
Testing task 108 class main logic ( must return the least number, that is bigger than n and is degree of number 2)
def test_task108_main_logic(number, expected_value): assert algo.Task108.main_logic(number) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pollard(N) :\n\tleft = right = seed\n\td = 1\n\twhile d == 1: \n\t\tleft = pseudo(left,N)\n\t\tright = pseudo(pseudo(right,N),N)\n\t\td = gcd(abs(left-right),N)\n\t\tif PRINT_TRACE : \n\t\t\tprint(left,right,d)\n\tif d == N : \n\t\tprint(\"Failure\")\n\telse :\n\t\tprint(\"non trivial factor is %d\"%d)", "de...
[ "0.6351067", "0.6322759", "0.62906826", "0.6278602", "0.6233129", "0.62023616", "0.6182629", "0.6170508", "0.61595374", "0.6153705", "0.6142571", "0.6103457", "0.6080529", "0.60778254", "0.6067927", "0.6057732", "0.60488695", "0.60452557", "0.60165286", "0.60158545", "0.60100...
0.0
-1
Testing task 331a class main logic ( must return the sum of 3 integers in power 2, that is equal to n)
def test_task331a_main_logic(number, expected_value): assert algo.Task331a.main_logic(number) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_of_three_squares(n):\n special = {1:(1, 0, 0), 2:(1, 1, 0), 3:(1, 1, 1), 10: (1, 3, 0), 34: (3, 3, 4), 58:(3, 7, 0),\n 85:(6, 7, 0), 130:(3, 11, 0), 214:(3, 6, 13), 226:(8, 9, 9), 370:(8, 9, 15),\n 526:(6, 7, 21), 706:(15, 15, 16), 730:(1, 27, 0), 1414:(6, 17, 33), 1906:(13, 21, 36),\n ...
[ "0.71092266", "0.69121766", "0.6900263", "0.6852991", "0.68254423", "0.6779459", "0.6768679", "0.6742208", "0.66945046", "0.66854495", "0.66733605", "0.6636726", "0.65705687", "0.6565622", "0.65579176", "0.6534161", "0.65196925", "0.650806", "0.64977133", "0.6482399", "0.6475...
0.0
-1
Testing task 331b class main logic ( must return the array of sums of 3 integers in power 2, that is equal to n)
def test_task331b_main_logic(number, expected_value): assert algo.Task331b.main_logic(number) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_of_three_squares(n):\n special = {1:(1, 0, 0), 2:(1, 1, 0), 3:(1, 1, 1), 10: (1, 3, 0), 34: (3, 3, 4), 58:(3, 7, 0),\n 85:(6, 7, 0), 130:(3, 11, 0), 214:(3, 6, 13), 226:(8, 9, 9), 370:(8, 9, 15),\n 526:(6, 7, 21), 706:(15, 15, 16), 730:(1, 27, 0), 1414:(6, 17, 33), 1906:(13, 21, 36),\n ...
[ "0.6796521", "0.67540747", "0.6711268", "0.67015684", "0.6571917", "0.6558617", "0.65404266", "0.650606", "0.64722335", "0.64675075", "0.645329", "0.6389222", "0.63783646", "0.63763386", "0.6341474", "0.633265", "0.63314736", "0.63301826", "0.6326787", "0.6307143", "0.6287321...
0.0
-1
Testing base class with validation method for exceptions
def test_task_with_two_int_validation_parameters_validate_exceptions_task87(data, expected_value): with pytest.raises(expected_value): algo.Task87.validate_data(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_validation(self):\n self.validationFails()", "def test_should_not_be_callable(self):\n with self.assertRaises(NotImplementedError):\n BaseValidator()(\"any-value\")", "def test_validate(self):\n pass", "def test_validation(self):\r\n\r\n with self.assertRaises(...
[ "0.7366222", "0.7237699", "0.721509", "0.7119311", "0.7103784", "0.70534474", "0.7048264", "0.6987562", "0.6925039", "0.6916672", "0.6913254", "0.6906676", "0.68661255", "0.68530154", "0.68451655", "0.68323594", "0.68066764", "0.6797967", "0.6775788", "0.67419225", "0.6741922...
0.0
-1
Testing task 87 class main logic
def test_task87_main_logic(number, quantity, expected_value): assert algo.Task87.main_logic(number, quantity) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def task():", "def task5(self):\n\n pass", "def task(self):", "def task(self):", "def test_solve_task(self):\n pass", "def task4(self):\n\n pass", "def task1(self):\n \n pass", "def task3(self):\n\n pass", "def test_get_run(self):\n pass", "def tas...
[ "0.76041514", "0.7486486", "0.74503386", "0.74503386", "0.7376307", "0.73466694", "0.7306746", "0.7189935", "0.7185765", "0.71620274", "0.7104699", "0.7092412", "0.7092412", "0.7046849", "0.70468414", "0.70148546", "0.69969004", "0.69918513", "0.69918513", "0.69721514", "0.69...
0.0
-1
Testing base class with validation method for exceptions
def test_task_with_two_int_validation_parameters_validate_exceptions_task226(data, expected_value): with pytest.raises(expected_value): algo.TaskWithTwoIntValidationParameters.validate_data(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_validation(self):\n self.validationFails()", "def test_should_not_be_callable(self):\n with self.assertRaises(NotImplementedError):\n BaseValidator()(\"any-value\")", "def test_validate(self):\n pass", "def test_validation(self):\r\n\r\n with self.assertRaises(...
[ "0.7366222", "0.7237699", "0.721509", "0.7119311", "0.7103784", "0.70534474", "0.7048264", "0.6987562", "0.6925039", "0.6916672", "0.6913254", "0.6906676", "0.68661255", "0.68530154", "0.68451655", "0.68323594", "0.68066764", "0.6797967", "0.6775788", "0.67419225", "0.6741922...
0.0
-1
Testing task 226 class main logic
def test_task226_main_logic(number1, number2, expected_value): assert algo.Task226.main_logic(number1, number2) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def task():", "def test_get_task_output(self):\n pass", "def task(self):", "def task(self):", "def task():\n pass", "def task():\n pass", "def task():\n\n\tprint('Example task executed.')", "def test_get_run(self):\n pass", "def setUp(self):\n self.t = Task()", "def set...
[ "0.7679905", "0.75751007", "0.74822515", "0.74822515", "0.7291026", "0.7291026", "0.7206594", "0.71457916", "0.71280587", "0.71280587", "0.6997051", "0.6974356", "0.69725513", "0.69159216", "0.6897864", "0.6865529", "0.6863298", "0.6853657", "0.6784358", "0.6762433", "0.67399...
0.0
-1
Testing base class with validation method for exceptions
def test_task_with_two_int_validation_parameters_validate_exceptions_task559(data, expected_value): with pytest.raises(expected_value): algo.TaskWithOneIntValidationParameter.validate_data(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_validation(self):\n self.validationFails()", "def test_should_not_be_callable(self):\n with self.assertRaises(NotImplementedError):\n BaseValidator()(\"any-value\")", "def test_validate(self):\n pass", "def test_validation(self):\r\n\r\n with self.assertRaises(...
[ "0.7366222", "0.7237699", "0.721509", "0.7119311", "0.7103784", "0.70534474", "0.7048264", "0.6987562", "0.6925039", "0.6916672", "0.6913254", "0.6906676", "0.68661255", "0.68530154", "0.68451655", "0.68323594", "0.68066764", "0.6797967", "0.6775788", "0.67419225", "0.6741922...
0.0
-1
Testing eratosthenes function in task 559
def test_task559_eratosthenes(number, expected_value): assert algo.Task559.eratosthenes(number) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eratosthenes(x):\n multiples = []\n for i in range(2, x+1):\n if i not in multiples:\n print (i)\n for j in range(i*i, x+1, i):\n multiples.append(j)", "def main():\n doctest.testmod()\n print(eratosthenes(2))", "def eratosthenes2(n):\n multiples =...
[ "0.7555729", "0.7525924", "0.7279653", "0.7068233", "0.6793754", "0.6754159", "0.6716757", "0.66996837", "0.66710955", "0.657833", "0.6571549", "0.6510445", "0.64366025", "0.6392734", "0.62452984", "0.62227535", "0.6184394", "0.6181353", "0.61811525", "0.61747223", "0.616319"...
0.7610841
0
Testing mersen_numbers function in task 559
def test_task559_mersen_number(number, expected_value): assert algo.Task559.mersen_numbers(number) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_numbers(number):\n print(\"\\nRunning test_numbers with {}\".format(number))", "def test_numbers(self):\n \n result = gen_expansion(sym.pi, 2)\n self.assertEqual(result, '14')\n result = gen_expansion(sym.exp(1), 2)\n self.assertEqual(result, '72')", "def test_angl...
[ "0.5994305", "0.58658266", "0.5729014", "0.56989163", "0.5615644", "0.5593863", "0.5531031", "0.55126804", "0.54742104", "0.5439089", "0.543804", "0.54284734", "0.54218674", "0.54073083", "0.5352614", "0.5331817", "0.53211087", "0.5284186", "0.5279782", "0.52637136", "0.52580...
0.7466113
0
Testing task 559 class main logic
def test_task559_main_logic(number, expected_value): assert algo.Task559.main_logic(number) == expected_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def task5(self):\n\n pass", "def task():", "def task4(self):\n\n pass", "def runtest(self):", "def test_get_run(self):\n pass", "def task(self):", "def task(self):", "def task4_1(self):\n\n pass", "def task1(self):\n \n pass", "def task3(self):\n\n ...
[ "0.76807034", "0.73960394", "0.7371841", "0.7336318", "0.73260546", "0.7267288", "0.7267288", "0.71438813", "0.71006924", "0.70854497", "0.70318955", "0.698589", "0.69634557", "0.6915204", "0.6915204", "0.6915204", "0.6888586", "0.6873803", "0.68686956", "0.6868453", "0.68684...
0.0
-1