query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
IoU Loss for individual examples inputs N x Classes x H x W target_oneHot N x Classes x H x W
def forward(self, inputs, target_oneHot): N = inputs.size()[0] # predicted probabilities for each pixel along channel inputs = F.softmax(inputs, dim=1) # Numerator Product inter = inputs * target_oneHot # Sum over all pixels N x C x H x W => N x C inter = inter...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def optimize(nn_last_layer, correct_label, learning_rate, num_classes):\n # TODO: Implement function\n\n logits = tf.reshape(nn_last_layer, (-1, num_classes))\n correct_label = tf.reshape(correct_label, (-1, num_classes))\n cross_entropy_loss = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(log...
[ "0.63638645", "0.6232823", "0.61541665", "0.6152304", "0.6136377", "0.6029153", "0.6009804", "0.5980784", "0.595536", "0.59404254", "0.594038", "0.5934869", "0.5930399", "0.5922354", "0.5916995", "0.59081185", "0.58797747", "0.58644426", "0.5848826", "0.5842461", "0.583871", ...
0.64057773
0
Given an increasing list of failure times, quantify the stability of the activity. A single failure, 10 seconds in the past, has a stability factor of 0.5; if there were additional failures before that, the stability factor will be lower. Returns a culled list of stop times and a stability factor (0 1).
def stability_factor(times, window=120): now = time.time() if len(times) == 0: return times, 1. # Only keep the last few failures, within our time window. times = [t for t in times[-200:-1] if t >= now - window] + times[-1:] dt = [5. / (now - t) for t in times] return times,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def early_stop(val_loss_history, t=10, required_progress=0.001): \n cnt = 0 # initialize the count --> to store count of cases where difference in\n # accuracy is less than required progress.\n \n if(len(val_loss_history) > 0): # if list has size > 0 \n for i ...
[ "0.55680317", "0.5377221", "0.5328913", "0.52989835", "0.52544403", "0.5166895", "0.51084334", "0.50803703", "0.50566787", "0.50365293", "0.4993658", "0.4976607", "0.49570292", "0.49236703", "0.4909648", "0.49003965", "0.48925897", "0.48806038", "0.48771045", "0.48700574", "0...
0.7117618
0
Update self.status based on service info (in format returned by parse_docker_state).
def update(self, service): self.service.update(service) if service['running']: self.status = None, time.time() else: self.status = service['exit_code'], time.time()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def service_status(self, service_status):\n\n self._service_status = service_status", "def update_status(self, context, status):\n plugin = self.driver.service_plugin\n plugin.update_status_by_agent(\n context, status, self.driver.service_type)", "def update(self, **kwargs):\n ...
[ "0.7005998", "0.6473761", "0.64613116", "0.62465763", "0.62055373", "0.61424726", "0.6131006", "0.6033399", "0.60213333", "0.5983427", "0.59706086", "0.59515053", "0.5920809", "0.5916702", "0.59145594", "0.5909762", "0.58893913", "0.5865086", "0.58510834", "0.5841508", "0.583...
0.7611852
0
Analyze a dockercompose.yaml file to get a list of services. Using dockercompose ps and docker inspect, determine whether each service is running or not. Use docker_compose_bin to pass in the full path to the dockercompose executable.
def parse_docker_state(docker_compose_file, docker_compose_bin=None): summary = {} compose = yaml.safe_load(open(docker_compose_file, 'r')) for key, cfg in compose.get('services', []).items(): summary[key] = { 'service': key, 'running': False, 'exit_code': 127, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_docker_compose_services():\n dir_list = os.listdir(BASE_DIR)\n directories = [d for d in dir_list if os.path.isdir(os.path.join(BASE_DIR, d))]\n\n return [d for d in directories if 'docker-compose.yml' in os.listdir(os.path.join(BASE_DIR, d))]", "def docker_services(\n docker_compose_file, d...
[ "0.7269383", "0.70416594", "0.64590114", "0.62653744", "0.62406147", "0.6178411", "0.59875304", "0.5948958", "0.59295565", "0.588693", "0.58269346", "0.5818228", "0.57980275", "0.57945746", "0.56690395", "0.5508496", "0.5462782", "0.54540205", "0.54382145", "0.54189664", "0.5...
0.74102795
0
Initialize order from json request.
def __init__(self, order_json): self.shop = order_json['shop'] self.size = order_json['size'] self.customer_name = order_json['name'] self.drink_name = order_json['drink'] self.customer_number = order_json['customer_number'] self.location = order_json['location'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_json(cls, data: Dict[str, Any]) -> \"InFlightOrder\":\n order = InFlightOrder(\n client_order_id=data[\"client_order_id\"],\n trading_pair=data[\"trading_pair\"],\n order_type=getattr(OrderType, data[\"order_type\"]),\n trade_type=getattr(TradeType, data[...
[ "0.70992726", "0.70685786", "0.68143004", "0.64073914", "0.6327209", "0.6254083", "0.6250655", "0.6232636", "0.62258476", "0.6100324", "0.60990167", "0.60973966", "0.59886014", "0.5982773", "0.58828604", "0.587519", "0.58548725", "0.5834122", "0.57914066", "0.57899594", "0.57...
0.7498886
0
Output accounts (Working accounts and bad accounts) to a HTML file with information of the account.
def Save_html(self, accounts): try: self.extension = ".html" colors.info("Saving as HTML in {}{}".format(self.file, self.extension)) SpotifyFree = [] SpotifyPremium = [] PremiumFamily = [] AdminPremiumFamily = [] BadAccounts ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account():\n return render_template('user/account.html')", "def account():\n\n return render_template('account_page.html', title='Account')", "def render_accounts(simulation, template_folder, output_dir = 'report', accounts_folder = path_accounts):\n accounts = simulation.accounts\n links = []\...
[ "0.6688748", "0.66766", "0.65685046", "0.6231859", "0.61974204", "0.60984695", "0.60301787", "0.59006804", "0.58325046", "0.58321315", "0.581532", "0.5777258", "0.5759236", "0.5758277", "0.5749657", "0.5727508", "0.5685886", "0.5647224", "0.56408274", "0.56145215", "0.5558057...
0.6965446
0
Output accounts (Working accounts and bad accounts) to a XML file with information of the account.
def Save_xml(self, accounts): try: self.extension = ".xml" colors.info("Saving as XML in {}{}".format(self.file, self.extension)) Main = ET.Element("SpotCheck") SpotifyFree = ET.SubElement(Main, 'SpotifyFree') SpotifyPremium = ET.SubElement(Main, '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createXML(whatToCreate):\n\n XMLSerializer = serializers.get_serializer(\"xml\")\n xml_serializer = XMLSerializer()\n if whatToCreate == \"allAccount\":\n path_fullToOutputFile = os.path.join(settings.PDF_OUTPUT_ROOT, \"accounts.xml\")\n objectsToSerialize = Account.o...
[ "0.6595541", "0.62130845", "0.59334725", "0.59177995", "0.5894015", "0.5818442", "0.5683541", "0.5596659", "0.5593022", "0.5586394", "0.5515927", "0.5488453", "0.5454454", "0.539811", "0.53653425", "0.53649664", "0.53565305", "0.53307545", "0.5300803", "0.5293869", "0.5282426...
0.71626604
0
Ouput accounts (Working accounts and bad accounts) to a JSON file with information of the account.
def Save_json(self, accounts): try: self.extension = ".json" colors.info("Saving as JSON in {}{}".format(self.file, self.extension)) json = {} json["Spotify Free"] = [] json["Spotify Premium"] = [] json["Premium Family"] = [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_accounts(self):\n print('=== Exporting all account data...')\n\n for account in self.client.tenant.accounts:\n print('- Exporting account:', account.email)\n\n json = {\n 'id': self.get_id(account),\n 'href': account.href,\n ...
[ "0.7318733", "0.68853736", "0.68502825", "0.6796701", "0.64130384", "0.6208117", "0.61719257", "0.6005446", "0.5971875", "0.5940103", "0.59375715", "0.5809758", "0.57586116", "0.5747811", "0.5621256", "0.5616947", "0.56166923", "0.56048834", "0.5601877", "0.56014293", "0.5600...
0.726491
1
Output only the working accounts to a TXT file with information of the account.
def Save_txt(self, accounts): self.extension = ".txt" self.sep = "<--------Account-------->\n" colors.info("Saving as TXT in {}{}".format(self.file, self.extension)) try: with open(self.file + self.extension, "a") as output_: for account in accounts: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_out_account_numbers_and_balances(list_of_all_accounts_known):\n with open('./practise_accounts.txt', mode='wt') as accounts_and_balances_to_write_out:\n for accounts in list_of_all_accounts_known:\n accounts_and_balances_to_write_out.writelines('{0} {1}\\n'.format(account...
[ "0.65166193", "0.58012176", "0.5766733", "0.57152236", "0.5621964", "0.56094396", "0.560284", "0.5578142", "0.556393", "0.55474865", "0.55330557", "0.5518977", "0.55127907", "0.54883975", "0.5461352", "0.5424787", "0.53921026", "0.53721887", "0.53702474", "0.5347236", "0.5337...
0.6878773
0
Select the best candidate pagenumber for the given page, with reference to neighboring pages. 'pages' must be a windowed_iterator; 'window', if provided, will look to a smaller set of neighboring pages to determine a likely page number. (Smaller than that provided by the given windowed_iterator.)
def guess_best_pageno(pageinfo, pages, window=None): if window is None: window = pages.window def tally(pageinfo, current_index, sofar, weight): for c in pageinfo.info['pageno_candidates']: if c.offset >= current_index: continue if c.offset not in sofar[c....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __window_scrollByPages(self, pages):\n pass", "def get_n_needed_pages(n_results):\n if n_results % N_RESULTS_FOR_PAGE == 0:\n return int(n_results / N_RESULTS_FOR_PAGE)\n else:\n return int(n_results / N_RESULTS_FOR_PAGE) + 1", "def select_page_like_person(pages, person):\n\n ...
[ "0.533257", "0.5093779", "0.5020989", "0.49389336", "0.49362502", "0.49140146", "0.4821802", "0.48214674", "0.4809199", "0.47486413", "0.4742521", "0.4684127", "0.46808767", "0.46710113", "0.46595886", "0.46473902", "0.4643131", "0.45898446", "0.45437312", "0.45382893", "0.45...
0.7138489
0
Populate server & server_ip_address MDC fields
def default_server_info(): # If not set or purposely set = None, then set default if MDC.get('server') is None: try: server = socket.getfqdn() except Exception: try: server = socket.gethostname() except Exception: server = '' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_server(self):\n server = super()._create_server(networks='none')\n source_host = server['OS-EXT-SRV-ATTR:host']\n target_host = 'host2' if source_host == 'host1' else 'host1'\n return server, source_host, target_host", "def populate_default_mdc(request):\n if MDC.get(\"...
[ "0.6051978", "0.5843572", "0.5815784", "0.5732247", "0.57190984", "0.56336695", "0.550937", "0.54662335", "0.54657954", "0.5416323", "0.538536", "0.53709483", "0.5358802", "0.53084266", "0.53024495", "0.5251704", "0.52356243", "0.5218537", "0.51843715", "0.5164941", "0.515820...
0.6851378
0
Populate MDC fields given a request in json format
def mdc_from_json(request_json): if MDC.get("instanceUUID") is None: default_mdc() MDC.put('requestID', get_request_id(request_json)) MDC.put('partnerName', get_partner_name(request_json))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def populate_mdc(request):\n populate_default_mdc(request)\n req_id = request.headers.get('X-ONAP-RequestID', g.empty_value)\n request_json = request.get_json()\n if req_id == g.empty_value:\n req_id = get_request_id(request_json)\n g.request_id = req_id\n MDC.put('requestID', req_id)\n ...
[ "0.6745948", "0.55671954", "0.55547464", "0.5531373", "0.5437459", "0.54123974", "0.54048735", "0.53911144", "0.53785235", "0.53613925", "0.53103703", "0.52992976", "0.52986294", "0.52928925", "0.5286078", "0.51701224", "0.5154492", "0.512921", "0.51243764", "0.512283", "0.50...
0.67404544
1
Populate default MDC fields given the request
def populate_default_mdc(request): if MDC.get("instanceUUID") is None: default_mdc() g.request_start = time.process_time() g.empty_value = "EMPTY" g.request_id = MDC.get("requestID") MDC.put('serviceName', request.path) MDC.put('IPAddress', request.headers.get('X-Forwarded-Fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def populate_mdc(request):\n populate_default_mdc(request)\n req_id = request.headers.get('X-ONAP-RequestID', g.empty_value)\n request_json = request.get_json()\n if req_id == g.empty_value:\n req_id = get_request_id(request_json)\n g.request_id = req_id\n MDC.put('requestID', req_id)\n ...
[ "0.7148182", "0.602771", "0.5891659", "0.58830243", "0.55724895", "0.54844886", "0.5304195", "0.5276959", "0.520797", "0.52076936", "0.51919466", "0.5191385", "0.5167862", "0.51356906", "0.50897276", "0.5078626", "0.5076923", "0.5056112", "0.50282836", "0.49944395", "0.497951...
0.70230365
1
Populate MDC fields from the request headers
def populate_mdc(request): populate_default_mdc(request) req_id = request.headers.get('X-ONAP-RequestID', g.empty_value) request_json = request.get_json() if req_id == g.empty_value: req_id = get_request_id(request_json) g.request_id = req_id MDC.put('requestID', req_id) MDC.put('par...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def requestheaders(self, flow: mitmproxy.http.HTTPFlow):", "def dispatch(self, request, *args, **kwargs):\n response = super(HeaderMixin, self).dispatch(request, *args, **kwargs)\n for key, value in self.get_headers(request).items():\n if key not in response:\n response[ke...
[ "0.65046465", "0.62967134", "0.6284752", "0.6284752", "0.6162381", "0.6144599", "0.60227084", "0.59882236", "0.59599906", "0.5959006", "0.5915227", "0.5905611", "0.59024036", "0.58740366", "0.58737975", "0.5865596", "0.5851492", "0.5842985", "0.58381975", "0.5807251", "0.5800...
0.6829647
0
Get the request_id from the request
def get_request_id(request_json): request_id = request_json['requestInfo'].get('requestId') if not request_id: request_id = request_json['requestInfo'].get('requestID') return request_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"request_id\")", "def request_id(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"request_id\")", "def request_id(self) -> Optional[str]:\n return self._request_id", "def get_request_id(): ...
[ "0.84795433", "0.8329366", "0.830264", "0.7830082", "0.7774755", "0.7722813", "0.7612277", "0.7470303", "0.73741233", "0.73023874", "0.7163331", "0.7163331", "0.7114027", "0.7042654", "0.6990485", "0.6965238", "0.69290584", "0.68729585", "0.68166494", "0.67945933", "0.6794593...
0.8425918
1
set errorCode and description
def set_error_details(code, desc): MDC.put('errorCode', code) MDC.put('errorDescription', desc)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error(self, code, msg):\r\n self.status = code\r\n self.status_message = str(msg)", "def set_error(self, code: Optional[int] = None, text: Optional[str] = None) -> None:\n if code is not None:\n self.error_code = code\n if text is not None:\n self.error_text ...
[ "0.7226377", "0.66515416", "0.6603316", "0.6584773", "0.65128946", "0.6479021", "0.6479021", "0.6479021", "0.6398637", "0.6370937", "0.6344257", "0.6301161", "0.62551934", "0.6240884", "0.6209139", "0.619861", "0.61939055", "0.6110585", "0.60983646", "0.6060462", "0.6057573",...
0.7841811
0
Break PPDDL into tokens (brackets, nonbracket chunks)
def _ppddl_tokenize(ppddl_txt): # strip comments lines = ppddl_txt.splitlines() mod_lines = [] for line in lines: try: semi_idx = line.index(';') except ValueError: pass else: line = line[:semi_idx] mod_lines.append(line) ppddl_txt ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenize(raw):\n if valid_expression(raw) != True:\n return valid_expression(raw)\n\n SYMBOLS = set('+-*/() ')\n\n mark = 0\n tokens = []\n n = len(raw)\n for j in range(n):\n if raw[j] in SYMBOLS:\n if mark != j:\n tokens.append(raw[mark:j]) # complet...
[ "0.60048425", "0.59707636", "0.59050167", "0.5863529", "0.57390285", "0.57290787", "0.5728932", "0.57163763", "0.568955", "0.56885785", "0.56841", "0.5660058", "0.55432665", "0.55279386", "0.54794043", "0.54697174", "0.54245275", "0.5410881", "0.5402246", "0.53744245", "0.532...
0.6390122
0
Convert a HList back into tokens (either single open/close parens or nonparen chunks)
def _hlist_to_tokens(hlist): tokens = ['('] for item in hlist: if isinstance(item, HList): tokens.extend(_hlist_to_tokens(item)) else: assert isinstance(item, str), "Can't handle item '%r'" % (item, ) tokens.append(item) tokens.append(')') return token...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hlist_to_sexprs(hlist):\n assert isinstance(hlist, HList), \\\n \"are you sure you want to pass in type %s?\" % (type(hlist),)\n tok_stream = _hlist_to_tokens(hlist)\n\n out_parts = []\n # was the last token an open paren?\n last_open = True\n for token in tok_stream:\n is_open ...
[ "0.7207954", "0.6189308", "0.60015196", "0.59691656", "0.59393567", "0.5918446", "0.57250255", "0.5675595", "0.5649293", "0.56384283", "0.5614204", "0.5575142", "0.5523847", "0.5522683", "0.55224365", "0.5475992", "0.54492694", "0.5404468", "0.54042023", "0.5399426", "0.53935...
0.7624621
0
Extract HLists representing PDDL for domain & problem from a collection of PDDL files & a problem name.
def extract_domain_problem(pddl_files, problem_name=None): domains, problems = extract_all_domains_problems(pddl_files) # retrieve hlist for problem & figure out corresponding domain if problem_name is None: problem_names = list(problems.keys()) if len(problem_names) != 1: raise...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_pddl(domain_file, problem_dir, operators_as_actions=False):\n domain = PDDLDomainParser(domain_file, \n expect_action_preds=(not operators_as_actions),\n operators_as_actions=operators_as_actions)\n problems = []\n problem_files = [f for f in glob.glob(os.path.jo...
[ "0.63395506", "0.5166759", "0.51194584", "0.5096329", "0.50759", "0.5063492", "0.5060452", "0.50081474", "0.4960836", "0.49505037", "0.49185455", "0.4917089", "0.49108973", "0.48711312", "0.48392257", "0.48274457", "0.47663596", "0.47588462", "0.47560546", "0.47486466", "0.47...
0.7167802
0
Extract a domain name from a single PDDL domain file.
def extract_domain_name(pddl_path): assert isinstance(pddl_path, str), \ "this only takes a single (string) filename" domains, _ = extract_all_domains_problems([pddl_path]) assert len(domains) == 1, \ "PDDL file at '%s' contains %d domains (not 1); they are %s" \ % (pddl_path, len(do...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_domain_problem(pddl_files, problem_name=None):\n domains, problems = extract_all_domains_problems(pddl_files)\n\n # retrieve hlist for problem & figure out corresponding domain\n if problem_name is None:\n problem_names = list(problems.keys())\n if len(problem_names) != 1:\n ...
[ "0.70611435", "0.6736632", "0.6644184", "0.65083444", "0.6231846", "0.618083", "0.61510557", "0.61462945", "0.61140597", "0.61140597", "0.61140597", "0.6107941", "0.6098826", "0.6032323", "0.5989271", "0.59697324", "0.5963077", "0.5958331", "0.59303266", "0.59296745", "0.5929...
0.8210151
0
Create modified hlist for problem that has old init atoms replaced with new set of init atoms.
def replace_init_state(problem_hlist, new_init_atoms): # check format for new atoms assert isinstance(new_init_atoms, (tuple, list)) for atom in new_init_atoms: # make sure atoms have the right format (they should all be paren-free, # which is the same format used when interfacing with SSiPP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rehash(self):\n primes = [3, 7, 11, 17, 23, 29, 37, 47, 59, 71, 89, 107, 131, 163, 197, 239, 293, 353, 431, 521, 631, 761,\n 919, 1103, 1327, 1597, 1931, 2333, 2801, 3371, 4049, 4861, 5839, 7013, 8419, 10103, 12143, 14591,\n 17519, 21023, 25229, 30293, 36353, 43627, 523...
[ "0.55467033", "0.5469739", "0.5210806", "0.51778555", "0.5142722", "0.5109277", "0.51012737", "0.50286275", "0.50209165", "0.5007251", "0.50064", "0.49888018", "0.4972342", "0.4962378", "0.49421215", "0.4909628", "0.48985466", "0.48952216", "0.4894046", "0.48938236", "0.48790...
0.7559443
0
Factory method for creating a list of datasets based on the provided config.
def create_datasets(cls, dataset_config, phase): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_creator(config):\n train_dataset, val_dataset = LinearDataset(2, 5), LinearDataset(2, 5)\n train_loader = DataLoader(train_dataset, batch_size=config[\"batch_size\"])\n val_loader = DataLoader(val_dataset, batch_size=config[\"batch_size\"])\n return train_loader, val_loader", "def create_dat...
[ "0.70969605", "0.70201373", "0.68344074", "0.6776368", "0.6705866", "0.6635719", "0.6573257", "0.65120465", "0.6498575", "0.642622", "0.6426022", "0.63702697", "0.6339183", "0.63318914", "0.63004375", "0.6271441", "0.62032425", "0.6139148", "0.61390036", "0.6128331", "0.61185...
0.71189034
0
Iterates over a given ndim dataset patchbypatch with a given stride and builds an array of slice positions.
def _build_slices(dataset, patch_shape, stride_shape): slices = [] if dataset.ndim == 4: in_channels, i_z, i_y, i_x = dataset.shape else: i_z, i_y, i_x = dataset.shape k_z, k_y, k_x = patch_shape s_z, s_y, s_x = stride_shape z_steps = SliceBuilder...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_slices(\n self,\n stride: int,\n patch_size: Tuple[int, int],\n img_size: Tuple[int, int],\n pad: int = None,\n ) -> Tuple[Dict[str, slice], int, int]:\n y_end, x_end = patch_size\n nrows, pady = self._get_margins(y_end, img_size[0], stride, pad=pad)\n ...
[ "0.7005847", "0.6875334", "0.67783237", "0.669869", "0.65634847", "0.6540892", "0.64972025", "0.6417897", "0.6367937", "0.6297416", "0.62602884", "0.6231236", "0.6219337", "0.61511153", "0.6101347", "0.60946655", "0.6035865", "0.60248786", "0.6021954", "0.5969248", "0.5953036...
0.8112532
0
Returns dictionary containing the training and validation loaders (torch.utils.data.DataLoader).
def get_train_loaders(config): assert 'loaders' in config, 'Could not find data loaders configuration' loaders_config = config['loaders'] logger.info('Creating training and validation set loaders...') # get dataset class dataset_cls_str = loaders_config.get('dataset', None) if dataset_cls_str ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getloader(self):\n\t\treturn self.train_loader, self.test_loader", "def get_loaders(train_dataset, val_dataset, test_dataset, batch_size=128):\n train_loader = DataLoader(train_dataset, batch_size=batch_size, num_workers=8,\n shuffle=True)\n\n val_loader = DataLoader(val_da...
[ "0.77058", "0.75321263", "0.73289746", "0.72428334", "0.7208654", "0.7152161", "0.7123573", "0.71009004", "0.6979185", "0.6968148", "0.69598883", "0.69548553", "0.69495887", "0.6937144", "0.6812265", "0.6792436", "0.67497855", "0.671914", "0.66676164", "0.6654188", "0.6636162...
0.78866273
0
Forces the kernel to forget any internal state
def reset(self): # we can have stateful kernels now raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def soft_reset():", "def soft_reset() -> None:\n ...", "def hard_reset() -> NoReturn:", "def _kill_kernel(self):", "def forget(self):\n self.ingress_tbl.clear()\n self.rootsw_tbl.clear()", "def _reset(self):", "def context_reset(self):\n self._context_state = None\n logging.info(...
[ "0.74217105", "0.722404", "0.72135746", "0.6803359", "0.67712796", "0.67340916", "0.6700091", "0.66579306", "0.6646685", "0.6634392", "0.66275513", "0.66275513", "0.66275513", "0.6625049", "0.6625049", "0.66111887", "0.6559115", "0.65540874", "0.65513855", "0.6551063", "0.654...
0.7379418
1
Junction table between track and tag
def create_table_track_tag(): db, cursor = connect_db() sql = """CREATE TABLE track_tag( id INT PRIMARY KEY AUTO_INCREMENT, track CHAR(50), listeners INT, tag CHAR(80))""" if not table_exists('track_tag'): cursor.execute(sql) db.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags():", "def setup_table_for_epochs(table, timeseries, tag):\n table = table.copy()\n indices = np.searchsorted(timeseries.timestamps[:], table['start_time'].values)\n if len(indices > 0):\n diffs = np.concatenate([np.diff(indices), [table.shape[0] - indices[-1]]])\n else:\n diffs...
[ "0.55131227", "0.5432311", "0.5379462", "0.5311604", "0.520015", "0.51316947", "0.5076026", "0.50580233", "0.5042422", "0.502247", "0.49778578", "0.49356183", "0.4933939", "0.48593968", "0.48234257", "0.47962663", "0.47531515", "0.47092152", "0.46891809", "0.46847436", "0.468...
0.6217344
0
Comment table, each track can have many comments
def create_table_comment(): db, cursor = connect_db() sql = """CREATE TABLE comment( id INT PRIMARY KEY AUTO_INCREMENT, content TEXT NOT NULL, track CHAR(50), FOREIGN KEY (track) REFERENCES track(mbid_track) ON DELETE CASCADE ON UPDATE CASCADE) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def comments(table='None',record_id=None):\n return LOAD('plugin_wiki','comment',\n args=(table,record_id or 0),ajax=True)", "def process_comments(session, comments):\n for c in tqdm(comments, desc=\"Injecting comments into DB\"):\n db_comment = session.query(Comment).get(c['i...
[ "0.6333306", "0.6269757", "0.60994935", "0.5773089", "0.5773089", "0.5773089", "0.5733459", "0.5616513", "0.5616513", "0.5616513", "0.5581671", "0.55440205", "0.5535735", "0.55026776", "0.54917896", "0.54766464", "0.54709023", "0.5468782", "0.5422078", "0.5420959", "0.5415652...
0.672153
0
Executes on 'inst = extension(__file__)', once the FuncExtension class is instantiate, overwrite the __init__() method and add the instance into lifecycle hooks.
def __call__(cls, *args, **kwargs): scope = ExtensionMeta._get_extension_scope(cls) # Only register function extension here if scope is ExtensionScope.FUNCTION: instance = super(ExtensionMeta, cls).__call__(*args, **kwargs) ExtensionMeta._register_function_extension(inst...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(cls, *args, **kwargs):\n super(ExtensionMeta, cls).__init__(*args, **kwargs)\n scope = ExtensionMeta._get_extension_scope(cls)\n\n # Only register application extension here\n if scope is ExtensionScope.APPLICATION:\n ExtensionMeta._register_application_extension...
[ "0.6908307", "0.66134", "0.63168395", "0.63143146", "0.6304827", "0.6285953", "0.62726295", "0.62570393", "0.6232876", "0.61896396", "0.6177422", "0.6167259", "0.61512214", "0.61439264", "0.61437917", "0.6127093", "0.6067047", "0.604869", "0.60440755", "0.60283905", "0.596429...
0.66437
1
Return the scope of an extension
def _get_extension_scope(cls, extension) -> ExtensionScope: return getattr(extension, '_scope', ExtensionScope.UNKNOWN)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_scope(self):\n raise NotImplementedError()", "def getScope(self):\n return self.graph.get(\"__scope\", '')", "def get_scope(self, ):\n return self.attrs.get(self.AttributeNames.SCOPE, None)", "def scope(self):\n return self._scope", "def scope(self):\n return self...
[ "0.73213845", "0.70416516", "0.69279176", "0.6821478", "0.6821478", "0.67471546", "0.6632716", "0.6580553", "0.6580553", "0.6580553", "0.6580553", "0.6580553", "0.65357023", "0.6508856", "0.6500741", "0.6484992", "0.6478981", "0.6477815", "0.6441294", "0.635962", "0.63475525"...
0.82154244
0
Extract feature of the article.
def extract_feature(self, article) : pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extractFeatures(self, datum):\n abstract", "def get_article_features(self, article_id):\n return self.article_features[article_id]", "def extract_features(self):\n self.extract_features_static()\n self.extract_features_dynamic()", "def extract_feat(self, img):\n x = sel...
[ "0.76325", "0.7500404", "0.72077006", "0.6871161", "0.6740519", "0.6689456", "0.6689456", "0.6626647", "0.6626647", "0.6532927", "0.6496821", "0.6480481", "0.64514136", "0.6408025", "0.63945675", "0.6326969", "0.6301005", "0.6250069", "0.6204821", "0.6189456", "0.6137698", ...
0.92542654
0
Serve qwerty.sh file as requested. URL path indicates git ref to serve, defaulting to current HEAD.
def serve_qwerty(environ): if not valid_request(environ): return ( # HTTP Status '400 BAD REQUEST', # HTTP Response Headers (('Content-Type', 'text/plain'),), # WSGI Body string_response(SHELL_BAD_REQUEST)) req_ref = parse_ref(en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def git_show(ref, filepath, **kw):\n if ref == DIRTY and filepath == 'qwerty.sh':\n return sh('cat', os.environ.get('QWERTY_SH', filepath), **kw)\n return sh('git', 'show', '{ref}:{filepath}'.format(**locals()), **kw)", "def do_GET(self): # pylint:disable=invalid-name\n if not self.path.star...
[ "0.5506621", "0.54689586", "0.5368447", "0.5207997", "0.5172485", "0.51046586", "0.5090519", "0.5063", "0.5042701", "0.50341594", "0.50282055", "0.50218034", "0.5019689", "0.49282256", "0.49267417", "0.49238536", "0.49171057", "0.49163142", "0.49148035", "0.4890634", "0.48906...
0.65912956
0
Parse URL which has a git ref.
def parse_ref(url_path): ref = url_path.lstrip('/') if not ref: ref = os.environ.get('DEFAULT_GIT_REF', 'HEAD').strip() return ref
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_url(repo_url: str) -> List[str]:\n try:\n return re.findall(r\"github\\.com/([^/]+)/([^\\/?]+)\", repo_url, re.I)[0]\n except IndexError:\n raise AnalyzerError(\"Incorrect repository URL\")", "def parse_git_repo(potential_url: str) -> Optional[RepoUrl]:\n return ...
[ "0.6886565", "0.68271065", "0.66438717", "0.66395956", "0.6441399", "0.6291505", "0.62186545", "0.6184888", "0.61118346", "0.6041315", "0.60231346", "0.59940207", "0.59714484", "0.59388185", "0.5928919", "0.59102505", "0.5882337", "0.58619136", "0.5851686", "0.5817157", "0.58...
0.8032139
0
List of remote names as returned by `git remote`.
def git_remote(**kw): return sh('git', 'remote', **kw).strip().split('\n')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getRemotes(directory):\n gitRemoteOutput = subprocess.check_output(['git','remote','-v'],cwd=directory)\n remotes = []\n for line in gitRemoteOutput.splitlines():\n if '(fetch)' in line:\n splitLine = line.split();\n remotes.append({'name': splitLine[0].strip(), 'url': spl...
[ "0.7427923", "0.7362086", "0.70858604", "0.67908543", "0.6740787", "0.66803145", "0.6658802", "0.65457875", "0.6332602", "0.6321992", "0.62936676", "0.6285218", "0.6279401", "0.61994255", "0.6173408", "0.6159415", "0.61329114", "0.60929936", "0.6055281", "0.6001555", "0.59582...
0.77508414
0
Run `git revparse short` on given ref, return stdout.
def git_rev_parse(ref, **kw): return sh('git', 'rev-parse', '--short', ref, **kw).strip()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rev_parse(commit_ish, short=False):\n args = [\"--short\"] if short else []\n return (\n subprocess.check_output([\"git\", \"rev-parse\"] + args + [commit_ish])\n .decode()\n .strip()\n )", "def _short_rev(self, revision):\n return subprocess2.check_output(['git', '--git-dir'...
[ "0.7441304", "0.7280745", "0.71660155", "0.67345434", "0.66260004", "0.6605308", "0.63576216", "0.61784005", "0.61181045", "0.6104781", "0.61037815", "0.60717386", "0.58966416", "0.5876135", "0.5854064", "0.58136415", "0.57321113", "0.5721485", "0.56808376", "0.5680357", "0.5...
0.78444266
0
Provide file content at given ref (via `git show`). Accept a projectspecific ref 'DIRTY' which requests file content within the working tree, whether the file matches HEAD or is modified/dirty. When GIT_DIR is in use, the working tree may not be known. Therefore, an environment variable QWERTY_SH specifies where to fin...
def git_show(ref, filepath, **kw): if ref == DIRTY and filepath == 'qwerty.sh': return sh('cat', os.environ.get('QWERTY_SH', filepath), **kw) return sh('git', 'show', '{ref}:{filepath}'.format(**locals()), **kw)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _git_show(self, path, ref=\"HEAD\"):\n res = requests.get(\n \"/\".join([self.loc, ref, path]),\n auth=HTTPBasicAuth(self.username, self.password)\n )\n\n if res.status_code // 100 != 2:\n return None\n\n if res.headers['Content-Type'] == 'applicatio...
[ "0.63712394", "0.6063302", "0.58879626", "0.5837158", "0.58147126", "0.56906724", "0.56815", "0.55939627", "0.55455285", "0.5500167", "0.54639506", "0.54491496", "0.53662145", "0.53462464", "0.53271997", "0.5295016", "0.5275983", "0.5274206", "0.5257765", "0.52293074", "0.518...
0.74254096
0
Counts the number of times a given character occurs in the sequence.
def count(self, char): return self._sequence.count(char)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count(self, character):\n c_list = [i for i in self.input_words]\n n = sum([True for char in c_list if char == character])\n return n", "def count_runlength_per_character(sequence):\n character_counts = defaultdict(list)\n current_character = None\n\n for character in sequence:\...
[ "0.80965114", "0.731327", "0.7124051", "0.6991963", "0.6991963", "0.6991963", "0.6991963", "0.6988559", "0.69828403", "0.69589186", "0.6919896", "0.69167745", "0.691067", "0.6885967", "0.6849524", "0.68440473", "0.68096626", "0.6725519", "0.6717172", "0.6714761", "0.66839606"...
0.8534954
0
Counts the number of times a given codon occurs in the sequence.
def count_codon(self, codon): return sum([1 for c in self if c == codon])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def codon_frequency(sequence, codon_table):\n # initialize the counter with the list of triplets from codon_table\n counter = Counter(dict([(c, 0) for c in codon_table]))\n # create a list/array of all possible codons found in the input sequence\n triplets = [sequence.upper()[i:i + 3] for\n ...
[ "0.76928365", "0.72288704", "0.7020587", "0.69627184", "0.6793571", "0.672953", "0.6676184", "0.6635528", "0.6520836", "0.65163827", "0.64449614", "0.64423144", "0.63420886", "0.6316222", "0.63059574", "0.62750775", "0.6271865", "0.62515956", "0.62329936", "0.6179496", "0.617...
0.7857171
0
Follow the given line along our raster data (which contains the height), and return an elevation profile based on this data. This "line following" can be done using the following SQL Common Table
def generate_elevation_profile(line): elem = from_shape(line, 4326) line_cte = db.session.query( func.ST_Transform(elem, 28992).label("geom")).cte(name="line") cells_cte = db.session.query( # Get the centroid of the cell which intersects our line func.ST_Centroid( #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_profile(tif, line_file, ds):\r\n\r\n import numpy as np\r\n import gdal\r\n import fiona\r\n from scipy.interpolate import interp1d\r\n# from scipy.interpolate import interp2d\r\n from scipy.ndimage import map_coordinates\r\n \r\n #%% Create evenly spaced points\r\n # Read co...
[ "0.69637424", "0.5826449", "0.57103837", "0.5646298", "0.55310214", "0.5500064", "0.54344666", "0.54160964", "0.54142326", "0.54000705", "0.53888005", "0.53466713", "0.5318213", "0.5275842", "0.52528954", "0.5251642", "0.52284986", "0.51672316", "0.5151932", "0.5125206", "0.5...
0.7878448
0
Function to get last customer_id from dimemsion table `dimCustomer`
def get_dimCustomer_last_id(db_engine): query = "SELECT max(customer_id) AS last_id FROM dimCustomer" tdf = pd.read_sql(query, db_engine) return tdf.iloc[0]['last_id']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createCustomerID(self):\n\n customerID = self._df_invoice_original.CustomerID.max()\n customerID += 1\n return int(customerID)", "def _get_next_cust_id():\n # print('Customer roster: ' + str(customers))\n key_list = []\n for customer_key in customers:\n stripped_prefix = custom...
[ "0.67792225", "0.6658362", "0.66357696", "0.645091", "0.63228", "0.63228", "0.6241016", "0.6202862", "0.6164557", "0.5997476", "0.59013075", "0.5857499", "0.5856728", "0.5774705", "0.57680035", "0.57648563", "0.5709758", "0.57052225", "0.56931895", "0.5676695", "0.56617033", ...
0.87742794
0
Function to extract table `customer`
def extract_table_customer(last_id, db_engine): if last_id == None: last_id = -1 query = "SELECT * FROM customer WHERE customer_id > {} LIMIT 100000".format( last_id) return pd.read_sql(query, db_engine)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def table_info(self):\n for customer in self.customers:\n print(customer.get_name())", "def get_all_customer_ids_from_table(table):\n\n # your code", "def get_customers(filters):\n\treturn frappe.db.sql(\"\"\"\n\t\tSELECT\n\n\t\t\tpar.debtor_creditor_number as 'Konto',\n\t\t\tCASE cus.cust...
[ "0.7069807", "0.6847795", "0.6749942", "0.6735457", "0.63997877", "0.63688225", "0.623806", "0.6143866", "0.61318064", "0.6121188", "0.60949534", "0.5986751", "0.5874319", "0.58279836", "0.57973367", "0.5785721", "0.5750967", "0.57416916", "0.5740802", "0.5729803", "0.5729663...
0.69289374
1
Function to lookup table `city`
def lookup_table_city(address_df, db_engine): unique_ids = list(address_df.city_id.unique()) unique_ids = list(filter(None, unique_ids)) query = "SELECT * FROM city WHERE city_id IN ({})".format( ','.join(map(str, unique_ids))) return pd.read_sql(query, db_engine)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cities(self, city_name: str = None):", "def get_cities(self, city_name: str = \"\"):", "def lookup():", "def get_city(self, territory_id: str = \"\"):", "def get_city(self, territory_id: str = \"\"):", "def find_airport_code_by_city(city):\n airports = get_airports()\n\n if city == 'London'...
[ "0.63925815", "0.63338417", "0.6196936", "0.6175682", "0.6175682", "0.6149344", "0.6148725", "0.61036944", "0.60618037", "0.60598654", "0.6055908", "0.60204005", "0.5920108", "0.58628803", "0.5817846", "0.58118546", "0.5788021", "0.57876307", "0.5774068", "0.57558584", "0.574...
0.68159336
0
Function to lookup table `country`
def lookup_table_country(address_df, db_engine): unique_ids = list(address_df.country_id.unique()) unique_ids = list(filter(None, unique_ids)) query = "SELECT * FROM country WHERE country_id IN ({})".format( ','.join(map(str, unique_ids))) return pd.read_sql(query, db_engine)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def country(name):\n return location_db().find(name=name)[\"country\"]", "def country(from_key='name', to_key='iso'):\n\n gc = GeonamesCache()\n dataset = gc.get_dataset_by_key(gc.get_countries(), from_key)\n\n def mapper(input):\n # For country name inputs take the names mapping into account....
[ "0.6425841", "0.64209306", "0.6373195", "0.63236594", "0.6322793", "0.6316175", "0.62102115", "0.61623144", "0.61216587", "0.61087", "0.6083194", "0.60344917", "0.5999983", "0.5999794", "0.59980667", "0.5994865", "0.5968701", "0.5947591", "0.59401757", "0.5921362", "0.5919463...
0.6930801
0
Recursively tries all valid moves until a dead end or vault is reached. If the vault is reached, the successful path is appended to the list of successful paths to be later tested for the shortest item.
def next_step(x, y, path): # Terminate if we're at the vault if x == 3 and y == 3: paths.append(path) return # Not at the vault, so figure out where we can go valids = get_valid_moves(x, y, path) # Try all the valid moves. if 'U' in valids: next_step(x, y - 1, path + 'U') if 'D' in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solve(self):\n while self.character.path[-1] != 88:\n n = self.next_move()\n if n is None:\n self.character.path += ['Error: Could not find full path (budget does not suffice or unreachable).']\n break\n self.character.path += [n]\n ...
[ "0.65833664", "0.6372056", "0.6130507", "0.60635877", "0.6021399", "0.6011221", "0.5976727", "0.5894789", "0.585667", "0.5837022", "0.58182186", "0.5795566", "0.57953036", "0.5782272", "0.57729685", "0.5744479", "0.57440406", "0.57273585", "0.5721254", "0.56813663", "0.567322...
0.6927385
0
Change ligand format from pdb to mae. Command e.g. $SCHRODINGER/utilities/structconvert imae gold_5HT2B_1106_0001_receptor_prep.mae omol2 gold_5HT2B_1106_0001_lreceptor_prep.mol2
def ChangeFormattoMol2(self): print "coverting" mainExecutablePath = os.path.join(self.Program_path,"utilities/structconvert") outputLigName = FileManager().changeExtention(os.path.basename(DockParams.glideRecAdd),".mol2") outputFile = os.path.join(self.ouPutDir,outputLigName) #if the file is already ther...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_amber_atomtype_to_rosetta_atomtype(self):\n\n tmpfile = open(\"tmp.mol2\", 'w')\n with open(\"ligand_am1_bcc.mol2\",'r') as f:\n atoms = False\n\n for line in f:\n\n print \"ATOM\", line.find(\"@<TRIPOS>ATOM\"),line\n print \"BOND\", lin...
[ "0.56204265", "0.5606673", "0.5589028", "0.55732787", "0.54238284", "0.53916115", "0.5365847", "0.5325752", "0.5295879", "0.5292423", "0.5265663", "0.5251396", "0.5227674", "0.5157129", "0.5050518", "0.5016841", "0.5005721", "0.49931896", "0.49730524", "0.49691537", "0.496626...
0.6292109
0
Inventor Document Object Open the specified Inventor document. Check document type and bind the document COM object to the associate class in the wrapper.
def _load_document(path, app): start_inventor() document_type_enum = { 12289: 'UnnownDocument', 12290: 'PartDocument', 12291: 'AssemblyDocument', 12292: 'DrawingDocument', 12293: 'PresentationDocument', 12294: 'DesignElementDocument...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load(self):\n service_manager = helper_util.getServiceManager(self.hostname, self.port,\n self.uno_path,\n self.office_binary_path)\n desktop = service_manager.createInstance(\"com.sun.star.frame.Deskto...
[ "0.6314423", "0.58153236", "0.5770224", "0.57164824", "0.56444573", "0.5527755", "0.5501214", "0.54984194", "0.5437338", "0.5371609", "0.53421426", "0.52601856", "0.52560765", "0.5243142", "0.52274036", "0.52099335", "0.5182543", "0.5144588", "0.51439834", "0.5133299", "0.508...
0.62638557
1
Export file Publish file into the export directory using the Inventor translator addin. Can export files such as; dwf, dxf, dwg, pdf, iges & step.
def export_to(self, subdir, filetype='pdf'): file = self.partcode + '.' + filetype path = self.export_dir.joinpath(subdir).joinpath(file) print(str(path)) self.doc.SaveAs(str(path), True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, export_path: str):", "def export(self):\n\t\tif ( self.saveFileStr.get() not in self.saveDefault ):\n\t\t\t# Set the tempo\n\t\t\ttempoObject = tempo.MetronomeMark( None, \n\t\t\t\t\t\t\t\t\t\t\t\tint(self.tempo.get()), \n\t\t\t\t\t\t\t\t\t\t\t\tnote.QuarterNote() )\n\t\t\tself.transcribedPart.ins...
[ "0.60674393", "0.6062647", "0.5992593", "0.5960276", "0.5954187", "0.58986855", "0.5898668", "0.587222", "0.5783057", "0.5770898", "0.57548", "0.57464784", "0.573224", "0.5731189", "0.5699863", "0.5672635", "0.5672362", "0.5646713", "0.5637762", "0.5585895", "0.5578398", "0...
0.634202
0
Close Document Close current Inventor document without saving.
def close(self): self.doc.Close(SkipSave=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close( self ):\r\n self.oodocument.close( 1 )", "def close(self):\n self._document.endDocument()\n self._output.close()\n return", "def close(self):\n self._document.endDocument()\n self._output.close()\n return", "def __del__(self):\n try:\n self....
[ "0.79013187", "0.72350127", "0.72350127", "0.6598856", "0.64040637", "0.6323551", "0.63138396", "0.6252028", "0.621006", "0.61996174", "0.61996174", "0.6174571", "0.6165006", "0.61634845", "0.61634845", "0.61457986", "0.6119146", "0.6109935", "0.6093869", "0.6093869", "0.6084...
0.7820382
1
Sheet Size Get the size of the sheet.
def get_drawing_sheet_size(self): drawing_sheet_size_enum = { 9993: 'A0', 9994: 'A1', 9995: 'A2', 9996: 'A3', 9997: 'A4' } return drawing_sheet_size_enum[self.doc.Sheets(1).Size]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sheet_px(self):\n return self.image.size", "def width(self):\n return self.sheet.width", "def height(self):\n return self.sheet.height", "def getSize(self):\n return self.screen.get_size()", "def size(self):\n return self._ax.size", "def get_size(self):\n ...
[ "0.7155422", "0.7145198", "0.6696293", "0.6311784", "0.6203815", "0.6170172", "0.614004", "0.6112646", "0.6112646", "0.6112646", "0.6112646", "0.6112646", "0.6112646", "0.6112646", "0.6111653", "0.60817945", "0.6013408", "0.5942203", "0.5916718", "0.5890572", "0.588095", "0...
0.7440444
0
Drawing Infomation Return a dictionary of the drawing's properties.
def get_drawing_info(self): iprop = self.doc.PropertySets.Item("Inventor User Defined Properties") drawing_info = { 'partcode': str(iprop.Item('Dwg_No')), 'rev': int(iprop.Item('Revision')), 'desc': str(iprop.Item('Component')), 'material': str(iprop.Item(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dictOfDraws(self):\n return dict()", "def get_drawing_properties(self, request):\n HttpRequest = request.to_http_info(self.api_client.configuration)\n return self.__make_request(HttpRequest, 'GET', 'CadResponse')", "def dictOfDraws(self):\n return {self.name: self.drawType}", ...
[ "0.6754636", "0.6641022", "0.6550758", "0.6287552", "0.6277386", "0.6244437", "0.62039536", "0.6133624", "0.61063665", "0.6066986", "0.60402703", "0.59900194", "0.5883342", "0.5839938", "0.5839938", "0.5837344", "0.5824808", "0.58013505", "0.5787323", "0.5770396", "0.57483697...
0.786125
0
Part List Export the drawings part list to an excel spreadsheet.
def export_part_list(self, filetype='xlsx'): if filetype == 'csv': enum = 48649 else: enum = 48642 path = self.export_dir.joinpath(self.partcode).joinpath('part_list.xlsx') self.doc.Sheets(1).PartsLists(1).Export(str(path), enum)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_xlsx_report(self, workbook, data, parts_data):\n worksheet = workbook.add_worksheet(\"daily_parts_issuance_wizard\")\n worksheet.set_column(0, 0, 10)\n worksheet.set_column(1, 1, 15)\n worksheet.set_column(2, 2, 20)\n worksheet.set_column(3, 3, 15)\n worksheet...
[ "0.56160164", "0.55761665", "0.54248136", "0.534758", "0.53009796", "0.52972174", "0.52714413", "0.5245905", "0.52419496", "0.52114475", "0.5188195", "0.51822585", "0.5180431", "0.51724", "0.5169368", "0.51534563", "0.51534563", "0.51424354", "0.51281565", "0.5084283", "0.508...
0.73799103
0
Assembly BOM Export the assembly's bom to an excel spreadsheet.
def export_bom(self): path = self.export_dir.joinpath(self.partcode).joinpath('bom.xlsx') bom = self.doc.ComponentDefinition.BOM bom.StructuredViewFirstLevelOnly = False bom.StructuredViewEnabled = True bom.BOMViews.Item("Structured").Export(path, 74498)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def excel(df_ccl, df_arg_stocks, df_bonds, df_arg_stocks_ccl):\n if os.path.exists('CCL.xlsx'):\n wb = xw.Book('CCL.xlsx')\n # SHEET CEDEARS\n ws = wb.sheets('CCL CEDEARs')\n ws.range('A1').expand().value = df_ccl\n # SHEET MERVAL\n ws_merval = wb.sheets('Merval')\n ...
[ "0.5489227", "0.53955525", "0.53943247", "0.535171", "0.5196142", "0.51958334", "0.5184721", "0.5184721", "0.5121045", "0.51061136", "0.50798583", "0.50670487", "0.50608927", "0.5057104", "0.50562996", "0.50555015", "0.5051913", "0.5022295", "0.5021901", "0.50205517", "0.5006...
0.69654846
0
Inventor Application COM Object Start COM client session with Inventor, and create object 'mod' that will point to the Python COM wrapper for Inventor's type library. Recast 'app' as an instance of the Application class in the wrapper.
def application(silent=True, visible=True): mod = win32com.client.gencache.EnsureModule( '{D98A091D-3A0F-4C3E-B36E-61F62068D488}', 0, 1, 0) app = win32com.client.Dispatch('Inventor.Application') app = mod.Application.Application(app) app.SilentOperation = silent app.Visible = visible ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xl_app():\n # get the Excel application object from PyXLL and wrap it\n xl_window = get_active_object()\n xl_app = win32com.client.Dispatch(xl_window).Application\n # it's helpful to make sure the gen_py wrapper has been created\n # as otherwise things like constants and event handlers won't wor...
[ "0.5643507", "0.5627383", "0.5627383", "0.54541713", "0.5249593", "0.5184261", "0.5141776", "0.51340455", "0.5034825", "0.49522698", "0.48428228", "0.47841534", "0.4783867", "0.4765067", "0.47261083", "0.4720507", "0.47188494", "0.47181958", "0.46886703", "0.46567947", "0.465...
0.64742947
0
Get the laitude and longitude of the satellite.
def getlatlon(self): lat = np.pi/2.0 - self._th time = self.gettime() lon = self._phi - 2*np.pi*time/86164.09164 return lat, lon
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def longitude(self):\n return self.coordinates[1]", "def get_longitude(self):\n return self.L + self.dL", "def lat_lons(self):", "def longitude(self):\r\n try:\r\n return str(self.connect()['coord']['lon'])\r\n except:\r\n return '@weather_longitude'", "def...
[ "0.7085491", "0.7080936", "0.7050814", "0.7034714", "0.70212334", "0.69736034", "0.69541067", "0.6901686", "0.6871633", "0.6860063", "0.6791301", "0.6791301", "0.6791301", "0.6721006", "0.6721006", "0.6717831", "0.67132956", "0.6712324", "0.6700615", "0.66944474", "0.66944474...
0.74325615
0
Return the differential at the given state of the satellite.
def diff_func(sat): state = sat.getstate() dstate = np.zeros(7) dstate[-1] = 1.0 dstate[0] = state[1] dstate[2] = state[3]/(state[0]) dstate[4] = state[5]/(state[0]*np.sin(state[2])) acc = tot_acc(sat) dstate[1], dstate[3], dstate[5] = sat.getvdot(acc[0], acc[1], acc[2]) return dstat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def diff_effector2(state, th0, alpha, beta, beta_p, p, d):\n dt_state = np.zeros_like(state)\n #print(len(state))\n if alpha == 1:\n for j in range(len(state)):\n if j == 0:\n dt_state[j] = p*beta*th0+2*beta_p*state[-1]-(beta_p+d[\"d_eff\"])*state[j]\n else:\n ...
[ "0.63147205", "0.60903084", "0.6006943", "0.600486", "0.6004454", "0.59828514", "0.597046", "0.5827749", "0.58180046", "0.57104623", "0.5707477", "0.5707477", "0.5697083", "0.56724244", "0.56356525", "0.563293", "0.5621552", "0.5615352", "0.5593139", "0.5592605", "0.5584849",...
0.6988144
0
Get the total acceleration on the satellite.
def tot_acc(sat): pos = sat.getpos_sph() lat = sat.getlatlon()[0] # g_acc = np.array([-G*M_EARTH/pos[0]**2, 0, 0]) g_acc = forces.gravity_wgs84(pos[0], lat) tether = sat.get_tether() t_acc = tether.accln(sat) return g_acc + t_acc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_acceleration(self):\n return self.acceleration", "def acceleration(self):\n return self.__accel", "def calculate_acceleration(self) -> np.array:\n F = self.calculate_net_force()\n m = self.mass\n a = F / m\n\n return a", "def average_speed(self):\n ret...
[ "0.73545295", "0.73051333", "0.7060621", "0.66527426", "0.6650752", "0.6501011", "0.6464128", "0.6383412", "0.6358947", "0.63549036", "0.63005334", "0.6251332", "0.6231296", "0.6144974", "0.6137299", "0.6135657", "0.60734946", "0.60516113", "0.60334015", "0.60043365", "0.5991...
0.7394116
0
Calculate the orbit. sat Satellite object. tfinal Duration for which the simulation is to be continued. tstep Time steps for rk4 method. trec Time durations after which the data are to be recorded.
def getorbit(sat, tfinal, tstep, trec): ntimes = (int)(tfinal/tstep) n_tvals = (int)(tfinal/trec) state_arr = np.zeros((6, n_tvals)) orbelem_arr = np.zeros((6, n_tvals)) s_major_arr = np.zeros(n_tvals) count = 0 for i in range(ntimes): sat.rk4_step_sat(tstep) if i % (trec/tst...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, tfinal):\n t = 0; kk = 0\n nstep = int(np.round(tfinal/self.dt))+1 # number of time steps\n self.omega = np.zeros((nstep,self.npts))\n self.theta = np.zeros((nstep,self.npts))\n\n while t <(tfinal+1e-10):\n self.return_map()\n self.omega[kk]...
[ "0.6794196", "0.60793453", "0.5901818", "0.5851239", "0.5782011", "0.5770543", "0.5591894", "0.5514925", "0.5505379", "0.55045956", "0.55011976", "0.54937136", "0.54893696", "0.54882526", "0.5484904", "0.5462346", "0.5450466", "0.5415354", "0.53967535", "0.5395138", "0.539078...
0.68522704
0
Add multiple edges from a list. Creates necessary nodes if missing.
def addEdgeList(self, edges): for e in edges: self.addEdge(e[0], e[1], e[2] if len(e) > 2 else None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def populate_edges(self, edges_list):\n edges = []\n for edge in edges_list:\n source, target, weight = edge[4], edge[5], edge[6]\n freq, line, geom = edge[7], edge[1], edge[2]\n edges.append(Edge(source, target, weight,\n freq, line, geom...
[ "0.7901773", "0.7504791", "0.74326646", "0.7195719", "0.70979315", "0.69542", "0.6848732", "0.6650528", "0.64970654", "0.6494456", "0.6472332", "0.63688713", "0.6281608", "0.6212791", "0.61292446", "0.60589206", "0.60501343", "0.60132796", "0.60039186", "0.59800214", "0.59626...
0.7991557
0
Return the shortest path from a single node to all other nodes using then BellmanFord algorithm.
def spBellmanFord(self, node, returnPaths = False): # Initialize working dictionaries and next edges to check curr = dict(map(lambda k: (k, (0, k) if k == node else (self.Inf, None)),\ self.__nodes.keys())) prev = {} edges = self.__nodes[node]["tails"] # Iter...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shortest(self, from_node, to_node):\n print \"Shortest path from {} to {}\".format(from_node.name, to_node.name)\n current = from_node\n solution = {current.name: 0}\n visited = []\n if from_node.name == to_node.name:\n return \"No route necessary\"\n\n whil...
[ "0.69181216", "0.6793333", "0.66386753", "0.6614206", "0.64635444", "0.6387431", "0.6366989", "0.6350682", "0.6343997", "0.6335303", "0.63228905", "0.63037467", "0.6294597", "0.62799925", "0.6256618", "0.62357825", "0.621537", "0.620141", "0.62002367", "0.61943823", "0.617711...
0.7007959
0
Sifts node up heap from starting position up to stopping position. Helper for Dijkstra shortest path algorithm.
def __siftup(heap, nodes, pos, stopPos = 0): # Loop until past stopping position while pos > stopPos: # Set parent position parentPos = (pos - 1) >> 1 # Swap if child less than parent if heap[pos][0] < heap[parentPos][0]: Graph.__swapHeapN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sift_up(heap, start, end):\n # Swap last node with parents until no longer greater.\n i = end - 1\n heaped = False\n while i > start and not heaped:\n parent = (i - 1) // 2\n if compare(heap[i], heap[parent]) > 0:\n heap[i], heap[parent] = heap[parent], heap[i]\n ...
[ "0.74632794", "0.7113151", "0.7083342", "0.69225824", "0.6910801", "0.68580097", "0.68276983", "0.6824524", "0.67925024", "0.6759504", "0.67199624", "0.6697237", "0.65319943", "0.65147156", "0.65080684", "0.6435036", "0.6434008", "0.63586605", "0.6327083", "0.6327083", "0.629...
0.76474434
0
Choos the closest option to the value in the provided scale This function quantifies a continuous domain value by transforming it on the closest value in a provided discrete scale. If the initial value is out of scale range, any transformation is applied.
def quantify ( value, scale ): if value < scale[0] or value > scale[-1]: return value for i in range (1, len(scale)): if value <= scale[i]: if scale[i] - value > value - scale[i-1]: return scale[i-1] else: return scale[i]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_scale(scale):\n return sequence_scale(scale, (1, 1.25, 1.5, 1.75, 2,\n 2.5, 3, 4, 5, 6, 7.5, 8, 9, 10))", "def scale_to(scale_to, group,\n allow_zero_scale=False, allow_unknown_scale=False):\n if isinstance(scale_to, numbers.Number):\n scale =...
[ "0.58203614", "0.5705652", "0.564065", "0.5609797", "0.55709827", "0.554368", "0.54593116", "0.54247427", "0.53765225", "0.5336261", "0.5330451", "0.5324379", "0.53215355", "0.53164834", "0.5311227", "0.52858055", "0.52744573", "0.52744573", "0.52655673", "0.5264844", "0.5263...
0.6383433
0
Provide a generator for looping on a signal through consecutive windows This function returns a python generator for looping on a signal. For each loop a single window is yielded. This way, any processing could be applied to the signal for each window through a simple forloop. If the withWindowIndex param is setted to ...
def getSignalReader( signal, sampleRate=16000, windowWidth=0.032, step=0.01, withWindowIndex=False): windowWidth = int( windowWidth * sampleRate) step = int( step * sampleRate) nbWindows = int((signal.size - windowWidth) // step ) +1 if withWindowIndex: for i in range(nbWindows): startIndex = ste...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def windows(self,windowSize):\n for i in range(0,len(self)-windowSize):\n yield (i,i+windowSize)", "def next_window(self) -> Iterator[Optional[np.ndarray]]:\n while self._count >= self._window_width:\n # Preserve what we want to return by copying it.\n p1 = np.copy(self._data_store...
[ "0.66393507", "0.6352211", "0.6261867", "0.6147487", "0.60668856", "0.5951129", "0.59446025", "0.5938473", "0.59366006", "0.59322333", "0.5929444", "0.5924533", "0.5921071", "0.5921071", "0.5886021", "0.58556145", "0.57975996", "0.57353735", "0.57302964", "0.57296604", "0.561...
0.7012798
0
Append the shorter provided signal so that its size equals the second signal size
def equalizeShapes( signal1, signal2): if signal1.size < signal2.size: signal1 = np.append( signal1, [0] * (signal2.size-signal1.size)) elif signal1.size > signal2.size: signal2 = np.append( signal2, [0] *(signal1.size - signal2.size)) return signal1, signal2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extend_signals(signals, length=None, samplerate=None):\n if length is None:\n return signals\n if samplerate is not None:\n length = round(samplerate * length)\n\n def extend(signal):\n padding = length - signal.shape[-1]\n if padding < 1:\n return signal.copy()\...
[ "0.6565597", "0.62266785", "0.6098461", "0.60221773", "0.59076077", "0.5724437", "0.5691555", "0.56132376", "0.5610638", "0.55797607", "0.5540436", "0.55208486", "0.5417652", "0.53261745", "0.52319014", "0.521986", "0.5175316", "0.5148651", "0.51152825", "0.5098384", "0.50800...
0.63064384
1
Note This is lazyly evaluated, no operation is actually run. Returns CacheID A global cache volume identifier. Raises ExecuteTimeoutError If the time to execute the query exceeds the configured timeout. QueryError If the API returns an error.
def id(self) -> CacheID: _args: list[Arg] = [] _ctx = self._select("id", _args) return _ctx.execute_sync(CacheID)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cache_id(self):\n return None", "def getIdOrThrow(con, key, value, table):\n\n # create cache directory if not present\n Path(ID_CACHE_FILE.parent).mkdir(parents=True, exist_ok=True)\n \n path_exists = Path(ID_CACHE_FILE).exists()\n\n cache = None\n if (path_exists):\n ca...
[ "0.57987165", "0.5342328", "0.5306248", "0.52472425", "0.5158554", "0.5020191", "0.50077933", "0.49869242", "0.49236473", "0.48542973", "0.48374295", "0.4832556", "0.48041767", "0.47923857", "0.47444147", "0.4727464", "0.47119942", "0.46731678", "0.46565753", "0.46541268", "0...
0.56010693
1
Retrieves default arguments for future commands. Returns Optional[list[str]] The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raises ExecuteTimeoutError If the time to execute the query exce...
def default_args(self) -> Optional[list[str]]: _args: list[Arg] = [] _ctx = self._select("defaultArgs", _args) return _ctx.execute_sync(Optional[list[str]])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def args(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"args\")", "def args(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"args\")", "def args(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"args\")", "def args(self) -> Optional[Sequence[st...
[ "0.56764024", "0.5603616", "0.5603616", "0.5603616", "0.5603616", "0.5603616", "0.5603616", "0.5603616", "0.5603616", "0.5603616", "0.5603616", "0.5603616", "0.5603616", "0.5603616", "0.5603616", "0.5603616", "0.5603616", "0.5603616", "0.5603616", "0.5603616", "0.5603616", ...
0.7336758
0
Retrieves an endpoint that clients can use to reach this container. If no port is specified, the first exposed port is used. If none exist an error is returned.
def endpoint( self, port: Optional[int] = None, scheme: Optional[str] = None, ) -> str: _args = [ Arg("port", port, None), Arg("scheme", scheme, None), ] _ctx = self._select("endpoint", _args) return _ctx.execute_sync(str)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_endpoint_or_skip_container(name, default_port):\n address = os.environ.get(f\"BASEPLATE_{name.upper()}_ADDR\", f\"{name}:{default_port:d}\")\n endpoint = Endpoint(address)\n\n try:\n sock = socket.socket(endpoint.family, socket.SOCK_STREAM)\n sock.settimeout(0.1)\n sock.connec...
[ "0.73166955", "0.62381595", "0.62227064", "0.61534625", "0.6089813", "0.60133004", "0.60073066", "0.5981336", "0.59137684", "0.58827883", "0.58003837", "0.58003837", "0.5777661", "0.57646894", "0.5760612", "0.5739323", "0.571847", "0.5641241", "0.5641154", "0.5612023", "0.561...
0.6626801
1
Retrieves entrypoint to be prepended to the arguments of all commands. Returns Optional[list[str]] The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raises ExecuteTimeoutError If the time to ...
def entrypoint(self) -> Optional[list[str]]: _args: list[Arg] = [] _ctx = self._select("entrypoint", _args) return _ctx.execute_sync(Optional[list[str]])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_entry_point_command(\n entry_point: Optional[\"EntryPoint\"], parameters: Dict[str, Any]\n) -> List[str]:\n if entry_point is None:\n return []\n return entry_point.compute_command(parameters)", "def get_command_args(self, skip_serialized_namedtuple: bool = False) -> Sequence[str]:\n ...
[ "0.68295944", "0.587499", "0.5640615", "0.5522266", "0.5418016", "0.5418016", "0.5418016", "0.5418016", "0.5418016", "0.5418016", "0.5418016", "0.5418016", "0.5418016", "0.5418016", "0.5418016", "0.5418016", "0.5418016", "0.5418016", "0.5418016", "0.5418016", "0.5418016", "...
0.72848684
0
Retrieves the list of environment variables passed to commands.
def env_variables(self) -> list["EnvVariable"]: _args: list[Arg] = [] _ctx = self._select("envVariables", _args) _ctx = EnvVariable(_ctx)._select_multiple( _name="name", _value="value", ) return _ctx.execute_sync(list[EnvVariable])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_env(self):\n env = {}\n for k, v in os.environ.items():\n k = k.decode() if isinstance(k, bytes) else k\n v = v.decode() if isinstance(v, bytes) else v\n env[k] = v\n return list(env.items())", "def get_env_vars():\n return [EnvVar(name=k, value=v...
[ "0.77872515", "0.7475562", "0.72771245", "0.72536695", "0.71774215", "0.71641856", "0.7119661", "0.7090317", "0.7089184", "0.7074179", "0.6998847", "0.6963431", "0.6893453", "0.6865305", "0.68650657", "0.6800763", "0.6800763", "0.6800763", "0.6800763", "0.6779927", "0.6779383...
0.7865112
0
Exit code of the last executed command. Zero means success. Will execute default command if none is set, or error if there's no default. Returns int The `Int` scalar type represents nonfractional signed whole numeric values. Int can represent values between (2^31) and 2^31 1. Raises ExecuteTimeoutError If the time to e...
def exit_code(self) -> int: _args: list[Arg] = [] _ctx = self._select("exitCode", _args) return _ctx.execute_sync(int)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getReturnCode(self):\n retcode = self.sendCmd(\"echo $?\")\n try:\n return int(retcode)\n except:\n return retcode", "def last_exit_code(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"last_exit_code\")", "def __execute(self, command):\n ...
[ "0.661077", "0.6244861", "0.617972", "0.59373474", "0.58992314", "0.58906657", "0.5867098", "0.5789455", "0.5749894", "0.5728617", "0.57132626", "0.56534255", "0.5593237", "0.5554626", "0.55375284", "0.5503943", "0.550357", "0.54913026", "0.5478894", "0.54733264", "0.5471068"...
0.6546105
1
Writes the container as an OCI tarball to the destination file path on the host for the specified platform variants. Return true on success. It can also publishes platform variants.
def export( self, path: str, platform_variants: Optional[Sequence["Container"]] = None, forced_compression: Optional[ImageLayerCompression] = None, ) -> bool: _args = [ Arg("path", path), Arg("platformVariants", platform_variants, None), Ar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def publish(\n self,\n address: str,\n platform_variants: Optional[Sequence[\"Container\"]] = None,\n forced_compression: Optional[ImageLayerCompression] = None,\n ) -> str:\n _args = [\n Arg(\"address\", address),\n Arg(\"platformVariants\", platform_var...
[ "0.6029206", "0.56742686", "0.5622499", "0.5582614", "0.5501043", "0.54825526", "0.5475316", "0.53787994", "0.5343687", "0.5217443", "0.5180776", "0.5168433", "0.5135707", "0.5117156", "0.5090999", "0.5085916", "0.5071348", "0.5055565", "0.5049126", "0.5027038", "0.50130314",...
0.66773933
0
Retrieves the list of exposed ports. This includes ports already exposed by the image, even if not explicitly added with dagger. Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
def exposed_ports(self) -> list["Port"]: _args: list[Arg] = [] _ctx = self._select("exposedPorts", _args) _ctx = Port(_ctx)._select_multiple( _description="description", _port="port", _protocol="protocol", ) return _ctx.execute_sync(list[Port])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_ports(self):\n return self.ironic_client.port.list()", "def _generate_expose_services(self):\n ports = []\n for p in self.image['ports']:\n if p.get('expose', True):\n\n r = \"{}/{}\".format(p['value'], p.get('protocol', 'tcp'))\n\n if 'servi...
[ "0.7290335", "0.71704257", "0.70985174", "0.70643663", "0.7003876", "0.6869889", "0.678324", "0.6732725", "0.6718274", "0.66717786", "0.6567904", "0.65197104", "0.64818937", "0.647672", "0.6449429", "0.64452434", "0.6435164", "0.6409327", "0.63928276", "0.6359007", "0.6335729...
0.81830645
0
Retrieves a hostname which can be used by clients to reach this container. Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable. Returns str The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freefor...
def hostname(self) -> str: _args: list[Arg] = [] _ctx = self._select("hostname", _args) return _ctx.execute_sync(str)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_hostname(self):\n\n # Display info message\n log.info(\"get_hostname\")\n\n # Get hostname\n output = await self.send_command(self.cmd_get_hostname)\n\n # Display info message\n log.info(f\"get_hostname: output: '{output}'\")\n\n # Remove the useless i...
[ "0.65890795", "0.6536303", "0.6509257", "0.64840835", "0.64606553", "0.64407516", "0.64041823", "0.63942474", "0.6393494", "0.62995166", "0.62910855", "0.6230252", "0.61710745", "0.6169512", "0.6168685", "0.61206555", "0.61118555", "0.61015284", "0.60687673", "0.60682136", "0...
0.72639436
0
The unique image reference which can only be retrieved immediately after the 'Container.From' call. Returns Optional[str] The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raises ExecuteTimeo...
def image_ref(self) -> Optional[str]: _args: list[Arg] = [] _ctx = self._select("imageRef", _args) return _ctx.execute_sync(Optional[str])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def image_reference(self) -> Optional[pulumi.Input['ImageDiskReferenceArgs']]:\n return pulumi.get(self, \"image_reference\")", "def image_reference(self, image_id):\n return \"\"", "def image_reference(self, image_id):\n return \"\"", "def image(self) -> Optional[str]:\n return p...
[ "0.6311492", "0.61091244", "0.61091244", "0.5940552", "0.5940552", "0.5940552", "0.5940552", "0.5940552", "0.5940552", "0.5940552", "0.5940552", "0.5940552", "0.5940552", "0.5940552", "0.5940552", "0.5940552", "0.5940552", "0.5940552", "0.5940552", "0.5940552", "0.5940552", ...
0.71772134
0
The platform this container executes and publishes as. Returns Platform The platform config OS and architecture in a Container. The format is [os]/[platform]/[version] (e.g., "darwin/arm64/v7", "windows/amd64", "linux/arm64"). Raises ExecuteTimeoutError If the time to execute the query exceeds the configured timeout. Q...
def platform(self) -> Platform: _args: list[Arg] = [] _ctx = self._select("platform", _args) return _ctx.execute_sync(Platform)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def platform(self, return_str=True):\n architecture = self.arch(\"docker\")\n host_platform = self.osversion() + \"/\" + architecture\n if return_str:\n return host_platform.lower()\n return self.parse_platform(host_platform)", "def platform(self) -> pulumi.Output[str]:\n ...
[ "0.70846224", "0.6969208", "0.69408244", "0.68314826", "0.67310053", "0.67069256", "0.6661841", "0.6630605", "0.6626512", "0.6568049", "0.65129524", "0.633002", "0.6327338", "0.6287377", "0.6273267", "0.6258723", "0.62487274", "0.6242203", "0.62166417", "0.62071663", "0.61486...
0.7800112
0
Publishes this container as a new image to the specified address. Publish returns a fully qualified ref. It can also publish platform variants.
def publish( self, address: str, platform_variants: Optional[Sequence["Container"]] = None, forced_compression: Optional[ImageLayerCompression] = None, ) -> str: _args = [ Arg("address", address), Arg("platformVariants", platform_variants, None), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def containerPublish(*args, bindNode: Union[List[AnyStr, AnyStr], bool]=None,\n bindTemplateStandins: bool=True, inConnections: bool=True, mergeShared:\n bool=True, outConnections: bool=True, publishNode: Union[List[AnyStr,\n AnyStr], bool]=None, unbindNo...
[ "0.6071595", "0.58889526", "0.5887912", "0.5844141", "0.56376755", "0.548788", "0.54441303", "0.5413677", "0.53569496", "0.5346531", "0.5330654", "0.52980494", "0.5290649", "0.5234556", "0.5232838", "0.5224487", "0.51891476", "0.5136988", "0.5127736", "0.5121484", "0.5119073"...
0.7129047
0
The error stream of the last executed command. Will execute default command if none is set, or error if there's no default. Returns str The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raise...
def stderr(self) -> str: _args: list[Arg] = [] _ctx = self._select("stderr", _args) return _ctx.execute_sync(str)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_error(self) -> Union[None, str, Exception]:\n return self._last_error", "def query_error(self):\n return self.details[KEY_QUERY_ERROR]", "def error_string(self):\n return self._error_string", "def _exec_command(\n self, command: Query, result_format: Format = Format.T...
[ "0.57899815", "0.5635957", "0.5538887", "0.53330994", "0.5299692", "0.52904576", "0.52213323", "0.5175396", "0.51694536", "0.5141167", "0.5141167", "0.5128675", "0.51236165", "0.51230663", "0.51167965", "0.511041", "0.511041", "0.51048505", "0.50990826", "0.50644976", "0.5049...
0.59089535
0
The output stream of the last executed command. Will execute default command if none is set, or error if there's no default. Returns str The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Rais...
def stdout(self) -> str: _args: list[Arg] = [] _ctx = self._select("stdout", _args) return _ctx.execute_sync(str)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_output(self):\n return self.cmd_output", "def run_with_output(self, cmd, end_strs=None, timeout=301, timeout_exception=True, api_call='write'):\n if api_call == 'write':\n self.write(cmd)\n out = ''\n else:\n out = self.runsingle(cmd)\n time.sl...
[ "0.59121895", "0.5779762", "0.57568353", "0.5748872", "0.5742346", "0.5736297", "0.57351315", "0.57116777", "0.5645583", "0.56395644", "0.56390417", "0.5611494", "0.553556", "0.5531238", "0.5501879", "0.5501879", "0.5427504", "0.5413421", "0.5404905", "0.5402934", "0.5389019"...
0.60270125
0
Retrieves the user to be set for all commands. Returns Optional[str] The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raises ExecuteTimeoutError If the time to execute the query exceeds the ...
def user(self) -> Optional[str]: _args: list[Arg] = [] _ctx = self._select("user", _args) return _ctx.execute_sync(Optional[str])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"user\")", "def user(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"user\")", "def user(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"user\")", "def user(self) -> pulumi.Outpu...
[ "0.6597173", "0.6597173", "0.6597173", "0.6545454", "0.64421016", "0.61470056", "0.59617865", "0.5879404", "0.5860199", "0.58245295", "0.5813345", "0.5813345", "0.58041745", "0.57512134", "0.57512134", "0.57512134", "0.57512134", "0.57512134", "0.57512134", "0.57512134", "0.5...
0.71875596
0
Retrieves this container but with a different command entrypoint.
def with_entrypoint(self, args: Sequence[str]) -> "Container": _args = [ Arg("args", args), ] _ctx = self._select("withEntrypoint", _args) return Container(_ctx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_entry_point(self, command: List[str]) -> \"EntryPoint\":\n entry_point = command[-1]\n new_entrypoint = EntryPoint(name=entry_point, command=command)\n self._entry_points[entry_point] = new_entrypoint\n return new_entrypoint", "def run(self, name, image, entrypoint, command):\...
[ "0.60759336", "0.5956756", "0.5911119", "0.58957165", "0.5809991", "0.55502254", "0.5546576", "0.5393044", "0.5376637", "0.5370964", "0.5341112", "0.53294563", "0.53131324", "0.53126734", "0.5310719", "0.52896684", "0.5283408", "0.52825946", "0.5259374", "0.5238372", "0.52380...
0.61889195
0
Expose a network port.
def with_exposed_port( self, port: int, protocol: Optional[NetworkProtocol] = None, description: Optional[str] = None, ) -> "Container": _args = [ Arg("port", port), Arg("protocol", protocol, None), Arg("description", description, None), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_port(cls, port, ser):\n cls._open_ports[port] = ser", "def bind(self, server_name: str, port: int) -> None:\n self.socket.bind((server_name, port))", "def port_connection(self, sock):\n sock.bind(('', 0)) # Bind to OS-assigned available & random port.\n sock.listen(1)", "...
[ "0.66923445", "0.65591955", "0.6496808", "0.6475775", "0.64325863", "0.63918716", "0.6389857", "0.63874406", "0.632225", "0.6314577", "0.62554437", "0.62454295", "0.6243628", "0.62079304", "0.6202866", "0.61900324", "0.61900324", "0.61900324", "0.61756516", "0.60956895", "0.6...
0.7106715
0
Retrieves this container plus the given label.
def with_label(self, name: str, value: str) -> "Container": _args = [ Arg("name", name), Arg("value", value), ] _ctx = self._select("withLabel", _args) return Container(_ctx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_label(self, label):\n status = self.ocp.add_label(resource_name=self.name, label=label)\n self.reload()\n return status", "def get_item_from_label(self, label):\n idx = self.labels.index(label)\n item = self[idx][0]\n return item", "def findLabel(self, label):\...
[ "0.66666883", "0.6150396", "0.58382374", "0.58368975", "0.5790207", "0.5782417", "0.56678164", "0.55893457", "0.5575059", "0.5557801", "0.5555703", "0.55418944", "0.55314136", "0.54798627", "0.547968", "0.547968", "0.547968", "0.547968", "0.5462796", "0.54448795", "0.5437708"...
0.654222
1
Retrieves this container plus a cache volume mounted at the given path.
def with_mounted_cache( self, path: str, cache: CacheVolume, source: Optional["Directory"] = None, sharing: Optional[CacheSharingMode] = None, owner: Optional[str] = None, ) -> "Container": _args = [ Arg("path", path), Arg("cache", cach...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cache_volume(self, key: str) -> CacheVolume:\n _args = [\n Arg(\"key\", key),\n ]\n _ctx = self._select(\"cacheVolume\", _args)\n return CacheVolume(_ctx)", "def path_to_volume(path):\n gFile = gio.File(path)\n try:\n mount = gFile.find_enclosing_mount()\n ...
[ "0.6730194", "0.64186776", "0.63821095", "0.63274246", "0.6193393", "0.60386485", "0.598818", "0.58878624", "0.58876306", "0.5815014", "0.5815014", "0.5749026", "0.5749026", "0.5705876", "0.5607839", "0.55734485", "0.55580467", "0.5552625", "0.55402076", "0.55402076", "0.5532...
0.7039625
0
Retrieves this container plus a temporary directory mounted at the given path.
def with_mounted_temp(self, path: str) -> "Container": _args = [ Arg("path", path), ] _ctx = self._select("withMountedTemp", _args) return Container(_ctx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_temporary_directory(path, ticket_id):\n return os.path.join(path, \"tmp\", ticket_id)", "def temp_dir() -> pathlib.Path:\n with tempfile.TemporaryDirectory(prefix=\"phd_\") as d:\n yield pathlib.Path(d)", "def tempdir():\n\n # Create a directory and return the path\n return tempfile.mkdtem...
[ "0.71030384", "0.65261793", "0.6412805", "0.6262189", "0.62295675", "0.6101249", "0.60668796", "0.6024729", "0.60200214", "0.5938895", "0.59332836", "0.5918487", "0.5891831", "0.58897907", "0.58834124", "0.58826363", "0.5872993", "0.5869437", "0.5863385", "0.58554363", "0.584...
0.7858667
0
Retrieves this container with a registry authentication for a given address.
def with_registry_auth( self, address: str, username: str, secret: "Secret", ) -> "Container": _args = [ Arg("address", address), Arg("username", username), Arg("secret", secret), ] _ctx = self._select("withRegistryAuth", _a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def without_registry_auth(self, address: str) -> \"Container\":\n _args = [\n Arg(\"address\", address),\n ]\n _ctx = self._select(\"withoutRegistryAuth\", _args)\n return Container(_ctx)", "def get(registry_url, path, **kwargs):\n url = registry_url + path\n response...
[ "0.685472", "0.66105175", "0.618927", "0.55614597", "0.5331449", "0.5320977", "0.5313164", "0.5304197", "0.5217885", "0.5211317", "0.51396", "0.51104254", "0.50566685", "0.5039284", "0.5030337", "0.5019028", "0.5014353", "0.50133103", "0.50092095", "0.49611825", "0.4960799", ...
0.7509884
0
Establish a runtime dependency on a service. The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set. The service will be reachable from the container via the provided hostname alias. The service dependency will also convey to any file...
def with_service_binding(self, alias: str, service: "Container") -> "Container": _args = [ Arg("alias", alias), Arg("service", service), ] _ctx = self._select("withServiceBinding", _args) return Container(_ctx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_service(self):\n logger = logging.getLogger(self.dkr_name)\n logger.info(\"Starting up service\")\n\n self.start_swarm()\n\n container_spec = docker.types.ContainerSpec(\n image=self.dkr_image,\n command=self.dkr_command,\n env=self.dkr_env\n ...
[ "0.55759305", "0.5257035", "0.516274", "0.512402", "0.50037384", "0.49986044", "0.4938968", "0.49232635", "0.47966775", "0.4777579", "0.47763166", "0.47693482", "0.4744823", "0.47436297", "0.47421214", "0.4726757", "0.46799383", "0.46350315", "0.46146035", "0.45891768", "0.45...
0.5605494
0
Retrieves this container plus a socket forwarded to the given Unix socket path.
def with_unix_socket( self, path: str, source: "Socket", owner: Optional[str] = None, ) -> "Container": _args = [ Arg("path", path), Arg("source", source), Arg("owner", owner, None), ] _ctx = self._select("withUnixSocket", _...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unix_socket(self, path: str) -> \"Socket\":\n _args = [\n Arg(\"path\", path),\n ]\n _ctx = self._select(\"unixSocket\", _args)\n return Socket(_ctx)", "def bind_unix_socket(file, mode=..., backlog=...):\n ...", "def without_unix_socket(self, path: str) -> \"Co...
[ "0.67328614", "0.60601455", "0.60442674", "0.60084957", "0.59770525", "0.59033674", "0.58619446", "0.58338773", "0.58223087", "0.57963634", "0.5675042", "0.56602", "0.56405914", "0.56060946", "0.5581335", "0.5559968", "0.55388147", "0.55087256", "0.5482889", "0.5473268", "0.5...
0.6844628
0
Retrieves this container minus the given environment variable.
def without_env_variable(self, name: str) -> "Container": _args = [ Arg("name", name), ] _ctx = self._select("withoutEnvVariable", _args) return Container(_ctx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_from_environment_variable(self, key, value):\n script = (\"$env:{k} = python -c \\\"\"\n \"print(';'.join(r'$env:{k}'.split(';')\"\n \"[:r'$env:{k}'.split(r';').index(r'{v}')] + \"\n \"r'$env:{k}'.split(';')\"\n \"[r'$env:{k}'.sp...
[ "0.6187502", "0.6147677", "0.61089355", "0.5924833", "0.5829221", "0.58124024", "0.5808938", "0.5773669", "0.5763803", "0.5536033", "0.5509093", "0.5351322", "0.52843183", "0.52778834", "0.5248313", "0.52437717", "0.5226726", "0.5221504", "0.5113048", "0.510904", "0.5071103",...
0.7213592
0
Unexpose a previously exposed port. Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
def without_exposed_port( self, port: int, protocol: Optional[NetworkProtocol] = None, ) -> "Container": _args = [ Arg("port", port), Arg("protocol", protocol, None), ] _ctx = self._select("withoutExposedPort", _args) return Container(_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def port_revert(switch, port):\n print client.port.port_revert(switch, port)", "def one_stack_port_down(self, dpid, dp_name, port):\n self.set_port_down(port, dpid, wait=False)\n self.wait_for_stack_port_status(dpid, dp_name, port, 4)", "def port_delete(switch, port):\n client.port.delete(s...
[ "0.647072", "0.6301258", "0.62937236", "0.62779564", "0.6220938", "0.6220405", "0.61736184", "0.6054928", "0.6020121", "0.601264", "0.5946094", "0.59381515", "0.59220266", "0.5891987", "0.587368", "0.58388424", "0.5808494", "0.5686151", "0.56752044", "0.5654729", "0.56049335"...
0.69589925
0
Retrieves this container minus the given environment label.
def without_label(self, name: str) -> "Container": _args = [ Arg("name", name), ] _ctx = self._select("withoutLabel", _args) return Container(_ctx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def without_env_variable(self, name: str) -> \"Container\":\n _args = [\n Arg(\"name\", name),\n ]\n _ctx = self._select(\"withoutEnvVariable\", _args)\n return Container(_ctx)", "def remove(self, label):\n\n\t\t\tself[label].remove()", "def remove_label(self, ):\n ...
[ "0.66496897", "0.5330764", "0.52882224", "0.5199348", "0.5165779", "0.50942105", "0.5088663", "0.5078351", "0.506204", "0.492045", "0.49178204", "0.49132752", "0.48770043", "0.48520106", "0.48393875", "0.4828513", "0.48234567", "0.47625855", "0.4745561", "0.47413865", "0.4724...
0.5749923
1
Retrieves this container after unmounting everything at the given path.
def without_mount(self, path: str) -> "Container": _args = [ Arg("path", path), ] _ctx = self._select("withoutMount", _args) return Container(_ctx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def with_mounted_temp(self, path: str) -> \"Container\":\n _args = [\n Arg(\"path\", path),\n ]\n _ctx = self._select(\"withMountedTemp\", _args)\n return Container(_ctx)", "def unmount(self, path=None, vm=None):\n os.system(f\"multipass unmount {vm}:{path}\")\n ...
[ "0.61931574", "0.60537726", "0.59759253", "0.5947723", "0.5853872", "0.5806124", "0.56645614", "0.5662928", "0.5547702", "0.5460679", "0.5327215", "0.5304362", "0.52935225", "0.5282473", "0.52442884", "0.52279145", "0.5225849", "0.5220709", "0.52165663", "0.5211946", "0.52053...
0.634811
0
Retrieves this container without the registry authentication of a given address.
def without_registry_auth(self, address: str) -> "Container": _args = [ Arg("address", address), ] _ctx = self._select("withoutRegistryAuth", _args) return Container(_ctx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_(self, address: str) -> \"Container\":\n _args = [\n Arg(\"address\", address),\n ]\n _ctx = self._select(\"from\", _args)\n return Container(_ctx)", "def proxy(self):\n result = self.instances(role='stateless-body', format=\"PrivateIpAddress\")\n ret...
[ "0.53610635", "0.5173082", "0.512947", "0.51140475", "0.5034747", "0.4980978", "0.49508032", "0.48956907", "0.4883904", "0.48732132", "0.48445934", "0.48017314", "0.47593758", "0.47366023", "0.46921074", "0.46746632", "0.46695486", "0.46374497", "0.46240345", "0.46238682", "0...
0.84330237
0
Retrieves this container with a previously added Unix socket removed.
def without_unix_socket(self, path: str) -> "Container": _args = [ Arg("path", path), ] _ctx = self._select("withoutUnixSocket", _args) return Container(_ctx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_socket(self, socket_rem):\n clients_to_pop = []\n # Iterate through the dictionary to find the client to pop. Can't pop the clien during the\n # iteration because the dictionary size will change and you will get the error:\n # RuntimeError: dictionary changed size during iter...
[ "0.5960474", "0.56718284", "0.56718284", "0.5627796", "0.5411516", "0.5353142", "0.53088796", "0.52230084", "0.52075905", "0.51570874", "0.5145966", "0.51450855", "0.5120872", "0.5110545", "0.50771874", "0.50523", "0.5047439", "0.49098563", "0.49065587", "0.48774353", "0.4838...
0.7181311
0
Retrieves the working directory for all commands. Returns Optional[str] The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raises ExecuteTimeoutError If the time to execute the query exceeds t...
def workdir(self) -> Optional[str]: _args: list[Arg] = [] _ctx = self._select("workdir", _args) return _ctx.execute_sync(Optional[str])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def working_dir(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"working_dir\")", "def cmdpath(self):\n return os.system('pwd')", "def cwd(self):\n if self.dryrun:\n return self._cwd\n else:\n return os.getcwd()", "def curdir(self):\n ...
[ "0.60573536", "0.59763354", "0.56226087", "0.56080365", "0.5544885", "0.55039334", "0.54795533", "0.5412548", "0.5376586", "0.53599834", "0.5354115", "0.534972", "0.53282166", "0.5319643", "0.5162174", "0.51597095", "0.515629", "0.5123181", "0.5092707", "0.5088866", "0.508864...
0.6248791
0
Gets the difference between this directory and an another directory.
def diff(self, other: "Directory") -> "Directory": _args = [ Arg("other", other), ] _ctx = self._select("diff", _args) return Directory(_ctx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def diff(self, other, match=lambda x: True, clean=False):\n result = {}\n\n def _iterativediff(t1, t2, subdir):\n \"\"\"compares two trees and appends new tree nodes to examine to\n the stack\"\"\"\n if t1 is None:\n t1 = {}\n if t2 is None:\...
[ "0.6350181", "0.6139689", "0.6104081", "0.60472983", "0.60097706", "0.5984666", "0.59691703", "0.5944452", "0.5944452", "0.59143704", "0.5870534", "0.5806133", "0.5756973", "0.5749702", "0.5747358", "0.5722832", "0.56907374", "0.56683815", "0.566699", "0.5649999", "0.56157154...
0.78703004
0
Retrieves this directory with all file/dir timestamps set to the given time.
def with_timestamps(self, timestamp: int) -> "Directory": _args = [ Arg("timestamp", timestamp), ] _ctx = self._select("withTimestamps", _args) return Directory(_ctx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_dir_mtime(self, sentry_unit, directory):\n return sentry_unit.directory_stat(directory)['mtime']", "def _get_files_timestamps(self, working_dir: Union[str, os.PathLike]):\n return {f: os.path.getmtime(os.path.join(working_dir, f)) for f in os.listdir(working_dir)}", "def create_directory...
[ "0.5944859", "0.57281244", "0.5668311", "0.55792975", "0.5516939", "0.5516939", "0.5371681", "0.53190684", "0.5315945", "0.522039", "0.5217049", "0.516873", "0.5140081", "0.5135091", "0.5129656", "0.5090161", "0.5077531", "0.5072731", "0.5069818", "0.5050652", "0.50408274", ...
0.65106505
0
Retrieves this directory with the directory at the given path removed.
def without_directory(self, path: str) -> "Directory": _args = [ Arg("path", path), ] _ctx = self._select("withoutDirectory", _args) return Directory(_ctx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rmdir(self, path: PathLike):", "def rmdir ( self, dirpath ):\n return", "def remove(path):\n if os.path.isdir(path):\n return __rmtree(path)\n else:\n return __rmfile(path)", "def rmdir(path):", "def removePath(self, path):\n self.pushMode(CLI_MODES.shell)\n outpu...
[ "0.72219676", "0.6939042", "0.6937969", "0.6912051", "0.68590677", "0.6830431", "0.6779768", "0.6702879", "0.66984344", "0.6663422", "0.6625391", "0.66150105", "0.6582777", "0.65217894", "0.6455944", "0.6397481", "0.6378798", "0.637422", "0.6332312", "0.63224095", "0.63166636...
0.708661
1
Retrieves the contents of the file. Returns str The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raises ExecuteTimeoutError If the time to execute the query exceeds the configured timeout. Q...
def contents(self) -> str: _args: list[Arg] = [] _ctx = self._select("contents", _args) return _ctx.execute_sync(str)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data_query(file_name):\n with open(file_name, 'r') as graphql_query:\n return graphql_query.read()", "def get_file_contents(self):\n with open(self.sql_file, 'r') as sql:\n text = sql.read()\n # text = text.replace('\\n', '\\n\\n')\n # text=sql.read()\n ...
[ "0.682788", "0.6191036", "0.61833054", "0.61099416", "0.59686124", "0.59530157", "0.59296596", "0.5926999", "0.5892585", "0.5859091", "0.5850787", "0.5782271", "0.5764316", "0.57609355", "0.57484555", "0.5742182", "0.57371527", "0.5735962", "0.5732126", "0.57274616", "0.57269...
0.63536906
1
Retrieves the contentaddressed identifier of the file. Note This is lazyly evaluated, no operation is actually run. Returns FileID A file identifier. Raises ExecuteTimeoutError If the time to execute the query exceeds the configured timeout. QueryError If the API returns an error.
def id(self) -> FileID: _args: list[Arg] = [] _ctx = self._select("id", _args) return _ctx.execute_sync(FileID)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _GetQueryId(filename: str) -> Optional[str]:\n match = re.match(r'(.*/)?q?([0-9]+[ab]?)\\.sql$', filename)\n if match:\n return match.group(2)", "def fileid(self):\n if self._fileid is None:\n rv = M.mexec('''set s1=$order(^DIC(\"B\",s0,0))''', str(self.filename[:30]), M.INOUT(\"\"))[0...
[ "0.59737355", "0.59559", "0.5955616", "0.59159434", "0.58598596", "0.5725182", "0.5597816", "0.5589871", "0.53040427", "0.5294746", "0.52708584", "0.52268076", "0.52257645", "0.5208095", "0.5204498", "0.51856655", "0.51718295", "0.51641196", "0.51525253", "0.51390356", "0.511...
0.66975915
0
Retrieves this file with its created/modified timestamps set to the given time.
def with_timestamps(self, timestamp: int) -> "File": _args = [ Arg("timestamp", timestamp), ] _ctx = self._select("withTimestamps", _args) return File(_ctx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, filename, from_time, to_time):\n raise NotImplementedError()", "def get_modified_time(self, name):\n raise NotImplementedError(\n \"subclasses of Storage must provide a get_modified_time() method\"\n )", "def get_modified_time(self, name):\n full_path = self...
[ "0.6454139", "0.62742496", "0.62163246", "0.61951196", "0.61951196", "0.6194118", "0.60753185", "0.6075241", "0.60568047", "0.6032788", "0.6022494", "0.6020687", "0.6020003", "0.6012793", "0.6004798", "0.5991593", "0.5987447", "0.59832364", "0.59284383", "0.5905297", "0.58956...
0.62903184
1
The digest of the current value of this ref. Returns str The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raises ExecuteTimeoutError If the time to execute the query exceeds the configured t...
def digest(self) -> str: _args: list[Arg] = [] _ctx = self._select("digest", _args) return _ctx.execute_sync(str)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def digest(self):\n return digest_tools.sha256_digest(self._payload.as_encoded_str())", "def digest(self):\n return self._parsed[\"digest\"]", "def digest(self):\n return self._hash", "def digest(self) -> Digest:\n return self.exe.digest", "def digest(self):\n # For discu...
[ "0.64590335", "0.6398314", "0.6286555", "0.6202799", "0.6150979", "0.60885227", "0.5990911", "0.5990911", "0.5990911", "0.58576226", "0.5778247", "0.5734453", "0.569523", "0.5656173", "0.5640345", "0.5640345", "0.5640345", "0.56269914", "0.56269914", "0.5574731", "0.55517536"...
0.72669244
0
Lists of branches on the repository. Returns list[str] The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raises ExecuteTimeoutError If the time to execute the query exceeds the configured tim...
def branches(self) -> list[str]: _args: list[Arg] = [] _ctx = self._select("branches", _args) return _ctx.execute_sync(list[str])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_branches(self) -> List[str]:\n self.__verify_repo_initialized()\n branches = heads.get_branch_names(self._env.branchenv)\n return branches", "def get_branches(self):\n\n # gets all branches in repository\n branches_endpoint = f'/repos/{self.repo}/branches'\n res...
[ "0.7739679", "0.7698265", "0.7677733", "0.7266715", "0.72543824", "0.72295564", "0.697496", "0.6938022", "0.6936254", "0.6627038", "0.6487021", "0.64603627", "0.642129", "0.6417452", "0.63434076", "0.63207203", "0.6317349", "0.6213451", "0.61583495", "0.61436373", "0.6117109"...
0.8267907
0