query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Method to return a single user item based on the user item's id and its user's id
def get_shoppinglist(self, user_id, item_id): single_user = self.get_single_user(user_id) for item in single_user['shopping_lists']: if item['id'] == item_id: return item
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_item(self, id: str, user: User) -> Optional[T]:", "def get_item_with_id(self, uid):\n for item in self.get_items():\n if item.id == uid:\n return item\n\n return None", "def read_item(\n *,\n db: Session = Depends(deps.get_db),\n id: int,\n current_us...
[ "0.81888264", "0.74340504", "0.74272496", "0.7383298", "0.736834", "0.73598313", "0.7240594", "0.7074708", "0.7013704", "0.6996037", "0.6929328", "0.68309075", "0.67663807", "0.6757231", "0.6750522", "0.6712037", "0.66984546", "0.66922104", "0.66691977", "0.66645956", "0.6620...
0.7080669
7
Method to delete a user item based on its id and its user's id
def remove_shoppinglist(self, user_id, item_id): single_user = self.get_single_user(user_id) for item in single_user['shopping_lists']: if item['id'] == int(item_id): single_user['shopping_lists'].remove(item)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_item(self, id: str, user: User) -> bool:", "def delete_item(self, item_id, user_id):\r\n item = self._db_manager.get_item(item_id)\r\n if item is None:\r\n flash(\"Invalid item.\")\r\n return\r\n if item[\"user_id\"] != user_id:\r\n flash(\"Only th...
[ "0.8827835", "0.8003457", "0.7913838", "0.7846232", "0.7707595", "0.76937795", "0.7643314", "0.76206136", "0.75877017", "0.74724805", "0.74564457", "0.7368197", "0.7362754", "0.7349677", "0.7290494", "0.72537416", "0.7233881", "0.7227828", "0.719459", "0.71916765", "0.7161109...
0.0
-1
Method to add shopping items to a shopping list
def add_shoppingitems(self, user_id, shoppinglist_id, name, quantity): new_shoppingitem = ShoppingItem(name, quantity) new_shoppingitem_details = new_shoppingitem.get_details() user = self.get_single_user(user_id) for shopinglist in user['shopping_lists']: if shopinglist['id'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_item_to_shopping_list(shopping_list, item, quantity):\n shopping_list_items = ShoppingListItems.query.filter_by(shopping_list_id=shopping_list.id, item_id=item.id).first()\n if shopping_list_items is None:\n shopping_list_items = ShoppingListItems(shopping_list_id=shopping_list.id, item_id=ite...
[ "0.69891316", "0.6971309", "0.6909483", "0.6886743", "0.68709165", "0.6862786", "0.6772096", "0.67416227", "0.6698839", "0.66877407", "0.6674672", "0.66226494", "0.66226494", "0.66226494", "0.65921545", "0.65899134", "0.65749466", "0.6560956", "0.6547719", "0.65255886", "0.65...
0.72290874
0
Method to get a single item from the shopping list
def get_shoppingitem(self, user_id, shoppinglist_id, item_id): shoppinglist = self.get_shoppinglist(user_id, shoppinglist_id) for item in shoppinglist['items']: if item['id'] == item_id: return item
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_item(item_id):\n return Item.query.filter_by(id=item_id).first()", "def get_item(self, name: str) -> Optional[Item]:\n item = self.filter_items(name, limit=1)\n return item[0] if item else None", "def get_item(self, call_number):\n return self.item_list.get(call_number)", "def...
[ "0.72919077", "0.7291454", "0.7179455", "0.7159581", "0.715449", "0.7142205", "0.7142205", "0.70436245", "0.69442225", "0.69362116", "0.693477", "0.6910595", "0.6884364", "0.68688667", "0.67610484", "0.67220116", "0.67014426", "0.6701249", "0.66954094", "0.6669914", "0.660991...
0.75183713
0
Method to delete an item from the shoppinglist
def remove_shoppingitem(self, user_id, shoppinglist_id, item_id): shoppinglist = self.get_shoppinglist(user_id, shoppinglist_id) for item in shoppinglist['items']: if item['id'] == int(item_id): shoppinglist['items'].remove(item)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_item(request, shoppinglist_id, item_id):\n Item.objects.filter(pk=item_id,\n shoppinglist__pantry__owner=request.user).delete()\n return redirect('shoppinglists.views.detail', shoppinglist_id)", "def deleteItem(list,item):\n print \"I deleted this item:\", item\n lis...
[ "0.8030308", "0.7621568", "0.7593034", "0.7562986", "0.750939", "0.7415289", "0.73915005", "0.7387138", "0.7356343", "0.73174816", "0.73023534", "0.7295307", "0.7246188", "0.72387516", "0.71779037", "0.7167007", "0.7143311", "0.71206284", "0.71154463", "0.70882845", "0.708669...
0.6691563
50
Method to indicate bought items
def buy_shoppingitem(self, user_id, shoppinglist_id, item_id): item = self.get_shoppingitem(user_id, shoppinglist_id, item_id) if not item['bought']: item['bought'] = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def purchase(self, item_type):", "def purchase_item(self):\r\n self.purchased_callback()\r\n self.status = 'purchased'\r\n self.fulfilled_time = datetime.now(pytz.utc)\r\n self.save()", "async def _vis_buy(self, ctx, *args):\n if has_post_permission(ctx.guild.id, ctx.channel....
[ "0.73451656", "0.67821705", "0.6600444", "0.65148836", "0.65054286", "0.6455387", "0.6421658", "0.63444376", "0.6324628", "0.6315627", "0.63023406", "0.6289282", "0.628285", "0.62249106", "0.6185769", "0.6153408", "0.6136711", "0.6134128", "0.60930735", "0.6054386", "0.605315...
0.75839543
0
If your looking at this and thinking 'why in gods name are you doing that', realize that this is required by the android app which I have no controll over. This is flat out dumb.
def get_legacy_pins(): return "2018-08-29 11:15:32.841\n" + json.dumps( list(map(translate_to_old, pin_dao.get_all())), indent = 4 )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def think(self):\n pass", "def support(self):", "def degibber(self):", "def _(a):\n\ta.internal.device.google_experience = not getattr(a.internal.settings,\n\t\t\t\t'False',\n\t\t\t\t'charge_only_mode' in a.device.ls('/system/bin'))\n\tif a.internal.device.google_experience:\n\t\tandroid.log.info(TAG,...
[ "0.52237844", "0.5203687", "0.5098423", "0.5072103", "0.5052208", "0.50287414", "0.49808693", "0.4959477", "0.49032933", "0.48983845", "0.4890433", "0.48784813", "0.48569018", "0.48569018", "0.48456803", "0.48218966", "0.48055628", "0.47725958", "0.476807", "0.47618002", "0.4...
0.0
-1
Parse a directory of HTML pages and check for links to other pages. Return a dictionary where each key is a page, and values are a list of all other pages in the corpus that are linked to by the page.
def crawl(directory): pages = dict() # Extract all links from HTML files for filename in os.listdir(directory): if not filename.endswith(".html"): continue with open(os.path.join(directory, filename)) as f: contents = f.read() links = re.findall(r"<a\s+(?...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linked_pages(corpus, page):\n pages = list()\n\n for link in corpus:\n if page in corpus[link]:\n pages.append(link)\n\n if not corpus[link]:\n pages.append(link)\n\n return pages", "def parse_page(url):\n page_content = download_page(url)\n if page_content:...
[ "0.6817799", "0.6559882", "0.6514604", "0.64565563", "0.6432747", "0.62858313", "0.6256209", "0.6251121", "0.614946", "0.607668", "0.60331887", "0.60087353", "0.5999504", "0.5984497", "0.5887131", "0.58262646", "0.58190536", "0.5814247", "0.5813702", "0.5809713", "0.5790241",...
0.8283629
7
Return a probability distribution over which page to visit next, given a current page. With probability `damping_factor`, choose a link at random linked to by `page`. With probability `1 damping_factor`, choose a link at random chosen from all pages in the corpus.
def transition_model(corpus, page, damping_factor): prob_dist = defaultdict(float) corpus_len = len(corpus) if not corpus[page]: for corpus_page in corpus: prob_dist[corpus_page] += 1/corpus_len return prob_dist len_linked_pages = len(corpus[page]) for linked_page in cor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transition_model(corpus, page, damping_factor):\n distribution = dict() #Create a dictionary for the probability distribution\n all_pages = []\n links = list(corpus[page]) #All pages linked by current page\n for u in corpus:\n all_pages.append(u)\n\n #If the current page does not link to ...
[ "0.7992964", "0.77270436", "0.764785", "0.7500536", "0.72686094", "0.70465213", "0.6915432", "0.68950415", "0.6844223", "0.6782304", "0.6755477", "0.6724492", "0.66375583", "0.6618151", "0.6553851", "0.65046436", "0.63941073", "0.63314575", "0.6278812", "0.62436855", "0.62332...
0.7451512
4
Return PageRank values for each page by sampling `n` pages according to transition model, starting with a page at random. Return a dictionary where keys are page names, and values are their estimated PageRank value (a value between 0 and 1). All PageRank values should sum to 1.
def sample_pagerank(corpus, damping_factor, n): corpus_length = len(corpus) # First sample previous_page_rank = defaultdict(lambda: 1/corpus_length) # All remaining samples # Choose a previous page, then add transition probabilities # Loop over remaining previous pages for sample in range(1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample_pagerank(corpus, damping_factor, n):\n\n PageRank = dict()\n\n # set ranks of all pages to 0\n for page in corpus:\n PageRank[page] = 0.0\n\n # choose the first sample page at random\n sample = random.choice(list(corpus.keys()))\n PageRank[sample] += 1\n\n # to go to the next...
[ "0.75169337", "0.6918657", "0.6863597", "0.6627731", "0.6537425", "0.65101093", "0.6433924", "0.6317246", "0.60648733", "0.5941704", "0.58936095", "0.58452195", "0.57045394", "0.56618065", "0.56023586", "0.55996376", "0.55472916", "0.552801", "0.54974765", "0.5457652", "0.542...
0.67144537
3
Return PageRank values for each page by iteratively updating PageRank values until convergence. Return a dictionary where keys are page names, and values are their estimated PageRank value (a value between 0 and 1). All PageRank values should sum to 1.
def iterate_pagerank(corpus, damping_factor): # Set initial values to choosing a page randomly corpus_length = len(corpus) prev_iterated_page_rank = defaultdict(lambda: 1/corpus_length) max_abs_difference = inf while max_abs_difference > 0.001: max_iter_diff = -inf next_iterated_page...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def PageRank(start):\n probs = {}\n probs[start] = 1\n num_page_rank_iterations = 3\n maximum = 25\n\n PageRankProbs = PageRankHelper(start,\n probs,\n num_page_rank_iterations)\n\n PageRankProbs = zip(PageRankProbs.iterkeys(),\n...
[ "0.71327984", "0.7025723", "0.68315536", "0.67477626", "0.6581035", "0.6356272", "0.6345436", "0.6294455", "0.6282516", "0.6247623", "0.62171674", "0.6167306", "0.61651623", "0.61310714", "0.5901231", "0.5877613", "0.57514936", "0.5736412", "0.56930906", "0.5603937", "0.55962...
0.6230429
10
MAX SIZE OF RANDOM INTEGER RANGE TO GENERATE ALL POSSIBLE PERMS is 2080
def __permute(l,opts): MAX_RAND_SIZE = 2080 if (len(l)/3 < MAX_RAND_SIZE): rd.shuffle(l) else: sys.stderr.write(\ "{}:{}: Valid Random Permutation Range Exceeded."\ .format(opts.progname,permute.__name__)) opts.perror+=1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_digits(generator, size) :\n return [int(generator.random()*10) for i in range(size)]", "def create_num_size(size):\n rand.seed(datetime.now())\n num = ''\n size = rand.choice(size) \n for _ in range(size):\n a = rand.randint(0,9)\n num += str(a)\n return num", "def ...
[ "0.7028499", "0.67332536", "0.6693746", "0.6675463", "0.66336054", "0.6608696", "0.657713", "0.6521843", "0.6511546", "0.6500632", "0.64960986", "0.6493789", "0.6480264", "0.6464707", "0.6453372", "0.63872236", "0.6383089", "0.63741326", "0.6346072", "0.6323319", "0.6305728",...
0.60394675
35
Initialisation of a _Config instance.
def __init__(self, *args, **kwargs): super().__init__() self._cfg = ConfigDict() # current configuration self._default_config = ConfigDict() # default configuration self._temp_config = OrderedDict() # temporary configuration self._path = Path() # current configuration pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_config(self):\n pass", "def init_config() -> Config:\n ...", "def _init_config_(self):\n self._config= {}", "def initialize(self, **kwargs):\n\n # Defining the configuration object\n self.config = kwargs.get('config')", "def Init(self, config):\r\n pass", "def _...
[ "0.7909576", "0.7742302", "0.7696239", "0.7674185", "0.75723463", "0.7561906", "0.74977136", "0.7456496", "0.7397632", "0.7368958", "0.7259326", "0.7254477", "0.72241116", "0.72157997", "0.7205846", "0.7189471", "0.7189471", "0.7183831", "0.71579534", "0.71477437", "0.7131284...
0.7987772
0
Edit attributes of the configuration.
def edit(self, **kwargs): for attr in self.EDITABLE_ATTR: kwarg = kwargs.pop(attr, self._WILDCARD) if kwarg is not self._WILDCARD: setattr(self, attr, kwarg) logger.debug("Attribute '{}' changed to '{}'.".format(attr, kwarg)) for p_attr in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_attributes(self, attributes):\n self.attributes = dict(attributes) # overwrite the existing registry of attributes with the input attributes", "def set_attributes(self, attributes):\n self.attributes = dict(attributes) # overwrite the existing registry of attributes with the input attribu...
[ "0.6473589", "0.6473589", "0.6473589", "0.63702786", "0.63045835", "0.6293869", "0.6224746", "0.62141687", "0.61229956", "0.61122084", "0.61088306", "0.6079231", "0.60124195", "0.60124195", "0.60038865", "0.6000448", "0.59741896", "0.5974063", "0.5967706", "0.5967706", "0.596...
0.75753456
0
If the section doesn't exist and search_in_default_config, append the section from default config to current configuration
def _check_section(self, section: Union[str, list], search_in_default_config: bool = None): section = None if section is None else ConfigDict.TO_KEY_FUNC(section) search_in_default_config = self._search_in_default_config if search_in_default_config is None \ else search_in_default_config ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_config(self, section=None):\r\n self.set_section(section, search_in_default_config=True)", "def overwrite(section: str, data: any) -> None:\n\toverwriteDict[section] = data\n\tlogger.debug(f'Overwritten config {section}!')", "def search_for_config(self, cfg_section, options):\n for key, ...
[ "0.68606806", "0.6550262", "0.65217954", "0.6469845", "0.6428516", "0.6379521", "0.6358503", "0.62302405", "0.6228921", "0.61324304", "0.6030926", "0.60255", "0.5983904", "0.59709", "0.59571606", "0.59264976", "0.5877952", "0.5862359", "0.5850703", "0.5835888", "0.5816391", ...
0.7271659
0
Returns the SectionDict associated to the 'section' key
def get_section(self, section=None, set_section=False, add_section=False, search_in_default_config=None): section = self._check_section(section, search_in_default_config=search_in_default_config) return self._cfg.get_section(section=section, set_section=set_section, add_section=add_section)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dict(self, section):\n\t\t\n\t\tdct = {}\n\t\t\n\t\tfor name, value in self.items(section):\n\t\t\tdct[name] = self.parse_value(value)\n\t\t\n\t\treturn dct", "def section(self):\n return SECTION_NAME_TO_SECTION[self.section_name]", "def get_options_for_section(section: str) -> Dict[str, Any]:\n w...
[ "0.7338172", "0.70201725", "0.69332033", "0.6904912", "0.68920475", "0.68613344", "0.6850933", "0.66979533", "0.6686725", "0.668527", "0.6677349", "0.66024166", "0.65857536", "0.6570939", "0.65477306", "0.65411085", "0.64621943", "0.6413999", "0.6413999", "0.6377982", "0.6362...
0.55626315
59
alias of set_section, with search_in_default_config argument True by default.
def load_config(self, section=None): self.set_section(section, search_in_default_config=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure(self, section):", "def search_for_config(self, cfg_section, options):\n for key, default in options.items():\n val = default\n if key in cfg_section:\n val = cfg_section[key]\n setattr(self, key, val)", "def _check_section(self, section: Unio...
[ "0.6789469", "0.66695064", "0.6498293", "0.6160742", "0.60437703", "0.6006598", "0.59721696", "0.59567016", "0.5919255", "0.5820273", "0.57651395", "0.57304776", "0.57055175", "0.569853", "0.56252676", "0.5622563", "0.5590487", "0.5496037", "0.5474919", "0.54692334", "0.54423...
0.6786406
1
alias to _cfg attribute
def config(self, config_dict): self._cfg.config = config_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config( **kwargs ):", "def configuration():", "def config(self, **kw):\n self.cfg_fixture.config(**kw)", "def config():", "def config():", "def config(self) -> NamedTuple:", "def set_config(self, cfg):\n\n cfg.add_section(self.name)\n for attr, value in self.__dict__.items():\n...
[ "0.71776825", "0.685836", "0.6824247", "0.67317116", "0.67317116", "0.6731125", "0.6682881", "0.66780627", "0.66780627", "0.66780627", "0.65280193", "0.64987534", "0.6493411", "0.6397842", "0.63869405", "0.63869405", "0.635186", "0.6324506", "0.6317438", "0.6309337", "0.62967...
0.0
-1
Load configuration from file. If forceload, reload_default values on error..
def load(self, path=None, force_load=None, auto_cast=None, load_empty=None, merge_how='right'): path = self._path if path is None else Path(path) auto_cast = self._auto_cast if auto_cast is None else auto_cast force_load = self._force_load if force_load is None else force_load load_e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(self, cfgfile, force_reload=False, failonerror=True,\n replace_keys={}):\n realpath = None\n if os.path.exists(cfgfile):\n realpath = cfgfile\n else:\n new_p = self._findConfigPath(cfgfile)\n if new_p:\n realpath = new_p\n ...
[ "0.7139778", "0.6983545", "0.69751984", "0.6963302", "0.6923232", "0.6894999", "0.68552387", "0.68206865", "0.6814341", "0.6757191", "0.6630725", "0.66274244", "0.6623084", "0.6610858", "0.66084945", "0.6578569", "0.65465844", "0.64928377", "0.64717007", "0.6463129", "0.64572...
0.7279285
0
Set path and config to default values. If write is True, overwrite default file with default configuration.
def reload_default(self, write=True, backup=True, how='right', how_section=None, sections=None): # self._cfg = self.default_config.deepcopy() self._path = self._default_path.copy() dico = self.default_config.deepcopy() sections = {sections} if isinstance(sections, str) else sections ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _write_default_config(self, force=False):\n\t\t\n\t\tif self.configfilepath is not None:\n\t\t\tlogger.debug(\"You use the existing config file %s, I don't have to write one.\" % \\\n (self._get_config_filepath()))\n\t\t\treturn\n\t\t\n\t\tif force or not os.path.exists(...
[ "0.66851825", "0.6599315", "0.6573214", "0.63652515", "0.6331893", "0.62328666", "0.62254226", "0.62060577", "0.6150296", "0.6066432", "0.60447663", "0.5919648", "0.5907546", "0.58950347", "0.58055705", "0.576085", "0.5756444", "0.575341", "0.5591363", "0.5586188", "0.5564079...
0.6801692
0
Returns a config_dict read from a INI file.
def read_config(cls, path, auto_cast=True, anomaly_flag='warning'): # WARNING: No check of input arguments ! # Read the configuration file with configparser config_parser = configparser.ConfigParser() try: config_parser.read(path, encoding=ENCODING) except (conf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_ini_file_into_dict(filename):\n output = {}\n\n INIfile = SafeConfigParser()\n result = INIfile.read(filename) # returns an empty list if file error\n if result == []:\n raise IOError\n\n #iterate through INI file and build dictionary\n for section_name in INIfile.sections():\n ...
[ "0.8019814", "0.7851325", "0.7706471", "0.74429536", "0.74194014", "0.7389865", "0.7376074", "0.7328146", "0.7315623", "0.7299748", "0.72546816", "0.7174758", "0.7162111", "0.714674", "0.70953774", "0.70951605", "0.70395404", "0.7037581", "0.70244175", "0.7005851", "0.6988791...
0.0
-1
Implement trajectory generator for your manipulator. Positional trajectory should be a 3rd degree polynomial going from an initial state q_0 to desired state q_k. Remember to derive the first and second derivative of it also. Use following formula for the polynomial from the instruction.
def generate(self, t): t /= self.T q = self.a_3 * t**3 + self.a_2 * t**2 * (1 - t) + self.a_1 * t * (1 - t)**2 + self.a_0 * (1 - t)**3 q_dot = (t**2)*(((-3)*self.a_0+3*self.a_1-3*self.a_2+3*self.a_3))+t*(6*self.a_0-4*self.a_1+2*self.a_2)+self.a_1 q_ddot = t*(((-6)*self.a_0+6*self.a_1-6*s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quintic_trajectory_planning(q0, qf, qd0, qdf, qdd0, qddf, m = 100):\n n = q0.shape[0]\n\n # Polynomial Parameters\n a0 = np.copy(q0)\n a1 = np.copy(qd0) \n a2 = np.copy(qdd0) / 2\n a3 = (20 * qf - 20 * q0 - 8 * qdf - 12 * qd0 - 3 * qdd0 + qddf) / 2\n a4 = (30 * q0 - 30 * qf + 14 * qdf + 16...
[ "0.66870165", "0.6496875", "0.6068087", "0.5954736", "0.5872611", "0.5806479", "0.5782105", "0.57541937", "0.56382334", "0.5616875", "0.55826694", "0.5577361", "0.5566148", "0.555733", "0.552018", "0.54858065", "0.5483865", "0.54755336", "0.545013", "0.5429541", "0.5416966", ...
0.58015233
6
Takes a list of dictionaries as input and outputs a CSV file.
def dict2csv(dictlist, csvfile): f = open(csvfile, 'wb') fieldnames = dictlist[0].keys() csvwriter = csv.DictWriter(f, delimiter=',', fieldnames=fieldnames) csvwriter.writerow(dict((fn, fn) for fn in fieldnames)) for row in dictlist: csvwriter.writerow(row) fn.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_csv(list_dicts, file_name):\n # We assume that all the dictionaries have the same keys\n fieldnames = list_dicts[0].keys()\n\n with open(file_name, 'w') as output_file:\n dict_writer = csv.DictWriter(output_file, fieldnames)\n dict_writer.writeheader()\n dict_writer.writerows(l...
[ "0.82183886", "0.8148236", "0.7516159", "0.7435449", "0.7253285", "0.7222639", "0.72080976", "0.7179089", "0.7170781", "0.71316403", "0.7119527", "0.71007425", "0.7058554", "0.7034148", "0.70299006", "0.70035684", "0.6990922", "0.69674456", "0.6953955", "0.6924046", "0.686764...
0.78628516
2
No parameters have been implemented yet
def list_permissions(self, catalog_id: str) -> List[Dict[str, Any]]: return self.grants[catalog_id]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parameters(self):", "def params():\n raise NotImplementedError", "def parameters(self):\n pass", "def Parameters():\n\n raise NotImplementedError()", "def define_parameters(self):", "def __call__(self):\n raise NotImplementedError", "def params(self):\n pass", "def __ca...
[ "0.75948536", "0.7268151", "0.7175833", "0.7131094", "0.711142", "0.70831674", "0.70758194", "0.7006704", "0.7006704", "0.7006704", "0.68782336", "0.68782336", "0.686784", "0.68645966", "0.68645966", "0.6850715", "0.6848863", "0.68123287", "0.6792722", "0.67743677", "0.676627...
0.0
-1
This currently just returns an empty list, as the corresponding Create is not yet implemented
def list_data_cells_filter(self) -> List[Dict[str, Any]]: return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(self, **kwa):\n return []", "def generate(self):\n return []", "def create_list(cls, *args):\n return _create_list(cls, *args)", "def create_list(cls, *args):\n return _create_list(cls, *args)", "def __noop_list(self, *args, **kwargs):\n return []", "def list(sel...
[ "0.76777947", "0.7135053", "0.7076982", "0.7076982", "0.68003124", "0.6728751", "0.67102647", "0.6579876", "0.6579876", "0.64027315", "0.629592", "0.62576115", "0.62358373", "0.62358373", "0.6229487", "0.6223494", "0.6203807", "0.6203807", "0.6203807", "0.6203038", "0.6199074...
0.0
-1
Create a new Shop Profile
def create(self, validated_data): return ShopProfile.objects.create(**validated_data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createProfile(self):\n if self.profile:\n return\n from soc.modules.gsoc.models.profile import GSoCProfile\n user = self.createUser()\n properties = {'link_id': user.link_id, 'student_info': None, 'user': user,\n 'parent': user, 'scope': self.program, 'status': 'active'}\n ...
[ "0.7333698", "0.7082951", "0.7064709", "0.6960642", "0.6960311", "0.69601357", "0.6950246", "0.68697006", "0.68697006", "0.68697006", "0.6861093", "0.6851095", "0.684921", "0.6847314", "0.6804711", "0.6803297", "0.6714414", "0.67008674", "0.6680203", "0.6668842", "0.6656584",...
0.79185814
0
Update the existing Shop profile
def update(self, instance, validated_data): instance.shop_name = validated_data.get('shop_name', instance.shop_name) instance.category = validated_data.get('category', instance.category) instance.latitude = validated_data.get('latitude', instance.latitude) instance.longtude = validated_d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_profile(self):\n self.cim.update_profile(\n customer_id=u\"222\",\n description=u\"Foo bar baz quz\",\n email=u\"dialtone@gmail.com\",\n customer_profile_id=u\"122\"\n )", "def update_profile():\n logger.debug(\"entering function update...
[ "0.69551045", "0.67155063", "0.6505477", "0.64532864", "0.64161766", "0.63588864", "0.6357579", "0.6316166", "0.63099915", "0.62903154", "0.6284435", "0.6200172", "0.61856973", "0.6150992", "0.6150155", "0.6134623", "0.61158746", "0.60930663", "0.6086921", "0.6076155", "0.606...
0.5622488
57
update an existing item
def update(self, instance, validated_data): instance.item_name = validated_data.get('item_name', instance.item_name) instance.brand = validated_data.get('brand', instance.brand) instance.list_price = validated_data.get('list_price', instance.list_price) instance.uom = validated_data.get(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateItem(self, object):\n pass", "def update_item(self, table, item):", "def update_item(self, id: str, user: User, **kwargs) -> None:", "def update_item(id: str, obj: endpoint_model):\n # should this error if exists?\n if obj.id:\n if obj.id != id:\n rais...
[ "0.8280263", "0.81447977", "0.7993836", "0.7355142", "0.722929", "0.72020215", "0.7185629", "0.7168546", "0.7024555", "0.69669366", "0.6939264", "0.6877538", "0.6835842", "0.6811537", "0.68082315", "0.67594725", "0.6746844", "0.67179114", "0.670934", "0.66849375", "0.667855",...
0.6584728
28
update an existing categories
def update(self, instance, validated_data): instance.cat_name = validated_data.get('cat_name', instance.cat_name) instance.img = validated_data.get('img', instance.img) instance.desc = validated_data.get('desc', instance.desc) instance.save() return instance
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, request, *args, **kwargs):\n response = super(CategoryViewSet).update(self, request, *args, *kwargs)\n response.data['message'] = \"Categoria ha sido editada\"", "def update(self, request, pk=None):\n if not request.auth.user.is_staff:\n return Response(\n ...
[ "0.7418198", "0.7234741", "0.72183055", "0.7139743", "0.7106988", "0.69815934", "0.6827737", "0.68089455", "0.67316884", "0.67297924", "0.6729216", "0.67233735", "0.66815853", "0.6635296", "0.6604073", "0.65747875", "0.6562277", "0.65461564", "0.6542109", "0.6527648", "0.6495...
0.0
-1
Compute the normal vector for each of the given vertexes in the mesh specified by the given vertexes and faces. Each vertex's normal vector is simply the average of the normal vectors of the faces it is adjacent to.
def compute_vertex_normals(vertices_zyx, faces, weight_by_face_area=False, face_normals=None): if face_normals is None: face_normals = compute_face_normals_numpy(vertices_zyx, faces, not weight_by_face_area) # numba is slightly faster for vertex normals, but not face normals if _numba_available: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculateMeshNormal(mesh_face_vertices):\n mesh_normal = []\n for mesh in mesh_face_vertices:\n v1x = mesh[1, 0] - mesh[0, 0]\n v1y = mesh[1, 1] - mesh[0, 1]\n v1z = mesh[1, 2] - mesh[0, 2]\n v2x = mesh[2, 0] - mesh[1, 0]\n v2y = mesh[2, 1] - mesh[1, 1]\n v2z = m...
[ "0.8153326", "0.722093", "0.69128704", "0.6840134", "0.6607267", "0.65231526", "0.6446641", "0.64117014", "0.6319435", "0.63080317", "0.6219768", "0.6148063", "0.6132507", "0.61289865", "0.6120251", "0.6085422", "0.60112137", "0.6003639", "0.59615904", "0.5959277", "0.5946175...
0.6507983
6
Compute the normal vector for the given triangular faces. The faces are specified in the typical fashion, i.e. each face's corners are specified as a list of 3 indices, indicating which vertices in the given vertex list comprise the face corners. If normalize=True, then unit vectors are returned. Otherwise, the magnitu...
def compute_face_normals(vertices_zyx, faces, normalize=False): # numpy is faster than numba for face normals. # Always use numpy. return compute_face_normals_numpy(vertices_zyx, faces, normalize)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculateMeshNormal(mesh_face_vertices):\n mesh_normal = []\n for mesh in mesh_face_vertices:\n v1x = mesh[1, 0] - mesh[0, 0]\n v1y = mesh[1, 1] - mesh[0, 1]\n v1z = mesh[1, 2] - mesh[0, 2]\n v2x = mesh[2, 0] - mesh[1, 0]\n v2y = mesh[2, 1] - mesh[1, 1]\n v2z = m...
[ "0.7125069", "0.71220785", "0.68017197", "0.6713881", "0.6648629", "0.66387725", "0.66331315", "0.66081", "0.6550402", "0.65357506", "0.64759254", "0.646564", "0.6436271", "0.6376584", "0.6371165", "0.6355018", "0.6310866", "0.62548745", "0.61315584", "0.6108793", "0.6099856"...
0.67967165
3
numba doesn't support np.cross() outofthebox, so here it is.
def cross(u,v): u1, u2, u3 = u v1, v2, v3 = v return np.array([u2*v3 - u3*v2, u3*v1 - u1*v3, u1*v2 - u2*v1], dtype=u.dtype)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cross(a, b):\n #return np.cross(a,b)\n\n return vector(a[1] * b[2] - a[2] * b[1],\n a[2] * b[0] - a[0] * b[2],\n a[0] * b[1] - a[1] * b[0])", "def cross(a, b):\n return np.array([a[1]*b[2] - a[2]*b[1],\n a[2]*b[0] - a[0]*b[2],\n ...
[ "0.6968073", "0.6852077", "0.66056025", "0.6594874", "0.65571004", "0.6494983", "0.63625574", "0.631185", "0.6259538", "0.61961305", "0.6146926", "0.6109132", "0.6079648", "0.59982544", "0.5980006", "0.59572953", "0.5877286", "0.57682353", "0.57618666", "0.5736346", "0.573094...
0.5799124
17
Same as np.linalg.norm for a singlevector input. By avoiding np.linalg.norm, we can support running on numpy installs that were not compiled with BLAS. (Admittedly, that's a rare scenario.)
def norm_l2(v): return np.sqrt((v**2).sum())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def norm(vec):\n return np.linalg.norm(vec)", "def fast_norm(x):\n return sqrt(dot(x, x.T))", "def l1(vec):\n return np.linalg.norm(vec, ord=1)", "def vector_norm(data, axis=None, out=None):\n data = np.array(data, dtype=np.float64, copy=True)\n if out is None:\n if data.ndim == 1:\n ...
[ "0.8028968", "0.78174204", "0.7628523", "0.7624475", "0.75862074", "0.7564668", "0.75592655", "0.75401086", "0.74093753", "0.7405673", "0.73849475", "0.73453254", "0.73112965", "0.72778994", "0.7238737", "0.72353673", "0.7212942", "0.7209183", "0.7182525", "0.717279", "0.7167...
0.6561202
70
Creates the default regression submodel. Args
def create_classification_graf( inputs, num_classes, pyramid_feature_size=256, classification_feature_size=256, name='classification_submodel' ): options = { 'kernel_size': 3, 'strides': 1, 'padding': 'same', } outputs = inputs for i in ran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_regression_submodels(input_shape, option, regression_feature_size=256, FC_num_of_nuerons=1024, name='regression_submodel'):\n if option == 1 or option == 0:\n inputs = keras.layers.Input(shape=(None, None, input_shape))\n # All new conv layers are initialized\n # with bias b = 0 ...
[ "0.70448923", "0.6608687", "0.64323825", "0.6384243", "0.6340081", "0.63179123", "0.6266902", "0.6041894", "0.6030131", "0.60073376", "0.59656024", "0.5949215", "0.5946567", "0.5942358", "0.5942143", "0.5932648", "0.59324545", "0.5924777", "0.5908567", "0.5888867", "0.5877790...
0.0
-1
Creates the default regression submodel. Args
def create_regression_submodels(input_shape, option, regression_feature_size=256, FC_num_of_nuerons=1024, name='regression_submodel'): if option == 1 or option == 0: inputs = keras.layers.Input(shape=(None, None, input_shape)) # All new conv layers are initialized # with bias b = 0 and a Gau...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_regression_model(num_values, num_anchors, pyramid_feature_size=256, regression_feature_size=256, name='regression_submodel'):\n # All new conv layers except the final one in the\n # RetinaNet (classification) subnets are initialized\n # with bias b = 0 and a Gaussian weight fill with stddev = ...
[ "0.6608687", "0.64323825", "0.6384243", "0.6340081", "0.63179123", "0.6266902", "0.6041894", "0.6030131", "0.60073376", "0.59656024", "0.5949215", "0.5946567", "0.5942358", "0.5942143", "0.5932648", "0.59324545", "0.5924777", "0.5908567", "0.5888867", "0.58777905", "0.5841634...
0.70448923
0
Creates the FPN layers on top of the backbone features. Args
def create_pyramid_features(C3, C4, C5, feature_size=256): # upsample C5 to get P5 from the FPN paper P5 = keras.layers.Conv2D(feature_size, kernel_size=1, strides=1, padding='same', name='C5_reduced')(C5) P5_upsampled = layers.UpsampleLike(name='P5_upsampled')([P5, C4]) P5 = keras.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_feature_layers(self, config):\n raise NotImplementedError", "def setup_layers(self):\n if self.args.model == \"exact\":\n self.layer = PPNPLayer\n else:\n self.layer = APPNPLayer\n self.setup_layer_structure()", "def build_layers(self):\n raise NotI...
[ "0.7184961", "0.6859367", "0.68180364", "0.6733854", "0.62066865", "0.6180018", "0.6080448", "0.6045887", "0.60403764", "0.60108316", "0.59789175", "0.59536123", "0.5932654", "0.5929342", "0.5917331", "0.59011847", "0.5870025", "0.5858796", "0.585748", "0.58048093", "0.579233...
0.0
-1
Creates the FPN layers on top of the backbone features. Args
def create_p3_feature(C3, C4, C5, feature_size=256): P5 = keras.layers.Conv2D(feature_size, kernel_size=1, strides=1, padding='same', name='C5_reduced')(C5) P5_upsampled = layers.UpsampleLike(name='P5_upsampled')([P5, C4]) # add P5 elementwise to C4 P4 = keras.layers.Conv2D(feature_size, kernel_size=1,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_feature_layers(self, config):\n raise NotImplementedError", "def setup_layers(self):\n if self.args.model == \"exact\":\n self.layer = PPNPLayer\n else:\n self.layer = APPNPLayer\n self.setup_layer_structure()", "def build_layers(self):\n raise NotI...
[ "0.7185184", "0.6858193", "0.6816799", "0.67348593", "0.6205501", "0.6178274", "0.6080039", "0.6045217", "0.6040359", "0.6010081", "0.59792393", "0.5952754", "0.59325486", "0.5928713", "0.59169686", "0.59022444", "0.58678496", "0.58580995", "0.58571285", "0.58048695", "0.5791...
0.0
-1
Construct a RetinaNet model on top of a backbone. This model is the minimum model necessary for training (with the unfortunate exception of anchors as output). Args
def gyf_net( inputs, backbone_layers, num_classes, option = 1, do_dropout = False, nd_weights=[ 0, 0, 0.01 , 0.01] , wd_weights=[ 0, 0, 0.01, 0.01], name='gyf_net', FC_num_of_nuerons = 128 ): dropout_param = 0.5 C3, C4, C5 = backbone_layer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_backbone(config):\n assert config.MODEL.BACKBONE in ['resnet50', 'resnet101'], \"backbone name is not supported!\"\n backbone_name = config.MODEL.BACKBONE\n dilation = False\n train_backbone = not config.EVAL\n return_interm_layers = False #TODO: impl case True for segmentation\n\n posi...
[ "0.6656871", "0.64971143", "0.647989", "0.6461896", "0.6445523", "0.6351768", "0.6273475", "0.6227288", "0.6215876", "0.6215043", "0.6200588", "0.61176455", "0.6098872", "0.6095074", "0.6092274", "0.60904074", "0.60895133", "0.6086633", "0.608019", "0.6066834", "0.6055574", ...
0.0
-1
Construct a RetinaNet model on top of a backbone and adds convenience functions to output boxes directly. This model uses the minimum retinanet model and appends a few layers to compute boxes within the graph. These layers include applying the regression values to the anchors and performing NMS. Args
def gyf_net_LCC( model=None, option = 'reg_fpn_p3_p7_mle', name='gyf_net-LCC', **kwargs ): if model is None: model = gyf_net(**kwargs) # we expect the anchors, regression and classification values as first output # todo - remove nd option if option == 'reg_baseli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retinanet_bbox(model= None, applyNms= True, class_specific_filter= True, name='retinanet-bbox', anchor_params= None, **kwargs):\n\n # if no anchor parameters are passed, use default values\n if anchor_params is None:\n anchor_params = AnchorParameters_default\n\n # create RetinaNet model\n i...
[ "0.64139163", "0.5904596", "0.5881505", "0.58185", "0.57925415", "0.5775857", "0.5696076", "0.5665686", "0.5630072", "0.56215036", "0.5606611", "0.5603881", "0.5564644", "0.5499803", "0.5498145", "0.5479341", "0.5479254", "0.54608303", "0.5448227", "0.5445161", "0.5440332", ...
0.0
-1
Get commandline arguments and return in a dictionary.
def GetArgs(): UserArgs = {} UserArgs['help'] = False UserArgs['RsodFileName'] = "" UserArgs['BiosPathX64'] = "" for i in range(1,len(sys.argv)): if sys.argv[i].lower() == "-help" : UserArgs["help"] = True elif sys.argv[i].lower() == "-h" : UserArgs["he...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retrieve_args_dict():\n process_args = sys.argv[1:]\n dictionary = dict()\n for process_arg in process_args:\n splitted = process_arg.split(\":\")\n if len(splitted) > 1:\n key = splitted[0]\n value = \"\".join(splitted[1:])\n dictionary[key] = value\n ...
[ "0.8392568", "0.73264146", "0.72220016", "0.7195668", "0.7151639", "0.71046627", "0.7067025", "0.7011563", "0.70049137", "0.6917291", "0.691006", "0.689744", "0.6896975", "0.68951774", "0.68362814", "0.68124163", "0.68043065", "0.67980427", "0.6727538", "0.6687054", "0.668665...
0.7052927
7
This function plots various quantities output from surveySim.
def plotsurvey(filename='obslist_all.fits', plot_type='f', program='m'): t = Table.read(filename, format='fits') if plot_type == 'f': fig, ax = plt.subplots() ra = t['RA'] ra[ra>300.0] -= 360.0 dec = t['DEC'] mjd = t['MJD'] mjd_start = np.min(mjd) mjd -...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot(self):\n\t\tself.plotOfSpect()", "def plot(self):\n\t\tself.plotOfSpect().plot()", "def plot_q_values(self):\n\n sim_freq = self.conf['Simulation']['params']['frequency']\n sim_wvlgth = 1e9*consts.c / sim_freq\n leg_str = ''\n for mat, matpath in self.conf['Materials'].item...
[ "0.6960224", "0.6864004", "0.6802096", "0.6696738", "0.66458255", "0.6615099", "0.66061896", "0.64792323", "0.647615", "0.6462577", "0.6423786", "0.6413281", "0.6410296", "0.6405238", "0.6347649", "0.6342669", "0.6320201", "0.6292734", "0.62917215", "0.6290562", "0.6255119", ...
0.6101525
32
get system network disk mount points
def get_mount_points(): points = [] t = subprocess.check_output(['mount']) t = t.decode() for line in t.splitlines(): t = line.find('smbfs') if t < 0: continue b = line.find(' on ') points.append(line[b+4: t-2]) # //share@win10.shared/storage on /Volumes/storage...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mpt():\n lbl_drives = ['device','mountpoint','fstype']\n disks = [d[0:3] for d in psutil.disk_partitions()]\n drives = [dict(zip(lbl_drives,ds)) for ds in disks]\n return [d['mountpoint']for d in drives]", "def get_disks(self):\n result = {}\n\n exp = self.config['devices']\n ...
[ "0.68773633", "0.68158823", "0.67882913", "0.6774222", "0.66594845", "0.66355723", "0.6554326", "0.64806867", "0.6475302", "0.6474165", "0.64323974", "0.63421154", "0.62973434", "0.6283676", "0.625942", "0.62251365", "0.6212416", "0.6192075", "0.61354935", "0.613342", "0.6131...
0.78018576
0
Create a VOEvent receiver service. The receiver service accepts VOEvent messages submitted to the broker by authors.
def makeBroadcasterService(endpoint, local_ivo, test_interval, whitelist): factory = VOEventBroadcasterFactory(local_ivo, test_interval) if log.LEVEL >= log.Levels.INFO: factory.noisy = False whitelisting_factory = WhitelistingFactory(factory, whitelist, "subscription") if log.LEVEL >= log.Leve...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_event(self):\n\t\treturn handle_to_object(call_sdk_function('PrlVm_CreateEvent', self.handle))", "def make_service_offer(self, incoming: Demand):\n rospy.loginfo(\"Making service offer...\")\n\n offer = Offer()\n offer.model = Multihash(rospy.get_param(\"~model\"))\n offer....
[ "0.5781585", "0.5657519", "0.56021494", "0.55497426", "0.55497426", "0.55497426", "0.54814553", "0.5467501", "0.5458404", "0.541941", "0.5413253", "0.5380272", "0.5364278", "0.53538424", "0.5344692", "0.53310215", "0.52988505", "0.5298473", "0.5285878", "0.5276575", "0.527268...
0.62264496
0
Test whether number of generated exemplars corresponds to expected number +/ tolerance
def test_num_of_exemplars(target_exemplars, tol): df = h2o.create_frame( rows=10000, cols=2, categorical_fraction=0.1, integer_fraction=0.3, real_range=100, seed=1234 ) agg = H2OAggregatorEstimator(target_num_exemplars=target_exemplars, rel_tol_num_exemplars=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_amount_in_tons(self):", "def test_excess_quantity(self):\n excess = self._uncertain_demand.excess_stock\n avg_order = sum([int(item) for item in self._data_set.values()]) //len(self._data_set)\n variance = [(item - avg_order) for item in self._data_set.values()]\n stdev = pow...
[ "0.62417066", "0.6170665", "0.61069566", "0.6106596", "0.6075478", "0.60676223", "0.59904754", "0.59904754", "0.5966602", "0.59636664", "0.5913543", "0.5900503", "0.5890577", "0.5879676", "0.5875304", "0.58695227", "0.58620834", "0.58284837", "0.5817856", "0.58031934", "0.579...
0.6148227
2
To catch the old API structure in which creating the parser would immediately parse and return data.
def __new__(cls, data=None, customization=None, ignore_nonstandard_types=True, homogenise_fields=True): if data is None: return super(BibTexParser, cls).__new__(cls) else: # For backwards compatibility: if data is given, parse and ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse(self):\n pass", "def parse(self):\n pass", "def parse(self):\n pass", "def parse(self):\n pass", "def parse(self):\n pass", "def parse(self):\n raise NotImplementedError", "def parse(self):", "def parse_api(self, soup):\n return {}", "def ...
[ "0.7138232", "0.69025296", "0.69025296", "0.69025296", "0.69025296", "0.67519003", "0.67396116", "0.66833234", "0.6609541", "0.6606015", "0.6590835", "0.6550816", "0.6404248", "0.6295026", "0.62539226", "0.6238733", "0.6234285", "0.6176463", "0.59207684", "0.59207684", "0.590...
0.0
-1
Creates a parser for rading BibTeX files
def __init__(self): self.bib_database = BibDatabase() #: Callback function to process BibTeX entries after parsing, for example to create a list from a string with #: multiple values. By default all BibTeX values are treated as simple strings. Default: `None`. self.customization = None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_bib_from_bibtex(filename):\n\tentry_regex = r'''\n\t\t\t(?msx) # flags: multi-line, dot-match-all, verbose\n\t\t\t^@\\w+\\{ # start of line, item type\n\t\t\t.*? # content, can span multiple lines, non-greedy\n\t\t\t^\\} # start of line, closing parens\n\t\t\t'''\n\tattr_regex = r'''\n\t...
[ "0.6234612", "0.6147995", "0.60319656", "0.59629756", "0.5920162", "0.5742437", "0.5685837", "0.55988944", "0.5565244", "0.55591327", "0.5548441", "0.55469084", "0.5477194", "0.542481", "0.54220295", "0.53916395", "0.5366751", "0.53573483", "0.53022027", "0.52594346", "0.5246...
0.60859346
2
Parse a BibTeX string into an object
def parse(self, bibtex_str): self.bibtex_file_obj = self._bibtex_file_obj(bibtex_str) self._parse_records(customization=self.customization) return self.bib_database
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bibtex_to_dict(bibtex):\n global logger\n result = dict()\n if os.path.exists(bibtex):\n fd = open(bibtex, \"r\")\n logger.debug(\"Reading in file %s\" % bibtex)\n text = fd.read()\n else:\n text = bibtex\n logger.debug(\"Removing comments...\")\n text = re.sub(r\"...
[ "0.66628987", "0.6659649", "0.633736", "0.633628", "0.6253365", "0.6071626", "0.5941959", "0.59201235", "0.5868278", "0.5813296", "0.57727057", "0.57572824", "0.5704655", "0.5671336", "0.562297", "0.5534481", "0.5516728", "0.54690385", "0.5426646", "0.5413599", "0.5386806", ...
0.6913478
0
Parse a BibTeX file into an object
def parse_file(self, file): return self.parse(file.read())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_bib_from_bibtex(filename):\n\tentry_regex = r'''\n\t\t\t(?msx) # flags: multi-line, dot-match-all, verbose\n\t\t\t^@\\w+\\{ # start of line, item type\n\t\t\t.*? # content, can span multiple lines, non-greedy\n\t\t\t^\\} # start of line, closing parens\n\t\t\t'''\n\tattr_regex = r'''\n\t...
[ "0.7056748", "0.6789347", "0.65760547", "0.6506177", "0.6466266", "0.62614244", "0.61830676", "0.6071847", "0.59961665", "0.5936106", "0.58459806", "0.58455586", "0.574384", "0.56954813", "0.56943685", "0.5688495", "0.56305325", "0.5595255", "0.55480367", "0.5541105", "0.5505...
0.5276055
36
Parse the bibtex into a list of records.
def _parse_records(self, customization=None): def _add_parsed_record(record, records): """ Atomic function to parse a record and append the result in records """ if record != "": logger.debug('The record is not empty. Let\'s parse it.')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(self, bibtex_str):\n self.bibtex_file_obj = self._bibtex_file_obj(bibtex_str)\n self._parse_records(customization=self.customization)\n return self.bib_database", "def parse_bib(filename, entry_regex, parse_func):\n\twith open(filename) as f:\n\t\treturn filter(None, (parse_func(it...
[ "0.7069204", "0.66858053", "0.6365787", "0.6218454", "0.61647767", "0.6109565", "0.605119", "0.60247535", "0.59034073", "0.5703395", "0.56781554", "0.56023383", "0.5566754", "0.55462235", "0.55357593", "0.5528895", "0.5505986", "0.54787135", "0.54554504", "0.5440011", "0.5430...
0.72426885
0
Atomic function to parse a record and append the result in records
def _add_parsed_record(record, records): if record != "": logger.debug('The record is not empty. Let\'s parse it.') parsed = self._parse_record(record, customization=customization) if parsed: logger.debug('Store the result of the parsed rec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_record(self, record):\n raise NotImplementedError()", "def parse_record(dom, record_dict, log):\n return parser(dom, record_dict, log)", "def _parse_records(self, customization=None):\n def _add_parsed_record(record, records):\n \"\"\"\n Atomic function to parse...
[ "0.6970799", "0.6505174", "0.63539755", "0.62376463", "0.6231728", "0.6189907", "0.6178221", "0.6087885", "0.5943535", "0.59019214", "0.5897599", "0.5895698", "0.5873401", "0.58263826", "0.5749148", "0.57163817", "0.57113546", "0.570671", "0.5662196", "0.56533664", "0.5653366...
0.7449858
0
Parse a record. tidy whitespace and other rubbish parse out the bibtype and citekey find all the keyvalue pairs it contains
def _parse_record(self, record, customization=None): d = {} if not record.startswith('@'): logger.debug('The record does not start with @. Return empty dict.') return {} # if a comment record, add to bib_database.comments if record.lower().startswith('@comment')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_record(self, record):\n raise NotImplementedError()", "def parse_record(self, in_rec):\n \n geo_util = geo.Geo()\n \n self.metadata = {}\n for k, v in in_rec.items():\n if k == 'metadata2': continue\n elif k == 'geometry':\n ...
[ "0.6419528", "0.63260657", "0.61760867", "0.6131838", "0.6122296", "0.6120553", "0.5983646", "0.58799636", "0.58595246", "0.5855788", "0.584823", "0.58271646", "0.58078647", "0.57758385", "0.57636255", "0.5644182", "0.5610186", "0.5606317", "0.55948454", "0.55234295", "0.5517...
0.72723114
0
Strip double quotes enclosing string
def _strip_quotes(self, val): logger.debug('Strip quotes') val = val.strip() if val.startswith('"') and val.endswith('"'): return val[1:-1] return val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _Unquote(s):\n if not hasattr(s, 'strip'):\n return s\n # Repeated to handle both \"'foo'\" and '\"foo\"'\n return s.strip(\"\\\"'\")", "def _Unquote(s):\n if not hasattr(s, 'strip'):\n return s\n # Repeated to handle both \"'foo'\" and '\"foo\"'\n return s.strip(\"'\").strip('\"').strip(\"'\")",...
[ "0.77753305", "0.77129984", "0.7416668", "0.7369961", "0.7316195", "0.72749907", "0.727079", "0.72586817", "0.7171268", "0.7170626", "0.7048465", "0.7045705", "0.6996785", "0.68673736", "0.6739336", "0.6514188", "0.64913297", "0.64645445", "0.643386", "0.64072984", "0.6398886...
0.73426867
4
Strip braces enclosing string
def _strip_braces(self, val): logger.debug('Strip braces') val = val.strip() if val.startswith('{') and val.endswith('}') and self._full_span(val): return val[1:-1] return val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_stray_braces(self, tex):\n num_lefts, num_rights = [\n tex.count(char)\n for char in \"{}\"\n ]\n if num_rights > num_lefts:\n backwards = tex[::-1].replace(\"}\", \"\", num_rights - num_lefts)\n tex = backwards[::-1]\n elif num_lef...
[ "0.7257907", "0.6704662", "0.663527", "0.663437", "0.65309894", "0.65099", "0.6454627", "0.63949865", "0.6302393", "0.6281844", "0.62191236", "0.62042516", "0.6161475", "0.60913813", "0.60668725", "0.6063109", "0.5937413", "0.59302425", "0.58825225", "0.58386445", "0.58217025...
0.76519185
0
Substitute string definitions inside larger expressions
def _string_subst_partial(self, val): def repl(m): k = m.group('id') replacement = self.bib_database.strings[k.lower()] if k.lower() in self.bib_database.strings else k pre = '"' if m.group('pre') != '"' else '' post = '"' if m.group('post') != '"' else '' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __Subst(self, m, s, l):\n if s is None:\n s = ''\n #if type(s) is types.LongType:\n #1.5.2: s = str(s)[:-1]\n return self.regexp.Subst(l, DTL.TemplateRegExp.macros[m], str(s))", "def test_evaluate_replace_expression(self):\n value = self.evaluate_common(\"rep...
[ "0.6560497", "0.6532088", "0.64842784", "0.64777434", "0.62473774", "0.622621", "0.622045", "0.6183432", "0.6173008", "0.6143813", "0.61242", "0.6123574", "0.6107318", "0.6066054", "0.6050567", "0.6044567", "0.6040717", "0.6009045", "0.6002451", "0.59890664", "0.5989054", "...
0.7003312
0
Clean instring before adding to dictionary
def _add_val(self, val): if not val or val == "{}": return '' val = self._strip_braces(val) val = self._strip_quotes(val) val = self._strip_braces(val) val = self._string_subst(val) return val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sanitize(self, _input):\n sanitized = {}\n for key, inp in _input.items():\n try:\n key = html.escape(key).strip()\n except AttributeError:\n pass\n # try:\n # inp = html.escape(inp).strip()\n # except (Attri...
[ "0.6268545", "0.62286484", "0.6139651", "0.61188745", "0.6037264", "0.5991762", "0.5991364", "0.5975864", "0.5972714", "0.592272", "0.5904946", "0.58103925", "0.580904", "0.5787211", "0.5737508", "0.5736629", "0.5727791", "0.57251036", "0.56657696", "0.5640273", "0.56325823",...
0.0
-1
Add a key and homogeneize alternative forms.
def _add_key(self, key): key = key.strip().strip('@').lower() if self.homogenise_fields: if key in list(self.alt_dict.keys()): key = self.alt_dict[key] if not isinstance(key, ustr): return ustr(key, 'utf-8') else: return key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_key(mu_key):\n params['key'] = mu_key", "def add_key(self, key_list: list) -> None:\n\n for key, funct, desc in key_list:\n # Force keys to be lowercase\n key = key.lower()\n \n self.key_functs[key] = funct\n self.key_satified[key] = False\...
[ "0.6486366", "0.6354456", "0.6322555", "0.61398035", "0.605703", "0.60256815", "0.59840685", "0.5979315", "0.5956355", "0.5809993", "0.5785336", "0.5777266", "0.57652295", "0.57652295", "0.5716468", "0.56604296", "0.56133515", "0.558195", "0.55463797", "0.5544744", "0.5540097...
0.5817976
9
Sets the access token.
def set_access_token(self, value: str) -> None: self.__requester.set_authorization(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_access_token(self, access_token):\n self.access_token = access_token", "def access_token(self, access_token):\n\n self._access_token = access_token", "def set_access_token(self, token):\n\n self.__current_request_mock.headers['Authorization'] = token", "def set_access_token(self,...
[ "0.8726035", "0.8284945", "0.78996503", "0.75930804", "0.7460136", "0.7379208", "0.7260947", "0.71620584", "0.7155994", "0.70417875", "0.70335436", "0.6937926", "0.6937383", "0.6926173", "0.67172366", "0.66388446", "0.6613158", "0.6582777", "0.64298064", "0.637697", "0.634287...
0.8179823
2
Provides the currently set access point.
def get_access_point(self) -> str: return self.__requester.base_url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def access(self):\n return self._access", "def access(self):\n return self._access", "def access_point_id(self) -> str:\n return pulumi.get(self, \"access_point_id\")", "def _getCurrentPoint(self):\n return self.__currentPoint", "def get_fan_set_point(self):\n return self...
[ "0.6743609", "0.6743609", "0.6608858", "0.65723866", "0.6504079", "0.6337296", "0.622661", "0.622661", "0.6189821", "0.6098333", "0.60944", "0.60067403", "0.5992989", "0.59382397", "0.588125", "0.5860819", "0.5853144", "0.5789034", "0.57688814", "0.5752235", "0.5752235", "0...
0.66070384
3
Sets the access point to communicate with.
def set_access_point(self, value: str) -> None: self.__requester.set_base_url(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setSetpoint(self, point):\n\n\t\tself._setpoint = point", "def setPoint(self, point):\n self.point = point", "def setpointCallback(self,setpoint):\n if not self.setpoint_valid:\n rospy.loginfo(\"First setpoint received.\")\n self.setpoint_valid = True\n self.set_p...
[ "0.6390105", "0.62136114", "0.6117438", "0.5991195", "0.5894934", "0.5868396", "0.5854952", "0.58540964", "0.58540964", "0.58540964", "0.5821169", "0.5821169", "0.580778", "0.58021396", "0.5796809", "0.579131", "0.57864845", "0.5778461", "0.57453096", "0.5659611", "0.5646041"...
0.68554735
0
Provides the list of all active builds.
def get_active_from_github_id( self, github_id: Union[str, int], *, params: Optional[dict] = None ) -> "resource_types.Active": return communicator.Active(self.__requester).from_github_id( github_id=int(github_id), parameters=params )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Builds():\n return builds", "def builds(self):\n return self._builds", "def getBuilds():", "def getCurrentBuilds():\n # again, we could probably provide an object for 'waiting' and\n # 'interlocked' too, but things like the Change list might still be\n # subject to change",...
[ "0.76474434", "0.74677944", "0.72095585", "0.70357376", "0.7003857", "0.68523914", "0.68523914", "0.67825145", "0.66561615", "0.650555", "0.6467641", "0.6301073", "0.6226253", "0.61929137", "0.6023285", "0.59893006", "0.5980562", "0.5972008", "0.59683216", "0.59568816", "0.59...
0.0
-1
Provides the list of all active builds for the given login in the given provider.
def get_active_from_login( self, login: str, *, provider: str = "github", params: Optional[dict] = None ) -> "resource_types.Active": return communicator.Active(self.__requester).from_login( login=login, provider=provider, parameters=params )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Builds():\n return builds", "def get_builds(self, *, params: Optional[dict] = None) -> \"resource_types.Builds\":\n\n return communicator.Builds(self.__requester).fetch(parameters=params)", "def build_list(ctx, show_url, show_data,\n start, count,\n project, build_type...
[ "0.5595932", "0.5579669", "0.5575324", "0.5530652", "0.55290043", "0.5472273", "0.5448642", "0.5247109", "0.5247109", "0.52199453", "0.5217522", "0.51758015", "0.5152291", "0.50583714", "0.50256395", "0.49641752", "0.4945307", "0.48910722", "0.4876092", "0.486524", "0.4823432...
0.5465332
6
Provides the list of broadcasts of the current user.
def get_broadcasts( self, *, params: Optional[dict] = None ) -> "resource_types.Broadcasts": return communicator.Broadcasts(self.__requester).fetch(parameters=params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list( self, mess, args):\n user = self.get_sender_username(mess)\n args = args.replace(' ', '_')\n if user in self.users:\n user_list = 'All these users are subscribed - \\n'\n user_list += '\\n'.join(['%s :: %s' %(u, self.users[u]) for u in sorted(self.users)])\n ...
[ "0.60016054", "0.5881634", "0.5803563", "0.57533914", "0.5750388", "0.57274336", "0.56940734", "0.5687119", "0.56761175", "0.564202", "0.5639454", "0.56097776", "0.56062895", "0.55889046", "0.5585895", "0.5524598", "0.55238736", "0.55003995", "0.5479891", "0.5464656", "0.5459...
0.6519794
0
Provides the build information from its ID.
def get_build( self, build_id: Union[int, str], *, params: Optional[dict] = None ) -> "resource_types.Build": return communicator.Build(self.__requester).from_id( build_id=build_id, parameters=params )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_build(self, build_id):\n pass", "def build():\n return get_cached(\"build.json\", False).get(\"build_id\")", "def build_id(self):\n if self.method == 'tagBuild':\n return self.params[1]", "def build_info(self):\n return self._build_info", "def get_koji_build_info(...
[ "0.77781296", "0.7655416", "0.6897013", "0.68396556", "0.672192", "0.66944796", "0.66136545", "0.6557567", "0.64643776", "0.6447651", "0.6428573", "0.6414766", "0.6414766", "0.64105403", "0.6359696", "0.62531394", "0.6200882", "0.6199", "0.6077942", "0.60720354", "0.5994919",...
0.66666526
6
Provides the list of builds of the current user.
def get_builds(self, *, params: Optional[dict] = None) -> "resource_types.Builds": return communicator.Builds(self.__requester).fetch(parameters=params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Builds():\n return builds", "def getBuilds():", "def build_list(ctx, show_url, show_data,\n start, count,\n project, build_type_id, branch, status, running, tags, user,\n output_format, columns):\n kwargs = {'start': start,\n 'count': count}\n ...
[ "0.6883745", "0.6575796", "0.6572598", "0.64355004", "0.6207138", "0.61170244", "0.60926265", "0.60643363", "0.59929526", "0.5961092", "0.5896418", "0.5896418", "0.5819128", "0.57775116", "0.57336736", "0.5678688", "0.5565604", "0.5452168", "0.544499", "0.5438009", "0.5406519...
0.6142329
5
Provides a cron from its given ID.
def get_cron( self, cron_id: Union[str, int], *, params: Optional[dict] = None ) -> "resource_types.Cron": return communicator.Cron(self.__requester).from_id( cron_id=cron_id, parameters=params )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cron_id(self, cr, uid, context):\n cron_obj = self.pool.get('ir.cron')\n # find the cron that send messages\n cron_id = cron_obj.search(cr, uid, [('function', 'ilike', self.cron['function']),\n ('model', 'ilike', self.cron['model'])],\n ...
[ "0.65078187", "0.6431072", "0.6326919", "0.6021894", "0.600872", "0.5984055", "0.58517635", "0.5767667", "0.5746677", "0.5657153", "0.55429775", "0.5541055", "0.5533714", "0.55243057", "0.55132204", "0.5493868", "0.5479761", "0.54725164", "0.54444087", "0.5411881", "0.5393716...
0.8255051
0
Provides a job from its given ID.
def get_job( self, job_id: Union[str, int], *, params: Optional[dict] = None ) -> "resource_types.Job": return communicator.Job(self.__requester).from_id( job_id=job_id, parameters=params )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_job(self, _id):\n data = {\n 'class': 'Job',\n 'id': _id,\n 'attrs': {},\n }\n job = self.db_client.send_request('list', json.dumps(data))\n\n return Job(\n _id=job['id'],\n _type=job['type'],\n task=job['task'],\...
[ "0.8370322", "0.81394696", "0.78803784", "0.77068985", "0.76749647", "0.76451606", "0.75760686", "0.75058204", "0.74840623", "0.7439674", "0.7318414", "0.7263681", "0.7233894", "0.71796244", "0.7149467", "0.71003586", "0.70752484", "0.7072272", "0.7063138", "0.70405346", "0.6...
0.8248076
1
Provides the list of jobs of the current user.
def get_jobs(self, *, params: Optional[dict] = None) -> "resource_types.Jobs": return communicator.Jobs(self.__requester).fetch(parameters=params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_job_list(self):\n return self.job_list", "def get_job_list(self):\n return self.job_list", "def list_jobs(self):\n\n return dict(self._from_json(self.manage.run(override=\"list-jobs\")))", "def list_jobs(user_data, cache):\n user = cache.ensure_user(user_data)\n\n jobs = []...
[ "0.7658048", "0.7658048", "0.7589254", "0.7546226", "0.75082177", "0.73086214", "0.7287166", "0.72396624", "0.7215694", "0.720352", "0.7182318", "0.714295", "0.71399367", "0.71126217", "0.7103244", "0.7100594", "0.7039654", "0.6998702", "0.69447064", "0.6885839", "0.6881713",...
0.6554408
43
Lints the given subject.
def lint(self, subject: Union[TextIOWrapper, bytes, str]) -> "resource_types.Lint": if isinstance(subject, TextIOWrapper): data = subject.read() elif isinstance(subject, (str, bytes)): data = subject else: raise TypeError( f"<subject> must be ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_subject(self, new_subject):\n raise NotImplementedError", "def lint(self, vartok, linted_entry):\n raise NotImplemented", "def update(self, subject: Subject) -> None:\n pass", "def update(self, subject: Subject) -> None:\n pass", "def lint(ctx):\r\n print('Running ...
[ "0.54728234", "0.5425725", "0.54179674", "0.54179674", "0.540823", "0.53795105", "0.5342376", "0.5280446", "0.52239424", "0.52239424", "0.51792663", "0.51792663", "0.51792663", "0.5109144", "0.5057882", "0.5050363", "0.5030301", "0.5018952", "0.5015047", "0.49664378", "0.4952...
0.7200309
0
Provides an organization from its given ID.
def get_organization( self, organization_id: Union[str, int], *, params: Optional[dict] = None ) -> "resource_types.Organization": return communicator.Organization(self.__requester).from_id( organization_id=organization_id, parameters=params )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_organization(self, id: str) -> dict[str, Any]:\n params = {}\n\n return self.client.get(self._url(id), params=params)", "def organization(self, organization_id):\r\n return organizations.Organization(self, organization_id)", "def find_organization(self):\n if self.org_id is ...
[ "0.7779527", "0.7667834", "0.72960305", "0.7177982", "0.6943155", "0.6880863", "0.6874825", "0.6787914", "0.6783364", "0.6768005", "0.6724089", "0.67040336", "0.6621863", "0.65592504", "0.653614", "0.6531504", "0.64872956", "0.64778906", "0.6453674", "0.64502835", "0.6436561"...
0.79455
0
Provides the list of organizations of the current user.
def get_organizations( self, *, params: Optional[dict] = None ) -> "resource_types.Organizations": return communicator.Organizations(self.__requester).fetch(parameters=params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def organizations(self):\n return self.get('{}/orgs'.format(ApiVersion.A1.value))", "def list_all_organizations(ctx):\n pprint(ctx.obj.orgs.get().data)", "async def get_organizations(request: Request):\n redis = request.app.state.redis\n organizations_obj = orjson.loads(await redis.get_key(\"influx...
[ "0.8252076", "0.79823494", "0.78466034", "0.7764435", "0.7730076", "0.7687636", "0.7638514", "0.7531042", "0.72897345", "0.72628844", "0.72628844", "0.7150535", "0.7096476", "0.7093779", "0.70538443", "0.6993073", "0.6938511", "0.6844323", "0.6752374", "0.6648712", "0.6563779...
0.71319103
12
Provides the list of repositories of the current user.
def get_repositories( self, *, params: Optional[dict] = None ) -> "resource_types.Repositories": return communicator.Repositories(self.__requester).fetch(parameters=params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repositories(self, user_name=None):\n user_name = user_name if user_name else self._auth[0]\n data = self._request('GET', 'users', user_name)\n return data.repositories\n #ret_val = []\n #for repository in data.repositories:\n # ret_val.append(repository.name)\n ...
[ "0.8624754", "0.81757784", "0.7706611", "0.7706166", "0.7597628", "0.7533269", "0.7528032", "0.75170326", "0.74408704", "0.74089473", "0.7329396", "0.7313573", "0.72049135", "0.7182676", "0.7179828", "0.7156892", "0.7150683", "0.7136331", "0.6991477", "0.6963982", "0.6919021"...
0.67244357
31
Provides the list of repositories of the given GitHub ID.
def get_repositories_from_github_id( self, github_id: Union[str, int], *, params: Optional[dict] = None ) -> "resource_types.Repositories": return communicator.Repositories(self.__requester).from_github_id( github_id=int(github_id), parameters=params )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_repos(github_id):\r\n\r\n url = 'https://api.github.com/users/{}/repos'.format(github_id)\r\n response = requests.get(url)\r\n todos = json.loads(response.text)\r\n\r\n repo_list = []\r\n \r\n for data in todos:\r\n repo_list.append(data['name'])\r\n\r\n return repo_list", "de...
[ "0.81455076", "0.71791214", "0.68482614", "0.67864573", "0.678607", "0.67319983", "0.6728848", "0.6713311", "0.67027485", "0.66266894", "0.6548572", "0.65197384", "0.6504157", "0.65015703", "0.64248604", "0.6378858", "0.6378281", "0.6359549", "0.6292143", "0.62408435", "0.617...
0.7886239
1
Provides the list of repositories for the given login in the given provider.
def get_repositories_from_login( self, login: str, *, provider: str = "github", params: Optional[dict] = None ) -> "resource_types.Repositories": return communicator.Repositories(self.__requester).from_login( login=login, provider=provider, parameters=params )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repositories(self, user_name=None):\n user_name = user_name if user_name else self._auth[0]\n data = self._request('GET', 'users', user_name)\n return data.repositories\n #ret_val = []\n #for repository in data.repositories:\n # ret_val.append(repository.name)\n ...
[ "0.66285455", "0.6528908", "0.6485047", "0.64401954", "0.6372433", "0.63584465", "0.6312798", "0.62660974", "0.62343997", "0.6229013", "0.61398834", "0.6103985", "0.6090164", "0.60706437", "0.59627527", "0.59548646", "0.5917306", "0.5913785", "0.5908407", "0.5907842", "0.5902...
0.83227384
0
Provides the repository from its given provider, ID or slug.
def get_repository_from_provider( self, provider: str, repository_id_or_slug: Union[str, int], *, params: Optional[dict] = None, ) -> "resource_types.Repository": return communicator.Repository(self.__requester).from_provider( provider=provider, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_repository(\n self, repository_id_or_slug: Union[str, int], *, params: Optional[dict] = None\n ) -> \"resource_types.Repository\":\n\n return communicator.Repository(self.__requester).from_id_or_slug(\n repository_id_or_slug=repository_id_or_slug, parameters=params\n )", ...
[ "0.71772826", "0.63128215", "0.62667835", "0.6212255", "0.6113477", "0.60990375", "0.58293307", "0.58286536", "0.5804322", "0.5787218", "0.5753442", "0.56915164", "0.5691488", "0.56619483", "0.5660118", "0.5628283", "0.56201863", "0.5602806", "0.557673", "0.5561464", "0.55591...
0.79773
0
Provides the repository from its given ID or slug.
def get_repository( self, repository_id_or_slug: Union[str, int], *, params: Optional[dict] = None ) -> "resource_types.Repository": return communicator.Repository(self.__requester).from_id_or_slug( repository_id_or_slug=repository_id_or_slug, parameters=params )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_repo(repo_id):\n if repo_id == \"orphans\":\n pkgs = Database().db.get_orphans()\n else:\n pkgs = Database().db.get_repo_pkgs(repo_id)\n return render_template(\"repo.html\", \n title=\" - \"+repo_id,\n repos=Database().db.get_repos_names...
[ "0.6880181", "0.66226876", "0.64765483", "0.6360771", "0.6302806", "0.626461", "0.62416524", "0.6215325", "0.6213524", "0.6175658", "0.60762954", "0.604203", "0.6022187", "0.59854496", "0.5957842", "0.59500873", "0.5933728", "0.59310895", "0.59252787", "0.58837426", "0.586411...
0.77257586
0
Provides the information of the current user.
def get_user(self, *, params: Optional[dict] = None) -> "resource_types.User": return communicator.User(self.__requester).fetch(parameters=params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_user_info():\n\n return current_user", "def user_info(self):\n return self.auth.get_user_by_session()", "def user_info(self):\n response = self.query('user_info')\n return response", "def show_user_info(self):\n name = self.get_user_name()\n print(f'Name: {name.t...
[ "0.8667596", "0.84123844", "0.8305332", "0.82019097", "0.81598705", "0.8110866", "0.79796934", "0.7841715", "0.7836537", "0.7836537", "0.781808", "0.78135294", "0.77583146", "0.77501225", "0.7672192", "0.7633349", "0.76326025", "0.7626147", "0.7612622", "0.7596718", "0.759620...
0.0
-1
Provides the information of a user from its ID.
def get_user_from_id( self, user_id: Union[str, int], *, params: Optional[dict] = None ) -> "resource_types.User": return communicator.User(self.__requester).from_user_id( user_id=user_id, parameters=params )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_info_by_id(self, user_id: int) -> dict:", "def user_info(user_id):\n return User.query.filter_by(id=user_id).first()", "def get_user(id):\n pass", "def show_user_info(user_id):\n\n user = User.query.get_or_404(user_id)\n return render_template(\"user_details.html\", user=user)", "d...
[ "0.8305874", "0.8155866", "0.77497923", "0.7693863", "0.7686031", "0.7686031", "0.76180446", "0.75860786", "0.7574494", "0.75569916", "0.75569916", "0.7468606", "0.7421179", "0.7418215", "0.738901", "0.73247707", "0.7319316", "0.73184985", "0.7311593", "0.72912717", "0.726198...
0.0
-1
Take a gaussian shell and confirm its power spectrum using shell_project_pspec.
def compare_averages_shell_pspec_dft(): select_radius = 5. #degrees Nside=256 Npix = 12 * Nside**2 Omega = 4*np.pi/float(Npix) Nfreq = 100 freqs = np.linspace(167.0, 177.0, Nfreq) dnu = np.diff(freqs)[0] Z = 1420/freqs - 1. sig = 2.0 mu = 0.0 shell = np.random.normal(mu, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def womgau(hop):\n import numpy as np\n import logging\n import matplotlib.pyplot as plt\n from scipy.optimize import curve_fit\n from tmath.wombat.womwaverange import womwaverange\n from tmath.wombat.womget_element import womget_element\n from tmath.wombat.inputter import inputter\n from t...
[ "0.54461145", "0.5179965", "0.50951344", "0.493999", "0.4939673", "0.4889197", "0.48608387", "0.48537308", "0.48335385", "0.48286435", "0.4800673", "0.4798589", "0.47939384", "0.47843185", "0.47838107", "0.47736582", "0.47597453", "0.47463492", "0.47239593", "0.47009686", "0....
0.60930073
0
Adds robot model to the MJCF model.
def merge_robot(self, mujoco_robot): self.robot = mujoco_robot self.merge(mujoco_robot)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_model(self, model, delay_sort=True):\n assert isinstance(model, Model)\n\n if self.model_dict.has_key(model.model_id):\n raise ModelOverwrite()\n\n ## set default model if not set\n if self.default_model is None:\n self.default_model = model\n\n self...
[ "0.6300351", "0.623976", "0.61926067", "0.61295176", "0.61295176", "0.6086574", "0.5866401", "0.577208", "0.5743423", "0.56547195", "0.5634474", "0.5634143", "0.56233644", "0.5622354", "0.56155986", "0.5605738", "0.5589253", "0.556396", "0.5549465", "0.55179256", "0.54772717"...
0.5588443
17
Adds arena model to the MJCF model.
def merge_arena(self, mujoco_arena): self.arena = mujoco_arena self.bin_offset = mujoco_arena.bin_abs self.bin_size = mujoco_arena.table_full_size self.bin2_body = mujoco_arena.bin2_body self.merge(mujoco_arena)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append(self,aModel):\n\n self.models.append(aModel)\n self.nmodes += len(aModel.modes)", "def _attach_to_model(self, model):\n self._model = model", "def add_ae(self, model, dataset, latent_options, model_paths, pre_process=None):\n ae = autoencoder(self.app, model, dataset, lat...
[ "0.56313676", "0.49615818", "0.49567008", "0.4920569", "0.4859373", "0.48569682", "0.48476598", "0.4833981", "0.47855198", "0.47855198", "0.47557554", "0.4750223", "0.47291082", "0.47220296", "0.46787572", "0.46525794", "0.4638592", "0.46205002", "0.4614683", "0.46135435", "0...
0.560865
1
Adds physical objects to the MJCF model.
def merge_objects(self, mujoco_objects): self.n_objects = len(mujoco_objects) self.mujoco_objects = mujoco_objects self.objects = [] # xml manifestation self.max_horizontal_radius = 0 for obj_name, obj_mjcf in mujoco_objects.items(): self.merge_asset(obj_mjcf) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addObject(self):\n\t\tsel = mc.ls( sl = True, typ = 'transform' )\n\t\tif sel:\n\t\t\tself.objects_lw.addItems( sel )", "def add_to_space(self, *objects):\n for obj in objects:\n self.space.add(obj)\n if isinstance(obj, pm.Body):\n self.bodies.append(obj)\n ...
[ "0.6231083", "0.6163978", "0.61568135", "0.59532267", "0.5918786", "0.59032637", "0.57899606", "0.574225", "0.57197064", "0.5689045", "0.5618526", "0.5602999", "0.55927825", "0.53426486", "0.5332537", "0.5312929", "0.53120226", "0.5302265", "0.5299465", "0.5294262", "0.528690...
0.6004492
3
Adds visual objects to the MJCF model.
def merge_visual(self, mujoco_objects): self.visual_obj_mjcf = [] for obj_name, obj_mjcf in mujoco_objects.items(): self.merge_asset(obj_mjcf) # Load object obj = obj_mjcf.get_visual(name=obj_name, site=False) self.visual_obj_mjcf.append(obj) s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addObjects(self):\n\n self.root = self.addRoot()\n vTemp = transform.getOffsetPosition(self.root, [0, 1, 0])\n self.top_loc = self.addLoc(\"top\", self.root, vTemp)\n centers = [self.root, self.top_loc]\n self.dispcrv = self.addDispCurve(\"crv\", centers)\n\n vTemp = t...
[ "0.64129865", "0.6372637", "0.625703", "0.6190473", "0.6069831", "0.6058175", "0.60520357", "0.6046985", "0.5969594", "0.59651613", "0.5939097", "0.5872474", "0.58611226", "0.5806287", "0.57963556", "0.5793267", "0.5742596", "0.57081103", "0.5706335", "0.57024294", "0.5668408...
0.7002316
0
Samples quaternions of random rotations along the zaxis.
def sample_quat(self): if self.z_rotation: rot_angle = np.random.uniform(high=2 * np.pi, low=0) return [np.cos(rot_angle / 2), 0, 0, np.sin(rot_angle / 2)] return [1, 0, 0, 0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_quaternions(count=100):\n rands = np.random.rand(count,3)\n root_1 = np.sqrt(rands[:,0])\n minus_root_1 = np.sqrt(1-rands[:,0])\n two_pi_2 = np.pi*2*rands[:,1]\n two_pi_3 = np.pi*2*rands[:,2]\n \n res = np.zeros((count,4))\n res[:,0] = minus_root_1*np.sin(two_pi_2)\n res[:,1] ...
[ "0.7073986", "0.68722045", "0.6529664", "0.6503195", "0.6345796", "0.6336485", "0.6277915", "0.61840326", "0.61288977", "0.60825557", "0.6078604", "0.60223764", "0.60217965", "0.60030395", "0.6001181", "0.5951943", "0.59054774", "0.58579105", "0.58181906", "0.57951933", "0.57...
0.7299934
0
Places objects randomly until no collisions or max iterations hit.
def place_objects(self): placed_objects = [] index = 0 np.random.seed(300) # place objects by rejection sampling for _, obj_mjcf in self.mujoco_objects.items(): horizontal_radius = obj_mjcf.get_horizontal_radius() bottom_offset = obj_mjcf.get_bottom_offset...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spawn_obstacles(self):\n self.obstacle_sprites.empty()\n number_of_obstacles = random.randint(MIN_OBSTACLES, MAX_OBSTACLES)\n while len(self.obstacle_sprites) < number_of_obstacles:\n obstacle = Obstacle(random.randrange(0, WIDTH), random.randrange(HEIGHT - 500, HEIGHT))\n ...
[ "0.6649374", "0.6615201", "0.64481175", "0.6212739", "0.6065585", "0.6065585", "0.6060398", "0.6040957", "0.6012398", "0.6007238", "0.5996292", "0.59452283", "0.5914823", "0.59141505", "0.5879403", "0.5825326", "0.58152974", "0.57988673", "0.57517725", "0.5739899", "0.5738482...
0.69110835
0
Places visual objects randomly until no collisions or max iterations hit.
def place_visual(self): index = 0 bin_pos = string_to_array(self.bin2_body.get("pos")) bin_size = self.bin_size for _, obj_mjcf in self.visual_objects: bin_x_low = bin_pos[0] bin_y_low = bin_pos[1] if index == 0 or index == 2: bin_x_l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fill(obj, prob = 1, collide_obj = None, collide_callback = None) :\n for x in range(int(Globals.instance.WIDTH/Globals.instance.GRID_SIZE)):\n for y in range(int(Globals.instance.HEIGHT/Globals.instance.GRID_SIZE)):\n if random.uniform(0, 1) > prob:\n continue\n ...
[ "0.6690254", "0.6616007", "0.64516664", "0.64507973", "0.64082336", "0.6398577", "0.6385337", "0.6320666", "0.6147977", "0.6133578", "0.6133578", "0.6133037", "0.6108902", "0.6108902", "0.6108902", "0.6084032", "0.6068002", "0.606773", "0.6066637", "0.60568565", "0.60369223",...
0.0
-1
Apply a patterning operator on a mesh through general transformation.
def patterning(mesh, operator): operators = { 'conway_dual': conway_dual, 'conway_join': conway_join, 'conway_ambo': conway_ambo, 'conway_kis': conway_kis, 'conway_needle': conway_needle, 'conway_zip': conway_zip, 'conway_truncate': conway_truncate, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform_mesh_filter(*args, **kwargs):\n import itk\n instance = itk.TransformMeshFilter.New(*args, **kwargs)\n return instance.__internal_call__()", "def manifold_and_triangulate():\n # Switch in edit mode \n bpy.ops.object.mode_set(mode='EDIT')\n\n # Deselect everything\n ...
[ "0.5618558", "0.5414091", "0.5391252", "0.538712", "0.53303236", "0.5186021", "0.5045422", "0.50429285", "0.5039544", "0.5029276", "0.5006718", "0.49956977", "0.4982048", "0.49593455", "0.49355075", "0.49018618", "0.48980793", "0.48942378", "0.48899797", "0.48395935", "0.4818...
0.7581529
0
>>> _map_dtype(np.dtype(np.int32)) int32 >>> _map_dtype(np.dtype(np.int64)) int64 >>> _map_dtype(np.dtype(np.object)) PyObject >>> _map_dtype(np.dtype(np.float64)) double >>> _map_dtype(np.dtype(np.complex128)) complex128
def map_dtype(dtype): item_idx = int(math.log(dtype.itemsize, 2)) if dtype.kind == 'i': return [int8, int16, int32, int64][item_idx] elif dtype.kind == 'u': return [uint8, uint16, uint32, uint64][item_idx] elif dtype.kind == 'f': if dtype.itemsize == 2: pass # half fl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _map_data_types(dtype):\n return _data_type_map[dtype]", "def datatype_map(dtype):\n # TODO: add datetype conversion\n if 'float' in dtype:\n return 'numeric'\n elif 'int' in dtype:\n return 'int'\n elif 'bool' in dtype:\n return 'boolean'\n else:\n return 'text'...
[ "0.80567575", "0.7175208", "0.7003725", "0.6944843", "0.69013226", "0.6860262", "0.683389", "0.68223584", "0.6821523", "0.68193454", "0.6785528", "0.6780237", "0.6765619", "0.67386276", "0.6680076", "0.66334206", "0.6630267", "0.6590078", "0.65894043", "0.65669954", "0.653415...
0.8565042
0
Desenha o labirinto representado no modelo model.
def draw(self, state): if state is None: state = self.model.current_state for row in range(len(self.model.maze.walls)): self.__draw_row_division() print(" {0:2d} ".format(row), end='') # Imprime número da linha for col in range(len(self.model.maze.walls[0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model(self):", "def model(self):", "def model(self):", "def model(self):", "def model(self):", "def __init__(self):\n self.model = None", "def __init__(self):\n self.model = None", "def create_model(self):\n self.model = None\n pass", "def save_model(self, request, o...
[ "0.55984116", "0.55984116", "0.55984116", "0.55984116", "0.55984116", "0.5581929", "0.5581929", "0.5559378", "0.5522319", "0.54893225", "0.54143155", "0.54143155", "0.54143155", "0.5379634", "0.53113645", "0.5260471", "0.5246865", "0.52457726", "0.52361137", "0.522273", "0.52...
0.0
-1
Transpose iload and istore. Must be fix in a future version.
def fix_iload(self): # Fixme : store in a good way and in the right type istore and iload for i in range(len(self.iload)): self.iload[i] = np.ascontiguousarray(self.iload[i].T, dtype=np.int32) self.istore = np.ascontiguousarray(self.istore.T, dtype=np.int32)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transpose():", "def transpose_load_concat(self, **kwargs):\n if self.mask_train:\n datamask=self.add_mask()\n thedatas={}\n for key, value in kwargs.items():\n if not self.mask_train:\n thedatas[key]=value.X_train.transpose('a','x','y','features').val...
[ "0.5811776", "0.57074726", "0.5681151", "0.5640245", "0.55777746", "0.5351398", "0.5351398", "0.52928823", "0.5287192", "0.5227838", "0.52135694", "0.5213067", "0.5190803", "0.5118121", "0.5108729", "0.5093582", "0.5092675", "0.50697315", "0.50460935", "0.50371075", "0.500618...
0.684812
0
Compute the distribution function at the equilibrium with the value on the border.
def prepare_rhs(self, simulation): nv = simulation.container.nv sorder = simulation.container.sorder nspace = [1] * (len(sorder) - 1) v = self.stencil.get_all_velocities() gpu_support = simulation.container.gpu_support for key, value in self.value_bc.items(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def erfc(x):\n return 0.0", "def gaussed_value(self):\n from random import gauss\n return sorted([0, int(gauss(self.value, self.sigma)), \\\n (self.size*8)-1])[1]", "def normalizefunction(self , values):\n maxv = np...
[ "0.5741531", "0.5684328", "0.5653153", "0.5638879", "0.55996156", "0.5574182", "0.55577606", "0.5529009", "0.5514495", "0.5494531", "0.5486149", "0.547287", "0.54722273", "0.54658103", "0.54658103", "0.5454037", "0.54514307", "0.5434385", "0.54310715", "0.54193836", "0.541202...
0.0
-1
Update distribution functions with this boundary condition.
def update(self, ff, **kwargs): from .symbolic import call_genfunction args = self._get_args(ff) args.update(kwargs) call_genfunction(self.function, args) # pylint: disable=no-member
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, function_values, es, bounds=None):\r\n if bounds is None:\r\n bounds = self.bounds\r\n if bounds is None or (bounds[0] is None and bounds[1] is None): # no bounds ==> no penalty\r\n return self # len(function_values) * [0.0] # case without voilations\r\n\r\n ...
[ "0.6606664", "0.64178854", "0.6225716", "0.6151874", "0.60961413", "0.6093528", "0.5998069", "0.59092504", "0.59061515", "0.58915484", "0.5869262", "0.5866838", "0.586291", "0.58489245", "0.5843187", "0.583318", "0.58013886", "0.58013636", "0.5791642", "0.57863945", "0.576748...
0.0
-1
Move arrays needed to compute the boundary on the GPU memory.
def move2gpu(self): if self.generator.backend.upper() == "LOOPY": try: import pyopencl as cl import pyopencl.array # pylint: disable=unused-variable from .context import queue except ImportError: raise ImportError("Please i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _data_move_out_last_dim_lt_one_block(tik_inst, dst, src, data_pos_info):\n sub_axis_1, sub_axis_0, axis_0, axis_1, axis_2, out_offset = data_pos_info\n data_size_one_block = _get_elment_cnt_one_block(src.dtype)\n\n with tik_inst.if_scope(sub_axis_1 == 1):\n with tik_inst.if_scope(sub_axis_0 * a...
[ "0.5812451", "0.5725411", "0.5472441", "0.545434", "0.54450196", "0.54422855", "0.5420267", "0.53995526", "0.5396849", "0.53827024", "0.5343788", "0.53435355", "0.5315347", "0.5311603", "0.52795476", "0.52631", "0.5237792", "0.52351785", "0.5228774", "0.5220994", "0.5220994",...
0.6041597
0
Compute the indices that are needed (symmertic velocities and space indices).
def set_iload(self): k = self.istore[0] ksym = self.stencil.get_symmetric()[k][np.newaxis, :] v = self.stencil.get_all_velocities() indices = self.istore[1:] + v[k].T self.iload.append(np.concatenate([ksym, indices]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def indices_and_currents_TSC_2D( charge_electron, positions_x, positions_y, velocity_x, velocity_y,\\\n x_grid, y_grid, ghost_cells, length_domain_x, length_domain_y, dt ):\n \n \n positions_x_new = positions_x + velocity_x * dt\n positions_y_new = positions_y + velo...
[ "0.70425975", "0.6227534", "0.621245", "0.61198896", "0.6050179", "0.60492086", "0.59963256", "0.59747845", "0.5971784", "0.5960889", "0.5925465", "0.5918824", "0.5916217", "0.5899766", "0.5848567", "0.5788059", "0.5782234", "0.5770706", "0.5726879", "0.5722692", "0.5709878",...
0.0
-1
Compute and set the additional terms to fix the boundary values.
def set_rhs(self): k = self.istore[:, 0] ksym = self.stencil.get_symmetric()[k] self.rhs[:] = self.feq[k, np.arange(k.size)] - self.feq[ksym, np.arange(k.size)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculateElementBoundaryCoefficients(self):\n pass", "def update(self):\n\n terms_toRemove = []\n\n for termIndex, [term_constantFactor, term_unknowns_attributeAddresses] in enumerate(self.LHS):\n\n # Check if coefficient is 0 - then no need to process any of the unknowns sinc...
[ "0.59818715", "0.59583765", "0.5903426", "0.5859693", "0.58076525", "0.5784628", "0.5665552", "0.5640563", "0.5586638", "0.5551454", "0.5532172", "0.5490747", "0.54334694", "0.5426477", "0.5416738", "0.54091454", "0.54014874", "0.5349996", "0.5336917", "0.5335465", "0.5335465...
0.52924377
25
Generate the numerical code.
def generate(self, sorder): from .generator import For from .symbolic import nx, ny, nz, indexed, ix ns = int(self.stencil.nv_ptr[-1]) dim = self.stencil.dim istore, iload, ncond = self._get_istore_iload_symb(dim) rhs, _ = self._get_rhs_dist_symb(ncond) idx = I...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def code(self):\n if not self._code:\n filename = '<fluxtools function %s>' % self.tag\n self._code = compile(self.math, filename, mode='eval')\n return self._code", "def _get_random_number_code(self):\r\n return \"str(random.randint(0, 1e9))\"", "def number(self):", ...
[ "0.66350216", "0.6155325", "0.6070667", "0.60567296", "0.6001382", "0.5999806", "0.5950534", "0.5930682", "0.58927596", "0.5881666", "0.5805855", "0.57972014", "0.5767194", "0.5750545", "0.5731919", "0.5724899", "0.57187545", "0.56876415", "0.5651061", "0.564188", "0.5631152"...
0.0
-1
Return the generated function
def function(self): return self.generator.module.bounce_back
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFunction(self) -> ghidra.program.model.listing.Function:\n ...", "def gen_function(self, function):\n if function.body:\n self.gen_function_def(function)", "def func ( self ) :\n return self.__func", "def func ( self ) :\n return self.__func", "def __call...
[ "0.72852004", "0.7195862", "0.7117405", "0.70892036", "0.7076999", "0.6858654", "0.6826619", "0.67727506", "0.67657286", "0.6740471", "0.67363507", "0.67158663", "0.6688514", "0.6664095", "0.665405", "0.6650802", "0.66507447", "0.66498697", "0.6646827", "0.6641116", "0.66322"...
0.0
-1
Compute the indices that are needed (symmertic velocities and space indices).
def set_iload(self): k = self.istore[0] ksym = self.stencil.get_symmetric()[k] v = self.stencil.get_all_velocities() iload1 = np.zeros(self.istore.shape, dtype=np.int32) iload2 = np.zeros(self.istore.shape, dtype=np.int32) mask = self.distance < 0.5 iload1[0, ma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def indices_and_currents_TSC_2D( charge_electron, positions_x, positions_y, velocity_x, velocity_y,\\\n x_grid, y_grid, ghost_cells, length_domain_x, length_domain_y, dt ):\n \n \n positions_x_new = positions_x + velocity_x * dt\n positions_y_new = positions_y + velo...
[ "0.70425975", "0.6227534", "0.621245", "0.61198896", "0.6050179", "0.60492086", "0.59963256", "0.59747845", "0.5971784", "0.5960889", "0.5925465", "0.5918824", "0.5916217", "0.5899766", "0.5848567", "0.5788059", "0.5782234", "0.5770706", "0.5726879", "0.5722692", "0.5709878",...
0.0
-1
Compute and set the additional terms to fix the boundary values.
def set_rhs(self): k = self.istore[:, 0] ksym = self.stencil.get_symmetric()[k] self.rhs[:] = self.feq[k, np.arange(k.size)] - self.feq[ksym, np.arange(k.size)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculateElementBoundaryCoefficients(self):\n pass", "def update(self):\n\n terms_toRemove = []\n\n for termIndex, [term_constantFactor, term_unknowns_attributeAddresses] in enumerate(self.LHS):\n\n # Check if coefficient is 0 - then no need to process any of the unknowns sinc...
[ "0.59818715", "0.59583765", "0.5903426", "0.5859693", "0.58076525", "0.5784628", "0.5665552", "0.5640563", "0.5586638", "0.5551454", "0.5532172", "0.5490747", "0.54334694", "0.5426477", "0.5416738", "0.54091454", "0.54014874", "0.5349996", "0.5336917", "0.5335465", "0.5335465...
0.52924377
24
Generate the numerical code.
def generate(self, sorder): from .generator import For from .symbolic import nx, ny, nz, indexed, ix ns = int(self.stencil.nv_ptr[-1]) dim = self.stencil.dim istore, iload, ncond = self._get_istore_iload_symb(dim) rhs, dist = self._get_rhs_dist_symb(ncond) idx ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def code(self):\n if not self._code:\n filename = '<fluxtools function %s>' % self.tag\n self._code = compile(self.math, filename, mode='eval')\n return self._code", "def _get_random_number_code(self):\r\n return \"str(random.randint(0, 1e9))\"", "def number(self):", ...
[ "0.66350216", "0.6155325", "0.6070667", "0.60567296", "0.6001382", "0.5999806", "0.5950534", "0.5930682", "0.58927596", "0.5881666", "0.5805855", "0.57972014", "0.5767194", "0.5750545", "0.5731919", "0.5724899", "0.57187545", "0.56876415", "0.5651061", "0.564188", "0.5631152"...
0.0
-1
Return the generated function
def function(self): return self.generator.module.Bouzidi_bounce_back
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFunction(self) -> ghidra.program.model.listing.Function:\n ...", "def gen_function(self, function):\n if function.body:\n self.gen_function_def(function)", "def func ( self ) :\n return self.__func", "def func ( self ) :\n return self.__func", "def __call...
[ "0.72852004", "0.7195862", "0.7117405", "0.70892036", "0.7076999", "0.6858654", "0.6826619", "0.67727506", "0.67657286", "0.6740471", "0.67363507", "0.67158663", "0.6688514", "0.6664095", "0.665405", "0.6650802", "0.66507447", "0.66498697", "0.6646827", "0.6641116", "0.66322"...
0.0
-1