query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Test ddb_to_event() with an INSERT record
def test_ddb_to_event_insert(): event_bus_name = "EVENT_BUS_NAME" source = "SOURCE" object_type = "Object" resource_key = "pk" record = { "awsRegion": "eu-west-1", "dynamodb": { "Keys": { "pk": {"N": "123"}, "sk": {"N": "456"} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_from_event_to_db_event() -> None:\n event = ha.Event(\n \"test_event\",\n {\"some_data\": 15},\n context=ha.Context(\n id=\"01EYQZJXZ5Z1Z1Z1Z1Z1Z1Z1Z1\",\n parent_id=\"01EYQZJXZ5Z1Z1Z1Z1Z1Z1Z1Z1\",\n user_id=\"12345678901234567890123456789012\",\n ...
[ "0.73484033", "0.68041223", "0.66886854", "0.6654554", "0.6365632", "0.6301395", "0.6172305", "0.6163462", "0.6074641", "0.6055097", "0.60474735", "0.6015944", "0.59741724", "0.5955494", "0.5915443", "0.5887545", "0.5862907", "0.58535135", "0.5838897", "0.5831508", "0.5827911...
0.7132411
1
Test ddb_to_event() with a REMOVE record
def test_ddb_to_event_remove(): event_bus_name = "EVENT_BUS_NAME" source = "SOURCE" object_type = "Object" resource_key = "pk" record = { "awsRegion": "eu-west-1", "dynamodb": { "Keys": { "pk": {"N": "123"}, "sk": {"N": "456"} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_from_event_to_delete_state() -> None:\n event = ha.Event(\n EVENT_STATE_CHANGED,\n {\n \"entity_id\": \"sensor.temperature\",\n \"old_state\": ha.State(\"sensor.temperature\", \"18\"),\n \"new_state\": None,\n },\n )\n db_state = States.from_e...
[ "0.63401204", "0.6329405", "0.6304225", "0.6297117", "0.6277293", "0.6252603", "0.6252603", "0.6182357", "0.6118735", "0.61179656", "0.5993098", "0.5991805", "0.59414893", "0.5878588", "0.5875611", "0.5875275", "0.5872615", "0.5867778", "0.5855224", "0.5847501", "0.5842894", ...
0.7548981
0
Test ddb_to_event() with a MODIFY record
def test_ddb_to_event_modify(): event_bus_name = "EVENT_BUS_NAME" source = "SOURCE" object_type = "Object" resource_key = "pk" record = { "awsRegion": "eu-west-1", "dynamodb": { "Keys": { "pk": {"N": "123"}, "sk": {"N": "456"} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_from_event_to_db_event() -> None:\n event = ha.Event(\n \"test_event\",\n {\"some_data\": 15},\n context=ha.Context(\n id=\"01EYQZJXZ5Z1Z1Z1Z1Z1Z1Z1Z1\",\n parent_id=\"01EYQZJXZ5Z1Z1Z1Z1Z1Z1Z1Z1\",\n user_id=\"12345678901234567890123456789012\",\n ...
[ "0.6913554", "0.6761107", "0.5959503", "0.58527106", "0.5841877", "0.58048624", "0.5751159", "0.56807643", "0.5669538", "0.565105", "0.5611269", "0.5603286", "0.5563104", "0.5541145", "0.55258465", "0.541534", "0.53720075", "0.5358723", "0.51953185", "0.51928216", "0.5174867"...
0.67751825
1
Test response() with a string as input
def test_response_string(): msg = "This is a test" retval = apigateway.response(msg) assert retval["body"] == json.dumps({"message": msg}) assert retval["statusCode"] == 200
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_response(response):\n if isinstance(response, str):\n return response\n else:\n return response.decode('utf-8')", "def test_string(self):\n endpoint = self.api.string\n assert endpoint.openapi_types['body'] == (str,)\n assert endpoint.settings['response_type'] ...
[ "0.6933088", "0.6670791", "0.6654123", "0.6631695", "0.66160566", "0.66118294", "0.659309", "0.6571372", "0.6556054", "0.6555131", "0.6497888", "0.64704853", "0.6439642", "0.638378", "0.6380912", "0.6351198", "0.6349144", "0.6322031", "0.6313695", "0.6306331", "0.62993747", ...
0.76170474
0
Test response() with a dict as input
def test_response_dict(): obj = {"key": "value"} retval = apigateway.response(obj) assert retval["body"] == json.dumps(obj) assert retval["statusCode"] == 200
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_input_dict(self):\n self.app.app.preprocess_request()\n\n input_dict = {'foo': 'bar'}\n\n resp = self.r(input_dict)\n\n self.assertIsInstance(\n resp, werkzeug.wrappers.Response\n )\n\n self.assertIn(\n 'foo:bar',\n resp.data.decod...
[ "0.74380875", "0.71008784", "0.6946105", "0.6849548", "0.66644555", "0.65498877", "0.6454671", "0.64409614", "0.6412768", "0.6390256", "0.6386494", "0.6356352", "0.6346852", "0.6316418", "0.63099927", "0.63099647", "0.62503165", "0.62399", "0.62230015", "0.621626", "0.6202132...
0.8119282
0
parses numPr content and extracts properties for paragraph for given numId and list level changes old_paragraph properties according to list properties changes run_properties adding text of numeration and it's properties
def parse(self, xml: BeautifulSoup, paragraph_properties: BaseProperties, run_properties: BaseProperties): if not xml: return ilvl, num_id = xml.ilvl, xml.numId if not num_id or num_id['w:val'] not in self.num_list: return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, number, title, paragraphs):\n self.number = number\n self.title = title\n self.paragraphs = []\n for paragraph_lines in paragraphs:\n new_pragraph = Paragraph.Paragraph(paragraph_lines)\n self.paragraphs.append(new_pragraph)", "def extract_para...
[ "0.5818638", "0.5802037", "0.57291275", "0.54282105", "0.5409849", "0.53206277", "0.5272299", "0.5258193", "0.5240247", "0.523543", "0.51349574", "0.5106097", "0.5090215", "0.505445", "0.5051656", "0.50428766", "0.5042719", "0.50214833", "0.5014173", "0.49937376", "0.49612364...
0.68393725
0
To Reset noise process to mean
def reset(self): self.noise.reset()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_noise(self):\n self.advantage_hidden_layer.reset_noise()\n self.advantage_layer.reset_noise()\n self.value_hidden_layer.reset_noise()\n self.value_layer.reset_noise()", "def reset_noise(self):\n try:\n self.head.reset_noise()\n except:\n p...
[ "0.7627231", "0.72575414", "0.7172777", "0.7105229", "0.6860863", "0.675273", "0.6733497", "0.6733497", "0.6714297", "0.66466874", "0.65141535", "0.64699894", "0.64560544", "0.6412064", "0.6378272", "0.63774854", "0.63699895", "0.6323135", "0.63093656", "0.6309275", "0.630807...
0.80328214
0
Plot histograms of SNP missingness for samples and SNPs. Input files should be generated by report.missingness() function.
def missingness_hist(missfile: str="plink"): imiss_file = missfile+".imiss" lmiss_file = missfile+".lmiss" imiss = pd.read_csv(imiss_file, delimiter=" ", skipinitialspace=True) lmiss = pd.read_csv(lmiss_file, delimiter=" ", skipinitialspace=True) fig, ax = plt.subplots(1,2, figsize=(16,6), sharex=T...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_hist_snfit_sncosmo(self):\n \n self.read_sncosmo(path='../sugar_analysis_data/results/res_salt2_SNF_'+str(self.width)+'.txt')\n self.read_snfit_results(snfit_res_path='../sugar_analysis_data/results/results_snfit_'+str(self.width)+'.txt')\n\n# self.read_sncosmo(path='../sugar_a...
[ "0.61413324", "0.6069336", "0.595717", "0.5934197", "0.59160805", "0.5889956", "0.5793941", "0.5725874", "0.5723579", "0.5683253", "0.5576507", "0.5548451", "0.55395395", "0.55188894", "0.54880816", "0.54876125", "0.54811525", "0.54531837", "0.54392886", "0.5425105", "0.54187...
0.7315661
0
Plot histograms of inbreeding coefficents for reported females/males. Input files should be generated by qc_report.check_sex().
def check_sex_hist(sexcheckfile: str="plink.sexcheck"): sexcheck = pd.read_csv(sexcheckfile, delimiter=" ", skipinitialspace=True) females = sexcheck.loc[sexcheck['PEDSEX'] == 2] males = sexcheck.loc[sexcheck['PEDSEX'] == 1] fig, ax = plt.subplots(1, 2, figsize=(16,6)) females.hist(column='F', ax=a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def analyseHill(ekindicts):\n\n import pylab\n pylab.rc('text', usetex=True)\n f=pylab.figure()\n f.suptitle('n distributions- No linear (case 3)')\n i=1\n for e in ekindicts:\n ekindata = ekindicts[e]\n proteins = ekindata.keys()\n nvals = []\n for prot in proteins:\n...
[ "0.6073794", "0.6001209", "0.59191334", "0.59092075", "0.5905101", "0.58910686", "0.57739305", "0.57325065", "0.5705722", "0.5701544", "0.56927866", "0.5668172", "0.5649899", "0.564805", "0.5645861", "0.5638266", "0.56157094", "0.5593486", "0.5586277", "0.5586", "0.558205", ...
0.7371283
0
Plot histograms of minor allele frequency (MAF) distributions for SNPs for specific frequency thresholds. The input file should be generated by the "maf_check_report()" function specified below.
def maf_dropped_hist(maffile: str="MAF_check.frq", threshold: float=0.05): maf = pd.read_csv(maffile, delimiter=" ", skipinitialspace=True) rare = maf.loc[maf['MAF'] < threshold] fig, ax = plt.subplots(1, 2, figsize=(16,6)) maf.hist(column='MAF', ax=ax[0]) ax[0].axvline(threshold, c='r', linestyle...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maf_hist(maffile: str=\"MAF_check.frq\"):\n maf = pd.read_csv(maffile, delimiter=\" \", skipinitialspace=True)\n fig = plt.figure(figsize=(8,6))\n plt.hist(maf['MAF'])\n plt.title(\"MAF Distribution\")\n plt.xlabel(\"MAF\")\n plt.ylabel(\"Number of SNPs\")\n return fig", "def main(inp_f,...
[ "0.7364104", "0.5894753", "0.5875593", "0.5856267", "0.5706544", "0.56963176", "0.5653498", "0.5592697", "0.55872905", "0.5555093", "0.5492908", "0.54548544", "0.543587", "0.54015934", "0.53663415", "0.53403544", "0.53359735", "0.53014374", "0.5294658", "0.52941793", "0.52928...
0.6844085
1
Plot histograms of hardyweinberg equilibrium (HWE) test pvalue distributions for SNPs. The input file should be generated by the qc_report.hardy_weinberg.
def hwe_hist(hwefile: str="plink.hwe", threshold: float=1e-6): hardy = pd.read_csv(hwefile, delimiter=" ", skipinitialspace=True) zoomhwe = hardy[hardy['P'] < threshold] fig, ax = plt.subplots(1, 2, figsize=(16,6)) plt.title("HWE Test") hardy.hist(column='P', ax=ax[0]) ax[0].axvline(threshold,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fwhmwhisker_multiext(filename,sigma,band,zenith):\n hdu=pf.open(filename)\n e1=[]\n e2=[]\n fwhmw=[]\n whiskerw=[]\n for hdui in hdu[1:]:\n Nobj = hdui.data.shape[0]\n for i in range(Nobj):\n print i\n img = hdui.data[i][4:].reshape(160,160)\n im...
[ "0.6204504", "0.6038797", "0.5808544", "0.5783616", "0.5723117", "0.5722789", "0.5721432", "0.568371", "0.566392", "0.56567353", "0.5631657", "0.56185776", "0.56057674", "0.55654615", "0.5549365", "0.5537009", "0.55303097", "0.5523255", "0.55221164", "0.55059963", "0.54918474...
0.71606237
0
Plot histogram of heterozygosity rate distributions for all samples. The input file should be generated by the qc_report.heterozygosity_samples().
def het_hist(het_check_df: pd.DataFrame): fig = plt.figure(figsize=(8,6)) plt.hist(het_check_df['het_rate']) plt.axvline(het_check_df['low_limit'][0], c='red', ls='--') plt.axvline(het_check_df['up_limit'][0], c='red', ls='--') plt.xlabel("Heterozygosity Rate") plt.ylabel("Number of Samples") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hwe_hist(hwefile: str=\"plink.hwe\", threshold: float=1e-6):\n\n hardy = pd.read_csv(hwefile, delimiter=\" \", skipinitialspace=True)\n zoomhwe = hardy[hardy['P'] < threshold]\n\n fig, ax = plt.subplots(1, 2, figsize=(16,6))\n plt.title(\"HWE Test\")\n hardy.hist(column='P', ax=ax[0])\n ax[0]...
[ "0.6612555", "0.6565793", "0.64546365", "0.64314544", "0.62969637", "0.6278775", "0.62036276", "0.6182599", "0.6179236", "0.6157942", "0.615459", "0.61429036", "0.61193144", "0.60951966", "0.60799766", "0.60565937", "0.6039534", "0.59985197", "0.5946924", "0.5944156", "0.5933...
0.6954653
0
Write either failed sample IDs or SNPs to two files. One is a humanreadable csv file, the other is a csv file intended to be read into a Pandas DataFrame.
def write_fail_file(ids_failed: dict, outfile: str="failed_ids"): hr = filename + "_hr.csv" pr = filename + "_pr.csv" with open(hr, "w") as f: for k,v in ids_failed.items(): f.write(str(k) + ": " + str(v) + "\n") pd.DataFrame.from_dict(data=ids_failed, orient='index').to_csv(pr, hea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _sample_failed_report(imissfile: str=\"plink.imiss\", lmissfile: str=\"plink.lmiss\",\n sexcheckfile: str=\"plink.sexcheck\",\n hetfailedfile: str=\"het_fail_ind.txt\",\n ibdfile: str=\"pihat_min0.2_in_founders.genome\",\n ...
[ "0.59206516", "0.5845258", "0.58105785", "0.575506", "0.5745646", "0.5745309", "0.5710545", "0.5644103", "0.556784", "0.544185", "0.5432509", "0.54268724", "0.5420259", "0.5400306", "0.53917617", "0.53685975", "0.5348828", "0.5346041", "0.53247756", "0.5324289", "0.531969", ...
0.59977597
0
Write report of all SNPs that failed QC checks.
def _snps_failed_report(write: bool=False, miss_threshold: float=0.2, maf_threshold: float=0.00001, hwe_threshold: float=1e-6, lmissfile: str="plink.lmiss", maffile: str="MAF_check.frq", hwefile: str="plink.hwe"): snps = {} ids_list = [] lmis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_error_report(self):\n\n with open('runReport.txt', 'a') as report:\n report.write(\"Number of Hits: \" + str(self.num_hits) + '\\n')\n report.write(\"Number of Requests: \" + str(self.num_requests) + '\\n')\n report.write(\"Hit Rate: \" + str((self.num_hits / self....
[ "0.62558824", "0.5955879", "0.58350295", "0.56715375", "0.5670514", "0.5632995", "0.5624504", "0.5608434", "0.55805814", "0.5534044", "0.5525278", "0.5480061", "0.5458178", "0.54576045", "0.54321843", "0.54130065", "0.54110825", "0.5406067", "0.5404644", "0.5396222", "0.53959...
0.6259418
0
Write a list of matplotlib Figure objects to a pdf file.
def save_pdf(bfile: str, plots: list): title = infile + "_qc_report.pdf" with PdfPages(title) as pdf: for plot in plots: pdf.savefig(plot)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pltmulti(filename):\n pp = PdfPages(filename)\n\n for fig in figs:\n pp.savefig(fig)\n pp.close()\n for fig in figs:\n fig.clear()\n plt.close()", "def save_plot(data, fname=\"plot.pdf\", axis_labels=None, show_legend=True, \n plot_title=None, plot_suptitle=\"None\"): \...
[ "0.70479006", "0.6290828", "0.6276088", "0.6186911", "0.6174644", "0.61348104", "0.6118848", "0.60695547", "0.6018124", "0.60099006", "0.5996087", "0.5984888", "0.5977084", "0.59678125", "0.5944863", "0.59101325", "0.5906264", "0.5897174", "0.58409935", "0.58313394", "0.58201...
0.7042722
1
Set a Phandle at root of tree
def set_phandle(self, phandle, node): if self.is_root(): self.phandles[phandle] = node else: self.parent.set_phandle(phandle, node)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_handle(self, handle): # -> None:\n ...", "def set_relative_root(self, root):\r\n self.root = root", "def set_relative_root(self, root):\r\n self.root = root", "def set_root(self):\n try:\n _check_call(_LIB.TreeliteTreeBuilderSetRootNode(\n self.tree.handle,\n ...
[ "0.65065104", "0.6168138", "0.6168138", "0.6086465", "0.6064793", "0.60237354", "0.6013145", "0.59666854", "0.5928178", "0.592426", "0.591921", "0.5821204", "0.58120984", "0.58011585", "0.5799797", "0.5778036", "0.5778036", "0.5771436", "0.57671916", "0.57671916", "0.57248354...
0.80903965
0
Get node for a particular phandle
def get_phandle(self, phandle): if self.is_root(): return self.phandles[phandle] else: self.parent.get_phandle(phandle)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_by_phandle( fdt, phandle, verbose=0 ):\n anode = None\n\n try:\n anode = fdt.phandle2node( phandle )\n except:\n pass\n\n return anode", "def get_handle(self, pid):\r\n self._raise_unless_has_pid(pid)\r\n return self._translate_line_to_handle(self....
[ "0.74571115", "0.6714687", "0.64187205", "0.6111631", "0.6024783", "0.6016679", "0.5920321", "0.5920068", "0.591336", "0.5892246", "0.5875863", "0.5862733", "0.5833168", "0.58268946", "0.58225256", "0.58101994", "0.58065355", "0.579452", "0.57893956", "0.57809913", "0.5757642...
0.7558637
0
Set the link to parent object
def set_parent(self, parent): self.parent = parent
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_parent(self, parent):\n self.__parent = parent", "def parent(self, parent):\n\n self._parent = parent", "def parent(self, parent):\n\n self._parent = parent", "def parent(self, parent):\n\n self._parent = parent", "def parent(self, parent):\n\n self._parent = par...
[ "0.7709443", "0.7527153", "0.7527153", "0.7527153", "0.7527153", "0.7501317", "0.7453611", "0.744805", "0.7425857", "0.7381508", "0.7371131", "0.7295479", "0.729197", "0.72448033", "0.7171901", "0.7171901", "0.71661663", "0.71535", "0.71219474", "0.708281", "0.706858", "0.7...
0.77138275
1
We have special behavior for deferred properties. Process each in turn
def process_deferreds(self): if self.deferred_properties.keys(): if b'interrupt-parent' in self.deferred_properties: phandle = struct.unpack('!I', self.deferred_properties[b'interrupt-parent'])[0] self.properties['interrupt-parent'] = self.get_phandle(phandle) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_property(self, resources, resource, model, prop, context):\n pass", "def __init__(self, deferred):\n self._values = []\n self._deferred = deferred", "def _lock_property(self, **properties):\n self._property_lock = properties\n try:\n yield\n fina...
[ "0.5772447", "0.56214094", "0.55389917", "0.5507124", "0.53457487", "0.52489406", "0.5246094", "0.52269405", "0.52269405", "0.52269405", "0.522344", "0.52216786", "0.5185956", "0.5181728", "0.51755667", "0.51708245", "0.51617956", "0.5125524", "0.51154965", "0.508286", "0.506...
0.59123147
0
Get the size of the cells for a reg field. Or if not found return default
def get_reg_size(self): if '#address-cells' in self.properties and '#size-cells' in self.properties: return self.properties['#address-cells'], self.properties['#size-cells'] elif self.parent is None: return 2, 1 else: return self.parent.get_reg_size()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_default_cell_size(cls, db, x, y, z, cell):\n ret_val, cell.value = gxapi_cy.WrapBIGRID._get_default_cell_size(GXContext._get_tls_geo(), db, x.encode(), y.encode(), z.encode(), cell.value)\n return ret_val", "def num_cells(self):\n if hasattr(self, '__num_cells__'):\n retur...
[ "0.6612843", "0.61897635", "0.6141662", "0.6071791", "0.59345895", "0.59345895", "0.59345895", "0.59345895", "0.5918711", "0.588385", "0.58066934", "0.5790984", "0.57549536", "0.5722307", "0.57218295", "0.5710967", "0.5704643", "0.5704643", "0.56762433", "0.56762433", "0.5672...
0.7466314
0
Return the root node
def get_root_node(self): return self.root
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def root_node(self):\n return self.process_tree", "def root(self) -> Node:\n return self._root", "def get_root(self):\n return self.root", "def get_root(self):\n return self._root", "def get_root(self):\n return self.__root", "def get_root(self):\n return self.__root...
[ "0.84039545", "0.8374915", "0.82073087", "0.8097818", "0.8076307", "0.8076307", "0.80171037", "0.7881108", "0.7866866", "0.7866866", "0.7833297", "0.7825902", "0.7825294", "0.7825294", "0.7825294", "0.7789383", "0.7724852", "0.77149004", "0.7637847", "0.740247", "0.7364553", ...
0.89189273
0
Return Unsigned 64 bit value
def _get_u64(property_value): size = struct.calcsize('!Q') return struct.unpack('!Q', property_value[:size])[0], property_value[size:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_uint64(self):\n return self.read(BitTypes.UINT_64.value)", "def u64(value: bytes, endian: str = \"little\", sign: bool = False) -> int:\n return unpack(value, 64, endian, sign)", "def ReadUInt64(self, endian=\"<\"):\n return self.unpack('%sQ' % endian, 8)", "def get_uint(val):\n ...
[ "0.7732684", "0.7446968", "0.72475135", "0.69126683", "0.6825021", "0.6811793", "0.6808178", "0.6808178", "0.6703142", "0.65805477", "0.6558285", "0.64141923", "0.6322656", "0.63142073", "0.61584127", "0.614074", "0.61293703", "0.61293703", "0.61291134", "0.6006034", "0.59875...
0.77944994
0
Calculation of length to word aligned string
def calc_length_word_align(length): words = int(length / 4) rem = length % 4 if rem > 0: words += 1 return words * 4
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def longest_word_length(words):", "def len_unpadded(self) -> int:", "def length_uc(x):\r\n return sum(length(m) for m in metamer(x))", "def makeWordLengths(self):\r\n clean_s = self.cleanString(self.text)\r\n LoW = clean_s.split() \r\n for x in LoW: \r\n if len(x) not in self...
[ "0.7103885", "0.678297", "0.66936374", "0.66353595", "0.65900815", "0.65466285", "0.6499617", "0.6499529", "0.64525545", "0.6443263", "0.643334", "0.6392349", "0.637607", "0.63727564", "0.63540184", "0.63340414", "0.6333407", "0.6330135", "0.6327617", "0.63234127", "0.6320469...
0.7781521
0
Pretty print the FDT structure
def debug_info_struct(fdt): # Traverse node tree in depth first depth = 0 path = b'' root = fdt.get_root_node() debug_node(fdt, root, depth, path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pretty_print_drt(self):\n self.drt_manager.pretty_print_drt()", "def pretty_print(self):\n pt = PrettyTable()\n for i in self.files_summary:\n pt.field_names = [\"File Name\", \"Classes\", \"Functions\", \"Lines\", \"Characters\"]\n pt.add_row(list([i, self.files_summar...
[ "0.71183574", "0.65764594", "0.65165854", "0.6451609", "0.63948", "0.6344296", "0.6297515", "0.6293094", "0.62850195", "0.6194503", "0.61937475", "0.61746114", "0.6150102", "0.6142343", "0.61353934", "0.6134732", "0.6134086", "0.61310756", "0.6123378", "0.6121033", "0.6103708...
0.6612843
1
Validate the provided input when constructing the ModelGenerator interface
def validate(self) -> None: validate_model_generator_interface_input(self.configs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_no_model(self):\n\n with self.assertRaisesRegex(ValueError,\n 'Please provide a model for this generator'):\n self._gen.generate(\n example=self._example,\n model=None,\n dataset=self._dataset,\n config=self._config)", "def valid...
[ "0.6509559", "0.6471608", "0.6471", "0.64322186", "0.6364867", "0.6336914", "0.6210463", "0.61195505", "0.60592943", "0.6054958", "0.5990077", "0.59755135", "0.5967933", "0.5963902", "0.5953675", "0.5944471", "0.5944471", "0.59369755", "0.59325033", "0.5917956", "0.59136003",...
0.71204984
0
If string is event expression (i.e., within EVENT tag), add form into currentDoc.taggedEventDict
def charData(string): if currentEvent is not None and currentToken is not None: eid = currentEvent.attrs[EID] logger.debug("Storing Event Values - charData: "+string) """To avoid storing the form of adverbs or other particles following the lexical item tagged as EVENT""" if c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_event_to_trigger_dict(event):\n\n\tconverted_event = convert_event_for_output(event)\n\n\t# Use OGLE name for key pointing to event as value if availble.\n\tif converted_event.has_key(\"name_OGLE\") and converted_event[\"name_OGLE\"] != \"\":\n\t\tlogger.info(\"Event has OGLE name\")\n\t\tname_key = \"name...
[ "0.555186", "0.54579014", "0.51797915", "0.5132567", "0.50637645", "0.50344574", "0.50117534", "0.4958612", "0.4933306", "0.49260473", "0.4891035", "0.48787174", "0.48091063", "0.4785578", "0.47854543", "0.47806117", "0.47784692", "0.4768833", "0.47650787", "0.47551653", "0.4...
0.6355422
0
Return the position of the event in the consituent it is embedded in. This method may be wrong (MV).
def getEventLocation(): global currentToken global currentChunk global currentSentence if currentSentence is not None: if currentToken is not None and currentToken.isAdjToken(): #if not currentChunk position = currentToken.position logger.debug("Event position obtained fr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_pos(self):\n return self._pos", "def get_pos(self):\n return self.rect.midtop", "def get_pos(self):\n return self.pos", "def get_pos(self):\r\n return self.pos", "def get_position(self):\n return self._pos", "def get_position(self):\n return self._pos", ...
[ "0.6947626", "0.69303155", "0.6904041", "0.6847795", "0.6817533", "0.6817533", "0.6812422", "0.6804917", "0.6752344", "0.6752344", "0.67469716", "0.6735814", "0.67343843", "0.67252153", "0.6718654", "0.671826", "0.6714137", "0.67099816", "0.67099816", "0.6708785", "0.6697959"...
0.77462137
0
Register a flow implementation.
def register_flow_implementation(hass, client_id, client_secret, base_url, profiles): if DATA_FLOW_IMPL not in hass.data: hass.data[DATA_FLOW_IMPL] = OrderedDict() hass.data[DATA_FLOW_IMPL] = { const.CLIENT_ID: client_id, const.CLIENT_SECRET: client_secret, const.BASE_URL: base_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_flow(self, state, flow_id):\n self._flows[state] = flow_id\n _LOGGER.debug(\"Register state %s for flow_id %s\", state, flow_id)", "def register_flow_implementation(hass, client_name, client_secret):\n hass.data.setdefault(DATA_AIS_WIFI_SERVICE_IMPL, {})\n\n hass.data[DATA_AIS_WI...
[ "0.6442713", "0.6369779", "0.62869805", "0.6175154", "0.5983011", "0.5922758", "0.5921874", "0.5921874", "0.5884547", "0.5850704", "0.57515186", "0.5728833", "0.5666385", "0.5648325", "0.5633139", "0.5625075", "0.55290496", "0.55260724", "0.55004144", "0.5458", "0.5448006", ...
0.6434403
1
Get a profile config entry.
def async_profile_config_entry(self, profile: str) -> Optional[ConfigEntry]: entries = self.hass.config_entries.async_entries(const.DOMAIN) for entry in entries: if entry.data.get(const.PROFILE) == profile: return entry return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_profile(self):\n return self.sqlfluff_config.get_section(\n (self.templater_selector, self.name, \"profile\")\n )", "def get_profile(path=\"~\"):\n global profiles\n profile = profiles.get(path,None)\n if not profile:\n profile = InitFileConfig(os.path.join(path,...
[ "0.66670287", "0.6411377", "0.6361126", "0.6269245", "0.62344956", "0.62108827", "0.6192574", "0.6067322", "0.6047501", "0.6047501", "0.60274976", "0.5993081", "0.5978055", "0.5957146", "0.5954137", "0.592238", "0.59220034", "0.5870727", "0.586618", "0.5852387", "0.5836615", ...
0.778216
0
Return a rough upper bound on the maximum eigenvalue of L.
def rough_l_max(L): # TODO: Check if L is sparse or not, and handle the situation accordingly l_max = np.linalg.eigvalsh(L.todense()).max() l_max_ub = 1.01 * l_max return l_max_ub
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def estimate_lmax(laplacian, tol=5e-3):\n lmax = sparse.linalg.eigsh(laplacian, k=1, tol=tol,\n ncv=min(laplacian.shape[0], 10),\n return_eigenvectors=False)\n lmax = lmax[0]\n lmax *= 1 + 2 * tol # Be robust to errors.\n ...
[ "0.71906644", "0.6570869", "0.6502009", "0.63436764", "0.6277832", "0.6253235", "0.6139118", "0.60703564", "0.595608", "0.5916203", "0.5887792", "0.5868432", "0.5836645", "0.5834126", "0.57791644", "0.57554054", "0.57421637", "0.5735357", "0.5728112", "0.572751", "0.5722501",...
0.8537372
0
change tuple item in index idx with newItem
def changeTupleItem(tData,idx,newItem): list_data=list(tData) list_data[idx]=newItem new_Tuble=tuple(list_data) return new_Tuble
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace_at_index(tup, ix, val):\n\n return tup[:ix] + (val,) + tup[ix + 1:]", "def __setitem__(self, index, newItem):\r\n self._items[index] = newItem", "def set_v_item(self, vindex, new_val):\n\n i = [((0, 0),),\n ((1, 1),),\n ((2, 2),),\n ([1, 2], [2, ...
[ "0.7292097", "0.705009", "0.6936579", "0.6779288", "0.67275816", "0.6594639", "0.65534335", "0.65526724", "0.646879", "0.6466017", "0.64083177", "0.6271511", "0.61799043", "0.61684626", "0.6119551", "0.6117759", "0.6107729", "0.6102414", "0.6042812", "0.6041506", "0.60243213"...
0.801793
0
Rescales the Laplacian eigenvalues in [1,1], using lmax as largest eigenvalue.
def rescale_laplacian(L, lmax=None): if lmax is None: try: if sp.issparse(L): lmax = sp.linalg.eigsh(L, 1, which="LM", return_eigenvectors=False)[0] else: n = L.shape[-1] lmax = linalg.eigh(L, eigvals_only=True, eigvals=[n - 2, n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def estimate_lmax(laplacian, tol=5e-3):\n lmax = sparse.linalg.eigsh(laplacian, k=1, tol=tol,\n ncv=min(laplacian.shape[0], 10),\n return_eigenvectors=False)\n lmax = lmax[0]\n lmax *= 1 + 2 * tol # Be robust to errors.\n ...
[ "0.65879554", "0.6413558", "0.6176044", "0.610757", "0.565682", "0.5597898", "0.5597898", "0.5588332", "0.553997", "0.5528505", "0.5522811", "0.55108255", "0.5470907", "0.5428034", "0.54232717", "0.54079694", "0.5380884", "0.538067", "0.53034294", "0.52102107", "0.52090275", ...
0.80267775
0
Return list of scaled wavelet kernels and derivatives. g[0] is scaling function kernel, g[1], g[Nscales] are wavelet kernels
def filter_design(l_max, N_scales, design_type='default', lp_factor=20, a=2, b=2, t1=1, t2=2): g = [] gp = [] l_min = l_max / lp_factor t = set_scales(l_min, l_max, N_scales) if design_type == 'default': # Find maximum of gs. Could get this analytically, but this als...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, data, largestscale=1, notes=0, order=2, scaling='log'):\n ndata=len(data)\n self.order=order\n self.scale=largestscale\n self._setscales(ndata, largestscale, notes, scaling)\n self.cwt=numpy.zeros((self.nscale, ndata), numpy.float64)\n omega=numpy.array(...
[ "0.5400535", "0.53276145", "0.53046024", "0.52425534", "0.52079475", "0.51877725", "0.5155725", "0.51239586", "0.51158124", "0.50969654", "0.50833356", "0.5063241", "0.5039982", "0.49959207", "0.49348655", "0.49202582", "0.48878056", "0.4882845", "0.487987", "0.48540536", "0....
0.5366488
1
Monic polynomial / cubic spline / power law decay kernel Defines function g(x) with g(x) = c1x^alpha for 0t2 cubic spline for t1<x<t2, Satisfying g(t1)=g(t2)=1
def kernel_abspline3(x, alpha, beta, t1, t2): # Convert to array if x is scalar, so we can use fminbound if np.isscalar(x): x = np.array(x, ndmin=1) r = np.zeros(x.size) # Compute spline coefficients # M a = v M = np.array([[1, t1, t1**2, t1**3], [1, t2, t2*...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kernel(x, g_type='abspline', a=2, b=2, t1=1, t2=2):\r\n if g_type == 'abspline':\r\n g = kernel_abspline3(x, a, b, t1, t2)\r\n elif g_type == 'mh':\r\n g = x * np.exp(-x)\r\n else:\r\n print(\"unknown type\")\r\n #TODO Raise exception\r\n\r\n return g", "def exercise_o...
[ "0.6310962", "0.5883481", "0.5818727", "0.5755755", "0.5742313", "0.5642258", "0.56190974", "0.56168497", "0.56025124", "0.5596743", "0.55938333", "0.55897206", "0.5589277", "0.55827576", "0.55570316", "0.5550757", "0.55099154", "0.548834", "0.5479543", "0.54743093", "0.54716...
0.6263975
1
Compute a set of wavelet scales adapted to spectrum bounds. Returns a (possibly good) set of wavelet scales given minimum nonzero and maximum eigenvalues of laplacian. Returns scales logarithmicaly spaced between minimum and maximum
def set_scales(l_min, l_max, N_scales): t1=1 t2=2 s_min = t1 / l_max s_max = t2 / l_min # Scales should be decreasing ... higher j should give larger s s = np.exp(np.linspace(np.log(s_max), np.log(s_min), N_scales)); return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_scales(min_scale=0.2, max_scale=0.9,num_layers=6):\n\n # this code follows the original implementation of wei liu\n # for more, look at ssd/score_ssd_pascal.py:310 in the original caffe implementation\n min_ratio = int(min_scale * 100)\n max_ratio = int(max_scale * 100)\n step = int(np.floor...
[ "0.6779795", "0.6503328", "0.6160019", "0.6000582", "0.59228474", "0.59133625", "0.58995426", "0.5746818", "0.5721642", "0.5717566", "0.5702068", "0.55817485", "0.5553121", "0.5551463", "0.55331236", "0.55255204", "0.5517993", "0.5508125", "0.54806966", "0.54566616", "0.54509...
0.6880822
0
Construct a InfraValidator component.
def __init__( self, model: types.BaseChannel, serving_spec: infra_validator_pb2.ServingSpec, examples: Optional[types.BaseChannel] = None, request_spec: Optional[infra_validator_pb2.RequestSpec] = None, validation_spec: Optional[infra_validator_pb2.ValidationSpec] = None): blessi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validator_instance(self):\n return CodingDNASubstitution(*self.params)", "def __init__(self,validator):\n self.validator = validator", "def __init__(self, *args):\n this = _libsbml.new_SBMLExternalValidator(*args)\n try: self.this.append(this)\n except: self.this = this",...
[ "0.5603296", "0.5553809", "0.54241323", "0.53484607", "0.52278566", "0.52126884", "0.51830024", "0.51698196", "0.5162531", "0.5120903", "0.5055932", "0.501882", "0.49940273", "0.49849048", "0.48895204", "0.48774824", "0.48774824", "0.48667395", "0.48442984", "0.4812087", "0.4...
0.66081
0
Make a step in the line tracing algorithm. This function chooses a step from the candidate steps and performs it. It returns either a vector of new indices or None in case there is no more valid step to perform.
def do_step(subpixel_steps, normal, candidate_indices, candidate_normals, angle_weight): n_options = candidate_indices.shape[0] if n_options == 0: return elif n_options == 1: # If we have only one valid option, go here for the next iteration return candidate_indices.flatten() el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def step (result: list, line: str):\n return result + points (result [-1], line)", "def do_train_step(self, additional_ops):\n self._total_step_distance = 0\n initial_search_step = self._sess.run(self.initial_search_step) if \\\n is_tensor(self.initial_search_step) else self.initial_s...
[ "0.6345318", "0.5852879", "0.56976086", "0.56444734", "0.56431484", "0.56187993", "0.5595055", "0.55751675", "0.5561598", "0.5555336", "0.5541005", "0.5513854", "0.550948", "0.5501076", "0.5478281", "0.5465828", "0.54503953", "0.5392995", "0.53897405", "0.53731656", "0.537194...
0.6220461
1
Traverse a line along single direction perpendicular to the normal. While traversing, it sets visited pixels in the derivative image to zero to mark them as seen. Only candidates with a negative derivative are considered.
def _traverse_line_direction( indices, masked_derivative, positions, normals, continuation_threshold, angle_weight, candidate_generator, direction, force_dir, ): # We start walking in the desired time direction sign = -1.0 if direction != np.sign(normals[indices[0], indices[1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_direction_vector(line):\n pt1, pt2 = line\n pt1 = np.array(pt1).reshape(2,)\n pt2 = np.array(pt2).reshape(2,)\n direct = pt2 - pt1\n direct_norm = normalize(direct)\n return direct_norm", "def pick_point_not_on_line(line: Line):\n return line.point1 + line.get_perpendicular_at_p...
[ "0.6231642", "0.62064487", "0.61921656", "0.61787385", "0.5913714", "0.58133996", "0.5803977", "0.57528514", "0.5731897", "0.5588801", "0.54787755", "0.5426759", "0.53662026", "0.5360662", "0.5349041", "0.52981734", "0.52764094", "0.52602357", "0.5254348", "0.5247349", "0.523...
0.6809142
0
Traverse a line in both directions.
def traverse_line( indices, masked_derivative, positions, normals, continuation_threshold, candidate_generator, angle_weight, force_dir, ): indices_fwd = _traverse_line_direction( indices, masked_derivative, positions, normals, continuation_thr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_line(self, context, line):", "def _traverse_line_direction(\n indices,\n masked_derivative,\n positions,\n normals,\n continuation_threshold,\n angle_weight,\n candidate_generator,\n direction,\n force_dir,\n):\n # We start walking in the desired time direction\n sign = ...
[ "0.6243903", "0.6061827", "0.6015995", "0.59162736", "0.5894806", "0.5746003", "0.5734897", "0.5689322", "0.56343824", "0.5622101", "0.5612732", "0.5593231", "0.55452335", "0.5537957", "0.55352867", "0.5503372", "0.5448246", "0.5430012", "0.54179573", "0.53955746", "0.5394861...
0.61460745
1
Detect lines from precomputed geometry data. The precomputed geometry data contains the magnitude of the second image derivative in the direction of largest change masked by pixels that are deemed to be a potential line center by the fact that they have their subpixel location in the range [.5, .5] for both coordinates...
def detect_lines_from_geometry( masked_derivative, positions, normals, start_threshold, continuation_threshold, max_lines, angle_weight, force_dir, ): def to_absolute_threshold(filtered_image, threshold): f = -filtered_image[filtered_image < 0] mn = np.min(f) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def traverse_line(\n indices,\n masked_derivative,\n positions,\n normals,\n continuation_threshold,\n candidate_generator,\n angle_weight,\n force_dir,\n):\n indices_fwd = _traverse_line_direction(\n indices,\n masked_derivative,\n positions,\n normals,\n ...
[ "0.6289988", "0.59759474", "0.5799737", "0.5626374", "0.5285343", "0.5180545", "0.50782937", "0.5058834", "0.5038265", "0.5022875", "0.50036347", "0.49837852", "0.49242127", "0.48989496", "0.48932955", "0.4891401", "0.48501903", "0.482961", "0.4828225", "0.482131", "0.4819862...
0.7829882
0
Scores potential peak points and selects the most optimal one. If an acceptable point is found, the function returns True, adds the point to the line and marks it as assigned in the frame.
def append_next_point(line, frame, score_fun): if np.any(frame.unassigned): (candidate_idx,) = np.where(frame.unassigned) candidate_times = frame.time_points[candidate_idx] candidate_coordinates = frame.coordinates[candidate_idx] score_matrix = score_fun([line], candidate_times, can...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findBestChokepoint(self, iPlayer=-1, bCheckForVisibility=false):\r\n\t\tpBestPlot = -1\r\n\t\tiBestValue = -1\r\n\t\tpPlayer = -1\r\n\t\tiTeam = -1\r\n\t\tif (iPlayer >= 0):\r\n\t\t\tpPlayer = gc.getPlayer(iPlayer)\r\n\t\t\tiTeam = pPlayer.getTeam()\r\n\r\n\t\tiFeatNebula = gc.getInfoTypeForString('FEATURE_ICE...
[ "0.5931456", "0.579558", "0.578731", "0.57819873", "0.5613833", "0.5574554", "0.55538595", "0.5516037", "0.5478818", "0.5411905", "0.54105973", "0.5409937", "0.5396969", "0.5395692", "0.5383844", "0.5376056", "0.53710335", "0.5324473", "0.5319133", "0.5278138", "0.5257701", ...
0.65550727
0
Extend a line. This extension terminates when it can't find an extension in the next "window" frames.
def extend_line(line, peaks, window, score_fun): frames_without_peak = 0 starting_frame = int(line.time_idx[-1]) + 1 for current_frame in peaks.frames[starting_frame:]: found_next_point = append_next_point(line, current_frame, score_fun) frames_without_peak = 0 if found_next_point else frame...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_extend_to_line(self):\n before_b = \"\"\"\\\n first line\n line 1\n line a\n line b\n line c\n last line\n \"\"\"\n after_b = \"\"\"\\\n first line\n line 1\n line a\n line b\n line c\n last line\n \"\"\"\n self.run_tes...
[ "0.6166917", "0.5941586", "0.5905543", "0.5905543", "0.5790662", "0.57643133", "0.57536477", "0.5727967", "0.56547356", "0.5599859", "0.55986065", "0.5595235", "0.5581196", "0.55352545", "0.5526695", "0.552564", "0.5508944", "0.5464621", "0.54287153", "0.5426038", "0.5369711"...
0.66578794
0
load run attempts to open the given filename and if this is possible returns the data if the filename is not accessible for some reason loadRun runs the given function with inputs args the returned result is saved as a JSON
def loadOrRun(filename,function,*args): def loadJSON(filename): "saves the data object as a JSON string" with open(filename,"r") as openFile: data = json.loads(openFile.read()) return data def saveJSON(filename,data): "saves the data object as a JSON string" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_map(arg):\n\n if os.path.isfile(arg):\n output = {}\n with open(arg) as arg_f:\n for line in arg_f:\n key, val = line.strip().split('\\t')\n output[key] = val\n return output\n return json.loads(arg)", "def _runParser(self):\n w...
[ "0.66125345", "0.6372623", "0.62351114", "0.61490405", "0.6144558", "0.60118073", "0.595576", "0.58983344", "0.5891401", "0.58865505", "0.5831925", "0.5829323", "0.575505", "0.57504463", "0.5747741", "0.57421225", "0.57315797", "0.5689022", "0.5684666", "0.5672642", "0.567120...
0.7306305
0
function to save the given data as a CSV file only writes the shortest data set in dictionary dictionary key is columb name and value is array
def saveData(filename,data): if (type(data) != dict): raise ValueError("The function provided did not return a single dictionary") elif not all([isinstance(data[key], collections.Iterable) for key in data.keys()]): try: for key,value in data.items(): if (type(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(filename, data, keys):\n with open(filename,'w') as fd:\n csv_out = csv.writer(fd, delimiter=',', quotechar='\"')\n csv_out.writerow(keys)\n for row in zip( *[data[k] for k in keys] ):\n csv_out.writerow(row)", "def write_csv(data):\n\n with open('data.csv', 'w') as f...
[ "0.76000464", "0.7449695", "0.7309566", "0.71805215", "0.71568155", "0.71388483", "0.71231884", "0.7119365", "0.7086888", "0.7073456", "0.704913", "0.702359", "0.69980276", "0.69874465", "0.69872636", "0.6960868", "0.69235003", "0.6922503", "0.69199264", "0.6898586", "0.68932...
0.800511
0
calculates and returns the energy required to travel between two points beta represents the distance climb ratio
def calculateEnergy(distance,height,beta): #check if height change is too great if (abs(height) > distance): return numpy.infty energy = beta*distance + height return max([0,energy])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def beta_func(eps, E, theta):\n\n def parameter_s(eps, E, theta):\n\n \"\"\"\n Return the parameter s (formula 3 from Gould's article)\n\n Parameters:\n eps : energy of the target photon (eV)\n E : energy of the gamma photon (e...
[ "0.6576568", "0.6341174", "0.6293908", "0.623638", "0.6198298", "0.61211705", "0.61179304", "0.6113404", "0.6087451", "0.60865986", "0.60841554", "0.60772365", "0.60565084", "0.6038824", "0.6027195", "0.6018858", "0.6018858", "0.6006927", "0.600312", "0.59943736", "0.59923947...
0.7119993
0
return number of lines of file
def number_of_lines(filename=""): c = 0 with open(filename) as f: for r in f: c += 1 return(c)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def no_of_lines():\n number_of_lines = len(open(FILE_NAME).readlines())\n return number_of_lines", "def number_of_lines(filename=\"\"):\n num_lines = 0\n with open(filename, encoding=\"utf-8\") as myFile:\n return myFile.read().count('\\n')", "def number_of_lines(filename=\"\"):\n count =...
[ "0.87256116", "0.860001", "0.85746235", "0.8567238", "0.85116553", "0.85110354", "0.8502824", "0.8492489", "0.8467929", "0.8460967", "0.843618", "0.8392563", "0.83837336", "0.8339544", "0.83332604", "0.8322604", "0.8318643", "0.8307665", "0.82334036", "0.82220536", "0.8203798...
0.86338365
1
Configurations for the various addons available to run in the cluster.
def addons_config(self) -> 'outputs.AddonsConfigResponse': return pulumi.get(self, "addons_config")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addons_config():\n # type () -> dict\n addons_json_path = 'addons.json'\n addons_json_path = os.path.join(_HERE, addons_json_path)\n with open(addons_json_path, encoding='utf-8') as addons_json:\n return json.load(addons_json)", "def configs(self):\n raise NotImplementedError()", "def...
[ "0.7216341", "0.64595217", "0.6325377", "0.62684304", "0.6213324", "0.6096831", "0.60487545", "0.60373974", "0.5979097", "0.5971932", "0.5899815", "0.5887073", "0.5879205", "0.58524054", "0.5769489", "0.5769489", "0.5763456", "0.5718401", "0.5653347", "0.56418467", "0.5641846...
0.7156975
1
Configuration for Binary Authorization.
def binary_authorization(self) -> 'outputs.BinaryAuthorizationResponse': return pulumi.get(self, "binary_authorization")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__, *,\n enabled: Optional[pulumi.Input[bool]] = None,\n evaluation_mode: Optional[pulumi.Input['BinaryAuthorizationEvaluationMode']] = None):\n if enabled is not None:\n warnings.warn(\"\"\"This field is deprecated. Leave this unset and instead ...
[ "0.6602845", "0.6454873", "0.565187", "0.534966", "0.5099298", "0.5000008", "0.49977428", "0.49957407", "0.4949052", "0.4940555", "0.49296132", "0.49217582", "0.49191168", "0.48995417", "0.48873043", "0.48849148", "0.48755065", "0.4864899", "0.48516113", "0.48355973", "0.4829...
0.69514894
0
[Output only] The current software version of the master endpoint.
def current_master_version(self) -> str: return pulumi.get(self, "current_master_version")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_version(self) -> str:\n raise NotImplementedError()", "def get_version():\n click.echo(get_current_version_number())", "def GetVersion(self):\n return self._SendRequest(HTTP_GET, \"/version\", None, None)", "def get_version(self):\n res = requests.get(self.base_url + '...
[ "0.7405532", "0.73275316", "0.7313072", "0.72402173", "0.7184773", "0.71844465", "0.7158839", "0.713493", "0.71291065", "0.7127062", "0.7091917", "0.7062665", "0.7040121", "0.70257056", "0.7014833", "0.6989701", "0.6976651", "0.69763815", "0.697081", "0.6967055", "0.6963595",...
0.7547715
0
The default constraint on the maximum number of pods that can be run simultaneously on a node in the node pool of this cluster. Only honored if cluster created with IP Alias support.
def default_max_pods_constraint(self) -> 'outputs.MaxPodsConstraintResponse': return pulumi.get(self, "default_max_pods_constraint")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_pods_per_node(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"max_pods_per_node\")", "def __init__(__self__, *,\n max_pods_per_node: Optional[pulumi.Input[str]] = None):\n if max_pods_per_node is not None:\n pulumi.set(__self__, \"max_pods_per_no...
[ "0.72490424", "0.68969697", "0.68824875", "0.67405826", "0.67405826", "0.67405826", "0.67405826", "0.67405826", "0.649803", "0.649803", "0.63067025", "0.6065648", "0.60440755", "0.59721464", "0.5968138", "0.5968138", "0.59207267", "0.5918348", "0.58353317", "0.57983226", "0.5...
0.7413817
0
Kubernetes alpha features are enabled on this cluster. This includes alpha API groups (e.g. v1alpha1) and features that may not be production ready in the kubernetes version of the master and nodes. The cluster has no SLA for uptime and master/node upgrades are disabled. Alpha enabled clusters are automatically deleted...
def enable_kubernetes_alpha(self) -> bool: return pulumi.get(self, "enable_kubernetes_alpha")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_backend_states_cluster(self):\n ctxt = context.RequestContext(fake.USER_ID, fake.PROJECT_ID, True)\n\n cluster_name = 'cluster'\n db.cluster_create(ctxt, {'name': cluster_name,\n 'binary': constants.VOLUME_BINARY})\n\n services = (\n ...
[ "0.5364504", "0.5304142", "0.5276616", "0.5182316", "0.5104517", "0.49828804", "0.4952004", "0.49358672", "0.49209613", "0.49145362", "0.48631567", "0.48362735", "0.48277518", "0.48120955", "0.48050743", "0.4804791", "0.47962186", "0.4762583", "0.47582188", "0.4757049", "0.47...
0.7327091
0
Enable the ability to use Cloud TPUs in this cluster.
def enable_tpu(self) -> bool: return pulumi.get(self, "enable_tpu")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_TPU(): \n try:\n tpu = tf.distribute.cluster_resolver.TPUClusterResolver()\n print(f\"Running on TPU: {tpu.master()}\")\n except ValueError:\n tpu = None\n\n if tpu:\n tf.config.experimental_connect_to_cluster(tpu)\n tf.tpu.experimental.initialize_tpu_system(t...
[ "0.6384191", "0.56108826", "0.5571511", "0.555702", "0.5371857", "0.53376144", "0.53211796", "0.5297298", "0.5216863", "0.52079934", "0.51780385", "0.5157446", "0.51468134", "0.51433855", "0.5114178", "0.51020265", "0.5091336", "0.50682604", "0.5067109", "0.50570095", "0.5042...
0.57667154
1
Configuration for the legacy ABAC authorization mode.
def legacy_abac(self) -> 'outputs.LegacyAbacResponse': return pulumi.get(self, "legacy_abac")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_replace_o_auth_client_authorization(self):\n pass", "def _set_authenticator(self):\n pass", "def configure_aaa_auth_proxy(device, server_grp):\n try:\n device.configure([\n f\"aaa authorization auth-proxy default group {server_grp}\"\n ])\n except SubComman...
[ "0.5847644", "0.5722612", "0.56613845", "0.5640855", "0.5617354", "0.5554816", "0.5540881", "0.55407065", "0.5516549", "0.54819787", "0.5480715", "0.54536587", "0.5445894", "0.54133517", "0.53962046", "0.5393042", "0.53687763", "0.53661174", "0.5306625", "0.5305923", "0.53038...
0.5968355
0
The configuration options for master authorized networks feature.
def master_authorized_networks_config(self) -> 'outputs.MasterAuthorizedNetworksConfigResponse': return pulumi.get(self, "master_authorized_networks_config")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config(self, options):\n group = options.group(\"Nomos settings\")\n _ = group.define\n _('-u', '--url', default='http://localhost', help='The host of the http server url prefix (default %(default)r)')\n _('-d', '--debug', help='Open debug mode (default %(default)r)', action='store_...
[ "0.60807794", "0.60114914", "0.59778917", "0.5971274", "0.5850403", "0.58323544", "0.58136946", "0.58050996", "0.5747543", "0.5744506", "0.5719246", "0.57091904", "0.5653633", "0.56394756", "0.5625632", "0.5604691", "0.5582377", "0.55736333", "0.5544703", "0.552748", "0.55246...
0.7232878
0
Monitoring configuration for the cluster.
def monitoring_config(self) -> 'outputs.MonitoringConfigResponse': return pulumi.get(self, "monitoring_config")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configuration():", "def config(self):\n pass", "def config(self):\n pass", "def config(self):\n raise NotImplementedError", "def get_cluster_config(self, clusterid, **kwargs):\n return {}", "def config():", "def config():", "def get_cluster_conf(self):\n # Load ...
[ "0.6392183", "0.63674974", "0.63674974", "0.62450653", "0.6243053", "0.62117106", "0.62117106", "0.6147165", "0.6100576", "0.5916988", "0.5902183", "0.58540654", "0.58334666", "0.580316", "0.5802037", "0.5797535", "0.5792378", "0.5762438", "0.57495224", "0.57456577", "0.57271...
0.7218966
0
[Output only] The size of the address space on each node for hosting containers. This is provisioned from within the `container_ipv4_cidr` range. This field will only be set when cluster is in routebased network mode.
def node_ipv4_cidr_size(self) -> int: return pulumi.get(self, "node_ipv4_cidr_size")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size(self):\r\n return sum(pool.size() for pool in self.host_to_pool.values())", "def size(self):\n return self._container._size", "def max_node_size(self):\n return self.max_node_capacity", "def get_size(self, node: int):\n return self._servers[node].size + self._queues[node]...
[ "0.63324183", "0.6079987", "0.6069866", "0.60444885", "0.5908167", "0.59070915", "0.59035134", "0.58925134", "0.58586276", "0.574201", "0.5722505", "0.57091755", "0.5695193", "0.56881124", "0.56256837", "0.5572904", "0.55593646", "0.5550266", "0.55467", "0.54951555", "0.54932...
0.7194445
0
The node pools associated with this cluster. This field should not be set if "node_config" or "initial_node_count" are specified.
def node_pools(self) -> Sequence['outputs.NodePoolResponse']: return pulumi.get(self, "node_pools")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def numa_nodes(self):\n return int(self.num_numa_nodes) # type: ignore", "def get_nodepool_taints(self) -> Union[List[str], None]:\n return self.agentpool_context.get_node_taints()", "def pool_list(mnode):\n cmd = \"gluster pool list\"\n return g.run(mnode, cmd)", "def get_nodepool_label...
[ "0.66326684", "0.6266685", "0.62534577", "0.61665773", "0.6165331", "0.61445326", "0.6082012", "0.60785145", "0.6073273", "0.6071389", "0.6052561", "0.60396147", "0.6031696", "0.6027259", "0.60230404", "0.5943898", "0.5933448", "0.59181905", "0.59092337", "0.58840585", "0.583...
0.7844672
0
Notification configuration of the cluster.
def notification_config(self) -> 'outputs.NotificationConfigResponse': return pulumi.get(self, "notification_config")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _on_config_changed(self, _):\n self._configure_pod()", "def get_cluster_conf(self):\n # Load cluster configuration file\n fpath = Path(self.cmd_opts.get(CLI_CMDOPT.DCOS_CLUSTERCFGPATH))\n\n # Unblock irrelevant local operations\n if str(fpath) == 'NOP':\n self.cl...
[ "0.6274625", "0.61184496", "0.59992546", "0.59397686", "0.59135175", "0.5906175", "0.58184856", "0.58034045", "0.58034045", "0.5800956", "0.5797025", "0.5762838", "0.569478", "0.5692991", "0.56560695", "0.5613686", "0.5596787", "0.5590034", "0.5585273", "0.5580533", "0.556369...
0.64493877
0
Configuration for private cluster.
def private_cluster_config(self) -> 'outputs.PrivateClusterConfigResponse': return pulumi.get(self, "private_cluster_config")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cluster_conf(self):\n # Load cluster configuration file\n fpath = Path(self.cmd_opts.get(CLI_CMDOPT.DCOS_CLUSTERCFGPATH))\n\n # Unblock irrelevant local operations\n if str(fpath) == 'NOP':\n self.cluster_conf_nop = True\n LOG.info(f'{self.msg_src}: cluster...
[ "0.695234", "0.65962726", "0.6491997", "0.6375175", "0.63101655", "0.62472576", "0.6246818", "0.6239748", "0.6221098", "0.6163213", "0.6049887", "0.6037894", "0.60173917", "0.5966339", "0.5959291", "0.5943853", "0.5887054", "0.5887054", "0.58785146", "0.58253574", "0.581395",...
0.77249736
0
The resource labels for the cluster to use to annotate any related Google Compute Engine resources.
def resource_labels(self) -> Mapping[str, str]: return pulumi.get(self, "resource_labels")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_labels(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:\n return pulumi.get(self, \"resource_labels\")", "def build_resource_labels(self):\n response = [ \n {\n \"key\": \"instance_id\", \n \"value\": \"9113659852587170607\"\n ...
[ "0.72568333", "0.70224243", "0.6757038", "0.6757038", "0.6757038", "0.6757038", "0.6757038", "0.6757038", "0.6757038", "0.6757038", "0.65252024", "0.65047044", "0.64962435", "0.64791125", "0.6476876", "0.64422274", "0.64399034", "0.6409625", "0.6409625", "0.6409625", "0.64096...
0.79130614
0
Configuration for exporting resource usages. Resource usage export is disabled when this config is unspecified.
def resource_usage_export_config(self) -> 'outputs.ResourceUsageExportConfigResponse': return pulumi.get(self, "resource_usage_export_config")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exports(self):\r\n return resources.Exports(self)", "def _export_resources(self, use_raster_region=False):\n for resource in self.resource_export_list:\n\n # print(\"Check for termination %i\"%self.resource_logger.get_termination(self.user_id, self.resource_id))\n\n # Chec...
[ "0.52988666", "0.52806956", "0.508678", "0.50576246", "0.5021003", "0.49232256", "0.49132994", "0.48141783", "0.4736182", "0.4681634", "0.46656135", "0.45810598", "0.45745647", "0.4529533", "0.45232862", "0.4509733", "0.4505689", "0.45039946", "0.44948426", "0.44871667", "0.4...
0.7425944
0
Clusterlevel Vertical Pod Autoscaling configuration.
def vertical_pod_autoscaling(self) -> 'outputs.VerticalPodAutoscalingResponse': return pulumi.get(self, "vertical_pod_autoscaling")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__, *,\n keda: Optional[pulumi.Input['ManagedClusterWorkloadAutoScalerProfileKedaArgs']] = None,\n vertical_pod_autoscaler: Optional[pulumi.Input['ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerArgs']] = None):\n if keda is not None:\n ...
[ "0.6191683", "0.5961352", "0.57963413", "0.56779057", "0.56612533", "0.55897486", "0.5511863", "0.5327871", "0.5314623", "0.5248582", "0.51493275", "0.51441306", "0.51271236", "0.5108643", "0.50980806", "0.5083642", "0.5079237", "0.5068873", "0.5054996", "0.5038697", "0.50147...
0.67106307
0
Select all OHLC for specific trading day, while defaulting to the latest available OHLC data. If ``date`` is given, this method will try to fetch OHLC data for that trading day. When there is no data for the given day, OHLC data will be loaded for the closest trading day earlier in time with data. This operation works ...
def latest( self, curve, date=None): # Build URL safe_curve = self._urlencode_curve_name(curve, curve_types=CURVE_TYPES) url = f"/ohlc/{safe_curve}/latest/" # Parameters params = {} self._add_date(params, "date", date) # HTTP re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_rates_for(currency: str, date: str):\n baseurl = f\"https://openexchangerates.org/api/historical/{date}.json\"\n params = {\"app_id\": OEG_APP_ID, \"symbols\": currency, \"base\": \"USD\"}\n return make_request(baseurl=baseurl, params=params)", "def collect_data_date(self, date=None):\n i...
[ "0.5650807", "0.55542356", "0.54291415", "0.53291017", "0.52177894", "0.5156873", "0.51429737", "0.50873697", "0.5029751", "0.4943151", "0.494221", "0.49331042", "0.478104", "0.47526354", "0.47475162", "0.47444502", "0.4741295", "0.47190276", "0.4716321", "0.470267", "0.47014...
0.5669922
0
Load all OHLC rows from a single trading day, sort them, and merge/convert them to a continuous series. It defaults to using the latest prices available, therefore "latest_as_period". If ``date`` is given, this method will try to fetch OHLC data for that trading day. When there is no data for the given day, OHLC data w...
def latest_as_periods( self, curve, field=OHLCField.SETTLEMENT, date=None): # Build URL safe_curve = self._urlencode_curve_name(curve, curve_types=CURVE_TYPES) # Parameters params = {} self._add_date(params, "date", date) # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def latest(\n self,\n curve,\n date=None):\n # Build URL\n safe_curve = self._urlencode_curve_name(curve, curve_types=CURVE_TYPES)\n url = f\"/ohlc/{safe_curve}/latest/\"\n # Parameters\n params = {}\n self._add_date(params, \"date\", date)...
[ "0.5703084", "0.553407", "0.5451137", "0.5372806", "0.530855", "0.5269858", "0.5257515", "0.52109927", "0.51734334", "0.51731384", "0.5149799", "0.5137957", "0.50300354", "0.50041586", "0.4960041", "0.49211484", "0.48573786", "0.48047334", "0.47960526", "0.4790022", "0.477382...
0.60150516
0
Lemme break down this function Init a new cart inst Query the product u added (by ID) Init a 'cardAdd' form ('POST') Submit with 'product, quantity' and 'updateoradd'
def cart_add(request, product_id): cart = Cart(request) product = get_object_or_404(Product, id=product_id) form = CartAddProductForm(request.POST) if form.is_valid(): input_data = form.cleaned_data cart.add(product=product, quantity=input_da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_cart(request):\n id = str(uuid.uuid4())\n item_type = request.POST.get('category')\n complexity = request.POST.get('complexity')\n variations = request.POST.get('variations')\n user_description = request.POST.get('user_description')\n fast_delivery = request.POST.get('fast_delivery')\n...
[ "0.7100771", "0.6878335", "0.6856198", "0.6801043", "0.67579836", "0.6699306", "0.66494405", "0.6645074", "0.6627023", "0.6598866", "0.65287143", "0.65268654", "0.6456414", "0.6448939", "0.64456594", "0.63757193", "0.6353272", "0.6220991", "0.6189352", "0.61710715", "0.616284...
0.69774467
1
Return the state of the sensor.
def state(self): if self.coordinator.data: return self.coordinator.data[self._sensor]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state(self):\n return self.device.device_data[self.device_id][self._sensor_type]", "def state(self):\n return self.device.value()", "def state(self):\n return self.device.device_data[self.device_id]['temperature']", "def state(self):\n return self._device.temperature", "def ...
[ "0.8718715", "0.80661917", "0.80472773", "0.8043865", "0.79883057", "0.79799485", "0.7954997", "0.7944044", "0.79310834", "0.7832018", "0.7808985", "0.7798248", "0.7773153", "0.7736619", "0.76678526", "0.7650288", "0.76228094", "0.76088077", "0.7522243", "0.74831516", "0.7416...
0.8168511
1
Has this optimisation converged
def converged(self) -> bool:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def converged(self) -> bool:\n if self._species is not None and self._species.n_atoms == 1:\n return True # Optimisation 0 DOF is always converged\n\n if self._abs_delta_e < self.etol / 10:\n logger.warning(\n f\"Energy change is overachieved. \"\n ...
[ "0.74979126", "0.7352496", "0.7348996", "0.7317411", "0.6986424", "0.69724727", "0.6905858", "0.683691", "0.6828877", "0.680164", "0.67609876", "0.67542726", "0.6750857", "0.6737987", "0.67141956", "0.66052353", "0.66034245", "0.65705764", "0.65700835", "0.6569831", "0.643914...
0.8263818
1
The energy change on between the final two optimisation cycles
def last_energy_change(self) -> PotentialEnergy:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def energy(self):\n e = 0\n\n restoration = RestorationModel(self.graph_damaged)\n restoration.run(self.state)\n restoration_graphs = restoration.get_restoration_graphs()\n restoration_times = restoration.get_restoration_times()\n restoration_costs = restoration.get_restor...
[ "0.6898248", "0.6738593", "0.67179537", "0.66558695", "0.6614445", "0.658965", "0.64882135", "0.6466257", "0.6457878", "0.6437173", "0.6425374", "0.63966984", "0.63872886", "0.62549436", "0.62187165", "0.62180096", "0.6185802", "0.6183921", "0.6169881", "0.6163976", "0.610848...
0.6899131
1
Optimise a species using a method
def optimise( cls, species: "Species", method: "Method", n_cores: Optional[int] = None, coords: Optional[OptCoordinates] = None, **kwargs, ) -> None:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _optimise(self):\n pass", "def run(\n self,\n species: \"Species\",\n method: \"Method\",\n n_cores: Optional[int] = None,\n ) -> None:\n self._n_cores = n_cores if n_cores is not None else Config.n_cores\n self._initialise_species_and_method(species, metho...
[ "0.59054494", "0.5867837", "0.5866247", "0.5777991", "0.56949055", "0.5675182", "0.5572097", "0.5540202", "0.54477495", "0.5373808", "0.5362516", "0.5361701", "0.5356831", "0.5355928", "0.53528816", "0.5315284", "0.5308003", "0.524262", "0.5233917", "0.5224517", "0.52237076",...
0.70730275
0
Iteration of the optimiser, which is equal to the length of the history minus one, for zero indexing.
def iteration(self) -> int: return len(self._history) - 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accelerate(self):\n return self[2]", "def _optimise(self):\n pass", "def optimize(self, ngen):\n res = 0\n for res in self(ngen):\n pass\n return res", "def current_update():\n # Compute the multiplier coefficient:\n ci = dt / (L * dx)\n for k in ran...
[ "0.60726655", "0.6001459", "0.58892554", "0.5865963", "0.5800136", "0.57045007", "0.57009655", "0.56971353", "0.5693327", "0.5685875", "0.56375873", "0.56092143", "0.56057304", "0.55978477", "0.55489707", "0.55424935", "0.5536424", "0.55318326", "0.5525693", "0.54617447", "0....
0.6199619
0
Update the gradient of the energy with respect to the coordinates using the method. Will transform from the current coordinates type to Cartesian coordinates to perform the calculation, then back.
def _update_gradient_and_energy(self) -> None: assert self._species and self._coords is not None and self._method from autode.calculations import Calculation # TODO: species.calc_grad() method # Calculations need to be performed in cartesian coordinates if self._coords is not ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_gradient_and_energy(self) -> None:\n return self._update_gradient_at(DimerPoint.midpoint)", "def _update_gradient_at(self, point: DimerPoint) -> None:\n assert (\n self._coords is not None\n and self._species is not None\n and self._method is not None\n ...
[ "0.7082646", "0.6886646", "0.6739924", "0.6218414", "0.6207886", "0.61311954", "0.6084439", "0.59552735", "0.595032", "0.59208214", "0.58562624", "0.58436793", "0.5833895", "0.5754394", "0.571729", "0.5706881", "0.5706263", "0.5691349", "0.567567", "0.56740075", "0.566287", ...
0.8035449
0
Update the energy, gradient and Hessian using the method. Will transform from the current coordinates type to Cartesian coordinates to perform the calculation, then back. Uses a numerical Hessian if analytic Hessians are not implemented for this method. Does not perform a Hessian evaluation if the molecule's energy is ...
def _update_hessian_gradient_and_energy(self) -> None: assert self._species and self._coords is not None and self._method should_calc_hessian = True if ( _energy_method_string(self._species) == method_string(self._method, self._method.keywords.hess) and self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_hessian(self) -> None:\n assert self._species and self._coords is not None and self._method\n\n species = self._species.new_species(\n name=f\"{self._species.name}_opt_{self.iteration}\"\n )\n species.coordinates = self._coords.to(\"cartesian\")\n\n species...
[ "0.73673356", "0.7216265", "0.6526816", "0.6129571", "0.60605246", "0.59225464", "0.5889441", "0.578965", "0.5788079", "0.57444555", "0.57352996", "0.5692805", "0.55746907", "0.55246085", "0.5515953", "0.55143005", "0.5510282", "0.549657", "0.5474565", "0.54389304", "0.543383...
0.79742205
0
Update the Hessian of a species
def _update_hessian(self) -> None: assert self._species and self._coords is not None and self._method species = self._species.new_species( name=f"{self._species.name}_opt_{self.iteration}" ) species.coordinates = self._coords.to("cartesian") species.calc_hessian( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_hessian_gradient_and_energy(self) -> None:\n assert self._species and self._coords is not None and self._method\n should_calc_hessian = True\n\n if (\n _energy_method_string(self._species)\n == method_string(self._method, self._method.keywords.hess)\n ...
[ "0.72241074", "0.6581742", "0.65321565", "0.64826435", "0.64396447", "0.62531716", "0.62245154", "0.6210999", "0.6198029", "0.6191426", "0.6147691", "0.6117358", "0.61037016", "0.6052289", "0.60474706", "0.6046593", "0.60456365", "0.59828645", "0.59104556", "0.5907148", "0.58...
0.8506919
0
Set a new set of coordinates of this optimiser, will append to the current history.
def _coords(self, value: Optional[OptCoordinates]) -> None: if value is None: return elif isinstance(value, OptCoordinates): self._history.append(value.copy()) else: raise ValueError( "Cannot set the optimiser coordinates with " f"{value}" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_coordinates(self, x, y, add_to_history=False):\n father = self.father()\n mother = self.mother()\n self.x = x\n self.y = y\n if not father is None:\n father.set_coordinates(x, y, add_to_history)\n fwidth = father.size()[0]\n else:\n ...
[ "0.6589398", "0.656747", "0.64574945", "0.6432482", "0.64310336", "0.6422245", "0.6419004", "0.6361158", "0.62960243", "0.6151301", "0.6085752", "0.60727155", "0.60299313", "0.5987532", "0.59863186", "0.59804946", "0.5955339", "0.59518814", "0.59230876", "0.5853755", "0.58306...
0.70119435
0
Does this optimiser have defined coordinates and a gradient?
def _has_coordinates_and_gradient(self) -> bool: return self._coords is not None and self._coords.g is not None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_gradient_convergence(self):\n pass", "def has_gradients(self) -> bool:\n return False", "def gradient(self):\n return NotImplemented", "def gradient(self, x):\n pass", "def gradient_supplied(fun, x0, jac, info):\n result = OptimizerResult()\n result.x = x0\n re...
[ "0.684583", "0.65688497", "0.65422535", "0.6513405", "0.6494195", "0.6462125", "0.63900477", "0.63488483", "0.62785405", "0.624249", "0.62083745", "0.60813445", "0.6075137", "0.60555345", "0.60552347", "0.6037873", "0.6000173", "0.59926647", "0.5978953", "0.5953402", "0.59186...
0.730875
0
Set the gradient tolerance
def gtol(self, value: Union[int, float, GradientRMS]): if float(value) <= 0: raise ValueError( "Tolerance on the gradient (||∇E||) must be " f"positive. Had: gtol={value}" ) self._gtol = GradientRMS(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_gradient_convergence(self):\n pass", "def set_tolerance(self, tol):\n self.tolerance = tol", "def tolerance(self, tolerance: float) -> None:\n self._tolerance = tolerance", "def set_tolerance(self, *args, **kwargs):\n raise ParameterError(\"The %s StoppingCriterioin does ...
[ "0.71243787", "0.67359334", "0.65088046", "0.64069635", "0.63717926", "0.6342482", "0.6324808", "0.6277355", "0.6270463", "0.6239376", "0.6174102", "0.6148233", "0.61089474", "0.60948575", "0.6036751", "0.59802085", "0.5916113", "0.5916078", "0.5897262", "0.58839667", "0.5855...
0.67792344
1
Is this optimisation converged? Must be converged based on both energy and gradient tolerance.
def converged(self) -> bool: if self._species is not None and self._species.n_atoms == 1: return True # Optimisation 0 DOF is always converged if self._abs_delta_e < self.etol / 10: logger.warning( f"Energy change is overachieved. " f'{self.etol....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_gradient_convergence(self):\n pass", "def converged(self) -> bool:", "def converged(self) -> bool:", "def converged(self) -> bool:", "def _check_convergence(current_position,\n next_position,\n current_objective,\n next_objec...
[ "0.7539031", "0.7381662", "0.7381662", "0.7381662", "0.7379752", "0.71624035", "0.6985989", "0.69402605", "0.69352055", "0.68829757", "0.6816837", "0.67151845", "0.6696989", "0.66939247", "0.6678315", "0.6673187", "0.66481334", "0.6609224", "0.65518117", "0.65459216", "0.6542...
0.8049817
0
Log the convergence of the energy
def _log_convergence(self) -> None: assert ( self._coords is not None ), "Must have coordinates to log convergence" log_string = f"{self.iteration}\t" if len(self._history) > 1: assert self._coords.e and self._history.penultimate.e, "Need ∆E" de: Pote...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log(self, x_old, grad, x, curr_iter, tol_g_val, tol_x_val, tol_f_val):\n\n print(\"-----------------------------------\")\n print(\"\\n Iter: \", curr_iter)\n print(\"\\n x_old: \", x_old)\n print(\"\\n gradient: \", grad)\n print(\"\\n x: \", x)\n print(\"\\n tol_x_va...
[ "0.6447044", "0.63881993", "0.63539535", "0.6344515", "0.6338458", "0.6263239", "0.6260464", "0.624772", "0.6208301", "0.6184861", "0.6182164", "0.6117849", "0.6113466", "0.61104494", "0.61004084", "0.6091021", "0.60780704", "0.6055994", "0.60516936", "0.6011979", "0.59960186...
0.7293605
0
Find the best Hessian update strategy by enumerating all the possible Hessian update types implemented for this optimiser and returning the first that meets the criteria to be used.
def _best_hessian_updater(self) -> "HessianUpdater": coords_l, coords_k = self._history.final, self._history.penultimate assert coords_k.g is not None and coords_l.g is not None for update_type in self._hessian_update_types: updater = update_type( h=coords_k.h, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_latest_heuristic():\n return Heuristics.Main(weights=tuple(LATEST_VECTOR))", "def get_heuristics():\n from ixle import heuristics\n def is_heuristic(obj):\n FORBID = 'Heuristic SuggestiveHeuristic'.split() # sigh make metaclass\n return getattr(obj,'__name__', None) not in FORBID a...
[ "0.6453442", "0.59862936", "0.57483494", "0.5483882", "0.5443671", "0.5433166", "0.5394984", "0.53371316", "0.5335538", "0.5334165", "0.53199065", "0.5318296", "0.5305196", "0.5291728", "0.52681136", "0.52636963", "0.52561134", "0.52435946", "0.5191281", "0.51801425", "0.5147...
0.78244114
0
Last but one set of coordinates (the penultimate set)
def penultimate(self) -> OptCoordinates: if len(self) < 2: raise IndexError( "Cannot obtain the penultimate set of " f"coordinates, only had {len(self)}" ) return self[-2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def final(self) -> OptCoordinates:\n if len(self) < 1:\n raise IndexError(\n \"Cannot obtain the final set of coordinates from \"\n \"an empty history\"\n )\n\n return self[-1]", "def last_pos(self):\n return self.locs[self.indices[-1], 2:4...
[ "0.70512617", "0.6724201", "0.6241731", "0.6138246", "0.612287", "0.60162157", "0.58220583", "0.5690654", "0.5690654", "0.56809294", "0.5671732", "0.5658037", "0.56515783", "0.5639954", "0.56307214", "0.563022", "0.56188434", "0.55843705", "0.552581", "0.552581", "0.5522097",...
0.75430834
0
Last set of coordinates
def final(self) -> OptCoordinates: if len(self) < 1: raise IndexError( "Cannot obtain the final set of coordinates from " "an empty history" ) return self[-1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_pos(self):\n return self.locs[self.indices[-1], 2:4]", "def penultimate(self) -> OptCoordinates:\n if len(self) < 2:\n raise IndexError(\n \"Cannot obtain the penultimate set of \"\n f\"coordinates, only had {len(self)}\"\n )\n\n r...
[ "0.71565", "0.6961253", "0.6697272", "0.6631349", "0.6589804", "0.65791255", "0.64669997", "0.641807", "0.64126986", "0.6387621", "0.6311996", "0.6311996", "0.6311996", "0.617127", "0.61159545", "0.60669136", "0.60283583", "0.60283583", "0.60202646", "0.6000876", "0.5945321",...
0.7475922
0
Minimum energy coordinates in the history
def minimum(self) -> OptCoordinates: if len(self) == 0: raise IndexError("No minimum with no history") return self[np.argmin([coords.e for coords in self])]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getmin(self):\n\n return self.X", "def min(self):\n return self._min_coords", "def x_min(self):\n return self.get_min_value(self.X_INDEX)", "def getMinX(self):\n return self.minx", "def minimum_value(self):\n return self._fitness[self._minidx]", "def get_state_obser...
[ "0.7085373", "0.7003818", "0.6942399", "0.68568605", "0.678881", "0.6646862", "0.6632343", "0.6624457", "0.65864694", "0.65766704", "0.65484273", "0.6474432", "0.6473671", "0.64680195", "0.64595205", "0.6439375", "0.643895", "0.63936305", "0.6383774", "0.63583", "0.63517016",...
0.76141334
0
Has this optimisation has converged
def converged(self) -> bool:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def converged(self) -> bool:\n if self._species is not None and self._species.n_atoms == 1:\n return True # Optimisation 0 DOF is always converged\n\n if self._abs_delta_e < self.etol / 10:\n logger.warning(\n f\"Energy change is overachieved. \"\n ...
[ "0.7355119", "0.7290562", "0.7272661", "0.7251812", "0.7124385", "0.70375144", "0.6923163", "0.6809701", "0.67881316", "0.67622733", "0.6747469", "0.67049253", "0.67006737", "0.6585411", "0.6575119", "0.6567254", "0.65066403", "0.64418536", "0.6366465", "0.63532215", "0.63294...
0.79426724
0
The final energy change in this optimisation
def last_energy_change(self) -> PotentialEnergy:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def energy(self):\n e = 0\n\n restoration = RestorationModel(self.graph_damaged)\n restoration.run(self.state)\n restoration_graphs = restoration.get_restoration_graphs()\n restoration_times = restoration.get_restoration_times()\n restoration_costs = restoration.get_restor...
[ "0.70983434", "0.67574704", "0.6727352", "0.6726076", "0.6715842", "0.6686525", "0.6635653", "0.6618608", "0.65934557", "0.6584008", "0.6558879", "0.6552821", "0.65491444", "0.6543821", "0.6540897", "0.6510314", "0.6453269", "0.64384806", "0.6426552", "0.64040226", "0.6374171...
0.7713392
0
Check that all DQ flags are propagated from the reference file (header keyword R_DARK) to the output PIXELDQ array.
def pixeldq_propagation(output_hdul, reference_hdul, input_hdul): nframes = output_hdul[0].header['NFRAMES'] groupgap = output_hdul[0].header['GROUPGAP'] nints, ngroups, nx, ny = output_hdul['SCI'].shape nframes_tot = (nframes+groupgap)*ngroups if nframes_tot > reference_hdul['SCI'].data.shape[0]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_add_refpix():\n data = np.ones((10, 10))\n refpix = (2, 3, 4, 5)\n\n new_array = bpd.add_refpix(data, refpix)\n yd, xd = new_array.shape\n print, xd, yd\n\n assert yd == 19\n assert xd == 15\n assert np.all(new_array[0:5, 5] == np.array([0, 0, 0, 0, 1]))\n assert np.all(new_arra...
[ "0.5539194", "0.54603523", "0.53175545", "0.5283281", "0.5143104", "0.51374406", "0.5090481", "0.5036602", "0.50334764", "0.500272", "0.49995208", "0.49839264", "0.49788827", "0.49374896", "0.49008256", "0.48827404", "0.4879289", "0.48668283", "0.48662207", "0.4860718", "0.48...
0.59396905
0
This function receives a string with the file location and the file name and loads into a data frame
def load_csvFile(file_location, file_name,sep,encoding): try: fullpath=file_location+file_name df = pd.read_csv(fullpath, encoding=encoding,sep=sep) return df except IOError: print('Error loading the file: ' , file_name) sys.exit(1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_file(input_file):\n basename = os.path.basename(input_file.name)\n filename = os.path.splitext(basename)[0]\n\n # data[filename] = json.load(input_file)\n print(\"Loading: \", filename)\n data[filename] = pd.DataFrame(json.load(input_file))\n print(data[filename])\n\n # print(data[fil...
[ "0.6746871", "0.67404", "0.67346776", "0.6709636", "0.6699955", "0.6674113", "0.6646142", "0.6602525", "0.6602525", "0.6602525", "0.6558512", "0.65576154", "0.65292907", "0.6524754", "0.6520044", "0.65091753", "0.64863163", "0.6475894", "0.6471109", "0.6461246", "0.6440831", ...
0.68416655
0
poses, poses_ref should be in direct
def adjust_poses(poses, refposes): # atoms, take last step as reference for i in range(len(poses)): for x in range(3): move = round(poses[i][x] - refposes[i][x], 0) poses[i][x] -= move refposes = poses.copy() return poses, refposes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def poses(self) -> List[T]:\n return self._poses", "def publish_pose(self):\n pose_msg = PoseWithCovarianceStamped()\n pose_msg.header.stamp = self.current_frame.time\n pose_msg.header.frame_id = \"map\"\n pose_msg.pose.pose = g2r(self.current_frame.pose3)\n\n cov = 1e-4...
[ "0.6148049", "0.58333236", "0.5746212", "0.572411", "0.5695177", "0.5692184", "0.5646998", "0.55455136", "0.5530044", "0.5528269", "0.54589295", "0.54589295", "0.5454357", "0.5427695", "0.5376216", "0.5335132", "0.5315859", "0.53136843", "0.5285144", "0.5277408", "0.52730626"...
0.67541105
0
infer most recent id based on snapshots available in current directory
def most_recent_id(q): since_id = None last_archive_file = last_archive(q) if last_archive_file: line = open(last_archive_file).readline() if line: since_id = json.loads(line)["id_str"] return since_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_previous_id(self, identifier: Identifier) -> Optional[Identifier]:\n previous_id = self._previous_id(identifier)\n if not previous_id:\n return None\n\n if identifier.year == previous_id.year \\\n and identifier.month == previous_id.month:\n return previ...
[ "0.62240463", "0.6077917", "0.5966858", "0.5966858", "0.5912072", "0.58827287", "0.58447146", "0.5768191", "0.570249", "0.5677729", "0.5671873", "0.56171113", "0.5595864", "0.5573676", "0.5540035", "0.5534258", "0.55134594", "0.5512899", "0.5507196", "0.5507196", "0.5507196",...
0.6641109
0
Give hydrate a list or generator of Twitter IDs and you get back a generator of lineoriented JSON for the rehydrated data.
def hydrate(tweet_ids): ids = [] client = TwitterClient() # rehydrate every 100 twitter IDs with one request for tweet_id in tweet_ids: tweet_id = tweet_id.strip() # remove new line if present ids.append(tweet_id) if len(ids) == 100: for tweet in client.hydrate(ids):...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tweets():\r\n tweets = models.Tweet.query.all()\r\n output = []\r\n\r\n for tweet in tweets:\r\n tweet_data = {'id': tweet.id,\r\n 'content': tweet.text_content,\r\n 'username': tweet.username,\r\n 'timestamp': tweet.timestamp.i...
[ "0.5547958", "0.5459695", "0.53579396", "0.5336772", "0.524784", "0.5217712", "0.5196269", "0.5168488", "0.51510733", "0.5120735", "0.5116518", "0.50929993", "0.5018285", "0.5009477", "0.5001987", "0.50006217", "0.49614438", "0.49544826", "0.4948409", "0.49253693", "0.4921666...
0.74821085
0
Test rover position after performing movements
def test_rover_position(self): rover = Rover(self.plateau_dimensions, self.rover_initial_position, Rover.DIRECTIONS.get('E')) rover.execute_instructions("LMLM") self.assertEqual(rover._position.x, 1) self.assertEqual(rover._position.y, 2) self.assertEqual(rover.get_heading, 'W')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n move_cmd = Twist()\n move_cmd.linear.x = 0\n move_cmd.angular.z = 0\n\n while not rospy.is_shutdown():\n # bump logic as previous psets\n if self.bump:\n self.bump = False\n # move backwards\n move_cmd.l...
[ "0.7047212", "0.6760165", "0.6707928", "0.65727127", "0.6571607", "0.65446305", "0.6535783", "0.65091497", "0.64800197", "0.6479194", "0.6458583", "0.64565194", "0.6451528", "0.64388776", "0.6437783", "0.6412534", "0.639565", "0.63825333", "0.63631266", "0.63585275", "0.63403...
0.7447002
0
Test the rover heading direction
def test_get_heading(self): rover = Rover(self.plateau_dimensions, self.rover_initial_position, Rover.DIRECTIONS.get('E')) self.assertEqual(rover.get_heading, 'E')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_direction(self):\n is_direction_correct = False\n while not is_direction_correct:\n direction = random.randint(0, 2)\n if direction == 0:\n self.turtle.left(90)\n elif direction == 1:\n self.turtle.right(90)\n else:\n ...
[ "0.70874095", "0.6434417", "0.6321018", "0.6321018", "0.6288908", "0.6286452", "0.6273468", "0.6260878", "0.6248477", "0.622202", "0.61888975", "0.61888975", "0.61508685", "0.61392933", "0.6133344", "0.61124337", "0.6094306", "0.60907185", "0.6074815", "0.606621", "0.60652757...
0.6713418
1
Test for exception for invalid rover heading direction from the the instructions
def test_get_heading_raise_exception(self): rover = Rover(self.plateau_dimensions, self.rover_initial_position, 8) with self.assertRaises(InvalidDirectionError): rover.get_heading
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_condition(direction, steps):\n assert direction in ['L', 'R', 'U', 'D'], \"Direction information has an incorrect alphabet\"\n assert steps > 0, \"Step value is zero\"", "def move_invalid():\n check50.run(run_command).stdin(\"EAST\").stdout(\"Invalid command.\")", "def verify_legal_move(self...
[ "0.65833044", "0.6357308", "0.62598133", "0.6221409", "0.6108726", "0.6033738", "0.59482646", "0.59148085", "0.5909448", "0.5874125", "0.5872158", "0.5871811", "0.57743484", "0.5769745", "0.57350487", "0.5729894", "0.5703237", "0.5687465", "0.567887", "0.5635186", "0.56183463...
0.6877422
0
Get current scene name.
def get_current_scene_name(): scene_name = cmds.file(query=True, sceneName=True, shortName=True) scene_name = osp.splitext(scene_name)[0] return scene_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_scene_name(self):\n return self._document.GetDocumentName()", "def name(self):\n return self._scene_name", "def currentBaseSceneName(self):\n logger.debug(\"Func: currentBaseSceneName/getter\")\n\n return self._currentBaseSceneName", "def scene_name():\n\n pass", "def bsp...
[ "0.8562304", "0.8504572", "0.8130134", "0.76879084", "0.7049954", "0.67965925", "0.6732677", "0.6724501", "0.66471833", "0.6629287", "0.659216", "0.659216", "0.659216", "0.659216", "0.659216", "0.659216", "0.659216", "0.659216", "0.659216", "0.659216", "0.659216", "0.659216...
0.87072027
0
Export animation of a node into video file.
def export_animation_into_video( root_node_name, save_dir='./', save_filename='', start_time=0, end_time=240 ): pprint("===> root_node_name: {}".format(root_node_name)) pprint("===> save_dir: {}".format(save_dir)) if not osp.exists(save_dir): os.makedirs(save_dir) # save_di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_video(datafile, outfile, overwrite,\n style, dpi, figsize, writer,\n show, budget, till_time, from_time,\n fps, bitrate, artist_tag, progress,\n ):\n\n from matplotlib import animation\n from microbenthos.dataview import HDFModelData,...
[ "0.65230316", "0.64608645", "0.62542063", "0.6188744", "0.61510164", "0.6134072", "0.6096631", "0.6040492", "0.5951504", "0.5910029", "0.5882583", "0.58463424", "0.5841342", "0.5831505", "0.58111906", "0.5801093", "0.57409114", "0.5718502", "0.5655921", "0.5654891", "0.565477...
0.8142775
0
This test validate payment type in cash
def test_payment_term_type_cash(self): self.payment_term_cash = self.env.ref( 'payment_term_type.payment_term_cash') self.assertEqual( self.payment_term_cash.payment_type, 'cash', 'Payment term should be in cash')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_submit_iso20022_payment_instruction(self):\n pass", "def test_payment_term_type_credit(self):\n self.payment_term_credit = self.env.ref(\n 'payment_term_type.payment_term_credit')\n self.assertEqual(\n self.payment_term_credit.payment_type, 'credit',\n ...
[ "0.69790846", "0.6930679", "0.66739774", "0.6649885", "0.6480269", "0.6470807", "0.64189327", "0.63895375", "0.6378604", "0.63263845", "0.6289536", "0.6287742", "0.61795413", "0.616937", "0.61440384", "0.6131297", "0.6121087", "0.6107333", "0.60896826", "0.6082444", "0.606850...
0.75920767
0
This test validate payment type in credit
def test_payment_term_type_credit(self): self.payment_term_credit = self.env.ref( 'payment_term_type.payment_term_credit') self.assertEqual( self.payment_term_credit.payment_type, 'credit', 'Payment term should be in credit')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_submit_iso20022_payment_instruction(self):\n pass", "def test_individual_ACH(self):\n form_data = self.form_data()\n form_data['payment_type'] = 'DirectDebit'\n form = DonationPaymentForm(data=form_data)\n self.assertTrue(form.is_valid())", "def test_validate_payment...
[ "0.70621574", "0.6863627", "0.67322314", "0.67029196", "0.66760445", "0.66378087", "0.64854723", "0.6427155", "0.63588053", "0.62683445", "0.62388813", "0.61590767", "0.61554676", "0.61176294", "0.6089378", "0.60601753", "0.6043033", "0.6015355", "0.59876543", "0.5984294", "0...
0.7584601
0
Generate a regularlyspaced collector field layout. See [1]_ for examples on how to use the function. Field layout parameters and limits are described in [2]_. Notes The field layout can be specified either using selecting a standard layout using the layout_type argument or by specifying the individual layout parameters...
def generate_field_layout(gcr, collector_area, L_min, neighbor_order, aspect_ratio=None, offset=None, rotation=None, layout_type=None, plot=True): # noqa: E501 # Consider special layouts which can be defined only by GCR if layout_type == 'square': asp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_layout(layout_type, xlabel, ylabel):\n\n base_layout = {\n \"font\": {\"family\": \"Raleway\"},\n \"hovermode\": \"closest\",\n \"margin\": {\"r\": 20, \"t\": 0, \"l\": 0, \"b\": 0},\n \"showlegend\": False,\n }\n\n if layout_type == \"scatter3d\":\n base_lay...
[ "0.5605408", "0.5459787", "0.53899556", "0.5274955", "0.50925547", "0.505614", "0.5000735", "0.4974556", "0.49709538", "0.49606627", "0.4953922", "0.49284118", "0.49278405", "0.48931682", "0.48262033", "0.48182365", "0.48010537", "0.479277", "0.47884673", "0.4776554", "0.4728...
0.7638738
0
Calculate the shading fraction for any layout of twoaxis tracking collectors. See [1]_ for examples on how to use the function.
def two_axis_shading_fraction(solar_azimuth, solar_elevation, collector_geometry, L_min, tracker_distance, relative_azimuth, plot=False): # noqa: E501 # If the sun is below the horizon, set the shading fraction to nan if solar_elevation < 0: r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def density(self):\r\n return self.count_ones() / float(self.xspan * self.yspan)", "def split_necessity(self):\n return max(self._color_var_rel) * self.n_pix\n # return reduce(int.__mul__, (l-u for u,l in self.bounds)) * self.n_pix", "def numberDensity(frametracks):\n ftr = frametracks\n ...
[ "0.5671327", "0.5435652", "0.5128012", "0.50895816", "0.50872785", "0.5040767", "0.49535114", "0.48906615", "0.48811007", "0.4826712", "0.48183963", "0.48176306", "0.4807215", "0.48055363", "0.48045817", "0.47947884", "0.47801843", "0.47741193", "0.47709098", "0.4756852", "0....
0.6167704
0
Set script dir path.
def set_script_dir(self, path): self.script_dir = path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def AddScriptDirToPath():\n path = os.path.abspath(__file__)\n\n for _ in range(3):\n path, _ = os.path.split(path)\n\n if not path in sys.path:\n sys.path.append(path)", "def change_to_script_directory(file_path):\n LOG.info('In change_to_script_directory')\n abspath = os.path.abspath(fil...
[ "0.7004337", "0.68930465", "0.6664939", "0.6406351", "0.6374064", "0.6350717", "0.62701786", "0.6212368", "0.6133288", "0.6040454", "0.60179245", "0.59946203", "0.59946203", "0.58985263", "0.58980566", "0.58781874", "0.587459", "0.5868243", "0.5842594", "0.5746359", "0.574455...
0.89241934
0
When the wiimote is powered down, this mesg callback is called, and a is [(8, 1)]. I REALLY have no idea why, and not time to dig in cwiid's source code ATM. Documentation would
def mesg_cb(self, a, b): if a[0] == (8, 1): self.omg_please_stop = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def battery_unplugged(self):\n self._info(\"battery_unplugged\")", "def diag_callback(self, msg, hand_name):\n\n state_changed = False\n if len(msg.status) > 1:\n for state in msg.status:\n if state.name == hand_name + \" EtherCAT Dual CAN Palm\":\n ...
[ "0.5440914", "0.54311347", "0.5404832", "0.52493477", "0.52066785", "0.5201481", "0.51684016", "0.5166866", "0.5164882", "0.5163768", "0.51343095", "0.5133924", "0.5128642", "0.51095194", "0.51079625", "0.5104123", "0.5102299", "0.5100992", "0.5089179", "0.50835484", "0.50829...
0.65010446
0