query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
compute idf and objectfeatures matrix for training set
def idf_object_features_set(set_id): # idf for calc features of new docs # object-features for learning model # doc_index links doc_id and row index in object-features # lemma_index links lemmas and column index in object-features # get lemmas of all docs in set docs = db.get_lemmas_freq(set_id...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_features(train_data, test_data):\n #train_wc_matrix, test_wc_matrix = get_word_count_features(train_data, test_data)\n train_idf_matrix, test_idf_matrix = get_idf_features(train_data, test_data)\n train_ngram_matrix, test_ngram_matrix = get_ngram_features(train_data, test_data)\n # train_li...
[ "0.6619801", "0.64366347", "0.6372779", "0.63321036", "0.63102317", "0.6256432", "0.6228051", "0.6178748", "0.60933167", "0.60557526", "0.6024493", "0.5988039", "0.5978126", "0.5965549", "0.59529054", "0.5933511", "0.5928089", "0.5916273", "0.5896251", "0.58895934", "0.587896...
0.7179811
0
sigmoid for every value of array x
def sigmoid_array(x): for l in range(len(x)): x[l] = 1/(1 + math.exp(-x[l])) return x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid(x: np.ndarray \n ) -> np.ndarray:\n return 1/(1+np.exp(-x))", "def sigmoid(x):\r\n return 1 / (1 + np.exp(-x))", "def sigmoid(x):\n S = np.ones((np.size(x),))\n for i in range(len(x)):\n S[i] = 1/(1+np.exp(-x[i]))\n return S", "def sigmoid(X):\n if isinst...
[ "0.855918", "0.83445925", "0.8308991", "0.8300278", "0.82980376", "0.8267586", "0.8267586", "0.8267586", "0.8267586", "0.8267586", "0.8267586", "0.8263312", "0.8179828", "0.8179828", "0.8171647", "0.8170802", "0.81627613", "0.8140558", "0.8127495", "0.8123879", "0.8111907", ...
0.84037894
1
compute entropy criteria for feature and answers
def entropy_difference(feature, answers, num_lemma): f_max = np.max(feature) f_min = np.min(feature) # check is it unsound feature if f_max == f_min: # print('lemma 0: ', num_lemma) return 10000 step = (f_max - f_min) / 1000 p = [[0, 0] for _ in range(1000)] sum_p = len(featu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def information_gain(features, attribute_index, targets):\r\n\r\n possible_feature_values = [0,1]\r\n \r\n possible_classifications = [0,1]\r\n \r\n feature = features[:,attribute_index]\r\n \r\n \r\n number_of_samples = len(feature)\r\n \r\n import math\r\n \r\n \r\n #curren...
[ "0.72258025", "0.71321565", "0.70042986", "0.6983623", "0.69810224", "0.69810224", "0.68815655", "0.6839398", "0.67989826", "0.6790044", "0.6771465", "0.6763687", "0.67623544", "0.6737052", "0.6696969", "0.66588163", "0.664294", "0.66203666", "0.66119146", "0.65870285", "0.65...
0.7332619
0
wrap for spot_doc_rubrics with local session
def spot_doc_rubrics2(doc_id, rubrics): db.doc_apply(doc_id, spot_doc_rubrics, rubrics)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spot_doc_rubrics(doc, rubrics, session=None, commit_session=True):\n # get lemmas by doc_id\n lemmas = doc.lemmas\n # compute document size\n doc_size = 0\n for lemma in lemmas:\n doc_size += lemmas[lemma]\n # models for rubrics\n models = {}\n\n # correct_answers = {}\n\n # f...
[ "0.5741224", "0.5666571", "0.52995265", "0.5269158", "0.51747894", "0.5086328", "0.5001454", "0.49858966", "0.49211386", "0.49211386", "0.4910525", "0.47497374", "0.4746444", "0.4739008", "0.47383398", "0.46627825", "0.4653349", "0.4652473", "0.46367034", "0.46367034", "0.463...
0.61031824
0
spot rubrics for document
def spot_doc_rubrics(doc, rubrics, session=None, commit_session=True): # get lemmas by doc_id lemmas = doc.lemmas # compute document size doc_size = 0 for lemma in lemmas: doc_size += lemmas[lemma] # models for rubrics models = {} # correct_answers = {} # fill set_id in rub...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spot_doc_rubrics2(doc_id, rubrics):\n db.doc_apply(doc_id, spot_doc_rubrics, rubrics)", "def main(rc):\n with store_client(rc) as sclient:\n for doc in rc.documents:\n sclient.copydoc(doc)", "def spot_test_set_rubric(test_set_id, rubric_id):\n # get lemmas\n docs = db.get_lemm...
[ "0.69208777", "0.5370122", "0.51581216", "0.49854934", "0.4783225", "0.47799012", "0.47690967", "0.47205272", "0.47074753", "0.4682977", "0.46623933", "0.46576574", "0.4648557", "0.46445367", "0.46335304", "0.46164656", "0.46158558", "0.45981637", "0.45951906", "0.4593771", "...
0.6318465
1
spot rubrics for all documents from test_set
def spot_test_set_rubric(test_set_id, rubric_id): # get lemmas docs = db.get_lemmas_freq(test_set_id) docs_size = {} # compute document size for doc_id in docs: lemmas = docs[doc_id] docs_size[doc_id] = 0 for lemma in lemmas: docs_size[doc_id] += lemmas[lemma] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spot_doc_rubrics(doc, rubrics, session=None, commit_session=True):\n # get lemmas by doc_id\n lemmas = doc.lemmas\n # compute document size\n doc_size = 0\n for lemma in lemmas:\n doc_size += lemmas[lemma]\n # models for rubrics\n models = {}\n\n # correct_answers = {}\n\n # f...
[ "0.63508373", "0.59862226", "0.56437767", "0.5264481", "0.5137441", "0.5057981", "0.50532794", "0.50263816", "0.50247127", "0.50228095", "0.49819055", "0.49736837", "0.49623054", "0.49571514", "0.49557984", "0.49491504", "0.49417806", "0.49294844", "0.49229982", "0.49190468", ...
0.64342356
0
compute average probability for true and false answers
def probabilities_score(model_id, test_set_id, rubric_id): result = {'true_average_probability': 0, 'false_average_probability': 0} # right answers answers = db.get_rubric_answers(test_set_id, rubric_id) # rubrication results rubrication_result = db.get_rubrication_probability(model_id, test_set_id,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mape(true, predictions):\n true = np.array(true)\n predictions = np.array(predictions) \n return np.mean(np.abs((true - predictions)) / true) * 100", "def precision_score(y_true, y_pred):\n return ((y_true == 1) * (y_pred == 1)).sum() / (y_pred == 1).sum()", "def calc_accuracy(true, predicte...
[ "0.68416166", "0.66683954", "0.6613903", "0.6596483", "0.6539802", "0.64255875", "0.6424991", "0.6420462", "0.6365455", "0.63586", "0.6343499", "0.63240093", "0.62925273", "0.627914", "0.62533486", "0.62258637", "0.6179806", "0.6166214", "0.6155228", "0.61428577", "0.6140479"...
0.683993
1
This function is returning the weight of the protein sequence given based on average weight given for each amino acid in given protein
def calc_weight(sequence): return len(sequence) * AVG_WEIGHT
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_molecular_weight(fasta_filename):\n \n sequence_weights={}\n aminoacid_mw = {'A': 89.09, 'C': 121.16, 'E': 147.13, 'D': 133.1, 'G': 75.07, 'F': 165.19, 'I': 131.18, 'H': 155.16, 'K': 146.19, 'M': 149.21, 'L': 131.18, 'N': 132.12, 'Q': 146.15, 'P': 115.13, 'S': 105.09, 'R': 174.2, 'T': 119.12...
[ "0.6750212", "0.6603459", "0.6503535", "0.6424174", "0.63299036", "0.63141996", "0.63141996", "0.6302852", "0.6218239", "0.6184637", "0.6173586", "0.61510265", "0.6140726", "0.61221576", "0.6102423", "0.61018354", "0.6076003", "0.60408807", "0.60073984", "0.60028505", "0.5948...
0.7381839
0
Marks the image as having been seen on the given blog returns Bool as indicator of new seen
def mark_seen(self, blog_url, get_Blog, seen_at=None): # get the blog where we just saw this image blog = get_Blog().get_or_create(url=blog_url) # update the blog new blog obj's short hash if not blog.short_hash: blog.short_hash = short_hash(blog_url) blog.save(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_new_based_on_imgs(soup):\n\n \n \n prev_hashes = get_prev_img_hashes()\n temp_hashes = get_temp_img_hashes(soup)\n\n if len(temp_hashes.difference(prev_hashes))>0:\n print(\"new, based on images\")\n return True\n else:\n return False", "def mark_seen(self):\r\n ...
[ "0.6048454", "0.5702105", "0.5617216", "0.55378336", "0.5485685", "0.54344535", "0.5427995", "0.53722227", "0.5333881", "0.53132117", "0.5305507", "0.52907443", "0.5284631", "0.52825695", "0.5263754", "0.52575016", "0.5235767", "0.52142894", "0.5206761", "0.520546", "0.520040...
0.7645362
0
stores the given data returns the data's store key if uploaded returns False if data already existed
def set_data(self, data, short_hash, upload_image, get_Blog, get_Image, compute_vhash, blog_url=None): # get the short hash for the data self.short_hash = short_hash(data) # TODO: compute other attrs: type, vhash, dimensions # save the data to the cloud storag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store_data(self, store_data):\n self._store_data = store_data", "def StoreFile(self, file_data):\r\n ### ###########################\r\n\r\n now = datetime.datetime.now();\r\n root_dir = os.path.join(settings.MEDIA_ROOT, now.strftime(\"%Y-%m-%d\"));\r\n fname = os.path.join(roo...
[ "0.63676924", "0.63348836", "0.6326494", "0.6223537", "0.6184256", "0.6106908", "0.6085891", "0.60779446", "0.6066866", "0.6061777", "0.60587716", "0.60249597", "0.5990663", "0.5988788", "0.59879524", "0.5976819", "0.59597427", "0.5940061", "0.5934865", "0.5929676", "0.589128...
0.6479089
0
returns a public url for this image
def get_public_url(self, get_image_public_url): # get that url return get_image_public_url(self.short_hash)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_url_image(self, obj):\n return settings.SERVER_HOST + obj.image.url", "def image_url(self) -> str:\n return pulumi.get(self, \"image_url\")", "def get_url_image(self, obj):\n return settings.IMAGE_HOST + obj.image.url", "def get_url_image(self, obj):\n return settings.IMAG...
[ "0.8159343", "0.81349707", "0.8098181", "0.8098181", "0.8098181", "0.8068925", "0.8035841", "0.7448655", "0.7433158", "0.74328434", "0.73438674", "0.7327816", "0.73267376", "0.723886", "0.7232513", "0.72067153", "0.71977", "0.71773213", "0.71523744", "0.7151588", "0.7013372",...
0.8463321
0
Rounds up a datetime interval to one of the closest time interval from the scope. Returns suggested start and end timestamps, e.g.
def round_datetime_interval(start, end): if not start or not end: return 1800000, None, None # Approximate number of bars. bars = 50 supported_intervals = [ # In seconds. 60, # 1 minute 120, # 2 minutes 300, # 5 minutes 600, # 10 min...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def round_time(\n dt: datetime,\n delta: str | timedelta | relativedelta,\n start_date: datetime = timezone.make_aware(datetime.min),\n):\n if isinstance(delta, str):\n # It's cron based, so it's easy\n time_zone = start_date.tzinfo\n start_date = timezone.make_naive(start_date, ti...
[ "0.6122795", "0.58377707", "0.5655673", "0.5626476", "0.5443188", "0.5438394", "0.5426317", "0.5354083", "0.5349516", "0.53376406", "0.53324294", "0.5328962", "0.5262824", "0.52342826", "0.52287924", "0.5211007", "0.52071995", "0.5177311", "0.5176398", "0.51655763", "0.515800...
0.6247458
0
Helper to determine whether to use es6 or require imports based on file context
def detect_import(self): if self.contains_match(CONTAINS_IMPORT): self.es6import = True elif self.contains_match(CONTAINS_REQUIRE): self.es6import = False else: self.es6import = self.get_project_pref('detect_prefer_imports')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Chep_2_Conditionalized_Import_Behavior_InlineImport():\n template = '''\n #def funky(s)\n #try\n #import os.path\n #except ImportError\n #pass\n #end try\n #return os.path.join('foo', $s)\n #end def\n '''\n te...
[ "0.6167472", "0.6017514", "0.56490624", "0.5636177", "0.55596316", "0.54430085", "0.541212", "0.5303518", "0.5297958", "0.52604955", "0.52583086", "0.5240708", "0.5227387", "0.51878864", "0.51798165", "0.5090028", "0.50892895", "0.5072239", "0.50425524", "0.5027445", "0.49965...
0.6984186
0
Helper to determine whether a regexp is contained in the current file in sublime 3 or sublime 2
def contains_match(self, regexp): # If the regexp is not found, find will return a tuple (-1, -1) in Sublime 3 or None in Sublime 2 # https://github.com/SublimeTextIssues/Core/issues/534 contains_import = self.view.find(regexp, 0) return contains_import.size() > 0 if float(sublime.versi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_cpp(filename: Path) -> bool:\n from fnmatch import fnmatch\n\n return any(fnmatch(os.path.basename(filename), p) for p in CPP_PATTERNS)", "def found(self, command, regex):\n result = self.sys(command)\n for line in result:\n found = re.search(regex,line)\n if foun...
[ "0.6236844", "0.6035598", "0.6035598", "0.59960926", "0.5810656", "0.5790262", "0.57603216", "0.57455856", "0.5740435", "0.5727228", "0.5653124", "0.5651493", "0.5648111", "0.5636862", "0.5629547", "0.5627501", "0.56141937", "0.56075996", "0.56075996", "0.55625325", "0.555048...
0.77203137
0
Return arguments for insert snippet command.
def get_args(self): return { 'contents': self.get_formatted_code() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help_insert(self):\n print(INSERT)", "def args(self) -> typing.Tuple[str, typing.List[str]]:\n func = inspect.stack()[1][3]\n command = func[len(self.CMD_PREFIX):]\n return ('{} {}'.format(sys.argv[0], command),\n sys.argv[2:])", "def get_args(self) -> List[str]:\...
[ "0.5862157", "0.5763", "0.5747862", "0.5689465", "0.55466807", "0.5543572", "0.5507813", "0.54482096", "0.5418385", "0.54103833", "0.5397669", "0.5368619", "0.53491396", "0.532232", "0.53106725", "0.52695787", "0.5247165", "0.5244827", "0.5234803", "0.52134436", "0.51947635",...
0.6094225
0
Get type of quotes to use.
def get_quotes(self): # However ignore the 'true' autodetection setting. jscs_quotes = self.jscs_options.get('validateQuoteMarks') if isinstance(jscs_quotes, dict): jscs_quotes = jscs_quotes.get('mark') if jscs_quotes and jscs_quotes is not True: return jscs_quote...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_type(self):\n if self.data[\"is_script\"]:\n return self.data[\"script\"]\n elif self.data[\"is_qt\"]:\n return \"qt\"\n else:\n return \"normal\"", "def get_type(self) -> str:\n # Note: this name conflicts with existing python builtins\n ...
[ "0.6076279", "0.60122496", "0.5968294", "0.59570783", "0.5889422", "0.5889422", "0.5889422", "0.5889422", "0.5889422", "0.5889422", "0.5889422", "0.5889422", "0.5889422", "0.5889422", "0.5889422", "0.5889422", "0.5889422", "0.5889422", "0.5889422", "0.5889422", "0.5889422", ...
0.68239087
0
Parses the disallowSpace{After,Before}BinaryOperators jscs options and checks if spaces are not allowed before or after an `=` so we know if we should strip those from the var statement.
def should_strip_setter_whitespace(self): def parse_jscs_option(val): if type(val) == bool: return val if isinstance(val, list) and '=' in val: return True return False return dict( before=parse_jscs_option( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _ExpectSpaceBeforeOperator(self, token):\n if token.string == ',' or token.metadata.IsUnaryPostOperator():\n return False\n\n # Colons should appear in labels, object literals, the case of a switch\n # statement, and ternary operator. Only want a space in the case of the\n # ternary operator.\...
[ "0.5571867", "0.52223045", "0.5181726", "0.51077217", "0.50890666", "0.50884646", "0.50165695", "0.49252373", "0.4916879", "0.48278362", "0.48272413", "0.48212582", "0.48195723", "0.47902355", "0.47791567", "0.4775543", "0.47721535", "0.47455353", "0.47295842", "0.46985298", ...
0.72638625
0
Finds the sensel device, if none is detected, return None. This None should throw an error in subsequent functions.
def openSensel(): handle = None (error, device_list) = sensel.getDeviceList() if device_list.num_devices != 0: (error, handle) = sensel.openDeviceByID(device_list.devices[0].idx) return handle
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _find_device(self):\n for bus in usb.busses():\n for dev in bus.devices:\n if dev.idVendor == self.vendor_id and dev.idProduct == self.product_id:\n if self.device_id is None or dev.filename == self.device_id:\n log.info('found station ...
[ "0.7095207", "0.66211075", "0.63678074", "0.633608", "0.6279986", "0.62618655", "0.62455034", "0.62315935", "0.6200235", "0.6090791", "0.60804033", "0.60033995", "0.5996161", "0.5954078", "0.5831486", "0.581433", "0.57635665", "0.57375133", "0.57314014", "0.570372", "0.567313...
0.6641357
1
Initializes the sensel to capture all contacts. Returns the initial frame.
def initFrame(): error = sensel.setFrameContent(handle, sensel.FRAME_CONTENT_CONTACTS_MASK) (error, frame) = sensel.allocateFrameData(handle) error = sensel.startScanning(handle) return frame
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initializeGL(self):\n\n self.gl = mg.create_context()\n\n self.recompile()\n\n self.to_capture = False\n self.capture_texture = self.gl.texture((capture_width, capture_height), 4, dtype=\"f4\")\n capture_framebuffer = self.gl.framebuffer([self.capture_texture])\n self....
[ "0.5816397", "0.574967", "0.55902994", "0.5495237", "0.54497045", "0.5447377", "0.5339393", "0.52684057", "0.5208814", "0.51819396", "0.5139388", "0.51059765", "0.50550157", "0.5049098", "0.50385374", "0.5037612", "0.5022273", "0.5020498", "0.50094044", "0.49824604", "0.49824...
0.7684333
0
Test module university.py by downloading university.csv and testing shape of extracted data has 62 rows and 17 columns
def test_university(): test_path = tempfile.mkdtemp() x_train, metadata = university(test_path) try: assert x_train.shape == (62, 17) except: shutil.rmtree(test_path) raise()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n\n #get the csv file into a data-frame\n universities_df = pd.read_csv('universities_data.csv', encoding = 'utf-8-sig')\n universities_names_list = universities_df['name'].tolist()\n\n #get list of university objects\n url = 'http://universities.hipolabs.com/search?country=Israel'\n ...
[ "0.6574307", "0.6403017", "0.5885163", "0.5802315", "0.5745275", "0.5678409", "0.566421", "0.56549424", "0.56502306", "0.56443703", "0.56308216", "0.56158274", "0.5613451", "0.55993706", "0.559208", "0.5591343", "0.55832076", "0.55831206", "0.55750996", "0.55711734", "0.55679...
0.7281142
0
Load numpy file contained embedding of video frames and uniformly selecting every hp.sample_frames out of all frames. Sampling rate is dropped if input length is less than target length (due to ctc loss).
def load_file(filename,label_len): embedding = np.load(filename) # sample_frames = hp.sample_frames # while(1): # n_frames = (embedding.shape[0]-1)/sample_frames + 1 # if (embedding.shape[0]-1)%sample_frames!=0: # n_frames += 1 # if n_frames>=label_len: # brea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_train_video(opt, frame_path, Total_frames):\n clip = []\n i = 0\n loop = 0\n\n # choosing a random frame\n if Total_frames <= opt.sample_duration: \n loop = 1\n start_frame = 0\n else:\n start_frame = np.random.randint(0, Total_frames - opt.sample_duration)\n \n ...
[ "0.61556715", "0.6012853", "0.5795365", "0.5787265", "0.5753409", "0.5703127", "0.55909455", "0.55065256", "0.55059505", "0.54967993", "0.54833144", "0.54575807", "0.5453226", "0.5434739", "0.5393761", "0.5387126", "0.53686005", "0.53385323", "0.5338431", "0.53017545", "0.529...
0.67151964
0
Builds dataset with multiple items per sample. Returns (x, y).
def build_train_dataset(x: List[List[NpArray]], y: NpArray, indices: List[int]) -> \ Tuple[NpArray, NpArray]: res_x, res_y = [], [] for idx in indices: for sample in x[idx]: res_x.append(sample) res_y.append(y[idx]) return np....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_test_dataset(x: List[List[NpArray]]) -> Tuple[NpArray, List[int]]:\n x_test, clips_per_sample = [], []\n\n for sample in x:\n clips_per_sample.append(len(sample))\n\n for clip in sample:\n x_test.append(clip)\n\n return np.array(x_test), clips_per_sample", "def sample_...
[ "0.71700114", "0.6876828", "0.67699337", "0.675121", "0.66405386", "0.66405386", "0.65027136", "0.6290405", "0.6290306", "0.626962", "0.6263836", "0.62594765", "0.62546146", "0.6243724", "0.6191763", "0.61844975", "0.61676997", "0.61600125", "0.6146306", "0.61357695", "0.6109...
0.71009916
1
Builds test dataset with multiple clips per sample, which will be joined later somehow (maximum, geom. mean, etc).
def build_test_dataset(x: List[List[NpArray]]) -> Tuple[NpArray, List[int]]: x_test, clips_per_sample = [], [] for sample in x: clips_per_sample.append(len(sample)) for clip in sample: x_test.append(clip) return np.array(x_test), clips_per_sample
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_test_set(data, pts): \n test_set = np.asarray(random.sample(data, pts))\n \n return test_set", "def make_dataset():\n\n\tnumberOfTrials = dataset_params.num_of_samples\n\tnumberOfTrials_train = int(numberOfTrials*0.8)\n\tnumberOfTrials_test = int(numberOfTrials*0.2)\n\n\tprint(\"...
[ "0.59920436", "0.58828664", "0.5873379", "0.5842184", "0.5801387", "0.5799118", "0.575984", "0.57430387", "0.5738082", "0.57155204", "0.5697254", "0.56378454", "0.56356657", "0.56329775", "0.5632461", "0.55968785", "0.5581852", "0.55785733", "0.55710536", "0.5516363", "0.5488...
0.7107193
0
Return negative log likelihood graph for gaussian constraints on a list of parameters.
def nll_gaussian(params: ztyping.ParamTypeInput, observation: ztyping.NumericalScalarType, uncertainty: ztyping.NumericalScalarType) -> tf.Tensor: return GaussianConstraint(params=params, observation=observation, uncertainty=uncertainty)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grad_neg_log_like(params):\n gp.set_parameter_vector(params)\n return -gp.grad_log_likelihood(y, quiet=True)", "def gaussian_likelihood(x, mu, log_std):\n prob = -0.5 * (((x - mu) / (tf.exp(log_std) + EPS)) ** 2 + 2 * log_std + np.log(2 * np.pi))\n return tf.reduce_sum(prob, axis=1)", "...
[ "0.64535975", "0.5904606", "0.5901875", "0.5888618", "0.58798784", "0.5872534", "0.5868868", "0.5861738", "0.5828152", "0.58248097", "0.57563585", "0.5716952", "0.57024264", "0.5620952", "0.5620016", "0.5609774", "0.56095904", "0.5586873", "0.5586873", "0.55866486", "0.558465...
0.6091901
1
Validates the shape of the result tables.
def _validate_result_shape(self, mean, output): self.assertTrue(isinstance(mean, ITableWorkspace)) self.assertEqual(mean.columnCount(), 6) self.assertEqual(mean.rowCount(), 8) self.assertTrue(isinstance(output, WorkspaceGroup)) self.assertEqual(len(output), 3) for idx ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate(self, obj):\n assert (self._confidence in obj.columns and self._predicted in obj.columns\n and self._groundtruth in obj.columns), \\\n \"Must at least have '%s', '%s' and '%s' columns.\" \\\n % (self._confidence, self._predicted, self._groundtruth)\n ...
[ "0.65462273", "0.6470221", "0.64296114", "0.64213187", "0.62917054", "0.6224976", "0.6170748", "0.6142788", "0.61046374", "0.607582", "0.6027592", "0.6017014", "0.6013583", "0.6006808", "0.5963135", "0.59552646", "0.59322536", "0.59297746", "0.59133005", "0.59023815", "0.5890...
0.69808173
0
Test use_cache with a missing cache file. Should generate error.
def test_use_cache_missing_file(): # Generate cached files cmd_list = [NETMIKO_GREP] + ['interface', 'all'] _, full_dir = find_netmiko_dir() remove_file = 'bad_device.txt' remove_file_full = "{}/{}".format(full_dir, remove_file) if os.path.exists(remove_file_full) and os.path.isfile(remove_file_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test__cache_notfound(self):\n # Access to a protected member _cache of a client class\n # pylint: disable=W0212\n treadmill.zkutils.get.side_effect = \\\n kazoo.exceptions.NoNodeError\n\n zkclient = kazoo.client.KazooClient()\n self.evmgr._cache(zkclient, 'foo#001'...
[ "0.73853165", "0.73476803", "0.7076356", "0.68939716", "0.684688", "0.68456286", "0.6829679", "0.67922646", "0.67754066", "0.6688267", "0.6683732", "0.6657779", "0.6619422", "0.6537959", "0.65214545", "0.6512296", "0.65074056", "0.64840156", "0.6457274", "0.64564806", "0.6424...
0.7576966
0
Verify failed devices are showing
def test_display_failed(): cmd_list = [NETMIKO_GREP] + ['interface', 'all'] (output, std_err) = subprocess_handler(cmd_list) assert "Failed devices" in output failed_devices = output.split("Failed devices:")[1] failed_devices = failed_devices.strip().split("\n") failed_devices = [x.strip() for x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_verify_state_of_a_device():", "def test_hide_failed():\n cmd_list = [NETMIKO_GREP] + ['--hide-failed', 'interface', 'all']\n (output, std_err) = subprocess_handler(cmd_list)\n assert \"Failed devices\" not in output", "def test_verify_list_of_devices_in_my_network():", "def test_verify_conn...
[ "0.69230753", "0.68009025", "0.6730258", "0.6647889", "0.6592971", "0.65443087", "0.6511433", "0.6507385", "0.6504286", "0.6377974", "0.636535", "0.6360225", "0.6213847", "0.62052417", "0.61863875", "0.6157639", "0.61221045", "0.6117112", "0.60790807", "0.59957546", "0.599575...
0.73280716
0
Test function that finds netmiko_dir.
def test_find_netmiko_dir(): base_dir_check = '/home/gituser/.netmiko' full_dir_check = '/home/gituser/.netmiko/tmp' base_dir, full_dir = find_netmiko_dir() assert base_dir == base_dir_check and full_dir == full_dir_check
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_obtain_netmiko_filename():\n create_dir_test = True\n file_name_test = '/home/gituser/.netmiko/tmp/test_device.txt'\n file_name = obtain_netmiko_filename('test_device')\n assert file_name == file_name_test\n\n if create_dir_test:\n uuid_str = str(uuid.uuid1())\n junk_dir_base ...
[ "0.72621965", "0.6246462", "0.6027246", "0.5804337", "0.5803069", "0.5800377", "0.5759109", "0.5746789", "0.56879157", "0.5673341", "0.5659619", "0.5653931", "0.5647432", "0.5622848", "0.56032187", "0.5596177", "0.557815", "0.55779433", "0.5561922", "0.5549885", "0.5549646", ...
0.84443676
0
The set of arguments for constructing a IdentityPoolProviderPrincipalTag resource.
def __init__(__self__, *, identity_pool_id: pulumi.Input[str], identity_provider_name: pulumi.Input[str], principal_tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, use_defaults: Optional[pulumi.Input[bool]] = None): pulumi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__,\n resource_name: str,\n args: IdentityPoolProviderPrincipalTagArgs,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...", "def __init__(__self__,\n resource_name: str,\n opts: Optional[pulumi.Resourc...
[ "0.7856163", "0.64542943", "0.6376276", "0.5968333", "0.5625083", "0.5487669", "0.5449511", "0.5414559", "0.54109836", "0.5339899", "0.53381735", "0.53368294", "0.5325394", "0.53140837", "0.52848655", "0.52398705", "0.52252465", "0.52150136", "0.51871485", "0.5153368", "0.514...
0.6546987
1
An identity pool ID.
def identity_pool_id(self) -> pulumi.Input[str]: return pulumi.get(self, "identity_pool_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_pool_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"identity_pool_id\")", "def identity_pool_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"identity_pool_id\")", "def pool_id ( self ):\n return self._pool_id", "def resource_pool_id(self) -> s...
[ "0.86603266", "0.838689", "0.82100475", "0.7408374", "0.73865277", "0.7111695", "0.70824254", "0.6979489", "0.6917806", "0.6748776", "0.6693632", "0.6658713", "0.65843666", "0.65843666", "0.6578973", "0.6505788", "0.6505788", "0.65010935", "0.64529204", "0.64043105", "0.63814...
0.86181694
1
The name of the identity provider.
def identity_provider_name(self) -> pulumi.Input[str]: return pulumi.get(self, "identity_provider_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_provider_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"identity_provider_name\")", "def identity_provider_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"identity_provider_name\")", "def provider_name(self):\n raise NotImplementedError", ...
[ "0.9126659", "0.8877346", "0.8368294", "0.8306505", "0.8110782", "0.80312", "0.7812182", "0.7812182", "0.7771749", "0.754476", "0.754476", "0.75150007", "0.7478888", "0.74466497", "0.73160523", "0.73160523", "0.7292682", "0.7079154", "0.6827711", "0.6733854", "0.66272384", ...
0.8995868
1
Get an existing IdentityPoolProviderPrincipalTag resource's state with the given name, id, and optional extra properties used to qualify the lookup.
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, identity_pool_id: Optional[pulumi.Input[str]] = None, identity_provider_name: Optional[pulumi.Input[str]] = None, principal_tags: Optional[pulumi.Input[Mapping[st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__,\n resource_name: str,\n args: IdentityPoolProviderPrincipalTagArgs,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...", "def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceO...
[ "0.5595048", "0.53635854", "0.49380523", "0.48628393", "0.4816035", "0.47020298", "0.4629302", "0.45980203", "0.45842114", "0.45643133", "0.45463476", "0.4532976", "0.4522428", "0.4495576", "0.4438125", "0.44314432", "0.44203177", "0.4390814", "0.43893582", "0.4349263", "0.43...
0.74135715
0
An identity pool ID.
def identity_pool_id(self) -> pulumi.Output[str]: return pulumi.get(self, "identity_pool_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_pool_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"identity_pool_id\")", "def identity_pool_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"identity_pool_id\")", "def pool_id ( self ):\n return self._pool_id", "def resource_pool_id(self) -> st...
[ "0.86181694", "0.838689", "0.82100475", "0.7408374", "0.73865277", "0.7111695", "0.70824254", "0.6979489", "0.6917806", "0.6748776", "0.6693632", "0.6658713", "0.65843666", "0.65843666", "0.6578973", "0.6505788", "0.6505788", "0.65010935", "0.64529204", "0.64043105", "0.63814...
0.86603266
0
The name of the identity provider.
def identity_provider_name(self) -> pulumi.Output[str]: return pulumi.get(self, "identity_provider_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_provider_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"identity_provider_name\")", "def identity_provider_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"identity_provider_name\")", "def provider_name(self):\n raise NotImplementedError", ...
[ "0.8995868", "0.8877346", "0.8368294", "0.8306505", "0.8110782", "0.80312", "0.7812182", "0.7812182", "0.7771749", "0.754476", "0.754476", "0.75150007", "0.7478888", "0.74466497", "0.73160523", "0.73160523", "0.7292682", "0.7079154", "0.6827711", "0.6733854", "0.66272384", ...
0.9126659
0
Breaks down a complicated filename and returns a 2element list consisting of the filenamecomponent and the SHAcomponent If mode == 'learn', given a string of the form "s1__s2__s3.c", it returns ['s1/s2/s3.c', 1] If mode == 'old', given a string of the form "s1__s2__s3__SHA.c", it returns ['s1/s2/s3.c', SHA]
def dismemberFilename(myname, mode): if mode == 'learn': return [pathLeaf(myname).replace('__', '/'), -1] elif mode == 'old': filename_parts = myname.split('__') # ['s1', 's2', 's3', 'SHA.c'] SHA_and_extension = filename_parts[-1].split('.') # ['SHA', 'c'] return ['/'.j...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def splitFilename(filename):\n\n if filename[-4:] == '.rpm':\n filename = filename[:-4]\n \n archIndex = filename.rfind('.')\n arch = filename[archIndex+1:]\n\n relIndex = filename[:archIndex].rfind('-')\n rel = filename[relIndex+1:archIndex]\n\n verIndex = filename[:relIndex].rfind(...
[ "0.5483648", "0.540052", "0.5353368", "0.5318837", "0.5288031", "0.5252998", "0.5236029", "0.5149559", "0.5129162", "0.5072963", "0.50405633", "0.4918019", "0.48877585", "0.48875466", "0.4871731", "0.48545542", "0.47975442", "0.47791", "0.47737268", "0.47444177", "0.4743137",...
0.640244
0
Returns the basename of the file/directory path in an _extremely_ robust way. For example, pathLeaf('/hame/saheel/git_repos/szz/abc.c/') will return 'abc.c'.
def pathLeaf(path): head, tail = ntpath.split(path) return tail or ntpath.basename(head)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path_leaf(path):\n head, tail = ntpath.split(path)\n return tail or ntpath.basename(head)", "def path_leaf(path):\n\thead, tail = ntpath.split(path)\n\treturn tail or ntpath.basename(head)", "def get_leafname(path):\n\n\tpos = string.rfind(path, os.sep)\n\tif pos != -1:\n\t\treturn path[pos+1:]\n\tel...
[ "0.8202049", "0.81125677", "0.77742285", "0.75503045", "0.7526012", "0.73413885", "0.7088789", "0.6984967", "0.6955897", "0.68906826", "0.68379354", "0.6827969", "0.6780256", "0.67511636", "0.6678975", "0.6597504", "0.65930575", "0.65369546", "0.65035325", "0.6499314", "0.648...
0.84374326
0
Computes the SHAs where all the fixinducing lines were introduced (along the lines of SZZ) and records the precise location of each such line in a CSV file in the `project_corpus_path` directory. TODO Document your algo!! Args
def szz(project_corpus_path, project_snapshots_path, bugfix_SHAs_filename, \ num_of_cores = '4', ps_bug_report_times_filename = ''): if ps_bug_report_times_filename == '' or os.path.isfile(ps_bug_report_times_filename): if not os.path.isdir(project_corpus_path) or not os.path.isdir(project_snapshots...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def TranscriptionFind(genome, gene_start_stop_dict,\n gene_first_exon_dict, gene_scaff_dict,\n gene_direction, gene_set, gene_gff_line,\n bam, stand_dev_threshold, walk, min_value,\n interation_value, out_file, logger, TITLE,\n ...
[ "0.53746367", "0.5096252", "0.50762796", "0.50170225", "0.4978774", "0.4946678", "0.4932188", "0.4927958", "0.48932934", "0.48801583", "0.48791954", "0.48785833", "0.4873219", "0.48639885", "0.4859189", "0.48531154", "0.48424622", "0.481692", "0.48109287", "0.4809388", "0.480...
0.5598505
0
Create a ZoneRecord resource with the given unique name, props, and options.
def __init__(__self__, resource_name: str, args: ZoneRecordArgs, opts: Optional[pulumi.ResourceOptions] = None): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_zone(self, zone, serial=None):\r\n return self.service.createObject({\r\n 'name': zone,\r\n 'serial': serial or strftime('%Y%m%d01'),\r\n \"resourceRecords\": {}})", "def create_record(self, zone_id, record, record_type, data, ttl=60):\r\n self.record.cre...
[ "0.67830896", "0.66456556", "0.65979064", "0.63441277", "0.6284031", "0.62557477", "0.6229536", "0.6211032", "0.60351735", "0.59962225", "0.5970569", "0.5852241", "0.57941115", "0.5788343", "0.5786571", "0.5690906", "0.5651166", "0.5644698", "0.56435764", "0.56245065", "0.553...
0.7262241
0
Get an existing ZoneRecord resource's state with the given name, id, and optional extra properties used to qualify the lookup.
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, name: Optional[pulumi.Input[str]] = None, priority: Optional[pulumi.Input[str]] = None, qualified_name: Optional[pulumi.Input[str]] = None, ttl: Optio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n asset_statuses: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ZoneAssetStatusArgs']]]]] = None,\n create_time: Optional[pulumi.Input[str]] = None,\n ...
[ "0.6687499", "0.6661502", "0.6029663", "0.5514889", "0.54734415", "0.54335076", "0.54033715", "0.53986657", "0.5330955", "0.53139925", "0.5313418", "0.5290533", "0.52262396", "0.5205333", "0.5184923", "0.5163674", "0.5150722", "0.5121249", "0.5112581", "0.50963205", "0.504456...
0.74212474
0
It generates and returns the realizations of the process. The realizations are hosted in an array matrix S whose row i represent the value of the process at time i for all the state of the world, and whose column j represents the path of the process for the simulation (or state of the world) j. Returns array The matrix...
def generateRealizations(self): #maybe, in this case, it is better dealing with arrays instead of lists. #If realizations are hosted in an array, it's easier to perform #operations with them: for example, remember that when you sum or #multiply two lists, the operation is not executed co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sys(self):\r\n return System(np.dot(self.psys.matrix, self.rsys.matrix))", "def run_simulation(self):\n self._data = msprime.sim_ancestry(\n recombination_rate=self.recombination_rate,\n sequence_length=self.len,\n num_replicates=self.num_replicates,\n ...
[ "0.5854377", "0.57707894", "0.56632286", "0.5630439", "0.5529519", "0.5455803", "0.5446149", "0.5443754", "0.5397323", "0.53795385", "0.53627515", "0.5360387", "0.53161407", "0.52479273", "0.5228732", "0.5227275", "0.5217589", "0.518999", "0.5186102", "0.51725996", "0.5159401...
0.64867127
0
It returns the realizations of the process at time timeIndex
def getRealizationsAtGivenTime(self, timeIndex): realizations = self.realizations; return realizations[timeIndex]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_list(self):\n return (self.N_T * (np.arange(self.N_itr) + 1) /\n self.N_itr * 1000 * self.DT)", "def getTimes():", "def getTimes():", "def getTimes():", "def get_timing(pidx):\n pgconn = get_dbconn(\"mesosite\")\n cursor = pgconn.cursor()\n cursor.execute(\n \...
[ "0.61247146", "0.6043734", "0.6043734", "0.6043734", "0.57777035", "0.57670903", "0.5563724", "0.5549501", "0.55488217", "0.55278444", "0.5521647", "0.5457292", "0.54337156", "0.5431724", "0.5423495", "0.54172146", "0.53973734", "0.5394623", "0.5386949", "0.53651875", "0.5354...
0.68299645
0
It returns the entire path of the process for a given simulation index
def getPath(self, simulationIndex): realizations = self.realizations; return realizations[:,simulationIndex]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_path(self):\n\t\treturn os.path.normpath(self.output + \"/\" + self.resultset_index)", "def printPath(self, simulationIndex):\n path = self.getPath(simulationIndex);\n\n print(\"The path for the\", simulationIndex, \"-th simulation is the following:\")\n print()\n print('\\n...
[ "0.6194272", "0.5910049", "0.57058936", "0.56998456", "0.56998456", "0.5684137", "0.5624882", "0.5624882", "0.5623874", "0.5590808", "0.5588383", "0.5558976", "0.5552057", "0.55445606", "0.5506157", "0.5492166", "0.5461353", "0.54532665", "0.54532665", "0.54532665", "0.545326...
0.72079676
0
It prints the entire path of the process for a given simulation index
def printPath(self, simulationIndex): path = self.getPath(simulationIndex); print("The path for the", simulationIndex, "-th simulation is the following:") print() print('\n'.join('{:.3}'.format(realization) for realization in path)) print()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_path(path, index):\r\n\r\n print(\"Printing trace for puzzle no. {0}\".format(index))\r\n print_puzzle(path[0][0])\r\n for i in range(1, len(path)):\r\n movement = get_move(path[i-1][1], path[i][1])\r\n\r\n moved_tile = get_value(path[i-1][0], path[i][1])\r\n print(i, \": mo...
[ "0.7143878", "0.62840337", "0.62348145", "0.6183162", "0.5965672", "0.59566885", "0.59365845", "0.5935982", "0.58508074", "0.58452827", "0.57137233", "0.5694292", "0.56709874", "0.56071806", "0.55772626", "0.5566466", "0.55639225", "0.5555327", "0.55487084", "0.5505415", "0.5...
0.7499326
0
It plots the paths of the process from simulationIndex to simulationIndex + numberOfPaths
def plotPaths(self, simulationIndex, numberOfPaths): for k in range(numberOfPaths): path = self.getPath(simulationIndex + k); plt.plot(path) plt.xlabel('Time') plt.ylabel('Realizations of the process') plt.show()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_path_statistics( self, path_file=\"tse_ensemble.json\" ):\n from matplotlib import pyplot as plt\n with open(path_file,'r') as infile:\n data = json.load(infile)\n try:\n paths = data[\"transition_paths\"]\n except KeyError:\n paths = [data]\n ...
[ "0.6657115", "0.6575424", "0.6300528", "0.6178793", "0.61458", "0.610633", "0.6047569", "0.5977867", "0.59663767", "0.5956206", "0.58128816", "0.5809306", "0.58068746", "0.5751905", "0.57391244", "0.5727227", "0.57147604", "0.5711319", "0.57035184", "0.56797856", "0.5677725",...
0.8709885
0
It returns the maximum of the realizations of the process at time timeIndex
def getMaximumAtGivenTime(self, timeIndex): realizationsAtTimeIndex = self.getRealizationsAtGivenTime(timeIndex) return np.max(realizationsAtTimeIndex)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getEvolutionMax(self):\n \n return [self.getMaximumAtGivenTime(timeIndex) for timeIndex in range(self.numberOfTimes - 1)]", "def max_time(self):\n return self.time[np.argmax(self.flux)]", "def max(self):\n\n return time_stat(self, stat=\"max\")", "def max_time(self) -> float:\r\n ...
[ "0.7338751", "0.71580356", "0.6704653", "0.6664134", "0.6621409", "0.6446359", "0.63972676", "0.6210386", "0.608417", "0.6026619", "0.60082227", "0.5994343", "0.5993893", "0.5967766", "0.5956552", "0.5921046", "0.5900468", "0.58589935", "0.5795851", "0.5795324", "0.5782808", ...
0.76386476
0
It returns the evolution of the maximum of the realizations of the process at given times Returns
def getEvolutionMax(self): return [self.getMaximumAtGivenTime(timeIndex) for timeIndex in range(self.numberOfTimes - 1)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_time(self):\n return self.time[np.argmax(self.flux)]", "def M_D_1(arrival_time,max_time,service_time=1/90):\n #conversion in seconds\n max_seconds = max_time*60*60\n sim_time = 0.0 # simulation time\n t_1 = 0.0 # time for next event (arrival)\n t_2 = max_seconds # time for next even...
[ "0.6125524", "0.5842367", "0.5835992", "0.5787089", "0.5771827", "0.5767159", "0.5761559", "0.57614523", "0.5683583", "0.56713635", "0.56365997", "0.5625341", "0.56223917", "0.5598241", "0.5570882", "0.55639154", "0.55524063", "0.5544458", "0.55353314", "0.55329156", "0.55313...
0.7328528
0
It prints the evolution of the maximum of the realizations of the process at given times Returns None.
def printEvolutionMaximum(self): evolutionMaximum = self.getEvolutionMax(); print(evolutionMaximum) print("The path of the maximum evolution is the following:") print() print('\n'.join('{:.3}'.format(max) for max in evolutionMaximum)) print()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getEvolutionMax(self):\n \n return [self.getMaximumAtGivenTime(timeIndex) for timeIndex in range(self.numberOfTimes - 1)]", "def plotEvolutionMaximum(self):\n evolutionMaximum = self.getEvolutionMax();\n plt.plot(evolutionMaximum)\n plt.xlabel('Time')\n plt.ylabel('Ma...
[ "0.601353", "0.5673783", "0.5593407", "0.55719185", "0.5419212", "0.5312438", "0.5301795", "0.5280384", "0.52526265", "0.521304", "0.52068067", "0.52050275", "0.5189907", "0.5148449", "0.5141974", "0.5139584", "0.5132588", "0.5115675", "0.5103251", "0.5102717", "0.51026523", ...
0.6115887
0
It plots the evolution of the maximum of the realizations of the process at given times Returns None.
def plotEvolutionMaximum(self): evolutionMaximum = self.getEvolutionMax(); plt.plot(evolutionMaximum) plt.xlabel('Time') plt.ylabel('Maximum realizations') plt.show()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updatefig(*args):\n p1.set_array(turn(grid))\n p2.set_data(tally['time'], tally['sickos'])\n p3.set_data(tally['time'], tally['immune'])\n p4.set_data(tally['time'], tally['dead'])\n ax2.set_xlim(0, max(tally['time']))\n # ax2.set_ylim(0, max(max(sickos), max(immune)))\n # End sim if the d...
[ "0.627695", "0.6128777", "0.609871", "0.6001754", "0.5972552", "0.59707105", "0.59184533", "0.5913484", "0.59092885", "0.5882151", "0.58819574", "0.5839702", "0.583627", "0.58102316", "0.5798293", "0.5763779", "0.5756616", "0.57515097", "0.574167", "0.5741197", "0.5739625", ...
0.6852981
0
Test case for create_project
def test_create_project(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_project_request(self):\n pass", "def test_add_project(self):\n pass", "def test_project_creation(self):\n title = 'Project title'\n code = 'SCW-12345'\n project = self.create_project(\n title=title,\n code=code,\n institution=s...
[ "0.87766117", "0.8437002", "0.841835", "0.80077946", "0.7994402", "0.7775029", "0.77226585", "0.76863635", "0.7676147", "0.76569086", "0.7646558", "0.7646026", "0.76438665", "0.7638706", "0.76039904", "0.74945164", "0.7460312", "0.7429228", "0.74266595", "0.7354817", "0.73494...
0.94393003
0
Test case for list_projects
def test_list_projects(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_list_project(self):\n pass", "def test_get_projects(self):\n pass", "def test_list_project_request(self):\n pass", "def test_get_project_list_with_projects(self):\n # Add two test projects.\n projects = [\n add_project(title='1', description='1'),\n ...
[ "0.9042425", "0.8778745", "0.87161314", "0.8480545", "0.8213874", "0.79792327", "0.7973112", "0.79351175", "0.7776914", "0.7674936", "0.7659318", "0.7621019", "0.7614639", "0.7605095", "0.75506294", "0.750285", "0.73882", "0.73737574", "0.72951984", "0.72737426", "0.72640103"...
0.92746294
0
Test case for read_project
def test_read_project(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_project(self):\n pass", "def test_get_projects(self):\n pass", "def test_list_project(self):\n pass", "def project():", "def project():", "def project():", "def test_project_detail(self):\n rv = self.app.get(\"/Assignment0\")\n self.assertIn(\"Assignment0...
[ "0.828083", "0.7624312", "0.73511124", "0.70184237", "0.70184237", "0.70184237", "0.6992255", "0.69816697", "0.69816697", "0.6962875", "0.6943265", "0.69107896", "0.68491393", "0.6812562", "0.6809167", "0.6785107", "0.6785107", "0.6785107", "0.6781834", "0.67258483", "0.66303...
0.92293584
0
Test case for update_project
def test_update_project(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_patch_project(self):\n pass", "def test_replace_project(self):\n pass", "def test_patch_project(self):\n self.assertEqual(Project.objects.count(), 2)\n\n url = reverse(\n 'projectroles:api_project_update',\n kwargs={'project': self.project.sodar_uuid},...
[ "0.82712364", "0.7873975", "0.7442448", "0.74199355", "0.7384629", "0.7369599", "0.73155415", "0.7272609", "0.7195377", "0.7130262", "0.7127845", "0.7127845", "0.7127845", "0.7080842", "0.7078068", "0.7027116", "0.7027116", "0.7027116", "0.7019853", "0.7015513", "0.700853", ...
0.94864285
0
Create a pretty image of a molecule, with a colored frame around it
def molecule_to_image(mol: Molecule, frame_color: PilColor) -> PilImage: mol = Chem.MolFromSmiles(mol.smiles) img = Draw.MolToImage(mol) cropped_img = crop_image(img) return draw_rounded_rectangle(cropped_img, frame_color)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def molecule_to_image(\n mol: Molecule, frame_color: PilColor, size: int = 300\n) -> PilImage:\n mol = Chem.MolFromSmiles(mol.smiles)\n img = Draw.MolToImage(mol, size=(size, size))\n cropped_img = crop_image(img)\n return draw_rounded_rectangle(cropped_img, frame_color)", "def _repr_png_(self):\n...
[ "0.66217947", "0.62990767", "0.62990767", "0.58950996", "0.5866949", "0.5851361", "0.5850181", "0.5778608", "0.575116", "0.5668649", "0.5657043", "0.56522775", "0.56274706", "0.5611535", "0.56026417", "0.55969375", "0.55717343", "0.55542105", "0.55526847", "0.5550516", "0.551...
0.6512195
1
Draw a rounded rectangle around an image
def draw_rounded_rectangle( img: PilImage, color: PilColor, arc_size: int = 20 ) -> PilImage: x0, y0, x1, y1 = img.getbbox() x1 -= 1 y1 -= 1 copy = img.copy() draw = ImageDraw.Draw(copy) arc_size_half = arc_size // 2 draw.arc((x0, y0, arc_size, arc_size), start=180, end=270, fill=color) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_rounded_rectangle(\n img: PilImage, color: PilColor, arc_size: int = 20\n) -> PilImage:\n # pylint: disable=invalid-name\n x0, y0, x1, y1 = img.getbbox()\n x1 -= 1\n y1 -= 1\n copy = img.copy()\n draw = ImageDraw.Draw(copy)\n arc_size_half = arc_size // 2\n draw.arc((x0, y0, arc...
[ "0.7510413", "0.72969645", "0.7181461", "0.6953991", "0.6858651", "0.68553674", "0.6835767", "0.68216497", "0.6786222", "0.67735654", "0.6771525", "0.6707417", "0.66786045", "0.6653492", "0.66526777", "0.66202426", "0.6594753", "0.6554674", "0.6513422", "0.6496861", "0.646856...
0.77442485
0
Create images of a list of molecules and save them to disc a globally managed folder.
def save_molecule_images( molecules: Sequence[Molecule], frame_colors: Sequence[PilColor] ) -> Dict[Molecule, str]: global IMAGE_FOLDER spec = {} for molecule, frame_color in zip(molecules, frame_colors): image_filepath = os.path.join( IMAGE_FOLDER, f"{molecule.inchi_key}_{frame_colo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __save_to_dir(self, imagelist, prefix, PATH):\n for pair in imagelist:\n directory = os.path.join(PATH, pair[1])\n if not os.path.exists(directory):\n os.mkdir(directory)\n filename = prefix + pair[2]\n pair[0].save(os.path.join(directory, filen...
[ "0.6778279", "0.6587836", "0.6533606", "0.6498707", "0.64328074", "0.6420537", "0.62873924", "0.62810856", "0.6238603", "0.6238188", "0.62225974", "0.61654925", "0.61612916", "0.60948086", "0.6073354", "0.60659975", "0.6053131", "0.60344714", "0.5995892", "0.59935164", "0.598...
0.68451995
0
Create an image of a bipartite graph of molecules and reactions using the dot program of graphviz
def make_graphviz_image( molecules: Union[Sequence[Molecule], Sequence[UniqueMolecule]], reactions: Union[Sequence[RetroReaction], Sequence[FixedRetroReaction]], edges: Sequence[Tuple[Any, Any]], frame_colors: Sequence[PilColor], ) -> PilImage: def _create_image(use_splines): txt = template...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_graphviz_image(\n molecules: Union[Sequence[Molecule], Sequence[UniqueMolecule]],\n reactions: Union[Sequence[RetroReaction], Sequence[FixedRetroReaction]],\n edges: Sequence[Tuple[Any, Any]],\n frame_colors: Sequence[PilColor],\n reaction_shapes: Sequence[str] = None,\n use_splines: boo...
[ "0.7629829", "0.69144285", "0.6787022", "0.67797905", "0.6778502", "0.67635626", "0.67353326", "0.6653782", "0.6613842", "0.6556271", "0.6535844", "0.6419457", "0.6395842", "0.63492775", "0.6347129", "0.6342978", "0.63408387", "0.63107", "0.63010144", "0.6286106", "0.6280245"...
0.77664346
0
Create HTML code of a bipartite graph of molecules and reactions using the vis.js network library. Package the created HTML page and all images as tarball.
def make_visjs_page( filename: str, molecules: Sequence[Molecule], reactions: Sequence[FixedRetroReaction], edges: Union[Sequence[Tuple[Any, Any]], nx.digraph.OutEdgeView], frame_colors: Sequence[PilColor], hierarchical: bool = False, ) -> None: mol_spec = save_molecule_images(molecules, fra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _repr_html_(self):\n import io\n import base64\n from PIL import Image\n\n library_name = \"vedo.assembly.Assembly\"\n help_url = \"https://vedo.embl.es/docs/vedo/assembly.html\"\n\n arr = self.thumbnail(zoom=1.1, elevation=-60)\n\n im = Image.fromarray(arr)\n ...
[ "0.65", "0.6355544", "0.62730944", "0.5997142", "0.58431", "0.58331263", "0.58309436", "0.57839453", "0.57279736", "0.57146037", "0.5705368", "0.5702328", "0.5696547", "0.56960404", "0.5689114", "0.5658812", "0.56489384", "0.5632636", "0.5624643", "0.5612612", "0.5604968", ...
0.69609904
1
Get policy state actions if they exist
def get_policy_actions(policy_lookup, state, player): if (state, player) not in policy_lookup: policy_lookup[(state, player)] = dict() return policy_lookup[(state, player)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_available_actions(self, state):\n pass", "def getActions(self, state): \n util.raiseNotDefined()", "def getLegalActions(self,state):\n return self.actionFn(state)", "def getLegalActions(self, state):\n return self.actionFn(state)", "def step(self, state):\n mcts_ac...
[ "0.7593261", "0.7569062", "0.7208601", "0.71995384", "0.7015666", "0.69273573", "0.69273573", "0.69273573", "0.6888104", "0.68572384", "0.6758826", "0.67579144", "0.67430145", "0.67199033", "0.6602976", "0.6591265", "0.65893406", "0.65571266", "0.65557694", "0.65148705", "0.6...
0.7607066
0
Get policy action value if it exists
def get_policy_value(policy_lookup, state, player, action): if action not in get_policy_actions(policy_lookup, state, player): policy_lookup[(state, player)][action] = 0 return policy_lookup[(state, player)][action]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAction(self, state):\n # Pick Action\n legalActions = self.getLegalActions(state)\n if len(legalActions) == 0:\n return None\n elif util.flipCoin(self.epsilon):\n return random.choice(legalActions)\n else:\n return self.getPolicy(state)", ...
[ "0.6932814", "0.6800669", "0.6750365", "0.6698205", "0.6698205", "0.6698205", "0.66241604", "0.6580595", "0.6480911", "0.64533645", "0.64310986", "0.64271003", "0.6360185", "0.6328164", "0.6317932", "0.63010204", "0.6281348", "0.6266339", "0.625199", "0.625199", "0.625199", ...
0.74600756
0
Return minimum policy action value for a state
def min_value(policy_lookup, state, player): action_values = list(get_policy_actions(policy_lookup, state, player).values()) if action_values: return np.min(action_values) return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPolicy(self, state):\n \"*** YOUR CODE HERE ***\"\n possibleActions = self.mdp.getPossibleActions(state)\n if len(possibleActions) == 0: return None\n results = []\n for action in possibleActions:\n total = 0\n for (nextState, prob) in self.mdp.getTra...
[ "0.7423119", "0.741661", "0.737838", "0.72380596", "0.72140557", "0.7211273", "0.71713763", "0.71495", "0.7147739", "0.7118717", "0.70819044", "0.7045204", "0.70225585", "0.7010276", "0.7000682", "0.6985005", "0.69514984", "0.69384867", "0.69344324", "0.68877256", "0.6883074"...
0.8106444
0
Return maximum policy action value for a state
def max_value(policy_lookup, state, player): action_values = list(get_policy_actions(policy_lookup, state, player).values()) if action_values: return np.max(action_values) return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_highest_value_action(self, state):\n a = self.sess.run(self.network.maxOutputNode, feed_dict={self.network.inputs: [state]})\n return a[0]", "def get_value(self, state):\n possible_actions = self.get_legal_actions(state)\n\n # If there are no legal actions, return 0.0\n ...
[ "0.8555896", "0.8210642", "0.81356865", "0.7956355", "0.7945223", "0.78740704", "0.7716465", "0.76843894", "0.767578", "0.7544931", "0.7542873", "0.7514069", "0.7505697", "0.7458506", "0.74196005", "0.7408121", "0.7404285", "0.7384199", "0.73444754", "0.7327485", "0.7325625",...
0.82146424
1
Display policy values of a board state
def visualize_policy(policy_lookup, board, player): state = board.flatten() # initialize board policy values to None board_policy_values = np.zeros((3, 3)) for i in range(3): for j in range(3): board_policy_values[i][j] = None # lookup policy value for each action for action in board.get_open(): board_poli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printState(self,board):\n self.printBoard(board.getBoard())\n self.printScore(board,board.getScore())", "def policy_eval():\r\n \r\n action_prob = [0.125, 0.625, 0.125, 0.125]# actions with probabilities\r\n data = grid_world()\r\n state_axis = np.zeros((9, 9))#initialize states\r\n ...
[ "0.6994765", "0.6739332", "0.6570411", "0.6556608", "0.644996", "0.6426292", "0.6337836", "0.6275739", "0.62564236", "0.62422144", "0.6233658", "0.6207903", "0.6100384", "0.60993165", "0.6043009", "0.6030694", "0.6024969", "0.6012984", "0.60074884", "0.5963703", "0.59048307",...
0.737854
0
Returns the sum of the numbers from lower through upper.
def summationLoop(lower, upper): sum = 0 for i in range(lower, upper + 1): sum += i return sum
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_range(self, lower, upper):\n if upper>self.upper:\n upper=self.upper\n if lower<self.lower:\n lower = self.lower\n\n i_l = int(np.floor((lower-self.lower)/self._dx))\n i_u = int(np.floor((upper-self.lower)/self._dx))\n total = 0.0\n for i in r...
[ "0.8400423", "0.8182569", "0.74909437", "0.7432203", "0.7408973", "0.70399815", "0.6944452", "0.6944229", "0.68275565", "0.6716233", "0.66702175", "0.6658637", "0.66237795", "0.6615981", "0.6517438", "0.647821", "0.6446492", "0.6336825", "0.6324186", "0.6315787", "0.62997735"...
0.82650006
1
generate a random filename
def random_filename(): return ''.join(random.choices(string.ascii_uppercase + string.digits, k=5))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_random_file_name():\n\n def random_file_name_factory():\n length = random.randint(10, 15)\n chars = string.ascii_letters + string.digits + \"-_\"\n return f\"{''.join(random.choice(chars) for _ in range(length))}.jpg\"\n\n return random_file_name_factory", "def generate_file...
[ "0.85415816", "0.80759776", "0.7940292", "0.7855972", "0.78502667", "0.7841351", "0.77415335", "0.77123237", "0.7674128", "0.74968827", "0.7459299", "0.7438276", "0.7380692", "0.7274986", "0.7238404", "0.7179149", "0.714998", "0.71346515", "0.71212363", "0.71189535", "0.71006...
0.8476896
1
Tests the creation of a AmazonS3 specific data storer.
def testCreateDataStorer(self): self.assertTrue(isinstance(self._factory.createDataStorer("identifier"), DataS3Adapter))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_amazon_s3_store_data(self):\n config = Config()\n metadata_bucket = config.config.get(\"metadata\", \"bucket\")\n data_bucket = config.config.get(\"data\", \"bucket\")\n metadata_provider = amazon.S3(config, metadata_bucket).connect()\n provider = amazon.S3(config, data_...
[ "0.7115106", "0.69014126", "0.67061657", "0.6605487", "0.65491045", "0.6284498", "0.6261592", "0.6202564", "0.61872977", "0.6168269", "0.6154194", "0.6150717", "0.6142914", "0.6121535", "0.60793626", "0.6062802", "0.60626155", "0.6047116", "0.60463965", "0.60335803", "0.60313...
0.8074689
0
Tests to update the credentials
def testUpdateCredentials(self): credentials = dict() credentials["username"] = "" credentials["password"] = "" self._factory.updateCredentials(credentials)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_user_profile(self):\n\n new_credentials = {'name': 'New Name', 'password': 'NewTestpass12'}\n response = self.client.patch(URL_ME, new_credentials)\n\n # Refresh the details of the user from the database.\n self.user.refresh_from_db()\n\n # Check that the update i...
[ "0.7746443", "0.7330875", "0.7330343", "0.7273652", "0.726221", "0.7201267", "0.7166417", "0.7116094", "0.71063346", "0.70503443", "0.7034849", "0.70041025", "0.6960353", "0.69588923", "0.69543844", "0.69487727", "0.6941252", "0.6916871", "0.69129294", "0.69068056", "0.688833...
0.81626886
0
This function is called periodically during autonomous
def AutonomousPeriodic(self): Scheduler.GetInstance().Run()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autonomousPeriodic(self):\n self.teleopPeriodic()", "def autonomousInit(self):\n #self.timer.reset()\n #self.timer.start()\n pass", "def realtime(self):", "def autonomousPeriodic(self):\n '''\n for i in self.dataSet:\n if i[4][0] < self.timer.get() and...
[ "0.76939803", "0.7333295", "0.7000954", "0.6831967", "0.6753689", "0.67142034", "0.6691596", "0.6546741", "0.65020126", "0.6491816", "0.6403982", "0.63931847", "0.63259196", "0.631717", "0.631717", "0.63160294", "0.6300988", "0.62993395", "0.62885785", "0.6281241", "0.6273936...
0.78060895
0
This function is called periodically during test mode
def TestPeriodic(self): LiveWindow.Run()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testRefresh(self):\n \n pass", "def test_run_started(self):", "def testPeriodic(self):\n wpilib.LiveWindow.run()", "def test_heartbeat(self):\n pass", "def trial(self):\n pass", "def startTestRun(self):", "def test_run_ended(self):", "def everytime(self):\n r...
[ "0.75196457", "0.7250264", "0.7207904", "0.7137617", "0.7080581", "0.6928592", "0.6900251", "0.6891117", "0.68818337", "0.67345786", "0.66311336", "0.66012233", "0.65951467", "0.6491059", "0.647534", "0.6475096", "0.6475096", "0.6475096", "0.647335", "0.64714676", "0.6459485"...
0.7506525
1
Run the Opsy server.
def run(script_info): app = script_info.load_app() server = create_server(app) try: host = app.config.opsy['server']['host'] port = app.config.opsy['server']['port'] proto = 'https' if server.ssl_adapter else 'http' app.logger.info(f'Starting Opsy server at {proto}://{host}:{...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n\t\t\n\t\tself.connect(self.config[\"server\"])", "def main():\n return run_server(**parse_server_args())", "def run(self):\n self._server = self._get_server()\n self._server.serve_forever()", "def main():\n docopt = docoptinit(__doc__)\n logging.basicConfig(level=loggi...
[ "0.6982762", "0.6922084", "0.68232703", "0.67431873", "0.6727341", "0.6725", "0.67038316", "0.667355", "0.66723275", "0.66492367", "0.6638128", "0.6635666", "0.66108435", "0.6598311", "0.65349036", "0.65341073", "0.6523984", "0.6489315", "0.6486966", "0.64636195", "0.64170146...
0.7912345
0
List all permissions the app is aware of.
def permission_list(**kwargs): print(AppPermissionSchema(many=True).dumps( get_protected_routes(ignored_methods=["HEAD", "OPTIONS"]), indent=4))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_permissions(self):\n # type: () -> List[Permission]\n headers = Headers({\"accept\": \"application/json\"})\n return self.connection.api_call(\n \"GET\", [\"resources\", self.id, \"permissions\"], model=Permission, headers=headers,\n )", "def get_all_permissions(se...
[ "0.82634306", "0.787807", "0.7769037", "0.76802576", "0.76248133", "0.75797546", "0.73929065", "0.7326292", "0.7316874", "0.7312243", "0.72730917", "0.7266721", "0.7251582", "0.72510326", "0.7225519", "0.72052515", "0.72032905", "0.7176814", "0.714984", "0.71372634", "0.71259...
0.826862
0
Write a value into the buffer for the given length. This is more efficient then creating and writing an array of a single value.
def write_value(self, value, length, error=True, move_start=True): if not error and length > self.maxsize: length = self.maxsize idxs = self.get_indexes(self._end, length, self.maxsize) self.move_end(length, error, move_start) self._data[idxs] = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write(self, value: int):\n self.data[self.pointer] = value", "def write(self, value: int, /) -> None:", "def Write(self, offset, value):\r\n addr = offset * 4 \r\n self.write(addr, value)", "def write(self, address: int, value: bytearray):\n for i, val in enumerate(value):\n ...
[ "0.65248704", "0.64803195", "0.6296469", "0.62879", "0.61605716", "0.609862", "0.60918474", "0.60880065", "0.6039514", "0.6036492", "0.60341746", "0.60159934", "0.59341705", "0.59053075", "0.584951", "0.58398277", "0.581167", "0.5808708", "0.58013177", "0.57925296", "0.577897...
0.74076855
0
Write zeros into the buffer for the specified length.
def write_zeros(self, length, error=True, move_start=True): self.write_value(0, length, error=error, move_start=move_start)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_nul_bytes(self, n):\n self.write(b'\\x00' * n)", "def prepend_zeros(data: bytes, length: int):\n print(\"prepend \" + str(length))\n return length * b\"0\" + data", "def append_zeros(input_signal, length=None):\n if length is None:\n length = 2 ** int(math.ceil(math.log(len(inp...
[ "0.6283033", "0.62015116", "0.5955452", "0.5634417", "0.5614875", "0.56004006", "0.5534813", "0.55236316", "0.5512742", "0.5460759", "0.5379353", "0.5364001", "0.52845514", "0.52615494", "0.52562517", "0.51941323", "0.517467", "0.51620394", "0.5158084", "0.51518273", "0.51403...
0.7804039
0
Read the data and move the start/read pointer, so that data is not read again. This method reads empty if the amount specified is greater than the amount in the buffer.
def read(self, amount=None): if amount is None: amount = self._length # Check available read size if amount == 0 or amount > self._length: return self._data[0:0].copy() idxs = self.get_indexes(self._start, amount, self.maxsize) self.move_start(amount) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_remaining(self, amount=None):\n if amount is None or amount > self._length:\n amount = self._length\n\n # Check available read size\n if amount == 0:\n return self._data[0:0].copy()\n\n idxs = self.get_indexes(self._start, amount, self.maxsize)\n se...
[ "0.7004888", "0.68289405", "0.6578622", "0.6386881", "0.63642263", "0.6346135", "0.63439137", "0.632571", "0.62540615", "0.6246668", "0.6226175", "0.6209409", "0.6203951", "0.61999094", "0.61687976", "0.616352", "0.6146556", "0.6113841", "0.60972565", "0.60848075", "0.6070838...
0.68437034
1
Read the data and move the start/read pointer, so that the data is not read again. This method reads the remaining data if the amount specified is greater than the amount in the buffer.
def read_remaining(self, amount=None): if amount is None or amount > self._length: amount = self._length # Check available read size if amount == 0: return self._data[0:0].copy() idxs = self.get_indexes(self._start, amount, self.maxsize) self.move_start(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _readData(self):\n # Debug. This fn should be called only after checking canRead()\n if not self._canRead():\n raise Exception(\"Trying to read more data than there is.\")\n\n data = self.buffer[:self._expectedByteCount]\n self.buffer = self.buffer[self._expectedByteCount...
[ "0.6858934", "0.65308416", "0.65099293", "0.63198656", "0.6250639", "0.6179618", "0.6173773", "0.61646664", "0.61498034", "0.6144139", "0.61436623", "0.61382663", "0.6129541", "0.6122185", "0.6102098", "0.6098493", "0.60864174", "0.6056444", "0.60450536", "0.60450536", "0.602...
0.71143496
0
Read the last amount of data and move the start/read pointer. This is an odd method for FFT calculations. It reads the newest data moving the start pointer by the update_rate amount that it was given. The returned skips number is the number of update_rate values.
def read_last(self, amount=None, update_rate=None): if amount is None: amount = self._length if update_rate is None: update_rate = amount # Check available read size if amount == 0 or amount > self._length: return None, 0 skips = (self._lengt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self) -> np.ndarray:\r\n # Read chunk from array\r\n signal_slice: np.ndarray = np.array(\r\n self._signal_data[self._pointer : self._pointer + self._chunk]\r\n )\r\n # Move index over\r\n self._pointer += self._chunk\r\n if self._pointer > len(self._...
[ "0.53829694", "0.53829694", "0.5337989", "0.53274786", "0.51686627", "0.5128614", "0.5126201", "0.511141", "0.5061084", "0.50162256", "0.50062734", "0.5001223", "0.49057913", "0.48822874", "0.48516887", "0.4841836", "0.48409307", "0.4828322", "0.48135075", "0.47934806", "0.47...
0.6848442
0
Sync the length with the start and end pointers.
def sync_length(self, should_grow=True): try: self._length = (self._end - self._start) % self.maxsize except ZeroDivisionError: self._length = 0 if self._length == 0 and should_grow: self._length = self.maxsize
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def twist(self, length):\r\n\r\n segment = []\r\n\r\n #grab all the items in the list from\r\n #our current location until the end of length\r\n mod_start = self.current_index % self.size\r\n mod_end = (self.current_index + length) % self.size\r\n\r\n #if we wrapped around...
[ "0.5956281", "0.5576492", "0.5475356", "0.54602545", "0.54277325", "0.5397421", "0.5393387", "0.52974296", "0.5243593", "0.52093387", "0.5208252", "0.519974", "0.5197779", "0.51680917", "0.516339", "0.5162192", "0.51388997", "0.5125775", "0.5125302", "0.5114871", "0.5105606",...
0.6733816
0
Return the available space.
def get_available_space(self): return self.maxsize - len(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def available_space(self):\n # From http://stackoverflow.com/a/787832/732596\n s = os.statvfs(self.path)\n return (s.f_bavail * s.f_frsize) / 1024**2", "def get_space_used():\n fs.get_space_used()", "def mem_avail():\n return psutil.virtual_memory().available", "def available_space...
[ "0.8008372", "0.7613703", "0.75092167", "0.74836314", "0.7220819", "0.7144782", "0.70907354", "0.7068847", "0.7026799", "0.7015171", "0.69986105", "0.6964338", "0.6933497", "0.68823874", "0.68521756", "0.6828981", "0.6789977", "0.674724", "0.66928", "0.6689496", "0.66668266",...
0.7887875
1
Return the dtype of the data.
def dtype(self): return self._data.dtype
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dtype(self):\n return self.data.dtype", "def dtype(self) -> DtypeLike:\n\n return self.data.dtype", "def dtype(self):\n return self.dataset.dtype", "def dtype(self):\n return self.array.dtype", "def dtype(self):\n return self._dtype", "def dtype(self):\n retu...
[ "0.87301797", "0.8446338", "0.84148496", "0.83855313", "0.83289075", "0.83289075", "0.83289075", "0.82657504", "0.8225879", "0.82118034", "0.82092184", "0.8098053", "0.80584", "0.8049524", "0.7933737", "0.7931455", "0.7907679", "0.7857508", "0.78264457", "0.78102624", "0.7801...
0.87331676
0
Creates a new certificate. If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. The poller requires the certificates/get permission, otherwise raises an
async def create_certificate( self, certificate_name: str, policy: CertificatePolicy, **kwargs ) -> Union[KeyVaultCertificate, CertificateOperation]: if not (policy.san_emails or policy.san_user_principal_names or policy.san_dns_names or policy.subject): raise ValueError(NO_SAN_OR_SUBJEC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_add_certificate(self):\n response = self.client.post(\n '/api/v1/certificates', data=json.dumps(new_certificate),\n content_type='application/json',\n headers=self.get_registrar_token())\n result = json.loads(response.data.decode())\n self.assertEqual(...
[ "0.6489642", "0.64813066", "0.63798654", "0.6109609", "0.59978354", "0.5797838", "0.57907546", "0.57467526", "0.5694181", "0.55973345", "0.55772674", "0.5559559", "0.55436045", "0.55427647", "0.55206823", "0.5512409", "0.5498758", "0.5490636", "0.5467333", "0.54404825", "0.54...
0.69468284
0
Gets a specific version of a certificate without returning its management policy. Requires certificates/get permission. To get the latest version of the certificate, or to get the certificate's
async def get_certificate_version( self, certificate_name: str, version: str, **kwargs ) -> KeyVaultCertificate: bundle = await self._client.get_certificate( vault_base_url=self.vault_url, certificate_name=certificate_name, certificate_version=version, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_certificate_request(self, vault_name: str,\n certificate_name: str,\n certificate_version: str) -> dict[str, Any]:\n url = f'https://{vault_name}{self.azure_cloud.suffixes.keyvault_dns}/certificates/{certificate_name}'\n if certifi...
[ "0.6604066", "0.62116116", "0.6183379", "0.6155492", "0.61449355", "0.61368275", "0.60539097", "0.5980792", "0.59279466", "0.5823024", "0.58037525", "0.57737714", "0.57406354", "0.5730415", "0.5730415", "0.5730415", "0.57215726", "0.5670612", "0.5638924", "0.5626855", "0.5620...
0.7093787
0
Get a deleted certificate. Possible only in a vault with softdelete enabled. Requires certificates/get permission. Retrieves the deleted certificate information plus its attributes, such as retention interval, scheduled permanent deletion, and the current deletion recovery level.
async def get_deleted_certificate(self, certificate_name: str, **kwargs) -> DeletedCertificate: bundle = await self._client.get_deleted_certificate( vault_base_url=self.vault_url, certificate_name=certificate_name, **kwargs ) return DeletedCertificate._from_deleted_certificate_bundle...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def recover_deleted_certificate(self, certificate_name: str, **kwargs) -> KeyVaultCertificate:\n polling_interval = kwargs.pop(\"_polling_interval\", None)\n if polling_interval is None:\n polling_interval = 2\n recovered_cert_bundle = await self._client.recover_deleted_certif...
[ "0.6923022", "0.63999605", "0.60577244", "0.57940936", "0.55470073", "0.5532237", "0.54090583", "0.53719103", "0.5317824", "0.5283685", "0.5267442", "0.5235222", "0.5188259", "0.5171617", "0.5094433", "0.5058892", "0.49639174", "0.49404588", "0.48969808", "0.486709", "0.48360...
0.7624662
0
Permanently deletes a deleted certificate. Possible only in vaults with softdelete enabled. Requires certificates/purge permission. Performs an irreversible deletion of the specified certificate, without possibility for recovery. The operation is not available if the
async def purge_deleted_certificate(self, certificate_name: str, **kwargs) -> None: await self._client.purge_deleted_certificate( vault_base_url=self.vault_url, certificate_name=certificate_name, **kwargs )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def delete_certificate(self, certificate_name: str, **kwargs) -> DeletedCertificate:\n polling_interval = kwargs.pop(\"_polling_interval\", None)\n if polling_interval is None:\n polling_interval = 2\n deleted_cert_bundle = await self._client.delete_certificate(\n v...
[ "0.67054504", "0.6211404", "0.6034061", "0.5930464", "0.5928886", "0.5907658", "0.588775", "0.5874071", "0.5767075", "0.57497597", "0.57255626", "0.5650153", "0.5645817", "0.56201583", "0.56109685", "0.55468774", "0.5518235", "0.54834414", "0.5473937", "0.54476756", "0.541691...
0.75400406
0
Recover a deleted certificate to its latest version. Possible only in a vault with softdelete enabled. Requires certificates/recover permission. If the vault does not have softdelete enabled,
async def recover_deleted_certificate(self, certificate_name: str, **kwargs) -> KeyVaultCertificate: polling_interval = kwargs.pop("_polling_interval", None) if polling_interval is None: polling_interval = 2 recovered_cert_bundle = await self._client.recover_deleted_certificate( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _acme_revoke(self, cert):\n # XXX | pylint: disable=unused-variable\n\n # pylint: disable=protected-access\n certificate = jose_util.ComparableX509(cert._cert)\n try:\n with open(cert.backup_key_path, \"rU\") as backup_key_file:\n key = OpenSSL.crypto.load_...
[ "0.5909231", "0.5637491", "0.5616782", "0.55714905", "0.5538955", "0.549184", "0.5395828", "0.52587295", "0.5119891", "0.5034296", "0.5010087", "0.500666", "0.49803507", "0.49446768", "0.4943516", "0.49153277", "0.49063587", "0.49057066", "0.49054945", "0.48861593", "0.484927...
0.71048915
0
Import a certificate created externally. Requires certificates/import permission. Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x50...
async def import_certificate( self, certificate_name: str, certificate_bytes: bytes, **kwargs ) -> KeyVaultCertificate: enabled = kwargs.pop("enabled", None) policy = kwargs.pop("policy", None) if enabled is not None: attributes = self._models.CertificateAttributes(enab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _store_certificate(fullchain, key, domain=None, tag_prefix=None,\n region_name=None, acm_client=None, dry_run=False):\n #pylint:disable=unused-argument\n result = _check_certificate(fullchain, key, domain=domain)\n if not domain:\n domain = result['ssl_certificate']['commo...
[ "0.555027", "0.53187644", "0.52335936", "0.51478225", "0.5022696", "0.49920884", "0.49599612", "0.49253953", "0.4920437", "0.48891997", "0.48853323", "0.48505723", "0.478446", "0.47836658", "0.47507176", "0.47453344", "0.47313616", "0.47218686", "0.47094363", "0.46670148", "0...
0.68919945
0
Gets the policy for a certificate. Requires certificates/get permission. Returns the specified certificate policy resources in the key vault.
async def get_certificate_policy(self, certificate_name: str, **kwargs) -> CertificatePolicy: bundle = await self._client.get_certificate_policy( vault_base_url=self.vault_url, certificate_name=certificate_name, **kwargs ) return CertificatePolicy._from_certificate_policy_bundle(cert...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_certificate_policy_request(self, vault_name: str, certificate_name: str) -> dict[str, Any]:\n url = f'https://{vault_name}{self.azure_cloud.suffixes.keyvault_dns}/certificates/{certificate_name}/policy'\n response = self.http_request(\n 'GET', full_url=url, resource=self.get_vault_...
[ "0.77671975", "0.6953911", "0.5839124", "0.5742078", "0.5690433", "0.5651099", "0.5582334", "0.5481366", "0.5472438", "0.5401795", "0.53769606", "0.53623295", "0.53264284", "0.53199345", "0.5318054", "0.5287591", "0.5262056", "0.52577", "0.5184184", "0.5177227", "0.5166596", ...
0.7358483
1
Updates the policy for a certificate. Requires certificates/update permission. Set specified members in the certificate policy. Leaves others as null.
async def update_certificate_policy( self, certificate_name: str, policy: CertificatePolicy, **kwargs ) -> CertificatePolicy: bundle = await self._client.update_certificate_policy( vault_base_url=self.vault_url, certificate_name=certificate_name, certificate_polic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_policy(self, *args, **kwargs):\r\n pass", "def device_update_policy(self, device_ids, policy_id):\n return self._device_action(device_ids, \"UPDATE_POLICY\", {\"policy_id\": policy_id})", "def UpdatePolicy(self, request, global_params=None):\n config = self.GetMethodConfig('Update...
[ "0.6495223", "0.6122082", "0.6114352", "0.6102968", "0.59703684", "0.5800063", "0.5687958", "0.56578624", "0.5580727", "0.54616994", "0.54585326", "0.5441063", "0.5394291", "0.535095", "0.53178614", "0.52896583", "0.5280764", "0.52681", "0.52563095", "0.52250296", "0.5208998"...
0.64556706
1
Back up a certificate in a protected form useable only by Azure Key Vault. Requires certificates/backup permission. This is intended to allow copying a certificate from one vault to another. Both vaults must be owned by the same Azure subscription. Also, backup / restore cannot be performed across geopolitical boundari...
async def backup_certificate(self, certificate_name: str, **kwargs) -> bytes: backup_result = await self._client.backup_certificate( vault_base_url=self.vault_url, certificate_name=certificate_name, **kwargs ) return backup_result.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def restore_certificate_backup(self, backup: bytes, **kwargs) -> KeyVaultCertificate:\n bundle = await self._client.restore_certificate(\n vault_base_url=self.vault_url,\n parameters=self._models.CertificateRestoreParameters(certificate_bundle_backup=backup),\n **kwarg...
[ "0.61585116", "0.5432173", "0.5318716", "0.5244657", "0.5137772", "0.50160456", "0.49782538", "0.4914477", "0.48900342", "0.4872436", "0.48656285", "0.48302194", "0.48298165", "0.48226115", "0.48034236", "0.4759593", "0.47491443", "0.4740311", "0.47066763", "0.46644107", "0.4...
0.6646567
0
Restore a certificate backup to the vault. Requires certificates/restore permission. This restores all versions of the certificate, with its name, attributes, and access control policies. If the certificate's name is already in use, restoring it will fail. Also, the target vault must be owned by the same Microsoft Azur...
async def restore_certificate_backup(self, backup: bytes, **kwargs) -> KeyVaultCertificate: bundle = await self._client.restore_certificate( vault_base_url=self.vault_url, parameters=self._models.CertificateRestoreParameters(certificate_bundle_backup=backup), **kwargs ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def backup_certificate(self, certificate_name: str, **kwargs) -> bytes:\n backup_result = await self._client.backup_certificate(\n vault_base_url=self.vault_url, certificate_name=certificate_name, **kwargs\n )\n return backup_result.value", "def restore_backup(self, backup, ...
[ "0.6206176", "0.578941", "0.57810414", "0.5518122", "0.5459229", "0.545646", "0.5449263", "0.5411994", "0.5381392", "0.5350106", "0.5296097", "0.528997", "0.52898425", "0.5289533", "0.52668786", "0.52342594", "0.5188092", "0.5162289", "0.51536995", "0.5060998", "0.5055808", ...
0.775596
0
Lists the currentlyrecoverable deleted certificates. Possible only if vault is softdelete enabled. Requires certificates/get/list permission. Retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletionspecific information.
def list_deleted_certificates( self, *, include_pending: Optional[bool] = None, **kwargs ) -> AsyncItemPaged[DeletedCertificate]: max_page_size = kwargs.pop("max_page_size", None) if self.api_version == "2016-10-01": if include_pending is not None: raise NotImple...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def recover_deleted_certificate(self, certificate_name: str, **kwargs) -> KeyVaultCertificate:\n polling_interval = kwargs.pop(\"_polling_interval\", None)\n if polling_interval is None:\n polling_interval = 2\n recovered_cert_bundle = await self._client.recover_deleted_certif...
[ "0.5930504", "0.5810624", "0.5445564", "0.5431113", "0.5354896", "0.5310337", "0.5298006", "0.5263039", "0.52389675", "0.5166186", "0.51401037", "0.5125574", "0.5110472", "0.5071451", "0.5021978", "0.50173384", "0.49939674", "0.49534753", "0.49424502", "0.4934416", "0.4934416...
0.6773191
0
List the identifiers and properties of a certificate's versions. Requires certificates/list permission.
def list_properties_of_certificate_versions( self, certificate_name: str, **kwargs ) -> AsyncItemPaged[CertificateProperties]: max_page_size = kwargs.pop("max_page_size", None) return self._client.get_certificate_versions( vault_base_url=self._vault_url, certificate_n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def certifiVersions():\n log = logger.new(function='certifiVersions')\n r = yield treq.get('https://pypi.python.org/pypi/certifi/json', timeout=5)\n log.msg(\"got certifi versions!\")\n data = yield r.json()\n\n # Note: this takes advantage of the fact that certifi's releases have the\n # same ve...
[ "0.6490166", "0.6426438", "0.63160443", "0.63044", "0.6249581", "0.61390465", "0.6003774", "0.60021186", "0.5911201", "0.5854424", "0.5776592", "0.57742536", "0.5766685", "0.5750346", "0.57278854", "0.56947684", "0.56905156", "0.5607363", "0.5604912", "0.5604374", "0.5584045"...
0.65740174
0
Sets the certificate contacts for the key vault. Requires certificates/managecontacts permission.
async def set_contacts(self, contacts: List[CertificateContact], **kwargs) -> List[CertificateContact]: new_contacts = await self._client.set_certificate_contacts( vault_base_url=self.vault_url, contacts=self._models.Contacts(contact_list=[c._to_certificate_contacts_item() for c in conta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_contacts(self, contacts):\n\n\t\tif contacts is not None and not isinstance(contacts, list):\n\t\t\traise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: contacts EXPECTED TYPE: list', None, None)\n\t\t\n\t\tself.__contacts = contacts\n\t\tself.__key_modified['Contacts'] = 1", "def contacts(self, contacts)...
[ "0.7523106", "0.71805346", "0.71805346", "0.6156637", "0.6142041", "0.5884162", "0.58729553", "0.58603793", "0.57227623", "0.5721069", "0.57132614", "0.5505021", "0.5488495", "0.54683405", "0.5432297", "0.5311218", "0.5282868", "0.528062", "0.5279917", "0.52583146", "0.525220...
0.78716165
0
Gets the certificate contacts for the key vault. Requires the certificates/managecontacts permission.
async def get_contacts(self, **kwargs) -> List[CertificateContact]: contacts = await self._client.get_certificate_contacts( vault_base_url=self._vault_url, **kwargs ) return [CertificateContact._from_certificate_contacts_item(contact_item=item) for item in contacts.contact_list]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_contacts(self):\n return self.contacts", "def get_contacts(self):\n\n\t\treturn self.__contacts", "def getcontacts():\n contacts = {}\n\n try:\n #get list of contact ids\n contactids = r.smembers(\"contacts\")\n\n #for each contact id get data\n for contactid i...
[ "0.734212", "0.7277253", "0.7175655", "0.6969443", "0.6927339", "0.6741601", "0.669288", "0.6679771", "0.6647958", "0.66372335", "0.6624503", "0.6612645", "0.6528251", "0.64787", "0.6432151", "0.63611555", "0.6351894", "0.6325086", "0.62903816", "0.6270996", "0.62341815", "...
0.83755594
0
Deletes the certificate contacts for the key vault. Requires the certificates/managecontacts permission.
async def delete_contacts(self, **kwargs) -> List[CertificateContact]: contacts = await self._client.delete_certificate_contacts( vault_base_url=self.vault_url, **kwargs ) return [CertificateContact._from_certificate_contacts_item(contact_item=item) for item in contacts.contact_list]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_contacts(self):\n self.db.delete_all_contacts()\n return self.update_contacts()", "def delete_contacts(self, contacts):\n self._post('contact_actions', None, self._build_params(contacts=contacts, action='delete'))", "def delete(self):\n self.skype.conn(\"DELETE\", \"{0}/u...
[ "0.7537571", "0.7379823", "0.63402975", "0.6199307", "0.615296", "0.6111035", "0.6089803", "0.60673594", "0.5951288", "0.5945933", "0.58693403", "0.58645344", "0.58433", "0.5814317", "0.5788029", "0.5750317", "0.5739216", "0.5732476", "0.5683771", "0.56610817", "0.5631036", ...
0.8016096
0
Gets the creation operation of a certificate. Requires the certificates/get permission.
async def get_certificate_operation(self, certificate_name: str, **kwargs) -> CertificateOperation: bundle = await self._client.get_certificate_operation( vault_base_url=self.vault_url, certificate_name=certificate_name, **kwargs ) return CertificateOperation._from_certificate_opera...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CreateCertificate(self, request):\n try:\n params = request._serialize()\n headers = request.headers\n body = self.call(\"CreateCertificate\", params, headers=headers)\n response = json.loads(body)\n model = models.CreateCertificateResponse()\n ...
[ "0.5323745", "0.5290432", "0.5155442", "0.5148315", "0.5133307", "0.5133307", "0.5133307", "0.5118752", "0.5118752", "0.5118752", "0.51068866", "0.51068866", "0.5080824", "0.50439566", "0.50420284", "0.49880618", "0.49764156", "0.4970792", "0.4961988", "0.49596292", "0.492790...
0.60303086
0
Cancels an inprogress certificate operation. Requires the certificates/update permission.
async def cancel_certificate_operation(self, certificate_name: str, **kwargs) -> CertificateOperation: bundle = await self._client.update_certificate_operation( vault_base_url=self.vault_url, certificate_name=certificate_name, certificate_operation=self._models.CertificateOpe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _cancel_pending_change(self, cert_obj):\n try:\n change_url = (\n cert_obj.cert_details[\"Akamai\"]\n [\"extra_info\"][\"change_url\"]\n )\n except KeyError:\n status = \"Maybe the domain {} already removed? \" \\\n ...
[ "0.67305464", "0.60831314", "0.6037295", "0.6024934", "0.6024934", "0.6024934", "0.6024934", "0.5966845", "0.5931395", "0.57804435", "0.57093364", "0.5697872", "0.5600302", "0.55759084", "0.55702156", "0.5547477", "0.5547477", "0.55273867", "0.5523492", "0.5518105", "0.551810...
0.6692325
1
Merges a certificate or a certificate chain with a key pair existing on the server. Requires the certificates/create permission. Performs the merging of a certificate or certificate chain with a key pair currently available in the service. Make sure when creating the certificate to merge using
async def merge_certificate( self, certificate_name: str, x509_certificates: List[bytes], **kwargs ) -> KeyVaultCertificate: enabled = kwargs.pop("enabled", None) if enabled is not None: attributes = self._models.CertificateAttributes(enabled=enabled) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_certificate_chain():\n caext = X509Extension(b\"basicConstraints\", False, b\"CA:true\")\n not_after_date = datetime.date.today() + datetime.timedelta(days=365)\n not_after = not_after_date.strftime(\"%Y%m%d%H%M%SZ\").encode(\"ascii\")\n\n # Step 1\n cakey = PKey()\n cakey.generate_ke...
[ "0.5912793", "0.5785164", "0.5719512", "0.5630169", "0.5488952", "0.54233533", "0.52684283", "0.5234029", "0.5136958", "0.5136601", "0.51317996", "0.5124178", "0.5102918", "0.5094773", "0.5064548", "0.50599504", "0.5055451", "0.49640405", "0.4957639", "0.49432704", "0.4898972...
0.6241665
0
Updates the specified certificate issuer. Requires certificates/setissuers permission.
async def update_issuer(self, issuer_name: str, **kwargs) -> CertificateIssuer: enabled = kwargs.pop("enabled", None) account_id = kwargs.pop("account_id", None) password = kwargs.pop("password", None) organization_id = kwargs.pop("organization_id", None) admin_contacts = kwargs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def issuer(self, issuer: str):\n\n self._issuer = issuer", "def certificate_issuer_id(self, certificate_issuer_id):\n\n self._certificate_issuer_id = certificate_issuer_id", "def issuer(self, value):\n\n is_oscrypto = isinstance(value, asymmetric.Certificate)\n if not isinstance(val...
[ "0.6972535", "0.6511538", "0.64975655", "0.617353", "0.60718924", "0.58061564", "0.56294805", "0.55558544", "0.5507725", "0.53951555", "0.53897464", "0.5285362", "0.52114314", "0.5205502", "0.51751256", "0.5158138", "0.515145", "0.5130808", "0.51226896", "0.50910485", "0.5083...
0.76455516
0
Deletes the specified certificate issuer. Requires certificates/manageissuers/deleteissuers permission.
async def delete_issuer(self, issuer_name: str, **kwargs) -> CertificateIssuer: issuer_bundle = await self._client.delete_certificate_issuer( vault_base_url=self.vault_url, issuer_name=issuer_name, **kwargs ) return CertificateIssuer._from_issuer_bundle(issuer_bundle=issuer_bundle)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def certificate_issuer_id(self):\n return self._certificate_issuer_id", "def certificate_issuer_id(self, certificate_issuer_id):\n\n self._certificate_issuer_id = certificate_issuer_id", "def issuer(self, value):\n\n is_oscrypto = isinstance(value, asymmetric.Certificate)\n if not i...
[ "0.54405326", "0.53633106", "0.5308739", "0.5292008", "0.51837564", "0.5093947", "0.5015717", "0.48553553", "0.48267108", "0.47868848", "0.47505197", "0.4654417", "0.46471775", "0.46171558", "0.4612264", "0.46041763", "0.46008196", "0.45570296", "0.45004335", "0.4493562", "0....
0.73457456
0
Lists properties of the certificate issuers for the key vault. Requires the certificates/manageissuers/getissuers permission.
def list_properties_of_issuers(self, **kwargs) -> AsyncItemPaged[IssuerProperties]: max_page_size = kwargs.pop("max_page_size", None) return self._client.get_certificate_issuers( vault_base_url=self.vault_url, maxresults=max_page_size, cls=lambda objs: [IssuerProperti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_trusted_issuers():\n\n # Query the blockchain and manage exceptions\n try:\n trusted_issuers = tf.dump_trusted_identities()\n except Exception as e:\n detail=str(e)\n log.error(detail)\n raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=detail)\n\n ...
[ "0.62516004", "0.5375079", "0.5267441", "0.523019", "0.51898634", "0.5173039", "0.5050751", "0.497449", "0.49561843", "0.4937976", "0.49265328", "0.48140576", "0.47978282", "0.47966686", "0.47876447", "0.47876447", "0.4781479", "0.4780105", "0.47510105", "0.47499838", "0.4743...
0.732406
0
Returns the list of all geometries in given region
def get_geometry(self, region=None) -> List[Geometry2D]: return self.geometry_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allGeometry(self):\n\n # TODO: This needs to handle pagination once that is implemented in the web\n # service.\n req = urllib2.Request(self.baseUri + 'geometry')\n r = urllib2.urlopen(req)\n\n data = json.load(r)\n\n # This ignore the \"lastEditTime\" and just works on the data.\n for ite...
[ "0.67121756", "0.64286244", "0.6395986", "0.63092536", "0.6299374", "0.6102714", "0.60804313", "0.60661674", "0.60644054", "0.5955644", "0.5845528", "0.5827808", "0.57959247", "0.57683283", "0.5693263", "0.5645893", "0.5640617", "0.5637714", "0.56285036", "0.5622284", "0.5608...
0.7447639
0