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
Tests creating a session with missing fields.
def test_create_session_missing_field(self, field_name): study_id = self.storage.create_study(sample_study_spec()) session = sample_session(study_id=study_id) session.ClearField(field_name) with self.assertRaises(ValueError): self.storage.create_session(session)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_session_missing_study(self):\n session = sample_session(study_id='missing')\n with self.assertRaises(ValueError):\n self.storage.create_session(session)", "def testSessionCreate(self):\n success = False\n attr = None\n\n try:\n attr = self.session.create...
[ "0.7314188", "0.721266", "0.69350606", "0.6933112", "0.68571717", "0.68025", "0.672386", "0.6665019", "0.66439575", "0.66117936", "0.6484293", "0.6464011", "0.64491874", "0.64235115", "0.6415269", "0.63388413", "0.6307025", "0.627489", "0.6270041", "0.626556", "0.6212912", ...
0.7380075
0
Tests creating a session for a missing study.
def test_create_session_missing_study(self): session = sample_session(study_id='missing') with self.assertRaises(ValueError): self.storage.create_session(session)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_session_missing(self):\n study_id = self.storage.create_study(sample_study_spec())\n self.assertIsNone(self.storage.get_session(study_id, 'missing'))\n\n session = sample_session(study_id)\n self.storage.create_session(session)\n self.assertIsNone(self.storage.get_session('missing', ses...
[ "0.8099342", "0.75863045", "0.755924", "0.74635404", "0.72233135", "0.68248355", "0.6630409", "0.65321535", "0.6492938", "0.6404101", "0.6378402", "0.6367728", "0.6347156", "0.6343192", "0.63141507", "0.62959117", "0.62526923", "0.6207722", "0.61770874", "0.61483103", "0.6102...
0.8253221
0
Tests getting a missing session.
def test_get_session_missing(self): study_id = self.storage.create_study(sample_study_spec()) self.assertIsNone(self.storage.get_session(study_id, 'missing')) session = sample_session(study_id) self.storage.create_session(session) self.assertIsNone(self.storage.get_session('missing', session.id))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_session_not_accessed(self):\n response = self.client.get(\"/auth_processor_no_attr_access/\")\n self.assertContains(response, \"Session not accessed\")", "def test_get_session_unconnected(self):\n ctx = Context(SSLv23_METHOD)\n server = Connection(ctx, None)\n session ...
[ "0.75620914", "0.73547095", "0.73520267", "0.7317915", "0.7208318", "0.71124625", "0.7018104", "0.6980379", "0.6973348", "0.68540627", "0.6847514", "0.6807951", "0.67942023", "0.67010593", "0.6681374", "0.6658106", "0.6648426", "0.65982705", "0.6584949", "0.6583117", "0.65460...
0.82678115
0
Tests updating a session.
def test_update_session(self): study_id = self.storage.create_study(sample_study_spec()) session = sample_session(study_id=study_id) self.storage.create_session(session) self.assertEqual(session.state, study_pb2.Session.STATE_VALID) session.state = study_pb2.Session.STATE_INVALID self.storage....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_session(self):\r\n now = time.time()\r\n\r\n # Make sure the session has data so that it doesn't get dropped\r\n cursor = self.db.cursor()\r\n cursor.execute(\"INSERT INTO session VALUES ('123456', 0, 1)\")\r\n cursor.execute(\"INSERT INTO session_attribute VALUES...
[ "0.82946134", "0.7408267", "0.68849015", "0.6867678", "0.6867678", "0.6867678", "0.68364346", "0.6808341", "0.6714346", "0.66298896", "0.66240585", "0.661912", "0.66188127", "0.6525494", "0.65100247", "0.6484793", "0.64749116", "0.6457133", "0.64357066", "0.643522", "0.643475...
0.7794056
1
Tests updating a missing session.
def test_update_missing_session(self): study_id = self.storage.create_study(sample_study_spec()) session = sample_session(study_id=study_id) with self.assertRaises(ValueError): self.storage.update_session(session)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_session(self):\r\n now = time.time()\r\n\r\n # Make sure the session has data so that it doesn't get dropped\r\n cursor = self.db.cursor()\r\n cursor.execute(\"INSERT INTO session VALUES ('123456', 0, 1)\")\r\n cursor.execute(\"INSERT INTO session_attribute VALUES...
[ "0.76117134", "0.75756556", "0.7009637", "0.674889", "0.6572191", "0.64988106", "0.6422968", "0.64106137", "0.63917124", "0.6378021", "0.6366198", "0.6350569", "0.63165647", "0.6315081", "0.62960345", "0.62960345", "0.62960345", "0.6290946", "0.62595004", "0.62563086", "0.624...
0.81444335
0
Initializes a session and returns the study ID and session ID.
def init_session(self) -> Tuple[str, str]: study_id = self.storage.create_study(sample_study_spec()) session = sample_session(study_id=study_id) self.storage.create_session(session) return study_id, session.id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _initialize_session(par_interface, protocol_name, hints=()):\n test_id_path = os.path.join(\n os.path.dirname(__file__),\n \"data\",\n f\"{protocol_name}\",\n \"image_classification\",\n \"test_ids.csv\",\n )\n test_ids = list(map(str.strip, open(test_id_path, \"r\")...
[ "0.67589587", "0.6480812", "0.64793074", "0.63419545", "0.6170321", "0.6170321", "0.6168319", "0.6077447", "0.60173506", "0.595339", "0.5944778", "0.59138125", "0.5908427", "0.5853368", "0.58149385", "0.5791339", "0.57378757", "0.5723941", "0.57024556", "0.57020456", "0.56647...
0.86156523
0
Initializes a session and creates a sample episode in the storage.
def _create_sample_episode(self) -> study_pb2.Episode: study_id, session_id = self.init_session() episode = sample_episode(study_id=study_id, session_id=session_id) self.storage.create_episode(episode) return episode
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_session(self):\n study_id = self.storage.create_study(sample_study_spec())\n\n session = sample_session(study_id=study_id)\n self.storage.create_session(session)\n\n self.assertEqual(self.storage.get_session(study_id, session.id), session)", "def init_session(self) -> Tuple[str, str]:...
[ "0.7073724", "0.689255", "0.68431765", "0.65292567", "0.61331826", "0.6132642", "0.6020185", "0.6020185", "0.6012741", "0.6004299", "0.59367913", "0.5828064", "0.5806541", "0.5730221", "0.5652401", "0.5632952", "0.56318444", "0.558953", "0.5565961", "0.5554899", "0.55479157",...
0.7475625
0
Tests creating an episode.
def test_create_episode(self): episode = self._create_sample_episode() self.assertEqual( self.storage.get_episode(episode.study_id, episode.session_id, episode.id), episode)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_existing_episode(self):\n episode = self._create_sample_episode()\n with self.assertRaises(ValueError, msg='Episode already exists.'):\n self.storage.create_episode(episode)", "def test_create_episode_missing_study(self):\n _, session_id = self.init_session()\n episode = sample_e...
[ "0.8144112", "0.71634734", "0.7010159", "0.7008141", "0.6933483", "0.68966794", "0.6790239", "0.6735227", "0.653441", "0.64430285", "0.63877565", "0.63446194", "0.63172746", "0.6283934", "0.6240871", "0.62397873", "0.6219842", "0.621288", "0.62003636", "0.618112", "0.61740386...
0.8827625
0
Tests creating an episode for a missing session.
def test_create_episode_missing_session(self): study_id = self.storage.create_study(sample_study_spec()) episode = sample_episode(study_id=study_id, session_id='missing') with self.assertRaises(ValueError): self.storage.create_episode(episode)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_episode_missing_study(self):\n _, session_id = self.init_session()\n episode = sample_episode(study_id='missing', session_id=session_id)\n with self.assertRaises(ValueError):\n self.storage.create_episode(episode)", "def test_create_existing_episode(self):\n episode = self._creat...
[ "0.81493276", "0.76721245", "0.75123125", "0.7170817", "0.68798655", "0.68144184", "0.6751232", "0.6561961", "0.65390486", "0.65072423", "0.6253223", "0.6202442", "0.61001486", "0.6073128", "0.6072587", "0.5989172", "0.59625196", "0.5948455", "0.59400785", "0.59313756", "0.59...
0.85375804
0
Tests creating an episode for a missing study.
def test_create_episode_missing_study(self): _, session_id = self.init_session() episode = sample_episode(study_id='missing', session_id=session_id) with self.assertRaises(ValueError): self.storage.create_episode(episode)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_episode_missing_session(self):\n study_id = self.storage.create_study(sample_study_spec())\n episode = sample_episode(study_id=study_id, session_id='missing')\n with self.assertRaises(ValueError):\n self.storage.create_episode(episode)", "def test_create_existing_episode(self):\n ...
[ "0.8137882", "0.78032833", "0.75689256", "0.6792931", "0.67500323", "0.6686436", "0.66267246", "0.6594826", "0.6574101", "0.65016884", "0.64614993", "0.645196", "0.640829", "0.6402761", "0.63559407", "0.6352517", "0.6350069", "0.6259453", "0.6259453", "0.6259453", "0.6259453"...
0.8455071
0
Tests creating an existing episode.
def test_create_existing_episode(self): episode = self._create_sample_episode() with self.assertRaises(ValueError, msg='Episode already exists.'): self.storage.create_episode(episode)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_episode(self):\n episode = self._create_sample_episode()\n\n self.assertEqual(\n self.storage.get_episode(episode.study_id, episode.session_id,\n episode.id), episode)", "def test_create_episode_missing_study(self):\n _, session_id = self.init_sessi...
[ "0.8846464", "0.7390104", "0.7268861", "0.7246912", "0.7072446", "0.6942797", "0.6775714", "0.6750638", "0.6562778", "0.64125943", "0.6404397", "0.63475555", "0.6346144", "0.6278463", "0.6254797", "0.625018", "0.62416214", "0.61866766", "0.618035", "0.6180024", "0.6161277", ...
0.85958314
1
Tests atomic update of an episode.
def test_atomic_update_episode(self): episode = self._create_sample_episode() study_id, session_id, episode_id = (episode.study_id, episode.session_id, episode.id) def callback(read_episode): # Read episode should match the stored one. self.assertEqual(re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_atomic_update_episode_no_update(self):\n episode = self._create_sample_episode()\n study_id, session_id, episode_id = (episode.study_id, episode.session_id,\n episode.id)\n\n def callback(read_episode):\n # Make a change but return false.\n read_ep...
[ "0.8621173", "0.7571105", "0.70153433", "0.6651448", "0.6575879", "0.6575879", "0.6575879", "0.65057075", "0.64887184", "0.6446726", "0.6431503", "0.64199495", "0.6419161", "0.641377", "0.6327878", "0.62431717", "0.62341446", "0.6153133", "0.61499906", "0.6110408", "0.6110301...
0.87514
0
Tests atomic update of an episode without any changes.
def test_atomic_update_episode_no_update(self): episode = self._create_sample_episode() study_id, session_id, episode_id = (episode.study_id, episode.session_id, episode.id) def callback(read_episode): # Make a change but return false. read_episode.num_st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_atomic_update_episode(self):\n episode = self._create_sample_episode()\n study_id, session_id, episode_id = (episode.study_id, episode.session_id,\n episode.id)\n\n def callback(read_episode):\n # Read episode should match the stored one.\n self.as...
[ "0.84660435", "0.7890779", "0.71040875", "0.6888165", "0.6645462", "0.664114", "0.664114", "0.664114", "0.65186656", "0.6496286", "0.6428055", "0.64232314", "0.6407289", "0.63487357", "0.6339075", "0.63161963", "0.624167", "0.62241834", "0.61784154", "0.61751306", "0.6154144"...
0.89119446
0
Tests atomic update of a missing episode.
def test_atomic_update_missing_episode(self): def callback(unused_episode): # Callback should not be called. assert False self.assertFalse( self.storage.atomic_update_episode('study', 'session', 'missing', callback))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_atomic_update_episode_no_update(self):\n episode = self._create_sample_episode()\n study_id, session_id, episode_id = (episode.study_id, episode.session_id,\n episode.id)\n\n def callback(read_episode):\n # Make a change but return false.\n read_ep...
[ "0.8667964", "0.7754999", "0.693362", "0.65994745", "0.6509191", "0.64592224", "0.64587677", "0.64382136", "0.63946396", "0.62582344", "0.6234301", "0.622272", "0.6222256", "0.61955893", "0.61854947", "0.6182698", "0.61460924", "0.61211073", "0.60616493", "0.6056387", "0.6053...
0.85606474
1
Tests deleting an episode.
def test_delete_episode(self): episode = self._create_sample_episode() study_id, session_id, episode_id = (episode.study_id, episode.session_id, episode.id) self.assertIsNotNone( self.storage.get_episode(study_id, session_id, episode_id)) self.assertTrue(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_podcast_episode(mocker):\n patched_delete_task = mocker.patch(\"search.search_index_helpers.deindex_document\")\n episode = PodcastEpisodeFactory.create()\n deindex_podcast_episode(episode)\n assert patched_delete_task.called is True\n assert patched_delete_task.call_args[0] == (\n ...
[ "0.8112195", "0.70771784", "0.7068329", "0.7054096", "0.70299566", "0.70178753", "0.7016936", "0.6961777", "0.68921447", "0.6890033", "0.68452835", "0.6833025", "0.6827591", "0.6823578", "0.68076617", "0.6764199", "0.67616373", "0.6751054", "0.67457855", "0.67202187", "0.6667...
0.88629466
0
Creates a mapping of device nodes to filesystem labels
def get_disk_labels(self): path = '/dev/disk/by-label/' labels = {} if not os.path.isdir(path): return labels for label in os.listdir(path): label = label.replace('\\x2f', '/') device = os.path.realpath(path + '/' + label) labels[device] =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_label_map(self, outpath):\n cnt = 1\n with open(outpath, 'w') as fp:\n for itm in self.clazzes:\n fp.write('item {\\n')\n fp.write('\\tname: \"{}\"\\n'.format(itm))\n fp.write('\\tid: {}\\n'.format(cnt))\n fp.write('}\\...
[ "0.6372033", "0.61217254", "0.60712963", "0.5962846", "0.5840805", "0.576137", "0.57216", "0.570853", "0.5627688", "0.5568255", "0.55652326", "0.5554678", "0.55515593", "0.54971075", "0.54883134", "0.5487028", "0.54858994", "0.5484734", "0.54722834", "0.5447246", "0.5447246",...
0.7093763
0
Creates a map of mounted filesystems on the machine.
def get_file_systems(self): result = {} if os.access('/proc/mounts', os.R_OK): file = open('/proc/mounts') for line in file: try: mount = line.split() device = mount[0] mount_point = mount[1] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collect_existing_mounts():\n result = {}\n for mount in sh.mount().stdout.decode('utf-8').splitlines():\n tokens = mount.split()\n if tokens[1] == 'on' and tokens[0].startswith('/dev/'):\n device = tokens[0][5:]\n result[tokens[2]] = device\n return result", "def mount(mapping, loaded_data...
[ "0.66772187", "0.6663922", "0.6540595", "0.6464295", "0.63340527", "0.6125977", "0.60277283", "0.59602416", "0.5908395", "0.5807566", "0.5790229", "0.57675683", "0.5697693", "0.5680934", "0.56492376", "0.5641508", "0.56374043", "0.5614667", "0.56000686", "0.55879927", "0.5533...
0.6847512
0
Parse a stream and return the syntax tree.
def parse_stream_raw(self, stream: IO[str], debug: bool = False) -> NL: tokens = tokenize.generate_tokens(stream.readline, grammar=self.grammar) return self.parse_tokens(tokens, debug)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_stream(stream):\n try:\n root = etree.parse(stream).getroot()\n except:\n root = etree.fromstring(stream)\n return parse_node(root)", "def parse_stream(self, stream: IO[str], debug: bool = False) -> NL:\n return self.parse_stream_raw(stream, debug)", "def get_parse_tree_...
[ "0.74537975", "0.68219215", "0.66676295", "0.66029507", "0.65491366", "0.63414955", "0.6323979", "0.6309332", "0.6279701", "0.62353003", "0.6179436", "0.60469824", "0.59709686", "0.5898578", "0.5817406", "0.5791366", "0.5787918", "0.5768625", "0.57505333", "0.57243526", "0.57...
0.68256766
1
Inquire whether file a was written since file b.
def _newer(a: str, b: str) -> bool: if not os.path.exists(a): return False if not os.path.exists(b): return True return os.path.getmtime(a) >= os.path.getmtime(b)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_newer(a, b):\n return os.stat(a).st_mtime >= os.stat(b).st_mtime", "def is_newer(filename1, filename2):\n return os.stat(filename1).st_mtime > os.stat(filename2).st_mtime", "def has_changed(self):\n timestamp = os.stat(self.filename).st_mtime\n if timestamp > self.last_timestamp:\n ...
[ "0.671648", "0.65600073", "0.65289783", "0.649369", "0.640166", "0.6357216", "0.6272455", "0.62173784", "0.61087847", "0.6075105", "0.6062069", "0.60289407", "0.60248065", "0.5989988", "0.5971817", "0.5944724", "0.59412205", "0.5939155", "0.5929307", "0.58972526", "0.5896943"...
0.67819273
0
Normally, loads a pickled grammar by doing pkgutil.get_data(package, pickled_grammar) where pickled_grammar is computed from grammar_source by adding the Python version and using a ``.pickle`` extension. However, if grammar_source is an extant file, load_grammar(grammar_source) is called instead. This facilitates using...
def load_packaged_grammar( package: str, grammar_source: str, cache_dir: Optional[Path] = None ) -> grammar.Grammar: if os.path.isfile(grammar_source): gp = _generate_pickle_name(grammar_source, cache_dir) if cache_dir else None return load_grammar(grammar_source, gp=gp) pickled_name = _gene...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_grammar(path):\n return SCFG(iterrules(smart_ropen(path)))", "def import_grammar(path):\n grammar_name = os.path.basename(path).replace(\".py\", \"\")\n grammar_file = f'restler_grammar_{grammar_name}_{os.getpid()}.py'\n\n # import req_collection from given grammar\n sys.path.append(os.pa...
[ "0.6434674", "0.6205083", "0.57276833", "0.5583306", "0.55783176", "0.5527383", "0.55202013", "0.5460389", "0.54289573", "0.5380848", "0.5375538", "0.53574336", "0.531384", "0.527468", "0.520273", "0.51227057", "0.5112731", "0.5065482", "0.501795", "0.49408016", "0.4926656", ...
0.8143914
0
Report to callback URL unrecoverable state.
def report_unrecoverable(self, payload, exception, callback_url): capture_exception(exception) if not callback_url: return payload["failure"] = {"type": "UNRECOVERABLE_FAILURE", "message": str(exception)} data = GraphExportCallbackError().load(payload) with retry()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _disconnected(self, link_uri):\n print \"Disconnected from %s\" % link_uri", "def _disconnected(self, link_uri):\n print('Disconnected from %s' % link_uri)", "def _disconnected(self, link_uri):\n\t\tprint \"Disconnected from %s\" % link_uri\n\t\tself.is_connected = False\n\t\t#print results",...
[ "0.60446364", "0.6042768", "0.58036995", "0.5747044", "0.57446784", "0.5615266", "0.56100786", "0.5585868", "0.55768955", "0.55508447", "0.55094993", "0.5495724", "0.5492256", "0.5474273", "0.5455634", "0.5453543", "0.54371685", "0.54321957", "0.5423257", "0.542012", "0.54134...
0.6381469
0
Validates argument against given type
def validate_argtype(arg, argtype): if not isinstance(arg, argtype): raise HelperException('{0} argument must be of type {1}'.format( arg, argtype)) return arg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CheckType(self, *args, **kwargs):\n pass", "def validate(name, args, required, typ):\n value = args.get(name)\n if required and value is None:\n raise errors.Error(\"{0} is required argument\".format(name))\n if value is not None and not isinstance(value, typ):\n raise errors.Er...
[ "0.79782647", "0.74722075", "0.7454573", "0.7397721", "0.7354097", "0.7325152", "0.7325152", "0.729872", "0.72182643", "0.707399", "0.7052788", "0.7052307", "0.70397305", "0.6999008", "0.6959094", "0.6943656", "0.6923142", "0.6888347", "0.6868499", "0.6857573", "0.6843838", ...
0.7716624
1
Returns guest os type for a specific provider
def get_guestos(os_string, os_arch, vm_provider): if "linux" in os_string.lower(): guestos = re.sub(r'\W+', ' ', re.sub(r'\d+', ' ', os_string)).strip() if "windows" in os_string.lower(): guestos = os_string if os_arch == '64': guestos = guestos + "_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vm_os_type(self, name_of_vm):\n # import pdb;pdb.set_trace()\n vm_obj = self.get_dc_object([vim.VirtualMachine], name_of_vm)\n os_type = vm_obj.config.guestFullName\n if \"CentOS\" in os_type:\n ostype = \"Centos\"\n return ostype\n elif \"Windows\" in o...
[ "0.73317045", "0.70313776", "0.69838566", "0.6882896", "0.67288715", "0.6599437", "0.6599437", "0.6384912", "0.63113153", "0.62968147", "0.62921023", "0.62780744", "0.6266455", "0.6231792", "0.62241685", "0.6106686", "0.60462534", "0.60106534", "0.60054153", "0.6003159", "0.5...
0.7188968
1
Get all controls contained in this control and add it to the growing dict. Add all its subcontrols to the dict recursively.
def _add_sub_controls( self, control_handle: ControlHandle, control_dict: Dict[str, ControlHandle], path: List[str] ) -> None: if control_handle.control.controls: group_id = control_handle.group_id group_title = control_handle.group_title group_class = control_han...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_controls(self, recurse: bool) -> Iterator[cat.Control]:\n if self._catalog.groups:\n for group in self._catalog.groups:\n controls = self._get_all_controls_in_group(group, recurse)\n for control in controls:\n yield control\n if ...
[ "0.5645396", "0.5495148", "0.5377387", "0.5162465", "0.5145317", "0.5099428", "0.50987905", "0.5056207", "0.5031219", "0.500833", "0.49493265", "0.4842759", "0.48350194", "0.48203725", "0.4807479", "0.47551566", "0.47224367", "0.47123903", "0.4711428", "0.47084883", "0.467013...
0.6607649
0
Get all control ids in catalog using the dict.
def get_control_ids(self) -> List[str]: return self._control_dict.keys()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _find_needed_control_ids(self) -> List[str]:\n control_ids: List[str] = []\n\n if self._import.include_controls is not None:\n for include_control in self._import.include_controls:\n new_ids = [withid.__root__ for withid in include_control.with_ids]\n ...
[ "0.6119492", "0.5675709", "0.5477195", "0.5417187", "0.5334982", "0.5324302", "0.53073305", "0.53041655", "0.5294698", "0.52786684", "0.5277025", "0.5260893", "0.52149516", "0.5173949", "0.51716167", "0.51547194", "0.5097081", "0.50915194", "0.5081629", "0.50781184", "0.50773...
0.6990758
0
Get control from catalog with this id using the dict.
def get_control(self, control_id: str) -> cat.Control: return self._control_dict[control_id].control
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_control(self, name):\n return self._controls[name]", "def get_control(self, name):\n\n return self._control_manager.get_control(name)", "def getControl( self, cCtrlName ):\n oControl = self.oDialogControl.getControl( cCtrlName )\n return oControl", "def FindControl(self, i...
[ "0.62171334", "0.6028268", "0.6025932", "0.59148675", "0.5725104", "0.56136507", "0.5564806", "0.5564806", "0.5564806", "0.5564806", "0.5494284", "0.5484531", "0.545967", "0.5452883", "0.54250944", "0.5421819", "0.53656626", "0.53423625", "0.5337524", "0.52968746", "0.5291786...
0.77218586
0
Yield all deep and individual controls from the catalog by group.
def get_all_controls(self, recurse: bool) -> Iterator[cat.Control]: if self._catalog.groups: for group in self._catalog.groups: controls = self._get_all_controls_in_group(group, recurse) for control in controls: yield control if self._catal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_all_controls_in_group(self, group: cat.Group, recurse: bool) -> cat.Control:\n controls: List[cat.Control] = []\n if group.controls:\n controls.extend(self._get_all_controls_in_list(group.controls, recurse))\n if recurse and group.groups:\n for group in group.gro...
[ "0.7172115", "0.66161424", "0.5707034", "0.5620608", "0.55688125", "0.5439129", "0.5431825", "0.53241324", "0.53027403", "0.5295067", "0.52657944", "0.5260429", "0.5259462", "0.5242605", "0.5212013", "0.52045536", "0.5193623", "0.5165793", "0.51524025", "0.51002127", "0.50846...
0.7840161
0
Find number of controls in the catalog with or without recursion.
def get_count_of_controls(self, recurse: bool) -> int: return len(list(self.get_all_controls(recurse)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def XPCountChildWidgets(inWidget):\n pass", "def get_control_count(cmd):\n return len(cmd.control_qubits)", "def count(app, status):\n item = app.tv.selection()[0]\n\n def count_children(item):\n children = app.tv.get_children(item)\n return len(children) + sum(count_children(child) for child in ...
[ "0.7143562", "0.6611065", "0.6468455", "0.64363104", "0.64224815", "0.633697", "0.626664", "0.62337494", "0.62282914", "0.61766297", "0.61374253", "0.6120987", "0.60238373", "0.59644246", "0.59617376", "0.5948237", "0.5921669", "0.5918821", "0.58953744", "0.5874844", "0.58711...
0.795239
0
Get the group_id, title, class for this control.
def get_group_info(self, control_id: str) -> Tuple[str, str, str]: return ( self._control_dict[control_id].group_id, self._control_dict[control_id].group_title, self._control_dict[control_id].group_class )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getGroup(self):\n\t\treturn self.Group", "def getId(self):\n return _libsbml.Group_getId(self)", "def get_group(self):\n\t\treturn self.variables.get('group')", "def group(self):\n return self._group", "def group(self):\n return self._group", "def group(self):\n return sel...
[ "0.61664236", "0.59509414", "0.58875346", "0.57557666", "0.57557666", "0.57557666", "0.57512784", "0.57453394", "0.56999004", "0.56967926", "0.56427884", "0.563783", "0.563783", "0.563783", "0.563783", "0.55837876", "0.55290115", "0.55277264", "0.55086", "0.5490321", "0.54730...
0.7177931
0
Replace the control in the control_dict after modifying it.
def replace_control(self, control: cat.Control) -> None: self._control_dict[control.id].control = control
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_key(self, key):\n\t\tif key in self.control_map:\n\t\t\tindex = self.control_map.index(key)\n\t\t\tcurrent_key = self.control_map[self.option_index]\n\t\t\tself.control_map[index] = current_key\n\t\t\tself.control_map[self.option_index] = key\n\t\t\treturn\n\t\tself.control_map[self.option_index] = key", ...
[ "0.5749516", "0.5564914", "0.5427508", "0.5411441", "0.53536874", "0.52528924", "0.52463484", "0.52446675", "0.52330023", "0.5227975", "0.5221352", "0.521432", "0.5213121", "0.51901734", "0.5149288", "0.51374793", "0.51298136", "0.51278216", "0.50966984", "0.50755215", "0.507...
0.7949081
0
Inject the import. This needs to be created prior to knowing the catalog.
def __init__(self, import_: prof.Import) -> None: self._import: prof.Import = import_ self._catalog_interface: Optional[CatalogInterface] = None self._catalog: Optional[cat.Catalog] = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _import(self, _import):\n\n self.__import = _import", "def __init__(self, catalog_path):\n self.catalog_path = catalog_path\n self.load_catalog()\n return", "def __import(self):\n configured_plugins = self.config.get('plugins', {}).copy()\n plugin_module_files = se...
[ "0.663703", "0.58297646", "0.580931", "0.5739323", "0.5673673", "0.56481", "0.55801886", "0.5576389", "0.5571534", "0.5571534", "0.5571534", "0.5571534", "0.5571534", "0.5569463", "0.5569463", "0.5569463", "0.5565817", "0.55463636", "0.5544377", "0.5543167", "0.55271006", "...
0.67995536
0
Set the catalog used by the catalog interface.
def _set_catalog(self, catalog: cat.Catalog) -> None: self._catalog_interface = CatalogInterface(catalog) self._catalog = catalog
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_catalogue(self, catalogue, force_it=False,\n fast_setup=False):\n from .catalogue.basecatalogue import Catalogue\n\n if not fast_setup:\n if self.has_catalogue() and force_it is False:\n raise AttributeError(\"'catalogue' already defined\"+\\\n ...
[ "0.7100417", "0.67884403", "0.6592774", "0.6592774", "0.6592774", "0.6318829", "0.63112867", "0.62464", "0.6233301", "0.6181935", "0.61664826", "0.6144115", "0.6144115", "0.6144115", "0.6144115", "0.6144115", "0.6132684", "0.61115813", "0.6007447", "0.58586174", "0.5847783", ...
0.8427457
0
Find all needed resource refs buried in control links and prose. For any controls retained in the resolved profile catalog, if any prose references a document by uuid, that reference needs to be in backmatter.
def _find_uuid_refs(self, control_id: str) -> Set[str]: control = self._catalog_interface.get_control(control_id) refs = set() if control.links is not None: for link in control.links: uuid_str = link.href.replace('#', '') refs.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def references(self):\n return self._get_related_resources(False)", "def get_resources(genome_build, fasta_ref, data):\n config = tz.get_in([\"config\", CONFIG_KEY], data)\n find_fn = _find_file(config)\n def normalize(f):\n return _get_id_fname(f)[-1]\n return sret.get_resources(genome...
[ "0.5467567", "0.54557467", "0.53928", "0.5303755", "0.5295719", "0.52955604", "0.5292127", "0.5267691", "0.51837915", "0.5162359", "0.51433045", "0.5128463", "0.5095411", "0.5086176", "0.50691277", "0.50627255", "0.50570613", "0.50569123", "0.50560236", "0.5045638", "0.499249...
0.61610556
0
Get list of control_ids needed by profile and corresponding groups.
def _find_needed_control_ids(self) -> List[str]: control_ids: List[str] = [] if self._import.include_controls is not None: for include_control in self._import.include_controls: new_ids = [withid.__root__ for withid in include_control.with_ids] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_control_ids(self) -> List[str]:\n return self._control_dict.keys()", "def controls(self):\n controls = []\n for i in range(len(self.__listReq)):\n if self.__controlsChecks[i].isChecked():\n controls.append(self.__listReq[i].get(\"id\"))\n return contr...
[ "0.65111464", "0.6205672", "0.56549215", "0.5507244", "0.5470839", "0.54281", "0.5301813", "0.52234375", "0.5221042", "0.5160412", "0.5101191", "0.50972325", "0.50923574", "0.5071234", "0.50597775", "0.50597775", "0.5040728", "0.50081456", "0.50081456", "0.4985737", "0.495661...
0.65936506
0
Prune the control based on the Import requirements. This is only called if the control is needed Some or all of its sub_controls may not be needed This always returns the original control, possibly with fewer subcontrols
def _prune_control(self, needed_ids: List[str], control: cat.Control, exclude_ids: List[str]) -> cat.Control: if control.controls is None: return control controls = [] for sub_control in control.controls: if sub_control.id in needed_ids and sub_control...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _prune_catalog(self) -> cat.Catalog:\n if self._import is None:\n return self._catalog\n\n needed_ids = self._find_needed_control_ids()\n\n # if a control includes controls - only include those that we know are needed\n final_control_ids = self._prune_...
[ "0.63285464", "0.568161", "0.5270715", "0.5265441", "0.5265441", "0.5265441", "0.5265441", "0.5085185", "0.5010219", "0.497952", "0.48801407", "0.48642635", "0.48113653", "0.47955292", "0.47868145", "0.47193998", "0.47082824", "0.46674186", "0.46500045", "0.4609581", "0.45989...
0.7149228
0
Prune the controls in the current catalog.
def _prune_catalog(self) -> cat.Catalog: if self._import is None: return self._catalog needed_ids = self._find_needed_control_ids() # if a control includes controls - only include those that we know are needed final_control_ids = self._prune_controls(nee...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _prune_control(self, needed_ids: List[str], control: cat.Control, exclude_ids: List[str]) -> cat.Control:\n if control.controls is None:\n return control\n controls = []\n for sub_control in control.controls:\n if sub_control.id in needed_ids and s...
[ "0.6599031", "0.65622777", "0.6243705", "0.62220794", "0.6076706", "0.60618687", "0.60584754", "0.60503435", "0.60245204", "0.6016483", "0.5983604", "0.5983604", "0.5983604", "0.5983604", "0.5980995", "0.58911234", "0.5850857", "0.58483833", "0.58468825", "0.5840119", "0.5791...
0.7041311
0
Prune the catalog based on the include rule in the import_. This only processes the one catalog yielded by the one import in this pipeline. It must yield in order to have the merge filter loop over available imported catalogs.
def process(self, catalog_iter: Iterator[cat.Catalog]) -> Iterator[cat.Catalog]: self._set_catalog(next(catalog_iter)) logger.debug(f'prune yielding catalog {self._catalog.metadata.title} with import {self._import.href}') yield self._prune_catalog()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _prune_catalog(self) -> cat.Catalog:\n if self._import is None:\n return self._catalog\n\n needed_ids = self._find_needed_control_ids()\n\n # if a control includes controls - only include those that we know are needed\n final_control_ids = self._prune_...
[ "0.625806", "0.61039066", "0.5189842", "0.5188882", "0.5045572", "0.5042427", "0.48675874", "0.47349843", "0.47209686", "0.47051436", "0.4676265", "0.46759972", "0.4642102", "0.4616021", "0.45954648", "0.45952064", "0.45509824", "0.45377216", "0.45216984", "0.45113653", "0.44...
0.7665973
0
Merge the incoming catalogs. This pulls from import and iterates over the incoming catalogs.
def process(self, pipelines: List[Pipeline]) -> Iterator[cat.Catalog]: merged: Optional[cat.Catalog] = None logger.debug(f'merge entering process with {len(pipelines)} pipelines') for pipeline in pipelines: catalog = next(pipeline.process(None)) merged...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def catalog_merge(self, catalog_cols=None):\n\n for cluster_info in self._catalog_dictionary.values():\n # Array element names\n catalog_idx = cluster_info['SPT_cat_idx']\n se_catalog = cluster_info['catalog']\n\n # Replace the existing SPT_ID in the SExtractor ca...
[ "0.70970803", "0.6216753", "0.6114086", "0.5939889", "0.59378207", "0.5812817", "0.57407904", "0.57098347", "0.537831", "0.5290929", "0.52903414", "0.5280879", "0.5265774", "0.5251718", "0.5245338", "0.5241884", "0.5237249", "0.52246374", "0.5214528", "0.5214528", "0.51989126...
0.62853765
1
Replace params in control prose with assignments for this control from profile or description info.
def _replace_params(self, text: str, control: cat.Control, param_dict: Dict[str, prof.SetParameter]) -> str: if control.params is not None: for param in control.params: # set default if no information available for text param_text = f'[{param.id} = no ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _replace_part_prose(\n self, control: cat.Control, part: common.Part, param_dict: Dict[str, prof.SetParameter]\n ) -> None:\n if part.prose is not None:\n fixed_prose = self._replace_params(part.prose, control, param_dict)\n # change the prose in the c...
[ "0.62454313", "0.59905773", "0.58929527", "0.5868368", "0.5747363", "0.5733021", "0.5694161", "0.5557375", "0.5521314", "0.5497367", "0.5486742", "0.54791397", "0.5475574", "0.5471737", "0.54653776", "0.54560345", "0.5425502", "0.54036605", "0.5371571", "0.53479147", "0.53412...
0.62967527
0
Find part in control and add to end of its list of parts. Update the control with the new parts otherwise error.
def _add_to_parts(self, control: cat.Control, id_: str, new_parts: List[common.Part]) -> None: for part in control.parts: if self._add_to_part(part, id_, new_parts): return True raise TrestleError(f'Unable to add parts for control {control.id} and part {id_}')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_parts(self, parts):\r\n self.board.insert_parts(parts)\r\n self.set_changed(parts)", "def add_part(self, part: dict, part_index: int) -> bool:\n\n if 'var' in part and self.pdf:\n part['text'] = str(self.pdf.context.get(part['var'], ''))\n\n words = part.get('tex...
[ "0.62499577", "0.59578145", "0.58590984", "0.5846495", "0.5685902", "0.55897236", "0.55784607", "0.5573609", "0.5350638", "0.53003", "0.5275361", "0.5239615", "0.5175999", "0.51183426", "0.5102686", "0.5068479", "0.5031264", "0.49884614", "0.4970463", "0.4953555", "0.49500462...
0.7302594
0
Load href for catalog or profile and yield each import as catalog imported by its distinct pipeline.
def process(self, input_=None) -> Iterator[cat.Catalog]: logger.debug(f'import entering process with href {self._import.href}') fetcher = cache.FetcherFactory.get_fetcher(self._trestle_root, self._import.href) model: Union[cat.Catalog, prof.Profile] model, model_type = f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process(self, catalog_iter: Iterator[cat.Catalog]) -> Iterator[cat.Catalog]:\n self._set_catalog(next(catalog_iter))\n logger.debug(f'prune yielding catalog {self._catalog.metadata.title} with import {self._import.href}')\n yield self._prune_catalog()", "def loadData(catalog)...
[ "0.5998951", "0.5905578", "0.58866274", "0.58866274", "0.58410424", "0.56630933", "0.5611932", "0.55231863", "0.5430306", "0.53453606", "0.5317062", "0.53026164", "0.5293516", "0.5279693", "0.52618074", "0.5258692", "0.51757324", "0.51510066", "0.5126339", "0.5124154", "0.512...
0.71030253
0
Create the resolved profile catalog given a profile path.
def get_resolved_profile_catalog(trestle_root: pathlib.Path, profile_path: pathlib.Path) -> cat.Catalog: logger.debug(f'get resolved profile catalog for {profile_path} via generated Import.') import_ = prof.Import(href=str(profile_path), include_all={}) import_filter = ProfileResolver.Import(tre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_profile(path, profile):\n profiles = load(path)\n try:\n return profiles[profile]\n except KeyError:\n return Profile(None, None, None, None)", "def get_profile(path=\"~\"):\n global profiles\n profile = profiles.get(path,None)\n if not profile:\n profile = InitFil...
[ "0.60971934", "0.6013556", "0.5995636", "0.5669014", "0.5664221", "0.5657426", "0.5600377", "0.55014", "0.5465162", "0.54474545", "0.53909516", "0.52316076", "0.52079433", "0.51845765", "0.5096629", "0.50827086", "0.50703496", "0.50089043", "0.50043905", "0.49665424", "0.4951...
0.7289553
0
First layer of type casting, used for highlevel verification.
def cast(self, value): if value is None: return None return self.type(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bitcast(self, typ):", "def _convertType(self, s):\n for func in (int, float):\n try:\n n = func(s)\n return n\n except:\n pass\n return s", "def _cast(d):\n if d[u\"type\"] in (u\"uri\", u\"bnode\", u\"literal\"):\n ...
[ "0.6999387", "0.67327386", "0.6675718", "0.66675943", "0.6626092", "0.65725845", "0.6534224", "0.6497217", "0.6437756", "0.6357361", "0.627856", "0.620702", "0.6197481", "0.61872745", "0.61385524", "0.6116015", "0.611323", "0.6077621", "0.6074536", "0.60444754", "0.6027428", ...
0.67854315
1
Returns the SNIDs, Age dataframe, and HR dataframe. A row in these dataframes correspond to one supernovae by its SNID.
def get_data(dataset, **kwargs): age_df = load_age_sample_from_mcmc_chains(dataset, **kwargs) hr_df = load_hr() age_df, hr_df = clean_data(age_df, hr_df) snids = age_df.index.unique().tolist() return snids, age_df, hr_df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_row2id( self, ratios_standardized, db ):\n\t\trow_info_collection = db.row_info\n\t\trow_name = []\n\t\trow_id = []\n\t\tfor i in row_info_collection.find():\n\t\t\trow_name.append( i[\"egrin2_row_name\"] )\n\t\t\trow_id.append( i[\"row_id\"] )\n\t\tfor i in ratios_standardized.index.values:\n\t\t\tif i no...
[ "0.5691195", "0.5628427", "0.55188334", "0.5444816", "0.54374135", "0.54314715", "0.53831553", "0.5299445", "0.5296162", "0.52598184", "0.525014", "0.5205775", "0.51578707", "0.51546997", "0.51521987", "0.51385283", "0.512588", "0.5111653", "0.50899905", "0.5083103", "0.50585...
0.5629062
1
sets the test namespace global for use in later functions
def set_test_namespace_value(namespace_name=None): global namespace_value namespace_value = namespace_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testInit(self):\n self.globalInit()\n self.test.start()", "def setUpModule():\n # pull in test environment as dict\n global TestEnv\n get_test_env(TestEnv)", "def setUpModule():\n # pull in test environment as dict\n global TestEnv\n get_test_env(TestEnv)", "def test_globa...
[ "0.6924791", "0.6603024", "0.6603024", "0.65853864", "0.6527247", "0.649926", "0.64096636", "0.63872683", "0.6312113", "0.62401766", "0.6216041", "0.6199831", "0.61963385", "0.6178875", "0.6172291", "0.616148", "0.6143175", "0.61373353", "0.612797", "0.6127405", "0.61009973",...
0.72230214
0
sets the keep_objects global for use in later functions
def set_keep_objects(keep_object): global keep_objects keep_objects = keep_object
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_objects():\n Base.__nb_objects = 0", "def keep_widgets(self,builder,widgets):\n keep = {}\n for widget in widgets:\n w = builder.get_object(widget)\n if w != 0: keep[widget] = w\n return keep", "def retainAll(self, *args):\n pass", "def make_...
[ "0.6158091", "0.5727481", "0.56317127", "0.5631198", "0.55661726", "0.5483998", "0.54772204", "0.54171336", "0.540118", "0.5335823", "0.5333657", "0.5313181", "0.5254294", "0.52515507", "0.5238748", "0.52149487", "0.5191622", "0.5181629", "0.5179051", "0.51688784", "0.5154617...
0.9230585
0
checks pod deleted or not , if not deleted , asserts
def check_pod_deleted(pod_name, created_objects): if keep_objects: return count = 12 api_instance = client.CoreV1Api() while (count > 0): try: api_response = api_instance.read_namespaced_pod( name=pod_name, namespace=namespace_value, pretty=True) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_vs_deleted(vs_name, created_objects):\r\n if keep_objects:\r\n return\r\n api_instance = client.CustomObjectsApi()\r\n val = 0\r\n while val < 12:\r\n try:\r\n api_response = api_instance.get_namespaced_custom_object(\r\n group=\"snapshot.storage.k8s.io...
[ "0.68168294", "0.66414994", "0.6565671", "0.6208202", "0.6132542", "0.60385877", "0.6030623", "0.6030623", "0.6027307", "0.601821", "0.59995455", "0.5893159", "0.58914894", "0.58879834", "0.5884133", "0.586102", "0.58529335", "0.5835894", "0.5819889", "0.58155376", "0.5809306...
0.7572274
0
deletes pvc pvc_name and return name of pv associated with it
def delete_pvc(pvc_name, created_objects): api_instance = client.CoreV1Api() try: api_response = api_instance.read_namespaced_persistent_volume_claim( name=pvc_name, namespace=namespace_value, pretty=True) LOGGER.debug(str(api_response)) except ApiException as e: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_pv(self, alias):\n if alias in self._epics_aliases:\n self._epics_aliases.pop(alias)\n try:\n det = alias.split('_')[0]\n attr = '_'.join(alias.split('_')[1:])\n self._device_sets[det]['pvs'].pop(attr)\n except:\n print 'No attr...
[ "0.6165015", "0.59400624", "0.5815077", "0.5763461", "0.56999123", "0.56542313", "0.559824", "0.5461889", "0.54552287", "0.5451767", "0.54504305", "0.54259175", "0.53963333", "0.53824115", "0.5304591", "0.5258171", "0.5211747", "0.5199865", "0.51921874", "0.51487386", "0.5147...
0.73431116
0
check pvc deleted or not , if not deleted , asserts
def check_pvc_deleted(pvc_name, volume_name, created_objects): if keep_objects: return count = 12 api_instance = client.CoreV1Api() while (count > 0): try: api_response = api_instance.read_namespaced_persistent_volume_claim( name=pvc_name, namespace=na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_pv_deleted(pv_name, created_objects):\r\n if keep_objects:\r\n return\r\n count = 12\r\n api_instance = client.CoreV1Api()\r\n while (count > 0):\r\n try:\r\n api_response = api_instance.read_persistent_volume(\r\n name=pv_name, pretty=True)\r\n ...
[ "0.66273063", "0.6615816", "0.6484457", "0.6286511", "0.6206349", "0.6184521", "0.6165736", "0.6162748", "0.6143568", "0.61405176", "0.6129468", "0.61188173", "0.60912496", "0.6082717", "0.60745144", "0.60600615", "0.6043073", "0.60288286", "0.602766", "0.6018986", "0.6012165...
0.7160483
0
checks pv is deleted or not , if not deleted ,asserts
def check_pv_deleted(pv_name, created_objects): if keep_objects: return count = 12 api_instance = client.CoreV1Api() while (count > 0): try: api_response = api_instance.read_persistent_volume( name=pv_name, pretty=True) LOGGER.debug(str(ap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_pvc_deleted(pvc_name, volume_name, created_objects):\r\n if keep_objects:\r\n return\r\n count = 12\r\n api_instance = client.CoreV1Api()\r\n while (count > 0):\r\n try:\r\n api_response = api_instance.read_namespaced_persistent_volume_claim(\r\n name=p...
[ "0.7347805", "0.67691976", "0.6591813", "0.6366553", "0.62933725", "0.62887233", "0.6217295", "0.6171698", "0.6129695", "0.61272365", "0.6087331", "0.60627997", "0.60588616", "0.60490024", "0.6029791", "0.6024642", "0.59743387", "0.5967891", "0.5951128", "0.59498787", "0.5948...
0.7464166
0
deletes storage class sc_name
def delete_storage_class(sc_name, created_objects): if sc_name == "" or keep_objects: return api_instance = client.StorageV1Api() try: LOGGER.info(f'SC Delete : deleting storage class {sc_name}') api_response = api_instance.delete_storage_class( name=sc_name, prett...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_destroy(self, arg):\n args = shlex.split(arg)\n if len(args) == 0:\n print(\"** class name missing **\")\n elif args[0] in class_type:\n if len(args) > 1:\n key = args[0] + \".\" + args[1]\n if key in models.storage.all():\n ...
[ "0.6728857", "0.6685568", "0.66681266", "0.663112", "0.6558662", "0.6518771", "0.6505384", "0.64653516", "0.6425802", "0.64257485", "0.6394601", "0.63802254", "0.63780487", "0.63762534", "0.6302098", "0.6261433", "0.62451506", "0.6180087", "0.6170602", "0.6135828", "0.6069715...
0.75160414
0
checks storage class sc_name deleted if sc not deleted , asserts
def check_storage_class_deleted(sc_name, created_objects): if sc_name == "" or keep_objects: return count = 12 api_instance = client.StorageV1Api() while (count > 0): try: api_response = api_instance.read_storage_class( name=sc_name, pretty=True) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_vs_class_deleted(vs_class_name, created_objects):\r\n if keep_objects:\r\n return\r\n api_instance = client.CustomObjectsApi()\r\n try:\r\n api_response = api_instance.get_cluster_custom_object(\r\n group=\"snapshot.storage.k8s.io\",\r\n version=\"v1\",\r\n ...
[ "0.7053851", "0.69061875", "0.6381389", "0.6170407", "0.6118836", "0.6112457", "0.60948175", "0.59683686", "0.5949317", "0.5920593", "0.5907477", "0.58933944", "0.58574504", "0.5850628", "0.58348876", "0.5788118", "0.5775473", "0.5720254", "0.5710589", "0.57028604", "0.569836...
0.7753483
0
deletes volume snapshot content vs_content_name
def delete_vs_content(vs_content_name, created_objects): if keep_objects: return custom_object_api_instance = client.CustomObjectsApi() try: custom_object_api_response = custom_object_api_instance.delete_cluster_custom_object( group="snapshot.storage.k8s.io", v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cli(env, snapshot_id):\n block_manager = SoftLayer.BlockStorageManager(env.client)\n deleted = block_manager.delete_snapshot(snapshot_id)\n\n if deleted:\n click.echo('Snapshot %s deleted' % snapshot_id)", "def delete_volume_snapshot(volume_snapshots):\n if type(volume_snapshots) is not li...
[ "0.68803614", "0.68212515", "0.679364", "0.67065024", "0.6655276", "0.6645816", "0.64384913", "0.64168566", "0.63954246", "0.6388806", "0.6320766", "0.6302202", "0.62918943", "0.62222826", "0.62197036", "0.62076575", "0.6192066", "0.6158397", "0.6095378", "0.60721195", "0.605...
0.69181675
0
deletes volume snapshot class vs_class_name
def delete_vs_class(vs_class_name, created_objects): if keep_objects: return custom_object_api_instance = client.CustomObjectsApi() try: custom_object_api_response = custom_object_api_instance.delete_cluster_custom_object( group="snapshot.storage.k8s.io", versi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_vs_class_deleted(vs_class_name, created_objects):\r\n if keep_objects:\r\n return\r\n api_instance = client.CustomObjectsApi()\r\n try:\r\n api_response = api_instance.get_cluster_custom_object(\r\n group=\"snapshot.storage.k8s.io\",\r\n version=\"v1\",\r\n ...
[ "0.6574109", "0.6507379", "0.6494434", "0.64595103", "0.6436339", "0.6395233", "0.6374625", "0.63596994", "0.6347549", "0.6341895", "0.6298921", "0.6268575", "0.62474287", "0.6236818", "0.62319326", "0.6199168", "0.61134535", "0.60844445", "0.6077592", "0.6051543", "0.6033271...
0.6970644
0
if volume snapshot class vs_class_name exists , assert
def check_vs_class_deleted(vs_class_name, created_objects): if keep_objects: return api_instance = client.CustomObjectsApi() try: api_response = api_instance.get_cluster_custom_object( group="snapshot.storage.k8s.io", version="v1", plural="volumesn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_volume_from_snapshot(self, mock_ghn):\n ctxt = context.get_admin_context()\n extra_specs = {}\n type_ref = volume_types.create(ctxt, 'hgst-1', extra_specs)\n snap = {'id': '1', 'name': 'volume1', 'display_name': '',\n 'volume_type_id': type_ref['id'], 'siz...
[ "0.60645586", "0.58958817", "0.58827144", "0.58808565", "0.5827973", "0.5765803", "0.5706305", "0.56821835", "0.56747925", "0.56470335", "0.5607881", "0.5602749", "0.5578585", "0.5574391", "0.557205", "0.55242616", "0.5510379", "0.5506996", "0.55049115", "0.545509", "0.543712...
0.6335318
0
Parsing database credentials to needed format
def parse_database_credentials(db_credentials): # # Distinguish between database config scheme of TYPO3 v8+ and TYPO3 v7- # if 'Connections' in db_credentials: _db_config = db_credentials['Connections']['Default'] _db_config['name'] = _db_config['dbname'] else: _db_config = d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _db_credentials(self):\n if self.password == \"\" or self.password == \"RUNTIME\":\n sys.stdout.write(PROMPT + \"Database password: \")\n sys.stdout.flush()\n self.password = getpass.getpass()\n elif self.password == \"ENV\":\n self.password = os.enviro...
[ "0.75976384", "0.631561", "0.6220293", "0.6195453", "0.6142266", "0.6123136", "0.610827", "0.6084008", "0.5961907", "0.5943947", "0.592665", "0.59165317", "0.5908896", "0.58995587", "0.58960736", "0.5892361", "0.58775276", "0.5873535", "0.58262646", "0.5815838", "0.57420766",...
0.72195506
1
Attempt to put all Apple official keys first.
def _apple_keys_first(items): key, val = items if key[0:2] is 'AP': return -13 if key[0:3] is 'ATS': return -12 if key == 'BuildMachineOSBuild': return -11 if key[0:2] is 'CF': return -10 if key[0:2] is 'CS': return -9 if key[0:2] is 'DT': retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __initialSigningKeys(self) -> None:\n seedStr = '0' * 31\n seedNum = ['1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']\n seedList = []\n for i in range(15):\n seed = seedStr + seedNum[i]\n seedList.append(seed.encode('utf-8'))\n\n ...
[ "0.56613433", "0.5612051", "0.55367976", "0.5497009", "0.54807544", "0.5412693", "0.54015905", "0.5356598", "0.53285116", "0.5321853", "0.5293622", "0.52864796", "0.5272871", "0.5233482", "0.52306044", "0.5226496", "0.52133894", "0.5198342", "0.51901215", "0.51886606", "0.516...
0.5738211
0
Open IPA file. Primary difference from ZipFile is that allowZip64 is set to True by default because many IPA files are larger than 2 GiB in file size.
def __init__(self, file, strict=False, mode='r', compression=ZIP_STORED, allowZip64=True): ZipFile.__init__(self, file, mode=mode, compression=compressi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_zip_file(self, filepath: str, mode=\"r\"):\n with ZipFile(self.zipped_code_path, \"r\") as z:\n return z.open(filepath, mode=mode)", "def zip_open_bin(zip, filename):\n if isinstance(zip, FakeZip):\n return zip.open(filename, 'rb')\n else:\n return zip.open(filename...
[ "0.634743", "0.57324374", "0.5612069", "0.54777706", "0.5407367", "0.5355133", "0.5299801", "0.5254633", "0.5188579", "0.51855814", "0.5138405", "0.51040757", "0.509063", "0.5084179", "0.50540304", "0.5048299", "0.5025194", "0.50244355", "0.5022473", "0.49980626", "0.49959952...
0.6130578
1
Find application's Info.plist and read it
def _get_app_info(self): info_plist = None for data in self.filelist: if re.match(self.info_plist_regex, data.filename): info_plist = data if not info_plist: self._raise_ipa_error() info_plist = self.read(info_plist) self.app_info = read...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_appdata():\n try:\n with FNAME.open() as _in:\n appdata = json.load(_in)\n except FileNotFoundError:\n return None\n return appdata", "def _fetch_app_info(app_id):\n try:\n assert len(app_id), \"Empty string\"\n lookup_url = \"https://itunes...
[ "0.67179626", "0.61157334", "0.6103222", "0.6021488", "0.59885883", "0.58451647", "0.5811156", "0.5763978", "0.5756686", "0.57552415", "0.5709742", "0.5630683", "0.56235945", "0.560948", "0.55377525", "0.54912055", "0.54805106", "0.54598397", "0.54539883", "0.5452242", "0.543...
0.7715055
0
Returns an approximate name of the IPA that iTunes would use when saving which is normally 'Application Name .ipa'.
def get_ipa_filename(self): try: return '%s %s.ipa' % ( self.get_app_name(), self.get_app_version(), ) except InvalidUnicodeApplicationNameError as e: self._logger.exception(e.msg) raise e raise UnknownApplicationN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getApplicationName(self) -> unicode:\n ...", "def app_name(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"app_name\")", "def anki(self) -> str:\n\n return self._get_via_app_bundle(path=\"/Applications/Anki.app\")", "def getApplicationReleaseName(self) -> unicode:\...
[ "0.5843728", "0.58028364", "0.57906556", "0.5777311", "0.5741903", "0.5741903", "0.56863403", "0.56653583", "0.5662619", "0.5645728", "0.5642729", "0.5640791", "0.5603106", "0.5548777", "0.5462954", "0.5452229", "0.54243374", "0.5380484", "0.5348016", "0.53463477", "0.5337898...
0.77516603
0
If the letter is in the secret word prints it in the correct position.
def show_hidden_word(secret_word, old_letters_guessed): print("\n") for letter in secret_word: if letter in old_letters_guessed: print(letter, end=' ') else: print('_', end=' ') return ' '
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display(missed_letters, correct_letters, secret_word):\n print(HANGMAN[len(missed_letters)])\n print()\n\n print('Missed letters:', end=' ')\n for letter in missed_letters:\n print(letter, end=' ')\n print()\n\n dashed_entry = ''\n\n for letter in secret_word:\n if letter == ...
[ "0.7285525", "0.7067564", "0.6935278", "0.68814844", "0.68651193", "0.6820002", "0.68115413", "0.67366827", "0.66891754", "0.66427976", "0.66192865", "0.65829724", "0.6569394", "0.65418607", "0.6518432", "0.6507135", "0.63947606", "0.63939655", "0.6388927", "0.6380534", "0.63...
0.75778306
0
generate corpus This function is used to create input of deep learning model Arguments
def generate_corpus(model, sample): dl_corpus = [] for word in sample: if word in model: dl_corpus.append(model[word]) else: dl_corpus.append([0]*VECTOR_DIM) return [dl_corpus]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_corpus():\n data = load_data()\n questions = [s.split(' ', 1)[1].lower() for s in data]\n return questions", "def build_corpus(self):\n print(\"Inside the build_corpus >>>>>\")\n documentsCount = 0\n documents = self.documents\n\t\t\n with open(self.documents_pat...
[ "0.7096986", "0.6744231", "0.6657487", "0.656679", "0.6518628", "0.64930314", "0.63936275", "0.6364378", "0.63405114", "0.63018423", "0.6300629", "0.6296021", "0.62681836", "0.62679356", "0.62213224", "0.62194496", "0.616336", "0.61481124", "0.61370206", "0.6135367", "0.61319...
0.7067189
1
cut data to maxlen This function is used to cut the slice or fill slice to maxlen Arguments
def cutdata(data, maxlen=MAXLEN, vector_dim=VECTOR_DIM): if maxlen: fill_0 = [0]*vector_dim if len(data) > 900: pass if len(data) <= maxlen: data = data + [fill_0] * (maxlen - len(data)) else: data = data[:maxlen] return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cut(self, max_lenght):\n self.V_estimates = self.V_estimates[:max_lenght]\n super().cut(max_lenght)", "def cut(self, array_obj):\n\n pass", "def __cut_arrays(data_array, maximum_time, arrays_to_cut):\n\n try:\n begin_time = data_array[arrays_to_cut[0]][0][0]\n...
[ "0.69645226", "0.6380795", "0.6361436", "0.6165514", "0.6066353", "0.5983795", "0.5856151", "0.582722", "0.58188987", "0.58142203", "0.5787195", "0.57533133", "0.5711839", "0.5702828", "0.56828594", "0.5668816", "0.5667397", "0.56552017", "0.5646507", "0.5644308", "0.56366247...
0.7444487
0
Propiedad de solo lectura que indica si el producto tiene stock para ser consumido por la reserva.
def hay_stock(self): return self.producto.stock_disponible >= 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stock_disponible(self):\n return self.stock - self.stock_reservado", "def is_in_stock(res_obj):\n selector = '#app > div.page-content > div.page-section > div > div > div.row-side > div.product-buy-box > div.product-flag > div > div > span'\n stock = res_obj.html.find(selector, first=True)\n\n ...
[ "0.7311599", "0.7207841", "0.70004326", "0.6752325", "0.66861576", "0.6673252", "0.6652762", "0.653829", "0.65088886", "0.6504993", "0.6481467", "0.6424982", "0.64123183", "0.63985544", "0.6398378", "0.63849753", "0.6363021", "0.63072646", "0.62533003", "0.6229322", "0.614256...
0.7610899
0
return True if status has a picture
def picture(result): media = result.entities.get('media') if media: return media[0].get('type') == u'photo' return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hasImage(self):\n if self.getImage():\n return True\n return False", "def has_picture(self):\n try:\n first = self.picture_planets()[0]\n except IndexError:\n first = None\n\n return first is not None", "def hasImage(self):\n return...
[ "0.722153", "0.7204437", "0.7086966", "0.70314354", "0.68476355", "0.6724479", "0.6715362", "0.6715362", "0.66871727", "0.66793394", "0.6676723", "0.66620064", "0.66517615", "0.664941", "0.6530739", "0.63559383", "0.6317477", "0.63152367", "0.63075036", "0.6249932", "0.622483...
0.7326019
0
search @ char for user mentions
def mention(result): return result.text.find('@') != -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_mention(tweet):\n\n pattern = r'^\\@[\\w\\d]+'\n return re.match(pattern, tweet)", "def filter_mentions(text):\n return re.sub(\"@\\S+\", \"\", text)", "def _restricted_search_mentions(val: str):\n try:\n val = str(val)\n except ValueError:\n raise argparse.ArgumentTypeErro...
[ "0.7072813", "0.69735146", "0.69198877", "0.6908199", "0.67648053", "0.67648053", "0.66494936", "0.6446541", "0.62945586", "0.6096585", "0.60494727", "0.6008523", "0.5931639", "0.5913022", "0.59090483", "0.58925194", "0.587658", "0.581112", "0.57371074", "0.57244647", "0.5678...
0.76028746
0
True if bracket count in text is 2
def brackets(result): return len(re.findall(r'"', result.text)) == 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _has_matched_brackets(text: str) -> bool:\n open_bracket_stack = []\n for index, _ in enumerate(text):\n if text[index] == \"[\":\n open_bracket_stack.append(index)\n elif text[index] == \"]\":\n if len(open_bracket_stack) == 0:\n return False\n ...
[ "0.715472", "0.68835855", "0.6874373", "0.6598982", "0.6571248", "0.653682", "0.6459625", "0.62567043", "0.62460405", "0.61277026", "0.6061218", "0.60503346", "0.5986428", "0.597946", "0.5959481", "0.593776", "0.5921036", "0.5920932", "0.59190124", "0.587785", "0.58514744", ...
0.7051151
1
Initializes a serialized event heap.
def __init__(self): super(_SerializedEventHeap, self).__init__() self._heap = [] self.data_size = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.stream_data_left = []\n heapq.heapify(self.stream_data_left)\n self.stream_data_right = []\n heapq.heapify(self.stream_data_right)", "def _InitializeEventHeap(self, time_range=None):\n self._event_heap = event_heaps.SerializedStreamEventHeap()\n\n numb...
[ "0.68938994", "0.6812462", "0.6677611", "0.6672684", "0.6659267", "0.65865517", "0.65813476", "0.65813476", "0.65813476", "0.6547604", "0.6460407", "0.6431932", "0.6398224", "0.6301136", "0.6287932", "0.6271902", "0.62198323", "0.62175816", "0.6212812", "0.620229", "0.6180889...
0.8552741
0
Initializes a serialized data stream.
def __init__( self, zip_file, temporary_path, stream_name, maximum_data_size=DEFAULT_MAXIMUM_DATA_SIZE, decompress_stream=True): super(_SerializedDataStream, self).__init__() self._entry_index = 0 self._file_object = None self._maximum_data_size = maximum_data_size self._decompress_strea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__( self, stream=None ):\n if stream is not None:\n self.stream = stream\n else:\n self.stream = StringIO()", "def __init__(self, stream):\n self.stream = stream", "def __init__(self, stream):\n self.stream = stream", "def __init__ (self, stream):\n...
[ "0.7183223", "0.6913196", "0.6913196", "0.6753824", "0.6579977", "0.6574551", "0.6514283", "0.6504524", "0.6458105", "0.63594294", "0.6347698", "0.6344044", "0.6321155", "0.62140095", "0.6201924", "0.6186983", "0.6163226", "0.612205", "0.60847723", "0.6037762", "0.6024514", ...
0.71561664
1
Opens the filelike object (instance of ZipExtFile).
def _OpenFileObject(self): try: if self._decompress_stream: self._zip_file.extract(self.name, self._temporary_path) else: self._file_object = self._zip_file.open(self.name, mode=b'r') return except KeyError as exception: raise IOError( 'Unable to open stream ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _open_zip(self):\n self.buffer = io.BytesIO()\n self.zf = zipfile.ZipFile(self.buffer, \"w\", zipfile.ZIP_DEFLATED)", "def _open_zipped(infile, mode='r', encoding='utf-8'):\n mode = mode[0] + 't'\n p2mode = mode\n if hasattr(infile, 'write'):\n return infile\n if isinstance...
[ "0.7205411", "0.7101709", "0.7023907", "0.70126736", "0.6914555", "0.67356014", "0.66970074", "0.66926026", "0.6613657", "0.65974003", "0.6559495", "0.65361804", "0.6450884", "0.64338094", "0.6407767", "0.63898945", "0.6385412", "0.6370592", "0.6363616", "0.6361729", "0.63377...
0.73068607
0
Reads an entry from the data stream.
def ReadEntry(self): if not self._file_object: self._OpenFileObject() data = self._file_object.read(self._DATA_ENTRY_SIZE) if not data: return try: data_entry = self._DATA_ENTRY.parse(data) except construct.FieldError as exception: raise IOError('Unable to read data entry w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Read(self):\n try:\n file_object = self._zip_file.open(self._stream_name, mode='r')\n except KeyError as exception:\n raise IOError(\n 'Unable to open stream with error: {0!s}'.format(exception))\n\n try:\n entry_data = file_object.read(self._TABLE_ENTRY_SIZE)\n while entr...
[ "0.64168674", "0.6345427", "0.59985125", "0.59181124", "0.59150994", "0.5898489", "0.58875453", "0.58856255", "0.58434165", "0.5760164", "0.57452285", "0.56546444", "0.5610597", "0.55970037", "0.5562838", "0.5547295", "0.552963", "0.55282795", "0.55150545", "0.55073416", "0.5...
0.79684174
0
Reopens the filelike object (instance of ZipExtFile).
def _ReopenFileObject(self): if self._file_object: self._file_object.close() self._file_object = None self._file_object = self._zip_file.open(self.name, mode='r') self._stream_offset = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reopen(self):\n self.close()\n self._fileobj = os.fdopen(os.open(str(self.path), os.O_CREAT | os.O_RDWR, 384), \"r+b\", 0)", "def reopen(self):\n self.close()\n self._fileobj = os.fdopen(\n os.open(str(self.path), os.O_CREAT | os.O_RDWR, 384), \"r+b\", 0\n )", ...
[ "0.73943824", "0.7345604", "0.7145357", "0.6861904", "0.67547745", "0.65311426", "0.63498193", "0.631852", "0.62467784", "0.6149679", "0.6097134", "0.6088887", "0.60876817", "0.60643053", "0.60005873", "0.59989965", "0.59843016", "0.59585303", "0.5952478", "0.5937588", "0.593...
0.8158042
0
Seeks a specific serialized data stream entry at a specific offset.
def SeekEntryAtOffset(self, entry_index, stream_offset): if not self._file_object: self._OpenFileObject() if self._decompress_stream: self._file_object.seek(stream_offset, os.SEEK_SET) else: if stream_offset < self._stream_offset: # Since zipfile.ZipExtFile is not seekable we nee...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seek(self, offset):\n if isinstance(offset, Time):\n offset = offset-self.time0\n elif isinstance(offset, str):\n offset = Time(offset, scale='utc') - self.time0\n\n try:\n offset = offset.to(self.dtsample.unit)\n except AttributeError:\n ...
[ "0.5513751", "0.5395265", "0.53952044", "0.5347776", "0.53257066", "0.53231096", "0.50847775", "0.50534725", "0.5049208", "0.5021871", "0.50083715", "0.48997012", "0.4896484", "0.4875344", "0.48671323", "0.48438704", "0.48148265", "0.47981694", "0.47570845", "0.47423187", "0....
0.67581886
0
Aborts the write of a serialized data stream.
def WriteAbort(self): if self._file_object: self._file_object.close() self._file_object = None if os.path.exists(self.name): os.remove(self.name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rollback(self):\n self.stream.seek(0)", "def abort(self):\n\n _check_init()\n if self._output:\n self._output.Abort()\n self._aborted = 1", "def abort(self) -> None:\n self._connector.abort_transaction()", "def end_serialization(self):\n pass", "def ...
[ "0.6325627", "0.61664176", "0.6115", "0.5960699", "0.59339565", "0.588716", "0.5869422", "0.5782328", "0.57361615", "0.5692674", "0.56703615", "0.5613142", "0.56123453", "0.560849", "0.55992156", "0.55673486", "0.5517396", "0.55074495", "0.5455442", "0.5442185", "0.54101914",...
0.63831586
0
Writes an entry to the filelike object.
def WriteEntry(self, data): if not self._file_object: raise IOError('Unable to write to closed serialized data stream.') data_size = len(data) # TODO: Fix maximum size limit handling to create new stream. # data_end_offset = ( # self._file_object.tell() + self._DATA_ENTRY_SIZE + data_size)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_to_file(entry, file):\n with open(file, \"a\") as f:\n f.write(entry)", "def _WriteFileEntry(self, file_entry, data_stream_name, destination_file):\n source_file_object = file_entry.GetFileObject(\n data_stream_name=data_stream_name)\n if not source_file_object:\n return\n\n...
[ "0.77868", "0.64352447", "0.6354288", "0.6344341", "0.62293386", "0.61865014", "0.61611825", "0.6051833", "0.5985296", "0.5983426", "0.5975988", "0.5964976", "0.5957163", "0.5953578", "0.59184694", "0.591397", "0.5893442", "0.58903044", "0.58851993", "0.58511597", "0.58494204...
0.7229724
1
Finalize the write of a serialized data stream. Writes the temporary file with the serialized data to the zip file.
def WriteFinalize(self): if not self._file_object: raise IOError('Unable to write to closed serialized data stream.') offset = self._file_object.tell() self._file_object.close() self._file_object = None current_working_directory = os.getcwd() try: os.chdir(self._temporary_path) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def finalize_zip(zip, filename):\n zip.close()\n with open(filename, 'wb') as file:\n file.write(zipbytes.getvalue())", "def zip_data(self) -> None:\n zipf = zipfile.ZipFile('output.zip', 'w', zipfile.ZIP_DEFLATED)\n self._zipdir(self.path, zipf)\n zipf.close()", "def test_def...
[ "0.71846116", "0.6653391", "0.66320926", "0.6439591", "0.64149076", "0.6322938", "0.62275094", "0.60586387", "0.6043945", "0.5984125", "0.5934537", "0.58407354", "0.5816182", "0.5780975", "0.5759505", "0.5752787", "0.57466626", "0.5665925", "0.561841", "0.5614855", "0.5585804...
0.7999223
0
Initializes the write of a serialized data stream. Creates a temporary file to store the serialized data.
def WriteInitialize(self): if self._file_object: raise IOError('Serialized data stream already opened.') stream_file_path = os.path.join(self._temporary_path, self.name) self._file_object = open(stream_file_path, 'wb') if platform_specific.PlatformIsWindows(): file_handle = self._file_objec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(\n self, zip_file, temporary_path, stream_name,\n maximum_data_size=DEFAULT_MAXIMUM_DATA_SIZE, decompress_stream=True):\n super(_SerializedDataStream, self).__init__()\n self._entry_index = 0\n self._file_object = None\n self._maximum_data_size = maximum_data_size\n self._deco...
[ "0.70997894", "0.62179345", "0.6028291", "0.5928215", "0.58894277", "0.5818324", "0.5786513", "0.5781357", "0.57762045", "0.5769191", "0.5732215", "0.5690442", "0.56813973", "0.561295", "0.5610554", "0.5605404", "0.55935323", "0.5538836", "0.55208355", "0.5519665", "0.5515521...
0.74604636
0
Initializes a serialized data offset table.
def __init__(self, zip_file, stream_name): super(_SerializedDataOffsetTable, self).__init__() self._offsets = [] self._stream_name = stream_name self._zip_file = zip_file
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, data=b''):\n self.data = data\n self.offset = 0", "def _GetSerializedDataOffsetTable(self, container_type, stream_number):\n lookup_key = '{0:s}.{1:d}'.format(container_type, stream_number)\n\n offset_table = self._offset_tables.get(lookup_key, None)\n if not offset_tabl...
[ "0.6215536", "0.5921422", "0.5901424", "0.5830085", "0.58185583", "0.571431", "0.5692805", "0.5686374", "0.5617496", "0.55387986", "0.5524144", "0.550044", "0.5465001", "0.54543555", "0.54458046", "0.5433446", "0.54250664", "0.54036075", "0.53978413", "0.5386417", "0.5386417"...
0.71376294
0
Reads the serialized data offset table.
def Read(self): try: file_object = self._zip_file.open(self._stream_name, mode='r') except KeyError as exception: raise IOError( 'Unable to open stream with error: {0!s}'.format(exception)) try: entry_data = file_object.read(self._TABLE_ENTRY_SIZE) while entry_data: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _GetSerializedDataOffsetTable(self, container_type, stream_number):\n lookup_key = '{0:s}.{1:d}'.format(container_type, stream_number)\n\n offset_table = self._offset_tables.get(lookup_key, None)\n if not offset_table:\n stream_name = '{0:s}_index.{1:06d}'.format(\n self._STREAM_NAME_PRE...
[ "0.63575137", "0.5983043", "0.5946667", "0.5853727", "0.58200467", "0.5763843", "0.56015533", "0.55401766", "0.5539385", "0.55269486", "0.54929006", "0.54848534", "0.5464604", "0.5423171", "0.5394988", "0.53757495", "0.5368999", "0.53397185", "0.53221315", "0.52554667", "0.52...
0.61568856
1
Writes the offset table.
def Write(self): table_data = self._TABLE.build(self._offsets) self._zip_file.writestr(self._stream_name, table_data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_offsets(self):\n\n for offset in self.offsets:\n self.db_file.write(struct.pack(\"<I\", offset))", "def write_offsets(offsets):\n\n index_data = bytes()\n for offset in offsets:\n index_data += bytearray(pack('H', offset))\n\n print(\"\\n_index =\\\\\")\n print(\"b'...
[ "0.76964515", "0.64423174", "0.6097248", "0.5907241", "0.58529836", "0.58020484", "0.5721098", "0.5617536", "0.54948485", "0.5465946", "0.543627", "0.5414884", "0.53788555", "0.53474176", "0.53399587", "0.52651244", "0.52097297", "0.52013814", "0.51983577", "0.5180647", "0.51...
0.68627596
1
Initializes a serialized data timestamp table.
def __init__(self, zip_file, stream_name): super(_SerializedDataTimestampTable, self).__init__() self._stream_name = stream_name self._timestamps = [] self._zip_file = zip_file
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args):\n _snap.TTable_swiginit(self, _snap.new_TTable(*args))", "def _init_table(self, table: \"Table\"):\n if not self.columns:\n self.columns = table.columns\n self._data = table.data", "def __init__(self, zip_file, stream_name):\n super(_SerializedDataO...
[ "0.66112685", "0.6446181", "0.63456225", "0.6272627", "0.6269339", "0.6222892", "0.62099767", "0.6158057", "0.6113965", "0.60865355", "0.6086482", "0.6065679", "0.6065679", "0.6065679", "0.6065679", "0.6065679", "0.6065679", "0.6065679", "0.6065679", "0.6065679", "0.6065679",...
0.72924495
0
Writes the timestamp table.
def Write(self): table_data = self._TABLE.build(self._timestamps) self._zip_file.writestr(self._stream_name, table_data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_timestamp(self, timestamp):\n return self.insert_into_database(database_name = self.database_name,\n table_name = 'analysisprofile',\n column_names = ['table_name', 'type_name', 'timestamp'],\n ...
[ "0.6875321", "0.63392663", "0.6302615", "0.6118684", "0.61022687", "0.60588914", "0.60251474", "0.6018949", "0.59081537", "0.57972616", "0.57892954", "0.5784104", "0.5780119", "0.5742766", "0.5739959", "0.57316697", "0.57246834", "0.57078475", "0.5680229", "0.5656697", "0.563...
0.68949664
0
Retrieves a value from the config parser.
def _GetConfigValue(self, config_parser, section_name, value_name): try: return config_parser.get(section_name, value_name).decode('utf-8') except (configparser.NoOptionError, configparser.NoSectionError): return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _GetConfigValue(self, config_parser, section_name, value_name):\n try:\n return config_parser.get(section_name, value_name).decode('utf-8')\n except configparser.NoOptionError:\n return", "def get_config_value(self, name):\r\n if name in self.config_values:\r\n return self.c...
[ "0.7828994", "0.72632587", "0.72562516", "0.7231387", "0.7180348", "0.7152527", "0.7135673", "0.70670396", "0.6819385", "0.68079066", "0.6805623", "0.6791728", "0.6755313", "0.6745314", "0.6717178", "0.67007136", "0.6682381", "0.66780645", "0.66668546", "0.6644024", "0.663696...
0.7771524
1
Initializes a ZIPbased storage file.
def __init__( self, maximum_buffer_size=0, storage_type=definitions.STORAGE_TYPE_SESSION): if (maximum_buffer_size < 0 or maximum_buffer_size > self._MAXIMUM_BUFFER_SIZE): raise ValueError('Maximum buffer size value out of bounds.') if not maximum_buffer_size: maximum_buffer_siz...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, path):\n super(ZIPStorageFileReader, self).__init__(path)\n self._storage_file = ZIPStorageFile()\n self._storage_file.Open(path=path)", "def _open_zip(self):\n self.buffer = io.BytesIO()\n self.zf = zipfile.ZipFile(self.buffer, \"w\", zipfile.ZIP_DEFLATED)", "def __in...
[ "0.7869996", "0.67825323", "0.6684379", "0.6573446", "0.64420867", "0.6367418", "0.6287247", "0.6223887", "0.62113833", "0.61982703", "0.6172486", "0.6088437", "0.60650754", "0.60300446", "0.5995328", "0.5993552", "0.59892476", "0.59736407", "0.5940586", "0.58911645", "0.5876...
0.6870413
1
Adds an serialized event.
def _AddSerializedEvent(self, event): identifier = identifiers.SerializedStreamIdentifier( self._last_stream_numbers['event'], self._serialized_event_heap.number_of_events) event.SetIdentifier(identifier) serialized_data = self._SerializeAttributeContainer(event) self._serialized_event...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_event(self, minfo):\n s = minfo.event.name\n if s == \"\":\n s = \"Empty\"\n if s not in self.events:\n e = ET.SubElement(self.result, 'event_type')\n name = ET.Element('name')\n name.text = s\n e.append(ET.tostring(name))\n ...
[ "0.6408713", "0.6408394", "0.6392327", "0.63833046", "0.6344644", "0.61501354", "0.60210276", "0.6011629", "0.5985267", "0.59568506", "0.592867", "0.58603173", "0.5846515", "0.58355474", "0.5826083", "0.58018017", "0.5791957", "0.57541215", "0.57148093", "0.5697227", "0.56842...
0.82958025
0
Builds the event tag index.
def _BuildEventTagIndex(self): self._event_tag_index = {} for event_tag in self.GetEventTags(): event_identifier = event_tag.GetEventIdentifier() lookup_key = event_identifier.CopyToString() self._event_tag_index[lookup_key] = event_tag.GetIdentifier()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_index():\n pass", "def build_index(self):\n self.rebuild_index()", "def __init__(self):\n super(EventTagIndex, self).__init__()\n self._index = None", "def _Build(self, storage_reader):\n self._index = {}\n for event_tag in storage_reader.GetAttributeContainers(\n self....
[ "0.6470799", "0.6413605", "0.63877326", "0.6276282", "0.62656426", "0.6089702", "0.57038313", "0.5692872", "0.5670689", "0.5628988", "0.5628747", "0.55977523", "0.5596954", "0.55200356", "0.5513125", "0.5432388", "0.5426122", "0.54222363", "0.5412955", "0.53475755", "0.534687...
0.8225914
0
Checks the storage metadata.
def _CheckStorageMetadata(cls, storage_metadata): if not storage_metadata.format_version: raise IOError('Missing format version.') if storage_metadata.format_version < cls._COMPATIBLE_FORMAT_VERSION: raise IOError( 'Format version: {0:d} is too old and no longer supported.'.format( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_metadata(self):\n sql = f\"SELECT COUNT(*) FROM {constants.TABLES}\"\n if self.dbcnx.execute(sql).fetchone()[0] == 0:\n return False # No metadata; skip.\n sql = f\"SELECT name FROM {constants.TABLES}\"\n tables1 = [r[0] for r in self.dbcnx.execute(sql)]\n s...
[ "0.68849", "0.6733465", "0.6723804", "0.66380924", "0.6502397", "0.6397274", "0.6310899", "0.6224822", "0.6220186", "0.6218965", "0.61822337", "0.6158581", "0.60215783", "0.5997119", "0.5945093", "0.5931985", "0.5921689", "0.59099275", "0.5904236", "0.5874082", "0.5835399", ...
0.7579233
0
Fills the event heap with the next events from the stream. This function will read events starting from the given stream number starting at the streams current index that have the same timestamp and adds them to the heap. This ensures that the sorting order of events with the same timestamp is consistent.
def _FillEventHeapFromStream(self, stream_number): event = self._GetEvent(stream_number, decompress_stream=False) if not event: return self._event_heap.PushEvent(event) reference_timestamp = event.timestamp filled_events = 1 while (event.timestamp == reference_timestamp and fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _InitializeEventHeap(self, time_range=None):\n self._event_heap = event_heaps.SerializedStreamEventHeap()\n\n number_range = self._GetSerializedDataStreamNumbers('event_data.')\n for stream_number in number_range:\n entry_index = self.NEXT_AVAILABLE_ENTRY\n if time_range:\n stream_nam...
[ "0.6708396", "0.5909344", "0.58688205", "0.5819905", "0.58049244", "0.5755066", "0.5705707", "0.5628854", "0.5574852", "0.5567036", "0.54250664", "0.5392046", "0.538862", "0.53423595", "0.5285505", "0.52389705", "0.5197304", "0.51567775", "0.5146793", "0.51372963", "0.5135809...
0.8259375
0
Retrieves specific event serialized data. By default the first available entry in the specific serialized stream is read, however any entry can be read using the index stream.
def _GetEventSerializedData( self, stream_number, entry_index=NEXT_AVAILABLE_ENTRY, decompress_stream=True): if stream_number is None: raise ValueError('Invalid stream number.') if entry_index is None: raise ValueError('Invalid entry index.') if stream_number < 1 or stream_number >...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readFromStream(cls, stream):\n list_ = []\n event_id_list = []\n for tr in stream:\n if tr.stats.event.id not in event_id_list:\n list_.append(tr.stats.event)\n event_id_list.append(tr.stats.event.id)\n\n log.info('Read event information of %...
[ "0.5965785", "0.58077484", "0.5639741", "0.54923236", "0.5457739", "0.54448295", "0.542159", "0.53696555", "0.53529304", "0.5326923", "0.5307013", "0.5287082", "0.5274927", "0.52596897", "0.5224719", "0.52177125", "0.5213484", "0.5211176", "0.51963025", "0.5189479", "0.518927...
0.6856159
0
Retrieves an event tag by the event identifier.
def _GetEventTagByIdentifier(self, event_identifier): if not self._event_tag_index: self._BuildEventTagIndex() lookup_key = event_identifier.CopyToString() event_tag_identifier = self._event_tag_index.get(lookup_key, None) if not event_tag_identifier: return return self._GetEventTag( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetEventTagByIdentifier(self, storage_reader, event_identifier):\n if self._index is None:\n self._Build(storage_reader)\n\n lookup_key = event_identifier.CopyToString()\n event_tag_identifier = self._index.get(lookup_key, None)\n if not event_tag_identifier:\n return None\n\n return s...
[ "0.7489416", "0.66501296", "0.6435521", "0.6387967", "0.6359272", "0.61622465", "0.6137645", "0.60752845", "0.6033951", "0.6003411", "0.5964391", "0.59148395", "0.5901486", "0.58955365", "0.5885773", "0.5877414", "0.5868369", "0.5861183", "0.58542573", "0.58474344", "0.583286...
0.84164923
0
Retrieves the last stream number.
def _GetLastStreamNumber(self, stream_name_prefix): last_stream_number = 0 for stream_name in self._GetStreamNames(): if stream_name.startswith(stream_name_prefix): _, _, stream_number = stream_name.partition('.') try: stream_number = int(stream_number, 10) except ValueE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last(self):\n return int(self.rpc.call(MsfRpcMethod.SessionRingLast, [self.sid])['seq'])", "async def get_appservice_last_pos(self) -> int:\n\n return await self.db_pool.simple_select_one_onecol(\n table=\"appservice_stream_position\",\n retcol=\"stream_ordering\",\n ...
[ "0.71587664", "0.688928", "0.66568166", "0.6616124", "0.6479632", "0.6416711", "0.6395545", "0.6391608", "0.6373386", "0.636418", "0.6338002", "0.6317301", "0.63045806", "0.6297375", "0.62272185", "0.619427", "0.61681545", "0.61647356", "0.61567175", "0.61452043", "0.61282295...
0.76081175
0
Retrieves the serialized data of a specific attribute container. By default the first available entry in the specific serialized stream is read, however any entry can be read using the index stream.
def _GetSerializedAttributeContainerData( self, container_type, stream_number, entry_index=NEXT_AVAILABLE_ENTRY): last_stream_number = self._last_stream_numbers[container_type] if stream_number < 1 or stream_number > last_stream_number: raise ValueError('Stream number out of bounds.') if entry...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _GetAttributeContainerByIndex(self, container_type, index):\n last_stream_number = self._last_stream_numbers[container_type]\n\n stream_number = 1\n while stream_number < last_stream_number:\n if stream_number <= len(self._event_sources_in_stream):\n number_of_entries = self._event_sources...
[ "0.6766131", "0.6556566", "0.64764994", "0.5987525", "0.59399986", "0.5927271", "0.5643335", "0.5526717", "0.55067885", "0.55013525", "0.5388177", "0.53306615", "0.53102344", "0.5197276", "0.5172566", "0.5145992", "0.513508", "0.5127645", "0.5125825", "0.5099988", "0.5089999"...
0.7010452
0
Updates structures after opening a new decompressed data stream. The stream will be seek'd to the last known location, and if too many decompressed streams are open already, the least frequently used stream will be closed.
def _UpdateDecompressedStream(self, data_stream): stream_name = data_stream.name if stream_name in self._saved_stream_offsets: entry_index, offset = self._saved_stream_offsets[stream_name] data_stream.SeekEntryAtOffset(entry_index, offset) if len(self._streams_lfu) > self._MAXIMUM_NUMBER_OF_DEC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _UpdateCompressedStream(self, data_stream):\n stream_name = data_stream.name\n if stream_name in self._saved_stream_offsets:\n entry_index, offset = self._saved_stream_offsets[stream_name]\n data_stream.SeekEntryAtOffset(entry_index, offset)\n\n self._open_streams[stream_name] = data_stream"...
[ "0.7141268", "0.64529437", "0.6094298", "0.58992296", "0.5737144", "0.56284827", "0.5556765", "0.54491574", "0.5383658", "0.53620946", "0.53394866", "0.5338429", "0.52606696", "0.52348787", "0.52274364", "0.5186454", "0.5171337", "0.5162821", "0.5113855", "0.5113593", "0.5049...
0.8278429
0
Updates structures after opening a new uncompressed data stream.
def _UpdateCompressedStream(self, data_stream): stream_name = data_stream.name if stream_name in self._saved_stream_offsets: entry_index, offset = self._saved_stream_offsets[stream_name] data_stream.SeekEntryAtOffset(entry_index, offset) self._open_streams[stream_name] = data_stream
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _UpdateDecompressedStream(self, data_stream):\n stream_name = data_stream.name\n if stream_name in self._saved_stream_offsets:\n entry_index, offset = self._saved_stream_offsets[stream_name]\n data_stream.SeekEntryAtOffset(entry_index, offset)\n\n if len(self._streams_lfu) > self._MAXIMUM_NU...
[ "0.68209773", "0.61636096", "0.6114487", "0.60476613", "0.59815973", "0.5905193", "0.57466537", "0.5632216", "0.5595335", "0.55674934", "0.55196404", "0.5496459", "0.54882395", "0.54587895", "0.54429436", "0.544156", "0.54389155", "0.5419615", "0.541147", "0.5409264", "0.5395...
0.6754263
1
Retrieves the serialized data offset table.
def _GetSerializedDataOffsetTable(self, container_type, stream_number): lookup_key = '{0:s}.{1:d}'.format(container_type, stream_number) offset_table = self._offset_tables.get(lookup_key, None) if not offset_table: stream_name = '{0:s}_index.{1:06d}'.format( self._STREAM_NAME_PREFIXES[conta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def OffsetToStringData(self) -> int:", "def retrieve_offsets(self):\n return [], []", "def data_offset(self):\n return self._offset + 0x4", "def get_table_data(self):\n return self.table_data", "def offset(self):\n self._fetch_if_needed()\n return self._offset", "def fi...
[ "0.6482787", "0.61175954", "0.59099203", "0.5787619", "0.57221115", "0.5680895", "0.5619794", "0.5552502", "0.5544916", "0.55095243", "0.55095243", "0.5476331", "0.5441493", "0.541585", "0.5410551", "0.53298426", "0.53298426", "0.53298426", "0.53095305", "0.5282681", "0.52686...
0.6462229
1
Retrieves the available serialized data stream numbers.
def _GetSerializedDataStreamNumbers(self, stream_name_prefix): stream_numbers = [] for stream_name in self._zipfile.namelist(): if not stream_name.startswith(stream_name_prefix): continue _, _, stream_number = stream_name.partition('.') try: stream_number = int(stream_number, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_readings(self):\n buf = self._read(0x020001)\n data = decode(buf[1:])\n return data", "def read_ints(self):\n return self.numbers", "def data(self) -> List[int]:\n return self.__ids", "def data(self) -> List[int]:\n return self.__ids", "def data(self) -> Li...
[ "0.6123326", "0.60691893", "0.5762534", "0.5762534", "0.5762534", "0.56716156", "0.5561603", "0.53404474", "0.53161645", "0.5281193", "0.5271223", "0.5246011", "0.52433115", "0.5185594", "0.5154446", "0.51528454", "0.51496285", "0.51195824", "0.51182187", "0.5109214", "0.5100...
0.7298989
0
Retrieves the serialized event stream timestamp table.
def _GetSerializedEventTimestampTable(self, stream_number): timestamp_table = self._event_timestamp_tables.get(stream_number, None) if not timestamp_table: stream_name = 'event_timestamps.{0:06d}'.format(stream_number) timestamp_table = _SerializedDataTimestampTable( self._zipfile, stream_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getTimestamp(self):\r\n\t\treturn self.data['timestamp']", "def timestamps(self):\n return self.source.timestamps[self._time_keep]", "def getTimestamp(self):\r\n\t\treturn self.pair.data['timestamp']", "def read_timestamp(self):\n if not self.fetch_from_database(database_name = self.databas...
[ "0.5968962", "0.59521824", "0.5894825", "0.5833716", "0.5824262", "0.57992494", "0.5763929", "0.5728756", "0.5685685", "0.56801814", "0.56462735", "0.56023407", "0.55963504", "0.5587628", "0.55663276", "0.55623734", "0.5561269", "0.55103415", "0.5481726", "0.54760754", "0.544...
0.77107424
0
Retrieves the stream names.
def _GetStreamNames(self): if self._zipfile: for stream_name in self._zipfile.namelist(): yield stream_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_streams(self)->List[str]:\n stream_path = self._get_storage_path()\n stream_names = []\n all_streams = self._ls_dir()\n for strm in all_streams:\n stream_names.append(strm.replace(stream_path,\"\").replace(\"stream=\",\"\").replace(\"study=\"+self.study_name, \"\"))\...
[ "0.77307224", "0.7440542", "0.7400953", "0.7182252", "0.7177651", "0.65583533", "0.65583533", "0.6524132", "0.6332357", "0.63082665", "0.63082665", "0.620997", "0.6205913", "0.6202951", "0.6202951", "0.6172257", "0.6095177", "0.60873675", "0.60676223", "0.6045437", "0.5927225...
0.81218964
0
Determines if the ZIP file contains a specific stream.
def _HasStream(self, stream_name): try: file_object = self._zipfile.open(stream_name, 'r') except KeyError: return False file_object.close() return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_stream(self, stream_name: str) -> bool:\n return self._path_exist(stream_name=stream_name)", "def isZipArchive(filepath):\r\n return zipfile.is_zipfile(filepath)", "def _iszip(self, filename):\n fname, ext = os.path.splitext(filename)\n return ext in _file_openers.keys()", ...
[ "0.726469", "0.6221034", "0.61563706", "0.6052924", "0.59418195", "0.59197545", "0.59092665", "0.58335894", "0.57808906", "0.5748869", "0.57273895", "0.5682704", "0.56808233", "0.5634593", "0.5625678", "0.55807525", "0.55104727", "0.5496972", "0.5492922", "0.5491166", "0.5478...
0.8318579
0
Initializes events into the event heap. This function fills the event heap with the first relevant event from each stream.
def _InitializeEventHeap(self, time_range=None): self._event_heap = event_heaps.SerializedStreamEventHeap() number_range = self._GetSerializedDataStreamNumbers('event_data.') for stream_number in number_range: entry_index = self.NEXT_AVAILABLE_ENTRY if time_range: stream_name = 'event_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _FillEventHeapFromStream(self, stream_number):\n event = self._GetEvent(stream_number, decompress_stream=False)\n if not event:\n return\n self._event_heap.PushEvent(event)\n\n reference_timestamp = event.timestamp\n filled_events = 1\n while (event.timestamp == reference_timestamp and\n...
[ "0.74232566", "0.66105425", "0.6587743", "0.6438691", "0.64272267", "0.6205338", "0.5846505", "0.58347034", "0.58006513", "0.57431066", "0.5732535", "0.5722661", "0.57113826", "0.57027316", "0.5690294", "0.5669432", "0.56392354", "0.56294936", "0.55776376", "0.5536148", "0.54...
0.7440643
0