query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Do a NetInf PUBLISH for one file file_name is the file to do now
def pubone(file_name,alg,host): hash_alg=alg scheme="ni" rform="json" ext="{ \"meta\": { \"pubdirs\" : \"yep\" } }" # record start time of this stime=time.time() # Create NIdigester for use with form encoder and StreamingHTTP ni_digester = NIdigester() # Install the template URL b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def publish(self, filename):\n # 1) Encrypt file\n # 2) Publish to remote cloud server\n # 3) Wait for the result\n # 4) Store results in files located inside RAM folder", "def detect(self, filename):\n self.publish(filename)", "def publishUploads(self, manualVerify = True):\...
[ "0.64287066", "0.60361385", "0.5941095", "0.59345895", "0.5917054", "0.57990074", "0.57726157", "0.57401097", "0.57236075", "0.57073116", "0.5628994", "0.55332154", "0.5481817", "0.54700124", "0.54092836", "0.54011065", "0.5339769", "0.53389674", "0.5331978", "0.5296641", "0....
0.6248407
1
Command line program to perform a NetInf 'publish' operation using http convergence layer. Uses NIproc global instance of NI operations class
def py_nipubdir(): # Options parsing and verification stuff usage = "%%prog -d <pathname of content directory> -n <FQDN of netinf node> [-a <hash alg>] [-m NN] [-c count]" parser = OptionParser(usage) parser.add_option("-d", "--dir", dest="dir_name", type="string", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def publish():\n pass", "def hydronn():\n from hydronn.bin import extract_data\n from hydronn.bin import extract_retrieval_data\n from hydronn.bin import train\n from hydronn.bin import retrieve\n from hydronn.bin import evaluate\n\n description = (\"HYDRONN: A NRT precipitation retrieval fo...
[ "0.5767328", "0.5661973", "0.5631436", "0.55480254", "0.54211825", "0.54131734", "0.5406113", "0.53765", "0.53701484", "0.53538346", "0.5352672", "0.5315707", "0.5301884", "0.5267521", "0.5263778", "0.5224786", "0.52056885", "0.5168929", "0.51480085", "0.5146815", "0.5140904"...
0.5670017
1
Generate cached and grouped activity items for personal and universal news. Args
def build_activity(self, user_id): activity_ids = self.raw_activity_links_collection.get_activity_ids_for_user(user_id) friend_ids = self.friends_collection.getFriends(user_id, limit=None) personal_items = self.raw_activity_items_collection.get_activity_items(activity_ids) universal_ve...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def activities_to_jsonfeed(activities, actor=None, title=None, feed_url=None,\n home_page_url=None):\n try:\n iter(activities)\n except TypeError:\n raise TypeError('activities must be iterable')\n\n if isinstance(activities, (dict, str)):\n raise TypeError('activities may not...
[ "0.58782476", "0.58245516", "0.5714196", "0.54559016", "0.5373944", "0.5279887", "0.52462864", "0.52327186", "0.52325124", "0.5232471", "0.5232227", "0.5223817", "0.5216105", "0.51968014", "0.51924586", "0.519236", "0.51744807", "0.51639336", "0.51562124", "0.5153761", "0.509...
0.6624148
0
This initializes the C fitting library.
def initializeC(self, image): super(CPupilFit, self).initializeC(image) self.mfit = self.clib.pfitInitialize(self.pupil_fn.getCPointer(), self.rqe, self.scmos_cal, self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__ (self) :\n self.loadCSPAD2x2CalibParsDefault()", "def initialize(self):\n self.write_model(path=PATH.GRAD, suffix='new')\n\n if PAR.RANDOM_OVER_IT or optimize.iter == 1:\n self.get_random_frequencies()\n\n print('Generating synthetics')\n system.run('sol...
[ "0.6538869", "0.640215", "0.62104684", "0.6187296", "0.61846364", "0.6099485", "0.602922", "0.60163647", "0.5997682", "0.5991749", "0.597411", "0.5933944", "0.5894047", "0.58402103", "0.57940716", "0.57654905", "0.57517904", "0.5741623", "0.57360727", "0.57360727", "0.5736072...
0.64429295
1
Pass new peaks to the C library.
def newPeaks(self, peaks, peaks_type): c_peaks = self.formatPeaks(peaks, peaks_type) self.clib.pfitNewPeaks(self.mfit, c_peaks, ctypes.c_char_p(peaks_type.encode()), c_peaks.shape[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def changePeaks(self):\n # Change the number of peaks\n if self.minpeaks is not None and self.maxpeaks is not None:\n npeaks = len(self.peaks_function)\n u = self.random.random()\n r = self.maxpeaks - self.minpeaks\n if u < 0.5:\n # Remove n ...
[ "0.64907897", "0.6027173", "0.57900417", "0.57882077", "0.5668051", "0.56633043", "0.5647525", "0.5629544", "0.562596", "0.5559616", "0.5544985", "0.5536392", "0.5512018", "0.5455464", "0.5427178", "0.54028904", "0.5350657", "0.5269623", "0.52637213", "0.525326", "0.52431154"...
0.70837945
0
Test that addEventListener gets flagged appropriately.
def test_addEventListener(): err = _do_test_raw(""" x.addEventListener("click", function() {}, true); x.addEventListener("click", function() {}, true, false); """) assert not err.failed() assert not err.notices err = _do_test_raw(""" x.addEventListener("click", function() {}, true, tru...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_subscribe_one_listener(self):\n def listener():\n pass\n EVENT_MANAGER.subscribe('test_listener', listener)\n self.assertIn(listener, EVENT_MANAGER._listeners['test_listener'])", "def test_mouseevents():\n\n err = _do_test_raw(\"window.addEventListener('mousemove', fun...
[ "0.63600886", "0.63525814", "0.629856", "0.6232452", "0.60886395", "0.58877194", "0.5872726", "0.57898706", "0.5751316", "0.5695141", "0.56895745", "0.5664929", "0.56027156", "0.5536601", "0.54882324", "0.54466474", "0.5415127", "0.5400491", "0.5400491", "0.5400491", "0.54004...
0.85027266
0
Tests that createElement calls are filtered properly
def test_createElement(): assert not _do_test_raw(""" var x = "foo"; x.createElement(); x.createElement("foo"); """).failed() assert _do_test_raw(""" var x = "foo"; x.createElement("script"); """).failed() assert _do_test_raw(""" var x = "foo"; x.createElement(bar); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_render_element2():\n elem = hr.Element()\n elem.append(\"this is some text\")\n elem.append(\"and this is some more text\")\n\n # This uses the render_results utility above\n file_contents = render_result(elem).strip()\n\n # making sure the content got in there.\n assert \"this is som...
[ "0.6099641", "0.5910537", "0.56316715", "0.5482185", "0.54426223", "0.54182744", "0.5415149", "0.5406062", "0.53996783", "0.53621614", "0.5355254", "0.5328316", "0.5324107", "0.5315543", "0.5293697", "0.5273912", "0.5255659", "0.5250865", "0.5217955", "0.51548404", "0.5153654...
0.7561235
0
Tests that createElementNS calls are filtered properly
def test_createElementNS(): assert not _do_test_raw(""" var x = "foo"; x.createElementNS(); x.createElementNS("foo"); x.createElementNS("foo", "bar"); """).failed() assert _do_test_raw(""" var x = "foo"; x.createElementNS("foo", "script"); """).failed() assert _do_test_raw...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_createElement():\n\n assert not _do_test_raw(\"\"\"\n var x = \"foo\";\n x.createElement();\n x.createElement(\"foo\");\n \"\"\").failed()\n\n assert _do_test_raw(\"\"\"\n var x = \"foo\";\n x.createElement(\"script\");\n \"\"\").failed()\n\n assert _do_test_raw(\"\"\"\n v...
[ "0.6553644", "0.5767339", "0.56110704", "0.5496338", "0.5460686", "0.5308755", "0.52212656", "0.5208479", "0.5199475", "0.5189086", "0.5153285", "0.51497877", "0.5131236", "0.51135963", "0.51049906", "0.50972146", "0.5070891", "0.50700235", "0.50475746", "0.5033134", "0.50266...
0.7780457
0
Tests that warnings on SQL methods are emitted properly
def test_sql_methods(): err = _do_test_raw(""" x.executeSimpleSQL("foo " + y); """) assert err.warnings[0]['id'][-1] == 'executeSimpleSQL_dynamic' err = _do_test_raw(""" x.createStatement("foo " + y); """) assert err.warnings[0]['id'][-1] == 'executeSimpleSQL_dynamic' err ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def warning(self, *args, **kwargs):", "def warn():\n pass", "def test_query_wrapper_operational_error(self):\n\n _session = self.sessionmaker()\n\n _session.begin()\n self.addCleanup(_session.rollback)\n q = _session.query(self.Foo).filter(\n self.Foo.count...
[ "0.63846934", "0.6327814", "0.6292967", "0.6227003", "0.61164504", "0.606927", "0.60324985", "0.6029675", "0.60110146", "0.6006412", "0.6006412", "0.6006412", "0.6006412", "0.6006412", "0.6006412", "0.6006412", "0.6006412", "0.5999971", "0.5977941", "0.5971273", "0.59604573",...
0.73811924
0
Tests that setAttribute calls are blocked successfully
def test_setAttribute(): assert not _do_test_raw(""" var x = "foo"; x.setAttribute(); x.setAttribute("foo"); x.setAttribute("foo", "bar"); """).failed() assert _do_test_raw(""" var x = "foo"; x.setAttribute("onfoo", "bar"); """).failed()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_attribute():\n elem = hr.Element(\"this is some text\", id=\"spam\", style=\"eggs\")\n elem.set_attributes(holy=\"grail\", answer=42)\n\n assert (\n get_opening_line(elem)\n == '<html id=\"spam\" style=\"eggs\" holy=\"grail\" answer=\"42\">'\n )", "def testSetAttributeActio...
[ "0.6553509", "0.6533299", "0.6466073", "0.62271565", "0.60845727", "0.600334", "0.5973352", "0.59136784", "0.5868815", "0.5804294", "0.58023375", "0.57952565", "0.57601655", "0.5696862", "0.56905687", "0.5690205", "0.5658569", "0.5632546", "0.563241", "0.56156796", "0.5583333...
0.7886286
0
Test that insertAdjacentHTML works the same as innerHTML.
def test_insertAdjacentHTML(): assert not _do_test_raw(""" var x = foo(); x.insertAdjacentHTML("foo bar", "<div></div>"); """).failed() assert _do_test_raw(""" var x = foo(); x.insertAdjacentHTML("foo bar", "<div onclick=\\"foo\\"></div>"); """).failed() # Test without declaration...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_createElement():\n\n assert not _do_test_raw(\"\"\"\n var x = \"foo\";\n x.createElement();\n x.createElement(\"foo\");\n \"\"\").failed()\n\n assert _do_test_raw(\"\"\"\n var x = \"foo\";\n x.createElement(\"script\");\n \"\"\").failed()\n\n assert _do_test_raw(\"\"\"\n v...
[ "0.6206021", "0.54315954", "0.5343544", "0.5333806", "0.5289093", "0.52715856", "0.52019536", "0.51820296", "0.5170138", "0.51649594", "0.51338845", "0.5128217", "0.51144373", "0.50881356", "0.506577", "0.5063727", "0.50439453", "0.50368094", "0.50320894", "0.49574444", "0.49...
0.84246767
0
Test that `nsIFile.launch()` is flagged.
def test_nsIFile_launch(): assert _do_test_raw('foo.launch()').failed()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_fail_launch_file(self):\n args = self.args.copy()\n # Pass a string instead of a list\n args[\"traj_file\"] = \"nofile.xtc\"\n with pytest.raises(FileNotFoundError) as err:\n UI.launch(**args)\n assert \"nofile.xtc does not exist.\" in str(err.value)", "def ...
[ "0.64032733", "0.6122187", "0.5883255", "0.5880068", "0.5665483", "0.5528563", "0.552782", "0.55099374", "0.5467473", "0.5463001", "0.544874", "0.5420529", "0.5306385", "0.5299579", "0.52987474", "0.52926964", "0.52705574", "0.52683437", "0.52574074", "0.5248173", "0.52363783...
0.82881325
0
Test that `.openDialog("")` throws doesn't throw an error for chrome/local URIs.
def test_openDialog_pass(self): self.run_script(""" foo.openDialog("foo") foo.openDialog("chrome://foo/bar") """) self.assert_silent()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_openDialog(self):\n\n def test_uri(self, uri):\n self.setUp()\n self.setup_err()\n self.run_script('foo.openDialog(\"%s\")' % uri)\n self.assert_failed(with_warnings=True)\n\n uris = ['http://foo/bar/',\n 'https://foo/bar/',\n ...
[ "0.6870198", "0.61324924", "0.6001495", "0.5948701", "0.59436876", "0.58810073", "0.56357914", "0.56282413", "0.5534864", "0.5530544", "0.55118865", "0.5507113", "0.5468689", "0.545093", "0.53994143", "0.5359619", "0.5342453", "0.5341253", "0.5336293", "0.5319729", "0.5292852...
0.7835892
0
Test that `.openDialog(bar)` throws doesn't throw an error where `bar` is a dirty object.
def test_openDialog_flag_var(self): self.run_script(""" foo.openDialog(bar) """) self.assert_notices()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_openDialog_pass(self):\n self.run_script(\"\"\"\n foo.openDialog(\"foo\")\n foo.openDialog(\"chrome://foo/bar\")\n \"\"\")\n self.assert_silent()", "def test_openWindowWithWrongSettingsFile(self):\n self.createWrongSettingsFile()\n return self.assertRaise...
[ "0.664462", "0.6096759", "0.5865762", "0.56994104", "0.5670863", "0.5574597", "0.5482802", "0.54300237", "0.5427492", "0.53748256", "0.5308122", "0.52538544", "0.5234245", "0.52235", "0.5222695", "0.52182746", "0.52126163", "0.5170296", "0.516994", "0.51174134", "0.5110923", ...
0.63953465
1
Test that `.openDialog("")` throws an error where is a nonchrome, nonrelative URL.
def test_openDialog(self): def test_uri(self, uri): self.setUp() self.setup_err() self.run_script('foo.openDialog("%s")' % uri) self.assert_failed(with_warnings=True) uris = ['http://foo/bar/', 'https://foo/bar/', 'ftp://f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_openDialog_pass(self):\n self.run_script(\"\"\"\n foo.openDialog(\"foo\")\n foo.openDialog(\"chrome://foo/bar\")\n \"\"\")\n self.assert_silent()", "def error_open_mess(url: str) -> None:\n meta = MainData()\n print(('{0}Can not open URL: {1} {2}{3}').format(meta...
[ "0.76250166", "0.63414615", "0.60822976", "0.5849271", "0.5837435", "0.5826389", "0.57790226", "0.57463026", "0.5706456", "0.5685249", "0.5682213", "0.56506664", "0.56181157", "0.5609045", "0.5588032", "0.55650854", "0.5546954", "0.55328673", "0.5530209", "0.55300903", "0.551...
0.6708838
1
select name from mydb.item_item where ingredients not like '%multimedia%' and ingredients not like '%provision%'
def test_excludeIngredientQuery(self) -> None: ingredient0 = 'multimedia' ingredient1 = 'provision' result = self.entries.exclude(Q(ingredients__icontains=ingredient0) | Q(ingredients__icontains=ingredient1)) self.assertEqual(988, len(result)) queries = (Q(ingredients__icontains...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute(self):\n return super(BeefRecipes, self).execute().where(lower(col('ingredients')).like(\"%beef%\"))", "def test_search_by_bad_ingredients(self):\n recipe_id = self.request_mgr.search_by_ingredients(['asdfadsfa'])\n self.assertEqual(recipe_id, None)", "def test_includeIngredien...
[ "0.620481", "0.6070535", "0.5824319", "0.56567574", "0.5471123", "0.540554", "0.54015297", "0.53638273", "0.5333347", "0.53282493", "0.5299963", "0.5287664", "0.52692205", "0.5224078", "0.52074933", "0.5206623", "0.52025026", "0.5187782", "0.5176583", "0.5147688", "0.51246583...
0.6608633
0
select name from mydb.item_item where ingredients like '%multimedia%' and ingredients like '%provision%'
def test_includeIngredientQuery(self) -> None: ingredient0 = 'multimedia' ingredient1 = 'provision' result = self.entries.filter(Q(ingredients__icontains=ingredient0) & Q(ingredients__icontains=ingredient1)) self.assertEqual(1, len(result))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute(self):\n return super(BeefRecipes, self).execute().where(lower(col('ingredients')).like(\"%beef%\"))", "def search_recipe(ingredients):\n\n params = '+'.join(ingredients.split())\n url_search = SEARCH_URL.format(params)\n response = req.get(url_search)\n\n return response.content",...
[ "0.6647757", "0.6191605", "0.59739184", "0.59232444", "0.5843114", "0.5770647", "0.57508814", "0.57090604", "0.56950915", "0.56343377", "0.55926657", "0.5586077", "0.555635", "0.55286276", "0.5510413", "0.55007166", "0.5458444", "0.5436161", "0.5435352", "0.5406655", "0.54020...
0.63518983
1
Processes the configuration for a group.
def _process_group(self, **config_kwargs) -> RobotGroupConfig: return RobotGroupConfig(self.sim_scene, **config_kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_group_from_config(self):\n\n group_file_name = \"cicada/config/group.yaml\"\n if os.path.isfile(group_file_name):\n self.group_data = dict()\n with open(group_file_name, 'r') as stream:\n self.group_data = yaml.safe_load(stream)\n self.all_grou...
[ "0.63921624", "0.6276154", "0.5917572", "0.58930755", "0.5878203", "0.5875567", "0.5822448", "0.57812375", "0.57412446", "0.57304585", "0.5726534", "0.57034045", "0.5700766", "0.56856185", "0.5675106", "0.56413394", "0.56358737", "0.5601757", "0.55887634", "0.55571437", "0.55...
0.7236225
0
Returns the initial states for the given groups.
def get_initial_state( self, groups: Union[str, Sequence[str]], ) -> Union[RobotState, Sequence[RobotState]]: if isinstance(groups, str): configs = [self.get_config(groups)] else: configs = [self.get_config(name) for name in groups] states = []...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_initial_states(self):\n raise NotImplementedError()", "def initial_states(self):\n return self._initial_states", "def initial_states(self):\n return list(self.iter_initial_states())", "def states_initial(self):\n return self.states(\"Initial = YES\")", "def _get_group_st...
[ "0.6517598", "0.63916826", "0.61768365", "0.61699396", "0.6043793", "0.59128195", "0.5887704", "0.58768594", "0.58085155", "0.58085155", "0.58085155", "0.58085155", "0.58085155", "0.58085155", "0.58085155", "0.58085155", "0.58085155", "0.58085155", "0.58085155", "0.58085155", ...
0.7757164
0
Returns the states for the given group configurations.
def _get_group_states( self, configs: Sequence[RobotGroupConfig]) -> Sequence[RobotState]: states = [] for config in configs: state = RobotState() # Return a blank state if this is a hardware-only group. if config.qpos_indices is None: stat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_states(self):\n raise NotImplementedError()", "def get_states():\n try:\n ''' Returns a list of states in list named result '''\n data = State.select()\n return ListStyle.list(data, request), 200\n except Exception as e:\n abort(500)", "def get_all_states(self):...
[ "0.5906376", "0.587641", "0.58613956", "0.5801155", "0.57883763", "0.57819426", "0.5745295", "0.5735361", "0.5593753", "0.5529911", "0.55296177", "0.54799014", "0.5479514", "0.54587895", "0.5449307", "0.5433292", "0.5427357", "0.5345912", "0.5342106", "0.5340869", "0.5320486"...
0.7487228
0
Applies observation noise to the given state.
def _apply_observation_noise(self, state: RobotState, config: RobotGroupConfig): if config.sim_observation_noise is None or self.random_state is None: return # Define the noise calculation. def noise(value_range: np.ndarray): amplitude = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_noise(self):\n self.noise = torch.normal(0.5, .2, self.state.shape).double()\n self.noise *= torch.sqrt(2 *\n self.vars['T']*torch.tensor(self.vars['dt']))", "def apply_noise(self, input):\n mask = np.random.binomial(1, 1-self.noise_prob, len(input)) ...
[ "0.7100496", "0.6829454", "0.6615999", "0.65508354", "0.6535193", "0.65046763", "0.6397168", "0.6329152", "0.6270984", "0.62694496", "0.6267069", "0.6266234", "0.62525165", "0.6244945", "0.6227903", "0.620435", "0.6183446", "0.6166714", "0.61635095", "0.616012", "0.6097126", ...
0.79560375
0
Denormalizes the given action.
def _denormalize_action(self, action: np.ndarray, config: RobotGroupConfig) -> np.ndarray: if config.denormalize_center.shape != action.shape: raise ValueError( 'Action shape ({}) does not match actuator shape: ({})'.format( action.shap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reverse_action(self, action):\n low = self.action_space.low\n high = self.action_space.high\n\n scale_factor = (high - low) / 2\n reloc_factor = high - scale_factor\n\n action = (action - reloc_factor) / scale_factor\n action = np.clip(action, -1.0, 1.0)\n\n ret...
[ "0.59685934", "0.5911025", "0.5838376", "0.57880056", "0.5760996", "0.5746722", "0.5595164", "0.5518302", "0.5501854", "0.5424955", "0.53894466", "0.5361105", "0.5326777", "0.5308367", "0.52543795", "0.50769705", "0.503363", "0.5022165", "0.5016263", "0.50093585", "0.50074387...
0.77185875
0
This validates the post request as a whole and not just a field. During read, the validator practically skips. During post, each orderline unit is validated. If an orderline has more units than available product units, the order is not accepted.
def validate(self, attrs): exception_body = [] for orderline in attrs.get('orderlines', []): product = orderline['product'] # If orderline has less units than available, all good. if orderline['units'] <= product.units: continue # else er...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean(self):\n cleaned_data = super().clean()\n variant = cleaned_data.get('variant')\n quantity = cleaned_data.get('quantity')\n if variant and quantity is not None:\n try:\n variant.check_quantity(quantity)\n except InsufficientStock as e:\n ...
[ "0.5745162", "0.552804", "0.55063504", "0.55063504", "0.5504187", "0.54778343", "0.54469776", "0.5445624", "0.5444358", "0.54384", "0.54326487", "0.5432112", "0.5422848", "0.54169387", "0.5380987", "0.53740376", "0.5372109", "0.5350199", "0.5332469", "0.5322742", "0.5322059",...
0.64973056
0
Actual updation of an order to confirmed/cancellation/delivery status happens here. There are only two valid transitions acceptable 1. From accepted to confirmed. 2. From confirmed to cancelled/delivered.
def update(self, instance, validated_data): # If an order is cancelled or delivered, it cannot be modified. if instance.status == CANCELLED or instance.status == DELIVERED: raise exceptions.PermissionDenied('This order cannot be modified.') # If an order is already confirmed but UI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_order(self):\n response = self.api_test_client.put('{}/orders/1'.format(\n self.BASE_URL), json={'order_status': 'accepted'})\n\n self.assertEqual(response.status_code, 201)\n self.assertTrue(\n response_as_json(response)['order']['status_updated_on'])\n ...
[ "0.68926567", "0.6892195", "0.66556543", "0.6604199", "0.64407927", "0.6413585", "0.6380169", "0.6379697", "0.6355502", "0.63130534", "0.63076985", "0.6285451", "0.6273759", "0.613097", "0.6118931", "0.6096293", "0.6087185", "0.60793054", "0.6068147", "0.6027666", "0.6010716"...
0.76192147
0
Create lr scheduler based on config. note that lr_scheduler must accept a optimizer that has been restored.
def build(optimizer_config, optimizer, total_step): optimizer_type = optimizer_config.WhichOneof('optimizer') if optimizer_type == 'rms_prop_optimizer': config = optimizer_config.rms_prop_optimizer lr_scheduler = _create_learning_rate_scheduler( config.learning_rate, optimizer, total_step=total_step)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_lr_scheduler(\n cfg: CfgNode, optimizer: torch.optim.Optimizer\n) -> torch.optim.lr_scheduler._LRScheduler:\n name = cfg.SOLVER.LR_SCHEDULER_NAME\n if name == \"WarmupMultiStepLR\":\n return WarmupMultiStepLR(\n optimizer,\n cfg.SOLVER.STEPS,\n cfg.SOLVER....
[ "0.8214888", "0.81373125", "0.8030262", "0.7877491", "0.7863203", "0.777814", "0.7759245", "0.76554245", "0.7646608", "0.7585435", "0.748087", "0.74216324", "0.7285573", "0.7153245", "0.7007013", "0.69302773", "0.6923065", "0.6863463", "0.68190587", "0.6761453", "0.6728476", ...
0.81571466
1
Perform a osd "action."
def _action(self, action, osd, info=None, **kwargs): body = {action: info} self.run_hooks('modify_body_for_action', body, **kwargs) url = '/osds/%s/action' % base.getid(osd) return self.api.client.post(url, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_action(self, client, action):\r\n client.deviceAction(action)", "def perform_actual_action(self, action):\n self.game.perform_action(action)", "def execute_action(self, agent, action):\n agent.bump = False\n agent.performance_measure -= 1\n \n if action == '...
[ "0.6288845", "0.59816945", "0.5836515", "0.5802067", "0.5802067", "0.57797366", "0.574658", "0.56953174", "0.56953174", "0.5662237", "0.5661676", "0.5661676", "0.5661676", "0.5661676", "0.5660734", "0.56254244", "0.5604492", "0.5561712", "0.5526677", "0.5524998", "0.55161124"...
0.6980433
0
The SubstanceEnzyme graph representing the collective metabolic network, occuring in any organism of the clade. This includes each and every enzyme of every organism of this clade.
def collectiveMetabolismEnzymes(self, excludeMultifunctionalEnzymes = defaultExcludeMultifunctionalEnzymes) -> SubstanceEnzymeGraph: graph = self.group.collectiveEnzymeGraph(noMultifunctional = excludeMultifunctionalEnzymes, keepOnHeap = True) graph.name = 'Collective metabolism enzymes ' + ' '.join(sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_graph_karateclub():\n all_members = set(range(34))\n club1 = {0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 16, 17, 19, 21}\n # club2 = all_members - club1\n\n G = eg.Graph(name=\"Zachary's Karate Club\")\n for node in all_members:\n G.add_node(node+1)\n\n zacharydat = \"\"\"\\\n0 1 1...
[ "0.6028162", "0.59044474", "0.57775235", "0.5567599", "0.554882", "0.5535332", "0.5522798", "0.5515686", "0.55137914", "0.55136275", "0.54814845", "0.5472295", "0.5457305", "0.5456937", "0.54244757", "0.54244757", "0.54244757", "0.5421997", "0.5420029", "0.5370936", "0.536334...
0.626008
0
The SubstanceEC graph representing the common metabolic network, shared among all organisms of the clade. This includes only EC numbers which occur in at least `majorityPercentageCoreMetabolism` % of all organisms of this clade.
def coreMetabolism(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, excludeMultifunctionalEnzymes = defaultExcludeMultifunctionalEnzymes) -> SubstanceEcGraph: graph = self.group.majorityEcGraph(majorityPercentage = majorityPercentageCoreMetabolism, noMultifunctional = excludeMul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conservedMetabolism(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> SubstanceEcGraph:\n parentCoreMetabolism = self.parentClade.coreMetabolism(majorityPercentageCoreMetabolism)\n childCoreMetabolism = self.childClade.coreMetabolism(majorityPercentageCoreMetabo...
[ "0.6851328", "0.6829522", "0.67308336", "0.67119503", "0.6634819", "0.66100425", "0.6589145", "0.6467408", "0.624838", "0.611285", "0.60297996", "0.60168624", "0.60092956", "0.5978053", "0.5830879", "0.58009404", "0.575013", "0.5714629", "0.5646468", "0.5639464", "0.56288904"...
0.7358444
0
The number of organisms (leaf taxons) in this clade. Returns int The number of organisms (leaf taxons) in this clade.
def organismsCount(self) -> int: return self.group.organismsCount
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def leaf_count(self) -> int:\n if self.children == []:\n return 1\n else:\n return sum([x.leaf_count() for x in self.children])", "def n_trees(self):\n return len(self.data_kd)", "def count_atoms(self):\n n = 0\n for chain in self.iter_chains():\n ...
[ "0.67566955", "0.6556457", "0.6517457", "0.6517457", "0.6510434", "0.64950323", "0.6437851", "0.6435725", "0.64108914", "0.6374372", "0.6369585", "0.6362572", "0.63609064", "0.63561183", "0.63489836", "0.63383377", "0.6318547", "0.63147897", "0.63098747", "0.63017595", "0.627...
0.77582914
0
The substanceEnzyme graph of all gene duplicated enzymes of the core metabolism.
def geneDuplicatedEnzymes(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, colour = False) -> SubstanceEnzymeGraph: enzymeGraph = self.coreMetabolismEnzymes(majorityPercentageCoreMetabolism) geneDuplicationModel = SimpleGeneDup...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addedMetabolismGeneDuplicatedEnzymes(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> SubstanceEnzymeGraph:\n parentCoreMetabolism = self.parentClade.coreMetabolism(majorityPercentageCoreMetabolism)\n childCoreMetabolism = self.childClade.coreMetabolism(majorit...
[ "0.6935128", "0.6869094", "0.63864636", "0.63718253", "0.62681776", "0.6187902", "0.6169614", "0.61466265", "0.6134928", "0.61197543", "0.61049575", "0.60786825", "0.58720994", "0.5807282", "0.5740409", "0.5649418", "0.56281716", "0.5621698", "0.5607962", "0.5592912", "0.5568...
0.6968888
0
All gene duplicated enzymes of the core metabolism, pointing to all their duplicates.
def geneDuplicatedEnzymesDict(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> Dict[Enzyme, Set[GeneID]]: enzymeGraph = self.coreMetabolismEnzymes(majorityPercentageCoreMetabolism) geneDuplicationModel = SimpleGeneDuplication geneIDs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geneDuplicatedEnzymePairs(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> Set[Tuple[Enzyme, Enzyme]]:\n \n \n enzymes = self.coreMetabolismEnzymes(majorityPercentageCoreMetabolism).getEnzymes()\n geneDuplicationModel = SimpleGeneDuplication\n ...
[ "0.7099837", "0.7025168", "0.69302565", "0.6652433", "0.65650713", "0.65152824", "0.6477518", "0.6289955", "0.6230133", "0.62202966", "0.60999846", "0.59928745", "0.5987962", "0.58550674", "0.5808454", "0.5769425", "0.564335", "0.5591993", "0.5578701", "0.5500059", "0.5488227...
0.71266633
0
All gene duplicated enzymes of the core metabolism, paired with each of their duplicates. If enzyme A is a duplicate of enzyme B and vice versa, this does not return duplicates, but returns only one pair, with the "smaller" enzyme as the first value. An enzyme is "smaller" if its gene ID string is "smaller".
def geneDuplicatedEnzymePairs(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> Set[Tuple[Enzyme, Enzyme]]: enzymes = self.coreMetabolismEnzymes(majorityPercentageCoreMetabolism).getEnzymes() geneDuplicationModel = SimpleGeneDuplication ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def divergedMetabolismGeneDuplicatedEnzymePairs(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> Set[Tuple[Enzyme, Enzyme]]:\n # get diverged metabolism\n divergedMetabolismEnzymes = self.divergedMetabolismEnzymes(majorityPercentageCoreMetabolism).getEnzymes()\n ...
[ "0.74381024", "0.7337452", "0.7129101", "0.690591", "0.6749732", "0.66438884", "0.6258788", "0.6047571", "0.59916437", "0.583954", "0.5826309", "0.5580656", "0.5540774", "0.54498655", "0.52426744", "0.5234347", "0.5220493", "0.5200757", "0.5197881", "0.51871806", "0.51799005"...
0.7607282
0
The substanceEC graph of EC numbers belonging to function changes of neofunctionalised enzymes of the core metabolism. Only EC numbers which could have actually taken part in a function change are reported. This is because enzymes can have multiple EC numbers, while only some might be eligible for a function change. Fo...
def neofunctionalisedECs(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, majorityPercentageNeofunctionalisation = defaultMajorityPercentageNeofunctionalisation, colour = False, eValue = defaultEValue, considerOnlyECs = None) -> SubstanceEcGraph: # get neofunctionalisations ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def redundantECsForContributingNeofunctionalisation(self, \n majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, \n majorityPercentageNeofunctionalisation = defaultMajorityPercentag...
[ "0.6066636", "0.5614624", "0.5553752", "0.5487054", "0.54392904", "0.54148823", "0.5396551", "0.53906614", "0.52966624", "0.52825737", "0.5221849", "0.5204589", "0.51931787", "0.5125437", "0.5115151", "0.51081955", "0.5107046", "0.5076023", "0.50700116", "0.50495934", "0.5038...
0.5634353
1
Get neofunctionalisation events of all enzymes in the core metabolism.
def neofunctionalisations(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, eValue = defaultEValue, considerOnlyECs = None) -> Set[Neofunctionalisation]: # get neofunctionalisations return self._neofunctionalisedEnzymes(majorityPercentageCoreMetabolism, eValue, co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def neofunctionalisationsForFunctionChange(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, majorityPercentageNeofunctionalisation = defaultMajorityPercentageNeofunctionalisation, eValue = defaultEValue, considerOnlyECs = None) -> Dict[FunctionChange, Set[Neofunctionalisation]]:\n ...
[ "0.59909326", "0.57868326", "0.57269204", "0.5654965", "0.5592295", "0.5470599", "0.54684854", "0.54546684", "0.54503614", "0.54164416", "0.54042697", "0.5348139", "0.5230972", "0.52255017", "0.52217627", "0.52217627", "0.5192401", "0.51829016", "0.5179526", "0.5167479", "0.5...
0.6120901
0
Get neofunctionalisation events of all enzymes in the core metabolism, grouped by each possible function change event.
def neofunctionalisationsForFunctionChange(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, majorityPercentageNeofunctionalisation = defaultMajorityPercentageNeofunctionalisation, eValue = defaultEValue, considerOnlyECs = None) -> Dict[FunctionChange, Set[Neofunctionalisation]]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def neofunctionalisations(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, eValue = defaultEValue, considerOnlyECs = None) -> Set[Neofunctionalisation]:\n # get neofunctionalisations \n return self._neofunctionalisedEnzymes(majorityPercentageCoreMetabolism, eVa...
[ "0.5865203", "0.55186284", "0.54669976", "0.54044694", "0.5370907", "0.53479284", "0.532519", "0.52754444", "0.5167715", "0.5159104", "0.5134438", "0.5128673", "0.5123458", "0.5117896", "0.5097917", "0.5074114", "0.49859592", "0.49851054", "0.49779522", "0.49597242", "0.49597...
0.68809205
0
Get neofunctionalisation events of all enzymes in the core metabolism, which contribute to redundancy, pointing to the EC numbers their function changes' EC numbers provides redundancy for.
def redundantECsForContributingNeofunctionalisation(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, majorityPercentageNeofunctionalisation = defaultMajorityPercentageNeofun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def neofunctionalisationsForFunctionChange(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, majorityPercentageNeofunctionalisation = defaultMajorityPercentageNeofunctionalisation, eValue = defaultEValue, considerOnlyECs = None) -> Dict[FunctionChange, Set[Neofunctionalisation]]:\n ...
[ "0.6847851", "0.6301637", "0.6094617", "0.60497826", "0.5845832", "0.58000714", "0.5776784", "0.5648149", "0.54955536", "0.547115", "0.5464117", "0.5397465", "0.5397401", "0.5384487", "0.5378686", "0.5366517", "0.5358685", "0.5353077", "0.53527224", "0.5348591", "0.53361887",...
0.6713973
1
All names/paths in NCBI taxonomy used to create the parent clade.
def parentNCBInames(self): return self.parentClade.ncbiNames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def childNCBInames(self):\n return self.childClade.ncbiNames", "def display_all_paths(taxonomy):\n for i,entry in enumerate(taxonomy):\n print \"For nodeId : {} :: NodeName : {} \" .format(entry['nodeId'], entry['nodeName'])\n parentId = entry['parentId']\n parentName = entry['pare...
[ "0.66094685", "0.5948672", "0.59455013", "0.5883354", "0.58186686", "0.57299733", "0.5665493", "0.5624762", "0.55911696", "0.55900514", "0.55431145", "0.554038", "0.55155194", "0.5509813", "0.55068725", "0.55050105", "0.5497012", "0.5494448", "0.54918534", "0.546851", "0.5436...
0.6904
0
All names/paths in NCBI taxonomy used to create the child clade.
def childNCBInames(self): return self.childClade.ncbiNames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def children(self, taxon, taxonomy):\n\n c = set()\n for taxon_id, taxa in taxonomy.items():\n if taxon in taxa:\n\n if taxon.startswith('s__'):\n c.add(taxon_id)\n else:\n taxon_index = taxa.index(taxon)\n ...
[ "0.626776", "0.6162786", "0.60941124", "0.60593927", "0.6052144", "0.5884141", "0.5847267", "0.56961423", "0.56444347", "0.5616592", "0.56161517", "0.55935484", "0.55766165", "0.5564394", "0.55252403", "0.54684275", "0.5455569", "0.54430205", "0.5435376", "0.54307735", "0.539...
0.6842796
0
SubstanceEC graph of the conserved core metabolism.
def conservedMetabolism(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> SubstanceEcGraph: parentCoreMetabolism = self.parentClade.coreMetabolism(majorityPercentageCoreMetabolism) childCoreMetabolism = self.childClade.coreMetabolism(majorityPercentageCoreMetabolism) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coreMetabolism(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, excludeMultifunctionalEnzymes = defaultExcludeMultifunctionalEnzymes) -> SubstanceEcGraph:\n graph = self.group.majorityEcGraph(majorityPercentage = majorityPercentageCoreMetabolism, noMultifunctional = excl...
[ "0.6580189", "0.6125802", "0.5889315", "0.5867898", "0.5865846", "0.5857007", "0.5807236", "0.5736168", "0.57251334", "0.5632387", "0.5575763", "0.5573248", "0.5559867", "0.5544407", "0.5537933", "0.55150014", "0.5493232", "0.5482677", "0.5473975", "0.5453563", "0.5412237", ...
0.6567516
1
SubstanceEC graph of the added core metabolism.
def addedMetabolism(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> SubstanceEcGraph: parentCoreMetabolism = self.parentClade.coreMetabolism(majorityPercentageCoreMetabolism) childCoreMetabolism = self.childClade.coreMetabolism(majorityPercentageCoreMetabolism) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coreMetabolism(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, excludeMultifunctionalEnzymes = defaultExcludeMultifunctionalEnzymes) -> SubstanceEcGraph:\n graph = self.group.majorityEcGraph(majorityPercentage = majorityPercentageCoreMetabolism, noMultifunctional = excl...
[ "0.6702209", "0.6497114", "0.61611027", "0.61203563", "0.6050524", "0.59818614", "0.5975307", "0.5904523", "0.58224356", "0.58078855", "0.57479113", "0.574062", "0.56759965", "0.560662", "0.5584677", "0.5557808", "0.5547269", "0.54960835", "0.54925925", "0.54916406", "0.54622...
0.6712265
0
SubstanceEC graph of the unified core metabolisms. The lost metabolism of the parent is coloured in blue, the conserved metabolism of both in red, and the added metabolism of the child in pink. The colouring is realised by adding a 'colour' attribute to each edge. Nodes are not coloured.
def unifiedMetabolism(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, colour = False) -> SubstanceEcGraph: parentCoreMetabolism = self.parentClade.coreMetabolism(majorityPercentageCoreMetabolism) childCoreMetabolism = self.childClade.coreMetabolism(majorityPercentageCor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def divergedMetabolism(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, colour = False) -> SubstanceEcGraph:\n parentCoreMetabolism = self.parentClade.coreMetabolism(majorityPercentageCoreMetabolism)\n childCoreMetabolism = self.childClade.coreMetabolism(majorityPerce...
[ "0.66438884", "0.653458", "0.6519239", "0.64919496", "0.63315225", "0.63292813", "0.6266335", "0.6138613", "0.60851824", "0.60435796", "0.59619445", "0.5899194", "0.5817667", "0.5779564", "0.57427", "0.57339853", "0.5727987", "0.5700911", "0.5666281", "0.563707", "0.5624694",...
0.6774996
0
SubstanceEnzyme graph derived from the unified core metabolisms. The lost metabolism of the parent is coloured in blue, the conserved metabolism of both in red, and the added metabolism of the child in pink. The colouring is realised by adding a 'colour' attribute to each edge. Nodes are not coloured.
def unifiedMetabolismEnzymes(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, colour = False) -> SubstanceEnzymeGraph: parentGraph = self.parentClade.coreMetabolismEnzymes(majorityPercentageCoreMetabolism) childGraph = self.childClade.coreMetabolismEnzymes(majorityPercen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unifiedMetabolismNeofunctionalisedEnzymes(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, colour = False) -> SubstanceEnzymeGraph: \n parentNeofunctionalised = self.parentClade.neofunctionalisedEnzymes(majorityPercentageCoreMetabolism, colour = False)\n ch...
[ "0.6252327", "0.60120577", "0.5928985", "0.5926421", "0.58765775", "0.58404446", "0.5823357", "0.58075684", "0.57982713", "0.5772567", "0.57336694", "0.5562557", "0.5510959", "0.54624", "0.5434476", "0.5418058", "0.5414687", "0.54030573", "0.54009295", "0.5381006", "0.5378098...
0.64225346
0
SubstanceEnzyme graph of geneduplicated enzymes, derived from the added core metabolism. First, the added core metabolism is calculated. Then, the enzymes associated with the added EC numbers are extracted from the child's enzyme metabolism.
def addedMetabolismGeneDuplicatedEnzymes(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> SubstanceEnzymeGraph: parentCoreMetabolism = self.parentClade.coreMetabolism(majorityPercentageCoreMetabolism) childCoreMetabolism = self.childClade.coreMetabolism(majorityPercen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addedMetabolismNeofunctionalisedEnzymes(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> SubstanceEnzymeGraph:\n parentCoreMetabolism = self.parentClade.coreMetabolism(majorityPercentageCoreMetabolism)\n childCoreMetabolism = self.childClade.coreMetabolism(majo...
[ "0.67369306", "0.6330515", "0.6303329", "0.62048954", "0.6128838", "0.6119623", "0.6048695", "0.5975053", "0.5937219", "0.5809199", "0.57253855", "0.5707537", "0.56158155", "0.5594471", "0.55635613", "0.5519335", "0.5513304", "0.5461732", "0.53989816", "0.5391257", "0.5377590...
0.69637746
0
SubstanceEnzyme graph of geneduplicated enzymes, derived from the lost core metabolism. First, the lost core metabolism is calculated. Then, the enzymes associated with the added EC numbers are extracted from the parent's enzyme metabolism.
def lostMetabolismGeneDuplicatedEnzymes(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> SubstanceEnzymeGraph: parentCoreMetabolism = self.parentClade.coreMetabolism(majorityPercentageCoreMetabolism) childCoreMetabolism = self.childClade.coreMetabolism(majorityPercent...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addedMetabolismGeneDuplicatedEnzymes(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> SubstanceEnzymeGraph:\n parentCoreMetabolism = self.parentClade.coreMetabolism(majorityPercentageCoreMetabolism)\n childCoreMetabolism = self.childClade.coreMetabolism(majorit...
[ "0.6755201", "0.6535308", "0.62986535", "0.62453306", "0.6057391", "0.60101473", "0.5982564", "0.5913863", "0.5899153", "0.5793252", "0.57070243", "0.56880486", "0.5584127", "0.5576912", "0.55608404", "0.5558294", "0.5490599", "0.5468845", "0.54171175", "0.54139686", "0.53863...
0.66248214
1
Pairs of geneduplicated enzymes, derived from the conserved core metabolism. First, the conserved core metabolism is calculated. Then, the enzymes associated with the conserved EC numbers are extracted from the collective parent's and child's metabolism individually. Then, for parent and child, the geneduplicated enzym...
def conservedMetabolismGeneDuplicatedEnzymePairs(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> Tuple[Set[Tuple[Enzyme, Enzyme]]]: # get conserved metabolism conservedMetabolismEnzymes = self.conservedMetabolismEnzymes(majorityPercentageCoreMetabolism).getEnzymes() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def divergedMetabolismGeneDuplicatedEnzymePairs(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> Set[Tuple[Enzyme, Enzyme]]:\n # get diverged metabolism\n divergedMetabolismEnzymes = self.divergedMetabolismEnzymes(majorityPercentageCoreMetabolism).getEnzymes()\n ...
[ "0.70549107", "0.69402546", "0.6706098", "0.6682713", "0.6562122", "0.64990956", "0.63584626", "0.6323621", "0.62530905", "0.61966795", "0.61394745", "0.6038204", "0.60298336", "0.5788429", "0.5784712", "0.56987387", "0.56817615", "0.56580746", "0.564051", "0.555223", "0.5536...
0.703319
1
Pairs of geneduplicated enzymes, derived from the diverged core metabolism. First, the diverged core metabolism is calculated. Then, the enzymes associated with the added EC numbers are extracted from the collective parent's and child's metabolism individually. Then, for parent and child, the geneduplicated enzyme pair...
def divergedMetabolismGeneDuplicatedEnzymePairs(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> Set[Tuple[Enzyme, Enzyme]]: # get diverged metabolism divergedMetabolismEnzymes = self.divergedMetabolismEnzymes(majorityPercentageCoreMetabolism).getEnzymes() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unifiedMetabolismGeneDuplicatedEnzymePairs(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> Set[Tuple[Enzyme, Enzyme]]: \n parentGeneDuplicated = self.parentClade.geneDuplicatedEnzymePairs(majorityPercentageCoreMetabolism)\n childGeneDuplicated = self.ch...
[ "0.68335646", "0.6791156", "0.6528488", "0.647306", "0.6471037", "0.6426987", "0.6238266", "0.6163832", "0.61556786", "0.61163086", "0.60860956", "0.59248537", "0.5918993", "0.5840949", "0.58134377", "0.5805267", "0.5802707", "0.5529467", "0.5491607", "0.54788053", "0.5477662...
0.7014142
0
Pairs of geneduplicated enzymes, derived from the unified core metabolisms.
def unifiedMetabolismGeneDuplicatedEnzymePairs(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> Set[Tuple[Enzyme, Enzyme]]: parentGeneDuplicated = self.parentClade.geneDuplicatedEnzymePairs(majorityPercentageCoreMetabolism) childGeneDuplicated = self.childClad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geneDuplicatedEnzymePairs(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> Set[Tuple[Enzyme, Enzyme]]:\n \n \n enzymes = self.coreMetabolismEnzymes(majorityPercentageCoreMetabolism).getEnzymes()\n geneDuplicationModel = SimpleGeneDuplication\n ...
[ "0.66328585", "0.6220458", "0.61605203", "0.59667987", "0.59406346", "0.59398246", "0.592409", "0.58372545", "0.58349013", "0.5752567", "0.5708292", "0.5680166", "0.5635978", "0.55386114", "0.5525389", "0.548303", "0.5480818", "0.5471715", "0.54622984", "0.54544353", "0.54533...
0.6404736
1
SubstanceEnzyme graph of neofunctionalised enzymes, derived from the added core metabolism.
def addedMetabolismNeofunctionalisedEnzymes(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> SubstanceEnzymeGraph: parentCoreMetabolism = self.parentClade.coreMetabolism(majorityPercentageCoreMetabolism) childCoreMetabolism = self.childClade.coreMetabolism(majorityPer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collectiveMetabolismEnzymes(self, excludeMultifunctionalEnzymes = defaultExcludeMultifunctionalEnzymes) -> SubstanceEnzymeGraph:\n graph = self.group.collectiveEnzymeGraph(noMultifunctional = excludeMultifunctionalEnzymes, keepOnHeap = True)\n graph.name = 'Collective metabolism enzymes ' + ' '.j...
[ "0.62832594", "0.6032561", "0.59919894", "0.5936504", "0.58536375", "0.5780906", "0.5709709", "0.56339985", "0.56321144", "0.561988", "0.56182474", "0.5617661", "0.5614264", "0.5597388", "0.5581094", "0.5547819", "0.5524394", "0.54902864", "0.5435478", "0.54295534", "0.534995...
0.6251779
1
SubstanceEnzyme graph of neofunctionalised enzymes, derived from the lost core metabolism.
def lostMetabolismNeofunctionalisedEnzymes(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> SubstanceEnzymeGraph: parentCoreMetabolism = self.parentClade.coreMetabolism(majorityPercentageCoreMetabolism) childCoreMetabolism = self.childClade.coreMetabolism(majorityPerc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addedMetabolismNeofunctionalisedEnzymes(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism) -> SubstanceEnzymeGraph:\n parentCoreMetabolism = self.parentClade.coreMetabolism(majorityPercentageCoreMetabolism)\n childCoreMetabolism = self.childClade.coreMetabolism(majo...
[ "0.619215", "0.61078405", "0.59768206", "0.58706874", "0.5782916", "0.5741197", "0.57312053", "0.5701871", "0.56801665", "0.56514645", "0.56266373", "0.56028616", "0.56004995", "0.55960053", "0.5593098", "0.55900544", "0.5576522", "0.55513394", "0.5510709", "0.54889655", "0.5...
0.61164635
1
SubstanceEC graph of "neofunctionalised" EC numbers, derived from the added core metabolism.
def addedMetabolismNeofunctionalisedECs(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, majorityPercentageNeofunctionalisation = defaultMajorityPercentageNeofunctionalisation) -> SubstanceEcGraph: parentCoreMetabolism = self.parentClade.coreMetabolism(majorityPercentageCoreMeta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unifiedMetabolismNeofunctionalisedECs(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, majorityPercentageNeofunctionalisation = defaultMajorityPercentageNeofunctionalisation, colour = False) -> SubstanceEcGraph: \n parentNeofunctionalised = self.parentClade.neofun...
[ "0.6423988", "0.6371142", "0.63001156", "0.62050164", "0.6046099", "0.5791749", "0.5715767", "0.55602425", "0.5521478", "0.5479102", "0.54652435", "0.5458608", "0.54561746", "0.54515", "0.5428723", "0.5406992", "0.53999406", "0.53977454", "0.52835554", "0.5282024", "0.526819"...
0.65178627
0
Two SubstanceEC graphs of "neofunctionalised" EC numbers, derived from the diverged core metabolism.
def divergedMetabolismNeofunctionalisedECs(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, majorityPercentageNeofunctionalisation = defaultMajorityPercentageNeofunctionalisation, colour = False): divergedMetabolism = self.divergedMetabolism(majorityPercentageCoreMetabolism, col...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unifiedMetabolismNeofunctionalisedECs(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, majorityPercentageNeofunctionalisation = defaultMajorityPercentageNeofunctionalisation, colour = False) -> SubstanceEcGraph: \n parentNeofunctionalised = self.parentClade.neofun...
[ "0.6214158", "0.60957927", "0.59478533", "0.58485806", "0.57059896", "0.5507641", "0.5501157", "0.54937583", "0.54590195", "0.5301212", "0.52908236", "0.52827936", "0.5239076", "0.5235464", "0.5215645", "0.52147555", "0.52099645", "0.5206502", "0.5192779", "0.5181326", "0.517...
0.61443126
1
SubstanceEC graph of "neofunctionalised" EC numbers, derived from the unified core metabolisms.
def unifiedMetabolismNeofunctionalisedECs(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, majorityPercentageNeofunctionalisation = defaultMajorityPercentageNeofunctionalisation, colour = False) -> SubstanceEcGraph: parentNeofunctionalised = self.parentClade.neofunctiona...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def neofunctionalisedECs(self, majorityPercentageCoreMetabolism = defaultMajorityPercentageCoreMetabolism, majorityPercentageNeofunctionalisation = defaultMajorityPercentageNeofunctionalisation, colour = False, eValue = defaultEValue, considerOnlyECs = None) -> SubstanceEcGraph:\n # get neofunctionalisation...
[ "0.6325263", "0.6321526", "0.62352514", "0.6154268", "0.6030487", "0.5650482", "0.5579346", "0.55359584", "0.55139494", "0.5471832", "0.5470082", "0.54345083", "0.54121524", "0.53877515", "0.53301024", "0.53161114", "0.5314621", "0.5297274", "0.5284816", "0.5276731", "0.52697...
0.6479725
0
Two clades in NCBI taxonomy, 'child' is assumed younger and must be nested somewhere inside 'parent'.
def __init__(self, parent, child, excludeUnclassified = defaultExcludeUnclassified): # read first NCBI name from Clade object, if necessary if isinstance(parent, Clade): parentNCBIname = parent.ncbiNames[0] elif not isinstance(parent, str): # must be iterable, else fail ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, parent, child, excludeUnclassified = defaultExcludeUnclassified, oneOrganismPerSpecies = defaultOneOrganismPerSpecies):\n # read NCBI names from Clade object, if necessary\n if isinstance(parent, Clade):\n self.parentClade = parent\n else:\n self.parent...
[ "0.5975638", "0.58271253", "0.5484291", "0.5396265", "0.5390652", "0.53713834", "0.53584284", "0.53490835", "0.5338156", "0.53251886", "0.5263821", "0.5227132", "0.51992923", "0.5184101", "0.51213396", "0.5080763", "0.50803787", "0.5078497", "0.50769305", "0.5075885", "0.5074...
0.68073165
0
Compare the current scene references versions with metadata and update as needed
def sceneRefCheck(silent=False): uptodate = True logger.debug('init sceneChecking...') currentProject = database.getCurrentProject() projName = pm.fileInfo.get('projectName') if currentProject != projName: logger.error('This file is from a project different from the current project') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkVersions():\n item = Item(fromScene=True)\n\n for ns, componentMData in item.components.iteritems():\n if ns == 'cam':\n # todo tratar versoes da camera\n continue\n\n if componentMData['assembleMode'] == 'reference':\n refComponent = ReferenceComponent...
[ "0.6834863", "0.6241142", "0.6191124", "0.6186932", "0.6126859", "0.5808705", "0.57901436", "0.5686815", "0.5674683", "0.56705105", "0.5636066", "0.5609275", "0.55931807", "0.553265", "0.54316425", "0.5389392", "0.53655267", "0.52925307", "0.52915853", "0.52761626", "0.525988...
0.6645423
1
Read a .plist file from filepath. Return the unpacked root object (which usually is a dictionary).
def readPlist(filepath): plistData = NSData.dataWithContentsOfFile_(filepath) dataObject, plistFormat, error = NSPropertyListSerialization.propertyListFromData_mutabilityOption_format_errorDescription_(plistData, NSPropertyListMutableContainers, None, None) if error: errmsg = "%s in file %s" % (error, filepath) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_plist(path: str, format: plistlib.PlistFormat) -> dict:\n if not os.path.isfile(path):\n raise ValueError(f'File {path} does not exist')\n\n with open(path, 'rb') as file:\n return plistlib.load(file, fmt=format, dict_type=dict)", "def _read_plist(self, filename):\n file_path...
[ "0.7377023", "0.7077552", "0.7020647", "0.70009124", "0.69380563", "0.6635612", "0.66037655", "0.6400661", "0.6191319", "0.60980314", "0.59968185", "0.5973855", "0.5956443", "0.5919474", "0.5916405", "0.59139293", "0.58797735", "0.58763933", "0.58301824", "0.5828497", "0.5816...
0.76269853
0
Print out the end status of the game when the server closes the connection.
def server_closed_connection(self): print("Game Over!") if self._winner: print("Player {} wins!".format(self._winner)) else: print("Draw!")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_connection_end() -> None:\r\n print(\"Connection lost with G-Earth\")\r\n print()", "def endSession(self):\n if(self.verb >= DLS_VERB_HIGH):\n print \"--Ending session with %s (no action)\" % (self.server)", "def end(self):\n winners = mafia.str_player_list(self.game.winners())\...
[ "0.7442786", "0.7357788", "0.70812464", "0.7068161", "0.6758912", "0.67495376", "0.6671296", "0.6662621", "0.66588444", "0.6629597", "0.6612989", "0.6597301", "0.658959", "0.6576882", "0.657107", "0.65640134", "0.65556294", "0.64894456", "0.6479372", "0.64617205", "0.64595443...
0.78706425
0
Track a download in Piwik
def track_download_request(download_url, download_title): from indico_piwik.plugin import PiwikPlugin if not download_url: raise ValueError("download_url can't be empty") if not download_title: raise ValueError("download_title can't be empty") request = PiwikRequest(server_url=PiwikPlu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download(self):\n pass", "def download(self):\n pass", "def download(self, download_request):\n raise NotImplementedError", "def download_progress(self, cloud_file, size, downloaded):", "def dowload_vt():\n print get_date_time_now() + \" ==> Download VT Samples started!\"\n p...
[ "0.62857395", "0.62857395", "0.6190119", "0.61862576", "0.60990036", "0.60830104", "0.59435177", "0.5895922", "0.58797216", "0.58775985", "0.58351547", "0.5832015", "0.5803117", "0.579149", "0.5750479", "0.5704647", "0.5701332", "0.5676492", "0.5647217", "0.5612867", "0.56082...
0.7677783
0
T.__new__(S, ...) > a new object with type S, a subtype of T
def __new__(S, *more): # real signature unknown; restored from __doc__ pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __new__(cls):\n return object.__new__(cls)", "def __new__(cls):\n return object.__new__(cls)", "def __newobj__(cls, *args):\n return cls.__new__(cls, *args)", "def __new__(S, *more): # real signature unknown; restored from __doc__\n pass", "def __new__(S, *more): # real signatur...
[ "0.72864395", "0.72864395", "0.7262999", "0.7261351", "0.7261351", "0.7261351", "0.7261351", "0.7228152", "0.72100246", "0.72100246", "0.66210115", "0.66210115", "0.66210115", "0.66210115", "0.66210115", "0.66210115", "0.6530774", "0.6427577", "0.6424623", "0.64146465", "0.64...
0.73813504
0
Returns the names of all qualities with exitsting expert knowledge.
def get_qualities_with_expert_knowledge(self) -> List[str]: return sorted(list(set([q for _, q in self.expert_knowledge])))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_expert_knowledge_for_qualities(self, qualities: List[str]) -> List[str]:\n expert_knowledge = reduce(\n lambda res, q: res | set(p for p, _q in self.expert_knowledge if _q == q),\n qualities,\n set()\n )\n return sorted(list(expert_knowledge))", "def ...
[ "0.6796296", "0.6399958", "0.5745922", "0.570581", "0.56431264", "0.5579781", "0.5524196", "0.5486619", "0.5414175", "0.5371931", "0.5336818", "0.5334099", "0.5322436", "0.53192633", "0.5316867", "0.5283304", "0.5277264", "0.527555", "0.52340245", "0.5215532", "0.5200703", ...
0.68818367
0
Returns the names of all parameters with exitsting expert knowledge.
def get_parameters_with_expert_knowledge(self) -> List[str]: return sorted(list(set([p for p, _ in self.expert_knowledge])))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parameter_names(self) -> List[str]:", "def _get_fitted_param_names(self):\n return self._fitted_param_names", "def get_hyperparameter_names():\n params = ['mu', 'nu', 'r', 's']\n return params", "def get_parameter_names(self):\n parNames = []\n # for par in self.variabl...
[ "0.6681219", "0.65302336", "0.6523821", "0.6485351", "0.64587325", "0.64377654", "0.63435304", "0.63268703", "0.6247378", "0.62124157", "0.6184946", "0.61841184", "0.6173412", "0.6156799", "0.61424565", "0.6138973", "0.6092514", "0.6074142", "0.6068428", "0.60556334", "0.6051...
0.7096718
0
Returns the names of all qualities that are affected by the given parameter.
def get_qualities_affected_by_paramter(self, parameter: str) -> List[str]: return [q for p, q in self.correlating_pq_tuples if p == parameter]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_parameters_affecting_qualites(self, qualities: List[str]) -> List[str]:\n parameters = reduce(\n lambda res, q: res | set(self.get_parameters_affecting_quality(q)),\n qualities,\n set()\n )\n return sorted(list(parameters))", "def get_parameters_affec...
[ "0.7138901", "0.65434414", "0.60828495", "0.5970741", "0.5706705", "0.56861335", "0.5615085", "0.5553577", "0.5414541", "0.53965795", "0.5352581", "0.5300973", "0.52954173", "0.52879333", "0.5286698", "0.5282407", "0.5249492", "0.5248632", "0.52475625", "0.52351964", "0.52118...
0.7769609
0
Returns the names of all parameters are affecting the given quality.
def get_parameters_affecting_quality(self, quality: str) -> List[str]: return [p for p, q in self.correlating_pq_tuples if q == quality]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_parameters(self, quality):\n if (quality.upper() == 'NAV') or (quality.upper() == 'NAVIGATION'):\n return self._sensor_param_dict['navigation'].copy()\n \n elif (quality.upper() == 'TAC') or (quality.upper() == 'TACTICAL'):\n return self._sensor_param_dict['tactic...
[ "0.6934809", "0.67903876", "0.6167672", "0.61589646", "0.6091067", "0.6062602", "0.59788996", "0.59663045", "0.5930198", "0.5925212", "0.5914016", "0.587946", "0.57363737", "0.5702479", "0.57009995", "0.57009995", "0.5699666", "0.5673059", "0.5664768", "0.5636903", "0.5629475...
0.8470386
0
Returns the names of all parameters are affecting the given qualities.
def get_parameters_affecting_qualites(self, qualities: List[str]) -> List[str]: parameters = reduce( lambda res, q: res | set(self.get_parameters_affecting_quality(q)), qualities, set() ) return sorted(list(parameters))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_parameters_affecting_quality(self, quality: str) -> List[str]:\n return [p for p, q in self.correlating_pq_tuples if q == quality]", "def get_qualities_affected_by_paramter(self, parameter: str) -> List[str]:\n return [q for p, q in self.correlating_pq_tuples if p == parameter]", "def par...
[ "0.684624", "0.6697432", "0.64668196", "0.6275496", "0.62012315", "0.60170823", "0.5992412", "0.597497", "0.5971461", "0.5962293", "0.5953351", "0.5907317", "0.58813965", "0.5875759", "0.58324844", "0.57914823", "0.5765543", "0.57585037", "0.5748246", "0.5748246", "0.5661398"...
0.82784075
0
Returns the names of all parameters that are expert knowledge of the given qualities.
def get_expert_knowledge_for_qualities(self, qualities: List[str]) -> List[str]: expert_knowledge = reduce( lambda res, q: res | set(p for p, _q in self.expert_knowledge if _q == q), qualities, set() ) return sorted(list(expert_knowledge))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_parameters_affecting_qualites(self, qualities: List[str]) -> List[str]:\n parameters = reduce(\n lambda res, q: res | set(self.get_parameters_affecting_quality(q)),\n qualities,\n set()\n )\n return sorted(list(parameters))", "def get_parameters_with_...
[ "0.7242944", "0.6727106", "0.6571987", "0.63019365", "0.6018897", "0.60036373", "0.57837", "0.57691544", "0.5760132", "0.5750516", "0.5735969", "0.5735225", "0.56694657", "0.56694657", "0.56474066", "0.56144816", "0.5601561", "0.55747986", "0.55496305", "0.5520627", "0.551223...
0.6919965
1
Returns the names of all qualties that are expert knowledge of the given parameter.
def get_expert_knowledge_for_parameter(self, parameter: str) -> List[str]: expert_knowledge = [q for (p, q) in self.expert_knowledge if p == parameter] return sorted(list(set(expert_knowledge)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_qualities_affected_by_paramter(self, parameter: str) -> List[str]:\n return [q for p, q in self.correlating_pq_tuples if p == parameter]", "def get_qualities_with_expert_knowledge(self) -> List[str]:\n return sorted(list(set([q for _, q in self.expert_knowledge])))", "def get_expert_knowl...
[ "0.69750583", "0.6972947", "0.6572471", "0.6532671", "0.6255699", "0.62491757", "0.5842264", "0.5311929", "0.52768415", "0.5177957", "0.5048739", "0.50431305", "0.502833", "0.49590343", "0.49437335", "0.4934118", "0.49310294", "0.49303398", "0.49248543", "0.4907331", "0.48799...
0.7195483
0
method tests timetable records in STATE_EMBRYO state
def test_state_embryo(self): self.pipeline_real.insert_uow = then_return_uow pipeline = spy(self.pipeline_real) job_record = get_job_record(job.STATE_EMBRYO, TEST_PRESET_TIMEPERIOD, PROCESS_SITE_HOURLY) pipeline.ma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_preset_timeperiod_state_in_progress(self):\n when(self.time_table_mocked).can_finalize_job_record(any(str), any(Job)).thenReturn(True)\n uow_dao_mock = mock(UnitOfWorkDao)\n when(uow_dao_mock).get_one(any()).thenReturn(create_unit_of_work(PROCESS_UNIT_TEST, 0, 1, None))\n self....
[ "0.6052409", "0.60238993", "0.60199136", "0.5990552", "0.59654564", "0.59051305", "0.58771414", "0.587141", "0.5824163", "0.57776195", "0.575167", "0.57320946", "0.57115203", "0.57089746", "0.57080287", "0.56987756", "0.5684115", "0.5668643", "0.564905", "0.56462383", "0.5624...
0.68013006
0
method tests timetable records in STATE_IN_PROGRESS state
def test_future_timeperiod_state_in_progress(self): when(self.time_table_mocked).can_finalize_job_record(any(str), any(Job)).thenReturn(True) uow_dao_mock = mock(UnitOfWorkDao) when(uow_dao_mock).get_one(any()).thenReturn(create_unit_of_work(PROCESS_UNIT_TEST, 0, 1, None)) self.pipeline_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_preset_timeperiod_state_in_progress(self):\n when(self.time_table_mocked).can_finalize_job_record(any(str), any(Job)).thenReturn(True)\n uow_dao_mock = mock(UnitOfWorkDao)\n when(uow_dao_mock).get_one(any()).thenReturn(create_unit_of_work(PROCESS_UNIT_TEST, 0, 1, None))\n self....
[ "0.71193224", "0.6860334", "0.66941416", "0.628547", "0.6147146", "0.6099557", "0.60727316", "0.59782106", "0.59703326", "0.59561163", "0.58597606", "0.5858871", "0.5750034", "0.57215893", "0.57205486", "0.5681524", "0.5675636", "0.56590813", "0.5616347", "0.56143284", "0.558...
0.7257185
0
method tests timetable records in STATE_IN_PROGRESS state
def test_preset_timeperiod_state_in_progress(self): when(self.time_table_mocked).can_finalize_job_record(any(str), any(Job)).thenReturn(True) uow_dao_mock = mock(UnitOfWorkDao) when(uow_dao_mock).get_one(any()).thenReturn(create_unit_of_work(PROCESS_UNIT_TEST, 0, 1, None)) self.pipeline_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_future_timeperiod_state_in_progress(self):\n when(self.time_table_mocked).can_finalize_job_record(any(str), any(Job)).thenReturn(True)\n uow_dao_mock = mock(UnitOfWorkDao)\n when(uow_dao_mock).get_one(any()).thenReturn(create_unit_of_work(PROCESS_UNIT_TEST, 0, 1, None))\n self....
[ "0.7257716", "0.6861403", "0.6694048", "0.6286829", "0.61476827", "0.6099142", "0.6072867", "0.59780765", "0.5971016", "0.595613", "0.5860175", "0.58586013", "0.5750365", "0.5722227", "0.57212484", "0.5681915", "0.56768733", "0.56603575", "0.5617645", "0.56150514", "0.5581628...
0.71204054
1
method tests timetable records in STATE_FINAL_RUN state
def test_processed_state_final_run(self): uow_dao_mock = mock(UnitOfWorkDao) when(uow_dao_mock).get_one(any()).thenReturn( create_unit_of_work(PROCESS_UNIT_TEST, 1, 1, None, unit_of_work.STATE_PROCESSED)) self.pipeline_real.uow_dao = uow_dao_mock pipeline = spy(self.pipeline...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transfer_to_final_timeperiod_state_in_progress(self):\n when(self.time_table_mocked).can_finalize_job_record(any(str), any(Job)).thenReturn(True)\n uow_dao_mock = mock(UnitOfWorkDao)\n when(uow_dao_mock).get_one(any()).thenReturn(\n create_unit_of_work(PROCESS_UNIT_TEST, 1,...
[ "0.66075", "0.6143854", "0.61161435", "0.61069274", "0.6051925", "0.59604484", "0.58838767", "0.58052", "0.5779052", "0.5769028", "0.57552785", "0.5731349", "0.5673748", "0.56650174", "0.56536967", "0.5641838", "0.56204814", "0.5584373", "0.5582211", "0.55599564", "0.55164605...
0.65768546
1
method tests timetable records in STATE_SKIPPED state
def test_state_skipped(self): pipeline = spy(self.pipeline_real) job_record = get_job_record(job.STATE_SKIPPED, TEST_PRESET_TIMEPERIOD, PROCESS_SITE_HOURLY) pipeline.manage_pipeline_for_process(job_record.process_name, job_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_skip(self, d_stmt, table): \n pass", "def skip_dti_tests():\n return True", "def IsSkipped(self):\n state = self.GetState()\n return state.status == TestState.SKIPPED", "def test_table_false_positives(self):\n pass", "def test_csv_skipped_status_report(self):\n skip...
[ "0.64526933", "0.62094676", "0.61737317", "0.6080123", "0.6063041", "0.59828675", "0.59114105", "0.5883286", "0.5864295", "0.5789228", "0.578475", "0.5716462", "0.56791854", "0.5611211", "0.5603914", "0.5570936", "0.5559213", "0.55535394", "0.5551212", "0.5548782", "0.5545937...
0.6912011
0
method tests timetable records in STATE_PROCESSED state
def test_state_processed(self): pipeline = spy(self.pipeline_real) job_record = get_job_record(job.STATE_PROCESSED, TEST_PRESET_TIMEPERIOD, PROCESS_SITE_HOURLY) pipeline.manage_pipeline_for_process(job_record.process_name, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_preset_timeperiod_state_in_progress(self):\n when(self.time_table_mocked).can_finalize_job_record(any(str), any(Job)).thenReturn(True)\n uow_dao_mock = mock(UnitOfWorkDao)\n when(uow_dao_mock).get_one(any()).thenReturn(create_unit_of_work(PROCESS_UNIT_TEST, 0, 1, None))\n self....
[ "0.67496896", "0.6644145", "0.6472953", "0.62294924", "0.6101738", "0.5977244", "0.59124064", "0.5691305", "0.55319977", "0.5511322", "0.55038923", "0.5429801", "0.54225284", "0.5324777", "0.5302315", "0.52370924", "0.5232825", "0.5190848", "0.5188738", "0.5178702", "0.514694...
0.72442085
0
function to create employee manager.
def create_manager(self, name, pos, dept): self.manager[dept.upper()].append( { 'name': name, 'pos': pos, 'dept': dept, 'senior': [], 'junior': [], 'trainee': [] } )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_emp(self, name, pos, dept):\n if pos.upper() == 'MANAGER':\n self.create_manager(name, pos, dept)\n elif pos.upper() == 'SENIOR':\n self.create_senior(name, pos, dept)\n elif pos.upper() == 'JUNIOR':\n self.create_junior(name, pos, dept)\n els...
[ "0.70986205", "0.70202345", "0.6854372", "0.6521865", "0.63904655", "0.62510014", "0.6242744", "0.6056396", "0.60380864", "0.6034902", "0.6033909", "0.6022222", "0.60213274", "0.5988317", "0.59657365", "0.591008", "0.5900008", "0.58407825", "0.58102566", "0.57738036", "0.5749...
0.74205023
0
function to create employee senior.
def create_senior(self, name, pos, dept): self.senior[dept.upper()].append( { 'name': name, 'pos': pos, 'dept': dept, 'manager': self.manager[dept.upper()][0]['name'], 'junior': [], 'trainee': [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_emp(self, name, pos, dept):\n if pos.upper() == 'MANAGER':\n self.create_manager(name, pos, dept)\n elif pos.upper() == 'SENIOR':\n self.create_senior(name, pos, dept)\n elif pos.upper() == 'JUNIOR':\n self.create_junior(name, pos, dept)\n els...
[ "0.7395388", "0.6873678", "0.6652067", "0.6417113", "0.63125676", "0.6297487", "0.6267351", "0.62289935", "0.6222155", "0.6122551", "0.6114099", "0.6063726", "0.6037256", "0.60092777", "0.60071415", "0.59452486", "0.5924796", "0.5911677", "0.58706707", "0.58596087", "0.585595...
0.72263277
1
functions to create employee junior.
def create_junior(self, name, pos, dept): self.junior[dept.upper()].append( { 'name': name, 'pos': pos, 'dept': dept, 'manager': self.manager[dept.upper()][0]['name'], 'senior': self.senior[dept.upper()][0]['name'], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_emp(self, name, pos, dept):\n if pos.upper() == 'MANAGER':\n self.create_manager(name, pos, dept)\n elif pos.upper() == 'SENIOR':\n self.create_senior(name, pos, dept)\n elif pos.upper() == 'JUNIOR':\n self.create_junior(name, pos, dept)\n els...
[ "0.6703623", "0.6629079", "0.58912194", "0.5825029", "0.57799065", "0.557808", "0.5561385", "0.55040497", "0.5481859", "0.54713845", "0.5368414", "0.5327975", "0.52699995", "0.52693903", "0.52427757", "0.52367204", "0.52185136", "0.52170134", "0.5204411", "0.5148115", "0.5135...
0.6939935
0
function to create employee trainee.
def create_trainee(self, name, pos, dept): self.trainee[dept.upper()].append( { 'name': name, 'pos': pos, 'dept': dept, 'manager': self.manager[dept.upper()][0]['name'], 'senior': self.senior[dept.upper()][0]['name'], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_emp(self, name, pos, dept):\n if pos.upper() == 'MANAGER':\n self.create_manager(name, pos, dept)\n elif pos.upper() == 'SENIOR':\n self.create_senior(name, pos, dept)\n elif pos.upper() == 'JUNIOR':\n self.create_junior(name, pos, dept)\n els...
[ "0.71946114", "0.64039135", "0.6397927", "0.60852325", "0.60668916", "0.5989232", "0.59618133", "0.5926233", "0.59155416", "0.584691", "0.5840692", "0.58354217", "0.57622826", "0.5757782", "0.57444525", "0.57208085", "0.5719296", "0.56969446", "0.56930053", "0.56875426", "0.5...
0.696836
1
function to create employee based on postion.
def create_emp(self, name, pos, dept): if pos.upper() == 'MANAGER': self.create_manager(name, pos, dept) elif pos.upper() == 'SENIOR': self.create_senior(name, pos, dept) elif pos.upper() == 'JUNIOR': self.create_junior(name, pos, dept) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_employee(self,personal_identity):\r\n new_emp = Employee(*personal_identity)\r\n registration_str = new_emp.get_registration_str()\r\n\r\n return_value = self.save_object_to_DB(\"employee\",registration_str)\r\n return return_value", "def create_employee(self):\n try...
[ "0.7340392", "0.7060474", "0.6856134", "0.66949964", "0.66828686", "0.6662708", "0.6607132", "0.66030127", "0.6332911", "0.6295497", "0.6276587", "0.62654424", "0.626206", "0.62513125", "0.62459964", "0.6240261", "0.6239734", "0.62260616", "0.6169861", "0.61182666", "0.607446...
0.7889773
0
test the attrs of City when set
def test_set_attrs(self): city2 = City() city2.name = "Hawaii" self.assertEqual(city2.name, "Hawaii") city2.state_id = "<3" self.assertEqual(city2.state_id, "<3") self.assertEqual(City.name, "") self.assertEqual(City.state_id, "")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_attributes(self):\n self.assertTrue(hasattr(self.city, 'name'))\n self.assertTrue(hasattr(self.city, 'state_id'))", "def test_city(self):\n c = City()\n self.assertEqual(c.name, \"\")\n self.assertEqual(c.state_id, \"\")\n c.name = \"San Francisco\"\n c.s...
[ "0.77947956", "0.74044555", "0.7307759", "0.7248982", "0.71909946", "0.71890724", "0.69839954", "0.68954945", "0.6838572", "0.6797316", "0.6596423", "0.6592114", "0.6484486", "0.64782625", "0.6418063", "0.6380564", "0.6375229", "0.62248665", "0.62208533", "0.61856556", "0.618...
0.79602754
0
test the inheritance of City from BaseModel
def test_inheritance(self): city3 = City() self.assertIsInstance(city3, BaseModel) self.assertIsInstance(city3, City)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_inheritence(self):\n self.assertTrue(issubclass(City, BaseModel))", "def test_subclass(self):\n self.assertIsInstance(self.city, BaseModel)\n self.assertTrue(hasattr(self.city, \"id\"))\n self.assertTrue(hasattr(self.city, \"created_at\"))\n self.assertTrue(hasattr(sel...
[ "0.8789952", "0.8498339", "0.8354064", "0.7497503", "0.7128531", "0.70219684", "0.700617", "0.698174", "0.6981573", "0.6797616", "0.6792511", "0.6769275", "0.6727983", "0.66833794", "0.6660511", "0.6656261", "0.65980506", "0.6585381", "0.6571345", "0.6492039", "0.64787066", ...
0.86559975
1
check that fifo matches expected types and perms, catch security hold were it could be replace with another file
def __checkFifo(path): pass # FIXME implement
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vsys_fifo_exists(path):\n if not os.path.exists(path):\n collectd.error('File does not exist: %s' % path)\n return False\n if not stat.S_ISFIFO(os.stat(path).st_mode):\n collectd.error('File is not a fifo: %s' % path)\n return False\n return True", "def _check_fifo(self):...
[ "0.6131964", "0.60713536", "0.57345945", "0.56298536", "0.5624965", "0.56156325", "0.5565259", "0.5526661", "0.5506482", "0.5501304", "0.5494585", "0.5419358", "0.5417479", "0.5339467", "0.5335473", "0.5235633", "0.5192825", "0.51720446", "0.51720446", "0.51584595", "0.514473...
0.6538033
0
Returns all the grid positions that are currently available for scoring. YB is only available after YZ has been scored other than 0 or NB, NT and GT are never available for scoring If 13 positions have been scored in the grid, no further positions can be filled
def available_positions(self): if len([x for x in self.grid.values() if x[0] != None]) < 13: return [x for x in assignable_positions if self.grid[x][1] == "---"] else: return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def free_positions(self):\n positions = []\n for i in range(self.grid_size):\n for j in range(self.grid_size):\n if self.grid[i][j] == 0:\n positions.append((i, j))\n if positions == []:\n raise GameException('Game Over. No free position ...
[ "0.6839561", "0.6820858", "0.6375092", "0.6179692", "0.6175604", "0.61393595", "0.6134617", "0.6129079", "0.61183804", "0.6112216", "0.6101577", "0.6083837", "0.5964636", "0.59512347", "0.58837503", "0.5817103", "0.5804341", "0.5783051", "0.5754948", "0.57523113", "0.5745287"...
0.72613794
0
Returns all the grid positions that have been filled in.
def filled_positions(self): return [x for x in assignable_positions if self.grid[x][0]]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def free_positions(self):\n positions = []\n for i in range(self.grid_size):\n for j in range(self.grid_size):\n if self.grid[i][j] == 0:\n positions.append((i, j))\n if positions == []:\n raise GameException('Game Over. No free position ...
[ "0.77568364", "0.723596", "0.7119489", "0.70678014", "0.7052116", "0.69976157", "0.68781596", "0.68656486", "0.68310523", "0.6827777", "0.67618763", "0.66904217", "0.6631231", "0.65709645", "0.65524876", "0.65520054", "0.65291786", "0.65274036", "0.6515479", "0.6496653", "0.6...
0.80966496
0
Assigns a tuple to a position in the grid, of the form (hand, score of this hand for this position)
def assign(self, hand, position): assert isinstance(hand, h.Hand) # print "POSITION:", position # print self try: assert self.grid[position][1] == "---" except AssertionError: raise FilledInError self.grid[position] = (hand, self.score(hand, positi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def score_tuple( hand ):\n m = matches(hand)\n #print( m )\n #royal_flush -- a special case of straight flush.\n if flush(hand) and straight(hand) and hand[4].rank == 14:\n return (8, hand[4].rank, 0)\n #straight_flush\n elif flush(hand) and straight(hand):\n return (8, hand[4].rank...
[ "0.6446688", "0.60046214", "0.5860571", "0.5825233", "0.57931954", "0.5780548", "0.57786965", "0.5750296", "0.57402545", "0.57364994", "0.5714486", "0.5714486", "0.57086986", "0.5672831", "0.5660482", "0.5629688", "0.5591937", "0.5587683", "0.55868065", "0.55848455", "0.55837...
0.7689742
0
Aggregate the statistics of a log dict
def aggregate_log_dict(agg_dict, new_dict) -> dict: for k in new_dict: # init new if not present if k not in agg_dict: agg_dict[k] = { 'n': 0, 'sum': 0.0, 'max': new_dict[k], 'min': new_dict[k], } # aggre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aggregate_logging_outputs(logging_outputs):\n cider_sum = sum(log.get('cider', 0) for log in logging_outputs)\n loss_sum = sum(log.get('loss', 0) for log in logging_outputs)\n sc_loss_sum = sum(log.get('sc_loss', 0) for log in logging_outputs)\n n_pos_sum = sum(log.get('n_positive',...
[ "0.72006446", "0.7089349", "0.7069627", "0.6966819", "0.6952808", "0.6841634", "0.683194", "0.6784331", "0.65914315", "0.64268196", "0.606027", "0.60507745", "0.6043965", "0.6035893", "0.60186166", "0.5961135", "0.59582734", "0.59497863", "0.5914297", "0.5878846", "0.5870959"...
0.7331248
0
Ansible module to verify IP reachability using Ping RPC over NETCONF.
def main(): module = AnsibleModule( argument_spec=dict( host=dict(type='str', required=True), destination=dict(type='str', required=True), repeat_count=dict(type='int', default=5), vrf_name=dict(type='str'), min_success_rate=dict(type='int', defaul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ping():\n return ping_response()", "def ping():\n return ping_response()", "def ping():\n return ping_response()", "def ping():\n return ping_response()", "def ip_check():\n hosts = []\n valid_hosts = []\n for item in sys.argv:\n if '@' in item:\n hosts.append(ite...
[ "0.6234672", "0.6234672", "0.6234672", "0.6234672", "0.6228038", "0.6227247", "0.616574", "0.60879576", "0.607467", "0.5944119", "0.5944096", "0.58443975", "0.57498163", "0.5747767", "0.57241446", "0.57212025", "0.57056487", "0.57054055", "0.5702251", "0.56238407", "0.561111"...
0.65288395
0
Store the datapoint in the Database.
def store_datapoint(sql, parts): t = datetime.fromtimestamp(parts[0]) humid = parts[1] temp_c = parts[2] temp_f = parts[3] heat_c = parts[4] heat_f = parts[5] c = sql.cursor() c.execute("INSERT INTO points VALUES (?,?,?,?,?,?)", (t, humid, temp_c, temp_f, heat_c, heat_f)) sql...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _insert_datapoint(self):\n # Insert\n if db_datapoint.idx_datapoint_exists(1) is False:\n record = Datapoint(\n id_datapoint=general.encode(self.reserved),\n agent_label=general.encode(self.reserved),\n agent_source=general.encode(self.reser...
[ "0.7809628", "0.6474018", "0.6452069", "0.6451785", "0.6422399", "0.64067936", "0.63725233", "0.6366098", "0.63641155", "0.6357713", "0.6354461", "0.6286375", "0.6228851", "0.6175777", "0.61217165", "0.60342234", "0.60303307", "0.6002851", "0.5999837", "0.5990769", "0.59858",...
0.75592405
1
Gets the connection with the Amazon S3 server. Raises an error if conn cannot be established
def get_conn(): global S3Conn S3Conn = tinys3.Connection(plug.options['aws_access_key'], plug.options['aws_secret_key'], default_bucket=plug.options['bucket'], tls=True) # Check that the given bucket exists by doing a HEAD request try: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_s3_connection(self):\n return connection.S3Connection(\n config.get('nereid_s3', 'access_key'),\n config.get('nereid_s3', 'secret_key')\n )", "def _get_aws_s3_connection(cls, access_key, secret_access_key):\n return boto.connect_s3(access_key, secret_access_key)...
[ "0.82608676", "0.81773007", "0.78756386", "0.7746647", "0.7277447", "0.7145592", "0.7025781", "0.69264907", "0.6921318", "0.6873866", "0.68642884", "0.6810215", "0.6697892", "0.6688311", "0.6616437", "0.6614548", "0.6512589", "0.6480621", "0.6454841", "0.6413643", "0.63492787...
0.8209997
1
Returns the float timestamp based on the date format timestamp stored by Amazon. Prefixes the given filename with Onitu's root.
def get_file_timestamp(filename): plug.logger.debug(u"Getting timestamp of {}", filename) metadata = S3Conn.head_object(u(filename)) timestamp = metadata.headers['last-modified'] # convert timestamp to timestruct... timestamp = time.strptime(timestamp, HEAD_TIMESTAMP_FMT) # ...timestruct to floa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getTimestamp(self, filename=None):\n if filename == None:\n return float(self.filename[:-4])\n else:\n return float(filename[:-4])", "def get_timestamp_from_path(file_path):\n return int(file_path.split('_')[1].split('.')[0])", "def timestamp(filename,...
[ "0.78132105", "0.6773026", "0.6582669", "0.6577208", "0.65521187", "0.6412246", "0.63317764", "0.6314977", "0.6306793", "0.6304807", "0.6289728", "0.62649685", "0.6254887", "0.6239393", "0.62276626", "0.62186366", "0.61868083", "0.6158499", "0.6081906", "0.6031934", "0.602073...
0.7196581
1
Caches a multipart upload. Checks that the cache isn't growing past MAX_CACHE_SIZE and that it isn't in the cache yet.
def add_to_cache(multipart_upload): if len(cache) < MAX_CACHE_SIZE: if multipart_upload.uploadId not in cache: cache[multipart_upload.uploadId] = multipart_upload
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_from_cache(multipart_upload):\n if multipart_upload.uploadId in cache:\n del cache[multipart_upload.uploadId]", "def StoreOrUpdateInCache(self, filename, data):\n try:\n if not memcache.add('%s%s' % (self.CACHE_PREFIX, filename), data):\n memcache.replace('%s%s' % (self.CACHE_...
[ "0.6604833", "0.5890147", "0.5890147", "0.5878093", "0.58533037", "0.5794422", "0.55992955", "0.55967", "0.5541061", "0.5466576", "0.54418707", "0.5400634", "0.53629166", "0.5326438", "0.5253554", "0.52396715", "0.52342", "0.5201345", "0.51884687", "0.51225877", "0.50966024",...
0.77208346
0
Removes the given MultipartUpload from the cache, if in it.
def remove_from_cache(multipart_upload): if multipart_upload.uploadId in cache: del cache[multipart_upload.uploadId]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_file_from_cache(self, md5_hash):\n self.used_space -= len(self.storage[md5_hash])\n self.storage.pop(md5_hash)\n self.remove_from_usage_queue(md5_hash)", "def add_to_cache(multipart_upload):\n if len(cache) < MAX_CACHE_SIZE:\n if multipart_upload.uploadId not in cache:\n...
[ "0.6391853", "0.6139608", "0.57140166", "0.5713958", "0.56205344", "0.5557041", "0.5550686", "0.5528383", "0.5524926", "0.552387", "0.551779", "0.5497478", "0.54907894", "0.54887533", "0.544679", "0.54364336", "0.54243356", "0.5414434", "0.5392673", "0.5388353", "0.53837955",...
0.8447665
0
Returns the multipart upload we have the ID of in metadata. As Amazon allows several multipart uploads at the same time for the same file, the ID is the only unique, reliable descriptor.
def get_multipart_upload(metadata): multipart_upload = None metadata_mp_id = None filename = metadata.path if filename.startswith(u"/"): filename = filename[1:] plug.logger.debug(u"Getting multipart upload of {}", filename) # Retrieve the stored multipart upload ID try: metad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initiate_multipart_upload(self):\n request = self.s3.create_request(\"OBJECT_POST\", uri = self.uri, headers = self.headers_baseline, extra = \"?uploads\")\n response = self.s3.send_request(request)\n data = response[\"data\"]\n self.upload_id = getTextFromXml(data, \"UploadId\")\n ...
[ "0.7365177", "0.59189004", "0.56275564", "0.56237596", "0.5594857", "0.5565518", "0.5528612", "0.54932034", "0.54911405", "0.5483178", "0.5480892", "0.54717666", "0.5466336", "0.54513574", "0.5451055", "0.53193146", "0.5319063", "0.53091484", "0.5307384", "0.52786773", "0.527...
0.74951166
0
Get the points to estimate head pose sideways
def head_pose_points(image, rotation_vector, translation_vector, camera_matrix): rear_size = 1 rear_depth = 0 front_size = image.shape[1] front_depth = front_size*2 val = [rear_size, rear_depth, front_size, front_depth] point_2d = get_2d_points(image, rotation_vector, translation_vector, camera_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_oriented_points(self):\n return g.points_from_probe(self)", "def pose_2d_pts(self,image):\n '''\n image- rgb image \n return:-\n pts - list of 2d pose landmarks as img coords\n image- rgb image on which the 2d pose landmarks are drawn\n ''' \n pts=...
[ "0.6658804", "0.6222457", "0.6192936", "0.615454", "0.61042935", "0.60609454", "0.6035024", "0.6020878", "0.60114807", "0.59733033", "0.5970817", "0.59246963", "0.58942825", "0.58829874", "0.5882882", "0.5877781", "0.58656156", "0.58611846", "0.58332133", "0.5820129", "0.5814...
0.6316923
1
Return a list of capabilities for the given user.
def getCapabilities4User(session_key, user=None): roles = [] capabilities = [] # Get user info if user is not None: logger.debug('Retrieving role(s) for current user: %s', user) userEntities = entity.getEntities('authentication/users/%s' % user, count=-1, sessio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def capabilities(self):\n return []", "def capabilities(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"capabilities\")", "def capabilities(self) -> Sequence['outputs.SkuCapabilityResponse']:\n return pulumi.get(self, \"capabilities\")", "def capabilities(self):\n pa...
[ "0.6409061", "0.6338583", "0.6190463", "0.59944904", "0.5973943", "0.59410274", "0.5928636", "0.58201957", "0.581861", "0.57884574", "0.577865", "0.57566994", "0.5692723", "0.5676897", "0.5660047", "0.56488127", "0.56191415", "0.5557506", "0.5557506", "0.55458957", "0.5538102...
0.80392367
0
Return a list of the review statuses in dictionary with the key set to the label (or stanza, if label is undefined).
def refreshStatusLabelMap(self, session_key, force_refresh=False): if force_refresh or self.status_label_map is None: logger.debug("Reloading the review statuses list") reviewStatusesEntities = entity.getEntities('alerts/reviewstatuses', count=-1, sessionKey=session_key) self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_labels(pr_id):\n label_json = get_status_json(pr_id, 'labels')\n current_labels = [l['name'] for l in label_json]\n return current_labels", "def labels_list(issue):\n return [x['name'] for x in issue['labels']]", "def get_review_status(pr_id):\n reviews = get_status_json(pr_id, 'reviews'...
[ "0.561644", "0.5421235", "0.5323489", "0.5313752", "0.52700627", "0.5267757", "0.5250117", "0.52430445", "0.5184294", "0.518364", "0.5169982", "0.50796485", "0.50787926", "0.5018987", "0.5011362", "0.4985156", "0.49694437", "0.49398953", "0.49062294", "0.48961285", "0.4891105...
0.5855251
0
Return the urgency override state.
def isUrgencyOverrideAllowed(session_key): notable_en = entity.getEntity(NotableEventUpdate.LOG_REVIEW_REST_URL, 'notable_editing', namespace=NotableEventUpdate.DEFAULT_NAMESPACE, owner=NotableEvent...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def urgency(self):\n\n try:\n tts = self.raw_time_to_resolve\n except:\n tts = 666\n\n defcon = \"normal\"\n\n if tts < 1:\n defcon = \"critical\"\n elif tts < 2:\n defcon = \"warning\"\n\n return defcon", "def get_level(self) ...
[ "0.7169567", "0.555879", "0.5551994", "0.5436678", "0.5436553", "0.5412196", "0.5387082", "0.5367364", "0.5339496", "0.5331872", "0.53277886", "0.5325559", "0.5320186", "0.5314916", "0.5301885", "0.52887714", "0.52858543", "0.5284677", "0.5282586", "0.5275696", "0.5273975", ...
0.588646
1
Returns the length of the comment required.
def commentLengthRequired(session_key): comment_en = entity.getEntity(NotableEventUpdate.LOG_REVIEW_REST_URL, 'comment', namespace=NotableEventUpdate.DEFAULT_NAMESPACE, owner=NotableEventUpdate.DEFA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sent_count(comment):\n return comment.__len__()", "def comments_count(self) -> int:\n return pulumi.get(self, \"comments_count\")", "def get_comments_num(self): \n num=len(self.comments_set.all())\n return num", "def count_...
[ "0.73293304", "0.705401", "0.6813874", "0.67454207", "0.6679172", "0.6659644", "0.65434384", "0.65434384", "0.64944047", "0.648698", "0.64770037", "0.64671075", "0.64671075", "0.64651716", "0.6432444", "0.6423683", "0.64124656", "0.64124656", "0.63907695", "0.6389172", "0.638...
0.78513294
0
Returns the status ID of the default systemwide review status.
def getDefaultStatus(session_key): # Get the list of statuses logger.debug("Getting the default status") statuses_list = entity.getEntities(NotableEventUpdate.REVIEW_STATUSES_REST_URL, namespace=NotableEventUpdate.DEFAULT_NAMESPACE, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_default_status(self):\n return self.bot_data_file[\"bot_status\"][\"defaultStatus\"]", "def get_review_status(self):\n if not hasattr(self, 'credential_review'):\n status = 'Awaiting review'\n elif self.credential_review.status <= 20:\n status = 'Awaiting review...
[ "0.68067926", "0.6296829", "0.60826635", "0.60303974", "0.5814972", "0.5710746", "0.5666026", "0.56644005", "0.5596166", "0.5588872", "0.5538899", "0.5532661", "0.5532661", "0.5532661", "0.5532661", "0.5532661", "0.5532661", "0.5532661", "0.5532661", "0.5532661", "0.5516928",...
0.7114933
0
Refresh the list of correlation searches from splunkd via REST.
def refreshCorrelationSearches(self, session_key): logger.debug("Reloading the correlation searches") self.correlation_searches = entity.getEntities('alerts/correlationsearches', count=-1, sessionKey=session_key) self.correlation_search_info = {k: {'rule_name': v['rule_name'], 'default_status': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refresh(self):\n self.dto = self.res.get()\n log.debug(f\"Refreshed {self.url}\")", "def repopall(ctx):\n c = ctx.obj['client']\n if not c.login:\n return False\n\n r = requests.request(\"GET\", urljoin(c.BASE_URL, '/apiproxy/JobService.js'), params={'accesskey': c.login, 'metho...
[ "0.59978175", "0.575787", "0.55191344", "0.54884845", "0.54615736", "0.5445839", "0.5445396", "0.5445396", "0.53740287", "0.53508", "0.5328238", "0.5328238", "0.5328238", "0.53184426", "0.53174514", "0.53174514", "0.531563", "0.52705693", "0.5265398", "0.5265398", "0.52478623...
0.7061147
0
Create an audit record for a list of updated events.
def create_audit_records(self, status_records, session_key): uri = '/services/receivers/simple' getargs = {'index': '_audit', 'sourcetype': 'incident_review', 'output_mode': 'json'} # Double list-comprehension: # a. Comma-separate the fields in each record, replacing "None" with the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateEvents(self, status_records, session_key, existing_statuses=None):\n\n for status_record in status_records:\n status_record.update_from_existing(existing_statuses.get(status_record.rule_id))\n\n # Update.\n unused_response, content = self.kv.batch_create([\n var...
[ "0.63237685", "0.59012693", "0.5659949", "0.5493767", "0.54725164", "0.5468641", "0.5305744", "0.5234044", "0.5232979", "0.522035", "0.5220307", "0.52176887", "0.5212649", "0.51756454", "0.5148049", "0.51328814", "0.5120397", "0.51175773", "0.5109951", "0.50947446", "0.504144...
0.6022617
1
Get the search results for the given search ID.
def getSearchResults(searchID, session_key): job = splunk.search.getJob(searchID, sessionKey=session_key) if not job.isDone: raise SearchNotDoneException("Search is not done, search must be completed before results can be processed") if job.reportSearch: logger.warn("T...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_search_results(search_string: str):\n database = get_db()\n result = []\n search_string = search_string.lower()\n search_strings = search_utils.preprocess_search_string(\n search_string[:150]\n )\n query_search = database.AQLQuery(\n query=search_queries.QUERY_SEARCH,\...
[ "0.6724352", "0.65330744", "0.64275545", "0.6412478", "0.63617796", "0.6330999", "0.6315197", "0.6310618", "0.630068", "0.6298764", "0.629138", "0.62622744", "0.6177091", "0.6141086", "0.6141086", "0.6141086", "0.6141086", "0.6141086", "0.6141086", "0.6141086", "0.6118462", ...
0.71253186
0
Set the status of the events that match a search with the given ID.
def setStatusBySearchID(self, searchID, urgency, status, comment, newOwner, reviewTime, capabilities, session_key, currentUser=None, force_refresh=False, rule_ids_to_change=None, existing_statuses=None): # This class instance will record the number of events successfully changed status_change_meta = Lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def id_status(self, id_status):\n self._id_status = id_status", "def update_status(self, id, status):\n sql = f\"UPDATE incidences SET status = \\'{status}\\'\\\n WHERE incidences.id = {id}\"\n conn = Db().con\n curr = conn.cursor()\n curr.execute(sql)\n conn.com...
[ "0.6252509", "0.5942144", "0.59207493", "0.5787411", "0.5685566", "0.56427914", "0.5544263", "0.5534634", "0.5514875", "0.54568875", "0.5452327", "0.5425086", "0.531803", "0.529227", "0.5255102", "0.52439374", "0.5222686", "0.52150995", "0.52004564", "0.51656383", "0.51502025...
0.6068505
1