query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Returns the mode id
def modeId(self): return self.__modeId
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mode(self) -> str:\r\n return self._mode", "def mode(self) -> str:\n return pulumi.get(self, \"mode\")", "def mode(self) -> str:\n return pulumi.get(self, \"mode\")", "def getmode(self):\n return self.mode", "def get_mode(self):\r\n return self.mode", "def mode(self...
[ "0.7811208", "0.7805747", "0.7805747", "0.77869534", "0.771352", "0.76968026", "0.76935", "0.7689646", "0.7655183", "0.7655183", "0.7655183", "0.76503944", "0.7631035", "0.7631035", "0.7631035", "0.7579294", "0.75691974", "0.7563148", "0.75571734", "0.7544744", "0.7537633", ...
0.9080869
0
Returns a normalized data if the embed a numpy or a dataset. Else returns the data.
def normalizeData(self, data): return _normalizeData(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_dataset(self):", "def denormalise_0_1(value_or_array, array_min, array_max):\n if isinstance(value_or_array, list):\n raise ValueError('this function accepts arraylike data, not a list. '\n 'Please check data or convert list to numpy array')\n elif isinstance(va...
[ "0.6411808", "0.6257444", "0.60196054", "0.5992935", "0.57872874", "0.57642037", "0.5717445", "0.57168716", "0.56780815", "0.56666386", "0.5641378", "0.56412536", "0.5624694", "0.5618897", "0.55740637", "0.5556557", "0.55519104", "0.55438924", "0.554357", "0.54966813", "0.548...
0.57247394
6
Returns names of axes which can be custom by the user and provided to the view.
def customAxisNames(self): return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def axesnames(self):\n return self._axesnames", "def axesNames(self, data, info):\n return []", "def allAxes( mv ):\n if mv is None: return None\n return mv.getAxisList()", "def process_custom_axes(axis_names):\n return axis_names.strip().strip(\"'\").strip('\"').split(',')", "def se...
[ "0.7648422", "0.7616448", "0.69971704", "0.6937097", "0.6732004", "0.66294384", "0.66294384", "0.65201336", "0.64523226", "0.64523226", "0.644479", "0.62596124", "0.62539476", "0.6205868", "0.6204709", "0.6199804", "0.61753386", "0.60562867", "0.6000825", "0.59575087", "0.590...
0.7429947
2
Set the value of a custom axis
def setCustomAxisValue(self, name, value): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value_axis(self, value_axis):\n\n self.container['value_axis'] = value_axis", "def set_point(self, axis: int, value: Union[int, float]):\n if axis < 0:\n axis += self.ndim\n if axis < 0:\n raise ValueError(\n f'axis is negative, expected positive, got...
[ "0.7426107", "0.6823979", "0.6566052", "0.6564019", "0.64065546", "0.6389571", "0.6220259", "0.6220259", "0.6219633", "0.61972004", "0.6181993", "0.61811894", "0.6174139", "0.6174139", "0.6139899", "0.6137108", "0.6131543", "0.60985774", "0.60769933", "0.6062639", "0.60532314...
0.8554661
0
Returns true if the widget is already initialized.
def isWidgetInitialized(self): return self.__widget is not None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_initialized(self) -> bool:\n return len(self) > 0", "def is_editor_ready(self):\r\n if self.editor_widget:\r\n window = self.editor_widget.window()\r\n if hasattr(window, 'is_starting_up') and not window.is_starting_up:\r\n return True", "def _isinit(s...
[ "0.7549473", "0.7125627", "0.7058051", "0.6861954", "0.68026435", "0.67455906", "0.67142135", "0.6673255", "0.6608615", "0.6608254", "0.65874594", "0.65844923", "0.6568072", "0.6543216", "0.6534076", "0.65151435", "0.64635277", "0.6377944", "0.63721126", "0.63586754", "0.6357...
0.86975914
0
Called when the view is selected to display the data.
def select(self): return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_view(self, selected):\n pass", "def on_show_view(self):\n self.setup()", "def on_show_view(self):\n self.setup()", "def on_show_view(self):\n self.setup()", "def double_clicked_to_view(self):\n\n # TODO need this method? better in init to go to view_file\n ...
[ "0.6908727", "0.68765587", "0.68765587", "0.68765587", "0.68169916", "0.6644139", "0.64929426", "0.64622873", "0.6419342", "0.64000374", "0.63986725", "0.6347207", "0.6281897", "0.62665963", "0.62107486", "0.61422783", "0.6078744", "0.6024754", "0.5984693", "0.59396374", "0.5...
0.0
-1
Returns the widget hold in the view and displaying the data.
def getWidget(self): if self.__widget is None: self.__widget = self.createWidget(self.__parent) hooks = self.getHooks() if hooks is not None: hooks.viewWidgetCreated(self, self.__widget) return self.__widget
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getWidget(self):", "def get_widget(self):\n\t\treturn None", "def get_widget(self):\r\n return None", "def getWidget(self):\n \n firstDataset = DashboardDataset.objects.filter(visualisation=self)[0]\n \n widget = {'name': self.name,\n 'id': \"v...
[ "0.715394", "0.6819817", "0.6572543", "0.6497226", "0.6424546", "0.64217347", "0.63251066", "0.6264714", "0.60248333", "0.60220647", "0.60014933", "0.5999917", "0.59659904", "0.5965528", "0.5953922", "0.593256", "0.59063375", "0.5884918", "0.58389086", "0.5837104", "0.5805009...
0.613439
8
Create the the widget displaying the data
def createWidget(self, parent): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_widgets( self ):", "def create_widgets(self):", "def create_widget(self):\n pass", "def create_widgets(self):\n #create description label\n Label(self,\n text = \"Patient Info:\"\n ).grid(row = 0, column = 0, sticky = W)", "def create_widget(self):\...
[ "0.77904814", "0.7724006", "0.74482644", "0.7145807", "0.70442563", "0.6963141", "0.6727688", "0.6713468", "0.66749644", "0.6665819", "0.66230774", "0.6606152", "0.6602463", "0.65789104", "0.6540385", "0.65140307", "0.6504417", "0.6483414", "0.64326835", "0.64275306", "0.6407...
0.62476426
35
Clear the data from the view
def clear(self): return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear(view):\n\n vid = view.id()\n\n if vid in __view_data:\n del __view_data[vid]", "def clear(self):\r\n self._state[\"data\"].clear()\r\n self._state[\"session\"].request_rerun()", "def clear(self):\r\n self._state[\"data\"].clear()\r\n self._state[\"session\"].r...
[ "0.75162023", "0.75093865", "0.75093865", "0.74801755", "0.74801755", "0.74801755", "0.7445752", "0.7445752", "0.7445752", "0.7445752", "0.7445752", "0.7445752", "0.7445752", "0.7369837", "0.7359641", "0.7359641", "0.7359641", "0.73505694", "0.7335502", "0.7292264", "0.725941...
0.6862511
51
Set the data displayed by the view
def setData(self, data): return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def UpdateView(self):\n self.View._viewData = self.Model.ModelViewData", "def set_data(self, data):\n self._model.set_data(data)\n self.__refresh()", "def set_data(self, data):\n\n pass", "def setData(self, data):\n self.data = data", "def setData(self, data):\n se...
[ "0.67212325", "0.6703987", "0.6577128", "0.65743166", "0.65743166", "0.65499383", "0.6453297", "0.6431296", "0.6351088", "0.6262122", "0.62261164", "0.6209779", "0.6202004", "0.6161496", "0.6143025", "0.6109205", "0.60769266", "0.6066145", "0.6061738", "0.6057122", "0.6055720...
0.6270766
9
Format an iterable of slice objects
def __formatSlices(self, indices): if indices is None: return '' def formatSlice(slice_): start, stop, step = slice_.start, slice_.stop, slice_.step string = ('' if start is None else str(start)) + ':' if stop is not None: string += str(st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_slice_strings(cls, slice_key):\n start = slice_key.start\n size = slice_key.stop - start\n return (str(start), str(size))", "def __getslice__(self, i, j):\n return OutputGroup(list.__getslice__(self, i, j))", "def print_slice(input, iz=0):\n\timage=get_image(input)\n\tnx = ...
[ "0.5865665", "0.57684493", "0.5599457", "0.5525063", "0.5512937", "0.55068475", "0.5437363", "0.54111654", "0.5382067", "0.5355884", "0.5338547", "0.53211254", "0.53099644", "0.5304407", "0.5304407", "0.52531093", "0.5224272", "0.5191909", "0.51722807", "0.5160424", "0.513076...
0.6723752
0
Build title from given selection information.
def titleForSelection(self, selection): if selection is None or selection.filename is None: return None else: directory, filename = os.path.split(selection.filename) try: slicing = self.__formatSlices(selection.slice) except Exception: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateTitle(self):\n \n if len(self.selParams) == 0:\n self.title = 'Measure (Nothing)'\n elif len(self.selParams) == 1:\n self.title = 'Measure ' + self.selParams[0]\n elif len(self.selParams) == 2:\n self.title = 'Measure ' + self.selParams[0] + ',...
[ "0.6353829", "0.613545", "0.6039983", "0.6028894", "0.58950776", "0.5741492", "0.5696391", "0.56829673", "0.5664377", "0.556874", "0.5443336", "0.5429673", "0.54182184", "0.54098636", "0.54039633", "0.53925604", "0.53877467", "0.5369228", "0.5365641", "0.53589183", "0.5351014...
0.75292933
0
Set the data selection displayed by the view If called, it have to be called directly after `setData`.
def setDataSelection(self, selection): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_selection(self, selection):\n self._selection = selection", "def update_selection(self):\n raise NotImplementedError", "def setSelectedDate(self, data):\n # print('setSelectedDate ', data)\n self.currentDate = data", "def update_view(self, selected):\n pass", "def...
[ "0.6738302", "0.66910154", "0.66355103", "0.6523672", "0.64766914", "0.6413622", "0.63925743", "0.6344838", "0.6215796", "0.62130725", "0.6122954", "0.6097352", "0.608399", "0.6022608", "0.6015785", "0.6015256", "0.6015057", "0.6011311", "0.5971476", "0.5964737", "0.59606576"...
0.83170843
0
Returns names of the expected axes of the view, according to the input data. A none value will disable the default axes selectior.
def axesNames(self, data, info): return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def axesnames(self):\n return self._axesnames", "def allAxes( mv ):\n if mv is None: return None\n return mv.getAxisList()", "def _default_axis_names(n_dims):\n _DEFAULT_NAMES = (\"z\", \"y\", \"x\")\n return _DEFAULT_NAMES[-n_dims:]", "def _find_axes(cls, input_data, explicit_x=None):\n\n...
[ "0.697044", "0.68636376", "0.6316774", "0.61642134", "0.60828024", "0.60513145", "0.59091306", "0.58836395", "0.58836395", "0.58783954", "0.58783954", "0.58372355", "0.57716405", "0.57354414", "0.57308847", "0.5713211", "0.5692361", "0.5676367", "0.56661934", "0.56484467", "0...
0.7396134
0
Returns the views that can be returned by `getMatchingViews`.
def getReachableViews(self): return [self]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMatchingViews(self, data, info):\n raise NotImplementedError()", "def getMatchingViews(self, data, info):\n if not self.isSupportedData(data, info):\n return []\n views = [v for v in self.__views if v.getCachedDataPriority(data, info) != DataView.UNSUPPORTED]\n retur...
[ "0.73828393", "0.69941866", "0.6910991", "0.6866864", "0.68596447", "0.6800824", "0.67730147", "0.6732255", "0.6717297", "0.6404748", "0.63528705", "0.6350586", "0.62178314", "0.613579", "0.6117917", "0.611534", "0.6032207", "0.59530085", "0.59079045", "0.5888702", "0.5878553...
0.70170206
1
Returns the views according to data and info from the data.
def getMatchingViews(self, data, info): priority = self.getCachedDataPriority(data, info) if priority == DataView.UNSUPPORTED: return [] return [self]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMatchingViews(self, data, info):\n raise NotImplementedError()", "def getViews(read):\n ...", "def data():\n return app_views", "def get_views(self):\n query = mssqlqueries.get_views()\n logger.info(u'Views query: %s', query)\n for tabular_result in self.execute_query...
[ "0.7969806", "0.69606024", "0.686283", "0.64240295", "0.6387216", "0.6334201", "0.61583513", "0.6104082", "0.6033356", "0.60128796", "0.59859484", "0.5854869", "0.5852785", "0.58455336", "0.5827547", "0.57515484", "0.5747855", "0.5738467", "0.5707945", "0.56745374", "0.565384...
0.68316317
3
Returns the priority of using this view according to a data. `UNSUPPORTED` means this view can't display this data `1` means this view can display the data `100` means this view should be used for this data `1000` max value used by the views provided by silx ...
def getDataPriority(self, data, info): return DataView.UNSUPPORTED
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getBestView(self, data, info):\n if not self.isSupportedData(data, info):\n return None\n views = [(v.getCachedDataPriority(data, info), v) for v in self.__views.keys()]\n views = filter(lambda t: t[0] > DataView.UNSUPPORTED, views)\n views = sorted(views, key=lambda t:...
[ "0.73111045", "0.5799851", "0.56085545", "0.5550155", "0.5519779", "0.54540956", "0.54540956", "0.54540956", "0.54540956", "0.5422215", "0.53575385", "0.53053236", "0.5287806", "0.52869827", "0.5281557", "0.5281557", "0.52641714", "0.525869", "0.525869", "0.525869", "0.525869...
0.7323587
0
Returns the direct sub views registered in this view.
def getViews(self): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def views(self):\n return self._views", "def child_views(self):\n return self.children", "def getViews(self):\n return list(self.__views)", "def getViews(self):\n return list(self.__views.keys())", "def getReachableViews(self):\n return [self]", "def other_views(cls):\n...
[ "0.7233933", "0.7220913", "0.69729173", "0.6953038", "0.67021793", "0.6609596", "0.654168", "0.6535742", "0.64842397", "0.62973654", "0.6059941", "0.60502416", "0.6000292", "0.5903239", "0.5832622", "0.57977766", "0.57622355", "0.55724", "0.5553914", "0.5470411", "0.54599607"...
0.69583744
3
Returns all views that can be reachable at on point. This method return any sub view provided (recursivly).
def getReachableViews(self): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getReachableViews(self):\n return [self]", "def views(self):\n return self._views", "def getViews(self):\n raise NotImplementedError()", "def getViews(self):\n return list(self.__views)", "def child_views(self):\n return self.children", "def getViews(self):\n ...
[ "0.7994752", "0.65861917", "0.6485654", "0.6417944", "0.6358205", "0.6335218", "0.6190338", "0.59789574", "0.58850986", "0.5878531", "0.58777565", "0.58640367", "0.585607", "0.5808636", "0.57850796", "0.57698834", "0.56750935", "0.55629796", "0.54616225", "0.54540443", "0.542...
0.7903768
1
Returns sub views matching this data and info. This method return any sub view provided (recursivly).
def getMatchingViews(self, data, info): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMatchingViews(self, data, info):\n priority = self.getCachedDataPriority(data, info)\n if priority == DataView.UNSUPPORTED:\n return []\n return [self]", "def child_views(self):\n return self.children", "def getViews(self):\n raise NotImplementedError()", ...
[ "0.66623676", "0.6509976", "0.62610114", "0.60390395", "0.60192496", "0.58090764", "0.58028334", "0.5798752", "0.56958425", "0.56136817", "0.55903375", "0.5563396", "0.5545881", "0.55402297", "0.5515465", "0.5467731", "0.54673463", "0.54271245", "0.5401829", "0.53947186", "0....
0.7676684
0
If true, the composite view allow sub views to access to this data. Else this this data is considered as not supported by any of sub views (incliding this composite view).
def isSupportedData(self, data, info): return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_view(self, user):\r\n return True", "def is_view(self):\n return self._base is not None", "def can_be_viewed_by(self,user):\n\n # check whether everyone is allowed to view this. Anymous user is the only member of group\n # 'everyone' for which permissions can be set\n ...
[ "0.63665915", "0.6361225", "0.61424387", "0.6134464", "0.6051655", "0.6020548", "0.60181636", "0.59689856", "0.5942634", "0.592821", "0.5894399", "0.5891005", "0.58342636", "0.58218175", "0.5810575", "0.57985485", "0.5771625", "0.57598394", "0.575076", "0.574671", "0.5743144"...
0.0
-1
Set the data context to use with this view.
def setHooks(self, hooks): super(SelectOneDataView, self).setHooks(hooks) if hooks is not None: for v in self.__views: v.setHooks(hooks)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_context(self, context: Context):\n self.context = context", "def set_context(self, context: Context):\n self.context = context", "def context(self, context):\n\n self._context = context", "def context(self, context):\n self._context = context", "def init_context_data(self):\n ...
[ "0.7683104", "0.7683104", "0.7604538", "0.7603135", "0.7315703", "0.70659196", "0.7049075", "0.68992573", "0.6756666", "0.661848", "0.657547", "0.6492585", "0.64533097", "0.6452145", "0.6437525", "0.6437525", "0.6437525", "0.6437525", "0.6437525", "0.6437525", "0.63808036", ...
0.0
-1
Add a new dataview to the available list.
def addView(self, dataView): hooks = self.getHooks() if hooks is not None: dataView.setHooks(hooks) self.__views[dataView] = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addView(self, dataView):\n hooks = self.getHooks()\n if hooks is not None:\n dataView.setHooks(hooks)\n self.__views.append(dataView)", "def add_view(self, *args, **kwargs):\n return self._resources_manager.add_view(*args, **kwargs)", "def add_view_step(self, view_ste...
[ "0.7770298", "0.62751746", "0.6245295", "0.61709106", "0.6146605", "0.6143366", "0.6009386", "0.59872663", "0.5966884", "0.5899624", "0.5888188", "0.5862685", "0.58360523", "0.574251", "0.5739594", "0.5723594", "0.5711219", "0.5705367", "0.5701599", "0.567094", "0.5650077", ...
0.6986231
1
Returns the list of registered views
def getViews(self): return list(self.__views.keys())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getViews(self):\n return list(self.__views)", "def views(self):\n return self._views", "def get_views(self):\n return self._get_types_from_default_ns(View)", "def getViews(self):\n raise NotImplementedError()", "def get_views(cohesity_client):\n views = cohesity_client.vi...
[ "0.80495256", "0.7825242", "0.7322528", "0.71818465", "0.70918703", "0.7040627", "0.7036368", "0.70254064", "0.6989426", "0.6974881", "0.6926255", "0.69062054", "0.6688032", "0.6612111", "0.64889175", "0.63672256", "0.63298315", "0.6300513", "0.62238866", "0.61698407", "0.607...
0.8089164
0
Returns the best view according to priorities.
def __getBestView(self, data, info): if not self.isSupportedData(data, info): return None views = [(v.getCachedDataPriority(data, info), v) for v in self.__views.keys()] views = filter(lambda t: t[0] > DataView.UNSUPPORTED, views) views = sorted(views, key=lambda t: t[0], rev...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_best_candidate(self):\n if not self.scores:\n return None\n return self.te_list[self.scores.index(max(self.scores))]", "def get_best_known_model(self) -> Tuple[Optional[Path], int]:\n return self._get_first_model(sort='total_score', desc=False)", "def get_best_solution(s...
[ "0.5956185", "0.5946167", "0.5866012", "0.5723517", "0.571503", "0.5705968", "0.5679877", "0.5675663", "0.5662041", "0.5633913", "0.55750704", "0.55725336", "0.557066", "0.5537898", "0.551114", "0.54992044", "0.54922616", "0.54763204", "0.5463753", "0.54381096", "0.54253614",...
0.6901257
0
Replace a data view with a custom view. Return True in case of success, False in case of failure.
def replaceView(self, modeId, newView): oldView = None for view in self.__views: if view.modeId() == modeId: oldView = view break elif isinstance(view, _CompositeDataView): # recurse hooks = self.getHooks() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replaceView(self, modeId, newView):\n oldView = None\n for iview, view in enumerate(self.__views):\n if view.modeId() == modeId:\n oldView = view\n break\n elif isinstance(view, CompositeDataView):\n # recurse\n hoo...
[ "0.6608374", "0.63342625", "0.5802944", "0.5615293", "0.55753934", "0.5501989", "0.5438444", "0.5432784", "0.54150265", "0.5374852", "0.53694946", "0.53612304", "0.53092", "0.5178626", "0.5124789", "0.50912267", "0.5088075", "0.5062455", "0.504078", "0.50203586", "0.50010663"...
0.6661702
0
Set the data context to use with this view.
def setHooks(self, hooks): super(SelectManyDataView, self).setHooks(hooks) if hooks is not None: for v in self.__views: v.setHooks(hooks)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_context(self, context: Context):\n self.context = context", "def set_context(self, context: Context):\n self.context = context", "def context(self, context):\n\n self._context = context", "def context(self, context):\n self._context = context", "def init_context_data(self):\n ...
[ "0.76813114", "0.76813114", "0.76026666", "0.7601226", "0.7315484", "0.70639783", "0.7049825", "0.689833", "0.6754621", "0.6616619", "0.6573297", "0.6492235", "0.64529794", "0.6450892", "0.64364654", "0.64364654", "0.64364654", "0.64364654", "0.64364654", "0.64364654", "0.638...
0.0
-1
Add a new dataview to the available list.
def addView(self, dataView): hooks = self.getHooks() if hooks is not None: dataView.setHooks(hooks) self.__views.append(dataView)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addView(self, dataView):\n hooks = self.getHooks()\n if hooks is not None:\n dataView.setHooks(hooks)\n self.__views[dataView] = None", "def add_view(self, *args, **kwargs):\n return self._resources_manager.add_view(*args, **kwargs)", "def add_view_step(self, view_ste...
[ "0.6986125", "0.6275191", "0.6244819", "0.6171132", "0.6145084", "0.6141402", "0.6009027", "0.59855765", "0.59667253", "0.59002584", "0.58872473", "0.58618987", "0.5837559", "0.5743151", "0.5737284", "0.5722587", "0.5710407", "0.57034796", "0.5701506", "0.56690824", "0.564912...
0.7770105
0
Returns the list of registered views
def getViews(self): return list(self.__views)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getViews(self):\n return list(self.__views.keys())", "def views(self):\n return self._views", "def get_views(self):\n return self._get_types_from_default_ns(View)", "def getViews(self):\n raise NotImplementedError()", "def get_views(cohesity_client):\n views = cohesity_cl...
[ "0.8089164", "0.7825242", "0.7322528", "0.71818465", "0.70918703", "0.7040627", "0.7036368", "0.70254064", "0.6989426", "0.6974881", "0.6926255", "0.69062054", "0.6688032", "0.6612111", "0.64889175", "0.63672256", "0.63298315", "0.6300513", "0.62238866", "0.61698407", "0.6074...
0.80495256
1
Returns the views according to data and info from the data.
def getMatchingViews(self, data, info): if not self.isSupportedData(data, info): return [] views = [v for v in self.__views if v.getCachedDataPriority(data, info) != DataView.UNSUPPORTED] return views
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMatchingViews(self, data, info):\n raise NotImplementedError()", "def getViews(read):\n ...", "def data():\n return app_views", "def getMatchingViews(self, data, info):\n priority = self.getCachedDataPriority(data, info)\n if priority == DataView.UNSUPPORTED:\n re...
[ "0.7969806", "0.69606024", "0.686283", "0.68316317", "0.64240295", "0.6334201", "0.61583513", "0.6104082", "0.6033356", "0.60128796", "0.59859484", "0.5854869", "0.5852785", "0.58455336", "0.5827547", "0.57515484", "0.5747855", "0.5738467", "0.5707945", "0.56745374", "0.56538...
0.6387216
5
Replace a data view with a custom view. Return True in case of success, False in case of failure.
def replaceView(self, modeId, newView): oldView = None for iview, view in enumerate(self.__views): if view.modeId() == modeId: oldView = view break elif isinstance(view, CompositeDataView): # recurse hooks = self.get...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replaceView(self, modeId, newView):\n oldView = None\n for view in self.__views:\n if view.modeId() == modeId:\n oldView = view\n break\n elif isinstance(view, _CompositeDataView):\n # recurse\n hooks = self.getHook...
[ "0.66609526", "0.633346", "0.58019185", "0.5614997", "0.557388", "0.5499673", "0.5438074", "0.5433056", "0.54160523", "0.5373652", "0.5368686", "0.5363025", "0.5309105", "0.517758", "0.51247215", "0.5092328", "0.5089086", "0.50640225", "0.5039589", "0.5020905", "0.50027037", ...
0.66075784
1
Update used colormap according to nxdata's SILX_style
def _updateColormap(self, nxdata): cmap_norm = nxdata.plot_style.signal_scale_type if cmap_norm is not None: self.defaultColormap().setNormalization( 'log' if cmap_norm == 'log' else 'linear')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def changeColor(self):\n self.layer.new_colormap()", "def color(self, sids=None, sat=1):\n if sids == None: # init/overwrite self.colors\n nids = self.nids\n # uint8, single unit nids are 1-based:\n self.colors = CLUSTERCLRSRGB[nids % len(CLUSTERCLRSRGB) - 1] * sat\...
[ "0.6052805", "0.5751103", "0.5729292", "0.56816226", "0.5550979", "0.5397923", "0.5361876", "0.5355042", "0.5344387", "0.5323888", "0.5323239", "0.53095704", "0.52873427", "0.5242239", "0.52291805", "0.52267003", "0.5224373", "0.5188541", "0.5188279", "0.51769954", "0.5140223...
0.7386802
0
initializes the Logger object
def __init__(self, log_path): # create a map for storing LogImg objects self.log_img_map = OrderedDict() # set the path to the log directory self.log_path = log_path # check if log directory already exists or create it if not os.path.exists(self.log_path): o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init():\n global logger\n logger = logging.getLogger(\"Log\")", "def __init__(self):\n self.logger = logger()", "def __init__(self):\n\n self._logger = logging.getLogger(__name__)", "def __init__(self):\n self.log = logging.getLogger()", "def initLogger(self):\n logle...
[ "0.8163742", "0.8149624", "0.8097391", "0.8094877", "0.79942304", "0.7862399", "0.7852204", "0.7826338", "0.7825711", "0.7824366", "0.7818538", "0.769426", "0.76774776", "0.76670194", "0.7631146", "0.75770164", "0.7560235", "0.75468314", "0.74853206", "0.748401", "0.7467921",...
0.0
-1
Adds a new LogImg object to the logger.
def add_log_img(self, log_img_type): self.log_img_map[log_img_type] = LogImg(self.log_path, log_img_type)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_image(self, log_name: str, image: Union[str, Any], step: Optional[int] = None) -> None:\n for key, logger in self._loggers.items():\n log_fn = getattr(logger, \"log_image\", None)\n if callable(log_fn):\n log_fn(log_name, image, step)", "def log_image(self, log...
[ "0.69299495", "0.6862203", "0.6212648", "0.619855", "0.61236614", "0.6035992", "0.6000903", "0.59973085", "0.59945935", "0.5994575", "0.59917325", "0.5952818", "0.59483373", "0.593813", "0.59179693", "0.5897211", "0.5896683", "0.58311635", "0.5816518", "0.58037096", "0.577038...
0.80627126
0
Get an existing log img object reference
def get_log_img_obj(self, log_img_type): if log_img_type in self.log_img_map: return self.log_img_map[log_img_type] else: msg = "error: log_img_type '{}' does not exist in the Logger object.\n".format(log_img_type) msg += "There are currently {} objects saved in the L...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getimage(self):", "def image(self):\n return self._image", "def get_image ( self, object ):\n return self.image", "def getImage(cam):\n\n return cam.getImage()", "def image_reference(self, image_id):\n info = self.image_info[image_id]\n if info[\"source\"] == \"balloon\":\n ...
[ "0.65449005", "0.64309585", "0.63550127", "0.62919086", "0.62624776", "0.62624776", "0.62375873", "0.62375873", "0.62375873", "0.6186268", "0.6169566", "0.6159949", "0.61112523", "0.60648036", "0.60528", "0.6019813", "0.6012564", "0.5965432", "0.5955746", "0.59413415", "0.594...
0.7790943
0
sets the current training step must be called for every new image which should be generated for a new training step
def set_train_step(self, new_train_step): self.train_step = new_train_step # update all childrens -> every LogImg object saved in the map for logimg in self.log_img_map.itervalues(): logimg.set_trainstep(self.train_step)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_step(self):\n pass", "def train_loop_pre(self, current_step):\r\n pass", "def train(self, training_steps=10):", "def training_step(self, **kwargs):\n raise NotImplementedError", "def train_loop_post(self, current_step):\r\n pass", "def on_train_batch_begin(self, step, lo...
[ "0.7835836", "0.7548936", "0.7455401", "0.7404723", "0.7162653", "0.7095082", "0.70790976", "0.69949675", "0.6986452", "0.69293296", "0.69147253", "0.6750946", "0.6750946", "0.6750946", "0.6750946", "0.6750946", "0.67374265", "0.6709535", "0.67073965", "0.6665719", "0.6606311...
0.74016756
4
starts plotting of all previously saved data
def plot_data(self): # plot every log image for log_img in self.log_img_map.itervalues(): log_img.plot()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\r\n self.myOutputs = list()\r\n self.myPlots = list()\r\n self.pause = 0\r\n self.doMPL = False\r\n self.graphLabelsX = []\r\n self.graphLabelsY = []\r\n for i in self.xData.iterkeys():\r\n self.xData[i] = []\r\n self.yData[i] = []\r\n sel...
[ "0.69637775", "0.69121104", "0.69121104", "0.69121104", "0.69121104", "0.69121104", "0.6849632", "0.68403935", "0.6823522", "0.6823135", "0.68141043", "0.68109906", "0.67928714", "0.67577595", "0.6722555", "0.66994137", "0.6601978", "0.6582382", "0.65547043", "0.6544401", "0....
0.0
-1
Check the validity of an AFM number (Greek VAT code). Check if input is a valid AFM number via its check digit (not if it is actually used). Return either True of False. Input should be given as a string. An integer, under certain conditions, could through an exception.
def check_afm(afm): if not isinstance(afm, str): raise TypeError( "check_afm()", "You should feed to this function only strings to avoid exceptions and errors! Aborting." ) if len(afm) == 11 and afm[:2].upper() == "EL": afm=afm[2:] if afm.isdigit() == True and len(afm) == 9: i, sums = 256, 0 fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CheckNumber(userInput):\n try:\n float(userInput)\n return True\n except(ValueError):\n return False", "def input_validation(input_: str) -> bool:\n return fullmatch('[1-9]', input_) is not None", "def valid(f):\r\n try:\r\n return not re.search(r'\\b0[0-9]', f) ...
[ "0.6608858", "0.6412995", "0.64045024", "0.6399352", "0.63957435", "0.63957435", "0.632859", "0.62783635", "0.6233358", "0.6208753", "0.6205611", "0.62022656", "0.61651295", "0.60816836", "0.6072849", "0.60379183", "0.59668356", "0.5966686", "0.5965664", "0.5954444", "0.59408...
0.7674553
0
This method trains the clustering network from scratch if there is no pretrained autoencoder, else it will load the existing pretrained autoencoder to retrieve the latent representation of the images to train the final clustering layer in the convolutional neural network.
def train(args): dataset = args.dataset ae_mode = args.mode train_input, train_labels = load_data(dataset, mode=ae_mode) num_clusters = len(np.unique(train_labels)) data_initialization = dataset_parameters[dataset]['data_initialization'] with_attention = args.attention interval_updation = da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train():\n init_distributed_mode(args)\n save_dir = TRAIN_CFG['save_dir']\n if not os.path.exists(save_dir) and torch.distributed.get_rank() == 0:\n os.mkdir(save_dir)\n kwargs = {}\n # If augmenting data, disable Pytorch's own augmentataion\n # This has to be done manually as augmenta...
[ "0.6275105", "0.61198753", "0.60603017", "0.60560143", "0.60117126", "0.5932849", "0.5908202", "0.58721745", "0.58566064", "0.5848631", "0.58267033", "0.5818534", "0.57857215", "0.5772631", "0.5761682", "0.5756426", "0.5731873", "0.5724584", "0.571866", "0.5717423", "0.571203...
0.7010814
0
Funcion encargada de adquirir conocimientos
def aprender(self, content_name: str, dificultad: int) -> None: if content_name not in self.contents.keys(): self.contents[content_name] = self._content_management(content_name, dificultad) self._contents_lvl[content_name] = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connectionMade(self):\n self.factory.debug = False\n self._snd(\"Codigo de operador:\")", "def CreadorComentario(hora, fecha, contenido, act, usuario): \n nuevoComentario = Comentario(horacomentario=hora, fechacomentario=fecha, contenido=contenido, idactcomentario=act,loginusuario=usuario)\n ...
[ "0.6330961", "0.6246897", "0.6238307", "0.6149837", "0.60814553", "0.60586333", "0.6041782", "0.6010524", "0.5978416", "0.59675205", "0.59191436", "0.586402", "0.57416487", "0.57245475", "0.56545484", "0.5624842", "0.55913025", "0.5560899", "0.54880196", "0.5467104", "0.54302...
0.0
-1
Will calculate all the primes below limit.
def calculate(self, limit: int) -> None: raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPrimes(limit): \n a = range(2,int(sqrt(limit)+1))\n isPrime = [True]*limit\n for n in a:\n if isPrime[n]:\n # for all primes, each multiple of prime from prime*prime to the end must not be prime\n for i in xrange(n*n, limit, n): \n isPrime[i] = False\n ...
[ "0.7655366", "0.75497746", "0.752949", "0.752003", "0.7453741", "0.7369072", "0.7356514", "0.7347591", "0.7254196", "0.72294754", "0.7177693", "0.71562976", "0.71253186", "0.710736", "0.6834905", "0.6784102", "0.6757351", "0.6756486", "0.67514503", "0.6747671", "0.6743722", ...
0.0
-1
Prints the list of primes prefixed with which algorithm made it
def out(self) -> None: print(self.__class__.__name__) for prime in self._primes: print(prime)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def out(self):\r\n print(self.__class__.__name__)\r\n for prime in self.primes:\r\n print(prime)", "def out(self):\n print(self.__class__.__name__)\n for prime in self.primes:\n print(prime)", "def print_next_prime(number):\n index = number\n while True:\...
[ "0.7165557", "0.7116424", "0.6398169", "0.63618255", "0.6310999", "0.5986278", "0.59604704", "0.5959969", "0.5911979", "0.5865329", "0.58519715", "0.5849108", "0.5772535", "0.5736948", "0.570392", "0.57023376", "0.56931543", "0.5693113", "0.5683457", "0.56555647", "0.56455696...
0.7041005
2
Picks the first connection based on the best three connections possible.
def pick_first_connection(self): self.best_connection = [] stations = list(self.grid.stations.values()) # add a first station to the track for station in stations: self.track = Track(f"greedy_track_{self.count}", self.grid) self.track.add_station(self.grid, sta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def choose_serial_connection(potential_connections):\n for connection in potential_connections:\n if os.path.exists(connection):\n return connection\n return None", "def _pick_server(self, key, inport): #key = ipp.srcip, ipp.dstip, tcpp.srcport, tcpp.dstport\n\n if len(se...
[ "0.6265498", "0.62159556", "0.5885226", "0.58790165", "0.5841181", "0.5781805", "0.5763767", "0.5667359", "0.56560063", "0.55838865", "0.5580121", "0.5565697", "0.554023", "0.551508", "0.5456506", "0.5409392", "0.54023296", "0.53600425", "0.5354556", "0.5351314", "0.53210104"...
0.7276076
0
Picks the next station based on the three connections that produce the best score.
def pick_next_station(self, station): self.best_score = 0 stations = self.grid.stations # all connections of the last added added station lookahead_1 = self.grid.get_station(self.best_connection[1]).connections for la1 in lookahead_1.values(): next_station = la1[0]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pick_first_connection(self):\n self.best_connection = []\n stations = list(self.grid.stations.values())\n\n # add a first station to the track \n for station in stations:\n self.track = Track(f\"greedy_track_{self.count}\", self.grid)\n self.track.add_station(...
[ "0.7436752", "0.6377942", "0.6055019", "0.56210613", "0.56195927", "0.55932504", "0.5592113", "0.5579121", "0.55658734", "0.553037", "0.5499738", "0.54976356", "0.5447143", "0.54371697", "0.54167473", "0.54167473", "0.54080623", "0.5369538", "0.53499717", "0.5339296", "0.5330...
0.83878165
0
Predicts the sound class (0 > Kick, 1 > Snare) for a single sound using an XGBoost model
def predictSoundClass(sound, boostModel, sampleRate=44100, nCoeffs=32): sound = util.normalize(sound) mfcc = extractFeatures(sound, sampleRate, nCoeffs) mfcc = mfcc.reshape(1, len(mfcc)) dTest = xgb.DMatrix(mfcc) return boostModel.predict(dTest)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(x):\n\n scores = np.zeros(shape=(len(classes_def), len(x)))\n\n for idx, c in enumerate(classes_def):\n\n model_name = model_name_pre + c + model_name_post\n print('Loading model', model_name, 'and making predictions..')\n model = load_model(model_name)\n\n scores[idx]...
[ "0.6329133", "0.6319796", "0.601781", "0.6012411", "0.59950215", "0.59683543", "0.5959344", "0.5959344", "0.5952556", "0.59423214", "0.59318", "0.59194446", "0.5901314", "0.5898736", "0.5898736", "0.5898736", "0.5892773", "0.5889295", "0.58853424", "0.5880142", "0.5864906", ...
0.70426357
0
Get a amenity with id as amenity_id
def get_amenity(amenity_id): try: amenity = Amenity.get(Amenity.id == amenity_id) except Exception: return {'code': 404, 'msg': 'Amenity not found'}, 404 return amenity.to_dict(), 200
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def amenity_get_by_id(amenity_id):\n obj = storage.get(\"Amenity\", amenity_id)\n if obj is None:\n abort(404)\n else:\n return jsonify(obj.to_dict())", "def amenities_id(amenity_id):\r\n for val in storage.all(\"Amenity\").values():\r\n if val.id == amenity_id:\r\n re...
[ "0.77794546", "0.770642", "0.76352286", "0.7437263", "0.7428258", "0.7405687", "0.7220406", "0.7220406", "0.71572345", "0.71449107", "0.7110059", "0.7098071", "0.70148665", "0.69844514", "0.69547874", "0.6646272", "0.6347817", "0.6306251", "0.62925506", "0.6254703", "0.624444...
0.77215296
1
Delete amenity with id as amenity_id
def delete_amenity(amenity_id): try: amenity = Amenity.get(Amenity.id == amenity_id) except Exception: return {'code': 404, 'msg': 'Amenity not found'}, 404 amenity = Amenity.delete().where(Amenity.id == amenity_id) amenity.execute() res = {} res['code'] = 201 res['msg'] = "A...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def amenity_delete(amenity_id=None):\n obj = storage.get(\"Amenity\", amenity_id)\n if obj is None:\n abort(404)\n storage.delete(obj)\n storage.save()\n return jsonify({}), 200", "def amenities_delete(amenity_id):\r\n amenities = storage.get(\"Amenity\", amenity_id)\r\n if amenities ...
[ "0.828099", "0.81136984", "0.80685514", "0.79795176", "0.7977136", "0.7969661", "0.79693115", "0.7922059", "0.78571624", "0.78356045", "0.77734894", "0.7765752", "0.7712711", "0.7606925", "0.7024841", "0.6947486", "0.6862664", "0.6641325", "0.65328556", "0.6338358", "0.633196...
0.82829297
0
Delete amenities with id as amenity_id and place with id as place_id
def delete_place_amenities(place_id, amenity_id): try: delete = PlaceAmenities.delete().where( PlaceAmenities.amenity == amenity_id, PlaceAmenities.place == place_id ) delete.execute() res = {} res['code'] = 200 res['msg'] = 'Amenity deleted su...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_amenity_place(place_id, amenity_id):\n place = storage.get(Place, place_id)\n if place is None:\n abort(404, description=\"Not Found\")\n amenity = storage.get(Amenity, amenity_id)\n if amenity is None:\n abort(404, description=\"Not Found\")\n if amenity in place.amenities:...
[ "0.82304513", "0.8189802", "0.7973082", "0.7140258", "0.6936414", "0.68594134", "0.66304946", "0.6570661", "0.6530816", "0.64950216", "0.6485565", "0.646877", "0.6443163", "0.64373386", "0.6418685", "0.64175266", "0.6345153", "0.62653947", "0.5971674", "0.58708566", "0.585538...
0.8434596
0
Return a rate to convert the metric data to new unit, as below. value in old unit / rate = value in new unit
def get_conversion_rate(self, old_unit, new_unit): for i in [old_unit, new_unit]: if i not in self.units: raise Exception("Can't find unit %s in unitgroup '%s'" % (i, self.name)) return float(self.units[new_unit]) / float(self.units[old_unit])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_conversion_rate(self, newunit):\n if not self.unit or not self.unitgroup:\n logging.error(\"Metric %s can't be converted into %s unit. \"\n \"Please correct your config file.\" % (self.name,\n newunit)...
[ "0.70476955", "0.67164433", "0.6425538", "0.6421992", "0.63206935", "0.6272851", "0.6172931", "0.61639756", "0.6147183", "0.60993135", "0.6065548", "0.60554105", "0.59908634", "0.59607494", "0.5956799", "0.594856", "0.5939248", "0.59317255", "0.59281486", "0.5904123", "0.5901...
0.74816525
0
Return a rate to convert the metric data to new unit. The rate is used by rddtool graph command when it plots data in
def get_conversion_rate(self, newunit): if not self.unit or not self.unitgroup: logging.error("Metric %s can't be converted into %s unit. " "Please correct your config file." % (self.name, newunit)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculateDataRate(self):\n pass", "def data_rate(self):\n return self._data_rate", "def _set_rate(self):\r\n interval = self.data.iloc[2, 0] - self.data.iloc[1, 0]\r\n self.rate = int(1 / interval)", "def getRate(self, context):\n try:\n return VTypeHelper.toDoub...
[ "0.69777024", "0.6721418", "0.6607883", "0.64402974", "0.6414736", "0.6262416", "0.6235003", "0.622903", "0.62074363", "0.6153343", "0.6146153", "0.60968655", "0.6064997", "0.6048295", "0.60335237", "0.60298145", "0.59791243", "0.59715265", "0.5950004", "0.59355766", "0.59228...
0.6657861
2
Return host metric data in a dictionary. The dictionary contains one item for each host. Item"s key is host name, value is a list of data for that host.
def get_host_data(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def host(self, host):\n if host in self.hosts_:\n vals = defaultdict(list)\n for k, value in [(x.key.lower(), x.value) for x in self.lines_\n if x.host == host and x.key.lower() != \"host\"]:\n vals[k].append(value)\n flatten = lamb...
[ "0.69064766", "0.6864215", "0.6533225", "0.65282434", "0.6335546", "0.6288289", "0.6281394", "0.62452465", "0.62399286", "0.6108026", "0.60803044", "0.60676736", "0.6064665", "0.6025634", "0.60003966", "0.5985068", "0.5984302", "0.5962639", "0.59510255", "0.5923121", "0.59162...
0.622131
9
Return VM metric data in a dictionary. The dictionary contains one item for each VM. Item"s key is VM name, value is a list of data for that VM.
def get_vm_data(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dictionary_of_metrics(items):\n \n n = len(items)\n average = round(np.mean(items), 2)\n median = round(np.median(items), 2)\n variance = round((sum((items-np.mean(items))**2))/(n-1), 2)\n standard_dev = round(((sum((items-np.mean(items))**2))/(n-1))**(1/2), 2)\n minimum = round(min(items)...
[ "0.60503286", "0.602742", "0.6023256", "0.595561", "0.5887822", "0.5782654", "0.57645106", "0.5749168", "0.57422394", "0.5700768", "0.56864053", "0.5673518", "0.5614287", "0.5600943", "0.56006455", "0.5563289", "0.55619323", "0.54891676", "0.5464899", "0.5460758", "0.54570776...
0.5511393
17
Return host names in a list.
def get_hosts(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def host_names(self):\n resp = self._cmd(uri = '/jenkins_hosts')\n names = []\n for item in resp.get('hosts'):\n names.append(item.get('host_name'))\n return sorted(names)", "def hostnames(self) -> Sequence[str]:\n return pulumi.get(self, \"hostnames\")", "def host...
[ "0.74767536", "0.7449043", "0.7095403", "0.70601505", "0.7057628", "0.6986617", "0.69683075", "0.6916557", "0.6910897", "0.6748414", "0.6656599", "0.66423064", "0.6610463", "0.6543629", "0.6512256", "0.65032697", "0.64719445", "0.6442846", "0.63579786", "0.6349816", "0.632885...
0.648158
16
Return VM names in a list.
def get_vms(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_vms(self):\n available_servers = self.connection.compute.servers()\n if available_servers:\n vm_names = [server.name for server in available_servers]\n return vm_names\n else:\n return []", "def namelist(self):\n return self._handle.getname...
[ "0.6857751", "0.6257477", "0.6257477", "0.62266254", "0.6208366", "0.6189442", "0.6163711", "0.6163711", "0.61337614", "0.6127522", "0.6100707", "0.6092303", "0.60783094", "0.60692805", "0.6014205", "0.6013253", "0.5946138", "0.5943979", "0.5941075", "0.5940607", "0.5915667",...
0.5477774
60
Return the fields of a host data record in a list.
def get_host_data_fields(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_fields(fc):\n return [f.name for f in arcpy.ListFields(fc)]", "def extractFields(deerfootRDDRecord):\n fieldsList = deerfootRDDRecord.split(\",\")\n return (fieldsList[0], [fieldsList[1], fieldsList[15], fieldsList[46]])", "def listFields(self):\n return self.get_json('/field')", "de...
[ "0.6213986", "0.60264015", "0.5972971", "0.5965215", "0.59143746", "0.58616215", "0.5858335", "0.5854301", "0.58492804", "0.58246523", "0.58062214", "0.5797772", "0.5766629", "0.57091284", "0.5703255", "0.5699028", "0.56777984", "0.5672483", "0.566576", "0.56613034", "0.56385...
0.66660905
0
Return the fields of a VM data record in a list.
def get_vm_data_fields(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fields(self, pager=None):\n return Field.deserialize_list(self._get_multiple('fields', {}, pager))", "def list_fields(fc):\n return [f.name for f in arcpy.ListFields(fc)]", "def listFields(self):\n return self.get_json('/field')", "def get_fieldlist(cls):\n return cls.fieldlis...
[ "0.6668574", "0.64598054", "0.6448825", "0.63467366", "0.63245344", "0.6320131", "0.6319845", "0.631197", "0.62458086", "0.6242731", "0.6185522", "0.61597586", "0.6136137", "0.61244106", "0.60978943", "0.60761255", "0.6071319", "0.6056425", "0.60514027", "0.6050539", "0.59907...
0.656898
1
Return data time information in a tuple.
def get_time_info(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_time_info(self, keys: list[str]):\n if self.is_info_v2:\n if not self.is_on:\n return 0\n return self.int_or_none(self._data.get(keys[1]))\n return self._data.get(keys[0])", "def CopyToStatTimeTuple(self):\n if self._number_of_seconds is None:\n ...
[ "0.6896615", "0.6830696", "0.67479175", "0.6706535", "0.6693293", "0.6687859", "0.6653777", "0.65909964", "0.6582156", "0.6582156", "0.6352521", "0.6329912", "0.63027865", "0.6289983", "0.6285771", "0.6283323", "0.62765485", "0.62752587", "0.62750447", "0.6242026", "0.6214285...
0.7061362
0
Return host output files in a tuple.
def get_host_outfiles(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_output_files(self):\r\n fname = self.__get_output_filename()\r\n return [fname] if fname else []", "def output_files(self):\n return [self.input_files()[0].replace(\".lhe.gz\", \".stdhep\").replace(\".lhe\", \".stdhep\")]", "def output_files(self):\n output_files = []\n for ...
[ "0.6888449", "0.66737944", "0.6598473", "0.6436748", "0.6293716", "0.6286534", "0.628374", "0.6179701", "0.60801107", "0.60670453", "0.5928418", "0.5906354", "0.5890646", "0.5887146", "0.5846622", "0.5820629", "0.58062935", "0.58001685", "0.57891005", "0.578708", "0.5781865",...
0.7225652
0
Return VM output files in a tuple.
def get_vm_outfiles(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_output_files(self):\r\n fname = self.__get_output_filename()\r\n return [fname] if fname else []", "def _list_outputs(self):\n outputs = self._outputs().get()\n\n out_dir = os.path.abspath(os.path.join(os.getcwd(), \"slicesdir\"))\n outputs[\"out_dir\"] = out_dir\n ...
[ "0.7118414", "0.6668537", "0.66680706", "0.66119856", "0.6590606", "0.6571721", "0.6446606", "0.64158994", "0.6320247", "0.6251037", "0.6235383", "0.619133", "0.61899394", "0.60789007", "0.60338473", "0.59975857", "0.5989016", "0.5984177", "0.5969433", "0.59565455", "0.594525...
0.74231887
0
Return output files containing combined graphs.
def get_allinone_outfiles(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def combineAllGraphFiles(chroms, final_out):\n outfile = open(final_out,'w');\n outfile.close();\n \n for chrom in chroms:\n graph_file = chrom + \".graph\";\n try:\n if os.system('%s %s >> %s' %\n (cat, graph_file, final_out)): raise\n except: sy...
[ "0.72057337", "0.6788363", "0.6708171", "0.6602823", "0.6285616", "0.6230171", "0.6176956", "0.6108693", "0.6098703", "0.6081117", "0.6059472", "0.5961873", "0.5959622", "0.5940123", "0.59289587", "0.58237875", "0.5809237", "0.5809181", "0.5778907", "0.5776773", "0.5772133", ...
0.5373504
48
Initialize a CSVFile object with a directory. The directory is CBTOOL experiment result directory generated by monextract command. It contains a few CSV files. Among those files, one contains host OS metric data, and another VM OS metric data.
def __init__(self, expdir): self.expdir = expdir self.expid = basename(expdir) self.host_csvfile = "%s/%s_%s.csv" % (expdir, self.HOST_FILE_PREFIX, self.expid) self.host_data = {} self.host_data_fields = [] self.host_outfiles...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __openAndInitCSVFile(self, modelInfo):\n # Get the base path and figure out the path of the report file.\n basePath = self.__outputDirAbsPath\n\n # Form the name of the output csv file that will contain all the results\n reportCSVName = \"%s_Report.csv\" % (self.__outputLabel,)\n reportCSVPath =...
[ "0.6246445", "0.6127223", "0.6095094", "0.60938084", "0.6007543", "0.59912115", "0.58670706", "0.5842792", "0.5808693", "0.57927597", "0.5757253", "0.57462543", "0.57432365", "0.57250065", "0.57250065", "0.56792647", "0.56714016", "0.5650973", "0.5606621", "0.5605827", "0.557...
0.61461604
1
Implement DataSource.get_hosts() method. The returned host names are sorted in alphabetic order.
def get_hosts(self): return sorted(self.host_data.keys())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_hosts(self):\n\n raise NotImplementedError", "def getHosts(self):\n raise \"not implemented\"", "def hosts(self) -> t.List[str]:\n if not self._hosts:\n self._hosts = self._get_db_hosts()\n return self._hosts", "def host_names(self):\n resp = self._cmd(ur...
[ "0.81791395", "0.785863", "0.77301955", "0.74106723", "0.7362429", "0.7362429", "0.7345172", "0.7278661", "0.7235248", "0.72335577", "0.7223325", "0.72067803", "0.71669626", "0.7105632", "0.7082958", "0.7082958", "0.69979745", "0.69384414", "0.6874702", "0.68602747", "0.68349...
0.82562816
0
Implement DataSource.get_vms() method. VM names in CSV files are of "vm_" format. The returned VM names are sorted in integer id order.
def get_vms(self): vms = [v for v in self.vm_data.keys()] vms.sort(lambda x, y: cmp(int(x[3:]), int(y[3:]))) return vms
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vms(self):\n\n raise NotImplementedError", "def get_vms(self, user=None, count=None):\n crit = dict()\n if count is not None:\n crit['count'] = count\n s = self._NDL_API('getvms', crit, user)\n if len(s) == 0:\n return []\n ips = s.split(','...
[ "0.5869199", "0.5651854", "0.55376905", "0.551105", "0.5461269", "0.54513437", "0.544437", "0.5337419", "0.5264466", "0.52439404", "0.5195252", "0.5182719", "0.51786023", "0.51264375", "0.5096237", "0.5057847", "0.5049899", "0.503902", "0.5005499", "0.49837598", "0.49673596",...
0.62985337
0
Read metric data from a CSV file.
def parse_csvfile(self, csvfile): logging.info("Parseing csvfile: %s" % basename(csvfile)) fields = [] data = {} try: with open(csvfile) as f: for line in f: line = line.strip() # Skip empty or commented line ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_metrics(fp):\r\n with open(fp) as csvfile:\r\n read = csv.reader(csvfile, delimiter=\",\", quotechar='\"')\r\n lst = []\r\n for i in read:\r\n new_row = i[0:2] + i[7:-1]\r\n lst.append(new_row)\r\n data = np.array(lst)\r\n return data", "def read_c...
[ "0.74477535", "0.72119755", "0.716451", "0.707749", "0.6992739", "0.67674613", "0.67209613", "0.66542745", "0.66535604", "0.66258454", "0.6613848", "0.6609793", "0.65608454", "0.65530956", "0.6535945", "0.6531946", "0.6514031", "0.6471657", "0.63800776", "0.6367226", "0.63314...
0.62869793
23
Parse a datatime string and return seconds since epoch.
def parse_timestr(self, timestr): epoch = datetime.datetime(1970, 1, 1, 0, 0, 0, 0, tzutc()) return int((parsedate(timestr) - epoch).total_seconds())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_time(s):\n\n dt = dateutil.parser.parse(s)\n# epoch_time = int((dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds())\n epoch_time = int(dt.replace(tzinfo=timezone.utc).timestamp())\n\n return epoch_time", "def datumToSeconds(timestr):\n return (datetime.datetime(int(timestr.s...
[ "0.76526344", "0.7463628", "0.682279", "0.6693088", "0.6685308", "0.65293956", "0.6505844", "0.6494147", "0.6421463", "0.64137083", "0.63933265", "0.63811636", "0.6282634", "0.62804013", "0.62677103", "0.62677103", "0.6256727", "0.6202523", "0.6202523", "0.6192253", "0.618009...
0.76556337
0
Initialize a RRDToolDB object.
def __init__(self, node, type, ds, mr, rrdtool_step): self.node = node if type == "host": self.data = ds.get_host_data()[node] self.topdir, self.file_prefix, outfiles = ds.get_host_outfiles() self.outfiles = outfiles[self.node] elif type == "vm": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(self):\n\n db = dict()\n\n db['meta'] = Meta(None)\n db['race'] = Race(None, None, None, None, None)\n db['track'] = Track(None, None)\n db['classes'] = set([])\n db['teams'] = set([])\n db['drivers'] = set([])\n\n self.db = db", "def __init_...
[ "0.68311155", "0.6826516", "0.67962766", "0.6766787", "0.6753073", "0.67380023", "0.66616017", "0.6656998", "0.6615077", "0.65841395", "0.65815353", "0.6576277", "0.65246594", "0.65041393", "0.649233", "0.6478575", "0.6469952", "0.64187014", "0.640127", "0.6388728", "0.638636...
0.61698735
46
Plot graph using information in graphinfo object.
def plot_graph(self, graphinfo): WIDTH = 450 HEIGHT = WIDTH * 0.55 opts = [] # Generate outfile name if not self.rrdfile: self.outfiles[graphinfo.name] = self.SKIPPED return logging.info("Plotting %s graph for %s" % (graphinfo.name, self.node)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_graph(self) -> None:", "def _PlotGraph(self, event):\n self._rcvLock.acquire()\n for j in event.data[0].keys():\n data = event.data[0][j]\n #print data\n line = []\n for k in data.keys():\n if k in COLORS.keys():\n ...
[ "0.77446437", "0.6901284", "0.6651679", "0.66496754", "0.65762436", "0.6498491", "0.64938074", "0.64504176", "0.64067835", "0.6402517", "0.63337934", "0.6324918", "0.6258363", "0.6218747", "0.620347", "0.6173851", "0.6162113", "0.61547357", "0.6136123", "0.6123041", "0.612050...
0.74431366
1
A wrapper of rrdtool functions, with additional logging function.
def rrdtool_cmd(self, cmd, *args, **kwargs): fn_table = {"create": rrdtool.create, "update": rrdtool.update, "graph": rrdtool.graph} fn = fn_table[cmd] cmdline = "rrdtool %s %s" % (cmd, " ".join([i if isinstance(i, str) else " ".join(i) for i ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logger():\n return RPLogger('pytest_reportportal.test')", "def rrd(*args):\n # We have one rrdtool instance per thread\n global _rrdtool\n thisThread = threading.currentThread()\n if not thisThread in _rrdtool:\n _rrdtool[thisThread] = popen2.Popen3(\"rrdtool -\")\n rrdtool = _rrdtoo...
[ "0.56776714", "0.56146", "0.55475384", "0.55475384", "0.5509798", "0.5460044", "0.5414567", "0.5409551", "0.5404668", "0.53456235", "0.53394705", "0.5327236", "0.53170985", "0.5291978", "0.5214487", "0.52052015", "0.5194438", "0.51273423", "0.5111953", "0.51106703", "0.508304...
0.6281851
0
Combine graphs for each host, each VM, and each type of graph. The function gets generated graphs from ds object, and combine them for each host, each VM, and each type of graph.
def combine_graphs(cls, ds, gr): topdir, file_prefix, outfiles = ds.get_allinone_outfiles() # For each host, combine all its graphs _, _, host_outfiles = ds.get_host_outfiles() for node in ds.get_hosts(): logging.info("Combining graphs for %s" % node) graphs = [...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def graph_create(host, host_path):\n graphs = list()\n for name in dash_profile['graphs']:\n log.info(\" Graph: %s\" % name)\n graph = list()\n # Skip undefined graphs\n if name not in graphdef.keys():\n log.error(\"%s not found in graphdef.yml\" % name)\n c...
[ "0.6458627", "0.6350494", "0.6022526", "0.5996724", "0.5935758", "0.58955854", "0.5857132", "0.57133496", "0.56948525", "0.5680493", "0.5671144", "0.5665709", "0.56493074", "0.56467503", "0.5636302", "0.5604065", "0.5592455", "0.5575804", "0.5561434", "0.5543002", "0.5527179"...
0.8009694
0
Combine multiple images vertically.
def combine_graphs_vertically(cls, graphs, newgraph): # Calculate width and height for the new graph imgs = [Image.open(f) for f in graphs] width, height = (0, 0) for i in imgs: w, h = getattr(i, "size") if w > width: width = w height ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def concat_images_vert(imga, imgb):\n ha,wa = imga.shape[:2]\n hb,wb = imgb.shape[:2]\n max_width = np.max([wa, wb])\n total_height = ha+hb\n new_img = np.zeros(shape=(total_height, max_width, 3), dtype=np.uint8)\n new_img[:ha,:wa]=imga\n #new_img[:hb,wa:wa+wb]=imgb\n new_img[ha:ha+hb,:wb]=...
[ "0.7169056", "0.715736", "0.7147293", "0.70633274", "0.69313425", "0.69029987", "0.68982524", "0.687417", "0.68651325", "0.6738004", "0.67376196", "0.6660112", "0.664066", "0.66142523", "0.65624243", "0.6554687", "0.6548402", "0.6500419", "0.6485709", "0.62753296", "0.6231157...
0.58971417
36
Set transparency to a color The function returns a new color code in RRGGBBAA format.
def alpha(cls, rgb_color, transparency): if transparency > 1: transparency = 1 elif transparency < 0: transparency = 0 return rgb_color + str(hex(int(254 * transparency)))[2:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_transparent_color(color: Color, transparency: float):\r\n return color[0], color[1], color[2], transparency", "def alpha(c, alpha):\n c = mpl.colors.to_rgb(c) + (alpha,)\n return mpl.colors.to_hex(c, keep_alpha=True)", "def _set_transparency(self, transparency, elm):\n a = str(100 - tr...
[ "0.78209764", "0.73038715", "0.7302642", "0.7206615", "0.6976027", "0.68748236", "0.6650054", "0.64086324", "0.64055395", "0.63803023", "0.6362796", "0.6257481", "0.62436134", "0.62134147", "0.621271", "0.6188674", "0.6172513", "0.6168444", "0.6161709", "0.61255264", "0.61204...
0.82165104
0
Load config file and instantiate UnitGroup, Metric and Graph objects.
def initialize(config_file): config = Config(config_file) # Instantiate UnitGroup objects, based on definition in config file. ugregistry = {} for ugname, ugcfg in config["unit_groups"].items(): ugobj = UnitGroup(ugname) for unit, value in ugcfg.items(): ugobj.add(unit, val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, unit_system: Literal[\"metric\", \"imperial\"], vertical_axis: Literal[\"Y\", \"Z\"] = 'Y'):\n self.settings = Settings(unit_system, vertical_axis)\n self.nodes = Nodes()\n self.members = Members()\n self.plates = Plates()\n self.meshed_plates = MeshedPlates()\...
[ "0.6170909", "0.615522", "0.61503947", "0.6127943", "0.60802895", "0.59707385", "0.5952361", "0.5900908", "0.58998567", "0.5868946", "0.5859573", "0.5854684", "0.5832521", "0.5830994", "0.5809213", "0.5793956", "0.57823586", "0.5777671", "0.5761102", "0.574937", "0.5740909", ...
0.7923505
0
Called with concatenated inputs.
def output(self, _in, out, **kwds): out.write(_in.read())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_inputs(self, inputs):", "def processInputs(self):", "def add_inputs(self, inputs):\n self.inputs += inputs", "def apply(self, inputs):\n raise NotImplementedError()", "def call(self, inputs):\n raise NotImplementedError", "def __call__(self, *inputs):\n raise NotImplemente...
[ "0.72767144", "0.68952537", "0.68802387", "0.66793346", "0.66559815", "0.6575727", "0.6424521", "0.632717", "0.62853605", "0.61507374", "0.60552895", "0.60506797", "0.60207206", "0.59887767", "0.5986514", "0.5977692", "0.59692264", "0.59556097", "0.5953001", "0.59425753", "0....
0.0
-1
Called to filter the inputs to this filter.
def input(self, _in, out, **kwds): content = _in.read() # Build up content to replace css_code = '' js_code = '' for css_name in self.css: for url in self.env[css_name].urls(): css_code += '<link rel="stylesheet" href="%s" type="text/css"/>\n' % url for js_na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter(self, filters):", "def filter(self, *args, **kwargs):", "def filter(self, filter_dict):\n pass", "def _filterfunc(self,*args,**kwargs):\n self._filterfunc = self.f\n return self.f(*args,**kwargs)", "def filter(self, *args):\n return _libsbml.ElementFilter_filter(self,...
[ "0.76750314", "0.76543945", "0.70859987", "0.68555427", "0.6752503", "0.6750072", "0.6669779", "0.6648749", "0.6634073", "0.6601129", "0.65998805", "0.65816885", "0.6581263", "0.648067", "0.6472967", "0.6455984", "0.6391022", "0.6387921", "0.6367822", "0.632678", "0.63219494"...
0.0
-1
This function opens and reads the file containg usernames and passwords.
def read_file(): # Create a file object called login_details, and give option to read file login_details = open("login_details.txt","r") # Create a list containing each line of login_details. List is called contents contents = login_details.readlines() login_details.close() return contents
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_login_file(fpath):\n with open(fpath) as f:\n name = f.readline().rstrip('\\n')\n passwd = f.readline().rstrip('\\n')\n return name, passwd", "def Load(self, filename):\n logging.info(\"Reading users file at %s\", filename)\n try:\n try:\n contents = utils.ReadFile(filename)\n ...
[ "0.76383704", "0.7196941", "0.71372074", "0.70621103", "0.6966878", "0.6893187", "0.6792541", "0.6549849", "0.63931286", "0.63850284", "0.63803875", "0.6363537", "0.6357971", "0.6305648", "0.6302588", "0.6248524", "0.6227911", "0.6190821", "0.61836797", "0.61142766", "0.60869...
0.6922845
5
This function asks user if they are logging in or registering
def get_choice(): choice = input("Would you like to login/register: ") return choice
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login(self):\n\t\twhile True:\n\t\t\tos.system('clear')\n\t\t\tprint(\"1. Sign in\")\n\t\t\tprint(\"2. Sign up\")\n\t\t\tchoice = input()\n\t\t\tif choice == \"1\":\n\t\t\t\tbreak\n\t\t\telse:\n\t\t\t\tself._sign_up()\n\n\t\twhile self._input():\n\t\t\tos.system(\"clear\")\n\t\t\tprint(\"Wrong username or pass...
[ "0.728322", "0.7134307", "0.7030127", "0.7030127", "0.68705314", "0.6842779", "0.683843", "0.67836773", "0.67504644", "0.6706167", "0.6701227", "0.6684802", "0.66330236", "0.6616314", "0.659495", "0.6550032", "0.65439117", "0.6543884", "0.6526391", "0.6453705", "0.6451095", ...
0.6917074
4
This function tells a user attempting to login that either the username or password, or both, were wrong.
def details_not_matching(): print("login details don't match.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_wrong_login_input(self):\n self.user.list_of_accounts = [{'username': 'dalton',\n 'pwd': 'chromelegend',\n 'email': 'legionless@yahoo.com'}]\n msg = self.user.login(\"legionless@yahoo.com\", \"legendchrome\")\n ...
[ "0.7418747", "0.73022175", "0.71493345", "0.7142716", "0.70497406", "0.7020387", "0.6977966", "0.691081", "0.6910784", "0.6896649", "0.68691635", "0.68573815", "0.68212044", "0.6767714", "0.6760063", "0.6731818", "0.67253214", "0.669996", "0.6691038", "0.6669218", "0.66669416...
0.64375275
46
This function checks if the username being entered exists in the text file. While taken usernames are being entered, the user is prompted for a new one. Only details with unique username are added to the text file.
def check_registration_details(username, password): contents = read_file() while ((username + '\n') in contents): print("Sorry! This username is taken..") username = get_username() password = get_password() add_details(username, password)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_find(file):\n username1 = input(\"Enter your username: \")\n username = username1.lower()\n for row in file:\n if row[0] == username:\n print(\"\\n username found \" + username +\"\\n\")\n user_found = [row[0],row[1]]\n pass_check(user_found)\n g...
[ "0.7662307", "0.6793095", "0.66563344", "0.6564982", "0.6513607", "0.6472383", "0.644965", "0.6377841", "0.63619727", "0.63443094", "0.6267576", "0.6248461", "0.6202253", "0.61871177", "0.60983133", "0.60960597", "0.6069588", "0.60584617", "0.60576737", "0.6053954", "0.605265...
0.7357108
1
This function adds correct details to the text file
def add_details(username, password): login_details = open("login_details.txt","a") login_details.write(username + "\n" + password + "\n") login_details.close() welcome_user(username) start()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def notest_file(text):\n if debug == 2:\n print(text)\n with open(\"info_file.txt\", \"a\", encoding=\"utf-8\", ) as f:\n f.write(text + \"\\n\")\n elif debug == 1:\n with open(\"info_file.txt\", \"a\", encoding=\"utf-8\", ) as f:\n f.write(text + \"\\n\")", "def ...
[ "0.69661003", "0.62447304", "0.6228062", "0.61662215", "0.6147956", "0.6117651", "0.6091805", "0.604744", "0.59951174", "0.5987553", "0.5959223", "0.59532696", "0.59102815", "0.58903915", "0.5872346", "0.58506405", "0.5848146", "0.58377904", "0.58331084", "0.5802298", "0.5792...
0.5678864
35
The main login and registration setup
def start(): choice = get_choice() choice = check_valid_option(choice) if choice == "login": contents = read_file() #print((contents)) if len(contents) == 1: print("Start an account and be our first member!") start() else: #print("...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login():", "def login():", "def login(self):", "def __init__(self):\r\n self.load_config()\r\n self.login()", "def login(self):\n\t\treturn", "def login():\n pass", "def _login(self, *args, **kwargs):\n pass", "def initialize(self):\n self.login()", "def login():\...
[ "0.74992186", "0.74992186", "0.7332048", "0.7211739", "0.7156991", "0.7054745", "0.69978404", "0.68534017", "0.6849122", "0.6827969", "0.67428875", "0.6719723", "0.6710744", "0.6703444", "0.6701009", "0.6657186", "0.6657186", "0.6657186", "0.6657186", "0.6636502", "0.66235757...
0.6002597
84
Get the WoS ID and MAG ID from a paperinfo json file
def get_wos_id(path_to_json): data = json.loads(path_to_json.read_text()) return (data.get('wos_id'), data.get('mag_id'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mp_info(mp_id):\r\n # pulling the json object from file\r\n j = get_mp_json_from_file(mp_id)\r\n\r\n votes = {}\r\n\r\n for item in j:\r\n if item.startswith('public_whip_dreammp'):\r\n\r\n key = item.replace('public_whip_dreammp', '')\r\n vote_id = re.findall(r'\\d+', ...
[ "0.5925384", "0.57665193", "0.57649213", "0.5484075", "0.53541416", "0.5328685", "0.5327472", "0.531801", "0.52699614", "0.5245115", "0.52148813", "0.5208454", "0.5204211", "0.5177082", "0.5166915", "0.5150425", "0.5139891", "0.513928", "0.5125608", "0.51210254", "0.5119743",...
0.6920304
0
Generate nodes in strongly connected components of graph.
def strongly_connected_components(G): preorder={} lowlink={} scc_found={} scc_queue = [] i=0 # Preorder counter for source in G: if source not in scc_found: queue=[source] while queue: v=queue[-1] if v not in preorder: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stronglyConnectedComponents(graph):\n indexCounter = [0]\n stack = []\n lowLinks = {}\n index = {}\n result = []\n\n def strongConnect(node):\n index[node] = indexCounter[0]\n lowLinks[node] = indexCounter[0]\n indexCounter[0] += 1\n stack.append(node)\n\n t...
[ "0.6806543", "0.68018043", "0.67945236", "0.671381", "0.6700505", "0.6503083", "0.6490845", "0.64448243", "0.6427107", "0.6369077", "0.6333589", "0.63292366", "0.63143605", "0.6306746", "0.6296139", "0.6266689", "0.62107134", "0.6139004", "0.6129281", "0.6109264", "0.6086888"...
0.63541424
10
Compute metrics for predicted recommendations.
def evaluate(topk_matches, test_user_products, num_recommendations, brand_dict): invalid_users = [] # Compute metrics precisions, recalls, ndcgs, hits, fairness = [], [], [], [], [] test_user_idxs = list(test_user_products.keys()) for uid in test_user_idxs: if uid not in topk_matches or len(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate(self, predicted_df):\n logging.info(\"Evaluating model: {}\".format(self.model_type))\n y_true = predicted_df[\"user_label\"].as_matrix()\n y_pred = predicted_df[\"label\"].as_matrix()\n\n scores_cols = [col for col in predicted_df.columns if col.startswith(\"scores_\")]\n ...
[ "0.6988709", "0.6850883", "0.6846707", "0.68143374", "0.67566925", "0.6752251", "0.67470825", "0.6721156", "0.6720654", "0.66740644", "0.66664124", "0.6655537", "0.66448474", "0.6623564", "0.661366", "0.6608693", "0.66018337", "0.6593844", "0.658284", "0.6574573", "0.65669096...
0.0
-1
Check if any scheduled time is up.
def is_triggered(self, curr_time: pd.Timestamp, state) -> bool: if self._n_passed >= len(self._schedule): return False else: next_trigger_time = self._schedule[self._n_passed] if next_trigger_time > curr_time: return False else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkUpstreamScheduler():", "def must_run(self):\r\n self.current_time = datetime.now()\r\n return all([self._minute(), self._hour(), self._day_of_month(), self._month(), self._day_of_week()])", "async def sun_up(self) -> bool:\n return await self.AD.sched.sun_up()", "def precheck(se...
[ "0.7456467", "0.70207775", "0.6900155", "0.688458", "0.6820396", "0.669598", "0.6655484", "0.66494626", "0.66319263", "0.65435404", "0.65263313", "0.65199494", "0.65155554", "0.64741135", "0.64327174", "0.6403302", "0.62911373", "0.6287856", "0.62839675", "0.6265789", "0.6257...
0.5937097
71
get Genre element with list attr
def get_genres(type_: str, value_: str, page: int, step: int): genre = factory.get_elem_list(Genre, type_, value_, page, step) return genre
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _GetAttributeList(node, attr_list=None):\n attr_list = attr_list or []\n if isinstance(node, jinja2.nodes.Getattr):\n attr_list.insert(0, node.attr)\n _GetAttributeList(node.node, attr_list)\n elif isinstance(node, jinja2.nodes.Name):\n attr_list.insert(0, node.name)\n return attr_list", "def ge...
[ "0.6062535", "0.5831022", "0.57182366", "0.5705885", "0.5572966", "0.54356104", "0.5361206", "0.53488874", "0.5309927", "0.5309927", "0.5309927", "0.52968377", "0.5273998", "0.5273998", "0.5234556", "0.518929", "0.5172812", "0.51493555", "0.51339674", "0.5126402", "0.51024354...
0.65601164
0
get Genre element with attrs
def get_genre(id_genre): genre = factory.get_elem_solo(Genre, id_genre) return genre
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_image_attributes(self, element):", "def get_genres(type_: str, value_: str, page: int, step: int):\n genre = factory.get_elem_list(Genre, type_, value_, page, step)\n return genre", "def __getitem__(self, name):\n return self.gattrs[name]", "def find_genres(genre_dom, dom):\n # take t...
[ "0.5788714", "0.57737064", "0.5725627", "0.5615253", "0.56053334", "0.5594965", "0.55769396", "0.55683476", "0.5526234", "0.5526234", "0.55093855", "0.54989445", "0.54989445", "0.5477207", "0.54172635", "0.53392744", "0.5312361", "0.5303174", "0.5301365", "0.5274901", "0.5265...
0.5910385
0
get count genres by type and value
def count_genres(type_: str, value_=''): count = factory.get_elem_count(Genre, type_, value_) return count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_count_genomic_types(self):\n \n result, bed_result = parse_AS_STRUCTURE_dict(\"test\", clipper.test_dir())\n result = count_genomic_types(result)\n \n self.assertDictEqual(result, {\"CE:\" : 14})", "def subtype_counts(node_set, G, log=False):\n subtypes = Counter()\...
[ "0.6092542", "0.6083161", "0.6023084", "0.594775", "0.5827863", "0.5791389", "0.5737511", "0.5697055", "0.5689171", "0.55484855", "0.5522721", "0.54647654", "0.5452232", "0.54305583", "0.5412545", "0.54052013", "0.53957707", "0.5388194", "0.5383729", "0.5371988", "0.5360215",...
0.8488953
0
Extracts and anaylzes the altitude from a raw telemetry string
def process_telemetry_string(telem, nichrome): telemFields = telem.split(",") try: # Check to make sure the string is actually the telemetry data. # This will have to be changed based on what you name your payload if re.match("\$\$\w{1,10}", telemFields[0]) != None: # The 6t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_altitude(self):\n self.degrees = self.altitude_encoder.get_degrees()\n self.tele_altitude = self.Calculations.convert_degrees( self.degrees)\n return self.tele_altitude", "def altitude(press, altimeter=29.92126):\n AS = altimeter*inHg2PA\n print(AS, press**(L*R/g/M))\n h = -...
[ "0.6720805", "0.65445393", "0.65247965", "0.6507956", "0.64723134", "0.62712276", "0.61412066", "0.61412066", "0.60638577", "0.57889676", "0.5782594", "0.5751737", "0.5751737", "0.5707257", "0.56867486", "0.56180745", "0.5610211", "0.5567454", "0.5563814", "0.54588395", "0.54...
0.6671002
1
Sleeps forever, periodically forcing nichrome to stay low (deactivated)
def keepNichromeLow(nichrome): while True: loginfo("Deactivating nichrome again...") nichrome.deactivate() time.sleep(2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lightleep(time_ms: int = None) -> None:", "def fuzz():\n if FUZZ:\n time.sleep(random.random())", "def wait_forever(self):\r\n while True:\r\n time.sleep(0.5)", "def wait(self):\n time.sleep(0.010)", "def _sleep(self):\n while 1:\n diff = (time.time()-self.las...
[ "0.62966967", "0.6132644", "0.60721", "0.5918225", "0.59004706", "0.58737785", "0.58737785", "0.58737785", "0.5843681", "0.5841695", "0.58400065", "0.58346456", "0.58301884", "0.5810509", "0.5802237", "0.5758035", "0.57551044", "0.5752673", "0.5744132", "0.5725491", "0.572158...
0.7663598
0
Creates the telemetry file if it isn't there
def create_telemetry_file(): loginfo("Creating telem file if it doesn't exist...") with open(HAB_TELEM_FILE, "w"): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_telemetry(self, telemetry):\n\n _id = telemetry['id']\n _type = telemetry['type']\n\n # If there is no log open for the current ID check to see if there is an existing (closed) log file, and open it.\n if _id not in self.open_logs:\n _search_string = os.path.join(se...
[ "0.6439721", "0.607161", "0.6014355", "0.6009945", "0.59758687", "0.5965215", "0.58997035", "0.5889219", "0.5861597", "0.5857285", "0.5794037", "0.57913977", "0.57815826", "0.57186556", "0.57160866", "0.5698505", "0.5695984", "0.5652613", "0.56342226", "0.56266046", "0.561926...
0.8411467
0
Generator function test example nonclass based generator. Calling this function returns generator
def tryDo(states, tymth, tock=0.0, **opts): feed = "Default" count = 0 try: # enter context states.append(State(tyme=tymth(), context="enter", feed=feed, count=count)) while (True): # recur context feed = (yield (count)) # yields tock then waits for next send ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testGeneratorType(self):", "def testExplicitGeneratorConvenienceFunctionUsage(self):\n\t\tc = Controller()\n\t\tx = c.mock()\n\t\tc.generator(x.g(8, 9), [10, 11])\n\t\tc.replay()\n\t\tself.failUnless([k for k in x.g(8, 9)] == [10, 11])", "def test_generator_inline(self):\n def test_odd(v):\n ...
[ "0.71429753", "0.7142396", "0.70949966", "0.7094", "0.70067734", "0.69793046", "0.68915766", "0.68774396", "0.68597263", "0.68286574", "0.68087935", "0.6745581", "0.67386496", "0.67066985", "0.67054546", "0.6586848", "0.6577897", "0.65526736", "0.65509874", "0.6549914", "0.65...
0.0
-1
Test wrapper function doify()
def test_doify(): def genfun(tymth, tock=0.0, **opts): tyme = yield(tock) assert inspect.isgeneratorfunction(genfun) gf0 = doing.doify(genfun, name='gf0', tock=0.25) gf1 = doing.doify(genfun, name='gf1', tock=0.125) assert inspect.isgeneratorfunction(gf0) assert inspect.isgeneratorfun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_a():\n foo_do(4)\n foo_do(\"hello\")\n bar_do([1,2,3])", "def test_do_return():\n\n @do\n def f():\n yield do_return(\"hello\")\n\n with warns(DeprecationWarning):\n assert perf(f()) == \"hello\"", "def test_wraps():\n print('func')", "def unitary_test():", "def t...
[ "0.59483993", "0.5807372", "0.5771744", "0.57428163", "0.5708095", "0.5708095", "0.5673134", "0.5553789", "0.5506994", "0.550334", "0.55026174", "0.55026174", "0.548085", "0.5474856", "0.5474856", "0.5474856", "0.5474856", "0.5474856", "0.5422439", "0.541525", "0.541525", "...
0.66281915
0
Test decorator with bound method returning generator
def test_doize_dodoer_with_bound_method(): # run until complete normal exit so done==True class A(): def __init__(self): self.x = 1 @doing.doize(tock=0.25) def myDo(self, tymth=None, tock=0.0, **opts): while self.x <= 3: tyme = yield(tock) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patched_generator(self, *args, **kwargs):\n self.validate(*args, **kwargs)\n yield from self.function(*args, **kwargs)", "def test_decorated(*args):\n for i in args:\n yield i", "def generator(func):\n\n @fn\n @wraps(func)\n def gen(*args, **kwargs):\n return Iter(fu...
[ "0.723703", "0.72216403", "0.6983151", "0.6971573", "0.6855999", "0.65148157", "0.64896125", "0.6367733", "0.6270018", "0.62691545", "0.6248485", "0.62291586", "0.6208451", "0.6201626", "0.61969006", "0.6168095", "0.6150243", "0.61480415", "0.61464787", "0.6142792", "0.612228...
0.68866885
4
Test Doer base class
def test_doer(): tock = 1.0 doer = doing.Doer() assert doer.tock == 0.0 assert doer.tymth == None tymist = tyming.Tymist() doer = doing.Doer(tymth=tymist.tymen(), tock=tock) assert doer.tock == tock == 1.0 doer.tock = 0.0 assert doer.tock == 0.0 # create generator use send and...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test(self):\n raise NotImplementedError", "def _test(self):\n pass", "def _test(self):\n pass", "def _test(self):\n pass", "def _test(self):", "def _test(self):", "def _test(self):", "def _test(self):", "def _test(self):", "def test(self):\n pass", "def te...
[ "0.6818304", "0.6673906", "0.6673906", "0.6673906", "0.6533348", "0.6533348", "0.6533348", "0.6533348", "0.6533348", "0.64626664", "0.6460273", "0.6429026", "0.6358491", "0.6342161", "0.6235659", "0.62250394", "0.6046093", "0.6046093", "0.6032392", "0.60314935", "0.60209715",...
0.0
-1
Test ReDoer base class
def test_redoer(): tock = 1.0 redoer = doing.ReDoer() assert redoer.tock == 0.0 tymist = tyming.Tymist() redoer = doing.ReDoer(tymth=tymist.tymen(), tock=tock) assert redoer.tock == tock == 1.0 redoer.tock = 0.0 assert redoer.tock == 0.0 # create generator use send and run until n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _test(self):", "def _test(self):", "def _test(self):", "def _test(self):", "def _test(self):", "def _test(self):\n pass", "def _test(self):\n pass", "def _test(self):\n pass", "def test(self):\n raise NotImplementedError", "def test_repeatable(self):\n\n def...
[ "0.61767393", "0.61767393", "0.61767393", "0.61767393", "0.61767393", "0.6121408", "0.6121408", "0.6121408", "0.6014255", "0.59986156", "0.59789985", "0.5973995", "0.59609497", "0.5949065", "0.59482294", "0.5913071", "0.5876806", "0.5861081", "0.5839187", "0.5826244", "0.5814...
0.0
-1
Test DoDoer class with tryDoer and always
def test_dodoer_always(): # create some TryDoers for doers doer0 = TryDoer(stop=1) doer1 = TryDoer(stop=2) doer2 = TryDoer(stop=3) doers = [doer0, doer1, doer2] tock = 1.0 dodoer = doing.DoDoer(tock=tock, doers=list(doers)) assert dodoer.tock == tock == 1.0 assert dodoer.doers == do...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_deleter_do_work_no_results(config, mocker):\n logger_mock = mocker.MagicMock()\n dwc_mock = mocker.patch(\"lta.deleter.Deleter._do_work_claim\", new_callable=AsyncMock)\n dwc_mock.return_value = False\n p = Deleter(config, logger_mock)\n await p._do_work()\n dwc_mock.assert_called(...
[ "0.6120738", "0.59847236", "0.59634715", "0.58789694", "0.5862914", "0.58382034", "0.5809949", "0.5742558", "0.57110935", "0.56508386", "0.5597733", "0.5591101", "0.55195457", "0.5505833", "0.5505833", "0.5505833", "0.54548043", "0.5433832", "0.54265547", "0.5421805", "0.5415...
0.7301341
0
Test exDo generator function nonclass based
def test_exDo(): doizeExDo = doing.doizeExDo assert inspect.isgeneratorfunction(doizeExDo) assert hasattr(doizeExDo, "tock") assert hasattr(doizeExDo, "opts") assert "states" in doizeExDo.opts assert doizeExDo.opts["states"] == None doizeExDo.opts["states"] = [] tymist = tyming.Tymist(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testGeneratorType(self):", "def test_func_generator():\n def test_odd(v):\n assert v % 2\n for i in range(0, 4):\n yield test_odd, i", "def test_generator_inline(self):\n def test_odd(v):\n assert v % 2\n for i in range(0, 4):\n ...
[ "0.69425654", "0.67788553", "0.66770464", "0.6559386", "0.6521904", "0.64930636", "0.6480948", "0.6477324", "0.64332664", "0.6391887", "0.6362238", "0.63430214", "0.63208383", "0.6199608", "0.6186559", "0.6182152", "0.6155177", "0.6155177", "0.6155177", "0.6155177", "0.615517...
0.6953838
0
Test TryDoer testing class with break to normal exit
def test_trydoer_break(): tymist = tyming.Tymist(tock=0.125) doer = TryDoer(tymth=tymist.tymen(), tock=0.25) assert doer.tock == 0.25 assert doer.states == [] assert tymist.tyme == 0.0 do = doer(tymth=doer.tymth, tock=doer.tock) assert inspect.isgenerator(do) result = do.send(None) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_main(mock_timesleep,mock_network,mock_machine_pin):\n with pytest.raises(InterruptedError):\n AppSwitch.main()", "def test_retry_run(self):\n pass", "def test_terminate_run(self):\n pass", "def test_case_01(self):\n if True:\n self.fail()", "def test_run_e...
[ "0.66845757", "0.6653311", "0.65745556", "0.65026855", "0.64127654", "0.6395772", "0.6381207", "0.6184485", "0.61808765", "0.61676306", "0.61503834", "0.6129957", "0.61259747", "0.60815704", "0.6045685", "0.60384524", "0.59880006", "0.59880006", "0.59866875", "0.59825224", "0...
0.600121
16
Test TryDoer testing class with close to force exit
def test_trydoer_close(): tymist = tyming.Tymist(tock=0.125) doer = TryDoer(tymth=tymist.tymen(), tock=0.25) assert doer.tock == 0.25 assert doer.states == [] assert tymist.tyme == 0.0 do = doer(tymth=doer.tymth, tock=doer.tock) assert inspect.isgenerator(do) result = do.send(None) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_terminate_run(self):\n pass", "def test_main(mock_timesleep,mock_network,mock_machine_pin):\n with pytest.raises(InterruptedError):\n AppSwitch.main()", "def on_close(self, event):\r\n if self.thread is not None:\r\n self.thread.abort = True\r\n if self.tester...
[ "0.68585944", "0.64765173", "0.6306529", "0.6275563", "0.6275563", "0.6275563", "0.6275563", "0.6227624", "0.6181504", "0.61700946", "0.6157398", "0.613914", "0.61259204", "0.6102497", "0.60586315", "0.603572", "0.6033575", "0.6021148", "0.60183555", "0.59761", "0.59629834", ...
0.6182289
8
Test TryDoer testing class with throw to force exit
def test_trydoer_throw(): tymist = tyming.Tymist(tock=0.125) doer = TryDoer(tymth=tymist.tymen(), tock=0.25) assert doer.tock == 0.25 assert doer.states == [] assert tymist.tyme == 0.0 do = doer(tymth=doer.tymth, tock=doer.tock) assert inspect.isgenerator(do) result = do.send(None) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_retry_run(self):\n pass", "def test_fails(self):\n raise FoolishError(\"I am a broken test\")", "def test_main(mock_timesleep,mock_network,mock_machine_pin):\n with pytest.raises(InterruptedError):\n AppSwitch.main()", "def test_case_01(self):\n if True:\n s...
[ "0.6831767", "0.66180384", "0.65865993", "0.65316236", "0.64181465", "0.6390878", "0.63057095", "0.62212795", "0.6213917", "0.6197823", "0.6175385", "0.617257", "0.6159644", "0.6148077", "0.6136038", "0.61148953", "0.60944396", "0.6073564", "0.6073084", "0.6045199", "0.604241...
0.6512613
4