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
Creates the output tensor/op given the state tensor as input.
def call(self, state, num_quantiles): batch_size = state.get_shape().as_list()[0] x = self.net(state) state_vector_length = x.get_shape().as_list()[-1] state_net_tiled = tf.tile(x, [num_quantiles, 1]) quantiles_shape = [num_quantiles * batch_size, 1] quantiles = tf.random.uniform( quan...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_final_state(tensor, mask):\n tt = tf.transpose(tensor, [1, 0, 2])\n return tf.boolean_mask(tt, mask)", "def _create_model(self, input_state, num_actions):\n with tf.name_scope('shared_layers'):\n layer = Dense(NN_WIDTH, activation = 'relu')(input_state);\n layer = ...
[ "0.6615481", "0.64977145", "0.6494192", "0.64583147", "0.6288876", "0.6247043", "0.62462354", "0.6221747", "0.6189141", "0.61535305", "0.61449796", "0.6139222", "0.6091026", "0.6090485", "0.6043574", "0.603817", "0.5973863", "0.5946608", "0.5941777", "0.5922285", "0.59003526"...
0.0
-1
Returns the cumulative probability distribution for the bandit's arms
def cumulative_probability_distribution(self): return list(accumulate(self.probability_distribution()))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cumprob(self):\r\n return self.probabilities.cumsum(-1)", "def compute_cdf(ordered_weights):\n return numpy.cumsum(ordered_weights) - 0.5 * ordered_weights", "def cumulative_distribution(self, dist='current'):\n \n dictDist = {'current': np.cumsum(self.current),\n ...
[ "0.63667864", "0.59885705", "0.58818203", "0.57574713", "0.5677634", "0.5671187", "0.56479055", "0.5644314", "0.5621553", "0.56100565", "0.5598687", "0.5585664", "0.5584585", "0.5569585", "0.55550855", "0.5535241", "0.5534491", "0.5534201", "0.55092424", "0.5478344", "0.54701...
0.61860913
1
Computes the object's next state and updates the object visualization on the screen. If colliding is True, then acceleration will not be applied.
def update( self, dt, colliding=False ): # Turn off acceleration during collisions to keep ball # from sinking through the floor: if colliding: a = [0,0] else: a = self.acceleration # How much the ball will move (in physics coordinates) during # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _nextFrame(self):\n self._handleInput() \n\n for entity in Entity.Entities:\n \n #Acceleration\n entity.velocity.y += Game.Gravity\n\n #Velocity\n entity.velocity += entity.acceleration\n \n #Position\n ent...
[ "0.6295751", "0.62391543", "0.58948", "0.5864048", "0.58189976", "0.58155006", "0.5807431", "0.5796653", "0.57755375", "0.5773455", "0.57145745", "0.5705247", "0.56241024", "0.5620825", "0.56017363", "0.5568935", "0.55253154", "0.55236137", "0.55228764", "0.55203354", "0.5519...
0.59208775
2
Returns the anchor point
def getAnchor(self): return self.anchor
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def anchor_position(self):\n return self._anchor_x, self._anchor_y", "def anchor(self):\n return self._anchor", "def anchor_x(self):\n return self._anchor_x", "def anchor(self) -> Optional[Vertex]:\n return self._anchor", "def guess_anchor(self):\n return self.nearest(\"V...
[ "0.82576627", "0.8179636", "0.8017302", "0.76942915", "0.76729125", "0.75523895", "0.7532764", "0.7502792", "0.73952943", "0.7162884", "0.7018313", "0.6970193", "0.69471616", "0.68853027", "0.6880658", "0.68483245", "0.6838758", "0.67409533", "0.6683675", "0.66472554", "0.659...
0.82521427
1
returns the basename for the corresponding filename_prefix
def get_filename(target_dir, filename_prefix): # this whole function is not the nicest thing, but isolating it makes # things clearer , a good refactoring would be to get # the info from the video_url or the current output, to avoid the # iteration from the current dir filenames = os.listdir(target_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getBaseName(filepath):\n return os.path.basename(filepath)", "def get_filename(target_dir, filename_prefix):\n # This whole function is not the nicest thing, but isolating it makes\n # things clearer. A good refactoring would be to get the info from the\n # video_url or the current output, to avo...
[ "0.73631924", "0.72451574", "0.72298723", "0.7206692", "0.71889937", "0.7135855", "0.70966387", "0.70349634", "0.7034767", "0.7034767", "0.7029529", "0.7020042", "0.69400764", "0.6930817", "0.691594", "0.69155747", "0.6910832", "0.6896609", "0.68697447", "0.6855322", "0.68393...
0.7559987
0
Replace text using regex.
def replace_message(message): return re.sub(regex1, r"\g<comic>", message)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def REGEXREPLACE(text, regular_expression, replacement):\n return re.sub(regular_expression, replacement, text)", "def replace(text,pattern,replace=\"\"):\n\n thisFunc = inspect.currentframe().f_code.co_name\n result = re.sub(pattern,replace,text)\n return result", "def re_sub(pattern, replacement, t...
[ "0.7659338", "0.75295484", "0.7207516", "0.7057383", "0.694099", "0.69238895", "0.69074166", "0.6761761", "0.67148924", "0.6696617", "0.6484302", "0.64661086", "0.63495857", "0.63213146", "0.6303902", "0.6272035", "0.6219445", "0.62025636", "0.61833996", "0.6140413", "0.61396...
0.6208861
17
Replace all hashtags in ``text`` with ``replace_with``.
def replace_hashtags(text, replace_with="_TAG_"): return RE_HASHTAG.sub(replace_with, text)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_hashtag_symbols(text):\n return text.replace('#','')", "def remove_hashtags(text):\n text = re.sub('\\B#\\w*[a-zA-Z]+\\w*', '', text)\n return text", "def filter_hashtags(text):\n return re.sub(\"#\\S+\", \"\", text)", "def removeHashtagInFrontOfWord(text):\n text = re.sub(r...
[ "0.6548886", "0.63280475", "0.6304474", "0.6184098", "0.61654866", "0.61164176", "0.6071221", "0.6032992", "0.59017617", "0.58903265", "0.58296806", "0.58296806", "0.5686215", "0.55288047", "0.54703265", "0.54062206", "0.5376215", "0.5347103", "0.53031415", "0.5254374", "0.52...
0.7951694
0
Replace all numbers in ``text`` with ``replace_with``.
def replace_numbers(text, replace_with="_NUMBER_"): return RE_NUMBER.sub(replace_with, text)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace_digits(text):\n text = re.sub(r\"\\d+\", \"number\", text)\n \n return text", "def replace_digits(text):\n text = re.sub('[0-9]', '5', text)\n return text", "def clean_numbers(text):\n return regex.sub(\"\\d+\", ' NUM', text)", "def remove_nums(self, text):\r\n ...
[ "0.82179713", "0.7456578", "0.70578367", "0.70087135", "0.70087135", "0.70087135", "0.6906772", "0.6490816", "0.64130896", "0.6399646", "0.63961256", "0.63436407", "0.6144586", "0.6135708", "0.6125761", "0.6076609", "0.60611427", "0.60271615", "0.5966679", "0.5966679", "0.596...
0.8226441
0
Replace all phone numbers in ``text`` with ``replace_with``.
def replace_phone_numbers(text, replace_with="_PHONE_"): return RE_PHONE_NUMBER.sub(replace_with, text)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace_digits(text):\n text = re.sub(r\"\\d+\", \"number\", text)\n \n return text", "def replace_numbers(text, replace_with=\"_NUMBER_\"):\n return RE_NUMBER.sub(replace_with, text)", "def replace_digits(text):\n text = re.sub('[0-9]', '5', text)\n return text", "def clean...
[ "0.73781407", "0.72474277", "0.66326135", "0.6279047", "0.62337095", "0.6102317", "0.6102317", "0.6102317", "0.6004542", "0.5860577", "0.58425987", "0.58277154", "0.5804781", "0.576744", "0.57541484", "0.5736585", "0.5658659", "0.5650656", "0.56247014", "0.5603115", "0.551540...
0.8295875
0
Replace all URLs in ``text`` with ``replace_with``.
def replace_urls(text, replace_with="_URL_"): return RE_SHORT_URL.sub(replace_with, RE_URL.sub(replace_with, text))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace_urls(text):\n text = re.sub('(?P<url>https?://[^\\s]+)', 'URL', text)\n return text", "def replace_urls_token(text):\n\n text = re.sub(r\"^https?://.*[\\r\\n]*\", \"<url/>\", text, re.M | re.I)\n return re.sub(r\"http\\S+(\\s)*(\\w+\\.\\w+)*\", \"<url/>\", text, re.M | re.I)", "...
[ "0.80500907", "0.7262176", "0.6782493", "0.66208375", "0.6392964", "0.638476", "0.6188562", "0.6152526", "0.6140596", "0.61244386", "0.6118383", "0.610067", "0.6034752", "0.59849185", "0.59626937", "0.59542114", "0.5939017", "0.59327173", "0.59327173", "0.5928074", "0.5916724...
0.79924023
1
Returns a random color defined in matplotlib.colors.BASE_COLORS or matpotlib.colors.CSS4_COLORS
def random_color(): c = colors[random.randint(0, len(colors) - 1)] return c[1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _random_color():\n return random.randint(0, 255)", "def random_color():\n r = lambda: random.randint(0, 255)\n color = ('%02X%02X%02X' % (r(), r(), r()))\n return color", "def random_color():\n colormode(255)\n return randint(0, 255), randint(0, 255), randint(0, 255)", "def _rand_color(...
[ "0.8245577", "0.8195117", "0.81574726", "0.81034184", "0.80555356", "0.7967437", "0.79281044", "0.79209054", "0.7896584", "0.7884475", "0.783549", "0.77710986", "0.77487963", "0.7742548", "0.77390194", "0.7731508", "0.7637822", "0.76128966", "0.74664146", "0.7447643", "0.7444...
0.8006844
5
A class to configure the marker on the graph. The base is a Point class
def __init__(self, x, y, marker='s', fillstyle='none', color='black'): super().__init__(x, y) self.marker = marker self.fillstyle = fillstyle self.color = color
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self,coordinate,label=None,color=None,markersize=80,marker='o'):\n self.coordinate = np.array(coordinate)\n self.label = label\n self.color = color\n self.marker = marker\n self.markersize = markersize", "def _point(self):\n raise NotImplementedError", "de...
[ "0.6526783", "0.64239997", "0.63707393", "0.63693285", "0.6316781", "0.63080883", "0.6293901", "0.61419135", "0.61236894", "0.60291475", "0.60117906", "0.6010417", "0.59884214", "0.5861355", "0.5804711", "0.5787556", "0.576906", "0.5762525", "0.5737318", "0.5735325", "0.57255...
0.67813987
0
Check that the two are not at least as close as some epsilon
def is_within_epsilon_of(self, that, epsilon): if (not isinstance(that, Annotation)): raise ValueError("Argument for intersects should be an annotation") if (self.bbox.xmin - epsilon > that.bbox.xmax or that.bbox.xmin - epsilon > self.bbox.xmax): return False if (self.b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(a,b):\n return abs(a-b) < epsilon", "def almost_eq(e1,e2) :\n\treturn round(e1-e2,4) == 0.0", "def is_almost_equal(self, x ,y ,epsilon=1*10**(-8)):\n \treturn abs(x-y) <= epsilon", "def almost_equal(x, y):\n return abs(x-y) < FP_PREC", "def approx_eq(a, b):\n return abs(a-b) < approx_...
[ "0.8072599", "0.7705578", "0.7611694", "0.75053805", "0.74547297", "0.72824156", "0.7147031", "0.7128365", "0.71111596", "0.71096116", "0.70994973", "0.70970786", "0.7050322", "0.7048478", "0.69617146", "0.6956363", "0.6948982", "0.694114", "0.69399107", "0.69399107", "0.6909...
0.0
-1
Format the y axis. This method is required.
def format_y_axis(self, text=None, positionx=None, positiony=None, color=None, fontsize=None): if text is not None: self.xaxis_label = text x, y = self.settings.otherParams["ylabel.position"] if positionx is not None: x = positionx if positiony is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_y_axis(self, y_tick, y_limits):\n self._fig.update_layout(\n yaxis=dict(\n range=y_limits,\n dtick=y_tick,\n ),\n )", "def format_ydata(self, y):\n try:\n return self.fmt_ydata(y)\n except TypeError:\n ...
[ "0.7826494", "0.7715604", "0.7492969", "0.74225605", "0.74225605", "0.7407978", "0.7192792", "0.7151643", "0.71114075", "0.6881998", "0.68313205", "0.680623", "0.6628544", "0.65608287", "0.65549165", "0.6509494", "0.6490423", "0.64839506", "0.64222705", "0.63978857", "0.63178...
0.7391607
6
Places the max age on the bottom right of the plot
def show_max_age_label(self): self.draw_max_age = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plotEvolutionMaximum(self):\n evolutionMaximum = self.getEvolutionMax();\n plt.plot(evolutionMaximum)\n plt.xlabel('Time')\n plt.ylabel('Maximum realizations')\n plt.show()", "def _set_maximum_value(self, value):\n # Check if the current value is not None, and if so,...
[ "0.628084", "0.611207", "0.6042483", "0.59697044", "0.59041345", "0.5897379", "0.580687", "0.5745762", "0.5740892", "0.57087815", "0.56910723", "0.56762767", "0.5655841", "0.56557804", "0.5619912", "0.5605085", "0.5593607", "0.5587225", "0.55800754", "0.557477", "0.5537528", ...
0.75079167
0
Internal, Hints should have an x value < 0 or bigger than self.xmax
def __sanitize_hint(self, hint): # TODO: what should this be? if hint is not None: edge = 10 if not isinstance(hint, Point): hint = Point(hint[0], hint[1]) if hint.y >= 0 and hint.y <= self.ymax: if (hint.x >= self.xmax / 2 and hint.x <...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_limits(self):\n if self.pos_x > self.max_x:\n self.max_x = self.pos_x\n if self.pos_y > self.max_y:\n self.max_y = self.pos_y\n if self.pos_x < self.min_x:\n self.min_x = self.pos_x\n if self.pos_y < self.min_y:\n self.min_y = self...
[ "0.66369957", "0.6261867", "0.61775446", "0.60904115", "0.6041167", "0.6015645", "0.60147953", "0.60067666", "0.5978147", "0.5974413", "0.59214216", "0.5920915", "0.5916806", "0.59019613", "0.58809257", "0.58745205", "0.5867945", "0.58427334", "0.58169246", "0.58029026", "0.5...
0.6402009
1
Merges dictionaries right to left. Has side effects for each argument.
def _merge_dicts(*args): return reduce(lambda d, s: d.update(s) or d, args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge(*dict_args):\n result = {}\n for dictionary in dict_args:\n result.update(dictionary)\n return result", "def _merge_dicts(*args):\n return reduce(lambda d, s: d.update(s) or d, args)", "def merge_dicts(x, y):\n z = x.copy()\n z.update(y)\n return z", "def merge_dicts(x, ...
[ "0.77585936", "0.7642509", "0.75553674", "0.75553674", "0.75553674", "0.7513154", "0.75086707", "0.75086707", "0.75086707", "0.75086707", "0.75086707", "0.75086707", "0.74754846", "0.74343747", "0.73994106", "0.7388429", "0.73847675", "0.73847675", "0.73847675", "0.73847675", ...
0.7653899
1
Sets the goal of this V1beta1ObjectiveSpec.
def goal(self, goal): self._goal = goal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_goal(self, goal: GoalType) -> None:\n self.goal = goal", "def set_goal(self, goal):\r\n self.goal = goal\r\n self.start_time = self.get_current_time()", "def set_goal(self, **kwargs):\n return self.env.set_goal(**kwargs)", "def set_goal(goal_loc):\n BoardPath._goal_...
[ "0.6847137", "0.6301083", "0.6160648", "0.6113916", "0.5923506", "0.5509465", "0.5363289", "0.51998234", "0.51625663", "0.5155937", "0.5066083", "0.5055035", "0.5044601", "0.5033005", "0.48844713", "0.4864388", "0.48288953", "0.48016804", "0.47754538", "0.4738988", "0.4734738...
0.67525053
1
Sets the objective_metric_name of this V1beta1ObjectiveSpec.
def objective_metric_name(self, objective_metric_name): self._objective_metric_name = objective_metric_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def metric_name(self, metric_name: str):\n if metric_name is None:\n raise ValueError('Invalid value for `metric_name`, must not be `None`') # noqa: E501\n\n self._metric_name = metric_name", "def setName(self, *args):\n return _libsbml.Objective_setName(self, *args)", "def met...
[ "0.64257777", "0.5627302", "0.55565006", "0.55565006", "0.55565006", "0.55565006", "0.55565006", "0.55565006", "0.55565006", "0.55565006", "0.55565006", "0.5361167", "0.5332128", "0.53186035", "0.5215034", "0.5215034", "0.5169319", "0.5169319", "0.49622774", "0.49168015", "0....
0.80898046
0
Sets the type of this V1beta1ObjectiveSpec.
def type(self, type): self._type = type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_type(self, type, asset=None):\n self._set_property('pc:type', type, asset)", "def setType(self, *args):\n return _libsbml.Objective_setType(self, *args)", "def set_type(self, type):\n self.type = type", "def set_type(self, type):\n self.type = type", "def set_type(self, ...
[ "0.6321005", "0.6229115", "0.6043234", "0.6043234", "0.60419714", "0.59257185", "0.59257185", "0.59257185", "0.588642", "0.5885106", "0.58702016", "0.58649373", "0.5844506", "0.58200896", "0.58066624", "0.57388157", "0.5737741", "0.5734664", "0.5732427", "0.5732427", "0.57166...
0.5599308
31
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, V1beta1ObjectiveSpec): return False return self.to_dict() == other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, V1beta1ObjectiveSpec): return True return self.to_dict() != other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.84560555", "0.83913696", "0.8143685", "0.81403786", "0.8131871", "0.8093231", "0.80915105", "0.80915105", "0.80915105", "0.8084564", "0.8084564", "0.8075547", "0.8075547", "0.8065006", "0.80417657", "0.80417657", "0.80417657", "0.80417657", "0.80417657", "0.80417657", "0.8...
0.0
-1
Stringifies a GI. It converts variation symbol into a string (i.e., + to _pos; and to _neg)
def as_string(self): if self.symbol == '+': temp = str(self.attribute_col) + '_pos' elif self.symbol == '-': temp = str(self.attribute_col) + '_neg' else: temp = str(self.attribute_col) + '_inv' return temp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pos_to_name(reg):\n l,b = position_region(reg).galactic() \n if numpy.sign(b) == 1:\n pm = \"+\"\n else:\n pm = \"-\"\n text = \"G%4.2f%1s%4.2f\" % (l,pm,abs(b))\n return text", "def __str__(self):\n\n rep = 'Generalized Syllogism:\\n'...
[ "0.6607812", "0.62499124", "0.602247", "0.5984523", "0.5883479", "0.5857428", "0.58372575", "0.5783968", "0.57655364", "0.5732554", "0.57182413", "0.5696852", "0.56706977", "0.5667027", "0.5646702", "0.5622799", "0.56057775", "0.5595601", "0.5584002", "0.55690694", "0.5565008...
0.6090936
2
Returns the GP in string format
def to_string(self): pattern = list() for item in self.gradual_items: pattern.append(item.to_string()) return pattern
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def str(self):\n out = \"{0}:\".format(self.gtype) if self.gtype else \"\"\n out += \"{0}\".format(repr(self.coords))\n out += \"[{0}]\".format(str(self.goalPtr)) if self.goalPtr else \"\"\n return out", "def pos_to_name(reg):\n l,b = position_region(reg).galactic() \...
[ "0.7185289", "0.6713946", "0.6669309", "0.6584663", "0.65223074", "0.6491413", "0.64315313", "0.64144623", "0.6328155", "0.6327975", "0.6308083", "0.62945855", "0.62930876", "0.62720317", "0.6257001", "0.6231791", "0.621236", "0.6189178", "0.6189178", "0.6189178", "0.6189178"...
0.0
-1
Return a list of cameras matching camera_ids.
def camera_info(self, camera_ids, **kwargs): api = self._api_info['camera'] payload = dict({ '_sid': self._sid, 'api': api['name'], 'method': 'GetInfo', 'version': api['version'], 'cameraIds': ', '.join(str(id) for id in camera_ids), },...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def camera_list(self, **kwargs):\n api = self._api_info['camera']\n payload = dict({\n '_sid': self._sid,\n 'api': api['name'],\n 'method': 'List',\n 'version': api['version'],\n }, **kwargs)\n response = self._get_json(api['url'], payload)\n\...
[ "0.7368694", "0.7174236", "0.7087088", "0.6857442", "0.68393576", "0.669999", "0.6590284", "0.6582303", "0.64434385", "0.64434385", "0.63746154", "0.6322547", "0.61819977", "0.6086376", "0.5975466", "0.5932839", "0.5931827", "0.586724", "0.5850118", "0.58136714", "0.5811054",...
0.70185727
3
Return true if camera is recording.
def is_recording(self): return self._recording_status in RECORDING_STATUS
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isRecording(self):\n if not self.proxy:\n self.proxy = self.session.service(\"ALVideoRecorder\")\n return self.proxy.isRecording()", "def is_recording(self):\n return self._isrecording", "def recording(self) -> bool:\n\t\treturn self._raw_result['data']['recording']", "def...
[ "0.83283544", "0.7816867", "0.77776545", "0.7438238", "0.73101664", "0.7279753", "0.7183958", "0.6973352", "0.6886689", "0.68238515", "0.67565334", "0.66688776", "0.66580516", "0.65564024", "0.65049815", "0.6395907", "0.63785344", "0.6323208", "0.61253095", "0.6116084", "0.60...
0.7559504
3
Initializes the TimeSeries's data from the given SQL cursor.
def initialize_from_sql_cursor(self, sqlcursor): # initialize the result tuples = 0 # add the SQL result to the time series data = sqlcursor.fetchmany() while 0 < len(data): for entry in data: self.add_entry(str(entry[0]), entry[1]) data ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_from_sql_cursor(self, sqlcursor):\n # initialize the result\n tuples = 0\n\n # add the SQL result to the timeseries\n data = sqlcursor.fetchmany()\n while 0 < len(data):\n for entry in data:\n self.add_entry(str(entry[0]), [item for item i...
[ "0.75112903", "0.6125756", "0.5882903", "0.5803149", "0.57719797", "0.5745259", "0.56093264", "0.5595334", "0.5592519", "0.55788296", "0.5560807", "0.55329263", "0.55284506", "0.55281353", "0.5524409", "0.5490075", "0.5486708", "0.54448783", "0.54158574", "0.5389734", "0.5345...
0.75692123
0
Returns the number of data entries stored in the TimeSeries.
def __len__(self): return len(self._timeseriesData)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_data(self):\n try:\n ndata = len(self.x)\n logger.info(\"Number of data points: {0}\".format(ndata))\n except AttributeError:\n logger.error(\"Data object has not been defined\")\n ndata = 0\n return ndata", "def data_count(self):\n ...
[ "0.7956524", "0.7708638", "0.7704976", "0.75899", "0.75002134", "0.74291724", "0.7385781", "0.7379717", "0.7270198", "0.72524685", "0.718217", "0.7154316", "0.7014864", "0.696949", "0.69578177", "0.6936469", "0.69212383", "0.6896637", "0.6861383", "0.6859388", "0.6849119", ...
0.7816038
1
Returns the item stored at the TimeSeries indexth position.
def __getitem__(self, index): return self._timeseriesData[index]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_item(self, index: int) -> _T:\n return self.index_to_item[index]", "def __getitem__(self, index):\n return self.data[index[0] - 1][index[1] - 1]", "def __getitem__(self, index):\n item = self.data[index]\n return item", "def __getitem__(self,i):\n\t\treturn self.series[i]"...
[ "0.74378836", "0.74334174", "0.71590513", "0.71253026", "0.71088785", "0.71088785", "0.7093996", "0.70619726", "0.7052217", "0.69903344", "0.6987595", "0.69618636", "0.6911742", "0.6904179", "0.6886945", "0.6886945", "0.68797183", "0.68453044", "0.6761487", "0.6747437", "0.67...
0.8196548
0
Returns if the TimeSeries is normalized.
def is_normalized(self): if not self._normalized: return self._check_normalization() return self._normalized
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_normalized(self) -> bool:\n return is_date_array_normalized(self.asi8, self.tz, reso=self._creso)", "def normalisable(self):\n\n return np.abs(np.nansum(self.data)) > 0", "def _is_normalized(self, tol: Optional[Real] = None) -> bool:\n tol = tol if tol is not None else self.tol\n ...
[ "0.78787774", "0.67261845", "0.62963593", "0.60376346", "0.6034303", "0.5892522", "0.585952", "0.58582145", "0.5837204", "0.5710639", "0.55987465", "0.55706024", "0.55375457", "0.553116", "0.5525907", "0.55243725", "0.54699326", "0.54621565", "0.54509765", "0.54480374", "0.53...
0.71743965
1
Returns if the TimeSeries is sorted.
def is_sorted(self): return self._sorted
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_sorted(self):\n previous = 0 # Setting to 0 shouldn't be an issue aslong as MIN_VALUE is at least 0\n for value in self.data:\n if value < previous:\n return False\n previous = value\n return True", "def time_series(self) -> bool:\n return ...
[ "0.7600161", "0.69787145", "0.66081285", "0.6538842", "0.6465583", "0.639849", "0.6351007", "0.6340955", "0.6329437", "0.62792075", "0.62618876", "0.62255156", "0.6216404", "0.61548847", "0.61373913", "0.6090497", "0.6078248", "0.6071335", "0.6057179", "0.6043806", "0.6036652...
0.7379102
1
Yield extracted features from a set of glog reports stored in a zip file.
def gen_glogs(zipname, ref_hashes, extraction, verbose=True, **extraction_kwargs): with ZipFile(zipname, 'r') as z: # sort files according to reference hash list filenames = sort_files(z.namelist(), ref_hashes) if verbose: filenames = tqdm(filenames) # load and return gl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_features(self, feature_type=\"all\"):\n # if exists(path=\"data.csv\"):\n # return pd.read_csv(\"data.csv\")\n # else:\n # reading through directory\n for file_path in self.list_news_path:\n with open(file_path, 'r') as f:\n\n # open document...
[ "0.59452516", "0.5761317", "0.5656144", "0.5656144", "0.5603303", "0.5603303", "0.5574355", "0.5521563", "0.5515974", "0.55076504", "0.5443905", "0.5416753", "0.5365445", "0.53261334", "0.5318004", "0.530645", "0.5292001", "0.5283433", "0.52798605", "0.5271696", "0.52600956",...
0.67947847
0
Asserts that the user id doesn't exist
def step_impl(context): response = test_app.get(f"/get_user_account/{user_id}") assert response.json() == []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_user_non_exist_id(self):\n print('(' + self.test_get_user_non_exist_id.__name__+')',\n self.test_get_user_non_exist_id.__doc__)\n self.assertIsNone(self.connection.get_user(NON_EXIST_PATIENT_USERNAME))", "def test_get_single_user_is_missing(self):\n add_user(\"neilb...
[ "0.7879742", "0.78487206", "0.7763679", "0.765779", "0.7594769", "0.75571746", "0.7545073", "0.7513345", "0.7475345", "0.74672145", "0.7464097", "0.74511826", "0.7424879", "0.7402145", "0.7368214", "0.73593825", "0.7358294", "0.73546624", "0.7316447", "0.73010415", "0.7277768...
0.0
-1
Evaluates the sigmoid activation of input z
def sigmoid(z): return 1 / (1 + np.exp(-1 * z))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid(z): \n return 1/(1 + np.e**(-z))", "def activation(z):\n # formula for sigmoid\n return 1 / (1 + np.exp(-z))", "def sigmoid(z):\r\n \r\n return 1.0 / (1.0+np.exp(-z))", "def sigmoid(z):\n\treturn 1.0/(1.0+np.exp(-z))", "def sigmoid(z):\r\n \r\n return vSigmoid(z);", "de...
[ "0.87525165", "0.8713125", "0.8674694", "0.86405665", "0.8611523", "0.85761523", "0.85728085", "0.8568245", "0.85382646", "0.8535496", "0.85316867", "0.85315984", "0.85214853", "0.8520563", "0.851858", "0.8511735", "0.85016924", "0.84887725", "0.84582764", "0.8449854", "0.842...
0.85758084
6
given a path, return a pose map
def get_pose_map(path) -> np.ndarray: hands = mp_hands.Hands( static_image_mode=True, max_num_hands=2, min_detection_confidence=0.5 ) # Read an image, flip it around y-axis for correct handedness output (see # above). image = cv2.imread(path) # range 0 - 255. 3d image = c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path_to_poses(mapdata, path):\n p_array = []\n rospy.loginfo(\"Converting path to poses.\")\n last_ori = quaternion_from_euler(0, 0, 0)\n last_ori = Quaternion(last_ori[0], last_ori[1],last_ori[2],last_ori[3])\n for i in range(len(path) - 1):\n msg = PoseStamped()\...
[ "0.7608824", "0.63387823", "0.6242811", "0.6236584", "0.6192242", "0.60348207", "0.5999612", "0.5983782", "0.5784153", "0.5727279", "0.56749123", "0.5658092", "0.5630909", "0.5627003", "0.56187195", "0.5473634", "0.5465681", "0.5465178", "0.544204", "0.54360574", "0.5411578",...
0.6368842
1
Tests that if the query term is not provided an empty queryset is returned.
def test_no_value_for_search_query_returns_empty_queryset(self): article = ArticleFactory() article.publish() request = RequestFactory().get("", {}) response = Search.as_view()(request) self.assertIn("results", response.context_data) results = response.context_data["resul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_empty_search_query_returns_empty_queryset(self):\n article = ArticleFactory()\n article.publish()\n request = RequestFactory().get(\"\", {\"q\": \"\"})\n response = Search.as_view()(request)\n self.assertIn(\"results\", response.context_data)\n results = response....
[ "0.7129401", "0.6875254", "0.6794152", "0.64132977", "0.6413233", "0.61520237", "0.60652834", "0.60642326", "0.6026971", "0.6024556", "0.6000621", "0.59743977", "0.5923404", "0.59043086", "0.58290136", "0.5826551", "0.58240056", "0.58238083", "0.5823071", "0.58222544", "0.582...
0.6922088
1
Tests that results are of the requested category only.
def test_results_are_of_the_requested_category_only(self): article = ArticleFactory(title="same") article.publish() feed = FeedFactory(text="same") request = RequestFactory().get("", {"q": "same"}) response = Search.as_view()(request, category="articles") self.assertIn("r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_category(self):\n # XXX identifiers would be groovy\n self.check_search(\n dict(category=u'36:self'), # trap\n [u'Ingrain'],\n 'simple category search, vs self',\n exact=True,\n )\n self.check_search(\n dict(category=u'14:...
[ "0.7662899", "0.7304349", "0.71782196", "0.70480824", "0.6950431", "0.6738949", "0.66344005", "0.65475327", "0.6467559", "0.6442441", "0.6414184", "0.64003", "0.6391267", "0.6391267", "0.63547635", "0.6340897", "0.63392204", "0.63392204", "0.6323578", "0.6310004", "0.62828016...
0.7840405
0
Read all text from .txt document.
def read_data(self): data = pd.read_table(self.file_dir, sep="\t", header=None) data.columns = ["FromNodeId", "ToNodeId"] return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readTextFromFile(self, filename):\r\n f = open(filename)\r\n self.text = f.read()\r\n f.close()", "def read_txt(path):\n with open(path, \"r\") as f:\n return f.read().splitlines()", "def read_txt(path):\n with open(path, \"r\") as f:\n return f.read().splitlines()"...
[ "0.7473117", "0.7330084", "0.7330084", "0.7275403", "0.71817404", "0.70846766", "0.70094705", "0.69405526", "0.6923494", "0.6919219", "0.69187564", "0.69187564", "0.69084316", "0.68454117", "0.6820375", "0.6792321", "0.6780814", "0.6779319", "0.67101234", "0.6679669", "0.6631...
0.0
-1
Returns the number of drafted Questions for this topic.
def question_count_drafted(self, obj): return obj.questions.drafted().count()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def question_count_published(self, obj):\n return obj.questions.published().count()", "def get_n_questions(self):\n return self.df.question.nunique()", "def question_count_removed(self, obj):\n return obj.questions.removed().count()", "def has_draft(self, object_id):\n return len(...
[ "0.679899", "0.6413791", "0.60514295", "0.6023301", "0.59942114", "0.59765005", "0.5930318", "0.58986014", "0.58927184", "0.58782625", "0.5862108", "0.58618146", "0.5779569", "0.5724282", "0.57100016", "0.567823", "0.5668843", "0.5650912", "0.55655426", "0.5529702", "0.551578...
0.83824325
0
Returns the number of published Questions for this topic.
def question_count_published(self, obj): return obj.questions.published().count()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_publishers(self, topic_name):\n return self._count_publishers_or_subscribers(topic_name, _rclpy.rclpy_count_publishers)", "def get_n_questions(self):\n return self.df.question.nunique()", "def vote_count(self):\n return QuestionVotes.objects.filter(question=self).count()", "def...
[ "0.6680849", "0.667033", "0.65022856", "0.6489186", "0.6435568", "0.6317258", "0.6296172", "0.6087696", "0.60868514", "0.59836155", "0.59082836", "0.5888286", "0.58848155", "0.5859198", "0.5826437", "0.5825862", "0.57804465", "0.5779567", "0.5778739", "0.57780296", "0.5762058...
0.829443
0
Returns the number of removed Questions for this topic.
def question_count_removed(self, obj): return obj.questions.removed().count()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_n_questions(self):\n return self.df.question.nunique()", "def get_total_words_removed(self):\n return self.total_words_removed", "def removed_member_count(self):\n return self._removed_member_count", "def getNumDeletions(self):\n return _libsbml.Submodel_getNumDeletions(se...
[ "0.6686839", "0.6492833", "0.6482789", "0.63946253", "0.6363508", "0.6137867", "0.6108803", "0.6005032", "0.59693235", "0.5962919", "0.59293216", "0.5895062", "0.58949673", "0.58875084", "0.5839968", "0.5784915", "0.5715642", "0.570551", "0.5658279", "0.5636379", "0.56180674"...
0.8484519
0
Returns the total number of Questions for this topic.
def question_count_total(self, obj): return obj.questions.count()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_n_questions(self):\n return self.df.question.nunique()", "def total_answer_count(self):\n # TODO(sll): Cache this computed property.\n total_count = 0\n for answer, count in self.answers.iteritems():\n total_count += count\n return total_count", "def vote_c...
[ "0.75022054", "0.7246199", "0.7211218", "0.6972901", "0.6742625", "0.66101754", "0.6603032", "0.6478064", "0.64570487", "0.64562947", "0.645361", "0.6427888", "0.6423029", "0.640779", "0.63542885", "0.63348407", "0.6301701", "0.62860763", "0.6269418", "0.625383", "0.62533104"...
0.81426394
0
Gets accept from headers. Default to "application/json" if it is unset.
def get_accept_from_headers( headers: Optional[starlette.datastructures.Headers], ) -> str: if headers is not None: for key, value in headers.items(): if prediction.ACCEPT_HEADER_REGEX.match(key): return value return prediction.DEFAULT_ACCEPT_VALUE
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_header_accept(self, accepts):\n if not accepts:\n return\n\n accepts = [x.lower() for x in accepts]\n\n if 'application/json' in accepts:\n return 'application/json'\n else:\n return ', '.join(accepts)", "def get_accept_header(\n cls,...
[ "0.7525885", "0.7452094", "0.7433217", "0.72159284", "0.6944203", "0.68490654", "0.66674685", "0.64658403", "0.6437024", "0.6382542", "0.63437533", "0.62042683", "0.6186144", "0.6144863", "0.60943484", "0.6094132", "0.6093663", "0.60062516", "0.60042876", "0.59850127", "0.579...
0.73217154
3
Given the latent z at a particular time step t and the input x at time step t, we return the mean and variance of the Gaussian distribution p(y_t|z_t, x_t).
def forward(self, z_t: torch.Tensor, x_t: torch.Tensor) -> Tuple[torch.Tensor, torch.nn.parameter.Parameter]: h1 = self.relu(self.lin_z_to_hidden(z_t)) h2 = self.relu(self.lin_x_to_hidden(x_t)) h3 = h1 + h2 # element-wise sum of the two hidden states m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Gaussian(x,t,sigma):\n return np.exp(-(x-t)**2/(2*sigma**2))", "def Gaussian(x, t, sigma):\n return np.exp(-(x - t)**2 / (2 * sigma**2))", "def gaussian(T, Y, X, t, y, x, sigma, sigma_t=1):\n const_value = np.sqrt(2 * np.pi * sigma) ** 3\n norm = np.exp(\n -(\n ((X - x) **...
[ "0.71092784", "0.6760463", "0.6612515", "0.6427414", "0.63776815", "0.6333422", "0.6293085", "0.62321866", "0.6213216", "0.62113976", "0.61027384", "0.60853755", "0.60643876", "0.6043089", "0.6023088", "0.60187274", "0.6005257", "0.59888834", "0.5966032", "0.59654903", "0.594...
0.0
-1
Combines the previous hidden state z_{t1} and the current input x_t to produce the hidden state h_t, which is used by the emitter and transition networks.
def forward(self, z_prev : torch.Tensor, rnn_input : torch.Tensor ) -> Tuple[torch.Tensor, torch.Tensor]: hidden = self.relu(self.lin_z_to_hidden(z_prev) + self.lin_rnn_to_hidden(rnn_input)) loc = self.hidden_to_loc(hidden) scale = F.softplus(sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, z_t_1, h_x):\n h_combined = 0.5*(self.z_to_h(z_t_1) + h_x)# combine the rnn hidden state with a transformed version of z_t_1\n \n z_mean = self.h_to_z_mean(h_combined)\n \n z_var = self.h_to_z_var(h_combined)\n \n epsilon = torch.randn(z_t_1.size()...
[ "0.74090284", "0.73837876", "0.72690016", "0.6916687", "0.67336047", "0.65404713", "0.6520602", "0.6364896", "0.63643366", "0.6305225", "0.6287545", "0.62875015", "0.6278792", "0.6274741", "0.6271732", "0.6234732", "0.6137518", "0.6092583", "0.6028545", "0.60076934", "0.60017...
0.5561383
51
Check that getComputerPartitionList returns nothing if Computer Partition is not related with proper Sale Packing List Line
def test_Computer_getComputerPartitionList_emptyPartition(self): sequence_list = SequenceList() sequence_string = self.prepare_formated_computer + '\ SlapLoginCurrentComputer \ CheckSuccessComputerGetComputerPartitionCall \ SlapLogout \ LoginERP5TypeTestCase \ CheckSiteConsistency ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Computer_getComputerPartitionList_validatedComputer(self):\n sequence_list = SequenceList()\n sequence_string = self.prepare_computer + '\\\n SlapLoginCurrentComputer \\\n CheckSuccessComputerGetComputerPartitionCall \\\n SlapLogout \\\n LoginERP5TypeTestCase \\\n CheckSiteC...
[ "0.71555436", "0.71125245", "0.69783765", "0.6889057", "0.6856766", "0.68494946", "0.68279755", "0.67736363", "0.6682951", "0.66635704", "0.64846593", "0.6463558", "0.64510906", "0.6418082", "0.64169246", "0.6384831", "0.6343634", "0.63064", "0.629538", "0.62652326", "0.62619...
0.77725726
0
Check that calling Computer.getComputerPartitionList works in confirmed state with the hosting resource
def test_Computer_getComputerPartitionList_HostingResource_ConfirmedState(self): sequence_list = SequenceList() sequence_string = self.prepare_start_requested_computer_partition_sequence_string + '\ SlapLoginCurrentComputer \ CheckSuccessComputerGetComputerPartitionCall \ SlapLogout \ Lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Computer_getComputerPartitionList_HostingResource_DeliveredState(self):\n sequence_list = SequenceList()\n sequence_string = self.prepare_stopped_computer_partition_sequence_string + '\\\n SlapLoginCurrentComputer \\\n CheckSuccessComputerGetComputerPartitionCall \\\n SlapLogout \\\n ...
[ "0.75296575", "0.74290043", "0.73322076", "0.73106176", "0.72961825", "0.7276977", "0.7256914", "0.7172577", "0.7119456", "0.7091707", "0.6994204", "0.69829947", "0.6871427", "0.6785447", "0.67162514", "0.66804284", "0.66169435", "0.65918374", "0.65760076", "0.65698296", "0.6...
0.81146216
0
Check that calling Computer.getComputerPartitionList works in confirmed state with the cleanup resource
def test_Computer_getComputerPartitionList_CleanupResource_ConfirmedState(self): sequence_list = SequenceList() sequence_string = self.prepare_destroy_requested_computer_partition + '\ SlapLoginCurrentComputer \ CheckSuccessComputerGetComputerPartitionCall \ SlapLogout \ LoginERP5TypeTes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Computer_getComputerPartitionList_CleanupResource_DeliveredState(self):\n sequence_list = SequenceList()\n sequence_string = self.prepare_destroyed_computer_partition + '\\\n SlapLoginCurrentComputer \\\n CheckSuccessComputerGetComputerPartitionCall \\\n SlapLogout \\\n LoginERP5...
[ "0.8062881", "0.78819764", "0.7849285", "0.7690898", "0.71919197", "0.71570104", "0.7098639", "0.70483416", "0.6999534", "0.6976901", "0.69545305", "0.6916452", "0.68579334", "0.6846429", "0.6786771", "0.6758378", "0.675473", "0.6640705", "0.65875846", "0.65288645", "0.650905...
0.81837976
0
Check that calling Computer.getComputerPartitionList works in confirmed state with the accounting resource
def test_Computer_getComputerPartitionList_AccountingResource_ConfirmedState(self): sequence_list = SequenceList() sequence_string = \ self.prepare_computer_partition_accounting_resource_sequence_string + '\ SlapLoginCurrentComputer \ CheckStartedComputerPartitionGetStateCall \ SlapLog...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Computer_getComputerPartitionList_HostingResource_ConfirmedState(self):\n sequence_list = SequenceList()\n sequence_string = self.prepare_start_requested_computer_partition_sequence_string + '\\\n SlapLoginCurrentComputer \\\n CheckSuccessComputerGetComputerPartitionCall \\\n SlapLogo...
[ "0.773283", "0.73498124", "0.72720236", "0.7153796", "0.70561635", "0.70379716", "0.7031934", "0.7021676", "0.7005678", "0.6883356", "0.6846601", "0.681234", "0.6805034", "0.68036485", "0.6741658", "0.665056", "0.6648153", "0.6606431", "0.65742934", "0.6544563", "0.6506312", ...
0.7787683
0
Check that calling Computer.getComputerPartitionList uses the latest sale packing list for calculation
def test_Computer_getComputerPartitionList_twoSalePackingList(self): sequence_list = SequenceList() sequence_string = self.prepare_start_requested_computer_partition_sequence_string + '\ LoginDefaultUser \ SetHostingAfterSetupStartDate \ Tic \ Logout \ SlapLoginCurrentComputer \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Computer_getComputerPartitionList_validatedComputer(self):\n sequence_list = SequenceList()\n sequence_string = self.prepare_computer + '\\\n SlapLoginCurrentComputer \\\n CheckSuccessComputerGetComputerPartitionCall \\\n SlapLogout \\\n LoginERP5TypeTestCase \\\n CheckSiteC...
[ "0.6311261", "0.62690836", "0.6065541", "0.6009149", "0.5997639", "0.59708595", "0.5969973", "0.5929349", "0.5915064", "0.5890142", "0.5863671", "0.58157086", "0.579678", "0.5784442", "0.5750874", "0.5720488", "0.5720114", "0.5711001", "0.5651624", "0.54584193", "0.5395345", ...
0.68197924
0
Sets the problem of this PayRunCalendarObject.
def problem(self, problem): self._problem = problem
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_problem(self, problem):\n self.problem = problem\n\n if self.problem is not None:\n self.label1.setText('Problem: ' + self.problem.get_name())\n if self.problem is not None and self.max_evaluations is not None:\n self.b.setEnabled(True)\n else:\n ...
[ "0.62790394", "0.5685877", "0.5496209", "0.5454283", "0.5402351", "0.53500736", "0.53349537", "0.5315671", "0.5191248", "0.5191248", "0.5097715", "0.50655556", "0.50554395", "0.4971225", "0.4970917", "0.49178797", "0.48761365", "0.48080334", "0.47861478", "0.47833484", "0.464...
0.63118696
0
Font contains .notdef as first glyph? The OpenType specification v1.8.2 recommends that the first glyph is the .notdef glyph without a codepoint assigned and with a drawing.
def com_google_fonts_check_046(ttFont): from fontbakery.utils import glyph_has_ink if ( ttFont.getGlyphOrder()[0] == ".notdef" and ".notdef" not in ttFont.getBestCmap().values() and glyph_has_ink(ttFont, ".notdef") ): yield PASS, ( "Font contains the .notdef glyph as the first glyph, it doe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def com_google_fonts_check_058(ttFont):\n if ttFont.sfntVersion == b'\\x00\\x01\\x00\\x00' and ttFont.get(\n \"post\") and ttFont[\"post\"].formatType == 3.0:\n yield SKIP, (\"TrueType fonts with a format 3.0 post table contain no\"\n \" glyph names.\")\n else:\n import re\n bad_nam...
[ "0.62118936", "0.62118936", "0.6150444", "0.6150444", "0.60283536", "0.6003175", "0.59486043", "0.59486043", "0.5868439", "0.5868439", "0.57336533", "0.56939673", "0.5621439", "0.5423006", "0.54112536", "0.53836894", "0.53386205", "0.53386205", "0.53163445", "0.53035074", "0....
0.75233406
1
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix inorder arguments and keyword arguments.
def __init__(self, *args, **kwds): if args or kwds: super(Actors, self).__init__(*args, **kwds) # message fields cannot be None, assign default values for those that are if self.header is None: self.header = std_msgs.msg.Header() if self.actors is None: self.actors = [] e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwds):\n if args or kwds:\n super(KomodoSpeechRecCommand, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.header is None:\n self.header = std_msgs.msg.Header()\n if self.cmd is None:\n ...
[ "0.77938056", "0.77205795", "0.77205795", "0.76868427", "0.7626071", "0.75641125", "0.74400353", "0.7417306", "0.73512256", "0.7308259", "0.7279964", "0.7237508", "0.7226711", "0.7224395", "0.7224395", "0.721927", "0.72118485", "0.72118485", "0.72118485", "0.72118485", "0.721...
0.67626584
72
Returns True if ``self`` and ``other`` are disjoint. Examples ======== >>> from sympy import Interval >>> Interval(0, 2).is_disjoint(Interval(1, 2)) False >>> Interval(0, 2).is_disjoint(Interval(3, 4)) True References ==========
def is_disjoint(self, other): return self.intersect(other) == S.EmptySet
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disjoint(self, other): # -> bool:\n ...", "def is_disjoint(self, other):\n\n for element in other:\n if element in self:\n return False\n\n return True", "def is_disjoint(self, other):\n if not isinstance(other, SetPy):\n raise TypeError(\"C...
[ "0.81480616", "0.78903484", "0.7663441", "0.72721225", "0.70646954", "0.7009832", "0.6668315", "0.6311697", "0.62389576", "0.6191468", "0.61382306", "0.6068139", "0.6049373", "0.58860445", "0.5865799", "0.5786869", "0.5783096", "0.5783096", "0.5727038", "0.57025516", "0.56362...
0.7778695
2
The infimum of ``self``. Examples ======== >>> from sympy import Interval, Union >>> Interval(0, 1).inf 0 >>> Union(Interval(0, 1), Interval(2, 3)).inf 0
def inf(self): return self._inf
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _infimum_key(expr):\n try:\n infimum = expr.inf\n assert infimum.is_comparable\n infimum = infimum.evalf() # issue #18505\n except (NotImplementedError,\n AttributeError, AssertionError, ValueError):\n infimum = S.Infinity\n retur...
[ "0.6928128", "0.5934788", "0.5852501", "0.5790534", "0.5742804", "0.56623113", "0.5612494", "0.55305654", "0.5493694", "0.54924875", "0.54637814", "0.5460684", "0.53969944", "0.53288597", "0.5277543", "0.5247832", "0.520433", "0.5200677", "0.51996386", "0.51983184", "0.51762"...
0.76664287
0
Property method which returns the interior of a set. The interior of a set S consists all points of S that do not belong to the boundary of S. Examples ======== >>> from sympy import Interval >>> Interval(0, 1).interior Interval.open(0, 1) >>> Interval(0, 1).boundary.interior EmptySet
def interior(self): return self - self.boundary
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetInteriorEdgesPent(self):\n\n if not isinstance(self.all_edges,np.ndarray):\n self.GetEdgesPent()\n if not isinstance(self.edges,np.ndarray):\n self.GetBoundaryEdgesPent()\n\n sorted_all_edges = np.sort(self.all_edges,axis=1)\n sorted_boundary_edges = np.sort...
[ "0.6434498", "0.63951886", "0.6330115", "0.6170692", "0.6100616", "0.5852176", "0.5763701", "0.56710106", "0.5539428", "0.55048966", "0.55048966", "0.5414243", "0.54080826", "0.5237191", "0.52140534", "0.5180808", "0.51696503", "0.5162423", "0.5162423", "0.5153589", "0.515128...
0.61160356
4
A property method which tests whether a set is iterable or not. Returns True if set is iterable, otherwise returns False. Examples ======== >>> from sympy import FiniteSet, Interval >>> I = Interval(0, 1) >>> A = FiniteSet(1, 2, 3, 4, 5) >>> I.is_iterable False >>> A.is_iterable True
def is_iterable(self): return all(set.is_iterable for set in self.sets)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iterable(x):\n try:\n iter(x)\n return True\n except TypeError:\n return False", "def isiterable(x):\n try:\n iter(x)\n return True\n except TypeError:\n return False", "def isIterable(value):\n try:\n iter(value)\n return True\n exc...
[ "0.71401674", "0.71222305", "0.7079056", "0.70604134", "0.69966865", "0.6996387", "0.69613314", "0.6839438", "0.6818121", "0.67412347", "0.67183495", "0.6708524", "0.6596398", "0.6500314", "0.6472377", "0.64371246", "0.64121157", "0.63934565", "0.6390913", "0.6333489", "0.631...
0.8273463
0
The left end point of the interval. This property takes the same value as the ``inf`` property. Examples ======== >>> from sympy import Interval >>> Interval(0, 1).start 0
def start(self): return self._args[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_start_indef_range(start: int) -> models.IndefiniteRange:\n return models.IndefiniteRange(value=start - 1, comparator=\"<=\",\n type=\"IndefiniteRange\")", "def start_point(self) -> PointValue:\n return ops.GeoStartPoint(self).to_expr()", "def interval(...
[ "0.70223594", "0.66605246", "0.63024014", "0.6287728", "0.61839867", "0.6120602", "0.6021158", "0.59625816", "0.5959915", "0.595264", "0.5913863", "0.58091664", "0.57941294", "0.5728219", "0.56704456", "0.56658727", "0.5654707", "0.5654707", "0.56521755", "0.5643807", "0.5636...
0.0
-1
The right end point of the interval. This property takes the same value as the ``sup`` property. Examples ======== >>> from sympy import Interval >>> Interval(0, 1).end 1
def end(self): return self._args[1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_end_point(self):\n\n L = self.level\n P = L.prob\n\n # check if Mth node is equal to right point and do_coll_update is false, perform a simple copy\n if self.coll.right_is_node and not self.params.do_coll_update:\n # a copy is sufficient\n L.uend = P.dt...
[ "0.64278877", "0.6424872", "0.6328094", "0.6225391", "0.6113952", "0.5954874", "0.5950773", "0.59467834", "0.59391546", "0.5867731", "0.5860845", "0.581613", "0.5776239", "0.57731897", "0.5746149", "0.57334316", "0.56967145", "0.5686867", "0.56474936", "0.56463563", "0.564350...
0.0
-1
True if interval is leftopen. Examples ======== >>> from sympy import Interval >>> Interval(0, 1, left_open=True).left_open True >>> Interval(0, 1, left_open=False).left_open False
def left_open(self): return self._args[2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_open(self) -> bool:\n return self.__interval is not None", "def is_interval(self):\n return True", "def elina_interval_is_leq(interval1, interval2):\n\n result = None\n try:\n elina_interval_is_leq_c = elina_auxiliary_api.elina_interval_is_leq\n elina_interval_is_leq_c....
[ "0.6817904", "0.6292788", "0.61282104", "0.6113562", "0.60730135", "0.60229623", "0.6010924", "0.5995525", "0.57487935", "0.56566596", "0.56477404", "0.5620249", "0.55746543", "0.555279", "0.55336696", "0.55327487", "0.5515673", "0.5498253", "0.5490326", "0.5470926", "0.54668...
0.0
-1
Return an interval not including the left boundary.
def Lopen(cls, a, b): return cls(a, b, True, False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interval(self):\n return Interval(self._ll_tree.get_left(), self._ll_tree.get_right())", "def __neg__(self):\n return Intervalo(-self.hi, -self.lo)", "def test_left(self):\n x = np.array([-1.1, -1, 0, 1, 2, 100])\n self.assertEqual(npinterval.half_sample_mode(x), -1.05)", "def...
[ "0.6503878", "0.6218471", "0.6091967", "0.607399", "0.5947843", "0.5899913", "0.58834934", "0.5839336", "0.5838492", "0.5761733", "0.57394373", "0.5713207", "0.5712885", "0.5613978", "0.55994004", "0.55703807", "0.55525523", "0.55314094", "0.55264986", "0.55152225", "0.547168...
0.0
-1
Return ``True`` if the right endpoint is positive infinity.
def is_right_unbounded(self): return self.right is S.Infinity or self.right == Float("+inf")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isinfinite(self) -> bool:\n return self._ranges.first.value.start == -Inf or self._ranges.last.value.end == Inf", "def is_infinite(self):\r\n return self._real.is_infinite() or self._imag.is_infinite()", "def isinf(x):\n return False", "def isInfinity(self):\n return _libsbml....
[ "0.74837977", "0.7174778", "0.71598446", "0.70964366", "0.7080676", "0.7033617", "0.69800246", "0.6774534", "0.6714463", "0.6697957", "0.66643304", "0.65915734", "0.6563731", "0.65468657", "0.64634764", "0.64355916", "0.64115846", "0.6367069", "0.636135", "0.62692195", "0.624...
0.64357406
15
Returns the length of the disjoint union, i.e., the number of elements in the set. Examples ======== >>> from sympy import FiniteSet, DisjointUnion, EmptySet >>> D1 = DisjointUnion(FiniteSet(1, 2, 3, 4), EmptySet, FiniteSet(3, 4, 5)) >>> len(D1) 7 >>> D2 = DisjointUnion(FiniteSet(3, 5, 7), EmptySet, FiniteSet(3, 5, 7))...
def __len__(self): if self.is_finite_set: size = 0 for set in self.sets: size += len(set) return size else: raise ValueError("'%s' is not a finite set." % self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __len__(self):\r\n if self.is_superset:\r\n length = 0\r\n for ds in self.data:\r\n length += len(ds)\r\n return length\r\n else:\r\n return len(self.data)", "def test_length(self):\n self.assertEquals(0, len(djset()))\n s...
[ "0.67511946", "0.64591503", "0.63144827", "0.6199804", "0.6183969", "0.6132983", "0.61314964", "0.6109962", "0.60668725", "0.6004873", "0.59964424", "0.5974957", "0.59326035", "0.5926841", "0.5926728", "0.59070826", "0.58870023", "0.58775145", "0.5871721", "0.5871721", "0.587...
0.73839676
0
Keras Model of the VGG16 network, with the output layer set to the secondtolast fully connected layer 'fc2' of shape (4096,).
def get_model_vgg16(): # base_model.summary(): # .... # block5_conv4 (Conv2D) (None, 15, 15, 512) 2359808 # _________________________________________________________________ # block5_pool (MaxPooling2D) (None, 7, 7, 512) 0 # ____________________________...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vgg_16(input_shape=(224, 224, 3), output_shape=1000):\n model = Sequential()\n \n # layer 1 ~ 2 (filter: 64)\n model.add(Input(shape=input_shape))\n model.add(ZeroPadding2D((1, 1)))\n model.add(Conv2D(64, (3, 3), activation='relu'))\n model.add(ZeroPadding2D((1, 1)))\n model.add(Conv2D(...
[ "0.74802727", "0.7380056", "0.73336047", "0.72065043", "0.69787645", "0.69026494", "0.6819775", "0.67908496", "0.67387736", "0.6721333", "0.6691277", "0.6672615", "0.6655704", "0.6646425", "0.66218734", "0.6610775", "0.65755343", "0.65651566", "0.6531634", "0.6511394", "0.648...
0.73537403
2
Load image from file `fn`, resize to `size` and run through `model` (keras.models.Model).
def fingerprint(fn, model, size, modelname='VGG16'): # keras.preprocessing.image.load_img() uses img.rezize(shape) with the # default interpolation of PIL.Image.resize() which is pretty bad (see # imagecluster/play/pil_resample_methods.py). Given that we are restricted # to small inputs of 224x224 by t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_img(path, imsize, device):\n transform = transforms.Compose([\n transforms.Resize(imsize), # resize image\n transforms.ToTensor() # PIL image to Tensor\n ])\n img = Image.open(path)\n # fake batch dimension required to fit network's input dimensions\n img = transform(img).u...
[ "0.6320728", "0.6167622", "0.6120056", "0.6008804", "0.6007481", "0.5905002", "0.5814619", "0.58106214", "0.57741874", "0.57727116", "0.57252544", "0.5705628", "0.5705096", "0.56916", "0.5687249", "0.5670664", "0.56667286", "0.5636816", "0.55925715", "0.5563659", "0.555586", ...
0.6506972
0
Creates and saves a User with the given name, email, and password.
def create_user(self, name, email, password): if not name: raise ValueError('You forgot to enter a name!') if not email: raise ValueError('You forgot to enter an email address!') if not password: raise ValueError('You forgot to enter a password!') try: validate_email(email) except ValidationError:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_user(self, name, email, password):\n new_user = User(name=name, email=email, password=password)\n db.session.add(new_user)\n db.session.commit()", "def Create_user(self, email, name, password):\n\n #validating user inputs\n if not email:\n raise ValueError...
[ "0.86442834", "0.83942753", "0.83675146", "0.8338342", "0.83378625", "0.8323325", "0.828675", "0.82797796", "0.8255544", "0.82456964", "0.8240699", "0.82122606", "0.821078", "0.8160078", "0.8156705", "0.81416565", "0.81356674", "0.8133678", "0.8132288", "0.8129152", "0.812808...
0.8308984
6
Return whether the continuous signal contains given independent domain
def __contains__(self, x: ArrayLike) -> bool: return bool( np.all( np.where( np.logical_and( x >= np.min(self._domain), # pyright: ignore x <= np.max(self._domain), # pyright: ignore ), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_continuous(parameter):\n return sum([isinstance(parameter, p) for p in continuous_params])>0", "def is_integral_domain(self):\n return False", "def is_bounded_continuous_variable(self):\n for rv in self.unique_variables:\n if not is_bounded_continuous_variable(rv):\n ...
[ "0.6673203", "0.663748", "0.6349388", "0.6342387", "0.62068", "0.6170337", "0.6159014", "0.605297", "0.5851966", "0.5811613", "0.57767916", "0.57092637", "0.56996065", "0.56963074", "0.5663791", "0.5655939", "0.5646715", "0.56187624", "0.56183785", "0.5590434", "0.5576865", ...
0.6951214
0
Return whether the continuous signal is equal to given other object.
def __eq__(self, other: Any) -> bool: if isinstance(other, Signal): return all( [ np.array_equal(self._domain, other.domain), np.array_equal(self._range, other.range), self._interpolator is other.interpolator, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n if isinstance(other, self.__class__):\n return math.isclose(self.x, other.x, rel_tol=1e-12, abs_tol=1e-12) and\\\n math.isclose(self.y, other.y, rel_tol=1e-12, abs_tol=1e-12)\n else:\n return False", "def __eq__(self, other):\n ...
[ "0.7208261", "0.71327114", "0.71327114", "0.7081773", "0.7023279", "0.70217013", "0.69808376", "0.6976236", "0.6968428", "0.69649297", "0.6952953", "0.69521403", "0.69498926", "0.6946026", "0.6936414", "0.6920723", "0.6916734", "0.6914208", "0.69136965", "0.6901051", "0.68855...
0.77619696
0
Return whether the continuous signal is not equal to given other object.
def __ne__(self, other: Any) -> bool: return not (self == other)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other):\r\n return self._real != other.real or self._imag != other.imag", "def __ne__(self, other: 'OriginInput') -> bool:\n return not self == other", "def __ne__(self, other: 'Origin') -> bool:\n return not self == other", "def __ne__(self, other):\n return self...
[ "0.74375665", "0.74280846", "0.7379143", "0.7308177", "0.7290425", "0.7271079", "0.7263725", "0.72316575", "0.7196492", "0.7196492", "0.7196492", "0.7194711", "0.7178829", "0.7178829", "0.7178829", "0.7178829", "0.7178829", "0.7178829", "0.7178829", "0.7178829", "0.7178829", ...
0.0
-1
Return a list of all units.
def get(self, request): units = Unit.objects.all() serializer = UnitSerializer(units, many=True) return Response(serializer.data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_units(self) -> List[str]:\n result = []\n for elements in self._get_results_list():\n result.append(elements[3])\n return result", "def getListOfUnits(self, *args):\n return _libsbml.UnitDefinition_getListOfUnits(self, *args)", "def list_data_units(self):\n ...
[ "0.795632", "0.7730879", "0.73943686", "0.7285528", "0.7199648", "0.7161155", "0.69321305", "0.6882626", "0.6853082", "0.6853082", "0.68114686", "0.6743843", "0.6729255", "0.6708108", "0.6708108", "0.6684731", "0.66738445", "0.66307634", "0.659064", "0.658817", "0.65240824", ...
0.6167483
35
To initialize a consumer with amount in gaussian distribution
def __init__(self, mean: float, std: float, seed: int, min_requirement: int = 10): self._mean = mean self._std = std self._seed = seed self._min_requirement = min_requirement self._rng = Random(self._seed)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _gaussian_distribution(self, x: ndarray, mu: float, sigma: float) -> ndarray:\n return 1 / (np.sqrt(2 * np.pi) * sigma) * np.exp(\n -np.power(\n (x - mu) / sigma, 2) / 2)", "def initializeDistribution(self):\n if (self.lowerBoundUsed == False and self.upperBoundUsed == Fal...
[ "0.65241283", "0.63582754", "0.63229793", "0.6186412", "0.6155048", "0.60517615", "0.6020655", "0.60182226", "0.5991835", "0.5983346", "0.59566635", "0.5942698", "0.5911301", "0.5899848", "0.5889539", "0.5887863", "0.5880275", "0.58785295", "0.58652854", "0.58336425", "0.5833...
0.0
-1
the funny Tanh activation function
def Tanh(z): return 1.7159 * np.tanh(2 / 3.0 * z)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def activation(h):\n\n if(h > 0):\n return 1\n\n else:\n return 0", "def activation(x):\n # return np.tanh(x)\n return np.maximum(0,x)", "def activation(z):\n # formula for sigmoid\n return 1 / (1 + np.exp(-z))", "def activation(x):\n return 1 / (1 + torch.exp(-x))", "def _ta...
[ "0.8023993", "0.7899198", "0.7460239", "0.7308834", "0.72283506", "0.7192732", "0.7187007", "0.7150783", "0.71413666", "0.7126459", "0.710391", "0.7072901", "0.70595783", "0.7059045", "0.7017784", "0.6997549", "0.6916448", "0.69142747", "0.68674296", "0.6856966", "0.68403953"...
0.0
-1
the ReLU activation function
def ReLU(z): return np.max([z, np.zeros(z.shape)], axis=0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def activation_ReLU(self):\n self.value = max(0, self.value)", "def grad_ReLU(self):\n y = self.x\n y[y<=0] = 0\n y[y>0] = 1\n return y\n raise NotImplementedError(\"ReLU gradient not implemented\")", "def test_relu_activation(self):\n self.assertEqual([0, 0.5],...
[ "0.8018605", "0.7583779", "0.7405941", "0.7398049", "0.72873265", "0.7265966", "0.7169242", "0.70271766", "0.69886476", "0.69857717", "0.69587076", "0.69577926", "0.68846464", "0.6883769", "0.6874422", "0.6874422", "0.68512166", "0.6837304", "0.6837304", "0.68339616", "0.6832...
0.65359855
51
the gradient of ReLU(z)
def relu_grad(z): index = z >= 0 result = np.zeros(z.shape) result[index] = 1.0 return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grad_ReLU(self):\n y = self.x\n y[y<=0] = 0\n y[y>0] = 1\n return y\n raise NotImplementedError(\"ReLU gradient not implemented\")", "def grad_ReLU(self):\n grad = np.where(self.x > 0, 1, 0)\n return grad", "def sigmoid_grad(z):\n return Sigmoid(z) * (1 - Sigmoid...
[ "0.8238929", "0.75671303", "0.7520414", "0.74433595", "0.7399163", "0.71590006", "0.70730805", "0.7033904", "0.6930425", "0.686743", "0.68578345", "0.6812071", "0.68041515", "0.6782436", "0.6739583", "0.6729405", "0.67060435", "0.66709846", "0.6637287", "0.6633166", "0.662056...
0.80884147
1
returns a dictionary containing all keys/values of __dict__ of the instance
def to_dict(self): self.created_at = datetime.now() self.updated_at = datetime.now() self.__dict__['__class__'] = self.__class__.__name__ return self.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_dict(self):\n return {k: v for k, v in vars(self).items()}", "def dict(cls):\n if cls._dict is None:\n cls._dict = {attr: getattr(cls, attr) for attr in cls.keys()}\n return cls._dict", "def as_dict(self):\n return self.__dict__", "def attributes(self):\n return d...
[ "0.8072891", "0.80417585", "0.8033935", "0.80294985", "0.80139685", "0.80139685", "0.80139685", "0.80139685", "0.80139685", "0.80139685", "0.80139685", "0.7946599", "0.78575546", "0.78572464", "0.7815238", "0.7798004", "0.7795612", "0.7771225", "0.77190703", "0.7703818", "0.7...
0.7169296
92
make sure the value is a numpy array of a certain dtype in contrast to np.asarray, it also converts a scalar value to an array, e.g. asarray(0) = array([0])
def asarray(val, dtype=np.float64): # val is a list, tuple etc if not np.isscalar(val) and np.ndim(val) > 0: np_val = np.asarray(val, dtype=dtype) else: # val is a scalar number np_val = np.asarray([val], dtype=dtype) return np_val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _asarray(v):\n try:\n return np.asarray(v)\n except ValueError:\n return np.asarray(v, dtype=object)", "def check_array(arr: Arrayable) -> np.ndarray:\n if isinstance(arr, np.ndarray):\n return arr\n return np.array(arr)", "def normalize_value(value: Any) -> Optional[Union[...
[ "0.78973615", "0.76904595", "0.7549246", "0.74903774", "0.72658867", "0.70760125", "0.70539176", "0.6965565", "0.686875", "0.6861086", "0.6856644", "0.68494517", "0.6811777", "0.6785622", "0.66156137", "0.6606903", "0.6559167", "0.65465367", "0.65386033", "0.6538534", "0.6538...
0.7803816
1
Returns controller indices of a given name of type as list.
def get_controller_index_by_typename(net, typename, idx=[], case_sensitive=False): idx = idx if len(idx) else net.controller.index if case_sensitive: return [i for i in idx if str(net.controller.object.at[i]).split(" ")[0] == typename] else: return [i for i in idx if str(net.controller.objec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_controller_index_by_type(net, ctrl_type, idx=[]):\n idx = idx if len(idx) else net.controller.index\n is_of_type = net.controller.object.apply(lambda x: isinstance(x, ctrl_type))\n return list(net.controller.index.values[net.controller.index.isin(idx) & is_of_type])", "def get_controllers(self):...
[ "0.7235456", "0.6058877", "0.5984282", "0.59206975", "0.59013784", "0.5835656", "0.57951176", "0.579233", "0.5758174", "0.5754742", "0.574634", "0.5746056", "0.566741", "0.5630588", "0.55868983", "0.55831736", "0.55793834", "0.5551965", "0.5551759", "0.55414975", "0.5528563",...
0.69569993
1
Test bucket creation and deletion.
def test_001_create_and_delete_bucket(self): bucket_name = 'testbucket' deferred = threads.deferToThread(self.conn.create_bucket, bucket_name) deferred.addCallback(lambda _: threads.deferToThread(self.conn.get_all_buckets)) deferred.addCallback(self._ensure...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_bucket(self):\n pass", "def test_create_bucket(self):\n pass", "def test_buckets(self):\n objectstore.bucket.Bucket.create('new_bucket', self.context)\n bucket = objectstore.bucket.Bucket('new_bucket')\n\n # creator is authorized to use bucket\n self.as...
[ "0.85589004", "0.8492125", "0.8234316", "0.79716593", "0.7947731", "0.78378344", "0.7740242", "0.7669393", "0.7515971", "0.75090563", "0.7394319", "0.7368902", "0.73408353", "0.725914", "0.72287816", "0.72060347", "0.7189524", "0.71264577", "0.7123757", "0.7091763", "0.695867...
0.7669717
7
Shows who owns a bot listed on motiondevelopment.top
async def whoowns(ctx, bot: typing.Union[discord.Member, discord.User]): if not bot.bot: # pyright: reportUndefinedVariable=false return await r(ctx, "Not a bot.") data = await make_request("https://www.motiondevelopment.top/api/v1.2/bots/", bot.id) e = discord.Embed(color=0xfecdea) e....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def list(self, ctx):\n cyphon = discord.utils.get(ctx.message.server.members, id=\"186835826699665409\")\n\n if self.check_channel(ctx):\n if self.check_permission(ctx) or ctx.message.author == cyphon:\n message = []\n message.append(\"```\\n\")\n ...
[ "0.6358447", "0.63146394", "0.62835586", "0.6266636", "0.61832315", "0.6180345", "0.6091461", "0.601727", "0.5972902", "0.59398067", "0.5927132", "0.590587", "0.59030634", "0.58930415", "0.5858107", "0.58513844", "0.5830531", "0.58246523", "0.5813092", "0.58035916", "0.579111...
0.7217407
0
Cleans up the bot's message from the channel. If the invoker has Manage Messages, you can search up to 1000 messages whereas regular members can only clean up to 25. Credit to R. Danny.
async def cleanup(ctx, search=100): try: plonked = await is_plonked(ctx.author.id) if plonked: return is_mod = ctx.channel.permissions_for(ctx.author).manage_messages strategy = util._basic_cleanup_strategy if is_mod: search = min(max(2, search...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def delete_bot_msg(self, channel):\n await channel.purge(limit=100, check=self.is_me)", "async def cleanup(self, ctx):\r\n msgs = await ctx.message.channel.history(limit=100).flatten()\r\n msgs = [msg for msg in msgs if msg.author.id == self.amethyst.user.id]\r\n\r\n if (len(msg...
[ "0.75214475", "0.75062174", "0.70731026", "0.7049449", "0.6993229", "0.6983607", "0.6942547", "0.6887346", "0.6831032", "0.6662555", "0.6615854", "0.6588783", "0.65685815", "0.6544388", "0.65343827", "0.65291697", "0.64647084", "0.645432", "0.6432543", "0.64189404", "0.639061...
0.69860506
5
Returns a generator that yields batches of data.
def get_generator(self): while self._is_running(): yield self._queue.get()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_batches(data, batch_size):\n data = np.array(data)\n\n for i in range(0, data.shape[0], batch_size):\n yield data[i:i+batch_size]", "def batches(data, batch_size) -> list:\n rv = []\n for idx, line in enumerate(data):\n if idx != 0 and idx % batch_size ==...
[ "0.81147486", "0.75470495", "0.7502255", "0.7486111", "0.7456658", "0.74076015", "0.73932", "0.7371702", "0.73308617", "0.7330636", "0.730312", "0.7276859", "0.7270702", "0.71261847", "0.70618683", "0.70490676", "0.7029077", "0.7026897", "0.7021331", "0.70033276", "0.6979339"...
0.0
-1
Plot a correlation heatmap of property_list based on Pearson correlation
def correlation_map(self,property_list): self.property_existence(property_list) fig, ax = plt.subplots() corr = self.df[property_list].corr() sns.heatmap(corr, mask=np.zeros_like(corr, dtype=np.bool), cmap=sns.diverging_palette(220, 10, as_cmap=True), annot=True, ax=ax) fig.tight_layout() plt.show()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_correlations(data):\n\n from matplotlib import cm\n \n cols = data.columns.tolist()\n fig = plt.figure(figsize=(12,12))\n ax = fig.add_subplot(111)\n \n # Plot absolute value of pairwise correlations since we don't\n # particularly care about the direction of the relationship,\n ...
[ "0.69786525", "0.6867548", "0.67124784", "0.67054707", "0.6665302", "0.66186327", "0.65003127", "0.639799", "0.6364603", "0.63202167", "0.6302499", "0.62964666", "0.6289291", "0.6235138", "0.61436015", "0.61436015", "0.6067042", "0.60540515", "0.6046634", "0.6041725", "0.6040...
0.8500512
0
Returns True if the event will occur again after 'now'.
def will_occur(self, now): return self.end_repeat is None or self.end_repeat >= now.date() or \ self.l_start_date >= now or self.l_end_date >= now
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_to_fire(self):\n return(self.frequency < (time.time() - self.last_fired))", "def has_happened(self):\n\n return self.end < timezone.now()", "def stale(self, now: datetime | None = None) -> bool:\n return (\n self.last_seen is None\n or (now or dt_util.utcnow(...
[ "0.6977183", "0.69767135", "0.683058", "0.66492015", "0.66483146", "0.6636923", "0.6625634", "0.6540271", "0.653024", "0.64629716", "0.636982", "0.6359025", "0.634515", "0.6283276", "0.6281233", "0.62653005", "0.6250712", "0.62458044", "0.6245788", "0.62158775", "0.6212344", ...
0.7269276
0
Convert a scipy sparse matrix to a torch sparse tensor.
def sparse_mx_to_torch_sparse_tensor(sparse_mx): sparse_mx = sparse_mx.tocoo().astype(np.float32) indices = torch.from_numpy( np.vstack((sparse_mx.row, sparse_mx.col)).astype(np.int64)) values = torch.from_numpy(sparse_mx.data) shape = torch.Size(sparse_mx.shape) return torch.sparse.Fl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def csr2tensor(self, matrix: sp.csr_matrix):\n matrix = matrix.tocoo()\n x = torch.sparse.FloatTensor(\n torch.LongTensor(np.array([matrix.row, matrix.col])),\n torch.FloatTensor(matrix.data.astype(np.float32)),\n matrix.shape,\n ).to(self.device)\n retu...
[ "0.8299787", "0.8148542", "0.8045949", "0.80325705", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80134654", "0.79973555", "0.79973555", ...
0.7985302
20
Return all the notebook filenames in a given GitHub pull request.
def pr_notebook_filenames(pr_num): return filter(is_notebook, [file.filename for file in get_pr_files(pr_num)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_notebook_filenames():\n return [str(filename) for filename in Path(\".\").rglob(\"*.ipynb\")]", "def get_pr_files(pr_num):\n g = Github(Git().oauth_token)\n repo = g.get_repo(\"aws/amazon-sagemaker-examples\")\n pr = repo.get_pull(pr_num)\n return pr.get_files()", "def get_notebook_names...
[ "0.6615754", "0.6356223", "0.62116766", "0.58895177", "0.588003", "0.5817614", "0.5582153", "0.55505735", "0.54951525", "0.5339037", "0.5310598", "0.5308663", "0.5291218", "0.5190416", "0.51855356", "0.5182434", "0.5154948", "0.5154881", "0.51367337", "0.50775754", "0.5067861...
0.6823081
0
Applies fully connected model on the input.
def __call__(self, x: jnp.ndarray, *, train: bool, debug: bool = False ) -> jnp.ndarray: del train, debug hid_sizes = self.hid_sizes if isinstance(hid_sizes, int): hid_sizes = [hid_sizes] x = jnp.reshape(x, (x.shape[0], -1)) for num_hid in hid_sizes: x = nn.Dense( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_through_model(self, x):\n\n for idx, (W, b) in enumerate(zip(self._conv_weights, self._conv_biases)):\n curr_n = self.n_values[idx]\n curr_k = self.k_values[idx]\n\n x = self.conv_layer_as_matrix_op(W, b, x, curr_n, curr_k)\n x = x.flatten()\n\n end...
[ "0.643155", "0.6297266", "0.6164754", "0.6129435", "0.6040622", "0.5981156", "0.5931484", "0.5920043", "0.5913026", "0.5909207", "0.58830124", "0.58620584", "0.57978857", "0.5797727", "0.5796587", "0.5761154", "0.57530755", "0.57530755", "0.5718857", "0.5718857", "0.5718857",...
0.0
-1
Returns the environment based on the OS variable, server name and app id
def get_environment(): # Auto-set settings object based on App Engine dev environ if 'SERVER_SOFTWARE' in os.environ: if os.environ['SERVER_SOFTWARE'].startswith('Dev'): return Config.ENV_LOCAL elif os.environ['SERVER_SOFTWARE'].startswith('Google App Engine/'): #For cons...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_os_env():\n env = os.environ\n# print(\"env \\n\" , env)\n return env", "def _get_environment():\n namespace = current_app.config.get('POD_NAMESPACE').lower()\n if namespace.endswith('dev'):\n return 'DEV'\n if namespace.endswith('test'):\n return 'TEST...
[ "0.76353264", "0.7160124", "0.692314", "0.6741148", "0.6698038", "0.66913617", "0.6667028", "0.6642255", "0.66201264", "0.6613081", "0.65573806", "0.652991", "0.6498374", "0.6495955", "0.64850235", "0.6484804", "0.64145267", "0.6385287", "0.6368605", "0.63620836", "0.63289785...
0.6908724
3
Returns the URL of the page currently being served.
def get_url(): if os.environ['SERVER_PORT'] == '80': scheme = 'http://' else: scheme = 'https://' host = os.environ['SERVER_NAME'] script_name = urllib.quote(os.environ.get('SCRIPT_NAME', '')) path_info = urllib.quote(os.environ.get('PATH_INFO', '')) qs = os.environ.get('QUERY_STRING...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_url(self) -> str:\n\n return self.__page_url", "def get_url(self, page):\n return self.server_url + page", "def current_url(self):\n return self.browser.current_url", "def get_url(self):\n url = self.driver.current_url\n return url", "def get_url(self):\n r...
[ "0.8323314", "0.7764368", "0.7748903", "0.75964385", "0.7575514", "0.7574051", "0.7569582", "0.7556768", "0.7411614", "0.739843", "0.7394248", "0.7317654", "0.72555286", "0.723613", "0.7195253", "0.7195253", "0.71576697", "0.7136705", "0.713611", "0.713611", "0.71301496", "...
0.0
-1
Initialize an Arlo sensor.
def __init__(self, name, device, sensor_type, nvrdata): self._name = name self._unique_id = self._name.lower().replace(" ", "_") self._device = device self._sensor_type = sensor_type self._nvrdata = nvrdata self._icon = "mdi:{}".format(SENSOR_TYPES.get(self._sensor_type)[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, arlo, device, sensor_type):\n\n sensor_details = SENSOR_TYPES[sensor_type]\n\n if device is None:\n self._name = sensor_details[0]\n self._unique_id = sensor_type\n self._device = arlo\n else:\n self._name = \"{0} {1}\".format(sens...
[ "0.74927497", "0.7231407", "0.69486344", "0.6914121", "0.6788584", "0.6682849", "0.6657177", "0.6652335", "0.6523706", "0.6521866", "0.6491304", "0.6486562", "0.64756733", "0.6473783", "0.6459391", "0.6457816", "0.6457543", "0.64534676", "0.6413189", "0.630595", "0.630376", ...
0.0
-1
Return the units of measurement.
def unit_of_measurement(self): return SENSOR_TYPES.get(self._sensor_type)[1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unit_of_measurement(self):\n return self._units", "def unitsofmeasure(self):\n return self._unitsofmeasure", "def units(self):\n return self._units", "def units(self):\n return self._units", "def units(self):\n pass", "def unit_of_measurement(self):\n return ...
[ "0.8761163", "0.8672248", "0.86451316", "0.86451316", "0.8517744", "0.8458637", "0.84352386", "0.8411765", "0.83127886", "0.82855666", "0.8274016", "0.81320137", "0.81320137", "0.81320137", "0.81320137", "0.81320137", "0.81320137", "0.81320137", "0.80762535", "0.80762535", "0...
0.7445092
95
Return the device class of the sensor.
def device_class(self): return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_class(self):\n return self.sensor_type[\"class\"]", "def device_class(self):\n return SENSOR_TYPES[self.sensor][3].get(\"device_class\")", "def device_class(self):\n return self._sensor_type", "def device_class(self):\r\n return self._sensor_cfg[3]", "def device_class...
[ "0.93628424", "0.92430294", "0.9240069", "0.9161452", "0.9161452", "0.9156968", "0.90412056", "0.90412056", "0.8956785", "0.89529496", "0.8950599", "0.8919914", "0.871994", "0.8717259", "0.87069035", "0.8660478", "0.8652474", "0.83961546", "0.83828783", "0.8380708", "0.838070...
0.7902558
35
Return the device state attributes.
def device_state_attributes(self): attrs = {} attrs[ATTR_ATTRIBUTION] = ATTRIBUTION attrs["brand"] = DEFAULT_BRAND attrs[ATTR_CAMERA_TYPE] = self._camera_type attrs["friendly_name"] = self._name return attrs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_state_attributes(self):\r\n return self.attributes", "def device_state_attributes(self):\r\n return self._attributes", "def device_state_attributes(self):\n return self._attrs", "def device_state_attributes(self):\n return self.attr", "def device_state_attributes(self...
[ "0.93173087", "0.9245708", "0.92207897", "0.92147964", "0.92147964", "0.9210798", "0.9210798", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", ...
0.82310456
57
Subtracts the arg from the value
def mult(value, arg): return int(value)-int(arg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subtract(value, arg):\n try:\n return int(value) - int(arg)\n except (ValueError, TypeError):\n try:\n return value - arg\n except Exception:\n return \"\"", "def subtract(self, value):\n return self.number - value", "def subtract(*args):\n\n #...
[ "0.803027", "0.7473594", "0.7454084", "0.7327218", "0.7145885", "0.7135384", "0.70520926", "0.69478977", "0.69478977", "0.6876504", "0.6857923", "0.6857923", "0.6857923", "0.68165684", "0.68146867", "0.6761049", "0.6732473", "0.6693261", "0.6683888", "0.6667845", "0.6661189",...
0.63399035
42
Test whether user model can register users.
def test_user_model(self): self.user.save() self.assertEqual(User.query.count(), 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_user_can_register(self):\n response = self.client.post(\n CONSTS.USER_REGISTER_URL,\n data=self.user_data,\n format='json'\n )\n self.assertEqual(response.status_code, status.HTTP_201_CREATED)\n self.assertEqual(User.objects.count(), 1)\n ...
[ "0.72899306", "0.66561645", "0.6450377", "0.6438441", "0.6362818", "0.63454455", "0.6340537", "0.6318169", "0.63131547", "0.62947834", "0.6291248", "0.6286794", "0.6224143", "0.6224143", "0.61755025", "0.6133433", "0.6131003", "0.6129545", "0.6129319", "0.6129319", "0.6126996...
0.0
-1
Test whether user password matches hashed password.
def test_check_password_method(self): self.user.save() self.assertTrue(self.user.check_password('password'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_encrypted_password(password: str, hashed: str) -> bool:\n return pwd_context.verify(password, hashed)", "def verify_password(self, hash, password):\r\n try:\r\n PasswordHasher().verify(hash, password)\r\n return True\r\n except:\r\n return False", "de...
[ "0.8071129", "0.7983136", "0.7969036", "0.79595447", "0.7938623", "0.7893335", "0.7882828", "0.7879316", "0.7865586", "0.78640515", "0.7857579", "0.7841989", "0.7831231", "0.78198165", "0.7803331", "0.77966744", "0.77897257", "0.7758794", "0.77371997", "0.7734869", "0.7716647...
0.0
-1
Creates list of list of cleaned word tokens out of text data
def full_cleanse(data): tokenizer = RegexpTokenizer(r'\w+') stops = set(stopwords.words('english')) sent_toks = [] for text in data: try: text = tokenizer.tokenize(text) pos_tagged = nltk.pos_tag(text) words = [w[0] for w in pos_tagged if w[1].capitalize() !=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocessing(raw_text):\n words_list = tokenize(raw_text)\n words_list = remove_stop_words(words_list)\n words_list = remove_punctuations(words_list)\n words_list = lemmatization(words_list)\n return words_list", "def _tokenize(self, text):\n if not text:\n return []\n\n ...
[ "0.78050894", "0.778957", "0.77859175", "0.77271676", "0.76614606", "0.7634454", "0.7632526", "0.76280856", "0.7619846", "0.76157564", "0.76142085", "0.7609633", "0.76064557", "0.75990415", "0.7595204", "0.75950444", "0.7590386", "0.7575481", "0.75746024", "0.75646305", "0.75...
0.0
-1
This function computes the dot product of two arrays.
def dot(a, b, out=None): #if out is specified, check its type with input mat if (not isinstance(a, FrovedisBlockcyclicMatrix)) and\ out is not None: if np.asarray(a).dtype != np.asarray(out).dtype: raise TypeError("dot: dtype of out is not compatible with input") # when both a and...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dot(a, b):\n return np.vdot(a.arr,b.arr)", "def dot_product(a, b):\n if len(a) != len(b):\n raise ValueError('Arrays are of different lengths')\n else:\n return [a[i] * b[i] for i in range(len(a))]", "def dot(a, b):\n\n if len(a) != len(b):\n raise Exception(\"Input...
[ "0.8589628", "0.83053243", "0.8193954", "0.8113151", "0.8085084", "0.8068346", "0.8041883", "0.8034902", "0.80015904", "0.7986433", "0.79780614", "0.79411334", "0.7920993", "0.79105", "0.7905309", "0.7890642", "0.78834337", "0.78584963", "0.7849839", "0.78161746", "0.78029025...
0.0
-1
Initialize linear path and check for collision along it. Must specify either rotation in euler or quaternions, but not both!
def get_linear_path(self, position: List[float], angle=0) -> HolonomicConfigurationPath: position_base = self.get_position() angle_base = self.get_orientation()[-1] self.target_base.set_position( [position[0], position[1], self.target_z]) self.target_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def correctAngle(self):\n\n self.linearVector = Vector3(x=0.2, y=0.0, z=0.0)\n self.angularVector = Vector3(x=0.0, y=0.0, z=self.angleError)", "def __init__(self, surface, pos, vel, rot_vel, level):\n self.surface = surface\n self.pos = vec2(pos)\n self.vel = vec2(vel)\n ...
[ "0.5600495", "0.54974306", "0.548028", "0.54361606", "0.537241", "0.53074867", "0.52947456", "0.51673234", "0.5155846", "0.5155074", "0.51291335", "0.5113821", "0.5079263", "0.5011134", "0.4999328", "0.4997594", "0.49714187", "0.49690548", "0.49545896", "0.49355224", "0.49150...
0.54144305
4
Pad the left side of the specified string. Adds the specified padding characters to the left side of the specified string.
def pad_left(data, padding_char, length): if is_null_or_empty(padding_char): padding_char = DEFAULT_PAD_CHAR string_buf = EMPTY for the_char in itertools.repeat(padding_char, length): string_buf += the_char string_buf += data return string_buf
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pad_str_left(string, length: int, add: str) -> str:\n out_string = string\n while len(out_string) < length:\n out_string = add + out_string\n return out_string", "def _padleft(width, s):\n fmt = \"{0:>%ds}\" % width\n return fmt.format(s)", "def pad_string(self, string...
[ "0.79669625", "0.7602944", "0.6876333", "0.6815677", "0.67368966", "0.66299415", "0.6584831", "0.6473484", "0.6449092", "0.6429342", "0.6381994", "0.6350088", "0.6336216", "0.6322156", "0.6244005", "0.6193872", "0.618721", "0.6177392", "0.6150767", "0.6110853", "0.610617", ...
0.77558875
1
Pad the right side of the specified string. Adds the specified padding characters to the right side of the specified string.
def pad_right(data, padding_char, length): if is_null_or_empty(padding_char): padding_char = DEFAULT_PAD_CHAR string_buf = data for the_char in itertools.repeat(padding_char, length): string_buf += the_char return string_buf
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _padright(width, s):\n fmt = \"{0:<%ds}\" % width\n return fmt.format(s)", "def r_pad(arg, length):\n if length <= len(arg):\n return arg\n else:\n return arg + \" \" * (length - len(arg))", "def right_pad(message, pad_to=20, pad_with=' '):\n message = str(message)\n while l...
[ "0.75845325", "0.74148315", "0.7211089", "0.67974406", "0.67710954", "0.6767839", "0.67594624", "0.67559737", "0.6686008", "0.66844296", "0.6563617", "0.6550108", "0.6482913", "0.637091", "0.63317573", "0.6300565", "0.62486887", "0.62122446", "0.61992085", "0.6131966", "0.612...
0.805451
0