query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Uses git binary to get the information on the specified directory.
def get_git_status(self, more=False): cmd_args = u'{} -c color.ui=always -c color.status=always status --branch '.format(self.git_cmd) if not more: cmd_args += '--short' with ChDir(self.directory): logger.debug('Running status command: {}'.format(cmd_args)) s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info(directory):\n git_dir = os.path.join(directory, '.git')\n if not os.path.exists(git_dir):\n raise IOError(errno.ENOENT, '.git not found', directory)\n\n if os.path.isfile(git_dir):\n # submodules\n with open(git_dir, 'r') as f:\n git_ref = f.read().strip()\n\n ...
[ "0.77134234", "0.74907887", "0.7367796", "0.70493096", "0.6932514", "0.68896735", "0.67703146", "0.6731434", "0.6713529", "0.66906565", "0.6634889", "0.6587841", "0.6581772", "0.6567745", "0.65648717", "0.65633637", "0.6461472", "0.6386494", "0.6333181", "0.6306241", "0.62618...
0.0
-1
Finding the commits that are not pushed to the origin remote
def get_queued_commits(self, author_filter=None): with ChDir(self.directory): logger.debug('Verify Dir Has an upstream branch: {}'.format(self.directory)) run_command('{} rev-parse --quiet @{{u}}..'.format(self.git_cmd), subprocess.PIPE) cmd_args = "{} rev-list".format(self.g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def origin(self):\n for item in os.popen('git remote -v'):\n split_item = item.strip().split()\n if split_item[0] == 'origin' and split_item[-1] == '(push)':\n return split_item[1]", "async def fetch_commits(self):\n for repo in self.config['repos'].split(','):\...
[ "0.66369563", "0.6598706", "0.6432641", "0.6345757", "0.63035303", "0.62276125", "0.6117992", "0.6060729", "0.6056284", "0.60144085", "0.59753895", "0.59223807", "0.5909121", "0.5904455", "0.5857569", "0.58364576", "0.5828773", "0.5821198", "0.58123845", "0.5805069", "0.57896...
0.5802054
20
Return a list of parts of speech.
def read_text(text_split): parts_of_speech = [] # instantiate empty list for word in text_split: # check if the last index is the other bracket or if it's punctuation # this prints the last letter of the prompt correctly if word[0] == "[" and word[-1] == "]": parts_of_speec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def part_of_speech(text):\n temp = nltk.pos_tag(text)\n return [word for word, tag in temp if \n (tag == \"NN\") or \n (tag == \"NNS\") or\n (tag == \"NNP\") or \n (tag == \"NNPS\")]", "def get_part_of_speech(tokens):\n\n return [e for e in nltk.chunk.ne_chunk...
[ "0.7134673", "0.6987765", "0.6834255", "0.6656446", "0.64809626", "0.64693034", "0.6468814", "0.62929255", "0.6226717", "0.612575", "0.60079587", "0.59267974", "0.5925256", "0.5793268", "0.5782666", "0.57525915", "0.57333004", "0.56673974", "0.5663541", "0.5642697", "0.564269...
0.5832706
13
Return a list of input words from user.
def get_input(read_text): user_input_list = [] # instantiate empty list # call the read_text function, and make a variable with its output list parts_of_speech = read_text(text_split) for word in parts_of_speech: # for each part of speech, ask user for a word of this type input_word ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_words() -> List[str]:\r\n user_words = input()\r\n user_words = user_words.split()\r\n return user_words", "def get_user_words():\n user_words = []\n while True:\n try:\n user_input = input()\n user_words.append(user_input)\n if user_input == \"...
[ "0.87324315", "0.7559497", "0.7193994", "0.71016663", "0.67820585", "0.67741716", "0.66742367", "0.6617233", "0.6617233", "0.66086435", "0.64847183", "0.64559364", "0.64380866", "0.6425917", "0.64247036", "0.63515234", "0.633357", "0.6247313", "0.62370324", "0.62076485", "0.6...
0.7514219
2
Return a final mad lib with parts of speech replaced by user input.
def make_madlib(get_input): # call the get_input function and make a variable from its output list replaced_list = get_input(read_text) index = 0 # we want both the index and the word that we want to replace in text_split for (i, word) in enumerate(text_split): # find the parts of speech, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mad_libs():\n\n # The parts of speech we are intrested in removing and replacing\n to_replace = [\"JJ\", \"JJR\", \"JJS\", \"NN\", \"NNS\", \"RB\", \"RBR\", \"RBS\"]\n done = False\n while not done:\n print(\"You're in the madlibs menu\")\n print(\"Here are your options:\")\n p...
[ "0.63713914", "0.6036372", "0.57943606", "0.5604704", "0.55267847", "0.549841", "0.54870534", "0.5482093", "0.5372294", "0.5347282", "0.5323033", "0.53198546", "0.52982825", "0.5293129", "0.52888864", "0.52587306", "0.5246758", "0.5227932", "0.52277255", "0.5220096", "0.52196...
0.7572062
0
Given the necessary information about relationships, generates SQL database useable by our open world implementation
def generateSQL(unary, binary, names, output_file, unary_dist=None, binary_dist=None): # Make sure we didn't mess anything up assert (len(unary) + len(binary)) == len(names) sql = '' # generate drop statements for name in names: sql += "drop table if exists %s;\n" % name # Create unar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_sql_parts(self, node,i=0,colNames=None,sql=None):\n\t\treferencesPersonFact = False\n\t\tif i == 0:\n\t\t\tsql=[]\n\t\t\tcolNames=[]\n\t\t\t# print('\\nSELECT *\\nFROM {}'.format(node))\n\t\tfor edge in self.DiG.out_edges(node):\n\t\t\t# print('\\tedge: {}->{} {}'.format(*edge,self.DiG.get_edge_data(...
[ "0.6268195", "0.62161386", "0.6120298", "0.61085665", "0.60339504", "0.59221375", "0.59038436", "0.5902835", "0.58226085", "0.5819849", "0.58148515", "0.580935", "0.5799963", "0.57978106", "0.57941604", "0.5790598", "0.5786547", "0.57412314", "0.5732473", "0.5721076", "0.5713...
0.55353254
39
Generates a unary relation from our graph by first sampling a value from dist (must return a number between 1 and N, where N is the number of nodes in the graph), and then sampling that many nodes from the graph with replacement
def generateUnaryRel(graph, dist=None): if dist is None: dist = lambda: random.randint(1, len(graph.nodes())) count = dist() return random.sample(graph.nodes(), count)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_regular_graph(variable_names, dist_func, num_neigh=10, **kwargs):\n shuffle(variable_names)\n num_vars = len(variable_names)\n num_neigh = min(num_neigh, num_vars-1)\n graphs = nx.random_graphs.random_regular_graph(num_neigh, num_vars)\n edges = np.array(graphs.edges())\n edges.sort(...
[ "0.6225221", "0.6075832", "0.57536215", "0.5595702", "0.55751705", "0.5566251", "0.5530265", "0.54891706", "0.5453418", "0.5447563", "0.5430584", "0.5427841", "0.54138327", "0.5403605", "0.54019284", "0.53796065", "0.5331073", "0.5319422", "0.53087515", "0.5298584", "0.529813...
0.8003123
0
TF or Term Frequency is the ratio of number of times the word appears in a document compared to the total number of words in that document.
def tf(vector): for line in vector: line[0] = np.true_divide(line[0], np.sum(line[0])) return vector
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tf(word, document):\n return freq(word,document) / wordCount(document)", "def get_tf(term, document):\n\n term_list = [term.lower() for term in document.split()]\n num_of_words_in_doc = len(document.split())\n term_count_in_doc = term_list.count(term)\n\n return term_count_in_doc / num_of_words_in_doc",...
[ "0.8723744", "0.84126645", "0.7926919", "0.78912336", "0.7862143", "0.7781198", "0.77429914", "0.7682379", "0.7656306", "0.76286805", "0.76163816", "0.7463605", "0.7445913", "0.7415905", "0.7412183", "0.73883826", "0.7378769", "0.7357459", "0.73337525", "0.7285356", "0.728293...
0.0
-1
Returns the theoretical probability that x_n will be between the values a and b.
def get_confidence_interval(self,a,b): k_vals,prob_vals = self.tuple_of_probabilities working_indices = [i for i,v in enumerate(k_vals) if (v >= a and v<= b)] working_prob_vals = [prob_vals[i] for i in working_indices] return sum(working_prob_vals)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def probability(s, a, b):\r\n return s.cdf(b) - s.cdf(a)", "def theoretical_distribution(x):\n a = 0\n b = 1\n if x < a:\n return 0\n elif x > b:\n return 1\n else:\n return float(x - a) / (b - a)", "def interval_prob(x1, x2, a, b):\n with mp.extradps(5):\n ...
[ "0.7519538", "0.7352858", "0.7060859", "0.68735635", "0.68382454", "0.67430097", "0.6606817", "0.6601517", "0.65820867", "0.6561573", "0.6522591", "0.64544326", "0.6453946", "0.6387221", "0.6384941", "0.63692117", "0.63621324", "0.63278866", "0.632063", "0.6309425", "0.630878...
0.633067
17
Plots the theoretical probability distribution for the random walk.
def plot_distribution(self,show=True): k_vals,prob_vals = self.tuple_of_probabilities plt.figure("Probability distribution of Random Walk, theoretical") plt.scatter(k_vals,prob_vals,s=4) plt.xlim((-self.n-1,self.n+1)) plt.xlabel("x\u2099 - Position after n jumps") plt.ylabel("Probability") plt.supti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geneticAlgorithmPlot(population, popSize, fittestSize, mutationRate, generations):\n pop = GA.initialPopulation(popSize, population)\n progress = []\n progress.append(1 / GA.rankRoutes(pop)[0][1])\n \n for i in range(0, generations):\n pop = GA.nextGeneration(pop, fittestSize, mutationRat...
[ "0.6606563", "0.6557504", "0.6498785", "0.641404", "0.640985", "0.6358938", "0.62723446", "0.6208371", "0.6195964", "0.61664635", "0.6133573", "0.60698766", "0.6052493", "0.6051445", "0.60448354", "0.6023211", "0.5997611", "0.59773487", "0.59731567", "0.5966449", "0.59633803"...
0.83731085
0
Runs a Monte Carlo simulation of the random walk for a specified number of trials. It then plots the results as a frequency distribution. Mean and variance values of the Monte Carlo simulation can be retrieved by calling mc.mean and mc.variance, respectively. Method parameters
def run_monte_carlo(self,number_of_trials=2000,plot=True,histogram=False,show=True,overlay=False): trial_data = [] for _ in range(number_of_trials): steps = self._random_walk_simulation() trial_data.append( sum(steps) + self.x_initial ) x_n, counts = np.unique(trial_data, return_counts=True) self.mc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulate(self, number_of_simulations):\n self.number_of_simulations = number_of_simulations\n\n for iteration_num in range(0, number_of_simulations, 1):\n self.add_grain(0)\n self.check_pile(iteration_num)\n self.mass_when_iteration.append(self.mass_count - self.m...
[ "0.6701685", "0.6585736", "0.6476485", "0.6432378", "0.6383453", "0.631216", "0.625372", "0.62430805", "0.6218561", "0.62165946", "0.62092024", "0.6172401", "0.61608857", "0.6157016", "0.6096449", "0.6096449", "0.609388", "0.60926163", "0.60920125", "0.60714257", "0.60618424"...
0.7543116
0
This method produces an animated simulation of a 1D random walk.
def random_walk_draw(self,num_plots,animated=False,show=True): t_x_arrays = [] t_max = self.n for _ in range(num_plots): current_x = self.x_initial x_array = [current_x] t_array = range(t_max + 1) steps = self._random_walk_simulation() for s in steps: current_x += s x_array.append(curren...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_walk(turtle, distance, steps):\n turtle.color(randcolor(), randcolor())\n for step in range(0,steps):\n random_move(turtle, distance)\n gohome(turtle)", "def animate(agent, steps, initialize=None):\n grid, r, c = random_world()\n image = plt.imshow(grid, cmap=cmap, norm=norm)\n if initi...
[ "0.6422432", "0.6396238", "0.636496", "0.63317525", "0.62908727", "0.6250839", "0.6221125", "0.6113204", "0.61060905", "0.60530597", "0.6004688", "0.59976655", "0.5970178", "0.5949534", "0.5910587", "0.5881018", "0.58617455", "0.58095884", "0.5787556", "0.5768405", "0.5759622...
0.7161393
0
Returns the theoretical average distance from x_initial.
def _calculate_mean_distance_theoretical(self): x_mean_distance = 0 x_vals,prob_vals = self.tuple_of_probabilities for i in range(len(x_vals)): x_val, prob = x_vals[i], prob_vals[i] x_distance = abs(x_val - self.x_initial) x_weighted = x_distance * prob x_mean_distance += x_weighted return x_mean_di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def avgX(self):\n return np.mean(self.getx())", "def _avg_sample(self):\n samples = [0] * self.num_samples\n for i in range(self.num_samples):\n samples[i] = self.sensor.measure_distance()\n time.sleep(self.sample_delay)\n if self.drop_extremes:\n samp...
[ "0.65964574", "0.6528893", "0.65209246", "0.63227236", "0.6232084", "0.62193644", "0.61996084", "0.61704206", "0.6161522", "0.61305714", "0.61239797", "0.6103318", "0.6088901", "0.5991759", "0.59127855", "0.59127855", "0.59127855", "0.59074956", "0.58808935", "0.58742917", "0...
0.80323946
0
Calculates the probability that x_n = k delta_x. This method uses the values of n and p in its calculations.
def _calculate_probability(self,k): if abs(k * self.delta_x) > (3 * np.sqrt(self.variance)): return 0.0 binom_coeff = special.binom(self.n,(self.n + k)/2) b_value = binom_coeff * ((self.p) ** ((self.n + k)/2)) * ((1-self.p) ** ((self.n - k)/2)) return b_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def probability(n, k, p):\n prob = 0\n power = expotentation_by_squaring((1-p), n)\n count_mult = math.log(n, 2)\n p_fraction = p/(1-p)\n count_mult += 1\n for i in range(0, k+1):\n element = newton(n, i)*power\n prob += element\n power *= p_fraction\n count_mult += 2\...
[ "0.7945974", "0.7007212", "0.6929289", "0.6782928", "0.67037106", "0.65899515", "0.6540211", "0.6514137", "0.6489262", "0.63936114", "0.636305", "0.6362294", "0.62638086", "0.6237782", "0.6176205", "0.61600775", "0.613456", "0.613456", "0.6123985", "0.6123276", "0.61229426", ...
0.7519626
1
Gets a tuple of the form (kvalues,probabilities) in the range [n,n].
def _get_tuple_of_probabilities(self): k_array = np.arange(-self.n,self.n+1,2) probability_array = [] for k in k_array: probability_array.append(self._calculate_probability(k)) return (k_array,probability_array)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def probability(n, k, p):\n prob = 0\n power = expotentation_by_squaring((1-p), n)\n count_mult = math.log(n, 2)\n p_fraction = p/(1-p)\n count_mult += 1\n for i in range(0, k+1):\n element = newton(n, i)*power\n prob += element\n power *= p_fraction\n count_mult += 2\...
[ "0.6795796", "0.6431642", "0.6371308", "0.63636243", "0.62259746", "0.6038752", "0.59965384", "0.5926337", "0.59128183", "0.5910087", "0.5896185", "0.58841133", "0.584079", "0.58231497", "0.5818503", "0.58054143", "0.5799345", "0.5798068", "0.5791992", "0.5765857", "0.5764065...
0.80612916
0
Fetches an URL with urlopen retries until success (to deal with ratelimits)
def request_until_succeed(url): req = Request(url) success = False while success is False: try: response = urlopen(req) if response.getcode() == 200: success = True except Exception as e: print(e) if e.file: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_url(url, bytes=10000, retry=3):\n retry = abs(retry or 1)\n for x in range(retry - 1):\n try: # retry silently several time\n page = urllib.urlopen(url)\n return page.read(10000)\n except:\n pass\n # try one last time and fail loudly if needed\n ...
[ "0.7759101", "0.74884486", "0.73910856", "0.7351973", "0.7349828", "0.72955513", "0.7255797", "0.7164698", "0.7157121", "0.7125055", "0.70978093", "0.70485735", "0.696427", "0.6924929", "0.68756586", "0.67357767", "0.6720894", "0.6692962", "0.6664536", "0.66399014", "0.663945...
0.7486804
2
tries to decode unicode to deal with python unicode strangeness
def unicode_decode(text): try: return text.encode('utf-8').decode() except UnicodeDecodeError: return text.encode('utf-8')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unicode_decode(text):\n\n try:\n return text.encode('utf-8').decode()\n except UnicodeDecodeError:\n return text.encode('utf-8')", "def escapeDecode(s: unicode) -> unicode:\n ...", "def TryDecode(text):\n try:\n return unicode(text, \"utf8\")\n except (TypeError, UnicodeDeco...
[ "0.7843637", "0.7709333", "0.768689", "0.74438226", "0.73078275", "0.7273341", "0.72526544", "0.71388495", "0.70961183", "0.708849", "0.7074156", "0.7049334", "0.7018959", "0.6978158", "0.6967038", "0.69328606", "0.6872787", "0.68676764", "0.6857858", "0.6856613", "0.6843041"...
0.79577845
0
Reads lines in file_id and fetches relevant facebook comments, using the facebook graph api, saving the result to result_file
def scrapeFacebookComments(file_id, result_file, access_token): with open(file_id, 'r', encoding='utf8') as f, \ open(result_file, 'w', encoding='utf8', newline='') as o: input_file = csv.DictReader(f) output_file = csv.DictWriter(o, fieldnames=[ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_comments(video_id, CLIENT_SECRETS_FILE):", "def process_reddit_comment_file(f,\n output_folder):\n ## Output File\n if output_folder is not None:\n fname = os.path.basename(f).replace(\"comments.json\",\"processed.comments.json\")\n if not fname.endswith...
[ "0.6400023", "0.62088317", "0.6198404", "0.5723124", "0.54117316", "0.5385133", "0.53159404", "0.524866", "0.51766294", "0.5171449", "0.5160384", "0.5138199", "0.51008713", "0.50976366", "0.50750273", "0.5037629", "0.50367475", "0.502809", "0.5021747", "0.50176424", "0.501086...
0.7850107
0
Generate an instance of the HPE OneView client. Generates an instance of the HPE OneView client using the hpOneView lib.
def get_hponeview_client(): manager_url = prepare_manager_url(CONF.oneview.manager_url) config = { "ip": manager_url, "credentials": { "userName": CONF.oneview.username, "password": CONF.oneview.password } } return hponeview_client.OneViewClient(config)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_heat_client(self):\n\n print \"\\t* Generating heat client\"\n # request a new auth token from keystone\n keystone = ksclient.Client(auth_url=self.auth_url,\n username=self.username,\n password=self.password,\n ...
[ "0.62012696", "0.59542215", "0.5604468", "0.53502053", "0.5333491", "0.52706295", "0.5257632", "0.5231252", "0.5147483", "0.5104047", "0.50083214", "0.5004166", "0.49704948", "0.49391007", "0.49293235", "0.49172926", "0.49049976", "0.48713294", "0.48525918", "0.48477373", "0....
0.78882736
0
Generate an instance of the iLORest library client.
def get_ilorest_client(server_hardware): oneview_client = get_hponeview_client() remote_console = oneview_client.server_hardware.get_remote_console_url( server_hardware ) host_ip, ilo_token = _get_ilo_access(remote_console) base_url = "https://%s:%s" % (host_ip, ILOREST_BASE_PORT) return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_client(self) -> None:\n self._client = discovery.build('ml', 'v1')", "def make_client(instance):\r\n neutron_client = utils.get_client_class(\r\n API_NAME,\r\n instance._api_version[API_NAME],\r\n API_VERSIONS,\r\n )\r\n instance.initialize()\r\n url = instance._url...
[ "0.6768092", "0.6565448", "0.65639997", "0.64433366", "0.6390451", "0.63213104", "0.62952775", "0.62724704", "0.62388724", "0.62262815", "0.6198003", "0.61788833", "0.61659384", "0.6135776", "0.6057306", "0.6035382", "0.5959817", "0.59236896", "0.58714986", "0.58455396", "0.5...
0.6267768
8
Get the needed information to access ilo. Get the host_ip and a token of an iLO remote console instance which can be used to perform operations on that controller.
def _get_ilo_access(remote_console): url = remote_console.get('remoteConsoleUrl') url_parse = parse.urlparse(url) host_ip = parse.parse_qs(url_parse.netloc).get('addr')[0] token = parse.parse_qs(url_parse.netloc).get('sessionkey')[0] return host_ip, token
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_details(module):\n\n login_list = [module.params['login'], os.getenv('DCI_LOGIN')]\n login = next((item for item in login_list if item is not None), None)\n\n password_list = [module.params['password'], os.getenv('DCI_PASSWORD')]\n password = next((item for item in password_list if item is not ...
[ "0.57575613", "0.57030374", "0.5658261", "0.561578", "0.55102676", "0.5456767", "0.54272753", "0.54270345", "0.53561795", "0.53542095", "0.5327382", "0.5325279", "0.5313275", "0.5305687", "0.528909", "0.52887946", "0.52811927", "0.52711695", "0.52711695", "0.526446", "0.52539...
0.808896
0
Verify if fields and namespaces of a node are valid. Verifies if the 'driver_info' field and the 'properties/capabilities' namespace exist and are not empty.
def verify_node_info(node): capabilities_dict = utils.capabilities_to_dict( node.properties.get('capabilities', '') ) driver_info = node.driver_info _verify_node_info('properties/capabilities', capabilities_dict, REQUIRED_ON_PROPERTIES) _verify_node_info('driver_info'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _verify_node_info(node_namespace, node_info_dict, info_required):\n missing_keys = set(info_required) - set(node_info_dict)\n\n if missing_keys:\n raise exception.MissingParameterValue(\n _(\"Missing the keys for the following OneView data in node's \"\n \"%(namespace)s: %(...
[ "0.62888443", "0.5970122", "0.5792318", "0.5749915", "0.57480246", "0.5558528", "0.555058", "0.54527915", "0.54470193", "0.54410964", "0.54384977", "0.5430039", "0.54069996", "0.53724563", "0.53724563", "0.5347799", "0.53438234", "0.53368545", "0.53343976", "0.5322387", "0.53...
0.7963399
0
Get OneView information from the node.
def get_oneview_info(node): try: capabilities_dict = utils.capabilities_to_dict( node.properties.get('capabilities', '') ) except exception.InvalidParameterValue as e: raise exception.OneViewInvalidNodeParameter(node_uuid=node.uuid, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_show(self, node):\n if node.instance_uuid:\n n = self.ironic_client.node.get_by_instance_uuid(\n node.instance_uuid)\n else:\n n = self.ironic_client.node.get(node.uuid)\n return n", "def get_node_details(self, node):\n node_details = self...
[ "0.65129185", "0.60302633", "0.60019517", "0.59819186", "0.5964509", "0.5886509", "0.57704425", "0.5651187", "0.5634503", "0.5597397", "0.5592938", "0.55923563", "0.5571141", "0.55683917", "0.55459785", "0.55267394", "0.55267394", "0.54931307", "0.54928416", "0.5488017", "0.5...
0.797151
0
Validate if the node configuration is consistent with OneView. This method calls hpOneView functions to validate if the node configuration is consistent with the OneView resources it represents, including serverHardwareUri, serverHardwareTypeUri, serverGroupUri serverProfileTemplateUri, enclosureGroupUri and node ports...
def validate_oneview_resources_compatibility(task): ports = task.ports oneview_client = get_hponeview_client() oneview_info = get_oneview_info(task.node) _validate_node_server_profile_template(oneview_client, oneview_info) _validate_node_server_hardware_type(oneview_client, oneview_info) _valid...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_node_server_hardware_type(oneview_client, oneview_info):\n node_server_hardware_type_uri = oneview_info['server_hardware_type_uri']\n server_hardware = oneview_client.server_hardware.get(\n oneview_info['server_hardware_uri'])\n server_hardware_sht_uri = server_hardware.get('serverHar...
[ "0.64884377", "0.626606", "0.6191199", "0.61666006", "0.56702393", "0.5576689", "0.5527156", "0.5473364", "0.53926665", "0.53686446", "0.5361794", "0.53390706", "0.53390706", "0.5296695", "0.5285889", "0.521166", "0.52000636", "0.5153872", "0.5126247", "0.5111564", "0.5093537...
0.70742106
0
Verify if info_required is present in node_namespace.
def _verify_node_info(node_namespace, node_info_dict, info_required): missing_keys = set(info_required) - set(node_info_dict) if missing_keys: raise exception.MissingParameterValue( _("Missing the keys for the following OneView data in node's " "%(namespace)s: %(missing_keys)s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_namespace_attrs(self, node):\n for cls in node.classes:\n for var in cls.variables:\n self.check_var_attrs(cls, var)\n for func in cls.functions:\n self.check_fcn_attrs(func)\n\n for func in node.functions:\n self.check_fcn_att...
[ "0.58488464", "0.58250725", "0.5789654", "0.5767724", "0.576109", "0.5756803", "0.57413286", "0.56746936", "0.55888873", "0.55871767", "0.55615854", "0.55192447", "0.54995584", "0.5496556", "0.54898274", "0.5455332", "0.54527485", "0.54376256", "0.5391571", "0.5388521", "0.53...
0.7387368
0
Checks if the node's Server Hardware has a Server Profile associated. Decorator to execute before the function execution to check if the Server Profile is applied to the Server Hardware.
def node_has_server_profile(func): def inner(self, *args, **kwargs): task = args[0] has_server_profile(task) return func(self, *args, **kwargs) return inner
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_server_profile(task):\n oneview_client = get_hponeview_client()\n try:\n profile = task.node.driver_info.get('applied_server_profile_uri')\n oneview_client.server_profiles.get(profile)\n except client_exception.HPOneViewException as exc:\n LOG.error(\n \"Failed to g...
[ "0.64625174", "0.6329892", "0.6047561", "0.59693646", "0.5888459", "0.5794492", "0.57879764", "0.5742285", "0.57172704", "0.55384105", "0.5498647", "0.54914945", "0.5441861", "0.5415404", "0.5377407", "0.5358442", "0.53436404", "0.5326051", "0.5309744", "0.530064", "0.5288293...
0.6996314
0
Checks if the node's Server Hardware has a Server Profile associated. Function to check if the Server Profile is applied to the Server Hardware.
def has_server_profile(task): oneview_client = get_hponeview_client() try: profile = task.node.driver_info.get('applied_server_profile_uri') oneview_client.server_profiles.get(profile) except client_exception.HPOneViewException as exc: LOG.error( "Failed to get server pro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_simple_server_profile_by_server_hardware(profile_name, server_name, return_true_if_exists=False):\n logger.info(\"--> creating a server profile with name '%s' ...\" % profile_name)\n # checking if the profile is already existing\n FusionUIBase.navigate_to_section(SectionType.SERVER_PROFILES, ti...
[ "0.6275056", "0.61501735", "0.61437684", "0.6112742", "0.6090006", "0.60501087", "0.60271287", "0.599908", "0.59340584", "0.5925858", "0.5887888", "0.58697414", "0.58384514", "0.582165", "0.57998717", "0.5766464", "0.5734024", "0.57302743", "0.5717543", "0.5691349", "0.564297...
0.7312112
0
Get the MAC of Server Hardware's iLO controller.
def _get_server_hardware_mac_from_ilo(server_hardware): try: client = get_ilorest_client(server_hardware) ilo_path = "/rest/v1/systems/1" hardware = jsonutils.loads(client.get(ilo_path).text) hardware_mac = hardware['HostCorrelation']['HostMACAddress'][0] except redfish.JsonDecod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMac(self):\n # Import netifaces here to prevent error importing this module in setup.py\n import netifaces\n interfaces = ['eth0', 'wlan0']\n try:\n interfaces.append(netifaces.gateways()['default'][netifaces.AF_INET][1])\n except:\n pass\n for...
[ "0.7558255", "0.7499342", "0.7251188", "0.7216513", "0.7197244", "0.7197244", "0.71224785", "0.7062655", "0.7039275", "0.68878335", "0.68746555", "0.677884", "0.67500824", "0.67455614", "0.6697018", "0.6639741", "0.662569", "0.6582134", "0.6567028", "0.6560305", "0.648537", ...
0.74903506
2
Get the MAC address of the first PXE bootable port of an Ethernet port.
def _get_server_hardware_mac(server_hardware): sh_physical_port = None if server_hardware.get('portMap'): for device in server_hardware.get( 'portMap', {}).get('deviceSlots', ()): for physical_port in device.get('physicalPorts', ()): if physical_port.get('typ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mac_address():\n eth0_interface = 'eth0'\n addresses = netifaces.ifaddresses(eth0_interface)[netifaces.AF_LINK][0]\n mac_address = addresses['addr']\n return mac_address", "def get_mac():\n\n interface = [x for x in netifaces.interfaces() if 'wlan' in x or 'wlp' in x][0]\n return netifa...
[ "0.69867545", "0.6868253", "0.6855199", "0.67767805", "0.6448431", "0.6439653", "0.641064", "0.6402625", "0.6315631", "0.6301838", "0.6258961", "0.6156755", "0.61553484", "0.6115181", "0.6087597", "0.6040105", "0.60321033", "0.6030586", "0.5961706", "0.59339625", "0.59106183"...
0.5524931
52
Validate if the Server Profile Template is consistent.
def _validate_node_server_profile_template(oneview_client, oneview_info): server_profile_template = oneview_client.server_profile_templates.get( oneview_info['server_profile_template_uri']) server_hardware = oneview_client.server_hardware.get( oneview_info['server_hardware_uri']) _validate_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_server_profile_template_manage_boot(server_profile_template):\n manage_boot = server_profile_template.get('boot', {}).get('manageBoot')\n\n if not manage_boot:\n message = _(\"Server Profile Template: %s, does not allow to manage \"\n \"boot order.\") % server_profile_...
[ "0.7069994", "0.68792826", "0.66662836", "0.6568979", "0.623397", "0.6207681", "0.6184548", "0.6091524", "0.6008042", "0.5996494", "0.59735686", "0.5967848", "0.5924284", "0.5894213", "0.58178085", "0.5812006", "0.57749254", "0.5769697", "0.5671442", "0.56670874", "0.5555338"...
0.7610132
0
Validate if the Server Hardware Types are the same. Validate if the Server Profile Template and the Server Hardware have the same Server Hardware Type
def _validate_server_profile_template_server_hardware_type( server_profile_template, server_hardware): spt_server_hardware_type_uri = ( server_profile_template.get('serverHardwareTypeUri') ) sh_server_hardware_type_uri = server_hardware.get('serverHardwareTypeUri') if spt_server_hardwar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_node_server_hardware_type(oneview_client, oneview_info):\n node_server_hardware_type_uri = oneview_info['server_hardware_type_uri']\n server_hardware = oneview_client.server_hardware.get(\n oneview_info['server_hardware_uri'])\n server_hardware_sht_uri = server_hardware.get('serverHar...
[ "0.72816855", "0.7089422", "0.6603946", "0.5662966", "0.5636588", "0.5465046", "0.5454747", "0.5449822", "0.5423557", "0.53436553", "0.5322769", "0.530526", "0.5304127", "0.52597606", "0.52190274", "0.5214245", "0.51793396", "0.5171909", "0.51624525", "0.51224446", "0.5110577...
0.797853
0
Validate Server Profile Template's Enclosure Group and Server Hardware's.
def _validate_spt_enclosure_group(server_profile_template, server_hardware): spt_enclosure_group_uri = server_profile_template.get('enclosureGroupUri') sh_enclosure_group_uri = server_hardware.get('serverGroupUri') if spt_enclosure_group_uri != sh_enclosure_group_uri: message = _("Server profile te...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_node_server_profile_template(oneview_client, oneview_info):\n server_profile_template = oneview_client.server_profile_templates.get(\n oneview_info['server_profile_template_uri'])\n server_hardware = oneview_client.server_hardware.get(\n oneview_info['server_hardware_uri'])\n\n ...
[ "0.760848", "0.6779853", "0.65984255", "0.6223883", "0.61876816", "0.60283494", "0.560771", "0.5489887", "0.53607535", "0.5346088", "0.5340885", "0.53095055", "0.52877337", "0.5249136", "0.52323705", "0.5205969", "0.51810074", "0.5165089", "0.5141421", "0.5105114", "0.5104925...
0.6317872
3
Validate if the Server Profile Template allows to manage the boot order.
def _validate_server_profile_template_manage_boot(server_profile_template): manage_boot = server_profile_template.get('boot', {}).get('manageBoot') if not manage_boot: message = _("Server Profile Template: %s, does not allow to manage " "boot order.") % server_profile_template.get('...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_node_server_profile_template(oneview_client, oneview_info):\n server_profile_template = oneview_client.server_profile_templates.get(\n oneview_info['server_profile_template_uri'])\n server_hardware = oneview_client.server_hardware.get(\n oneview_info['server_hardware_uri'])\n\n ...
[ "0.67219007", "0.6499709", "0.6323258", "0.6316359", "0.6255033", "0.6118853", "0.6111678", "0.6087322", "0.6000576", "0.58550376", "0.5843932", "0.57918465", "0.5738527", "0.57050484", "0.56965", "0.5672641", "0.56639814", "0.56551486", "0.564075", "0.5627896", "0.56241286",...
0.8403261
0
Validate if the node's Server Hardware Type matches Server Hardware's.
def _validate_node_server_hardware_type(oneview_client, oneview_info): node_server_hardware_type_uri = oneview_info['server_hardware_type_uri'] server_hardware = oneview_client.server_hardware.get( oneview_info['server_hardware_uri']) server_hardware_sht_uri = server_hardware.get('serverHardwareType...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_server_profile_template_server_hardware_type(\n server_profile_template, server_hardware):\n spt_server_hardware_type_uri = (\n server_profile_template.get('serverHardwareTypeUri')\n )\n sh_server_hardware_type_uri = server_hardware.get('serverHardwareTypeUri')\n\n if spt_se...
[ "0.67908597", "0.62367", "0.5962622", "0.5756479", "0.56312937", "0.55868", "0.5542178", "0.5457781", "0.5441118", "0.542971", "0.54071677", "0.53862107", "0.5355715", "0.5339024", "0.53239506", "0.528533", "0.5275171", "0.5271481", "0.52409774", "0.52346915", "0.51931256", ...
0.8271434
0
Validate if the node's Enclosure Group matches the Server Hardware's.
def _validate_node_enclosure_group(oneview_client, oneview_info): server_hardware = oneview_client.server_hardware.get( oneview_info['server_hardware_uri']) sh_enclosure_group_uri = server_hardware.get('serverGroupUri') node_enclosure_group_uri = oneview_info['enclosure_group_uri'] if node_encl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_node_server_hardware_type(oneview_client, oneview_info):\n node_server_hardware_type_uri = oneview_info['server_hardware_type_uri']\n server_hardware = oneview_client.server_hardware.get(\n oneview_info['server_hardware_uri'])\n server_hardware_sht_uri = server_hardware.get('serverHar...
[ "0.6324016", "0.6095127", "0.5762267", "0.5492249", "0.5368418", "0.5298437", "0.52928054", "0.524873", "0.5237448", "0.51903677", "0.5187325", "0.5177885", "0.5053734", "0.50441307", "0.50437135", "0.50406593", "0.50092286", "0.50085694", "0.5004797", "0.5001447", "0.500056"...
0.68265074
0
Validate if a port matches the node's Server Hardware's MAC.
def _validate_node_port_mac_server_hardware(oneview_client, oneview_info, ports): server_hardware = oneview_client.server_hardware.get( oneview_info['server_hardware_uri']) if not ports: return # NOTE(nicodemos) If hponeview client's unable to ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _mac_test(mac):\n\n\t\tif re.search(r'([0-9A-F]{2}[:]){5}([0-9A-F]){2}', mac.upper()) is not None:\n\t\t\treturn True\n\t\telse:\n\t\t\treturn False", "def isMACCommand(self):\n return self.payload.fport == 0", "def validate_port(port_id, serial_id):\n check_port = False\n api_uri = f\"/v1/dev...
[ "0.7097071", "0.674294", "0.67142147", "0.66719925", "0.6523463", "0.652277", "0.6445301", "0.64277035", "0.618244", "0.61718965", "0.61240774", "0.6104669", "0.6086369", "0.6079721", "0.6074816", "0.6058944", "0.60415375", "0.6036376", "0.59993446", "0.5959773", "0.59428114"...
0.7183407
0
Validate if the node's Server Profile Template's MAC type is physical.
def _validate_server_profile_template_mac_type(oneview_client, oneview_info): server_profile_template = oneview_client.server_profile_templates.get( oneview_info['server_profile_template_uri'] ) if server_profile_template.get('macType') != 'Physical': message = _("The server profile template...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_server_profile_template_server_hardware_type(\n server_profile_template, server_hardware):\n spt_server_hardware_type_uri = (\n server_profile_template.get('serverHardwareTypeUri')\n )\n sh_server_hardware_type_uri = server_hardware.get('serverHardwareTypeUri')\n\n if spt_se...
[ "0.6238729", "0.5995228", "0.5811483", "0.57653874", "0.56162757", "0.5592679", "0.5545467", "0.5504423", "0.5461139", "0.53143936", "0.53029996", "0.5298736", "0.5189293", "0.5159756", "0.515517", "0.5120909", "0.50535005", "0.5044812", "0.50217086", "0.5011732", "0.50085557...
0.83715606
0
This method computes the results as a dictionary
def results(self): results = {'answer':42} return results
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_results(self) -> Dict:\n results = {}\n results['time'] = np.array(self._results['time'])\n results['norm'] = np.array(self._results['norm'])\n results['bond_dimensions'] = np.array(self._results['bond_dimensions'])\n results['dynamics'] = self._results['dynamics']\n ...
[ "0.7524411", "0.733618", "0.72358906", "0.7162806", "0.6873215", "0.6867773", "0.6776679", "0.67169344", "0.6667122", "0.66590506", "0.6656961", "0.6643292", "0.65733004", "0.65509677", "0.6536344", "0.65005565", "0.64302456", "0.6420882", "0.64187676", "0.64016956", "0.63917...
0.64690924
16
Glib callback, to call on glib events watched
def _emited(self, *args): debug("OnEventDeferred : event catched") self.callback(*args) self._clean()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_event(self, event):", "def on_event_finished(self, event):", "def on_event(self, event):\r\n pass", "def events(self):", "def callback(self):\n pass # pragma: no cover", "def on_event(self, event):\n pass", "def on_hook(self) -> None:", "def handle_event(self, event):", ...
[ "0.59699833", "0.58868843", "0.58148116", "0.5778598", "0.5771084", "0.56385773", "0.5576121", "0.5568321", "0.55356026", "0.5518454", "0.5518454", "0.5492587", "0.5447376", "0.5420657", "0.53432494", "0.53419924", "0.53188616", "0.5284998", "0.5257975", "0.52463734", "0.5230...
0.0
-1
Glib callback, to call on glib err events
def _err_emited(self, *args): debug("OnEventDeferred : err event catched") self.errback(*args) self._clean()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_error(self, callback):\n self.error_callback = callback", "def handle_err(self):\n pass", "def on_error(self, status_code, data):\n\t\tprint(\"error_code: \",status_code)", "def ERR(self):", "def hook_notifyerror(self,msg,subsystem=None):\n ui.notifyerror(msg,subsystem)", "def...
[ "0.64166325", "0.6177739", "0.61619174", "0.5980505", "0.59541637", "0.59343463", "0.5878699", "0.5859958", "0.5820616", "0.57654464", "0.5743583", "0.57358557", "0.5722895", "0.5707079", "0.57069254", "0.56566525", "0.5656086", "0.5653089", "0.5645864", "0.56389225", "0.5627...
0.57778734
9
Add event on obj which will trigger error on this Deferred
def add_error_event(self, obj, event, *args): hid = obj.connect(event, self._err_emited, *args) self.handlers_id.append(hid)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _err_emited(self, *args):\n\t\tdebug(\"OnEventDeferred : err event catched\")\n\t\tself.errback(*args)\n\t\tself._clean()", "def errback(self, f):\r\n assert self.__obj is None, 'Only one object can be registered.'\r\n assert isinstance(f, Failure), \"Failure has to be of type 'Failure'.\"\r\n ...
[ "0.67899597", "0.6495937", "0.619477", "0.61869735", "0.61564225", "0.615239", "0.59784204", "0.59604985", "0.58662796", "0.5854047", "0.5818122", "0.5777247", "0.5679716", "0.5663086", "0.5646356", "0.56234443", "0.5596893", "0.5590271", "0.5570113", "0.5570113", "0.5570113"...
0.7338435
0
To call when trigerred
def _clean(self): for hid in self.handlers_id: self.obj.handler_disconnect(hid)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def triggered(self, *args, **kwargs): # real signature unknown\n pass", "def fire(self):", "def trigger(self, type, event):", "def __call__(self, trigger, type, event):", "def fire(self):\n pass", "def take_action(self, *args, **kwargs):\r\n pass", "def act(self):\n pass", ...
[ "0.7579424", "0.7375058", "0.73647785", "0.72742695", "0.72413653", "0.6972291", "0.69711393", "0.6867664", "0.68155426", "0.68155426", "0.6703577", "0.6642475", "0.6636517", "0.66193414", "0.65902543", "0.6557556", "0.64969707", "0.64872396", "0.6479976", "0.64473957", "0.64...
0.0
-1
This function prints and plots the confusion matrix.
def plot_confusion_matrix(cm,classes,title='Confusion matrix',cmap=plt.cm.Blues): x_classes=classes+ ['Recall'] y_classes=classes+ ['Precision'] plt.imshow(cm, interpolation='nearest', cmap=cmap) plt.title(title,fontname='Times New Roman',fontsize = 16, y=1.03) cbar=plt.colorbar(fraction=0.046) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(self):\r\n interp = ClassificationInterpretation.from_learner(self.learn)\r\n interp.plot_confusion_matrix()", "def showConfusionMatrix(self): \r\n sn.heatmap(self.conf_matrix, annot=True)\r\n plt.plot( label=\"Accuracy\")\r\n plt.plot( label=\"Error\"...
[ "0.80894613", "0.80770946", "0.79976976", "0.7946727", "0.7921785", "0.78448296", "0.7833224", "0.7781221", "0.7775631", "0.77574563", "0.77061635", "0.77016985", "0.7692213", "0.76785815", "0.76588994", "0.7641414", "0.7622791", "0.7611233", "0.7610989", "0.7598244", "0.7587...
0.75652844
24
Returns a frozenset of variables used in given terms. Note that this returns all used variables, not just free ones.
def used_variables(*terms): t = terms[0] if len(terms) == 1 else terms if type(t) is Var: return frozenset((t,)) elif type(t) in (tuple, Const, Apply, Eq, Ite, Not, And, Or, Implies, Iff): return union(*(used_variables(x) for x in t)) elif type(t) in (ForAll, Exi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def free_variables(*terms, **kwargs):\n by_name = kwargs.get('by_name', False)\n _free_variables = partial(free_variables, by_name=by_name)\n\n t = terms[0] if len(terms) == 1 else terms\n\n if type(t) is Var:\n return frozenset((t.name if by_name else t,))\n\n elif type(t) in (tuple, Const, ...
[ "0.7428986", "0.6987549", "0.69048446", "0.6717069", "0.6559568", "0.63589525", "0.62739486", "0.6270176", "0.61921215", "0.6188963", "0.61090964", "0.5963275", "0.5938047", "0.5924042", "0.589158", "0.5881121", "0.5876238", "0.5858637", "0.56572014", "0.5639939", "0.56199235...
0.7920552
0
Returns a frozenset of variables free in given terms.
def free_variables(*terms, **kwargs): by_name = kwargs.get('by_name', False) _free_variables = partial(free_variables, by_name=by_name) t = terms[0] if len(terms) == 1 else terms if type(t) is Var: return frozenset((t.name if by_name else t,)) elif type(t) in (tuple, Const, Apply, Eq, Ite...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def used_variables(*terms):\n\n t = terms[0] if len(terms) == 1 else terms\n\n if type(t) is Var:\n return frozenset((t,))\n\n elif type(t) in (tuple, Const, Apply, Eq, Ite, Not, And, Or,\n Implies, Iff):\n return union(*(used_variables(x) for x in t))\n\n elif type(t)...
[ "0.7301436", "0.6923216", "0.66222817", "0.6540475", "0.6467375", "0.63554454", "0.6250781", "0.61498994", "0.5961769", "0.58668995", "0.5840457", "0.5688273", "0.5672531", "0.5552212", "0.5511896", "0.55101573", "0.54558146", "0.5436367", "0.5431674", "0.54288334", "0.541791...
0.7726464
0
Returns a frozenset of variables bound in given terms.
def bound_variables(*terms): t = terms[0] if len(terms) == 1 else terms if type(t) is Var: return frozenset() elif type(t) in (tuple, Const, Apply, Eq, Ite, Not, And, Or, Implies, Iff): return union(*(bound_variables(x) for x in t)) elif type(t) in (ForAll, Exist...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def used_variables(*terms):\n\n t = terms[0] if len(terms) == 1 else terms\n\n if type(t) is Var:\n return frozenset((t,))\n\n elif type(t) in (tuple, Const, Apply, Eq, Ite, Not, And, Or,\n Implies, Iff):\n return union(*(used_variables(x) for x in t))\n\n elif type(t)...
[ "0.72198117", "0.70041084", "0.6517899", "0.59218013", "0.5741847", "0.57111204", "0.5670193", "0.5647711", "0.5632197", "0.5581976", "0.55689853", "0.55376583", "0.54729617", "0.5426977", "0.5418284", "0.5415937", "0.5402921", "0.53907967", "0.5385815", "0.53603476", "0.5360...
0.8032309
0
Returns a frozenset of constants used in given terms.
def used_constants(*terms): t = terms[0] if len(terms) == 1 else terms if type(t) is Const: return frozenset((t,)) elif type(t) in (tuple, Var, Apply, Eq, Ite, Not, And, Or, Implies, Iff, ForAll, Exists, Lambda, NamedBinder): return union(*(used_constants(x) for x in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_constants():\n return filter(\n lambda key: key.upper() == key and type(globals()[key]) in _ALLOWED,\n\n filter( # filter _PRIVATE variables\n lambda x: not x.startswith(\"_\"),\n globals()\n )\n )", "def used_variables(*t...
[ "0.63245064", "0.5992687", "0.59890866", "0.59641623", "0.5806408", "0.56888586", "0.56451476", "0.55847293", "0.5571786", "0.55393314", "0.55284834", "0.5504401", "0.54954517", "0.54566354", "0.54400617", "0.5428424", "0.54196256", "0.5411198", "0.53967535", "0.53961635", "0...
0.80427533
0
Return the term obtained from t by simultaneous substitution given by subs subs is either a dictionary or a mapping given by an iterable of (key, value) pairs Both keys and values in subs can be either Var or Const. All keys in subs will be substituted by their values in subs. For variables, only free occurances will b...
def substitute(t, subs): if not isinstance(subs, dict): subs = dict(subs) if type(t) in (Var, Const): if t in subs: return subs[t] else: return t elif type(t) in (Apply, Eq, Ite, Not, And, Or, Implies, Iff): return type(t)(*(substitute(x, subs) for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def substitute_apply(t, subs, by_name=False):\n\n if not isinstance(subs, dict):\n subs = dict(subs)\n\n _substitute_apply = partial(substitute_apply, subs=subs, by_name=by_name)\n\n if type(t) in (Var, Const):\n return t\n\n if type(t) is Apply and t.func in subs:\n terms = tuple(...
[ "0.6979903", "0.6809032", "0.68054605", "0.67548573", "0.6693763", "0.6661133", "0.65522754", "0.65254176", "0.6471985", "0.62673676", "0.6261165", "0.6179068", "0.6160233", "0.61346424", "0.6046451", "0.5994784", "0.5992433", "0.5826811", "0.58200824", "0.5808683", "0.574078...
0.80016816
0
Return the term obtained from t by simultaneous substitution given by subs subs is either a dictionary or a mapping given by an iterable of (key, value) pairs Both keys and values in subs can be either Var or Const, but must be 2nd order. For any key, value in subs, Apply(key, terms) is substituted by value(terms'), so...
def substitute_apply(t, subs, by_name=False): if not isinstance(subs, dict): subs = dict(subs) _substitute_apply = partial(substitute_apply, subs=subs, by_name=by_name) if type(t) in (Var, Const): return t if type(t) is Apply and t.func in subs: terms = tuple(_substitute_appl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def substitute(t, subs):\n\n if not isinstance(subs, dict):\n subs = dict(subs)\n\n if type(t) in (Var, Const):\n if t in subs:\n return subs[t]\n else:\n return t\n\n elif type(t) in (Apply, Eq, Ite, Not, And, Or, Implies, Iff):\n return type(t)(*(substit...
[ "0.72416764", "0.65752196", "0.6252526", "0.6022401", "0.5977601", "0.5844865", "0.57589626", "0.57118535", "0.55280894", "0.55234385", "0.55226636", "0.5458737", "0.54270804", "0.533437", "0.5322457", "0.53204954", "0.52589554", "0.51950306", "0.5139489", "0.50581187", "0.50...
0.77619237
0
Push universals inside conjunctions and existentials inside disjunctions, and flatten conjunctions and disjunctions
def normalize_quantifiers(t): if type(t) in (Var, Const): return t elif type(t) in (Apply, Eq, Ite, Not, Implies, Iff): return type(t)(*(normalize_quantifiers(x) for x in t)) elif type(t) in (And, Or): return type(t)(*( z for x in t for y in [no...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def join_conjuncts(conjuncts):\n if (len(conjuncts) == 0):\n return EmptyExpression()\n elif (len(conjuncts) == 1):\n return conjuncts[0]\n return AndExpression(conjuncts[0], join_conjuncts(conjuncts[1:]))", "def NormalizeDisjunctions(disj,\n clause,\n ...
[ "0.6443251", "0.64089215", "0.6074677", "0.5995137", "0.58688325", "0.5720804", "0.5696947", "0.5695756", "0.5695434", "0.5670252", "0.56636274", "0.56636274", "0.5454893", "0.5410893", "0.54107594", "0.53419995", "0.5327409", "0.5188059", "0.51802075", "0.5173974", "0.516951...
0.0
-1
Returns True if t is Eq(x,x) for some x
def is_tautology_equality(t): return type(t) is Eq and t.t1 == t.t2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def equals(x, y):\n return x == y", "def exact(cls, lhs, rhs):\n return lhs == rhs", "def __eq__(self, *args):\n return _ida_hexrays.cexpr_t___eq__(self, *args)", "def eq(self, y):\n return 1 - self.ne(y)", "def __eq__(self, other: t.Any) -> bool:\n return self._op_bool('__eq__',...
[ "0.6527325", "0.6335552", "0.62206423", "0.61665654", "0.6158353", "0.6072844", "0.606981", "0.6037759", "0.6037759", "0.6037759", "0.6037759", "0.6037759", "0.6037759", "0.6037759", "0.6037759", "0.6037759", "0.6037759", "0.6037759", "0.6037759", "0.6037759", "0.6037759", ...
0.69490355
0
Returns True if t is syntactially equal to u modulo alpha conversion
def equal_mod_alpha(t,u): def rec(t,u,m1,m2,n): if type(t) is Var and type(u) is Var: return m1.get(t,t) == m2.get(u,u) if type(t) in (ForAll, Exists, Lambda, NamedBinder) and type(t) is type(u): if len(t.variables) == len(u.variables): for v1,v2 in zip(t.vari...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def u_exact(t):\n return a * t + b", "def isalpha(self) -> bool:\n pass", "def oracle(ct: int) -> bool:\n return rsa.dec(ct) & 1 == 0", "def isAcute(trpl):\n vd = vectorFormat(trpl)\n if angle_between(*vd) < np.pi/2:\n return True\n else:\n return False", "def check_pali...
[ "0.58734155", "0.5778579", "0.5749819", "0.5632407", "0.55852145", "0.55829185", "0.5546565", "0.5520525", "0.55134135", "0.5501811", "0.5460695", "0.5449854", "0.54210347", "0.5412214", "0.538456", "0.5383626", "0.53737104", "0.5345897", "0.5311306", "0.5297979", "0.5283892"...
0.67610735
0
Retrieves the parameters from the User Interface and executes the appropriate commands.
def setupCentralFeature(): inputFC = ARCPY.GetParameterAsText(0) outputFC = ARCPY.GetParameterAsText(1) distanceMethod = ARCPY.GetParameterAsText(2).upper().replace(" ", "_") weightField = UTILS.getTextParameter(3, fieldName = True) potentialField = UTILS.getTextParameter(4, fieldName = True) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_interface() -> dict:\n args = _spawn_cli()\n\n if args['graphical_user_interface']:\n args = _spawn_gui()\n\n return args", "def cmd_user(args):", "def run(self):\n self._params = self.parsingcommands()\n self.start()", "def set_by_gui(self):\n\n # Use the GetFro...
[ "0.64933056", "0.63061106", "0.6163773", "0.6124755", "0.6104701", "0.6090645", "0.6065398", "0.60392755", "0.59720314", "0.5961228", "0.58988", "0.5890323", "0.5884006", "0.58813107", "0.585739", "0.5848049", "0.58280426", "0.5819351", "0.58124715", "0.58089554", "0.5807343"...
0.0
-1
Reports the Central Feature results as a message or to a file.
def report(self, fileName = None): header = ARCPY.GetIDMessage(84200) columns = [ARCPY.GetIDMessage(84191), ARCPY.GetIDMessage(84201), ARCPY.GetIDMessage(84202)] results = [ columns ] for case in self.uniqueCases: if not self.caseField: st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def report(self, result):\n raise NotImplementedError", "def report():\n pass", "def report(self):\n if self.integration.channels.n_mapping_channels > 0:\n msg = f'({self.get_mean_point_response()})'\n else:\n msg = '(---)'\n self.integration.comments.ap...
[ "0.6436226", "0.63747406", "0.6339677", "0.6156899", "0.6153056", "0.614563", "0.6017631", "0.6008375", "0.6001736", "0.59945923", "0.59724426", "0.5939775", "0.58608884", "0.58568907", "0.5841457", "0.5820173", "0.581097", "0.57991844", "0.5720601", "0.57149744", "0.5708021"...
0.5674634
24
Creates an Output Feature Class with the Directional Mean Results.
def createOutput(self, outputFC): #### Validate Output Workspace #### ERROR.checkOutputPath(outputFC) #### Shorthand Attributes #### ssdo = self.ssdo caseField = self.caseField #### Create Output Feature Class #### ARCPY.SetProgressor("default", ARCPY.GetIDMess...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetFeatureMeansOutput(self) -> \"itkDataObjectDecoratorVCUCD const *\":\n return _itkScalarImageToRunLengthFeaturesFilterPython.itkScalarImageToRunLengthFeaturesFilterIUS2_GetFeatureMeansOutput(self)", "def GetFeatureMeansOutput(self) -> \"itkDataObjectDecoratorVCUCD const *\":\n return _itkSca...
[ "0.6007328", "0.5953091", "0.5914813", "0.58763796", "0.5794096", "0.5764322", "0.56564254", "0.5608095", "0.55957776", "0.55957776", "0.55321646", "0.52677256", "0.5212198", "0.5199211", "0.51898897", "0.5150236", "0.5150236", "0.5136099", "0.5125028", "0.5106955", "0.507898...
0.46067312
94
Method used to calculate the distance between each feature in the dataset. The algorithm is near 0(n2). Effort to improve algorithn is currently underway.
def nsquaredDist(points, weights = None, potent = None, dType = "EUCLIDEAN"): n,k = NUM.shape(points) maxMinSumDist = 3.402823466E+38 if weights == None: weights = NUM.ones((n,), float) if potent == None: potent = NUM.zeros((n,), float) weightedPotential = weights * potent ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _calc_distance_features(self):\n d = ()\n for dx, dy in DIRECTIONS:\n if dx and dy:\n d += (list(self.__calc_distance(direction_x=dx, direction_y=dy)), )\n elif dx:\n tmp, _, _ = self.__calc_distance(direction_x=dx, direction_y=dy)\n ...
[ "0.7269883", "0.70110106", "0.68549025", "0.68144464", "0.67935103", "0.67327285", "0.67210007", "0.67199934", "0.6640506", "0.66104364", "0.66035396", "0.6600966", "0.6562376", "0.6559457", "0.654279", "0.6527522", "0.65272194", "0.6524415", "0.65215033", "0.6520606", "0.650...
0.0
-1
Unzip a file (zip_file), extract the contained files, and clean the useful files name.
def unzip_oxygen_files(zip_file): name_main_content = None name_left_menu = None list_img_files_to_save = list() files_unzipped = ZipFile(zip_file) for file_unzipped_name in files_unzipped.namelist(): if not file_unzipped_name.startswith('__MACOSX'): if file_unzipped_name.endswi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unzip_file(zip_file: str) -> None:\n destination = tempfile.mkdtemp(prefix='gaelo_pross_unzip_')\n with ZipFile(zip_file) as my_zip:\n for member in my_zip.namelist():\n filename = os.path.basename(member)\n # skip directories\n if not filen...
[ "0.7879227", "0.7851471", "0.7838017", "0.7399866", "0.72983783", "0.7179027", "0.7157811", "0.71029925", "0.70012826", "0.69726837", "0.69336355", "0.69276774", "0.685054", "0.6836097", "0.682251", "0.6815342", "0.68073237", "0.67946047", "0.67689204", "0.6732124", "0.671994...
0.7050054
8
Return the body part of HTML files.
def get_body(html_file_content): return findall("<body>(.*?)</body>", html_file_content, DOTALL)[0].decode("utf-8")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_body(html_page):\n soup = BeautifulSoup(open(html_page), 'html.parser')\n body = soup.find('body')\n return body", "def get_body_content(self):\n\n try:\n html_tree = parse_html_string(self.content)\n except:\n return ''\n\n html_root = html_tree.getroo...
[ "0.77461666", "0.7460988", "0.7410468", "0.7252582", "0.72338134", "0.69558644", "0.6863169", "0.66610724", "0.66539806", "0.665275", "0.6494882", "0.64808214", "0.6437959", "0.6399701", "0.63638884", "0.63097113", "0.6272104", "0.6268735", "0.62536013", "0.62374175", "0.6231...
0.7931815
0
Correct the diagram links into the main content body.
def correct_img_links(body_main_content, schema_name, list_name_image): for name_image in list_name_image: body_main_content = body_main_content.replace( "src=\"" + name_image + "\"", "src=\"{% static \"schema_viewer/oxygen/" + schema_name + "/" + name_image + "\" %}\"" ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fix_links():\n pass", "def append_links(self, lines, lang):\n lines.append(\"verbatim &nbsp;\")\n lines.append(\"section Links\")\n lines.append(\"external http://polcasaglia.blogspot.com Blog\")\n lines.append(\"external http://www.uisp-fe.it/calcio.php UISP\" )\n lines...
[ "0.63308895", "0.5643925", "0.55043316", "0.5476968", "0.5352855", "0.5346029", "0.53028953", "0.5257914", "0.5252659", "0.52249026", "0.52183926", "0.519567", "0.5179021", "0.5144104", "0.51285285", "0.5118393", "0.50887305", "0.50714946", "0.5056446", "0.50404006", "0.50282...
0.5835807
1
Correct the links to an element with a specified id within a page.
def correct_links(html_file, schema_name): return html_file.replace(schema_name.replace(".", "_") + "_xsd.html#", "#").replace("target=\"mainFrame\"", "")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def id_click(elem_id):\r\n css_click('#{}'.format(elem_id))", "def relink(self, link_id):", "def update_links(self):\n for a in self.book.xpath(\"//a[@href]\"):\n href = a.xpath(\"@href\")[0]\n index_list = a.xpath(\"@data-index\")\n \n ### If there is no d...
[ "0.5732867", "0.57129985", "0.5561037", "0.5431923", "0.5380251", "0.53681576", "0.5339433", "0.5337128", "0.52954435", "0.51980627", "0.51771003", "0.5171741", "0.5160099", "0.5103413", "0.5056982", "0.5039212", "0.5028696", "0.5026417", "0.5026249", "0.50201905", "0.5015862...
0.49036095
28
Create the final HTML oxygen files, with the common header, a specific left menu and the main body.
def create_html_file(body_left_menu, body_main_content): # Get the header fie and get it contents path_header = path.join( SITE_ROOT, 'schema_viewer', 'templates', 'schema_viewer', 'oxygen', 'header_oxygen_template.html' ) file_header = open(path_header, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def common_header_part1(outfile: TextIO, title: str, indexpath: str = \"\") -> None:\n outfile.write(\"<!DOCTYPE HTML>\\n\")\n outfile.write(\"<html lang=\\\"en\\\">\\n\")\n outfile.write(\" <head>\\n\")\n outfile.write(\" <!-- Google tag (gtag.js) -->\\n\")\n outfile.write(\" <script async src=\...
[ "0.61840135", "0.615706", "0.6106681", "0.59005207", "0.58948696", "0.5833731", "0.57632947", "0.57230896", "0.57106525", "0.57040775", "0.56784046", "0.5634475", "0.56243837", "0.5544781", "0.5540921", "0.5534541", "0.55281717", "0.55029094", "0.5502361", "0.5495124", "0.549...
0.7858279
0
Delete the previous version of the oxygen files in case of an update.
def delete_previous_files(schema_name, path_template, path_static): list_file_static = listdir(path_static) list_file_template = listdir(path_template) if schema_name in list_file_static: tree_path = path.join(path_static, schema_name) rmtree(tree_path, ignore_errors=True) html_file_name...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_version(self):\n pass", "def cleanup(self):\n files = self.nlst()\n latest = self.latest_filename\n for filename in files:\n if filename != latest:\n result = self.delete(filename)\n logger.info(f\"Deleted old export from FTP: {resul...
[ "0.671009", "0.6189813", "0.6089963", "0.60492635", "0.5967357", "0.5963805", "0.59523124", "0.58832395", "0.5855765", "0.58287776", "0.5819642", "0.5810277", "0.5799433", "0.579169", "0.5766293", "0.5758868", "0.57391065", "0.5717249", "0.5716283", "0.5714396", "0.57026523",...
0.5372125
69
Save the oxygen treated files.
def save_file(schema_name, unzipped_file, list_name_img, html_file_content): # Create the different paths base_path = path.join(SITE_ROOT, 'schema_viewer') path_template = path.join(base_path, 'templates', 'schema_viewer', 'oxygen') path_static = path.join(base_path, 'static', 'schema_viewer', 'oxygen'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self):\n super(YacoFile, self).save(self._filename)", "def save(self):\n # TODO: save the file", "def save(self):\n file = open(self.path, 'w')\n self.parser.write(file)\n file.close()", "def save(self):\n if PYTHON3:\n fileobj = open(self.filenam...
[ "0.64760363", "0.61626124", "0.61587566", "0.6028327", "0.6016403", "0.60064465", "0.60013676", "0.5986529", "0.59179187", "0.59133315", "0.58921486", "0.5864421", "0.58638525", "0.5859094", "0.5845023", "0.5842954", "0.58204085", "0.57929534", "0.5788086", "0.57738835", "0.5...
0.0
-1
Delete the drop list on the left menu.
def delete_menu(body_left_menu): return sub("<form (.*?) </form>", "", body_left_menu, flags=DOTALL)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_menu():", "def leftdelalllistitems(self):\n self._leftlist.delete()", "def rightdelalllistitems(self):\n self._rightlist.delete()", "def delete(self, *args):\n if self.cur == Win.left:\n self.commands.delpl([])\n else:\n cur_song = self.rightwin.hi...
[ "0.7733161", "0.7365979", "0.6736597", "0.66517335", "0.6495857", "0.6299191", "0.6218803", "0.6123064", "0.6118206", "0.6067442", "0.60464346", "0.60106766", "0.6008462", "0.60053957", "0.6001826", "0.5995467", "0.5929168", "0.5919876", "0.591443", "0.588858", "0.5830762", ...
0.6306563
5
Check if the files are name the right way.
def is_correct_name(name_left_menu, name_main_content, schema_name): return name_main_content.startswith(schema_name.replace(".", "_")) and name_left_menu.startswith(schema_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_valid_file_name(self, file_name, input_output):\n if self.check_file_exists (file_name):\n if self.check_file_name_extensions (file_name, input_output):\n return True\n else:\n return False\n else:\n print (\"File does not exist...
[ "0.71929294", "0.7132529", "0.7119266", "0.7111831", "0.70485663", "0.6969248", "0.6935903", "0.69152814", "0.69132406", "0.68058664", "0.6759821", "0.67477936", "0.67245626", "0.6688093", "0.6649612", "0.6649612", "0.6649612", "0.6649267", "0.6627869", "0.6600657", "0.653856...
0.0
-1
Delete the floating global control on the main content.
def del_global_control(body_main_content): return sub("<div id=\"global_controls\" (.*?) </div>", "", body_main_content, flags=DOTALL)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DelDiv(self):\n if self.created:\n self.CloseImage()\n command = \"\"\"$('#{}').remove();\"\"\".format(self.wid)\n get_ipython().run_cell_magic('javascript', '', command)\n self.created = False\n self.wid = uuid.uuid4().hex", "def OnCloseFloatingP...
[ "0.6569426", "0.6322288", "0.6220098", "0.61642945", "0.6048335", "0.6038787", "0.599455", "0.598732", "0.5944671", "0.5929435", "0.5899441", "0.5881212", "0.5822167", "0.5811097", "0.5805517", "0.5760576", "0.5734409", "0.57206446", "0.5712142", "0.5706464", "0.5681028", "...
0.6487117
1
Is called when model is initialized.
def __init__(self, image_channels, num_classes): super().__init__() self.model = torchvision.models.resnet18(pretrained=True) self.model.fully_connected = nn.Linear(224, 10)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_model(self):\n pass", "def init_model(self):\n pass", "def initialize(self, model):\n pass", "def onInit(self):\n pass", "def __init__(self):\n self.model = None", "def __init__(self):\n self.model = None", "def post_init(self):\n\t\tpass", "def ...
[ "0.87021303", "0.8675239", "0.8595884", "0.7529007", "0.7524197", "0.7524197", "0.74977756", "0.7488579", "0.7450165", "0.73805875", "0.73642135", "0.7351956", "0.73474675", "0.7244248", "0.72271895", "0.72271895", "0.71926934", "0.7177532", "0.71773064", "0.71741855", "0.717...
0.0
-1
Performs a forward pass through the model
def forward(self, x): #batch_size = x.shape[0] out = self.model(x) return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self):\n pass", "def forward(self):\n pass", "def forward(self, forward):\n\n self._forward = forward", "def forward(self, *args, **kwargs):\n pass", "def forward_pass(self):", "def forward(self):\n raise NotImplemented", "def forward(self):\n raise...
[ "0.7781306", "0.7781306", "0.75729156", "0.75230056", "0.7505109", "0.74263227", "0.74263227", "0.74263227", "0.73245245", "0.7310507", "0.7309029", "0.73008585", "0.7245502", "0.7235511", "0.7235511", "0.72333467", "0.71885544", "0.7169972", "0.7169972", "0.7139009", "0.7115...
0.6689024
53
Test all feasible Mysql types.
def test_data_types(sdc_builder, sdc_executor, database, sql_type, insert_fragment, expected_type, expected_value, keep_data): table_name = get_random_string(string.ascii_lowercase, 20) connection = database.engine.connect() try: # Create table connection.execute(f""" CREATE TABL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def meets_condition(db_type: str):\n\t\t...", "def _check_sql_mode(self, **kwargs):\n return []", "def test_selectable_orm(self):\n b = SQLAlchemyBuilder(selectable=self.datatypes_table)\n type_examples = \"\"\"\n [score] -> num\n score ...
[ "0.645035", "0.63011086", "0.6299865", "0.61006", "0.5945623", "0.58826905", "0.58359575", "0.5807354", "0.57903266", "0.5706516", "0.56834126", "0.5640781", "0.5626899", "0.56115544", "0.55312985", "0.551172", "0.5480632", "0.5480241", "0.54659134", "0.5460469", "0.54514587"...
0.5347046
27
deques the frames and runs prediction network on them.
def _process(self): while True: with Timer() as data_timer: frame = self._frames_q.get() with Timer() as agent_timer: s, frame_metadata = self._unwrap_frame(frame) s = np.expand_dims(s, 0) # batch act = self.pred(s)[0][0].argmax() put_overwrite(self._actions_q, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __predict(self):\n frame_ind = 0\n while True:\n if not self.__queue_frame.empty():\n frame_ind += 1\n frame = self.__queue_frame.get()\n self.detector_lock.acquire()\n rects, probs, classesID = self.detect_frame(frame)\n ...
[ "0.66556954", "0.6258876", "0.6240899", "0.618182", "0.61364746", "0.61184543", "0.6099741", "0.60250056", "0.60198146", "0.5992484", "0.598858", "0.59394705", "0.5863917", "0.58249295", "0.5809526", "0.57778484", "0.5756796", "0.57393205", "0.57242197", "0.5709892", "0.57000...
0.6108806
6
Returns data, trajectories, and trajcategories
def get_all_data(self, tids=None, uids=None, cids=None): arg_tids = tids arg_uids = uids arg_cids = cids if tids is None: tids = self.tids if uids is None: uids = self.uids if cids is None: cids = self.cids tids = set(tids) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_trajectories_feature(self):\n if self.df_feature is not None:\n return self.df_feature\n trajs_feature = [traj.get_basic_feature() for traj in self.trajectories]\n self.df_feature = pd.DataFrame(trajs_feature)\n self.df_feature[\"LABEL\"] = self.df[\"LABEL\"]\n ...
[ "0.5957784", "0.5917458", "0.5876374", "0.57930994", "0.565999", "0.55378914", "0.55311126", "0.5477821", "0.54587895", "0.541768", "0.54167956", "0.5406964", "0.5402507", "0.5381969", "0.5371459", "0.53617156", "0.53342634", "0.53302366", "0.5322792", "0.5321513", "0.5294451...
0.49892798
67
filters data that have at least $at_least $x unique values per $per
def filter_x_per_y(df, at_least, x, per): return df.groupby(per, as_index=False, sort=False).filter( lambda g: g[x].nunique() >= at_least )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_toofew_toolong(df, min_each_group, max_length):\n df = df[~(df.question.apply(lambda x : len(x)) > max_length)]\n\n counts = df[\"index\"].value_counts()\n idxs = np.array(counts.index)\n \n # index numbers of groups with count >= mineachgroup\n list_idx = [i for i, c in zip(idxs, coun...
[ "0.55409527", "0.55308944", "0.55091226", "0.5428687", "0.5395138", "0.53877074", "0.5354342", "0.5341396", "0.52779645", "0.5227017", "0.51802427", "0.51764864", "0.51556313", "0.5132215", "0.51163405", "0.51158553", "0.5110208", "0.510321", "0.50508755", "0.5044529", "0.503...
0.798085
0
Receives a DBSReader object and finds out whether it's pointing to Global DBS (no matter whether it's production or the preproduction instance).
def isGlobalDBS(dbs): try: url = urlparse(dbs.dbsURL) if url.hostname.startswith('cmsweb'): if url.path.startswith('/dbs/prod/global') or url.path.startswith('/dbs/int/global'): return True except Exception as ex: logging.error("Failed to find out whether DBS ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_gisdbase():\n global current_gisdbase\n return current_gisdbase", "async def casino_is_global(self):\n return await self.db.Settings.Global()", "def is_on_dbsnp(row):\n is_on_dbsnp = 1\n\n if row[\"dbsnp\"] == \"-\":\n is_on_dbsnp = 0\n\n return is_on_dbsnp", "def...
[ "0.52581006", "0.5185863", "0.51744187", "0.51528794", "0.5043897", "0.50279176", "0.5004774", "0.500209", "0.49769497", "0.49480417", "0.49011204", "0.48366022", "0.48357213", "0.48242038", "0.4815816", "0.48043567", "0.47987908", "0.47840345", "0.47834823", "0.47745487", "0...
0.7254706
0
Check whether we're handling a block or a dataset
def isDataset(inputData): if '#' in inputData.split('/')[-1]: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_block(self):\n\t\treturn self.name in get_elements_collection(self.__res, 'block_level')", "def check_block(self, block):\n pass", "def is_dataset(self):\n return self._dataset is not None", "def is_valid(self, dataset):\n pass", "def _check_block_type():\n \n \n maxBlock...
[ "0.6642541", "0.6571856", "0.6351768", "0.6229571", "0.60271245", "0.5995095", "0.5977335", "0.59726757", "0.59427077", "0.59242815", "0.5867659", "0.5792803", "0.57652533", "0.5763878", "0.5760709", "0.57508045", "0.57508045", "0.5722193", "0.57106143", "0.57044363", "0.5692...
0.5535452
29
Get data location from Rucio. Location is mapped to the actual sites associated with them, so PSNs are actually returned
def locationsFromRucio(self, dataItems, rucioAcct): result = defaultdict(set) self.logger.info("Fetching location from Rucio for account: %s", rucioAcct) for dataItem in dataItems: try: dataLocations = self.rucio.getDataLockedAndAvailable(name=dataItem, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_location(self):\n\t\treturn self.location", "def location_data(self) -> pulumi.Output[Optional['outputs.LocationDataResponse']]:\n return pulumi.get(self, \"location_data\")", "def get_location(self):\n return self.request({\n \"path\": \"/\" + UUID + \"/location\"\n })"...
[ "0.66687316", "0.66027284", "0.65894485", "0.6579517", "0.6561672", "0.6553024", "0.6507655", "0.6507655", "0.6507655", "0.6507655", "0.6507655", "0.6507655", "0.6507655", "0.6507655", "0.6507655", "0.6507655", "0.6507655", "0.6507655", "0.6507655", "0.6507655", "0.6507655", ...
0.6383166
35
Get data location from dbs
def locationsFromDBS(self, dbs, dataItems): result = defaultdict(set) for dataItem in dataItems: try: if isDataset(dataItem): phedexNodeNames = dbs.listDatasetLocation(dataItem) else: phedexNodeNames = dbs.listFileBlockL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_loc(self):\n\t\treturn self.__dbfile", "def __get_location(self) -> str:\n\t\treturn os.getenv('SQLITE_DRIVER_LOCATION', 'db.sqlite')", "def get_datasource_of():\n global datasource_of\n\n if not datasource_of:\n datasource_of = stixhelpers.datasource_of()\n \n return datasource_of"...
[ "0.6616532", "0.6296066", "0.6252961", "0.62318724", "0.6225313", "0.61788684", "0.61649096", "0.61381984", "0.60394216", "0.60271424", "0.59884375", "0.5912525", "0.5897254", "0.5876116", "0.5872178", "0.58330953", "0.582461", "0.58245146", "0.5800512", "0.57918423", "0.5775...
0.6312537
1
Sort items by dbs instances return dict with DBSReader as key & data items as values
def organiseByDbs(self, dataItems): itemsByDbs = defaultdict(list) for item in dataItems: if ACDCBlock.checkBlockName(item['name']): # if it is acdc block don't update location. location should be # inserted when block is queued and not supposed to change ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sortdb():\n return sorted(donor_db.items(), key=sumdbkey, reverse=True)", "def read_db():\n f_result = []\n result = execute_query('select sitename, id from {} order by sitename;'.format(TABLES[0]))\n sites = [(x['sitename'], x['id']) for x in result]\n for sitename, site_id in sites:\n ...
[ "0.6100124", "0.5767866", "0.5482177", "0.5375432", "0.52297914", "0.517466", "0.51589227", "0.51308376", "0.5080761", "0.50783294", "0.5067629", "0.5035221", "0.50315094", "0.5030121", "0.50266075", "0.5023428", "0.5004768", "0.50018305", "0.4949546", "0.49456415", "0.494003...
0.62622225
0
Initialize your data structure here.
def __init__(self, n: int):        self.rows = [[n, -1] for _ in range(n)]        self.cols = [[n, -1] for _ in range(n)]        self.diag = [[n, -1], [n, -1]] # 0 for normal, 1 for anti            def move(self, row: int, col: int, player: int) -> int:        r1, r2 = self.check(self.rows, row, player), self.che...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_empty(self):\n self._data = []", "def __init__(self):\n self._data = []", "def __init__(self):\n self._data = []", "def __init__(self):\n self._data = []", "def __init__(self):\n self._data = []", "def __init__(self):\n self._data = []", "def __init__...
[ "0.7765608", "0.7645274", "0.7645274", "0.7645274", "0.7645274", "0.7645274", "0.7645274", "0.7595176", "0.75853467", "0.7558298", "0.7530608", "0.7530608", "0.7530608", "0.7530608", "0.7530608", "0.74971247", "0.74971247", "0.7478105", "0.7477832", "0.7477832", "0.7477832", ...
0.0
-1
Hjorth's Complexity and Parameters Hjorth Parameters are indicators of statistical properties initially introduced by Hjorth (1970) to describe the general characteristics of an EEG trace in a few quantitative terms, but which can applied to any time series. The parameters are activity, mobility, and complexity. NeuroK...
def complexity_hjorth(signal): # Sanity checks if isinstance(signal, (np.ndarray, pd.DataFrame)) and signal.ndim > 1: raise ValueError( "Multidimensional inputs (e.g., matrices or multichannel data) are not supported yet." ) # Calculate derivatives dx = np.diff(signal) d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def doParametersOfInterest(self):\n \n self.modelBuilder.doVar('expr::cosW(\"0.87681811112\",)')\n self.modelBuilder.doVar('expr::sinW(\"0.48082221247\",)')\n self.modelBuilder.doVar('expr::mZ(\"91.2\",)')\n self.modelBuilder.doVar('expr::Lambda1(\"100.0\",)')\n self.modelBui...
[ "0.6022703", "0.57704234", "0.5730367", "0.56339955", "0.5561419", "0.5557344", "0.5556481", "0.5482355", "0.548171", "0.548036", "0.54543763", "0.5435389", "0.5425596", "0.5410607", "0.5403748", "0.5390412", "0.537292", "0.5371755", "0.5351225", "0.53323776", "0.531349", "...
0.71381897
0
Initialize the Application given a system.
def __init__(self, system, *args, **kwargs): # Initialize the application as a tkinter.Tk object tkinter.Tk.__init__(self, *args, **kwargs) self.title("Foveated Vision System") self.configure(bg="lightgray", width=1200, height=800) self.resizable(width=False, height=False)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_application(self):\n pass", "def initialize(self, application):", "def initialize():\n environment = Environment()\n environment.setup()", "def init_app(args, setup_logging=True):\n if setup_logging:\n pyramid.paster.setup_logging(args.config)\n settings = pyramid.past...
[ "0.6723451", "0.6705834", "0.62384826", "0.622743", "0.61934197", "0.6075346", "0.59855795", "0.59793085", "0.5969467", "0.5965201", "0.59624267", "0.5955624", "0.59332913", "0.5872671", "0.58487064", "0.58303475", "0.57860106", "0.57808584", "0.5745589", "0.57177776", "0.571...
0.0
-1
Update the images that are displayed from the video stream.
def update(self): # Update the vision frames in the system self._system.update() # Create blank PIL images to hold the video streams layered = PIL.Image.new('RGBA', (400, 400)) stacked = PIL.Image.new('RGBA', (200, 800)) control = PIL.Image.new('RGBA', (600, 800...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self):\n print('VIDEO: Video Stream started')\n while True:\n if self.stopped:\n return\n (self.grabbed, self.frame) = self.stream.read()", "def viewUpdate(self):\n # Update Capture\n imgtk = self.model.capture\n self.updateImage(...
[ "0.67444074", "0.6730207", "0.6720518", "0.67168564", "0.6591318", "0.657772", "0.6577194", "0.64696455", "0.6445771", "0.64267576", "0.64083344", "0.6405238", "0.6402562", "0.6371376", "0.6345765", "0.63317454", "0.62935567", "0.62902534", "0.6285674", "0.6278713", "0.626501...
0.7045872
0
Update the vision choices when a new device is selected.
def updateDevice(self, *args): # Update the list of vision choices and the default vision choice self._appChoice["vision"] = [choice[0] for choice in self._system[self._appString["device"].get()]] self._appString["vision"].set(self._appChoice["vision"][0]) # Delete the old choice...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateVision(self, *args):\r\n\r\n # Update the list of frame choices and the default frame choice\r\n self._appChoice[\"frame\"] = [choice[0] for choice in self._system[self._appString[\"device\"].get()][self._appString[\"vision\"].get()]]\r\n self._appString[\"frame\"].set(self._appChoic...
[ "0.68089235", "0.59843624", "0.5973282", "0.5937724", "0.5828414", "0.58241105", "0.5739061", "0.56566024", "0.56519794", "0.5624004", "0.5604147", "0.5591249", "0.55712897", "0.5546274", "0.5538931", "0.54759663", "0.54590356", "0.54416597", "0.54367846", "0.54256344", "0.54...
0.82246095
0
Update the frame choices whena new vision is selected.
def updateVision(self, *args): # Update the list of frame choices and the default frame choice self._appChoice["frame"] = [choice[0] for choice in self._system[self._appString["device"].get()][self._appString["vision"].get()]] self._appString["frame"].set(self._appChoice["frame"][0]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slider_frames_changed(self):\n\n # Again, please note the difference between indexing and GUI displays.\n index = self.slider_frames.value() - 1\n\n # Differentiate between frame ordering (by quality or chronologically).\n if self.frame_ordering == \"quality\":\n self.fra...
[ "0.67221683", "0.647668", "0.6142463", "0.60368323", "0.6010365", "0.59839", "0.594206", "0.5939723", "0.5774318", "0.57701164", "0.5685508", "0.56649303", "0.5623016", "0.5616354", "0.5597576", "0.55696803", "0.5566506", "0.5529806", "0.5504718", "0.54967684", "0.5455349", ...
0.777694
0
Creates an interactive echelle environment with a variable deltanu slider. If you're working in a Jupyter notebook/lab environment, you must call `%matplotlib notebook` before running this.
def interact_echelle( freq, power, dnu_min, dnu_max, step=None, cmap="BuPu", ax=None, smooth=False, smooth_filter_width=50.0, scale=None, return_coords=False, backend="bokeh", notebook_url="localhost:8888", plot_method="fast", sampling=2, **kwargs ): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def editor_example():\n agent_sensors = [sensors.RGBCamera, sensors.LocationSensor, sensors.VelocitySensor]\n agent = AgentDefinition(\"uav0\", agents.UavAgent, agent_sensors)\n env = HolodeckEnvironment([agent], start_world=False)\n env.agents[\"uav0\"].set_control_scheme(1)\n command = [0, 0, 10, ...
[ "0.54224694", "0.52515614", "0.5237333", "0.5127714", "0.5104529", "0.5093767", "0.50813234", "0.5066324", "0.4892671", "0.48902854", "0.48725274", "0.48507506", "0.48250785", "0.48107544", "0.47614673", "0.4716767", "0.46999207", "0.46977425", "0.46767718", "0.4671984", "0.4...
0.4808876
14
Creates a color palette compatible with Bokeh from a matplotlib cmap name.
def get_bokeh_palette(cmap): from bokeh.colors import RGB from matplotlib import cm # Solution adapted from # https://stackoverflow.com/questions/31883097/elegant-way-to-match-a-string-to-a-random-color-matplotlib m_RGB = (255 * plt.get_cmap(cmap)(range(256))).astype("int") return [RGB(*tuple(r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def palette_from_mpl_name(name):\n if name in CMAPS:\n return CMAPS[name]\n\n rgba = plt.get_cmap(name)(np.linspace(0, 1, 256))\n palette = [to_hex(color) for color in rgba]\n return palette", "def get_palette(palette_name):\n\n if hasattr(plt.cm, palette_name):\n cmap = getattr(plt....
[ "0.8101128", "0.6942909", "0.6776598", "0.6741528", "0.6741528", "0.66666794", "0.66659963", "0.66659963", "0.66659963", "0.6503461", "0.6470813", "0.6413775", "0.63696545", "0.6352337", "0.631037", "0.61285675", "0.61251086", "0.6121512", "0.6044165", "0.60116994", "0.601053...
0.6990008
1
instead of return a cursor object, find_one() returns one document. so when you look up document by it's _id (_id field is always unique), use find_one() method.
def find_one(): fmter.tpl._straightline("one document", 100) result = users.find_one({}) print(type(result)) ppt(result) fmter.tpl._straightline("none result", 100) result = users.find_one({"_id": 100}) print(type(result)) ppt(result)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_one(self, collection, query):\n obj = getattr(self.db, collection)\n result = obj.find_one(query)\n return result", "def first(self, **kwargs):\n return self.find(**kwargs).first()", "def one(self):\n try:\n return self[0]\n except IndexError:\n raise self.d...
[ "0.7754107", "0.7186727", "0.7182808", "0.715503", "0.69664955", "0.6931495", "0.69100857", "0.6904317", "0.6898412", "0.6841113", "0.68210936", "0.6808862", "0.679702", "0.6777635", "0.67716956", "0.6718852", "0.6685826", "0.66839063", "0.66428053", "0.6642651", "0.66407835"...
0.7955518
0
because document can be nested, so you can use field.sub_field.subfield. ... to access children fields
def dot_notation(): ppt(list( users.find({"profile.enthnicity": "asian"}) ))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subfield():\n return Subfield()", "def _get_nested(nested_dict, field):\n print(nested_dict, field)\n keys = field.split('.')\n current = nested_dict\n for k in keys:\n print('key', k, 'current', current)\n # return None for nested fields without a value i...
[ "0.7141398", "0.6325323", "0.628575", "0.62599593", "0.6144266", "0.59896255", "0.5943311", "0.58616906", "0.5857536", "0.5824355", "0.57983726", "0.5751088", "0.56624633", "0.56524676", "0.5632159", "0.56152475", "0.56012654", "0.5580025", "0.5523471", "0.5508865", "0.549159...
0.0
-1
Fills out the model by invoking C{svnlook}
def _populateModel(self): self.repoPath = self.argv[1] self.rev = self.argv[2] self.model.rev = self.rev self.model.repo = os.path.split(self.repoPath)[-1] self.prefix = (self.addRepoPrefix() and ('/' + self.model.repo)) or '' # First, get the user and log message ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_model(self):\n pass # TODO: Implement this.", "def build_model():", "def update_model(self):\n pass", "def updateModel(self):\n pass", "def loadAdjustedModel(self):\r\n # Load model in GUI\r\n addModel(self.trcFilePath.replace('.trc','.osim'))", "def makeMod...
[ "0.5480063", "0.54420656", "0.5437654", "0.53411984", "0.5257772", "0.5196333", "0.51816934", "0.50881743", "0.5072814", "0.50495183", "0.50386804", "0.5009755", "0.499261", "0.49754384", "0.49611595", "0.49506703", "0.49395007", "0.4916408", "0.4916408", "0.49122566", "0.491...
0.69316125
0
Gera o codigo rml do cabecalho
def cabecalho(dic_cabecalho,dat_ordem,imagem): tmp='' tmp+='\t\t\t\t<image x="4.1cm" y="26.9cm" width="74" height="60" file="' + imagem + '"/>\n' tmp+='\t\t\t\t<lines>3.3cm 26.3cm 19.5cm 26.3cm</lines>\n' tmp+='\t\t\t\t<setFont name="Helvetica-Bold" size="15"/>\n' tmp+='\t\t\t\t<drawString x="6.7cm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(self):", "def mezclar_bolsa(self):", "def load_ccs9():\n ccs9 = pd.read_csv(pkg_resources.resource_filename(__name__,'$dxref 2015.csv'))\n ccs9 = ccs9.reset_index()\n for col in ccs9.columns:\n ccs9.loc[:,col]=ccs9[col].str.strip('\\'')\n ccs9.columns=ccs9.iloc[0,:]\n ccs9 = ccs9...
[ "0.55839115", "0.55125", "0.53216106", "0.5215636", "0.5121315", "0.5116958", "0.51138484", "0.5088174", "0.49747437", "0.4962377", "0.49491808", "0.49370742", "0.4935785", "0.4934977", "0.49025398", "0.4889983", "0.48558292", "0.4849866", "0.48489085", "0.48460174", "0.48455...
0.55939573
0
Gera o codigo rml do rodape
def rodape(lst_rodape): tmp='' tmp='' tmp+='\t\t\t\t<lines>3.3cm 2.2cm 19.5cm 2.2cm</lines>\n' tmp+='\t\t\t\t<setFont name="Helvetica" size="8"/>\n' tmp+='\t\t\t\t<drawString x="3.3cm" y="2.4cm">' + lst_rodape[2] + '</drawString>\n' tmp+='\t\t\t\t<drawString x="18.4cm" y="2.4cm">Página <pageNum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rop():\n return", "def lro(self) -> global___Snippet.Lro:", "def get_rouge(ref_path, pred_path):\n print(\"###########cal rouge###############\")\n source_lines = [line.strip() for line in codecs.open(ref_path, \"r\", \"utf-8\").readlines()]\n pred_lines = [ pred.strip() for pred in codecs.open(pred_...
[ "0.6016394", "0.598565", "0.5746635", "0.5739094", "0.55431193", "0.55244523", "0.5518214", "0.543907", "0.54066896", "0.53700364", "0.5345745", "0.5305402", "0.52925533", "0.5265397", "0.5254321", "0.5248294", "0.52093405", "0.5157794", "0.5145444", "0.51160425", "0.5107024"...
0.50784093
24
Gera o codigo rml que define o estilo dos paragrafos
def paraStyle(): tmp='' tmp+='\t<stylesheet>\n' tmp+='\t\t<blockTableStyle id="Standard_Outline">\n' tmp+='\t\t\t<blockAlignment value="LEFT"/>\n' tmp+='\t\t\t<blockValign value="TOP"/>\n' tmp+='\t\t</blockTableStyle>\n' tmp+='\t\t<initialize>\n' tmp+='\t\t\t<paraStyle name="all" alignm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def define_parameters(self):", "def parameters(self):", "def doParametersOfInterest(self):\n\n self.modelBuilder.doVar(\"Afb[0.6,-0.70,0.70]\");\n self.modelBuilder.doSet(\"POI\",\"Afb\")\n\n # ss templates\n self.modelBuilder.doVar(\"Rdy_mumu_ss[1.0,0.0,10.0]\");\n self.mode...
[ "0.64564425", "0.6269693", "0.604923", "0.6017091", "0.59432966", "0.5927661", "0.5904071", "0.58930105", "0.5876353", "0.58385175", "0.58262694", "0.5811515", "0.57941467", "0.57618046", "0.5759846", "0.5745511", "0.5650662", "0.5646204", "0.5636251", "0.5623941", "0.5610162...
0.0
-1
Funcao que gera o codigo rml da sessao plenaria
def pauta(lst_splen, lst_pauta): tmp='' #inicio do bloco tmp+='\t<story>\n' for dicsp in lst_splen: #sessao plenaria if dicsp['sessao']!=None: tmp+='\t\t<para style="P0">' + dicsp['sessao'].replace('&','&amp;') +', EM ' + dicsp['datasessao'].replace('&','&amp;')+ '</para>...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def session(self):", "def get_or_create_session(db):", "def save_inscription():\n user = None\n f = InscriptionForm()\n if f.validate_on_submit() and f.uniq_Username() and f.passwd_confirmed():\n from hashlib import sha256\n m = sha256()\n m.update(f.get_mdp().encode())\n u...
[ "0.62706566", "0.58388746", "0.5836526", "0.57945734", "0.57002115", "0.56958556", "0.56462306", "0.56462306", "0.5479111", "0.54686075", "0.544465", "0.543805", "0.5410522", "0.5397467", "0.53923786", "0.5386921", "0.5382159", "0.5382095", "0.53573304", "0.53492916", "0.5332...
0.0
-1
Gera o codigo rml da assinatura
def presidente(lst_presidente): tmp='' tmp+='\t\t<para style="P3">\n' tmp+='\t\t\t<font color="white"> </font>\n' tmp+='\t\t</para>\n' tmp+='\t\t<para style="P3">\n' tmp+='\t\t\t<font color="white"> </font>\n' tmp+='\t\t</para>\n' tmp+='\t\t<para style="P3" spaceAfter="40">\n' tmp+='...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_ir(self):", "def mezclar_bolsa(self):", "def __str__(self):\n return self.idBaixasReceber", "def cliquer_sur_unité(self):", "def encode(category_main : ):", "def __init__(self,obj):\n self.nature_libelle = obj['NatureLibelle']\n self.ins_nom = obj['InsNom']\n self.i...
[ "0.5959136", "0.5499816", "0.54604596", "0.5433409", "0.53827584", "0.52883506", "0.5285676", "0.5262863", "0.5205403", "0.5198016", "0.51858664", "0.5181811", "0.5152689", "0.51158124", "0.5115277", "0.510677", "0.5100671", "0.50992584", "0.50992584", "0.50992584", "0.507903...
0.0
-1
Initializes a storage manager instance.
def __init__(self, app): self.app = app self.config = app.config['FILE_STORAGE'] self.secur = app.config['SECURITY_MANAGEMENT']['content'] if self.config['type'] == 's3': # Boto s3 instance if self.config['id'] != '' and self.config['key'] != '': s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n config = self.read_config()\n self.deployment = config['deployment']\n self.deployment_config = config[self.deployment]\n logger.info(f'Initializing storage client with the {self.deployment} deployment config {pformat(self.deployment_config)}')\n\n # get the...
[ "0.6641924", "0.6619307", "0.6612643", "0.6593752", "0.6475286", "0.6464472", "0.63604945", "0.63438195", "0.62690544", "0.62511116", "0.6243224", "0.6091188", "0.6026038", "0.60204107", "0.6006953", "0.5971609", "0.59692246", "0.59356165", "0.592682", "0.59250253", "0.592312...
0.0
-1
Retreive a file from the file storage.
def storage_get_file(self, group='', key=''): try: obj = None content = None if key != '': if self.config['type'] == 's3': obj = self.s3.Object(bucket_name=self.bucket, key='corr-{0}s/{1}'.format(group,key)) res = obj.ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, filename, **kw):\n\n file_path = os.path.join(self.storage_path, filename)\n try:\n file_obj = open(file_path, \"r\")\n except IOError:\n return\n else:\n return file_obj.read()", "def get_file(URI):\n return file_fabric.get_class(URI)...
[ "0.78756535", "0.7461347", "0.7436858", "0.7395782", "0.7368263", "0.7213877", "0.72103053", "0.713844", "0.7136062", "0.7094323", "0.7046528", "0.70224756", "0.6999044", "0.6987379", "0.6954168", "0.6929677", "0.6907303", "0.6901869", "0.68689317", "0.6859872", "0.6847875", ...
0.74737984
1
Make sure a content is free of malicious data. It called the antivirus ClamAV through its python interface to do the job.
def is_safe(self, content=None): if not self.secur: return [True, "Security is not required."] else: if content is not None: cd = clamd.ClamdUnixSocket() if cd.ping() == 'PONG': cd.reload() file_buffer = Byte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_vulnerability(self):\n\t\tpass", "def test_verifyDamaged(self):\n self.testObject.content.setContent('garbage!')\n self.assertRaises(CorruptObject, self.testObject.verify)", "def malicious(self):\n return self.probably_malicious", "def test_kyc_post_legal_share_holder(self):\n ...
[ "0.6266415", "0.606212", "0.5981505", "0.58764136", "0.56155235", "0.5567562", "0.5503536", "0.5503536", "0.54759705", "0.54505795", "0.53994906", "0.5343958", "0.53100395", "0.52728504", "0.52579534", "0.52579534", "0.51845664", "0.5134979", "0.5133656", "0.5132123", "0.5127...
0.57496166
4
Upload a file into the s3 bucket.
def storage_upload_file(self, file_meta=None, file_obj=None): if file_meta != None and file_obj != None: m = hashlib.md5() if file_meta.location == 'local': dest_filename = file_meta.storage try: group = 'corr-resources' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upload_object(self, file_path, s3_path):\n logging.info(\"Uploading file to \\\"{}\\\" to S3\".format(s3_path))\n bucket_name, key = S3Util.get_bucket_and_key(s3_path)\n self.s3_resource.Bucket(bucket_name).upload_file(file_path, key)", "def _upload_s3(self, filename, bucket, objectKey):...
[ "0.86530435", "0.8389777", "0.8361179", "0.8325962", "0.8258803", "0.825059", "0.8241126", "0.82018214", "0.8064815", "0.8038341", "0.80270815", "0.79748935", "0.7933823", "0.78858334", "0.78781134", "0.7859663", "0.7847567", "0.78461665", "0.783782", "0.7817148", "0.7810306"...
0.0
-1
Agent function that deletes a file in the storage.
def agent_delete(self, group, path, key): found = False for file_path in glob.glob('{0}/corr-{1}s'.format(path, group)): if key in file_path: os.remove(file_path) found = True break return found
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, filename, **kw):\n\n file_path = os.path.join(self.storage_path, filename)\n\n try:\n os.remove(file_path)\n except OSError:\n pass", "def delete(self, filename):\n pass", "def delete(self, host, file):", "def delete_file(filename):\n\tprint ...
[ "0.78285897", "0.7648353", "0.7642585", "0.760645", "0.76037663", "0.74779713", "0.74424183", "0.7431991", "0.7220687", "0.7075886", "0.7070949", "0.7070422", "0.70667434", "0.7064232", "0.7057947", "0.7055706", "0.70467263", "0.703922", "0.7017835", "0.69733405", "0.69544697...
0.0
-1
Agent function that prepares a dictionary for storage in a compressed files.
def agent_prepare(self, zf, group, object_dict): object_buffer = StringIO() object_buffer.write(json.dumps(object_dict, sort_keys=True, indent=4, separators=(',', ': '))) object_buffer.seek(0) data = zipfile.ZipInfo("{0}.json".format(group)) data.date_time = time.localtime(time.t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _files_from_json(self, file_json):\n self.compressed_file_json = zlib.compress(json.dumps(file_json).encode('utf-8'))\n self.compression_algorithm = 'gzip'\n self.compressed_content_hash = hashlib.sha256(self.compressed_file_json).hexdigest()", "def file_to_dictionary():\n\n return;",...
[ "0.6145931", "0.6029067", "0.5845155", "0.5629594", "0.56274456", "0.5606034", "0.55619204", "0.55617094", "0.55312747", "0.5409232", "0.5396165", "0.5389857", "0.5363818", "0.5336105", "0.5334452", "0.5315649", "0.53133637", "0.53003275", "0.52949893", "0.527997", "0.5277781...
0.62700593
0
Delete a file from the s3 bucket.
def storage_delete_file(self, group='', key=''): deleted = False if key not in ["default-logo.png", "default-picture.png"]: if self.config['type'] == 's3': s3_files = self.s3.Bucket(self.bucket) for _file in s3_files.objects.all(): if _file...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_file(bucket, file_to_be_deleted):\n s3 = boto3.client('s3', aws_access_key_id=access_key, aws_secret_access_key=secret_key)\n s3.delete_object(Bucket=bucket, Key=file_to_be_deleted)\n print(file_to_be_deleted, \" : is deleted from the bucket\")", "def delete_file_from_s3(bucket_name, filepath...
[ "0.86315507", "0.82782817", "0.8190081", "0.7701372", "0.7638301", "0.76289713", "0.7577905", "0.7507077", "0.74693567", "0.74376506", "0.73432124", "0.73346096", "0.7309587", "0.72627354", "0.7256304", "0.71695846", "0.71298283", "0.7094936", "0.7075884", "0.70637834", "0.70...
0.0
-1