query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Restrict most types of constant except for numeric types and constant strings Picks up some obvious conversions such as None and Bools
def _Constant(self, t): value = t.value if isinstance(value, tuple): self.RaiseError(t, "Tuples not supported") if isinstance(value, dict): self.RaiseError(t, "Dictionaries not supported") if isinstance(value, list): self.RaiseError(t, "Lists not suppo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def smart_coerce(value: str) -> ValueType:\n try:\n return int(value)\n except ValueError:\n pass\n try:\n return float(value)\n except ValueError:\n pass\n if value.lower() in ('null', 'none', ):\n return None\n elif value.lower() in ('true', ):\n return...
[ "0.6328382", "0.6033366", "0.5924364", "0.5904759", "0.5871673", "0.582811", "0.57898164", "0.5732572", "0.57246566", "0.57075286", "0.5638559", "0.559512", "0.5559636", "0.55591905", "0.54913414", "0.54847956", "0.5479766", "0.547383", "0.54578835", "0.54506004", "0.544511",...
0.5639109
10
Equivalent to a ternary operator
def _IfExp(self, t): self.dispatch(t.test) self.write(" ? ") self.dispatch(t.body) self.write(" : ") self.dispatch(t.orelse)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conditional_value(self) -> global___Expression.ConditionalOperator:", "def get_truefalse(truefalse):\n return 'True' if truefalse else 'False'", "def toggle(condition, if_true, if_false):\n return (if_true if condition else if_false)", "def ifelse(test, if_true, if_false):\n if test:\n re...
[ "0.6408623", "0.60773087", "0.60416794", "0.6040853", "0.5728847", "0.5722783", "0.5698696", "0.5694586", "0.5692849", "0.5692849", "0.56510156", "0.56408584", "0.5613775", "0.55266976", "0.551668", "0.5453018", "0.54519844", "0.544794", "0.5433943", "0.5424278", "0.53960836"...
0.5033665
59
Translate to C equivalent opertaors
def _UnaryOp(self, t): self.write("(") self.write(self.unop[t.op.__class__.__name__]) self.dispatch(t.operand) self.write(")")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CL(self):", "def C(self, u, v):\n pass", "def lin_o_func(self):\n return self.hx", "def c(self):\n pass", "def c(self):\n pass", "def exo2():", "def _make_array(self, c):\n return (c * ctypes.py_object)()", "def topoc2ant_c_wrapped(el, az):\n gam = ct.c_double()\...
[ "0.55931556", "0.55788374", "0.54712087", "0.545349", "0.545349", "0.5416191", "0.53282946", "0.53185683", "0.52821124", "0.5247868", "0.52405506", "0.519369", "0.5176467", "0.5163417", "0.5161596", "0.5116109", "0.51085824", "0.5087596", "0.50612295", "0.50414175", "0.503272...
0.0
-1
Python style pow and floordiv are not supported so translate to a function call. No matrix mul support.
def _BinOp(self, t): op_name = t.op.__class__.__name__ # translate pow into function call (no float version) if op_name == "Pow": self.write("pow(") self.dispatch(t.left) self.write(", ") self.dispatch(t.right) self.write(")") #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __pow__(self, ???):", "def power(a, b):\n \n return a**b", "def __pow__(self,*args):\r\n pass", "def py_pow(x, p, op_version=None):\n return x ** p", "def pow(x, y):\n return 0.0", "def __rpow__(self, ???):", "def pow(space, w_base, w_exponent, w_modulus):\n return space.pow(w_base, ...
[ "0.7005062", "0.68626165", "0.68304825", "0.67894477", "0.6744171", "0.6733175", "0.6722", "0.67047685", "0.6682735", "0.66395473", "0.6584284", "0.6565196", "0.65598845", "0.655792", "0.655061", "0.655061", "0.655061", "0.655061", "0.655061", "0.655061", "0.655061", "0.655...
0.0
-1
Translate to logical and/or operators in C
def _BoolOp(self, t): self.write("(") s = " %s " % self.boolops[t.op.__class__] interleave(lambda: self.write(s), self.dispatch, t.values) self.write(")")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def and_(a, b):", "def _and(it):\n return 1 if it[0]==1 and it[1]==1 else 0", "def _logical_and(*args):\n args_ = [_static_value(x) for x in args]\n if any(x is not None and not bool(x) for x in args_):\n return constant_op.constant(False)\n if all(x is not None and bool(x) for x in args_):\n retur...
[ "0.80580425", "0.74413097", "0.74133176", "0.7363188", "0.7348686", "0.72836405", "0.7277993", "0.7163794", "0.7146615", "0.7092901", "0.7062364", "0.6979023", "0.6877739", "0.6872799", "0.6869939", "0.6856394", "0.6841215", "0.68358576", "0.6812308", "0.6753586", "0.6708629"...
0.0
-1
A very limited set of attributes are supported so these are fully evaluated here. Other places where attribute type expressions may occur will also evaluate them fully rather than recursively call this function. Attributes supported are only; pyflamegpu.attribute a supported attribute e.g. pyflamegpu.ALIVE. This will b...
def _Attribute(self,t): # Only a limited set of globals supported func_dict = None # pyflamegpu singleton if isinstance(t.value, ast.Name): if t.value.id == "pyflamegpu": if t.attr in self.fgpu_attrs: # proceed ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testattributes(self):\n for attr in ('ST', 'DX', 'IQ', 'MA', 'Dam', 'Hit'):\n AttributeAbility([attr,])", "def check_common_attrs(self, ast):\n declarator = ast.declarator\n attrs = declarator.attrs\n meta = declarator.metaattrs\n ntypemap = ast.typemap\n ...
[ "0.6042245", "0.5977239", "0.5950845", "0.5936985", "0.59264654", "0.5886172", "0.5826526", "0.5790564", "0.5755268", "0.567972", "0.56774443", "0.5620047", "0.553324", "0.55215055", "0.54968786", "0.5450834", "0.5426266", "0.5415868", "0.5412917", "0.5388492", "0.53772295", ...
0.713576
0
Some basic checks are undertaken on calls to ensure that the function being called is either a builtin or defined device function. A special dispatcher is required
def _Call(self, t): # check calls but let attributes check in their own dispatcher funcs = self._device_functions + self.pythonbuiltins + [self._input_message_var] # message_input variable is a valid function name as certain message types have arguments on iterator if isinstance(t.func, ast.Name...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(fun_name):", "def test_dispatchUnknown(self):\n disp = Dispatcher()\n name = \"missing\"\n args = (1, 2)\n res = disp.dispatch(name, *args)\n self.assertEqual(res, (name,) + args)", "def validate_universal_calls(cls):\n assert True == cls.universal...
[ "0.5971725", "0.5816666", "0.56597704", "0.565735", "0.56368434", "0.56075937", "0.560516", "0.5587939", "0.55403495", "0.54888415", "0.542656", "0.5398054", "0.53934664", "0.53790116", "0.5372327", "0.53566486", "0.53564227", "0.5351131", "0.53422856", "0.5330329", "0.532966...
0.5911068
1
Arrays are not supported but subscript allows accessing array like variables which is required for macro environment properties (e.g. a[0][1][2])
def _Subscript(self, t): self.dispatch(t.value) self.write("[") self.dispatch(t.slice) self.write("]")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_test_arraypointertype(self):\n input = \"\"\"\n void main () {\n float arr[3];\n arr[2]=1.5;\n foo(arr);\n arr[2] = foo(arr)[2] + 1.1;\n putFloatLn(arr[2]);\n }\n float[] foo(float x[]){\n x[2] = 5.1;\n return x;\n ...
[ "0.5226535", "0.52079296", "0.51937526", "0.5155106", "0.51182663", "0.5075775", "0.505575", "0.50432193", "0.4988872", "0.4984631", "0.4984631", "0.49769264", "0.49674764", "0.49674764", "0.4951684", "0.48429304", "0.48406672", "0.48227164", "0.47971278", "0.47961617", "0.47...
0.0
-1
Arguments should be processed by a custom dispatcher and it should not be possible to get here
def _arg(self, t): self.RaiseError(t, "Arguments should already have been processed")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, args):", "def handle_arguments(self, args):\n debug(\"BloomGenerator.handle_arguments: got args -> \" + str(args))", "def _post_argument_parsing(self):\n pass", "def dispatcher(self):\n pass # pragma: no cover", "def __call__(self, args, kwargs):\n raise NotI...
[ "0.69573575", "0.6790874", "0.66730875", "0.66662073", "0.6665857", "0.6653361", "0.66326094", "0.6623602", "0.655339", "0.65198654", "0.6508264", "0.6471017", "0.6397061", "0.63866425", "0.63720274", "0.63668007", "0.6358945", "0.6358945", "0.6345801", "0.6319397", "0.631502...
0.0
-1
Arguments should be processed by a custom dispatcher and it should not be possible to get here
def _arguments(self, t): self.RaiseError(t, "Arguments should already have been processed")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, args):", "def handle_arguments(self, args):\n debug(\"BloomGenerator.handle_arguments: got args -> \" + str(args))", "def _post_argument_parsing(self):\n pass", "def __call__(self, args, kwargs):\n raise NotImplementedError", "def dispatcher(self):\n pass # p...
[ "0.695645", "0.67914146", "0.6672667", "0.6665095", "0.6663948", "0.6652526", "0.6631388", "0.66237223", "0.65519965", "0.65194076", "0.65079045", "0.6469331", "0.63968253", "0.6386184", "0.63703763", "0.63667357", "0.63573086", "0.63573086", "0.63446873", "0.6319109", "0.631...
0.0
-1
A function to visualize pymatgen Structure objects in jupyter notebook using chemview package.
def quick_view(structure, bonds=True, conventional=False, transform=None, show_box=True, bond_tol=0.2, stick_radius=0.1): s = structure.copy() if conventional: s = SpacegroupAnalyzer(s).get_conventional_standard_structure() if transform: s.make_supercell(transform) atom_types = [i.symb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ipython_repr_no_nglview(self):\n molecule = Molecule().from_smiles(\"CCO\")\n molecule._ipython_display_()", "def jupyter():", "def test_visualize_openeye(self):\n import IPython\n\n mol = Molecule().from_smiles(\"CCO\")\n\n assert isinstance(mol.visualize(backend=\"...
[ "0.64746124", "0.6093616", "0.6001484", "0.6001484", "0.5946787", "0.58996487", "0.58758247", "0.5842013", "0.5826114", "0.5824589", "0.5681209", "0.56638604", "0.56560427", "0.5653275", "0.5592476", "0.5589071", "0.5589071", "0.557641", "0.5573647", "0.5561114", "0.55604887"...
0.6274498
1
Sets the latitude of the center of the map (in degrees North).
def lat(self): return self['lat']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_center_position(self, lon, lat):\n self.lon_center = lon\n self.lat_center = lat", "def center_map(self):\n self.folium_map.location = _get_center_coords(self.locations)", "def setLonLat(self, longitude, latitude):\n self._lon = longitude\n self._lat = latitude\n ...
[ "0.79386646", "0.6982322", "0.69601065", "0.69601065", "0.6958233", "0.67998946", "0.6750116", "0.6718834", "0.6718834", "0.6718834", "0.6657234", "0.6521176", "0.65120494", "0.6503709", "0.64779633", "0.6468823", "0.6463587", "0.6361164", "0.63329315", "0.63317585", "0.62532...
0.52226204
85
Sets the longitude of the center of the map (in degrees East).
def lon(self): return self['lon']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_center_position(self, lon, lat):\n self.lon_center = lon\n self.lat_center = lat", "def center_map(self):\n self.folium_map.location = _get_center_coords(self.locations)", "def set_lon(self, lon):\n self._set_sub_text('lon', text=str(lon))\n return self", "def longi...
[ "0.7713446", "0.6939537", "0.6829773", "0.6798695", "0.6644435", "0.6644435", "0.6644435", "0.6521517", "0.6521517", "0.63733596", "0.6272971", "0.6196717", "0.6163853", "0.61490005", "0.6020683", "0.60018146", "0.59674734", "0.5966749", "0.5953392", "0.59224313", "0.59046423...
0.5577709
36
Construct a new Center object
def __init__(self, arg=None, lat=None, lon=None, **kwargs): super(Center, self).__init__('center') # Validate arg # ------------ if arg is None: arg = {} elif isinstance(arg, self.__class__): arg = arg.to_plotly_json() elif isinstance(arg, dict): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, centre):\n super().__init__()\n self.centre = centre", "def __init__(self, center=None, radius=1):\n if center is None:\n center = Point()\n self.center = center\n self.radius = radius", "def __init__( self , center , radius ):\r\n self.ce...
[ "0.72278726", "0.722529", "0.71776736", "0.6926115", "0.6846305", "0.67975366", "0.67975366", "0.67975366", "0.67975366", "0.664468", "0.664468", "0.6639922", "0.64834195", "0.64597523", "0.64532304", "0.64329094", "0.64091885", "0.6394365", "0.63900244", "0.6376003", "0.6372...
0.7048143
3
Remove the sprite from all lists and cancel the update event.
def remove_from_sprite_lists(self): super().remove_from_sprite_lists() # It is very important to call this to prevent potential # issues such as crashes or excess memory use from failed # garbage collection. pyglet.clock.unschedule(self.update)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self):\n # delete sprite if fired\n if not self.player.state == 'USE_A':\n self.game.all_sprites.remove(self)", "def remove_sprites(self, *sprites):\r\n with self.lock:\r\n self.sprites_to_unload.update(sprites)", "def _remove_texture(self):\n # Retrieve the i...
[ "0.766939", "0.72574145", "0.6607035", "0.65096223", "0.64890796", "0.64082247", "0.63706535", "0.63706535", "0.6319077", "0.6264712", "0.62010026", "0.61186045", "0.60208344", "0.60023475", "0.59555334", "0.59235364", "0.5921738", "0.5916878", "0.5907688", "0.5894691", "0.58...
0.82141757
0
Update the graph by redrawing the internal texture data.
def update_graph(self, delta_time: float): # Skip update if there is no SpriteList that can draw this graph if self.sprite_lists is None or len(self.sprite_lists) == 0: return sprite_list = self.sprite_lists[0] # Clear and return if timings are disabled if not arca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _redraw_graph(self) -> None:\n self._clear_drawing()\n self.draw_graph(graph=self.graph, axes=self.subplot)\n self.draw_graph(graph=self.graph2, axes=self.subplot2)\n self.draw_mappings(self.mapping)", "def _update_current_graph(self, **kwargs):\n\n self.current_graph.redra...
[ "0.73301584", "0.7203513", "0.7171285", "0.7122468", "0.6981086", "0.682984", "0.6811901", "0.6716891", "0.66613007", "0.65672034", "0.6497443", "0.6478494", "0.6450372", "0.64425576", "0.63823295", "0.6361715", "0.6361715", "0.63509274", "0.634727", "0.6336588", "0.6336588",...
0.6214974
28
Make sure that the wavelength solution gives same results on different runs.
def test_regression_determine_wavelength_solution( ad, params, caplog, change_working_dir, path_to_refs, request): caplog.set_level(logging.INFO, logger="geminidr") with change_working_dir(): logutils.config(file_name='log_regress_{:s}.txt'.format(ad.data_label())) p = GNIRSLongslit([ad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def runWavelengthDependency():\n RunData([getFiles(mintime=(15, 39, 58), maxtime=(15, 47, 58), folder='data/30Jul/')[0],], out='I600nmwave',\n wavelength='l600')\n RunData([getFiles(mintime=(17, 48, 35), maxtime=(17, 56, 03), folder='data/30Jul/')[0],], out='I700nmwave',\n wavelength='l...
[ "0.6326733", "0.62901336", "0.62077874", "0.6200481", "0.61979157", "0.61383563", "0.6129043", "0.61258394", "0.61127585", "0.6074986", "0.606553", "0.6044059", "0.60430026", "0.60421956", "0.6021372", "0.60169053", "0.597903", "0.59567064", "0.5934162", "0.59200054", "0.5919...
0.6112688
9
Returns the preprocessed spectrum file.
def ad(path_to_inputs, request): filename = request.param path = os.path.join(path_to_inputs, filename) if os.path.exists(path): ad = astrodata.open(path) else: raise FileNotFoundError(path) return ad
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocessing(filename):\n reporting(\"Preprocessing file...\", True)\n chdir(path.dirname(filename))\n (rate, sig) = wavefile.load(path.split(filename)[1])\n signal = sig[0]\n\n duration = len(signal) / rate\n reporting(f\"Done. Duration={duration}\")\n return signal", "def spectrum(sel...
[ "0.6432614", "0.6161507", "0.60673326", "0.5921605", "0.59183276", "0.58777124", "0.5702783", "0.56843203", "0.5673299", "0.56465805", "0.5645744", "0.56218576", "0.55903924", "0.5574906", "0.55568427", "0.5550424", "0.5543234", "0.55300075", "0.55147284", "0.55121267", "0.54...
0.0
-1
Generate text file with test details.
def do_report(ad, ref_ad, failed): output_dir = ("../DRAGONS_tests/geminidr/gnirs/longslit/" "test_determine_wavelength_solution") os.makedirs(output_dir, exist_ok=True) report_filename = 'report.txt' report_path = os.path.join(output_dir, report_filename) ref_wavecal_model = am.g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_test_txt(name, path):\n with open(path + '/test.txt', 'a') as file:\n file.write('data/test/' + name + '\\n')", "def write_tests(project_name, root_dir):\r\n test_path = get_file_path(root_dir, \"tests\", \"%s_tests.py\" % project_name) #Get the path for setup.py\r\n test_content = g...
[ "0.78161335", "0.7021593", "0.685751", "0.6783171", "0.6773141", "0.6696793", "0.65754807", "0.6556282", "0.65421546", "0.652261", "0.651013", "0.65013415", "0.64712375", "0.64608437", "0.641307", "0.63824457", "0.6368995", "0.6334157", "0.6326425", "0.62804115", "0.62656343"...
0.0
-1
Creates input data for tests using preprocessed standard star and its calibration files. The raw files will be downloaded and saved inside the path stored in the `$DRAGONS_TEST/raw_inputs` directory. Processed files will be stored inside a new folder called "dragons_test_inputs". The subdirectory structure should refle...
def create_inputs_recipe(): module_name, _ = os.path.splitext(os.path.basename(__file__)) path = os.path.join(CREATED_INPUTS_PATH_FOR_TESTS, module_name) os.makedirs(path, exist_ok=True) os.chdir(path) os.makedirs("inputs/", exist_ok=True) print('Current working directory:\n {:s}'.format(os.g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_test_inputs(input_dir):\n # Prepare input parameters\n parameters = Dict(dict={})\n # example structure: bcc Fe\n structure = StructureData(cell=[[1.42002584, 1.42002584, 1.42002584],\n [1.42002584, -1.42002584, -1.42002584],\n ...
[ "0.6538091", "0.6146276", "0.607586", "0.5977594", "0.5945953", "0.59351915", "0.5910153", "0.5886085", "0.5845465", "0.5794927", "0.576355", "0.574656", "0.57456464", "0.57011575", "0.5694419", "0.569211", "0.5688554", "0.5685619", "0.56332463", "0.56278634", "0.5609137", ...
0.7445018
0
This function checks that the ordering of the samples matches between the expression file and the metadata file. This ordering is used for calculating DEGs.
def compare_and_reorder_samples(expression_file, metadata_file): # Check ordering of sample ids is consistent between gene expression data and metadata metadata = pd.read_csv(metadata_file, sep="\t", header=0, index_col=0) metadata_sample_ids = metadata.index expression_data = pd.read_csv(expression_fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_file_sorting(observable_config_path: list[Path]) -> None:\n _names = list(map(lambda f: f.name, observable_config_path))\n _names_sorted = list(\n sorted(_names, key=lambda f: re.findall(r\"(\\d+).bin\", f)[0])\n )\n _is_match = [f0 == f1 for f0, f1 in zip(_names, _names_sorted)]\n ...
[ "0.57153094", "0.5681696", "0.56747234", "0.56506944", "0.56446517", "0.5587243", "0.5585911", "0.5583389", "0.5577927", "0.5573355", "0.55560887", "0.55500454", "0.5520259", "0.5505986", "0.5488156", "0.546695", "0.5445724", "0.54166615", "0.5415728", "0.54112035", "0.539252...
0.8004621
0
This function reads in pseudomonas pathway data from `pathway_DB_filename` and formats and outputs it to `output_filename` in order to be used in GSEA_analysis.R
def format_pseudomonas_pathway_DB(pathway_DB_filename, local_dir, out_filename): # Read in pathway data pa_pathway_DB = pd.read_csv( pathway_DB_filename, names=["pathway id", "num genes", "genes"], sep="\t", header=None, ) # Drop extra column pa_pathway_DB.drop(colum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_ripser_output(output_path,max_dim,output_name=None):\n # \\todo add persistence by density (columns pers by threshold and column pers by dens) ## only needed if input weighted network\n output_file_path =os.path.join(output_path,'output_ripser.txt')\n data = open(output_file_path,'rb').readlines(...
[ "0.5886894", "0.5863955", "0.5786592", "0.5592899", "0.558136", "0.5495973", "0.5433662", "0.5431351", "0.5404583", "0.53899485", "0.53796154", "0.53388137", "0.5241749", "0.52406466", "0.52103275", "0.5181477", "0.5170354", "0.51633763", "0.5160058", "0.513753", "0.5134894",...
0.78855044
0
This function processes samples in the template and simulated experiments to prepare for DE analysis using DESeq.
def process_samples_for_limma( expression_filename, grp_metadata_filename, out_expression_filename=None, process_metadata_filename=None, ): # Read data expression = pd.read_csv(expression_filename, sep="\t", index_col=0, header=0) if process_metadata_filename is not None: process_me...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare(params, samples):\r\n return", "def _insertAllSteps(self): \n self.uMics = self.inputCoordinatesTiltedPairs.get().getUntilted().getMicrographs()\n self.tMics = self.inputCoordinatesTiltedPairs.get().getTilted().getMicrographs()\n\n self.inputMics = self._createSetOfParti...
[ "0.5883362", "0.5755976", "0.57489634", "0.56756586", "0.5667148", "0.56626016", "0.5629808", "0.5613106", "0.55905974", "0.5588201", "0.5555386", "0.555308", "0.55530614", "0.55265236", "0.5500799", "0.5494181", "0.54867214", "0.54662234", "0.5421914", "0.54192924", "0.54029...
0.0
-1
This function processes samples in the template and simulated experiments to prepare for DE analysis using DESeq.
def process_samples_for_DESeq( expression_filename, grp_metadata_filename, out_expression_filename=None, count_threshold=None, process_metadata_filename=None, ): # Read data expression = pd.read_csv(expression_filename, sep="\t", index_col=0, header=0) if process_metadata_filename is no...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare(params, samples):\r\n return", "def _insertAllSteps(self): \n self.uMics = self.inputCoordinatesTiltedPairs.get().getUntilted().getMicrographs()\n self.tMics = self.inputCoordinatesTiltedPairs.get().getTilted().getMicrographs()\n\n self.inputMics = self._createSetOfParti...
[ "0.5884892", "0.5756187", "0.57483244", "0.5675142", "0.5668464", "0.56622994", "0.5629105", "0.5612436", "0.5591457", "0.5587859", "0.5554776", "0.55546945", "0.5554384", "0.552562", "0.5499063", "0.5493435", "0.548793", "0.5467298", "0.54216987", "0.54175216", "0.5401552", ...
0.5284362
33
Compute the hash of a parsed JSON value using the given hash object. This function does not hash the JSON value, it hashes the object tree that is the result of parsing a string in JSON format. Hashables (JSON objects) are hashed entry by entry in order of the lexicographical ordering on the keys. Iterables are hashed ...
def hash_json( hash_obj, value ): try: items = iter(list(value.items( ))) except AttributeError: # Must check for string before testing iterability since strings are iterable if isinstance( value, str ): _hash_string( hash_obj, value ) else: try: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_hash_json(self):\n # pre-sorted str object\n self.assertEqual('5348ed1f4cd2f73e576bb66b866f2800', \\\n comparator.hash_json('{\"a_1\": [{\"a_2\": 2, \"f_2\": 3, \"g_2\": 1}], \"c_3\": 1}'))\n # pre-sorted dict object\n self.assertEqual('5348ed1f4cd2f73e576bb66b866f28...
[ "0.65041846", "0.6385206", "0.6255319", "0.62435746", "0.6187472", "0.6180679", "0.6165562", "0.6159233", "0.6080034", "0.5938248", "0.59185636", "0.5907186", "0.5907186", "0.5907186", "0.5907186", "0.5907186", "0.58739746", "0.58451295", "0.58451295", "0.58178645", "0.581098...
0.79588073
0
Remove selected items from the tree. Because data is stored separately also need to deal with it, but deleting the matching items from the data list and updating all of the data indexes is a bit of a headache, so just make them empty.
def remove_treeItem(browser, tree): items = tree.selectedItems() for item in items: if item.listIndex: # Only dataset items have a listIndex browser.ui.workingDataTree.dataItems[item.listIndex] = [] sip.delete(item)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_selected(self):\n if not self.tree_widget.selectedItems():\n self.configuration_widgets.logger.warning('Nothing has been selected. Please select an item and try again.')\n return\n _selected_items = self.tree_widget.selectedItems()\n root = self.tree_widget.inv...
[ "0.72222024", "0.67945594", "0.6788877", "0.6749571", "0.66043264", "0.6599819", "0.65675104", "0.6546712", "0.6505644", "0.634928", "0.6347942", "0.6327042", "0.632324", "0.63223594", "0.62746567", "0.6272785", "0.6232611", "0.6196286", "0.61239", "0.6118763", "0.6097092", ...
0.72647107
0
Clone h5 item. Useful for Drag & Drop
def clone_item(item): i = h5Item(item.text(0)) i.path = item.path i.listIndex = item.dataIndex i.originalIndex = item.originalIndex i.data = item.data return i
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clone(self):", "def clone(self):\n raise NotImplementedError", "def copy(self, h5file=None):\n h5 = qpimage.core.copyh5(self.h5, h5file)\n return FLImage(h5file=h5, h5dtype=self.h5dtype)", "def copy(self):\n new_h5 = FileHDFio(file_name=self.file_name, h5_path=self.h5_path)\n ...
[ "0.6020959", "0.58370215", "0.5827161", "0.5780741", "0.57302743", "0.57141834", "0.568242", "0.5659609", "0.5652022", "0.56075025", "0.55323535", "0.5526989", "0.5505679", "0.5489802", "0.54832345", "0.5482787", "0.5463926", "0.53882384", "0.5372098", "0.5372057", "0.533904"...
0.74541837
0
Helper function to convert SPARQL results into a Pandas data frame.
def get_sparql_dataframe(query, service = "https://query.wikidata.org/sparql"): sparql = SPARQLWrapper(service) sparql.setQuery(query) sparql.setReturnFormat(JSON) result = sparql.query() processed_results = json.load(result.response) cols = processed_results['head']['vars'] out = [] f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sparql_dataframe(service, query):\n sparql = SPARQLWrapper(service)\n sparql.setQuery(query)\n sparql.setReturnFormat(JSON)\n result = sparql.query()\n\n processed_results = json.load(result.response)\n cols = processed_results['head']['vars']\n\n out = []\n...
[ "0.7584528", "0.7129623", "0.7129623", "0.711426", "0.7094009", "0.7050637", "0.70471936", "0.6952182", "0.6945529", "0.6940668", "0.6868899", "0.6827423", "0.6801506", "0.6724016", "0.67137694", "0.6685681", "0.6672927", "0.6663773", "0.66266656", "0.6613739", "0.6602476", ...
0.7614764
0
Build a dictionary describing a music album
def make_album(artist_name, album_title): music_album = { 'Artist': artist_name.title(), 'Album': album_title.title() } return music_album
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_album(artist, title, songs=None):\n album = {}\n album['artist'] = artist\n album['title'] = title\n if songs:\n album['songs'] = songs\n return album", "def make_album(artist, title):\n album_dict = {\n 'artist': artist.title(),\n 'title': title.title(),\n ...
[ "0.78110856", "0.77839744", "0.7685824", "0.76828676", "0.76828676", "0.7542805", "0.75344175", "0.7530572", "0.7466792", "0.7411964", "0.735979", "0.73411816", "0.73353547", "0.73207825", "0.730691", "0.728729", "0.7213423", "0.71799314", "0.710353", "0.7094194", "0.7069114"...
0.7782399
2
Build a dictionary describing a music album
def make_album_two(artist_name, album_title, number_of_songs= None): music_album = {'Artist': artist_name.title(), 'Album': album_title.title()} if number_of_songs: music_album['Number of Songs'] = number_of_songs return music_album
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_album(artist, title, songs=None):\n album = {}\n album['artist'] = artist\n album['title'] = title\n if songs:\n album['songs'] = songs\n return album", "def make_album(artist, title):\n album_dict = {\n 'artist': artist.title(),\n 'title': title.title(),\n ...
[ "0.78110856", "0.77839744", "0.7782399", "0.7685824", "0.76828676", "0.76828676", "0.7542805", "0.75344175", "0.7530572", "0.7466792", "0.7411964", "0.735979", "0.73411816", "0.73353547", "0.73207825", "0.730691", "0.728729", "0.7213423", "0.71799314", "0.710353", "0.7094194"...
0.68839395
23
Build a set of resources who are available for a given time. It might make more sense to work based on a given restricted resource set.
def avail(self, time, resource_group): a = set() for r in self.resource_group.resources: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _filter_resources_by_age(self, resources: [], resource_age_minutes: int):\n all_resources = []\n for resource in resources:\n if resource_age_minutes:\n start = self._to_utc_datetime(resource.updated_on)\n end = datetime.utcnow().replace(tzinfo=pytz.UTC)\n...
[ "0.6184426", "0.60298663", "0.5953174", "0.5767035", "0.5638926", "0.5493595", "0.54747224", "0.5458828", "0.54446715", "0.5438135", "0.53841877", "0.53665984", "0.5353068", "0.53493536", "0.53424084", "0.53357965", "0.53341115", "0.5326668", "0.53145623", "0.5271738", "0.526...
0.73468834
0
Test to see if the mongodb client logger can persist a log entry to the database
def test_mongo_logging_client_persists_log(): error_message = "This is a test message." logger = LoggingService(console_output=True) result = logger.log(LogEntry(LogLevel.ERROR, __name__, error_message)) logger.log(LogEntry(LogLevel.WARN, __name__, error_message)) logger.log(LogEntry(LogLevel.INFO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_log(self):\n message = \"Message is {0}\".format(random.random())\n resp = gracedb.writeLog(eventId, message)\n self.assertEqual(resp.status, 201)\n new_log_uri = resp.getheader('Location')\n new_log = resp.json()\n self.assertEqual(new_log_uri, new_log['se...
[ "0.6045933", "0.586778", "0.5836898", "0.5810724", "0.57567275", "0.56929016", "0.56574714", "0.5656057", "0.5636488", "0.5636488", "0.5576545", "0.55317235", "0.5509709", "0.54728764", "0.5472665", "0.5462667", "0.54399234", "0.53963417", "0.53956026", "0.5391641", "0.538321...
0.6278423
0
API.Java is the file with most revisions and fixes in the bug introducing change.
def test_revisions_weight(self): solution = FeatureWeightLearner(self.repository, generations=70).learn() self.assertGreater(solution["revisions"], solution["fixes"])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api(self) -> str:", "def patch_sdk():", "def patch_sdk():", "def patch_sdk():", "def write_updated_content(filename, updated_jdoc):\n\n with open(filename, 'r+') as f:\n java_doc_location = find_javadoc(filename)\n original_text = f.read()\n\n if java_doc_location is None:\n ...
[ "0.59695005", "0.5921598", "0.5921598", "0.5921598", "0.5599607", "0.5551672", "0.5551672", "0.549483", "0.5482901", "0.54320264", "0.533171", "0.533171", "0.533171", "0.533171", "0.533171", "0.5311816", "0.526028", "0.5249579", "0.5245414", "0.5222134", "0.52081716", "0.51...
0.0
-1
Place the piece on a board at the provided linear position.
def __init__(self, board, index): self.board = board self.index = index self._x, self._y = None, None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def place_at(self, row, col, piece):\n self.board[row + PADDING][col + PADDING] = piece", "def place_piece(piece, px, py, pc):\n \n\n for i, j in piece:\n x = px + i\n y = py + j\n if not (0 <= x < BOARD_WIDTH):\n continue\n if not (0 <= y < BOARD_HEIGHT):\n ...
[ "0.76690376", "0.7182792", "0.7109724", "0.70972294", "0.68987334", "0.68776935", "0.68297994", "0.6791927", "0.6777104", "0.66752934", "0.66641605", "0.65767026", "0.6527156", "0.6510956", "0.6510956", "0.6492618", "0.64556587", "0.6382593", "0.637511", "0.63017607", "0.6263...
0.0
-1
Display all relevant object internals.
def __repr__(self): return ( '<{}: uid={}; label={}, symbol={}; x={}, y={}; index={}>'.format( self.__class__.__name__, self.uid, self.label, self.symbol, self.x, self.y, self.index))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_object_details(obj: object) -> None:\n print_section(obj, 'Type', print_type)\n print_section(obj, 'Documentation', print_documentation)\n print_section(obj, 'Attributes', print_attributes)\n print_section(obj, 'Methods', print_methods)\n print_section_delimiter()", "def print_objects(se...
[ "0.7177779", "0.7122019", "0.70775235", "0.6984967", "0.67244166", "0.6650569", "0.66377944", "0.662285", "0.6608439", "0.65655065", "0.6540253", "0.6531621", "0.6511373", "0.6501881", "0.6458379", "0.64282763", "0.6425996", "0.6378596", "0.6353891", "0.6325332", "0.6325332",...
0.0
-1
Compute 2D coordinates of the piece.
def compute_coordinates(self): self._x, self._y = self.board.index_to_coordinates(self.index)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _coord(self, x, y):\n gridEdge = 7 # originally 5\n y = gridEdge - y\n cx = 100 * (x - 1) + 50\n cy = 100 * (y - 1) + 50\n r = 20\n return (cx - r, cy - r, cx + r, cy + r)", "def coords2D(self):\n return (self.x, self.y)", "def pixel2coords(self, x...
[ "0.73788416", "0.7368451", "0.69669753", "0.69285214", "0.6886795", "0.68646175", "0.68372095", "0.67921597", "0.6789865", "0.6781801", "0.67475146", "0.6724371", "0.66918415", "0.6677662", "0.66761553", "0.6613176", "0.6612401", "0.6603495", "0.6580332", "0.656608", "0.65619...
0.71683186
2
Return the piece's horizontal position. Property is used here so we only compute position once when needed.
def x(self): if self._x is None: self.compute_coordinates() return self._x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_horizontal(self, position):\n pass", "def get_horizontal(self, x, y):\n\n return self._board[y]", "def horizontal(self):\n return self._horizontal", "def _get_x(self):\n return self.position.x", "def get_x_position(self):\n return self.rect.x", "def horiz_center...
[ "0.7555169", "0.71737736", "0.68906856", "0.67113984", "0.66651046", "0.6657736", "0.6657736", "0.66271603", "0.6555104", "0.6521626", "0.64567375", "0.63844174", "0.6338153", "0.6338153", "0.6300035", "0.6295312", "0.6227775", "0.6223017", "0.62109965", "0.620136", "0.615026...
0.0
-1
Return the piece's vertical position. Property is used here so we only compute position once when needed.
def y(self): if self._y is None: self.compute_coordinates() return self._y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_y_position(self): \n return self.rect.y", "def _get_y(self):\n return self.position.y", "def get_y(self):\n return self.posY", "def get_pos_y(self):\n return self.__pos_y", "def get_y_position(self):\n return self.actual_coordinates[1]", "def y(self):\r\n...
[ "0.72299945", "0.71392894", "0.70769536", "0.69982135", "0.6946308", "0.69392604", "0.67431444", "0.6726614", "0.6718979", "0.67096394", "0.668686", "0.66658616", "0.6653479", "0.6539394", "0.65354824", "0.6437881", "0.6415131", "0.6410589", "0.6389794", "0.63825667", "0.6372...
0.0
-1
Number of squares separating the piece from board's bottom edge.
def bottom_distance(self): return self.board.height - 1 - self.y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_num_black_pieces(self):\n return self.num_black_pieces", "def columns(self) -> int:\n return self.__squares[0].__len__()", "def bottom_height_px(self):\n return self.bottom_pieces * PipePair.PIECE_HEIGHT", "def get_size(self):\n return len(self.board)", "def _adjacent_bl...
[ "0.69117856", "0.6843006", "0.6691296", "0.65614504", "0.6522529", "0.65193826", "0.6504261", "0.646451", "0.6464343", "0.6431834", "0.6429351", "0.6374707", "0.63672584", "0.6351437", "0.63387626", "0.6334059", "0.6305897", "0.6291991", "0.6206564", "0.62018037", "0.6156334"...
0.58802783
45
Number of squares separating the piece from board's right edge.
def right_distance(self): return self.board.length - 1 - self.x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def columns(self) -> int:\n return self.__squares[0].__len__()", "def num_pieces_left(self):\n return self.num_white_pieces + self.num_black_pieces", "def number_of_their_pieces_to_right(column):\n row = __get_top_of_stack(column)\n return number_pieces_of_type_in_direction(column, row, THE...
[ "0.68224204", "0.67955893", "0.67566025", "0.6721409", "0.67032707", "0.6690386", "0.6673122", "0.6567716", "0.65650105", "0.6469845", "0.63960135", "0.63398033", "0.6330938", "0.63127047", "0.6299541", "0.62951994", "0.6247025", "0.6244428", "0.618134", "0.61776143", "0.6147...
0.6083372
25
Number of squares separating the piece from board's top edge.
def top_distance(self): return self.y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_num_black_pieces(self):\n return self.num_black_pieces", "def num_pieces_left(self):\n return self.num_white_pieces + self.num_black_pieces", "def columns(self) -> int:\n return self.__squares[0].__len__()", "def get_num_white_pieces(self):\n return self.num_white_pieces",...
[ "0.714511", "0.6862219", "0.6851472", "0.67452055", "0.6723331", "0.66431844", "0.65715116", "0.6539787", "0.6536414", "0.64877564", "0.6469646", "0.64569587", "0.64565516", "0.64425284", "0.6439542", "0.6425374", "0.6407991", "0.63659966", "0.63487965", "0.6333705", "0.63302...
0.0
-1
Number of squares separating the piece from board's left edge.
def left_distance(self): return self.x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_pieces_left(self):\n return self.num_white_pieces + self.num_black_pieces", "def get_pieces_left(board, piece):\r\n\tpieces = 0\r\n\tfor row in board:\r\n\t\tfor col in row:\r\n\t\t\tif col == piece:\r\n\t\t\t\tpieces += 1\r\n\r\n\treturn pieces", "def number_of_their_pieces_to_left(column):\n ...
[ "0.79140216", "0.7175402", "0.6958002", "0.6864814", "0.6846879", "0.6766236", "0.6750894", "0.66248316", "0.65929973", "0.65737724", "0.64028585", "0.6343601", "0.6329777", "0.6307301", "0.6228556", "0.62279946", "0.6163106", "0.6096209", "0.6093313", "0.6085473", "0.607297"...
0.0
-1
All horizontal squares from the piece's point of view. Returns a list of relative movements up to the board's bound.
def horizontals(self): horizontal_shifts = set(izip_longest(map( lambda i: i - self.x, range(self.board.length)), [], fillvalue=0)) horizontal_shifts.discard((0, 0)) return horizontal_shifts
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spanning_squares(self):\n spanning = []\n for i in range(self.length):\n # Assume ACROSS and DOWN are the only valid directions\n if self.direction == \"ACROSS\":\n spanning.append((self.start_x + i, self.start_y))\n else:\n spanning....
[ "0.6494722", "0.64518917", "0.6354893", "0.63426304", "0.63299483", "0.6264752", "0.6235491", "0.6193277", "0.6177784", "0.6174575", "0.61528724", "0.6148699", "0.61453056", "0.6122243", "0.6096462", "0.6087461", "0.60867596", "0.60618335", "0.6006694", "0.59964144", "0.59660...
0.7379711
0
All vertical squares from the piece's point of view. Returns a list of relative movements up to the board's bound.
def verticals(self): vertical_shifts = set(izip_longest([], map( lambda i: i - self.y, range(self.board.height)), fillvalue=0)) vertical_shifts.discard((0, 0)) return vertical_shifts
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vertical(self, x, y):\n\n return [row[x] for row in self._board]", "def spanning_squares(self):\n spanning = []\n for i in range(self.length):\n # Assume ACROSS and DOWN are the only valid directions\n if self.direction == \"ACROSS\":\n spanning.a...
[ "0.6549495", "0.65164524", "0.6475518", "0.6370953", "0.63641816", "0.63362104", "0.6315978", "0.62523115", "0.6206709", "0.6104576", "0.6071588", "0.60655314", "0.6062132", "0.60403407", "0.60398203", "0.6025194", "0.5976983", "0.5959147", "0.59579796", "0.5956464", "0.59492...
0.7238823
0
All diagonal squares from the piece's point of view. Returns a list of relative movements up to the board's bound.
def diagonals(self): left_top_shifts = map(lambda i: (-(i + 1), -(i + 1)), range(min( self.left_distance, self.top_distance))) left_bottom_shifts = map(lambda i: (-(i + 1), +(i + 1)), range(min( self.left_distance, self.bottom_distance))) right_top_shifts = map(lambda i: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_legal_moves(self):\n moves = []\n if self.player_locations[self.whose_turn] is None:\n return self.get_blank_locations()\n matrix = [(1,0), (-1,0), (0,1), (0,-1), (1,1), (1,-1), (-1, 1), (-1,-1)]\n\n for dx, dy in matrix:\n x,y = self.player_locations[self....
[ "0.7041069", "0.68426985", "0.6820618", "0.67042565", "0.6688481", "0.66436976", "0.6637318", "0.6608051", "0.66066635", "0.65922946", "0.65870273", "0.6556292", "0.65425926", "0.6470519", "0.64307237", "0.64034235", "0.63913053", "0.6317035", "0.6294141", "0.6290895", "0.628...
0.6688425
5
Return list of relative movements allowed.
def movements(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMovableRange(self, unit):\n CostArr_mod = modifyMovCost(CostArr, ability)\n Obstacles = self.getUnpassable(player) # units that are not passable....\n pos_list, path_list = UCS_solve(unit.pos, CostArr_mod, unit.MovPnt)\n return pos_list, path_list", "def all_rel_actions(self, p...
[ "0.6335595", "0.6219791", "0.61731637", "0.6113557", "0.6098801", "0.6082442", "0.6076151", "0.60303247", "0.59810054", "0.59727407", "0.59463936", "0.59408045", "0.5901733", "0.58617115", "0.58573633", "0.58515835", "0.58431864", "0.58416694", "0.5836999", "0.5812548", "0.58...
0.6397189
0
Return the cached territory occupied by the piece.
def territory(self): cache_key = ( self.board.length, self.board.height, self.uid, self.index) if cache_key not in self.territory_cache: vector = self.compute_territory() self.territory_cache[cache_key] = vector else: vector = self.territory_cache[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_territory(self):\n # Initialize the square occupancy vector of the board.\n vector = self.board.new_vector()\n\n # Mark current position as reachable.\n vector[self.index] = True\n\n # List all places reacheable by the piece from its current position.\n for x_s...
[ "0.6026444", "0.59270763", "0.5713847", "0.56876725", "0.5581824", "0.5523887", "0.5491418", "0.54348814", "0.54129577", "0.5392716", "0.5293671", "0.5249759", "0.5236839", "0.5229331", "0.5221467", "0.5203362", "0.51952547", "0.5169698", "0.5168036", "0.5155035", "0.51431674...
0.6969132
0
Compute territory reachable by the piece from its current position. Returns a list of boolean flags of squares indexed linearly, for which a True means the square is reachable.
def compute_territory(self): # Initialize the square occupancy vector of the board. vector = self.board.new_vector() # Mark current position as reachable. vector[self.index] = True # List all places reacheable by the piece from its current position. for x_shift, y_shift...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_moves(self):\n\n from itertools import product\n free_position = self.find_free()\n return [list(free_position+i) for i in [[0,1],[1,0],[-1,0],[0,-1]] if tuple(i+free_position) in product(range(self.size),repeat=2)]", "def _get_rules_possibles_moves(cell, board_shape):\n retu...
[ "0.5903241", "0.5804372", "0.57658273", "0.57489616", "0.5739321", "0.5720743", "0.5670181", "0.5648418", "0.5639911", "0.5635544", "0.5632291", "0.5622091", "0.5598855", "0.559796", "0.5573405", "0.55529225", "0.5552635", "0.5536598", "0.55041766", "0.55024284", "0.54945725"...
0.6670306
0
Generate M3U file for the given software into out_dir
def generate(software, out_dir, suffix, dry_run): m3u_filename = software.name + (suffix if suffix else '') + '.m3u' if not dry_run: m3u_fd = open(os.path.join(out_dir, m3u_filename), 'w') for i in software.images(): image_rel_path = os.path.relpath(i.path, out_dir) if not dry_run...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_output_matrix_files(self, year, max_zone_id):\r\n from opus_emme2.travel_model_output import TravelModelOutput\r\n tm_output = TravelModelOutput(self.emme_cmd)\r\n year_config = self.config['travel_model_configuration'][year]\r\n for x in 1,2,3:\r\n if \"bank%i\" %...
[ "0.5642974", "0.5558042", "0.5551027", "0.5361542", "0.53559524", "0.5301094", "0.5252762", "0.5241855", "0.5204623", "0.5158686", "0.51586396", "0.5136852", "0.51365227", "0.51075536", "0.50907314", "0.5074185", "0.50671935", "0.50445044", "0.5027117", "0.5024382", "0.502100...
0.8317543
0
Generate M3U file for the list of softwares into out_dir
def generate_all(softwares, out_dir, suffix, dry_run): if not dry_run: if not out_dir.exists(): out_dir.mkdir(parents=True) multi_images_softwares = (x for x in softwares if x.nb_images() > 1) for i in multi_images_softwares: try: generate(i, out_dir, suf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate(software, out_dir, suffix, dry_run):\n m3u_filename = software.name + (suffix if suffix else '') + '.m3u'\n\n if not dry_run:\n m3u_fd = open(os.path.join(out_dir, m3u_filename), 'w')\n\n for i in software.images():\n image_rel_path = os.path.relpath(i.path, out_dir)\n\n ...
[ "0.7786916", "0.5748073", "0.5662895", "0.5528735", "0.55101776", "0.5463695", "0.5421654", "0.5380845", "0.53311723", "0.5303696", "0.52977276", "0.52798694", "0.5260766", "0.52486426", "0.5233821", "0.51944816", "0.5123264", "0.5093341", "0.5092315", "0.50845486", "0.506893...
0.59200364
1
Set up Wiser climate device.
async def async_setup_entry(hass, config_entry, async_add_entities): data = hass.data[DOMAIN][config_entry.entry_id][DATA] # Get Handler wiser_numbers = [] _LOGGER.debug("Setting up Away Mode setpoint setter") wiser_numbers.extend( [WiserAwayModeTempNumber(data, "Away Mode Target Temperature")...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _setup_sensor ( self ):\n self.spectral = Spectral ( np.array([450, 520, 630, 770., 1550, 2090.] ),\n np.array([ 520, 600, 690, 900., 1750., 2350.] ) )", "def _setup_sensor ( self ):\n self.spectral = Spectral ( np.array([500, 610, 780, 1580.] ),\n ...
[ "0.59758526", "0.5945028", "0.5865419", "0.5819859", "0.5804272", "0.5767758", "0.57342315", "0.56519085", "0.56142", "0.5603683", "0.55886334", "0.55398846", "0.5516714", "0.55021566", "0.54558253", "0.5444716", "0.5435281", "0.5406201", "0.53743196", "0.5360252", "0.5341247...
0.0
-1
Handle updated data from the coordinator.
def _handle_coordinator_update(self) -> None: _LOGGER.debug(f"{self.name} updating") self._value = self._data.wiserhub.system.away_mode_target_temperature # Support prior to 2022.7.0 Versions without deprecation warning if hasattr(self, "_attr_value"): self._attr_value = self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _handle_coordinator_update(self) -> None:\n self._update_data()\n self.async_write_ha_state()", "def _handle_coordinator_update(self) -> None:\n self._update_from_rest_data()\n self.async_write_ha_state()", "def _handle_coordinator_update(self) -> None:\n self.update_from...
[ "0.8382766", "0.83799595", "0.8251621", "0.79713356", "0.7916281", "0.7603569", "0.7557993", "0.7358644", "0.7336086", "0.7178118", "0.7178118", "0.7178118", "0.7178118", "0.7113253", "0.6962891", "0.6899875", "0.6793388", "0.67592835", "0.67307264", "0.66545016", "0.6622291"...
0.7118628
13
Return the minimum value.
def native_min_value(self) -> float: return TEMP_MINIMUM
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_minimum(self):\n return self._minimum", "def find_min(self):\n return self.min", "def find_min(self):\n return self.min", "def min(self) -> pulumi.Input[int]:\n return pulumi.get(self, \"min\")", "def min(self) -> pulumi.Input[int]:\n return pulumi.get(self, \"mi...
[ "0.87291557", "0.8631156", "0.8631156", "0.85999566", "0.85999566", "0.85038835", "0.8491322", "0.8482031", "0.8466204", "0.8466204", "0.8432562", "0.8430932", "0.8430932", "0.8421418", "0.8405366", "0.8311868", "0.82909995", "0.8286746", "0.8284653", "0.8281578", "0.8255062"...
0.8165567
22
Return the maximum value.
def native_max_value(self) -> float: return TEMP_MAXIMUM
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_max_value(self):\n max_value = max(self.values)\n return max_value", "def _get_maximum(self):\n return self._maximum", "def get_max(self):\n return self._max", "def get_max(self):\n return self.max[-1]", "def _get_maximum_value(self):\n if hasattr(self, '_m...
[ "0.8933136", "0.88841957", "0.87473977", "0.861131", "0.8606676", "0.85935724", "0.8586842", "0.8532539", "0.8532539", "0.8495911", "0.8495911", "0.8488697", "0.8487578", "0.8399635", "0.83845997", "0.836424", "0.83359325", "0.8262177", "0.8261219", "0.8261219", "0.8256761", ...
0.8079731
31
Return the mode of the entity.
def mode(self) -> NumberMode: return NumberMode.AUTO
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mode(self, ):\n return self.get_parameter('mode')", "def get_mode(self):\r\n return self.mode", "def mode(self):\n return self._lift(\"mode\")", "def mode(self):\n return self._data.get('mode', None)", "def getmode(self):\n return self.mode", "def mode(self):\n ...
[ "0.79294884", "0.7913022", "0.7889855", "0.7879603", "0.78356427", "0.78341234", "0.78341234", "0.78341234", "0.7831721", "0.7831721", "0.7831721", "0.781534", "0.78104544", "0.7787036", "0.7783009", "0.777116", "0.7756425", "0.7699104", "0.7604584", "0.7604584", "0.7558141",...
0.0
-1
Return Name of device.
def name(self): return f"{get_device_name(self._data, 0, self._name)}"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self._device.name", "def name(self):\n return self._device.name", "def name(self):\n return self._device.name", "def name(self):\n return self.device.name()", "def name(self):\n return self.device.device_data[self.device_id]['name']", "def devic...
[ "0.891022", "0.891022", "0.891022", "0.8865886", "0.87226844", "0.8687004", "0.8687004", "0.8627558", "0.8609878", "0.8509157", "0.8509157", "0.8476352", "0.84732556", "0.8449398", "0.8261127", "0.8234234", "0.8221397", "0.81503457", "0.81250376", "0.8083982", "0.79021084", ...
0.8831564
4
Return device specific attributes.
def device_info(self): return { "name": get_device_name(self._data, 0), "identifiers": {(DOMAIN, get_identifier(self._data, 0))}, "manufacturer": MANUFACTURER, "model": self._data.wiserhub.system.product_type, "sw_version": self._data.wiserhub.system.f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attributes(self, device_id=0):\n\t\t\treturn cuda.Device(device_id).get_attributes()", "def device_info(self) -> Optional[Dict[str, Any]]:\n return {ATTR_NAME: self.name, \"identifiers\": {(DOMAIN, self._device.device_id)}}", "def device_state_attributes(self):\n attrs = {\n ATTR_A...
[ "0.80724686", "0.7450437", "0.742771", "0.7409806", "0.7293218", "0.72523683", "0.72523683", "0.719905", "0.7175151", "0.7155777", "0.7155777", "0.71476424", "0.7145971", "0.71375567", "0.7095317", "0.7051197", "0.703671", "0.7035435", "0.7017325", "0.7013673", "0.70050514", ...
0.6574845
83
Handle updated data from the coordinator.
def _handle_coordinator_update(self) -> None: _LOGGER.debug(f"{self.name} updating") self._value = getattr(self._actuator.floor_temperature_sensor, self._name) # Support prior to 2022.7.0 Versions without deprecation warning if hasattr(self, "_attr_value"): self._attr_value =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _handle_coordinator_update(self) -> None:\n self._update_data()\n self.async_write_ha_state()", "def _handle_coordinator_update(self) -> None:\n self._update_from_rest_data()\n self.async_write_ha_state()", "def _handle_coordinator_update(self) -> None:\n self.update_from...
[ "0.8382766", "0.83799595", "0.8251621", "0.79713356", "0.7916281", "0.7603569", "0.7557993", "0.7358644", "0.7178118", "0.7178118", "0.7178118", "0.7178118", "0.7118628", "0.7113253", "0.6962891", "0.6899875", "0.6793388", "0.67592835", "0.67307264", "0.66545016", "0.6622291"...
0.7336086
8
Return the minimum value.
def native_min_value(self) -> float: return -9
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_minimum(self):\n return self._minimum", "def find_min(self):\n return self.min", "def find_min(self):\n return self.min", "def min(self) -> pulumi.Input[int]:\n return pulumi.get(self, \"min\")", "def min(self) -> pulumi.Input[int]:\n return pulumi.get(self, \"mi...
[ "0.87291557", "0.8631156", "0.8631156", "0.85999566", "0.85999566", "0.85038835", "0.8491322", "0.8482031", "0.8466204", "0.8466204", "0.8432562", "0.8430932", "0.8430932", "0.8421418", "0.8405366", "0.8311868", "0.82909995", "0.8286746", "0.8284653", "0.8281578", "0.8255062"...
0.7826625
38
Return the maximum value.
def native_max_value(self) -> float: return 9
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_max_value(self):\n max_value = max(self.values)\n return max_value", "def _get_maximum(self):\n return self._maximum", "def get_max(self):\n return self._max", "def get_max(self):\n return self.max[-1]", "def _get_maximum_value(self):\n if hasattr(self, '_m...
[ "0.8933136", "0.88841957", "0.87473977", "0.861131", "0.8606676", "0.85935724", "0.8586842", "0.8532539", "0.8532539", "0.8495911", "0.8495911", "0.8488697", "0.8487578", "0.8399635", "0.83845997", "0.836424", "0.83359325", "0.8262177", "0.8261219", "0.8261219", "0.8256761", ...
0.7767184
55
Return the mode of the entity.
def mode(self) -> NumberMode: return NumberMode.AUTO
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mode(self, ):\n return self.get_parameter('mode')", "def get_mode(self):\r\n return self.mode", "def mode(self):\n return self._lift(\"mode\")", "def mode(self):\n return self._data.get('mode', None)", "def getmode(self):\n return self.mode", "def mode(self):\n ...
[ "0.79352784", "0.7918545", "0.78954023", "0.7884875", "0.7841136", "0.78398794", "0.78398794", "0.78398794", "0.7837497", "0.7837497", "0.7837497", "0.7821151", "0.781643", "0.7792414", "0.7788912", "0.77766544", "0.77633715", "0.7705739", "0.76101565", "0.76101565", "0.75625...
0.0
-1
Return Name of device.
def name(self): return f"{get_device_name(self._data, self._actuator.id)} Floor Temp Offset"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self._device.name", "def name(self):\n return self._device.name", "def name(self):\n return self._device.name", "def name(self):\n return self.device.name()", "def name(self):\n return f\"{get_device_name(self._data, 0, self._name)}\"", "def nam...
[ "0.891022", "0.891022", "0.891022", "0.8865886", "0.8831564", "0.87226844", "0.8687004", "0.8687004", "0.8627558", "0.8609878", "0.8509157", "0.8509157", "0.8476352", "0.84732556", "0.8449398", "0.8261127", "0.8234234", "0.8221397", "0.81503457", "0.81250376", "0.8083982", ...
0.0
-1
Return device specific attributes.
def device_info(self): return { "name": get_device_name(self._data, self._actuator.id), "identifiers": {(DOMAIN, get_identifier(self._data, self._actuator.id))}, "via_device": (DOMAIN, self._data.wiserhub.system.name), }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attributes(self, device_id=0):\n\t\t\treturn cuda.Device(device_id).get_attributes()", "def device_info(self) -> Optional[Dict[str, Any]]:\n return {ATTR_NAME: self.name, \"identifiers\": {(DOMAIN, self._device.device_id)}}", "def device_state_attributes(self):\n attrs = {\n ATTR_A...
[ "0.80724686", "0.7450437", "0.742771", "0.7409806", "0.7293218", "0.72523683", "0.72523683", "0.719905", "0.7175151", "0.7155777", "0.7155777", "0.71476424", "0.7145971", "0.71375567", "0.7095317", "0.7051197", "0.703671", "0.7035435", "0.7017325", "0.7013673", "0.70050514", ...
0.6660786
72
Recursively parses XML contents to python dict. We assume that `object` tags are the only ones that can appear multiple times at the same level of a tree.
def recursive_parse_xml_to_dict(xml): if not xml: return {xml.tag: xml.text} result = {} for child in xml: child_result = recursive_parse_xml_to_dict(child) if child.tag != 'object': result[child.tag] = child_result[child.tag] else: if child.tag not in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recursive_parse_xml_to_dict(xml):\n if not xml:\n return {xml.tag: xml.text}\n result = {}\n for child in xml:\n child_result = recursive_parse_xml_to_dict(child)\n if child.tag != 'object':\n result[child.tag] = child_result[child.tag]\n else:\n if child.tag not in result:\n re...
[ "0.76405007", "0.6487578", "0.6464231", "0.6301873", "0.6218455", "0.6149198", "0.6135709", "0.607625", "0.60481364", "0.58940786", "0.5876097", "0.5762465", "0.5756617", "0.5738174", "0.5733136", "0.57227683", "0.5722584", "0.56979394", "0.5683315", "0.5661643", "0.5641846",...
0.7581804
1
Key to sort hosts / domains alphabetically, by domain name.
def domain_sort_key(domain): import re domain_expr = r'(.*\.)?(.*\.)(.*)' # Eg: (www.)(google.)(com) domain_search = re.search(domain_expr, domain) if domain_search and domain_search.group(1): # sort by domain name and then everything left of # Eg: google, com, www domain_valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subdomain_sorting_key(hostname):\n parts = hostname.split('.')[::-1]\n if parts[-1] == 'www':\n return parts[:-1], 1\n return parts, 0", "def list_domain_names(self) -> Dict:\n pass", "def get_hosts(self):\n\n return sorted(self.host_data.keys())", "def sort_...
[ "0.77395064", "0.5994397", "0.59496844", "0.5851569", "0.5843953", "0.5838", "0.58089083", "0.5635496", "0.56327444", "0.55446255", "0.5542909", "0.5542909", "0.5528308", "0.55238223", "0.5503389", "0.5494649", "0.54859453", "0.5457136", "0.5452885", "0.544919", "0.54136103",...
0.8291568
0
This function adjusts matplotlib settings so that all figures in the textbook have a uniform format and look.
def setup_text_plots(fontsize=8, usetex=True): from distutils.version import LooseVersion matplotlib.rc('legend', fontsize=fontsize, handlelength=3) matplotlib.rc('axes', titlesize=fontsize) matplotlib.rc('axes', labelsize=fontsize) matplotlib.rc('xtick', labelsize=fontsize) matplotlib.rc('ytick...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_matplotlib_settings():\n font = {\"weight\": \"bold\", \"size\": 22, \"family\": \"sans-serif\"}\n matplotlib.rc(\"font\", **font)\n matplotlib.rc(\"text\", usetex=True)\n matplotlib.rcParams[\"mathtext.fontset\"] = \"dejavusans\"", "def set_style(usetex=False):\n plt.rc('text', usetex=...
[ "0.7674264", "0.7047249", "0.69050926", "0.676554", "0.6711467", "0.6589669", "0.6553633", "0.6522526", "0.650684", "0.6426557", "0.6402421", "0.6368734", "0.6247413", "0.6218916", "0.61540663", "0.6130522", "0.608861", "0.5950496", "0.59500664", "0.59225714", "0.5862739", ...
0.63753253
11
draw and label a cube. edges is a list of numbers between 1 and 12, specifying which of the 12 cube edges to draw
def draw_cube(ax, xy, size, depth=0.3, edges=None, label=None, label_kwargs=None, **kwargs): if edges is None: edges = range(1, 13) x, y = xy y -= size # set left/up corner as the first (0,0) for one cube # first plot background edges if 9 in edges: ax.plot([x + d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeCube(c) :\n print(\"Edge Length =\",c.getLength())\n print(\"Volume =\",c.volume())\n print(\"Surface Area =\",c.surfaceArea())\n print(\"Face Diagonal =\",c.faceDiagonal())\n print(\"Space Diagonal =\",c.spaceDiagonal())", "def main() :\n c1 = Cube(5.3) # cube with edge length of 5.3\...
[ "0.6443449", "0.6413569", "0.6355094", "0.63017035", "0.6130413", "0.6115143", "0.60516644", "0.59508514", "0.59508514", "0.59094137", "0.58450186", "0.5810668", "0.5770342", "0.57679313", "0.5727801", "0.5716166", "0.57069796", "0.56948054", "0.5686037", "0.5677185", "0.5661...
0.73245275
0
Shift an image by the specified amount Uses interpolation to do subpixel shifts if desired. Missing data should be represented with numpy.nans.
def shift(data, offset, header=None, variance=None, order=None, crpix=None, resize=False, no_shift=False, missing=np.nan, **kwargs): if not isinstance(header, fits.header.Header): header = fits.header.Header() var = variance.copy() if isinstance(variance, np.ndarray) else None if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shift(image,shift_x,shift_y):\n return np.roll(np.roll(image,shift_y,axis=0),shift_x,axis=1)", "def shift(self):\n r = self.std\n mid = self.mid_pixel #center pixel index of 384x384 image\n delta = self.size - self.mid_pixel - r\n \n x = np.random.randint(low=-1*delta,hi...
[ "0.7026287", "0.68541515", "0.66203284", "0.6425733", "0.6338593", "0.63167566", "0.62013304", "0.6186507", "0.6057882", "0.6040801", "0.5912511", "0.5905362", "0.58581746", "0.58155656", "0.5812555", "0.5750415", "0.5727573", "0.5655622", "0.56455517", "0.5634604", "0.562525...
0.56988156
17
Validates the .workflow file.
def validate_syntax(self): resolves_present = False uses_present = False if not self.wf.get('workflow', None): pu.fail('A workflow block must be present\n') else: for _, wf_block in dict(self.wf['workflow']).items(): if wf_block.get('resolves', Non...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate(self):\n if not self._contents.has_key('type'):\n raise ValidationFailed(\"Metadata file %s contains no type field\" % (self._filename))\n \n if not self._contents.has_key('version'):\n raise ValidationFailed(\"Metadata file %s contains no version field\" %\...
[ "0.6631906", "0.6614255", "0.6606154", "0.6537318", "0.63448745", "0.62795186", "0.62735194", "0.6186111", "0.61825204", "0.6171616", "0.61469364", "0.61425644", "0.61318344", "0.6077196", "0.6075853", "0.6061646", "0.60611504", "0.6057122", "0.60558885", "0.6055866", "0.6049...
0.67150223
0
normalize the dictionary representation of the workflow
def normalize(self): # modify from this: # # "workflow": { # "test-and-deploy": { # "resolves": "deploy" # } # } # # to this: # # "workflow": { # "name": "test-and-deploy", # "on": "push"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalise_workflow(workflow_dict):\n normalise_process(workflow_dict)\n if not 'steps' in workflow_dict:\n exit_perm_fail(\"No steps in Workflow\")\n\n if isinstance(workflow_dict['steps'], dict):\n new_steps = []\n for step_id, step in workflow_dict['steps'].items():\n ...
[ "0.7474329", "0.5918155", "0.5898275", "0.58240426", "0.5808958", "0.57993853", "0.57069623", "0.5687853", "0.5675693", "0.559138", "0.5580299", "0.5571338", "0.55547684", "0.5554434", "0.55311835", "0.5512876", "0.55118704", "0.549156", "0.5486343", "0.54750293", "0.54630303...
0.6584143
1
A GHA workflow is defined by specifying edges that point to the previous nodes they depend on. To make the workflow easier to process, we add forward edges. We also obtains the root nodes.
def complete_graph(self): root_nodes = set() for name, a_block in self.wf['action'].items(): a_block['name'] = name for n in a_block.get('needs', []): if not self.wf['action'][n].get('next', None): self.wf['action'][n]['next'] = set() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward_graph(self):\n raise NotImplementedError", "def get_forward_init(node, graph):\n\tedges = []\n\tfor e in node.edges:\n\t\tif node.label <= graph.nodes[e.to].label:\n\t\t\tedges.append(e)\n\treturn edges", "def _bfs_forward(self, start_node):\n visited = {node: (False) for node in self...
[ "0.68631876", "0.59310347", "0.5865252", "0.57889354", "0.57486254", "0.57264847", "0.56896424", "0.5673367", "0.5652373", "0.5643193", "0.5587451", "0.55842507", "0.55828464", "0.5574014", "0.5573729", "0.55621177", "0.55612457", "0.5532347", "0.5529374", "0.55181307", "0.55...
0.6231825
1
Clone actions that reference a repository.
def download_actions(self): cloned = set() infoed = False for _, a in self.wf['action'].items(): if ('docker://' in a['uses'] or 'shub://' in a['uses'] or './' in a['uses']): continue action = None if a['us...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clone(repo, src, dest, shallow):\n print('Repo: %s' % repo)\n print('Source: %s' % src)\n print('Destination: %s' % dest)\n print('Shallow: %s' % shallow)", "def clone_repo():\n with settings(warn_only=True):\n run('git clone %(repository_url)s %(repo_path)s' % env)", "def GetClone(se...
[ "0.6880847", "0.6472116", "0.6390989", "0.6377147", "0.63734037", "0.6366674", "0.62699676", "0.62628525", "0.6210326", "0.61976963", "0.6163758", "0.6146929", "0.61124015", "0.6028663", "0.60193825", "0.5995425", "0.5988343", "0.5987096", "0.5978216", "0.59648484", "0.594991...
0.54043
61
Factory of ActionRunner instances, one for each action
def instantiate_runners(self): for _, a in self.wf['action'].items(): if 'docker://' in a['uses']: a['runner'] = DockerRunner( a, self.workspace, self.env, self.quiet, self.debug, self.dry_run) continue if 'shub://'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_clients():\n clients = {}\n\n rospy.loginfo(\"Waiting for rubble detector\")\n clients['rubble_detect'] = actionlib.SimpleActionClient('rubble_detect',\n RubbleDetectAction)\n\n rospy.loginfo(\"Waiting for rubble checker\")\n clie...
[ "0.56596607", "0.56475294", "0.5616994", "0.5510894", "0.54630816", "0.5457942", "0.54218817", "0.5406142", "0.53818655", "0.5351243", "0.53502804", "0.5345953", "0.532772", "0.5279873", "0.527048", "0.523934", "0.521685", "0.51686555", "0.515931", "0.5137021", "0.5137021", ...
0.69310266
0
Run the pipeline or a specific action
def run(self, action_name=None, reuse=False, parallel=False): os.environ['WORKSPACE'] = self.workspace self.download_actions() self.instantiate_runners() if action_name: self.wf['action'][action_name]['runner'].run(reuse) else: for s in self.get_stages()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n\n self._action.execute()", "def action_run(self):\n pass", "def apply_action(self, action):\n return self.__environment.step(action)", "def _run_actions(self):\n\n if \"install-bento\" in self.actions:\n self._do_action_bento_setup()\n\n if \"create-...
[ "0.6953901", "0.6952061", "0.6602551", "0.6561766", "0.6464926", "0.64080197", "0.6405319", "0.63914955", "0.63781947", "0.63781947", "0.6359134", "0.63469976", "0.63318545", "0.63070595", "0.62973326", "0.6241613", "0.6240744", "0.6202429", "0.6176801", "0.6176801", "0.61743...
0.6402181
7
Generator of stages. A stages is a list of actions that can be executed in parallel.
def get_stages(self): current_stage = self.wf['root'] while current_stage: yield current_stage next_stage = set() for n in current_stage: next_stage.update(self.wf['action'][n].get('next', set())) current_stage = next_stage
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stages(self):\n return StageManager(session=self._session)", "def stages(self):\r\n return pipelines.Stages(self)", "def run(stages, maxsize=0):\n\n if isinstance(stages, list) and len(stages) == 0:\n raise ValueError(\"Expected at least 1 stage to run\")\n\n elif isinstance(stag...
[ "0.6442683", "0.63786435", "0.6202054", "0.6113744", "0.6091911", "0.60464627", "0.60097075", "0.60097075", "0.5929696", "0.5866913", "0.5734935", "0.56417054", "0.56399095", "0.56399095", "0.56399095", "0.56128675", "0.55290216", "0.5513827", "0.54971427", "0.5468624", "0.54...
0.71270746
0
Runs the singularity action
def run(self, reuse=False): build = True if 'shub://' in self.action['uses']: image = self.action['uses'] build = False elif './' in self.action['uses']: image = 'action/' + os.path.basename(self.action['uses']) singularityfile_path = os.path.join(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_smoke(self):\n\t\tinit_state = torch.tensor(0.0)\n\t\ttotal_time = torch.tensor(4.0)\n\t\tprint('Agent state trajectory and actions:')\n\t\tAgent().play(init_state, total_time)\n\t\tpyro.clear_param_store()", "def singularity_start(self, image):\n env_vars = self.action.get('env', {})\n\n ...
[ "0.5975073", "0.5935403", "0.59130096", "0.57898796", "0.5710506", "0.56999266", "0.56843907", "0.5681977", "0.55953836", "0.55517167", "0.5515142", "0.55127794", "0.5501622", "0.5477187", "0.5396195", "0.53956157", "0.5391933", "0.53681904", "0.53640187", "0.53324854", "0.53...
0.6079829
0
Generates the image name from the image url.
def generate_image_name(self, image): return image.replace('shub://', '').replace('/', '-') + '.simg'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_generated_image_name(full_image_url):\r\n\r\n logging.debug('get_generated_image_name({})'.format(full_image_url))\r\n\r\n image_name = datetime.datetime.now().strftime(\"%Y%m%d%H%M%S\")\r\n image_extension = full_image_url.split(\".\")[-1]\r\n image_name = image_name + \".\" + image_extension\...
[ "0.8253151", "0.7566465", "0.73151815", "0.7306501", "0.72865564", "0.72370976", "0.7237034", "0.7213149", "0.7112175", "0.71032536", "0.7042305", "0.70135736", "0.7007883", "0.6985449", "0.6945476", "0.6920966", "0.68803626", "0.68720126", "0.6842178", "0.68296844", "0.68112...
0.8002894
1
Check whether an instance exists or not.
def singularity_exists(self): instances = Client.instances(quiet=self.quiet) for instance in instances: if self.pid in instance.name: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _Exists(self, instance_only: bool = False) -> bool:\n cmd = util.GcloudCommand(self, 'spanner', 'instances', 'describe',\n self.name)\n\n # Do not log error or warning when checking existence.\n _, _, retcode = cmd.Issue(suppress_warning=True, raise_on_failure=False)\n i...
[ "0.7803968", "0.76079255", "0.70579004", "0.7034308", "0.7027742", "0.7027742", "0.6946009", "0.689386", "0.67451686", "0.6722067", "0.6699531", "0.66554385", "0.6641805", "0.66386664", "0.66077375", "0.6606492", "0.6554289", "0.65404296", "0.6523959", "0.651226", "0.6500812"...
0.77773875
1
Stops and removes an instance.
def singularity_rm(self): Client.instances(self.pid, quiet=self.quiet).stop()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop_instance(self):\n instance_id = self._choose_among_running_instances()\n\n # Cancel\n if not instance_id:\n print 'Operation cancelled'\n return\n\n print '# Stopping the instance \"%s\"' % instance_id\n self.compute.stop_instance(instance_id)\n ...
[ "0.74867284", "0.7001102", "0.68385786", "0.6705385", "0.6695328", "0.66951686", "0.667478", "0.6628798", "0.66176504", "0.660671", "0.6593816", "0.65497553", "0.6535843", "0.6532505", "0.64770555", "0.64421254", "0.6439605", "0.6426153", "0.6410027", "0.6365153", "0.635097",...
0.63447744
22
Pulls an docker or singularity images from hub.
def singularity_pull(self, image): Client.pull(image)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pull(self) -> None:\n cached_zip_filepath = None\n try:\n scheme, name, tag, secret = parse_hub_uri(self.args.uri)\n\n executor = HubIO.fetch(name, tag=tag, secret=secret)\n\n if not tag:\n tag = executor.tag\n\n uuid = executor.uuid\n ...
[ "0.6917054", "0.66231585", "0.6467475", "0.64548194", "0.64449644", "0.6421621", "0.63432056", "0.631559", "0.63136727", "0.631053", "0.630868", "0.62965673", "0.6283755", "0.6199952", "0.619788", "0.61943036", "0.61171836", "0.6069643", "0.6063285", "0.6025357", "0.59519005"...
0.6308105
11
Builds an image from a recipefile.
def singularity_build(self, path, image): Client.build(os.path.join( path, 'singularity.def' ), self.generate_image_name(image))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build(image_name, path='.'):\n try:\n doxy.images.build(path=path, tag=image_name)\n message = '[*] Image {} built.'\n print message.format(image_name)\n except Exception as err:\n print err\n raise", "def parseRecipe (self,filename):\r\n return RecipeFileO...
[ "0.6221498", "0.57881945", "0.56212443", "0.55962044", "0.5468818", "0.5449105", "0.5435583", "0.54293376", "0.5417929", "0.5412393", "0.5368963", "0.53490657", "0.53334695", "0.5324951", "0.5318995", "0.5296623", "0.529369", "0.52904105", "0.52801436", "0.5234523", "0.522143...
0.50080234
43
Starts a singularity instance based on the image.
def singularity_start(self, image): env_vars = self.action.get('env', {}) for s in self.action.get('secrets', []): env_vars.update({s: os.environ[s]}) for e, v in self.env.items(): env_vars.update({e: v}) env_vars.update({'HOME': os.environ['HOME']}) #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def singularity_build(self, path, image):\n Client.build(os.path.join(\n path, 'singularity.def'\n ), self.generate_image_name(image))", "def start_ssm(self, ssm_image):\n pass", "def create_instance_by_image(self):\n print '# Start a new instance based on an existing AMI...
[ "0.666752", "0.6325278", "0.6263676", "0.614632", "0.5845064", "0.5794984", "0.5747361", "0.5733841", "0.5721612", "0.56165344", "0.5603583", "0.5509438", "0.54767895", "0.5428946", "0.53604615", "0.53470963", "0.5332762", "0.53182864", "0.53123957", "0.5296787", "0.52888715"...
0.7294491
0
Use argparse to parse command line arguments.
def get_args(): parser = argparse.ArgumentParser(description='Runner for tasks') parser.add_argument('--db_url', help='Database url string to the db.', required=True) return parser.parse_args()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arg_parse():\n p = ap.ArgumentParser()\n p.add_argument()\n return p.parse_args()", "def parse_arguments():\n parser = argparse.ArgumentParser()\n parser.add_argument('-u', '--urls_dirpath', type=unicode)\n parser.add_argument('-r', '--resources_dir', type=unicode)\n parser.add_argument(...
[ "0.80362767", "0.79380834", "0.7909644", "0.7786256", "0.77640563", "0.7757112", "0.7753354", "0.7752254", "0.7741536", "0.77328235", "0.77010775", "0.76901954", "0.76706934", "0.7655658", "0.7648945", "0.7648416", "0.7646757", "0.76460826", "0.76380634", "0.76354045", "0.763...
0.0
-1
Load foia sba datasets
def load_sba_datasets(dbm, direc): foia_504_1991_present = pd.read_excel(direc + 'FOIA - 504 (FY1991-Present).xlsx') foia_7a_1991_1999 = pd.read_excel(direc + 'FOIA - 7(a) (FY1991-FY1999).xlsx', skiprows=1) foia_7a_2000_2009 = pd.read_excel(direc + 'FOIA - 7(a)(FY2000-FY2009).xlsx', skiprows=1) foia_7a_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_kiba_dataset():\n trainn_fold = json.load(\n open(os.path.join('dataset', 'regression', 'benchmark', 'KIBAtest', 'folds', 'train_fold_setting1.txt')))\n train_fold = []\n for e in zip(*trainn_fold):\n for ee in e:\n train_fold.extend(ee)\n #train_fold = [ee for e in tr...
[ "0.629331", "0.62574154", "0.61739457", "0.61300355", "0.6085598", "0.6068422", "0.6059043", "0.599034", "0.5854947", "0.58494705", "0.58464795", "0.5826532", "0.58246195", "0.58217824", "0.5821119", "0.57790554", "0.5750343", "0.5750343", "0.5742792", "0.57419103", "0.574190...
0.76649237
0
Generate center offset for crop window
def center_crop(image, source=(218, 178, 3), target=128): height, width, channel = source off_h = np.ceil((height - target) / 2).astype(int) off_w = np.ceil((width - target) / 2).astype(int) return image[off_h: off_h+target, off_w: off_w+target, :]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def center(self):\n # minz to offset the heights to 0\n mz = (self.maxz-self.minz)/2\n #mz = self.minz\n return (self.minx + self.width / 2, self.miny + self.height / 2, mz)", "def calculate_window_position(self):\n self.x = SQUARE_SIZE * self.col + SQUARE_SIZE // 2\n se...
[ "0.6784088", "0.6756137", "0.6714128", "0.6631258", "0.6611774", "0.6609801", "0.6596732", "0.6587204", "0.6557443", "0.6556682", "0.6531438", "0.6452741", "0.64465266", "0.64361143", "0.6413167", "0.6385451", "0.63821167", "0.6377177", "0.6372448", "0.6344084", "0.6343337", ...
0.6065056
52
Template for validating FMU models for Bonsai integration.
def __init__( self, model_filepath: str, user_validation: bool = True, ): # ensure model filepath is balid, and save as att if it is assert model_filepath.endswith(".fmu"), "Provided filepath is not an FMU file: '{}'".format(model_filepath) self.model_filepath = mode...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate():", "def data_validation(self):\n print \"Starting basic data validation ...\"\n allattr = dir(bdefile)\n idx = [ii for ii, attr in enumerate(allattr) if \"validate_oee_error_\" in attr]\n vfunclist = []\n for ii in idx:\n vfunclist += [allattr[ii]]\n\n...
[ "0.62146026", "0.59948707", "0.5963622", "0.5916925", "0.589161", "0.5838374", "0.58137685", "0.58000225", "0.58000225", "0.573189", "0.5726065", "0.5707462", "0.5697073", "0.56887645", "0.5651742", "0.5627777", "0.55742997", "0.5545567", "0.5542714", "0.5541837", "0.55222416...
0.52467144
65
Check if configuration file exists, otherwise indicate user to do so Configuration contains sim config_params/inputs/outputs and naming
def _validate_sim_config(self): print("\n[FMU Validator] ---- Looking to see if YAML config file exists ----") # use convention to search for config file config_file = self.sim_config_filepath if not os.path.isfile(config_file): print("[FMU Validator] Configuratio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __check_config(self):\n if not os.path.exists(self.__config_path):\n return False\n else:\n return True", "def is_config_exist(self) -> bool:\n pass", "def is_config_exist(self) -> bool:\n return True", "def check_config_file():\n # Locate and init con...
[ "0.7276761", "0.72518843", "0.723697", "0.700425", "0.6990162", "0.68774563", "0.68128514", "0.6784662", "0.677204", "0.6760748", "0.674573", "0.6722314", "0.6706433", "0.6663527", "0.66553557", "0.6630366", "0.6555873", "0.65515465", "0.6551169", "0.65199214", "0.64805055", ...
0.72461706
2
We use the fmi standard to extract the correct set of config_params, inputs, outputs We look into the "causality" attribute for each variable in model description
def _extract_sim_config_from_fmi_std(self): print("\n---- Looking to see if FMU model description contains required 'causality' type definitions ----") sim_config_params = [] sim_inputs = [] sim_outputs = [] sim_other_vars = [] for variable in self.model_descrip...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def doParametersOfInterest(self):\n \n self.modelBuilder.doVar('expr::cosW(\"0.87681811112\",)')\n self.modelBuilder.doVar('expr::sinW(\"0.48082221247\",)')\n self.modelBuilder.doVar('expr::mZ(\"91.2\",)')\n self.modelBuilder.doVar('expr::Lambda1(\"100.0\",)')\n self.modelBui...
[ "0.6243876", "0.6197848", "0.61577994", "0.6136601", "0.61252385", "0.60175735", "0.5826551", "0.5813928", "0.5751767", "0.5715533", "0.5710865", "0.5692011", "0.56493515", "0.5560804", "0.5558627", "0.55206186", "0.5514668", "0.5512474", "0.5510357", "0.5506426", "0.5503846"...
0.6741056
0
Dump sim's config_params, inputs, and outputs to YAML file By default, we overwrite to main YAML config file.
def _dump_config_to_yaml_file(self, sim_config_params = None, sim_inputs = None, sim_outputs = None, sim_other_vars = None, is_aux_yaml = False): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_config(_config, simulation_dir):\n with open(os.path.join(simulation_dir, 'config.yaml'), 'w') as f:\n yaml.dump(_config, f, default_flow_style=False)", "def save():\n print(\"Saving config file..\")\n\n res = yaml.round_trip_dump(_conf, indent=2, block_seq_indent=1)\n\n with open(__c...
[ "0.730918", "0.699196", "0.68951195", "0.67941695", "0.6579302", "0.6568991", "0.6554705", "0.64560366", "0.64269376", "0.64144593", "0.6292432", "0.6266346", "0.6234814", "0.62344337", "0.62238747", "0.617985", "0.6164769", "0.6161922", "0.6141542", "0.6134677", "0.6123942",...
0.81717044
0
Get string with the sim's config_params, inputs, and outputs for the model
def _get_sim_config_str(self): log = "[FMU Validator] The set of configuration_parameters, inputs, and outputs defined is the following:\n" log += "\n{}: {}".format("Sim Config Params -- Brain Config ", self.sim_config_params) log += "\n{}: {}".format("Sim Inputs -- Brain Act...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_model_config(model_name, args):\n if model_name == 'Tacotron2':\n model_config = dict(\n # optimization\n mask_padding=args.mask_padding,\n # audio\n n_mel_channels=args.n_mel_channels,\n # symbols\n n_symbols=args.n_symbols,\n ...
[ "0.63613605", "0.6227064", "0.6027238", "0.6021502", "0.59806687", "0.59724784", "0.58838063", "0.5799649", "0.5774296", "0.57192713", "0.5702105", "0.57006687", "0.568292", "0.56661975", "0.5660352", "0.5649805", "0.56424356", "0.56185853", "0.56185603", "0.5617623", "0.5615...
0.737774
0
Remove nonalphanumeric characters to make them valid with Bonsai interaction.
def _clean_non_alphanumeric_chars(self): for i,variable in enumerate(self.model_description.modelVariables): clean_name = re.sub(r'[^a-zA-Z0-9_]', '', variable.name) if clean_name != variable.name: log = "Sim variable '{}' has been renamed to '{}' ".format(variable.name,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup_input(data):\n data = re.sub(r'[^0-9A-Za-z ()_,.-:]', '', data)\n return data", "def clean_unnecessary_characters(self, tweet):\n tweet = tweet.lstrip(\"\\\"\").rstrip(\"\\\"\")\n tweet = re.sub(self.compiledAlphanumericRegex, ' ', tweet)\n tweet = tweet.replace('_', ' ')\n...
[ "0.73747957", "0.73650575", "0.73443496", "0.7294863", "0.72666633", "0.72465616", "0.7158626", "0.7149394", "0.713084", "0.7125717", "0.71202695", "0.71086025", "0.71029955", "0.70836455", "0.707941", "0.70679945", "0.70411354", "0.70361745", "0.70283735", "0.7028341", "0.70...
0.744641
0
Template for simulating FMU models for Bonsai integration. Note, it calls FMUSimValidation to validate the model when first instanced.
def __init__( self, model_filepath: str, fmi_version: str = FMI_VERSION, start_time = START_TIME, stop_time = STOP_TIME, step_size = STEP_SIZE, user_validation: bool = False, use_unzipped_model: bool = False, ): # validate simulation: config_v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __set_fmu__(self, fmu_file, result_handler, solver, atol, rtol, verbose):\n if self.fmu is None:\n \n # TODO:\n # See what can be done in catching the exception/propagating it\n self.fmu = pyfmi.load_fmu(fmu_file)\n \n # Get the optio...
[ "0.629378", "0.6192165", "0.60618526", "0.6044517", "0.60348445", "0.6019483", "0.5948904", "0.5907536", "0.5832203", "0.58019847", "0.572914", "0.5647409", "0.5641304", "0.5582606", "0.55634594", "0.55448914", "0.5505208", "0.5491149", "0.54623306", "0.5438175", "0.53968614"...
0.70113957
0
Initialize model in the sequential manner required.
def initialize_model(self, config_param_vals = None): self._is_initialized = True self.fmu.instantiate() self.fmu.reset() self.fmu.setupExperiment(startTime=self.start_time) if config_param_vals is not None: self._apply_config(config_param_vals) self.fmu.ente...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_model(self):\n pass", "def init_model(self):\n pass", "def initialize(self, model):\n pass", "def initialize(self):\n LOG.info(\"Initializing Model.\")\n self.model = self.convert(df=self.training_df)\n if self.bootstraps is not None:\n LOG....
[ "0.7742976", "0.7590463", "0.759012", "0.74840647", "0.7275883", "0.70921814", "0.6888844", "0.68874913", "0.68849003", "0.6871453", "0.68196464", "0.6760278", "0.67510974", "0.6709929", "0.66639215", "0.6652089", "0.6573573", "0.6572885", "0.6565885", "0.6531906", "0.6519555...
0.6732077
13
Move one step forward.
def run_step(self): # Ensure model has been initialized at least once self._model_has_been_initialized("run_step") # Check if sim is steady-state (doesn't contain "doStep" method) if "doStep" not in dir(self.fmu): error_log = "[run_step] FMU model cannot be run on...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def step_forward(self):", "def forward(self):\n self.position += 1", "def move_forward():\n pass", "def step(self, move):", "def forward(self):\n self.cursor.forward()", "def _step(self) -> None:", "def back(self, step):\r\n self.forward(-step)", "def move_forward(self, distan...
[ "0.84211636", "0.80904514", "0.7710274", "0.76850307", "0.74500424", "0.71530104", "0.7122298", "0.7110573", "0.7092961", "0.7079883", "0.70217985", "0.7018611", "0.6964649", "0.69422424", "0.6910966", "0.6876663", "0.68695754", "0.6869501", "0.68424183", "0.68298566", "0.680...
0.0
-1
Reset model with new config (if given).
def reset(self, config_param_vals: Dict[str, Any] = None): # Ensure model has been initialized at least once self._model_has_been_initialized("reset") # Terminate and re-initialize self._terminate_model() self.initialize_model(config_param_vals) # Reset...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_model(self):\n raise NotImplementedError", "def reset_model(self):\n raise NotImplementedError", "def reset_model(self):\n raise NotImplementedError", "def reset(self, model):\n self.reset_strategy(model)", "def reset(self, config, **kwargs):\n pass", "def res...
[ "0.77136797", "0.77136797", "0.77136797", "0.731388", "0.7217995", "0.7177466", "0.6790846", "0.6759494", "0.67429775", "0.668906", "0.66128105", "0.65749794", "0.6570066", "0.65698665", "0.65314436", "0.6444437", "0.63590646", "0.6338237", "0.6334196", "0.627672", "0.6215812...
0.7440945
3
Close model and remove unzipped model from temporary folder.
def close_model(self): # Ensure model has been initialized at least once self._model_has_been_initialized("close_model") # terminate fmu model # - avoids error from calling self.fmu.terminate if termination has already been performed self._terminate_model() # f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_up_temp_files():\n global __tmp_model_dir\n\n if __tmp_model_dir is not None:\n FileUtils.deleteDirectory(__tmp_model_dir)\n __tmp_model_dir = None", "def delete_model(self):\n os.remove(self.filepath)\n self.cmodel = None", "def cleanUp(self):\r\n # Close any...
[ "0.71848893", "0.7168014", "0.69020855", "0.6778169", "0.66447943", "0.6597088", "0.63135016", "0.6312071", "0.63115525", "0.62721944", "0.6262568", "0.6260771", "0.6243184", "0.61231935", "0.60675275", "0.60634017", "0.6029513", "0.59984267", "0.5996684", "0.599638", "0.5995...
0.7889111
0
Get var indices for each (valid) var name provided in list. If none are provided, all outputs are returned.
def get_states(self, sim_outputs: List = None): # Ensure model has been initialized at least once self._model_has_been_initialized("get_states") if sim_outputs is None: sim_outputs = self.sim_outputs elif not len(sim_outputs) > 0: sim_outputs = self.sim_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _var_names_to_indices(self, var_names: List):\n\n if type(var_names) is not type([]):\n # Return empty array if input is not 'list' type\n print(\"[_var_names_to_indices] Provided input is not of type list.\")\n return []\n\n indices_array = []\n names_arra...
[ "0.7106208", "0.6794905", "0.6497141", "0.6025208", "0.5968013", "0.5913243", "0.5865424", "0.5832427", "0.57964826", "0.57409185", "0.5729248", "0.57017255", "0.5681039", "0.5604614", "0.5604506", "0.5603223", "0.5594183", "0.55620307", "0.5516843", "0.54871476", "0.5463308"...
0.0
-1
Apply brain actions to simulation inputs.
def apply_actions(self, b_action_vals: Dict[str, Any] = {}): # Ensure model has been initialized at least once self._model_has_been_initialized("apply_actions") # Ensure action dict is not empty if not len(b_action_vals.items()) > 0: print("[apply_actions] Provided ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply(self, inputs):\n raise NotImplementedError()", "def _simulation_run(model_instance, observations, actions, rewards):\r\n\r\n for observation, action, reward in zip(observations, actions, rewards):\r\n model_instance.observe(observation)\r\n model_instance.overrideAct...
[ "0.64400464", "0.5957464", "0.58729064", "0.5810304", "0.57571757", "0.57132226", "0.5649076", "0.56446207", "0.56303746", "0.5490612", "0.5457731", "0.545238", "0.5415022", "0.54109704", "0.5397137", "0.5371112", "0.5361186", "0.5359599", "0.53587407", "0.53278804", "0.53256...
0.0
-1
Get a list of all variables in the sim (removing duplicates, if any). Note, list is kept the same from first time this method is called.
def get_all_var_names(self): if hasattr(self, "all_var_names"): return self.all_var_names # Append all variables in model (defined in YAML). aux_all_var_names = [] aux_all_var_names.extend(self.sim_config_params) aux_all_var_names.extend(self.sim_inputs) aux...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_variables(self):\n return []", "def get_all_variables(self):\n out = []\n for i in self.items:\n out += i.get_all_variables()\n return out", "def get_all_variables(self):\n out = []\n for i in self.items:\n out += i.get_all_variables()...
[ "0.7587621", "0.74283415", "0.74283415", "0.74283415", "0.74034715", "0.73497486", "0.73163354", "0.71726215", "0.7025907", "0.6996247", "0.6937989", "0.6923813", "0.67796665", "0.6772739", "0.67677814", "0.67526543", "0.6719864", "0.6713113", "0.6711427", "0.67106885", "0.66...
0.7627399
0
Get var indices for each (valid) var name provided in list.
def _get_variables(self, sim_outputs: List = None): # Ensure model has been initialized at least once self._model_has_been_initialized("_get_variables") # Ensure array is not empty if sim_outputs is None: return {} elif not len(sim_outputs) > 0: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def indices_of_var(v):\n name = v.varName\n indices = name[2:].split(',')\n i, j = int(indices[0]), int(indices[1])\n return i, j", "def _var_names_to_indices(self, var_names: List):\n\n if type(var_names) is not type([]):\n # Return empty array if input is not 'list...
[ "0.7444971", "0.7400322", "0.6825618", "0.61766595", "0.6171719", "0.6141269", "0.604002", "0.6002675", "0.5954537", "0.58911085", "0.5872941", "0.5856526", "0.5843315", "0.58359766", "0.57936394", "0.579151", "0.5744204", "0.5717505", "0.57010794", "0.56933683", "0.5685582",...
0.0
-1