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
Utility function to generate a randomized 32character utf8 string.
def generateRandomString(): return ''.join(b64encode(urandom(32)).decode('utf-8'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_random_string():\n return \"\".join(random.choice(string.ascii_lowercase + string.digits) for _ in range(16)) # nosec", "def unique_str():\n return hex(random.randint(0, 256 * 256 * 256 * 256 - 1))[2:]", "def _rand_str(size=16):\n return \"\".join(random.SystemRandom().choices(string.asc...
[ "0.80023235", "0.7574162", "0.7462413", "0.7459368", "0.7423628", "0.73884416", "0.73762", "0.73687685", "0.73519164", "0.7270867", "0.7266105", "0.7253016", "0.7234479", "0.7217285", "0.71469647", "0.71222097", "0.7103025", "0.7077789", "0.7076362", "0.70763403", "0.7074905"...
0.7915006
1
Registers and returns the uid of the remote object if the unique id handler tool is available.
def _getUidByUrl(self): # check for unique id handler tool if not PRODUCTS_CMFUID_INSTALLED: return uidtool = queryUtility(IUniqueIdHandler) if uidtool is None: return obj = getUtility(ISiteRoot).restrictedTraverse(self.remote_url) return uidtool....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getmyuid():\n raise NotImplementedError()", "def obj_to_uid(obj):\n object_ser = pickle.dumps(obj)\n serialised_b64 = base64.encodebytes(object_ser)\n unique_id = serialised_b64.decode()\n return unique_id", "def known_uid():\n return '48ee71d9-20f0-41fc-a99f-c518121a880e'", "def uid (s...
[ "0.62769085", "0.5979896", "0.59322", "0.5852313", "0.5846881", "0.58400476", "0.58395666", "0.577882", "0.57760674", "0.57760674", "0.57760674", "0.57567644", "0.5742425", "0.5742425", "0.57292646", "0.5717885", "0.57044554", "0.5673191", "0.56694037", "0.5669335", "0.562118...
0.71938664
0
Registers and returns the uid of the remote object if the unique id handler tool is available.
def _getObjectByUid(self): # check for unique id handler tool if not PRODUCTS_CMFUID_INSTALLED: return uidtool = queryUtility(IUniqueIdHandler) if uidtool is None: return # check for remote uid info on object uid = getattr(aq_base(self), 'remote_u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getUidByUrl(self):\n # check for unique id handler tool\n if not PRODUCTS_CMFUID_INSTALLED:\n return\n uidtool = queryUtility(IUniqueIdHandler)\n if uidtool is None:\n return\n\n obj = getUtility(ISiteRoot).restrictedTraverse(self.remote_url)\n r...
[ "0.7191048", "0.6274347", "0.59789914", "0.59292203", "0.58489907", "0.5848554", "0.58400077", "0.5836984", "0.57775366", "0.57733786", "0.57733786", "0.57733786", "0.57529795", "0.5742371", "0.5742371", "0.5729427", "0.5714595", "0.57022285", "0.5670433", "0.56701034", "0.56...
0.5477824
33
Check the pointing against the source position.
def check_pointing(kd): # from .kiss_pointing_model import KISSPmodel kd._KissRawData__check_attributes(["F_sky_Az", "F_sky_El", "F_tl_Az", "F_tl_El", "A_hours", "A_time_pps"]) fig_pointing, ax = plt.subplots() mask = kd.telescope_position.mask ax.plot(kd.F_sky_Az[~mask], kd.F_sky_El[~mask], label...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def does_it_point_to(self, dest):\n return dest in self.points_to", "def pos_updated(self,next_pos):\n #if (int(self.oldx) == int(self.x) and int(self.oldy) == int(self.y)):\n if (int(next_pos[0]) == int(self.x) and int(next_pos[1]) == int(self.y)):\n return False\n else:\n...
[ "0.69126195", "0.65514904", "0.63591015", "0.63506365", "0.6247437", "0.62231284", "0.61984205", "0.61874676", "0.6182153", "0.617781", "0.6154955", "0.6142628", "0.6111239", "0.6092104", "0.60230815", "0.5988403", "0.59797394", "0.59700984", "0.59530574", "0.5951796", "0.594...
0.0
-1
Attempt to get the active settings, and if the secret key is set to the default one, then create a new randomized secret key.
def check_secret_key(cls): logger.info("attempting to check the secret key...") try: s = cls.objects.filter(is_active=True).first() if s and s.secret_key == "not-a-very-good-secret": chars = "abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)" s.se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_secret(setting, secrets=secrets):\n return secrets[setting]", "def get_shared_secret(self):\n shared_secret = self.charm_config.get(\"shared-secret\")\n saved_shared_secret = self.kv.get(\"shared-secret\")\n if not shared_secret:\n if saved_shared_secret:\n ...
[ "0.63599825", "0.63512933", "0.6262027", "0.60579515", "0.6037721", "0.59737897", "0.59392446", "0.58960783", "0.5894387", "0.58593845", "0.58050233", "0.5741639", "0.571343", "0.569318", "0.56584144", "0.5619214", "0.55711234", "0.55609787", "0.5546059", "0.5539475", "0.5535...
0.59137094
7
Returns a new query that yields only the distinct attribute dictionaries.
def distinct(self): return DistinctQuery(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_attributes(dataset):\n return dataset.flatMap(lambda x: x.keys()).distinct().collect()", "def distinct(self):\n qs = copy(self)\n qs._distinct = True\n return qs", "def get_all_attrs():\n cursor = Biometa.objects.aggregate(*[\n {'$unwind': '$sample_attributes'},\n ...
[ "0.67824453", "0.67707354", "0.6306246", "0.61149323", "0.6015974", "0.5910721", "0.58561134", "0.57884216", "0.5784151", "0.5730671", "0.5698376", "0.56848973", "0.56417584", "0.5631722", "0.5612098", "0.56015056", "0.55975586", "0.55945975", "0.55112934", "0.5509146", "0.54...
0.7042583
0
Returns an int64_list from a bool / enum / int / uint.
def int64_feature(self, value): return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _BoolsToInts(arg_list):\n result = []\n for arg in arg_list:\n if isinstance(arg, (list, tuple)):\n result.append(_BoolsToInts(arg))\n elif arg is True:\n result.append(1)\n elif arg is False:\n result.append(0)\n else:\n result.append(arg)\n\n return result", "def convertT...
[ "0.6879461", "0.6594319", "0.64610714", "0.64480275", "0.6365076", "0.6292767", "0.6272", "0.621682", "0.6104883", "0.5952729", "0.5947156", "0.5901963", "0.58641315", "0.58641315", "0.58546174", "0.584493", "0.5844073", "0.5830585", "0.58009046", "0.57939154", "0.57939154", ...
0.52802974
82
Close the connection to the database, if any.
def close_connection_if_open(): try: conn = flask.g._database_connection except AttributeError: pass else: conn.close() del flask.g._database_connection
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_db_connection(cls):\n db.close()", "def close_database(self):\n if self._conn is not None:\n self._conn.close()\n self._conn = None", "def close(self):\n if self._dbopen:\n self._dbcon.close()", "def close(self):\n if self._conn is not No...
[ "0.8760214", "0.87304854", "0.8431955", "0.8383244", "0.8368992", "0.83112925", "0.8225679", "0.81829965", "0.8134925", "0.8134925", "0.8134925", "0.8117622", "0.8092849", "0.80540955", "0.80275327", "0.8022037", "0.80208796", "0.8018865", "0.80137193", "0.7995095", "0.798887...
0.77389264
31
This function use the zip function to help us generate ngrams Concatentate the tokens into ngrams and return
def n_gram(list, n): ngrams = zip(*[list[i:] for i in range(n)]) return [" ".join(ngram) for ngram in ngrams]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def n_grams(tokens, n):\n return zip(*[tokens[i:] for i in range(n)])", "def build_ngrams(tokens, n=2):\n ngrams = zip(*(islice(group, idx, None) for idx, group in enumerate(tee(tokens, n))))\n return ngrams", "def n_grams(tokens, n=1):\n shiftToken = lambda i: (el for j,el in enumerate(tokens) if ...
[ "0.7617477", "0.7470776", "0.732712", "0.73225147", "0.7279611", "0.708159", "0.68269104", "0.67832613", "0.67683333", "0.67411864", "0.6663142", "0.65951955", "0.6589546", "0.65855277", "0.65522957", "0.654571", "0.64943606", "0.6478387", "0.6469586", "0.6466792", "0.6458041...
0.66344905
11
Initialize the flatten weights.
def _initialize_weights(self): stddev = 1.0 / math.sqrt(self._hidden_size) for layer_id, param_id in itertools.product( range(self._num_layers * (self._bidirectional + 1)), range(self._num_gates * 2)): i = layer_id * 2 + (param_id // self._num_gates) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _initialize_weights(self):\n pass", "def init_weights(self):\n # Initialize weights\n self.apply(self._init_weights)", "def init_weights(self):\n # Initialize weights\n self.apply(self._init_weights)\n # Tie weights if needed\n self.tie_weights()", "def in...
[ "0.7941322", "0.78777975", "0.7717487", "0.7603258", "0.7462157", "0.73472494", "0.7302802", "0.7219489", "0.71978956", "0.71978956", "0.71978956", "0.7176673", "0.7166932", "0.7156281", "0.71415526", "0.71013314", "0.71013314", "0.7100617", "0.70538676", "0.70474875", "0.703...
0.6712236
47
Residual unit with 2 sub layers.
def residual_block(self, x, stride, out_filter, activate_before_residual=False, padding_in='SAME'): with tf.name_scope("res_block" + str(self._count_conv)): in_filter = x.get_shape().as_list()[-1] if activate_before_residual: with tf.variable_scope('shared_activation'): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _residual(self, x):\n h = x\n h = self.c1(h)\n h = self.activation(h)\n h = self.c2(h)\n h = F.avg_pool2d(h, 2)\n\n return h", "def _compute_residuals(self):\n residuls = self.I - self.E\n return residuls", "def _residual(self, x):\n h = x\n ...
[ "0.69269395", "0.68226415", "0.6805156", "0.67525655", "0.66495687", "0.66160816", "0.6558935", "0.6499019", "0.6450447", "0.6404291", "0.6357325", "0.6352921", "0.6268192", "0.62466097", "0.6241244", "0.6229056", "0.6212663", "0.62063855", "0.6204324", "0.6197958", "0.618711...
0.5485063
65
Fit in a list of docs, which had been preprocessed and tokenized, such as word bigrammed, stopwords removed, lemmatized, part of speech filtered. Then build up a tfidf model to compute each word's idf as its weight. Noted that tf weight is already involved when constructing average word vectors, and thus omitted.
def fit(self, docs): # comply with scikit-learn transformer requirement text_docs = [] for doc in docs: text_docs.append(" ".join(doc)) tfidf = TfidfVectorizer() tfidf.fit(text_docs) # must be list of text string # if a word was never seen - it must be at least a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fit(self, corpus):\n tf = []\n df = {}\n idf = {}\n doc_len = []\n corpus_size = 0\n for document in corpus:\n corpus_size += 1\n doc_len.append(len(document))\n\n # compute tf (term frequency) per document\n frequencies = {}...
[ "0.7904618", "0.7772725", "0.7692799", "0.75526816", "0.7194879", "0.7053158", "0.7036455", "0.7004341", "0.6995653", "0.69807214", "0.6978545", "0.69410586", "0.6919294", "0.69020516", "0.6891554", "0.6888705", "0.687837", "0.6797447", "0.67321277", "0.6706456", "0.6686631",...
0.83235234
0
NotFound view for AJAX requests.
def xhr_not_found_view(request): return HTTPNotFound()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def not_found(request):\n return Response(render_template('core/not_found.html'), status=404,\n mimetype='text/html')", "def not_found(self, request):\n return 'Not found'", "def view(obj, request):\n return HTTPNotFound()", "def page_not_found(e):\n\n # Respons to api requ...
[ "0.7871394", "0.764238", "0.751863", "0.74829817", "0.73646843", "0.7303901", "0.72378373", "0.72013605", "0.71907485", "0.7190473", "0.7181101", "0.7181101", "0.7169116", "0.7166708", "0.71491206", "0.7127023", "0.7127023", "0.7121635", "0.7107662", "0.7106705", "0.7076301",...
0.8406488
0
A projection function that prevents v from leaving the tangent space of origin point.
def proj_tan0(self, v, c): return v
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_projection_from_vector(v, w):\n \"\"\"projects v onto w and subtracts the result from v\"\"\"\n return vector_subtract(v, project(v, w))", "def remove_projection_from_vector(v, w):\n return vector_subtract(v, project(v, w))", "def project_vector(u, v):\n u_np = np.array([u.get_x(), u.get...
[ "0.7001486", "0.69354916", "0.6844989", "0.6765347", "0.65733564", "0.64623946", "0.6253514", "0.62395644", "0.61570174", "0.6141985", "0.6106418", "0.6030135", "0.5990714", "0.5935048", "0.59034806", "0.5896629", "0.5865526", "0.58323604", "0.57923144", "0.5788979", "0.57770...
0.66658735
4
Map a point v in the tangent space of point x to the manifold.
def expmap(self, v, x, c): c = self.truncate_c(c) v_norm = self.clip(tf.norm(v, ord=2, axis=-1, keepdims=True)) second_term = TanC(self._lambda_x(x, c) * v_norm / 2.0, c) * v / v_norm gamma = self._mobius_add(x, second_term, c) return gamma
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_tangent(self, vector, base_point):\n tangent_vec = self._iterate_over_factors(\n \"to_tangent\", {\"base_point\": base_point, \"vector\": vector}\n )\n return tangent_vec", "def to_tangent(self, vector, base_point):\n return gs.copy(vector)", "def tangent(self, p):...
[ "0.6683835", "0.6682886", "0.62691945", "0.61532944", "0.5733489", "0.56882346", "0.5663054", "0.56587976", "0.5624867", "0.55921465", "0.5552671", "0.55490094", "0.5543394", "0.55260605", "0.55126894", "0.55105543", "0.5477381", "0.54402906", "0.54244506", "0.5423567", "0.54...
0.0
-1
Map a point v in the tangent space of origin point to the manifold.
def expmap0(self, v, c): c = self.truncate_c(c) v_norm = self.clip(tf.norm(v, ord=2, axis=-1, keepdims=True)) gamma = TanC(v_norm, c) * v / v_norm return gamma
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_tangent(self, vector, base_point):\n return gs.copy(vector)", "def to_tangent(self, vector, base_point):\n tangent_vec = self._iterate_over_factors(\n \"to_tangent\", {\"base_point\": base_point, \"vector\": vector}\n )\n return tangent_vec", "def tangent(self, uv)...
[ "0.69912463", "0.6648027", "0.6488708", "0.6461468", "0.6040514", "0.58583313", "0.58238995", "0.5806593", "0.5787152", "0.5780274", "0.5764578", "0.56691307", "0.5668222", "0.56607324", "0.5622549", "0.55428267", "0.55381554", "0.55353755", "0.55147034", "0.54706776", "0.546...
0.0
-1
Calculate the squared geodesic/distance between x and y.
def sqdist(self, x, y, c): c = self.truncate_c(c) dist = 2.0 * ArTanC(tf.norm(self._mobius_add(-x, y, c), ord=2, axis=-1), c) return dist ** 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def euclidean_distance(x, y):\n x1, y1 = x\n x2, y2 = y\n return sqrt((x1 - x2)**2 + (y1 - y2)**2)", "def dist_squared(x_0, y_0, x_1, y_1):\n\n return (x_0 - x_1)**2 + (y_0 - y_1)**2", "def calculate_distance(x: float, y: float) -> float:\n # return geopy.distance.vincenty(x, y).km\n R = 6370...
[ "0.74443054", "0.74331427", "0.73301697", "0.73246294", "0.7316416", "0.7265986", "0.7152516", "0.7137806", "0.71336013", "0.70969284", "0.706704", "0.7054395", "0.7042865", "0.7036934", "0.70260185", "0.6989291", "0.6914842", "0.68972737", "0.6841928", "0.6790297", "0.679002...
0.6377332
63
Computes the inner product of a pair of tangent vectors v1 and v2 at x.
def inner(self, v1, v2, x, c, keep_shape=False): c = self.truncate_c(c) metric = tf.square(self._lambda_x(x, c)) product = v1 * metric * v2 res = tf.reduce_sum(product, axis=-1, keepdims=True) if keep_shape: # return tf.broadcast_to(res, x.shape) last_dim ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inner_product(self, tangent_vec_a, tangent_vec_b, base_point):\n inner_prod_mat = self.metric_matrix(base_point)\n aux = gs.einsum(\"...j,...jk->...k\", gs.conj(tangent_vec_a), inner_prod_mat)\n return gs.dot(aux, tangent_vec_b)", "def inner_product(self, tangent_vec_a, tangent_vec_b, ba...
[ "0.7748647", "0.762943", "0.7555474", "0.7322697", "0.72441715", "0.7190461", "0.71592337", "0.7074783", "0.7048657", "0.7000617", "0.69488657", "0.68887407", "0.6804445", "0.6766873", "0.6757232", "0.6742054", "0.6733878", "0.67058504", "0.67023575", "0.66927606", "0.6686110...
0.0
-1
Wrap input tensor with dense layer.
def dense(self, input_tensor, units, name, activation='linear'): with tf.variable_scope('Dense', name): init_w = tf.truncated_normal(shape=(self.num_channels(input_tensor), units), dtype=tf.float32) w = tf.Variable(init_w) b = t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_dense_layer(self, input_tensor, output_size, activation_fn=None,\n name = None):\n return tf.layers.dense(input_tensor, output_size, activation=activation_fn,\n kernel_initializer=tf.contrib.layers.variance_scaling_initializer(),\n ...
[ "0.7356222", "0.72055626", "0.7106055", "0.68207663", "0.6740901", "0.67191607", "0.66882", "0.65716493", "0.6551061", "0.6548716", "0.6509733", "0.6466875", "0.64548945", "0.6364962", "0.63022614", "0.62926656", "0.6285683", "0.6270025", "0.62462944", "0.61212045", "0.611104...
0.70813286
3
Return a string representation of the ship.
def __repr__(self): dir_str = sh.direction_repr_str(Direction, self.direction()) info = (self.coordinates(), self._hit_coors, dir_str, self._bs) return str(info)
{ "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 __repr__(self):\r\n rep_tpl = (self.__board_size, self.__bombs_dict, ...
[ "0.73737925", "0.70997673", "0.68632567", "0.6834909", "0.68081784", "0.6782454", "0.6778136", "0.675137", "0.6748032", "0.66801757", "0.6675872", "0.6668439", "0.6664023", "0.66346645", "0.66346437", "0.6624499", "0.66211826", "0.6609688", "0.6591927", "0.65690786", "0.65561...
0.63988644
36
Returns a bool indicating whether the Operation can now be preformed.
def is_ready(self): for dependency in self.dependencies: if not dependency.is_finished: return False # If all dependencies are finished we're ready. return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_make_action(self) -> bool:\n return not(self.has_pending_action or self.is_dead())", "def is_on(self):\n if self.is_update_locked():\n return self.graceful_state\n if self._state['action'] == 1 and self._state['state'] == 2:\n return True\n return False",...
[ "0.67482376", "0.63803893", "0.6326173", "0.6326173", "0.6326173", "0.6325747", "0.63041985", "0.63041985", "0.6295889", "0.6253177", "0.6251356", "0.6239816", "0.6217125", "0.6211083", "0.6180027", "0.6149411", "0.6107223", "0.6100739", "0.60905635", "0.6083158", "0.6080134"...
0.0
-1
Convert local datetime to UTC string Converts datetime.datetime or pandas.Timestamp in local time to to UTC string for constructing HTTP request
def _get_UTC_string( self, dt: datetime, local_tz: str = "America/Los_Angeles", fmt: str = "%Y%m%dT%H:%M-0000", ) -> str: tz_ = pytz.timezone(local_tz) return tz_.localize(dt).astimezone(pytz.UTC).strftime(fmt)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def local_datetime_to_str(dt):\n if not dt:\n return \"\"\n return local_datetime(dt).strftime('%Y-%m-%d %H:%M:%S')", "def local_to_utc(local_dt: datetime) -> datetime:\n if local_dt is None:\n return None\n utc_dt = local_dt.astimezone(tz.UTC)\n return utc_dt", "def localize_utc(v...
[ "0.6612694", "0.64998025", "0.6472217", "0.6450555", "0.64482915", "0.64409757", "0.6429818", "0.63801944", "0.63655984", "0.63655984", "0.63655984", "0.6355556", "0.63419676", "0.6313661", "0.6295784", "0.62804246", "0.62704813", "0.6189889", "0.61815065", "0.6133904", "0.60...
0.7121373
0
Get LMPs for entire month Helper method to get LMPs for a complete month
def get_month_lmps(self, year: int, month: int) -> pd.DataFrame: start: datetime = datetime(year, month, 1) end: datetime = start + relativedelta(months=1) return self.get_lmps(start, end)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_months(self, cr, uid, context):\n months=[(str(n),str(n)) for n in range(1,13)]\n return months", "def get_months(path):\n now = datetime.now()\n retval = []\n month_iterator = get_start_date(path)\n while not (month_iterator.year == now.year and month_iterator.month == now.month...
[ "0.6209428", "0.6080575", "0.6045852", "0.59484684", "0.59302306", "0.5910353", "0.57609594", "0.5729147", "0.5719108", "0.5713476", "0.5690234", "0.56821966", "0.5656257", "0.5652362", "0.5623577", "0.5599742", "0.55872065", "0.5582436", "0.55738115", "0.55525035", "0.554169...
0.7645053
0
Display a list of images with matplotlib and save them afterwards.
def show_images(images, save=None, size=None): assert len(images) > 0, "images should contain at least 1 element" assert len(images[0].shape) == 3, "each image should contain 3 elements (c, w,h)" fig, ax = plt.subplots(nrows=images[0].shape[0], ncols=len(images)) for i in range(len(images)): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plotImages(image_list, name_list, path, as_grey, toSave=False):\n\n\tfig = plt.figure()\n\timageCoordinate = 100 + 10*len(image_list) + 1\n\ti = 0\n\n\tfor image in image_list:\n\t\tfig.add_subplot(imageCoordinate)\n\t\tplt.title(name_list[i])\n\t\tplt.axis('off')\n\t\tplt.imshow(image)\n\t\tif as_grey:\n\t\t\...
[ "0.77899086", "0.75809216", "0.7401679", "0.7293872", "0.7033605", "0.70169836", "0.69532794", "0.69323045", "0.69220823", "0.6897566", "0.68829554", "0.68750685", "0.68699867", "0.6850714", "0.6845518", "0.6820569", "0.6775413", "0.6775413", "0.6775413", "0.67529017", "0.673...
0.7024418
5
This policy points the camera to the offset in the target frame
def __init__(self, env, frame_id, offset): self.env = env if not isinstance(self.env, Pr2Env): raise ValueError("env should be of type Pr2Env but instead it is of type %s" % type(self.env)) self.frame_id = frame_id self.offset = offset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_camera(self):\n pose = deepcopy(self.data['poses']['marker']) # PoseStamped()\n eye_pose = deepcopy(pose)\n eye_pose.pose.position.x += 0.60\n eye_pose.pose.position.z += 0.20\n focus_pose = PoseStamped()\n base_eye_pose = PoseStamped()\n\n try:\n ...
[ "0.6904287", "0.57907104", "0.56830627", "0.5645349", "0.56274587", "0.56216615", "0.5601326", "0.55899036", "0.5577058", "0.5576241", "0.55422616", "0.55222255", "0.5517438", "0.5478787", "0.546555", "0.54519933", "0.54519933", "0.54192287", "0.5407392", "0.53972995", "0.539...
0.0
-1
Render website's home page.
def home(): return make_response(open('app/templates/index.html').read())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_home():\r\n\treturn render_template(\"index.html\")", "def home():\n return render_template('homepage.html')", "def home():\n\n return render_template('home_page.html')", "def homepage():\n return render_template('home/index.html', \n title=\"Bem vindo!\")", "...
[ "0.8724249", "0.85791856", "0.850329", "0.84860355", "0.84612614", "0.84362435", "0.8429879", "0.8419578", "0.8396612", "0.8396612", "0.8374868", "0.8356488", "0.8350785", "0.8340763", "0.8340763", "0.83374727", "0.83374727", "0.83374727", "0.83374727", "0.83374727", "0.83374...
0.0
-1
Render the website's about page.
def about(): return render_template('about.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about():\n return render_template('about.html', title='About')", "def about():\n\n return render_template('about_page.html', title='About')", "def about():\n\n\treturn render_template(\"about.html\")", "def about():\n return render_template(\n 'about.html',\n title='About',\n ...
[ "0.87910306", "0.8698105", "0.86404276", "0.86124563", "0.8490408", "0.84784615", "0.8467779", "0.84352976", "0.84289914", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242...
0.8325753
31
Add headers to both force latest IE rendering engine or Chrome Frame, and also to cache the rendered page for 10 minutes.
def add_header(response): response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1' response.headers['Cache-Control'] = 'public, max-age=0' return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, max-age=60'\n return response", "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, m...
[ "0.82229227", "0.8222085", "0.8222085", "0.8222085", "0.8222085", "0.819543", "0.8112277", "0.8086321", "0.7972646", "0.78653675", "0.7661059", "0.72371095", "0.7160023", "0.71526927", "0.71526927", "0.7150213", "0.7150213", "0.7141528", "0.7136741", "0.7127908", "0.7127908",...
0.8162872
23
The "Improved" evaluation function discussed in lecture that outputs a score equal to the difference in the number of moves available to the two players.
def improved_score(game, player): if game.is_loser(player): return float("-inf") if game.is_winner(player): return float("inf") own_moves = len(game.get_legal_moves(player)) opp_moves = len(game.get_legal_moves(game.get_opponent(player))) return float(own_moves - opp_moves)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def custom_score_2(game, player):\n if game.is_loser(player):\n return float(\"-inf\")\n if game.is_winner(player):\n return float(\"inf\")\n\n # Aim to maximise your own available moves vs the opponent (Factor 2)\n\n opponent = game.get_opponent(player)\n return float(len(game.get_leg...
[ "0.75373864", "0.71763146", "0.7173904", "0.7060477", "0.6959869", "0.68857193", "0.68856335", "0.68621564", "0.68424577", "0.68344295", "0.6830429", "0.6824632", "0.6812624", "0.67435306", "0.6723101", "0.6718503", "0.6709417", "0.6695227", "0.66761166", "0.66604704", "0.663...
0.7414911
1
function that returns True if given number x is a multiple of 2
def is_multiple_of_2(x): if x == 2: return True elif x and (x%2) == 0 and x!=0: return is_multiple_of_2(x/2) else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_even(x):\n return x % 2 == 0", "def primenumber(x):\n if x >= 2:\n for y in range(2,x):\n if not (x % y):\n return False\n else:\n return False\n return True", "def is_even(self, x):\n return x%2 == 0", "def is_even(number):\n if ((number%2) =...
[ "0.78451467", "0.7801242", "0.7765475", "0.7597982", "0.757846", "0.7576611", "0.7573972", "0.75724286", "0.75426966", "0.7536441", "0.75360143", "0.7460907", "0.74603933", "0.745121", "0.74378216", "0.7426763", "0.73897517", "0.738536", "0.733372", "0.73313564", "0.7325335",...
0.89183307
0
Parse issue comments (json) and return the Release Note section.
def get_release_note(comments): release_note = "" i = 0 for comment in comments: #pprint.pprint(comment) #print "**** Comment-{0}: {1}".format(i, comment['body']) #print "**** Comment-{index}: {body}".format( # index=i, # body=comment['body'] # ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_issue_get_comment(self):\n pass", "def test_issue_get_comments(self):\n pass", "def problem_comments(self, identifier):\n return self._get(\"problems/%d/comments\" % identifier).json()", "def comments(self):\n comments_url = self.data['comments_url']\n return json....
[ "0.65757674", "0.6351964", "0.6324245", "0.62822604", "0.6150393", "0.6041485", "0.59677887", "0.59328306", "0.58843917", "0.5846195", "0.5846195", "0.5799319", "0.57956886", "0.56596625", "0.5659344", "0.55837697", "0.55837697", "0.5557559", "0.55418074", "0.5524228", "0.552...
0.6670181
0
Returns a list with the possible actions.
def actions(self) -> List[str]: return list(self.__endpoints.keys())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_list_of_actions(self):\n return self.actions", "def get_actions(self):\n return []", "def actions(self):\n return self._action_list", "def get_available_actions(self):\n return self.actions", "def _generate_actions(self) -> list:\n pass", "def actions(self) -> l...
[ "0.8680097", "0.86252487", "0.8445734", "0.8274512", "0.8130275", "0.8070561", "0.806699", "0.79799896", "0.7903485", "0.7873099", "0.78637683", "0.7837835", "0.7837835", "0.7803666", "0.7782427", "0.7782427", "0.7782427", "0.7758712", "0.772838", "0.77083397", "0.7700402", ...
0.7183957
63
calc_gt_indices() calculate the ground truth indices and number of valid key points.
def calc_gt_indices(batch_keys_gt, batch_assignments_gt): _, indices_gt = torch.max( batch_assignments_gt, 2 ) # get ground truth matches from source to target indices_gt += ( 1 ) # remember that indices start counting from 1 for 0 is used to store empty key points mask_gt = (batch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tf_compute_gt_indices(\n anchors,\n bboxes,\n negative_iou_thresh=0.3,\n positive_iou_thresh=0.5\n):\n \n ious = tf.map_fn(fn=lambda x: tf_compute_iou_map_fn(x, anchors), elems=bboxes)\n print(f'bboxes: {bboxes.get_shape()}')\n print(f'anchors: {anchors.get_shape()}')\n ious = tf.tr...
[ "0.5684506", "0.55978316", "0.55460405", "0.5478052", "0.54051334", "0.53852844", "0.536485", "0.53260666", "0.5311604", "0.5294909", "0.52915275", "0.5247399", "0.524711", "0.5245708", "0.52237314", "0.5219526", "0.5214035", "0.52100533", "0.5179353", "0.5147465", "0.5142866...
0.772527
0
NormalisationPerRow() normalise the 3rd dimension by calculating its sum and divide the vector in last dimension by the sum Arguments
def NormalisationPerRow(keycorr): eps = 1e-15 sum_per_row = keycorr.sum(dim=2, keepdim=True) + eps sum_per_row = sum_per_row.expand_as(keycorr) # B x N x L keycorr = keycorr / sum_per_row return keycorr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalizeRows(x):\n\n ### YOUR CODE HERE\n # using l2 norm to normalize\n x = x / np.sqrt(np.sum(x * x, axis=-1, keepdims=True))\n ### END YOUR CODE\n\n return x", "def normalizeRows(x):\n\n ### YOUR CODE HERE\n norm2 = np.linalg.norm(x,2,axis = 1).reshape(x.shape[0],-1)\n x = x/norm2...
[ "0.72876555", "0.7283241", "0.72747684", "0.7239905", "0.7136468", "0.71126693", "0.7072292", "0.7028774", "0.69391763", "0.68529695", "0.68088806", "0.67766", "0.67632353", "0.6671305", "0.6630437", "0.66156536", "0.6606181", "0.65843636", "0.65481806", "0.6511744", "0.64802...
0.62315196
43
Hide the resume view
def hideResumeView(self): self.resumeView.setFixedHeight(0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showResumeView(self):\n self.resumeView.setFixedHeight(ResumeView.DEFAULT_HEIGHT)", "def unhide(self):\n self.course.quick_action(self.id, 'show')", "def hide(self):\n self.visible = False", "def hide(self):\n self.course.quick_action(self.id, 'hide')", "def hide(self):\n ...
[ "0.7254863", "0.718034", "0.698908", "0.69832003", "0.6839531", "0.6771533", "0.64633524", "0.6432491", "0.6345697", "0.6345156", "0.6345156", "0.63159746", "0.6315509", "0.6300532", "0.6265671", "0.6264543", "0.6251417", "0.6251417", "0.62217134", "0.6170736", "0.61248606", ...
0.8260272
0
Yield successive nsized chunks from l.
def chunks(l, n): for i in range(0, len(l), n): yield l[i:i + n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]", "def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def get_chunks(self, ...
[ "0.8040086", "0.79256725", "0.7923959", "0.78855336", "0.78781366", "0.7816429", "0.7766289", "0.7756418", "0.7744994", "0.77324396", "0.77295053", "0.77257586", "0.77034765", "0.7690202", "0.7690202", "0.7664886", "0.7657751", "0.7656609", "0.7656609", "0.7646568", "0.764656...
0.74497783
66
representation of a general quaternion must be (real,pure), since not all quaternions are rotations
def __repr__(self): result = "Quaternion (%g (%g %g %g))" % \ (self.real, self.pure[0], self.pure[1], self.pure[2]) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quatreal(q):\n a = q[0,0]\n b = q[0,1]\n c = q[0,2]\n d = q[0,3]\n amat = a*np.identity(4)\n bmat = b*np.array([[0,1,0,0],[-1,0,0,0],[0,0,0,-1],[0,0,1,0]])\n cmat = c*np.array([[0,0,1,0],[0,0,0,1],[-1,0,0,0],[0,-1,0,0]])\n dmat = d*np.array([[0,0,0,1],[0,0,-1,0],[0,1,0,0],[-1,0,0,0]])\n...
[ "0.75282234", "0.708969", "0.69521374", "0.68551564", "0.6827433", "0.67995447", "0.67013186", "0.66887194", "0.6660648", "0.66585463", "0.66528195", "0.6652248", "0.6587295", "0.65285206", "0.65136635", "0.6505146", "0.650103", "0.648099", "0.6432907", "0.64178133", "0.64022...
0.6788703
6
Representation of a unit quaternion is as rx,ry,rz,theta, so we can see what it does
def __repr__(self): if self.real != 1.: # if it is not the identity theta = numpy.arccos(self.real) angle = 360 * theta / numpy.pi xyz = self.pure / numpy.sin(theta) else: # if it is the identity angle = 0. xyz = self.pu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quaternion(self, name, q):\n R = self.R(name=name, q=q)\n quat = transformations.unit_vector(\n transformations.quaternion_from_matrix(matrix=R))\n return quat", "def _quaternions(self, R):\n # Simple Wikipedia version\n # en.wikipedia.org/wiki/Rotation_matrix#Qu...
[ "0.74589664", "0.7435746", "0.7312789", "0.7306613", "0.713349", "0.7126787", "0.7064956", "0.7050946", "0.6971781", "0.69579864", "0.6950597", "0.690259", "0.6872728", "0.68358636", "0.68234634", "0.67865634", "0.674581", "0.6739161", "0.6731305", "0.67069983", "0.666723", ...
0.6922068
11
This extracts the smiles of the molecule.
def extract_smiles(molecule_etree): SMILES_XPATH = 'hunterdb:Structure/hunterdb:CanonicalSmiles/child::text()' return molecule_etree.xpath(SMILES_XPATH, namespaces=HUNTER_DB_NAMESPACE_DICT)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def smiles(self) -> List[str]:\n return [d.smiles for d in self.data]", "def smiles(self) -> List[str]:\n return [None for i in range(len(self.data))]", "def to_smiles(rdm):\n return _rd_chem.MolToSmiles(rdm)", "def to_smiles(rdm):\n smi = _rd_chem.MolToSmiles(rdm)\n return smi", "de...
[ "0.7677816", "0.7067173", "0.6877831", "0.6830037", "0.6730977", "0.6550506", "0.6440925", "0.64209", "0.63925207", "0.62997323", "0.62986434", "0.618333", "0.6166588", "0.6136921", "0.6110032", "0.6109394", "0.61065704", "0.6073837", "0.606387", "0.6054457", "0.5983434", "...
0.7624828
1
Return one Tensor pair of (input id sequence, punc id sequence).
def __getitem__(self, index): txt_seq = self.txt_seqs[index] word_id_seq, punc_id_seq = self._preprocess(txt_seq) return word_id_seq, punc_id_seq
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_decoder_input(target_data, target_vocab_to_int, batch_size):\n # Create a constant tensor with the 'go id'.\n go_id = tf.constant(target_vocab_to_int['<GO>'], shape=(batch_size,1), dtype=tf.int32)\n # Concatenate the vector without the last word id with the go ids vector\n processed_input =...
[ "0.578625", "0.577629", "0.5771879", "0.56676894", "0.56326747", "0.56156164", "0.5595276", "0.55860853", "0.5577225", "0.5542905", "0.5530276", "0.55280465", "0.5498169", "0.5481612", "0.546571", "0.5437932", "0.5411924", "0.54079986", "0.53682584", "0.5357858", "0.53449494"...
0.0
-1
Return data loader for custom dataset.
def build_data_loader(txt_path, in_vocab_path, out_vocab_path, batch_size=1, drop_last=False, num_workers=0): dataset = PuncDataset(txt_path, in_vocab_path, out_vocab_path) batch_sampler = RandomBucketBatchSampler(dataset, batch_size=batch_size,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _custom_data_loader(self) -> DataLoader:\n dataloaders = DataLoader(self.dataset, batch_size=1)\n return dataloaders", "def train_dataloader(self) -> DataLoader:\n return self._custom_data_loader()", "def test_dataloader(self) -> DataLoader:\n return self._custom_data_loader()",...
[ "0.86546284", "0.82551056", "0.7985637", "0.7751636", "0.7638236", "0.7620933", "0.747159", "0.74482036", "0.738281", "0.7363889", "0.7332778", "0.7288082", "0.72861975", "0.7284339", "0.72446615", "0.72166497", "0.71842426", "0.7139064", "0.7135292", "0.7133612", "0.71309483...
0.0
-1
Abstract method. Returns a prettified string representation of the configuration dictionary.
def prettify(self): return self._config_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n config_str = 'Configurations\\n'\n config_str += pprint.pformat(self.__dict__)\n return config_str", "def __repr__(self) -> str:\n return json.dumps(self._config)", "def __repr__(self) -> str:\n dump_conf = copy.deepcopy(self)\n string = \"\"\n ...
[ "0.82789963", "0.80186653", "0.7807075", "0.7789988", "0.76330763", "0.7528295", "0.73643875", "0.7358356", "0.73345804", "0.73345804", "0.7317116", "0.7219879", "0.71073157", "0.6998035", "0.6989008", "0.6980547", "0.6965279", "0.6909353", "0.68794554", "0.68794554", "0.6858...
0.8623259
0
Hash a password for storing.
def hash_password(self, password): salt = hashlib.sha256(os.urandom(60)).hexdigest().encode('ascii') pwdhash = hashlib.pbkdf2_hmac('sha256', password.encode('utf-8'), salt, 100000) pwdhash = binascii.hexlify(pwdhash) return (salt + pwdhash).decode('as...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash_password(self):\n self.__password = self.str_to_hash(self.__password)", "def hash_password(self, password):\n self.password = pwd_context.encrypt(password)", "def hash_password(self, password):\n self.password_hash = generate_password_hash(password)", "def hash_passwd(password, ...
[ "0.847967", "0.8346137", "0.82644516", "0.80417943", "0.7999399", "0.7971465", "0.7947968", "0.7919728", "0.78821445", "0.78162515", "0.77545875", "0.77411246", "0.766462", "0.76507545", "0.76267356", "0.75862885", "0.75638247", "0.755944", "0.7549114", "0.75445807", "0.75196...
0.7979167
5
Split by rolling a window. `kwargs` are passed to `split_ranges_into_sets`.
def split(self, X: tp.ArrayLike, n: tp.Optional[int] = None, window_len: tp.Optional[float] = None, min_len: int = 1, **kwargs) -> RangesT: X = to_any_array(X) if isinstance(X, (pd.Series, pd.DataFrame)): index = X.index else: index = pd.Index(np.arange(X.sh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split(self, X: tp.ArrayLike, n: tp.Optional[int] = None, min_len: int = 1, **kwargs) -> RangesT:\n X = to_any_array(X)\n if isinstance(X, (pd.Series, pd.DataFrame)):\n index = X.index\n else:\n index = pd.Index(np.arange(X.shape[0]))\n\n # Resolve start_idxs an...
[ "0.63268083", "0.6086343", "0.59990233", "0.5940898", "0.5847125", "0.571639", "0.57056844", "0.568201", "0.56758213", "0.56348795", "0.5625457", "0.5601168", "0.5541704", "0.5537056", "0.5526042", "0.54844564", "0.54844564", "0.5471997", "0.5464775", "0.5442314", "0.543939",...
0.68475413
0
Return interactors of the target.
def find_interactors(self) -> pd.DataFrame: sql = INTERACTOR_QUERY cols = ["target_species", "pmid", "pmc", "interactor_type", "interactor_name", "interactor_bel", "relation_type", "target_bel", "target_type", "target_symbol", "pmod_type"] if self.node_type != 'protein' or not ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_target_actors(self):\n target_actors = [ddpg_agent.target_actor for ddpg_agent in self.maddpg_agent]\n return target_actors", "def get_target_actors(self):\n target_actors = [ddpg_agent.target_actor for ddpg_agent in self.maddpg_agent]\n return target_actors", "def get_targe...
[ "0.66492236", "0.66492236", "0.66492236", "0.66492236", "0.64679575", "0.6416261", "0.64028364", "0.63600886", "0.62524873", "0.6250397", "0.6104982", "0.60565275", "0.60318047", "0.60318047", "0.60318047", "0.60318047", "0.59799725", "0.5966184", "0.5960836", "0.58953017", "...
0.0
-1
Constructor, sets first ping received flag and config to be used
def __init__(self, hash, config, module): self.module = module self.expr = re.compile('!~.*?@') self.config = config self.firstPing = True self.hash = hash
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self._ping_challenge = None", "def __init__(self):\n self.config_parser = ConfigParser.RawConfigParser(allow_no_value=False)\n # Following attributes are packets related\n self.destination_address = None\n self.protocol = None\n self.source_address ...
[ "0.762703", "0.6609856", "0.6564644", "0.63944244", "0.6379821", "0.6308685", "0.6234198", "0.623405", "0.6190138", "0.61761916", "0.6106787", "0.6070441", "0.60218185", "0.598811", "0.59872586", "0.59637725", "0.5960948", "0.5960948", "0.5958446", "0.59367496", "0.5936361", ...
0.62648666
6
Questions with a pub_date in the past should be displayed on the index page
def test_index_view_with_a_past_question(self): create_question(question_text="Past Question",days=-30) response=self.client.get(reverse('polls:index')) self.assertQuerysetEqual(response.context['latest_question_list'],['<Question: Past Question>'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_index_view_with_a_past_question(self):\n create_question(question_text=\"Past question\", days=-30)\n response = self.client.get(reverse('polls:index'))\n self.assertQuerysetEqual(response.context['latest_question_list'], \n ['<Question: Past question>'])", "def test_inde...
[ "0.70870703", "0.7034064", "0.69834465", "0.6864377", "0.68486047", "0.68263906", "0.6792561", "0.6784673", "0.6783765", "0.67822576", "0.6765928", "0.6747979", "0.6739287", "0.6703457", "0.670249", "0.66761106", "0.6675829", "0.6672586", "0.66490483", "0.6646943", "0.6644324...
0.6966493
3
Questions with a future pub_date shouldn't be displayed in the index page
def test_index_view_with_a_future_question(self): create_question(question_text="Future question",days=30) response=self.client.get(reverse('polls:index')) self.assertContains(response,"No polls are available.") self.assertQuerysetEqual(response.context['latest_question_list'],[])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_waspublished_recently_with_future_question(self):\n time = timezone.now() + datetime.timedelta(days=30)\n future_question = Question(pub_date=time)\n self.assertIs(future_question.was_published_recently(),False)", "def test_index_view_with_a_future_question(self):\n create_qu...
[ "0.69415134", "0.68490076", "0.68221325", "0.68197405", "0.6772741", "0.6745777", "0.6740684", "0.67356384", "0.67334276", "0.6724978", "0.6719983", "0.67018306", "0.66874415", "0.66812646", "0.6669319", "0.66293985", "0.66293985", "0.6617807", "0.66051733", "0.6604489", "0.6...
0.68925947
1
Even if both past and future questions exist, only past ones shall be displayed.
def test_index_view_with_future_question_and_past_question(self): create_question(question_text="Past Question", days=-30) create_question(question_text="Future Question",days=30) response=self.client.get(reverse('polls:index')) self.assertQuerysetEqual(response.context['latest_question_list'],['<Question: Past...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_past_and_future_questions(self):\n create_question(question_text=\"Future question\", days=30)\n create_question(question_text=\"Past question\", days=-30)\n res = self.client.get(reverse(\"polls:index\"))\n self.assertEqual(res.status_code, 200)\n self.assertQuerysetEqu...
[ "0.7484344", "0.736532", "0.7347654", "0.7254999", "0.72502", "0.7237922", "0.7201963", "0.7196952", "0.7187767", "0.7140844", "0.71364677", "0.7132343", "0.7118552", "0.7107464", "0.7082358", "0.7078148", "0.70745736", "0.7053211", "0.70314485", "0.70173854", "0.701232", "...
0.7181047
9
The detail view of a question with a pub_date in the future should return 404 not found.
def test_detail_view_with_a_future_question(self): future_question=create_question(question_text="Future question",days=5) url=reverse('polls:detail',args=(future_question.id,)) response=self.client.get(url) self.assertEqual(response.status_code,404)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_detail_view_with_a_future_question(self):\n future_question = create_question(question_text='Future question.',\n days=5)\n response = self.client.get(reverse('polls:detail',\n args=(future_question.id,)))\n se...
[ "0.7610992", "0.75693536", "0.74730915", "0.69882387", "0.69627565", "0.6937845", "0.6925003", "0.6890749", "0.68575734", "0.6821121", "0.67561996", "0.6741725", "0.66858286", "0.6666086", "0.6653046", "0.6648161", "0.6618732", "0.65929693", "0.6579955", "0.6577897", "0.65586...
0.7540407
2
The detail view of a question with a pub_date in the past should be displayed in the question's text
def test_detail_view_with_a_past_question(self): past_question=create_question(question_text="Past question",days=-5) url=reverse('polls:detail',args=(past_question.id,)) response=self.client.get(url) self.assertContains(response,past_question.question_text)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_detail_view_with_a_past_question(self):\n past_question = create_question(question_text='Past Question.',\n days=-5)\n response = self.client.get(reverse('polls:detail',\n args=(past_question.id,)))\n self.assert...
[ "0.69777507", "0.69494456", "0.68990624", "0.67645353", "0.6525667", "0.6413893", "0.6395725", "0.6381168", "0.63374865", "0.62782615", "0.6261589", "0.6248936", "0.61466235", "0.6123659", "0.61225396", "0.608083", "0.6067463", "0.6064017", "0.6009305", "0.6008894", "0.599337...
0.6971042
1
The set of arguments for constructing a Acl resource.
def __init__(__self__, *, name: Optional[pulumi.Input[str]] = None, name_prefix: Optional[pulumi.Input[str]] = None, tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, user_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__,\n resource_name: str,\n args: Optional[AclArgs] = None,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...", "def __init__(__self__,\n resource_name: str,\n args: AclRuleArgs,\n opts...
[ "0.6898065", "0.6617685", "0.66099405", "0.6557983", "0.6517685", "0.6412482", "0.6362176", "0.61482257", "0.6030966", "0.5985059", "0.5981654", "0.59723634", "0.59723634", "0.5967805", "0.5966265", "0.59586465", "0.5954442", "0.59526473", "0.59320873", "0.5927983", "0.591299...
0.0
-1
Creates a unique name beginning with the specified prefix. Conflicts with `name`.
def name_prefix(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "name_prefix")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_name(prefix):\n suffix = generate_uuid()[:8]\n return '{0}_{1}'.format(prefix, suffix)", "def prefix_id(self, name):\n if \":\" in name: return name\n return self.prefix + \":\" + name", "def _prefix_name(self, name: str) -> str:\n name_to_check: str = name.split(\".\", ...
[ "0.8195386", "0.7412632", "0.7311378", "0.7266671", "0.72004753", "0.7194196", "0.71685916", "0.704199", "0.7006226", "0.69408906", "0.6851571", "0.6812473", "0.6740329", "0.6735273", "0.6682095", "0.6674863", "0.66349596", "0.66146654", "0.660699", "0.65408987", "0.6521067",...
0.5849593
92
A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the providerlevel.
def tags(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: return pulumi.get(self, "tags")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi....
[ "0.6417238", "0.6417238", "0.6413433", "0.6413433", "0.6413433", "0.6413433", "0.62760407", "0.62002236", "0.61427516", "0.6099873", "0.6085585", "0.60677147", "0.5971887", "0.5957169", "0.58641315", "0.58444744", "0.58444744", "0.58444744", "0.58444744", "0.58444744", "0.584...
0.56866676
57
The ARN of the ACL.
def arn(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return p...
[ "0.7463274", "0.7463274", "0.7463274", "0.7463274", "0.7463274", "0.7295445", "0.7295445", "0.7295445", "0.7295445", "0.7295445", "0.7295445", "0.7295445", "0.7295445", "0.7295445", "0.7295445", "0.7295445", "0.7295445", "0.7295445", "0.7295445", "0.7295445", "0.7295445", "...
0.68942505
46
Creates a unique name beginning with the specified prefix. Conflicts with `name`.
def name_prefix(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "name_prefix")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_name(prefix):\n suffix = generate_uuid()[:8]\n return '{0}_{1}'.format(prefix, suffix)", "def prefix_id(self, name):\n if \":\" in name: return name\n return self.prefix + \":\" + name", "def _prefix_name(self, name: str) -> str:\n name_to_check: str = name.split(\".\", ...
[ "0.8195386", "0.7412632", "0.7311378", "0.7266671", "0.72004753", "0.7194196", "0.71685916", "0.704199", "0.7006226", "0.69408906", "0.6851571", "0.6812473", "0.6740329", "0.6735273", "0.6682095", "0.6674863", "0.66349596", "0.66146654", "0.660699", "0.65408987", "0.6521067",...
0.5849593
91
A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the providerlevel.
def tags(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: return pulumi.get(self, "tags")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi....
[ "0.6416844", "0.6416844", "0.64130056", "0.64130056", "0.64130056", "0.64130056", "0.627534", "0.6200736", "0.6142195", "0.60977936", "0.60851777", "0.6068165", "0.59709346", "0.5958385", "0.5864118", "0.58440715", "0.58440715", "0.58440715", "0.58440715", "0.58440715", "0.58...
0.56862754
54
A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
def tags_all(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: return pulumi.get(self, "tags_all")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi....
[ "0.7443346", "0.7443346", "0.74376667", "0.74376667", "0.74376667", "0.74376667", "0.715855", "0.70964247", "0.70819575", "0.70573276", "0.69309324", "0.69174427", "0.6825906", "0.6798232", "0.6753831", "0.6701688", "0.6631699", "0.6631699", "0.6631699", "0.6631699", "0.66316...
0.0
-1
Get an existing Acl resource's state with the given name, id, and optional extra properties used to qualify the lookup.
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, arn: Optional[pulumi.Input[str]] = None, minimum_engine_version: Optional[pulumi.Input[str]] = None, name: Optional[pulumi.Input[str]] = None, name_pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n arn: Optional[pulumi.Input[str]] = None,\n auth_mode: Optional[pulumi.Input[str]] = None,\n default_s3_location: Optional[pulumi.Input[str]] = None,\n ...
[ "0.6150456", "0.5936474", "0.5910118", "0.58701456", "0.58295697", "0.58181906", "0.579276", "0.57857597", "0.5749239", "0.57019305", "0.56827664", "0.56789464", "0.56683517", "0.5665181", "0.5643875", "0.56394255", "0.5618664", "0.5616628", "0.5588353", "0.55847317", "0.5575...
0.6139589
1
The ARN of the ACL.
def arn(self) -> pulumi.Output[str]: return pulumi.get(self, "arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return p...
[ "0.7463274", "0.7463274", "0.7463274", "0.7463274", "0.7463274", "0.7123396", "0.709543", "0.709543", "0.7067154", "0.7067154", "0.7067154", "0.6921482", "0.68942505", "0.68942505", "0.68942505", "0.68942505", "0.68942505", "0.68942505", "0.68942505", "0.68942505", "0.6894250...
0.7295445
17
Creates a unique name beginning with the specified prefix. Conflicts with `name`.
def name_prefix(self) -> pulumi.Output[str]: return pulumi.get(self, "name_prefix")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_name(prefix):\n suffix = generate_uuid()[:8]\n return '{0}_{1}'.format(prefix, suffix)", "def prefix_id(self, name):\n if \":\" in name: return name\n return self.prefix + \":\" + name", "def _prefix_name(self, name: str) -> str:\n name_to_check: str = name.split(\".\", ...
[ "0.8195386", "0.7412632", "0.7311378", "0.7266671", "0.72004753", "0.7194196", "0.71685916", "0.704199", "0.7006226", "0.69408906", "0.6851571", "0.6812473", "0.6740329", "0.6735273", "0.6682095", "0.6674863", "0.66349596", "0.66146654", "0.660699", "0.65408987", "0.6521067",...
0.5883099
75
A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the providerlevel.
def tags(self) -> pulumi.Output[Optional[Mapping[str, str]]]: return pulumi.get(self, "tags")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi....
[ "0.64191085", "0.64191085", "0.6415434", "0.6415434", "0.6415434", "0.6415434", "0.6277808", "0.6201281", "0.6144052", "0.6099742", "0.6086857", "0.6069395", "0.5971659", "0.59599036", "0.5865412", "0.58455414", "0.58455414", "0.58455414", "0.58455414", "0.58455414", "0.58455...
0.5664481
93
A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
def tags_all(self) -> pulumi.Output[Mapping[str, str]]: return pulumi.get(self, "tags_all")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi....
[ "0.7442922", "0.7442922", "0.74372643", "0.74372643", "0.74372643", "0.74372643", "0.71595305", "0.7096487", "0.70816255", "0.70577693", "0.69300693", "0.6916472", "0.68235135", "0.67972314", "0.67532057", "0.6701463", "0.66302735", "0.66302735", "0.66302735", "0.66302735", "...
0.64104486
57
Add the error object to the Update Request and mark it as "Failed"
def add_error_to_update_request(self, error: str): self.update_request.error = error self.set_as_failed()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mark_failed(self):\r\n self.require_item()\r\n\r\n url = '{0}/mark_failed'.format(self.get_url())\r\n request = http.Request('PUT', url)\r\n\r\n return request, parsers.parse_empty", "def mark_failed(self):\n self.status = self.FAILED\n self.traceback = self._format_...
[ "0.74177074", "0.66984576", "0.66843605", "0.6635854", "0.6577132", "0.6569868", "0.65557945", "0.6499608", "0.6499608", "0.6488117", "0.6487509", "0.6472668", "0.6449274", "0.6449274", "0.6439488", "0.6390878", "0.63848215", "0.63698006", "0.6348278", "0.63382226", "0.633822...
0.86556023
0
Deserialize a buffer protocol compatible object into a pandas DataFrame.
def deserialize_pandas(buf, *, use_threads=True): buffer_reader = pa.BufferReader(buf) with pa.RecordBatchStreamReader(buffer_reader) as reader: table = reader.read_all() return table.to_pandas(use_threads=use_threads)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_pandas(self, obj, index=True):\n return Reader(_from_pandas(obj, index=index))", "def __load( self, json_blob ):\n return pd.read_json( json_blob, orient='split' )", "def r_to_pandas(robj, names=None):\n if names is None:\n try:\n names = robj.names\n except A...
[ "0.59791774", "0.588964", "0.5828294", "0.5801973", "0.5762243", "0.5705677", "0.5665013", "0.56443995", "0.5643365", "0.5560033", "0.5552342", "0.55324054", "0.5518481", "0.55175304", "0.55161595", "0.55115664", "0.54450506", "0.5433118", "0.54165363", "0.54129523", "0.53707...
0.7827326
0
Sets the loglevel of the current SSH connection. The log level of the current connection is set. If no connection exists yet, this loglevel is used as default for connections created in the future. In both cases the old log level is returned, either the log level of the current connection or the previous default loglev...
def set_ssh_loglevel(self, loglevel): if self._current == None: old = self._loglevel self._loglevel = loglevel return old return self._current.set_default_log_level(loglevel)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_log_level_connect(self, value: t.Union[str, int] = \"debug\") -> None:\n if self.LOG:\n logs.set_log_level(obj=self.LOG, level=value)", "def set_log_level(self, level: str) -> None:\n self.logger.setLevel(self._logging.log_levels[level])\n self.err.setLevel(self._logging.l...
[ "0.67811686", "0.6350295", "0.6276066", "0.62709147", "0.62081325", "0.6207227", "0.620008", "0.6168651", "0.61519593", "0.6116851", "0.6105786", "0.6074723", "0.6071603", "0.6067615", "0.6064632", "0.60624325", "0.6042613", "0.5962583", "0.5941709", "0.59387106", "0.5917979"...
0.77609706
0
Returns a reward to the agent.
def get_reward(self, physics): current_mask = np.any(self.image < 100, axis=-1).astype(int) area = np.sum(current_mask * self.mask) reward = area / np.sum(self.mask) return reward
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reward(self) -> Reward:\n return self.__reward", "def reward(self):\n return self._reward", "def get_reward(self):\n accuracy = self.state\n # Use accuracy as reward for now.\n reward = accuracy\n return reward", "def get_reward(self):\n reward, self.reward = ...
[ "0.8227387", "0.8064022", "0.8047813", "0.782541", "0.7821733", "0.7812273", "0.7783558", "0.77331483", "0.7732694", "0.7560724", "0.75542104", "0.7531912", "0.75232726", "0.75079393", "0.74293023", "0.73427373", "0.7333967", "0.73134005", "0.72362983", "0.72253823", "0.71495...
0.0
-1
Create a new empty JobManifest with the given job ID.
def create(cls, job_id: str) -> "JobManifest": now = datetime.datetime.now(datetime.timezone.utc) return JobManifest(creation_time=now, job_id=job_id, orbit_ids=[], task_ids=[])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_job_manifest(bucket: Bucket, job_id: str) -> JobManifest:\n path = f\"thor_jobs/v1/job-{job_id}/manifest.json\"\n as_str = bucket.blob(path).download_as_string()\n return JobManifest.from_str(as_str)", "def create_new_job(self, search_id: Hashable) -> Hashable:\n partial_id = (\n ...
[ "0.6710013", "0.5658664", "0.55456865", "0.55351293", "0.54609525", "0.5450734", "0.5431339", "0.5429583", "0.5363874", "0.5361948", "0.53567654", "0.5312667", "0.5308671", "0.53079253", "0.5307272", "0.5305698", "0.52920604", "0.5238305", "0.5213917", "0.52121687", "0.519263...
0.88597673
0
Serialize the JobManifest as a string. Returns str JSON serialization of the JobManifest.
def to_str(self) -> str: return json.dumps( { "job_id": self.job_id, "creation_time": self.creation_time.isoformat(), "orbit_ids": self.orbit_ids, "task_ids": self.task_ids, } )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_json(self):\n\n working_dictionary = {\n key: self.__dict__[key] for key in self.JSON_KEYS if key in self.__dict__\n }\n\n try:\n # Ensure a consistent and compact JSON representation across Python versions\n string_result = json.dumps(working_dictionary...
[ "0.72537065", "0.70503193", "0.6507869", "0.64236027", "0.61140454", "0.5988725", "0.5970232", "0.5952248", "0.58835006", "0.58835006", "0.586589", "0.5824706", "0.5794988", "0.57862854", "0.5769015", "0.575821", "0.5756795", "0.5756795", "0.5756795", "0.5756795", "0.5756795"...
0.66118735
2
Remove a document from Elasticsearch.
def remove(self, document_id, namespace, timestamp): index, doc_type = self._index_and_mapping(namespace) action = { '_op_type': 'delete', '_index': index, '_type': doc_type, '_id': u(document_id) } meta_action = { '_op_type':...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_document(obj):\n index = obj.get_index_name()\n doc_type = obj.get_document_type()\n try:\n ES.delete(index=index, doc_type=doc_type, id=obj.pk)\n except NotFoundError:\n raise DocumentNotFound(obj.get_index_name(), obj.pk)", "async def remove_doc(self, *args, **kwargs):\n ...
[ "0.75229126", "0.7490367", "0.7348737", "0.7295783", "0.72651434", "0.7017016", "0.7016369", "0.6944938", "0.6782602", "0.6767749", "0.6669089", "0.6564615", "0.64994425", "0.6441128", "0.64276326", "0.6373746", "0.63664985", "0.6322107", "0.62990564", "0.62715405", "0.624909...
0.7141973
5
Gets the shape of the input excluding the batch size
def get_sample_shape(inputs): return tuple(inputs.size())[1:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_input_shape(self):\n return self.network.inputs[self.input_blob].shape", "def inputShape(self):\n return self.input_shape", "def get_input_tensor_shape(self):\n return self._engine.get_input_tensor_shape()", "def input_shape(self):\n return self._ipt_shape", "def get_input_s...
[ "0.8349712", "0.8239117", "0.82321775", "0.8191806", "0.8123994", "0.8031009", "0.7984709", "0.7984709", "0.7984709", "0.78609776", "0.76713836", "0.76104164", "0.75373757", "0.75114393", "0.75114393", "0.75114393", "0.74859786", "0.74281955", "0.7419961", "0.7372976", "0.736...
0.7454735
17
Creates a generator by slicing ``data`` into chunks of ``block_size``. >>> data = range(10) >>> list(block_splitter(data, 2)) [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9]] If ``data`` cannot be evenly divided by ``block_size``, the last block will
def block_splitter(data, block_size): buf = [] for i, datum in enumerate(data): buf.append(datum) if len(buf) == block_size: yield buf buf = [] # If there's anything leftover (a partial block), # yield it as well. if buf: yield buf
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def block_split(stream, block_size=BLOCK_SIZE_IN_BYTES):\n # TODO: this could possibly be a generator\n return [stream[i:i + BLOCK_SIZE_IN_BYTES]\n for i in range(0, len(stream), BLOCK_SIZE_IN_BYTES)]", "def reshape_as_blocks(data, block_size):\n data, block_size = _process_block_inputs(data,...
[ "0.73116237", "0.6969292", "0.6698882", "0.62618506", "0.61792463", "0.61741424", "0.61176544", "0.61053765", "0.60622555", "0.6040073", "0.5969064", "0.5956016", "0.5941752", "0.59379977", "0.59155315", "0.5913359", "0.5906953", "0.5902095", "0.58966833", "0.58927494", "0.58...
0.83897716
0
Return first n items of the iterable as a list Copied shamelessly from
def take(n, iterable): return list(itertools.islice(iterable, n))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def take(iterable, n):\n return list(itertools.islice(iterable, n))", "def take(n, iterable):\n return list(islice(iterable, n))", "def take(n, iterable):\n return list(islice(iterable, n))", "def take(num, iterable):\n return list(islice(iterable, num))", "def take(self, n): # noqa: N805\...
[ "0.8396118", "0.83117026", "0.83117026", "0.7947794", "0.776932", "0.7457759", "0.7400993", "0.7198617", "0.7121794", "0.70964605", "0.7092736", "0.70698583", "0.70642185", "0.7059872", "0.70538545", "0.70316726", "0.6986508", "0.6848235", "0.68407524", "0.68373364", "0.67585...
0.8330421
2
On Windows, some default encodings are not provided by Python, while they are always available as "mbcs" in each locale. Make them usable by aliasing to "mbcs" in such a case.
def aliasmbcs(): if sys.platform == 'win32': import locale, codecs enc = locale.getdefaultlocale()[1] if enc.startswith('cp'): # "cp***" ? try: codecs.lookup(enc) except LookupError: import encodings ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getsystemenc():\n\n return sys.getfilesystemencoding()", "def set_utf8_locale():\n lang, encoding = locale.getlocale()\n if encoding != 'UTF-8':\n locale.setlocale(locale.LC_CTYPE, (lang, 'UTF-8'))", "def getdefaultencoding(): # real signature unknown; restored from __doc__\n return \"\"...
[ "0.6456849", "0.63695854", "0.62721294", "0.626052", "0.62339544", "0.62339544", "0.6121814", "0.60187846", "0.6000281", "0.5972629", "0.5930318", "0.5923736", "0.5882366", "0.5835465", "0.5723865", "0.56501776", "0.5612613", "0.56073093", "0.55557543", "0.55343115", "0.55147...
0.8484207
0
Return true if the object is a module.
def ismodule(object): return isinstance(object, types.ModuleType)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_module(obj):\n return type(obj) is types.ModuleType", "def isModule(self, name):\n return os.path.isfile(self.modulePath(name))", "def is_module_object(self, obj):\n if not isinstance(obj, BaseException):\n try:\n c = obj.__class__\n source_file = in...
[ "0.90503365", "0.8028993", "0.7713271", "0.75602067", "0.72879297", "0.72090334", "0.71414125", "0.7023594", "0.67919755", "0.67801344", "0.67676246", "0.66763747", "0.66438377", "0.66348135", "0.6616767", "0.66113514", "0.65961194", "0.6527026", "0.65172386", "0.6506568", "0...
0.8945327
1
Return true if the object is a class.
def isclass(object): return isinstance(object, (type, types.ClassType))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isclass(object):\n if not inspect.isclass(object):\n return False\n if isbuiltin(object):\n return False\n return type not in inspect.getmro(object)", "def class_is(cls: Class) -> bool:\n pass", "def is_kind_of_class(obj, a_class):\n if isinstance(obj, a_class) is True:\n ...
[ "0.8689777", "0.847604", "0.8062617", "0.80282146", "0.80282146", "0.8018681", "0.80158186", "0.79666317", "0.79666317", "0.79666317", "0.79666317", "0.79666317", "0.79666317", "0.794599", "0.7932038", "0.79265285", "0.7922377", "0.78950083", "0.7596183", "0.75640416", "0.736...
0.872781
0
Return true if the object is a userdefined function.
def isfunction(object): return isinstance(object, types.FunctionType)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isbuiltin(object):\r\n return isinstance(object, types.BuiltinFunctionType)", "def is_function(obj):\n if type(obj) is types.FunctionType:\n return True\n if not is_object(obj):\n return False\n if not hasattr(obj, '__class__'):\n return False\n module = obj.__class__.__mo...
[ "0.78222114", "0.78041106", "0.7623925", "0.7501091", "0.74632204", "0.7428319", "0.7406653", "0.7363749", "0.7339153", "0.72277546", "0.71474063", "0.7087786", "0.7007423", "0.6993981", "0.6977328", "0.6902159", "0.6788628", "0.6785741", "0.67802554", "0.67642415", "0.665850...
0.78785634
0
Return true if the object is a userdefined generator function. Generator function objects provides same attributes as functions. See help(isfunction) for attributes listing.
def isgeneratorfunction(object): return bool((isfunction(object) or ismethod(object)) and object.func_code.co_flags & CO_GENERATOR)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isfunction(object):\r\n return isinstance(object, types.FunctionType)", "def is_function(obj):\n if type(obj) is types.FunctionType:\n return True\n if not is_object(obj):\n return False\n if not hasattr(obj, '__class__'):\n return False\n module = obj.__class__.__module__...
[ "0.7225927", "0.7036342", "0.6980597", "0.69032043", "0.6873411", "0.6864246", "0.6861426", "0.6831486", "0.6810423", "0.6700796", "0.65101063", "0.64845026", "0.64761686", "0.64271176", "0.6378125", "0.6342166", "0.6299797", "0.62501353", "0.61387503", "0.61264426", "0.61222...
0.80566955
0
Return true if the object is a frame object.
def isframe(object): return isinstance(object, types.FrameType)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def frame_available(self):\n return type(self._frame) != type(None)", "def isinstance_blender_object(self, b_obj):\n # lame and slow, but functional\n return b_obj in Blender.Object.Get()", "def hasCurrentFrame(self):\n if self.currentFrame == []:\n return False\n return True", ...
[ "0.7059548", "0.6776868", "0.67025095", "0.6320981", "0.6151478", "0.6132881", "0.61015505", "0.60789543", "0.6062816", "0.6059846", "0.6057658", "0.602962", "0.60256284", "0.60208946", "0.6008246", "0.5994111", "0.5985257", "0.5973069", "0.595703", "0.5956045", "0.5944672", ...
0.8961334
0
Return true if the object is a builtin function or method.
def isbuiltin(object): return isinstance(object, types.BuiltinFunctionType)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isbuiltin(object):\n if inspect.isbuiltin(object):\n return True\n\n return getattr(object, '__module__', None) == 'builtins'", "def is_builtin(fn) -> bool:\n return getattr(fn, TRITON_BUILTIN, False)", "def is_function(obj):\n if type(obj) is types.FunctionType:\n return True\n ...
[ "0.8289285", "0.7472802", "0.7363803", "0.71875185", "0.70628667", "0.70435905", "0.70102745", "0.69756746", "0.6775871", "0.67595947", "0.6733965", "0.6691371", "0.66529965", "0.65831393", "0.6575697", "0.6573933", "0.6510448", "0.64959884", "0.64307064", "0.6391338", "0.638...
0.8574259
0
Return true if the object is an abstract base class (ABC).
def isabstract(object): return bool(isinstance(object, type) and object.__flags__ & TPFLAGS_IS_ABSTRACT)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_abstract(cls) -> bool:\n return cls is InternalObject", "def is_abstract(cls):\n return cls.__dict__.get('abstract', False)", "def is_abstract(cls) -> bool:\n return cls.get_ql_class() is None", "def test_that_this_class_is_abstract(self) -> type(None):\n message = ''\n ...
[ "0.79591995", "0.7740118", "0.74967694", "0.6876047", "0.6846115", "0.65837055", "0.65216106", "0.65125287", "0.6509723", "0.6505676", "0.64681417", "0.64598703", "0.64483017", "0.63817596", "0.63814217", "0.63706404", "0.6360255", "0.63141894", "0.6295798", "0.6278391", "0.6...
0.8235927
0
Get lines of comments immediately preceding an object's source code. Returns None when source can't be found.
def getcomments(object): try: lines, lnum = findsource(object) except (IOError, TypeError): return None if ismodule(object): # Look for a comment block at the top of the file. start = 0 if lines and lines[0][:2] == '#!': start = 1 while start < len(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getsourcelines(object):\r\n lines, lnum = findsource(object)\r\n\r\n if ismodule(object): return lines, 0\r\n else: return getblock(lines[lnum:]), lnum + 1", "def getsourcelines(object):\n lines, lnum = findsource(object)\n\n if inspect.ismodule(object): return lines, 0\n else: return inspe...
[ "0.72634727", "0.71040714", "0.697937", "0.6219743", "0.619659", "0.616633", "0.614325", "0.6131676", "0.60498", "0.60067236", "0.592545", "0.58221656", "0.58154655", "0.5761031", "0.5745453", "0.5741687", "0.5715431", "0.56689686", "0.5604483", "0.55737406", "0.55317247", ...
0.7663891
0
D.items() > list of D's (key, value) pairs, as 2tuples
def items(self): L = [] for key, value in self.data.items(): o = key() if o is not None: L.append((o, value)) return L
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _tupleize(d):\n return [(key, value) for key, value in d.items()]", "def items(self):\n return ((key, value) for (key, value) in zip(self.__keys, self.__vals))", "def items(self) -> tuple[tuple[Hashable, Any], ...]:\n return tuple(zip(self.keys(), self.values()))", "def dict_values(d):\n...
[ "0.7830863", "0.7284799", "0.7120354", "0.7040355", "0.70346266", "0.7028189", "0.70108086", "0.696593", "0.69515955", "0.69515955", "0.69386834", "0.68796587", "0.6806141", "0.6757493", "0.6757493", "0.66560125", "0.6589901", "0.6550006", "0.6549958", "0.64609885", "0.645890...
0.6295288
28
Return a list of weak references to the keys. The references are not guaranteed to be 'live' at the time they are used, so the result of calling the references needs to be checked before being used. This can be used to avoid creating references that will cause the garbage collector to keep the keys around longer than n...
def keyrefs(self): return self.data.keys()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keyrefs(self):\n return [ref(key) for key in self.iterkeys()]", "def keyrefs(self):\n return list(self.data)", "def iterkeyrefs(self):\n for key in self.iterkeys():\n yield ref(key)", "def list_ref_keys(self):\n print('=======')\n print('REFs')\n print...
[ "0.82069016", "0.73039544", "0.70277053", "0.68495166", "0.6591765", "0.6591765", "0.65662", "0.6492488", "0.6408364", "0.62811583", "0.6258436", "0.62512493", "0.62409", "0.6135763", "0.6131842", "0.61273736", "0.61273736", "0.60930115", "0.608971", "0.6087546", "0.6075515",...
0.7237666
3
D.setdefault(k[,d]) > D.get(k,d), also set D[k]=d if k not in D
def setdefault(self, key, default=None): return self.data.setdefault(ref(key, self._remove),default)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keywithsecondminval(d): \r\n if len(d) == 1:\r\n d = (d.keys())\r\n return d[0]\r\n\r\n v=list(d.values())\r\n k=list(d.keys())\r\n\r\n a = list(v)\r\n\r\n b = list(k)\r\n\r\n k.pop(v.index(min(v)))\r\n\r\n v.pop(v.index(min(v)))\r\n\r\n test = k[v.index(min(v))]\r\n\r\n ...
[ "0.55361325", "0.5436378", "0.5407081", "0.5375841", "0.53595066", "0.53391355", "0.5331777", "0.53075683", "0.5303953", "0.52871853", "0.5269493", "0.52402604", "0.52296007", "0.51799726", "0.51506335", "0.5150125", "0.5150125", "0.5150125", "0.5147283", "0.51231664", "0.509...
0.0
-1
D.items() > list of D's (key, value) pairs, as 2tuples
def items(self): L = [] for key, value in self.data.items(): o = key() if o is not None: L.append((o, value)) return L
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _tupleize(d):\n return [(key, value) for key, value in d.items()]", "def items(self):\n return ((key, value) for (key, value) in zip(self.__keys, self.__vals))", "def items(self) -> tuple[tuple[Hashable, Any], ...]:\n return tuple(zip(self.keys(), self.values()))", "def dict_values(d):\n...
[ "0.7830863", "0.7284799", "0.7120354", "0.7040355", "0.70346266", "0.7028189", "0.70108086", "0.696593", "0.69515955", "0.69515955", "0.69386834", "0.68796587", "0.6806141", "0.6757493", "0.6757493", "0.66560125", "0.6589901", "0.6550006", "0.6549958", "0.64609885", "0.645890...
0.6295288
29
Return a list of weak references to the keys. The references are not guaranteed to be 'live' at the time they are used, so the result of calling the references needs to be checked before being used. This can be used to avoid creating references that will cause the garbage collector to keep the keys around longer than n...
def keyrefs(self): return self.data.keys()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keyrefs(self):\n return [ref(key) for key in self.iterkeys()]", "def keyrefs(self):\n return list(self.data)", "def iterkeyrefs(self):\n for key in self.iterkeys():\n yield ref(key)", "def list_ref_keys(self):\n print('=======')\n print('REFs')\n print...
[ "0.82069016", "0.73039544", "0.70277053", "0.68495166", "0.6591765", "0.6591765", "0.65662", "0.6492488", "0.6408364", "0.62811583", "0.6258436", "0.62512493", "0.62409", "0.6135763", "0.6131842", "0.61273736", "0.61273736", "0.60930115", "0.608971", "0.6087546", "0.6075515",...
0.7237666
2
D.setdefault(k[,d]) > D.get(k,d), also set D[k]=d if k not in D
def setdefault(self, key, default=None): return self.data.setdefault(IdentityRef(key, self._remove),default)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keywithsecondminval(d): \r\n if len(d) == 1:\r\n d = (d.keys())\r\n return d[0]\r\n\r\n v=list(d.values())\r\n k=list(d.keys())\r\n\r\n a = list(v)\r\n\r\n b = list(k)\r\n\r\n k.pop(v.index(min(v)))\r\n\r\n v.pop(v.index(min(v)))\r\n\r\n test = k[v.index(min(v))]\r\n\r\n ...
[ "0.55361325", "0.5436378", "0.5407081", "0.5375841", "0.53595066", "0.53391355", "0.5331777", "0.53075683", "0.5303953", "0.52871853", "0.5269493", "0.52402604", "0.52296007", "0.51799726", "0.51506335", "0.5150125", "0.5150125", "0.5150125", "0.5147283", "0.51231664", "0.509...
0.0
-1
D.items() > list of D's (key, value) pairs, as 2tuples
def items(self): my_items = [] for key, sleek_ref in self.data.items(): try: thing = sleek_ref() except SleekRefDied: pass else: my_items.append((key, thing)) return my_items
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _tupleize(d):\n return [(key, value) for key, value in d.items()]", "def items(self):\n return ((key, value) for (key, value) in zip(self.__keys, self.__vals))", "def items(self) -> tuple[tuple[Hashable, Any], ...]:\n return tuple(zip(self.keys(), self.values()))", "def dict_values(d):\n...
[ "0.7830863", "0.7284799", "0.7120354", "0.7040355", "0.70346266", "0.7028189", "0.70108086", "0.696593", "0.69515955", "0.69515955", "0.69386834", "0.68796587", "0.6806141", "0.6757493", "0.6757493", "0.66560125", "0.6589901", "0.6550006", "0.6549958", "0.64609885", "0.645890...
0.0
-1
D.setdefault(k[,d]) > D.get(k,d), also set D[k]=d if k not in D
def setdefault(self, key, default=None): try: return self[key] except KeyError: self[key] = default return default
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keywithsecondminval(d): \r\n if len(d) == 1:\r\n d = (d.keys())\r\n return d[0]\r\n\r\n v=list(d.values())\r\n k=list(d.keys())\r\n\r\n a = list(v)\r\n\r\n b = list(k)\r\n\r\n k.pop(v.index(min(v)))\r\n\r\n v.pop(v.index(min(v)))\r\n\r\n test = k[v.index(min(v))]\r\n\r\n ...
[ "0.55356115", "0.54372454", "0.5406987", "0.5378993", "0.5358973", "0.53389716", "0.53341734", "0.53058434", "0.5301141", "0.52891356", "0.5269982", "0.5237737", "0.523226", "0.51801175", "0.5150922", "0.51496565", "0.51496565", "0.51496565", "0.5146695", "0.51202506", "0.509...
0.0
-1
Return a list of weak references to the values. The references are not guaranteed to be 'live' at the time they are used, so the result of calling the references needs to be checked before being used. This can be used to avoid creating references that will cause the garbage collector to keep the values around longer th...
def valuerefs(self): return self.data.values()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valuerefs(self):\n return [ref(value) for value in self.itervalues()]", "def _refs(self, items):\n # type: (Iterable[Any]) -> Iterable[weakref.ReferenceType]\n return map(self.ref, items)", "def get_pyweakrefs(obj: typing.Any) -> list[ReferenceType]:\r\n seq = _reference_id_registry...
[ "0.74262476", "0.6810636", "0.6778606", "0.66600424", "0.64524084", "0.64439523", "0.6413778", "0.6381763", "0.6361749", "0.6361271", "0.6280388", "0.6164737", "0.6074578", "0.6072525", "0.596822", "0.59287894", "0.5897373", "0.5887382", "0.5860268", "0.5860268", "0.582918", ...
0.0
-1
Add a type specific assertEqual style function to compare a type. This method is for use by TestCase subclasses that need to register their own type equality functions to provide nicer error messages.
def addTypeEqualityFunc(self, typeobj, function): self._type_equality_funcs[typeobj] = function
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_types_are_equal(self):\n self.assertEqual(True, comparator.types_are_equal(None, None))\n self.assertEqual(True, comparator.types_are_equal(True, True))\n self.assertEqual(True, comparator.types_are_equal(True, False))\n self.assertEqual(True, comparator.types_are_equal(int(), ...
[ "0.64099425", "0.6162845", "0.60878867", "0.60483795", "0.60189486", "0.58744097", "0.5855696", "0.5852741", "0.5842349", "0.58336544", "0.57676536", "0.57270336", "0.55989355", "0.55440307", "0.5539809", "0.54932046", "0.54577434", "0.5427406", "0.5401657", "0.5399568", "0.5...
0.64216036
0
Fail if the two objects are unequal as determined by the '==' operator.
def assertEqual(self, first, second, msg=None): assertion_func = self._getAssertEqualityFunc(first, second) assertion_func(first, second, msg=msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_not_equal_on_equal(self):\n a = objects.OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n b = objects.OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n self.assertFalse(a != b)\n self.assertFalse(b != a)", "def test_equality_check_against_other_object_doesnt_raise...
[ "0.7972038", "0.7953332", "0.791635", "0.7878723", "0.78270835", "0.78110594", "0.7785602", "0.7784792", "0.7608514", "0.7529266", "0.75235796", "0.7501297", "0.74929625", "0.7451132", "0.74390656", "0.74371505", "0.73967385", "0.73882294", "0.7386272", "0.7371011", "0.736063...
0.0
-1
Fail if the two objects are equal as determined by the '==' operator.
def assertNotEqual(self, first, second, msg=None): if not first != second: msg = self._formatMessage(msg, '%s == %s' % (safe_repr(first), safe_repr(second))) raise self.failureException(msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_equal(o1: object, o2: object) -> bool:\n if o1 is None and o2 is None:\n return True\n if o1 is None:\n return False\n return o1 == o2", "def test_equal_on_equal(self):\n a = objects.OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n b = object...
[ "0.7919041", "0.7786313", "0.77699965", "0.7705751", "0.76696056", "0.7583974", "0.7578073", "0.75717276", "0.75399613", "0.7528206", "0.7517002", "0.7496462", "0.7496462", "0.7487033", "0.7487033", "0.7474491", "0.74317163", "0.7405117", "0.7405117", "0.7385922", "0.73718214...
0.0
-1
Return a relative version of a path
def _relpath_nt(path, start=os.path.curdir): if not path: raise ValueError("no path specified") start_list = os.path.abspath(start).split(os.path.sep) path_list = os.path.abspath(path).split(os.path.sep) if start_list[0].lower() != path_list[0].lower(): unc_path, rest = os.path.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relative(self, path):\n return re.sub(self.path_regex, '', path).lstrip(os.sep)", "def relativize(path: str):\n return join('.', path)", "def relativePath(path):\n spath = pathSplit(path)\n return spath[-1]", "def get_relative_path(path: str):\n return os.path.relpath(path, get_project...
[ "0.7916205", "0.77834916", "0.77383643", "0.765349", "0.7530642", "0.7522436", "0.7415771", "0.7404095", "0.729165", "0.72837", "0.7279967", "0.723366", "0.7217335", "0.71864855", "0.7178365", "0.7105353", "0.7092798", "0.70900303", "0.70873284", "0.70858437", "0.70681816", ...
0.0
-1
Return a relative version of a path
def _relpath_posix(path, start=os.path.curdir): if not path: raise ValueError("no path specified") start_list = os.path.abspath(start).split(os.path.sep) path_list = os.path.abspath(path).split(os.path.sep) # Work out how much of the filepath is shared by start and path. i = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relative(self, path):\n return re.sub(self.path_regex, '', path).lstrip(os.sep)", "def relativize(path: str):\n return join('.', path)", "def relativePath(path):\n spath = pathSplit(path)\n return spath[-1]", "def get_relative_path(path: str):\n return os.path.relpath(path, get_project...
[ "0.7916205", "0.77834916", "0.77383643", "0.765349", "0.7530642", "0.7522436", "0.7415771", "0.7404095", "0.729165", "0.72837", "0.7279967", "0.723366", "0.7217335", "0.71864855", "0.7178365", "0.7105353", "0.7092798", "0.70900303", "0.70873284", "0.70858437", "0.70681816", ...
0.0
-1
Return a suite of all tests cases found using the given sequence of string specifiers. See 'loadTestsFromName()'.
def loadTestsFromNames(self, names, module=None): suites = [self.loadTestsFromName(name, module) for name in names] return self.suiteClass(suites)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def suite():\n\tts = unittest.TestSuite()\n\tfor test_module in __all__:\n\t\tm = importlib.import_module(\"pyroclast.test.\" + test_module)\n\t\tfor n in dir(m):\n\t\t\tc = getattr(m, n)\n\t\t\tif is_test_case(c):\n\t\t\t\ts = unittest.TestLoader().loadTestsFromTestCase(c)\n\t\t\t\tts.addTests(s)\n\treturn ts", ...
[ "0.7213632", "0.68787366", "0.680435", "0.680435", "0.6786496", "0.6779659", "0.6721755", "0.66643906", "0.6648306", "0.66412103", "0.65829444", "0.6578536", "0.65720206", "0.6553921", "0.6527574", "0.65239364", "0.6509599", "0.6484128", "0.6448192", "0.64428675", "0.64099556...
0.6919736
1
Sets the clicking point.
def SetClickPoint(self, p): self.click_pt = p
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_click(self, x: int, y: int) -> None:\n\t\tself.state = MouseState.CLICKED\n\t\tself.click_position = Point(x, y)", "def click(self, click):\n\n self._click = click", "def setPoint(self, point):\n self.point = point", "def setSetpoint(self, point):\n\n\t\tself._setpoint = point", "def ...
[ "0.8060222", "0.67688763", "0.67274594", "0.6723143", "0.67118764", "0.6710596", "0.6600474", "0.6538162", "0.6524762", "0.65210557", "0.6342079", "0.6339296", "0.633513", "0.62810963", "0.62769955", "0.6273338", "0.6269413", "0.6228525", "0.6217557", "0.6215185", "0.618928",...
0.87736624
0
Returns whether the event is allowed or not.
def IsAllowed(self): return self.notify.IsAllowed()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_allowed(self) -> bool:\n return self.effect == ALLOW_ACCESS", "def can_be_registered(self, event_type):\n return (event_type in self._watchable_events or\n (event_type == self.ANY and self._allow_any))", "def check_allowed(self):\n if self.state_model.op_state in [\n ...
[ "0.71218127", "0.6753952", "0.6584852", "0.65724695", "0.65048504", "0.6486049", "0.64661396", "0.6425485", "0.64117974", "0.6407661", "0.6383321", "0.6383321", "0.6368016", "0.63388735", "0.6322138", "0.63019186", "0.62861454", "0.62475485", "0.6230119", "0.6214851", "0.6194...
0.75149125
1
Returns the toolbar item kind. See L{SetKind} for more details.
def GetKind(self): return self.kind
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def item_type(self) -> str:\n return self.__item_type", "def kind(self):\n return self.get_data(\"kind\")", "def item_type(self):\n return self._item_type", "def kind(self) -> str:\n return pulumi.get(self, \"kind\")", "def kind(self) -> str:\n return pulumi.get(self, \"k...
[ "0.62074655", "0.61990243", "0.61379355", "0.61212325", "0.61212325", "0.61212325", "0.61212325", "0.61212325", "0.61212325", "0.61212325", "0.61212325", "0.61212325", "0.61212325", "0.61212325", "0.61212325", "0.61212325", "0.61212325", "0.61212325", "0.61212325", "0.61212325"...
0.6155106
2