query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Draw a line between previous and current data points.
def drawPoints(self, qp): # pen = self.pen size = self.size() self.yOffset = [size.height()*0.2 + size.height()*0.618/self.NUM_CHANNEL * y for y in xrange(self.NUM_CHANNEL) ] for ix in xrange(self.NUM_CHANNEL): self.pen.setStyle(Qt.SolidLine) self.pen.setWidth(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def previous_line():\r\n set_point(point().previous_line())", "def draw_line():\n global y1, y2\n canvas.create_line(x1, y1, x2, y2, width=2, fill=color)\n y1 -= 10\n y2 += 10", "def draw_line(self, x0, y0, x1, y1, color=Color['white']):\n pygame.draw.line(self.display, color, (x0, y0), (x1...
[ "0.75817573", "0.6934287", "0.680875", "0.6636438", "0.66180754", "0.65603083", "0.64937496", "0.64824474", "0.6427642", "0.64183474", "0.6389613", "0.6386527", "0.63336986", "0.6306745", "0.63025856", "0.6294018", "0.62741625", "0.6271146", "0.6259881", "0.62597656", "0.6258...
0.56101316
99
Returns a test suite configured with a test layer.
def DocFileSuite(testfile, flags=FLAGS, setUp=setUp, layer=FUNCTIONAL_TESTING): m = manuel.doctest.Manuel(optionflags=flags, checker=CHECKER) m += manuel.codeblock.Manuel() return layered( manuel.testing.TestSuite(m, testfile, setUp=setUp, globs=dict(layer=layer)), layer=layer)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def suite():\n loader = unittest.TestLoader()\n testsuite = loader.loadTestsFromModule(sys.modules[__name__])\n return testsuite", "def suite():\n return unittest.TestLoader().loadTestsFromName(__name__)", "def suite():\n loader = unittest.TestLoader()\n mysuite = unittest.TestSuite()\n my...
[ "0.76350325", "0.7401057", "0.7197761", "0.71340877", "0.7119628", "0.7110631", "0.70487565", "0.7030444", "0.69746447", "0.69642705", "0.69487154", "0.69442624", "0.6922646", "0.68770444", "0.68366295", "0.681701", "0.6802467", "0.6778123", "0.6738736", "0.6681138", "0.66803...
0.56368035
79
Return the value for a win (+1) if the game is over, otherwise return the minimum value over all legal child nodes.
def min_value(self, state, min_alpha, min_beta, min_depth): if state.terminal_test(): return state.utility(0) if min_depth <=0 : return self.score(state) v = float("inf") for a in state.actions(): v = min(v, self.max_value(state.result(a), min...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def minimax_value(self, game, depth):\n if self.time_left() < self.TIMER_THRESHOLD:\n raise SearchTimeout()\n\n # If the current node is a terminal node or we've reached the depth limit,\n # return the score of the current node.\n if depth == 0 or game.is_winner(self) or game...
[ "0.73772734", "0.72615904", "0.70722085", "0.6971487", "0.6908342", "0.6781943", "0.66904825", "0.66322535", "0.6589574", "0.6579567", "0.6574109", "0.65508115", "0.65438753", "0.65390706", "0.64980227", "0.6480823", "0.6473899", "0.6463454", "0.6454646", "0.6386392", "0.6357...
0.5959784
57
Return the value for a loss (1) if the game is over, otherwise return the maximum value over all legal child nodes.
def max_value(self, state, max_alpha, max_beta, max_depth): if state.terminal_test(): return state.utility(0) if max_depth <=0 : return self.score(state) v = float("-inf") for a in state.actions(): v = max(v, self.min_value(state.result(a), ma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_value(gameState):\n if terminal_test(gameState): return -1", "def __max_value(self, game, depth):\n self.__check_time()\n val = float('-inf')\n\n # check if out of moves or at depth limit\n if self.__is_terminal(game, depth):\n val = self.score(game, self)\n ...
[ "0.7336388", "0.71256316", "0.70073336", "0.6956904", "0.6888057", "0.6767903", "0.67463326", "0.67286676", "0.67062616", "0.6689845", "0.6562635", "0.65383226", "0.6523367", "0.6523264", "0.6508314", "0.64459115", "0.6435481", "0.6431325", "0.64089143", "0.63934004", "0.6388...
0.6366291
21
Spherical average density as a function of 3d radius.
def density_lens(self, r, alpha_1, w_c, w_t, e1=0, e2=0, center_x=0, center_y=0): theta_E_conv, w_c, w_t, s_scale_1, s_scale_2 = self.param_convert( alpha_1, w_c, w_t, e1, e2 ) f_1 = self._nie_1.density_lens( r, theta_E_conv, e1, e2, s_scale_1, center_x, center_y ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spherical_function(j, x, y, z):\n theta = np.arccos(z)\n phi = np.arctan2(y, x)\n return angular_function(j, theta, phi)", "def cosmic_average_density_solar_mass_per_kpc3_from(self, redshift: float) -> float:\r\n cosmic_average_density_kpc = (\r\n self.critical_density(z=redshift)....
[ "0.65772235", "0.6442502", "0.643668", "0.6411733", "0.63362277", "0.6293318", "0.62569475", "0.62214035", "0.619501", "0.6167706", "0.6165493", "0.61422056", "0.61325884", "0.6105005", "0.60995215", "0.60757124", "0.6069958", "0.6029771", "0.6025661", "0.60089463", "0.600733...
0.0
-1
Get a str of current time
def get_now(): return datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_current_time() -> str:\n return datetime.now().strftime(\"%FT%H:%M:%S\")", "def time_now() -> str:\n return datetime_to_str(datetime_now())", "def str_current_time():\n return strftime(\"%Y_%m_%d_%H_%M_%S_%Z\", gmtime())", "def timestr():\n return dt.strftime(dt.now(),'%H:%M:%S')", "de...
[ "0.865743", "0.86497694", "0.8637203", "0.8448242", "0.84018785", "0.83604866", "0.8354596", "0.8339417", "0.8303579", "0.82449746", "0.81321", "0.80703133", "0.8048203", "0.802489", "0.8009913", "0.80075294", "0.79958105", "0.79369855", "0.7884949", "0.7871418", "0.78655016"...
0.7866158
20
Set the customDescription in the meta based on provided optional custom description or no description. This will inject into the meta the `customDescription` and `showDescriptionValue` if the `description` is provided as argument, otherwise it will inject 'no description'. It returns the meta definition of the widget.
def _set_description( meta: Dict, description: Optional[Union[str, bool]] = None, **kwargs ) -> Dict: if description is False or description is None: show_description_value = MetaWidget.DESCRIPTION_OPTION_NOTHING description = "" elif isinstance(description, str): show_description_va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_description(self, desc: str) -> None:\n self.metadata.data[\"description\"] = desc", "def get_meta_description(self, language=None, fallback=True, version_id=None, force_reload=False):\n return self.get_title_obj_attribute(\"meta_description\", language, fallback, version_id, force_reload)"...
[ "0.59299886", "0.58760107", "0.5664593", "0.5646101", "0.56214607", "0.55615705", "0.55515456", "0.554994", "0.5527326", "0.5512343", "0.5463594", "0.5427093", "0.541945", "0.5414692", "0.5400024", "0.5386919", "0.5368402", "0.53523314", "0.5350993", "0.53458434", "0.5321847"...
0.7902633
0
Validates the `slickml version` command.
def test_cli__passes__with_version_command() -> None: runner = CliRunner() result = runner.invoke( cli, args="version", ) assert_that(result.exit_code).is_equal_to(0) assert_that(result.output).is_instance_of(str) assert_that(result.output).contains(f"SlickML Version: {__versio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid_version(self):\n pass", "def check_version(ctx, _, value):\n if not value or ctx.resilient_parsing:\n return\n\n click.echo(f\"geocube v{importlib.metadata.version('geocube')}\")\n\n ctx.exit()", "def check_version():\n err = \"PaddlePaddle version 1.6 or higher is requir...
[ "0.66529775", "0.6639908", "0.6474816", "0.647093", "0.63744926", "0.6338787", "0.6269328", "0.6083448", "0.60468054", "0.6036306", "0.60277903", "0.5971272", "0.5961025", "0.59483457", "0.5930615", "0.5930225", "0.5925808", "0.5914152", "0.5891469", "0.5887173", "0.5884716",...
0.5960367
13
r"""A value of true is returned if it is a default rewriteaction.
def isdefault(self) : try : return self._isdefault except Exception as e: raise e
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def redirect_rewrite(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"redirect_rewrite\")", "def redirect_rewrite(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"redirect_rewrite\")", "def rewrite_config(self) -> Optional['outputs.RuleRuleActionRewriteConfig']:\...
[ "0.6304335", "0.6304335", "0.58344686", "0.57790065", "0.5763412", "0.57028294", "0.56745297", "0.56745297", "0.56745297", "0.56710064", "0.5560442", "0.5466676", "0.5448285", "0.5397061", "0.533752", "0.53143483", "0.5301279", "0.5259219", "0.52356434", "0.5216609", "0.52057...
0.50480485
40
r""" Use this API to fetch all the rewriteaction resources that are configured on netscaler.
def get(cls, client, name="", option_="") : try : if not name : obj = rewriteaction() response = obj.get_resources(client, option_) else : if type(name) is not list : if type(name) == cls : raise Exception('Invalid parameter name:{0}'.format(type(name))) obj = rewriteaction() ob...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rewrites(self) -> Sequence['outputs.RewriteResponse']:\n return pulumi.get(self, \"rewrites\")", "def rewrite_configs(self) -> Sequence['outputs.GetRulesRuleRuleActionRewriteConfigResult']:\n return pulumi.get(self, \"rewrite_configs\")", "def rewrite_config(self) -> Optional['outputs.RuleRul...
[ "0.6635202", "0.65814066", "0.54352105", "0.5325518", "0.5281006", "0.5271869", "0.52580476", "0.51275", "0.506616", "0.4958792", "0.49507806", "0.49458218", "0.4927503", "0.48807478", "0.4879837", "0.48721504", "0.48533827", "0.48511428", "0.484289", "0.48324654", "0.4830334...
0.5855259
2
Function to declare main member variables. X and Y coordinates are set in random locations right along the left edge of screen
def __init__(self): #random.uniform(1, 10) = random float values for x coordinate to make sure ball spawns on left edge of screen with random values #random.unform(1, 330) = 1-330 was chosen to make sure the ball can spawn randomly either below or on top of left edge of the screen self.x = rando...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_random_coord(self):\n x_coord = \\\n random.randrange(Screen.SCREEN_MIN_X, Screen.SCREEN_MAX_X)\n y_coord = \\\n random.randrange(Screen.SCREEN_MIN_Y, Screen.SCREEN_MAX_Y)\n self.x_coord = x_coord\n self.y_coord = y_coord", "def __init__(self, x, y):\n ...
[ "0.74468565", "0.7133956", "0.70399797", "0.7037827", "0.7037827", "0.69348204", "0.6865996", "0.6836733", "0.6758966", "0.6749782", "0.6749782", "0.6678604", "0.6624898", "0.65936226", "0.6570457", "0.6570457", "0.6570457", "0.6570457", "0.6570457", "0.655606", "0.65469563",...
0.75196844
0
Function to assign center of ball with Point() class' attributes and the velocity from Velocity() class
def __init__(self): self.center = Point() self.velocity = Velocity()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, posn_x, posn_y, velocity_x, velocity_y, kula): \n self.posn_x = posn_x # x position of box containing the ball (bottom). \n self.posn_y = posn_y # x position of box containing the ball (left edge). \n self.velocity_x = velocity_x # amount of x-mo...
[ "0.7039646", "0.6801206", "0.67774403", "0.6590186", "0.6381299", "0.631689", "0.62913436", "0.62616825", "0.62611747", "0.6230307", "0.6218584", "0.61599684", "0.6117306", "0.61100805", "0.61074823", "0.60990787", "0.60982317", "0.60596746", "0.60532373", "0.6053025", "0.604...
0.7635171
0
Responsible for making sure ball bounces horizontally but lost if it passes the right edge of screen.
def bounce_horizontal(self): self.velocity.dx = -self.velocity.dx return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ball_bounce(wall):\n if wall: # top & bottom walls\n ball_vel[1] = -ball_vel[1]\n else: # left or right walls\n ball_vel[0] = -ball_vel[0]", "def _bounce(self):\n right = self.surface.get_width() - self.size\n left = self.size\n top = self.size\n bottom = se...
[ "0.68605554", "0.6775136", "0.6759548", "0.671623", "0.6630472", "0.66025406", "0.6596937", "0.65426517", "0.6484303", "0.6483002", "0.6480968", "0.64414144", "0.64101404", "0.6392284", "0.6383765", "0.6381507", "0.63758355", "0.6327392", "0.6320571", "0.63168603", "0.6315765...
0.6936616
0
Responsible for making sure ball bounces up and down vertically.
def bounce_vertical(self): self.velocity.dy = -self.velocity.dy return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bounce(self):\n self.y_dir *= -1 # Reverse vertical direction of travel", "def verticalBounce(self):\n self._vy = random.uniform(-1.1,-.9) * self._vy", "def vertbounce(self):\r\n self.dy=-self.dy", "def _bounce(self):\n right = self.surface.get_w...
[ "0.76470816", "0.75425434", "0.72014", "0.7162889", "0.7140294", "0.7117331", "0.71083456", "0.7053118", "0.6982345", "0.6925602", "0.6903974", "0.6897591", "0.6808927", "0.67745864", "0.6760082", "0.67221045", "0.6614949", "0.6604583", "0.65904814", "0.65849024", "0.6572808"...
0.7755596
0
Checks to see if the ball has hit the paddle and if so, calls its bounce method.
def check_hit(self): too_close_x = (PADDLE_WIDTH / 2) + BALL_RADIUS too_close_y = (PADDLE_HEIGHT / 2) + BALL_RADIUS if (abs(self.ball.center.x - self.paddle.center.x) < too_close_x and abs(self.ball.center.y - self.paddle.center.y) < too_close_y and self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_collision(self):\n if self.window.get_object_at(self.ball.x,self.ball.y+self.radius*2) is self.paddle:\n self.bounce()\n if self.window.get_object_at(self.ball.x+self.radius*2,self.ball.y+self.radius*2) is self.paddle:\n self.bounce()", "def updateBall(self):\n ...
[ "0.798999", "0.7777622", "0.7708951", "0.7706148", "0.76476926", "0.76099795", "0.74214804", "0.73795027", "0.7288236", "0.72598", "0.7258313", "0.72472936", "0.72299653", "0.71720135", "0.70372385", "0.69409704", "0.6931272", "0.6882324", "0.6877795", "0.6740171", "0.6583581...
0.6979026
15
Checks to see if the ball has hit the borders of the screen and if so, calls its bounce methods.
def check_bounce(self): if self.ball.center.x < 0 and self.ball.velocity.dx < 0: self.ball.bounce_horizontal() if self.ball.center.y < 0 and self.ball.velocity.dy < 0: self.ball.bounce_vertical() if self.ball.center.y > SCREEN_HEIGHT and self.ball.velocity.dy > 0: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateBall(self):\n if self._ball.getLeft() <= 0 or self._ball.getRight() >= GAME_WIDTH:\n self._ball.bounceSides()\n if self._ball.getTop() >= GAME_HEIGHT:\n self._ball.bounceTopBottom()\n self._ball.moveBall()\n \n self._updateCollisions()", "def che...
[ "0.78495353", "0.7828999", "0.76905483", "0.75966907", "0.75013435", "0.7473912", "0.74503756", "0.7166787", "0.7094467", "0.7084806", "0.7053152", "0.7021688", "0.7005068", "0.6914101", "0.6866494", "0.68219787", "0.6757214", "0.67538184", "0.6732893", "0.6680376", "0.66755"...
0.81079966
0
Runs at the end of the test case; drops the db
def tearDown(self): with self.app.app_context(): db.session.remove() db.drop_all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def teardown():\n teardown_db()", "def tearDown(self):\n db.session.commit()\n db.drop_all()", "def tearDown(self):\n self.db.drop_all()\n pass", "def tearDown(self):\n with app.app_context():\n db = app.db.get_db()\n cur = db.cursor()\n ...
[ "0.87688816", "0.8661875", "0.8634616", "0.85929716", "0.8583327", "0.85801166", "0.85801166", "0.85801166", "0.85801166", "0.85801166", "0.85801166", "0.85801166", "0.85801166", "0.85801166", "0.85801166", "0.85801166", "0.85801166", "0.85801166", "0.85801166", "0.85801166", ...
0.82276815
73
Exports the weather dataframe as a csv file formatted for importing into Amicus.
def weather_to_amicus_csv(weather_df: DataFrame, output_fn) -> None: amicus_df = weather_df[DATETIME].to_frame(name='Date time') amicus_df['Air temperature (\u00b0C)'] = weather_df[TEMP] amicus_df['Relative humidity (%)'] = weather_df[RH] amicus_df['10 m wind speed (km/h)'] = weather_df[WIND_SPEED] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_sensor_data_to_csv(self):\n df = pd.read_sql('SELECT * FROM sensor_data', self.conn)\n df.to_csv('output/sensor_data.csv', index=False)", "def write_csv(self):\n self.tableView.df.to_csv('Data export.csv', index=False)\n print('CSV file exported')", "def dbtocsv():\n ...
[ "0.7839396", "0.73751986", "0.7328462", "0.71246094", "0.70415", "0.7000611", "0.69713014", "0.69679004", "0.69349575", "0.6801677", "0.6783012", "0.67826456", "0.6775847", "0.67722857", "0.67339593", "0.67338246", "0.6722942", "0.66809446", "0.663279", "0.657332", "0.6567911...
0.7589649
1
Retrieves an organisation from the repository
def find(self, organisation_id: OrganisationId) -> Optional[Organisation]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_org(self):\n return Org.deserialize(self._get_single('org', {}, from_results=False))", "def get_org(self, retry_on_rate_exceed=False):\n return Org.deserialize(self._get_raw('org', {}, retry_on_rate_exceed))", "def get_organisation_with_role(user, rolecode):\n return get_organisations_...
[ "0.7201799", "0.7143288", "0.7084282", "0.7046704", "0.6988632", "0.6962273", "0.69420457", "0.6782259", "0.67702776", "0.6766686", "0.6682064", "0.6671275", "0.66634905", "0.6579827", "0.6555584", "0.65302795", "0.6458586", "0.6435865", "0.6434992", "0.6410172", "0.64003015"...
0.7570137
0
Transform nltk POS to wordnet POS.
def _wnpos(pos: str) -> str: pos = pos.lower() wnpos = "n" if pos.startswith("j"): wnpos = "a" elif pos[0] in ('n', 'r', 'v'): wnpos = pos[0] return wnpos
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_wordnet_pos(pos):\n if pos[0] == 'J':\n return nltk.corpus.wordnet.ADJ\n elif pos[0] == 'V':\n return nltk.corpus.wordnet.VERB\n elif pos[0] == 'N':\n return nltk.corpus.wordnet.NOUN\n elif pos[0] == 'R':\n return nltk.corpus.wordnet.ADV\n else:\n # As defa...
[ "0.6720926", "0.6385923", "0.6300673", "0.6275617", "0.62179047", "0.6204052", "0.6181552", "0.6084939", "0.6077209", "0.60389775", "0.6019915", "0.6008052", "0.6008052", "0.6008052", "0.6008052", "0.6008052", "0.6008052", "0.59951156", "0.5990497", "0.597806", "0.59759283", ...
0.0
-1
Turn a set of `re` flags into a string suitable for inclusion in a regex. >>> import superexpressive as se >>> se.re_flags_to_string(re.A) '(?a)' >>> import superexpressive as se >>> se.re_flags_to_string(re.IGNORECASE | re.LOCALE) '(?iL)' >>> import superexpressive as se >>> se.re_flags_to_string() ''
def re_flags_to_string(flags: int=0) -> str: possible_flags = { re.ASCII: "a", re.IGNORECASE: "i", re.LOCALE: "L", re.UNICODE: "u", re.MULTILINE: "m", re.DOTALL: "s", re.VERBOSE: "x", } flagchrs = "" for flagval, flagchr in possible_flags.items():...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_text(flags):\n\n return _to_text(flags, _by_value, _flags_order)", "def to_regex(*args:List[str], flags:int=0, compile:bool=True) -> Union[str, re.compile]:\n pattern = \"\".join(args)\n\n if compile:\n return re.compile(pattern, flags=flags)\n else:\n flagstring = re_flags_to_st...
[ "0.6624036", "0.61152077", "0.59513146", "0.5809818", "0.5799426", "0.57630664", "0.56715584", "0.5597607", "0.55446595", "0.55166924", "0.5434782", "0.54221", "0.54160994", "0.52571785", "0.5225581", "0.5205827", "0.5185662", "0.50566024", "0.5014961", "0.49905992", "0.49066...
0.87320936
0
A length 1 item that matches any of the included characters. >>> import superexpressive as se >>> se.any_of_chars('A', 'F', 'dkja') '[AFdkja]'
def any_of_chars(*args:List[str]) -> str: # TODO uniq chars = "".join(args) return f"[{chars}]"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def oneof(chars):\n return Pattern(\"[\" + re.escape(chars) + \"]\")", "def stringContainsAllCharacters(string, characters):\n assert type(string) is str\n assert iter(characters)\n return False not in [character in string for character in characters]", "def test_single_char(self):\n self.as...
[ "0.7097736", "0.6058937", "0.59057176", "0.58306646", "0.5787647", "0.5732651", "0.57322675", "0.5691855", "0.5670252", "0.5577965", "0.55327433", "0.5481739", "0.5469526", "0.54675406", "0.54498774", "0.5449688", "0.54294145", "0.53325975", "0.5286011", "0.52833676", "0.5264...
0.6909282
1
Overridden. Return a window containing the main content of the dialog.
def GetContentWindow(self): return self.FindWindow("content")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main_window(self) -> MainWindow:\n return self._main_window", "def GetMainWindow(self):\r\n \r\n return self._main_win", "def get_main_window():\n\n pass", "def GetWindow(self):\r\n\r\n return self.window", "def maya_main_window():\n main_window_ptr = omui.MQtUtil.main...
[ "0.7395543", "0.7219583", "0.71592057", "0.70130676", "0.68830043", "0.68830043", "0.68830043", "0.6858769", "0.6769049", "0.674174", "0.6695728", "0.6677378", "0.6654865", "0.65950394", "0.6584246", "0.6475057", "0.6457443", "0.64419985", "0.64361936", "0.64361936", "0.64214...
0.69362885
4
Assign the content window to this dialog.
def SetContent(self, window): window.SetName("content") window.SetBackgroundColour(wx.GetApp().settings.bg_color) window.SetForegroundColour(wx.GetApp().settings.fg_color) window.SetFont(wx.GetApp().settings.text_font)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetContentWindow(self):\n return self.FindWindow(\"content\")", "def set_content(self, widget):\n\t\tself.content = widget", "def SetWindow(self, w):\r\n\r\n self.window = w", "def set_window(self, handle):\n pass", "def create_dialog_content_helper(cls, title, content):\n #...
[ "0.66529715", "0.6434889", "0.6285857", "0.6214485", "0.61130077", "0.6101298", "0.6094938", "0.60076296", "0.5951275", "0.5916565", "0.5868372", "0.5795479", "0.5709565", "0.5680944", "0.56758136", "0.5666169", "0.56418693", "0.55526847", "0.55474746", "0.5544652", "0.552217...
0.67843306
0
Return a vertical static line.
def VertLine(self, parent, depth=1): line = sppasStaticLine(parent, orient=wx.LI_VERTICAL) line.SetMinSize(wx.Size(depth, -1)) line.SetSize(wx.Size(depth, -1)) line.SetPenStyle(wx.PENSTYLE_SOLID) line.SetDepth(depth) line.SetForegroundColour(self.GetForegroundColour()) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vertical_line(t, n):\n lt(t)\n fd(t,n)\n rt(t)", "def _createline(self):\n return self.cv.create_line(0, 0, 0, 0, fill=\"\", width=2,\n capstyle = TK.ROUND)", "def get_vertical_line(self, point: Sequence[float], **kwargs) -> Line:\n return self.get_l...
[ "0.7034275", "0.68892854", "0.6814996", "0.6659123", "0.6497669", "0.64920145", "0.63483816", "0.6292037", "0.626732", "0.6212418", "0.60922736", "0.6033434", "0.5909657", "0.58432186", "0.5842352", "0.58406615", "0.5830174", "0.5825188", "0.5819703", "0.58046913", "0.5788228...
0.72394747
0
Fadein opacity of the dialog.
def __alpha_cycle_in(self, *args): self.opacity_in += self.deltaN if self.opacity_in <= 0: self.deltaN = -self.deltaN self.opacity_in = 0 if self.opacity_in >= 255: self.deltaN = -self.deltaN self.opacity_in = 255 self.timer1.Stop() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def FadeOut(self):\r\n\r\n while 1:\r\n self._alpha_amount -= 10\r\n if self._alpha_amount <= 0:\r\n self._alpha_amount = 255\r\n return\r\n\r\n self.SetTransparent(self._alpha_amount)\r\n wx.SafeYield()\r\n wx.MilliSleep(1...
[ "0.6712135", "0.65582323", "0.63700897", "0.6065584", "0.6010138", "0.59761536", "0.58341897", "0.5811401", "0.5772434", "0.56834716", "0.56687903", "0.5653866", "0.5646091", "0.5616334", "0.5612764", "0.5586602", "0.55856335", "0.553369", "0.55176526", "0.55113614", "0.54788...
0.5253901
25
Fadeout opacity of the dialog.
def __alpha_cycle_out(self, *args): self.opacity_out += self.deltaN logging.debug('opacity = {:d}'.format(self.opacity_out)) if self.opacity_out >= 255: self.deltaN = -self.deltaN self.opacity_out = 255 self.timer2.Stop() if self.opacity_out <= 0: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def FadeOut(self):\r\n\r\n while 1:\r\n self._alpha_amount -= 10\r\n if self._alpha_amount <= 0:\r\n self._alpha_amount = 255\r\n return\r\n\r\n self.SetTransparent(self._alpha_amount)\r\n wx.SafeYield()\r\n wx.MilliSleep(1...
[ "0.68651307", "0.6513315", "0.629913", "0.62010366", "0.61249274", "0.59980416", "0.59793377", "0.58805496", "0.5848932", "0.57893014", "0.5753309", "0.57012916", "0.5612499", "0.56114745", "0.5591843", "0.55330086", "0.5530878", "0.54946196", "0.5455164", "0.5442472", "0.543...
0.555935
15
Return a proportional size value.
def fix_size(value): try: obj_size = int(float(value) * wx.GetApp().settings.size_coeff) except AttributeError: obj_size = int(value) return obj_size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetProportion(self):\r\n\r\n return self.proportion", "def get_proportion(w, h, base_size=256):\n large_side = base_size\n k = float(w) / float(h)\n\n if w > h:\n w_prop = large_side\n h_prop = int(w_prop / k)\n elif w < h:\n h_prop = large_side\n w_prop = int(h...
[ "0.7298712", "0.68818516", "0.6734537", "0.6581888", "0.6459702", "0.6437677", "0.6403491", "0.6367083", "0.63393307", "0.62594587", "0.625514", "0.6233785", "0.6216065", "0.6205839", "0.62009037", "0.61976385", "0.61776483", "0.6173507", "0.617318", "0.6172196", "0.61262584"...
0.63491035
8
Convert a snake case to camel case
def snake_to_camel(string): return "".join(word.title() for word in string.split("_"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def snake_to_camel_case(snake_str: str) -> str:\n\n words = snake_str.strip(\"_\").split(\"_\")\n return words[0] + \"\".join(word[:1].upper() + word[1:] for word in words[1:])", "def snake_to_camel(snake_str):\n title_str = snake_str.split('_')\n return ' '.join(title_str).title()", "def snake_to_...
[ "0.85531586", "0.8521463", "0.8440934", "0.8360003", "0.82450986", "0.82365894", "0.82344395", "0.817078", "0.8089525", "0.808807", "0.808807", "0.80655485", "0.8030042", "0.8013399", "0.7962193", "0.7946988", "0.79186666", "0.7893642", "0.78589356", "0.7820551", "0.78112876"...
0.7907187
17
changes Rubylike YAML file to a list of dictionaries of dictionaries etc.
def parse_ruby_yaml_to_python_dict(file='plewic.01.0001.yaml'): python_yaml_name = "plewic_python." + ".".join(file.split(".")[1:]) # expressions in a line that makes the function ignore it # I assume that the lines containing the following strings are short enough # so that they don't break to another...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conversion_yaml():\r\n data ={\r\n 'name': 'george',\r\n 'age': 16,\r\n 'friends':\r\n [{'name': 'marry', 'age': 16}, {'name': 'jack', 'age': 17}]\r\n }\r\n yaml_data = yaml.dump(data)\r\n dirname = os.path.dirname(os.path.dirname(__file__))\r\n # data_dir = os.path.j...
[ "0.6709343", "0.6476866", "0.6414832", "0.6353843", "0.6236895", "0.61842465", "0.6149002", "0.6097069", "0.6077178", "0.60674024", "0.602638", "0.5962776", "0.59446704", "0.59408236", "0.5877493", "0.5871509", "0.5836809", "0.58286023", "0.5824188", "0.5817663", "0.5810871",...
0.6207877
5
Returns the duration dict
def get_duration(self): return self.duration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duration(timedelta):\r\n duration = {}\r\n duration['day'] = timedelta.days\r\n minutes_temp, duration['second'] = divmod(timedelta.seconds, 60)\r\n duration['hour'], duration['minute'] = divmod(minutes_temp, 60)\r\n\r\n return duration", "def duration(self):\n return self._get(\"durati...
[ "0.7514982", "0.7157288", "0.71035075", "0.704194", "0.704194", "0.69898725", "0.69510144", "0.68659633", "0.6798888", "0.67785954", "0.6721468", "0.6705861", "0.67018634", "0.6690495", "0.668531", "0.668531", "0.668531", "0.668531", "0.668531", "0.668531", "0.668531", "0.6...
0.6945955
7
Returns the duration dict
def get_between_commands(self): return self.between_commands
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duration(timedelta):\r\n duration = {}\r\n duration['day'] = timedelta.days\r\n minutes_temp, duration['second'] = divmod(timedelta.seconds, 60)\r\n duration['hour'], duration['minute'] = divmod(minutes_temp, 60)\r\n\r\n return duration", "def duration(self):\n return self._get(\"durati...
[ "0.7514982", "0.7157288", "0.71035075", "0.704194", "0.704194", "0.69898725", "0.69510144", "0.6945955", "0.68659633", "0.6798888", "0.67785954", "0.6721468", "0.6705861", "0.67018634", "0.6690495", "0.668531", "0.668531", "0.668531", "0.668531", "0.668531", "0.668531", "0....
0.0
-1
Calculate the duration for a transmission between the first and the `node_num`s node as a datetime.timedelta. This method needs to be implemented.
def duration(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duration(self):\r\n return self.t2 - self.t1", "def nodes_time(self):\n return self._nodes_time", "def get_duration(self, current_time):\n return current_time - self.slam.get_data(node_name=self.last_point_name)['time']", "def get_duration(self):\n return float(self.time.iloc[-1] ...
[ "0.57289964", "0.56476265", "0.56071085", "0.5585202", "0.5563804", "0.5550958", "0.554723", "0.55195343", "0.55195343", "0.551362", "0.5490098", "0.547661", "0.5453543", "0.53933656", "0.5373028", "0.53669167", "0.536428", "0.5336475", "0.5327848", "0.53093374", "0.5260612",...
0.48692286
70
Creates a symmetry operation from a rotation matrix and a translation vector.
def from_rotation_and_translation(cls,rotation_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), translation_vec=(0, 0, 0), rot_f=((1, 0, 0), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def symmetry(m, reflect, rotate):\n\n def LR_reflect(m):\n return tuple(reversed(m))\n\n def UD_reflect(m):\n return tuple(tuple(reversed(m[x][:])) for x in range(len(m)))\n\n operand = {m}\n if reflect:\n operand = operand | {LR_reflect(m), UD_reflect(m...
[ "0.6287702", "0.60923773", "0.6083054", "0.608204", "0.60634536", "0.6053644", "0.5985068", "0.59602416", "0.5882171", "0.5882171", "0.5877154", "0.5874965", "0.5804815", "0.5720199", "0.5666781", "0.56627554", "0.565641", "0.5631901", "0.5569029", "0.55678266", "0.5562333", ...
0.0
-1
Applies rotation portion to a tensor. Note that tensor has to be in full form, not the Voigt form.
def transform_tensor(self, tensor): dim = tensor.shape rank = len(dim) assert all([i == 3 for i in dim]) # Build einstein sum string lc = string.ascii_lowercase indices = lc[:rank], lc[rank:2 * rank] einsum_string = ','.join([a + i for a, i in zip(*indices)]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotate(self,\n rotation: Union[Tensor, np.ndarray, float],\n axis: Optional[int] = None) -> Tensor:\n if not isinstance(rotation, Tensor):\n rotation = self.tensor.new_tensor(rotation)\n assert rotation.shape == torch.Size([3, 3]) or rotation.numel() == 1, \...
[ "0.6283869", "0.62538576", "0.6072927", "0.60491985", "0.5795175", "0.57842904", "0.5770796", "0.57429916", "0.5725348", "0.57105094", "0.56834596", "0.5657569", "0.5650958", "0.5645559", "0.56025314", "0.5592231", "0.5574966", "0.5568153", "0.55587983", "0.5537416", "0.55275...
0.6079811
2
A 3x3 numpy.array representing the rotation matrix.
def rotation_matrix(self): return self.affine_matrix[0:3][:, 0:3]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotation_mat(self) -> np.ndarray:\n rot = np.zeros((3, 3))\n\n txx = 2 * self.x * self.x\n tyy = 2 * self.y * self.y\n tzz = 2 * self.z * self.z\n twx = 2 * self.w * self.x\n twy = 2 * self.w * self.y\n twz = 2 * self.w * self.z\n txy = 2 * self.x * self....
[ "0.8225689", "0.7458449", "0.74491125", "0.74262255", "0.7270437", "0.72640806", "0.7225547", "0.719604", "0.7179377", "0.7155655", "0.71342736", "0.7130868", "0.7110312", "0.7080335", "0.7061877", "0.7014485", "0.69881886", "0.698092", "0.69518113", "0.69000506", "0.68524456...
0.7820476
1
Changes RGB [0,1] valued image to BGR [0,255] with mean subtracted.
def caffe_preprocess(img): out = numpy.copy(img) out -= IMAGE_256_MEAN[None, None, :] out = out[:, :, [2, 1, 0]] # swap channel from RGB to BGR return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _normalize_image(self, img: np.ndarray) -> np.ndarray:\n i2 = img.astype(float) - self.bg\n i2 /= i2.max()\n return i2", "def _preprocess(self, image):\n\n # Scale from [0, 255] to [0, 1] and BGR to RGB \n return (image / 255.0)[:, :, ::-1]", "def reverse_black_and_white(...
[ "0.6844709", "0.6844558", "0.6683562", "0.66460234", "0.6582157", "0.6481389", "0.64260936", "0.64152306", "0.63956726", "0.63849556", "0.63461757", "0.6338296", "0.63148713", "0.63080424", "0.6254225", "0.625152", "0.62453556", "0.623202", "0.6223897", "0.62127256", "0.62056...
0.63327444
12
Dot product for two lists.
def _listdot(d1, d2): return [np.dot(x[0].T, x[1]) for x in zip(d1, d2)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dotproduct(v1, v2):\n\treturn sum(imap(operator.mul, v1, v2))", "def dotproduct(x, y):\n return sum(imap(operator.mul, x, y))", "def dot_product(v1, v2):\n return v1[0] * v2[0] + v1[1] * v2[1]", "def dotproduct(vec1, vec2):\n import operator\n return sum(map(operator.mul, vec1, vec2))", "de...
[ "0.8290546", "0.8147137", "0.79608387", "0.7949161", "0.7902275", "0.78892195", "0.7853784", "0.783287", "0.7825258", "0.7789848", "0.77896935", "0.77891684", "0.7753578", "0.77484345", "0.7699132", "0.7694744", "0.7678852", "0.76744646", "0.7649855", "0.7636648", "0.7613619"...
0.80125606
2
returns if the coordinate is valid
def is_valid(x, y): return (x >= 0) & (x < BOARD_SIZE) & (y >= 0) & (y < BOARD_SIZE)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_coordinates(self, x, y):\n return ((x >= 0) and (x < self.width) and\n (y >= 0) and (y < self.height))", "def is_valid(self) -> ir.BooleanValue:\n return ops.GeoIsValid(self).to_expr()", "def is_valid(self):\n if len(self.exterior) < 3:\n return False\n ...
[ "0.7635393", "0.7472494", "0.74480176", "0.74360436", "0.74203867", "0.7327456", "0.7303246", "0.72949624", "0.726949", "0.7233637", "0.7144868", "0.71197385", "0.70538825", "0.7045558", "0.7041876", "0.7004137", "0.6978121", "0.6902285", "0.6894375", "0.68855935", "0.6874322...
0.6209266
88
Create a minesweeper game.
def __init__(self, board_size=BOARD_SIZE, num_mines=NUM_MINES): self.board_size = board_size self.num_mines = num_mines self.board = place_mines(board_size, num_mines) self.my_board = np.ones((board_size, board_size), dtype=int) * CLOSED self.valid_actions = np.ones((self.board_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def minesweeper(self, ctx, width: int = 5, height: int = 5, mines: int = 5, debug=None):\n # Check for invalid input\n if width <= 0 or height <= 0 or mines <= 0:\n await ctx.send('Please enter width, height, and number of mines greater than zero.', delete_after=10)\n retu...
[ "0.71119905", "0.7079213", "0.7059485", "0.7055157", "0.7003343", "0.6783584", "0.67306495", "0.65587604", "0.6529097", "0.6506076", "0.6492845", "0.64354086", "0.64216906", "0.6366257", "0.6360492", "0.6312773", "0.63115317", "0.62686133", "0.6266905", "0.62617075", "0.62253...
0.0
-1
Create a minesweeper game.
def __init__(self, board_size=BOARD_SIZE, num_mines=NUM_MINES): self.board_size = board_size self.num_mines = num_mines self.board = place_mines(board_size, num_mines) self.my_board = np.ones((board_size, board_size), dtype=int) * CLOSED self.num_actions = 0 self.observ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def minesweeper(self, ctx, width: int = 5, height: int = 5, mines: int = 5, debug=None):\n # Check for invalid input\n if width <= 0 or height <= 0 or mines <= 0:\n await ctx.send('Please enter width, height, and number of mines greater than zero.', delete_after=10)\n retu...
[ "0.71119905", "0.7079213", "0.7059485", "0.7055157", "0.7003343", "0.6783584", "0.67306495", "0.65587604", "0.6529097", "0.6506076", "0.6492845", "0.64354086", "0.64216906", "0.6366257", "0.6360492", "0.6312773", "0.63115317", "0.62686133", "0.6266905", "0.62617075", "0.62253...
0.0
-1
Return True iff two lines are perpendicular
def _l_(L1, L2): if not all(isinstance(L, Line) for L in (L1, L2)): raise TypeError('_l_() expects two lines') return L1.normal_vec() * L2.normal_vec() == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coplanar_points_are_on_same_side_of_line(a, b, p1, p2):\n check_shape_any(a, (3,), (-1, 3), name=\"a\")\n vg.shape.check(locals(), \"b\", a.shape)\n vg.shape.check(locals(), \"p1\", a.shape)\n vg.shape.check(locals(), \"p2\", a.shape)\n\n # Uses \"same-side technique\" from http://blackpawn.com/...
[ "0.75375444", "0.7429906", "0.71164393", "0.6961527", "0.6945664", "0.69406855", "0.689354", "0.68928206", "0.683313", "0.6813058", "0.6732602", "0.66901326", "0.66415787", "0.66334033", "0.66201824", "0.6606393", "0.6578443", "0.6523774", "0.6521847", "0.6519163", "0.6519163...
0.68369126
8
Return the last error string.
def strerror(pnd): return _nfc.strerror(pnd)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error_string(self):\n return self._error_string", "def GetLastExceptionString():\n (exc, error) = sys.exc_info()[0:2]\n exc_msg = str(exc)\n if '<class' in exc_msg:\n exc_msg = exc_msg.split(\"'\")[1]\n\n exc_msg = exc_msg.replace('dns.exception.', '')\n error = '%s %s' % (exc_msg, error)\n #...
[ "0.7801384", "0.77900064", "0.76998794", "0.7655489", "0.74398726", "0.73745316", "0.7249249", "0.71920145", "0.7148343", "0.71236336", "0.70572394", "0.6967696", "0.69484645", "0.6870067", "0.6870067", "0.6870067", "0.6862114", "0.68450445", "0.6833759", "0.6831707", "0.6817...
0.0
-1
Return the device name.
def device_get_name(pnd): return _nfc.device_get_name(pnd)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_device_name(self):\n name = self._device[\"name\"]\n if not name or name == \"--\":\n name = self._mac\n\n return name", "def device_name(self) -> Optional[str]:\n return pulumi.get(self, \"device_name\")", "def device_name(self) -> Optional[str]:\n return ...
[ "0.8788066", "0.87851596", "0.87851596", "0.86620736", "0.86620736", "0.86360085", "0.86360085", "0.86360085", "0.86346877", "0.8572782", "0.8427779", "0.8426968", "0.8376641", "0.830186", "0.82401216", "0.8203853", "0.81880784", "0.81346387", "0.8027384", "0.79859686", "0.79...
0.7623448
28
Return the device connection string.
def device_get_connstring(pnd): return _nfc.device_get_connstring(pnd)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_device(self) -> str:\n pass", "def connection_string(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"connection_string\")", "def connection_string(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"connection_string\")", "def device(self) -> str:\n return se...
[ "0.7637919", "0.7562592", "0.7562592", "0.7217359", "0.7163468", "0.6940765", "0.68373865", "0.68175423", "0.67627054", "0.67294014", "0.6644681", "0.6644681", "0.66303134", "0.659762", "0.65929246", "0.6565107", "0.65532345", "0.65360665", "0.6520301", "0.6508784", "0.648017...
0.70888174
5
Get supported baud rates.
def device_get_supported_baud_rate(pnd, nmt, supported_br): return _nfc.device_get_supported_baud_rate(pnd, nmt, supported_br)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def baud_rate(self):\n return self._read(MX_BAUD_RATE)", "def baudrate(self):\n return self._baudrate", "def get_baudrate(self):\n # Get default baudrate for this target\n if self.yotta_config and 'mbed-os' in self.yotta_config:\n if 'stdio' in self.yotta_config['mbed-os'...
[ "0.6981226", "0.6858425", "0.6422032", "0.6315792", "0.6092807", "0.59904325", "0.56992114", "0.56688", "0.56106347", "0.5532839", "0.5402132", "0.54003185", "0.53817034", "0.53686213", "0.5355297", "0.53449285", "0.53266823", "0.5315218", "0.53134626", "0.5277024", "0.527702...
0.7153391
0
Computes the intersection over union (IoU) between two boxes.
def intersection_over_union(self, other_box): offset_x = (min(self.x_max, other_box.x_max) - max(self.x_min, other_box.x_min)) offset_y = (min(self.y_max, other_box.y_max) - max(self.y_min, other_box.y_min)) intersection_width = max(0, offset_x)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iou(boxes1, boxes2):\n intersections = intersection(boxes1, boxes2)\n area1 = area(boxes1)\n area2 = area(boxes2)\n unions = np.expand_dims(area1, axis=1) + np.expand_dims(\n area2, axis=0) - intersections\n# return intersect / union\n return np.where(intersections == 0.0, np.zeros_like(intersection...
[ "0.83120286", "0.82837814", "0.8182385", "0.81605506", "0.8152651", "0.8098413", "0.80617714", "0.7957169", "0.78419256", "0.7835584", "0.78270584", "0.77953416", "0.7757001", "0.7747402", "0.7746809", "0.7743636", "0.7743636", "0.7736999", "0.7686187", "0.76321757", "0.76017...
0.7200999
42
Applies the given deviations (returned by a call to `deviation_relative_to`) to this box.
def apply_deviations(self, dev_x, dev_y, dev_w, dev_h): return BoundingBox.from_cx_cy_w_h( (dev_x * self.width) + self.center_x, (dev_y * self.height) + self.center_y, math.exp(dev_w) * self.width, math.exp(dev_h) * self.height )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deviation_relative_to(self, other_box): \n\n return (\n (self.center_x - other_box.center_x) / other_box.width, \n (self.center_y - other_box.center_y) / other_box.height, \n math.log(self.width / other_box.width), \n math.log(self.height / other_box.he...
[ "0.5544952", "0.5416158", "0.5407359", "0.5097041", "0.5015258", "0.48771197", "0.47183898", "0.46998692", "0.4615728", "0.4595063", "0.45161223", "0.45132944", "0.4506885", "0.44606826", "0.44532582", "0.44488737", "0.4444152", "0.44321185", "0.4405695", "0.43806678", "0.434...
0.66072077
0
Create a JSON representation of this message.
def json(self): message_value = deepcopy(self.value) return json.dumps(encode_bin_as_b64(message_value))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def construct_json(self):\n\n if 'message' not in self.data:\n self.data['message'] = self.message\n\n if self.status == 200:\n self.data['status'] = 'OK'\n else:\n self.data['status'] = 'Not OK'\n\n return json.dumps(self.data)", "def to_json(self):\n...
[ "0.80458975", "0.7907605", "0.76169115", "0.7143488", "0.7143488", "0.7143488", "0.7143488", "0.7143488", "0.7143488", "0.7143488", "0.7143488", "0.7143488", "0.7120693", "0.7086734", "0.70779884", "0.70779186", "0.70579106", "0.70224833", "0.6990568", "0.6985272", "0.6981935...
0.72216976
3
Decode text to JSON and return a Message object accordingly.
def from_text(cls, text): raw = decode_b64(json.loads(text)) raw[0] = Code(raw[0]) # make it an object of type Code return cls(*raw)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def json_decode(text):\n return _json_decode(text)", "def decode_message(json_data):\n\t# Remove the quotations at the start and end of the string\n\tjson_data = re.sub(r'\"(.*)\"', r'\\1', json_data)\n\t# Unescape all other quotation marks\n\tjson_data = re.sub(r'\\\\(.)', r'\\1', json_data)\n\tclean_data = ...
[ "0.74639183", "0.7189891", "0.70539623", "0.6721933", "0.6656054", "0.65904564", "0.6526649", "0.6493381", "0.6480489", "0.6411858", "0.6410093", "0.6305638", "0.62740964", "0.62445563", "0.622486", "0.61896896", "0.6150542", "0.6138943", "0.61382806", "0.6062557", "0.6049653...
0.56004024
59
Call this method instead of AddressForm.save() when appropriate to avoid duplicating an address in the database.
def get_or_create(self): if self.is_valid(): address, created = Address.objects.get_or_create( street=self.cleaned_data['street'], city=self.cleaned_data['city'], state=self.cleaned_data['state'], country=self.cleaned_data['country'], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, *args, **kwargs):\n # Save a hash of the address fields so we can check whether two\n # addresses are the same to avoid saving duplicates\n # self.hash = self.generate_hash()\n\n # Ensure that each user only has one default shipping address\n # and billing address\...
[ "0.7182839", "0.69642663", "0.66004765", "0.6497977", "0.6245208", "0.62204474", "0.5971764", "0.5785383", "0.5782658", "0.5718224", "0.56303114", "0.56266123", "0.56049377", "0.5599606", "0.5554738", "0.5554738", "0.5526102", "0.5508125", "0.5460157", "0.5458225", "0.5448546...
0.6076036
6
Initialization of LyricsNN class describing an RNN for lines prediction.
def __init__(self, depth, identifier): self.model = Sequential() self.identifier = identifier self.model_filename = f'models/{self.identifier}.model' self.model.add(LSTM(4, input_shape=(2, 2), return_sequences=True)) for i in range(depth): self.model.add(LSTM(8, retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, vocab_size, output_size, embedding_dim, hidden_dim, n_layers, seq_len, drop_prob=0.5):\n super(SentimentRNN, self).__init__()\n\n self.output_size = output_size\n self.n_layers = n_layers\n self.hidden_dim = hidden_dim\n self.seq_len = seq_len\n \n ...
[ "0.6579965", "0.6544176", "0.6441179", "0.6438505", "0.6383005", "0.6339359", "0.63345486", "0.61825365", "0.61330235", "0.61164886", "0.6097343", "0.6083694", "0.60652137", "0.6063856", "0.60518354", "0.6039933", "0.60377985", "0.60356927", "0.60174865", "0.60089666", "0.595...
0.0
-1
create a fakeCSV.csv file and later rename it to the data.csv which can be used in the textToCsv function call
def createFakeCsv(): df = pd.DataFrame(["a","b","c"]) df.to_csv(path+'/fakeCSV.csv') os.rename('fakeCSV.csv','data.csv')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_csv_file(csv_path):\n with open(csv_path, 'w', newline='') as csv_file:\n writer = csv.writer(csv_file)\n header = ['file_name', 'chart_in_file',\n 'year', 'month', 'row_no', 'bird_species']\n header += list(range(1, 32))\n writer.writerow(header)", "def s...
[ "0.7040914", "0.6868081", "0.6826778", "0.6786819", "0.67643785", "0.6664379", "0.664735", "0.66265637", "0.66244644", "0.6601803", "0.65988266", "0.65708536", "0.65648025", "0.6558951", "0.64657164", "0.6400722", "0.6392307", "0.63626724", "0.635851", "0.6356147", "0.6347168...
0.8577033
0
Converts a rotation matrix to a quaternion Matlab port to python for evaluation purposes
def rotmat2quat(R): rotdiff = R - R.T r = np.zeros(3) r[0] = -rotdiff[1, 2] r[1] = rotdiff[0, 2] r[2] = -rotdiff[0, 1] sintheta = np.linalg.norm(r) / 2 r0 = np.divide(r, np.linalg.norm(r) + np.finfo(np.float32).eps) costheta = (np.trace(R) - 1) / 2 theta = np.arctan2(sintheta, cos...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Rot_to_quaternion(r: array):\n\n # Compute the trace of the rotation matrix\n tr = r[0, 0] + r[1, 1] + r[2, 2]\n\n if tr > 0:\n S = sqrt(tr + 1.0) * 2\n qw = 0.25 * S\n qx = (r[2, 1] - r[1, 2]) / S\n qy = (r[0, 2] - r[2, 0]) / S\n qz = (r[1, 0] - r[0, 1]) / S\n el...
[ "0.8075256", "0.79984576", "0.7916058", "0.78263533", "0.77953583", "0.7602561", "0.7555989", "0.7463216", "0.7459454", "0.74492604", "0.7407526", "0.7295868", "0.72948986", "0.7284594", "0.72581196", "0.7230329", "0.71801275", "0.71128905", "0.71101606", "0.71029717", "0.709...
0.76489675
5
Get input, initial state, final state, and probabilities tensor from
def get_tensors(loaded_graph): with loaded_graph.as_default(): input_tensor = loaded_graph.get_tensor_by_name("input:0") initial_state_tensor = loaded_graph.get_tensor_by_name("initial_state:0") final_state_tensor = loaded_graph.get_tensor_by_name("final_state:0") probs_tensor = load...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_input(self):\n n_input = tf.placeholder(tf.int32, [None, None], name='n_input')\n t_input = tf.placeholder(tf.int32, [None, None], name='t_input')\n n_target = tf.placeholder(tf.int32, [None, None], name='n_target')\n t_target = tf.placeholder(tf.int32, [None, None], name='t_t...
[ "0.69206744", "0.6620964", "0.6510186", "0.6486847", "0.6457684", "0.6426807", "0.64235395", "0.6331466", "0.62967086", "0.6261943", "0.62432843", "0.622595", "0.6225692", "0.62057304", "0.6134078", "0.61149305", "0.6085871", "0.6084642", "0.6063506", "0.6058988", "0.6034808"...
0.6288018
9
Initialize the LIF model by specifying RC params.
def __init__(self, r=None, c=None, v=None): if r is None and c is None and v is None: self.r = RESISTANCE_LIF self.c = CAPACITANCE_LIF self.v = VOLTAGE_THRESHOLD_LIF else: self.r, self.c, self.v = r, c, v
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _initialize_model(rngs):\n init_model_state, init_params = model_def.init(\n rngs, *dummy_input, train=False, debug=False).pop('params')\n # Set bias in the head to low value, such that loss is small initially.\n if config.get('init_head_bias', None) is not None:\n init_params = flax.core....
[ "0.68981415", "0.6778512", "0.6304026", "0.62496275", "0.6207386", "0.61951435", "0.5942858", "0.59382224", "0.59166574", "0.5913951", "0.589226", "0.58801925", "0.58637875", "0.58492166", "0.58403957", "0.5823923", "0.58199495", "0.580222", "0.5745649", "0.5742168", "0.57246...
0.5520111
73
Interpret the next 4 bytes in the stream as the chunk's CRC32 checksum, check if it matches the calculated checksum, and wipe the state.
def _get_chunk_end(self) -> models.ChunkEndToken: if self._chunk_state is None or self._chunk_state.next_read != 0: raise exceptions.StreamStateError( "Incorrect chunk state for ending data" ) [declared_crc32] = struct.unpack('>I', self._read(4)) crc32oka...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _checksum(cls, buff):\n checksum = 0\n\n while True:\n data = buff.read(cls.checksum_struct.size)\n\n if len(data) == 0:\n break\n if len(data) < 4:\n pad_count = len(data) % 4\n data = data + \"\\x00\" * pad_count\n ...
[ "0.6474902", "0.63290596", "0.6217175", "0.614795", "0.5855832", "0.57860446", "0.56504697", "0.56408715", "0.55898196", "0.5546535", "0.55336976", "0.5492091", "0.54762423", "0.54647064", "0.54517967", "0.54467636", "0.5416865", "0.5415279", "0.53935397", "0.5366285", "0.533...
0.46889907
95
Check is a string matches any of the ignorable string constants in the list.
def ignorable(descriptor): found = False for name in _IGNORE_DESCRIPTORS: if name in descriptor: found = True return found
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_string(s, strings):\n for string in strings:\n if string not in s:\n return False\n return True", "def test_str_not_in_str_list(self):\n # compact ver sion (env variables)\n assert_that(Condition.is_valid(\n '\"{{ env.BRANCH_NAME }}\" not in [\"dev\", \"...
[ "0.67769057", "0.6723068", "0.67195636", "0.6685276", "0.64831877", "0.6440842", "0.62976426", "0.62976426", "0.608894", "0.6061952", "0.6055659", "0.6016699", "0.5992257", "0.5951146", "0.5944341", "0.5908234", "0.5908234", "0.5908234", "0.584692", "0.5838412", "0.58344626",...
0.0
-1
Check validation for username
def username_validation(username): errors = [] #Check if Username exists if(username_present(username)): errors.append("Användarnamnet finns redan.") #Username needs to be longer then 3 chars if(len(username) <= 3): errors.append("Användarnamnet mäste vara 3 tecken eller längre.") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_username(self, username):\n if self.username_regex.search(username) is not None:\n print(\"Correct username\")\n return True\n else: \n print(\"Wrong username\")\n return False", "def validate_name(self, username: str) -> bool:\n\t\treturn not ...
[ "0.8605321", "0.8363683", "0.8359597", "0.83194035", "0.82597756", "0.82597756", "0.8215134", "0.8189023", "0.81853515", "0.8174883", "0.81574917", "0.81487864", "0.81487864", "0.8146904", "0.81339544", "0.81268877", "0.81085265", "0.81054664", "0.80960983", "0.80745924", "0....
0.79777014
26
Check validation for password
def password_validation(pass1,pass2): errors = [] if(pass1 != pass2): errors.append("Lösenorden matchade inte.") if(len(pass1) < 3): errors.append("Lösenordet måste vara längre än 3 bokstöver.") return errors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_valid_password(self):\n pass_field = Field(\"\".join(['x' * (int(self.app.config['MAX_PWD_LEN']))]))\n\n valid_password(None, pass_field)", "def is_password_valid(password):\n #TODO : This should also be handled by the front_end\n pass", "def _check_password(self, password)...
[ "0.84507257", "0.8402689", "0.8400819", "0.8337054", "0.8277088", "0.81550276", "0.8100132", "0.8067589", "0.806264", "0.8041702", "0.80319214", "0.8028712", "0.80205053", "0.7986465", "0.7978783", "0.7977855", "0.795277", "0.79506594", "0.79307485", "0.79305184", "0.79275686...
0.0
-1
Show image with landmarks
def show_landmarks(image, landmarks): plt.imshow(image) plt.scatter(landmarks[:, 0], landmarks[:, 1], s=10, marker='.', c='r') plt.pause(0.001) # pause a bit so that plots are updated
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_landmarks(image, landmarks):\n\n if isinstance(image, str):\n # image = io.imread(image)\n image = cv2.cvtColor(cv2.imread(image), cv2.COLOR_BGR2RGB)\n\n plt.imshow(image)\n\n plt.scatter(landmarks[:, 0], landmarks[:, 1], s=10, marker='.', c='r')\n plt.pause(0.001) # pause a bit...
[ "0.808608", "0.78171635", "0.778297", "0.7465765", "0.7464966", "0.6598388", "0.65567565", "0.65280706", "0.6492143", "0.6483718", "0.6477732", "0.644593", "0.64328134", "0.63780797", "0.6371934", "0.6371934", "0.6371934", "0.636128", "0.6348264", "0.6341621", "0.6301995", ...
0.7926357
3
Assert slugs for selected search
def assertSlugs(self, field, value, slugs): search_request = [{ "object_name": "Assessment", "filters": { "expression": { "left": field, "op": {"name": "="}, "right": value, }, }, "fields": ["slug"], }] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_search_tags(self):\n page = self.page1\n page.search_tags = \"Chutes, Ladders\"\n page.save_revision().publish()\n taglist = page.clean_search_tags\n for name in [\"Chutes\", \"Ladders\"]:\n self.assertIn(name, taglist)", "def test_product_slug(self):\n\n ...
[ "0.6848772", "0.65132594", "0.64170605", "0.63745207", "0.62808585", "0.62615275", "0.6238778", "0.62327796", "0.62017906", "0.6165098", "0.6152465", "0.6140121", "0.6139936", "0.6139936", "0.6139936", "0.6136641", "0.61336833", "0.6069835", "0.60680634", "0.6020204", "0.6006...
0.6953346
0
Filter by added new comment and old comment exists
def test_search_by_new_comment(self): slugs = [self.assessment.slug] desc = "321" new_comment = factories.CommentFactory(description=desc) factories.RelationshipFactory(source=new_comment, destination=self.assessment) self.assertSlugs("comment", self.comment.descrip...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_for_duplicate_comment(self, new):\n possible_duplicates = self.get_comment_model()._default_manager.using(\n self.target_object._state.db\n ).filter(\n content_type=new.content_type,\n object_pk=new.object_pk,\n user_name=new.user_name,\n ...
[ "0.6316749", "0.5532967", "0.5489668", "0.5443753", "0.5391214", "0.5388516", "0.5315777", "0.52756", "0.5259229", "0.5197859", "0.51538825", "0.5149346", "0.51384956", "0.5113432", "0.50835305", "0.50456214", "0.5030016", "0.5017003", "0.4995472", "0.4978139", "0.497021", ...
0.4968502
22
Strips leading zeros from version number. This converts 1974.04.03 to 1974.4.3 as the format with leading month and day zeros is not accepted by PIP versioning.
def strip_leading_zeros(version: str) -> str: return ".".join(str(int(i)) for i in version.split("."))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_closing_zero(model_version: str) -> str:\r\n if model_version[-2:] == \".0\":\r\n return model_version[:-2]\r\n return model_version", "def format_version(version):\n\n return \"v%03d\" % version", "def _norm_version(version, build=''):\n l = version.split('.')\n if build:\n ...
[ "0.6954924", "0.66494554", "0.6607103", "0.65504134", "0.6522276", "0.6475586", "0.64568365", "0.6435397", "0.63637435", "0.6274114", "0.6257918", "0.621994", "0.6191119", "0.61290926", "0.61062455", "0.6084795", "0.6005788", "0.59738547", "0.59320265", "0.5922085", "0.591614...
0.79807574
0
Return age of guitar.
def get_age(self): age = 2021 - self.year return age
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_age(self):\n return Guitar.CURRENT_YEAR - self.year", "def get_age(self):\n\t\treturn self.age", "def get_age(self) -> int:\n return self.age", "def get_age(self):\r\n return self.age", "def get_age(self):\n age = CURRENT_YEAR - self.year\n return age", "def get...
[ "0.84887856", "0.76437443", "0.7559086", "0.753404", "0.7532731", "0.7525913", "0.74784195", "0.74784195", "0.74746895", "0.74478936", "0.7411588", "0.7410562", "0.73717886", "0.7349488", "0.7336023", "0.7336023", "0.7336023", "0.7333213", "0.7325631", "0.72226375", "0.719377...
0.7427642
10
Return whether the device is HomeKitenabled.
def homekit_enabled(self) -> bool: return bool(self._device_info["HomeKit"])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_home(self):\n return bool([\n device for device in self.devices\n if device.is_home and device.is_phone\n ])", "def is_on(self):\n return self._program.get(\"enabled\") is True", "def ishome(self):\n return self._plrevgeoloc.isHome", "def is_on(self) -...
[ "0.74554527", "0.6414873", "0.63198864", "0.6271145", "0.62071985", "0.62071985", "0.62071985", "0.6205384", "0.6196341", "0.6162103", "0.6160482", "0.61003095", "0.6073807", "0.6043367", "0.60089767", "0.5991096", "0.5985485", "0.5967729", "0.5962597", "0.59498745", "0.59478...
0.9178715
0
Return the device type.
def type(self) -> str: return self._device_info["Type"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_type(self):\n # type: () -> string_types\n return self._device_type", "def device_type(self):\n return self._device_type", "def device_type(self):\n return self._meta['device_type']", "def device_type(self):\n return Context.devtype2str[self.device_typeid]", "d...
[ "0.9037524", "0.90288436", "0.9010983", "0.8995372", "0.8995372", "0.8832146", "0.8688302", "0.8621049", "0.85237527", "0.85237527", "0.85237527", "0.84477854", "0.834488", "0.8244467", "0.82170415", "0.81673187", "0.8035013", "0.8026461", "0.8024478", "0.79951596", "0.794047...
0.8421975
12
Clones the contents of this object into a new instance of the same class, and then modifies the cloned copy using the specified default_value and metadata. Returns the cloned object as the result. Note that subclasses can change the signature of this method if needed, but should always call the 'super' method if possib...
def clone(self, default_value=Missing, **metadata): if "parent" not in metadata: metadata["parent"] = self new = self.__class__.__new__(self.__class__) new_dict = new.__dict__ new_dict.update(self.__dict__) if "editor" in new_dict: del new_dict["editor"]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clone(self, default_value=NoDefaultSpecified, **metadata):\n if \"parent\" not in metadata:\n metadata[\"parent\"] = self\n\n new = self.__class__.__new__(self.__class__)\n new_dict = new.__dict__\n new_dict.update(self.__dict__)\n\n if \"editor\" in new_dict:\n ...
[ "0.7849692", "0.69377464", "0.62991315", "0.59456563", "0.57620776", "0.57402605", "0.56147456", "0.53697824", "0.5364406", "0.5359552", "0.5338624", "0.5318208", "0.5256096", "0.5254779", "0.52038485", "0.51854974", "0.5171551", "0.5153403", "0.5139882", "0.51387507", "0.509...
0.7796804
1
Tell ngrok to tear down the tunnel. Stop the background tunneling process.
def stop(self): self.ngrok.terminate() return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cancel_tunnel(cls, remote_host, remote_port):\r\n _, po = cls.TUNNELS.pop((remote_host, remote_port), (None, None))\r\n if po:\r\n safe_kill(po)", "def stop(self):\n self.running = False\n self.hop_channel(\"auto\")", "def shutDown(self):\n self.host = None\n self.por...
[ "0.6602548", "0.6544424", "0.64130837", "0.6344659", "0.63190275", "0.6306022", "0.63053703", "0.6264894", "0.62556607", "0.6208981", "0.61939526", "0.6133307", "0.6125131", "0.6118024", "0.61080134", "0.6104832", "0.609015", "0.60852677", "0.60842836", "0.60435945", "0.60255...
0.6804179
0
Marks the supplied object as untextured. The shader needs to know this for every untextured object, because otherwise the shader will make it all black.
def flagUntexturedObject(self, object): object.setShaderInput("texDisable", 1, 1, 1, 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flagTexturedObject(self, object):\n object.setShaderInput(\"texDisable\", 0, 0, 0, 0)", "def toggle_transparency(object_list=None):\n object_list = object_list or mc.ls(sl=True)\n if not object_list:\n return\n\n shader = TRANSPARENT_SHADER_NAME\n\n if not mc.objExists(shader):\n ...
[ "0.81474715", "0.5573028", "0.5372784", "0.5259314", "0.52575266", "0.52540916", "0.5238957", "0.5146414", "0.51319337", "0.5054174", "0.49876937", "0.49832848", "0.48839203", "0.48695555", "0.48635027", "0.4834769", "0.4823867", "0.48199543", "0.48047712", "0.48025328", "0.4...
0.84461397
0
Returns the hardness of the shadows. This is usually a value higher than 0. 64 is usually a good value for very hard shadows, while at a value of 0, the shadows are so soft they are unnoticable. Usually a value near 15 is recommended, but this may vary on the scene and you may need to experiment a bit with this value.
def getHardness(self, hardness): return self.__hardness
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_shadow(self):\n grad_H = torch.autograd.grad(self.hamiltonian_,self.parameters,create_graph = True)[0]\n grad_H_copy = grad_H.clone().detach()\n velocity = self.inverse_ @ self.momentum.t()\n velocity_copy = velocity.clone().detach()\n prehessian = velocity_copy @ grad_H....
[ "0.64606076", "0.61076593", "0.5659373", "0.56149584", "0.56116533", "0.54669493", "0.5422367", "0.54214424", "0.5365746", "0.5348207", "0.5333525", "0.5332085", "0.5331254", "0.5279425", "0.52777076", "0.5239923", "0.5236636", "0.523562", "0.52228415", "0.518874", "0.5155837...
0.59974337
2
Test case for get_device_group_by_id1
def test_get_device_group_by_id1(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_device_group_by_id(self):\n pass", "def test_get_device_groups1(self):\n pass", "def test_get_device_groups(self):\n pass", "def test_update_device_group_by_id1(self):\n pass", "def test_partially_update_device_group_by_id1(self):\n pass", "def test_update_...
[ "0.9312894", "0.86152446", "0.81099105", "0.8045822", "0.7804015", "0.7775619", "0.7702657", "0.76584816", "0.75396895", "0.7477459", "0.7459499", "0.73985004", "0.7221935", "0.71005195", "0.7078464", "0.7072636", "0.7063998", "0.70401704", "0.70146847", "0.69065005", "0.6845...
0.95787245
0
Test case for update_device_group_by_id
def test_update_device_group_by_id(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_partially_update_device_group_by_id(self):\n pass", "def test_update_device_group_by_id1(self):\n pass", "def test_partially_update_device_group_by_id1(self):\n pass", "def test_update_device_by_id(self):\n pass", "def test_partially_update_device_by_id(self):\n ...
[ "0.9418701", "0.93432456", "0.9144009", "0.78787094", "0.78768146", "0.78417784", "0.779405", "0.77800554", "0.77212477", "0.7663947", "0.7663696", "0.75038546", "0.7167483", "0.71426827", "0.7122559", "0.70687544", "0.70444477", "0.6940763", "0.6936375", "0.68457174", "0.673...
0.9582825
0
Test case for update_device_group_by_id1
def test_update_device_group_by_id1(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_partially_update_device_group_by_id1(self):\n pass", "def test_update_device_group_by_id(self):\n pass", "def test_partially_update_device_group_by_id(self):\n pass", "def test_update_device_by_id1(self):\n pass", "def test_partially_update_device_by_id1(self):\n ...
[ "0.93832743", "0.93671364", "0.9243686", "0.7982077", "0.79347783", "0.7787908", "0.7785914", "0.7717263", "0.7704478", "0.7656242", "0.76072687", "0.74940306", "0.71125656", "0.7084893", "0.7023078", "0.6988108", "0.68989885", "0.6894515", "0.6890141", "0.684053", "0.6828986...
0.9540272
0
Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages. There is an alias called 'just'. example res = rx.Observable.return(42) res = rx.Observable.return(42, rx.Scheduler.timeout)
def return_value(cls, value, scheduler=None): scheduler = scheduler or current_thread_scheduler def subscribe(observer): def action(scheduler, state=None): observer.on_next(value) observer.on_completed() return scheduler.schedule(action) return AnonymousObservable(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(func: Callable, scheduler: abc.Scheduler = None) -> ObservableBase:\n from ..operators.observable.start import start\n return start(func, scheduler)", "def defer(observable_factory: Callable[[Any], ObservableBase]) -> ObservableBase:\n from ..operators.observable.defer import defer...
[ "0.55531275", "0.5166064", "0.50442696", "0.49978098", "0.49963588", "0.49476802", "0.4912872", "0.48327878", "0.475615", "0.4729894", "0.45519", "0.45499033", "0.4524066", "0.45072457", "0.43996987", "0.43576333", "0.433959", "0.4313538", "0.4313538", "0.4313538", "0.4313538...
0.6745742
0
Return the path. Prepend with CWD and prefix
def get_path(path): if _prefix and not '/' in path: path = _prefix + path if not _cwd: return path return join(_cwd, path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path(self, prefix, args=()):\n dir_path = self.dir.path(prefix, args)\n return os.path.join(dir_path, self.name)", "def path(self, prefix, args=()):\n assert len(args) == self.nargs\n prefix = os.path.abspath(prefix)\n name = self.name_(args)\n assert os.path.relpath...
[ "0.73822325", "0.73651373", "0.7036756", "0.7012196", "0.6879618", "0.6833048", "0.6808527", "0.6491455", "0.632277", "0.6292265", "0.62735814", "0.62713635", "0.626437", "0.6261836", "0.61543214", "0.61540467", "0.6135026", "0.6132204", "0.6132049", "0.6129539", "0.61061597"...
0.7837085
0
Issue a GET request for the given URL.
async def _fetch(self, session, url, proxy=None, raw=False, which_site=False): print(url) result = None site = None if 'hare' in url: # {'Unknown': -1, 'Pixnet': 0, 'Hares': 1} site = self._websites['Hares'] elif 'pixnet' in url: site = self._websites['P...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, url):\n return self._request('GET', url)", "def _get(self, url):\n return self._request(url)", "def __get(self, url, headers=None):\n return self.__req(url, \"GET\", headers=headers)", "def get(url, to_error=_default_to_error, **kwargs):\n\n return request('get', url, to...
[ "0.7883896", "0.77640957", "0.7738244", "0.7612464", "0.75966185", "0.7526963", "0.75052214", "0.7481662", "0.74746346", "0.74106705", "0.73912764", "0.73087555", "0.7297788", "0.7264017", "0.7259342", "0.7254266", "0.7232382", "0.72316253", "0.72316253", "0.72316253", "0.723...
0.0
-1
To set up a boundary for the open files limitation at the same time.
async def _bound_fetch(self, semaphore, session, url, proxy=None, raw=False, which_site=False): async with semaphore: return await self._fetch(session, url, proxy, raw, which_site)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def limit():\n bwc = BandwidthConfigurator()\n bwc.limit()", "def _set_max_open_files(command, key):\n global _MAX_OPEN_FILES\n if _MAX_OPEN_FILES is None:\n _MAX_OPEN_FILES = (paleomix.common.system.get_max_open_files(),)\n\n (max_open_files,) = _MAX_OPEN_FILES\n if max_open_files:\n ...
[ "0.5811182", "0.56389654", "0.5497745", "0.54893994", "0.545382", "0.5448054", "0.53914845", "0.53693", "0.5349658", "0.5330323", "0.53131086", "0.53071016", "0.5305885", "0.52843595", "0.5270937", "0.5249806", "0.5229425", "0.5227775", "0.5211759", "0.52109766", "0.51792026"...
0.0
-1
Return allones tensor of given shape and type.
def ones(shape, dtype=K.floatx()): # As of Keras version 1.1.0, Keras ones() requires integer values # in shape (e.g. calling np.ones() with the Theano backend) and # thus can't be called with tensor values. This version avoids the # issue by using the backend ones() instead. if K.backend() == 'thea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ones(shape, dtype=None):\n\n return full(shape, 1, dtype)", "def empty(*shape, **kwargs):\n return Tensor(np.empty(shape), **kwargs)", "def ones(shape, **kwargs):\n return Tensor(np.ones(shape), **kwargs)", "def empty(shape, dtype=np.float32, constant=False):\n return Tensor(np.empty(...
[ "0.7239552", "0.7234052", "0.71911055", "0.70934355", "0.70898616", "0.70649135", "0.672523", "0.6585413", "0.6585413", "0.6522735", "0.6515479", "0.6483929", "0.6466721", "0.6429149", "0.6366113", "0.63100284", "0.630325", "0.6278902", "0.6230271", "0.6223832", "0.6215334", ...
0.6712473
7
Return allzeros tensor of given shape and type.
def zeros(shape, dtype=K.floatx()): # As of Keras version 1.1.0, Keras zeros() requires integer values # in shape (e.g. calling np.zeros() with the Theano backend) and # thus can't be called with tensor values. This version avoids the # issue by using the backend zeros() instead. if K.backend() == '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zeros(*shape, **kwargs):\n return Tensor(np.zeros(shape), **kwargs)", "def zeros(shape, dtype=None):\n\n return full(shape, 0, dtype)", "def zeros(shape, dtype=np.float32, constant=False):\n return Tensor(np.zeros(shape, dtype), constant=constant)", "def empty(*shape, **kwargs):\n ret...
[ "0.78290266", "0.77888846", "0.7677265", "0.75223565", "0.74518645", "0.73906773", "0.7364313", "0.72332895", "0.72332895", "0.7180945", "0.7104846", "0.69690907", "0.6929705", "0.6898232", "0.68935305", "0.68361795", "0.6807142", "0.68026096", "0.6801418", "0.6801418", "0.67...
0.73404515
7
Return tensor of given shape and type filled with given value.
def values(value, shape, dtype=K.floatx()): return value * ones(shape, dtype) # or zeros() + ?
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _build_tensor(self, ndarray):\n\n ndarray = np.asarray(ndarray).astype(self.dtype)\n return tf1.placeholder_with_default(\n ndarray, shape=ndarray.shape if self.use_static_shape else None)", "def tensor_constructor(value, name=None, strict=False, allow_downcast=None,\r\n bo...
[ "0.64718324", "0.6296214", "0.6233983", "0.61664563", "0.61466515", "0.6141009", "0.6141009", "0.60928553", "0.60563564", "0.60109097", "0.6010672", "0.6009017", "0.59948504", "0.58983475", "0.5895598", "0.58839995", "0.5870249", "0.5870249", "0.5847118", "0.5844058", "0.5834...
0.6670203
0
Return matrices broadcasting indices on a 2d grid. This is a partial backendindependent version of TensorFlow meshgrid()
def meshgrid(i, j, indexing='ij'): if K.ndim(i) != 1 or K.ndim(j) != 1: raise ValueError('need ndim() == 1') if K.backend() == 'tensorflow': import tensorflow as tf I, J = tf.meshgrid(i, j, indexing=indexing) else: assert K.backend() == 'theano' from theano import ten...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ndgrid(*args,**kwargs):\n kwargs['indexing'] = 'ij'\n return meshgrid(*args,**kwargs)", "def meshgrid(x, y, row_major=True):\n # type: (int, int, bool)->Tensor\n a = torch.arange(0, x)\n b = torch.arange(0, y)\n xx = a.repeat(y).view(-1, 1).float()\n yy = b.view(-1, 1).repeat(1, x).view(...
[ "0.66549087", "0.6448521", "0.6395647", "0.6385773", "0.62383676", "0.607281", "0.6054111", "0.6050764", "0.60465246", "0.6029575", "0.60188174", "0.5937803", "0.5893137", "0.5836443", "0.5809325", "0.58063555", "0.57907295", "0.5780437", "0.57102764", "0.56989294", "0.568289...
0.63798696
4
Return onehot representation of given tensor or numpy array.
def one_hot(a, size=None, dtype=np.int32): # http://stackoverflow.com/a/37323404 if isinstance(a, np.ndarray): if size is None: size = a.max() + 1 return np.eye(size, dtype=dtype)[a] else: if size is None: raise NotImplementedError() return K.eye(size,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot(x, num_classes, dtype=jnp.float32):\n return jax.nn.one_hot(x, num_classes).astype(dtype)", "def to_one_hot(arr, num_classes):\n arr = arr.data.astype(int)\n a = np.zeros((arr.shape[0], num_classes))\n a[np.arange(len(a)), arr] = 1\n return tensor.Tensor(a, requires_grad=True)", "def t...
[ "0.7859921", "0.7779984", "0.7779984", "0.776788", "0.76527566", "0.7610865", "0.75510514", "0.75354576", "0.75270677", "0.75139195", "0.74732864", "0.7455506", "0.74368954", "0.7429599", "0.7426404", "0.74015445", "0.739606", "0.7351203", "0.7293224", "0.72600925", "0.725696...
0.7242473
21
Return unique values from iterable.
def unique(iterable): seen = set() return [i for i in iterable if not (i in seen or seen.add(i))]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unique(iterable):\n seen = set()\n return [x for x in iterable if x not in seen and not seen.add(x)]", "def distinct(iterable):\n\n def distincting(iterable_):\n set_of_distinct_values = set()\n for i in iterable_:\n if i not in set_of_distinct_values:\n set_o...
[ "0.7999121", "0.78902364", "0.7870895", "0.77103716", "0.7579125", "0.7523557", "0.7280493", "0.71887684", "0.6989713", "0.6963051", "0.69561213", "0.6887821", "0.68650216", "0.6838632", "0.68206346", "0.6817162", "0.6778499", "0.6734577", "0.67336524", "0.67220056", "0.66545...
0.78983736
1
Return array of zeros with shape of given tensor or numpy array.
def zeros_like(a): if isinstance(a, np.ndarray): return np.zeros_like(a) else: return K.zeros_like(a)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zeros(*shape, **kwargs):\n return Tensor(np.zeros(shape), **kwargs)", "def zeros(shape, dtype=None):\r\n if not isinstance(shape, (list, tuple, TensorVariable)):\r\n shape = [shape]\r\n if dtype is None:\r\n dtype = config.floatX\r\n return alloc(numpy.array(0, dtype=dtype), *sh...
[ "0.79991907", "0.7783359", "0.77504045", "0.7721461", "0.7674716", "0.75811875", "0.74053454", "0.74053454", "0.7366194", "0.73502535", "0.7249148", "0.7201274", "0.7160762", "0.7130828", "0.7086376", "0.7073063", "0.70270133", "0.69933385", "0.69453585", "0.686986", "0.68680...
0.7504606
6
Outer product of two vectors. If batch is True, return batchwise outer product.
def outer_product(a, b, batch=False): if batch: return batch_outer_product(a, b) a, b = normalize_and_check_ndim([a, b], 1) # The outer product is equivalent to matrix multiplication a * b # where the vector a is interpreted as a column matrix and the # vector b as a row matrix. The followin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def batch_outer_product(a, b):\n a, b = normalize_and_check_ndim([a, b], 2)\n # This is a batchwise version of the matrix multiplication approach\n # used for outer_product(), see explanation there.\n return a[:, :, np.newaxis] * b[:, np.newaxis, :]", "def outer_product(x):\n return keras.backend....
[ "0.76808894", "0.72845256", "0.7163513", "0.69399536", "0.687263", "0.6790263", "0.6752418", "0.6522772", "0.6463579", "0.6463288", "0.6452809", "0.6356816", "0.6337843", "0.62326765", "0.6077236", "0.6058667", "0.60003865", "0.59570444", "0.5895751", "0.58939034", "0.5848351...
0.8109959
0
Batchwise "outer sum" of pairs of vectors. Expects two 2d tensors of shapes (b, m) and (b, n) and returns a 3d tensor of shape (b, m, n) where each of the (m, n) submatrices is the "outer sum" of corresponding vectors.
def batch_outer_sum(a, b): a, b = normalize_and_check_ndim([a, b], 2) # Due to broadcasting, this sum works analogously to batch matrix # multiplication. See also comments in batch_outer_product(). return a[:, :, np.newaxis] + b[:, np.newaxis, :]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def outer_sum(a, b, batch=False):\n if batch:\n return batch_outer_sum(a, b)\n # TODO: naming. Surely this has to be called something sensible?\n a, b = normalize_and_check_ndim([a, b], 1)\n # Due to broadcasting, this sum works analogously to matrix\n # multiplication. See also comments in o...
[ "0.7549128", "0.70124334", "0.6718192", "0.6595632", "0.6483426", "0.63795763", "0.6304991", "0.62340254", "0.6183096", "0.6170267", "0.6150513", "0.60053456", "0.59777755", "0.59755504", "0.5973091", "0.5962293", "0.594411", "0.59096915", "0.58444077", "0.5838402", "0.581593...
0.8179489
0
Return the log of the sum of exponentials of elements of x. Preserves numerical precision around the maximum value by initially subtracting and finally adding back in the max.
def logsumexp(x, axis=None): xmax = K.max(x, axis=axis, keepdims=True) xmax_ = K.max(x, axis=axis) return xmax_ + K.log(K.sum(K.exp(x - xmax), axis=axis))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_sum_exp(x):\n log_reduce_sum = P.ReduceSum()\n log = P.Log()\n exp = P.Exp()\n x_max = max(x.data)\n return log(log_reduce_sum(exp(x - x_max), 1)) + x_max", "def _logsumexp(x):\n # Search maximum.\n max_x = None\n length = len(x)\n for i in range(length):\n if max_x is N...
[ "0.8786673", "0.8604101", "0.8512844", "0.82524306", "0.8206249", "0.8206249", "0.77675444", "0.7728264", "0.7438143", "0.74150777", "0.7405275", "0.73468286", "0.73385084", "0.7293474", "0.72790587", "0.72658545", "0.72424203", "0.72053695", "0.70896155", "0.70545155", "0.70...
0.6813828
27
Create the Spark Session
def create_spark_session(): return SparkSession.builder \ .appName("Dataframe Reader") \ .master("local[*]") \ .getOrCreate()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_sparksession():\n return SparkSession.builder.\\\n appName(\"Transforming the historical parking occupancy and blockface datasets\").\\\n getOrCreate()", "def create_spark_session():\n \n print(\"Create Spark Session\")\n spark = SparkSession \\\n .builder ...
[ "0.8568158", "0.8250398", "0.81808573", "0.79985565", "0.79985565", "0.79985565", "0.79985565", "0.7984815", "0.79698676", "0.79698676", "0.79698676", "0.79698676", "0.79698676", "0.79698676", "0.79698676", "0.79698676", "0.79698676", "0.7966938", "0.79057294", "0.787787", "0...
0.8185485
2
To initialize a linked list structure used to handle hash conflicts and two variables for counting work.
def __init__(self): # 'count' is to store the length of chain that the 'singlyLinkedList' refers to, the number of values, not keys self.count = 0 # type: int # To store existing keys in the 'singlyLinkedList' self.keys = [] # type: List[keyType] # To deal with collision. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.hash_table = {}\n self.count_table = {}\n self.head = CountListNode()\n self.tail = CountListNode()", "def __init__(self):\n self.dummy = ListNode(-1)\n self.cnt = 0", "def __init__(self, head: ListNode):\n self.head = head\n se...
[ "0.78824806", "0.7559018", "0.72582144", "0.7242763", "0.7227502", "0.71689093", "0.7115092", "0.70966566", "0.70966566", "0.70688194", "0.7066724", "0.7056077", "0.70482403", "0.70228016", "0.6980681", "0.6976722", "0.69580126", "0.69549394", "0.69451207", "0.69191515", "0.6...
0.73773247
2
To concatenate two dictionary objects and self stores the result.
def mconcat(self, dictionary: 'Dictionary') -> None: if not isinstance(dictionary, Dictionary): raise Exception # to traverse the 'dictionary' and add the special nodes of 'dictionary' to self. for index in range(self.length): if dictionary.hashTable[index].count != 0: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iadd__(self, other):\n if not isinstance(other, dict):\n msg = 'Can not concatenate Dict and {}'.format(type(other))\n raise TypeError(msg)\n for key, val in other.items():\n if key in self:\n self._append_key(key, val)\n else:\n ...
[ "0.8154367", "0.76680094", "0.7294488", "0.71228254", "0.7068959", "0.70477664", "0.70020056", "0.70011073", "0.6856165", "0.6803097", "0.6782024", "0.67354494", "0.6733947", "0.67152697", "0.67136866", "0.66847044", "0.66847044", "0.66611797", "0.6613321", "0.65947926", "0.6...
0.5654489
97
Sample same number of negatives as positives but at least one
def get_num_neg(self, negative: torch.Tensor, num_pos: int) -> int: # protect against not enough negative examples and sample at least one neg if possible num_neg = min(negative.numel(), max(num_pos, 1)) return num_neg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_no_duplicates_and_positives_in_negative_sample(self):\n model = PoincareModel(self.data_large, negative=3)\n positive_nodes = model.node_relations[0] # Positive nodes for node 0\n num_samples = 100 # Repeat experiment multiple times\n for i in range(num_samples):\n ...
[ "0.708323", "0.69966656", "0.6853481", "0.68406075", "0.63011277", "0.61945343", "0.61586463", "0.6129091", "0.61034524", "0.60780746", "0.6037477", "0.603703", "0.5994463", "0.59613866", "0.5944668", "0.5925236", "0.5923893", "0.59209436", "0.59129316", "0.59129316", "0.5898...
0.0
-1
Create value map from enumerated type.
def to_value_map(enum): value_map = dict(zip(tuple(enum), enum._fields)) if -1 not in value_map: value_map[-1] = None return value_map
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mapping_for_enum(mapping):\n return dict(mapping.keys())", "def _serialize(self, data: Any) -> Dict[Any, Any]:\n\n return {field: value.value if isinstance(value, Enum) else value for field, value in data}", "def enum_dict(self):\n import warnings\n warnings.warn('You should not use...
[ "0.68868405", "0.59671664", "0.5924394", "0.5878461", "0.5795853", "0.57651186", "0.57444775", "0.5744464", "0.5743687", "0.555403", "0.5549169", "0.5529969", "0.55164593", "0.54984736", "0.54640585", "0.5461794", "0.5444919", "0.54248315", "0.5406385", "0.5396126", "0.539340...
0.66536695
1
Clear self.device input buffer.
def __flush_input(self): self.device.reset_input_buffer()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _serial_clear(self):\n self.serial.reset_input_buffer()", "def clear(self):\n self.buf = np.zeros((self.length, self.dim))\n self.ptr = 0\n self._size = 0", "def clear_buffer(self):\n for i, value in enumerate(self.buffer):\n self.buffer[i] = 0", "def reset(s...
[ "0.7579089", "0.7564613", "0.7474572", "0.73297286", "0.72956663", "0.7286823", "0.70935583", "0.6971847", "0.69621885", "0.69489235", "0.68369627", "0.6791775", "0.6790212", "0.674181", "0.66984165", "0.6666557", "0.66506237", "0.6648108", "0.66307324", "0.6609893", "0.65864...
0.787337
0
Subset a pandas.DataFrame with a 'chr' (chromosome) column to a particular chromosome. Reset the index if desired.
def subset_to_chrom(df, chrom, reindex=False): if not isinstance(chrom, list): chrom = [chrom] if not reindex: sub_df = df[df['chr'].isin(chrom)] else: sub_df = df[df['chr'].isin(chrom)].reset_index(drop=True) if sub_df.empty: raise ValueError('Chromosome subsetting res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pandas_df_method(chrs, chrSize, N):\n # Empty dataframe makes the if statements below a little easier\n df = pd.DataFrame()\n for ii in range(chrs):\n if not df.empty:\n # hold onto previous chromosomes, to be added together later\n old_df = df\n # pandas was fr...
[ "0.5383547", "0.531656", "0.5285686", "0.52306026", "0.5181435", "0.5068248", "0.5054984", "0.50486916", "0.50470036", "0.50061595", "0.49313873", "0.4880109", "0.48668268", "0.48520857", "0.48259526", "0.4806168", "0.47955918", "0.4781934", "0.47592208", "0.47032985", "0.470...
0.7214755
0
Euclidean distance between current pose and the goal.
def euclidean_distance(self,): return sqrt(pow((self.pose1.x - self.pose2.x), 2) + pow((self.pose1.y - self.pose2.y), 2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def euclidean_distance(self, goal_pose):\n\t\treturn sqrt(pow((goal_pose.x - self.pose.x), 2) +\n\t\t\t\t pow((goal_pose.y - self.pose.y), 2))", "def euclidean_distance(self, goal_pose):\n return sqrt(pow((goal_pose.x - self.pose.x), 2) +\n pow((goal_pose.y - self.pose.y), 2))", "d...
[ "0.84976345", "0.84813356", "0.82875615", "0.73956144", "0.7167065", "0.69989085", "0.6992502", "0.688031", "0.67752343", "0.67629236", "0.67340976", "0.6733802", "0.6725629", "0.6725629", "0.6725629", "0.6725629", "0.6725629", "0.6725629", "0.6725629", "0.6715818", "0.668803...
0.76946825
3
Sets the arr_date of this Stop. Arrival date in format YYYYMMDD, if available
def arr_date(self, arr_date): self._arr_date = arr_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rt_arr_date(self, rt_arr_date):\n\n self._rt_arr_date = rt_arr_date", "def arr_date(self):\n return self._arr_date", "def dep_date(self, dep_date):\n\n self._dep_date = dep_date", "def set_date(self, date):\n self.data['date'] = date", "def arr_time(self, arr_time):\n\n ...
[ "0.76801926", "0.6634716", "0.6303334", "0.60577255", "0.60407275", "0.5995572", "0.59622914", "0.59370536", "0.59370536", "0.5928312", "0.591016", "0.5887686", "0.5856641", "0.5827557", "0.5771383", "0.57631165", "0.5760676", "0.5760676", "0.5760676", "0.5760676", "0.5760676...
0.8322325
0
Gets the dep_time of this Stop.
def dep_time(self): return self._dep_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rt_dep_time(self):\n return self._rt_dep_time", "def dt(self) -> float:\n return self._dt", "def duration(self) -> float:\n return self._stop - self._start if self._stop is not None else None", "def get_time(self) -> float:\n raise NotImplementedError()", "def get_time_elaps...
[ "0.76340383", "0.69289684", "0.6700814", "0.6639289", "0.6582707", "0.656935", "0.6531528", "0.6488568", "0.6482343", "0.647869", "0.64723927", "0.6461741", "0.6451497", "0.6448607", "0.64331126", "0.640568", "0.6404436", "0.6399066", "0.6399066", "0.6388274", "0.637814", "...
0.85949135
0
Gets the dep_date of this Stop. Departure date in format YYYYMMDD, if available
def dep_date(self): return self._dep_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rt_dep_date(self):\n return self._rt_dep_date", "def dissolution_date(self) -> datetime:\n return self._dissolution_date", "def dep_time(self):\n return self._dep_time", "def decommission_date(self):\n return self._decommission_date", "def dep_date(self, dep_date):\n\n ...
[ "0.68812186", "0.62684524", "0.6139583", "0.6046779", "0.6004411", "0.56983453", "0.56968385", "0.5644735", "0.5618119", "0.5577743", "0.55707", "0.5556461", "0.5556461", "0.5556461", "0.5556461", "0.5541041", "0.55379695", "0.553578", "0.5535212", "0.55270046", "0.5510605", ...
0.813874
0
Sets the dep_date of this Stop. Departure date in format YYYYMMDD, if available
def dep_date(self, dep_date): self._dep_date = dep_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rt_dep_date(self, rt_dep_date):\n\n self._rt_dep_date = rt_dep_date", "def dep_date(self):\n return self._dep_date", "def dep_time(self, dep_time):\n\n self._dep_time = dep_time", "def departure(self, when: datetime.date):\n if self._departure:\n logging.warning(\n ...
[ "0.7047382", "0.6734145", "0.6207777", "0.6137859", "0.6076862", "0.60438323", "0.5876538", "0.5876307", "0.58750683", "0.58623844", "0.5852742", "0.5852474", "0.5847346", "0.5839326", "0.5810803", "0.57592154", "0.5754374", "0.5745503", "0.5682334", "0.5682334", "0.5671467",...
0.8388232
0