query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
test that the generator yields the correct output when indexing from zero
def test_generation_index_zero(self): generator = math_helpers.triangle_number_generator() first_eleven_triangle_numbers = [next(generator) for _ in range(11)] canonical_values = [0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55] self.assertEqual(canonical_values, first_eleven_triangle_numbers)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_generation_index_one(self):\n generator = math_helpers.triangle_number_generator(1)\n first_ten_triangle_numbers = [next(generator) for _ in range(10)]\n canonical_values = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55]\n self.assertEqual(canonical_values, first_ten_triangle_numbers)", ...
[ "0.65620244", "0.65434223", "0.6286427", "0.6189783", "0.6189389", "0.61437476", "0.60891944", "0.60622066", "0.60527146", "0.60308594", "0.6026977", "0.60156935", "0.59985435", "0.5989036", "0.59800375", "0.5966629", "0.5911112", "0.58879185", "0.58549297", "0.5843811", "0.5...
0.6773308
0
test that the generator yields the correct output when indexing from one
def test_generation_index_one(self): generator = math_helpers.triangle_number_generator(1) first_ten_triangle_numbers = [next(generator) for _ in range(10)] canonical_values = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55] self.assertEqual(canonical_values, first_ten_triangle_numbers)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_generator_method(self):\n for i in range(0, 4):\n yield self.try_odd, i", "def test_testGenerator():\n\n # check type\n assert isinstance(testset, list)\n\n # check the shape\n assert len(testset)==newObs.shape[0]", "def test_func_generator_transplant():\n ...
[ "0.67612666", "0.6540647", "0.6347304", "0.63265353", "0.6272674", "0.6268136", "0.6202047", "0.6105433", "0.6067533", "0.60582614", "0.6054167", "0.60507053", "0.60323983", "0.6031629", "0.6027344", "0.60162985", "0.60071313", "0.6004916", "0.5967041", "0.59528667", "0.59383...
0.66759306
1
Get login manager names
def getTimekprLoginManagers(): global _loginManagers return(_loginManagers)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_managers():\n return {'managers': get_users('managers')}", "def get_system_managers(only_name: bool = False) -> list[str]:\n\tHasRole = DocType(\"Has Role\")\n\tUser = DocType(\"User\")\n\n\tif only_name:\n\t\tfields = [User.name]\n\telse:\n\t\tfields = [User.full_name, User.name]\n\n\tsystem_managers...
[ "0.65457773", "0.6402471", "0.62186337", "0.618175", "0.6157624", "0.5922514", "0.58962244", "0.5892551", "0.5839041", "0.58095676", "0.5780388", "0.5710504", "0.5697233", "0.5679872", "0.5607318", "0.551856", "0.5480489", "0.5459577", "0.54572856", "0.54572856", "0.5455005",...
0.7099838
0
Initialize all users present in the system as per particular config
def checkAndInitUsers(self): # config users = {} # iterate through all usernames for rUser in pwd.getpwall(): # check userid if rUser.pw_uid is not None and rUser.pw_uid != "" and not ("/nologin" in rUser.pw_shell or "/false" in rUser.pw_shell): #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init():\n create_user(app)\n get_all_user()", "def init_default_users():\n from flask import current_app as app\n with app.app_context():\n notion_uname = app.config.get(\"NOTION_CRONJOB_USERNAME\")\n notion_passwd = app.config.get(\"NOTION_CRONJOB_PASSWORD\")\n\n if notion_u...
[ "0.7886939", "0.71261805", "0.7068532", "0.6840538", "0.6811883", "0.6785962", "0.67232174", "0.67232174", "0.6675994", "0.6618686", "0.66058826", "0.66042155", "0.65231067", "0.6509159", "0.65031755", "0.64593905", "0.6435049", "0.64212024", "0.64208126", "0.6414819", "0.640...
0.7862209
1
Gets or creates directory for logs
def init_logs_directory(self): return self.join_and_init_path(self.get_data_general_directory, PATH_FOR_LOGS)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_log_dir():\n log_dir = get_log_dir()\n if log_dir.endswith('latest'):\n shutil.rmtree(log_dir, ignore_errors=True)\n mkdirs(log_dir)\n return log_dir", "def logs_directory(self):", "def _create_log_dir():\n if not os.path.exists(FLASK_APP.config[\"LOG_DIR\"]):\n os.makedirs(FLA...
[ "0.7976153", "0.7894984", "0.7791716", "0.7596984", "0.75095797", "0.74462134", "0.7382162", "0.73279244", "0.72530645", "0.71706456", "0.71434605", "0.7124528", "0.7102195", "0.70760244", "0.7049274", "0.704064", "0.6969299", "0.69350225", "0.69172055", "0.6914677", "0.69056...
0.8063092
0
Gets or creates path to error log files
def init_error_files(self): dir_path = self.init_logs_directory() log_errors = self.join_path(dir_path, PATH_FOR_LOG_ERRORS) return log_errors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stderr_path(self):\n return self.log_path\n # return self.path / 'stderr.txt'", "def errorpath():\n stdoutfile=pdbid()+\".error.log\"\n stdout = os.path.join(output_dir(), stdoutfile)\n\n return stdout", "def get_log_file_path(self):\n dir_path = self._get_log_file_dir()\n ...
[ "0.7527874", "0.73948807", "0.702239", "0.68975806", "0.68153846", "0.679226", "0.6656828", "0.66181743", "0.6549538", "0.65288526", "0.6426263", "0.6417242", "0.6403863", "0.6398437", "0.6381421", "0.63401043", "0.63269967", "0.63261133", "0.6292237", "0.6261665", "0.6213658...
0.7725463
0
Initialize this histogram as a new dict; update with given items
def __init__(self, iterable=None): super(Histogram, self).__init__() self.types = 0 # the number of distinct item types in this histogram self.tokens = 0 # the total count of all item tokens in this histogram if iterable: self.update(iterable)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _updateFromItem(self):\n item = self.getItem()\n\n if item is None:\n self.reset()\n return\n\n if not isinstance(item, self._SUPPORTED_ITEM_CLASS):\n _logger.error(\"Unsupported item\", item)\n self.reset()\n return\n\n # Compu...
[ "0.6358941", "0.6122818", "0.60806197", "0.5977958", "0.5972093", "0.5950355", "0.5922684", "0.5915707", "0.58972573", "0.5872561", "0.58719796", "0.58702004", "0.58552015", "0.5855035", "0.5743081", "0.5723025", "0.57209456", "0.57205206", "0.5706214", "0.5673024", "0.566270...
0.67038065
0
Return the count of the given item in this histogram, or 0
def count(self, item): if item in self: return self[item] else: return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count(self, item):\n # type: (Any) -> int\n return list.count(self, self.ref(item))", "def count(self, item):\n return _(self._.count(item))", "def count(self, item: Any) -> int:\n curr = self._first\n count = 0\n\n while curr is not None:\n if curr.item...
[ "0.7501823", "0.74777937", "0.74387944", "0.7385838", "0.71182686", "0.7001242", "0.69319326", "0.6839006", "0.6803228", "0.67443347", "0.66951853", "0.6672748", "0.653674", "0.6500396", "0.64986986", "0.6493515", "0.6493515", "0.6473139", "0.64564973", "0.645404", "0.644886"...
0.8094787
0
Build a browser object a and pointer to the page body, of the search results.
def build_browser(searchurl): options = webdriver.ChromeOptions() options.add_argument('--no-sandbox') try: browser = webdriver.Chrome(ChromeDriverManager().install()) except Exception as e: print(f'No found chromedriver in this environment.') print(f'Install on your machine. exc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search():\n url = create_search_url()\n links = make_selenium_search(url)\n\n return links", "def page_body():\r\n st.header(\"Search\")\r\n st.subheader(\"Search For SMEs With A Few Different Options\")\r\n\r\n search_mode_selection = st.radio(\r\n help=\"Search For SMEs That Have P...
[ "0.61708033", "0.60043526", "0.56796", "0.5647723", "0.56084704", "0.56076986", "0.5590576", "0.5586558", "0.5546072", "0.55399984", "0.55074215", "0.54825324", "0.5472605", "0.54686517", "0.5468585", "0.5468585", "0.54547846", "0.54461205", "0.5438007", "0.5430138", "0.54218...
0.67708874
0
Collect all the images url by an html images objects
def get_url_from_images(html_images): urls = [] for image in html_images: try: url = image['data-src'] if not url.find("https://"): urls.append(url) except: try: url = image['src'] if not url.find("https://"): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scrape(self):\n reg = re.compile(self.regex)\n images = self.soup.findAll('img')\n results = []\n for img in images:\n try:\n url = dict(img.attrs)['src']\n url = self._make_url_path(url)\n if reg.match(url):\n ...
[ "0.7710374", "0.7701632", "0.73915905", "0.73700666", "0.7355089", "0.7310259", "0.72975385", "0.71919096", "0.7167929", "0.7150677", "0.7149977", "0.71022826", "0.7074955", "0.69532025", "0.6945381", "0.6927229", "0.69269663", "0.6885604", "0.68824416", "0.6851432", "0.68369...
0.7713752
0
Load all the environment variables defined in the `env_file`. This is equivalent to `. env_file` in bash. It is possible to define all the system specific variables in the `env_file`.
def load_envs(env_file: Optional[str] = None) -> None: dotenv.load_dotenv(dotenv_path=env_file, override=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_envs_from_file(file_path=constants.ENV_FILE_DEFAULT_PATH.value):\n #pylint: disable=unspecified-encoding\n with open(file_path, \"r\") as file:\n for line in file:\n line = line.strip()\n if not line:\n continue\n if line.startswith(\"#\"):\n ...
[ "0.8037709", "0.75521344", "0.74704516", "0.74306357", "0.73876494", "0.7366125", "0.7323644", "0.70755285", "0.7024416", "0.6894454", "0.6866709", "0.68233156", "0.68144315", "0.67741936", "0.67297035", "0.66447043", "0.6612059", "0.6598596", "0.6559391", "0.6450934", "0.638...
0.8404838
0
Update status and return task updated
def update_status(request): task_id = request.POST.get('task_id', 0) new_status = request.POST.get('new_status', 0) search_task = task_models.Task.query.filter(task_models.Task.id == task_id).first() if not search_task: return HttpResponse(simplejson.dumps({'success': False})) search_task....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_status(self, *args, **kwargs):\n # Get Future\n future = self.future\n\n # Do nothing if no Future\n if not future:\n return\n\n # Get the status\n dask_status = future.status.lower()\n\n try:\n # Translate to TethysJob status\n ...
[ "0.74056137", "0.72580117", "0.7137461", "0.70980364", "0.7047253", "0.69939744", "0.69837", "0.6919644", "0.6919353", "0.68925995", "0.6863291", "0.6858715", "0.68347573", "0.68258166", "0.6808914", "0.67726386", "0.67489964", "0.6748969", "0.6720296", "0.6717316", "0.671134...
0.7371842
1
Return a list of domains for a hostname (in args)
def return_domains(hostname, username): myconnection = ssh_connection(hostname, username) if myconnection == 1: return "Connection to %s failed" % hostname else: # Send the command (non-blocking) stdin, stdout, stderr = myconnection.exec_command("sudo /usr/sbin/postconf -P */unix/sys...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_domain_names():\n pass", "def resolv(hostname):\n\n ips = list()\n\n # Create resolver object\n res = resolver.Resolver()\n\n # Choose the correct DNS servers\n # Blue DNS servers\n if hostname.startswith('b-'):\n res.nameservers = ['172.16.2.10', '172.16.2.11']\n # Green DNS servers\n eli...
[ "0.7465468", "0.6850255", "0.68328685", "0.6611784", "0.6570603", "0.65482295", "0.63765883", "0.637582", "0.63531", "0.62842184", "0.6282919", "0.6246976", "0.6245952", "0.62338334", "0.6204809", "0.6178074", "0.6166124", "0.6165479", "0.6160553", "0.61244196", "0.6105133", ...
0.70557356
1
Add a domain extension (if does not exist) for a domain name in transport file
def return_add_transport(hostname, domain_name, domain_extension, username): #Established the connection myconnection = ssh_connection(hostname, username) if myconnection == 1: return "Connection to %s failed" % hostname else: #We will to test if the domain already exist in the postfix c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_email_domain(email, domain):\n if not domain:\n return email\n if '@' in email:\n return email\n at_domain = domain if domain.startswith('@') else '@' + domain\n if email.endswith(at_domain):\n return email\n if email.endswith(at_domain + '>'):\n return email\n ...
[ "0.6212772", "0.59794325", "0.5933907", "0.59092826", "0.58966273", "0.5798986", "0.5794832", "0.5772177", "0.57682776", "0.57138413", "0.5669241", "0.5665553", "0.5661082", "0.5605815", "0.5545321", "0.55394465", "0.55169743", "0.54749495", "0.54575026", "0.54471385", "0.542...
0.6211821
1
Returns the total number of subscribers for a given subreddit.
def number_of_subscribers(subreddit): # Set the Default URL strings base_url = 'https://www.reddit.com' api_uri = '{base}/r/{subreddit}/about.json'.format(base=base_url, subreddit=subreddit) # Set an User-Agent user_agent = {'User-Agent': 'Pyth...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def number_of_subscribers(subreddit):\n url = \"https://www.reddit.com/r/{}.json\".format(subreddit)\n r = requests.get(url, headers={'User-agent': 'shoji'},\n allow_redirects=False)\n data = r.json()\n if not r.status_code == 200:\n return 0\n try:\n sub = data.get...
[ "0.88452405", "0.88001615", "0.8758702", "0.87437683", "0.87410414", "0.8737465", "0.8723826", "0.87215465", "0.86755574", "0.86608243", "0.86076564", "0.86025274", "0.8579033", "0.8564103", "0.85612786", "0.8550934", "0.8545987", "0.8475834", "0.8413587", "0.82184273", "0.82...
0.9056629
0
Filter out UN intervention nodes except the ones in the include list.
def filter_to_hume_interventions(stmts): include = ['provision_of_free_food_distribution', 'provision_of_cash_transfer'] filter_out = [False] * len(stmts) print('Filtering %d stmts' % len(stmts)) for idx, stmt in enumerate(stmts): for agent in stmt.agent_list(): if 'UN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exclude_nodes(self, nodes):", "def filter(self, include=None, exclude=None):\n if not include:\n include = ()\n if not exclude:\n exclude = ()\n\n return sorted([x for x in self.data.values() if (not include or any(isinstance(x, t) for t in include)) and\n ...
[ "0.67418694", "0.6117754", "0.58795565", "0.573762", "0.56526923", "0.55822784", "0.55800045", "0.5576209", "0.55718714", "0.5571381", "0.5549623", "0.5520182", "0.55010605", "0.54866487", "0.54247105", "0.5379925", "0.5378728", "0.53578", "0.5351679", "0.53441405", "0.533387...
0.6273386
1
Returns 1 if X has won the game, 1 if O has won, 0 otherwise.
def utility(board): winning_player = winner(board) # Did X win? if winning_player == X: return 1 # Did O win? if winning_player == O: return -1 return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_game_won(self) -> int:\n\n b = self.board\n for c1, c2, c3, c4 in _WINDOWS:\n if b[c1] and (b[c1] == b[c2] == b[c3] == b[c4]):\n print(\"win\", c1, c2, c3, c4)\n return b[c1]", "def player(board):\n x_counter = 0\n o_counter = 0\n\n for i in...
[ "0.7282075", "0.72561866", "0.72313863", "0.7200964", "0.7191572", "0.7168141", "0.7164547", "0.71292514", "0.7123542", "0.71037567", "0.7097756", "0.7078315", "0.70739603", "0.7033477", "0.7021798", "0.701796", "0.70142305", "0.70036036", "0.69928795", "0.6981686", "0.694844...
0.73503214
0
Find words in word_set that have length greater than n.
def words_len_greater_than(n): return {w for w in word_set if len(w) > n}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def n_long_words(words, n):\n words_longer_than_n = []\n for word in words:\n if len(word) > n:\n words_longer_than_n.append(word)\n\n return words_longer_than_n", "def filter_long_words(list,n):\n numberlist=[]#set up a new list\n for i in range(0,len(list)):\n if len(lis...
[ "0.78197736", "0.7227532", "0.69592094", "0.69480854", "0.6835576", "0.67826504", "0.6761459", "0.6617565", "0.65964276", "0.63648957", "0.62678367", "0.6237345", "0.61757463", "0.6142094", "0.61131424", "0.60555744", "0.603735", "0.60353917", "0.6034472", "0.6024036", "0.601...
0.8484499
0
Finds all words in word_set that do not have the letter l.
def words_without_letter(l): return {w for w in word_set if has_no_letter(w, l)}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def words_uses_only(letters):\n\treturn {w for w in word_set if uses_only(w, letters)}", "def known(words):\r\n return set(w for w in words if w in WORDS)", "def exclude_words(self, words):\n idcs = []\n for i in range(len(self)):\n if not self.transcript(i) in words:\n ...
[ "0.70398265", "0.66386557", "0.66319805", "0.6586166", "0.65605026", "0.64877725", "0.64639956", "0.6449832", "0.63439935", "0.6343545", "0.63153183", "0.6264546", "0.62233686", "0.6147896", "0.6138847", "0.61236644", "0.6107858", "0.60502595", "0.5988028", "0.5979397", "0.59...
0.8541773
0
Finds percentage of words in word_set without letter l.
def percent_without_letter(l): return len(words_without_letter(l)) / len(word_set)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boostScore(self, result: str, words:set ):\n found = 0;\n for word in words:\n if result in self.invertedIndex[word]:\n found += 1\n return found/len(words)", "def percent_frequencies(self):\n word_count = 0\n local = self.frequencies()\n fo...
[ "0.65205586", "0.6472289", "0.6440788", "0.643002", "0.63763565", "0.6327741", "0.62209934", "0.6209515", "0.6150368", "0.61175454", "0.6074386", "0.6044777", "0.60375136", "0.6026406", "0.6003252", "0.59939384", "0.5986944", "0.5981807", "0.5981807", "0.59739184", "0.5941633...
0.88551563
0
Prints number of words from word_set that avoid the user submitted string of letters.
def user_avoid_count(): forbidden = input('Enter a string of forbidden letters.\n> ') print(len({w for w in word_set if avoids(w, forbidden)}))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_uses_all():\n str = input('Enter a string of letters, please:')\n\n count_uses_all = 0\n for line in fin:\n word = line.strip()\n if uses_all(word, str):\n print(word)\n count_uses_all += 1\n print('Number of words that use all letters in the string:', coun...
[ "0.69023", "0.68986577", "0.6628784", "0.6303168", "0.622313", "0.6209866", "0.61580354", "0.6153805", "0.6128608", "0.6120367", "0.6089993", "0.606419", "0.6043903", "0.6039978", "0.6039978", "0.60386497", "0.6035041", "0.6030058", "0.5978528", "0.59610736", "0.59212035", ...
0.7388498
0
Finds all words in word_set made from letters.
def words_uses_only(letters): return {w for w in word_set if uses_only(w, letters)}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def words_without_letter(l):\n\treturn {w for w in word_set if has_no_letter(w, l)}", "def filter_by_lettersets(words):\n lettersets = {}\n\n for word in words:\n letterset = frozenset(word)\n length = len(word)\n if letterset not in lettersets or length > lettersets[letterset][0]:\n ...
[ "0.7162044", "0.70259464", "0.70036924", "0.69394267", "0.69267565", "0.68268996", "0.6785891", "0.677334", "0.67678404", "0.67589533", "0.67586404", "0.6694646", "0.66327876", "0.6626484", "0.66089416", "0.6602606", "0.6593278", "0.65701854", "0.65646875", "0.65646625", "0.6...
0.8051923
0
Use alias to find actual wrapper, which contain actor handler.
def find_alias(self, alias): if hasattr(self, '_logger'): self._logger.debug(alias) self.check_alias(alias, True) path = self.alias_path_map[alias] path = self._absolute_path(path) self.check_path(path, True) nid = self.path_nid_map[path] return self.g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_alias(self):", "def resolveAlias(self, alias):", "def __call__(self, alias):\n return self.get_by_alias(alias)", "def _get_target(self):\n target = None\n lnw = self.wrapped_handler_ref()\n if lnw is not None:\n target_ref = getattr(lnw, \"object\", None)\n ...
[ "0.60231894", "0.59816706", "0.5686326", "0.5532191", "0.5452447", "0.53855836", "0.53855836", "0.53269017", "0.5276283", "0.5275559", "0.5274242", "0.52167267", "0.52167267", "0.52167267", "0.5179842", "0.51712525", "0.51392704", "0.51069885", "0.50725645", "0.50703895", "0....
0.63080287
0
Given A = [x2 ... xM] where set A contains x2 lots of 2, x3 lots of 3, etc. Yields all ProdFreqPair's This algorithm does _not_ ensure that the products returned are distinct...
def prodgreqs_base(A): choices = [ list(range(xi+1)) for xi in A ] M = len(choices) + 1 for yi in itertools.product(*choices): prod, freq = 1, 1 for a, y, x in zip(range(2, M+1), yi, A): prod *= a ** y freq *= math.factorial(x) // math.factorial(y) // math.factorial(x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prodgreqs(A):\n pairs = list(prodgreqs_base(A))\n pairs.sort(key = lambda pfp : pfp.product)\n current_prod = -1\n current_freq = 0\n for pfp in pairs:\n if current_prod == -1:\n current_prod = pfp.product\n current_freq = pfp.freq\n else:\n if curr...
[ "0.780175", "0.6109361", "0.5713249", "0.56769186", "0.5640308", "0.55529904", "0.5530571", "0.55021", "0.5501083", "0.54204476", "0.54203075", "0.5342395", "0.532664", "0.5325811", "0.5297416", "0.5295746", "0.52800983", "0.52746207", "0.52708566", "0.52666736", "0.52485013"...
0.77215075
1
prods = list of products. Returns list of tuples (A, count) where A is a possible set, and count is the realtive change of seeing A.
def probability(prods, prod_dict_As, count_dict): for p in prods: if p not in prod_dict_As: raise Exception("Think we cannot make the product {}.".format(p)) # Argh, Python, this is a reference! #possible_As = prod_dict_As[prods[0]] possible_As = set( prod_dict_As[prods[0]] ) for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prodgreqs(A):\n pairs = list(prodgreqs_base(A))\n pairs.sort(key = lambda pfp : pfp.product)\n current_prod = -1\n current_freq = 0\n for pfp in pairs:\n if current_prod == -1:\n current_prod = pfp.product\n current_freq = pfp.freq\n else:\n if curr...
[ "0.63840234", "0.59333855", "0.5842505", "0.5733728", "0.5702081", "0.5599455", "0.5538646", "0.54229885", "0.5393193", "0.5324072", "0.52548593", "0.52327603", "0.5222254", "0.5216476", "0.5201859", "0.5191278", "0.5166486", "0.5156769", "0.5152277", "0.5132815", "0.5082037"...
0.6677144
0
Given the root dir of the images tree, get a list of all of the files that contain cards.
def get_cards_in_deck(root, region_codes): # TODO: speed up matching in some way to allow for all regions at once # TODO: it should be possible to multithread some matching with Pool root_parts = pathlib.Path(root).parts all_files = [] for code in region_codes: all_files.extend(glob.glob(f'{...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_card_files(card_dir: str = \"./cards\") -> List[Path]:\n p: Path = Path(card_dir)\n return list(p.glob('**/*.yaml'))", "def my_root_listdir(root_dir):\n root_listdir = [\n images_dir\n for images_dir in os.listdir(root_dir)\n if not any(\n characters in images_dir...
[ "0.75481945", "0.6519376", "0.63496464", "0.6327218", "0.62881887", "0.62469524", "0.6230385", "0.6211273", "0.618625", "0.60530376", "0.6047469", "0.60347384", "0.6007315", "0.60035497", "0.5998598", "0.59846973", "0.5981891", "0.5981891", "0.59797746", "0.59771097", "0.5967...
0.70987046
1
Test json_loads_array validates result.
def test_json_loads_array() -> None: assert json_loads_array('[{"c":1.2}]') == [{"c": 1.2}] with pytest.raises( ValueError, match="Expected JSON to be parsed as a list got <class 'dict'>" ): json_loads_array("{}") with pytest.raises( ValueError, match="Expected JSON to be parsed ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_loads_an_array_json_file(self):\n from test.resources import array_json\n self.assertEqual(array_json._data, [1, 2, 3])\n self.assertEqual(len(array_json), 3)\n self.assertEqual(array_json[0], 1)", "def test_load_json_array_data(tmp_path: Path) -> None:\n fname = tmp_path ...
[ "0.77304274", "0.725045", "0.67286676", "0.67286676", "0.66942936", "0.667589", "0.6655001", "0.65915096", "0.6579132", "0.65585667", "0.64578795", "0.6457878", "0.64489824", "0.6448039", "0.6438813", "0.6417333", "0.6408036", "0.6396981", "0.6394695", "0.6379384", "0.6376763...
0.8247545
0
Test json_loads_object validates result.
def test_json_loads_object() -> None: assert json_loads_object('{"c":1.2}') == {"c": 1.2} with pytest.raises( ValueError, match="Expected JSON to be parsed as a dict got <class 'list'>" ): json_loads_object("[]") with pytest.raises( ValueError, match="Expected JSON to be parsed a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_simplef(self):\n samp1 = JObject(keys = ['status', 'result'])\n j = json.loads('{\"status\": \"success\", \"resultd\": \"yes\"}')\n self.assertFalse(check_json_object(j, samp1))", "def test_simple(self):\n samp1 = JObject(keys = ['status', 'result'])\n j = json.loads('...
[ "0.7466225", "0.7436751", "0.7261869", "0.7108797", "0.707524", "0.7068392", "0.7052709", "0.69498384", "0.6922862", "0.68458074", "0.679536", "0.6768142", "0.674017", "0.6738646", "0.66757935", "0.66757935", "0.66631764", "0.66617775", "0.66461724", "0.65988183", "0.6568571"...
0.8140474
0
Test deprecated test_find_unserializable_data logs a warning.
async def test_deprecated_test_find_unserializable_data( caplog: pytest.LogCaptureFixture, ) -> None: # pylint: disable-next=hass-deprecated-import,import-outside-toplevel from homeassistant.util.json import find_paths_unserializable_data find_paths_unserializable_data(1) assert ( "uses fin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_serialize_no_metadata(self):\n pass # pragma: no cover", "def test_serialize_sinfo(self):\n self.assert_raises(RuntimeError, self.instance.serialize,\n self.testing_options['objects'][0],\n add_serializer_info=True)", "def test_ignore_...
[ "0.64343673", "0.6035663", "0.5727462", "0.57251585", "0.5675099", "0.5574621", "0.551062", "0.54578316", "0.5383934", "0.5342037", "0.53340733", "0.5258394", "0.52225083", "0.5216664", "0.5208067", "0.5180121", "0.51705754", "0.5160198", "0.5145018", "0.5122322", "0.5117121"...
0.69288146
0
Test deprecated save_json logs a warning.
async def test_deprecated_save_json( caplog: pytest.LogCaptureFixture, tmp_path: Path ) -> None: # pylint: disable-next=hass-deprecated-import,import-outside-toplevel from homeassistant.util.json import save_json fname = tmp_path / "test1.json" save_json(fname, TEST_JSON_A) assert "uses save_js...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write(obj):\n import warnings\n warnings.warn(\"simplejson.dumps(s) should be used instead of write(s)\",\n DeprecationWarning)\n return dumps(obj)", "def test_save_json_with_invalid_step(temp_dir):\n data = json.dumps({\"k\": \"v\", \"list\": [1, 2, 3]})\n\n with pytest.raises(ValueErr...
[ "0.6194405", "0.5898329", "0.58882964", "0.5858988", "0.58045053", "0.5784072", "0.56817424", "0.567576", "0.56687623", "0.5630771", "0.5492047", "0.5476971", "0.54741037", "0.5469141", "0.54161847", "0.54124707", "0.53882706", "0.5366019", "0.53471386", "0.53345484", "0.5328...
0.7213232
0
Filter subreads from input_fofn using pls2fasta, and create all_reads_fasta.
def _filter_subreads(self): logging.info("Start to filter subreads in fofn.") if op.exists(self.ori_all_reads_fasta) and self.force_redo is not True: msg = "{fa} already exists, skip pls2fasta".format(fa=self.ori_all_reads_fasta) logging.warn(msg) else: loggin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_reads(alignment_file, readdb, read_dirs, quality_threshold=7, recursive=False, trim=False):\n assert alignment_file.endswith(\"bam\"), \"Alignment file must be in BAM format: {}\".format(alignment_file)\n # grab aligned segment\n if trim:\n assert isinstance(trim, int), \"Trim needs to b...
[ "0.59555817", "0.5874914", "0.5856849", "0.57773864", "0.5676103", "0.5649386", "0.56342393", "0.55829614", "0.5536078", "0.55328315", "0.54585654", "0.5444906", "0.5354874", "0.5350444", "0.53398484", "0.53377277", "0.5320953", "0.5305111", "0.52870345", "0.5270289", "0.5247...
0.79045886
0
Return tmp file for all_reads_fasta.
def tmp_all_reads_fasta(self): return op.join(self.out_dir, "all_reads.fasta.tmp")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rc_all_reads_fasta(self):\n return op.join(self.out_dir, \"rc_all_reads.fasta\")", "def ori_all_reads_fasta(self):\n return op.join(self.out_dir, \"all_reads.fasta.ori\")", "def createSequenceFile(sequences, tmpDir, filename='seq.fa'):\n seqfile = os.path.join(tmpDir, filename)\n with o...
[ "0.6950289", "0.65887046", "0.6245512", "0.6187316", "0.60011536", "0.60011536", "0.59201795", "0.59051627", "0.58881676", "0.58435273", "0.57945323", "0.5721843", "0.571925", "0.57050365", "0.5691162", "0.5662805", "0.56540394", "0.5609064", "0.5592718", "0.55707186", "0.555...
0.87710905
0
Return palindrome reads to palindrome_subreads.fasta.
def palindrome_reads_fasta(self): return op.join(self.out_dir, "palindrome_subreads.fasta")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _split_palindrome(self):\n if not op.exists(self.sdp_out_file) or self.force_redo is True:\n self._self_align()\n\n logging.debug(\"Parsing sdp and detect plindrome reads\")\n split_table = {}\n with SDPReader(self.sdp_out_file) as reader:\n for sdp in reader:\...
[ "0.7124422", "0.64792925", "0.6309654", "0.6244965", "0.61357105", "0.605843", "0.6032168", "0.5964192", "0.57816607", "0.5762167", "0.5736995", "0.5725491", "0.5662916", "0.5592227", "0.5575531", "0.55341953", "0.5533105", "0.5491442", "0.5485938", "0.5482197", "0.5467225", ...
0.89094687
0
Call SDPMatcher to align every read to its reverse complementary reads.
def _self_align(self): logging.info("Splitting palindrome.") logging.debug("Making reverse complement sequences of reads in " + "{i} to {o}".format(i=self.ori_all_reads_fasta, o=self.rc_all_reads_fasta)) num_reads = revcmp_fasta(sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _split_palindrome(self):\n if not op.exists(self.sdp_out_file) or self.force_redo is True:\n self._self_align()\n\n logging.debug(\"Parsing sdp and detect plindrome reads\")\n split_table = {}\n with SDPReader(self.sdp_out_file) as reader:\n for sdp in reader:\...
[ "0.6444837", "0.5993634", "0.59170055", "0.5713154", "0.569583", "0.564132", "0.56328523", "0.552024", "0.5510628", "0.55094206", "0.54319066", "0.5429327", "0.5372529", "0.5343879", "0.5330321", "0.5324704", "0.52589524", "0.52114356", "0.51807946", "0.5178548", "0.51682466"...
0.656948
0
There exist some chimeric reads in which adapters are either missing or not recognizable. These are called palindrome reads conform to the
def _split_palindrome(self): if not op.exists(self.sdp_out_file) or self.force_redo is True: self._self_align() logging.debug("Parsing sdp and detect plindrome reads") split_table = {} with SDPReader(self.sdp_out_file) as reader: for sdp in reader: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_palindrome():", "def test_process_barcode_paired_end_data_orientation_reverse_in_read1(\r\n self):\r\n\r\n fastq1_data = [\"HWI-ST830\", \"ATCGATCGATCGATCGATCG\",\r\n np.arange(3, 23, dtype=np.int8)]\r\n fastq2_data = [\"HWI-ST830\", \"GGTTCCAA\", np.arang...
[ "0.6330099", "0.5880869", "0.58668864", "0.58557117", "0.5848267", "0.5844541", "0.5809427", "0.57850903", "0.57663035", "0.57657886", "0.57587874", "0.57221115", "0.5686201", "0.5674231", "0.56126064", "0.5611727", "0.5600394", "0.5596763", "0.55905193", "0.5541581", "0.5536...
0.6142979
1
Detach the hidden state, and optionally zero the hidden data
def detach_hidden(self, zero=False): if zero: self.hidden = self._make_hidden(self.batch_size) else: self.hidden[0].detach()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def detach_hidden(self, zero=False):\n if zero:\n self.hidden = self._make_hidden(self.batch_size)\n else:\n self.hidden = self.hidden.detach()", "def reset_hidden(hidden, mask):\n if len(mask) != 0:\n hidden[:, mask, :] = 0\n \n ...
[ "0.81687796", "0.7248448", "0.69499934", "0.6717769", "0.669204", "0.6651705", "0.6403011", "0.6300455", "0.6255132", "0.62323743", "0.62123096", "0.61785233", "0.6158845", "0.61502695", "0.6142751", "0.61369663", "0.6118904", "0.6113743", "0.60545844", "0.6038087", "0.598468...
0.8106021
1
Detach the hidden state, and optionally zero the hidden data
def detach_hidden(self, zero=False): if zero: self.hidden = self._make_hidden(self.batch_size) else: self.hidden = self.hidden.detach()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def detach_hidden(self, zero=False):\n if zero:\n self.hidden = self._make_hidden(self.batch_size)\n else:\n self.hidden[0].detach()", "def reset_hidden(hidden, mask):\n if len(mask) != 0:\n hidden[:, mask, :] = 0\n \n return hid...
[ "0.8106021", "0.7248448", "0.69499934", "0.6717769", "0.669204", "0.6651705", "0.6403011", "0.6300455", "0.6255132", "0.62323743", "0.62123096", "0.61785233", "0.6158845", "0.61502695", "0.6142751", "0.61369663", "0.6118904", "0.6113743", "0.60545844", "0.6038087", "0.598468"...
0.81687796
0
No. 1 tests collection for MedicinalProductInteraction.
def test_medicinalproductinteraction_1(base_settings): filename = ( base_settings["unittest_data_dir"] / "medicinalproductinteraction-example.json" ) inst = medicinalproductinteraction.MedicinalProductInteraction.parse_file( filename, content_type="application/json", encoding="utf-8" ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_visualize_equipment(self):\n pass", "def test_intercommunalitys_get(self):\n pass", "def test_intent_classifier_get_details_all(self):\n pass", "def test_get_scenarios(self):\n pass", "def test_intent_classifier_get_details(self):\n pass", "def test_intent_clas...
[ "0.62932193", "0.60196525", "0.6018355", "0.5950828", "0.5924243", "0.59123635", "0.5907507", "0.5899704", "0.58986557", "0.58589035", "0.5851156", "0.5851156", "0.58460665", "0.5829347", "0.58013", "0.57753193", "0.5757767", "0.5756155", "0.5752222", "0.57447743", "0.5725009...
0.7485463
0
Main inference function. Given data loaders, output the main attributes from the model.
def inference(self): for partition, loader in self.loaders.items(): avg_loss, (y, y_hat), post, attentions, tags = self.eval_loader( loader) self.preds[partition] = { 'tag': tags, 'y': y, 'y_hat': y_hat, # 'posteriors': post, # 'attentions': attentions }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inference(model, data, diagnostics, seed, extra_fitting_args):\n pass", "def inference(self, dataset, model_dir):\n raise NotImplementedError", "def inference(self, data_loader):\n\n # Handling inference for Multiclass classification\n outputs_list = []\n with torch.no_grad()...
[ "0.7079301", "0.69063145", "0.68889844", "0.6414583", "0.63948715", "0.6255342", "0.62492347", "0.6212708", "0.61944205", "0.617807", "0.6174323", "0.6170213", "0.6147475", "0.6098715", "0.609512", "0.60736245", "0.6059464", "0.6036302", "0.6023182", "0.59940803", "0.5947019"...
0.6913925
1
Returns the global maximum value and position.
def globalMaximum(self): # The global maximum is at one peak's position potential_max = list() for func, pos, height, width in zip(self.peaks_function, self.peaks_position, self.peaks_height, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_max_position(self):\n raise NotImplementedError()", "def max_position(self):\n raise NotImplementedError", "def max_positions(self):\n return self.args.max_positions", "def get_max(self):\n return self.max[-1]", "def max(self):\n assert self.__stack\n retur...
[ "0.75708455", "0.7472142", "0.7386652", "0.73621035", "0.735912", "0.7274368", "0.72637445", "0.7262161", "0.7253182", "0.72366637", "0.72155946", "0.71909815", "0.7190395", "0.71811473", "0.71685374", "0.7157625", "0.71497184", "0.7140186", "0.7138031", "0.7129402", "0.71283...
0.81460285
0
Returns all visible maximums value and position sorted with the global maximum first.
def maximums(self): # The maximums are at the peaks position but might be swallowed by # other peaks maximums = list() for func, pos, height, width in zip(self.peaks_function, self.peaks_position, se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def globalMaximum(self):\n # The global maximum is at one peak's position\n potential_max = list()\n for func, pos, height, width in zip(self.peaks_function,\n self.peaks_position,\n self.peaks_height,\n ...
[ "0.6995808", "0.68941957", "0.66584855", "0.6647283", "0.6497538", "0.6467697", "0.63477576", "0.6342275", "0.6313204", "0.6293297", "0.6282581", "0.6270059", "0.626008", "0.62317383", "0.62317383", "0.6225912", "0.622096", "0.6213579", "0.6213579", "0.6213579", "0.6201832", ...
0.7002531
0
Order the peaks to change position, height, width and number.
def changePeaks(self): # Change the number of peaks if self.minpeaks is not None and self.maxpeaks is not None: npeaks = len(self.peaks_function) u = self.random.random() r = self.maxpeaks - self.minpeaks if u < 0.5: # Remove n peaks or les...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _layout(self):\n top = 2.0\n y = 0.0\n x = 0.0\n maxend = 0.0\n for track in self._tracks:\n track.set_view(self.view.species, self.view.seqname, \n self.view.start, self.view.end)\n tracksize = track.get_size()\n y -=...
[ "0.5916728", "0.56701946", "0.5532572", "0.54608786", "0.5455434", "0.5438626", "0.5307399", "0.52490765", "0.5241294", "0.5218205", "0.52033854", "0.5194276", "0.5190472", "0.5177038", "0.517002", "0.51685995", "0.51646316", "0.5159973", "0.51592517", "0.51470447", "0.514527...
0.6554263
0
Open the self.dev PyEZ Device instance.
def open(self): # Move all of the connection arguments into connect_args connect_args = {} # check for mode if self.get_option('port') is None: if self.get_option('mode') == 'telnet': connect_args['port'] = 23 elif self.get_option('mode') == 'seri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_device_dialog(self):\n res, device = DeviceDialog.get_device(self.indexer)\n if res and device:\n self.serial = device.serial\n if self.serial:\n caps_str = None\n self.open_device(self.serial, caps_str)", "def open(self) -> None:\n ...
[ "0.6904389", "0.68133426", "0.67640007", "0.6750752", "0.65204847", "0.64496225", "0.6357437", "0.62946606", "0.6099149", "0.6057723", "0.60555756", "0.6051541", "0.5988858", "0.5986539", "0.59722483", "0.5957039", "0.5942295", "0.59388256", "0.59096193", "0.5903228", "0.5808...
0.694745
0
Get the capabilities for network api..
def get_capabilities(self): return json.dumps({'network_api': 'pyez'})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __get_capability(self):\n requests = self.__get_capability_request()\n exception = self.__get_capability_exception()\n layers = self.__get_capability_layer()\n \n capability = { \"requests\": requests,\n \"exception\" : exception,\n ...
[ "0.732674", "0.7316955", "0.7160758", "0.70745724", "0.7045996", "0.6886132", "0.6836141", "0.68084925", "0.67257965", "0.6713764", "0.6674197", "0.66370296", "0.6603681", "0.6588467", "0.6588442", "0.65790033", "0.6574301", "0.6511568", "0.649308", "0.64927596", "0.64711374"...
0.79206073
0
Get chassis inventory details from the device.
def get_chassis_inventory(self): resp = self.dev.rpc.get_chassis_inventory() return etree.tostring(resp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_inventory(self):\n raise NotImplementedError(\"Subclasses define what returning the inventory entails\")", "def list_chassis(self):\n return self.ironic_client.chassis.list()", "def inventory(self):\n return self._inventory", "def inventory(self):\n data = self.client.inve...
[ "0.65856266", "0.6535421", "0.64895856", "0.6437434", "0.6413848", "0.62109286", "0.6195449", "0.6156714", "0.615364", "0.6138173", "0.5979466", "0.58476555", "0.58304507", "0.5812715", "0.57982266", "0.5759065", "0.57481444", "0.574362", "0.57305074", "0.57303625", "0.571804...
0.82395315
0
Get re name from the device.
def get_re_name(self): return self.dev.re_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self.device.device_data[self.device_id]['name']", "def name(self):\n return f\"{get_device_name(self._data, 0, self._name)}\"", "def name(self):\n return self._device.name", "def name(self):\n return self._device.name", "def name(self):\n return s...
[ "0.7746113", "0.7704492", "0.7679899", "0.7679899", "0.7679899", "0.76730424", "0.763995", "0.7550984", "0.73723626", "0.7287189", "0.72534335", "0.72094625", "0.719057", "0.7172307", "0.7141149", "0.7137775", "0.7114999", "0.7103347", "0.6995812", "0.69910777", "0.69866925",...
0.81063586
0
send set chassis cluster enable rpc to the device.
def set_chassis_cluster_enable(self, cluster_id, node_id): return self.dev.rpc.set_chassis_cluster_enable( cluster_id=cluster_id, node=node_id, reboot=True, normalize=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def enable(self, **kwargs) -> None: # pylint: disable=unused-argument\r\n await self.set_ena(True)", "def enable(self):\n try:\n self.bus.open(self.BUS_NUMBER)\n self.write(AntennaDeployerCommand.ARM_ANTS, 0x00)\n self.bus.close()\n return True\n ...
[ "0.64136285", "0.63151765", "0.6265535", "0.62011963", "0.5983005", "0.5968258", "0.591594", "0.58644897", "0.5831258", "0.58006275", "0.5789824", "0.5748024", "0.5725565", "0.5712674", "0.5682932", "0.5681965", "0.5678034", "0.5669555", "0.5667108", "0.5664479", "0.5662961",...
0.7949058
0
send set chassis cluster disable rpc to the device.
def set_chassis_cluster_disable(self): return self.dev.rpc.set_chassis_cluster_disable( reboot=True, normalize=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_chassis_cluster_enable(self, cluster_id, node_id):\n return self.dev.rpc.set_chassis_cluster_enable(\n cluster_id=cluster_id, node=node_id,\n reboot=True, normalize=True)", "def do(self):\n this_server = TangoServerHelper.get_instance()\...
[ "0.6368087", "0.63586265", "0.5982028", "0.59609485", "0.5881299", "0.5879154", "0.585808", "0.58371866", "0.58231795", "0.5772776", "0.5765652", "0.57600576", "0.57569", "0.57289124", "0.57201433", "0.5612662", "0.55817485", "0.5572804", "0.55690765", "0.55593354", "0.555630...
0.8469492
0
invoke jsnapy for persistent connection.
def invoke_jsnapy(self, data, action): try: self.queue_message("vvvv", "Creating jnpr.jsnapy.SnapAdmin instance.") jsa = jnpr.jsnapy.SnapAdmin() self.queue_message("vvvv", 'Executing %s action.' % action) if action == 'check': responses = jsa.check...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect_to_master():", "def connect():", "def _connect_to_rdr_replica(self):\n self.gcp_env.activate_sql_proxy(replica=True)\n self.db_conn = self.gcp_env.make_mysqldb_connection()", "def connect(dbapi_connection, connection_record):\n connection_record.info['pid'] = os.getpid()", "def...
[ "0.5772906", "0.5252777", "0.5099669", "0.50921255", "0.4938454", "0.49262697", "0.4921192", "0.4911013", "0.48786032", "0.48148036", "0.47887895", "0.47836024", "0.47610974", "0.47570044", "0.47287473", "0.47155914", "0.46973544", "0.46935", "0.46934238", "0.46922463", "0.46...
0.52720755
1
Rollback the device configuration to the specified id. Rolls back the configuration to the specified id. Assumes the configuration is already opened. Does NOT commit the configuration.
def rollback_configuration(self, id): if self.dev is None or self.config is None: raise AnsibleError('The device or configuration is not open.') if id == 'rescue': self.queue_message("log", "Rolling back to the rescue configuration.") try: self.config...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def savepoint_rollback(self, id):\n self.execute(\"ROLLBACK TO SAVEPOINT {}\".format(id))", "def rollback_workflow(self, execution_id):\n raise NotImplementedError", "def rollback(self):\n if self._transaction is None:\n raise TransactionNotStartedError(\"Cannot call rollbac...
[ "0.6042772", "0.5595296", "0.55862564", "0.55803925", "0.5574582", "0.5410788", "0.5168469", "0.51220083", "0.50194913", "0.49942717", "0.49847025", "0.49685273", "0.49579942", "0.49227747", "0.48944387", "0.4886762", "0.48730212", "0.48716104", "0.48346812", "0.4829784", "0....
0.8159079
0
Check the candidate configuration. Assumes the configuration is already opened. Performs the equivalent of a "commit check", but does NOT commit the configuration.
def check_configuration(self): try: self.config.commit_check() self.queue_message("log", "Configuration checked.") except (self.pyez_exception.RpcError, self.pyez_exception.ConnectError) as ex: raise AnsibleError('Failure checking the configuraton: %s'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_configuration(self):\n self.ensure_one()\n getattr(self, '%s_check_configuration' % self.provider, lambda: None)()", "def check_config(cfg):", "def check_config():\n\n if not config_instance:\n LOG.error(\"Failed to load the config!\")\n sys.exit(9)\n\n if not hasatt...
[ "0.66688347", "0.6636353", "0.66157126", "0.65205115", "0.6457699", "0.63909507", "0.63631624", "0.62421334", "0.6215764", "0.59953415", "0.59659874", "0.5956047", "0.59328073", "0.5863985", "0.5859425", "0.5851761", "0.58481836", "0.58206636", "0.5782035", "0.5770281", "0.57...
0.7320109
0
The possible initial states warped walkers may assume.
def initial_states(self): return self._initial_states
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_initial_states(self):\n raise NotImplementedError()", "def initial_state(self):\n return 0", "def iter_initial_states(self):\n from six.moves import filter\n return filter(lambda s:s.is_initial, self.iter_states())", "def states_initial(self):\n return self.states(\...
[ "0.6536528", "0.63338894", "0.6325197", "0.6295865", "0.61272234", "0.6122794", "0.608243", "0.6061773", "0.60178685", "0.59641576", "0.5951884", "0.59460944", "0.59215546", "0.5918401", "0.5916066", "0.5902502", "0.589962", "0.58667886", "0.5859815", "0.5859748", "0.5859748"...
0.64018655
1
The indices of the atom positions in the state considered the ligand.
def ligand_idxs(self): return self._ligand_idxs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def atom_idxs(self):\n\n return np.array([atom.atom_idxs for atom in self])", "def getLandmarkindices(self):\n return self.subsetnodes_indices", "def getLandmarkindices(self):\n return self.subsetindices", "def extract_ligand_indexes(traj, ligand):\n ligand_indexes = []\n for resid...
[ "0.7631998", "0.7395858", "0.7285203", "0.7201684", "0.69681764", "0.6946488", "0.6833295", "0.6828469", "0.6820649", "0.67353374", "0.66252863", "0.6587609", "0.6586959", "0.65467286", "0.653346", "0.6422198", "0.64164", "0.6409819", "0.6397331", "0.6265197", "0.62486005", ...
0.8726919
0
The indices of the atom positions in the state considered the receptor.
def receptor_idxs(self): return self._receptor_idxs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def atom_idxs(self):\n\n return np.array([atom.atom_idxs for atom in self])", "def get_indices(self):\r\n return self._indices", "def getIndices(self):\r\n return self._indices", "def occ_indices(self):\n indices = []\n for index,item in enumerate(self):\n if ite...
[ "0.82382464", "0.727947", "0.7218753", "0.7151456", "0.7083873", "0.6969181", "0.6967562", "0.68910456", "0.6889587", "0.6860909", "0.6848452", "0.6824074", "0.67979336", "0.6595159", "0.65589255", "0.6538948", "0.65247905", "0.65097815", "0.6502098", "0.6494767", "0.64834356...
0.8276405
0
The method that must be implemented in nonabstract subclasses. Should decide if a walker should be warped or not and what its progress is regardless.
def _progress(self, walker): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def walk(self):\r\n return not not self.prototype.walk", "def _warp(self, walker):\n\n\n # choose a state randomly from the set of initial states\n target_idx = np.random.choice(range(len(self.initial_states)), 1,\n p=self.initial_weights/np.sum(self.initial_...
[ "0.5694468", "0.5546899", "0.5413223", "0.5394204", "0.53752905", "0.52860034", "0.52287936", "0.5194105", "0.5181029", "0.51800656", "0.5109089", "0.50865793", "0.5069367", "0.5034896", "0.49629974", "0.49596345", "0.49489784", "0.4874057", "0.48161283", "0.48133498", "0.480...
0.5744697
0
Perform the warping of a walker. Chooses an initial state to replace the walker's state with according to it's given weight. Returns a walker of the same type and weight.
def _warp(self, walker): # choose a state randomly from the set of initial states target_idx = np.random.choice(range(len(self.initial_states)), 1, p=self.initial_weights/np.sum(self.initial_weights))[0] warped_state = self.initial_states[target_idx] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build(self, w=1):\n states = self.a.states.values()\n reachedStates = set()\n remainingStates = set()\n\n _open = Heap()\n\n for s in states:\n if s.acceptingFunction is not None:\n s.h = 0\n _open.push(0, s)\n reachedSt...
[ "0.5691519", "0.5282371", "0.523244", "0.52236164", "0.5166298", "0.5165015", "0.5163046", "0.51418316", "0.5122877", "0.50620407", "0.5039045", "0.5032708", "0.5029594", "0.5018036", "0.50139284", "0.497852", "0.49433792", "0.49433264", "0.4927654", "0.49240887", "0.48710394...
0.79330695
0
Test the progress of all the walkers, warp if required, and update the boundary conditions. Arguments
def warp_walkers(self, walkers, cycle): new_walkers = [] # sporadic, zero or many records per call warp_data = [] bc_data = [] # continual, one record per call progress_data = defaultdict(list) # calculate progress data all_progress_data = [self._progr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_bc(self, new_walkers, warp_data, progress_data, cycle):\n\n # Only report a record on\n # the first cycle which gives the distance at which walkers\n # are warped\n if cycle == 0:\n return [{'boundary_distance' : np.array([self._cutoff_distance]),},]\n else...
[ "0.60423297", "0.5936672", "0.5913109", "0.5713147", "0.57058764", "0.56307214", "0.56240726", "0.5593375", "0.55728346", "0.5571248", "0.556696", "0.55633765", "0.55494684", "0.55380464", "0.5494036", "0.5490094", "0.5489748", "0.5474049", "0.5456332", "0.5423952", "0.539291...
0.65448344
0
Tests whether a warping record generated by this class is discontinuous or not.
def warping_discontinuity(cls, warping_record): # if it is Ellipsis then all possible values are discontinuous if cls.DISCONTINUITY_TARGET_IDXS is Ellipsis: return True # if it is None then all possible values are continuous elif cls.DISCONTINUITY_TARGET_IDXS is None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isDisturbance(self):\n return False", "def is_disarming(self):\n return self == ArmingState.DISARMING", "def is_inequality(self):\n return False", "def is_inequality(self): \n return False", "def violated(self) -> bool:\n ...", "def isDisturbance(self):\n ...
[ "0.6019516", "0.58300686", "0.5823266", "0.58221227", "0.5780994", "0.57764226", "0.56322896", "0.562625", "0.562625", "0.5590142", "0.557394", "0.55690134", "0.5565335", "0.5565335", "0.55490774", "0.55443126", "0.55276537", "0.5511996", "0.54868835", "0.5474168", "0.5464244...
0.7393263
0
The cutoff RMSD for considering a walker bound.
def cutoff_rmsd(self): return self._cutoff_rmsd
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cutoff_distance(self):\n return self._cutoff_distance", "def getCutoffDistance(self):\n return self.cutoffDistance", "def _find_cutoff(self):\n cutoff = 1\n while ((self.linear_rstar_unnorm(cutoff) -\n self.turing_rstar_unnorm(cutoff))**2\n > self.a...
[ "0.68994784", "0.684816", "0.6659511", "0.63361603", "0.6224314", "0.610096", "0.60006905", "0.5984938", "0.5863935", "0.5832403", "0.5760526", "0.5737055", "0.5589224", "0.55820787", "0.5528107", "0.5526099", "0.5503479", "0.5474288", "0.5471942", "0.54236096", "0.5419457", ...
0.7921369
0
The indices of the atom positions in the state considered the binding site.
def binding_site_idxs(self): return self._receptor_idxs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def atom_idxs(self):\n\n return np.array([atom.atom_idxs for atom in self])", "def agent_locs_idx(self):\n return tuple(self.agent_locs.T)", "def get_indices(self):\r\n return self._indices", "def getIndices(self):\r\n return self._indices", "def indices(self):\n i, j, _e...
[ "0.7762307", "0.73607725", "0.7259929", "0.7114606", "0.7097203", "0.7028722", "0.6852481", "0.6815367", "0.67249656", "0.6657523", "0.6605119", "0.6554097", "0.65420175", "0.65259284", "0.6498936", "0.64765036", "0.6446694", "0.6387674", "0.63860303", "0.63356364", "0.629407...
0.7760267
1
Minmin distance for a walker.
def _calc_min_distance(self, walker): cell_lengths, cell_angles = box_vectors_to_lengths_angles(walker.state['box_vectors']) t2 = time.time() # make a traj out of it so we can calculate distances through # the periodic boundary conditions walker_traj = mdj.Trajectory(walker.sta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_min_distance():\n return np.argmin(d)", "def _minimum_distance(self,arg):\n return min([abs(arg-e) for e in self if not e is arg])", "def min_distance(distance, spt_set, self_nodes):\n minimum = sys.maxsize\n minimum_node = None\n for curr_node in self_nodes....
[ "0.73179567", "0.72875845", "0.72847605", "0.71689516", "0.7112868", "0.6957201", "0.68769455", "0.6720647", "0.67204887", "0.67204887", "0.6690567", "0.6615009", "0.6576083", "0.65604377", "0.6559518", "0.65405184", "0.649975", "0.64913887", "0.6486688", "0.6473945", "0.6455...
0.7929464
0
Calculate whether a walker has unbound and also provide a dictionary for a single walker in the progress records.
def _progress(self, walker): min_distance = self._calc_min_distance(walker) # test to see if the ligand is unbound unbound = False if min_distance >= self._cutoff_distance: unbound = True progress_data = {'min_distances' : min_distance} return unbound, pro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _progress(self, walker):\n\n # first recenter the ligand and the receptor in the walker\n box_lengths, box_angles = box_vectors_to_lengths_angles(walker.state['box_vectors'])\n grouped_walker_pos = group_pair(walker.state['positions'], box_lengths,\n sel...
[ "0.5411492", "0.49769568", "0.47918302", "0.47679746", "0.47668457", "0.4766094", "0.47169706", "0.4641848", "0.45923612", "0.4586116", "0.45711255", "0.45584255", "0.45256615", "0.4499298", "0.44648027", "0.44494456", "0.44364905", "0.44351688", "0.44245186", "0.4407154", "0...
0.6793257
0
Add CORS header if the TabPy has attribute _cors_origin and _cors_origin is not an empty string.
def _add_CORS_header(self): origin = self.tabpy.get_access_control_allow_origin() if len(origin) > 0: self.set_header("Access-Control-Allow-Origin", origin) logger.debug("Access-Control-Allow-Origin:{}".format(origin)) headers = self.tabpy.get_access_control_allow_header...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_cors_header(resp):\n resp.headers['X-Content-Type-Options'] = os.environ.get(\"X_CONTENT_TYPE_OPTIONS\")\n resp.headers['Access-Control-Allow-Origin'] = os.environ.get(\"ACCESS_CONTROL_ALLOW_ORIGIN\")\n resp.headers['Access-Control-Allow-Headers'] = os.environ.get(\"ACCESS_CONTROL_ALLOW_HEADERS\")...
[ "0.7479771", "0.7410093", "0.7130474", "0.7120577", "0.7087482", "0.6989684", "0.6989684", "0.6969113", "0.69539034", "0.69539034", "0.6934905", "0.6931153", "0.6773808", "0.67104447", "0.67014056", "0.6693697", "0.6672938", "0.6642145", "0.6585849", "0.65656114", "0.6508159"...
0.8239014
0
asserts that the two tensors have nans in the same locations, and the nonnan elements all are close.
def _assert_allclose_with_nans(self, tensor1, tensor2): # Check nans are in the same place self.assertFalse( torch.any( # True if there's any mismatch torch.logical_xor( # True where either tensor1 or tensor 2 has nans, but not both (mismatch) torch.isna...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sa_allclose(self, a, b):\n for name in a.dtype.names:\n print(name, a[name], b[name])\n nan_mask_a = np.isnan(a[name])\n nan_mask_b = np.isnan(b[name])\n self.assertTrue(np.allclose(nan_mask_a, nan_mask_b))\n self.assertTrue(np.allclose(\n ...
[ "0.7419661", "0.7288233", "0.7000732", "0.6927218", "0.6881153", "0.6624811", "0.66094536", "0.64761245", "0.64403725", "0.64227897", "0.6385241", "0.6251182", "0.6232587", "0.6197191", "0.619503", "0.61666614", "0.61274195", "0.6125417", "0.612099", "0.6098439", "0.60977125"...
0.8152861
0
This endpoint saves stars on both employees (from and to).
def give_star_to(request, from_employee_id, to_employee_id): if from_employee_id == to_employee_id: content = {'detail': config.USER_UNABLE_TO_GIVE_STARS_ITSELF} return Response(content, status=status.HTTP_406_NOT_ACCEPTABLE) elif request.method == 'POST': # Set values from request.data ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def give_star_to_many(request, from_employee_id):\n if request.method == 'POST':\n serializer_bulk = StarBulkSerializer(data=request.data)\n errors = []\n stars_added = 0\n if serializer_bulk.is_valid():\n text = (request.data['text'] if 'text' in request.data.keys() else ...
[ "0.6868924", "0.6250418", "0.55197275", "0.5386975", "0.53556263", "0.5274113", "0.5269144", "0.51558644", "0.5138154", "0.5062679", "0.5037192", "0.4971181", "0.49530414", "0.49388695", "0.4928753", "0.4862501", "0.48402056", "0.48165706", "0.48164162", "0.48102924", "0.4807...
0.7238564
0
This endpoint saves stars on many employees.
def give_star_to_many(request, from_employee_id): if request.method == 'POST': serializer_bulk = StarBulkSerializer(data=request.data) errors = [] stars_added = 0 if serializer_bulk.is_valid(): text = (request.data['text'] if 'text' in request.data.keys() else None) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_stars():\n prod_id = int(request.vars.prod_id)\n logger.info(\"changing stars on prod_id {%s}\" %prod_id)\n rating = int(request.vars.rating)\n logger.info(\"auth.user from api: %s\"%auth.user.email )\n db.stars.update_or_insert(\n (db.stars.prod_id == prod_id) & (db.stars.user_email ...
[ "0.65493494", "0.6255241", "0.5915746", "0.58588463", "0.581408", "0.5757517", "0.5629571", "0.55980355", "0.5534477", "0.5484442", "0.5417349", "0.5381393", "0.53757095", "0.5244011", "0.5242649", "0.5189538", "0.51865286", "0.5157941", "0.5154189", "0.5085337", "0.5067989",...
0.66047436
0
Returns stars list from employee
def stars_employee_list(request, employee_id): if request.method == 'GET': employee = get_object_or_404(Employee, pk=employee_id) employee_stars = Star.objects.filter(to_user=employee) paginator = PageNumberPagination() results = paginator.paginate_queryset(employee_stars, request) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def listofstars():\n a = []\n for star in Star.select():\n a.append(star.name)\n return a", "def read_stars(self):\n if self.hip_stars: return\n all_stars = list(hipparcos.stars())\n self.hip_stars = [None]*(max(s[0] for s in all_stars)+1)\n for s in all_stars: self.hi...
[ "0.65949583", "0.59830517", "0.5790625", "0.5790625", "0.5762904", "0.57204705", "0.57030344", "0.5624437", "0.56211567", "0.56128275", "0.5539449", "0.54814416", "0.54640126", "0.54514897", "0.5410562", "0.5351911", "0.5337319", "0.5314365", "0.52982193", "0.52729607", "0.52...
0.6991311
0
Returns stars list from employee grouped by categories
def stars_employee_list_group_by_category(request, employee_id): if request.method == 'GET': employee = get_object_or_404(Employee, pk=employee_id) employee_stars = Star.objects.filter(to_user=employee).values( 'category__pk', 'category__name').annotate(num_stars=Count('categ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stars_employee_list_group_by_category_detail(request, employee_id, category_id):\n if request.method == 'GET':\n employee = get_object_or_404(Employee, pk=employee_id)\n category = get_object_or_404(Category, pk=category_id)\n stars = Star.objects.filter(to_user=employee, category=categ...
[ "0.7007525", "0.59851885", "0.5556762", "0.55023956", "0.5407123", "0.5271068", "0.5266676", "0.5217127", "0.51259863", "0.5058241", "0.5042192", "0.49784303", "0.49537513", "0.49003536", "0.48288986", "0.4767216", "0.47545198", "0.4754141", "0.47451153", "0.4737546", "0.4733...
0.7557061
0
Returns stars list detail from employee divided by category
def stars_employee_list_group_by_category_detail(request, employee_id, category_id): if request.method == 'GET': employee = get_object_or_404(Employee, pk=employee_id) category = get_object_or_404(Category, pk=category_id) stars = Star.objects.filter(to_user=employee, category=category).orde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stars_employee_list_group_by_category(request, employee_id):\n if request.method == 'GET':\n employee = get_object_or_404(Employee, pk=employee_id)\n employee_stars = Star.objects.filter(to_user=employee).values(\n 'category__pk',\n 'category__name').annotate(num_stars=Co...
[ "0.7767644", "0.627831", "0.6173061", "0.61503166", "0.6051116", "0.5625467", "0.5144692", "0.51389676", "0.5044438", "0.50162166", "0.4995553", "0.49473953", "0.49473953", "0.4908418", "0.48810714", "0.4879202", "0.48721278", "0.48388222", "0.4828112", "0.48069254", "0.48045...
0.7837158
0
Returns stars list detail from employee divided by keyword
def stars_employee_list_group_by_keyword_detail(request, employee_id, keyword_id): if request.method == 'GET': employee = get_object_or_404(Employee, pk=employee_id) keyword = get_object_or_404(Keyword, pk=keyword_id) stars = Star.objects.filter(to_user=employee, keyword=keyword).order_by('-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stars_employee_list_group_by_keyword(request, employee_id):\n if request.method == 'GET':\n employee = get_object_or_404(Employee, pk=employee_id)\n employee_stars = Star.objects.filter(to_user=employee).values(\n 'keyword__pk',\n 'keyword__name').annotate(num_stars=Count...
[ "0.7377244", "0.71312815", "0.61359555", "0.6098041", "0.5693139", "0.5631095", "0.5615941", "0.55251753", "0.5348024", "0.52622336", "0.51969576", "0.4985614", "0.4914094", "0.48876992", "0.48755857", "0.48753193", "0.48228306", "0.48139346", "0.48138267", "0.48138267", "0.4...
0.7438995
0
Returns stars top {top_number} list according to {kind} (category, keyword) {id} (kind_id)
def stars_top_employee_lists(request, top_number, kind, id): try: if request.method == 'GET': if kind == 'category': top_list = Star.objects.filter(category__id=id).values( 'to_user__pk', 'to_user__username', 'to_user__f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_top_stars():\n topStars = {'1': {'amm': [{'name': 'G1_1', 'x': 2509.0, 'y': 555.0},\n {'name': 'G1_2', 'x': 2294.0, 'y': 1638.5}],\n 'ben': [{'name': 'G1_1', 'x': 2534.5, 'y': 563.5},\n {'name': 'G1_2', 'x': 2320.0, 'y': 1...
[ "0.60313934", "0.60311204", "0.5865894", "0.57242155", "0.56809145", "0.5665485", "0.56539917", "0.56519616", "0.56417096", "0.5641546", "0.5620258", "0.5525258", "0.5505354", "0.55012465", "0.54801244", "0.5477889", "0.54741967", "0.5462364", "0.5446692", "0.54427594", "0.54...
0.6483316
0
Returns stars list grouped by keyword or result list if you use ?search=
def stars_keyword_list(request): if request.method == 'GET': if request.GET.get('search'): search_term = request.GET.get('search') star_list = Star.objects.filter( Q(keyword__name__icontains=search_term)).values( 'keyword__pk', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stars_employee_list_group_by_keyword(request, employee_id):\n if request.method == 'GET':\n employee = get_object_or_404(Employee, pk=employee_id)\n employee_stars = Star.objects.filter(to_user=employee).values(\n 'keyword__pk',\n 'keyword__name').annotate(num_stars=Count...
[ "0.685482", "0.6766883", "0.6648922", "0.6097524", "0.5980909", "0.5949772", "0.57064515", "0.5693047", "0.5673603", "0.5615363", "0.55775267", "0.5569931", "0.5540077", "0.5528783", "0.5505158", "0.5449459", "0.54458284", "0.54412043", "0.54386306", "0.5397043", "0.5381772",...
0.78138244
0
Returns stars list detail for keyword id.
def stars_keyword_list_detail(request, keyword_id): if request.method == 'GET': keyword = get_object_or_404(Keyword, pk=keyword_id) stars = Star.objects.filter(keyword=keyword).values( 'to_user__pk', 'to_user__username', 'to_user__first_name', 'to_user...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stars_keyword_list(request):\n if request.method == 'GET':\n if request.GET.get('search'):\n search_term = request.GET.get('search')\n star_list = Star.objects.filter(\n Q(keyword__name__icontains=search_term)).values(\n 'keyword__pk',\n ...
[ "0.65570277", "0.6077957", "0.5929901", "0.52924275", "0.5283511", "0.5109503", "0.50915295", "0.5078839", "0.5013255", "0.50105697", "0.50094837", "0.5008347", "0.5002635", "0.49825704", "0.4980135", "0.49639466", "0.49519765", "0.48904246", "0.48874703", "0.48666564", "0.47...
0.7541413
0
This endpoint saves badge assignation to employee
def give_badge_to(request, badge_id, to_employee_id, from_employee_id): if to_employee_id == from_employee_id: content = {'detail': config.USER_UNABLE_TO_GIVE_BADGES_ITSELF} return Response(content, status=status.HTTP_406_NOT_ACCEPTABLE) elif request.method == 'POST': badge = get_object_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post(self):\n try:\n employee = self.service.add_employee(self.schema, request.json)\n except ValidationError as error:\n return error.messages, 400\n return self.schema.dump(employee), 201", "def post(self):\n data = EmployeeRegister.parser.parse_args()\n ...
[ "0.5923621", "0.5880477", "0.56466275", "0.56447726", "0.5616239", "0.55937636", "0.5498253", "0.5423412", "0.5403294", "0.5400293", "0.53704214", "0.5318688", "0.5316724", "0.5301786", "0.5289739", "0.52713543", "0.5261288", "0.5256878", "0.52554864", "0.5237651", "0.5233833...
0.72410214
0
Returns badge list from employee
def badges_employee_list(request, employee_id): if request.method == 'GET': employee = get_object_or_404(Employee, pk=employee_id) employee_bages = EmployeeBadge.objects.filter(to_user=employee) paginator = PageNumberPagination() results = paginator.paginate_queryset(employee_bages, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def employee_list_group_by_badges_detail(request, badge_id):\n if request.method == 'GET':\n badge = get_object_or_404(Badge, pk=badge_id)\n employee_list = EmployeeBadge.objects.filter(badge=badge).values(\n 'to_user__pk',\n 'to_user__username',\n 'to_user__first_...
[ "0.6881834", "0.66980416", "0.6510214", "0.61874956", "0.6009835", "0.5942125", "0.593319", "0.5839908", "0.5740555", "0.5684213", "0.5672405", "0.5652698", "0.56246674", "0.5577624", "0.5495039", "0.547461", "0.539064", "0.536127", "0.53156245", "0.52861315", "0.5280018", ...
0.74351066
0
Returns badge list with employee counter or result list if you use ?search=
def employee_list_group_by_badges(request): if request.method == 'GET': if request.GET.get('search'): search_term = request.GET.get('search') badge_list = EmployeeBadge.objects.filter( Q(badge__name__icontains=search_term)).values( 'badge__pk', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def badges_employee_list(request, employee_id):\n if request.method == 'GET':\n employee = get_object_or_404(Employee, pk=employee_id)\n employee_bages = EmployeeBadge.objects.filter(to_user=employee)\n paginator = PageNumberPagination()\n results = paginator.paginate_queryset(employ...
[ "0.6890771", "0.6407852", "0.57139814", "0.5629032", "0.558691", "0.5570377", "0.5480534", "0.5445521", "0.5406145", "0.5389485", "0.53879863", "0.5364861", "0.53562313", "0.5354165", "0.53436494", "0.5332263", "0.530441", "0.5293682", "0.5283176", "0.5282777", "0.5282735", ...
0.7933099
0
Returns employee list grouped by badge, you should provide badge_id
def employee_list_group_by_badges_detail(request, badge_id): if request.method == 'GET': badge = get_object_or_404(Badge, pk=badge_id) employee_list = EmployeeBadge.objects.filter(badge=badge).values( 'to_user__pk', 'to_user__username', 'to_user__first_name', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def employee_list_group_by_badges(request):\n if request.method == 'GET':\n if request.GET.get('search'):\n search_term = request.GET.get('search')\n badge_list = EmployeeBadge.objects.filter(\n Q(badge__name__icontains=search_term)).values(\n 'badg...
[ "0.76944005", "0.6957184", "0.611837", "0.56083935", "0.55651563", "0.5556811", "0.55224836", "0.54797256", "0.54534733", "0.54494524", "0.5444034", "0.5382721", "0.534674", "0.5346019", "0.53341836", "0.52874357", "0.5269832", "0.5198266", "0.51640195", "0.5162273", "0.51605...
0.7924092
0
Create a RegressionData object from sklearn estimator.
def from_sklearn(cls, estimator, feature_matrix, property_vector): return cls( module=estimator.__module__, estimator_name=estimator.__class__.__name__, feature_matrix=feature_matrix, property_vector=property_vector, parameters=estimator.get_params(), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, estimator, **kwargs):\n super(LogisticRegression, self).__init__(\n estimator, **kwargs)\n\n self.estimator = estimator", "def _load(cls,data:{}, X=None):\n estimator = cls()\n estimator.load_data(data=data)\n estimator.load_X(X=X)\n return ...
[ "0.61592203", "0.608703", "0.6083207", "0.6022593", "0.6017327", "0.59459114", "0.5923836", "0.5880928", "0.5872907", "0.5844896", "0.5699999", "0.56314605", "0.5628858", "0.5625192", "0.5571561", "0.5568077", "0.5566561", "0.5545005", "0.55440325", "0.5529227", "0.552391", ...
0.67040175
0
Get the ECI for the cluster expansion. This just divides coefficients by the corresponding multiplicities. External terms are dropped since their fitted coefficients do not represent ECI.
def eci(self): num_ext_terms = len(self._subspace.external_terms) # check for extra terms coefs = self.coefs[:-num_ext_terms] if num_ext_terms else self.coefs[:] eci = coefs.copy() eci = eci / self._subspace.function_total_multiplicities return eci
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eci(self):\n return self.__eci", "def get_Ec(self):\n return self.Ec", "def expansion(self, niters=-1):\n _cgco.gcoExpansion(self.handle, np.intc(niters), self.energyTempArray)\n return self._convertEnergyBack(self.energyTempArray[0])", "def get_E(J,k):\n E = -2 * J * np.co...
[ "0.6564559", "0.57694936", "0.5583941", "0.55318445", "0.5458844", "0.54127294", "0.5366535", "0.53557855", "0.53367984", "0.52990323", "0.5223814", "0.51811206", "0.51741844", "0.5160664", "0.5150545", "0.5145208", "0.51438606", "0.51201993", "0.51041776", "0.51036525", "0.5...
0.72708476
0
Get tuple of cluster interaction tensors. Tuple of ndarrays where each array is the interaction tensor for the corresponding orbit of clusters.
def cluster_interaction_tensors(self): interaction_tensors = (self.coefs[0],) + tuple( sum( m * self.eci[orbit.bit_id + i] * tensor for i, (m, tensor) in enumerate( zip(orbit.bit_combo_multiplicities, orbit.correlation_tensors) ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interactions(self) -> Sequence[Interaction[_C_out, Tuple[int,...]]]:\n return self._simulation.interactions", "def interactions(self) -> Sequence[Interaction[_C_out, _A_out]]:\n ...", "def interactions(self) -> Sequence[Interaction[_C_out,_A_out]]:\n return self._interactions", "def ...
[ "0.5650275", "0.5396234", "0.5260104", "0.52348673", "0.51911455", "0.5157701", "0.5040121", "0.50043637", "0.49888366", "0.496246", "0.49001786", "0.48809347", "0.4871462", "0.48085994", "0.47944516", "0.4790466", "0.47883955", "0.47878823", "0.4782386", "0.47713706", "0.475...
0.8034195
0
Get expansion structure. Prim structure with only sites included in the expansion (i.e. sites with partial occupancies)
def expansion_structure(self): return self.cluster_subspace.expansion_structure
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getExpansion(self, data):\n pass", "def test_get_systems_expanded(self):\n pass", "def get_expansion(block, expansion=None):\n if isinstance(expansion, int):\n assert expansion > 0\n elif expansion is None:\n if hasattr(block, 'expansion'):\n expansion = block.e...
[ "0.5775837", "0.5456535", "0.54396933", "0.5356344", "0.514245", "0.5062866", "0.5056621", "0.50404763", "0.49497902", "0.49316373", "0.49132568", "0.48724383", "0.48683625", "0.48390302", "0.48267677", "0.48048848", "0.4803488", "0.47871587", "0.47768342", "0.47751993", "0.4...
0.722945
0
Get Orbit ids corresponding to each ECI in the Cluster Expansion. If the Cluster Expansion includes external terms these are not included in the list since they are not associated with any orbit.
def eci_orbit_ids(self): return self._subspace.function_orbit_ids
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_electrode_indeces(electrical_series, electrode_ids):\n electrode_table_region = list(electrical_series.electrodes.to_dataframe().index)\n return [elect_idx for elect_idx, elect_id in enumerate(electrode_table_region) if elect_id in electrode_ids]", "def get_eids(self):\n return [d['eid'] for...
[ "0.58896", "0.5580595", "0.5454563", "0.54299253", "0.54212594", "0.54058343", "0.5400522", "0.5378499", "0.5372512", "0.53594655", "0.53535104", "0.53434646", "0.5342312", "0.5337998", "0.5327088", "0.53255314", "0.53094417", "0.5304125", "0.5278686", "0.52694434", "0.526722...
0.75284874
0
Calculate the cluster weights. The cluster weights are defined as the weighted sum of ECI squared, where the weights are the ordering multiplicities.
def effective_cluster_weights(self): weights = np.array( [ np.sum( self._subspace.function_ordering_multiplicities[ self._subspace.function_orbit_ids == i ] * self.eci[self.eci_orbit_ids == i] ** 2 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_clusterable_weights(self):\n raise NotImplementedError('Must be implemented in subclasses.')", "def compute_weights(self):\n\n # Init lists\n weights, weights_k_idx = [], []\n for i_order in range(self.n_orders): # For each orders\n\n weights_n, k_idx_n = self.get_w(i_...
[ "0.7190651", "0.70356905", "0.6451532", "0.6440331", "0.6369305", "0.63520586", "0.63319385", "0.62741387", "0.6229008", "0.6212792", "0.61735576", "0.61735576", "0.61735576", "0.61735576", "0.61735576", "0.613884", "0.61196315", "0.6102148", "0.6101437", "0.6101437", "0.6101...
0.82398254
0
Get the feature matrix used in fit. If not given, returns an identity matrix of len num_corrs
def feature_matrix(self): return self._feat_matrix
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matrix_features(self):\n return self._matrix_features", "def compute_feature_matrix(sequences, split, dinuc=False, model='cterm'):\n if model == 'cterm':\n X = compute_cterm_feature_matrix(sequences, split, dinuc=dinuc)\n else:\n X = compute_nterm_feature_matrix(sequences, split, d...
[ "0.5865127", "0.5651641", "0.55444366", "0.547327", "0.538161", "0.53447926", "0.52134264", "0.52046114", "0.51970637", "0.5180495", "0.5131346", "0.51012635", "0.5094566", "0.5063523", "0.50486535", "0.5048352", "0.503609", "0.5031869", "0.50282717", "0.5007706", "0.5006746"...
0.6299052
0
Compute the vector of cluster interaction values for given structure. A cluster interaction is simply a vector made up of the sum of all cluster expansion terms over the same orbit.
def cluster_interactions_from_structure( self, structure, normalized=True, scmatrix=None, site_mapping=None ): if scmatrix is None: scmatrix = self._subspace.scmatrix_from_structure(structure) occu = self.cluster_subspace.occupancy_from_structure( structure, scmatrix...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_interaction_tensors(self):\n interaction_tensors = (self.coefs[0],) + tuple(\n sum(\n m * self.eci[orbit.bit_id + i] * tensor\n for i, (m, tensor) in enumerate(\n zip(orbit.bit_combo_multiplicities, orbit.correlation_tensors)\n ...
[ "0.59573764", "0.56333023", "0.54057556", "0.53692955", "0.52924997", "0.51834893", "0.51754993", "0.5105054", "0.50476855", "0.5041256", "0.50108224", "0.50036925", "0.49943978", "0.49627247", "0.4951808", "0.49466053", "0.49453312", "0.4925825", "0.49249965", "0.4916185", "...
0.62799895
0
Remove fit coefficients or ECI's with small values. Removes ECI's and orbits in the ClusterSubspaces that have ECI/parameter values smaller than the given threshold. This will change the fits error metrics (i.e. RMSE) a little, but it should not be much. If they change a lot then the threshold used is probably too high...
def prune(self, threshold=0, with_multiplicity=False): coefs = self.eci if with_multiplicity else self.coefs bit_ids = [i for i, coef in enumerate(coefs) if abs(coef) < threshold] self.cluster_subspace.remove_corr_functions(bit_ids) # Update necessary attributes ids_complement =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trimCompo(self, threshold):\n newCompo = {}\n for key,value in self.m_compo.items():\n if value > threshold:\n newCompo[ key ] = value\n self.m_compo = newCompo", "def prune_outliers_from_dataset(datasets: tuple, threshold: float, verbose: bool) -> tuple:\n #...
[ "0.62536013", "0.57788783", "0.5763838", "0.5722056", "0.571018", "0.5643245", "0.5627789", "0.55441475", "0.5527665", "0.55141956", "0.5495865", "0.54696786", "0.5461309", "0.5422423", "0.53910226", "0.5389687", "0.53792", "0.5369068", "0.53648835", "0.5363127", "0.5340759",...
0.6851633
0
Set the orbit and cluster interaction data in evaluator.
def _set_evaluator_data(self, set_orbits=False): if set_orbits: self._subspace.evaluator.reset_data( get_orbit_data(self._subspace.orbits), self._subspace.num_orbits, self._subspace.num_corr_functions, ) flat_interaction_tensors = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, data):\n\n self.data = data\n self.calculator = Calculator(descriptors, ignore_3D=True)\n self.described_molecules = self.featurize()", "def __init__(self, synonyme_cache, intersection_cache, data, evaluator):\n self.SYNSET_CACHE = synonyme_cache\n self.INTER...
[ "0.57773596", "0.5721634", "0.56163263", "0.54464465", "0.54463744", "0.54107165", "0.5388258", "0.5385944", "0.5348698", "0.5345845", "0.52903944", "0.5274697", "0.52731305", "0.5257818", "0.5226652", "0.52054065", "0.5167687", "0.51592535", "0.515142", "0.51405585", "0.5131...
0.8182642
0
Create ClusterExpansion from serialized MSONable dict.
def from_dict(cls, d): reg_data_dict = deepcopy(d.get("regression_data")) if reg_data_dict is not None: reg_data_dict["feature_matrix"] = np.array( d["regression_data"]["feature_matrix"] ) reg_data_dict["property_vector"] = np.array( d[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy(self):\n return ClusterExpansion.from_dict(self.as_dict())", "def from_dict(cls, dikt) -> 'ShardingDescriptor':\n return util.deserialize_model(dikt, cls)", "def _from_string(cls, serialized):\r\n parse = cls.URL_RE.match(serialized)\r\n if not parse:\r\n raise I...
[ "0.5919251", "0.57916635", "0.56996584", "0.56544054", "0.54264385", "0.53941065", "0.5385412", "0.5363183", "0.52725023", "0.5242033", "0.52273315", "0.5222105", "0.52039033", "0.51954126", "0.5185823", "0.5161533", "0.51568764", "0.5140203", "0.5136915", "0.51132333", "0.51...
0.705797
0
Goes through all open orders on pair, figured out if they're in range, wipe and recreate if adjustment is needed
def manage_orders(self): for coin, pair_info in self.usdt_pairs.items(): orders = self.kc.get_orders(pair_info["symbol"], status="active") self.log(coin, orders["totalNum"]) if orders["totalNum"]: self.log(len(orders["items"])) for order ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def update_open_trades(self, pair: str):\n\n remove_indexes = []\n\n for index, trade in enumerate(self.trades[pair]['open']):\n if await self._handle_deferred_push(trade):\n remove_indexes.append(index)\n elif await self._handle_deferred_sell(trade):\n ...
[ "0.65187794", "0.5971989", "0.5893282", "0.5487122", "0.5485203", "0.5469665", "0.5453112", "0.5382519", "0.5372027", "0.5354412", "0.53433925", "0.5335271", "0.5335135", "0.532721", "0.5317983", "0.5316886", "0.53092206", "0.52989537", "0.52932405", "0.52614486", "0.52577066...
0.6033398
1
divides operand_1 by operand_2
def calc(operand_1, operand_2): return operand_1 / operand_2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc(operand_1, operand_2):\n return operand_1/operand_2", "def calc(operand_1, operand_2):\n return operand_1/operand_2", "def calc(operand_1, operand_2):\n return operand_1/operand_2", "def calc(operand_1, operand_2):\n\n return operand_1/operand_2", "def calc(operand_1, o...
[ "0.83308667", "0.83308667", "0.83308667", "0.8282008", "0.77688485", "0.74107593", "0.7272513", "0.721974", "0.71896094", "0.71896094", "0.716603", "0.7139801", "0.7103532", "0.7100584", "0.7084736", "0.7084736", "0.70549184", "0.7040841", "0.7022843", "0.70023674", "0.699961...
0.8452331
0
Inserts value at position idx, shifting the original elements down the list, as needed. Note that inserting a value at len(self) equivalent to appending the value is permitted. Raises IndexError if idx is invalid.
def insert(self, idx, value): assert(isinstance(idx, int)) nidx = self._normalize_idx(idx) self.data.append(None) for i in range(len(self.data)-1,idx,-1): self.data[i] = self.data[i-1] self.data[idx] = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self, idx, element):\n if self._length == self._capacity: # Need to increase size\n self._grow_arr()\n\n if idx < 0: # For negative indexing, convert to positive counterpart\n idx = self._convert_negative_index(idx)\n idx = min(self._length, idx) # Any index...
[ "0.76569957", "0.74387354", "0.7170466", "0.7159848", "0.6967311", "0.69386035", "0.6900636", "0.68895215", "0.6883031", "0.67318654", "0.67028767", "0.665537", "0.6628325", "0.65901107", "0.6585507", "0.6529382", "0.64873207", "0.64773446", "0.6460093", "0.6458619", "0.64099...
0.7784822
0
Deletes and returns the element at idx (which is the last element, by default).
def pop(self, idx=-1): to_ret =self. __getitem__(idx) self.__delitem__(idx) return to_ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pop(self, idx=-1):\n if idx < 0: # For negative indexing, convert to positive counterpart\n idx = self._convert_negative_index(idx)\n if not 0 <= idx < self._length: # Ignore indices outside of bounds\n raise IndexError(f'index {idx} out of bounds')\n\n element = se...
[ "0.80245477", "0.7400927", "0.7243163", "0.72293675", "0.71489924", "0.70918417", "0.7064182", "0.70333284", "0.6955016", "0.6955016", "0.68780965", "0.68660593", "0.6779757", "0.6776178", "0.6724961", "0.67232394", "0.66534007", "0.6649281", "0.66203725", "0.66099906", "0.65...
0.75975555
1
Returns True if this ArrayList contains the same elements (in order) as other. If other is not an ArrayList, returns False.
def __eq__(self, other): to_ret = False if (not isinstance(other, ArrayList)) or (len(other.data) != len(self.data)): return to_ret for i in range(len(self.data)): if self.data[i] != other.data[i]: return to_ret else: p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n\n for vert in self:\n if vert not in other:\n return False\n if len(self) == len(other):\n return True", "def __eq__(self, other):\n if not isinstance(other, Vector):\n return False\n elif len(self) != len(othe...
[ "0.73884636", "0.7384937", "0.71894115", "0.70885074", "0.70311356", "0.69708467", "0.6966033", "0.6947643", "0.6930064", "0.69040084", "0.690394", "0.6902855", "0.6864643", "0.6862794", "0.6860097", "0.6842636", "0.6841529", "0.6812321", "0.6763469", "0.6750699", "0.6732056"...
0.834435
0
Set up the NM08 grid for pyFEHM
def make_NM08_grid(work_dir, log_base, max_range): base_name = 'NM08' dat = fdata.fdata(work_dir=work_dir) dat.files.root = base_name pad_1 = [1500., 1500.] # Symmetric grid in x-y base = log_base dx = pad_1[0] x1 = dx ** (1 - base) * np.linspace(0, dx, max_range) ** base X = np.sort...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GLDAS025Cellgrid():\n return GLDAS025Grids(only_land=False)", "def cell_setup(self):\n p = self.project\n c = p.NewCell(0, area=1000, with_surfacewater=True)\n vgm = cmf.VanGenuchtenMualem()\n vgm.fit_w0()\n for d in self.depth:\n vgm.Ksat = 10 * 2 ** -d\n ...
[ "0.67005414", "0.6574899", "0.6446238", "0.64186054", "0.6409591", "0.6403353", "0.6398128", "0.63680947", "0.6358191", "0.6286116", "0.6284696", "0.62710345", "0.62391335", "0.62309885", "0.6200199", "0.6179789", "0.6178399", "0.6168873", "0.61656123", "0.61655104", "0.61533...
0.6873292
0
Toplevel function to run various models for NM08 stimulation in parallel for all combinations of reservoir parameters, dual macro parameters and permeability model parameters.
def model_multiprocess(reservoir_dicts, dual_lists, root, run_dict, perm_tups=None, cores=2, machine='laptop', parallel=False): sys.setrecursionlimit(5000000) if parallel: Parallel(n_jobs=cores)( delayed(NM08_model_loop)(root, run_dict, res_dict,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n run_simulation(spectral=False, ml=False, num_procs=1)\n run_simulation(spectral=True, ml=False, num_procs=1)\n run_simulation(spectral=False, ml=True, num_procs=1)\n run_simulation(spectral=True, ml=True, num_procs=1)\n run_simulation(spectral=False, ml=True, num_procs=10)\n run_sim...
[ "0.69426864", "0.6767892", "0.6682021", "0.66687495", "0.6619903", "0.6563379", "0.6513622", "0.6498593", "0.64675415", "0.64250636", "0.63996357", "0.6380449", "0.63052523", "0.62816036", "0.6271001", "0.6245444", "0.6239286", "0.62295204", "0.6218943", "0.620826", "0.619595...
0.67882544
1
Return set containing all adjective synonyms of given word.
def getAdjectives(self, word): adjectives = set() for synset in wordnet.synsets(word): if synset.pos == ADJ: for synonym in synset.lemma_names: adjectives.add(synonym) return adjectives
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_synonyms(word):\n synsets = [];\n syns = wn.synsets(word)\n for ss in syns:\n lemmas = []\n for l in ss.lemmas():\n lemma = { \"name\": l.name(), \"related_forms\": [] }\n for x in l.derivationally_related_forms():\n lemma['related_forms'].append(...
[ "0.80280876", "0.7371191", "0.727186", "0.71608585", "0.699722", "0.6978515", "0.69227", "0.67186886", "0.66606176", "0.658505", "0.6563347", "0.65600806", "0.65338475", "0.6508433", "0.64404345", "0.6423368", "0.64093894", "0.6374424", "0.63694614", "0.62788695", "0.6244392"...
0.78257185
1
Week count returns the number of calendar weeks in a year. Most years have 52 weeks of course, but if the year begins on a Thursday or a leap year begins on a Wednesday then it has 53.
def WeekCount(year): weekday = DayOfWeek(year, 1, 1) if weekday == 4: return 53 elif weekday == 3 and LeapYear(year): return 53 else: return 52
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weeks_per_year(year):\n return week_from_date(date(year, 12, 31))", "def workweeks(yr):\n\n # TODO: MOVE all of this crap into a intelDateTime.py module. Does not belong here. JSS\n\n nyd = datetime.date(yr, 1, 1).weekday() # Determine the day of the week on which the 1st of January fell this year....
[ "0.8074389", "0.7601402", "0.6511341", "0.6500138", "0.6401162", "0.63772", "0.6248234", "0.61319476", "0.5956608", "0.5922138", "0.5748826", "0.5710432", "0.5697062", "0.56096387", "0.5576821", "0.5569819", "0.55226177", "0.5512972", "0.54710263", "0.5469762", "0.54560375", ...
0.8738448
0
Returns a tuple of (century,year,ordinalDay)
def GetOrdinalDay(self): if self.day is None: if self.month is None and self.week is None: return (self.century, self.year, None) else: raise DateTimeError( "can't get ordinal day with month or week precision") if self.LeapYear(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_years_eve(year):\n return (year, DEC, 31)", "def century(year):\r\n century = 0\r\n last_digit = year % 10\r\n if year >= 1 and last_digit == 0:\r\n century = year // 100 \r\n else:\r\n century = year // 100 + 1\r\n return century", "def dia_independencia(year):\n ret...
[ "0.68773776", "0.6542961", "0.6282669", "0.61359525", "0.60769606", "0.6039188", "0.59386253", "0.59348583", "0.5828855", "0.5789047", "0.57889295", "0.57671714", "0.57671714", "0.5734408", "0.5720547", "0.5702465", "0.56704795", "0.56505144", "0.562306", "0.5620994", "0.5619...
0.71418583
0
Returns a tuple of (century,decade,year,week,weekday), note that Monday is 1 and Sunday is 7
def GetWeekDay(self): if self.day is None: if self.week: return ( self.century, self.year // 10, self.year % 10, self.week, None) el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_year_and_week():\n _update_week_number()\n return _cur_year, _cur_week", "def christmas(year, observed=None):\n day = 25\n if observed:\n weekday = calendar.weekday(year, DEC, 25)\n if weekday == SAT:\n day = 24\n if weekday == SUN:\n day = 26\n ...
[ "0.6633035", "0.633678", "0.62908995", "0.5879685", "0.57920355", "0.5673606", "0.56580865", "0.56568646", "0.5642385", "0.56214803", "0.5618055", "0.56165", "0.56031454", "0.5583499", "0.552413", "0.5509516", "0.54637563", "0.5458758", "0.54468614", "0.54213107", "0.53691626...
0.6420974
1
UpdateStructTime changes the year, month, date, wday and ydat fields of t, a struct_time, to match the values in this date.
def UpdateStructTime(self, t): if not self.Complete(): raise DateTimeError("UpdateStructTime requires complete date") t[0] = self.century * 100 + self.year t[1] = self.month t[2] = self.day t[6] = self.GetWeekDay()[4] - 1 t[7] = self.GetOrdinalDay()[2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def UpdateStructTime(self, t):\n self.date.UpdateStructTime(t)\n self.time.UpdateStructTime(t)", "def UpdateStructTime(self, t):\n if not self.Complete():\n raise DateTimeError(\"UpdateStructTime requires a complete time\")\n t[3] = self.hour\n t[4] = self.minute\n ...
[ "0.8585779", "0.76568127", "0.5674095", "0.53683573", "0.5276543", "0.5162595", "0.51445436", "0.5093863", "0.50832886", "0.50665617", "0.5031827", "0.48917872", "0.48271343", "0.48101082", "0.47949743", "0.4784963", "0.47647735", "0.4732103", "0.46906406", "0.46847725", "0.4...
0.7900712
1