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
Gets the state of bool and returns it as a string
def get_state_tostring(rapid_data): try: if rapid_data.RapidType == 'bool': res = 'State = %s' % rapid_data.Value return res else: err = 'DataType is ' + rapid_data.RapidType + ' and not bool.' return err except Exception, err: return e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boolToString(aBoolean):\n if aBoolean:\n return \"true\"\n return \"false\"", "def get_status(bool):\n if bool:\n return \"✓\"\n else:\n return \"...\"", "def convertToString(boolean: bool) -> str:\n ...", "def get_string(self):\n boolean_value_string = str(...
[ "0.7561416", "0.73963606", "0.73042196", "0.7211878", "0.71062225", "0.7031119", "0.69903034", "0.69739217", "0.69646794", "0.6963175", "0.6944954", "0.69127375", "0.68968815", "0.6888625", "0.68097264", "0.67869693", "0.6717488", "0.6701653", "0.6690473", "0.6689842", "0.668...
0.7408383
1
Create a group for each volume in Cubit and add the volume to its group This is useful when working with assemblies, as the group structuring is retained throughout webcutting for eventual hexmeshing. This makes it easier to apply operations onto entire 'parts', such as imprint and merge operations.
def part_volumes_to_part_groups(prefix=None): if prefix == None: prefix = "part" V = cubit.get_entities("volume") for vid in V: cubit.cmd(f"create group '{prefix}_{vid}'") cubit.cmd(f"{prefix}_{vid} add volume {vid}")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_groups(self):\n for g in self.groups:\n self.add_group(groupname=g['groupname'],\n grouptitle=g['grouptitle'],\n path_to_group=g['path'])", "def create_volume(self, volume):\n vg_name = self.get_volume_group_name(volume.id)\n ...
[ "0.6239366", "0.6179523", "0.61773646", "0.60487336", "0.60022634", "0.5921083", "0.59190804", "0.5872536", "0.5857526", "0.5844531", "0.5841097", "0.5722707", "0.56823695", "0.56412196", "0.5620686", "0.5607933", "0.5548481", "0.55290765", "0.5522698", "0.54874456", "0.54587...
0.74218816
0
Cycle through each group in Cubit and apply imprint and merge operations This script is intended to work in conjunction with the `part_volumes_to_part_groups()` method provided above, to simplify imprint and merge mesh operations on assemblies.
def imprint_merge_each_group(): G = cubit.get_entities("group") for gid in G: vid = cubit.get_group_volumes(gid) if len(vid)>1: cubit.cmd(f"imprint vol {list_to_str(vid)}") cubit.cmd(f"merge vol {list_to_str(vid)}")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def part_volumes_to_part_groups(prefix=None):\r\n \r\n if prefix == None:\r\n prefix = \"part\"\r\n V = cubit.get_entities(\"volume\")\r\n for vid in V:\r\n cubit.cmd(f\"create group '{prefix}_{vid}'\")\r\n cubit.cmd(f\"{prefix}_{vid} add volume {vid}\")", "def batchAnalysis(groupfil):\n groups = [...
[ "0.5810753", "0.567241", "0.5430803", "0.5392502", "0.5296513", "0.5141839", "0.5131266", "0.509134", "0.50574565", "0.50171715", "0.49960905", "0.49957606", "0.49899256", "0.49641788", "0.49630186", "0.49581245", "0.49410984", "0.49235407", "0.49215546", "0.49210194", "0.491...
0.76621246
0
Function that takes as input a partiallybuilt SQuAD DataFrame (with at least ['context', 'answer', 'answer_start'] columns) and returns the same DataFrame with the new column 'answer_end', that consists of last answer character index
def _add_end_index(self, df): ans_end = [] for index, row in df.iterrows(): t = row.answer s = row.answer_start ans_end.append(s + len(t)) df["answer_end"] = ans_end return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _lost_answers_indexes(self, df, tokenized_contexts):\n whole_answers_start = df[\"answer_start\"].tolist()\n whole_answers_end = df[\"answer_end\"].tolist()\n lost_dirty, lost_truncated = [], []\n for i, (c, s, e) in enumerate(\n zip(tokenized_contexts, whole_answers_star...
[ "0.5642789", "0.53538007", "0.52393335", "0.5226168", "0.5217864", "0.51208067", "0.5069592", "0.5007896", "0.5005129", "0.5002634", "0.49440268", "0.4912213", "0.49117282", "0.4893948", "0.48366824", "0.4810873", "0.4799291", "0.47896028", "0.47729725", "0.47614086", "0.4759...
0.69397795
0
Remove rows that contain incorrect answers, (either because of the the tokenizer's truncation or because they were not correct in the first place)
def _remove_lost_answers(self, df): tokenized_contexts = self.tokenizer.tokenize( df["context"].tolist(), "context", special=False ) lost_truncated, lost_dirty = self._lost_answers_indexes(df, tokenized_contexts) to_remove = lost_truncated + lost_dirty clean_df = df.d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_data(inputFile, cutoff=0.95):\r\n ISOcodes = {'sk': 0, 'fr': 1, 'es': 2, 'de': 3, 'pl': 4}\r\n\r\n df = pd.read_csv(inputFile, encoding=\"utf8\")\r\n df['text'].replace('', np.nan, inplace=True)\r\n df.dropna(subset=['text'], inplace=True)\r\n total = len(df)\r\n englishCount, misclassi...
[ "0.59768844", "0.58624184", "0.5826944", "0.5787648", "0.57419413", "0.5739159", "0.5724699", "0.5692569", "0.5639244", "0.5627357", "0.56174916", "0.56031877", "0.55832124", "0.55652976", "0.5550268", "0.5535883", "0.5491192", "0.5468092", "0.5459994", "0.5443922", "0.544233...
0.66155213
0
Group answers to the same question into a single row
def _group_answers(self, df): if "answer" not in df.columns: return df return ( df.groupby(["question_id", "question", "title", "context_id", "context"]) .agg({"answer": list, "answer_start": list, "answer_end": list}) .reset_index() )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_all_correct_answers_for_wrong_qs_in_csv(self):\n # from nose.tools import set_trace; set_trace()\n my_csv_file = open(\"output_csv\", \"w\")\n for form_card_ind in range(2, 5):\n for div_ind in range(2, 4):\n question_title = self.score_page.find_all_grading...
[ "0.57340735", "0.5725098", "0.5506427", "0.54633534", "0.53794444", "0.5274659", "0.5197814", "0.51925075", "0.5123404", "0.5111936", "0.50927466", "0.50443393", "0.50247186", "0.50171703", "0.50085396", "0.4988077", "0.49810994", "0.49488193", "0.48795906", "0.48672336", "0....
0.7415085
0
Plots up to 4 columns as before and after normalization, using the number of bins as passed
def compare_histograms(df, df_norm, fignum, fields, binns): fig = plt.figure(num=fignum, figsize=(18,18)) fig.suptitle('Histogram before and after normalization', fontsize=22) ax1 = fig.add_subplot(421, axisbg='0.94') ax2 = fig.add_subplot(422, axisbg='0.94') ax3 = fig.add_subplot(423, axisbg='0.94'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalized_hist_dataframe(data_column, bin_number=50, output_dir='/var/tmp/'):\n db = celldatabase.load_hdf(\"/var/tmp/figuresdata/2019astrpi/direct_and_indirect_cells.h5\")\n # dbTuned = db.query(studyparams.TUNING_FILTER)\n D1DB = db.query(studyparams.D1_CELLS)\n nD1DB = db.query(studyparams.nD1_...
[ "0.6174681", "0.6065753", "0.58939785", "0.5858456", "0.585392", "0.5778824", "0.5772834", "0.5772834", "0.5765824", "0.57647973", "0.5763682", "0.5740469", "0.5688683", "0.5680666", "0.56742305", "0.565243", "0.56125164", "0.5606433", "0.55953777", "0.5593033", "0.5593033", ...
0.6554766
0
Decorator to validate fetcher access points of a given data source
def checkAccessPoint(AccessPoint): def wrapper(*args): if AccessPoint.__name__ not in args[0].valid_access_points: raise InvalidFetcherAccessPoint( "'%s' not available with '%s' src. Available access point(s): %s" % (AccessPoint.__name__, a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def proxy_check(self, proxy):", "def can_access_datasource(self, datasource: \"BaseDatasource\") -> bool:\n\n try:\n self.raise_for_access(datasource=datasource)\n except SupersetSecurityException:\n return False\n\n return True", "def check_url_kwarg_for_http(functio...
[ "0.5583874", "0.5550153", "0.55275315", "0.5491639", "0.543794", "0.54285276", "0.54213953", "0.5369566", "0.53435016", "0.52621186", "0.5239755", "0.5231236", "0.5182703", "0.5170501", "0.5145664", "0.5103957", "0.5099573", "0.50915235", "0.5045558", "0.5043653", "0.50427204...
0.7359599
0
Fetch and return data as xarray.DataSet Returns
def to_xarray(self, **kwargs): if not self.fetcher: raise InvalidFetcher( " Initialize an access point (%s) first." % ",".join(self.Fetchers.keys()) ) xds = self.fetcher.to_xarray(**kwargs) xds = self.postproccessor(xds) return xds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collect_datset(self):\n response = requests.get(self.url)\n lines = response.text.splitlines()\n data = []\n for item in lines:\n item = item.split(\",\")\n data.append(item)\n data.pop(0) # to remove labels from list\n dataset = np.matrix(data)\n...
[ "0.6725734", "0.6548247", "0.64486486", "0.64259756", "0.64254236", "0.6370132", "0.63647956", "0.6182566", "0.616453", "0.613698", "0.6089343", "0.606105", "0.6022825", "0.6015031", "0.6013282", "0.6007527", "0.59577554", "0.59529793", "0.59522295", "0.5921434", "0.5905289",...
0.665941
1
Clear data cached by fetcher
def clear_cache(self): if not self.fetcher: raise InvalidFetcher( " Initialize an access point (%s) first." % ",".join(self.Fetchers.keys()) ) return self.fetcher.clear_cache()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_cache(self):\n requests.get(url=self.proxy_url+'/clear_cache')", "def clear_cache(self):\n pass", "def clear_cache():\n # TODO\n pass", "def clear_cache(self):\n\n for dataset in self._datasets:\n dataset.clear_cache()", "def cache_clear(self):\n\t\ts...
[ "0.7458527", "0.7436181", "0.73642033", "0.73064405", "0.7302861", "0.7270309", "0.7240838", "0.71944416", "0.71434283", "0.70971024", "0.7072682", "0.7046859", "0.7020051", "0.70122194", "0.69788504", "0.6977603", "0.6891961", "0.68614626", "0.68614626", "0.6848789", "0.6843...
0.759135
0
Fetch and return index data as xarray DataSet This is a shortcut to .load().index.to_xarray() Returns
def to_xarray(self, **kwargs): if self._AccessPoint not in self.valid_access_points: raise InvalidFetcherAccessPoint( " Initialize an access point (%s) first." % ",".join(self.Fetchers.keys()) ) return self.load().index.to_xarray(**kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_xarray_data():\n pressure = xr.DataArray([850., 700., 500.], dims=('isobaric',), attrs={'units': 'hPa'})\n temp = xr.DataArray([[[[296., 295., 294.], [293., 292., 291.]],\n [[286., 285., 284.], [283., 282., 281.]],\n [[276., 275., 274.], [273., 272....
[ "0.66301817", "0.6526453", "0.64050734", "0.6305211", "0.6266725", "0.62328595", "0.6203111", "0.61584604", "0.6153438", "0.6139485", "0.60812867", "0.6065309", "0.6064389", "0.60103244", "0.60103244", "0.6007262", "0.60051835", "0.60036457", "0.60001653", "0.5986962", "0.591...
0.68834615
0
Parse a learning rate argument into an initial rate and an optional scheduler callback.
def parse_learning_rate_arg(learning_rate: str): sp = str(learning_rate).split('*') initial = float(sp[0]) if len(sp) == 1: return initial, [] elif len(sp) == 2: return initial, [_parse_schedule(sp[1])] assert False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_learning_rate(args,optimizer, epoch):\n lr = args.lr\n schedule = args.lr_schedule\n # schedule from TRADES repo (different from paper due to bug there)\n if schedule == 'trades':\n if epoch >= 0.75 * args.epochs:\n lr = args.lr * 0.1\n # schedule as in TRADES paper\n ...
[ "0.632414", "0.626112", "0.62322897", "0.61935663", "0.6161706", "0.61524177", "0.61368936", "0.6128309", "0.6113266", "0.6106419", "0.60915613", "0.6090125", "0.60646015", "0.6049675", "0.6031494", "0.6018241", "0.60113454", "0.6008282", "0.60074973", "0.597578", "0.59740263...
0.77980846
0
Returns a LaTeX bmatrix
def _repr_latex_(self): if len(self.shape) > 2: raise ValueError("bmatrix can at most display two dimensions") def fmt(x): if x == 0: return "." if np.abs(x) < EPS: return "0." return "{:.2g}".format(x) temp_string...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bmatrix(a):\n if len(a.shape) > 2:\n raise ValueError('bmatrix can at most display two dimensions')\n lines = str(a).replace('[', '').replace(']', '').splitlines()\n rv = [r'\\begin{bmatrix}']\n rv += [' ' + ' & '.join(l.split()) + r'\\\\' for l in lines]\n rv += [r'\\end{bmatrix}']\n ...
[ "0.7743502", "0.74842423", "0.63150483", "0.6305179", "0.63013434", "0.6166482", "0.5991281", "0.59912777", "0.59640145", "0.59256893", "0.5863013", "0.5815379", "0.57520753", "0.571899", "0.5717092", "0.571185", "0.5644417", "0.5642071", "0.55754423", "0.55503935", "0.554882...
0.76726884
1
Function to generate a slab firework. Returns a TransmuterFW if bulk_structure is specified, constructing the necessary transformations from the slab and slab generator parameters, or an OptimizeFW if only a slab is specified.
def get_slab_fw( slab, transmuter=False, db_file=None, vasp_input_set=None, parents=None, vasp_cmd="vasp", name="", add_slab_metadata=True, ): vasp_input_set = vasp_input_set or MPSurfaceSet(slab) # If a bulk_structure is specified, generate the set of transformations, # els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_wf_slab(\n slab,\n include_bulk_opt=False,\n adsorbates=None,\n ads_structures_params=None,\n vasp_cmd=\"vasp\",\n db_file=None,\n add_molecules_in_box=False,\n):\n fws, parents = [], []\n\n if adsorbates is None:\n adsorbates = []\n\n if ads_structures_params is None:\...
[ "0.67040366", "0.5640458", "0.51109827", "0.49943426", "0.49048126", "0.486088", "0.47991237", "0.474455", "0.47086114", "0.4688175", "0.46360973", "0.46182954", "0.46181244", "0.4612753", "0.4609356", "0.45899773", "0.4575776", "0.45464182", "0.45347545", "0.45274094", "0.44...
0.6714504
0
Gets a set of slab transformation params
def get_slab_trans_params(slab): slab = slab.copy() if slab.site_properties.get("surface_properties"): adsorbate_indices = [ slab.index(s) for s in slab if s.properties["surface_properties"] == "adsorbate" ] slab.remove_sites(adsorbate_indices) # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_params(self):\n return {\n \"nspecies\": self.nspecies,\n \"lmax\": self.lmax,\n \"nmax\": self.nmax,\n \"rcut\": self.rcut,\n \"sigma\": self.sigma,\n \"trans_width\": self.trans_width\n }", "def get_test_params(cls, par...
[ "0.62581253", "0.6234418", "0.6016546", "0.6016546", "0.5990056", "0.5886807", "0.5869015", "0.5863636", "0.5848084", "0.58105665", "0.5797687", "0.5769558", "0.5769558", "0.5768116", "0.5768116", "0.5758246", "0.57491994", "0.5703122", "0.56741905", "0.5670331", "0.5665315",...
0.6935679
0
Gets a workflow corresponding to a slab calculation along with optional adsorbate calcs and precursor oriented unit cell optimization
def get_wf_slab( slab, include_bulk_opt=False, adsorbates=None, ads_structures_params=None, vasp_cmd="vasp", db_file=None, add_molecules_in_box=False, ): fws, parents = [], [] if adsorbates is None: adsorbates = [] if ads_structures_params is None: ads_structure...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_slab_trans_params(slab):\n slab = slab.copy()\n if slab.site_properties.get(\"surface_properties\"):\n adsorbate_indices = [\n slab.index(s)\n for s in slab\n if s.properties[\"surface_properties\"] == \"adsorbate\"\n ]\n slab.remove_sites(adsorba...
[ "0.5356782", "0.5137777", "0.5095916", "0.50181425", "0.49951154", "0.4963605", "0.49125382", "0.49036023", "0.48759225", "0.48211554", "0.47875145", "0.4776284", "0.47653547", "0.47547576", "0.47491452", "0.47476944", "0.47375447", "0.4729218", "0.47158277", "0.4706253", "0....
0.531252
1
Get list of spoke drivers.
def spoke_drivers(self): location = "spokedrivers" return self.send_get(location, params={})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_drivers(self):\n return self.ironic_client.driver.list()", "def get_drivers():\n return [str(d) for d in drivers.values()]", "def list_drivers():\n return jsonify(drivers)", "def get_driver_list():\n return list(object_store.ObjectStorageDriver.registry.keys())", "def get_driver_na...
[ "0.74357295", "0.70358056", "0.6950667", "0.6941811", "0.6867647", "0.68359935", "0.65849864", "0.6453694", "0.60488504", "0.59476393", "0.58313", "0.55947214", "0.5551657", "0.5551657", "0.5551657", "0.5551657", "0.5551657", "0.5551657", "0.5529575", "0.54744893", "0.5459883...
0.8594227
0
Delete a pin property.
def pin_delete(self, pin_id=None, path=None): if path == None: path = [] if pin_id != None: path.insert(0, pin_id) path.insert(0, "pin") location = '/'.join(path) return self.send_delete(location, params={})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_user_property(self, property):\n try:\n if property in self._user_properties.keys():\n self._user_properties.pop(property)\n except:\n logger.info(f\"Failed to delete user property: {property}\")", "def destroy(self, request, slug):\n found_pro...
[ "0.6841758", "0.6535029", "0.63882107", "0.6322994", "0.62899005", "0.6169886", "0.6169886", "0.6169886", "0.6169886", "0.61678183", "0.6115541", "0.5974684", "0.5961329", "0.58796346", "0.58781785", "0.58167297", "0.5778079", "0.57440794", "0.56999385", "0.56785053", "0.5642...
0.66737354
1
Add or delete schedule entry for pin.
def pin_schedule(self, pin_id, new_entry=None, entry_index=None): if new_entry == None: new_entry = {} if new_entry != {} and entry_index != None: #can't create & delete return False elif entry_index != None: #delete the entry return self.pin_delete(pin_id=pin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put_schedule(self, name, schedule):\n self.__schedules[name] = schedule", "def add(self, schedule):\n try:\n if schedule in self.set:\n self.log.error(\"%s has already been added to this Scheduler.\" %\n schedule)\n return\n ...
[ "0.62823707", "0.61584544", "0.5606634", "0.5485308", "0.5467268", "0.5453536", "0.5435338", "0.5407546", "0.5361484", "0.53577447", "0.5332148", "0.5296647", "0.5280061", "0.5251361", "0.5243916", "0.5243916", "0.5235594", "0.51785713", "0.51239806", "0.51238644", "0.5030048...
0.74206275
0
GET/PUT for pin object.
def pin(self, pin_id=None, path=None, value=None, **kwargs): if path == None: path = [] if pin_id != None: path.insert(0, pin_id) path.insert(0, "pin") location = '/'.join(path) if value != None: decoded_json_response = self.send_put(location,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_pin(request, pk):\n\n try:\n snippet = Persona.objects.get(pin=pk)\n except Persona.DoesNotExist:\n return JSONResponse('No hay usuarios para ser Atendidos!', status=400)\n # return HttpResponse('false', content_type='application/json')\n\n if request.method == 'GET':\n ...
[ "0.638429", "0.5804245", "0.5800485", "0.57738566", "0.57719696", "0.5763119", "0.57423925", "0.5706368", "0.5704966", "0.5700083", "0.56714535", "0.56144094", "0.5611113", "0.5611113", "0.5611113", "0.56100076", "0.5599714", "0.5586745", "0.55804753", "0.5579179", "0.5522294...
0.6827182
0
Grab garage controller driver list.
def garage_controller_drivers(self): location = "garagecontrollerdrivers" return self.send_get(location, params={})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def camera_controller_drivers(self):\n location = \"cameracontrollerdrivers\"\n return self.send_get(location, params={})", "def get_driver_list():\n return list(object_store.ObjectStorageDriver.registry.keys())", "def list_drivers(self):\n return self.ironic_client.driver.list()", "d...
[ "0.7385293", "0.7233574", "0.7212199", "0.69809055", "0.693919", "0.6764003", "0.67531717", "0.6677916", "0.620572", "0.5986577", "0.59750503", "0.59674835", "0.59054404", "0.5868078", "0.58067846", "0.5736845", "0.57081175", "0.5707443", "0.5699345", "0.5640303", "0.5636588"...
0.8116447
0
GET/PUT for garage controller.
def garage_controller(self, garage_controller_id=None, path=None, value=None, **kwargs): if path == None: path = [] if garage_controller_id != None: path.insert(0, garage_controller_id) path.insert(0, "garagecontroller") location = '/'.jo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, request):\n pass", "def get(self):\n self.get_or_post(method='GET')", "def ng_get(self, request, *args, **kwargs):\r\n return self.build_json_response(self.get_object())", "def view_put():\n\n return jsonify(\n get_dict(\"url\", \"args\", \"form\", \"data\", \"ori...
[ "0.6314442", "0.631404", "0.61549205", "0.6116851", "0.60219365", "0.5981975", "0.59726673", "0.59723544", "0.59723544", "0.59588516", "0.5905724", "0.5876426", "0.58338636", "0.58303607", "0.5806022", "0.5806022", "0.57948124", "0.57812124", "0.57623196", "0.5728819", "0.571...
0.67237455
0
Create a new garage controller.
def garage_controller_create(self, name=None, driver=None, driver_info=None): location = "garagecontroller" return self.send_post(location, params={"name":name, "driver":driver, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_controller() -> Controller:\n _controller = Controller()\n return _controller", "def create_controller(self, typ):\n return self.controller_objects[typ]()", "def camera_controller_create(self, name=None,\n driver=None, driver_info=None):\n location...
[ "0.7512562", "0.6439229", "0.6137958", "0.6010644", "0.59439", "0.58159643", "0.5755364", "0.56156963", "0.55355316", "0.5443521", "0.53891313", "0.5351185", "0.52447784", "0.5228676", "0.5224241", "0.5224241", "0.5195128", "0.5191956", "0.5186482", "0.5164106", "0.5155211", ...
0.76918703
0
Delete a garage controller.
def garage_controller_delete(self, garage_controller_id=None, path=None): if path == None: path = [] if garage_controller_id: path.insert(0, garage_controller_id) path.insert(0, "garagecontroller") location = '/'.join(path) return self.send_del...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_controller(cls, args, config):\n # print \"MOLNSProvider.delete_provider(args={0}, config={1})\".format(args, config)\n if len(args) == 0:\n raise MOLNSException(\"USAGE: molns cluser delete name\")\n config.delete_object(name=args[0], kind='Controller')", "def camera_c...
[ "0.7129146", "0.6781368", "0.64461946", "0.63255733", "0.62400234", "0.6213546", "0.61884904", "0.6128076", "0.6127299", "0.6050601", "0.60204345", "0.6017519", "0.5989827", "0.5989827", "0.5989827", "0.5989827", "0.5947876", "0.59369946", "0.59218615", "0.5918555", "0.590976...
0.8406111
0
Grab camera controller driver list.
def camera_controller_drivers(self): location = "cameracontrollerdrivers" return self.send_get(location, params={})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cameras_list():\n lib.initlib()\n return lib.is_GetCameraList()", "def get_camera_list():\n cameras = []\n modules = glob.glob(os.path.join(os.path.dirname(__file__), '*_camera.py'))\n for module in modules:\n m = import_module('.' + os.path.basename(module)[:-3], __name__)\n ...
[ "0.7177996", "0.71014553", "0.6889121", "0.6513389", "0.64207715", "0.63801694", "0.6355844", "0.6354507", "0.6349286", "0.6312726", "0.62594205", "0.61337095", "0.6094902", "0.60888165", "0.600037", "0.5992191", "0.5943546", "0.59393626", "0.59254307", "0.59128296", "0.58715...
0.82922775
0
GET/PUT for camera controller.
def camera_controller(self, camera_controller_id=None, path=None, value=None, **kwargs): if path == None: path = [] if camera_controller_id != None: path.insert(0, camera_controller_id) path.insert(0, "cameracontroller") location = '/'.jo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cam():\n\treturn Response(gen(camera),\n\t\t\t\t\tmimetype='multipart/x-mixed-replace; boundary=frame'), 200", "def camera(self):\n return self.__camera", "def camera(self):\n return self._camera", "def camera(self):\n return self._camera", "def get_camera(camid):\n camera = get...
[ "0.65088314", "0.60280484", "0.5967427", "0.5967427", "0.59517896", "0.59313315", "0.5858214", "0.5843304", "0.57947284", "0.577467", "0.5726902", "0.5630387", "0.5625143", "0.5621106", "0.56064785", "0.5561165", "0.55356747", "0.5528753", "0.55175257", "0.55114865", "0.55013...
0.757974
0
Create a new camera controller.
def camera_controller_create(self, name=None, driver=None, driver_info=None): location = "cameracontroller" return self.send_post(location, params={"name":name, "driver":driver, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createCamera():\n prefs = getPreferences()\n\n # Remove any pre-existing preview camera.\n if CAM_NAME in bpy.data.cameras:\n bpy.data.cameras.remove(bpy.data.cameras[CAM_NAME], do_unlink=True)\n\n # Store the current scene camera.\n cache.values[\"sceneCamera\"] = bpy.context.scene.camer...
[ "0.7482744", "0.7170251", "0.707746", "0.68586093", "0.6783389", "0.6770215", "0.6494709", "0.645442", "0.6439012", "0.6268004", "0.61889476", "0.6141001", "0.60508347", "0.6011696", "0.59724355", "0.59656", "0.59611076", "0.5939466", "0.5935062", "0.5889589", "0.5839069", ...
0.7897751
0
Delete a camera controller.
def camera_controller_delete(self, camera_controller_id=None, path=None): if path == None: path = [] if camera_controller_id: path.insert(0, camera_controller_id) path.insert(0, "cameracontroller") location = '/'.join(path) return self.send_del...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def delete(self, request):\n\n userid = await authenticated_userid(request)\n project = await request.app.context_project(request, userid)\n\n await request.post()\n\n camera_id = request.match_info['camera_file_id']\n\n log = request['slog']\n log.debug('request: ca...
[ "0.67821556", "0.666302", "0.6652054", "0.66309637", "0.6466971", "0.64224917", "0.6243469", "0.60542005", "0.5906114", "0.5870111", "0.5823149", "0.5715122", "0.55625546", "0.5483713", "0.5471664", "0.54044414", "0.5398379", "0.53631467", "0.534239", "0.52743757", "0.5264109...
0.85754865
0
Return a doc for classification.
def doc(docid): data = {'id':docid, 'text':"Some made up text for classification"} return _send(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def classify_document(classification_file, classification_dict, document):\n\tdocument_dictionary = make_prob_dictionary(classification_file, classification_dict)\n\tdocument = read_doc(document)\n\tdoc_words = document[0]\n\tdoc_length = float(document[1])\n\tdocument = probabilities(doc_words, doc_length, classi...
[ "0.6846127", "0.65232426", "0.6481798", "0.64392984", "0.63728017", "0.6331718", "0.62706006", "0.6158677", "0.6158677", "0.60652834", "0.6032085", "0.6011661", "0.6000423", "0.599248", "0.59622985", "0.59619105", "0.5956338", "0.5899538", "0.58319587", "0.5824523", "0.581842...
0.67577565
1
this method returns a onehot vector of the given size, where the 1 is placed in the ind entry.
def get_one_hot(size, ind): one_hot = np.zeros((size,)) one_hot[ind] = 1 return one_hot
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_one_hot(ind, n):\n vec = np.zeros(n)\n vec[ind] = 1\n return vec", "def turn_to_one_hot(self,length,ind):\n one_hot = [0 for _ in range(length)]\n if (ind >= len(one_hot)):\n one_hot[-1] = 1\n else:\n one_hot[ind] = 1\n return one_hot", "def one...
[ "0.84444565", "0.8298798", "0.8195772", "0.8189615", "0.8126685", "0.81259286", "0.81199", "0.810238", "0.7999138", "0.7949889", "0.79117304", "0.7889848", "0.7886849", "0.77816015", "0.7770782", "0.77627516", "0.7722842", "0.7692494", "0.76899445", "0.7679778", "0.7666221", ...
0.8994864
0
this method gets a sentence, and a mapping between words to indices, and returns the average onehot embedding of the tokens in the sentence.
def average_one_hots(sent, word_to_ind): known_words = 0 size = len(word_to_ind.keys()) sum_vec = np.zeros((size,)) for token in sent.text: #going over all tokens and summing their embeddings if (token in word_to_ind): sum_vec += get_one_hot(size, word_to_ind[token]) know...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_input_sentence(sess, char_dict, model_settings, model_vars, sentence):\n chars = list(sentence.strip())\n cids = char_dict.chars2cids(chars)\n \n in_embedding = np.eye(model_settings['input_classes'])\n one_hot = in_embedding[cids]\n one_hot_by_t = np.expand_dims(one_hot, 1)\n\n ...
[ "0.70716166", "0.67135066", "0.64619", "0.64208233", "0.63380706", "0.63346714", "0.6219714", "0.6205237", "0.6202509", "0.61407244", "0.6089581", "0.60849255", "0.6080179", "0.6057294", "0.605728", "0.60515374", "0.6020962", "0.60118914", "0.59976226", "0.59922934", "0.59855...
0.81724966
0
this function gets a dictionary mapping words to their counts, and returns a mapping between words to their index. Words that come after the cutoff
def get_word_to_ind (count_dict, cutoff = 0): word_to_ind = {} if (not cutoff): cutoff = len(count_dict.keys()) #sorting the words by their count: sorted_tuples = list(reversed(sorted(count_dict.items(), key=operator.itemgetter(1)))) for i in range(cutoff): cur_word = sorted_tuples[i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mapWordsFrequencies(self):\n token_stream = self._tokenize(self.readable)\n token_map = self._countTokens(token_stream)\n return token_map", "def make_word_to_freq(self):\n\t\tword_to_freq = {}\n\t\tdocuments = self.tokenized_documents[\"train\"]\n\t\tfor document in documents:\n\t\t\tfo...
[ "0.69760984", "0.6954841", "0.6766027", "0.6726694", "0.67247045", "0.67236096", "0.6681085", "0.66526943", "0.6645256", "0.6600014", "0.6541794", "0.6508631", "0.65043277", "0.64985615", "0.6474499", "0.64682674", "0.64619994", "0.6455175", "0.6454146", "0.6413961", "0.63939...
0.7955864
0
This function calculates the efficiency of exchange for a plate heat exchanger according to the NTU method of AShRAE 90.1
def calc_plate_HEX(NTU, cr): eff = 1 - scipy.exp((1 / cr) * (NTU ** 0.22) * (scipy.exp(-cr * (NTU) ** 0.78) - 1)) return eff
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_D_C3H8_air_eff(self, T):\n\n Kn = self.get_Kn(T)\n D_C3H8_air_Kn = self.get_D_C3H8_air_Kn(T)\n\n if np.isscalar(Kn):\n if Kn <= 1.:\n D_C3H8_air_eff = (\n self.porosity / self.tortuosity * self.D_C3H8_air\n )\n else:\n D_C3H8_air_ef...
[ "0.6313557", "0.6123198", "0.61030024", "0.5907772", "0.58622473", "0.57490164", "0.57417744", "0.5727624", "0.5723339", "0.5719097", "0.5718488", "0.56559277", "0.5644845", "0.5608475", "0.5591137", "0.5575324", "0.55370706", "0.55288464", "0.551509", "0.55105394", "0.550247...
0.62462807
1
Test that a made up long hand configurable is ignored
def testFakeLongHandConfigurables(self): config = self.getBaseConfiguration() # The following should be ignored by the configure step config.Webtools.section_('foo') config.Webtools.foo.bar = 'baz' config.Webtools.section_('stuff') config.Webtools.stuff = 'things' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_checkCustoms(self):\n self.failUnlessEqual(self.nice.opts['myflag'], \"PONY!\")\n self.failUnlessEqual(self.nice.opts['myparam'], \"Tofu WITH A PONY!\")", "def test_set_defaults(self):\r\n self.assertEqual(self.config.values['option1'], 1337)\r\n self.assertNotIn('option2', s...
[ "0.6766213", "0.66667897", "0.6473414", "0.6466414", "0.63463116", "0.62720895", "0.62639576", "0.6243529", "0.62287503", "0.61999834", "0.61995345", "0.60602146", "0.60419804", "0.60262173", "0.6009782", "0.6004174", "0.5995757", "0.5993168", "0.5987102", "0.59861827", "0.59...
0.7133786
0
Check that changing the proxy base via tools.proxy.base does actually change the proxy base
def testLongHandProxyBase(self): test_proxy_base = '/unit_test' config = self.getBaseConfiguration() config.Webtools.section_('tools') config.Webtools.tools.section_('proxy') config.Webtools.tools.proxy.base = test_proxy_base config.Webtools.tools.proxy.on = True ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testShortHandProxyBase(self):\n test_proxy_base = '/unit_test'\n\n config = self.getBaseConfiguration()\n # Set the proxy base with a short hand cfg variable\n config.Webtools.proxy_base = test_proxy_base\n server = Root(config)\n\n server.start(blocking=False)\n ...
[ "0.73537105", "0.707217", "0.65160185", "0.6482923", "0.64283407", "0.63094395", "0.607075", "0.6037365", "0.6035557", "0.58942497", "0.5875546", "0.5870355", "0.58613294", "0.5828071", "0.5792144", "0.5784577", "0.57787377", "0.5766081", "0.5765948", "0.5754316", "0.56934655...
0.7315316
1
Check that changing the proxy_base via the short hand config variable does actually change the proxy base
def testShortHandProxyBase(self): test_proxy_base = '/unit_test' config = self.getBaseConfiguration() # Set the proxy base with a short hand cfg variable config.Webtools.proxy_base = test_proxy_base server = Root(config) server.start(blocking=False) self.assertE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testLongHandProxyBase(self):\n test_proxy_base = '/unit_test'\n\n config = self.getBaseConfiguration()\n config.Webtools.section_('tools')\n config.Webtools.tools.section_('proxy')\n config.Webtools.tools.proxy.base = test_proxy_base\n config.Webtools.tools.proxy.on = ...
[ "0.7153598", "0.6757066", "0.64711475", "0.62738633", "0.62492245", "0.61831546", "0.6168169", "0.6149791", "0.6121371", "0.60943186", "0.6077903", "0.6022061", "0.6006754", "0.5966603", "0.5921745", "0.5910734", "0.5906392", "0.5905266", "0.5830339", "0.5785171", "0.57717496...
0.78756124
0
Change the port the server runs on long hand
def testLongHandChangePort(self): test_port = 8010 config = self.getBaseConfiguration() # Set the port to a non-standard one config.Webtools.section_('server') config.Webtools.server.socket_port = test_port server = Root(config) server.start(blocking=False) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def port():", "def testShortHandChangePort(self):\n test_port = 8010\n\n config = self.getBaseConfiguration()\n # Set the port to a non-standard one\n config.Webtools.port = test_port\n\n server = Root(config)\n server.start(blocking=False)\n self.assertEqual(cpco...
[ "0.7758642", "0.74998397", "0.7478552", "0.74446315", "0.741211", "0.7343784", "0.7291729", "0.7231268", "0.71967334", "0.71687037", "0.7156469", "0.7125699", "0.7118466", "0.7118466", "0.7110985", "0.70806605", "0.70552653", "0.70552653", "0.70552653", "0.7050624", "0.702661...
0.75783044
1
Change the port the server runs on short hand
def testShortHandChangePort(self): test_port = 8010 config = self.getBaseConfiguration() # Set the port to a non-standard one config.Webtools.port = test_port server = Root(config) server.start(blocking=False) self.assertEqual(cpconfig['server.socket_port'], tes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def port():", "def testShortHandPortOverride(self):\n test_port = 8010\n\n config = self.getBaseConfiguration()\n # Set the port the long handed way\n config.Webtools.section_('server')\n config.Webtools.server.socket_port = test_port - 1\n # then override\n confi...
[ "0.7702599", "0.7484887", "0.7411772", "0.7371148", "0.7283332", "0.72535723", "0.7192074", "0.7168187", "0.7164538", "0.71594673", "0.7155762", "0.7112388", "0.7107334", "0.703942", "0.7017263", "0.7013244", "0.7008784", "0.6976495", "0.6976495", "0.6976495", "0.6966748", ...
0.76313025
1
Change the port the server runs on long hand, then over ride it with the short hand equivalent
def testShortHandPortOverride(self): test_port = 8010 config = self.getBaseConfiguration() # Set the port the long handed way config.Webtools.section_('server') config.Webtools.server.socket_port = test_port - 1 # then override config.Webtools.port = test_port ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testShortHandChangePort(self):\n test_port = 8010\n\n config = self.getBaseConfiguration()\n # Set the port to a non-standard one\n config.Webtools.port = test_port\n\n server = Root(config)\n server.start(blocking=False)\n self.assertEqual(cpconfig['server.sock...
[ "0.7417877", "0.7364783", "0.70508415", "0.6900824", "0.6878274", "0.6856175", "0.67688036", "0.6766498", "0.6668962", "0.6667537", "0.6656747", "0.6654613", "0.661222", "0.6516741", "0.64837056", "0.64663637", "0.64663637", "0.64663637", "0.64641964", "0.6461626", "0.6457403...
0.76452917
0
Use the filter tool to prevent unexpected accesses from unsupported methods TODO
def testUsingFilterTool(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter(self, *args, **kwargs):", "def filter(self, filters):", "def filterRansac():\n pass", "def dummy_method_silent(self):\n\n pass", "def filter_request():\n if request.method not in ALLOWED_METHODS:\n return \"Method Not Allowed\", 405\n ua = str(request.user_agen...
[ "0.66336066", "0.6017838", "0.6004909", "0.5968763", "0.5898707", "0.5789355", "0.5755716", "0.57516074", "0.573139", "0.57238835", "0.5708848", "0.567627", "0.567044", "0.558462", "0.5566893", "0.5533586", "0.5483126", "0.547571", "0.5469539", "0.5469539", "0.54615074", "0...
0.70513415
0
use the chemical formulas from the InChIs to verify that each and every reaction is balanced
def balance_reactions(self): element_df = ccache.get_element_data_frame(self.cids) # find all reactions that contain only compounds that have formulae cpd_with_formulae = (element_df != 0).any(axis=1) logger.info('# compounds without a formula: %d' % sum(~cpd_with_fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_balanced(self):\n self.assertTrue(is_closed('(())') == 0)", "def gam_in_biomass(reaction):\n left = set([\"atp_c\", \"h2o_c\"])\n right = set([\"adp_c\", \"pi_c\", \"h_c\"])\n return (\n left.issubset(met.id for met in reaction.reactants) and\n right.issubset(met.id for met...
[ "0.5839963", "0.5808818", "0.57857436", "0.5687498", "0.56869805", "0.5679629", "0.5648583", "0.56441873", "0.5597478", "0.5570817", "0.5536617", "0.55318", "0.55314183", "0.5522626", "0.5511559", "0.55078155", "0.54939705", "0.5490643", "0.5470173", "0.5467089", "0.54484385"...
0.6749521
0
Calculate the reverse transform for all reactions in training_data.
def reverse_transform(self): self.reaction_df['dG0'] = self.reaction_df['dG0_prime'] for i, rxn in self.iterreactions(): aq_cond = self.reaction_df.loc[i, ['pH', 'I', 'T']] self.reaction_df.at[i, 'dG0'] -= rxn.get_transform_ddG0(*aq_cond)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inverse_transform(self, data: np.ndarray) -> np.ndarray:\n for i in range(self.n_layers):\n j = self.n_layers-1-i\n new_data = np.nan_to_num(data)\n new_data = self.ica_list[j].inverse_transform(X=new_data)\n if i != self.n_layers - 1:\n new_dat...
[ "0.608607", "0.6066743", "0.60285115", "0.6012941", "0.59580684", "0.59580684", "0.59580684", "0.59580684", "0.59580684", "0.59493375", "0.5944869", "0.5856188", "0.58256835", "0.57948464", "0.57897985", "0.5780429", "0.5739959", "0.57358384", "0.5723912", "0.5684246", "0.568...
0.67173964
0
Read the Formation Energy data from literature data [16] Returns pandas.DataFrame References .. [1] Alberty (2006) .. [2] Maden (2000) .. [3] Thauer (1977) .. [4] Wagman (1982) .. [5] Dolfing (1992) .. [6] Dolfing (1994)
def read_formations(): with resource_stream('component_contribution', FullTrainingData.FORMATION_ENERGY_FNAME) as fp: formation_df = pd.read_csv(gzip.GzipFile(fileobj=fp)) cids_that_dont_decompose = set( formation_df.loc[formation_df['decompose'] ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_life_expectancy() -> pd.DataFrame:\n\n life_df = pd.read_csv(\"data/API_SP.DYN.LE00.IN_DS2_en_csv_v2_988752.csv\",\n header=2, usecols=[0,62], names=[\"Country\", \"Life expectancy\"])\n\n index = life_df[life_df[\"Country\"]==\"Iran, Islamic Rep.\"].index.values[0]\n lif...
[ "0.61456037", "0.6099583", "0.5829568", "0.5712764", "0.57003295", "0.565965", "0.5650847", "0.5564461", "0.5516579", "0.5479664", "0.547758", "0.54745764", "0.54721504", "0.5437464", "0.54372483", "0.5434614", "0.5408107", "0.54012036", "0.5396452", "0.5387284", "0.5375178",...
0.71538556
0
Read the Reduction potential from literature data [18] Returns pandas.DataFrame References .. [1] CRC biochemistry (2010) .. [2] Prince (1987) .. [3] Thauer (1977) .. [4] CRC biochemistry (2010) .. [5] Alberty (2006) .. [6] Deppenmeier (2008) .. [7] Saeki (1985) .. [8] Unden (1997)
def read_redox(): with resource_stream('component_contribution', FullTrainingData.OXIDATION_POTENTIAL_FNAME) as fp: redox_df = pd.read_csv(gzip.GzipFile(fileobj=fp)) delta_nH = redox_df['nH_red'] - redox_df['nH_ox'] delta_charge = redox_df['charge_red'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_formations():\n\n with resource_stream('component_contribution',\n FullTrainingData.FORMATION_ENERGY_FNAME) as fp:\n formation_df = pd.read_csv(gzip.GzipFile(fileobj=fp))\n\n cids_that_dont_decompose = set(\n formation_df.loc[formation_df['de...
[ "0.6069549", "0.57876635", "0.57378787", "0.57055783", "0.5663309", "0.56483614", "0.5611897", "0.5578978", "0.5490725", "0.54850566", "0.54808444", "0.5478851", "0.5469072", "0.5450555", "0.543326", "0.5421569", "0.54016733", "0.53807616", "0.5371682", "0.536716", "0.5332485...
0.6099513
0
create a dictionary for one hot vector representation of valence electrons
def dict_shell_v_electrons_for_one_hot_vector(): # s1 - f14 is notated as shell_v_electons # number in s1 ... f14 indicates how many valence electrons are in that shell, # ex: p5 indicates that there are 5 valence electrons in the p shell # value in the dict corresponds to index of the one-hot-vector ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot_vector_one_element(element):\n # in one-hot-vector notaiton 1 corresponds to the presence of valence e's in the shell\n # according to the key in the dict, for key notation see notes on dict_shell_v_electrons_for_one_hot_vector()\n D = dict_shell_v_electrons_for_one_hot_vector()\n shell_v_e...
[ "0.68905", "0.6694276", "0.6556573", "0.64763856", "0.64213455", "0.6010316", "0.5988112", "0.59668624", "0.5933675", "0.59232545", "0.59161085", "0.59045726", "0.58817625", "0.58688486", "0.586152", "0.5851435", "0.5839059", "0.58121246", "0.57870066", "0.57826024", "0.57611...
0.8022084
0
get valence electrons for an element in the structure
def get_shell_v_electrons(element): # s1 - f14 is notated as shell_v_electons # get shell_v_electons for corresponding element if element == 'H': return ['s1'] elif element == 'He': return ['s2'] else: valence_electrons = periodic_table.Element(element).electronic_structure[5...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_electrons(self):\n for iline, line in enumerate(self.lines):\n fstring = 'number_of_electrons'\n if line.find(fstring) >= 0:\n index_ele = iline + 1\n break\n return float(self.lines[index_ele].split('\\n')[0])", "def get_valences(self):\...
[ "0.6178311", "0.60336924", "0.5848775", "0.5819815", "0.5783596", "0.5759457", "0.57318735", "0.5720433", "0.5596006", "0.55642945", "0.5546886", "0.55226445", "0.5520696", "0.54883677", "0.5482869", "0.54281795", "0.5398206", "0.5367817", "0.5360988", "0.5346929", "0.5340324...
0.6709078
0
get polyhedras for each of the sites in the structure return a list
def get_polyhedras_for_all_sites(structure): # index of list = index of the structure site # given an index returns a list of dictionaries # index correspods to the site of the central atom and dictionary has all neighbors as key and corresponding angle ratios as values v_polyhedra_sites = [] for i ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sites(self):\n struc = self.structure\n pots = self.potentials\n shapes = self.shapes\n\n _, new_pots = self._check_for_CPA(struc, pots)\n site_list = []\n for j in range(len(struc.sites)):\n site_list.append({\n 'StructureDataSite': struc.sit...
[ "0.54778886", "0.5458013", "0.5354114", "0.5247637", "0.520858", "0.5201762", "0.5188058", "0.51777005", "0.51392895", "0.51024777", "0.5074483", "0.5070221", "0.5069766", "0.50119555", "0.4977238", "0.497127", "0.49295658", "0.49264345", "0.49196494", "0.4841756", "0.4826195...
0.77412266
0
The compute_FAR method is used to compute the False Acceptance Rate (FAR).
def compute_FAR(self, impostor_score, thresholds=0.01): print('Computing FAR') condition = lambda score, thr: score > thr return self._F_performance(np.squeeze(np.array(impostor_score)), thresholds, condition)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_FAR_of_thresh(self, threshold, livetime, groundtype):\n\t\t#Find FAR from number of events above a threshold\n\t\tFAR = float(np.sum(self.LLR_above_thresh(threshold=threshold, groundtype=groundtype)))/float(livetime)\n\t\t\n\t\t#If FAR is null, choose FAR to be that of the most extreme background eve...
[ "0.59539515", "0.56982476", "0.5498059", "0.5448071", "0.542143", "0.54211175", "0.53424215", "0.529052", "0.51836085", "0.51779884", "0.5163315", "0.5161866", "0.51187503", "0.5113809", "0.50567526", "0.5051289", "0.5042379", "0.50330323", "0.49928784", "0.49869552", "0.4965...
0.7434235
0
The compute_FRR method is used to compute the False Rejection Rate (FRR).
def compute_FRR(self, genuine_score, thresholds=0.01): print('Computing FRR') condition = lambda score, thr: score <= thr return self._F_performance(genuine_score, thresholds, condition)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getF_and_R(self):\n R = self.getR()\n # Treat the laminar case: f = 64/R\n if R < 2000: # R < 2000 implies flow is laminar\n if R > 0:\n f = 64/R # Darcy's equation for friction factor\n return {\"R\": R, \"f\": f}\n elif R == 0:\n ...
[ "0.65564245", "0.65287846", "0.6198347", "0.60896105", "0.59199065", "0.5742813", "0.5730647", "0.57160044", "0.57000136", "0.5698048", "0.56693923", "0.5598712", "0.55948985", "0.5586447", "0.5580251", "0.55748373", "0.5456912", "0.5451239", "0.5443533", "0.54415745", "0.543...
0.7274165
0
The _compute_thresholds method computes the list of thresholds to use in computing FAR and FRR (FOR INTERNAL USE ONLY).
def _compute_thresholds(self, thresholds): thr = thresholds limit = int(1 / thresholds) thresholds = [x * thr for x in range(limit)] thresholds.append(1) return thresholds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_thresholds(self):\n \n for group in self.roi_groups:\n for roi in group.rois:\n for image in range(len(roi.counts)):\n # print(roi.autothreshs)\n # print('image',image)\n if roi.autothreshs[image]:\n ...
[ "0.6915533", "0.66604465", "0.6628242", "0.65145713", "0.6447336", "0.63278013", "0.62804854", "0.62639785", "0.61738557", "0.6161861", "0.6130367", "0.6079826", "0.60115075", "0.5987828", "0.59792984", "0.59723645", "0.5904272", "0.5891934", "0.5890027", "0.58883226", "0.587...
0.7832747
0
The compute_EER method computes the Equal Error Rate (EER) through the False Acceptance Rate (FAR) and the False Rejection Rate (FRR).
def compute_EER(self, FAR, FRR): print('Computing EER') distance = abs(FAR - FRR) min_distance = min(distance) idx = np.where(distance == min_distance) return np.mean((FAR[idx] + FRR[idx]) / 2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_hr_ee(self):\n\n # HR - resting HR = net HR\n net_hr = np.array([i - self.rest_hr if i is not None else None for i in self.df_epoch[\"HR\"]])\n\n # Sets values below 0% HRR (below resting HR) to 0\n net_hr[net_hr <= 0] = 0\n\n # Equation from Brage et al., 2004. Act...
[ "0.63122684", "0.62375075", "0.6005604", "0.5962147", "0.5802526", "0.5786154", "0.5786154", "0.57078075", "0.5686621", "0.5638704", "0.5631321", "0.5617069", "0.5612243", "0.5581315", "0.5563586", "0.5560175", "0.55182976", "0.54956925", "0.5480842", "0.54414266", "0.5423252...
0.75275457
0
The compute_AUC method computes the Area Under the Curve (AUC) value from the False Acceptance Rate (FAR) and the Correct Acceptance Rate (CAR).
def compute_AUC(self, FAR, CAR): print('Computing AUC') return abs(np.trapz(CAR, FAR))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def FastAUC(model):\n\n train_pred = model.predict(model.X_train)\n test_pred = model.predict(model.X_test)\n return roc_auc_score(model.Y_train,train_pred), roc_auc_score(model.Y_test, test_pred)", "def auc(self,predictions,labels):\n\n # sort the array by predictions in descending order in cas...
[ "0.6963172", "0.68556386", "0.6831374", "0.6802048", "0.6772471", "0.6601097", "0.653083", "0.64571923", "0.64566046", "0.64535993", "0.6437013", "0.64357656", "0.64157087", "0.63924754", "0.6364884", "0.63396573", "0.62996906", "0.6282218", "0.6274723", "0.62670517", "0.6247...
0.8466757
0
The compute_CRR method computes the Correct Rejection Rate (CRR) from the False Acceptance Rate (FAR).
def compute_CRR(self, FAR): print('Computing CRR') return (np.ones((1, len(FAR))) - FAR)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_CAR(self, FRR):\r\n print('Computing CAR')\r\n return (np.ones((1, len(FRR))) - FRR)[0]", "def roc(ground_truth, pred_result):\n assert len(ground_truth)==len(pred_result)\n tp, fp, tn, fn = 1e-8, 1e-8, 1e-8, 1e-8\n for i in range(len(ground_truth)):\n if ground_truth[i]...
[ "0.65288067", "0.5981593", "0.5872643", "0.5852522", "0.58302766", "0.5761999", "0.57414544", "0.57358056", "0.5672711", "0.5661779", "0.5651226", "0.5649021", "0.56473464", "0.55610514", "0.5559014", "0.5506419", "0.54786223", "0.5471709", "0.5463862", "0.54625064", "0.54574...
0.7988503
0
The compute_CAR method computes the Correct Acceptance Rate (CAR) from the False Rejection Rate (FRR).
def compute_CAR(self, FRR): print('Computing CAR') return (np.ones((1, len(FRR))) - FRR)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_CRR(self, FAR):\r\n print('Computing CRR')\r\n return (np.ones((1, len(FAR))) - FAR)[0]", "def compute_AUC(self, FAR, CAR):\r\n print('Computing AUC')\r\n return abs(np.trapz(CAR, FAR))", "def getF_and_R(self):\n R = self.getR()\n # Treat the laminar case: ...
[ "0.6543801", "0.62296724", "0.578373", "0.5765895", "0.5631936", "0.54449034", "0.5422693", "0.5402665", "0.5383919", "0.5337913", "0.5329523", "0.53150845", "0.52979875", "0.5285038", "0.52552736", "0.52096033", "0.51551443", "0.5125058", "0.51150274", "0.5103708", "0.509394...
0.77609086
0
The compute_performance_analysis method computes the False Acceptance Rate (FAR), the False Rejection Rate (FRR), the Correct Rejection Rate (CRR), the Correct Acceptance Rate (CAR) for each threshold value, the Equal Error Rate (EER) and the Area Under the Curve (AUC) on a genuine scores array and an impostor scores a...
def compute_performance_analysis(self, G, I, thresholds=0.01): FAR = self.compute_FAR(I, thresholds) FRR = self.compute_FRR(G, thresholds) CRR = self.compute_CRR(FAR) CAR = self.compute_CAR(FRR) EER = self.compute_EER(FAR, FRR) AUC = self.compute_AUC(FAR, CAR) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_analysis(self, data, labels, distance, thresholds=None):\r\n print(' Computing genuine and impostor scores')\r\n scores = self.compute_scores(data, distance)\r\n if thresholds is None:\r\n G, I, thresholds = self.genuines_and_impostors(scores, labels)\r\n else:\r...
[ "0.68800604", "0.63820964", "0.6354114", "0.63031924", "0.61340654", "0.60958236", "0.608292", "0.59482414", "0.59277093", "0.5918541", "0.59059393", "0.589219", "0.5863595", "0.5807743", "0.5776116", "0.57624245", "0.5712769", "0.56988746", "0.56601155", "0.5647822", "0.5640...
0.6791727
1
The compute_analysis method computes the False Acceptance Rate (FAR), the False Rejection Rate (FRR), the Correct Rejection Rate (CRR), the Correct Acceptance Rate (CAR) for each threshold value, the Equal Error Rate (EER) and the Area Under the Curve on a data matrix.
def compute_analysis(self, data, labels, distance, thresholds=None): print(' Computing genuine and impostor scores') scores = self.compute_scores(data, distance) if thresholds is None: G, I, thresholds = self.genuines_and_impostors(scores, labels) else: G, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_analysis(self):\r\n def get_mean(self):\r\n \"\"\"\r\n Compute mean in all sensors\r\n \"\"\"\r\n for i in range(1,len(self.data[0])):\r\n self.prom.append(np.mean(self.data[:,i])) \r\n\r\n \r\n def get_stddev(self):\r\n ...
[ "0.6309563", "0.58479935", "0.5719307", "0.5491282", "0.54801613", "0.5469953", "0.5436074", "0.5431127", "0.54118514", "0.5353119", "0.534321", "0.53364295", "0.53191656", "0.5318091", "0.5294328", "0.528951", "0.5279901", "0.5257389", "0.52564377", "0.52362484", "0.52105314...
0.66166776
0
The genuines_and_impostors method computes the genuine scores and the impostor scores.
def genuines_and_impostors(self, scores, labels): print('Computing genuine scores and impostor scores') scores_dimension, genuine_dimension, impostor_dimension = self._define_dimensions(scores, labels) genuine_score = np.zeros(shape=(genuine_dimension, 1)) impostor_score = np.zeros(s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def g_score(self):\n _, _, I_CK = self._entropies()\n return 2.0 * I_CK", "def compute_analysis(self, data, labels, distance, thresholds=None):\r\n print(' Computing genuine and impostor scores')\r\n scores = self.compute_scores(data, distance)\r\n if thresholds is None:\r\n ...
[ "0.5908113", "0.5808429", "0.5775945", "0.5765171", "0.5759262", "0.57498795", "0.56638306", "0.56234115", "0.55417323", "0.5534174", "0.5509591", "0.5462868", "0.5461088", "0.54249567", "0.54188925", "0.54126656", "0.54111266", "0.54024756", "0.53850144", "0.5380926", "0.537...
0.7662449
0
The scores_statiscics computes a set of descriptive statistical parameters (mean, median, standard deviation) on the array of similarity scores.
def scores_statistics(self, scores): aux_scores = np.array(scores) return np.mean(aux_scores), np.median(aux_scores), np.std(aux_scores)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def descriptive_statistics(relfreqs): \n means = np.mean(relfreqs, axis=\"columns\")\n stdevs = np.std(relfreqs, axis=\"columns\")\n return means, stdevs", "def scores_stat(scores, N):\n\n scores_avg = np.nan * np.zeros((len(scores),))\n scores_std = np.nan * np.zeros((len(scores),))\n for idx ...
[ "0.61048746", "0.54783547", "0.547629", "0.5473358", "0.5466225", "0.5464779", "0.54573387", "0.5457245", "0.5401036", "0.53395224", "0.5307298", "0.5279069", "0.52609307", "0.52311283", "0.52279276", "0.5204376", "0.5197849", "0.51872057", "0.5172685", "0.5163635", "0.512596...
0.6615644
0
returns the value of the node at nth position from the end of the list
def value_n_from_end(self, n): # check the validity of the input if n > self.n-1: print(f"Error; n is greater than the length of the list = {self.n-1}") return temp_node = self.head # store head for _ in range((self.n-1) - n): temp_node = te...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nth_node_from_end(self, n):\n\n length = 0\n\n if self.head:\n current = self.head\n while current:\n length += 1\n current = current.next\n\n count = 0\n current = self.head\n while count < (length - n): \n ...
[ "0.74624777", "0.7346212", "0.7245577", "0.7144503", "0.7056932", "0.6897913", "0.6836249", "0.68209404", "0.68094146", "0.67188853", "0.6701307", "0.66925293", "0.66457725", "0.6619531", "0.66030765", "0.65967846", "0.6596734", "0.6596202", "0.65683895", "0.6555614", "0.6543...
0.7774788
0
Delete the entire linked list
def delete_list(self): temp_node = self.head while temp_node is not None: prev_node = temp_node temp_node = temp_node.next # prev_node.val += ": deleted" # for sanity check # reset data prev_node.val = None prev_node.next = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_node_at_end(self):\n if not self.head:\n print('List already empty')\n return\n temp = self.head\n while temp.next:\n if not temp.next.next:\n break\n temp = temp.next\n temp.next = None", "def delete(self, node):\n...
[ "0.7421643", "0.73093677", "0.7297119", "0.7152628", "0.7131672", "0.7042285", "0.7038422", "0.698151", "0.6981293", "0.69722617", "0.696888", "0.6919545", "0.6898942", "0.6865548", "0.685082", "0.6822985", "0.6790733", "0.6790022", "0.6789559", "0.6781021", "0.6766273", "0...
0.8174865
0
Converts the string s to unicode if it is of type bytes.
def to_unicode(s, encoding="utf-8"): if isinstance(s, six.text_type): return s elif isinstance(s, bytes): return s.decode(encoding) # TODO: warning? Exception? return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def asunicode(s):\n if isinstance(s, bytes):\n return s.decode('utf-8', 'replace')\n else:\n return s", "def to_unicode(s):\n if isinstance(s, basestring):\n return force_unicode(s)\n return s", "def force_unicode(s):\n return (s.decode('utf8')\n if isinstance(s, s...
[ "0.8340978", "0.79099596", "0.7799121", "0.77731043", "0.75542563", "0.7480702", "0.74548", "0.7364664", "0.7324261", "0.7320521", "0.7316827", "0.7223738", "0.7191209", "0.7190067", "0.71578455", "0.7147032", "0.7146166", "0.71063703", "0.70780754", "0.7071083", "0.7003143",...
0.802636
1
Test case for create_currency_using_post
def test_create_currency_using_post(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_currency_using_put(self):\n pass", "def test_creating_new_po_with_different_currency(self):\n print '\\n'\n logger.debug(\"Creating new po with a price change\")\n print '\\n'\n #validate the response\n po = copy.deepcopy(base_purchase_order)\n del...
[ "0.68356407", "0.6706081", "0.6400179", "0.614817", "0.61457443", "0.6144491", "0.61123645", "0.60654515", "0.60512275", "0.6031001", "0.5988373", "0.5983007", "0.5959523", "0.5932132", "0.58593994", "0.5820279", "0.5782696", "0.57480276", "0.57440805", "0.574227", "0.573114"...
0.9424277
0
Test case for get_currency_all_using_get
def test_get_currency_all_using_get(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_currency_using_get(self):\n pass", "def getCurrencies():", "def get_all_currencies(self):\r\n method = self.public_endpoints['currency_info']['method']\r\n url = self.base_url + self.public_endpoints['currency_info']['url']\r\n req = requests.request(method, url)\...
[ "0.8527205", "0.74762857", "0.7270341", "0.70285404", "0.68799645", "0.67204595", "0.6591492", "0.65616804", "0.6527166", "0.6511705", "0.6505761", "0.6465918", "0.6460552", "0.64540637", "0.6406723", "0.63937515", "0.6367416", "0.6337919", "0.6323411", "0.6306953", "0.629917...
0.9566926
0
Test case for get_currency_using_get
def test_get_currency_using_get(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_currency_all_using_get(self):\n pass", "def getValue(currency=None):", "def getUserCurrency():", "def get_currency():\n return _currency", "def getActiveCurrency():", "def getCurrencies():", "def getBaseCurrency():", "def getcurrency(self):\n return self.__currency", "def ...
[ "0.8397472", "0.7687877", "0.74333936", "0.7401438", "0.72292423", "0.71974003", "0.71221143", "0.70503765", "0.70401907", "0.67288995", "0.67098254", "0.66631013", "0.65806085", "0.6573663", "0.64758766", "0.6447453", "0.6421329", "0.64192945", "0.64126575", "0.6379896", "0....
0.9505069
0
Test case for update_currency_using_put
def test_update_currency_using_put(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_updating_po_with_new_currency(self):\n #test original quantity\n \n modified_po = copy.deepcopy(base_purchase_order)\n modified_po['currency'] = 'RMB'\n \n resp = self.client.put('/api/v1/purchase-order/1/',\n format='json',\n ...
[ "0.6958976", "0.6940111", "0.6561515", "0.6515543", "0.6428388", "0.63960254", "0.6357593", "0.634193", "0.6340724", "0.6260269", "0.62273633", "0.61698914", "0.61180425", "0.6101994", "0.60801125", "0.6055223", "0.60366535", "0.60110843", "0.5987459", "0.5976042", "0.5971641...
0.9577534
0
Constructor for Battleship class Populates shipes list with random coordinates
def __init__(self): # self.ships = [ # (1, 1), # (1, 2), # (3, 4), # (4, 5), # ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.total_ships = 0\n self.starting_position = None\n self.total_rows_req = 0\n self.total_column_req = 0\n self.shipList = []", "def __init__(self):\n self.numShipsPerPlayer = 0\n self.playerType = 1 # Whether P2 is a human (1) or AI (2-4 f...
[ "0.75161", "0.747994", "0.73905015", "0.73893094", "0.73670924", "0.72767407", "0.7220443", "0.7211145", "0.7109368", "0.7106377", "0.7066264", "0.7064379", "0.6940032", "0.68883884", "0.68498534", "0.6840638", "0.68297946", "0.6815027", "0.68074423", "0.67862326", "0.678561"...
0.77771276
0
Handshake with a v11 server. Server sends version after authentication
def test_handshakeV11(self): user=padString('hello') host=padString('world') self.sfact.program= \ [('recv',CAmessage(dtype=0, count=CA_VERSION)), ('recv',CAmessage(cmd=20, size=len(user), body=user)), ('recv',CAmessage(cmd=21, size=len(host), body...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handshake(self):\n version = Version()\n version_serial = VersionSerializer()\n self.send_message(version, version_serial)", "def handshake(self, peer_name):\n version = Version()\n self.send_message(peer_name, version)", "def handshake(self):\n\n request_line = _b...
[ "0.77323616", "0.68461657", "0.67431724", "0.66035455", "0.644397", "0.63936067", "0.63600695", "0.63543665", "0.61337984", "0.60764194", "0.5982414", "0.59694844", "0.59272075", "0.59147125", "0.5889653", "0.5852988", "0.57188207", "0.5639291", "0.5639291", "0.5593274", "0.5...
0.7077312
1
Given the location of a log directory, returns all of the Method logs in a list to have their data imported.
def importMethodFileNames(directory): allfileNames = os.listdir(directory) methodsRunList = [] for filename in allfileNames: if "_MethodRunLog_" in filename: methodsRunList.append(filename) return methodsRunList
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def importAllLogData(directory):\n\n listofRunData = []\n filenames = importMethodFileNames(directory)\n\n for name in filenames:\n listofRunData.append(importTestData(directory +'/' + name))\n\n return listofRunData", "def all_logs(self):\n return os.listdir(LOGS_BASE_PATH)", "def fi...
[ "0.7695482", "0.6907083", "0.68779814", "0.6823004", "0.6823004", "0.6811872", "0.67836237", "0.67697006", "0.665295", "0.6501666", "0.64949274", "0.6478783", "0.6459066", "0.63557965", "0.6227704", "0.61744946", "0.6129405", "0.60701364", "0.60007477", "0.5982382", "0.595200...
0.7354085
1
Given a log directory by the user returns lists of all the recorded data from the logs resulting log is a three dimensional array
def importAllLogData(directory): listofRunData = [] filenames = importMethodFileNames(directory) for name in filenames: listofRunData.append(importTestData(directory +'/' + name)) return listofRunData
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_access_logs(file_dir=log_dir):\n \n file_list = []\n for myfile in glob.glob1(file_dir, 'access_log*'):\n file_list.append('%s/%s' % (file_dir, myfile))\n# print file_list\n return file_list", "def getLogs():", "def getLogs():", "def get_data_files(main_directory):\n print('*...
[ "0.6871541", "0.671468", "0.671468", "0.663768", "0.6517435", "0.6468136", "0.6452705", "0.63986236", "0.6367914", "0.63383603", "0.62654144", "0.62299556", "0.620553", "0.61963004", "0.6195375", "0.61826825", "0.61727697", "0.61565095", "0.6099221", "0.6072016", "0.6067693",...
0.6760461
1
If a selling transaction has been started, this view will display an address and request the details necessary from the user for the chosen payment processor
def selling_page_2(request, tx_id): # get the transaction from the passed id tx = get_object_or_404(Transactions, id=tx_id) # get the payment_processor name from the tx payment_processor = None for pp in globs.PAYMENT_PROCESSORS: if pp[0] == tx.payment_processor: payment_processo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index(request):\n if request.method == 'POST':\n form = TxForm(request.POST)\n if form.is_valid():\n if request.POST['tx_type'] == 'BUY':\n # address validation\n if not request.POST['address']:\n print('no address')\n ...
[ "0.6634749", "0.5998892", "0.58536446", "0.5819148", "0.58139586", "0.57966197", "0.57903916", "0.5731881", "0.5643265", "0.5587352", "0.5565018", "0.5554695", "0.55475986", "0.5523211", "0.552041", "0.55099136", "0.5508046", "0.5502811", "0.54928315", "0.54797226", "0.546411...
0.6099121
1
False unless node is a h1h6 node containing an anchor.
def is_headline(node): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isAnchor(node):\n # TODO What is considered an anchor needs to be subject to an option\n return bool((isinstance(node, nodes.target)\n or isinstance(node, nodes.Structural))\n and node[DuAttrIds]\n and not node.get(DuAttrRefuri, None))", ...
[ "0.7069017", "0.62116396", "0.6078808", "0.59389526", "0.59324163", "0.5890443", "0.5890443", "0.5890443", "0.58889157", "0.58822024", "0.5880245", "0.5864034", "0.5863417", "0.5782385", "0.5749293", "0.5745051", "0.5681698", "0.5664069", "0.565869", "0.5619829", "0.56170315"...
0.6410106
1
The text in headline node (text of anchor element).
def headline_text(node): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def headline(self):\n \n return self._headline", "def headline(self):\r\n return '%s%s %s%s' % (BLUE, self.title,\r\n NORMAL, self.link)", "def is_headline(node):\n pass", "def test_single_headline(self):\n\n text = \"Example headline\"\n\n f...
[ "0.7480799", "0.7280363", "0.66121274", "0.6573565", "0.64763385", "0.6228906", "0.6204091", "0.6187863", "0.6185961", "0.6176918", "0.6115738", "0.6058421", "0.6016905", "0.60115004", "0.5985969", "0.59503734", "0.59398186", "0.5884656", "0.58704394", "0.58543044", "0.582719...
0.8731675
0
A list of all headlines in html_root_node.
def all_headlines(html_root_node): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_headlines(self):\r\n\t\tlist_vals = list(self.keyword_headlines().values())\r\n\t\tuniq_headlines = set()\r\n\t\tfor list_val in list_vals:\r\n\t\t\tfor headlineobj in list_val:\r\n\t\t\t\tuniq_headlines.add(headlineobj.headlineid.content)\r\n\r\n\t\treturn list(uniq_headlines)", "def get_headlines(s...
[ "0.67986226", "0.65997756", "0.65986437", "0.6581237", "0.6533369", "0.64754415", "0.6419111", "0.62299573", "0.62149304", "0.6154909", "0.6016565", "0.59933895", "0.5969729", "0.5963461", "0.59520066", "0.59432167", "0.5813856", "0.57545596", "0.5723752", "0.56269383", "0.56...
0.90039504
0
Open url using `urlib` and extract all the headlines from it.
def all_headlines_from(url): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gather_headlines(urls):\n pass", "def read_url(url):\n\thtml = urllib.urlopen(url).read().decode('utf8')\n\ttext = plaintext(html)\n\tlines = text.splitlines()\n\tlines = [line for line in lines if line.strip() != '']\n\tlines = [line for line in lines if line.startswith('<') == False]\n\tlines = [line fo...
[ "0.6672172", "0.6091217", "0.603721", "0.59787077", "0.5971131", "0.59305006", "0.58876294", "0.58835566", "0.57485056", "0.5741651", "0.56798166", "0.56780094", "0.5677688", "0.5666863", "0.56656384", "0.5651764", "0.56477207", "0.56319916", "0.56246245", "0.55930126", "0.55...
0.7402837
0
Return the aggregate list of every headline found in each url in `urls`.
def gather_headlines(urls): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_titles(urls):\n\n titles = []\n for url in urls:\n with urlopen(url) as response:\n encoding = response.info().get_content_charset(failobj=\"utf-8\")\n html = response.read().decode(encoding)\n title_parser = TitleParser()\n title_parser.feed(html)\n...
[ "0.6785917", "0.66031754", "0.6585685", "0.64747643", "0.6285192", "0.6158868", "0.6079059", "0.60513383", "0.6022498", "0.597162", "0.5873791", "0.58727", "0.58486205", "0.58414024", "0.5756526", "0.5736474", "0.57008785", "0.5687183", "0.5649379", "0.56354105", "0.56212187"...
0.70993817
0
This function fills GENERO table by values recorded in genre_list (extractionTitleBasics function)
def insertionGenero (cur, conn, genre_list): for genre in genre_list : idGenero = genre[0] genero=genre[1] # print(generoInsert.format(idTitulo,genero)) # REGISTER DATA IN GENERO TABLE cur.execute(generoInsert.format(idGenero,genero)) conn.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_genre_title_table(self):\n start_of_titles = self.db_file.tell()\n self.genre_title_table_length = 0\n for giEntry in self.genreIndex:\n giEntry.title_entry_offset = (\n self.db_file.tell() - start_of_titles)\n\n for album in giEntry.album_numbers...
[ "0.64778924", "0.6259126", "0.60637856", "0.59455675", "0.5902932", "0.58608884", "0.5840058", "0.57418627", "0.56885207", "0.56724733", "0.565406", "0.5599797", "0.55931234", "0.55268145", "0.55236465", "0.55155027", "0.55127984", "0.54621285", "0.5444199", "0.5435684", "0.5...
0.62879306
1
Merge the metadata on the obj (module) with whatever is in the dom parameter. From the spec. what should be replaced and what we should just add to.
def mergeMetadata(self, obj, dom): self.update_semantics = 'merge' # create a metadata dict that has all the values from obj, overridden # by the current dom values. metadata = self.getModuleMetadata(obj, {}) metadata.update(self.getMetadata(dom, METADATA_MAPPING)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replaceMetadata(self, obj, dom):\n self.update_semantics = 'replace'\n # create a metadata dict that has all the defaults, overridden by the\n # current dom values. This way we will 'clear' the properties not in\n # the dom.\n metadata = copy(METADATA_DEFAULTS)\n metad...
[ "0.78307074", "0.5696329", "0.5232228", "0.52190924", "0.5212288", "0.5208964", "0.51459545", "0.51202196", "0.511697", "0.51020396", "0.50840163", "0.50777334", "0.5052909", "0.50156856", "0.5010484", "0.50085795", "0.49969932", "0.49952522", "0.49937052", "0.49749744", "0.4...
0.79121405
0
Compute the updated roles just the list of userids and roles in the xml Compute the deleted roles collaborators that are currently on the object, but not in the xml Compute the cancelled roles pending collaboration request for which there are no roles in the xml
def updateRoles(self, obj, dom): domRoles = self.validateRoles(self.getRolesFromDOM(dom)) moduleRoles = self.validateRoles(self.getRolesFromModule(obj)) updateRoles = {} deleteUsers = [] cancelRoles = [] if self.action == 'create' or self.update_semantics == 're...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _updateRoles(self, obj, updateRoles={}, deleteRoles=[], cancelRoles=[]):\n #user_role_delta = {}\n pending = obj.getPendingCollaborations()\n\n collabs = obj.getCollaborators()\n\n user_role_delta = obj.generateCollaborationRequests(\n newUser=False, newRoles=updateRoles,...
[ "0.78267735", "0.62636226", "0.6133807", "0.60892725", "0.6004539", "0.59698313", "0.5845509", "0.58294207", "0.58185166", "0.578801", "0.5783296", "0.5755804", "0.572187", "0.5703647", "0.5698297", "0.5674649", "0.56582236", "0.565688", "0.5655063", "0.5649481", "0.5625305",...
0.7100128
1
we override init in order to add DELETE as a legitemate call in RhaptosSword land.
def __init__(self, context, request): EditMedia.__init__(self, context, request) SWORDTreatmentMixin.__init__(self, context, request) self.callmap.update({'DELETE': self.DELETE,})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _initDeleteEntryDocument(self, atomDoc): #@UnusedVariable #$NON-NLS-1$\r\n pass", "def _Delete(self):\n pass", "def delete(self):\n ...", "def before_delete(self, obj, st):\n pass", "def __delete__(self):\n pass", "def __init__(self):\n self._OPERATION = None", ...
[ "0.666207", "0.65416425", "0.6242141", "0.6221454", "0.6002465", "0.5978867", "0.5935902", "0.5900536", "0.589194", "0.58769816", "0.58454543", "0.58454543", "0.58454543", "0.58454543", "0.58454543", "0.58454543", "0.58454543", "0.58454543", "0.58454543", "0.58454543", "0.582...
0.66437906
1
Bully Election Algrorithm, largest id becomes the primary copy at failure to connect to primary copy the server sends a election message to each replication server if a server has a higher ID it replies with an election message then sends another election message else if no server replies then server becomes the primar...
def election(epoch, counter): election_msg="ELECTION {} {}".format(epoch, counter) has_highest_id=True for neighbor_id, neighbor in setting['neighbor'].items(): try: neighbor.send(election_msg) response = neighbor.recv(1024) print "response {} = {}\n".format(neig...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, datacenter_id, server):\n logging.debug('initialized')\n self.datacenter_id = datacenter_id\n # self.datacenters = CONFIG['datacenters']\n # update the datacenters, so that the id and port are all int\n # self.datacenters = dict([(x, y) for x, y in self.datacen...
[ "0.60686874", "0.5831416", "0.579597", "0.56342006", "0.5362166", "0.5356418", "0.53092897", "0.5308506", "0.5284388", "0.52041113", "0.51242214", "0.5074616", "0.5061372", "0.502205", "0.5011775", "0.50083876", "0.49474934", "0.49435997", "0.49112096", "0.4907587", "0.489784...
0.6423148
0
Remove all occurrence data that is beyond the timeframe away
def garbage_collect(self, timestamp): stale_keys = [] for key, window in list(self.occurrences.items()): if timestamp - lookup_es_key(window.data[-1][0], self.ts_field) > self.rules['timeframe']: stale_keys.append(key) list(map(self.occurrences.pop, stale_keys))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_continuity_gaps(data):\n indexes = data.dropna(how='all').index\n resolution = tf._get_data_resolution(indexes)\n # print(resolution)\n continuity = pd.DataFrame({'Date From': indexes.values.flatten()[:-1],\n 'Date To': indexes.values.flatten()[1:]})\n continui...
[ "0.6462741", "0.63697124", "0.6309201", "0.6152415", "0.60006833", "0.5947367", "0.59286183", "0.59077483", "0.58233404", "0.5817005", "0.58018243", "0.57663417", "0.57635015", "0.5753978", "0.574974", "0.57426316", "0.5714076", "0.56959677", "0.5666575", "0.565121", "0.56509...
0.64764446
0
Menu window for connection options.
def QuickClient(): window = Toplevel(root) window.title("Connection options") window.grab_set() Label(window, text="Server IP:").grid(row=0) destination = Entry(window) destination.grid(row=0, column=1) go = Button(window, text="Connect", command=lambda: client_options_go(des...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def menuItem(*args):\n\toptionsWindow()", "def createConnectionMarkingMenu(ned):\n pass", "def main_menu():\n print('\\n', '='*50, sep='')\n print(\"Choose an option by number: \")\n print(\"\\t 1 = Create or Connect to a new file database\")\n print(\"\\t 2 = Create a new memory database\")\n...
[ "0.7180071", "0.6531201", "0.6517682", "0.63511026", "0.6250732", "0.6205597", "0.6200337", "0.6104969", "0.6094198", "0.6090927", "0.60902876", "0.60812694", "0.60646504", "0.6033254", "0.6027954", "0.6006696", "0.6006", "0.5991397", "0.59778076", "0.59332895", "0.5929329", ...
0.6743488
1
Asks the user to select a mirror or region
def select_mirror_regions(preset_values: Dict[str, Any] = {}) -> Dict[str, Any]: if preset_values is None: preselected = None else: preselected = list(preset_values.keys()) mirrors = list_mirrors() selected_mirror = Menu( _('Select one of the regions to download packages from'), list(mirrors.keys()), pres...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def choose_ROI(self):\n self.dialog.show()", "def select_proper_region(self):\n # Click the desired region\n region = self.driver.find_element_by_css_selector(web_map[self.region][button_path])\n region.click()\n time.sleep(1)\n\n try:\n search = self.driver.f...
[ "0.593471", "0.58292496", "0.53281075", "0.52737904", "0.52704084", "0.52674955", "0.5248862", "0.52418613", "0.52343667", "0.52082294", "0.51641893", "0.51516956", "0.5142655", "0.5131679", "0.51144654", "0.5113026", "0.5052643", "0.50478053", "0.5044979", "0.5043979", "0.50...
0.6011499
0
Allows the user to select additional repositories (multilib, and testing) if desired.
def select_additional_repositories(preset: List[str]) -> List[str]: repositories = ["multilib", "testing"] choice = Menu( _('Choose which optional additional repositories to enable'), repositories, sort=False, multi=True, preset_values=preset, raise_error_on_interrupt=True ).run() match choice.type_:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_repository_choices(self, group, **kwargs):\n try:\n repos = self.get_repositories()\n except ApiError:\n raise IntegrationError(\n 'Unable to retrive repositories. Please try again later.'\n )\n else:\n repo_choices = [(repo['i...
[ "0.65247846", "0.6422345", "0.61720467", "0.5992142", "0.59049773", "0.5868521", "0.58155847", "0.5796395", "0.5795635", "0.5771325", "0.5751288", "0.573541", "0.56290424", "0.5628116", "0.5580904", "0.5551537", "0.5505512", "0.5503683", "0.54568577", "0.544466", "0.54438776"...
0.74506885
0
returns a dictionary representing the given css string
def css2dict(css): cssdict = {} if None == css: return cssdict for pair in css.split(';'): #TODO: what about escaped separators if pair.find(':') >= 0: key, value = pair.split(':') cssdict[ key.strip() ] = value.strip() return cssdict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stylecrunch(stystr):\n return dict(pair.split(\":\") for pair in semicolons.findall(stystr))", "def parse_styles(text: str) -> List[dict]:\n styles = []\n regex = r'(\\d{3})=(\".*?\"),(\\d+\\.?\\d+),(\\(.*?\\))'\n\n for line in text.split(\"\\r\\n\"):\n if line == \"\":\n contin...
[ "0.7565182", "0.63786125", "0.61541766", "0.61383957", "0.60449034", "0.59305197", "0.59305197", "0.59297955", "0.56886953", "0.5599633", "0.5586585", "0.5551669", "0.5522183", "0.5511475", "0.54103243", "0.54039335", "0.5332993", "0.52898246", "0.5279062", "0.52665704", "0.5...
0.8405405
0
converts css color definition (a hexa code with leading or 'rgb()') to eps color definition
def cssColor2Eps(cssColor, colors='RGB'): if '#' == cssColor[0]: r = float(int(cssColor[1:3],16)) / 255 g = float(int(cssColor[3:5],16)) / 255 b = float(int(cssColor[5:7],16)) / 255 else: # assume 'rgb()' color rgb = re.sub('[^0-9]+', ' ', cssColor).strip().split() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def HTMLColorToRGB(colorstring):", "def _from_rgb(self, rgb):\r\n return \"#%02x%02x%02x\" % rgb", "def get_color_in_rgb_decimal():\n\n # Grabbing custom colormap from matplotlib\n a = cm.get_cmap('cool', 32)\n b = cm.get_cmap('spring', 32)\n c = cm.get_cmap('autumn_r', 64)\n d = cm.g...
[ "0.63561934", "0.6239488", "0.6189206", "0.6128038", "0.60768765", "0.60739654", "0.6020834", "0.59405243", "0.59337896", "0.59258235", "0.5920372", "0.59110606", "0.5899338", "0.58159894", "0.58132404", "0.57889074", "0.5785479", "0.5777547", "0.574547", "0.57418907", "0.574...
0.6663057
0
converts svgLength to eps length using the current transformation matrix
def lengthConv(self, svgLength): matrix = self.matrices[-1] epsx = matrix[0] * svgLength epsy = matrix[1] * svgLength return math.sqrt(epsx*epsx + epsy*epsy)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fixNonScalingStroke(path):\n svg, w, h = openSVG(path)\n groups = svg.getElementsByTagName(\"g\")\n # first remove childless groups\n childless = [g for g in groups if len([el for el in g.childNodes if el.nodeType != 3]) == 0] # 3 is the value of TEXT_NODE\n removed=[]\n for g in childless:\...
[ "0.5396958", "0.51962554", "0.5178974", "0.5146222", "0.51342857", "0.5126967", "0.5044272", "0.49974364", "0.49826935", "0.49046278", "0.48724288", "0.4868977", "0.48643032", "0.48499852", "0.48421443", "0.47544014", "0.47328284", "0.4718418", "0.46791637", "0.46724", "0.467...
0.79849714
0
converts svgx, svgy coordinates to eps coordinates using the current transformation matrix
def coordConv(self, svgx, svgy, relative=False): if relative: svgx = float(svgx) + self.curPoint[0] svgy = float(svgy) + self.curPoint[1] else: svgx = float(svgx) svgy = float(svgy) matrix = self.matrices[-1] epsx = matrix[0] * svgx + matri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def svg2paths(svg_file_location,\n return_svg_attributes=False,\n convert_circles_to_paths=True,\n convert_ellipses_to_paths=True,\n convert_lines_to_paths=True,\n convert_polylines_to_paths=True,\n convert_polygons_to_paths=True,\n ...
[ "0.6299751", "0.5921712", "0.5856011", "0.5828061", "0.5808535", "0.5663573", "0.5597315", "0.55227065", "0.5451829", "0.5405776", "0.53755844", "0.53638893", "0.5351364", "0.5350262", "0.5308753", "0.5266446", "0.52424", "0.5240112", "0.522508", "0.5174055", "0.51563597", ...
0.730306
0
multiplies matrix with matrix2
def matrixMul(self, matrix, matrix2): matrix0 = matrix[:] matrix[0] = matrix0[0] * matrix2[0] + matrix0[2]*matrix2[1] # + matrix0[4]*0 matrix[1] = matrix0[1] * matrix2[0] + matrix0[3]*matrix2[1] # + matrix0[5]*0 matrix[2] = matrix0[0] * matrix2[2] + matrix0[2]*matrix2[3] # + matrix0[4]*0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matrix_mult(m1, m2):\n pass", "def mul(self,mat1,mat2):\n if(isinstance(mat2,int)==True):\n result = [[mat1[i][j] * mat2 for j in range(len(mat1[0]))] for i in range(len(mat1))]\n self.out = result\n return self.out\n elif(len(mat1[0])==len(mat2)):\n ...
[ "0.8331192", "0.78144807", "0.77365655", "0.76593673", "0.7568586", "0.7475502", "0.7467693", "0.7414705", "0.73881304", "0.73793954", "0.736702", "0.7325723", "0.7291215", "0.7291215", "0.71967196", "0.71614975", "0.71301925", "0.7107061", "0.70055836", "0.6999651", "0.69885...
0.8054246
1
should be called when a path segment end is reached in a element
def endPathSegment(self, elem): if self.removeStrayPoints and self.segmentCommands <= 1: self.alert("removing stray point", elem) self.epspath = self.epspath[:self.segmentStartIndex] return if self.autoClose and (self.closeOp == 'f' or self.closeOp == 'b'): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def endPath(self) -> None:\n pass", "def endElement(self, tag):\n pass", "def _endElement(self, name):\n name = self.__node_stack[-1].getName()\n if name in list(self.__node_end_visit_dict.keys()):\n self.__node_end_visit_dict[name](self.__node_stack[-1])\n\n self....
[ "0.6862414", "0.65900844", "0.64327216", "0.6248682", "0.6098287", "0.5943914", "0.59415805", "0.59382623", "0.5929189", "0.59030104", "0.5791933", "0.5783992", "0.57512766", "0.57341665", "0.5663573", "0.5591261", "0.55746967", "0.5571224", "0.5532481", "0.5529534", "0.55286...
0.6789083
1
transforms matrix using svg transform attribute
def attrTransform(self, matrix, transform): for ttype, targs in self.reTransformFind.findall(transform): targs = list(map(lambda x: float(x), self.reNumberFind.findall(targs))) if ttype == 'matrix': newmatrix = [ targs[0], targs[1], targs[2], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_4x4_transform(scale_x, scale_y, trans_x, trans_y, trans_z):\r\n transform = [[scale_x, 0.0, 0.0, trans_x],\r\n [0.0, scale_y, 0.0, trans_y],\r\n [0.0, 0.0, 1.0, trans_z],\r\n [0.0, 0.0, 0.0, 1.0]]\r\n return transform", "def fixNonScalingStroke(path):...
[ "0.6280564", "0.6271068", "0.6157171", "0.61280656", "0.6016436", "0.594125", "0.59352785", "0.5932846", "0.59304225", "0.5898772", "0.5873862", "0.5849465", "0.58438855", "0.5840229", "0.5831245", "0.5826484", "0.5795076", "0.5791729", "0.57863724", "0.57750905", "0.57621646...
0.6830423
0
writes used gradient definitions into self.epsSetup
def gradientSetup(self): gradientNum = 0 epsGradients = "" for gradientId, gradient in self.gradients.items(): if gradient['linUseCount'] > 0: gradientNum += 1 epsGradients += ("\n%%AI5_BeginGradient: (l_%s)" + \ "\n(l_%s) 0 %d Bd\...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_regressors(self) :\n\t\tlogging.debug(\"Setting regressors\")\n\t\n\t\tnvars = len(self.ss.variables)\t\t\n\n\t\tself.regressors_true = []\n\t\tfor eqn in self.ss.equations : \n\t\t\tprod= self._find_regressors(eqn,'g')\n\t\t\tdegrad = self._find_regressors(eqn,'h')\n\t\t\tself.regressors_true.append({\n...
[ "0.58231753", "0.5727754", "0.5638937", "0.5570932", "0.5558757", "0.5556781", "0.5495503", "0.54542357", "0.5394431", "0.5337532", "0.5306093", "0.5292332", "0.52698463", "0.5255523", "0.5238003", "0.52352965", "0.52182776", "0.52010906", "0.5187616", "0.5181867", "0.5173451...
0.7156717
0
The JSON file holds the definitions for all of the available bundles.
def get_bundle_definitions(bundleFile): try: with open(bundleFile) as fh_json: bundleDefinitions = json.load(fh_json, object_pairs_hook=check_for_duplicate_key) except IOError as err: logging.error("Failed to access JSON file: '{0}'".format(bundleFile)) sys.exit(1) exc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_bundle_definitions(bundleDefinitions):\n\n logging.info(\"\\n#{0}\\nBundle defintions read from JSON file\".format('-'*60))\n for bundle in sorted(bundleDefinitions):\n logging.info(\" BUNDLE : {0}\".format(bundle))\n\n for item in bundleDefinitions[bundle]['not_supported_configs']:...
[ "0.66532934", "0.6258272", "0.60380584", "0.5864218", "0.5796659", "0.56438226", "0.56121004", "0.55864847", "0.55839664", "0.5527602", "0.55119395", "0.54431605", "0.5428016", "0.5413294", "0.539625", "0.53958285", "0.5381298", "0.5378303", "0.5378303", "0.53761464", "0.5371...
0.7064029
0
Identify any bundles listed in the 'bundle_dependency' section which do not have definitons.
def find_undeclared_bundles(bundleDefinitions): logging.info("\n#{0}\nChecking for undeclared dependencies".format('-'*60)) undeclared = [] for bundle in bundleDefinitions: logging.info(' {0}'.format(bundle)) for dependentBundle in bundleDefinitions[bundle]['bundle_dependency']: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dependencies(self) -> List[Bundle]:\n return []", "def _unresolvedDependents (self):\n return self.__unresolvedDependents", "def missing_references(self):\n return [ ref for ref in self.reference_names() if not config.file_in_cache(self.name, self.observatory) ]", "def show_bundle_de...
[ "0.6660877", "0.6050043", "0.5992544", "0.5860958", "0.5842009", "0.5834465", "0.5649339", "0.5589519", "0.5523849", "0.55094457", "0.5491152", "0.5476097", "0.5469338", "0.5464172", "0.5455044", "0.5449842", "0.5433449", "0.5420869", "0.5414582", "0.54075974", "0.53974825", ...
0.8021731
0
Identify any circular dependencies by constructing the dependency paths. Any item added to a path must not alread be in the path.
def find_circular_dependencies(bundleDefinitions, undeclared): logging.info("\n#{0}\nChecking for circular dependencies".format('-'*60)) circularDependencies = [] for bundle in sorted(bundleDefinitions): # Don't continue with check if the bundle is already part of a circular dependency i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_dependency(bundle, dependencyPath, bundleDefinitions, undeclared, circularDependencies):\n\n if bundle in dependencyPath:\n dependencyPath.append(bundle) # Add the path, so circular dependency report shows full loop\n dependencyPath.append(\"_STOP_\") # Ad...
[ "0.66847825", "0.6227448", "0.60454285", "0.5993753", "0.5929115", "0.5775236", "0.5752626", "0.57454526", "0.56339025", "0.56230384", "0.56101286", "0.56044245", "0.5593142", "0.5564136", "0.55628574", "0.5504652", "0.548935", "0.5435659", "0.5426029", "0.54183215", "0.54099...
0.62650263
1
Checks whether a bundle is part of an already discovered circular dependency. If it is then there is no need to check again!!
def bundle_already_in_circ_dep(bundle, circularDependencies): for circDep in circularDependencies: if bundle in circDep: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_circular_dependencies(bundleDefinitions, undeclared):\n\n logging.info(\"\\n#{0}\\nChecking for circular dependencies\".format('-'*60))\n\n circularDependencies = []\n\n for bundle in sorted(bundleDefinitions):\n\n # Don't continue with check if the bundle is already part of a circular dep...
[ "0.6437034", "0.6402119", "0.60723346", "0.6002684", "0.5847695", "0.5814916", "0.57556236", "0.5735556", "0.5728871", "0.57168245", "0.57039297", "0.563764", "0.5626051", "0.5616689", "0.5523088", "0.54770434", "0.5466552", "0.5447443", "0.54447263", "0.5420267", "0.54147583...
0.84915686
0
Build up the dependency path. A circular dependency occurs if the bundle to be added is already in the path. Any undeclared dependencies.wil be ignored.
def add_dependency(bundle, dependencyPath, bundleDefinitions, undeclared, circularDependencies): if bundle in dependencyPath: dependencyPath.append(bundle) # Add the path, so circular dependency report shows full loop dependencyPath.append("_STOP_") # Add a marker ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dependency_dir(self) -> Path:", "def _set_dependencies(self, analysis, path):\n for toc in (analysis.binaries, analysis.datas):\n for i, tpl in enumerate(toc):\n if not tpl[1] in self._dependencies:\n logger.debug(\"Adding dependency %s located in %s\", tpl...
[ "0.6905839", "0.64517426", "0.58908755", "0.58455557", "0.5633123", "0.55449796", "0.55188257", "0.5448078", "0.54315066", "0.5429512", "0.54067385", "0.53938925", "0.53731686", "0.53731686", "0.5358674", "0.53106695", "0.5300706", "0.529237", "0.52539355", "0.52501297", "0.5...
0.75771683
0
Generate the list of bundles to be generated for the specified build configuration. Only the bundles supported by the requested build configuration are added.to the list. The list is in the correct order to cope with bundle dependencies.
def determine_bundles_for_config(buildConfig, bundleDefinitions): logging.info("\n#{0}\nDetermining bundle order for {1}".format('-'*60, buildConfig)) bundlesForConfig = [] for bundle in sorted(bundleDefinitions): bundleReqdForConfig = True for unsupported in bundleDefinitions[bundle]['not...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_bundles_for_config(buildConfig, bundlesForConfig):\n\n logging.info(\"\\n#{0}\\nOrdered list of bundles to be generated for {1}\".format('-'*60, buildConfig))\n logging.info(' {0}\\n'.format( '\\n '.join(str(x) for x in bundlesForConfig)))", "def insert_bundle_in_list (bundle, bundlesForConf...
[ "0.74364465", "0.60412747", "0.60352236", "0.59575236", "0.5830665", "0.58042866", "0.58034015", "0.55368704", "0.54618466", "0.5451596", "0.5436672", "0.5411953", "0.5403626", "0.5385279", "0.53844357", "0.5361635", "0.5358353", "0.5347456", "0.5342946", "0.53264004", "0.530...
0.6920122
1
Insert the target bundle into the list in the correct place to allow for bundle dependecies. This is a recursive function which will consider any dependencies that the target bundle has. The recurseDepth is used for output formatting only (only seen when logging set to INFO) The '.bdl' suffix is stripped off when addin...
def insert_bundle_in_list (bundle, bundlesForConfig, bundleDefinitions, recurseDepth): logging.info('{0}Processing bundle : {1}'.format(' '*recurseDepth, bundle)) bundleNoSuffix = re.sub('\.bdl$', '', bundle) if not bundleNoSuffix in bundlesForConfig: if len(bundleDefinitions[bundle]['bundle_d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_dependency(bundle, dependencyPath, bundleDefinitions, undeclared, circularDependencies):\n\n if bundle in dependencyPath:\n dependencyPath.append(bundle) # Add the path, so circular dependency report shows full loop\n dependencyPath.append(\"_STOP_\") # Ad...
[ "0.5469248", "0.5374542", "0.5002664", "0.4853261", "0.44343942", "0.4345729", "0.42835534", "0.4267142", "0.425596", "0.41964754", "0.41816697", "0.41801015", "0.41651815", "0.41616327", "0.4154839", "0.41496274", "0.4140611", "0.413978", "0.41358128", "0.41320792", "0.41120...
0.7294369
0
Output the ordered list of bundles for the requested build configuration. This is written to stdout, or to the specified file.
def output_result(bundlesForConfig, ofile): result = ('{0}\n'.format('\n'.join(str(x) for x in bundlesForConfig))) if ofile: try: with open(ofile, "w") as outfile: outfile.write(result) except IOError as err: logging.error("{0}".format(err)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_bundles_for_config(buildConfig, bundlesForConfig):\n\n logging.info(\"\\n#{0}\\nOrdered list of bundles to be generated for {1}\".format('-'*60, buildConfig))\n logging.info(' {0}\\n'.format( '\\n '.join(str(x) for x in bundlesForConfig)))", "def list_bundles():\n response = houston.get(\...
[ "0.79161257", "0.60409415", "0.5940385", "0.5914158", "0.5771154", "0.5641886", "0.5558533", "0.54321206", "0.540583", "0.53593206", "0.5343445", "0.5253075", "0.5142436", "0.5136483", "0.5119899", "0.51133585", "0.51004875", "0.50714576", "0.5069464", "0.5037573", "0.5022329...
0.6991703
1