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
What is the maximum value of 1D state space
def state_max(self) -> float: raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value(self, state):\n return np.amax(self.q_values(state))", "def get_state_observed_max(self):\n maxValues = numpy.zeros(self.get_num_variables())\n i = 0\n for v in self.variables:\n maxValues[i] = v.get_max_value()\n i += 1\n return maxValues", "d...
[ "0.7324334", "0.7092528", "0.669573", "0.65897846", "0.65406847", "0.64511967", "0.6447762", "0.6444075", "0.640259", "0.6390478", "0.6386007", "0.63753605", "0.6373763", "0.6328871", "0.63153136", "0.63127965", "0.6306555", "0.63013524", "0.62864304", "0.6277458", "0.626008"...
0.80544597
0
Returns the target output for this task.
def output(self): if not os.path.isdir(OUTPUT_DATA_PATH): os.mkdir(OUTPUT_DATA_PATH) return luigi.LocalTarget(self.process_id.strftime(OUTPUT_DATA_PATH+"/reddit_data%Y_%m_%d_%H.xlsx"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_output(self):\n return self.output", "def get_output(self):\n return self.output", "def get_output(self):\n return self._output", "def get_output(self, **kwargs):\n return self.out", "def get_target(self):\n task = self.task.get_task(self.task_id)\n if 'nam...
[ "0.76913494", "0.76913494", "0.7591348", "0.74682355", "0.7363378", "0.73447067", "0.73104286", "0.7308671", "0.7308671", "0.7308671", "0.7282424", "0.7280702", "0.7234891", "0.7165149", "0.7151598", "0.71489656", "0.71489656", "0.71489656", "0.71489656", "0.71489656", "0.714...
0.69123024
27
Convert from Service JSON response to `ServiceJob` instance
def from_d(d): def sx(x): return d[x] def s_or(x, default=None): return d.get(x, default) # Convert to string key value to ascii def se(x): return to_ascii(sx(x)) def se_or(x, default=None): v = s_or(x, default=default) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dikt) -> 'JobOutputRequest':\n return util.deserialize_model(dikt, cls)", "def parse_full_job_page(self, response, job_dict):\n return Job(job_dict)", "def from_json(cls, b):\n return cls.from_dict(json.loads(b))", "def from_json(cls, json_data: Mapping[str, Any]) -> '...
[ "0.6028941", "0.60121024", "0.58771497", "0.58296984", "0.58176845", "0.56953996", "0.5689922", "0.567049", "0.56486726", "0.56459635", "0.5562394", "0.54920506", "0.5486145", "0.54842603", "0.54456896", "0.5443924", "0.541138", "0.53794813", "0.53781325", "0.53768134", "0.53...
0.5200758
46
Checks if the shape resulting from removing the given solid is valid. If it is, returns True and removes the solid from its internal representation. Otherwise returns false and the internal representation is unchanged
def remove_if_valid(self, solid): assert isinstance(solid, TopoDS_Solid) _solid = Solid(solid) affected_lists = [l for l in self._xz_intersections + self._yz_intersections if _solid in l] bad_lists = [l for l in affected_lists if len(l) == 1] if bad_lists: return Fals...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solid(self):\r\n return not not self.prototype.solid", "def solid(self):\r\n return not not self.model.prototype.solid", "def is_valid(self):\n if len(self.exterior) < 3:\n return False\n return self.to_shapely_polygon().is_valid", "def is_solid(self, world=None):\n...
[ "0.6648199", "0.6635969", "0.5991318", "0.59347063", "0.57435995", "0.5663807", "0.5602503", "0.5588618", "0.5521896", "0.54105324", "0.53777754", "0.53765774", "0.5331534", "0.53008854", "0.5280453", "0.52592486", "0.517499", "0.51429147", "0.5101849", "0.5045268", "0.503154...
0.8079224
0
Return True if queue is empty
def is_empty(self): return self._size == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return self.queue == []", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.__queue) > 0", "def empty(self) -> bool:\n if self.queue.empty():\n ...
[ "0.9174872", "0.9084071", "0.9084071", "0.90831834", "0.9062936", "0.906216", "0.90212774", "0.89920825", "0.89908427", "0.89881116", "0.8932364", "0.8827321", "0.8827321", "0.8823471", "0.8815711", "0.88156897", "0.8778546", "0.8734904", "0.87312645", "0.8644368", "0.8628145...
0.75962514
62
Return(but do not remove) the element at the front of the queue
def first(self): if self.is_empty(): raise Empty('Queue is empty') return self._head._element
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFront(self):\n\t\tfront = self.queue[self.front]\n\t\treturn front\n\t\tpass", "def front(self):\n return self.queue[0] if not self.empty() else None", "def front(queue):\n if empty_queue(queue):\n raise IndexError(\"Queue is empty!\")\n else:\n return queue.front.value", "d...
[ "0.8525873", "0.8378964", "0.8140181", "0.8075494", "0.80271876", "0.8025105", "0.7909408", "0.7909408", "0.78732806", "0.7860935", "0.7851642", "0.7829966", "0.7810734", "0.77832055", "0.77629155", "0.7760046", "0.7755535", "0.7755535", "0.7747377", "0.7744308", "0.7709152",...
0.7756731
16
Check if a number is almost prime
def check_almost_prime(num, primes_list): no_factors = 0 max_prime = num - 1 for prime in primes_list: if prime > max_prime: break while num % prime == 0: no_factors += 1 num /= prime if no_factors > 2: return 0 if no_factors == 2: return 1 retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isprime(number: int) -> bool:\n for i in range(2, int(number ** 0.5) + 1):\n if number % i == 0:\n return False\n return True", "def is_prime(n):\n return mr_prime(n)", "def isprime(number):\n\n if number == 1:\n return False\n for i in range(2, int(number**0.5) + 1)...
[ "0.7976847", "0.7958806", "0.7948939", "0.79029673", "0.78816575", "0.78534603", "0.78509724", "0.7849492", "0.78481025", "0.7844813", "0.78150946", "0.78066635", "0.77851737", "0.777676", "0.77735746", "0.7764226", "0.775335", "0.77413446", "0.7738808", "0.7721783", "0.77142...
0.75870794
37
String for representing the Model object.
def __str__(self): return '%s' % (self.name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self):\n return \"DataModel(name={},attributes={},description={})\".format(\n self.name, {a.name: str(a) for a in self.attributes}, self.description\n )", "def __str__(self):\n \n res =...
[ "0.82368803", "0.79901737", "0.7849152", "0.78468513", "0.77520275", "0.7625378", "0.7625378", "0.76225406", "0.76225406", "0.75483394", "0.7522958", "0.7470355", "0.7469358", "0.7447144", "0.7447144", "0.74314755", "0.7427648", "0.7389925", "0.7351721", "0.73424315", "0.7322...
0.0
-1
String for representing the Model object.
def __str__(self): return '%s' % (self.vendor)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self):\n return \"DataModel(name={},attributes={},description={})\".format(\n self.name, {a.name: str(a) for a in self.attributes}, self.description\n )", "def __str__(self):\n \n res =...
[ "0.82363755", "0.7990512", "0.78485423", "0.784718", "0.7751073", "0.76245975", "0.76245975", "0.7623291", "0.7623291", "0.7548185", "0.75231767", "0.74707526", "0.74700165", "0.74471915", "0.74471915", "0.7430331", "0.7426486", "0.739002", "0.73506206", "0.7341893", "0.73223...
0.0
-1
Creating a randomized name.
def create_random_name(length): name = (''.join(random.choices(string.ascii_lowercase, k=length))) name_capitalized = name.capitalize() return name_capitalized
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_name(self):\n letters = string.ascii_letters\n random_name = ''.join(random.choice(letters) for _ in range(10))\n assert isinstance(random_name, str)\n return random_name", "def _generate_name(name):\n return 'test-%s-%s-%s' % (time.strftime('%Y%m%d%H%M%S'),\n ...
[ "0.8473132", "0.8269473", "0.82017463", "0.8193355", "0.81230366", "0.80950993", "0.79900515", "0.7978913", "0.7970938", "0.7815667", "0.77738726", "0.77472824", "0.77339816", "0.77067584", "0.7668902", "0.766001", "0.75457335", "0.7510217", "0.74780184", "0.7446293", "0.7417...
0.7807909
10
Returns the hypo from the fiducial/fithypothesis key
def get_hypo_from_fiducial_hypo_key(self, fhkey): return fhkey.split('_')[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fid_from_fiducial_hypo_key(self, fhkey):\n return fhkey.split('_')[-2]", "def get_hypixel_key(self):\n key = self.bot_data_file[\"apiKeys\"][\"hypixel\"]\n if self.check_empty_key(key):\n return key\n else:\n print(\"ERROR GETTING THE HYPIXEL KEY (get you...
[ "0.7042078", "0.6051914", "0.5687437", "0.5564087", "0.5549174", "0.5363302", "0.5317577", "0.5279895", "0.5266221", "0.5224591", "0.52060044", "0.5150866", "0.5101742", "0.50710994", "0.5069106", "0.50170875", "0.5003114", "0.5000154", "0.49796987", "0.49648806", "0.49646154...
0.8455484
0
Make file name for tex output files
def make_tex_name(self, end): tex_name = "" if hasattr(self, 'labels'): if self.labels.dict['data_name'] == '': tex_name += "data_" else: tex_name += "true_%s_"%self.labels.dict['data_name'] if self.detector is not None: tex_nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def outname(self,sctn):\n return '%s_%s.html'%(self.basename,sctn)", "def getOutputFilename(self, filename):\n return filename[:-4] + \".txt\"", "def MakeTexStr(self):\n if self._latex_str == '':\n self._latex_str += bmr_hdr.format(\n self._filename.replace('.tex'...
[ "0.69431376", "0.69284415", "0.6692531", "0.6520139", "0.6499096", "0.6484681", "0.64658284", "0.643551", "0.6427567", "0.64271116", "0.6346323", "0.6344557", "0.63130623", "0.62780654", "0.6237424", "0.62370497", "0.62023324", "0.6198988", "0.6190018", "0.61797404", "0.61651...
0.7358767
0
Checks that there are no duplicated positions.
def _validate_positions(): positions = set([field["position"] for field in fields]) if len(positions) != len(fields): raise IncorrectPredictionsTableOrder
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_place(self, positions):\n return self.size == len(set(positions[i] + i for i in range(self.size))) == len(\n set(positions[i] - i for i in range(self.size)))", "def pos_no_conflict_check(positions, R):\n for pos in positions:\n if not single_pos_no_conflict_check(pos, R):\n ...
[ "0.7397151", "0.67634374", "0.6761341", "0.67321855", "0.6688995", "0.6655897", "0.6644622", "0.65514535", "0.65010196", "0.6467287", "0.6409616", "0.6408384", "0.63845885", "0.6348332", "0.63446015", "0.63416195", "0.6330323", "0.63249207", "0.6319347", "0.628848", "0.625819...
0.5973032
47
Returns the result of NoneToEmptyQuerySet instead of a regular QuerySet.
def get_queryset(self): return NoneToEmptyQuerySet(self.model, using=self._db)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def none(self):\n clone = self._chain()\n clone.query.set_empty()\n return clone", "def query_none(self):\n return multisearch.queries.QueryNone().connect(self)", "def get_inititially_selected_queryset(self):\n return self.model.objects.none()", "def queryset(cls):\n ...
[ "0.7153786", "0.6839473", "0.67798024", "0.65623015", "0.6502179", "0.64747626", "0.639812", "0.62542117", "0.62088317", "0.6175962", "0.612903", "0.61209935", "0.6069687", "0.6062007", "0.603136", "0.603136", "0.6014894", "0.6001097", "0.5988454", "0.59800255", "0.5971937", ...
0.81059086
0
Modified repr for object representation.
def __repr__(self): if self.rest: rest_repr = ', ' + repr(self.rest) else: rest_repr = '' return 'Link({0}{1})'.format(self.first, rest_repr)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n return repr(self.__dict__['_obj'])", "def repr_(object_):\n return repr(object_)", "def __repr__(self):\n return self.pretty_print(self.__dict__)", "def __repr__(self):\n\n return repr(self.__dict__)", "def __str__(self):\n return repr(self)", ...
[ "0.8308683", "0.81057674", "0.7917441", "0.7864875", "0.7824185", "0.7772134", "0.77516913", "0.77437913", "0.7728905", "0.77246493", "0.76801586", "0.76801586", "0.76801586", "0.76801586", "0.76801586", "0.7677524", "0.7670947", "0.76642936", "0.76635194", "0.7658909", "0.76...
0.0
-1
Return names of dark and light themes for application.
def names(self): return self.dark_name, self.light_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_themes():\n themes = [*os.scandir(os.path.join(CONF_DIR, \"colorschemes\")),\n *os.scandir(os.path.join(MODULE_DIR, \"colorschemes\"))]\n\n return [t for t in themes if os.path.isfile(t.path)]", "def themes(self):\n if self._themes is None:\n self.refresh()\n ...
[ "0.7098856", "0.6941113", "0.6886924", "0.6794994", "0.67164475", "0.66907245", "0.65747935", "0.65700656", "0.6363531", "0.63316655", "0.6171683", "0.606351", "0.6055646", "0.60471904", "0.6041927", "0.6004565", "0.59851515", "0.59330195", "0.588121", "0.58508795", "0.584592...
0.62402207
10
Return current app mode. Return light theme by default to toggle to dark theme.
def get_current_app_mode() -> ThemeMode: theme: ApplicationTheme = themes[0] # Change current mode. path = theme.path try: with open(path, 'r', encoding='utf-8') as f: pass except FileNotFoundError: path = theme.windows_path try: with open(path, 'r', encoding...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_mode() -> ThemeMode:\n try:\n # test:\n assert False\n # todo: Check platform and add more platforms.\n with winreg.OpenKey(\n winreg.HKEY_CURRENT_USER,\n (r'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes'\n r'\\Pers...
[ "0.8376423", "0.78625804", "0.72527236", "0.693797", "0.6717479", "0.66852087", "0.6549633", "0.6545833", "0.648958", "0.6443121", "0.64392096", "0.6436298", "0.64200485", "0.64200485", "0.63986427", "0.6395614", "0.63905364", "0.63757384", "0.63618475", "0.635668", "0.632926...
0.86299425
0
Get toggled mode based on current mode.
def get_toggled_mode(current_mode: ThemeMode) -> ThemeMode: return (ThemeMode.light if current_mode == ThemeMode.dark else ThemeMode.dark)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def currentMode(self):\n logger.debug(\"Func: currentMode/getter\")\n\n return self._currentsDict[\"currentMode\"]", "def getMode(self):\n return self._mode", "def get_mode(self):\r\n return self._api.get_mode()", "def get_mode(self):\r\n return self.mode", "def getMode(s...
[ "0.7412477", "0.73822623", "0.7310764", "0.72858244", "0.7279957", "0.7266004", "0.7142095", "0.7127457", "0.71190304", "0.7054686", "0.70420915", "0.70306844", "0.7006925", "0.70064867", "0.7002522", "0.7002522", "0.69996244", "0.69996244", "0.69996244", "0.6995646", "0.6995...
0.78654677
0
Trim all samples in a batch to MAXLENGTH and pad them to identical lengths.
def trim_and_pad_batch(self, batch): maxlength = min(self.MAXLENGTH, max([len(x) for x in batch])) batch = [x[:maxlength] for x in batch] batch = [np.concatenate([x, np.zeros(maxlength - x.shape[0])]) for x in batch] return batch
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Batch_Size_Normalization(batch, batch_len, pad_token, batch_size):\n max_length = max(batch_len)\n current_batch_len = len(batch)\n need_more = batch_size-current_batch_len\n if need_more==0:\n return batch\n\n padding_array = np.ones(max_length)*pad_token\n for i in range(need_more):\...
[ "0.73393714", "0.6794169", "0.66928875", "0.66109043", "0.66104877", "0.6500822", "0.648561", "0.6474067", "0.64650595", "0.6460871", "0.64459044", "0.6353153", "0.6303142", "0.6301248", "0.6236003", "0.6220014", "0.6217669", "0.61584425", "0.6154803", "0.6134153", "0.6132086...
0.84682834
0
Delete any documents that do not contain any words (i.e., that were blankonly).
def delete_empty_documents(self, dataset): print("Deleting empty documents in", dataset) number_documents = len(self.raw_documents[dataset]) indices = list(filter(lambda x:len(self.raw_documents[dataset][x].strip()), range(number_documents))) self.raw_documents[dataset] = [self.raw_documents[dataset][idx] for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_search_words(self,\r\n index,\r\n entrytext):\r\n\r\n for a_temp in DELETECHARACTERS:\r\n entrytext = entrytext.replace(a_temp, BLANK)\r\n\r\n for w in set(entrytext.split()):\r\n w = w.strip()\r\n\r\n i...
[ "0.6694606", "0.6575149", "0.6434805", "0.642709", "0.6385204", "0.63672984", "0.634992", "0.6281326", "0.6239466", "0.6194086", "0.6189664", "0.61618084", "0.60838485", "0.6070476", "0.60552865", "0.60512906", "0.6034264", "0.6008207", "0.60043776", "0.59701675", "0.5938523"...
0.6804529
0
Create word index arrays from the tokenized documents. The word index arrays serve as input to training/evaluation/relevance scoring.
def make_X(self, dataset): print("Making X", dataset) self.X[dataset] = [] for document in self.tokenized_documents[dataset]: array = np.array([self.worddict.get(word, self.worddict["__oov__"]) for word in document]) self.X[dataset].append(array)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_document_tokens_matrix( self, documents_tokens ):\n document_tokens_matrix_sources = dict()\n tools_list = list()\n for source in documents_tokens:\n # create a unique list of all words\n all_tokens = list()\n doc_tokens = documents_tokens[ source ]\...
[ "0.69399405", "0.6922191", "0.6701223", "0.6372283", "0.63683516", "0.6280279", "0.62795895", "0.6273169", "0.62596124", "0.62404424", "0.62050205", "0.6180359", "0.61626536", "0.614405", "0.61372715", "0.6134434", "0.613296", "0.61042005", "0.61020863", "0.6090465", "0.60903...
0.593627
31
Read raw data from the json file associated with (path to be set in config.py)
def get_raw_data(self, dataset): print("Getting raw data for", dataset) self.raw_documents[dataset] = [] self.Y[dataset] = [] with open(self.jsons[dataset]) as handle: for line in handle: json_obj = json.loads(line) stars = json_obj["stars"] if stars != 3: self.raw_documents[dataset].append...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_json_file(self):\n with open(self.subcfgfilename) as json_file:\n json_string = json_file.read()\n json_data = json.loads(json_string)\n return(json_data)", "def _raw_read(self, filepath, dirpath=None):\n self.json_dict = super().read(filepath)\n re...
[ "0.7715707", "0.76542825", "0.74878913", "0.7483342", "0.72949696", "0.725952", "0.72501856", "0.7230151", "0.71848714", "0.7145747", "0.71443963", "0.70847565", "0.7071592", "0.7070315", "0.705912", "0.7053868", "0.7034751", "0.702222", "0.7021464", "0.70120883", "0.6999527"...
0.0
-1
Return requirements from a requirements file. This expects a requirements file with no ``findlinks`` lines.
def _get_dependencies(requirements_file: Path) -> List[str]: lines = requirements_file.read_text().strip().split('\n') return [line for line in lines if not line.startswith('#')]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_requirements():\n with open(\"requirements.txt\", 'r') as f:\n return f.read().splitlines()", "def get_requirements():\n with open('requirements.txt') as fd:\n lines = fd.read().splitlines()\n requires, links = [], []\n for line in lines:\n if line.startswith...
[ "0.8078903", "0.7968852", "0.7956327", "0.7874231", "0.78719735", "0.78349525", "0.77560455", "0.7626917", "0.7610132", "0.7551161", "0.75266165", "0.7492829", "0.747868", "0.74538183", "0.74454075", "0.7432905", "0.7378615", "0.73785156", "0.736273", "0.731193", "0.7301394",...
0.7805918
6
Returns a list of atoms representing atoms on the contour/edge of the graphenic layer and of the existing holes. Used to prevent new holes touching existing ones.
def get_contour(atom_list): initial = [atom for atom in atom_list if ((0 < len(identify_bonds(atom, atom_list)) < 3) and (check_connected(atom, identify_bonds(atom, atom_list)) == False))] extra_1 = [] for atom in atom_list: neighbours = [bond[0] for bond in identify_bonds(atom, atom_list)] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_contour(hole_atoms, atom_list):\n contour_atoms = []\n extra_atoms = []\n global bond_list\n bond_list = bond_list_1\n for atom in hole_atoms:\n c = [bond[0] for bond in identify_bonds(atom, atom_list) if ((bond[0] not in hole_atoms) and (bond[0] not in contour_atoms))]\n for ...
[ "0.72873443", "0.6582357", "0.6486398", "0.608028", "0.59882003", "0.5970188", "0.59671474", "0.58909136", "0.588228", "0.58613706", "0.58591586", "0.58287656", "0.58275", "0.582627", "0.57437956", "0.5704725", "0.56897026", "0.5658169", "0.5642107", "0.5628244", "0.5623437",...
0.67225623
1
Returns a list of atoms representing atoms on the contour/edge of the graphenic layer and of the existing holes. Used to prevent new holes touching existing ones.
def find_contour(hole_atoms, atom_list): contour_atoms = [] extra_atoms = [] global bond_list bond_list = bond_list_1 for atom in hole_atoms: c = [bond[0] for bond in identify_bonds(atom, atom_list) if ((bond[0] not in hole_atoms) and (bond[0] not in contour_atoms))] for element in c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_contour(atom_list):\n initial = [atom for atom in atom_list if ((0 < len(identify_bonds(atom, atom_list)) < 3) and (check_connected(atom, identify_bonds(atom, atom_list)) == False))]\n \n extra_1 = []\n for atom in atom_list:\n neighbours = [bond[0] for bond in identify_bonds(atom, atom_...
[ "0.67212147", "0.6583964", "0.6485464", "0.60798305", "0.5989183", "0.5969657", "0.59682745", "0.5890468", "0.5881151", "0.5862929", "0.5857462", "0.58304733", "0.5828795", "0.58252805", "0.5745302", "0.570288", "0.5691466", "0.5657655", "0.56418115", "0.56291354", "0.5623697...
0.72864246
0
r""" einsum(subscripts, operands) Evaluates the Einstein summation convention on the operands. This implementation exactly mirrors that of ``numpy.einsum`` and supports backpropagation through all variety of tensorproducts, sums, traces, and views that it can perform. The following docstring was adapted from the docume...
def einsum(*operands, optimize=False, constant=False): # TODO: normalize error handling for invalid inputs operands = list(operands) if isinstance(operands[0], str): # operands form: "ijk, ijk", x, y variables = operands[1:] if any(isinstance(i, Tensor) for i in operands): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def einsum(subscripts, *operands):\n raise NotImplementedError", "def einsum(ops, *args):\n\n if len(args) != 2:\n raise ValueError(\"Currently only two operands are supported\")\n\n inops, outops = ops.split('->')\n inops = inops.split(',')\n\n # All indices that are in input AND in ou...
[ "0.8047489", "0.7242151", "0.7152754", "0.63151926", "0.61698246", "0.6114144", "0.6113121", "0.6074974", "0.6068289", "0.59489155", "0.5899865", "0.5805374", "0.5726775", "0.5560793", "0.5545564", "0.5527907", "0.5518557", "0.54571724", "0.5398596", "0.537284", "0.5371635", ...
0.7332211
1
Dataloader of the `JHUCROWD++`_ dataset.
def JHU_CROWD(path: str) -> Dataset: dataset = Dataset(DATASET_NAME) dataset.load_catalog(os.path.join(os.path.dirname(__file__), "catalog.json")) for segment_name in SEGMENT_LIST: segment = dataset.create_segment(segment_name) segment_path = os.path.join(path, segment_name) image_ro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataloader(self):\n\n # load / split data\n train_data = self.data.get_train_data()\n if self.args.use_dev:\n train_data, dev_data = self.data.split_data(train_data)\n test_data = self.data.get_test_data()\n\n #print(train_data[0])\n #print(dev_data[0])\n ...
[ "0.6336475", "0.61304355", "0.5971722", "0.5847539", "0.5825926", "0.5750217", "0.57182723", "0.5670559", "0.5627674", "0.56244856", "0.56018347", "0.55862707", "0.55199605", "0.5519217", "0.55126995", "0.5499972", "0.54712534", "0.5456989", "0.5443736", "0.5408074", "0.54079...
0.57597077
5
Accepts only tickets with remaining_time field
def validate(self, ticket): debug(self, "Called validate(%s)..." % ticket) if ticket is not None and isinstance(ticket, AgiloTicket) and \ ticket.is_writeable_field(Key.REMAINING_TIME): remaining_time = self.parse_remaining_time(ticket) if (not self.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate(self, ticket):\n debug(self, \"Called validate(%s)...\" % ticket)\n if ticket is not None and isinstance(ticket, AgiloTicket) and \\\n ticket.is_writeable_field(Key.REMAINING_TIME):\n remaining_time = ticket[Key.REMAINING_TIME] or ''\n match = self.ex...
[ "0.62892735", "0.59172094", "0.5889611", "0.5771665", "0.5746504", "0.57293135", "0.57168686", "0.5565989", "0.5542619", "0.54507524", "0.5418683", "0.5412213", "0.5389857", "0.5378949", "0.53786576", "0.53773236", "0.53708684", "0.5360094", "0.5325163", "0.53125954", "0.5304...
0.6272372
1
Add columns from a source. SOURCE is any object supporting the DataTableBase interface. The values from the source are inserted into the current datatable.
def add_cols(self, source) : cols = source.get_cols() types = source.get_types() new_cols = [] new_types = [] for i in range(len(cols)) : if cols[i] not in self.cols : new_cols.append(cols[i]) new_types.append(types[i]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_columns(source):\n return _get_tuple(source)", "def init_sources(self):\n\n columns = ['some', 'column', 'headers']\n self.columns = columns\n\n self.data_source = ColumnDataSource(data=dict(zip(columns, []*len(columns))))", "def add_column_into_source(self, tap_type, table...
[ "0.5886388", "0.5737543", "0.56411767", "0.56024194", "0.5431844", "0.5185482", "0.5174467", "0.51542056", "0.5090378", "0.50158465", "0.4980832", "0.4965107", "0.49250972", "0.4916635", "0.49140692", "0.4913746", "0.4887684", "0.4868349", "0.48492506", "0.47867334", "0.47823...
0.75367403
0
Return the current row count for the table.
def get_row_count(self) : count_sql = 'SELECT count(*) FROM "%s"' % (self.name,) cur = self.con.cursor() cur.execute(count_sql) return cur.fetchone()[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def row_count(self):\n return self.__row_count", "def row_count(self):\n return self._row_count", "def rowcount(self):\n return self._count", "def rowcount(self):\n\t\treturn self._count", "def row_count(self) -> int:\n return len(self.rows)", "def row_count(self) -> int:\n ...
[ "0.8466452", "0.84421664", "0.840626", "0.8364453", "0.8267521", "0.8267521", "0.81178814", "0.79461575", "0.7845531", "0.7705845", "0.7675725", "0.765543", "0.7638328", "0.7609061", "0.7596597", "0.75680137", "0.75359184", "0.75137126", "0.7510956", "0.749579", "0.7480422", ...
0.7983576
7
Jump if the greater or equal flags are set.
def jge(self, jump_distance): value = bytearray() # 0F 8D cd JGE rel32 value.extend([0x0F, 0x8D]) encoded_amount = struct.pack("i", jump_distance) value += encoded_amount return value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def JEQ(self):\n # print(\"JEQ\")\n # print(f\"FLAG: {self.fl}\")\n mask = 0b00000001\n\n a = self.fl & mask\n # print(f\"A: {a}\")\n\n if a:\n # print(\"we jump\")\n self.pc = self.reg[self.ram[self.pc + 1]]\n else:\n # print(\"we d...
[ "0.6317473", "0.6190845", "0.61488163", "0.58050174", "0.58018535", "0.56774896", "0.5638106", "0.5557847", "0.5513077", "0.54760575", "0.54760075", "0.5435341", "0.53950655", "0.5320811", "0.5287941", "0.5255394", "0.52510834", "0.5241849", "0.5223898", "0.51887274", "0.5184...
0.0
-1
Sets the status of this EnabledInfo.
def status(self, status): self._status = status
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setEnabled(self, status):\r\n self._status = status\r\n\r\n if status:\r\n self._start()\r\n else:\r\n self._stop()\r\n\r\n for cb in self._statusListener:\r\n cb(self, status)", "def set_status(self, status):\n self.status = status", "def...
[ "0.7800555", "0.7306623", "0.7306623", "0.7306623", "0.72554773", "0.71749586", "0.70013165", "0.69903636", "0.69903636", "0.69903636", "0.69903636", "0.69903636", "0.69903636", "0.69903636", "0.69849616", "0.6965701", "0.6950901", "0.6950901", "0.68774253", "0.6873566", "0.6...
0.6981872
35
Sets the status_switch_time of this EnabledInfo.
def status_switch_time(self, status_switch_time): self._status_switch_time = status_switch_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state_sys_time(self, state_sys_time):\n self._state_sys_time = state_sys_time", "def __init__(self, status=False, comment=None, status_switch_time=None, teamcity=None): # noqa: E501 # noqa: E501\n\n self._status = None\n self._comment = None\n self._status_switch_time = None\n ...
[ "0.56983596", "0.56610054", "0.54731107", "0.54664826", "0.5443645", "0.5386132", "0.53337675", "0.5331197", "0.5310322", "0.5297834", "0.5279101", "0.5279101", "0.5279101", "0.5268614", "0.5240808", "0.52355987", "0.5214942", "0.52022564", "0.5184441", "0.51803786", "0.51623...
0.86382955
0
Name of the device.
def name(self): _LOGGER.debug(self._shelly_cloud_device_name + ' >>> ' + self._shelly_cloud_entity_name + ' >>> name() >>> ' + self._shelly_cloud_device_name) return self._shelly_cloud_device_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self._device.name", "def name(self):\n return self._device.name", "def name(self):\n return self._device.name", "def name(self):\n return f\"{get_device_name(self._data, 0, self._name)}\"", "def name(self):\n return self.device.name()", "def nam...
[ "0.9097775", "0.9097775", "0.9097775", "0.9061745", "0.9025759", "0.881624", "0.86864114", "0.8568692", "0.8558048", "0.8555749", "0.8555749", "0.8532012", "0.8532012", "0.8469097", "0.84059423", "0.8375903", "0.8366243", "0.83477855", "0.8282749", "0.81535566", "0.79456824",...
0.80647564
20
Set up data for testing.
def setUp(self): self.probabilities_for_cdf = ECC_TEMPERATURE_PROBABILITIES.reshape(3, 9) self.threshold_points = ECC_TEMPERATURE_THRESHOLDS self.bounds_pairing = (-40, 50)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUpTestData(cls):\n # volunteer user\n common.initialize_empty_volunteer()", "def setUp(self):\n self.dataset = get_test_dataset()", "def setUp(self):\n\n self.test_data_path = 'testing/test_data/'", "def setUp(self):\n self.data = DatabaseIntermediary()", "def setU...
[ "0.80007607", "0.79576796", "0.7928157", "0.785984", "0.77252805", "0.77136564", "0.77055836", "0.77055836", "0.77055836", "0.77055836", "0.7700484", "0.76099646", "0.7474632", "0.74122864", "0.73990965", "0.73868054", "0.7359824", "0.7335635", "0.7325923", "0.7324017", "0.73...
0.0
-1
Bound a number between two constants
def clamp(n, minn, maxn): return max(min(maxn, n), minn)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simplebounds(cls, val, lower, upper):\n if val < lower:\n val = lower\n if val > upper:\n val = upper\n return val", "def constrain(inputVal, lower_limit, upper_limit):\n \n if (inputVal < lower_limit):\n return lower_limit\n elif (inputVal > upper_l...
[ "0.70112604", "0.68316644", "0.681633", "0.6764539", "0.67307013", "0.66286147", "0.65718555", "0.65455836", "0.6540684", "0.6525857", "0.6517224", "0.64938766", "0.6473324", "0.6461692", "0.64428455", "0.6434471", "0.640262", "0.6362559", "0.634921", "0.6348296", "0.6323164"...
0.59258366
55
Find local maxima pixels in an image stack within a given window. Defines local maxima as pixels whose value is equal to the maximum value within a defined window centered on that point. Implementation is to first run a maximum filter, then define pixels in the original image whose value is equal to the maxfilter resul...
def local_max(img, size=(70,100,100)): # Apply a maximum filter. max_f = ndi.maximum_filter(img, size=size) # Find pixels that are local maxima. local_max = np.where(max_f == img, 1, 0) return(local_max)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def peak_local_max_nD(img, size=(70,100,100), min_dist=0):\n def has_neighbor(peak, peak_list, min_dist):\n \"\"\"Find whether a peak already exists within minimum distance of this peak\"\"\"\n for testpeak in peak_list:\n if (distance.euclidean(peak, testpeak) < min_dist):\n ...
[ "0.6773827", "0.6690919", "0.6458444", "0.6428409", "0.63588756", "0.63492244", "0.60867316", "0.5958801", "0.5957955", "0.5957955", "0.5942641", "0.5919028", "0.59147114", "0.59119725", "0.5896226", "0.5873993", "0.5859534", "0.585771", "0.58529603", "0.5834837", "0.5811325"...
0.7622608
0
Find local maxima in an Ndimensional image. Generalizes scikit's peak_local_max function to three (or more) dimensions. Finds local maxima pixels within supplied window, determines centroids for connected pixels, and returns a mask of these centroid positions and a list of them.
def peak_local_max_nD(img, size=(70,100,100), min_dist=0): def has_neighbor(peak, peak_list, min_dist): """Find whether a peak already exists within minimum distance of this peak""" for testpeak in peak_list: if (distance.euclidean(peak, testpeak) < min_dist): return True...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def local_max(img, size=(70,100,100)):\n # Apply a maximum filter.\n max_f = ndi.maximum_filter(img, size=size)\n # Find pixels that are local maxima.\n local_max = np.where(max_f == img, 1, 0)\n return(local_max)", "def detect_local_minima(arr, mask=None):\n # https://stackoverflow.com/questio...
[ "0.66987324", "0.6557603", "0.6429785", "0.6264377", "0.6144342", "0.6073965", "0.60014975", "0.5999285", "0.5990882", "0.5922203", "0.58585465", "0.5762706", "0.57241493", "0.5674644", "0.5631021", "0.56297046", "0.5585459", "0.5563584", "0.5530211", "0.5523302", "0.54643947...
0.7620194
0
Find a background (value=0) pixel in a mask. Searches for a background pixel in a mask, defined as a pixel with value 0. Background pixel is chosen at random from among all 0 pixels.
def find_background_point(mask): zerocoords = np.where(mask == 0) i = np.random.randint(0,len(zerocoords[0])) coord = zerocoords[0][i] for n in range(1, len(zerocoords)): coord = np.append(coord, zerocoords[n][i]) return tuple(coord)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chooseRandPixel(mask):\n array = np.transpose(np.nonzero(mask)) # Get the indices of nonzero elements of mask.\n index = random.randint(0,len(array)-1) # Select a random index\n return array[index]", "def clean_mask(mask, background=0):\n kernels = [\n np.array([[ 1, -1, -1], [-1, 1, -1],...
[ "0.7012101", "0.63900024", "0.6272139", "0.61467755", "0.5984164", "0.5957396", "0.5819784", "0.58184606", "0.5760389", "0.5739316", "0.5737187", "0.56919", "0.56675345", "0.56653273", "0.56641465", "0.5645335", "0.5630077", "0.5629339", "0.5599537", "0.5579547", "0.5567698",...
0.738801
0
View image stack with boxes drawn around detected spots
def quickview_ms2(stack, spot_data, channel=0, spot_id='all', figsize=12, MAX=True, halfwidth_xy=8, spotmode=False): if (spot_id == 'all'): data = spot_data.copy() else: data = {spot_id:spot_data[spot_id]} if spotmode: halfwidth_xy = 3 substack = stack[channel] boxes = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view(self):\n\t\tfigure_out = self.figure.copy()\n\t\timage_pairs = np.unique(self.local_matches[\"image_pairs\"][0])\n\t\tfor i in image_pairs:\n\t\t\t# draw bounding box\n\t\t\ti_loc = self.local_database[\"image_locs\"][np.where(self.local_database[\"image_idx\"] == i)[0][0]]\n\t\t\tcv2.rectangle(figure_out...
[ "0.72297984", "0.7019689", "0.6855829", "0.66976476", "0.66716367", "0.66629636", "0.66629636", "0.653807", "0.6515927", "0.6514664", "0.6506795", "0.6442844", "0.6437424", "0.64049655", "0.6384307", "0.6382383", "0.634831", "0.63409656", "0.6336691", "0.63149285", "0.6300306...
0.0
-1
Perform segmentation on a timeseries of 3D stacks Accepts a function that performs nuclear segmentation on a 3D image stack, calls this function on each frame of a 4D image stack, and returns a 4D nuclear mask. Individual time frames are independently segmented and labels are not connected between them.
def segment_nuclei_4dstack(stack, seg_func, **kwargs): # Segment first frame, initialize 4D labelmask. frame0 = seg_func(stack[0], **kwargs) labelmask = np.array([frame0]) # Segment subsequent frames, stack results together. for n in range(1, stack.shape[0]): print(n, end=' ') frame ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def segment_nuclei3D_5(instack, sigma1=3, sigma_dog_small=5, sigma_dog_big=40, seed_window=(70,100,100),\n erosion_length=5, dilation_length=10, sensitivity=0.5, size_min=1e4, \n size_max=5e5, circularity_min=0.5, display=False):\n\n\n def smart_dilate(stack, labelmas...
[ "0.63560593", "0.6342845", "0.59947366", "0.5937562", "0.58145386", "0.57874197", "0.5714978", "0.5559475", "0.55079997", "0.54416966", "0.54246885", "0.5397451", "0.53814244", "0.531016", "0.52537036", "0.52524835", "0.52115023", "0.5184818", "0.5181062", "0.51775354", "0.51...
0.693505
0
Match labels of segmented structures between two labelmasks.
def update_labels(mask1, mask2): # Find the object in mask2 that has maximum overlap with an object in max1, # (as a fraction of the objects pixels in mask1) def get_max_overlap(mask1, mask2, label1): # Count overlapping pixels. labels, counts = np.unique(mask2[mask1 == label1], return_count...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def label_segments(segs, truths, detected):\n for seg in segs:\n for truth in truths:\n if time_overlap(seg, truth): \n seg[\"label\"] = truth[\"label\"]\n for det in detected:\n if time_overlap(seg, det):\n if ...
[ "0.6957109", "0.62531114", "0.60568833", "0.5868811", "0.5844121", "0.583243", "0.58223724", "0.58218205", "0.58092034", "0.5799262", "0.5702313", "0.56317323", "0.5619657", "0.5604046", "0.55833405", "0.5563465", "0.55599004", "0.5557725", "0.5530411", "0.5528488", "0.549651...
0.68187106
1
Bound a number between two constants
def clamp(n, minn, maxn): return max(min(maxn, n), minn)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simplebounds(cls, val, lower, upper):\n if val < lower:\n val = lower\n if val > upper:\n val = upper\n return val", "def constrain(inputVal, lower_limit, upper_limit):\n \n if (inputVal < lower_limit):\n return lower_limit\n elif (inputVal > upper_l...
[ "0.70112604", "0.68316644", "0.681633", "0.6764539", "0.67307013", "0.66286147", "0.65718555", "0.65455836", "0.6540684", "0.6525857", "0.6517224", "0.64938766", "0.6473324", "0.6461692", "0.64428455", "0.6434471", "0.640262", "0.6362559", "0.634921", "0.6348296", "0.6323164"...
0.57944274
76
Initialize new spot with next numeric ID and entry in connected_data.
def initialize_new_spot(new_spot_data, connected_data): if (connected_data.keys()): new_id = max(connected_data.keys()) + 1 else: new_id = 1 connected_data[new_id] = np.expand_dims(new_spot_data, 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self._idx = Node.index\n Node.index += 1", "def init(self):\n self.padre = self.id\n self.sinVisitar = [] \n self.visited = False\n print (\"inicializo algoritmo\")\n for i in range (len(self.neighbors)): #De esta forma se pueden mani...
[ "0.5418677", "0.5404944", "0.5365731", "0.5343149", "0.5334733", "0.53292894", "0.53161687", "0.53161687", "0.5288859", "0.5250205", "0.52446026", "0.5231255", "0.52251077", "0.52228373", "0.52228373", "0.5191674", "0.51554686", "0.51548076", "0.5136638", "0.51238644", "0.511...
0.7496566
0
Opens a new database connection if there is none yet for the current application context.
def get_db(): if not hasattr(g, 'sqlite_db'): g.sqlite_db = connect_db() return g.sqlite_db
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_open():\n if not hasattr(g, 'sqlite_db'):\n g.sqlite_db = db_connect()\n return g.sqlite_db", "def open_database(self):\n if self._conn is None:\n self._conn = sqlite3.connect(self._db_path)", "def open_db(db_name: str = DB_NAME) -> DBConnection:\n return sqlite3.connec...
[ "0.773782", "0.75820196", "0.7316448", "0.7168609", "0.7023129", "0.6966087", "0.69546735", "0.69495314", "0.6897569", "0.6842675", "0.68285626", "0.681815", "0.68044835", "0.6794984", "0.67679894", "0.6760836", "0.67511946", "0.67471915", "0.67323065", "0.66991436", "0.66874...
0.64032626
83
Concatenate endpoint and final URL.
def concat_url(endpoint, url): u = "%s/%s" % (endpoint.rstrip("/"), url.strip("/")) return u.rstrip('/')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _construct_url(self, endpoint):\n return self.base_url + self.api_path + endpoint.strip('/')", "def build_url(self, endpoint_url: str) -> str:\n return self.base_url + endpoint_url % self.instance_id", "def _join_url(saas_url, endpoint):\n\n saas_url = f\"{saas_url}/\"\n endpoint = endp...
[ "0.74742275", "0.7269796", "0.7175692", "0.71596", "0.70213", "0.69491", "0.6947381", "0.6928694", "0.68832123", "0.68601626", "0.6854039", "0.68420404", "0.68103427", "0.67940575", "0.67940575", "0.6767998", "0.6761178", "0.6674753", "0.664846", "0.6641822", "0.6630077", "...
0.81906676
0
Adds padding text at the start of a sentence.
def transform( self, sentences: List[List[str]], target_ids: List[int] ) -> Tuple[List[List[str]], List[int]]: transformed_sentences = [] transformed_target_ids = [] for sentence, target_id in zip(sentences, target_ids): transformed_sentences.append(self.text_tokens + sen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pad_sentences(sentence, sequence_length, padding_word=\"<PAD/>\"):\r\n sequence_length = 20\r\n sentence_list = sentence.strip().split(' ')\r\n if 200 > len(sentence_list):\r\n num_padding = sequence_length - len(sentence_list)\r\n padding_word = \"<PAD/>\"\r\n new_sentence = sent...
[ "0.6965356", "0.6933696", "0.69216293", "0.6869734", "0.68351597", "0.67512625", "0.66050684", "0.65845966", "0.6547793", "0.65382135", "0.6465414", "0.63721937", "0.627264", "0.62622", "0.6246692", "0.6197636", "0.61268294", "0.6109954", "0.60445744", "0.6007599", "0.6002122...
0.0
-1
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.8038813", "0.79248375", "0.7923423", "0.7885103", "0.78773195", "0.7815877", "0.77655786", "0.77556044", "0.77441615", "0.7731815", "0.77288336", "0.772473", "0.77028215", "0.76889825", "0.76889825", "0.7664208", "0.76570904", "0.7655856", "0.7655856", "0.76458347", "0.764...
0.7448925
75
Build a palette definition from either a simple string or a dictionary, filling in defaults for items not specified.
def from_config( cls, cfg, default_fg=DEFAULT_FG_16, default_bg=DEFAULT_BG_16, default_fg_hi=DEFAULT_FG_256, default_bg_hi=DEFAULT_BG_256, max_colors=2**24 ): # TODO: mono e = PaletteEntry(mono = default_fg, foreground=default...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, colorNames):\n self._lengthOfPattern = 0 # will later be queried from the user\n self._palette = '' # initials for color choices, e.g., R for red\n for color in colorNames:\n self._palette += color[0].upper()", "def use_default_dict():\n ...
[ "0.58850473", "0.58386135", "0.58280224", "0.56451863", "0.5625769", "0.55202246", "0.5502358", "0.5496009", "0.5495031", "0.5393192", "0.53180754", "0.531082", "0.5267755", "0.520979", "0.51729643", "0.51683825", "0.5159678", "0.5137804", "0.512281", "0.5122527", "0.5098934"...
0.57047886
3
Returns string of extra info for __repr__().
def _extra_repr(self): return ''
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n extras = self._extra_repr()\n if isinstance(extras, list):\n extras = ' '.join([str(e) for e in extras])\n try:\n if self.id:\n return '<%s %s 0x%x>' % (type(self).__name__,\n ('%s %s' % (self.id...
[ "0.78283966", "0.77375877", "0.7687218", "0.76055586", "0.7555131", "0.75000334", "0.74571764", "0.744892", "0.74434084", "0.7438104", "0.74377024", "0.74233174", "0.74117184", "0.7360773", "0.7345917", "0.73441535", "0.72871655", "0.72871655", "0.72871655", "0.72583014", "0....
0.8242073
0
Override default equals operation. IDLNodes are equal if all their properties are equal.
def __eq__(self, other): if other is None or not isinstance(other, IDLNode): return 1 return self.__dict__.__eq__(other.__dict__)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\r\n if not isinstance(other, BaseElement): return False\r\n return self.as_dict() == other.as_dict() and self.eid == other.eid", "def __eq__(self, other):\n if not isinstance(other, NodeInterfaceAlias):\n return False\n\n return self.__dict__ == oth...
[ "0.7477901", "0.74357456", "0.72444695", "0.7200534", "0.7193656", "0.71801114", "0.71704066", "0.71704066", "0.71704066", "0.71704066", "0.71704066", "0.71675265", "0.71675265", "0.71675265", "0.71511906", "0.7145813", "0.7121271", "0.7114071", "0.7114071", "0.7113948", "0.7...
0.7792428
0
Reset the id of the Node. This is typically done during a normalization phase (e.g., "DOMWindow" > "Window").
def reset_id(self, newId): self.id = newId
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_uid():\n NNModel._UID_BASE = -1", "def reset_id(self, new_id):\n if self.id != new_id:\n self.id = new_id\n self.doc_js_name = new_id\n self.javascript_binding_name = new_id\n for member in self.operations:\n member.doc_js_interfa...
[ "0.70308524", "0.6869483", "0.6775127", "0.67088693", "0.6664753", "0.6553676", "0.65210867", "0.6483599", "0.6422293", "0.6365199", "0.63385797", "0.62504816", "0.6188777", "0.6186573", "0.61661303", "0.6149513", "0.6133739", "0.6111859", "0.6092984", "0.6090128", "0.6084401...
0.73122156
0
Returns a list containing this node and all it child nodes (recursive).
def all(self, type_filter=None): res = [] if type_filter is None or isinstance(self, type_filter): res.append(self) for v in self._all_subnodes(): if isinstance(v, IDLNode): res.extend(v.all(type_filter)) elif isinstance(v, list): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subtrees(self):\n return list(iter(self))", "def get_children(self):\n return []", "def get_children(self):\n return [node for node in self._children.values()]", "def get_children(self):\n std = self._std\n bld = self._bld\n cls = self.__class__\n\n root =...
[ "0.79112154", "0.790918", "0.7901621", "0.78076804", "0.777471", "0.7695004", "0.7685995", "0.76457787", "0.76147527", "0.76147527", "0.76147527", "0.76145494", "0.7598386", "0.7568883", "0.7553284", "0.7525412", "0.7502718", "0.7502027", "0.74894196", "0.74824876", "0.747616...
0.0
-1
Check a sparkdataframe to find existence of duplicate values for a set of given columns
def check_sparkdf_find_dupes(sparkdf,columns): return sparkdf.groupBy(columns).count().where('count>1').sort('count', ascending=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_by(df: pd.DataFrame, columns: List[str]) -> Result:\n result = Result(f\"Duplicates\")\n result.items_count = len(df)\n df = df.dropna(subset=columns, how=\"all\")\n duplicates = df[df.duplicated(columns, keep=False)][columns]\n if duplicates.empty:\n return result\n\n errors = {}...
[ "0.70761764", "0.67027205", "0.6699218", "0.660388", "0.65129834", "0.6485821", "0.64064527", "0.64027154", "0.63034064", "0.6282684", "0.61856705", "0.61500347", "0.6127648", "0.6047853", "0.5986667", "0.5979793", "0.59759897", "0.59615165", "0.5949579", "0.59030557", "0.590...
0.8052438
0
Get a nice string representation of the cubic polynomial `p`.
def nice_cubic_polynomial(p): tmp = "" if p["a"] == 1: tmp += " x^3" elif p["a"] != 0: tmp += "%.2fx^3" % p["a"] if p["b"] == 1: tmp += "\t+ x^2" elif p["b"] != 0: tmp += "\t+ %.2fx^2" % p["b"] else: tmp += "\t\t" if p["c"] == 1: tmp += "\t+ x"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self) -> str:\n polynomial = \"\"\n for i in range(self.degree, -1, -1):\n if self.coefficients[i] == 0:\n continue\n elif self.coefficients[i] > 0:\n if polynomial:\n polynomial += \" + \"\n else:\n ...
[ "0.6800418", "0.6732153", "0.67045623", "0.6659032", "0.66174585", "0.6423057", "0.6212907", "0.620363", "0.6016788", "0.58934104", "0.5886453", "0.5838241", "0.57581615", "0.573579", "0.57154334", "0.55892724", "0.5529264", "0.5507327", "0.55057025", "0.55036235", "0.5495405...
0.8349409
0
Unload a config entry.
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS) if unload_ok: hass.data[DOMAIN].pop(entry.entry_id) return unload_ok
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_unload_entry(hass, config_entry):\n unload_ok = await hass.config_entries.async_forward_entry_unload(\n config_entry, \"climate\"\n )\n return unload_ok", "async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:\n hass.data.pop(DOMAIN)\n return True", ...
[ "0.697284", "0.6888074", "0.6779855", "0.6747459", "0.6689002", "0.6657831", "0.66162205", "0.6603433", "0.65925974", "0.65595686", "0.65411645", "0.64977276", "0.64931643", "0.6486601", "0.6486601", "0.6486601", "0.6486601", "0.6469397", "0.6469397", "0.6462678", "0.6459733"...
0.6507643
14
Return a zerovalued matrix of the same shape as `matrix` and with equivalent integer or floating point type Note this differs from `numpy.zero_like` in that it always uses the largest integer type (int_) even if the source matrix uses a smaller type (e.g. uint8). This is so that we have sufficient headroom to sum many ...
def zero_like(matrix): dtype = numpy.int_ if is_integer(matrix) else numpy.float_ return numpy.zeros(matrix.shape, dtype=dtype)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zero_matrix(matrix):\n if not matrix:\n return\n\n n_rows = len(matrix)\n n_cols = len(matrix[0])\n\n # First row and first column of the matrix are used to store row and columns to nullify.\n # At the beginning we determine if the first row and/or first column contain a zero.\n first_...
[ "0.73966384", "0.71608627", "0.7073641", "0.68901014", "0.68604356", "0.68059593", "0.6800942", "0.67580235", "0.66957706", "0.66957706", "0.6672541", "0.6668487", "0.6637845", "0.66139966", "0.65811944", "0.65452635", "0.6541478", "0.6527024", "0.6525011", "0.65146905", "0.6...
0.8943931
0
Return smallest numpy integer type capable of representing all values in the supplied range
def smallest_int_type_for_range(minimum, maximum): signed = minimum < 0 abs_max = max(maximum, abs(minimum)) if signed: if abs_max < 1 << 7: return numpy.int8 elif abs_max < 1 << 15: return numpy.int16 elif abs_max < 1 << 31: return numpy.int32 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_signed_type(x, min_size=8):\n for int_dtype in np.sctypes[\"int\"]:\n if (cudf.dtype(int_dtype).itemsize * 8) >= min_size:\n if np.iinfo(int_dtype).min <= x <= np.iinfo(int_dtype).max:\n return int_dtype\n # resort to using `int64` and let numpy raise appropriate exce...
[ "0.71769917", "0.6977312", "0.67614967", "0.634183", "0.6268485", "0.62563896", "0.62008595", "0.61327434", "0.61305994", "0.61170274", "0.6067906", "0.6042717", "0.5960769", "0.59440744", "0.5943825", "0.5917356", "0.5911487", "0.58114755", "0.58102846", "0.5800823", "0.5799...
0.7716588
0
Returns the UTC date and time as a `datetime` object.
def Utc(self): return _EPOCH + datetime.timedelta(days=self.ut)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def utcdatetime(self):\n utc = self.toZone('UTC')\n second = int(utc._second)\n microsec = utc.micros() % 1000000\n dt = datetime(utc._year, utc._month, utc._day, utc._hour,\n utc._minute, second, microsec)\n return dt", "def utc():\n return date_from_ut...
[ "0.79494536", "0.7185768", "0.71735877", "0.7083116", "0.70780075", "0.70140195", "0.7010726", "0.69308555", "0.6928681", "0.6893604", "0.68374366", "0.6809676", "0.67880887", "0.67762154", "0.6714111", "0.66243637", "0.6605262", "0.65900433", "0.655665", "0.6450974", "0.6422...
0.0
-1
Calculates equatorial coordinates of a celestial body as seen by an observer on the Earth's surface.
def Equator(body, time, observer, ofdate, aberration): gc_observer = _geo_pos(time, observer) gc = GeoVector(body, time, aberration) j2000 = [ gc.x - gc_observer[0], gc.y - gc_observer[1], gc.z - gc_observer[2] ] if not ofdate: return _vector2radec(j2000, time) te...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _position_to_ECEF(self, latitude, longitude, altitude):\n\n # Convert the position to cartesian coordinates in the ECEF frame.\n angular_latitude = radians(latitude)\n angular_longitude = radians(longitude)\n a = 6378137.0 # Earth's semi-major axis (meters)\n f = 1/298.257223563 # Reciprocal fla...
[ "0.6263922", "0.61497617", "0.6112122", "0.60302675", "0.59933054", "0.5974637", "0.59005386", "0.58623946", "0.5847565", "0.58004224", "0.5771312", "0.57018155", "0.56987035", "0.56945324", "0.56408775", "0.5631874", "0.5605876", "0.55781645", "0.5563956", "0.5541898", "0.55...
0.6405329
0
Calculates heliocentric ecliptic longitude of a body based on the J2000 equinox. This function calculates the angle around the plane of the Earth's orbit of a celestial body, as seen from the center of the Sun. The angle is measured prograde (in the direction of the Earth's orbit around the Sun) in degrees from the J20...
def EclipticLongitude(body, time): if body == Body.Sun: raise InvalidBodyError() hv = HelioVector(body, time) eclip = Ecliptic(hv) return eclip.elon
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scalar_earth_angle( lat1, lon1, lat2, lon2):\n theta1 = lat1 *dtor\n phi1 = lon1 *dtor\n theta2 = lat2 * dtor\n phi2 = lon2 * dtor\n p1 = numpy.vstack((cos(theta1)*cos(phi1),cos(theta1)*sin(phi1),sin( theta1))).T\n p2 = numpy.vstack((cos(theta2)*cos(phi2), cos( theta2)* sin( phi2), sin( theta...
[ "0.62861323", "0.62691706", "0.62367535", "0.62124497", "0.6090344", "0.60588187", "0.599333", "0.59682375", "0.5910116", "0.5870196", "0.58282614", "0.57290375", "0.571611", "0.56917226", "0.565665", "0.5608026", "0.5599055", "0.5589569", "0.5571707", "0.5535048", "0.5532213...
0.61430514
4
Returns one body's ecliptic longitude with respect to another, as seen from the Earth. This function determines where one body appears around the ecliptic plane (the plane of the Earth's orbit around the Sun) as seen from the Earth, relative to the another body's apparent position. The function returns an angle in the ...
def PairLongitude(body1, body2, time): if body1 == Body.Earth or body2 == Body.Earth: raise EarthNotAllowedError() vector1 = GeoVector(body1, time, False) eclip1 = Ecliptic(vector1) vector2 = GeoVector(body2, time, False) eclip2 = Ecliptic(vector2) return _NormalizeLongitude(eclip1.elon ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scalar_earth_angle( lat1, lon1, lat2, lon2):\n theta1 = lat1 *dtor\n phi1 = lon1 *dtor\n theta2 = lat2 * dtor\n phi2 = lon2 * dtor\n p1 = numpy.vstack((cos(theta1)*cos(phi1),cos(theta1)*sin(phi1),sin( theta1))).T\n p2 = numpy.vstack((cos(theta2)*cos(phi2), cos( theta2)* sin( phi2), sin( theta...
[ "0.59436023", "0.5801272", "0.5670904", "0.5567944", "0.556547", "0.55235994", "0.55052245", "0.5504363", "0.54402506", "0.5427005", "0.5386866", "0.5347162", "0.5257846", "0.5243895", "0.5236571", "0.52174634", "0.519021", "0.518347", "0.5172707", "0.5159714", "0.5132748", ...
0.67752004
0
Finds visual magnitude, phase angle, and other illumination information about a celestial body. This function calculates information about how bright a celestial body appears from the Earth, reported as visual magnitude, which is a smaller (or even negative) number for brighter objects, and a larger number for dimmer o...
def Illumination(body, time): if body == Body.Earth: raise EarthNotAllowedError() earth = _CalcEarth(time) if body == Body.Sun: gc = Vector(-earth.x, -earth.y, -earth.z, time) hc = Vector(0.0, 0.0, 0.0, time) phase = 0.0 # placeholder value; the Sun does not have a phase ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_body_pos(component, time):\r\n # Convert to radians\r\n M = radians(eval(component.orbit['M'])(time))\r\n w = radians(eval(component.orbit['w'])(time))\r\n i = radians(eval(component.orbit['i'])(time))\r\n N = radians(eval(component.orbit['N'])(time))\r\n a = component.orbit['a']\r\n ...
[ "0.5986034", "0.575325", "0.568569", "0.55688435", "0.5526129", "0.5413503", "0.52904296", "0.5165623", "0.5120634", "0.5120634", "0.5028022", "0.502111", "0.4984233", "0.49829665", "0.4959016", "0.49546692", "0.49440768", "0.49328852", "0.48865834", "0.48638484", "0.4859351"...
0.6490706
0
Applies a rotation to a state vector, yielding a rotated state vector. This function transforms a state vector in one orientation to a state vector in another orientation. Both the position and velocity vectors are rotated the same way.
def RotateState(rotation, state): return StateVector( rotation.rot[0][0]*state.x + rotation.rot[1][0]*state.y + rotation.rot[2][0]*state.z, rotation.rot[0][1]*state.x + rotation.rot[1][1]*state.y + rotation.rot[2][1]*state.z, rotation.rot[0][2]*state.x + rotation.rot[1][2]*state.y + rotation...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def RotateVector(rotation, vector):\n return Vector(\n rotation.rot[0][0]*vector.x + rotation.rot[1][0]*vector.y + rotation.rot[2][0]*vector.z,\n rotation.rot[0][1]*vector.x + rotation.rot[1][1]*vector.y + rotation.rot[2][1]*vector.z,\n rotation.rot[0][2]*vector.x + rotation.rot[1][2]*vecto...
[ "0.660283", "0.6499375", "0.63328576", "0.6332595", "0.631458", "0.63041615", "0.61546046", "0.61114883", "0.5915919", "0.5903883", "0.586938", "0.5852559", "0.58192164", "0.5802146", "0.5791364", "0.57722956", "0.5769193", "0.5767105", "0.57183295", "0.5715796", "0.5715114",...
0.71861947
0
Returns a list of filenames for all jpg images in a directory.
def get_image_list(path: str) -> list: return list(os.path.join(path, f) for f in os.listdir(path) if f.endswith('.jpg'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def return_images(directory):\r\n allfiles = os.listdir(directory)\r\n image_list = [im for im in allfiles if '.jpg' in str(im)]\r\n image_list = [directory + im for im in image_list]\r\n return image_list", "def list_images(img_dir) -> Iterable[str]:\n extensions = (\".png\", \".jpg\", \".jpeg\",...
[ "0.826809", "0.820497", "0.78100127", "0.76965976", "0.76412135", "0.7619803", "0.75671864", "0.7563033", "0.7471995", "0.7467322", "0.7416391", "0.7407385", "0.73941857", "0.7390004", "0.73765004", "0.73607075", "0.73303187", "0.73159367", "0.7313564", "0.72920936", "0.72678...
0.7599427
6
Histogram equalisation of a grayscale image.
def histogram_equalisation(image: Image, n_bins: int =256) -> (Image, array): # get image histogram image_hist, bins = histogram(image.flatten(), n_bins, density=True) cdf = image_hist.cumsum() # cumulative distribution function cdf = 255 * cdf / cdf[-1] # normalise # use linear interpolation of c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def histogram_equalize(im_orig):\n if im_orig.ndim == 3:\n return _histogram_equalize_rgb(im_orig)\n return _histogram_equalize_grayscale(im_orig)", "def _histogram_equalize_grayscale(im_orig):\n image = im_orig.copy()\n\n hist_orig = utils.get_histogram(image)\n\n im_eq = _histogram_equali...
[ "0.8089166", "0.79507494", "0.7846936", "0.7705845", "0.76918745", "0.7631691", "0.7610614", "0.75724125", "0.74689364", "0.74419224", "0.7429299", "0.7402295", "0.73815554", "0.7358336", "0.7335168", "0.73210144", "0.73127174", "0.7252659", "0.72166526", "0.72011", "0.714280...
0.65979433
37
Get configs using the WGL_ARB_pixel_format extension. This method assumes a (dummy) GL context is already created.
def _get_arb_pixel_format_matching_configs(self, canvas): # Check for required extensions if self.sample_buffers or self.samples: if not gl_info.have_extension('GL_ARB_multisample'): return [] # Construct array of attributes attrs = [] for na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_pixel_format_descriptor_matching_configs(self, canvas):\n pfd = PIXELFORMATDESCRIPTOR()\n pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR)\n pfd.nVersion = 1\n pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL\n\n if self.double_buffer:\n pfd.dwFlags |= PFD_DOUBL...
[ "0.6772448", "0.57424074", "0.5567094", "0.52413565", "0.5173083", "0.50337434", "0.50237656", "0.49902695", "0.49771088", "0.49641028", "0.47908753", "0.47457704", "0.47089696", "0.46747124", "0.4663806", "0.46361196", "0.46246383", "0.4608715", "0.45941466", "0.4585389", "0...
0.69498193
0
Renders the home page, which varies depending on the type of user.
def home(): # sets the page to load depending on the type of user # if none specified the login screen will be displayed pageName = '' userType = session.get('UserType', None) if userType == None: pageName = 'anonHome.jade' elif userType == 'Seeker': pageName = 'indexJob.jade' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home():\n\n return render_template('home_page.html')", "def get(self):\n if self.logged_in:\n self.render('home.html', {\n 'name': self.current_user.name,\n 'server': self.current_user.server,\n 'faction': factions.get(self.current_user.faction),\n 'home': True,\n ...
[ "0.7827229", "0.7778227", "0.7643133", "0.7636759", "0.75849384", "0.75635684", "0.7546959", "0.75277245", "0.75277245", "0.75277245", "0.75277245", "0.75277245", "0.75277245", "0.75277245", "0.75277245", "0.75277245", "0.75277245", "0.75277245", "0.75277245", "0.75277245", "...
0.8399138
0
Renders the about page.
def about(): return render_template( 'about.jade', title='About', year=datetime.now().year, repository_name=repository.name, )
{ "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 on_about(self):\n render_about_window()", "def about():\n return render_temp...
[ "0.85650355", "0.85034525", "0.84489655", "0.84044397", "0.8394454", "0.82935613", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82680845",...
0.7702098
61
Validates if the mobile number is present in our DB
def validate(self, attrs): mobile_number = attrs.get('mobile_number') try: user = get_user_model().objects.get(mobile_number=mobile_number) except ObjectDoesNotExist: msg = _('Mobile number does not exist in our system') raise NotFound(detail=msg) return attrs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mobile_validator(mobile):\n if mobile[0:4] != '+989':\n raise ValidationError('Invalid mobile')", "def validate_mobile(self, mobile):\n self.mobile = mobile.strip()\n example = \"mobile number (ex. +2346787646)\"\n if re.match(r'(^[+0-9]{1,3})*([0-9]{10,11}$)',\n ...
[ "0.7908758", "0.78153634", "0.76618016", "0.7538794", "0.6858684", "0.68258494", "0.67313343", "0.66750556", "0.6673322", "0.6667678", "0.6658811", "0.66492355", "0.661446", "0.6564815", "0.6530095", "0.65300375", "0.64817286", "0.64553416", "0.64364177", "0.6432711", "0.6426...
0.6767172
6
Check if user instance passes this policy
def passes(self, request: PolicyRequest) -> PolicyResult: raise PolicyException()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_is_por_holder(self, obj):\n user = self.context['request'].user\n if not user.is_authenticated:\n return False\n # pylint: disable=no-member\n profile = UserProfile.objects.get(user=user)\n if obj in profile.get_council_privileges():\n return True\n ...
[ "0.66734934", "0.6639481", "0.6574904", "0.6545851", "0.650872", "0.64759743", "0.64663786", "0.6465928", "0.64608777", "0.638229", "0.6344151", "0.63245195", "0.63087034", "0.6306086", "0.6306086", "0.6306086", "0.63042015", "0.6287854", "0.6275693", "0.626434", "0.6246596",...
0.6083794
52
Validate user exists and then validate being admin
def clean(self, *args, **kwargs): super(AuthenticateAdminForm, self).clean(*args, **kwargs) if self.user_cache is not None and not self.user_cache.is_staff: raise forms.ValidationError(_('User is not admin')) return self.cleaned_data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validateUser(self,admin):\n \n res=admin.helper.getOneUser(self.name)\n if res == False:\n return True\n else:\n return False", "def admin_user_exists(self):\n try:\n User.objects.get(username='admin')\n except User.DoesNotExist:\n ...
[ "0.81679124", "0.8088987", "0.7232899", "0.7190351", "0.7126982", "0.7093386", "0.7093386", "0.7078438", "0.70723057", "0.7006676", "0.70019114", "0.69578856", "0.69193476", "0.6915106", "0.6891122", "0.6860301", "0.68589574", "0.68557143", "0.68480873", "0.6845856", "0.68119...
0.65191656
52
Gets a collection of `InputExample`s for the train set.
def get_train(self, data_file): return self.read_data(data_file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_train_inputs(self, example):\n return example", "def get_train_examples(self):\n raise NotImplementedError()", "def get_train_examples(self, input_file):\r\n raise NotImplementedError()", "def _create_examples(self, data, set_type):\n examples = []\n for (i, elem) in en...
[ "0.73499966", "0.7173421", "0.7126833", "0.65602446", "0.64204013", "0.64052176", "0.63422555", "0.6290186", "0.6282746", "0.625262", "0.62499267", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0...
0.0
-1
Gets a collection of `InputExample`s for the dev set.
def get_dev(self, data_file): return self.read_data(data_file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dev_examples(self, input_file):\r\n raise NotImplementedError()", "def get_train_inputs(self, example):\n return example", "def get_examples(self, env):\n return self.fam.c_get_examples(self, env)", "def get_dev_examples(self):\n raise NotImplementedError()", "def _create_ex...
[ "0.68112403", "0.6588688", "0.655683", "0.6552607", "0.64272827", "0.63816285", "0.6255956", "0.61930686", "0.61160946", "0.6094262", "0.6054992", "0.6051947", "0.5994604", "0.5994604", "0.5994604", "0.5994604", "0.5994604", "0.5994604", "0.5994604", "0.5994604", "0.5994604",...
0.0
-1
Encode the input vector and return the hidden layer.
def encode(self, input): h = np.zeros(self.hidden_size) preactivation = np.dot(self.W.T, input) + self.b sigmoid(preactivation, h) return h
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode(self):\n with tf.name_scope(\"encode\"):\n self.encoder_inputs = tf.layers.dense(\n inputs=self.encoder_inputs,\n units=self.options['hidden_size'], activation=None, use_bias=True,\n kernel_initializer=tf.keras.initializers.he_normal(seed=No...
[ "0.6366711", "0.62644607", "0.61589944", "0.6070543", "0.60465646", "0.60465646", "0.5984367", "0.5948031", "0.59459335", "0.5918803", "0.5918803", "0.58657014", "0.5859008", "0.58447266", "0.5814172", "0.58039576", "0.578531", "0.5781655", "0.57758033", "0.5770331", "0.57398...
0.6897835
0
Decode the hidden layer and return the output.
def decode(self, input_size): output = np.zeros(input_size) preactivation = np.dot(self.W, self.h) + self.c sigmoid(preactivation, output) return output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode(self, z):\n result = self.decoder_input(z)\n result = result.view(-1, 512, 2, 2)\n result = self.decoder(result)\n result = self.final_layer(result)\n return result", "def _DecodeFn():\n _, decode_dict = self._model.ConstructDecodeGraph(\n input_batch=i...
[ "0.6665868", "0.6654033", "0.65953827", "0.6576793", "0.6576793", "0.64054537", "0.6363088", "0.6333844", "0.6333844", "0.63186383", "0.6273008", "0.62217635", "0.619764", "0.619708", "0.6185212", "0.61830896", "0.61572087", "0.6149021", "0.61181104", "0.6088497", "0.60606277...
0.59683794
25
load an image from the specified path then resize and centrally crop it so it is `max_dim` x `max_dim` then add the batch dimension then do the VGG preprocessing steps.
def load_and_preprocess_image(path, max_dim=512): f = tf.io.read_file(path) img = tf.io.decode_image(f) img = resize_min(img, max_dim) img = tf.expand_dims(img, axis=0) img = vgg_preprocess_input(img) return img
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_image(path):\n img = skimage.io.imread(path)\n img = img / 255.0\n assert (0 <= img).all() and (img <= 1.0).all()\n short_edge = min(img.shape[:2])\n yy = int((img.shape[0] - short_edge) / 2)\n xx = int((img.shape[1] - short_edge) / 2)\n crop_img = img[yy: yy + short_edge, xx: xx + sh...
[ "0.6574183", "0.6447274", "0.63645583", "0.6272842", "0.6116848", "0.6110461", "0.6093452", "0.6065792", "0.60598665", "0.604062", "0.6029678", "0.60124916", "0.60006446", "0.59922904", "0.596092", "0.59437567", "0.58958584", "0.58794254", "0.58730483", "0.5871344", "0.582857...
0.7724589
0
Return true if num is a power of 2.
def is_power_of_2(num: int) -> bool: return ((num & (num - 1)) == 0) and num > 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isPower2(num):\n\treturn ((num & (num - 1)) == 0) and num > 0", "def isPower2(num):\n\treturn ((num & (num - 1)) == 0) and num > 0", "def is_power2(num):\n num = int(num)\n return num != 0 and ((num & (num - 1)) == 0)", "def is_power_of_two(n):\n if n < 0:\n return False\n else:\n ...
[ "0.884419", "0.884419", "0.88261586", "0.8139863", "0.8122464", "0.8112884", "0.7948784", "0.7947629", "0.7744439", "0.7555327", "0.7025078", "0.6979623", "0.6923772", "0.66791964", "0.66763175", "0.66548973", "0.661825", "0.65802264", "0.64112157", "0.6408351", "0.6348953", ...
0.8865914
0
Make initial condition. Currently, this is a hexagonal lattice + noise Makes reference to the self.hexagonal_lattice function, then crops down to the reference frame
def make_init(self,L,noise=0.005): self.L = L self.x0 = self.hexagonal_lattice(int(np.ceil(self.L/0.5)),int(np.ceil(self.L/np.sqrt(3))),noise=noise) # self.x0 = self.hexagonal_lattice(self.n_c,self.n_c,noise=noise) # self.x0 = self.x0[self.x0.max(axis=1) < L*0.95] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _setup_hydro_radial_initial_conditions(logger, filename,\n initial_condition):\n # Open the file, get needed dimensions\n gridfile = NetCDFFile(filename, 'r+')\n nVertLevels = len(gridfile.dimensions['nVertLevels'])\n # Get variables\n xCell = gridfile.v...
[ "0.59392774", "0.5737588", "0.55976343", "0.5594137", "0.55106485", "0.5469256", "0.54639053", "0.54175353", "0.5391243", "0.53064334", "0.52854824", "0.52771896", "0.5276438", "0.52277684", "0.5179265", "0.5150432", "0.5144536", "0.5126347", "0.5122714", "0.5107915", "0.5080...
0.6917108
0
Make initial condition. Currently, this is a hexagonal lattice + noise Makes reference to the self.hexagonal_lattice function, then crops down to the reference frame
def make_init_balanced(self,L,noise=0.005): self.L = L self.x0 = self.hexagonal_lattice(int(self.L),int(np.ceil(self.L)),noise=noise,A = self.A0) # self.x0 = self.hexagonal_lattice(self.n_c,self.n_c,noise=noise) # self.x0 = self.x0[self.x0.max(axis=1) < L*0.95] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_init(self,L,noise=0.005):\n self.L = L\n self.x0 = self.hexagonal_lattice(int(np.ceil(self.L/0.5)),int(np.ceil(self.L/np.sqrt(3))),noise=noise)\n # self.x0 = self.hexagonal_lattice(self.n_c,self.n_c,noise=noise)\n # self.x0 = self.x0[self.x0.max(axis=1) < L*0.95...
[ "0.69170046", "0.5940885", "0.57401407", "0.55956054", "0.55111027", "0.5468451", "0.54636616", "0.54187566", "0.5392479", "0.53079605", "0.52859926", "0.52788", "0.5277814", "0.5228037", "0.51774377", "0.5151226", "0.51468456", "0.5125766", "0.51237863", "0.5108989", "0.5079...
0.5599232
3
Get the number of islands, defined as contiguous regions of a given cell type. Considers only cases where there are two cell types. A_islands is the number of islands of cell_type == 0, and B_islands for cell_type == 1
def get_num_islands(self,nT=100): t_sel = np.linspace(0,self.n_t-1,nT).astype(int) A_islands,B_islands = np.zeros(nT,dtype=np.int32),np.zeros(nT,dtype=np.int32) for i, t in enumerate(t_sel): tri = self.tri_save[t] Adj = np.zeros((self.n_c,self.n_c),dty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_returns_correct_number_of_islands(self):\n grid = [\n [\"1\", \"1\", \"1\", \"0\", \"0\"],\n [\"1\", \"1\", \"0\", \"0\", \"1\"],\n [\"1\", \"0\", \"1\", \"0\", \"1\"],\n [\"0\", \"1\", \"1\", \"1\", \"1\"],\n [\"1\", \"0\", \"1\", \"1\", \"1\"...
[ "0.6784147", "0.67033917", "0.65098816", "0.6254648", "0.60965127", "0.60157305", "0.5926094", "0.5919941", "0.581518", "0.57760024", "0.57539946", "0.5724426", "0.57113403", "0.5588966", "0.5543214", "0.5469735", "0.5407624", "0.539489", "0.5381206", "0.53773445", "0.5289445...
0.6586224
2
Get the number of islands, defined as contiguous regions of a given cell type. Considers only cases where there are two cell types. A_islands is the number of islands of cell_type == 0, and B_islands for cell_type == 1
def get_num_boundaries(self, nT=100): t_sel = np.linspace(0, self.n_t - 1, nT).astype(int) num_boundaries = np.zeros(nT, dtype=np.int32) for i, t in enumerate(t_sel): tri = self.tri_save[t] tri_types = self.c_types[tri] # Find heteroty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_returns_correct_number_of_islands(self):\n grid = [\n [\"1\", \"1\", \"1\", \"0\", \"0\"],\n [\"1\", \"1\", \"0\", \"0\", \"1\"],\n [\"1\", \"0\", \"1\", \"0\", \"1\"],\n [\"0\", \"1\", \"1\", \"1\", \"1\"],\n [\"1\", \"0\", \"1\", \"1\", \"1\"...
[ "0.67853683", "0.6704313", "0.6586618", "0.6510527", "0.6255565", "0.6097517", "0.6016832", "0.5927237", "0.5921041", "0.58156675", "0.5776975", "0.5754796", "0.5725204", "0.57118547", "0.5589854", "0.5544013", "0.54708153", "0.5407814", "0.53959453", "0.53816605", "0.5378049...
0.45917535
95
Perform a normalization between [0,1]. x_norm = (xxmin)/(xmax xmin)
def normalize(self,x,xmin,xmax): return (x-xmin)/(xmax-xmin)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize(x):\r\n return x/norm(x)", "def normalize(x, lower=-1, upper=1):\n x_norm = (upper - lower)*((x - np.min(x)) / (np.max(x) - np.min(x))) + lower\n return x_norm", "def normalize(x):\n # TODO: Implement Function\n data_max = np.max(x)\n data_min = np.min(x)\n x = (x - data_min)...
[ "0.80984056", "0.7955471", "0.7869283", "0.78684324", "0.7778468", "0.775667", "0.7737361", "0.76808083", "0.7642053", "0.7642053", "0.7632772", "0.74893105", "0.74049294", "0.7340071", "0.72964716", "0.7260495", "0.7206723", "0.71853065", "0.71826017", "0.71630496", "0.71421...
0.7973795
1
Get the length of the interface between each pair of cells. LI[i,j] = length of interface between cell i and j = L[j,i] (if using periodic triangulation)
def get_l_interface(n_v,n_c, neighbours, vs, CV_matrix,L): h_j = np.empty((n_v, 3, 2)) for i in range(3): h_j[:, i] = vs h_jp1 = np.dstack((roll_reverse(neighbours[:,:,0]),roll_reverse(neighbours[:,:,1]))) l = np.mod(h_j - h_jp1 + L/2,L) - L/2 l = np.sqrt(l[:,:,0]**2 + l[:,:,1]**2) LI = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def leg_length(self, *args):\n i, j = args\n return Partition(list(self)).leg_length(i-1, j-1)", "def linelength(l):\n return dist(l[0],l[1])", "def lengthPerArea(I):\n perim = skimage.measure.perimeter(I.astype(int), 8)\n LA = perim / np.sum(I)\n print(\"LA (true count): {:.2%}\".for...
[ "0.59834963", "0.59422874", "0.5882861", "0.5844716", "0.5699111", "0.56649065", "0.562797", "0.5627206", "0.56237376", "0.5618193", "0.5616862", "0.5605292", "0.55870914", "0.5562787", "0.5554988", "0.5550756", "0.55480146", "0.5545356", "0.5511143", "0.5471276", "0.5458074"...
0.5498029
19
Read requirements file as a list.
def read_requirements(file_name): reqs = read_file(file_name).splitlines() if not reqs: raise RuntimeError( "Unable to read requirements from the %s file" "That indicates this copy of the source code is incomplete." % file_name ) return reqs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_requirements():\n with open('requirements.txt') as f:\n requirements = f.readlines()\n return [element.strip() for element in requirements]", "def read_requirements():\r\n reqs_path = os.path.join('.', 'requirements.txt')\r\n with open(reqs_path, 'r') as f:\r\n requirements = [...
[ "0.8748586", "0.8681122", "0.8619218", "0.8141392", "0.810621", "0.789851", "0.7836826", "0.7806789", "0.7762501", "0.7741214", "0.77101004", "0.76970416", "0.76383096", "0.7627496", "0.7618595", "0.7578627", "0.75467014", "0.7544747", "0.7517437", "0.74422437", "0.74133974",...
0.79659677
5
Get current running config on device.
def running_config(self): return self.show("show running-config")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config(self) -> 'outputs.DeviceConfigResponse':\n return pulumi.get(self, \"config\")", "def get_running_config(self, conn):\n config = conn.get_config(source=\"running\")\n if config:\n root = ET.fromstring(config._raw)\n running_config = root[0][0]\n rg...
[ "0.7413874", "0.7359133", "0.7343755", "0.7283954", "0.70826036", "0.70769906", "0.70321804", "0.70184255", "0.695905", "0.6955101", "0.6938347", "0.6938347", "0.6938347", "0.6938347", "0.6938347", "0.6938347", "0.6938347", "0.6938347", "0.6938347", "0.6938347", "0.6938347", ...
0.77269113
0
Get the device model.
def model(self): version_data = self._raw_version_data() if self._model is None: self._model = version_data["hardware"] return self._model
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model(self):\n return self._device.device_data[self._uuid]['model']", "def model(self):\n return self._bulb_device.model or self.capabilities.get(\"model\")", "async def get_model(self):\n\n # Display info message\n log.info(\"get_model\")\n\n # Get model\n output ...
[ "0.86849976", "0.82617897", "0.81384325", "0.7994881", "0.7916028", "0.7731288", "0.7724705", "0.7662568", "0.7662568", "0.76050144", "0.75849694", "0.75370795", "0.746513", "0.7363361", "0.7238591", "0.72034365", "0.7199427", "0.7087431", "0.7079612", "0.7069121", "0.7061479...
0.8051527
3
Get os version on device.
def os_version(self): version_data = self._raw_version_data() if self._os_version is None: self._os_version = version_data["version"] return self._os_version
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_os_version(self):\n\t\treturn call_sdk_function('PrlSrvInfo_GetOsVersion', self.handle)", "def get_os_version(self):\n\t\treturn call_sdk_function('PrlVmCfg_GetOsVersion', self.handle)", "def os_version(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"os_version\")", "def os_version(se...
[ "0.8357424", "0.8296784", "0.81600046", "0.80157346", "0.7974654", "0.79689115", "0.78939945", "0.7889954", "0.7727489", "0.75515336", "0.7465989", "0.73980474", "0.73010355", "0.72789496", "0.72318625", "0.7206821", "0.72060955", "0.7144352", "0.71371037", "0.71362656", "0.7...
0.78450805
8
Get serial number of device.
def serial_number(self): version_data = self._raw_version_data() if self._serial_number is None: self._serial_number = version_data["serial"] return self._serial_number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_serial_number(self) -> str:\n return pulumi.get(self, \"device_serial_number\")", "def device_serial_number(self) -> str:\n return pulumi.get(self, \"device_serial_number\")", "def get_serial_number(self):\n serial = create_string_buffer(64)\n self._dll.ShamrockGetSerialN...
[ "0.85125524", "0.85125524", "0.8111351", "0.8094309", "0.8078873", "0.78911734", "0.7887509", "0.78827775", "0.7830774", "0.7773291", "0.7737921", "0.7638606", "0.763237", "0.7598803", "0.75985247", "0.7572365", "0.7568262", "0.7548178", "0.7542104", "0.75192124", "0.7504787"...
0.75096977
20
Total amount this user has contributed to other peoples' orders, minus total amount others have contributed to this user's orders.
def karma(self): total = (sum(oc.amount for oc in self.order_contributions if oc.is_external) - sum(o.external_contribution for o in self.own_orders)) return total or Decimal('0.00')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_raised(self):\n return self.total_donated() + (self.community_contribution or 0)", "def payout(self):\n user = self.completed_by\n user_node = user.get()\n for key, value in self.v_reward:\n user_node[key] += value\n graph.push(user_node)", "def total_pai...
[ "0.6011712", "0.59071547", "0.58578575", "0.5741217", "0.5712757", "0.56965977", "0.5675433", "0.56498843", "0.5608585", "0.5605787", "0.5584599", "0.55698866", "0.5546173", "0.5531884", "0.54835373", "0.54538035", "0.5443094", "0.54304713", "0.54099894", "0.540866", "0.54072...
0.5759845
3
Method to create app and set up test client
def setUp(self): self.app = create_app("testing") self.app = self.app.test_client() self.question_details = { "title": "How to exit Vim on Ubuntu 16.04", "description": "How does one get the exit Vim from terminal?"}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n self.app = create_app()\n self.client = self.app.test_client", "def test_app():\n # setup\n app = main.create_application()\n app.dependency_overrides[get_settings] = get_settings_override\n with TestClient(app) as test_client:\n yield test_client\n # te...
[ "0.79120404", "0.78470296", "0.78286195", "0.77330875", "0.769381", "0.7615462", "0.7611224", "0.7611224", "0.7611224", "0.7611224", "0.7611224", "0.7611224", "0.7611224", "0.7611224", "0.7611224", "0.75286645", "0.75286645", "0.75258005", "0.7520442", "0.7509644", "0.7508783...
0.0
-1
Get list of spectra for given parameter list and base name.
def _get_spectrum(parlist, catdir): name = parlist[3] filename = name.split('[')[0] column = name.split('[')[1][:-1] filename = os.path.join(catdir, filename) sp = SourceSpectrum.from_file(filename, flux_col=column) totflux = sp.integrate() try: validate_totalflux(totflux) exc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_all_spectra(self):\n pass", "def get_snapshot_list(self, base, snappref=\"SPECTRA_\"):\n #print('Looking for spectra in', base)\n powerspectra = FluxPower(maxk=self.max_k)\n for snap in range(30):\n snapdir = os.path.join(base,snappref+str(snap).rjust(3,'0'))\n ...
[ "0.70337903", "0.6748008", "0.6547452", "0.6412692", "0.62961274", "0.61495095", "0.5945992", "0.5933074", "0.5743851", "0.5738307", "0.5712551", "0.5701117", "0.56282717", "0.56207204", "0.5576099", "0.5532797", "0.55142087", "0.5511111", "0.55032444", "0.549668", "0.54515",...
0.6810884
1
Efficient and convenient way of displaying images in interactive tabs grouped by labels/clusters. It's using IPython.display function and HTML under the hood
def plot_class_tabs( images, labels, max_imgs_per_tab=10, img_width=220, force_b64=False): assert(len(images) == len(labels)) assert(type(images) is np.ndarray) assert(type(labels) is np.ndarray) assert(type(max_imgs_per_tab) is int) assert(type(img_width) is ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def visualize(**images):\n n = len(images)\n plt.figure(figsize=(16, 5))\n for i, (name, image) in enumerate(images.items()):\n plt.subplot(1, n, i + 1)\n plt.xticks([])\n plt.yticks([])\n plt.title(' '.join(name.split('_')).title())\n plt.imshow(image)\n plt.show()\n...
[ "0.6748637", "0.65655255", "0.6563977", "0.6501886", "0.6479263", "0.6456324", "0.6456324", "0.6456324", "0.645349", "0.6315476", "0.63038445", "0.6289486", "0.6232979", "0.62301207", "0.622404", "0.6200554", "0.6190136", "0.6176619", "0.61536527", "0.6129579", "0.61195445", ...
0.63179487
9
Sets the action of this WorkflowWorkflowInfoAllOf.
def action(self, action): allowed_values = ["Start", "Pause", "Resume", "Retry", "Cancel"] # noqa: E501 if self.local_vars_configuration.client_side_validation and action not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `act...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setAction(self, action):\n self.action = action\n return self", "def set_action(self, action):\n self._action = action\n return self", "def set_action(self, action):\n self.action = action", "def set_action(self, action):\n self.action = action", "def set_actio...
[ "0.67782867", "0.66763484", "0.6644579", "0.6644579", "0.6624107", "0.63052374", "0.6289504", "0.62523377", "0.6239488", "0.6229905", "0.6229905", "0.6229905", "0.6229905", "0.6229905", "0.6229905", "0.62084633", "0.60454094", "0.5966737", "0.58288383", "0.5599939", "0.559902...
0.549344
26
Sets the end_time of this WorkflowWorkflowInfoAllOf.
def end_time(self, end_time): self._end_time = end_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def end_time(self, end_time):\n self._end_time = end_time", "def end_time(self, end_time):\n self._end_time = end_time", "def end_date_time(self, end_date_time):\n\n self._end_date_time = end_date_time", "def end_time(self, end_time):\n if end_time is None:\n raise Valu...
[ "0.7656553", "0.7656553", "0.75073254", "0.72321594", "0.71457255", "0.7067891", "0.69822735", "0.6753781", "0.64392823", "0.64392823", "0.64392823", "0.64392823", "0.64392823", "0.64392823", "0.64392823", "0.64392823", "0.6435791", "0.6409524", "0.624342", "0.6118381", "0.60...
0.77241963
2
Sets the name of this WorkflowWorkflowInfoAllOf.
def name(self, name): self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n\t\...
[ "0.62764657", "0.62764657", "0.62764657", "0.62764657", "0.62764657", "0.62536746", "0.6230616", "0.6227525", "0.6227525", "0.6222099", "0.6218799", "0.6218799", "0.6205494", "0.6205494", "0.62021226", "0.6189971", "0.6181939", "0.6181939", "0.6181939", "0.6181939", "0.616011...
0.0
-1
Sets the start_time of this WorkflowWorkflowInfoAllOf.
def start_time(self, start_time): self._start_time = start_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_time(self, start_time):\n self._start_time = start_time", "def start_time(self, start_time):\n self._start_time = start_time", "def start_time(self, start_time: str):\n if start_time is None:\n raise ValueError(\"Invalid value for `start_time`, must not be `None`\") #...
[ "0.7259494", "0.7259494", "0.69659585", "0.69177955", "0.6755454", "0.6697145", "0.6528818", "0.6504401", "0.6454112", "0.6428467", "0.6376379", "0.63364375", "0.62980837", "0.6253419", "0.62471837", "0.61212367", "0.61151904", "0.60787255", "0.6065423", "0.6058514", "0.60366...
0.73148024
3
Sets the success_workflow_cleanup_duration of this WorkflowWorkflowInfoAllOf.
def success_workflow_cleanup_duration(self, success_workflow_cleanup_duration): self._success_workflow_cleanup_duration = success_workflow_cleanup_duration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def failed_workflow_cleanup_duration(self,\n failed_workflow_cleanup_duration):\n\n self._failed_workflow_cleanup_duration = failed_workflow_cleanup_duration", "def success_retention_period(self) -> pulumi.Output[Optional[int]]:\n return pulumi.get(self, \"su...
[ "0.6195331", "0.5141385", "0.5139909", "0.46657354", "0.46411705", "0.46411705", "0.46364954", "0.4449436", "0.43824297", "0.43647543", "0.43647543", "0.43206546", "0.4311806", "0.42858744", "0.427781", "0.42298764", "0.41808632", "0.41712856", "0.41086656", "0.41024885", "0....
0.8581278
0
Sets the type of this WorkflowWorkflowInfoAllOf.
def type(self, type): self._type = type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_type(self, type_balle):\n self.type_balle = type_balle", "def set_type(self, type):\n self.type = type", "def set_type(self, type):\n self.type = type", "def set_type(self, type):\n self._type = type", "def type(self, type):\n self._type = type", "def type(self,...
[ "0.6196338", "0.59517366", "0.59517366", "0.57625175", "0.5707861", "0.5707861", "0.56250185", "0.5578843", "0.5550348", "0.5549706", "0.5549706", "0.55156875", "0.54781955", "0.5425611", "0.5425611", "0.54060525", "0.53827435", "0.5378038", "0.5378038", "0.5378038", "0.53767...
0.5659843
27
Sets the workflow_meta_type of this WorkflowWorkflowInfoAllOf.
def workflow_meta_type(self, workflow_meta_type): allowed_values = ["SystemDefined", "UserDefined", "Dynamic"] # noqa: E501 if self.local_vars_configuration.client_side_validation and workflow_meta_type not in allowed_values: # noqa: E501 raise ValueError( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_type(self, type_balle):\n self.type_balle = type_balle", "def meta(self, meta):\n if not isinstance(meta, GiftiMetaData):\n raise TypeError(\"Not a valid GiftiMetaData instance\")\n self._meta = meta", "def set_olap_type(self, column, olap_type):\n self[column][OL...
[ "0.49841064", "0.4907281", "0.4824843", "0.48142347", "0.48142347", "0.48142347", "0.48142347", "0.48142347", "0.47350627", "0.4677754", "0.4677754", "0.46724626", "0.46508554", "0.46230292", "0.46005636", "0.45840526", "0.45711994", "0.45569384", "0.45551628", "0.45551628", ...
0.7319362
0