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
Return cached TFIDF model.
def getTFIDF(): global vectorizer global tfidf global tokens global texts_weights if tfidf is None: texts_content = [] for text in texts: with open(text, 'r') as ifile: texts_content.append(cleantext(ifile.read())) vectorizer = CountVectorizer(tokenizer=tokenize, stop_words='engli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_model() -> tf.keras.Model:\n t0 = time.time()\n logger.info(\"getting and caching model\")\n if not os.path.exists(constants.MODEL_FILE):\n download_model()\n model = tf.keras.models.load_model(constants.MODEL_FILE)\n logger.info(f\"got model, took {time.time() - t0:.2f}s\")\n retu...
[ "0.6543457", "0.61030877", "0.6062981", "0.59962225", "0.5935302", "0.581631", "0.58020777", "0.57767993", "0.5664971", "0.56373924", "0.56349456", "0.56313944", "0.5577781", "0.5530665", "0.55282116", "0.55155575", "0.55048007", "0.54988927", "0.54984057", "0.54954654", "0.5...
0.5593906
12
Find length of the current object.
def __len__(self): return self._len
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __len__(self):\n return self._length", "def __len__(self):\n return self._length", "def __len__(self):\n return self._length", "def __len__(self):\n return self._length", "def __len__(self):\n return self._length", "def __len__(self):\n return self._length", ...
[ "0.80103886", "0.80103886", "0.80103886", "0.80103886", "0.80103886", "0.80103886", "0.8003976", "0.7992827", "0.7978085", "0.7976429", "0.7955085", "0.7941689", "0.79408014", "0.79408014", "0.79408014", "0.79408014", "0.79408014", "0.78931236", "0.7889033", "0.7862361", "0.7...
0.7828618
23
Performs necessary clean up and destroys root window.
def _stop_smartmirror(self, event): if self._face_recognizer: self._face_recognizer.stop_face_recognition() self.destroy()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def teardown():\n global root, main\n main.teardown()\n root.quit()\n try: # might already be gone\n root.destroy()\n except: pass", "def destroy(self):\n self._root.destroy()", "def destroy_window():\n WindowSingleton.destroy_instance()", "def _destroy(self):\n self.app.topLevel...
[ "0.7839281", "0.77448857", "0.7672062", "0.7557091", "0.7510537", "0.7503557", "0.7482217", "0.7430646", "0.7406484", "0.739943", "0.7359873", "0.73461056", "0.7306733", "0.7276328", "0.7243297", "0.7193098", "0.7191033", "0.7191033", "0.710188", "0.7100357", "0.70877576", ...
0.0
-1
Returns dictionary mapping frames' names to coordinates.
def get_framename_coords_dict(self): return self._framename_coords_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_coordinate_frame(self):\n return self.coord_frame.name", "def get_frame_info(frame):\n filename = frame.f_code.co_filename\n return {\"filename\": filename, \"line_no\": frame.f_lineno,\n \"function\": frame.f_code.co_name,\n \"sym_table\": copy.copy(frame.f_locals)}", ...
[ "0.6006692", "0.5710867", "0.5688718", "0.55837625", "0.54986805", "0.54414976", "0.5440245", "0.5429375", "0.5397568", "0.53751296", "0.536868", "0.5349125", "0.5320494", "0.52910215", "0.5269675", "0.52554244", "0.5235032", "0.5220984", "0.5189066", "0.516956", "0.5167839",...
0.7194915
0
Verify the given environment variable is set and return its value. Raise an error if it isn't set.
def _verify_env(var_name: str, err_msg: str) -> str: try: return os.environ[var_name] except KeyError: raise RuntimeError(err_msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_env_value(var_name):\n try:\n return os.getenv(var_name)\n except KeyError:\n error_msg = 'Set the {} environment variable'.format(var_name)\n raise ImproperlyConfigured(error_msg) from None", "def _get_env_var(env_var_name: str) -> str:\n env_var_value: Optional[str] = os.e...
[ "0.7500903", "0.7256027", "0.7224086", "0.72035134", "0.7151252", "0.7130704", "0.70926815", "0.70706683", "0.7025316", "0.7025316", "0.7010438", "0.69805145", "0.6911152", "0.68079907", "0.6759375", "0.6743206", "0.67234296", "0.6697448", "0.66934717", "0.6679995", "0.667999...
0.7436773
1
"Combines two images, inserting image_2 into a region defined by the polygons" Args
def polygonal_paste(image_1, image_2, polygon_1, polygon_2): #trim images mask = Image.new("L", original.size, 0) draw = ImageDraw.Draw(mask) draw.polygon(polygon_1, fill=255, outline=None) a = Image.composite(image_1, Image.new("L", original.size, 255), mask) mask = Image.new(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __mergeImages(imagePaths):\n \n firstImage = QtGui.QPixmap(imagePaths[0])\n width = firstImage.width()\n height = firstImage.height()\n \n mergedImage = QtGui.QPixmap(width * len(imagePaths), height)\n bitMap = QtGui.QBitmap(mergedImage)\n bitMap.clear()\...
[ "0.64037347", "0.63618743", "0.63505536", "0.629857", "0.6273877", "0.6204203", "0.61489975", "0.61369604", "0.6136431", "0.6130856", "0.60212696", "0.6020025", "0.60197836", "0.601836", "0.5942631", "0.591092", "0.5900261", "0.5897348", "0.58788514", "0.58175296", "0.5793619...
0.7733901
0
Given tokenized sequences (either questions, answers or answer options, tokenized in ``__getitem__``), padding them to maximum specified sequence length. Return as a tensor of size ``(, max_sequence_length)``. This method is only called in ``__getitem__``, chunked out separately for readability.
def _pad_sequences(self, sequences): for i in range(len(sequences)): sequences[i] = sequences[i][: self.params[MAX_SENTENCE_LENGTH]] # Pad all sequences to max_sequence_length. maxpadded_sequences = torch.full((len(sequences), self.params[MAX_SENTENCE_LENGTH]), fill_value=PAD_INDEX...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pad_sequence(sequence, pad_tok=0, max_length=None):\n if max_length is None:\n max_length = max([len(seq) for seq in sequence])\n\n sequence_padded, seq_length = [], []\n for seq in sequence:\n seq_ = seq[:max_length] + [pad_tok] * max(max_length - len(seq), 0)\n sequence_padded.a...
[ "0.724999", "0.7037582", "0.6933426", "0.6910552", "0.6903208", "0.68649685", "0.6773222", "0.67585677", "0.67316025", "0.6707253", "0.6653943", "0.66226256", "0.6615774", "0.6614026", "0.66107464", "0.65937626", "0.65413606", "0.6540945", "0.6539719", "0.6512405", "0.6450956...
0.68808746
5
Create a box from a box object or by given arguments
def create_profile( cls, x: int = 0, y: int = 0, width: int = 0, height: int = 0, title: str = "", page_end: str = "", line_color: Color = None, title_color: Color = None, fill: bool = True, box=None, ) -> str: # out: st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_box(cls, box):\n if not isinstance(box, HBox):\n raise ValueError('Incorrect input type.')\n\n points = [(box.box[0], box.box[1]), (box.box[2], box.box[1]),\n (box.box[2], box.box[3]), (box.box[0], box.box[3])]\n\n conf = box.confidence\n\n return cl...
[ "0.67672217", "0.6443691", "0.6343993", "0.6209076", "0.61500406", "0.6104773", "0.6099118", "0.60815895", "0.6067214", "0.6046506", "0.6027242", "0.60107464", "0.6008285", "0.5962489", "0.5936616", "0.59344023", "0.59283787", "0.5913267", "0.5846785", "0.58409494", "0.581754...
0.0
-1
Override queryset to avoid attachment lookup while serializing. It will fetch attachments, and force ``pictures`` attribute of instances.
def get_queryset(self): qs = super().get_queryset() qs.prefetch_related(Prefetch('attachments', queryset=Attachment.objects.filter( is_image=True ).exclude(title='mapimage').order_by('-star...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self):\n return (\n super()\n .get_queryset()\n .select_related(\n \"document\",\n )\n )", "def get_pictures(self, obj):\n return [{\n \"category\": {\n \"id\": category.pk,\n ...
[ "0.6341298", "0.6077183", "0.6039366", "0.5979115", "0.59421843", "0.5928844", "0.58834845", "0.5865738", "0.58438504", "0.5799034", "0.5779878", "0.57661873", "0.5735454", "0.5734573", "0.57058346", "0.56965774", "0.56777364", "0.56731963", "0.5655218", "0.56436306", "0.5630...
0.7810722
0
Function to compute the basis given lengths and angles (in radians). The a lattice vectors will be aligned in x direction, and the be will be in the xy plane.
def compute_basis(self, lengths, angles_radians): # Convert lengths to basis. basis = np.zeros((3, 3), dtype=float) basis[0][0] = lengths[0] basis[0][1] = lengths[1] * np.math.cos(angles_radians[2]) basis[0][2] = lengths[2] * np.math.cos(angles_radians[1]) basis[1][1] = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_aligned_basis(self):\n\n angles = self.get_lattice_angles_radians()\n lengths = self.get_lattice_parameters()\n return self.compute_basis(lengths, angles)", "def set_basis(self, basis=None, lengths=None, angles=None):\n\n c_basis = basis\n\n if c_basis is None and lengt...
[ "0.6805443", "0.667597", "0.6067706", "0.557387", "0.55522114", "0.5525432", "0.54821724", "0.542766", "0.53810894", "0.5322827", "0.5281787", "0.5274864", "0.52708024", "0.5259608", "0.5243021", "0.52181876", "0.5200745", "0.5191755", "0.5174369", "0.51485837", "0.51242787",...
0.8038135
0
Function to get the lattice vectors for this cell. Returns
def get_lattice_vectors(self): return self.lattice_vectors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getLatticeVectors(self):\n return [self.lattVec1, self.lattVec2, self.lattVec3]", "def lattice_vectors(self, space=\"r\"):\n if space.lower() == \"r\":\n return self.lattice.matrix\n if space.lower() == \"g\":\n return self.lattice.reciprocal_lattice.matrix\n ...
[ "0.83521456", "0.7854896", "0.7854896", "0.72898835", "0.70946527", "0.70946527", "0.70946527", "0.7088543", "0.69945604", "0.6949278", "0.6823675", "0.6693795", "0.6626122", "0.6566221", "0.65405214", "0.6539646", "0.6505351", "0.6503812", "0.64637166", "0.6452513", "0.64454...
0.8769504
0
Function to get the basis vectors aligned such that a vector is parallel to the xaxis, and the b vector is in the xy plane.
def get_aligned_basis(self): angles = self.get_lattice_angles_radians() lengths = self.get_lattice_parameters() return self.compute_basis(lengths, angles)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solve_ax_b(amat, bvec):\n matrix = np.eye(amat.shape[0]) - amat\n return np.linalg.solve(matrix, bvec)", "def covariant_coordinates(basis, vectors):\n\n M, N = np.shape(basis)\n \n metric_tensor = np.zeros((N,N))\n\n metric_tensor = basis.dot(basis.T)\n # for i in range(0, N):\n # ...
[ "0.62672615", "0.61980593", "0.6137229", "0.6024117", "0.6021913", "0.60052747", "0.5968482", "0.59271836", "0.5871967", "0.5825086", "0.5797013", "0.5783823", "0.576554", "0.57413876", "0.57111746", "0.57003427", "0.5693094", "0.5690178", "0.5681939", "0.5680813", "0.5672793...
0.59509593
7
Build a dictionary containing everthing we know about a user.
def build_profile(first,last, **user_info): profile = {} profile['first_name'] = first profile['last_name'] = last for key, value in user_info.items(): profile[key] = value return profile
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_helper(user) -> dict:\n return {\n \"id\": str(user[\"_id\"]),\n \"fullname\": user[\"fullname\"],\n \"email\": user[\"email\"],\n \"properties\": user[\"properties\"]\n }", "def get_user_info(user: User)-> dict:\n data = {\n 'user_id': user.id,\n 'user...
[ "0.73860776", "0.725986", "0.71557593", "0.70810914", "0.703474", "0.7012243", "0.69999564", "0.68585867", "0.6835764", "0.6715256", "0.6633476", "0.6627332", "0.6622981", "0.66072", "0.66070515", "0.66042876", "0.66042876", "0.6512663", "0.6492661", "0.6491629", "0.6455168",...
0.5995101
96
Convert a letter to a onehot tensor
def letter_to_onehot(letter): validate_letter_input(letter) # create a tensor with a 1 at the letter's index and zeros everywhere else i = char_to_i[letter] onehot = torch.zeros(hps['onehot_length']) onehot[i] = 1 # reshape into the shape that the LSTM module requires for inputs onehot = on...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chars_to_onehot(text: str, char_to_idx: dict) -> Tensor:\n # TODO: Implement the embedding.\n # ====== YOUR CODE: ======\n N = len(text)\n D = len(char_to_idx)\n\n result = torch.zeros([N, D], dtype=torch.int8)\n\n char_count = 0\n for c in text:\n result[char_count, char_to_idx[c]]...
[ "0.792187", "0.7699312", "0.7499532", "0.7490904", "0.74880266", "0.74651283", "0.7439104", "0.7415418", "0.74121106", "0.73905474", "0.73892546", "0.73788327", "0.7366564", "0.7306587", "0.728869", "0.72790873", "0.7261279", "0.7255736", "0.7254551", "0.7254551", "0.72538334...
0.84730846
0
Test for ValueError when providing bad max_depth
def test_invalid_max_depth(self) -> None: model = torch.nn.Conv2d(3, 8, 3) summary = get_module_summary(model) with self.assertRaisesRegex(ValueError, "Got -2."): prune_module_summary(summary, max_depth=-2) with self.assertRaisesRegex(ValueError, "Got 0."): prune_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validateDepth(self, depth):\r\n try:\r\n depth = int(depth)\r\n except ValueError: # make error message nicer\r\n raise ValueError(\"Invalid depth '{}' provided\".format(depth))\r\n if depth < 0:\r\n raise ValueError(\"Maximum depth cannot be negative\")\r\...
[ "0.7535115", "0.71549565", "0.67827374", "0.656631", "0.64039266", "0.63597184", "0.6342759", "0.6265841", "0.6244583", "0.6203614", "0.61591446", "0.61438024", "0.6119622", "0.6106816", "0.6044291", "0.6008601", "0.5985652", "0.5969763", "0.5843743", "0.5780377", "0.5770316"...
0.78855705
0
Concatenate matrix for all `cities` but keep track from which city each point come from.
def join_cities(cities): features = None for idx, city in enumerate(cities): mat = load_matrix(city)['v'] coming_from = idx*np.ones((1, mat.shape[0])).ravel() if features is not None: features = np.vstack([features, mat]) origin = np.hstack([origin, coming_from])....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_cities(cities, reduced, origin, features):\n for idx, city in enumerate(cities):\n autochthons = origin == idx\n original = sio.loadmat(city+'_fv')\n coords = reduced[autochthons, :]\n cats = features[autochthons, 5] * 8e5\n newv = np.hstack([coords, coords, cats.res...
[ "0.6077832", "0.5556268", "0.5553289", "0.5459992", "0.54433453", "0.54067814", "0.5381416", "0.5264378", "0.5260821", "0.5084171", "0.50365984", "0.49414536", "0.49386215", "0.49190572", "0.49181315", "0.4909665", "0.48982742", "0.4886436", "0.48790336", "0.48738608", "0.480...
0.78302723
0
Initialize a List object.
def __init__(self, uuid_formatter, *, selection=None): self.uuid_formatter = uuid_formatter self.selection = selection
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, l):\n self._list = l", "def __init__(self):\n self._list = []", "def __init__(self):\n self._list = []", "def __init__(self):\n\n # Execute the base class __init__() method.\n super(RelaxListType, self).__init__()\n\n # Some generic initial names.\...
[ "0.7907375", "0.73788065", "0.73788065", "0.73751867", "0.73518544", "0.73299915", "0.7300695", "0.7294387", "0.7294387", "0.70910347", "0.7049147", "0.70166445", "0.7011282", "0.6940314", "0.6938481", "0.69245815", "0.6920756", "0.6916371", "0.68926126", "0.68897855", "0.687...
0.0
-1
Generate the display string for a boolean property
def gen_string(has_property, code): # must check membership in dbus.Boolean, because dbus.Boolean is # not a subclass of bool, but of int. prefix = ( "?" if not isinstance(has_property, Boolean) else (" " if has_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return 'true' if self.value is True else 'false'", "def render_boolean(value):\n if type(value) != bool:\n raise TypeError('The \\'value\\' parameter must be a boolean')\n return 'true' if value else 'false'", "def properties_string(mopool):\n\n d...
[ "0.80439", "0.72201306", "0.7143681", "0.7094541", "0.6945949", "0.688795", "0.6719269", "0.6694775", "0.6580484", "0.65002775", "0.64888954", "0.6472476", "0.64416486", "0.64250004", "0.64140433", "0.63696057", "0.63432693", "0.6303147", "0.6297635", "0.628941", "0.6231029",...
0.675354
6
Ensures all input map values are tensors. This should be called from inside the import name scope.
def _ConvertInputMapValues(name, input_map): if not all(isinstance(v, tensor.Tensor) for v in input_map.values()): if name == '': # pylint: disable=g-explicit-bool-comparison raise ValueError( 'tf.import_graph_def() requires a non-empty `name` if `input_map` ' 'contains non-Tensor value...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dict_withtensor_inputs(self):\n with tf.Graph().as_default():\n model, inputs, target = self.build_simple_model()\n model.fit({ placeholder: inpData for _, placeholder, inpData in inputs }, target, batch_size = 1)", "def _normalize_generate_inputs(\n self,\n in...
[ "0.60920596", "0.6046218", "0.5958672", "0.5929381", "0.587021", "0.5510884", "0.54531896", "0.54463565", "0.5398967", "0.5335816", "0.53251094", "0.53042233", "0.52687824", "0.52672726", "0.5266582", "0.5248581", "0.52436084", "0.5214136", "0.5203637", "0.5189423", "0.518622...
0.69180095
0
Normalize across probabilities, treating each as independent. So, each is normalized by dividing by the sum of all probabilities.
def normalize_probs(self, probabilities): total = sum(probabilities.values()) norm_probabilities = {class_name: prob / total for class_name, prob in probabilities.items()} return norm_probabilities
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize(probabilities):\n for person in probabilities:\n for distribution in [\"gene\", \"trait\"]:\n prob_sum = reduce(lambda x, y: x + y, list(probabilities[person][distribution].values()))\n for prob_key in probabilities[person][distribution]:\n probabilities...
[ "0.74586284", "0.74047095", "0.7370576", "0.7326194", "0.7322802", "0.7283154", "0.72705543", "0.7125172", "0.69317013", "0.67251426", "0.6698762", "0.66088843", "0.66085", "0.6602376", "0.65646183", "0.65510786", "0.65461653", "0.65302825", "0.6521841", "0.6496834", "0.64888...
0.7353045
3
Return date video was uploaded to YouTube in the form YEARMONTHDAY
def get_upload_date(html_string): soup = BeautifulSoup(html_string, 'lxml') try: return soup.select_one('meta[itemprop="uploadDate"][content]')['content'] except TypeError: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time_of_most_recent_uploaded_video():\n resent_date_time = ''\n search_results = youtube_search_keyword('today news', 10)\n\n if search_results == {}:\n return\n\n for result in search_results:\n video_date_time_obj = get_date_time_object_from_string(\n result['snippet'...
[ "0.6340946", "0.58012974", "0.5568881", "0.5418434", "0.5412753", "0.53533113", "0.53506273", "0.5318703", "0.5301549", "0.5290187", "0.52794856", "0.52753747", "0.5256393", "0.5232155", "0.5230594", "0.5187649", "0.51841545", "0.5167272", "0.5164649", "0.512035", "0.5096659"...
0.0
-1
Gets the destination of this UpdateRuleAclDto.
def destination(self): return self._destination
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDestination(self):\n return self.__destination", "def get_destination(self):\n return self._destination", "def getDestination(self):\n return self.get(\"dest\")", "def destination(self) -> pulumi.Output['outputs.DestinationResponse']:\n return pulumi.get(self, \"destination...
[ "0.61518586", "0.60630715", "0.60268295", "0.58724153", "0.57101697", "0.5672933", "0.56689787", "0.56512964", "0.56408316", "0.5550081", "0.54917145", "0.5449856", "0.5449676", "0.54479307", "0.54446816", "0.5430264", "0.5430264", "0.5418601", "0.5374777", "0.53379923", "0.5...
0.603589
2
Returns the string representation of the model
def to_str(self): import simplejson as json if six.PY2: import sys reload(sys) sys.setdefaultencoding("utf-8") return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _repr_model_(self):\n return str(self)", "def __str__(self):\n\n return str(self.model)", "def get_model_string(self):\n raise NotImplementedError()", "def __str__(self):\n return self.model", "def serialize_model(self):\n return dill.dumps(self.model)", "def __str_...
[ "0.8602374", "0.85093755", "0.8237104", "0.8050309", "0.80128866", "0.79348034", "0.78766525", "0.77898884", "0.7786461", "0.7745792", "0.7627315", "0.76055235", "0.757999", "0.7514394", "0.75038797", "0.75035286", "0.74850684", "0.7440529", "0.74325883", "0.74239755", "0.740...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n return not self == other", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other):\n return self.__dict__ != other.__dict__", "def __eq__(self, other):\n return not self.__ne__(other)", ...
[ "0.8410411", "0.8391477", "0.8172175", "0.81410587", "0.80920255", "0.8088807", "0.80676955" ]
0.0
-1
Find 2^n that is equal to or greater than.
def nextpow2(self, i): n = 0 while (2**n) < i: n += 1 return n
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_power_of_2(N): \n return (N & (N - 1) == 0) and N != 0", "def isqrt_lte(n):\n if n == 0: return 0\n q, r = divmod(n.bit_length(), 2)\n x = 2 ** (q + r)\n while True:\n y = (x + n // x) >> 1\n if y >= x:\n return x\n x = y", "def get_highest_power_of_2(n)...
[ "0.7239654", "0.7233626", "0.70848995", "0.7017832", "0.69404656", "0.6838112", "0.6825995", "0.67551196", "0.67126393", "0.6678811", "0.66404283", "0.6555926", "0.6543209", "0.65370893", "0.65067047", "0.6504647", "0.6479732", "0.6474798", "0.63794285", "0.6316462", "0.63155...
0.58467555
82
A SoftMax layer (no linear projection) with optional temperature
def SoftMax(x, use_temperature=False, temperature_init=1.0): if use_temperature: t = tf.get_variable('invtemp', [], initializer=tf.constant_initializer(1.0 / float(temperature_init))) x = x * t return tf.nn.softmax(x, name='output')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_softmax_temperature(self, new_temperature):\n self._softmax_temperature.assign(\n tf.constant(new_temperature, dtype=tf.float32))", "def softmax():\r\n\r\n\treturn activations.softmax", "def _darknet_softmax_output(inputs, params, attrs, prefix):\n temperature = attrs.get(\"temperature\", ...
[ "0.6629616", "0.64809847", "0.6472863", "0.640344", "0.6276721", "0.6224897", "0.61906517", "0.6147863", "0.6125148", "0.60873497", "0.60767287", "0.60378206", "0.5921203", "0.5921203", "0.5866525", "0.5826023", "0.58119315", "0.58099097", "0.57771444", "0.5772689", "0.575644...
0.7586775
0
Get the number of nodes.
def __len__(self): return self._n_nodes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_num_nodes(self):\n return self._num_nodes", "def get_num_nodes():\n return _num_nodes", "def number_of_nodes(self) -> int:\n return self._nodes_count", "def node_count(self) -> int:\n return pulumi.get(self, \"node_count\")", "def get_num_nodes(self):\n return self.as...
[ "0.9037251", "0.89960074", "0.8845691", "0.8838913", "0.8819332", "0.8816823", "0.87971145", "0.8760646", "0.87146", "0.866118", "0.8610361", "0.86057854", "0.85515827", "0.85515827", "0.85511833", "0.8538582", "0.8531174", "0.8491073", "0.84353626", "0.8391165", "0.8377785",...
0.78679115
43
Get the line_width value.
def line_width(self): return self._connect.width
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def line_width(self):\n return denormalize(self._line_width)", "def line_width(self, *args, **kwargs):\n return _qtgui_swig.const_sink_c_line_width(self, *args, **kwargs)", "def line_width(self, *args, **kwargs):\n return _qtgui_swig.const_sink_c_sptr_line_width(self, *args, **kwargs)", ...
[ "0.8302502", "0.78652155", "0.7675106", "0.7414525", "0.7326334", "0.73192585", "0.73117644", "0.73082554", "0.727725", "0.7256059", "0.7240899", "0.72364867", "0.7193499", "0.7186456", "0.714585", "0.7127945", "0.71105945", "0.7069506", "0.7060201", "0.7045656", "0.6929279",...
0.8385755
0
Get the color_by value.
def color_by(self): return self._color_by
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getColor(self, x):\r\n return self._color[x]", "def get_color(self):\n return self.color", "def color(self):\n return self.uniform_buffer.data[\"color\"]", "def get_color(self) -> tuple:\n return self._color", "def color(self):\n return Predator.color_dict[self.color_...
[ "0.759711", "0.7485609", "0.7477794", "0.7452367", "0.7441372", "0.7436143", "0.7436143", "0.7436143", "0.7378981", "0.730971", "0.72901934", "0.72669184", "0.72669184", "0.7240156", "0.72035867", "0.72035867", "0.71981484", "0.71885276", "0.7126667", "0.7125752", "0.71148944...
0.7834975
0
Get the alpha value.
def alpha(self): return self._alpha
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAlpha(self):\n return self.alpha", "def get_alpha(self):\n return self.alpha", "def alpha(self) -> float:\n return self._alpha", "def alpha(self) -> float:\n\n return self._alpha", "def Alpha(self):\n return self._alpha", "def obtener_alpha(self):\n\t\treturn self....
[ "0.87750465", "0.87476975", "0.8457503", "0.8417643", "0.84138185", "0.8370622", "0.83089125", "0.8275951", "0.8034226", "0.7789022", "0.7692026", "0.76258963", "0.7577983", "0.75463873", "0.75022465", "0.74567586", "0.743743", "0.74210995", "0.73554623", "0.7351204", "0.7344...
0.86048347
3
Sets the authors of this PluginContainer.
def authors(self, authors): if authors is None: raise ValueError("Invalid value for `authors`, must not be `None`") # noqa: E501 self._authors = authors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_authors(self, authors):\n\t\tself.authors = authors", "def authors(self, authors):\n user_objs = []\n\n for author in authors:\n if not isinstance(author, User):\n author = User(identifier=author.strip())\n user_objs.append(author)\n\n self._autho...
[ "0.8114216", "0.6757091", "0.6644804", "0.6548917", "0.653017", "0.64759254", "0.64484155", "0.63785183", "0.63785183", "0.63785183", "0.635664", "0.63277614", "0.6189719", "0.61286074", "0.6043951", "0.6042772", "0.59709406", "0.59482795", "0.5945658", "0.59429723", "0.59076...
0.6938322
1
Sets the id of this PluginContainer.
def id(self, id): if id is None: raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setId(self, id):\n self.id = id", "def plugin_id(self, plugin_id):\n\n self._plugin_id = plugin_id", "def id(self, id: str):\n\n self._id = id", "def id(self, id: str):\n\n self._id = id", "def id(self, id: str):\n\n self._id = id", "def id(self, id):\n \n ...
[ "0.7165538", "0.7066045", "0.69602096", "0.69602096", "0.69602096", "0.6922787", "0.6922787", "0.6922787", "0.6922787", "0.6922787", "0.69065434", "0.6905929", "0.6905929", "0.6905929", "0.6905929", "0.6905929", "0.6905929", "0.6905929", "0.6905929", "0.6905929", "0.6905929",...
0.0
-1
Sets the name of this PluginContainer.
def name(self, name): if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(self, name):\n self.options['name'] = name", "def set_name(self, name=''):\n self._name = name", "def set_name(self, name):\n pass", "def set_name(self, name):\n self._name = name", "def set_name(self, name):\n self._name = name", "def set_name(self, name):...
[ "0.7564102", "0.7545566", "0.7389165", "0.7386589", "0.7386589", "0.7386589", "0.7386589", "0.7386589", "0.7386589", "0.7385984", "0.73627746", "0.73627746", "0.73627746", "0.73627746", "0.73627746", "0.7272366", "0.7153433", "0.7124301", "0.7121851", "0.7074982", "0.7074982"...
0.0
-1
Sets the description of this PluginContainer.
def description(self, description): self._description = description
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_description(self, description):\n self.__description = description", "def set_description(self, description):\n self.description = description", "def set_description(self, description):\n self.description = description", "def set_description(self, description):\n self._des...
[ "0.8041228", "0.79684347", "0.79684347", "0.7955", "0.79323554", "0.79005605", "0.7854367", "0.78327894", "0.7757031", "0.77025956", "0.7637566", "0.7637566", "0.7637566", "0.7637566", "0.7637566", "0.7625769", "0.7625769", "0.7625769", "0.7625769", "0.7625769", "0.7625769", ...
0.7642314
44
Returns the string representation of the model
def to_str(self): return pprint.pformat(self.to_dict())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _repr_model_(self):\n return str(self)", "def __str__(self):\n\n return str(self.model)", "def get_model_string(self):\n raise NotImplementedError()", "def __str__(self):\n return self.model", "def serialize_model(self):\n return dill.dumps(self.model)", "def __str_...
[ "0.86030954", "0.85091114", "0.8235956", "0.80497414", "0.80114347", "0.793421", "0.78784716", "0.77902746", "0.7789831", "0.77466464", "0.7629886", "0.7608351", "0.7582489", "0.7515188", "0.75065583", "0.7504687", "0.74877244", "0.744343", "0.74351317", "0.74271595", "0.7407...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n return not self == other", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other):\n return self.__dict__ != other.__dict__", "def __eq__(self, other):\n return not self.__ne__(other)", ...
[ "0.8410411", "0.8391477", "0.8172175", "0.81410587", "0.80920255", "0.8088807", "0.80676955" ]
0.0
-1
Here we make a subspace by using a boolean mask that needs to be of the same size as the number of vectors. Used for the cross validation
def subspace_mask(self, mask): if mask.shape[0] != len(self.vecs): raise Exception('Subspace mask must be the same size as length of vectors') return type(self)(list(itertools.compress(self.vecs, mask)), space=self.space, is_orthonormal=self.is_orthonormal, values_flat=self.values_flat[:,:,m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def semisupervised_mask(unlabeled_size: int, labels: torch.Tensor):\n\n labels = labels.view(-1, 1)\n labeled_size = labels.size(0)\n mask_size = unlabeled_size + labeled_size\n mask = torch.zeros(mask_size, mask_size, dtype=torch.float32).to(labels.device)\n\n L = torch.eq(label...
[ "0.59766567", "0.58777404", "0.586942", "0.5778879", "0.5646571", "0.5626275", "0.56171805", "0.5602063", "0.555558", "0.5539246", "0.55375487", "0.552794", "0.5524552", "0.55172336", "0.5502885", "0.5480528", "0.5424234", "0.54083776", "0.5406236", "0.5396231", "0.5394914", ...
0.6521035
0
Given a string like 'mass/(lengthtime)', return the list ['mass', 'length', 'time'].
def vars_in_str(s): return re.findall('[a-z|_]+', s)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenizer(string: str) -> list:\n stop = [' ', '+', '-', '*', '/', '^', '(', ')', ',']\n tokens = []\n is_num: bool = False\n t_start: int = 0\n t_length: int = 0\n i: int = 0 # replacing for with while for recalculating current loop\n while i < len(string):\n if string[i] in stop:...
[ "0.6575522", "0.6004709", "0.59677345", "0.5827069", "0.57360595", "0.5683441", "0.56831443", "0.5658173", "0.55993", "0.553727", "0.549611", "0.54853106", "0.54652786", "0.54455817", "0.5432272", "0.5408703", "0.5407403", "0.5392076", "0.5387863", "0.537943", "0.53463286", ...
0.51013434
48
Create the symbolic unit with given name. A symbolic unit is a class that derives from symbolic expression, and has a specialized docstring.
def str_to_unit(name): return UnitExpression(SR, SR.var(name))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Symbol(name):\n return Expr(name)", "def __new__(cls, \n name, \n composed_unit, \n is_si=False):\n # pylint: disable=W0613\n\n if name not in REGISTRY:\n REGISTRY[name] = super(NamedComposedUnit, \n cl...
[ "0.6589944", "0.60879487", "0.6004834", "0.6004289", "0.6004289", "0.58078", "0.5666329", "0.5627522", "0.5528241", "0.5495634", "0.54824275", "0.5447692", "0.54404116", "0.54169685", "0.54009247", "0.53601146", "0.5337746", "0.5301998", "0.5278827", "0.5272762", "0.52594525"...
0.68527114
0
Compare two collections of units, or a collection of units with some other object.
def __cmp__(self, other): if not isinstance(other, Units): return cmp(type(self), type(other)) return cmp((self.__name, self.__data), (other.__name, other.__data))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def op__cmp(self, other):\n\n if len(self.objectSet) < len(other):\n smaller = self.objectSet\n larger = other\n else:\n smaller = other\n larger = self.objectSet\n\n for item in smaller.keys():\n if item not in larger:\n re...
[ "0.6316681", "0.62389725", "0.6060638", "0.603684", "0.60241336", "0.598853", "0.5947646", "0.59337115", "0.58982843", "0.58644354", "0.5842017", "0.58030206", "0.5780082", "0.57791156", "0.57645977", "0.57332045", "0.57258165", "0.57065916", "0.57009697", "0.5695485", "0.568...
0.7501214
0
Return string representation of this collection of units.
def __repr__(self): name = ' of ' + self.__name if self.__name else '' return "Collection of units{0}: {1}".format(name, ' '.join(sorted([str(x) for x in self.__data])))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n\n return str(self.unit_type) + \" \" + str(self.number)", "def __str__(self) -> str:\n return f\"{self.value}{self.unit}\"", "def __str__(self):\n output = [['id', self.id],\n ['name', self.name],\n ['a-axis', '{:.4~P}'.format(self.a_...
[ "0.75500876", "0.73561305", "0.73037744", "0.72919", "0.72038084", "0.71787834", "0.7175665", "0.71465296", "0.71124494", "0.7087026", "0.70816344", "0.69163543", "0.69130737", "0.6902135", "0.6894906", "0.68936706", "0.6850603", "0.6848696", "0.68430626", "0.6800838", "0.677...
0.8278317
0
Converts units between expr and target. If target is None then converts to SI base units.
def convert(expr, target): base_target = target z = {} tz = {} for x in expr.variables(): if is_unit(x): if unit_to_type[str(x)] == 'temperature': return convert_temperature(expr, target) else: z[x] = base_units(x) expr = expr.subs(z)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_units(value: int, target: str):\n rates = {\"CM\": 2.54, \"INCH\": 0.44, \"KG\": 0.45, \"IBS\": 2.2,\n \"FEET\": 30.48}\n return value * rates[target]", "def unit_conversion_factor(source, target):\n\n if not source or not target:\n return 1\n if source == t...
[ "0.6876453", "0.6435725", "0.63466644", "0.5749984", "0.57284087", "0.5727191", "0.5484606", "0.5465258", "0.54604244", "0.54436505", "0.54279274", "0.54051346", "0.5398031", "0.5380917", "0.5372369", "0.5316928", "0.5306577", "0.53060746", "0.52836746", "0.5237742", "0.52334...
0.7746476
0
Converts unit to base SI units.
def base_units(unit): from sage.misc.all import sage_eval if str(unit) not in unit_to_type: return unit elif unit_to_type[str(unit)] == 'si_prefixes' or unit_to_type[str(unit)] == 'unit_multipliers': return sage_eval(unitdict[unit_to_type[str(unit)]][str(unit)]) else: v = SR.var(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def si_unit_conversion(self):\n pass", "def unitConverter(self,value):\r\n assert type(value) == str\r\n \r\n try:\r\n return float(value)\r\n except:\r\n self.isSIUnit(value)\r\n\r\n multiplier = 1\r\n unitPrefixes = ...
[ "0.7657606", "0.7070373", "0.69649446", "0.66204184", "0.64390326", "0.6430932", "0.62886006", "0.62617683", "0.6206096", "0.6201554", "0.6182535", "0.6172992", "0.6087092", "0.6064463", "0.6055422", "0.5979407", "0.59707", "0.5925398", "0.5922627", "0.5922627", "0.5920383", ...
0.65412235
4
Tests whether ``ComponentMetadataRow.copy_with_keyword_parameters`` works as intended.
def test__ComponentMetadataRow__copy_with_keyword_parameters__0(): components = [Component(ComponentType.button, label = 'chata')] component_metadata = ComponentMetadataRow( components = components, ) copy = component_metadata.copy_with_keyword_parameters({}) _assert_fields_set(cop...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test__ComponentMetadataRow__copy_with_keyword_parameters__1():\n old_components = [Component(ComponentType.button, label = 'chata')]\n new_components = [Component(ComponentType.button, label = 'yuina')]\n \n component_metadata = ComponentMetadataRow(\n components = old_components,\n )\n ...
[ "0.805724", "0.6454219", "0.64509356", "0.6360048", "0.58925843", "0.5788691", "0.5611897", "0.556244", "0.5551214", "0.55429286", "0.548524", "0.5284078", "0.5225751", "0.5074175", "0.50651586", "0.50112265", "0.5002398", "0.5001126", "0.4983489", "0.49797085", "0.49707165",...
0.81069356
0
Tests whether ``ComponentMetadataRow.copy_with_keyword_parameters`` works as intended.
def test__ComponentMetadataRow__copy_with_keyword_parameters__1(): old_components = [Component(ComponentType.button, label = 'chata')] new_components = [Component(ComponentType.button, label = 'yuina')] component_metadata = ComponentMetadataRow( components = old_components, ) copy = com...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test__ComponentMetadataRow__copy_with_keyword_parameters__0():\n components = [Component(ComponentType.button, label = 'chata')]\n \n component_metadata = ComponentMetadataRow(\n components = components,\n )\n copy = component_metadata.copy_with_keyword_parameters({})\n \n _assert_f...
[ "0.8106694", "0.6454892", "0.64495015", "0.6360598", "0.5893318", "0.578822", "0.5611545", "0.5561476", "0.5551227", "0.55438024", "0.548456", "0.5285143", "0.5226763", "0.5073213", "0.5063713", "0.501259", "0.5002775", "0.5002204", "0.49838412", "0.49773094", "0.4971075", ...
0.8056663
1
Calculate the prior probability for a given parametersample.
def gauss_lnprior(self, gauss_par_sample): # Block any samples with a<0: gauss_par_sample = np.atleast_2d(gauss_par_sample) accept_idx = gauss_par_sample[:,0]>0 lnprior_vals = np.empty(len(gauss_par_sample)) lnprior_vals[accept_idx]= super(Sn1aOpticalEnsemble, self).gauss_lnprior...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ln_prior(self):\n\t\tlnp = 0.0\n\t\tfor param in self.pars:\n\t\t\tlnp += param.prior.ln_prob(param.currVal)\n\t\treturn lnp", "def get_prior_params():\n return 0., 1.", "def log_prior(self):\n\n\n lp = 0\n lp += Dirichlet(self.pi).log_probability(self.m)\n lp += Beta(self.tau1 * np...
[ "0.661319", "0.6591389", "0.64158183", "0.63842076", "0.635648", "0.6342497", "0.6307181", "0.6305238", "0.62920314", "0.6288015", "0.6260013", "0.62532806", "0.62205666", "0.62114125", "0.6203457", "0.6189099", "0.61799586", "0.6161715", "0.6139422", "0.61320806", "0.6116338...
0.0
-1
Verify that get_features produces the right padding.
def test_invalid_range_is_correctly_padded(self): observation = self.create_observation() self.features.observe(observation) vector = self.features.get_features() wind_column = vector[16:] # Remove ambient features. # The balloon should be at level 80, which corresponds to [0, 100] and # [281...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_pad_feature(self):\n # Check no padding for context features\n feature_tensor = self.parser.pad_feature(tf.zeros((10)),\n self.feature_config.get_feature(\"query_text\"))\n assert feature_tensor.shape == (10,)\n\n # Check padding ...
[ "0.70609677", "0.65794826", "0.6303214", "0.601684", "0.56784326", "0.5649317", "0.5625338", "0.56060576", "0.56056803", "0.5548559", "0.55484265", "0.5545805", "0.55213505", "0.54738986", "0.5460593", "0.5447951", "0.5447951", "0.54375815", "0.5428842", "0.54273736", "0.5411...
0.0
-1
Verify that get_features produces the right padding.
def test_valid_winds(self): observation = self.create_observation() self.features.observe(observation) vector = self.features.get_features() wind_column = vector[16:] # Remove ambient features. # This test relies on the fact that SimpleStaticWindField should return # a forecast that is exactl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_pad_feature(self):\n # Check no padding for context features\n feature_tensor = self.parser.pad_feature(tf.zeros((10)),\n self.feature_config.get_feature(\"query_text\"))\n assert feature_tensor.shape == (10,)\n\n # Check padding ...
[ "0.70624197", "0.657602", "0.63014174", "0.60120845", "0.5673968", "0.5647168", "0.56229746", "0.56045556", "0.56043166", "0.5552977", "0.55445355", "0.55417645", "0.5524033", "0.547133", "0.5458293", "0.5444001", "0.5444001", "0.54328936", "0.54248506", "0.54247266", "0.5409...
0.0
-1
Ensure id is set with options passed to init are set on the message.
def test_id_is_passed_in_with_options(self): from furious.batcher import Message _id = "id" options = {'id': _id, 'value': 1, 'other': 'zzz', 'nested': {1: 1}} message = Message(id=_id, value=1, other='zzz', nested={1: 1}) self.assertEqual(options, message._options)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__, *,\n id: Optional[pulumi.Input[str]] = None):\n if id is not None:\n pulumi.set(__self__, \"id\", id)", "def __init__(__self__, *,\n id: Optional[str] = None):\n if id is not None:\n pulumi.set(__self__, \"id\", id)", "d...
[ "0.69447064", "0.6849297", "0.6849297", "0.669741", "0.6566078", "0.65478355", "0.6489752", "0.6489752", "0.6489752", "0.6489752", "0.6489752", "0.646648", "0.63888794", "0.6286707", "0.62188387", "0.61821353", "0.6172847", "0.60883206", "0.6061435", "0.606094", "0.60494846",...
0.7370096
0
Ensure get_queue returns the default queue if non was given.
def test_get_default_queue(self): from furious.batcher import Message message = Message() self.assertEqual('default-pull', message.get_queue())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"queue\")", "def test_get_queue(self):\n from furious.batcher import Message\n\n queue = \"test\"\n\n message = Message(queue=queue)\n\n self.assertEqual(queue, message.get_queue())", "def getQueue(sel...
[ "0.69039106", "0.6763392", "0.6583275", "0.64609116", "0.6452478", "0.64305913", "0.63812107", "0.636264", "0.6361638", "0.63522243", "0.6349935", "0.634615", "0.6345818", "0.6317066", "0.6282507", "0.62438893", "0.624249", "0.62375915", "0.6210983", "0.6203998", "0.6181925",...
0.78709614
0
Ensure from_dict returns the correct Message object.
def test_from_dict(self): from furious.batcher import Message task_args = {'other': 'zzz', 'nested': 1} options = {'id': 'id', 'task_args': task_args} message = Message.from_dict(options) self.assertEqual(task_args, message.get_task_args()) self.assertEqual(message.id...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dikt) -> 'Message':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'Messages':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, _dict: Dict) -> 'MessageRequest':\n args = {}\n if 'input' in _dict:\n args['input...
[ "0.8240035", "0.78508246", "0.77237177", "0.77207094", "0.7593466", "0.74409425", "0.73801476", "0.7223251", "0.71461296", "0.7135169", "0.71172225", "0.7110929", "0.7063306", "0.7019063", "0.6995303", "0.6943158", "0.6939059", "0.686147", "0.68250483", "0.67950034", "0.66360...
0.71368104
9
Returns the number of appended elements in buffer.
def size(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def len (self):\n return len (self._buf)", "def len(self):\n return len(self._buf)", "def buffer_count(self):\n self.send_command(\"GET_BUFFER_COUNT\")\n return int(self.latest_response)", "def __len__(self):\n with self.__cond:\n return self.__buffer.size", ...
[ "0.7145875", "0.7090326", "0.7072155", "0.7044706", "0.6904905", "0.67762375", "0.67348576", "0.6653807", "0.65296876", "0.6517756", "0.64656126", "0.6417424", "0.6333885", "0.63003105", "0.63003105", "0.6289002", "0.62882453", "0.6282477", "0.6232458", "0.62303597", "0.62257...
0.0
-1
Initialize initial conditions randomly
def random_init(offset=20): # setOpenBound(flags, bWidth,'yY',FlagOutflow|FlagEmpty) # inflow sources ----------------------------------------------------------------------# # Main params ----------------------------------------------------------------------# npSeed = -1 t = 0 if(npSeed>0): np.random.seed...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_model(self) -> None:\n if not self.A:\n self.A = uniform_random_initialization(self.nr_states, self.nr_states)\n if not self.B:\n self.B = uniform_random_initialization(self.nr_states, self.nr_emissions)\n if not self.pi:\n self.pi = count_based_...
[ "0.7082369", "0.7051715", "0.701714", "0.69569236", "0.69512343", "0.69506437", "0.68208164", "0.6744603", "0.6694288", "0.66872966", "0.6562823", "0.65369815", "0.6519221", "0.64957887", "0.649205", "0.6483634", "0.64753926", "0.6475212", "0.64702857", "0.643734", "0.6434139...
0.0
-1
Inserts an element to the Front of the Deque
def push_front(self, element): #1. Create a new node with the Element passed in! new_node = Node(element) #2. check if the Deque is Empty, if it is we will set head and tail to the node #3. If the Deque is not Empty, we will insert the new node where the head is ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push_front(self, val):\r\n self.deque.insert(0, val)", "def push_front(self, item):\n self.list.prepend(item)", "def insert_front(self, value):\r\n if self._front is None:\r\n new_node = _Deque_Node(value, None, None)\r\n self._rear = new_node\r\n self....
[ "0.7957556", "0.79042494", "0.78154576", "0.76943505", "0.7600301", "0.7493425", "0.72821254", "0.72782516", "0.71972996", "0.71765006", "0.7091586", "0.7068664", "0.7042059", "0.70281273", "0.7006709", "0.7000816", "0.6995221", "0.69937825", "0.69878614", "0.6978486", "0.695...
0.7748396
3
Inserts an element to the Back of the Deque
def push_back(self, element): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push_front(self, val):\r\n self.deque.insert(0, val)", "def insertFront(self, value):\r\n if len(self.deque) < self.k:\r\n self.deque = self.deque[::-1]\r\n self.deque.append(value)\r\n self.deque = self.deque[::-1]\r\n return True\r\n else:\r\...
[ "0.7305285", "0.7248034", "0.71954536", "0.7156064", "0.7150639", "0.7112135", "0.70204717", "0.7013831", "0.69993454", "0.6971014", "0.6943908", "0.69230974", "0.68986005", "0.68488467", "0.68471754", "0.6825565", "0.67860484", "0.67493695", "0.67136264", "0.6683518", "0.666...
0.7236668
2
Returns the string representation of the model
def to_str(self): import simplejson as json if six.PY2: import sys reload(sys) sys.setdefaultencoding("utf-8") return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _repr_model_(self):\n return str(self)", "def __str__(self):\n\n return str(self.model)", "def get_model_string(self):\n raise NotImplementedError()", "def __str__(self):\n return self.model", "def serialize_model(self):\n return dill.dumps(self.model)", "def __str_...
[ "0.8602374", "0.85093755", "0.8237104", "0.8050309", "0.80128866", "0.79348034", "0.78766525", "0.77898884", "0.7786461", "0.7745792", "0.7627315", "0.76055235", "0.757999", "0.7514394", "0.75038797", "0.75035286", "0.74850684", "0.7440529", "0.74325883", "0.74239755", "0.740...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n return not self == other", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other):\n return self.__dict__ != other.__dict__", "def __eq__(self, other):\n return not self.__ne__(other)", ...
[ "0.8410411", "0.8391477", "0.8172175", "0.81410587", "0.80920255", "0.8088807", "0.80676955" ]
0.0
-1
SPECTRAL_PROJECTION computes the PCE coefficient using the spectral projection method.
def spectral_projection(self, fun, level, verbose='y'): # create sparse grid # ------------------ if verbose == 'y': t1 = timer() print("* generation of smolyak sparse grid ... ", end=' ', flush=True) # self.grid = PceSmolyakGrid(self, level) #x, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _handlerProjectionChoice(self, event):\n \n cam = self._threedRenderer.GetActiveCamera()\n if not cam:\n return\n \n pcs = self.threedFrame.projectionChoice.GetSelection()\n if pcs == 0:\n # perspective\n cam.ParallelProjectionOff()\n ...
[ "0.56055087", "0.5532196", "0.5519699", "0.55067587", "0.5451859", "0.5299277", "0.52284306", "0.5144094", "0.5128767", "0.51218736", "0.5121222", "0.5108422", "0.5083736", "0.50692314", "0.5054885", "0.5042073", "0.5041494", "0.5032402", "0.50244224", "0.5024412", "0.5022427...
0.44968995
99
Return the current value of the owner's attribute.
def current_value(self): return getattr(self.owner, self.attribute)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value(self):\n return self.get_attribute('value')", "def value(self):\n return self.get_attribute(\"value\")", "def value(self):\n\n # we force update reference since this is a property\n self._update_reference(inform=False)\n return self._reference.get_attribute('value')...
[ "0.7541979", "0.7479793", "0.74215984", "0.7321664", "0.72856176", "0.72682005", "0.7263582", "0.7263009", "0.7207407", "0.7195659", "0.7180897", "0.71590364", "0.7149908", "0.7149908", "0.7147205", "0.7143437", "0.7122395", "0.71191955", "0.71191955", "0.71191955", "0.711919...
0.91456366
0
The default action to modify the property if there is no given action.
def default_action(self): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_action(cls):\n raise NotImplementedError(cls)", "def _set_action(self, action):\n raise NotImplementedError()", "def _set_action(self, action):\n raise NotImplementedError()", "def set_action(self,action):\r\n \r\n self.action = action", "def set_action(self, ...
[ "0.72397876", "0.71628743", "0.71628743", "0.71187353", "0.6991344", "0.6770802", "0.66562355", "0.6635231", "0.6604464", "0.6600567", "0.65597814", "0.650186", "0.6404198", "0.62989324", "0.6239748", "0.62375784", "0.6233225", "0.6152506", "0.61190456", "0.6110583", "0.60299...
0.7420347
0
Sets the name of the card when initializing the whole deck.
def setName(self, name): self.name = self.name + name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def card_holder_name(self, card_holder_name):\n\n self._card_holder_name = card_holder_name", "def card_holder_name(self, card_holder_name):\n\n self._card_holder_name = card_holder_name", "def card_bank_name(self, card_bank_name):\n\n self._card_bank_name = card_bank_name", "def set_nam...
[ "0.752315", "0.752315", "0.70208", "0.688894", "0.688894", "0.688894", "0.688894", "0.688894", "0.68465096", "0.6835024", "0.68180203", "0.68180203", "0.68180203", "0.68180203", "0.68180203", "0.6809974", "0.67973554", "0.6779622", "0.6777164", "0.6777164", "0.6777164", "0....
0.67310727
26
Sets the intitial classification of a card.
def setClassification(self, classification): self.classification = self.classification
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setClassifierType(self, classifier):\n if classifier != \"rf\" and classifier != \"svc\":\n raise ValueError(\"Classifier must be 'rf or 'svc'.\")\n else:\n self._classifierType = classifier\n if classifier == \"svc\" :\n self._ClassifierParameters ...
[ "0.60736704", "0.5771301", "0.576692", "0.576692", "0.576692", "0.56566", "0.56313086", "0.5511636", "0.5439657", "0.54361016", "0.5410635", "0.53939605", "0.53658444", "0.53417766", "0.5293392", "0.5289899", "0.52865344", "0.52655333", "0.519312", "0.5180535", "0.51781297", ...
0.703052
0
This function initializes the cards_dealt vector with all 0's.
def setCardsDealt(): cards_dealt = {} for i in range (0, 52): cards_dealt[i] = 0 return cards_dealt
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resetCards(self):\n self.cartas = []\n self.cartasJugadas = []\n self.ultimaCartaJugada = 0", "def reset(self):\n self.cards = list(range(self.num_cards))\n self._temp = [0]*self.num_cards", "def initialize_deck(self):\n cards = [(card, pattern) \n f...
[ "0.67151374", "0.66038996", "0.6258579", "0.61673105", "0.6127918", "0.60307765", "0.60122865", "0.5987486", "0.5982863", "0.59825164", "0.59601986", "0.5871208", "0.58023334", "0.57814866", "0.57791424", "0.57608086", "0.5720395", "0.571654", "0.5715677", "0.5705152", "0.569...
0.69379556
0
Create an iris cube for each metric.
def create_outcubes(metric_dict, atts, units_dict, time_coord): cube_list = [] for metadata, data in metric_dict.items(): hemisphere, direction, metric = metadata standard_name = '%s_%s_%s' %(hemisphere, direction, metric) long_name = '%s %s %s' %(hemisphere, direction, metric) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_up_test_cube():\n data = np.linspace(-45.0, 45.0, 9, dtype=np.float32).reshape((1, 3, 3)) + 273.15\n\n attributes = {\n \"um_version\": \"10.4\",\n \"source\": \"Met Office Unified Model\",\n \"Conventions\": \"CF-1.5\",\n \"institution\": \"Met Office\",\n \"histor...
[ "0.62685966", "0.60023206", "0.59132946", "0.5859383", "0.57990086", "0.57840115", "0.567472", "0.563414", "0.5591853", "0.5578561", "0.5533486", "0.5399388", "0.5370245", "0.5334785", "0.52587473", "0.5251646", "0.5245514", "0.5194757", "0.51854837", "0.518065", "0.51590943"...
0.6501304
0
Converts a numpy image representation to a base64 encoding of the image file with a metadata that is necessary to display it in Dash's image object can display images encoded in base64 format if they have necessary metadata flags which we also add.
def convert_numpy_to_base64_image_string(image_np): image_pil = Image.fromarray(image_np) buffer = BytesIO() image_pil.save(buffer, format="JPEG") base64_img_string = base64.b64encode(buffer.getvalue()) base64_img_string_with_metadata = "data:image/jpg;base64,{}".format(base64_img_str...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def np_to_base64(img_np):\n img = Image.fromarray(img_np.astype('uint8'), 'RGB')\n buffered = BytesIO()\n img.save(buffered, format=\"PNG\")\n return u\"data:image/png;base64,\" + base64.b64encode(buffered.getvalue()).decode(\"ascii\")", "def encodeImage(np_img_array):\n _, img_buffer = cv2.imenco...
[ "0.7388205", "0.72241145", "0.70346606", "0.7010675", "0.7002945", "0.6929437", "0.6911154", "0.68552786", "0.68299526", "0.6807346", "0.6793691", "0.67023075", "0.6641442", "0.6623969", "0.6609319", "0.65049976", "0.6459019", "0.6457918", "0.6418417", "0.64170647", "0.640869...
0.7963675
0
Add a value to the heap.
def add(self, val): # heapq is min heap if len(val) > 1: val = (val[0]*-1,) + val[1:] else: val = (val[0] * -1) heapq.heappush(self.data, val) if self.size == self.n: # max heap is full heapq.heappop(self.data) else: self.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push(self, val):\n self.heap.append(val)\n self.size += 1\n self.heapify_up(self.size-1)", "def insert(self, value):\n\n # add the new value to the end of the array\n self.heap_array.append(value)\n\n # percolate up from the last index to restore heap property\n ...
[ "0.8552448", "0.81189466", "0.79941046", "0.7992266", "0.79463154", "0.78544295", "0.7803345", "0.7739624", "0.7722025", "0.7703504", "0.7703504", "0.75932986", "0.75785697", "0.7500259", "0.74658287", "0.7375772", "0.7369499", "0.7369499", "0.73680794", "0.736706", "0.736174...
0.8620391
0
Returns the number of VMS that belongs to a certain Network.
def num_vms_by_network(self,vms=[],network=""): vm_count = 0 for vm in vms: if (vm.network == network): vm_count += 1 return vm_count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_networks(self) -> int:\n return self._count_model(Network)", "def num_vm(self):\n return int(self.get_detail(\"Relationships\", \"Instances\"))", "def get_miner_count(network, days):\r\n\r\n days_dt = timezone.now() - datetime.timedelta(days=days)\r\n miners_count = len(Transactio...
[ "0.6185679", "0.60636467", "0.55827594", "0.5570968", "0.55671567", "0.55302507", "0.550314", "0.5477923", "0.5439204", "0.5397344", "0.5397344", "0.53900605", "0.5388104", "0.5365746", "0.5292124", "0.5290548", "0.5290548", "0.52781725", "0.5274545", "0.52557224", "0.5235491...
0.720427
1
Appends a column of ones to the end of the vector. This takes care of bias term.
def append_one(vector): return np.append(vector, 1.0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_bias_column(data):\n new_data = np.ones((data.shape[0], data.shape[1] + 1))\n new_data[:,:-1] = data\n\n return new_data", "def prepend_one(self, col_vec):\n return np.insert(col_vec,0, np.array([[1]]),axis=0)", "def concat_with_bias(left_vector, right_vector):\n return np.vstack((le...
[ "0.6921061", "0.67890984", "0.64561844", "0.63758904", "0.63291234", "0.59936297", "0.59818536", "0.59316516", "0.5825945", "0.57970536", "0.5791228", "0.57175964", "0.5682151", "0.5669361", "0.5653014", "0.5608588", "0.5593365", "0.55852777", "0.5572478", "0.5535322", "0.553...
0.69856006
0
serialize the file path to JSON file path
def save(self): if self.__session: self.__session.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_path(self, path):\n data = self.to_json_map()\n with open(path, 'w') as f:\n json.dump(data, f)\n f.write('\\n')", "def to_json(self, filepath):\n data = self.to_data()\n with open(filepath, 'wb+') as fh:\n json.dump(data, fh)", "def to_path(s...
[ "0.7494173", "0.72986174", "0.7220175", "0.71656305", "0.715407", "0.7129192", "0.70673835", "0.6961152", "0.69605076", "0.6955084", "0.694811", "0.6911415", "0.6866298", "0.6795213", "0.6793787", "0.6775809", "0.67500746", "0.67070025", "0.6697362", "0.6691683", "0.66825217"...
0.0
-1
serialize the file path to JSON file path
def reload(self): try: Base.metadata.create_all(self.__engine) session_factory = sessionmaker(bind=self.__engine, expire_on_commit=False) self.__session = scoped_session(session_factory) except Exception as E: pri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_path(self, path):\n data = self.to_json_map()\n with open(path, 'w') as f:\n json.dump(data, f)\n f.write('\\n')", "def to_json(self, filepath):\n data = self.to_data()\n with open(filepath, 'wb+') as fh:\n json.dump(data, fh)", "def to_path(s...
[ "0.7494173", "0.72986174", "0.7220175", "0.71656305", "0.715407", "0.7129192", "0.70673835", "0.6961152", "0.69605076", "0.6955084", "0.694811", "0.6911415", "0.6866298", "0.6795213", "0.6793787", "0.6775809", "0.67500746", "0.67070025", "0.6697362", "0.6691683", "0.66825217"...
0.0
-1
Instantiate variational MeshNet model, which also uses weight normalization.
def meshnet_vwn(n_classes, input_shape, receptive_field=67, filters=71, activation='relu', is_mc=False, batch_size=None, name='meshnet_vwn'): if receptive_field not in {37, 67, 129}: raise ValueError("unknown receptive field. Legal values are 37, 67, and 129.") def one_layer(x, layer_num, dilation_rat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, weights, nb_classes = 39):\n\n self.mdl = model_keras.model_vt(nb_classes=nb_classes, dataset_name=\"modelnet\")\n\n self.mdl.load_weights(weights)", "def weight_init(net):\n classname = net.__class__.__name__\n if classname.find('Conv3d') != -1:\n nn.init.xavier_nor...
[ "0.6159605", "0.594115", "0.5848744", "0.57884306", "0.57262534", "0.57222795", "0.57114834", "0.57076937", "0.56970006", "0.5693937", "0.5693937", "0.566916", "0.5662545", "0.5658821", "0.56449914", "0.56092036", "0.56009746", "0.55980223", "0.55916554", "0.55900186", "0.558...
0.6374514
0
Create axis of x from 0 based on nodes and dx
def create_axis(nodes, L): dx = L/nodes axisx = [0] x = 0 for i in range(1, nodes+1): if i == 1: x = add_dec(x, dx/2) axisx.append(x) else: x = add_dec(x, dx) axisx.append(x) axisx.append(add_dec(x, dx/2)) return np.array(axisx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _x_axis_change(self, index):\n self._parameter_root['x_min'].value = 0\n self._parameter_root['x_max'].value = 0\n self._parameter_root['y_min'].value = 0\n self._parameter_root['y_max'].value = 0\n self._update_figure()", "def xrng(self, start, end):\n self.gnuplot....
[ "0.6007977", "0.5879359", "0.580237", "0.5795226", "0.57103455", "0.56521344", "0.5634749", "0.54902405", "0.54587305", "0.54330206", "0.54266244", "0.5371123", "0.53544205", "0.53492695", "0.5339239", "0.5328879", "0.53191423", "0.5294893", "0.5293862", "0.5288312", "0.52549...
0.70666695
0
Create two zerosarray based on nodes, one dimension and two dimensions
def create_zmatrix(nodes): return np.zeros([nodes, nodes]), np.zeros([nodes])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zeros(shape):\n return empty(shape, 0)", "def zero_array() -> np.ndarray:\n\n return np.zeros([3, 3])", "def initialize_with_zeros(dim):\n b = 0\n w = np.zeros(shape=(dim,1))\n\n assert(w.shape == (dim,1))\n assert(isinstance(b,float) or isinstance(b,int))\n return w,b", "def ini...
[ "0.62886333", "0.62705797", "0.60896176", "0.60601914", "0.60392046", "0.6026476", "0.60254294", "0.60055363", "0.5950271", "0.5892673", "0.5862331", "0.58358103", "0.5768548", "0.57636654", "0.57226896", "0.5721449", "0.5710438", "0.5697583", "0.569746", "0.5679559", "0.5618...
0.6562363
0
Creating axis of y for plotting
def prep_y(result): y_num = np.append(result, TB) y_num = np.insert(y_num, 0, TA) return y_num
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yrng(self, start, end):\n self.gnuplot.yaxis((float(start), float(end)))", "def set_y_axis(self, *args, **kwargs):\n return _qtgui_swig.freq_sink_c_set_y_axis(self, *args, **kwargs)", "def set_y_axis(self, *args, **kwargs):\n return _qtgui_swig.const_sink_c_set_y_axis(self, *args, **kw...
[ "0.7401538", "0.72062594", "0.714857", "0.7125816", "0.7099737", "0.7095846", "0.7092069", "0.7072433", "0.7053323", "0.7052339", "0.7046917", "0.70455617", "0.7012888", "0.6966542", "0.6965688", "0.6960736", "0.6950547", "0.6924921", "0.6923197", "0.6895327", "0.6869341", ...
0.0
-1
Get a logger with the specified name and default settings.
def get_logger(logger_name: str) -> Logger: logger = logging.getLogger(logger_name) logger.setLevel(logging.DEBUG) logger.addHandler(get_console_handler()) logger.addHandler(get_timed_file_handler()) logger.addFilter(RankFilter(LOCAL_RANK)) logger.propagate = False return logger
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_logger(name=None):\n return logging.getLogger(name)", "def get_logger(name=None):\n return logging.getLogger(name)", "def get_logger(name=None):\n logger = logging.getLogger(prefixed(name=name))\n return logger", "def logger(name):\n return Logging.get_logger(name)", "def logger(name...
[ "0.8107343", "0.8107343", "0.80788416", "0.7875959", "0.7875959", "0.7826842", "0.78240556", "0.78240556", "0.7822961", "0.78170085", "0.7780702", "0.7769565", "0.776851", "0.7766825", "0.77612376", "0.7708655", "0.7695993", "0.7668838", "0.7663566", "0.76589906", "0.7655778"...
0.7280746
44
is self different from other?
def __ne__(self,other): return self.x != other.x or self.y != other.y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def difference(self, other):\n pass", "def __ne__(self, other):\n return self.__dict__ != other.__dict__", "def __ne__(self, other):\n return not self==other", "def __ne__(self, other):\n return True", "def __ne__(self, other):\n\t\treturn self != other", "def __ne__(self,...
[ "0.7683563", "0.76475906", "0.7426551", "0.7420831", "0.7392932", "0.7375952", "0.7345055", "0.7345055", "0.7345055", "0.73433536", "0.73433536", "0.7339224", "0.7334552", "0.73331857", "0.73120284", "0.7304624", "0.7303046", "0.7303046", "0.7303046", "0.7303046", "0.7303046"...
0.0
-1
Gets staff of staff change.
def staff(self): return self._staff
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def teaching_staff(self):\n return self._teaching_staff", "def cdh_staff(self):\n return self.filter(cdh_staff=True)", "def fetch_staff(self, obj, user):\n members = models.Membership(conference=obj).fetch()\n return [member.staff for member in members]", "def staff(self, staff):\...
[ "0.681435", "0.6527543", "0.6409038", "0.60913277", "0.60913277", "0.6027696", "0.5939957", "0.5869871", "0.5869871", "0.5863572", "0.5799015", "0.5751786", "0.57273936", "0.5716238", "0.5667007", "0.5624864", "0.5556216", "0.55540705", "0.55409306", "0.5491055", "0.54809916"...
0.7652591
1
Get's the cluster Id of the EMR cluster based on cluster name
def _get_cluster_id(self): cluster_id = self.current_state_definition.get('Cluster', {}).get("Id") if not cluster_id: emr_clusters = self.client.list_clusters(ClusterStates=["STARTING","BOOTSTRAPPING","RUNNING","WAITING","TERMINATING"]) filtered_clusters = [cluster["Id"] for clu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_id(self, name):\n for cluster in self.list():\n if name == cluster['name']:\n return cluster['_id']\n raise NotFound(\"K8s cluster {} not found\".format(name))", "def get_cluster_id(self, name):\n r = requests.get('{}/kubernetes/clusters'.format(self.base_ur...
[ "0.84085", "0.80740744", "0.8021774", "0.7862506", "0.7862506", "0.7862506", "0.7862506", "0.7862506", "0.7862506", "0.78385305", "0.7782433", "0.77354914", "0.7710568", "0.75672585", "0.7562025", "0.7527212", "0.7473705", "0.74641985", "0.74039674", "0.73675865", "0.7327454"...
0.7658031
13
Determines if current state is equivalent to the desired state.
def is_state_definition_equivalent(self): desired_instances = self.desired_state_definition.get("Instances").get("InstanceGroups") # instance pool if not desired_instances: desired_instances = self.desired_state_definition.get("Instances").get("InstanceFleets") # TODO neith...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_state_equivalent(self, state1, state2):\n return state1 == state2", "def equals(self, state) :\r\n\r\n return self.puzzle == state.puzzle", "def correct_state(self, state, diff=True):\n return state", "def equals(self, state):\n return self.l == state.l and self.r == state....
[ "0.7728697", "0.7316365", "0.72785586", "0.72417593", "0.7079968", "0.7004719", "0.69265485", "0.6899436", "0.68525213", "0.6734737", "0.6723878", "0.6718287", "0.66891193", "0.6619956", "0.661856", "0.65881056", "0.65668696", "0.65661186", "0.6552824", "0.6516902", "0.650273...
0.64119214
25
Returns the subclass that should handle this particular service's records
def _get_payload_class(cls, service): try: return cls._payload_classes[service] except KeyError: LOGGER.error('Requested payload service [%s] does not exist', service)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSubclass(self):\r\n return objectSubclassHandle", "def get_specialization(self) -> \"Base\":\n instance = self\n for cls in self.__class__.__subclasses__():\n match = cls.objects.filter(id=self.id).first()\n if match: # use that the id is share among other subcl...
[ "0.66833633", "0.6409576", "0.630878", "0.6276799", "0.6228403", "0.61998785", "0.60825336", "0.60699105", "0.6027152", "0.6015631", "0.6001117", "0.5984505", "0.5923969", "0.5833666", "0.5828889", "0.5826871", "0.57483083", "0.5745301", "0.5734697", "0.5719909", "0.57141477"...
0.5478902
44
Return number of days in that month in that year.
def days_in_month(year, month): if not 1 <= month <= 12: # checking if the month inputted is a proper value return 'Invalid Month' # if not, 'Invalid month' returned if month == 2 and is_leap(year): # checking if month is Feb AND is_leap evaluates to True return 29 # if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getNumberOfDaysInMonth(self, month, year):\n\n return calendar.monthrange(year, month)[1]", "def number_of_days(month, year):\r\n if month in (1, 3, 5, 7, 8, 10, 12):\r\n return 31\r\n elif month == 2:\r\n return 29 if ( year % 4 == 0 and year % 100 != 0 ) or ( year % 400 == 0 ) el...
[ "0.7988201", "0.79437184", "0.77065986", "0.7702178", "0.7660931", "0.75643635", "0.7533754", "0.7511104", "0.74673086", "0.7462611", "0.74423206", "0.74275815", "0.73861307", "0.7382193", "0.73816985", "0.7375358", "0.73604554", "0.73576134", "0.7352843", "0.72869223", "0.72...
0.6747488
41
Closest nonpartial descendents of `cls`.
def children_np (cls) : result = cls._children_np if result is None : def _gen (cls) : for k, c in pyk.iteritems (cls.children) : if c.is_partial : for knp, cnp in pyk.iteritems (c.children_np) : yield kn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_parents(self):\n return [cls for cls in self.is_a if isinstance(cls, owlready2.ThingClass)]", "def closest_common_ancestors(self, cls1, cls2):\n distances = {}\n for ancestor in self.common_ancestors(cls1, cls2):\n distances[ancestor] = self.number_of_generations(cls1, ancest...
[ "0.5992671", "0.5898088", "0.57755363", "0.57470137", "0.57460684", "0.57004035", "0.5672529", "0.56581384", "0.5650738", "0.56262594", "0.5590634", "0.5582726", "0.5568205", "0.5561055", "0.5552133", "0.55515844", "0.55488586", "0.5510626", "0.54901725", "0.54788387", "0.547...
0.0
-1
All nonpartial descendents of `cls`, including `cls`.
def children_np_transitive (cls) : result = cls._children_np_transitive if result is None : result = cls._children_np_transitive = dict \ ( (tn, c) for tn, c in pyk.iteritems (cls.children_transitive) if not c.is_partial ) return resul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _all_subclasses(cls: Any) -> Set[Type]:\n children: Set[Type] = set()\n to_examine = [cls]\n while len(to_examine) > 0:\n this_class = to_examine.pop()\n for child in this_class.__subclasses__():\n if child not in children:\n to_examine.append(child)\n ...
[ "0.7249251", "0.67035276", "0.6662769", "0.66526896", "0.6563297", "0.6557688", "0.6542008", "0.65365005", "0.65245795", "0.65224355", "0.64690673", "0.64597493", "0.64457995", "0.6440666", "0.6432317", "0.631662", "0.63119763", "0.62969476", "0.6259092", "0.62231004", "0.621...
0.0
-1
All descendents of `cls`, including `cls`.
def children_transitive (cls) : result = cls._children_transitive if result is None : def _gen (cls) : def _gen_children (cls) : yield cls for c in pyk.itervalues (cls.children) : yield from _gen_children (c) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _all_subclasses(cls: Any) -> Set[Type]:\n children: Set[Type] = set()\n to_examine = [cls]\n while len(to_examine) > 0:\n this_class = to_examine.pop()\n for child in this_class.__subclasses__():\n if child not in children:\n to_examine.append(child)\n ...
[ "0.74230707", "0.70583475", "0.6938789", "0.6928199", "0.69032854", "0.686487", "0.68537736", "0.67654383", "0.6752541", "0.67101735", "0.6678226", "0.6652421", "0.6641361", "0.66280913", "0.66001546", "0.65895206", "0.6551666", "0.65251505", "0.649843", "0.6432173", "0.63632...
0.62326425
27
Add `pred` to `cls`
def add_predicate (cls, pred, verbose = True, override = False) : cls._m_add_prop (pred, cls._Predicates, verbose, override)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, pred, target):\n return NotImplemented", "def pred(self):\n return self.__pred", "def ap_per_class(tp, conf, pred_cls, target_cls):\n\n # Sort by objectness\n i = np.argsort(-conf)\n tp, conf, pred_cls = tp[i], conf[i], pred_cls[i]\n\n # Find unique classes\n unique_...
[ "0.608966", "0.5977968", "0.59760344", "0.59361434", "0.59089434", "0.586653", "0.5845684", "0.5843191", "0.5819738", "0.58116996", "0.57882", "0.5761437", "0.5737559", "0.5714706", "0.55221784", "0.54364157", "0.53959644", "0.5378564", "0.53696364", "0.536866", "0.53292483",...
0.65181756
0
Add `pred` to `cls`
def add_predicate (cls, pred, verbose = True, parent = None, transitive = True, override = False) : result = cls._m_add_prop \ (pred, cls._Predicates, verbose, parent, override) if transitive and result is not None : for c in pyk.itervalues (cls.children) : c.add_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_predicate (cls, pred, verbose = True, override = False) :\n cls._m_add_prop (pred, cls._Predicates, verbose, override)", "def __call__(self, pred, target):\n return NotImplemented", "def pred(self):\n return self.__pred", "def ap_per_class(tp, conf, pred_cls, target_cls):\n\n # So...
[ "0.65181756", "0.608966", "0.5977968", "0.59760344", "0.59361434", "0.586653", "0.5845684", "0.5843191", "0.5819738", "0.58116996", "0.57882", "0.5761437", "0.5737559", "0.5714706", "0.55221784", "0.54364157", "0.53959644", "0.5378564", "0.53696364", "0.536866", "0.53292483",...
0.59089434
5
Return if a given number n is a prime or not
def is_prime(n): if n <= 2: return True i = 2 while i <= math.sqrt(n): if n % i == 0: return False i += 1 return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isprime(n):\n if prime(n):\n return True\n else:\n return False", "def isprime(n):\n if prime(n):\n return True\n else:\n return False", "def n_is_prime(n):\n \n if n == 2:\n return True\n if n < 2 or n % 2 == 0:\n return False\n for i in ra...
[ "0.8770636", "0.8770636", "0.86777604", "0.8613402", "0.86039674", "0.85951424", "0.8578908", "0.85768855", "0.8569863", "0.8561962", "0.8553397", "0.85428524", "0.85385245", "0.8534502", "0.85142004", "0.8510102", "0.85074127", "0.8481879", "0.84811014", "0.8476426", "0.8467...
0.8446141
23
Attach a text label above each bar in rects, displaying its height.
def autolabel(rects, ax): for rect in rects: height = rect.get_height() ax.annotate('{}'.format(round(height,2)), fontsize=12, xy=(rect.get_x() + rect.get_width() / 2, height), xytext=(0, 3), # 3 points vertical offset textcoords="offset p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def label_bar(rects, ax):\n for rect in rects:\n height = rect.get_height()\n ax.text(\n rect.get_x() + rect.get_width() / 2.0,\n height + 0.5,\n \"%.1f\" % height,\n fontsize=6,\n ha=\"center\",\n va=\"bottom\",\n )", "def...
[ "0.81573904", "0.7871709", "0.7840774", "0.7823166", "0.7819309", "0.77938247", "0.7782439", "0.7698503", "0.769288", "0.7668513", "0.76655746", "0.76621795", "0.7645011", "0.7645011", "0.7638946", "0.7615205", "0.7583419", "0.7550755", "0.7543736", "0.75143987", "0.74932146"...
0.7430346
30
Make a mock dockerpy Client object.
def make_mock_docker_client(): docker_client = mock.Mock(spec=docker.client.DockerClient) containers = docker_client.containers containers.run.side_effect = make_mock_container docker_client.api = mock.Mock(spec=docker.api.APIClient) docker_client.api.port.side_effect = lambda cid, port: [{"HostPort...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dockerClientLowLevel():\n cli = MagicMock()\n class Items(object):\n def __init__(self, dct):\n self.dct = dct\n\n def get(self, key):\n ret = self.dct.get(key)\n if ret is None:\n raise docker.errors.NotFound(key)\n return ret\n \n...
[ "0.77159506", "0.7645529", "0.74275494", "0.72183615", "0.7165512", "0.70677435", "0.6941512", "0.6871001", "0.66600597", "0.6648217", "0.6601954", "0.6584687", "0.65003216", "0.64696616", "0.6418252", "0.63960314", "0.631796", "0.6282433", "0.62780297", "0.6218198", "0.62153...
0.85909265
0
Change the mute role name.
async def muterole(self, ctx, rolename: str): server = ctx.message.server self.settingsload[server.id]["Mute Role"] = rolename dataIO.save_json(self.settings, self.settingsload) await self.bot.say("Muted role name is now: **{}**".format(rolename))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def role_name(self, role_name):\n\n self._role_name = role_name", "def role_name(self, role_name):\n\n self._role_name = role_name", "async def mutesetup(self, ctx):\n mute = ctx.guild.get_role(int(fs_data.document(str(ctx.guild.id)).get().to_dict()[\"muterole\"]))\n for channel in ...
[ "0.68425244", "0.68425244", "0.6718008", "0.6651943", "0.6536168", "0.6523022", "0.63685185", "0.63665897", "0.6282113", "0.6261664", "0.621848", "0.6191839", "0.6181195", "0.61598915", "0.6145816", "0.611673", "0.61164075", "0.6110703", "0.61046207", "0.6099901", "0.60683805...
0.7735792
0
Change the channel for those that have been denied.
async def deniedchannel(self, ctx, channel: str): server = ctx.message.server self.settingsload[server.id]["Denied Channel"] = channel dataIO.save_json(self.settings, self.settingsload) await self.bot.say("Mute channel is now: **{}**".format(channel))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def setchannel(self, ctx):\n cache = []\n await self.prompt_for_welcome_channel(ctx, cache=cache)\n for cached in cache:\n try:\n await cached.delete()\n except discord.Forbidden:\n pass", "async def deny(self, ctx, user: discord.Memb...
[ "0.6988984", "0.67793137", "0.6737582", "0.66239715", "0.6513277", "0.6508389", "0.65060747", "0.63676584", "0.63577145", "0.6335386", "0.62272865", "0.6140867", "0.6114966", "0.60748124", "0.5899607", "0.58990884", "0.5826819", "0.5823743", "0.58100283", "0.5776376", "0.5760...
0.7824975
0
Get the running time by subtracting end time from start time.
def get_run_time(self): seconds = Time.millis_to_seconds(self.__end_time, self.__start_time) return float("{0:.2f}".format(seconds))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_time(self):\n return self.end_time - self.start_time", "def run_time(self):\n if self._start_time and self._end_time:\n # If start and end time is set -- calculate run time.\n return get_duration(self._end_time - self._start_time)\n elif self._start_time a...
[ "0.7742021", "0.77297866", "0.7562553", "0.74231505", "0.7131019", "0.7124108", "0.7122284", "0.71188086", "0.70748264", "0.70237434", "0.70237434", "0.7005352", "0.69939196", "0.69468814", "0.68852663", "0.68833506", "0.6879338", "0.6848521", "0.6818636", "0.6805972", "0.678...
0.72315496
4
Get all subclasses inclusive for klass
def acmGetAllSubclasses(klass): classes = [] for sub in PLoop(klass.Subclasses()): classes.extend(acmGetAllSubclasses(sub)) classes.append(klass) return classes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_subclasses(cls):\n klasses = []\n for klass in cls.__subclasses__():\n if not klass.__subclasses__():\n return klass\n else:\n klass_to_append = get_subclasses(klass)\n if klass_to_append:\n klasses.append(klass_to_append)\n\n return kl...
[ "0.7854899", "0.7814332", "0.77065575", "0.7702019", "0.7693111", "0.76443624", "0.7631381", "0.7552217", "0.7539177", "0.75234723", "0.7505298", "0.7409353", "0.73651654", "0.7356457", "0.7354243", "0.7345087", "0.72673744", "0.72289073", "0.7199171", "0.71521455", "0.715204...
0.7917243
0
Initialize extensionDefinition, exttokens shoulf be a Set
def __init__(self, module_name, class_name, extension_name): self.module_name = module_name self.class_name = class_name self.extension_name = extension_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, module_name, class_name, extension_name, extcode, exttokens, extparsed):\n ExtensionDefinition.__init__(self, module_name, class_name, extension_name)\n self.code = extcode\n self.tokens = exttokens\n self.parsed_code = extparsed\n self.type = \"ExtensionAttrib...
[ "0.6862795", "0.6366248", "0.63291645", "0.61112934", "0.60911554", "0.58668363", "0.5828864", "0.57387614", "0.5635794", "0.56228477", "0.5608946", "0.5572764", "0.5560172", "0.5536271", "0.55130607", "0.55130607", "0.55094814", "0.5461262", "0.5443206", "0.5443206", "0.5398...
0.48447135
77
Initialize extensionAttribute, exttokens shoulf be a Set
def __init__(self, module_name, class_name, extension_name, extcode, exttokens, extparsed): ExtensionDefinition.__init__(self, module_name, class_name, extension_name) self.code = extcode self.tokens = exttokens self.parsed_code = extparsed self.type = "ExtensionAttribute"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_spec_extensions(self):\n for k, v in self.raw_element.items():\n if k.startswith(\"x-\"):\n self.extensions[k[2:]] = v\n self._accessed_members.append(k)", "def register_default_attributes(self):\n for attr_name in [\n \"is_negated\",\n...
[ "0.61957157", "0.6160128", "0.6132547", "0.60142744", "0.5950574", "0.5950574", "0.5912726", "0.5599929", "0.5549375", "0.55371565", "0.55123144", "0.54997826", "0.54997826", "0.54812473", "0.5459731", "0.54426044", "0.53966826", "0.53799313", "0.5369069", "0.53370833", "0.53...
0.73815835
0
Creates and saves a User with the given email and password.
def _create_user(self, email, password, is_staff, is_superuser, **extra_fields): now = timezone.now() if not email: raise ValueError('The given email must be set') email = self.normalize_email(email) user = self.model(email=email, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_user(self, email, password, **extra_fields):\n if not email:\n raise ValueError('User must have an email address')\n email = self.normalize_email(email)\n user = self.model(email=email, **extra_fields)\n user.set_password(password)\n user.save(using=self....
[ "0.8466699", "0.8452205", "0.8424401", "0.84138757", "0.84100276", "0.84072137", "0.8404796", "0.83925974", "0.8390453", "0.8390453", "0.8390453", "0.8390453", "0.8377451", "0.8375503", "0.8375503", "0.8375503", "0.8375503", "0.8371138", "0.83673215", "0.8363768", "0.83622265...
0.82309467
61
This callback allows us to get a "hot" copy of the config.
def check_trualias(self, name): return trualias.find(name, self.config)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config():\n global _BASE_CONFIG\n return copy.deepcopy(_BASE_CONFIG)", "def _get_config(self):\n return self.__config", "def _get_config(self):\n return self.__config", "def _get_config(self):\n return self.__config", "def _get_config(self):\n return self.__config", "def _get_co...
[ "0.6868524", "0.6778915", "0.6778915", "0.6778915", "0.6778915", "0.6778915", "0.6778915", "0.6778915", "0.6778915", "0.6778915", "0.6778915", "0.6778915", "0.6778915", "0.6778915", "0.6778915", "0.6778915", "0.6778915", "0.6778915", "0.6778915", "0.6778915", "0.6778915", "...
0.0
-1
Copy the state an instance onto the persistent instance with the same identifier. If there is no persistent instance currently associated with the session, it will be loaded. Return the persistent instance. If the given instance is unsaved, save a copy of and return it as a newly persistent instance. The given instance...
def get(self, **kwargs): supplier_id = kwargs.pop(self.supplier_id_key, None) supplier_name = kwargs.pop(self.supplier_name_key, None) suppliers = None if supplier_id and not supplier_name: try: supplier_id = int(supplier_id) except TypeError: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __copy__(self):\n session = orm.Session()\n copy = session.merge(self, load=False)\n session.expunge(copy)\n return copy", "def dump(self, instance):\n return self.get(instance)", "def dump(self, instance):\n return self.get(instance)", "def copy(self):\n ...
[ "0.6334838", "0.5811493", "0.5811493", "0.5801114", "0.5616348", "0.5557642", "0.55142426", "0.55074775", "0.54504937", "0.54409575", "0.5437377", "0.5429199", "0.5413113", "0.5399966", "0.53992665", "0.5386859", "0.5355984", "0.5354619", "0.53533214", "0.531798", "0.53130376...
0.0
-1
Generate a random matrix permutations
def matrix_permutation( m, n ): m, n = int( m ), int( n ) return permutation( m ), permutation( n )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample(self, random_state):\n rows = []\n for _ in range(self.num_rows):\n random_permutation = random_state.permutation(self.num_atoms)\n rows.append(random_permutation[:self.num_cols])\n return np.array(rows)", "def permutation( n ):\n n = int( n )\n lst = sc.arange( n )\n sc.ra...
[ "0.7210775", "0.69300705", "0.68964165", "0.6753872", "0.67410135", "0.673845", "0.6732823", "0.66618085", "0.66398144", "0.66374624", "0.65415597", "0.6496805", "0.64758766", "0.6471921", "0.6417373", "0.64009285", "0.6387433", "0.63817364", "0.6342958", "0.62764", "0.627405...
0.66486144
8
Returns whether we are frozen via py2exe. This will affect how we find out where we are located.
def we_are_frozen(): return hasattr(sys, "frozen")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main_is_frozen():\n import imp\n return (\n # new py2exe\n hasattr(sys, \"frozen\") or\n # tools/freeze\n imp.is_frozen(\"__main__\"))", "def we_are_frozen():\r\n\r\n return hasattr(sys, \"frozen\")", "def we_are_frozen():\n\n return hasattr(sys, \"frozen\")", "def w...
[ "0.7807943", "0.70160544", "0.699891", "0.6935395", "0.6935395", "0.64478153", "0.64478153", "0.6334488", "0.62700266", "0.62186635", "0.60036474", "0.59400505", "0.58867526", "0.5881803", "0.58799833", "0.58799833", "0.5875872", "0.58276945", "0.5812056", "0.5805086", "0.579...
0.69831365
4