query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
to get the data in grid lines
def grid_line(object): def __init__(self, casenum): self.casenum = casenum def getList(self): """ to get the whole list of grid line data """ lineList = get_array(self.casenum, 'branch') self.lineList = lineList return lineList def getLin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grid_lines(self):\n # get edges initially in model coordinates\n use_ref_coords = self.use_ref_coords\n self.use_ref_coords = False\n xyedges = self.xyedges\n self.use_ref_coords = use_ref_coords\n\n xmin = xyedges[0][0]\n xmax = xyedges[0][-1]\n ymin = x...
[ "0.67843086", "0.6667962", "0.6639809", "0.65646976", "0.6479268", "0.6388036", "0.6334958", "0.63266695", "0.6300384", "0.62831205", "0.62409914", "0.619513", "0.61594695", "0.61511624", "0.61485094", "0.6129613", "0.61257434", "0.61074805", "0.60834837", "0.60828245", "0.60...
0.72366786
0
to get the whole list of grid line data
def getList(self): lineList = get_array(self.casenum, 'branch') self.lineList = lineList return lineList
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grid_line(object):\n def __init__(self, casenum):\n self.casenum = casenum\n \n def getList(self):\n \"\"\"\n to get the whole list of grid line data\n \"\"\"\n lineList = get_array(self.casenum, 'branch')\n self.lineList = lineList\n return lineLis...
[ "0.7344816", "0.7205422", "0.67930704", "0.67659235", "0.66508794", "0.6500586", "0.64731324", "0.64722013", "0.632781", "0.62839407", "0.62142247", "0.618896", "0.61152285", "0.61150104", "0.6106856", "0.61065537", "0.6069832", "0.60571694", "0.6055219", "0.6054586", "0.6045...
0.0
-1
in this example, there is only one thread
def example0(name): print("main started") my_func("realpython") print("main ended")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_thread(self):", "def executor(self):", "def run(self):", "def run(self):", "def run(self):", "def run(self):", "def run(self):", "def run(self):", "def run(self):", "def run(self):", "def run(self):", "def run(self):", "def _make_thread(self):\r\n pass", "def run(self):...
[ "0.7880205", "0.73612", "0.7268202", "0.7268202", "0.7268202", "0.7268202", "0.7268202", "0.7268202", "0.7268202", "0.7268202", "0.7268202", "0.7268202", "0.7105681", "0.7069302", "0.69082105", "0.6903735", "0.6903735", "0.68982446", "0.688398", "0.6798316", "0.6776921", "0...
0.0
-1
in this example, multiple threads are run main started myfunc started with realpython myfunc1 started with foo myfunc2 started with haha myfunc ended myfunc2 ended myfunc1 ended main ended
def example4(name): print("main started") # main thread t1 = threading.Thread(target=my_func, args=['realpython']) # the second thread t1.start() t2 = threading.Thread(target=my_func1, args=['foo']) # the third thread t2.start() t3 = threading.Thread(target=my_func2, args=['haha']) # the fourth ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def example5(name):\n print(\"main started\") # main thread\n with concurrent.futures.ThreadPoolExecutor(max_workers=3) as e:\n e.map(my_func, ['realpython', 'bar', 'haha'])\n print(\"main ended\")", "def example0(name):\n print(\"main started\")\n my_func(\"realpython\")\n print(\"main ...
[ "0.72712207", "0.7134418", "0.6344133", "0.62373", "0.5900686", "0.58492994", "0.57990813", "0.57882786", "0.5758856", "0.5754322", "0.5727432", "0.5726683", "0.5707882", "0.5698103", "0.5674418", "0.564004", "0.5619732", "0.561841", "0.5604227", "0.5597306", "0.55969626", ...
0.756083
0
This example recreates example4 but in a more efficient way using thread pool main started myfunc started with realpython myfunc started with bar myfunc started with haha myfunc ended myfunc ended myfunc ended main ended
def example5(name): print("main started") # main thread with concurrent.futures.ThreadPoolExecutor(max_workers=3) as e: e.map(my_func, ['realpython', 'bar', 'haha']) print("main ended")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def example0(name):\n print(\"main started\")\n my_func(\"realpython\")\n print(\"main ended\")", "def example4(name):\n print(\"main started\") # main thread\n t1 = threading.Thread(target=my_func, args=['realpython']) # the second thread\n t1.start()\n t2 = threading.Thread(target=my_func1...
[ "0.7121908", "0.70680535", "0.6010677", "0.5877939", "0.58015925", "0.5801124", "0.5707956", "0.56762254", "0.5649907", "0.562774", "0.562774", "0.562774", "0.562774", "0.562774", "0.562774", "0.562774", "0.562774", "0.562774", "0.562774", "0.562774", "0.562774", "0.562774"...
0.75483465
0
View to show the cart page. Get the products in the cart base on whether the user is logged in or not. Think about the idea when user is logged in and not logged in.
def get(self,request): try: if request.user.is_authenticated(): cart = self.cart_obj.get_cart_by_user(request.user) else: cart = self.cart_obj.get_cart_by_id(request.session.get('cart_id',None)) if not cart: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_cart(request):\n categories = all_categories()\n productTypes = all_productTypes()\n return render(request, \"cart.html\", {\"categories\": categories,\n \"productTypes\": productTypes})", "def detail(request):\n # del request.session['cart_id']\n #...
[ "0.7836032", "0.7605336", "0.7576391", "0.7427119", "0.73779625", "0.736863", "0.7343909", "0.7343909", "0.73066235", "0.73066235", "0.73066235", "0.72929233", "0.7132074", "0.7132074", "0.71241754", "0.7099787", "0.70438397", "0.69991326", "0.6998831", "0.6988149", "0.696664...
0.7479689
3
API Insert the files into Elasticsearch.
def insert_filedetails_ajax(request): try: file_path = request.GET.get('file_path') file_name, extension = splitext(file_path) date_time = datetime.datetime.now().strftime("%Y.%m.%d_%H:%M:%S") json_obj = {"file_path": file_path, "extension": extension, "date_ingested": date_time} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_to_index( env, meta_dict, file_str, logger ):\n global adapter_glob\n if adapter_glob is not None:\n adapter = adapter_glob\n else:\n logger.warning( u\"Connecting to index...\" )\n adapter = adapter_file.adapter(env)\n adapter_glob = adapter\n doc = document(\n ...
[ "0.6646253", "0.649103", "0.6468256", "0.6400195", "0.6380662", "0.6347296", "0.62993985", "0.6227582", "0.6178393", "0.6102029", "0.60767525", "0.6047224", "0.6043802", "0.6040563", "0.602994", "0.60210097", "0.5976548", "0.5956317", "0.5937528", "0.5911576", "0.5901469", ...
0.0
-1
API get all the documents from Elasticsearch.
def get_allfiles_ajax(request): try: get_all = fetch_all() return JsonResponse({"fs_metadata": get_all['hits']['hits'], "message": "Success", "status_code": "200"}) except Exception as e: print("Get All Documents Error : ", e) return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_all(): \n client, index_name = connection_es()\n res = client.search(index = index_name+\"*\")\n return res", "def list_documents(\n self, index: str, query: Dict[str, Any] = None\n ) -> Iterable[Dict[str, Any]]:\n return es_scan(self.__client__, query=query or {}, index=in...
[ "0.7677105", "0.72987986", "0.71383095", "0.70095366", "0.69514704", "0.6827761", "0.6823215", "0.6781777", "0.6666381", "0.6641504", "0.6638397", "0.6512604", "0.6504365", "0.6417668", "0.6381008", "0.63642246", "0.63193834", "0.626496", "0.62535805", "0.62307006", "0.622177...
0.0
-1
API update using id and tag into Elasticsearch.
def update_filedetails_ajax(request): try: document_id = request.GET.get('document_id') tag = request.GET.get('tag') get_index = find_index_with_document(document_id) updated_data = update(get_index, document_id, tag) return JsonResponse({"fs_metadata": updated_data, "message...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(get_index, document_id, tag): \n client, index_name = connection_es()\n res = client.update(index = get_index, doc_type = 'nvisnx', id = document_id, body= {\"doc\" : {\"tag\": tag}})\n return res", "def update(self, tag, params={}, **options):\n path = \"/tags/%s\" % (tag)\n ...
[ "0.7698348", "0.7082211", "0.6979634", "0.6839155", "0.6732194", "0.672683", "0.669146", "0.666812", "0.6547668", "0.64642787", "0.6374026", "0.6337735", "0.63087946", "0.6255031", "0.60572124", "0.6016344", "0.5969136", "0.59264106", "0.5920357", "0.5919323", "0.5915952", ...
0.0
-1
API delete documents using id from Elasticsearch.
def delete_filedetails_ajax(request): try: document_id = request.GET.get('document_id') get_index = find_index_with_document(document_id) deleted_data = delete(get_index, document_id) return JsonResponse({"document_id": document_id, "message": "Success", "status_code": "200"}) ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def document_delete(index_name, doc_type, doc_id):\n resp = es.delete(index=index_name, doc_type=doc_type, id=doc_id)\n print(resp)", "def delete(get_index, document_id): \n client, index_name = connection_es()\n resp = client.delete(index = get_index, doc_type=\"nvisnx\", id = document_id)\n r...
[ "0.7428253", "0.7047408", "0.70071435", "0.69630975", "0.6870129", "0.67370117", "0.66782504", "0.6675429", "0.66510236", "0.65836054", "0.65232456", "0.6499699", "0.64743775", "0.64278865", "0.6404531", "0.6381131", "0.63614595", "0.6350981", "0.6345756", "0.6326952", "0.630...
0.0
-1
Generate a hex UID
def generate_uid(length=10): uid = uuid.uuid4().hex[0:length] return uid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_uid():\n return random_string(5, string.hexdigits.lower())\n # return (\"%x\" % (int(time.time()) * 0x10 % 0x1000000000)\n # + random_string(7, string.hexdigits.lower()))", "def generate_user_id() -> str:\n return 'u' + str((uuid.getnode()))", "def new_uid():\n return str(uuid...
[ "0.8424885", "0.77790034", "0.77502453", "0.76640016", "0.7663068", "0.75369626", "0.75063133", "0.7452815", "0.7432415", "0.7419043", "0.74088436", "0.74088436", "0.73718894", "0.72921085", "0.7273682", "0.7256061", "0.7255503", "0.7239619", "0.7232834", "0.7204194", "0.7201...
0.7920812
1
Generates the URL "slug" not predefined due changing titles
def slug(self): slug = slugify(self.text) return "%s/%s" % (self.uid, slug[:36]) # max 24 characters
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_slug(self):\n slug = slugify(self.title)\n new_slug = slug\n s = 1\n while Article.objects.filter(slug=new_slug).exists():\n \"\"\"increase value of slug by one\"\"\"\n new_slug = f'{slug}-{s}'\n s += 1\n return new_slug", "def crea...
[ "0.74424213", "0.74022186", "0.73629117", "0.71713024", "0.70533115", "0.69844365", "0.69625795", "0.6874045", "0.6861308", "0.6859211", "0.6859211", "0.6793881", "0.6777502", "0.67266905", "0.6687068", "0.6683898", "0.6611359", "0.65894544", "0.65846866", "0.6571645", "0.654...
0.6478431
24
Calculates the STIP features for a specified set of input files and stores them in the output location.
def calc_stip_features(path_to_videos, filename, path_to_output_file, ext=None, start_frame=None, end_frame=None, overwrite=True): if not overwrite and os.path.isfile(path_to_output_file): # Skip if file already present log("Ignoring file {}{}, because overwrite is disabled"....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_spec(input_filepath, output_filepath):\n file_list = glob.glob(input_filepath + '/*')\n file_list.sort()\n features_set = []\n with ShadyBar(f\"Extracting features {input_filepath}...\", max=len(file_list)) as bar:\n for f in file_list:\n interim_data = np.loadtxt(f, delimit...
[ "0.6002216", "0.57004464", "0.5582022", "0.5469837", "0.5357879", "0.53559333", "0.52715075", "0.52210796", "0.5204268", "0.51967114", "0.519573", "0.5174511", "0.51638204", "0.5157115", "0.51457024", "0.51314926", "0.51284796", "0.5092859", "0.50881195", "0.5074976", "0.5068...
0.50084573
24
Process files from the queue.
def worker(queue, run): for args in iter(queue.get, None): try: run(*args) except Exception as e: # catch exceptions to avoid exiting the thread prematurely print('{} failed: {}'.format(args, e), file=sys.stderr)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def task(self, chunk_filename_queue, writer):\n self.init_structs()\n while True:\n filename = chunk_filename_queue.get()\n for item in self.single_file_gen(filename):\n writer.send_bytes(item)", "def process_queue(self):\n if not self.has_queue:\n ...
[ "0.70209163", "0.6941973", "0.68375695", "0.6716875", "0.6712224", "0.66711754", "0.6402412", "0.6341205", "0.6331502", "0.6320673", "0.63120264", "0.62958574", "0.62499005", "0.62422794", "0.62272096", "0.62058926", "0.6197084", "0.6181007", "0.6170086", "0.6163313", "0.6162...
0.0
-1
Starts threads to run the function with processes in parallel
def start_processes_in_parallel(queue, func, number_of_process=None): if not number_of_process: number_of_process = mp.cpu_count() - 1 # start threads threads = [Thread(target=worker, args=(queue, func)) for _ in range(number_of_process)] for t in threads: t.daemon = True # threads...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_in_parallel(self):\n\t\tfor p in self.parallel_threads:\n\t\t\tp.start()\n\t\tfor p in self.parallel_threads:\n\t\t\tp.join()", "def MultiProcesses( *functions ):\n \n # Variables\n processes = np.array( [] )\n \n # Sending processes in parallel\n for function in functions:\n proce...
[ "0.7552233", "0.7321745", "0.712635", "0.702093", "0.70002836", "0.69785124", "0.68648654", "0.6764552", "0.6708156", "0.6672512", "0.6651728", "0.6645571", "0.65197843", "0.6495909", "0.6478915", "0.6467651", "0.6460147", "0.64334625", "0.6405026", "0.6401871", "0.6387127", ...
0.7281942
2
Computes the name of a county given it's zipcode
def county_name(zipcode): search = SearchEngine(simple_zipcode=True) # set simple_zipcode=False to use rich info database zipcode_query = search.by_zipcode(str(zipcode)) zipcode_query_dict = zipcode_query.to_dict() county = zipcode_query_dict['county'] if county is None: print('Invalid Coun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def city_country(city_name, country_name):\n city_country_combo = city_name + ', ' + country_name\n return city_country_combo.title()", "def city_country(city_name, country_name):\n combi = f\"{city_name.title()}, {country_name.title()}\"\n return combi.title()", "def city_state_zip(**kwargs):\r\n ...
[ "0.6422869", "0.63803333", "0.63314253", "0.6329193", "0.6269642", "0.6251078", "0.6227773", "0.6216738", "0.618028", "0.61654603", "0.61536604", "0.61536604", "0.60994875", "0.6088756", "0.6076896", "0.6072779", "0.60661525", "0.6040675", "0.6012614", "0.59852415", "0.595690...
0.8695817
0
For each test, build a new YaraAnalyzer.
def setUp(self): self.setUpPyfakefs() with mock.patch.object(subprocess, 'Popen', side_effect=thor_mocks.mock_thor_start): self._analyzer = yara_analyzer.YaraAnalyzer() # Write target file. # pylint: disable=no-member self.fs.create_file('./target.exe', contents='Thi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n super(TestAnalyzer, self).__init__()\n self._results = []", "def testGetAnalyzerInstances(self):\n analyzer_names = manager.AnalyzersManager.GetAnalyzerNames()\n analyzers = manager.AnalyzersManager.GetAnalyzerInstances(analyzer_names)\n self.assertEqual(len(analyzer_names), ...
[ "0.61968255", "0.5871857", "0.56706536", "0.5612355", "0.5585955", "0.55783165", "0.5506784", "0.5488338", "0.54793984", "0.5476998", "0.54543394", "0.5441958", "0.5440611", "0.5424232", "0.5421577", "0.5412421", "0.54094994", "0.54019105", "0.5391985", "0.5389894", "0.538531...
0.0
-1
Verify the mocked request matches.
def _assert_request(mock_requests: mock.MagicMock, mock_output: mock.MagicMock): # Verify UPX call mock_output.assert_has_calls([ mock.call(['./upx', '-q', '-d', mock.ANY], stderr=subprocess.STDOUT), ]) mock_requests.assert_has_calls([ mock.call('http://127.0.0.1:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def match_request(\n self,\n method,\n url,\n *,\n data=None,\n auth=None,\n params=None,\n headers=None,\n allow_redirects=None,\n timeout=None,\n json=None,\n cookies=None,\n **kwargs,\n ):\n data = data or...
[ "0.6924573", "0.67021644", "0.6677142", "0.66608727", "0.66096157", "0.65619034", "0.6518308", "0.64706886", "0.6379971", "0.63056576", "0.622024", "0.61340016", "0.60706127", "0.6043272", "0.6036543", "0.60285103", "0.60253316", "0.5987051", "0.5979541", "0.59752214", "0.597...
0.63318384
9
Analyze returns the expected list of rule matches.
def test_analyze(self, mock_requests: mock.MagicMock, mock_output: mock.MagicMock): yara_matches = self._analyzer.analyze('/target.exe') self._assert_request(mock_requests, mock_output) self.assertEqual(1, len(yara_matches)) match = yara_matches[0] self.assertEqual('THOR', match...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def match_rules(rules, wm):\n res = []\n for r in rules:\n new_patterns = match_rule(r[0],r[1],r[2], wm)\n if new_patterns:\n print(\" Match succeeds\")\n print(\" Adding assertions to WM\")\n else:\n print(\" Match fails\...
[ "0.5835707", "0.58267164", "0.55471814", "0.5527018", "0.5368063", "0.5300912", "0.52113616", "0.51996094", "0.5143646", "0.5127022", "0.51096666", "0.5081547", "0.50634825", "0.506103", "0.50559425", "0.5054468", "0.5012354", "0.5004759", "0.50028557", "0.5001351", "0.499751...
0.5871569
0
Analyze returns empty list if no matches.
def test_analyze_no_matches(self, mock_requests: mock.MagicMock, mock_output: mock.MagicMock): self.assertEqual([], self._analyzer.analyze('/target.exe')) self._assert_request(mock_requests, mock_output)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_hits(self, broker, search):\n # TODO: Use sets when RHEL-4 is no longer supported\n hits = []\n for hit in search.findall(self._read_file(broker.log)):\n if hit not in hits:\n hits.append(hit)\n return hits", "def analyzeAll(self, program: ghidra.pro...
[ "0.56661934", "0.5630961", "0.5487526", "0.5433682", "0.53892547", "0.53883475", "0.53814745", "0.5375211", "0.5301285", "0.5206891", "0.5190482", "0.5187957", "0.51719016", "0.5168622", "0.5146465", "0.5142774", "0.5142774", "0.51228255", "0.5053054", "0.5051791", "0.5048823...
0.5484506
3
[(page_image, page_ocr), ...] > [(product_image, product), ...] >>> assert_excel_parser( ... parser=main,
def main(url): return excel_parser( url, extract_product_from_data )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_parse_sample_sheet(self):\n pass", "def parse_pages():\n\n excel_filename = 'Result_' + datetime.datetime.now().strftime('%Y-%m-%d %H-%M-%S') + '.xlsx'\n workbook = xlsxwriter.Workbook(excel_filename)\n worksheet_all = workbook.add_worksheet()\n\n create_headers(worksheet_all, workboo...
[ "0.6254735", "0.5377421", "0.5323541", "0.5106242", "0.50258374", "0.49943188", "0.49895155", "0.4969769", "0.4964595", "0.49275738", "0.4897017", "0.4897017", "0.48849654", "0.48579365", "0.48426545", "0.48359296", "0.48239824", "0.47577006", "0.47136748", "0.4708069", "0.47...
0.52425975
3
After each test, rolls back the sandboxed_session
def rollback_session_after_test(self, sandboxed_session): yield sandboxed_session.rollback()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tearDown(self):\n self.session.close()", "def teardown_session(e):\n my_db.close()\n OT_spider.close()", "def tearDown(self): \n db.session.rollback()", "def tearDown(self): \n db.session.rollback()", "def tearDown(self):\n self.sess.close()", "...
[ "0.7122727", "0.6794178", "0.6663135", "0.6663135", "0.66445196", "0.66358507", "0.66308486", "0.6602018", "0.65987426", "0.6561146", "0.6548552", "0.6548552", "0.6532302", "0.6532302", "0.6532302", "0.6532302", "0.6532302", "0.6532302", "0.65306467", "0.6514152", "0.6481635"...
0.8207038
0
(Computed) The etag of the IAM policy.
def etag(self) -> str: return pulumi.get(self, "etag")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def etag(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"etag\")", "def etag(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"etag\")", "def etag(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"etag\")", "def etag(self) -> pulumi.Output[str]:\n return pul...
[ "0.70715654", "0.70715654", "0.70715654", "0.70715654", "0.70715654", "0.70715654", "0.70715654", "0.6971113", "0.6930204", "0.6930204", "0.6930204", "0.6930204", "0.6930204", "0.6930204", "0.6930204", "0.6930204", "0.6930204", "0.6930204", "0.6930204", "0.6930204", "0.693020...
0.71049285
6
The providerassigned unique ID for this managed resource.
def id(self) -> str: return pulumi.get(self, "id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def provider_id(self):\n return self.get('_id')", "def provider_id(self):\n raise NotImplementedError", "def id(self):\n return self.raw_resource.uuid", "def healthcare_provider_id(self):\n return self._healthcare_provider_id", "def unique_identifier(self) -> str:\n retur...
[ "0.8193402", "0.7851373", "0.77124894", "0.7604287", "0.7477648", "0.7476093", "0.7476093", "0.7476093", "0.7425807", "0.7380237", "0.7371964", "0.7371964", "0.7371964", "0.7371964", "0.7371964", "0.7371964", "0.7371964", "0.7371964", "0.735787", "0.735787", "0.73477197", "...
0.0
-1
(Required only by `storage.BucketIAMPolicy`) The policy data generated by a `organizations_get_iam_policy` data source.
def policy_data(self) -> str: return pulumi.get(self, "policy_data")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def policy_data(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"policy_data\")", "def policy_data(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"policy_data\")", "def policy_data(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"policy_data\")", "def pol...
[ "0.80894715", "0.79416263", "0.7624144", "0.75112396", "0.75105304", "0.7228022", "0.71576035", "0.71576035", "0.71576035", "0.7105232", "0.6949225", "0.69218427", "0.69218427", "0.69131845", "0.6870519", "0.6870519", "0.68398976", "0.6836218", "0.6836218", "0.6814781", "0.68...
0.7941598
4
Retrieves the current IAM policy data for bucket example ```python import pulumi import pulumi_gcp as gcp policy = gcp.storage.get_bucket_iam_policy(bucket=google_storage_bucket["default"]["name"]) ```
def get_bucket_iam_policy(bucket: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetBucketIamPolicyResult: __args__ = dict() __args__['bucket'] = bucket opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) __ret__ = pulu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bucket_iam_policy_output(bucket: Optional[pulumi.Input[str]] = None,\n opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetBucketIamPolicyResult]:\n ...", "def get_bucket_policy(Bucket=None):\n pass", "def policy(self) -> typing.Optional[\"BucketPolicy...
[ "0.8047549", "0.7948865", "0.69205636", "0.69205636", "0.6630802", "0.6520681", "0.63187873", "0.6244433", "0.6199992", "0.6199992", "0.61718905", "0.61498356", "0.61498356", "0.6139455", "0.6080319", "0.60535866", "0.6042336", "0.600247", "0.598721", "0.592493", "0.5898587",...
0.8031223
1
Retrieves the current IAM policy data for bucket example ```python import pulumi import pulumi_gcp as gcp policy = gcp.storage.get_bucket_iam_policy(bucket=google_storage_bucket["default"]["name"]) ```
def get_bucket_iam_policy_output(bucket: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetBucketIamPolicyResult]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bucket_iam_policy(bucket: Optional[str] = None,\n opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetBucketIamPolicyResult:\n __args__ = dict()\n __args__['bucket'] = bucket\n opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)\n __re...
[ "0.8031692", "0.79494417", "0.6921183", "0.6921183", "0.6630346", "0.6521183", "0.63191986", "0.6243815", "0.6201865", "0.6201865", "0.6170791", "0.6149633", "0.6149633", "0.61402816", "0.60815215", "0.6054667", "0.6043298", "0.60041904", "0.5985827", "0.59267944", "0.5898068...
0.80478656
0
Fetch data from Genesys and save it into Json files. This data is used to study the duplication level between USDA and CGN.
def fetch_data(): log = logging.getLogger(__name__) log.info('Checking data files...') if not os.path.isfile('CGN.txt'): params_cgn = { 'institute.code': ['NLD037'], # 'crops': ['tomato'], 'taxonomy.genus': ['Solanum', 'Lycopersicon'], 'taxonomy.specie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_genotype_data():\n print(\"downloading genotype data\")\n download_from_url(PSAM_PATH, dst=f\"{GENOTYPE_DATA_PATH}/{MERGED_GENOTYPE_FILE}.psam\", desc=\"downloading psam\")\n download_from_url(PVAR_PATH, dst=f\"{GENOTYPE_DATA_PATH}/{MERGED_GENOTYPE_FILE}.pvar.zst\",\n des...
[ "0.5973477", "0.5803134", "0.57299006", "0.5714865", "0.56429684", "0.56429684", "0.56427765", "0.56059736", "0.55862916", "0.55444044", "0.55252194", "0.54157865", "0.53990847", "0.53948665", "0.53821665", "0.5366713", "0.53538084", "0.5352743", "0.53450966", "0.5336839", "0...
0.76027054
0
Print a list. Start with the name, then iter through items. Finally print its length. Also works with sets, tuples...
def printL(L, L_name='List', verbose=True): if verbose: ('\n[' + L_name + ']:') if verbose: for item in list(L): print('\t' + str(item)) print('[' + L_name + '] length: ' + str(len(L)) + '\n')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_list(l, name=None, output=sys.stdout):\n if not name:\n name = '<no name given>'\n\n if not l or len(l) == 0:\n print('>>>>>>> list = ' + name + ' - EMPTY', file=output)\n return\n\n if name is None:\n name = str(l[0].__class__)\n\n print('>>>>>>> list = ' + name +...
[ "0.7141043", "0.6907795", "0.6866269", "0.6848637", "0.6724731", "0.6533302", "0.64033216", "0.6328528", "0.62946206", "0.62609035", "0.62533116", "0.62444794", "0.62444794", "0.6242436", "0.62266845", "0.6219947", "0.621447", "0.61818296", "0.615832", "0.6102063", "0.609076"...
0.6851405
3
Get all instances of this class in the registry.
def get_instances(cls, recursive=False): instances = list(cls._instances) if recursive: for Child in cls.__subclasses__(): instances += Child.get_instances(recursive=recursive) # Remove duplicates from multiple inheritance. return list(set(instances))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_instances(cls):\n raise NotImplementedError", "def get_all_cached_instances(cls):\n return list(cls.__dbclass__.__instance_cache__.values())", "def getinstances(cls):\n\t\t\tdead = set()\n\t\t\tfor ref in cls._instances:\n\t\t\t\tobj = ref()\n\t\t\t\tif obj is not None:\n\t\t\t\t\tyield o...
[ "0.7619687", "0.72287494", "0.70653266", "0.7045179", "0.6888304", "0.68455154", "0.68399835", "0.6827565", "0.6720347", "0.6706184", "0.66594434", "0.6623655", "0.6620567", "0.65878433", "0.65827703", "0.6566919", "0.6550206", "0.65336657", "0.6468475", "0.64582914", "0.6431...
0.732727
1
Gets all the models which share the MetaModel origin.
def get_models(cls, recursive=False): models = list(cls._models) if recursive: for child in cls.__subclasses__(): models += child.get_models(recursive=recursive) return list(models)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def models(self):\r\n return self.get_field('model')", "def models(self):\r\n return self.get_field('model')", "def peak_all_models(self) -> List:\n models = list(self.meta.name)\n print(models)\n return models", "def get_related_models(self):\n\t\tmodels = []\n\t\tif not s...
[ "0.67832965", "0.67832965", "0.6562437", "0.6512124", "0.6445747", "0.63675845", "0.63225657", "0.62866795", "0.6277958", "0.62186563", "0.61224395", "0.6100776", "0.6088184", "0.6084223", "0.6077946", "0.6038946", "0.6030036", "0.6029571", "0.5980312", "0.5946005", "0.594548...
0.5592448
28
Instantiate a new build rule based on kwargs. Appropriate args list varies with rule type.
def new(ruletype, **kwargs): try: ruleclass = TYPE_MAP[ruletype] except KeyError: raise error.InvalidRule('Unrecognized rule type: %s' % ruletype) try: return ruleclass(**kwargs) except TypeError: log.error('BADNESS. ruletype: %s, data: %s', ruletype, kwargs) rai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build(cls, **kwargs):\n return cls(kwargs) #pylint: disable=no-value-for-parameter", "def __init__(self, *args):\n this = _libsbml.new_Rule(*args)\n try: self.this.append(this)\n except: self.this = this", "def construct(args,\n **kwargs):\n kw = parse_args(args)...
[ "0.6302051", "0.61495674", "0.5984927", "0.59743166", "0.5813008", "0.5790656", "0.5728552", "0.57015586", "0.5655793", "0.5636998", "0.5636998", "0.5636998", "0.5636998", "0.5636998", "0.56218827", "0.56109154", "0.55799127", "0.55431616", "0.54849225", "0.54520905", "0.5445...
0.69835865
0
simply returns a splash for not logged in users or its mailbox if the user is logged in
def index(): if current_user.is_authenticated: return redirect(url_for("mailbox.mailbox_list_received")) return render_template("index_bs.html")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def me():\n return current_user.get()", "def GET_validuser(self):\r\n c.response_content_type = 'text/plain'\r\n if c.user_is_loggedin:\r\n return c.user.name\r\n else:\r\n return ''", "def get_current_user(self):\n try:\n user = super().get_curre...
[ "0.601104", "0.5755353", "0.57426095", "0.5733698", "0.56513757", "0.5626156", "0.5553362", "0.5520831", "0.5493673", "0.5485242", "0.54466677", "0.54420096", "0.5426605", "0.5426264", "0.53759664", "0.53759664", "0.5362569", "0.5355861", "0.5355861", "0.53546566", "0.534246"...
0.5122155
54
Returns a JSON containing unread notifications for the user
def notification(): # pop-up notification notifies = NotifyModel.get_notify(current_user.get_id()) return jsonify(notifications=notifies)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_unread_messages():\n mark_seen = request.args.get('mark_seen', True)\n unread_msg = g.driver.get_unread()\n\n if mark_seen:\n for msg in unread_msg:\n msg.chat.send_seen()\n\n return jsonify(unread_msg)", "def get_all_user_notifications(self, user_id):\n dao = Notific...
[ "0.7635725", "0.72683996", "0.7085017", "0.703589", "0.68658626", "0.68634385", "0.6820263", "0.6811239", "0.67490655", "0.67361164", "0.65947247", "0.6419349", "0.64029396", "0.63255686", "0.631757", "0.6290393", "0.62488854", "0.6229212", "0.62270206", "0.6173307", "0.61195...
0.6450524
11
Takes an unsorted list, a threshold, below which insertion sort is used instead of merge sort, and a boolean reverse, which determines if the list is sorted in increasing or decreasing order. This part splits the list into progressively smaller parts then calls merge to put it all back together
def merge_sort(unsorted, threshold, reverse): length = len(unsorted) if length < 2: return unsorted elif length < threshold: return insertion_sort(unsorted, reverse) else: mid = length//2 list1 = unsorted[0:mid] list2 = unsorted[mid:length] list1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge_sort(input_list,start,end):\n if start < end:\n mid=(start+end)//2\n merge_sort(input_list,start,mid)\n merge_sort(input_list,mid+1,end)\n return merge(input_list,start,mid,end)", "def test_list_with_unbalanced_halves():\n lst = [2, 4, 3, 8, 1, 9, 10, 13]\n assert m...
[ "0.6500331", "0.64686525", "0.6465554", "0.64295685", "0.64216506", "0.6392987", "0.63503456", "0.63239914", "0.6315092", "0.62860906", "0.62561256", "0.62519425", "0.6209382", "0.62084955", "0.620024", "0.6192919", "0.6174429", "0.6171197", "0.61506146", "0.61372715", "0.612...
0.76275474
0
Merges two lists, first and second, in either increasing or decreasing order, depending on reverse
def merge(first, second, reverse): final = [0]*(len(first)+len(second)) i = 0 j = 0 if reverse: while i+j < len(final): if (j >= len(second)) or ((i < len(first)) and (first[i] > second[j])): final[i+j] = first[i] i += 1 else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge(l1, l2):\n\n #Reverse the lists\n l1 = list(reversed(l1))\n l2 = list(reversed(l2))\n\n ret = []\n\n while True:\n # If either list is empty, reverse the other one and append it to the end\n if not l1:\n ret.extend(reversed(l2))\n return ret\n if ...
[ "0.78887236", "0.76090616", "0.74231946", "0.74130917", "0.74009126", "0.7382625", "0.7322549", "0.7304537", "0.7280156", "0.7268654", "0.7245732", "0.7214211", "0.7207699", "0.71946347", "0.7191366", "0.71792436", "0.7142443", "0.7132886", "0.71247315", "0.7108219", "0.70609...
0.7846751
1
Takes an unsorted list and sorts it using the insertion sort method in the order specified by the value of reverse
def insertion_sort(unsorted, reverse): length = len(unsorted) if reverse: i = 0 j = 0 while i < length: j = i while j > 0 and unsorted[j] > unsorted[j-1]: temp = unsorted[j] unsorted[j] = unsorted[j-1] unso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_2(l):\n l.reverse()", "def reverse_sort(list_to_sort: List) -> List:\n if len(list_to_sort) == 1:\n return list_to_sort\n list_to_sort = [e for e in list_to_sort] # to avoid sorting in place, comment this to change original list\n for j in range(len(list_to_sort) - 2, -1, -1):\n ...
[ "0.7853301", "0.7687661", "0.75495464", "0.75006354", "0.74556357", "0.71750027", "0.7122347", "0.7091604", "0.7055314", "0.7043185", "0.7035889", "0.6994239", "0.69913334", "0.69231874", "0.69068694", "0.68790865", "0.68767464", "0.68348974", "0.6812114", "0.6803969", "0.677...
0.7310547
5
Create a new client.
def __init__(self, url, username, password): self.session = requests.session() self.session.auth = (username, password) self.session.headers.update({ 'Accept': JSON_CONTENT_TYPE, }) self.url = url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_client(self) -> None:\n pass", "def create_client(name):\n client = Client(name=name)\n print(client.client_secret)\n db.session.add(client)\n db.session.commit()\n return client", "def create_client(\n body: ClientmodelClientCreateRequest,\n x_additional_headers: Optional[Di...
[ "0.8414307", "0.7898926", "0.76239187", "0.7560852", "0.7491058", "0.7406467", "0.71997094", "0.71953195", "0.7139246", "0.7005442", "0.698633", "0.69013715", "0.6881409", "0.68806535", "0.68705076", "0.6847955", "0.68408066", "0.67676437", "0.6740156", "0.6707498", "0.667444...
0.0
-1
Fetch a single legislation expression, if it exists, by filtering on the FRBR URI. We do this because there is no GET endpoint for a work FRBR URI, only an expression FRBR URI. By default, only fetches the id and frbr_uri fields. Specify a list of fields to fetch otherwise.
def find_legislation(self, frbr_uri_prefix, fields=('field_frbr_uri',)): params = { 'filter[field_frbr_uri][value]': frbr_uri_prefix, 'filter[field_frbr_uri][operator]': 'STARTS_WITH' } if fields: params['fields[node--legislation]'] = ','.join(fields) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_legislation(self, expr_uri, fields=('field_frbr_uri',)):\n # the GET request requires this accept header, not the default one\n headers = {\n 'Accept': 'application/json',\n }\n params = {}\n if fields:\n params['fields[node--legislation]'] = ','.joi...
[ "0.69796807", "0.49620867", "0.48607516", "0.4747582", "0.47416613", "0.46898153", "0.4659622", "0.45725793", "0.4541741", "0.45356673", "0.45117137", "0.44913068", "0.44750413", "0.4474428", "0.44622138", "0.44539246", "0.4417351", "0.44019884", "0.43827352", "0.43553713", "...
0.64284
1
Fetch a single legislation expression, if it exists. By default, only fetches the id and frbr_uri fields. Specify a list of fields to fetch otherwise.
def get_legislation(self, expr_uri, fields=('field_frbr_uri',)): # the GET request requires this accept header, not the default one headers = { 'Accept': 'application/json', } params = {} if fields: params['fields[node--legislation]'] = ','.join(fields) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_legislation(self, frbr_uri_prefix, fields=('field_frbr_uri',)):\n params = {\n 'filter[field_frbr_uri][value]': frbr_uri_prefix,\n 'filter[field_frbr_uri][operator]': 'STARTS_WITH'\n }\n\n if fields:\n params['fields[node--legislation]'] = ','.join(fie...
[ "0.61241204", "0.51818883", "0.49835798", "0.49209628", "0.49200243", "0.48930994", "0.47840205", "0.4743934", "0.45873097", "0.4581193", "0.45607665", "0.45160976", "0.44856694", "0.4447797", "0.44260952", "0.4411156", "0.4410095", "0.4408937", "0.440199", "0.43945158", "0.4...
0.7090029
0
List all legislation expressions for a place.
def list_legislation(self, place_code): results = [] params = { 'filter[field_frbr_uri][value]': f'/akn/{place_code}/', 'filter[field_frbr_uri][operator]': 'STARTS_WITH', 'fields[node--legislation]': 'field_frbr_uri', } url = self.url + '/jsonapi/node/...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def legends(self):\n return [leg for leg in self._legends]", "def list_formulae():\n return _list_tindyb_unique_values(\"formula\", dbpath=__dbpath__)", "def describe_locations():\n pass", "def _derive_country_MX(place):\n lname = place.name.lower()\n derived = []\n match = _PARENTHETIC...
[ "0.5264176", "0.49682465", "0.49632758", "0.49632642", "0.49223864", "0.49025452", "0.4897046", "0.48797643", "0.48588276", "0.48420218", "0.47878242", "0.4753311", "0.47311145", "0.4720755", "0.4714829", "0.4704091", "0.47006062", "0.47000864", "0.46678424", "0.46594155", "0...
0.610629
0
Create a new legislation work and expression and return the full description.
def create_legislation_work(self, info): resp = self.session.post( self.url + '/jsonapi/node/legislation', json=info, headers={'Content-Type': JSON_CONTENT_TYPE}, timeout=self.timeout) self.check_for_error(resp) info = resp.json()['data'] i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_legislation(self, expr_uri, info):\n resp = self.session.post(\n self.url + expr_uri,\n json=info,\n headers={'Content-Type': JSON_CONTENT_TYPE},\n timeout=self.timeout)\n self.check_for_error(resp)\n info = resp.json()['data']\n if...
[ "0.61689997", "0.5541025", "0.5490086", "0.54542214", "0.54395074", "0.53243685", "0.5317579", "0.52964807", "0.5295471", "0.52922416", "0.5291361", "0.5267162", "0.5234458", "0.5223556", "0.5218605", "0.52170676", "0.5212621", "0.52034056", "0.51867324", "0.5184041", "0.5176...
0.5217925
15
Create a new legislation expression and return the full description.
def create_legislation(self, expr_uri, info): resp = self.session.post( self.url + expr_uri, json=info, headers={'Content-Type': JSON_CONTENT_TYPE}, timeout=self.timeout) self.check_for_error(resp) info = resp.json()['data'] if not info: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_descr(self, attr_name):", "def leg_maker(size=40, color='0x9C661F'):\n leg = GOval(size, size+30)\n leg.filled = True\n leg.fill_color = color\n leg.color = color\n return leg", "def description(self):\n assert not self._expression_used\n self._handle_used = True\n return sel...
[ "0.57703763", "0.5612563", "0.5591931", "0.5380776", "0.53548706", "0.5211884", "0.512674", "0.51117057", "0.51014334", "0.5098089", "0.5097364", "0.50892615", "0.50838184", "0.50791925", "0.50747347", "0.507339", "0.5043403", "0.50364876", "0.503377", "0.5032216", "0.5019911...
0.5830445
0
Delete legislation by node id.
def delete_legislation(self, expr_uri): resp = self.session.delete(self.url + expr_uri, timeout=self.timeout) self.check_for_error(resp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def del_node (self, id):\n raise NotImplementedError", "def delete_node(self, _id):\n return self.make_request(\"DELETE\", \"nodes/\"+_id, {})", "def delete_node(self, node_id, connection=None):\n\n connection = connection or self.engine.connect()\n\n # delete the paths associated with ...
[ "0.77828246", "0.7355772", "0.70663506", "0.7061792", "0.69358206", "0.6900647", "0.67953926", "0.6771778", "0.6755386", "0.6737594", "0.66836745", "0.66422313", "0.6557317", "0.6516612", "0.64261824", "0.6405015", "0.6396118", "0.63222146", "0.6305334", "0.62353", "0.6234832...
0.60244304
31
Patch an existing legislation by node id.
def update_legislation(self, expr_uri, info): resp = self.session.patch( self.url + expr_uri, json=info, headers={'Content-Type': JSON_CONTENT_TYPE}, timeout=self.timeout) self.check_for_error(resp) return resp.json()['data']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_id(self, patch_id):\n self._patch_id = patch_id", "def change_node(self, node: dict):\n # check if it is not overriding existing node\n if node.get('id') is not None:\n if node['id'] not in self._nodes:\n raise ValueError('tried to change non-existing node...
[ "0.6265677", "0.5985221", "0.5901512", "0.5749885", "0.56735283", "0.5509904", "0.5506046", "0.5481858", "0.5442415", "0.5403813", "0.54012805", "0.53729826", "0.535759", "0.53066707", "0.5290731", "0.5279866", "0.5233747", "0.52330667", "0.5196351", "0.51735353", "0.5155912"...
0.0
-1
Upload a file to the lii and return the node id.
def upload_file(self, node, fname, data, fieldname): resp = self.session.post( self.url + f'/jsonapi/node/{node}/{fieldname}', data=data, headers={ 'Content-Type': 'application/octet-stream', 'Content-Disposition': f'attachment; filename="{fnam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upload_file(self, f):\n return self._telegraph.upload_file(f)", "def node_file_upload(ctx, file, filename):\n filepath = click.format_filename(file)\n filename = filename if filename else filepath\n\n with open(file, \"r\") as f:\n content = f.read()\n\n try:\n ctx.obj['node'...
[ "0.7023373", "0.687328", "0.6477241", "0.6289029", "0.62865573", "0.6145262", "0.6127179", "0.60793984", "0.6061025", "0.6020251", "0.6013384", "0.59927136", "0.5989776", "0.5945167", "0.59342283", "0.5850324", "0.5836321", "0.583418", "0.58282876", "0.5811652", "0.5753125", ...
0.723194
0
List files associated with a legislation node.
def list_legislation_files(self, nid, field): resp = self.session.get(self.url + f"/jsonapi/node/legislation/{nid}/{field}", timeout=self.timeout) self.check_for_error(resp) return resp.json()['data']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def listFiles(self):\n pass", "def list_file(self, path: str) -> List[FileName]:\n current_file = self.file_exists(path)\n if current_file is None:\n raise FileNotExistException(\n \"Path doesn't exist. Can't list non-existent path\"\n )\n if curre...
[ "0.69451326", "0.65188605", "0.63498425", "0.6243756", "0.6219241", "0.6154089", "0.61321485", "0.6004312", "0.5975518", "0.5971345", "0.59706646", "0.5954831", "0.5954498", "0.5953372", "0.59485877", "0.5926061", "0.59160614", "0.59031665", "0.58852905", "0.5877798", "0.5866...
0.7763789
0
Filters an attack event.
def filter(self, value, attackEvent): queryDigits = sum(c.isdigit() for c in attackEvent.fields["query"]) groups = re.findall("(==|!=|<|<=|>|>=)(\d+)", value) relationship = groups[0][0] number = int(groups[0][1]) if relationship == "==" and queryDigits == number: re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_event(event):\n tokens = event.split()\n# if tokens[-1] in SUBJS and tokens[-2] == \"tell\":\n# return True\n# if tokens[-1] in [\"know\", \"say\", \"think\"]:\n# return True\n # filter eventualities with only 2 tokens\n if len(tokens) <= 2:\n return True\n # filter hot verbs\n if an...
[ "0.59108555", "0.575912", "0.55490017", "0.5546458", "0.55433214", "0.55248475", "0.5505036", "0.5472423", "0.5446081", "0.5388685", "0.5386382", "0.5383061", "0.52962315", "0.5282356", "0.5271071", "0.5254203", "0.5186451", "0.51769686", "0.5170154", "0.5162012", "0.5154676"...
0.0
-1
Retrieve the tcp identified by the specified identifier
def getIpTcp(self): query = '' conn = self.get_connection() headers = { 'Content-type' : 'application/json', 'Authorization' : 'A10 %s' %self.sessionid} conn.request('GET', self.get_path() + '/' + query, headers=headers) response = conn.getresponse() expected_status = 200 errors = {500: 'An unexpected run...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lookup_socket(self, address): # TODO: optimize me\n\n net_tuple = self.read_nodestate(0)\n for item in net_tuple:\n discovered_address = item[1]\n if address == discovered_address:\n return item[0]", "def tcp_socket(self) -> Optional[pulumi.Input['TCPSocket...
[ "0.59464496", "0.55471534", "0.5472671", "0.54111755", "0.53893316", "0.5299998", "0.52808774", "0.5254719", "0.5224211", "0.52072257", "0.5200745", "0.5184563", "0.5152923", "0.5148989", "0.5146435", "0.51278967", "0.5104274", "0.51016253", "0.5075102", "0.5066041", "0.50655...
0.69662493
0
Replace the object tcp
def putIpTcp(self, tcp): query = '' conn = self.get_connection() headers = { 'Content-type' : 'application/json', 'Authorization' : 'A10 %s' %self.sessionid} output=OrderedDict() output['tcp']=serialize_Tcp_json(tcp) payload = serialize_final_json(output) conn.request('PUT', self.get_path() + '/' + query,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace(name, newobject):", "def put(cls, obj):\n pass", "def swap_socket(self, new_sock):\n del self.socket\n self.socket = new_sock\n self.conn = self.socket", "def _update_object(self, data_dict):\r\n pass", "def put(self, obj):\n\n if obj is None:\n ...
[ "0.58834565", "0.5881783", "0.56873995", "0.5530008", "0.5500321", "0.54792285", "0.5454966", "0.5424171", "0.5419293", "0.5419293", "0.5400785", "0.53520703", "0.53288096", "0.5328373", "0.5314694", "0.5311538", "0.52730453", "0.52693754", "0.5240439", "0.52332467", "0.52060...
0.57627726
2
Remove the tcp identified by the specified identifier from the system
def deleteIpTcp(self): query = '' conn = self.get_connection() headers = { 'Content-type' : 'application/json', 'Authorization' : 'A10 %s' %self.sessionid} conn.request('DELETE', self.get_path() + '/' + query, headers=headers) response = conn.getresponse() expected_status = 200 errors = {500: 'An unexpect...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_tcp(ctx, global_ip, global_port, local_ip, local_port):\n\n # Verify the ip address format \n if is_valid_ipv4_address(local_ip) is False:\n ctx.fail(\"Given local ip address {} is invalid. Please enter a valid local ip address !!\".format(local_ip))\n\n if is_valid_ipv4_address(global_i...
[ "0.66617686", "0.61916286", "0.61521727", "0.58983296", "0.58463335", "0.5779146", "0.5741216", "0.57381725", "0.5735484", "0.57274055", "0.56983846", "0.5684289", "0.56816524", "0.5629058", "0.5621266", "0.5618001", "0.5610599", "0.5610599", "0.56052005", "0.5603235", "0.555...
0.74882025
0
Create the object tcp
def submitIpTcp(self, tcp): query = '' conn = self.get_connection() headers = { 'Content-type' : 'application/json', 'Authorization' : 'A10 %s' %self.sessionid} output=OrderedDict() output['tcp']=serialize_Tcp_json(tcp) payload = serialize_final_json(output) conn.request('POST', self.get_path() + '/' + qu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n # Create a TCP/IP socket\n self.client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)", "def __init__(self):\n self.host = socket.gethostname() # 192.168.56.1\n self.port = 33000\n self.buffer_size = 1024\n self.address = (self.host, se...
[ "0.70379204", "0.685682", "0.6756597", "0.6746518", "0.6735529", "0.66671294", "0.66281486", "0.66208684", "0.6613877", "0.6589314", "0.658274", "0.65486974", "0.65486974", "0.65458995", "0.6543262", "0.65430474", "0.65310043", "0.6520433", "0.6496424", "0.647834", "0.6472835...
0.0
-1
Retrieve all tcp objects currently pending in the system
def getAllIpTcps(self): query = '' conn = self.get_connection() headers = { 'Content-type' : 'application/json', 'Authorization' : 'A10 %s' %self.sessionid} conn.request('GET', self.get_path() + '/' + query, headers=headers) response = conn.getresponse() expected_status = 200 errors = {500: 'An unexpected...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetListTCPObjects(self):\n rdata =[]\n total = 0\n with open(self.ServerInfo['MgmtObjects'].MGMTServerFilePathTCPPorts) as f:\n data = json.load(f)\n total = data['total']\n if total == 0:\n return None\n for i in range(total):\n # prin...
[ "0.69517106", "0.64199525", "0.6138711", "0.6105612", "0.59809905", "0.5949874", "0.59222156", "0.5889137", "0.57988304", "0.5736065", "0.5722521", "0.57223004", "0.57219213", "0.5707166", "0.56596583", "0.56313956", "0.5623342", "0.55821925", "0.557804", "0.5577517", "0.5568...
0.69884336
0
Runs kmeans on 1 GPU.
def run_kmeans(x, nmb_clusters, verbose=False): n_data, d = x.shape # faiss implementation of k-means clus = faiss.Clustering(d, nmb_clusters) clus.niter = 10 clus.max_points_per_centroid = 10000000 res = faiss.StandardGpuResources() flat_config = faiss.GpuIndexFlatConfig() flat_config....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n data = Dummy(n_samples=500, n_dim=3)\n X = data.get_dummy()\n clustering = Kmeans(X, K=5, display=False)\n clustering.run()\n print(f\"Number of iterations: {clustering.num_iterations}\\n\")\n\n \"\"\" Test example of clustering_kmeans with unknown number of clusters K \"\"\"\n c...
[ "0.67367566", "0.6471971", "0.6289722", "0.626697", "0.62218416", "0.6204235", "0.6202007", "0.6184911", "0.6184055", "0.6147832", "0.6088372", "0.606217", "0.6025204", "0.59815586", "0.59565955", "0.5939371", "0.59327406", "0.5915717", "0.59018946", "0.58462656", "0.5816353"...
0.64684594
2
Preprocess an array of features.
def preprocess_features(npdata, pca=128): _, ndim = npdata.shape npdata = npdata.astype('float32') # Using PCA didn't help in our case. # Apply PCA-whitening with Faiss #mat = faiss.PCAMatrix (ndim, pca, eigen_power=-0.9) #mat.train(npdata) #assert mat.is_trained #npdata = mat.app...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess_feature(df):", "def preprocess_features(features):\n rowsum = np.array(features.sum(1))\n r_inv = np.power(rowsum, -1).flatten()\n r_inv[np.isinf(r_inv)] = 0.\n r_mat_inv = sp.diags(r_inv)\n features = r_mat_inv.dot(features)\n return features.toarray() # densify -- these are ti...
[ "0.7355943", "0.6872203", "0.680106", "0.6781985", "0.67640245", "0.66646343", "0.66646343", "0.660503", "0.66022897", "0.65712607", "0.6488485", "0.64480215", "0.64433885", "0.64012057", "0.6370464", "0.63638115", "0.6356219", "0.6356219", "0.63524216", "0.63437927", "0.6343...
0.672049
5
Insert a new Node at the end of linked list
def insert(self, data): if self.head == None: self.head = Node(data) else: curr = self.head while curr.link != None: curr = curr.link curr.link = Node(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_end(self, data):\n\n if self.head is None:\n self.head = ListNode(data)\n else:\n temp = self.head\n while temp.next is not None:\n temp = temp.next\n temp.next = ListNode(data)", "def insert_after(self,node,new_node):\n n...
[ "0.8148187", "0.7815384", "0.7763275", "0.7622498", "0.7496598", "0.74464536", "0.74432915", "0.7405461", "0.73680526", "0.7358912", "0.72806185", "0.72622913", "0.72363603", "0.7232796", "0.71699554", "0.7160366", "0.7143708", "0.7132515", "0.7132515", "0.71115035", "0.70284...
0.70837075
20
Display all linked list elements
def display(self, end="->"): curr = self.head result = '' while curr != None: result += str(curr.data) + end curr = curr.link result = result.strip(end) print(result)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display(self):\r\n elems = [] #create a list of elements we've seen\r\n current_node = self.head\r\n while current_node.next!=None:\r\n current_node = current_node.next\r\n elems.append(current_node.data)\r\n print(elems)", "def list_print(self):\n nod...
[ "0.84568965", "0.8213851", "0.808806", "0.80566", "0.80476457", "0.79047906", "0.78577435", "0.7706681", "0.7697232", "0.76910263", "0.76873213", "0.7658046", "0.76558465", "0.7618996", "0.7616294", "0.75307035", "0.7484382", "0.74367356", "0.7413044", "0.7277549", "0.7274222...
0.68089575
34
Get the length of the linked list
def get_length(self): curr = self.head length = 0 while curr != None: length += 1 curr = curr.link return length
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_length(self):\n pointer = self.head\n counter = 0\n while pointer:\n counter += 1\n pointer = pointer.next_node\n return counter", "def length(self):\n return self.linked_list.length()", "def length(self):\r\n current_node = self.head\r\n ...
[ "0.8839559", "0.88344073", "0.8750934", "0.86144745", "0.83789593", "0.8362712", "0.83407676", "0.83168334", "0.83009917", "0.82192546", "0.8112709", "0.8077225", "0.80621135", "0.80393803", "0.80384076", "0.8028961", "0.79636455", "0.79584897", "0.7937", "0.7933721", "0.7933...
0.8840205
0
Get the element at specified position or returns None if position does not exist
def get_element(self, pos): curr = self.head count = 1 while curr != None: if count == pos: return curr.data curr = curr.link count += 1 return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_position(self, pos):\n element = self.head\n count = 1\n\n if pos == 1:\n return element\n elif pos > 1 and self.head:\n while count < pos:\n element = element.next\n count += 1\n if element is None:\n ...
[ "0.7687424", "0.7412961", "0.6943923", "0.68401533", "0.67232615", "0.67172253", "0.66860145", "0.66341776", "0.6605367", "0.6601718", "0.6578222", "0.6516474", "0.6492555", "0.6492555", "0.64918137", "0.64886534", "0.647172", "0.6471375", "0.64704806", "0.64075685", "0.63981...
0.7868817
0
carga los emojis desde la carpeta.
def _load_emoticons(emotions): return [nparray_as_image(cv2.imread('graphics/%s.png' % emotion, -1), mode=None) for emotion in emotions]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def emojis(self, ctx):\n\n\t\tawait self.message_leaderboard(ctx, \"emojis\")", "async def getemoji(self, ctx):\n pass", "def de_emojify(self, tweet):\n regrex_pattern = re.compile(\n pattern=\"[\"\n \"\\U0001F600-\\U0001F64F\" # emoticons\n \"\\U0001F300-\...
[ "0.759955", "0.6647761", "0.6587347", "0.6486262", "0.6481584", "0.64346176", "0.636827", "0.6305332", "0.620564", "0.61532205", "0.6023843", "0.60163885", "0.6000087", "0.59775937", "0.5953988", "0.5945015", "0.59159696", "0.5895401", "0.58917266", "0.5872658", "0.58493346",...
0.5666559
26
Muestra la webcam y detecta los rostros y las emociones en tiempo real para dibujar los emojis.
def show_webcam_and_run(model, emoticons, window_size=None, window_name='webcam', update_time=10): cv2.namedWindow(window_name, WINDOW_NORMAL) if window_size: width, height = window_size cv2.resizeWindow(window_name, width, height) # 选择摄像头,0为本地 vc = cv2.VideoCapture(0) # http://192.168...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_frame(self):\r\n\r\n # Reading the Video and grasping the Frames\r\n _, frame = self.video.read()\r\n\r\n # Converting the Color image to Gray Scale\r\n gray_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)\r\n\r\n # Image size is reduced by 30% at each image scale.\r\n ...
[ "0.6349221", "0.61298025", "0.60099834", "0.5987401", "0.5907742", "0.58317894", "0.5773631", "0.57720965", "0.5752085", "0.57329386", "0.5702524", "0.56955504", "0.5686861", "0.5675076", "0.56712705", "0.5658507", "0.5623298", "0.5621945", "0.558406", "0.5580833", "0.5568899...
0.67097116
0
Get the stride between lines of a C matrix
def get_matrix_stride(mat): itemsize = mat.itemsize stride = mat.strides[0] // itemsize assert mat.strides == (stride * itemsize, itemsize) return stride
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def out_stride(self):\n return 4", "def lineout(data, cencol, pxwidth = 3):\n frame_dimension = len(data)\n spectrum_intensities = np.array([ sum( [data[i][j] for j in range(cencol-pxwidth,cencol+pxwidth+1)] ) for i in range(frame_dimension) ])\n return spectrum_intensities", "def out_stride(self):...
[ "0.6341353", "0.6026125", "0.6015157", "0.5969687", "0.5904242", "0.58180946", "0.5800844", "0.57403153", "0.5735365", "0.57338125", "0.5727915", "0.5695839", "0.5649859", "0.56348044", "0.5630995", "0.55920064", "0.5587389", "0.55793166", "0.5561398", "0.5519366", "0.5517608...
0.6712748
0
Check that the matrix of double looks fine
def check_double_matrix(mat): if len(mat.shape) != 2: sys.stderr.write("Invalid matrix: dimension {} not {}\n" .format(len(mat.shape), 2)) return False # If the strides hasn't got the same number of elements, really weird # things happened... Let's abort in such cas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testMatrix(m):\n print \"Testing the spread matrix:\"\n for i in m.matrix:\n if float('%.3g' % sum(i)) != 1.000 and sum(i) != 0:\n print \"The spread is not as expected\", sum(i)\n return\n print \"Matrix is acceptable\"", "def _check_matrix(self,...
[ "0.6854547", "0.6790353", "0.67284423", "0.6678701", "0.6612804", "0.6561573", "0.64683634", "0.63938135", "0.63869256", "0.6364449", "0.63438624", "0.6276176", "0.6272913", "0.62640566", "0.6256419", "0.6254902", "0.62461764", "0.62152296", "0.6209413", "0.6194714", "0.61872...
0.68912345
0
Test several things around numpy and cffi
def main(): matrix = numpy.zeros((10, 10)) print("Original matrix:\n{}".format(matrix)) if not check_double_matrix(matrix): return 1 matrix_data = ffi.cast("double *", matrix.ctypes.data) _cffi_example.matrix_add_coords(matrix_data, matrix.shape[0], matri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compile_cutils():\r\n\r\n types = ['npy_' + t for t in ['int8', 'int16', 'int32', 'int64', 'int128',\r\n 'int256', 'uint8', 'uint16', 'uint32', 'uint64', 'uint128', 'uint256',\r\n 'float16', 'float32', 'float64', 'float80', 'float96', 'float128',\r\n 'float256']]\r\n\r\n complex_type...
[ "0.65539813", "0.6443295", "0.6392358", "0.6291215", "0.62505853", "0.6220695", "0.62024707", "0.61812323", "0.60880494", "0.607032", "0.60649407", "0.602607", "0.59926057", "0.59598535", "0.5942965", "0.5938708", "0.5923445", "0.59232455", "0.59103423", "0.5894893", "0.58833...
0.0
-1
Converts a time string from an slog file into a string DTG string for use in TAML. Have to artificially turn (seconds) into (date), so there's some creativity in the conversion.
def convert_time(slog_time_str): base_time = datetime.datetime(2007, 1, 1) delta = datetime.timedelta(0, float(slog_time_str)) timestamp = base_time + delta taml_dtg = timestamp.strftime('%Y-%m-%dT%H:%M:%S') return taml_dtg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convertTime(string):\n try:\n d = dtparser.parse(string)\n except ValueError:\n try:\n d = datetime.fromtimestamp(float(string))\n except ValueError:\n return string\n\n d.replace(tzinfo=tz.tzlocal())\n return datetime.strftime(d, \"%Y/%m/%d %H:%M:%S\")", ...
[ "0.6709552", "0.6487091", "0.6420539", "0.639823", "0.6296272", "0.62832755", "0.6231348", "0.62042576", "0.6168536", "0.61509234", "0.61488825", "0.6141358", "0.6126549", "0.6100859", "0.6069301", "0.603041", "0.60138583", "0.5983436", "0.59756863", "0.59745187", "0.59640115...
0.7685931
0
Fits generator on the graph
def fit( self, graph: List[Tuple[int, int]], is_directed: bool, *args, **kwargs ): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_graph(self):", "def __generator(self, inp):\n nodes_input = 1\n for i in range(len(self.arch_G)):\n nodes_output = self.arch_G[i]\n inp = fc_layer(inp, nodes_input, nodes_output, 'G_' + str(i + 1) + '_')\n nodes_input = self.arch_G[i]\n\n return fc_la...
[ "0.7418792", "0.7051481", "0.69156545", "0.67285794", "0.66040176", "0.6590043", "0.6583011", "0.65533", "0.6494747", "0.6431917", "0.6421992", "0.6377688", "0.6371203", "0.6349026", "0.6347922", "0.63353777", "0.6330606", "0.6300959", "0.62825394", "0.62698245", "0.6258512",...
0.0
-1
Generates graph with approximately `num_nodes` and exactly `num_edges` from generator
def generate( self, num_nodes: int, num_edges: int, is_directed: bool, *args, return_node_ids: bool = False, **kwargs, ) -> np.ndarray: raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate(self):\n\n g = nx.Graph()\n g.add_nodes_from(self.graph.nodes)\n\n num_nodes = g.number_of_nodes()\n\n degree_sequence = sorted([d for n, d in self.graph.degree()])\n degree_count = Counter(degree_sequence)\n deg, cnt = zip(*degree_count.items())\n\n de...
[ "0.7148452", "0.7055047", "0.67906475", "0.67173404", "0.665062", "0.6641448", "0.6621053", "0.65373224", "0.64683425", "0.6438116", "0.6409539", "0.63667434", "0.63432056", "0.6339525", "0.62839967", "0.62677395", "0.6254661", "0.6254088", "0.6254088", "0.6210768", "0.619631...
0.6627939
6
Store fitted results into json file
def save_fit_results(self, save_path: str = "./fit_results.json"): assert ( self._fit_results ), "There are no fit results to be saved, \ call fit method first or load the results from the file" assert save_path.endswith(".json"), self.JSON_ASSERTION with open(save_pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_results(results):\n json.dump(results, open(\"results.json\", \"w\"))", "def save_fit_results(self, save_path: str = \"./fit_results.json\"):\n assert (\n self._fit_src_dst_results or self._fit_dst_src_results\n ), \"There are no fit results to be saved, \\\n call fit ...
[ "0.7465609", "0.7382611", "0.6806038", "0.6790864", "0.67722875", "0.6744859", "0.66805696", "0.66547126", "0.66245914", "0.65919757", "0.6576034", "0.65640616", "0.6540873", "0.6520938", "0.6481845", "0.64712536", "0.6405506", "0.6401357", "0.63735455", "0.6363669", "0.63511...
0.7513786
0
load fitted results from json file
def load_fit_results(self, load_path: str = "./fit_results.json"): assert load_path.endswith(".json"), self.JSON_ASSERTION with open(load_path, "r") as fjson: self._fit_results = json.load(fjson)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_fit_results(self, load_path: str = \"./fit_results.json\"):\n assert load_path.endswith(\".json\"), self.JSON_ASSERTION\n with open(load_path, \"r\") as fjson:\n wrapped_results = json.load(fjson)\n assert (\n \"fit_src_dst_results\" in wrapped_results\n ...
[ "0.73352855", "0.6404458", "0.63621724", "0.6311765", "0.62229115", "0.6197745", "0.6123886", "0.60660917", "0.60134476", "0.59846854", "0.5945812", "0.592143", "0.5854745", "0.5849048", "0.583823", "0.5828923", "0.58042717", "0.57943183", "0.5791443", "0.5774277", "0.5751769...
0.7811587
0
Fits generator on the graph
def fit( self, graph: List[Tuple[int, int]], src_set: Set[int], dst_set: Set[int], is_directed: bool, transform_graph: bool, *args, **kwargs, ): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_graph(self):", "def __generator(self, inp):\n nodes_input = 1\n for i in range(len(self.arch_G)):\n nodes_output = self.arch_G[i]\n inp = fc_layer(inp, nodes_input, nodes_output, 'G_' + str(i + 1) + '_')\n nodes_input = self.arch_G[i]\n\n return fc_la...
[ "0.7418792", "0.7051481", "0.69156545", "0.67285794", "0.66040176", "0.6590043", "0.6583011", "0.65533", "0.6494747", "0.6431917", "0.6421992", "0.6377688", "0.6371203", "0.6349026", "0.6347922", "0.63353777", "0.6330606", "0.6300959", "0.62825394", "0.62698245", "0.6258512",...
0.0
-1
Generates graph with approximately `num_nodes_src_set`/`num_nodes_dst_set` nodes and exactly `num_edges_src_dst`/`num_edges_dst_src` edges from generator
def generate( self, num_nodes_src_set: int, num_nodes_dst_set: int, num_edges_src_dst: int, num_edges_dst_src: int, is_directed: bool, return_node_ids: bool = False, transform_graph: bool = True, *args, **kwargs, ): raise NotImp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dfs_edges_generator(graph, source, reverse=...):\n ...", "def np_batch_generator(n_nodes, n_edges, batch_size, data_subset, epochs=1, shuffle=True):\n\n # we stop accumulating to a batch when one of these numbers is exceeded\n max_nodes = batch_size * n_nodes\n max_edges = batch_size * n_edges\n ...
[ "0.6357381", "0.61960644", "0.6187048", "0.6162786", "0.61440974", "0.61100316", "0.6039733", "0.59805906", "0.59549385", "0.59503865", "0.5926314", "0.58999896", "0.58972", "0.57888955", "0.576996", "0.5767073", "0.57605594", "0.5741135", "0.5737695", "0.57273066", "0.570914...
0.7906923
0
Stores fitted results into json file
def save_fit_results(self, save_path: str = "./fit_results.json"): assert ( self._fit_src_dst_results or self._fit_dst_src_results ), "There are no fit results to be saved, \ call fit method first or load the results from the file" assert save_path.endswith(".json"), self.JSO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_results(results):\n json.dump(results, open(\"results.json\", \"w\"))", "def save_fit_results(self, save_path: str = \"./fit_results.json\"):\n assert (\n self._fit_results\n ), \"There are no fit results to be saved, \\\n call fit method first or load the results from...
[ "0.76523083", "0.76427025", "0.6963589", "0.68375766", "0.6818667", "0.6774356", "0.66953206", "0.6687157", "0.66694516", "0.6658131", "0.6654102", "0.6638956", "0.66346896", "0.6613533", "0.65783024", "0.6571502", "0.6545202", "0.65309095", "0.65279335", "0.65145934", "0.649...
0.7499114
2
Loads fitted results from json file
def load_fit_results(self, load_path: str = "./fit_results.json"): assert load_path.endswith(".json"), self.JSON_ASSERTION with open(load_path, "r") as fjson: wrapped_results = json.load(fjson) assert ( "fit_src_dst_results" in wrapped_results and "fit_dst_src...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_fit_results(self, load_path: str = \"./fit_results.json\"):\n assert load_path.endswith(\".json\"), self.JSON_ASSERTION\n with open(load_path, \"r\") as fjson:\n self._fit_results = json.load(fjson)", "def load():\n\n #: the file passed by the user in the post request\n fi...
[ "0.79122615", "0.65482247", "0.64179564", "0.6359414", "0.6281388", "0.6250493", "0.61909735", "0.61442757", "0.61417186", "0.60516894", "0.59675527", "0.5951223", "0.5920149", "0.5870302", "0.5859236", "0.5849556", "0.5831417", "0.5825516", "0.5821571", "0.5817166", "0.58045...
0.7303407
1
Create plugin manager and defined hooks specification.
def create_plugin_manager(): plugin_manager = PiPluginManager(hookspecs.hookspec.project_name) plugin_manager.add_hookspecs(hookspecs) return plugin_manager
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_register_dynamic_plugin_manager(self):\n pass", "def test_register_dynamic_plugin_manager1(self):\n pass", "def plugin_manager() -> pluggy.PluginManager:\n _plugin_manager = pluggy.PluginManager(\"rasa\")\n _plugin_manager.add_hookspecs(sys.modules[\"rasa.plugin\"])\n _discover_...
[ "0.7119126", "0.70899945", "0.70372623", "0.69193995", "0.6870526", "0.665556", "0.6444245", "0.64034927", "0.6372821", "0.63320184", "0.6328381", "0.6325857", "0.6302487", "0.62694174", "0.6228222", "0.6221385", "0.6182159", "0.6134531", "0.61034197", "0.6096832", "0.6066662...
0.81805366
0
Keep the list of already called hook per plugin to know if a plugin has already been initialized in case of hotregistration.
def before(hook_name, methods, kwargs): for hookimpl in methods: self._plugin2calls[hookimpl.plugin].add(hook_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_all_hooks():\n global _all_hooks_registered\n if not _all_hooks_registered:\n logger.debug(\"Searching for hooks\")\n hooks = list(get_app_submodules('site_hooks'))\n logger.debug(\"Got %s hooks\" % len(hooks))\n _all_hooks_registered = True", "def init(self):\n ...
[ "0.68519974", "0.65498334", "0.6497009", "0.6264585", "0.6251791", "0.623449", "0.62343425", "0.62343425", "0.61572456", "0.6060473", "0.60595745", "0.6048773", "0.60333836", "0.6011112", "0.5968206", "0.59615594", "0.5940426", "0.58936125", "0.5871757", "0.5865771", "0.58567...
0.6333181
3
Override to keep all plugins that have already been registered at least one time.
def register(self, plugin, name=None): plugin_name = super(PiPluginManager, self).register(plugin, name) if plugin not in self._plugin2calls: self._plugin2calls[plugin] = set() return plugin_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear(self):\r\n with PluginStore.mutex:\r\n self._disabled = []\r\n for _, plugin in self._plugins.items():\r\n plugin.shutdown()\r\n self._plugins.clear()", "def reset(self):\n for plugin in self.plugins:\n LOGGER.info('Resetting %s', plugin)\n...
[ "0.72106093", "0.68358684", "0.6480067", "0.6460695", "0.6422556", "0.6353031", "0.63316566", "0.618075", "0.61752623", "0.60917026", "0.60694945", "0.6019211", "0.6017463", "0.59837437", "0.597309", "0.59382385", "0.5896065", "0.5854006", "0.5845902", "0.5836334", "0.5798915...
0.53707254
59
Register the core plugins, load plugins from setuptools entry points and the load given module/package paths.
def load_all_plugins(self, paths, disabled=None): # Load plugins declared by setuptools entry points self.load_setuptools_entrypoints(hookspecs.hookspec.project_name) plugins = [] for path in paths: plugin = load_module(path) if plugin: LOGGER.deb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_plugins(self):\n self.__doing('load_plugins')\n self.__do_if_not_done('bootstrap')\n if self.env.mode in ('dummy', 'unit_test'):\n return\n for package in self.packages:\n self.add_package(package)", "def load_plugins(self) -> None:\n import impor...
[ "0.71670216", "0.70831335", "0.68646836", "0.6777503", "0.6772449", "0.6566016", "0.6562655", "0.6513015", "0.6493436", "0.64681345", "0.6448732", "0.6436965", "0.63849676", "0.63309056", "0.6289031", "0.62655675", "0.6195485", "0.6175629", "0.61183715", "0.61055356", "0.6090...
0.6887568
2
Return the list of loaded plugins except ``pibooth`` core plugins. (external plugins can be registered or unregistered)
def list_external_plugins(self): values = [] for plugin in self._plugin2calls: # The core plugins are classes, we don't want to include # them here, thus we take only the modules objects. if inspect.ismodule(plugin): if plugin not in values: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_plugins(self):\n return []", "def get_non_gui_plugins():\n return [cls() for cls in get_non_gui_plugin_classes()]", "def plugin_list(self):\r\n return get_module_list()", "def get_disabled_plugins(self):\n return self._disabled_plugins", "def getIgnoredPlugins(self):\n ...
[ "0.748177", "0.7343613", "0.715946", "0.7155568", "0.7129391", "0.6981885", "0.69517004", "0.69423413", "0.6925067", "0.68775153", "0.67109644", "0.66824967", "0.66654766", "0.66553617", "0.6642868", "0.66312057", "0.65977263", "0.65490544", "0.6548626", "0.654292", "0.652238...
0.71489537
4
Return the friendly name of the given plugin and optionally its version.
def get_friendly_name(self, plugin, version=True): # List of all setuptools registered plugins distinfo = dict(self.list_plugin_distinfo()) if plugin in distinfo: name = distinfo[plugin].project_name vnumber = distinfo[plugin].version else: name = sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_name(self, plugin):\n return plugin.name if isinstance(plugin, BasePlugin) else plugin", "def get_plugin_name(filename):\n m = PLUGIN_PACKAGE_RE.search(filename or '')\n if m:\n return m.group(1)\n else:\n return None", "def get_plugin_name(self):\n return self.plu...
[ "0.7386398", "0.7290012", "0.7092868", "0.69911456", "0.67694056", "0.67535245", "0.67400986", "0.6504187", "0.6483196", "0.6451923", "0.6373576", "0.63026863", "0.62797564", "0.625846", "0.6180294", "0.61733705", "0.609387", "0.59891397", "0.5984237", "0.59653777", "0.589649...
0.8702743
0
Return the ist of the hook names that has already been called at least one time fr the given plugins.
def get_calls_history(self, plugin): if plugin in self._plugin2calls: return list(self._plugin2calls[plugin]) return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_custom_hook_names():\n return list(_CUSTOM_HOOKS)", "def names() -> Tuple[str, ...]:\n return plugins.list_all(package_name=__name__)", "def hooks(self):\n return tuple(self.__hooks.keys())", "def plugin_names(self):\n return self.__plugin_names", "def get_functions_seen(self):\...
[ "0.62393296", "0.5960841", "0.5893372", "0.58870816", "0.57874966", "0.5709598", "0.56208736", "0.5597268", "0.5507188", "0.5443211", "0.531665", "0.5305549", "0.52597785", "0.52513576", "0.5248053", "0.5206385", "0.5205989", "0.5186444", "0.51845413", "0.51769197", "0.514961...
0.5334923
10
Returns a bytes_list from a string / byte.
def _bytes_feature(value): if isinstance(value, type(tf.constant(0))): value = value.numpy() # BytesList won't unpack a string from an EagerTensor. return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hex_str_to_bytes_arr(bytes_str: str) -> List[int]:\n return eval(f\"[{bytes_str}]\")", "def decode_chain_list(in_bytes):\n bstrings = numpy.frombuffer(in_bytes, numpy.dtype('S' + str(mmtf.utils.constants.CHAIN_LEN)))\n return [s.decode(\"ascii\").strip(mmtf.utils.constants.NULL_BYTE) for s in bstrin...
[ "0.72284156", "0.7016995", "0.6966397", "0.6805752", "0.6782744", "0.6686736", "0.66507965", "0.6556132", "0.65115374", "0.6501608", "0.6488183", "0.64153695", "0.6406492", "0.63723576", "0.63595635", "0.6352758", "0.6343899", "0.6320864", "0.630812", "0.6248688", "0.62459064...
0.0
-1
Yield a connection pool connected to vial server
def vial_client( server: str, apikey: str ) -> Iterator[urllib3.connectionpool.ConnectionPool]: if not server: raise Exception("Must pass VIAL server to call") if not apikey: raise Exception("Must pass VIAL API Key to use") http_pool = urllib3.PoolManager() vial_http = http_pool.c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_connection(self) -> Iterator[psycopg2.connect]:\n\n conn = self._pool.getconn()\n\n if self.pre_ping:\n for n in range(self.max_reconnects):\n if not self.ping(conn):\n if n > 0:\n time.sleep(self._back_off_time(n - 1))\n ...
[ "0.68395984", "0.6616775", "0.6468955", "0.6466008", "0.62284225", "0.6185906", "0.6179943", "0.61773294", "0.6155422", "0.6123735", "0.6113533", "0.61117333", "0.6077807", "0.602352", "0.6014565", "0.59833854", "0.5972427", "0.59647954", "0.5947133", "0.59159994", "0.5907486...
0.67863506
1
Verifies that header contains valid authorization token
def verify_token(vial_http: urllib3.connectionpool.ConnectionPool) -> bool: verify_resp = vial_http.request("GET", "/api/verifyToken") return verify_resp.status == 200
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_auth_header(headers):\n if current_app.auth_db is None:\n raise NoAuthenticationDatabaseException\n\n if \"Authorization\" not in headers:\n raise NoAuthHeaderException\n\n auth_header = headers[\"Authorization\"].split(\" \")\n\n if len(auth_header) < 2 or auth_header[0] != ...
[ "0.7470917", "0.7445979", "0.7394502", "0.73606247", "0.7258435", "0.715719", "0.7148856", "0.71172875", "0.71169674", "0.7074974", "0.700769", "0.69644564", "0.69075775", "0.6794475", "0.67745864", "0.67448145", "0.67387635", "0.673642", "0.66281843", "0.66200036", "0.661797...
0.6473546
34
Start import run and return the id for it
def start_import_run(vial_http: urllib3.connectionpool.ConnectionPool) -> str: import_resp = vial_http.request("POST", "/api/startImportRun") if import_resp.status != 200: raise Exception(f"Failed to start import run {import_resp.data}") import_data = json.loads(import_resp.data.decode("utf-8")) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_import_task(clientRequestToken=None, name=None, importUrl=None):\n pass", "def start_import(data_import):\n\tdata_import = frappe.get_doc(\"Data Import Beta\", data_import)\n\ti = Importer(data_import.reference_doctype, data_import=data_import)\n\treturn i.import_data()", "def importer_process(imp...
[ "0.69069815", "0.6695886", "0.66000867", "0.62952036", "0.6082602", "0.60786223", "0.59738696", "0.59381676", "0.59378403", "0.5874674", "0.58106", "0.57830364", "0.57355547", "0.5719899", "0.5697861", "0.5693284", "0.5665559", "0.56556344", "0.5612762", "0.56112766", "0.5574...
0.76171285
0
Verifies that header contains valid authorization token
def retrieve_existing_locations( vial_http: urllib3.connectionpool.ConnectionPool, ) -> Iterator[dict]: resp = vial_http.request( "GET", "/api/searchLocations?format=nlgeojson&all=1", preload_content=False ) for line in resp: yield geojson.loads(line) resp.release_conn()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_auth_header(headers):\n if current_app.auth_db is None:\n raise NoAuthenticationDatabaseException\n\n if \"Authorization\" not in headers:\n raise NoAuthHeaderException\n\n auth_header = headers[\"Authorization\"].split(\" \")\n\n if len(auth_header) < 2 or auth_header[0] != ...
[ "0.7473123", "0.74481225", "0.73952866", "0.7360394", "0.72580284", "0.71565604", "0.71481323", "0.7116696", "0.71163434", "0.70735514", "0.7007949", "0.6964352", "0.6907963", "0.67945844", "0.677438", "0.67444694", "0.67376435", "0.6735434", "0.6628119", "0.6618508", "0.6617...
0.0
-1
Verifies that header contains valid authorization token
def retrieve_existing_locations_as_index( vial_http: urllib3.connectionpool.ConnectionPool, ) -> rtree.index.Index: locations = retrieve_existing_locations(vial_http) def generate_index_row(i: int, loc: dict) -> tuple: loc_point = shapely.geometry.shape(loc["geometry"]) return (i, loc_point...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_auth_header(headers):\n if current_app.auth_db is None:\n raise NoAuthenticationDatabaseException\n\n if \"Authorization\" not in headers:\n raise NoAuthHeaderException\n\n auth_header = headers[\"Authorization\"].split(\" \")\n\n if len(auth_header) < 2 or auth_header[0] != ...
[ "0.7473123", "0.74481225", "0.73952866", "0.7360394", "0.72580284", "0.71565604", "0.71481323", "0.7116696", "0.71163434", "0.70735514", "0.7007949", "0.6964352", "0.6907963", "0.67945844", "0.677438", "0.67444694", "0.67376435", "0.6735434", "0.6628119", "0.6618508", "0.6617...
0.0
-1
Ininitialise the particle with a position and momentum vectors and a mass
def __init__(self, position, momentum, mass): self.position = position self.momentum = momentum self.mass = mass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self,mass,x=None,p=None,v=None):\n self.setPosition(x)\n self.setMass(mass)\n if p is not None and v is not None:\n raise CoordinateException(\"Initializing a particle can only have momentum or velocity, not both.\")\n elif p is None:\n self.setVelocity(v)\n self.calcMomentu...
[ "0.7615262", "0.7456344", "0.72507364", "0.7072128", "0.69992965", "0.69264543", "0.6856271", "0.68511766", "0.67422575", "0.66545683", "0.66174793", "0.6592208", "0.65753937", "0.65723133", "0.6545215", "0.6524425", "0.65193844", "0.650629", "0.6497146", "0.6483156", "0.6477...
0.7441553
2
Return the velocity vector of the particle
def get_velocity(self): return self.momentum/self.mass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getVelocity(self):\n return self.v", "def getVelocity(self):\n\n return self.vel", "def velocity(self):\n return self._velocity", "def velocity(self):\n return self._velocity", "def velocity_at_pos(self, x, y):\n return scipy.array([float(self._interp_u(x, y)),\n ...
[ "0.7955968", "0.7745024", "0.77234554", "0.77234554", "0.7688092", "0.76584786", "0.76424485", "0.75447935", "0.75148714", "0.7462534", "0.7457666", "0.73845005", "0.72576076", "0.7106754", "0.70722777", "0.7026906", "0.7010185", "0.69741774", "0.6948821", "0.6877791", "0.686...
0.79404175
1
Return kinetic enrgy of the particle
def get_energy(self): return self.momentum*self.momentum/(2*self.mass)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kineticEnergy(self):\n return self.params['kinetic']", "def kinetic_energy(self):\r\n position, velocity, escaped_particles,impact, wall_collision,mom = self.box_collision_info()\r\n for j in xrange(1,self.n):\r\n abs_velocity = np.sqrt(velocity[:,0]**2+velocity[:,1]**2\r\n ...
[ "0.7499276", "0.74066544", "0.7244842", "0.7038553", "0.673587", "0.65941375", "0.65808964", "0.65267044", "0.65236604", "0.6151119", "0.6151119", "0.6103551", "0.60998434", "0.6088825", "0.6062322", "0.5941433", "0.58287054", "0.5811235", "0.57866675", "0.5780221", "0.572142...
0.0
-1
Return quaternion from Euler angles and axis sequence.
def quaternion_from_euler(ai, aj, ak, axes='sxyz'): try: firstaxis, parity, repetition, frame = _AXES2TUPLE[axes.lower()] except (AttributeError, KeyError): _ = _TUPLE2AXES[axes] firstaxis, parity, repetition, frame = axes i = firstaxis j = _NEXT_AXIS[i+parity] k = _NEXT_AXI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def euler_to_quaternion(euler: tuple) -> object:\n\n (yaw, pitch, roll) = (euler[0], euler[1], euler[2])\n qy = np.sin(roll / 2) * np.cos(pitch / 2) * np.cos(yaw / 2) - np.cos(roll / 2) * np.sin(pitch / 2) * np.sin(yaw / 2)\n qx = np.cos(roll / 2) * np.sin(pitch / 2) * np.cos(yaw / 2) + np.sin(roll / 2) *...
[ "0.7727526", "0.7503549", "0.74089247", "0.73761517", "0.73758185", "0.7261005", "0.72107375", "0.7182006", "0.71239877", "0.71054584", "0.70450413", "0.70432484", "0.69958776", "0.69414973", "0.6939632", "0.69368577", "0.69198453", "0.68761027", "0.68623286", "0.68605334", "...
0.7246877
6
Extract filtered inrange velodyne coordinates based on azimuth & elevation angle limit
def hv_in_range(x, y, z, fov, fov_type='h'): d = np.sqrt(x ** 2 + y ** 2 + z ** 2) if fov_type == 'h': return np.logical_and(np.arctan2(y, x) > (-fov[1] * np.pi/180), np.arctan2(y, x) < (-fov[0] * np.pi/180)) elif fov_type == 'v': return np.logical_and(np.arctan2(z, d) < (fov[1] * np.pi / 180), np.arctan2(z, d) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_target_azimuths(radar_in):\n sweep_start = radar_in.sweep_start_ray_index['data'][0]\n sweep_end = radar_in.sweep_end_ray_index['data'][0]\n target_azimuths = np.sort(\n radar_in.azimuth['data'][sweep_start:sweep_end+1])\n az_tol = np.median(target_azimuths[1:]-target_azimuths[:-1])\n\n...
[ "0.6166181", "0.5888999", "0.58740586", "0.58250934", "0.5766253", "0.57479966", "0.5739707", "0.5711385", "0.5607426", "0.55564934", "0.5489532", "0.54890054", "0.5479273", "0.5467141", "0.54620796", "0.5453764", "0.5424477", "0.5399013", "0.53936005", "0.5388616", "0.537854...
0.0
-1
Get the event type
def __unicode__(self): return "%d" % (self.type)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_event_type(event):\n return event.type()", "def _get_event_type(event):\n return event.type()", "def get_type(self):\n return self.event_type", "def event_type(self) -> int:\n return self.data[\"args\"][\"eventType\"]", "def type(self) -> str:\n return self._even...
[ "0.9124082", "0.9124082", "0.90069985", "0.8711404", "0.83575463", "0.82805854", "0.80476016", "0.80090797", "0.77455413", "0.76935184", "0.76803297", "0.76801234", "0.7523564", "0.73957133", "0.71513206", "0.7093203", "0.7033223", "0.69131833", "0.6899823", "0.6825652", "0.6...
0.0
-1
Get the Billing agreement
def __unicode__(self): return "%d (%d - %d)" % (self.agreement_id, self.payer_email, self.state)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_agreement(self):\n pass", "def get_incorporation_agreement_json(filing):\n return filing.json['filing']['incorporationApplication'].get('incorporationAgreement', {})", "def agreement_number(self) -> Optional[str]:\n return pulumi.get(self, \"agreement_number\")", "def getPay...
[ "0.6833925", "0.65939116", "0.6525695", "0.6019161", "0.59166104", "0.56271607", "0.56155455", "0.5562701", "0.5470692", "0.5386633", "0.5386633", "0.5386633", "0.5381787", "0.53544766", "0.53544766", "0.5314757", "0.5287566", "0.52750283", "0.5269475", "0.5251014", "0.524676...
0.0
-1
Get the payment descriptor
def __unicode__(self): return "%d (%d , %d, %d)" % (self.pay_id, self.intent, self.state, self.client_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPayment(self):\n pass", "def get_payment_description(self, name):\n if self.method == 'manual':\n return \"Paid by Cash\"\n elif self.method == 'credit_card':\n return (\n \"Paid by Card \" + \"(\" + (\"xxxx \" * 3) +\n self.payment_...
[ "0.7141235", "0.6703626", "0.66543996", "0.6183217", "0.60790956", "0.59304446", "0.5927887", "0.58225256", "0.5784891", "0.57677084", "0.57677084", "0.57616067", "0.57466364", "0.5736313", "0.5706687", "0.56976795", "0.56879294", "0.5646603", "0.5642304", "0.563779", "0.5634...
0.0
-1
Get the transaction descriptor
def __unicode__(self): return "%d (%f)" % (self.payment.pay_id, self.id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transaction_id(self):\n return self.private", "def get_transfer(self):\n return self._transfer", "def gettransaction(self, txid):\n return TransactionInfo(**self.proxy.gettransaction(txid))", "def get_descriptor(self, uuid):\n return tuple(self.get_many_descriptors(uuid))[0]", "...
[ "0.5730446", "0.5669879", "0.5597634", "0.5591067", "0.5510349", "0.55066407", "0.55001414", "0.5484473", "0.5484473", "0.54712063", "0.5413419", "0.5396153", "0.5390768", "0.53889847", "0.53568065", "0.5290514", "0.5290454", "0.52822185", "0.52687573", "0.52203363", "0.52101...
0.0
-1
Get the sale descriptor
def __unicode__(self): if self.billing_agreement_id != None: return "%d -%d (%d)" % (self.sale_id, self.state, self.billing_agreement_id) return "%d -%d (%d)" % (self.sale_id, self.state, self.parent_payment)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sales_rep(self):\r\n return self._sales_rep", "def get_single_sale(self, sale_id):\n sale_record = self.dbconn.get_single_sale(sale_id=sale_id)\n return sale_record", "def get(self, sale_id):\n sales_record = Sales().get_all_sales()\n single_sale = [\n sale...
[ "0.6110091", "0.59884834", "0.5958059", "0.5788091", "0.56876206", "0.559325", "0.5526897", "0.53787124", "0.5336509", "0.53172165", "0.5274664", "0.526286", "0.5261349", "0.5202559", "0.5164068", "0.5111815", "0.5108286", "0.5108286", "0.5088821", "0.508271", "0.5072037", ...
0.0
-1
Get the authorization descriptor
def __unicode__(self): return "%s -%s (%s)" % (self.sale_id, self.state, self.parent_payment)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authorization(self):\n return self._authorization", "def get_authorization(self):\n raise NotImplemented()", "def authorization(self) -> Optional['outputs.AuthorizationResponse']:\n return pulumi.get(self, \"authorization\")", "def authorize(self):\n\n return self.__a", "def...
[ "0.707867", "0.69775796", "0.6673104", "0.64048684", "0.6353344", "0.6286655", "0.6067879", "0.59025586", "0.58201575", "0.58201575", "0.5803035", "0.5797658", "0.57780045", "0.5777812", "0.57753474", "0.57323074", "0.5643588", "0.56276643", "0.5623638", "0.5604519", "0.55523...
0.0
-1
Get the refund descriptor
def __unicode__(self): if self.sale_id != None: return "%d -%d (%d)" % (self.refund_id, self.state, self.sale_id) return "%d -%d (%d)" % (self.refund_id, self.state, self.capture_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retrieve(payment, refund_id):\n if isinstance(payment, resources.Payment):\n payment = payment.id\n\n http_client = HttpClient()\n response, _ = http_client.get(routes.url(routes.REFUND_RESOURCE, resource_id=refund_id, payment_id=payment))\n return resources.Refund(**resp...
[ "0.64392316", "0.5863587", "0.58257824", "0.5778564", "0.5630128", "0.54803634", "0.54636323", "0.5356619", "0.53540045", "0.5255977", "0.523284", "0.51943237", "0.51324826", "0.510862", "0.510862", "0.5082535", "0.50733966", "0.50484294", "0.50201195", "0.49867564", "0.49514...
0.43564573
96
Check that `VMPool.__iter__` iterates over VM IDs.
def test_iter(self): for n, pool in enumerate([self.pool0, self.pool1, self.pool2]): assert list(iter(pool)) in ( list('ab'[:n]), list('ba'[:n]), )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_vpn_id():\n for v in vpns:\n assert len(v.id) > 0", "def test_iter(self):\n obs = self.tester.__iter__()\n self.assertTrue(isinstance(obs, Iterable))\n self.assertEqual(set(obs), self.exp_sample_ids)", "def test_iter(self):\n obs = self.tester.__iter__()\n ...
[ "0.5551847", "0.5502366", "0.5502366", "0.499766", "0.4989234", "0.49801987", "0.4952273", "0.49347952", "0.49295378", "0.49100518", "0.49041685", "0.4864451", "0.48494568", "0.48422536", "0.48142493", "0.47784758", "0.47465125", "0.4716814", "0.4716193", "0.47150078", "0.470...
0.5758834
0
Apply the electron event selection using fastcalo or electron features. The pidname will be a string that can be one or more pidnames algorithms. If there is EFCalo or HLT in pidname, the selection uses fastcalo features.
def ApplyElectronSelection( self, pidname ): doAnd=False; doOr=False fc = self.retrieve("FastCalo"); el = self.retrieve("Electron") # remove spaces if exist pidname = pidname.replace(' ','') # Check conditions strings if '&' in pidname: pidname = pidname.split('&') doAnd=True; isPass...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute(module_name):\n\n global clf_re\n global filter_function\n global remap_pairs\n\n # Get the window date to process events\n (from_date, until_date) = rules_common.window_dates(module_name)\n\n # Get the files to process, lines and mark lines\n (files, total_lines, mark_lines) = \\\...
[ "0.5087484", "0.50239825", "0.49709415", "0.46197402", "0.4569843", "0.45122904", "0.4461218", "0.4412482", "0.44032472", "0.44027945", "0.43926793", "0.43906233", "0.43781617", "0.4360104", "0.43565696", "0.43386114", "0.43149012", "0.43059707", "0.4303484", "0.4274708", "0....
0.7302416
0