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
Private. Resets the traversal state of all nodes in preparation for a new traversal
def _reset_traversal_state(self): for n in self.nodes.values(): n.reset_traversal_state()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_tree(self):\n self.root = None\n self.action = None\n self.dist_probability = None", "def reset_visited(self):\n self.__visited = False", "def reset_graph(self):\n self.nodes = {}\n self.add_node(self.initial_state)\n self.add_node(self.final_state)", ...
[ "0.74285185", "0.73662233", "0.7337941", "0.73155934", "0.7201365", "0.71484256", "0.7138489", "0.71265846", "0.71129096", "0.71065027", "0.7018088", "0.6959817", "0.6881637", "0.6879142", "0.681779", "0.6811828", "0.6801169", "0.67853063", "0.67844963", "0.6764829", "0.67444...
0.8812322
0
Perform a depthfirst traversal of the entire graph. The supplied visitor_function callable is called twice per
def depth_first_traversal(self, visitor_function=None): self._reset_traversal_state() self.time = 0 result = False for n in self.nodes.values(): if NodeColor.WHITE == n.color: stack = collections.deque() stack.append(n) while...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def traverse_depth_first(self, fn):\n queue = deque([self.root])\n while len(queue) > 0:\n node = queue.popleft()\n fn(node)\n queue.extendleft(reversed(node.children))", "def _traverse_region_graph(root: Region, fun: Callable[[Region], None]) -> None:\n visited_...
[ "0.69131184", "0.6532276", "0.63960713", "0.6223167", "0.61571103", "0.59844995", "0.59705156", "0.59194154", "0.59114933", "0.5801044", "0.5797877", "0.5770219", "0.5733677", "0.5723791", "0.5710354", "0.5705172", "0.5666923", "0.5657166", "0.5648695", "0.5614636", "0.561195...
0.69286025
0
Perform BFS, starting at the specified node.
def breadth_first_traversal(self, start_node, visitor_function=None, max_depth=None): self._reset_traversal_state() if isinstance(start_node, str): start_node = self.nodes[start_node] if not isinstance(start_node, ProcessNode): raise TypeError('Expect start_node to eith...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bfs(maze, current_node):\n q = collections.deque()\n\n q.append(current_node)\n\n while len(q) > 0:\n current_node = q.popleft()\n maze[current_node.row][current_node.cell] = 1\n yield maze\n\n for neighbour in get_neighbours(maze, current_node):\n if maze[neighb...
[ "0.712657", "0.7019322", "0.6977231", "0.6904166", "0.6873453", "0.6778046", "0.6764516", "0.67611027", "0.66524756", "0.65571046", "0.6479184", "0.64744705", "0.6444245", "0.6440059", "0.64398944", "0.64012533", "0.6394898", "0.6370323", "0.6339818", "0.63252306", "0.6316992...
0.59082425
67
This lengthy, irritating piece of code returns the slice idcs for subcube (i,j) in a decomposition of an original map of shape (2HD_res[0],2HD_res[1]) with chunks of 2LD_res per sides, together with buffers[0],[1] buffers pixel on each side, fixed by the periodicity condition of the HD map. Nothing very subtle for the ...
def get_slices_chk_N(N, LD_res, HD_res, buffers, inverse=False): assert len(LD_res) == 2 and len(HD_res) == 2 if np.all(LD_res == HD_res): assert N == 0, N assert buffers == (0, 0), buffers sl0_LD = slice(0, 2 ** LD_res[0]) # Center of buffered cube sl1_L...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _segments2slices(array_size, grid_segments, patch_segments):\n patch_slices = [slice(start, stop) for start, stop in patch_segments]\n array_slices = []\n\n for start, stop in grid_segments:\n segment_size = max(abs(start), abs(stop))\n k = int(ceil(float(segment_size) / array_size) + (-...
[ "0.60255563", "0.5919896", "0.58811724", "0.5863269", "0.585582", "0.58138037", "0.57283646", "0.56544244", "0.5653726", "0.56497926", "0.5631293", "0.55874455", "0.5561426", "0.5546333", "0.55354935", "0.55143887", "0.5499627", "0.54738224", "0.5452872", "0.54172575", "0.541...
0.6117562
0
Function that raise exception of the public method area
def area(self): raise Exception("area() is not implemented")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self):\r\n raise self", "def __call__(self):\r\n raise self", "def throw(self):\n pass", "def exception(self, *args, **kwargs):", "def unexpectedException(self):", "def raise_(err):\n raise err", "def exception(self):\n raise Exception(\"Exception tes...
[ "0.7519949", "0.7519949", "0.7479147", "0.7351615", "0.72099924", "0.69999564", "0.69876474", "0.69554514", "0.66960365", "0.6632302", "0.6583972", "0.6538573", "0.65098816", "0.65000296", "0.6460797", "0.64351404", "0.64302117", "0.64289075", "0.6414966", "0.6404366", "0.639...
0.0
-1
Function that integer validator to a name and value
def integer_validator(self, name, value): self.name = name self.value = value if type(value) is not int: raise TypeError("{} must be an integer".format(name)) if value <= 0: raise ValueError("{} must be greater than 0".format(name)) self.value = value ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def integer_validator(self, name, value):\n if type(value) is not int:\n raise TypeError(name + \" must be an integer\")\n elif value <= 0 and name not in (\"x\", \"y\"):\n raise ValueError(name + \" must be > 0\")\n elif value < 0 and name in (\"x\", \"y\"):\n ...
[ "0.8130921", "0.788335", "0.7841091", "0.7826758", "0.7700402", "0.7427867", "0.7427867", "0.7261612", "0.7167946", "0.70053536", "0.693558", "0.6867623", "0.67775255", "0.6776555", "0.67418826", "0.6563546", "0.65442383", "0.6446882", "0.6382053", "0.6289101", "0.626554", ...
0.8029562
1
This function is called to check if a username / password combination is valid.
def check_auth(username, password): return username == USERNAME and password == PASSWORD
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_auth(username, password, expected_user, expected_pw):\n return username == expected_user and password == expected_pw", "def validate_authentication(self, username, password):\n return self.user_table[username]['pwd'] == password", "def check_valid(self, username, password):\n con...
[ "0.82211864", "0.8146436", "0.7962432", "0.7885527", "0.78588223", "0.78382313", "0.78288996", "0.7815222", "0.7798579", "0.77856815", "0.77700555", "0.7760794", "0.7754975", "0.77548647", "0.7750886", "0.7749223", "0.77322245", "0.7715806", "0.7687129", "0.7685904", "0.76736...
0.7975914
2
Sends a 401 response that enables basic auth
def authenticate(): return Response( 'Could not verify your access level for that URL.\n' 'You have to login with proper credentials', 401, {'WWW-Authenticate': 'Basic realm="Login Required"'})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticate():\n return Response('Not Authorized', 401, {'WWW-Authenticate': 'Basic realm=\"api\"'})", "def authenticate():\n return Response(\n '', 401, {'WWW-Authenticate': 'Basic realm=\"Login Required\"'}\n )", "def authenticate():\n return Response(\n 'You have to login with pro...
[ "0.8093736", "0.80926424", "0.7958403", "0.7852648", "0.7843114", "0.7824419", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", ...
0.774767
34
Set pin as high
def set_pin_high(pin): HIGH_PINS.append(pin)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_high(pin):\n _write_value(HIGH, \"{0}/gpio{1}/value\".format(_path_prefix, pin))", "def gpio_output_high(self, pin: int) -> None:\n self._pins[pin - 1] = \"OUTPUT_HIGH\"", "def set_pin_low(pin):\n if pin in HIGH_PINS:\n HIGH_PINS.remove(pin)", "def set_pin(self):\n GPIO.set...
[ "0.8202024", "0.7684762", "0.76168716", "0.756904", "0.74249405", "0.720764", "0.7134327", "0.711949", "0.71125674", "0.7103002", "0.70253396", "0.69540894", "0.68812466", "0.6861089", "0.6766074", "0.67559886", "0.6692666", "0.66920656", "0.66851836", "0.6638315", "0.6575943...
0.85144776
0
Set pin as high
def set_pin_low(pin): if pin in HIGH_PINS: HIGH_PINS.remove(pin)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_pin_high(pin):\n HIGH_PINS.append(pin)", "def set_high(pin):\n _write_value(HIGH, \"{0}/gpio{1}/value\".format(_path_prefix, pin))", "def gpio_output_high(self, pin: int) -> None:\n self._pins[pin - 1] = \"OUTPUT_HIGH\"", "def set_pin(self):\n GPIO.setwarnings(False)\n GPIO...
[ "0.85144776", "0.8202024", "0.7684762", "0.756904", "0.74249405", "0.720764", "0.7134327", "0.711949", "0.71125674", "0.7103002", "0.70253396", "0.69540894", "0.68812466", "0.6861089", "0.6766074", "0.67559886", "0.6692666", "0.66920656", "0.66851836", "0.6638315", "0.6575943...
0.76168716
3
init a service group
def __init__(self, name): self.name = name self.elements = list()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initService(self):", "def _initGroups(self):\n defaults = self._getGroupDefaults()\n ddict = self._getDefaultGroupDict(defaults)\n\n for group in self._config.sections():\n ddict[\"_name\"] = group\n container = self.getGroupContainer(**ddict)\n self._pas...
[ "0.6977778", "0.647504", "0.6311481", "0.6163518", "0.6104335", "0.6073847", "0.60509956", "0.6020045", "0.59971154", "0.59911984", "0.5847313", "0.58042663", "0.5801854", "0.57892656", "0.5780774", "0.5769546", "0.5730015", "0.5711347", "0.5633376", "0.56113166", "0.5598102"...
0.0
-1
yield the values of the underlying objects
def __getattr__(self, item): if item == 'value': return [s.value for s in self.elements] else: raise AttributeError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n for val in self.value:\n yield val", "def __iter__(self):\n for value in self.__dict__.values():\n yield value", "def __iter__(self):\n yield from chain.from_iterable(self.data.values())", "def __iter__(self):\n for v in self._items:\n ...
[ "0.78900456", "0.783961", "0.76023287", "0.75327784", "0.7466362", "0.7364445", "0.7347672", "0.73172176", "0.72873604", "0.72775656", "0.71958953", "0.7171008", "0.7160181", "0.70680296", "0.7050591", "0.7016633", "0.70131326", "0.7009068", "0.7009068", "0.7009068", "0.70090...
0.0
-1
Return a related filter_name, using the filterset relationship if present.
def related(filterset, filter_name): if not filterset.relationship: return filter_name return LOOKUP_SEP.join([filterset.relationship, filter_name])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_filter_name(self):\n pass", "def get_param_filter_name(cls, param, rel=None):\n # check for empty param\n if not param:\n return param\n\n # strip the rel prefix from the param name.\n prefix = '%s%s' % (rel or '', LOOKUP_SEP)\n if rel and param.starts...
[ "0.6471144", "0.62778616", "0.58047044", "0.56574893", "0.56555384", "0.56209326", "0.5564204", "0.55566245", "0.5534012", "0.5517095", "0.5462722", "0.54582113", "0.5367023", "0.5363491", "0.53548676", "0.53417313", "0.53322023", "0.5322664", "0.526207", "0.52405727", "0.522...
0.8743976
0
Resolve `AutoFilter`s into their perlookup filters. `AutoFilter`s are a declarative alternative to the `Meta.fields` dictionary syntax, and use the same machinery internally.
def expand_auto_filters(cls, new_class): # get reference to opts/declared filters orig_meta, orig_declared = new_class._meta, new_class.declared_filters # override opts/declared filters w/ copies new_class._meta = copy.deepcopy(new_class._meta) new_class.declared_filters = new_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loadFilters(ufo):\n preFilters, postFilters = [], []\n for filterDict in ufo.lib.get(FILTERS_KEY, []):\n namespace = filterDict.get(\"namespace\", \"ufo2ft.filters\")\n try:\n filterClass = getFilterClass(filterDict[\"name\"], namespace)\n except (ImportError, AttributeErr...
[ "0.5492552", "0.5431763", "0.5252897", "0.52475154", "0.5196505", "0.5192317", "0.5170377", "0.5147656", "0.5139516", "0.50391585", "0.4980402", "0.49512303", "0.49480322", "0.49272498", "0.49130383", "0.49125457", "0.489388", "0.48330957", "0.48206162", "0.4809472", "0.48018...
0.5948139
0
Returns the subset of filters that should be initialized by the FilterSet, dependent on the requested `params`. This helps minimize the cost of initialization by reducing the number of deepcopy ops. The `rel` argument is used for related filtersets to strip the param of its relationship prefix. See `.get_param_filter_n...
def get_filter_subset(cls, params, rel=None): # Determine names of filters from query params and remove empty values. # param names that traverse relations are translated to just the local # filter names. eg, `author__username` => `author`. Empty values are # removed, as they indicate an...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_request_filters(self):\n # build the compiled set of all filters\n requested_filters = OrderedDict()\n for filter_name, f in self.filters.items():\n requested_filters[filter_name] = f\n\n # exclusion params\n exclude_name = '%s!' % filter_name\n ...
[ "0.6619125", "0.6226987", "0.6226987", "0.60220295", "0.56563276", "0.557124", "0.5495559", "0.5387023", "0.537955", "0.5361835", "0.5359296", "0.53389424", "0.53347725", "0.5314394", "0.53115654", "0.52742255", "0.5228215", "0.5208534", "0.51974314", "0.5195309", "0.5190603"...
0.8191257
0
Disable filter subsetting, allowing the form to render the filterset. Note that this decreases performance and should only be used when rendering a form, such as with DRF's browsable API.
def disable_subset(cls, *, depth=0): if not issubclass(cls, SubsetDisabledMixin): cls = type('SubsetDisabled%s' % cls.__name__, (SubsetDisabledMixin, cls), {}) # recursively disable subset for related filtersets if depth > 0: # shallow copy to prev...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allow_filtering(self):\r\n clone = copy.deepcopy(self)\r\n clone._allow_filtering = True\r\n return clone", "def non_hidden(self):\n return self.filter(hidden=False)", "def non_hidden(self):\n return self.filter(hidden=False)", "def __disableSearchEdit(self):\n s...
[ "0.6328865", "0.61500955", "0.61500955", "0.61072856", "0.5808935", "0.57838905", "0.57728505", "0.5675368", "0.56208265", "0.5614127", "0.55958295", "0.55693483", "0.5554618", "0.5534325", "0.5480112", "0.5472331", "0.5463367", "0.5458596", "0.5456048", "0.54518133", "0.5449...
0.6411095
0
Get the filter name for the request data parameter.
def get_param_filter_name(cls, param, rel=None): # check for empty param if not param: return param # strip the rel prefix from the param name. prefix = '%s%s' % (rel or '', LOOKUP_SEP) if rel and param.startswith(prefix): param = param[len(prefix):] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_filter_name(self):\n pass", "async def get_filter(self, **kwargs: Any) -> str:\n return self._telescope.filter_name", "def name(self) -> StringFilter:\n return self.__name", "def filter(self) -> Optional[str]:\n return pulumi.get(self, \"filter\")", "def get_json_callbac...
[ "0.79879385", "0.73243344", "0.675019", "0.65612745", "0.6520124", "0.6505116", "0.64178914", "0.6189231", "0.6183338", "0.61544156", "0.6082367", "0.60678583", "0.6023081", "0.60075915", "0.6005047", "0.59691584", "0.59691584", "0.587701", "0.5817631", "0.5786401", "0.576572...
0.6619432
3
Build a set of filters based on the request data. This currently includes only filter exclusion/negation.
def get_request_filters(self): # build the compiled set of all filters requested_filters = OrderedDict() for filter_name, f in self.filters.items(): requested_filters[filter_name] = f # exclusion params exclude_name = '%s!' % filter_name if relate...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_filters(self, req):\n filters = {}\n properties = {}\n\n for param in req.params:\n if param in SUPPORTED_FILTERS:\n filters[param] = req.params.get(param)\n if param.startswith('property-'):\n _param = param[9:]\n pro...
[ "0.7212947", "0.70940274", "0.7063467", "0.70396554", "0.70150787", "0.7010616", "0.68755764", "0.67024094", "0.67008877", "0.6694236", "0.6660822", "0.6646979", "0.65543395", "0.65318733", "0.64761287", "0.64659613", "0.6453026", "0.64314073", "0.6378158", "0.63564056", "0.6...
0.7715377
0
Get the related filterset instances for all related filters.
def get_related_filtersets(self): related_filtersets = OrderedDict() for related_name in self.related_filters: if related_name not in self.filters: continue f = self.filters[related_name] related_filtersets[related_name] = f.filterset( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_related_filtersets(self, queryset):\n for related_name, related_filterset in self.related_filtersets.items():\n # Related filtersets should only be applied if they had data.\n prefix = '%s%s' % (related(self, related_name), LOOKUP_SEP)\n if not any(value.startswit...
[ "0.7343028", "0.67154413", "0.61035365", "0.60354567", "0.5970218", "0.59653723", "0.5931315", "0.58990955", "0.5755272", "0.5717431", "0.5715828", "0.5692265", "0.5688741", "0.5616253", "0.5609072", "0.5583161", "0.55796957", "0.5577063", "0.55623674", "0.55400354", "0.55383...
0.82383394
0
Filter the provided `queryset` by the `related_filtersets`. It is recommended that you override this method to change the filtering behavior across relationships.
def filter_related_filtersets(self, queryset): for related_name, related_filterset in self.related_filtersets.items(): # Related filtersets should only be applied if they had data. prefix = '%s%s' % (related(self, related_name), LOOKUP_SEP) if not any(value.startswith(prefix)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_filters(self, queryset, applicable_filters=None, applicable_exclusions=None):\n if applicable_filters:\n queryset = queryset.filter(applicable_filters)\n if applicable_exclusions:\n queryset = queryset.exclude(applicable_exclusions)\n return queryset", "def ge...
[ "0.67854434", "0.6782465", "0.66839457", "0.6680913", "0.646492", "0.63564074", "0.63288736", "0.63143224", "0.63010234", "0.6240037", "0.6125244", "0.60945296", "0.608679", "0.6075394", "0.6073214", "0.60558784", "0.60067743", "0.60016656", "0.5998127", "0.59923685", "0.5961...
0.84336936
0
Callback function for metrics_btn A window will popup to display the user metadata of previous user
def display_metrics(self): metrics = client.user_metrics(self.user_name.get()) messagebox.showinfo("Metrics", metrics)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_metrics3(self):\n messagebox.showinfo(\"Processed Image Metrics\", self.pro_metrics)", "def display_metrics2(self):\n messagebox.showinfo(\"Original Image Metrics\", self.raw_metrics)", "def user_labels_prev(*args):\n return _ida_hexrays.user_labels_prev(*args)", "def action_sessio...
[ "0.5536531", "0.5336233", "0.5274754", "0.52151805", "0.5156828", "0.51532024", "0.51404095", "0.509433", "0.50761753", "0.50675863", "0.5057054", "0.5030155", "0.49895877", "0.49638245", "0.49565363", "0.4928132", "0.49049008", "0.48959267", "0.48698136", "0.4867956", "0.486...
0.63189566
0
Callback function for im_metrics_btn1 A window will popup to display the original image metadata
def display_metrics2(self): messagebox.showinfo("Original Image Metrics", self.raw_metrics)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_metrics3(self):\n messagebox.showinfo(\"Processed Image Metrics\", self.pro_metrics)", "def win5_ManageData_Caption(event=None):\r\n\r\n clearwin()\r\n global IMAGES_FILE_PATH\r\n global i\r\n i = 0\r\n\r\n Descriptions = load()\r\n imgs = []\r\n if os.path.exists(IMAGES_F...
[ "0.69807404", "0.62527585", "0.58932143", "0.58668804", "0.58499783", "0.58255225", "0.5808261", "0.57940733", "0.5692784", "0.56442815", "0.5617792", "0.5611394", "0.55932826", "0.5588301", "0.5586624", "0.5570289", "0.555042", "0.5538848", "0.55376774", "0.55155426", "0.548...
0.73585606
0
Callback function for im_metrics_btn2 A window will popup to display the processed image metadata
def display_metrics3(self): messagebox.showinfo("Processed Image Metrics", self.pro_metrics)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_metrics2(self):\n messagebox.showinfo(\"Original Image Metrics\", self.raw_metrics)", "def btn_display_hist_callback(self):\n self.show_as_waiting(True)\n ids = self.tbl_images.get_selected_ids()\n names = self.tbl_images.get_selected_names()\n\n for id, name in zip...
[ "0.7458454", "0.616558", "0.60215414", "0.5975251", "0.584566", "0.582564", "0.5801999", "0.5760714", "0.5755779", "0.5739632", "0.5733116", "0.56553966", "0.56404024", "0.5639404", "0.5581315", "0.5552886", "0.5552128", "0.55366683", "0.5528491", "0.55033773", "0.5477598", ...
0.74962056
0
Open a popup window to let user choose file(s) The full filepath will be stored in the class
def import_file(self): from tkinter import filedialog self.filepath = filedialog.askopenfilenames( initialdir="/", title="Select file", filetypes=(("PNG files", "*.png"), ("JPEG files", "*.jpeg"), ("TIFF files", "*.tiff"), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_popup(file) -> str:\n layout = [\n [sg.Text(f\"Select the action to perform on\\n\\n{file}\")],\n [sg.Button(\"Open File\", key=\"-APP-\"),\n sg.Button(\"Open in File Explorer\", key=\"-EXPLORER-\"),\n sg.Button(\"Delete File\", key=\"-DEl-\",\n ...
[ "0.81688225", "0.80503184", "0.78248763", "0.77235496", "0.7679591", "0.76397675", "0.76276994", "0.7585482", "0.7508304", "0.74986696", "0.7496582", "0.7495827", "0.74400616", "0.7432761", "0.7358748", "0.7349472", "0.7333362", "0.73316485", "0.7327523", "0.7324655", "0.7269...
0.7110334
29
Control the load button Load a list of processed images in the database. User could choose one or more images to download. If only one image is chosen the resulted plot will be displayed in the GUI. If multiple file is chosen, the files will be zip to a zip archive and save to a designated path.
def load_function(self): self.image_names = client.get_image_list(self.user_name.get()) # clear listbox self.name_list.delete(0, END) for i in self.image_names: self.name_list.insert(END, i)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_function(self):\n # Ask user for directory and user ID\n savepath = filedialog.askdirectory()\n ID = self.user_name.get()\n\n self.msg2.set('Saving files to the designated folder')\n\n # Get selected filenames\n index = self.name_list.curselection()\n s...
[ "0.70843863", "0.64637136", "0.6282635", "0.61812353", "0.6077754", "0.60075426", "0.60023975", "0.5985294", "0.59840703", "0.59838974", "0.59453404", "0.5897838", "0.5861998", "0.5781273", "0.5778588", "0.5764681", "0.5759482", "0.5740892", "0.57235175", "0.57107615", "0.568...
0.595108
10
Callback function that controls the download button
def download_function(self): # Ask user for directory and user ID savepath = filedialog.askdirectory() ID = self.user_name.get() self.msg2.set('Saving files to the designated folder') # Get selected filenames index = self.name_list.curselection() select_files = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_with_callback(self, url, path=None, filename=None, headers=None, force=False, func=None):", "def click_download_button(self):\n self._basket.click_download_button()", "def download_files(self):", "def download(self):\n pass", "def download(self):\n pass", "def download_f...
[ "0.7018457", "0.69721246", "0.69597185", "0.6953735", "0.6953735", "0.6816827", "0.6681164", "0.663355", "0.66132164", "0.65275913", "0.6489063", "0.6469115", "0.64611053", "0.6418321", "0.6399592", "0.637393", "0.6368756", "0.6359143", "0.63438714", "0.6293492", "0.62759054"...
0.6004468
68
Determine the image size of the images to be displayed in GUI The original width to height ratio will be preserved. Max width/height is set to be 300, and the other dimension will be adjusted accordingly.
def image_size(size): l_max = max(size) if l_max > 300: num = l_max/300 else: num = 1 w = round(size[0] / num) h = round(size[1] / num) new_size = [w, h] return new_size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_image_size(self):", "def scale_widget_to_image_size(self):\n if self._image is not None:\n im = self._image.make_image()\n self.width = im.shape[1]\n self.height = im.shape[0]", "def format_img_size(self, img, C):\n img_min_side = float(C.im_size)\...
[ "0.7428963", "0.72670555", "0.7153747", "0.7006132", "0.6961046", "0.69432396", "0.678366", "0.6766124", "0.6737722", "0.66931385", "0.6661223", "0.6660257", "0.6642184", "0.6614157", "0.66024864", "0.66024864", "0.65730685", "0.656699", "0.6548179", "0.6547853", "0.65275776"...
0.6792414
6
Communicate with server and database to get original and processed images, pre and postprocessing histogram.
def get_image_pair(filename, ID): r = client.get_image_file(ID, filename) try: check_r_type(r) except TypeError: return r else: pro_img_arr, method = client.get_image(r) pro_img = Image.fromarray(pro_img_arr) raw_img_name = filename.replace('_' + method, "") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process():\n config = read_config()\n \n\n img_dir = config['DEFAULT']['images_directory']\n results_dict = {}\n images = list(get_image_files(img_dir))\n for image in tqdm.tqdm(images):\n info = hash_file(image)\n if info == 0:\n continue\n\n hash_value = info...
[ "0.6015694", "0.5810847", "0.57723105", "0.5640843", "0.56245506", "0.56011194", "0.5577318", "0.55666625", "0.5558006", "0.5541642", "0.5531403", "0.5502279", "0.5499759", "0.54302055", "0.541875", "0.5414848", "0.5412454", "0.541103", "0.5408943", "0.53958166", "0.535821", ...
0.0
-1
Check if the output from server is a string of error message Raise error if it is string. It should be a dictionary.
def check_r_type(r): if type(r) is str: raise TypeError('Get Error message.')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_rpc_value ( user_dict ):\n for key in user_dict:\n if not isinstance ( user_dict[ key ], str ):\n # Error code 422\n raise ValueError ( 'Value of {0} is not a string'.format ( key ) )", "def is_error(response: str) -> bool:\n return \"ERROR\" in respo...
[ "0.67002916", "0.6622685", "0.65426445", "0.64297044", "0.6372873", "0.62947875", "0.61671525", "0.604404", "0.6020194", "0.59307563", "0.590339", "0.5883814", "0.5872144", "0.58716655", "0.58712596", "0.5850643", "0.5848179", "0.5827672", "0.58271694", "0.58263636", "0.58262...
0.68892103
0
Extract filename and extension from filepath
def get_file_name(filepath): # need pytest filename, extension = os.path.splitext(filepath.split('/')[-1]) return filename, extension
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_ext(path):\n result = os.path.splitext(path)[1]\n return result", "def get_file_ext(path: str) -> str:\n return os.path.splitext(os.path.basename(path))[1]", "def get_file_name_with_ext(path: str) -> str:\n return os.path.basename(path)", "def _get_ext(self, path):\n return os.pat...
[ "0.80850315", "0.7980222", "0.7961075", "0.79087883", "0.7875789", "0.7851262", "0.7824376", "0.7815243", "0.7754425", "0.7731678", "0.7668338", "0.7649159", "0.76470023", "0.7626894", "0.7625784", "0.76075673", "0.7575197", "0.7550891", "0.75276417", "0.7518576", "0.74935955...
0.79995126
1
Check if multiple or single file is chosen.
def check_multi_single(filenames): num = len(filenames) if num == 1: single = bool(1) else: single = bool(0) return single
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_multi_file(self):\n return 'files' in self.torrent['info']", "def select_files():\n\n if not Settings.is_prompt(): return [File.get_random_file()]\n category = Settings.select_category()\n if not category: return File.select_file_upload_method()\n # if not Settings.confi...
[ "0.6862918", "0.6714143", "0.64036655", "0.6360947", "0.62420434", "0.6179852", "0.6168158", "0.606886", "0.6025578", "0.5963181", "0.59183747", "0.5914388", "0.59100074", "0.59086585", "0.5877628", "0.5876562", "0.5874005", "0.58681023", "0.5844574", "0.5818032", "0.5810063"...
0.6930178
0
Call other function to run analysis and upload the results to the database It can both accept one single .zip file or one/multiple image file(s)
def run_analysis(filepath, ID, method): filename, extension = get_file_name(filepath[0]) if extension == '.zip': msg = run_zip_analysis(filepath, ID, method) else: msg = run_images_analysis(filepath, ID, method) return msg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_images_analysis(filepath, ID, method):\n for path in filepath:\n try:\n Image.open(path)\n except IOError:\n msg = 'Please import images files, or just a single zip archive'\n else:\n filename, extension = get_file_name(path)\n\n # Save ra...
[ "0.7374393", "0.6846931", "0.6268699", "0.62572134", "0.6137036", "0.6073903", "0.6000757", "0.5980023", "0.59539145", "0.5949638", "0.5929469", "0.59196985", "0.59115666", "0.59078693", "0.5898189", "0.5814665", "0.57921034", "0.5774928", "0.57512265", "0.5742385", "0.574088...
0.68059576
2
Run image analysis for zip archive
def run_zip_analysis(filepath, ID, method): with zipfile.ZipFile(filepath[0]) as zf: for entry in zf.namelist(): if not entry.startswith("__"): # Get rid hidden files in zip with zf.open(entry) as file: data = file.read() fh = io.BytesIO(d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run():\n\n today = datetime.now().strftime(\"%Y-%m-%d\")\n log_file = os.path.abspath(\"logs/{}.log\".format(today))\n logger = RsmasLogger(\"pipeline\", log_file)\n\n images = get_list_of_images()\n # LOG: list of images to process\n logger.log(loglevel.INFO, [img.key for img in images])\n\n...
[ "0.64381856", "0.63635296", "0.6358149", "0.6324381", "0.62869585", "0.6232183", "0.6155203", "0.6140258", "0.6044015", "0.6022487", "0.5966659", "0.5904075", "0.5880147", "0.58736247", "0.5790913", "0.5768327", "0.57619715", "0.5741277", "0.57412493", "0.5739594", "0.5689725...
0.693419
0
Check if message contains Error or Warning for run_analysis functions.
def check_msg(msg): err = bool(0) if 'Error' in msg: err = bool(1) elif "Warning" in msg: msg = 'Success! Warning: Image already exists. ' \ 'Processing ran on existing image' else: msg = 'Image saved successfully' return err, msg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error_check(self, message):\n matches = ERROR_SYNTAX.match(message)\n if matches:\n error_code = int(matches.group(1))\n error_message = matches.group(2)\n return error_code, error_message\n return None", "def collect_errors_and_warnings(self) -> str:\n ...
[ "0.6047532", "0.59931284", "0.59822315", "0.5976988", "0.5970713", "0.59450835", "0.59394825", "0.5925255", "0.5906123", "0.59012663", "0.5873115", "0.58316827", "0.57754755", "0.57746696", "0.57093453", "0.5681229", "0.56606114", "0.5603111", "0.558577", "0.5583142", "0.5579...
0.6277207
0
Check if message contains Error for get new_user_id function. Raise a ValueError if message contains "Error"
def check_user(msg): if "Error" in msg: raise ValueError('User already exists.')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_message_id(self, user, item_id, message_id):\n try:\n\n err_options = message_id.split(':', 2)\n msg_error_count = int(err_options[1])\n\n # check for token update\n if len(err_options) > 1 and err_options[2] != str(self.get_token(user)):\n ...
[ "0.67848724", "0.61461526", "0.6122", "0.6017559", "0.5941634", "0.5908885", "0.59077275", "0.5874253", "0.5843121", "0.5823432", "0.5823432", "0.5823432", "0.57579714", "0.57539093", "0.5725768", "0.57183814", "0.57163316", "0.57006186", "0.56851375", "0.5680018", "0.5669614...
0.701784
0
Upload image(s) and run the required analysis for multiple or single image file(s)
def run_images_analysis(filepath, ID, method): for path in filepath: try: Image.open(path) except IOError: msg = 'Please import images files, or just a single zip archive' else: filename, extension = get_file_name(path) # Save raw image to dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n \n # for inserting other images, add tem to /input folder and list them here\n images = (\n 'image-0',\n 'image-1',\n 'image-2'\n )\n\n for image_name in images:\n print(image_name, \"image:\")\n\n image = open_image(image_name)\n display_image(im...
[ "0.6907992", "0.6606996", "0.65919435", "0.6470824", "0.6414355", "0.6368806", "0.6355245", "0.63245857", "0.6265804", "0.62025523", "0.62011194", "0.6152564", "0.6149888", "0.61378866", "0.61241436", "0.608345", "0.60723394", "0.606071", "0.606038", "0.6033568", "0.6033372",...
0.76435435
0
Download multiple processed images in a zip archive.
def download_multiple(select_files, savepath, id, ext): with zipfile.ZipFile(savepath + '/processed_images.zip', mode='w') as zf: for file in select_files: pro_img, _, _, _, _ = get_image_pair(file, id) output = io.BytesIO() pro_img.save(output, format=ext) f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def downloadImages(self):\n\t\ti = 0\n\t\tfor im in self.images:\n\t\t\t# Let's get the file extension and file name and make the final file path. \n\t\t\t# We need to do this to slugify the file name and avoid errors when loading images\n\t\t\tfile_name, file_extension = os.path.splitext(im['url'])\n\t\t\tfile_na...
[ "0.76530296", "0.72565246", "0.68648124", "0.673801", "0.6725581", "0.67049855", "0.67010486", "0.6687771", "0.6672859", "0.6647223", "0.6634884", "0.66337126", "0.66298825", "0.66295946", "0.65946233", "0.65826285", "0.6576", "0.65477145", "0.6529526", "0.6509803", "0.650044...
0.7829335
0
This method will store a MistAssociation object into mongodb after creating a MistAssociation with the same values as the Association provided. Secret will be encoded because it constantly produced errors with encoding.
def storeAssociation(self, server_url, association): mist_association = MistAssociation() mist_association.assoc_type = association.assoc_type mist_association.handle = association.handle.hex() mist_association.secret = association.secret.hex() mist_association.lifetime = associ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def storeAssociation(self, server_url, assoc):\n assoc = models.Association(url=server_url,\n handle=assoc.handle,\n association=assoc.serialize())\n assoc.put()", "def storeAssociation(self, server_url, association):\r\n entity = datastore.Entity('Associati...
[ "0.702098", "0.6713939", "0.56481075", "0.53882486", "0.5067821", "0.50430053", "0.5034432", "0.493951", "0.49269888", "0.4900855", "0.48810253", "0.48749557", "0.4837358", "0.48064864", "0.48010197", "0.4800175", "0.47752208", "0.4773829", "0.47659233", "0.47503135", "0.4745...
0.705629
0
Gets a server url and the handle and finds a matching association that has not expired. Expired associations are deleted. The association returned is the one with the most recent issuing timestamp.
def getAssociation(self, server_url, handle=None): query = {'server_url': server_url} if handle: query.update({'handle': handle.hex()}) try: mist_associations = MistAssociation.objects(**query) except me.DoesNotExist: mist_associations = [] f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAssociation(self, server_url, handle=None):\n query = models.Association.all().filter('url', server_url)\n if handle:\n query.filter('handle', handle)\n\n results = query.fetch(1)\n if len(results) > 0:\n assoc = xAssociation.deserialize(results[0].association)\n if assoc.getExpir...
[ "0.77972186", "0.76248354", "0.61887425", "0.6054781", "0.568007", "0.49513325", "0.4506718", "0.44599456", "0.44545853", "0.4377314", "0.4343994", "0.42867646", "0.42596504", "0.42539644", "0.4183411", "0.41812235", "0.41506642", "0.4147285", "0.41288793", "0.41181672", "0.4...
0.7585846
2
This method removes the matching association if it's found, and returns whether the association was removed or not.
def removeAssociation(self, server_url, handle): try: mist_associations = MistAssociation.objects( server_url=server_url, handle=handle.hex()) except me.DoesNotExist: return False for assoc in mist_associations: assoc.delete() return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def removeAssociation(self, *args):\n return _libsbml.FbcOr_removeAssociation(self, *args)", "def removeAssociation(self, *args):\n return _libsbml.Association_removeAssociation(self, *args)", "def removeAssociation(self, *args):\n return _libsbml.FbcAnd_removeAssociation(self, *args)", ...
[ "0.69179744", "0.6731579", "0.67246026", "0.5947728", "0.58918077", "0.5864309", "0.5859789", "0.58411855", "0.5758755", "0.5709778", "0.56879985", "0.5626436", "0.5593932", "0.55795133", "0.5561436", "0.55258703", "0.550188", "0.5499768", "0.54942656", "0.5483335", "0.545969...
0.64031404
3
Called when using a nonce. This method should return C{True} if the nonce has not been used before, and store it for a while to make sure nobody tries to use the same value again. If the nonce has already been used or the timestamp is not current, return C{False}. You may use L{openid.store.nonce.SKEW} for your timesta...
def useNonce(self, server_url, timestamp, salt): if is_nonce_old(timestamp): return False try: mist_nonces = MistNonce.objects(server_url=server_url, salt=salt, timestamp=timestamp) except me.DoesNotExist: mist_non...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def useNonce(self, nonce):\r\n query = datastore.Query('Nonce')\r\n query['nonce ='] = nonce\r\n query['created >='] = (datetime.datetime.now() -\r\n datetime.timedelta(hours=6))\r\n\r\n results = query.Get(1)\r\n if results:\r\n datastore.Delete(results[0].key())\r\n ...
[ "0.73136973", "0.6600226", "0.6195637", "0.61672926", "0.61513644", "0.6094848", "0.6070164", "0.6020712", "0.6004455", "0.5996191", "0.5996191", "0.59095937", "0.5881976", "0.5801852", "0.5756545", "0.569583", "0.5590977", "0.5563972", "0.55559796", "0.5550194", "0.5542444",...
0.76029676
0
Remove expired nonces from the store. Discards any nonce from storage that is old enough that its timestamp would not pass L{useNonce}. This method is not called in the normal operation of the library. It provides a way for store admins to keep their storage from filling up with expired data.
def cleanupNonces(self): try: mist_nonces = MistNonce.objects() except me.DoesNotExist: mist_nonces = [] counter = 0 for n in mist_nonces: if n.is_old(): n.delete() counter += 1 return counter
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _remove_expired(self):\n with self.__lock:\n is_changed = False\n for k in list(self._d.keys()):\n if self._d[k].is_expired():\n log.debug(\"removing expired item: {}\".format(self._d[k]))\n del self[k]\n is_ch...
[ "0.6667037", "0.66389847", "0.66271514", "0.6594752", "0.65522724", "0.64164263", "0.640086", "0.62734115", "0.6258594", "0.6247243", "0.6166327", "0.6157293", "0.6084007", "0.6060935", "0.60464877", "0.5984581", "0.592853", "0.58712083", "0.5768196", "0.5718193", "0.56924313...
0.5977415
16
Remove expired associations from the store. This method is not called in the normal operation of the library. It provides a way for store admins to keep their storage from filling up with expired data.
def cleanupAssociations(self): try: mist_associations = MistAssociation.objects() except me.DoesNotExist: mist_associations = [] counter = 0 for assoc in mist_associations: if assoc.is_expired(): assoc.delete() counter ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _remove_expired(self):\n with self.__lock:\n is_changed = False\n for k in list(self._d.keys()):\n if self._d[k].is_expired():\n log.debug(\"removing expired item: {}\".format(self._d[k]))\n del self[k]\n is_ch...
[ "0.6875887", "0.6844624", "0.67177826", "0.65542144", "0.6533008", "0.6387391", "0.6350593", "0.6350029", "0.63188756", "0.62800354", "0.6261716", "0.6261716", "0.62265635", "0.61934316", "0.6192193", "0.6032369", "0.6010329", "0.600182", "0.59811556", "0.5909272", "0.5898087...
0.68006694
2
Shortcut for C{L{cleanupNonces}()}, C{L{cleanupAssociations}()}. This method is not called in the normal operation of the library. It provides a way for store admins to keep their storage from filling up with expired data.
def cleanup(self): return self.cleanupNonces(), self.cleanupAssociations()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup(self, *args, **kwargs):", "def _cleanup(self):\n pass", "def cleanup():", "def cleanup(*args, **kwargs): # real signature unknown\n pass", "def cleanup(self):\n\n pass", "def cleanup(self):\n raise NotImplementedError", "def cleanup(self):\n pass", "def cleanup(...
[ "0.7016629", "0.69023955", "0.66813576", "0.6666886", "0.66557264", "0.65890634", "0.6582056", "0.6582056", "0.6582056", "0.6582056", "0.6582056", "0.6582056", "0.6582056", "0.6582056", "0.6582056", "0.6582056", "0.6582056", "0.6575037", "0.65191555", "0.6517952", "0.649991",...
0.73417866
0
Return top level command handler.
def init(): @click.command() @click.option('--cell', callback=cli.handle_context_opt, envvar='TREADMILL_CELL', expose_value=False, required=True) @click.argument('app-or-svc') @click.option('--host', help='Hostnam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_command_handler(self) -> Callable:\n try:\n return globals()[self.command_handler]\n except KeyError:\n logging.error(\"command_handler function '%s' for command '%s' not found in global scope\" %\n (self.command_handler, self...
[ "0.7392408", "0.69905674", "0.6935066", "0.6817442", "0.6468187", "0.6460933", "0.6309276", "0.62970257", "0.62815976", "0.6280105", "0.6223721", "0.62009555", "0.61951655", "0.6180926", "0.6155766", "0.61281425", "0.60346127", "0.600372", "0.6003017", "0.59750646", "0.584907...
0.0
-1
View application's service logs.
def logs(app_or_svc, host, uniq, service): try: app, uniq, logtype, logname = app_or_svc.split('/', 3) except ValueError: app, uniq, logtype, logname = app_or_svc, uniq, 'service', service if any(param is None for param in [app, uniq, logtype, logname]): cli....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getLogs():", "def getLogs():", "def logs(self):\n return self.logger.logs()", "def log(self):\n resp = requests.get(\"%s/api/log\"%self.urlbase, verify=False)\n return resp.json[\"log\"]", "def logs(self, shell=False):\n if self.app_id:\n return self.yarn_api.logs...
[ "0.68098724", "0.68098724", "0.64053893", "0.6395825", "0.630246", "0.6281809", "0.6209214", "0.62079066", "0.611495", "0.61128664", "0.6103324", "0.60686356", "0.6053491", "0.6024822", "0.60207194", "0.5982966", "0.5934909", "0.5930149", "0.59281075", "0.59259474", "0.592594...
0.6984841
0
Find nodeinfo endpoint on host
def _nodeinfo_endpoint(host): zkclient = context.GLOBAL.zk.conn nodeinfo_zk_path = '{}/{}'.format(z.ENDPOINTS, 'root') for node in zkclient.get_children(nodeinfo_zk_path): if 'nodeinfo' in node and host in node: data, _metadata = zkclient.get( '{}/{}'.format(nodeinfo_zk_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getHostInfo():", "def get_node_details(self, node):\n node_details = self.parser.find_server_by_ip(node.get('ip')) or \\\n self.parser.find_server_by_hostname(node.get('host'))\n\n return node_details", "def getHost():", "def getHost():", "def test_get_node_internal_...
[ "0.7210888", "0.66543496", "0.6595249", "0.6595249", "0.6384198", "0.62400854", "0.6236083", "0.6164553", "0.6050032", "0.6024226", "0.5987261", "0.5953469", "0.593182", "0.5915911", "0.59002453", "0.5839691", "0.58132106", "0.57908964", "0.5767918", "0.5744465", "0.57380223"...
0.7731481
0
dropout + batch norm + l1_l2
def architecture_CONV_FC_batch_norm_dropout_L1_l2( X, nbclasses, nb_conv=1, nb_fc=1, kernel_initializer="random_normal" ): # input size width, height, depth = X.shape input_shape = (height, depth) # parameters of the architecture l1_l2_rate = 1.0e-3 dropout_rate = 0.5 conv_kernel = 3 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def architecture_CONV_FC_batch_norm_dropout_L1_l2_LEAKY_ReLU(\n X, nbclasses, nb_conv=1, nb_fc=1\n):\n # input size\n width, height, depth = X.shape\n input_shape = (height, depth)\n\n # parameters of the architecture\n l1_l2_rate = 1.0e-3\n dropout_rate = 0.5\n conv_kernel = 3\n conv_fi...
[ "0.6057391", "0.6015575", "0.59682286", "0.59510905", "0.5895679", "0.5895679", "0.5812982", "0.57391614", "0.5654636", "0.5644836", "0.56329393", "0.56230843", "0.5617473", "0.56083846", "0.5606605", "0.55982274", "0.55822885", "0.5554348", "0.5552772", "0.554574", "0.554353...
0.6199096
0
dropout + batch norm + l1_l2
def architecture_CONV_FC_batch_norm_dropout_L1_l2_TANH( X, nbclasses, nb_conv=1, nb_fc=1 ): # input size width, height, depth = X.shape input_shape = (height, depth) # parameters of the architecture l1_l2_rate = 1.0e-3 dropout_rate = 0.5 conv_kernel = 3 conv_filters = 64 nbunits...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def architecture_CONV_FC_batch_norm_dropout_L1_l2(\n X, nbclasses, nb_conv=1, nb_fc=1, kernel_initializer=\"random_normal\"\n):\n # input size\n width, height, depth = X.shape\n input_shape = (height, depth)\n\n # parameters of the architecture\n l1_l2_rate = 1.0e-3\n dropout_rate = 0.5\n c...
[ "0.61973625", "0.605561", "0.59693855", "0.5950774", "0.58955586", "0.58955586", "0.5811553", "0.57387733", "0.5654752", "0.5646109", "0.5632108", "0.56242067", "0.5616107", "0.56091213", "0.5604995", "0.559818", "0.5580515", "0.55549634", "0.5554276", "0.5544025", "0.554147"...
0.6014573
2
dropout + batch norm + l1_l2
def architecture_CONV_FC_batch_norm_dropout_L1_l2_SIGMOID( X, nbclasses, nb_conv=1, nb_fc=1 ): # input size width, height, depth = X.shape input_shape = (height, depth) # parameters of the architecture l1_l2_rate = 1.0e-3 dropout_rate = 0.5 conv_kernel = 3 conv_filters = 64 nbun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def architecture_CONV_FC_batch_norm_dropout_L1_l2(\n X, nbclasses, nb_conv=1, nb_fc=1, kernel_initializer=\"random_normal\"\n):\n # input size\n width, height, depth = X.shape\n input_shape = (height, depth)\n\n # parameters of the architecture\n l1_l2_rate = 1.0e-3\n dropout_rate = 0.5\n c...
[ "0.6197579", "0.60561115", "0.60153174", "0.5969007", "0.5949365", "0.58943415", "0.58943415", "0.58114785", "0.5737982", "0.56550455", "0.5645784", "0.5630686", "0.56221515", "0.5616789", "0.560882", "0.56057966", "0.5596632", "0.55800354", "0.55554694", "0.5553616", "0.5540...
0.55448663
20
dropout + batch norm + l1_l2
def architecture_CONV_FC_batch_norm_dropout_L1_l2_LEAKY_ReLU( X, nbclasses, nb_conv=1, nb_fc=1 ): # input size width, height, depth = X.shape input_shape = (height, depth) # parameters of the architecture l1_l2_rate = 1.0e-3 dropout_rate = 0.5 conv_kernel = 3 conv_filters = 64 n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def architecture_CONV_FC_batch_norm_dropout_L1_l2(\n X, nbclasses, nb_conv=1, nb_fc=1, kernel_initializer=\"random_normal\"\n):\n # input size\n width, height, depth = X.shape\n input_shape = (height, depth)\n\n # parameters of the architecture\n l1_l2_rate = 1.0e-3\n dropout_rate = 0.5\n c...
[ "0.6198059", "0.6015281", "0.596931", "0.5949474", "0.58950055", "0.58950055", "0.5811575", "0.5737953", "0.56548023", "0.5646338", "0.563125", "0.5623065", "0.56162375", "0.5609015", "0.5605381", "0.5597299", "0.5579035", "0.55545306", "0.5553643", "0.5545299", "0.5540341", ...
0.60564125
1
This first section contains the functions that make the program convert the different number systems
def calculator (menuWindow): #This procedure accepts the parameter subProgram which will tell it which conversion function #to call. These functions will then return a value to outputUpdate and #set resultText to the appropriate message""" def popUP(message): pop = tk.Tk() pop.title("Er...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _pettifor_numbers():\n return { \"Li\": 0.45,\n \"Be\": 1.5,\n \"B\": 2.0,\n \"C\": 2.5,\n \"N\": 3.0, \n \"O\": 3.5,\n \"F\": 4.0,\n \n \"Na\": 0.4,\n \"Mg\": 1.28,\n \"Al\": 1.66,\n ...
[ "0.6049695", "0.57279676", "0.56754863", "0.56605375", "0.56527585", "0.56470346", "0.56375796", "0.5623967", "0.56085277", "0.56013507", "0.56012034", "0.55787975", "0.5558308", "0.5548418", "0.5497168", "0.5491952", "0.54788685", "0.54778224", "0.54226166", "0.54081273", "0...
0.0
-1
Generates a trajectory of the Markov jump process.
def Execute(self,settings,IsStatusBar=False): if settings.IsSeed: np.random.seed(5) self._IsInitial = True self.settings = settings self.sim_t = copy.copy(settings.starttime) # does not have to start at zero if we perform sequential simulations ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_trajectory(self, current_pos, velocity, goal, dt, prediction_time):\n\n history = list(np.copy(self._reached_goals))\n\n\n\n\n out = []\n out.append(np.copy(current_pos))\n first_goal_idx = np.where(self._goals == goal)[0][0]\n selected_goal = goal\n reached_...
[ "0.6040567", "0.6015634", "0.60108757", "0.590324", "0.58615047", "0.58486295", "0.5742071", "0.5694309", "0.5661889", "0.5657638", "0.563613", "0.5598414", "0.5571726", "0.5569394", "0.55562425", "0.5501541", "0.5492893", "0.5480169", "0.54617375", "0.54580027", "0.5438285",...
0.0
-1
Calculates a time step of the Direct Method
def RunExactTimestep(self): if self.sim_t == 0: randoms = np.random.random(1000) self.randoms_log = np.log(randoms)*-1 self.randoms = np.random.random(1000) self.count = 0 elif self.count == 1000: randoms = np.random.random(1000) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_time_step():\n\n dt = Hydro.compute_time_step()\n\n return dt", "def _STEPS2TIME(step):\n return step/1000.", "def time(self, step: int) -> float:\n return self._start_time + self._parameters.dt*(step - self._start_step)", "def time_step(self):\n\n rho_rel = np.abs(self.rho_d...
[ "0.73281395", "0.72096485", "0.7029386", "0.70150405", "0.6889623", "0.68617964", "0.68476254", "0.6813826", "0.68087006", "0.66766346", "0.6659325", "0.6623326", "0.660472", "0.6590279", "0.65758175", "0.656104", "0.6550675", "0.6538886", "0.6505917", "0.649663", "0.6495107"...
0.0
-1
r""" Find named groups in `pattern` and replace them with the group name. E.g., 1. ^(?P\w+)/b/(\w+)$ ==> ^/b/(\w+)$ 2. ^(?P\w+)/b/(?P\w+)/$ ==> ^/b//$
def replace_named_groups(pattern): named_group_indices = [ (m.start(0), m.end(0), m.group(1)) for m in named_group_matcher.finditer(pattern) ] # Tuples of (named capture group pattern, group name). group_pattern_and_name = [] # Loop over the groups and their start and end indices. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rename_regex_groups(pattern):\n\n grp_rewritten = ''\n mapping = dict()\n rmapping = dict()\n cnt = 1\n for item in _NAMED_GRP_PATTERN.split(pattern):\n if _NAMED_GRP_PATTERN.fullmatch(item):\n old_name = item[len(_NAMED_GRP_PREFIX):-len(_NAMED_GRP_S...
[ "0.7320233", "0.67950296", "0.605959", "0.6014507", "0.5789089", "0.5741866", "0.55717754", "0.5548644", "0.55015105", "0.5437232", "0.54301506", "0.53881884", "0.5342404", "0.53323615", "0.52918", "0.5223952", "0.520838", "0.51812756", "0.5165162", "0.5128126", "0.510275", ...
0.7663291
0
r""" Find unnamed groups in `pattern` and replace them with ''. E.g., 1. ^(?P\w+)/b/(\w+)$ ==> ^(?P\w+)/b/$ 2. ^(?P\w+)/b/((x|y)\w+)$ ==> ^(?P\w+)/b/$
def replace_unnamed_groups(pattern): unnamed_group_indices = [m.start(0) for m in unnamed_group_matcher.finditer(pattern)] # Indices of the start of unnamed capture groups. group_indices = [] # Loop over the start indices of the groups. for start in unnamed_group_indices: # Handle nested par...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_named_groups(pattern: str, noncapturing: bool = True) -> str:\n if noncapturing:\n new_parens = \"(?:\"\n else:\n new_parens = \"(\"\n\n return re.sub(r\"\\(\\?P<\\w+>\", new_parens, pattern)", "def replace_named_groups(pattern):\n named_group_indices = [\n (m.start(0)...
[ "0.680426", "0.6300317", "0.60647875", "0.58528376", "0.5731375", "0.56507546", "0.56190664", "0.5457598", "0.5445742", "0.5427602", "0.5402431", "0.5378804", "0.531599", "0.52673435", "0.5245449", "0.5193543", "0.5173778", "0.51385576", "0.50884974", "0.50674146", "0.5060320...
0.73646694
0
r""" Clean up urlpattern regexes into something more readable by humans. For example, turn "^(?P\w+)/athletes/(?P\w+)/$" into "//athletes//".
def simplify_regex(pattern): pattern = replace_named_groups(pattern) pattern = replace_unnamed_groups(pattern) # clean up any outstanding regex-y characters. pattern = pattern.replace('^', '').replace('$', '') if not pattern.startswith('/'): pattern = '/' + pattern return pattern
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean(self, sub):\n sub = re.sub(r'^RT[\\s]+', '', sub)\n sub = re.sub(r'https?:\\/\\/.*[\\r\\n]*', '', sub)\n sub = re.sub(r'#', '', sub)\n sub = re.sub(r'@[A-Za-z0–9]+', '', sub) \n\n return sub", "def url_removal(text):\n return re.sub(r'''(?i)\\b((?:https?://|www\\d{...
[ "0.6629905", "0.6508251", "0.638263", "0.63161266", "0.6314307", "0.6314307", "0.6314307", "0.6314307", "0.6314307", "0.6314307", "0.6314307", "0.63040775", "0.62951714", "0.6283508", "0.62794656", "0.62432885", "0.62392426", "0.6236246", "0.6177149", "0.6127283", "0.60598266...
0.5762543
42
return a list of manifests that are applied on this machine
def fact(): manifests = [x for x in os.walk(manifests_dir)] return { 'manifests': manifests }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def available_manifest_strands(self):\n return self._available_manifest_strands", "def list_manifests():\n import enaml\n with enaml.imports():\n from .pulses.manifest import PulsesManagerManifest\n from .tasks.manifest import PulsesTasksManifest\n from .measure.manifest import ...
[ "0.7041786", "0.6661976", "0.65691805", "0.62815154", "0.62224513", "0.6135718", "0.60951227", "0.60727566", "0.5942932", "0.58993065", "0.588448", "0.58641076", "0.58577496", "0.5830976", "0.58182544", "0.58155537", "0.58051246", "0.5784909", "0.5783124", "0.57371914", "0.57...
0.5902238
9
Avoid using literal_eval for simple addition expressions. Returns sum of all positive numbers.
def split_and_sum(expression): split_vals = expression.split('+') float_vals = [float(v) for v in split_vals] total = sum([v for v in float_vals if v > 0.0]) return total
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eval_sum(parse_result):\r\n total = 0.0\r\n current_op = operator.add\r\n for token in parse_result:\r\n if token == '+':\r\n current_op = operator.add\r\n elif token == '-':\r\n current_op = operator.sub\r\n else:\r\n total = current_op(total, tok...
[ "0.71442914", "0.70861304", "0.62418014", "0.62357926", "0.6229933", "0.62040615", "0.6063164", "0.60560673", "0.6047006", "0.5978517", "0.59740245", "0.59523994", "0.59317786", "0.59307003", "0.5925646", "0.5923283", "0.5915873", "0.5901256", "0.58456707", "0.5834098", "0.58...
0.65476674
2
Requests the last known production mix (in MW) of a given country
def fetch_production(zone_key='IN-GJ', session=None, target_datetime=None, logger=getLogger('IN-GJ')): session = session or requests.session() if target_datetime: raise NotImplementedError( 'This parser is not yet able to parse past dates') value_map = fetch_data(zo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_inflation_country():\n print(\">> Downloading WORLD BANK inflation / country data...\")\n url = source_config.inflation_data_url['latest']\n output_file = source_config.inflation_data_files['raw']['latest']\n download_insee_excel(url, output_file, check=False)", "def get_country(self, country...
[ "0.56177616", "0.54850656", "0.5471012", "0.5399314", "0.526083", "0.5193768", "0.51925", "0.51359487", "0.50710964", "0.5054442", "0.49891022", "0.49824235", "0.4921711", "0.488063", "0.48740438", "0.48602745", "0.48566684", "0.48416945", "0.48135594", "0.480547", "0.4795513...
0.45403993
55
Method to get consumption data of Gujarat
def fetch_consumption(zone_key='IN-GJ', session=None, target_datetime=None, logger=getLogger('IN-GJ')): session = session or requests.session() if target_datetime: raise NotImplementedError( 'This parser is not yet able to parse past dates') value_map = fetch_data(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getEnergyUsage():\n energy_data = asyncio.run(plug.get_emeter_realtime())\n\n return energy_data", "def getStockData():\n pass", "def getCurentData(self):\n if not self.labExperiment:\n super().getCurentData()\n else:\n return np.array(self.connection.query(...
[ "0.658672", "0.63099957", "0.6295263", "0.62537384", "0.61207724", "0.6117239", "0.61045456", "0.606737", "0.6031213", "0.6023843", "0.5998073", "0.598272", "0.59735596", "0.59629476", "0.5935335", "0.5935141", "0.593349", "0.5888127", "0.58589953", "0.5831155", "0.5789991", ...
0.0
-1
Smoothed absolute function. Useful to compute an L1 smooth error.
def abs_smooth(net_loc, input_loc): x = net_loc - input_loc absx = tf.abs(x) minx = tf.minimum(absx, 1) r = 0.5 * ((absx - 1) * minx + absx) return r
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _l1_smooth_loss(self, y_true, y_predicted):\n absolute_value_loss = tf.abs(y_true, y_predicted) - 0.5\n square_loss = 0.5 * (y_true - y_predicted)**2\n smooth_l1_condition = tf.less(absolute_value_loss, 1.0)\n l1_smooth_loss = tf.select(smooth_l1_condition,\n ...
[ "0.64517206", "0.58765614", "0.56680757", "0.5649169", "0.5616871", "0.55822164", "0.55743736", "0.5557006", "0.5528426", "0.5517026", "0.54865664", "0.5475101", "0.5430965", "0.54217964", "0.5417211", "0.53726065", "0.5364687", "0.5338996", "0.5331391", "0.5327666", "0.53195...
0.5849999
2
if keys from dict occur in kw, pop them
def _kw_extract(kw,dict): for key,value in dict.items(): dict[key]=kw.pop(key,value) return kw,dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mRemove(self, **kw):\n kw = copy_non_reserved_keywords(kw)\n for key, val in kw.items():\n # It would be easier on the eyes to write this using\n # \"continue\" statements whenever we finish processing an item,\n # but Python 1.5.2 apparently doesn't let you use \...
[ "0.659709", "0.658242", "0.64829236", "0.6343324", "0.62005615", "0.602767", "0.59886026", "0.5980594", "0.5973243", "0.59430367", "0.5851196", "0.5803663", "0.578763", "0.5769544", "0.5725139", "0.5696665", "0.564784", "0.56437635", "0.5620172", "0.56135494", "0.5593906", ...
0.73164487
0
plot(f) allows f to be (x,y) tuple
def plot(f,**kw): if type(f)==tuple: x,y=f pl.plot(x,y,**kw) else: pl.plot(f,**kw)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_plot(x,y):", "def plot():\n pass", "def plot_f(self, *args, **kwargs):\r\n kwargs['plot_raw'] = True\r\n self.plot(*args, **kwargs)", "def __plot(self, x: list, y:list):\r\n # clear the figure\r\n self.figure.clear()\r\n # create an axis\r\n self.canvas.a...
[ "0.7233913", "0.67269236", "0.6719971", "0.643809", "0.63938314", "0.63545954", "0.62653416", "0.61198306", "0.6113964", "0.6108317", "0.60705554", "0.6022874", "0.5939718", "0.59299445", "0.59191865", "0.5891549", "0.58682585", "0.58335316", "0.5833347", "0.5831018", "0.5812...
0.8709098
0
Plot values along direction dir={0,1,2}, through point pt=[x,y,z]
def plot_values_along(pp,pt=[0.5,0.5,0.5],**kw): kv = {'dir':0, 'verbose':0, 'all':False, 'iv':0, 'i4':0, 'var':None} kw,kv = _kw_extract(kw,kv) plot(ds.values_along(pp,pt,iv=kv['iv'],dir=kv['dir'],all=kv['all']),**kw)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_point(axis, pnt3d, color):\n xy = bc2xy(pnt3d)\n axis.scatter(xy[0], xy[1], c=color, marker='o')", "def plot_direction(ax, phi_deg, psi_deg, \n color='black', marker='d', markersize=3,\n label=None, label_position='right', weight='normal'):\n phi_rad = phi_de...
[ "0.6262929", "0.6006915", "0.57216173", "0.5702731", "0.56610227", "0.5660082", "0.5647964", "0.5641175", "0.56411433", "0.5629691", "0.56232494", "0.5620824", "0.5591335", "0.5566767", "0.5546428", "0.5539211", "0.553336", "0.553327", "0.552634", "0.5522603", "0.55138886", ...
0.605601
1
Plot values along direction dir={0,1,2}, through point pt=[x,y,z]
def plot_patch_values_along(pp_in,pt=[0.5,0.5,0.5],hold=False,**kw): kv = {'dir':0, 'verbose':0, 'all':False, 'iv':0, 'i4':0, 'var':None} kw,kv = _kw_extract(kw,kv) pp = ds.patches_along(pp_in,pt,dir=kv['dir'],verbose=kv['verbose']) xmin,xmax = ds.minmax_patches(pp,dir=kv['dir']) if not hold: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_point(axis, pnt3d, color):\n xy = bc2xy(pnt3d)\n axis.scatter(xy[0], xy[1], c=color, marker='o')", "def plot_values_along(pp,pt=[0.5,0.5,0.5],**kw):\n kv = {'dir':0, 'verbose':0, 'all':False, 'iv':0, 'i4':0, 'var':None}\n kw,kv = _kw_extract(kw,kv)\n plot(ds.values_along(pp,pt,iv=kv['iv']...
[ "0.62647605", "0.60552585", "0.6005312", "0.5723366", "0.57031566", "0.566268", "0.5660064", "0.56475013", "0.56423193", "0.5641629", "0.563067", "0.5624117", "0.56221503", "0.55907345", "0.556801", "0.55449003", "0.5540896", "0.5535063", "0.5534622", "0.5526678", "0.55239534...
0.0
-1
plot power spectrum of 2D array
def power2d(f,*kw): ft2=np.abs(np.fft.fft2(f))**2 m=f.shape k=np.meshgrid(range(m[0]),range(m[1])) k=np.sqrt(k[0]**2+k[1]**2) a=2 k0=1.0/a**0.5 k1=1.0*a**0.5 power=[] kk=[] while(k1 <= m[0]//2): kk.append((k0*k1)**0.5) w=np.where((k>k0) & (k <= k1)) power....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_spectrum( data ):\n d = data[1]\n # rfft gives positive frequecies. Square to get power spectrum.\n fp = numpy.absolute( numpy.fft.rfft( d ) )**2\n freq = numpy.fft.fftfreq( d.shape[-1] )\n n = len(fp)\n\n # reshape stuff a bit. keep only positive freqs.\n fp = fp[1:-1]\n freq = fr...
[ "0.6865385", "0.68452597", "0.68080705", "0.6768042", "0.66995203", "0.66993386", "0.64395714", "0.6430631", "0.6409568", "0.63501585", "0.6320459", "0.6320107", "0.6272982", "0.62168336", "0.6190964", "0.6128101", "0.6125795", "0.61254364", "0.6112583", "0.61059433", "0.6100...
0.0
-1
raise a figure to the top
def show_plot(figure_id=None): if figure_id is None: fig = pl.gcf() else: # do this even if figure_id == 0 fig = pl.figure(num=figure_id) pl.show() pl.pause(1e-9) fig.canvas.manager.window.activateWindow() fig.canvas.manager.window.raise_()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_top(self):\n return group()", "def XPBringRootWidgetToFront(inWidget):\n pass", "def autostop():", "def raise_window(window):\n window.attributes('-topmost', 1)\n window.attributes('-topmost', 0)", "def back_extra(self, ontop):\n\n self.frames[ontop].forget()\n self.e...
[ "0.62913567", "0.61378044", "0.5949495", "0.5857847", "0.58181804", "0.5804387", "0.57883143", "0.5783538", "0.5747582", "0.5702409", "0.5701583", "0.56797063", "0.5665179", "0.5653984", "0.56508195", "0.5632079", "0.5603762", "0.5568151", "0.5565534", "0.5541218", "0.5529163...
0.0
-1
replace the normal pause, w/o raising window()
def pause(time=1e-6): pl.draw() pl.gcf().canvas.start_event_loop(time)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pause(self):\n\t\tpass", "def pause(): # real signature unknown; restored from __doc__\n pass", "def pause(self):\n pass", "def pause(self):\n pass", "def pause():\n click.pause()", "def pause(self):\n \n self.pause = True", "def pause(self):\n pass\n ...
[ "0.7750189", "0.760757", "0.7583673", "0.7583673", "0.7269366", "0.71191716", "0.70278", "0.69974154", "0.6884622", "0.68308437", "0.68308437", "0.68252546", "0.68184483", "0.68105435", "0.6808565", "0.6798502", "0.67898375", "0.6775584", "0.6741306", "0.6734974", "0.67122114...
0.6827029
11
Plot the PDF of the density
def pdf_d(iout,run='',data='../data',iv='d',i4=0,nbin=100,xlim=[-4,3],lnd=False): s = di.snapshot(iout,run=run,data=data) n = nbin bins = np.linspace(xlim[0],xlim[1],n+1) htot = 0.0 i = 0 for p in s.patches: i += 1 if i%1000==0: print('{:.1f}%'.format(i/len(s.patches)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pdf(data, args):\n return Plot._dist(data, args)", "def make_kde_plot(x, pdf):\n\n fig = plt.figure(figsize=(768/96, 400/96), dpi=9)\n ax = plt.gca()\n ax.plot(x, pdf)\n ax.fill_between(x, pdf, alpha=.5)\n\n # Formatting\n plt.xlabel('Hourly rate ($)', fontsize=18)\n plt.xticks(fo...
[ "0.73690754", "0.71617067", "0.71548754", "0.6999526", "0.6962633", "0.6902345", "0.690083", "0.6887748", "0.6878603", "0.68121535", "0.67572474", "0.66559654", "0.66133654", "0.66133654", "0.6585173", "0.6584147", "0.6578231", "0.6572529", "0.6552081", "0.654156", "0.6535898...
0.5843463
98
Plot the output of the dispatch.pdf() procedure
def plot_pdf(pdf,**kwargs): pl.hist(pdf.bins,bins=pdf.bins,weights=pdf.counts,**kwargs) return pdf.time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Plot(self):\n\n ### Create the path names ###\n folder_string = self.params.folder+\"/plots/\"\n u_string = self.params.folder+\"/plots/u.pdf\"\n p_string = self.params.folder+\"/plots/p.pdf\"\n\n ### Check if folder exists ###\n if not os.path.exists(folder_string): o...
[ "0.70713794", "0.69506466", "0.65899605", "0.6551687", "0.65347886", "0.6530138", "0.65197337", "0.6519003", "0.6465785", "0.6432504", "0.63811475", "0.6373067", "0.6363945", "0.63360846", "0.6330689", "0.63069654", "0.62943375", "0.62903255", "0.6219337", "0.62005454", "0.61...
0.591895
48
Delete matches category and all its channels.
async def delete_matches_category(self): existing_categories = self.get_channels( 'matches', ChannelType.category) for c in existing_categories: try: await asyncio.gather(*(chan.delete() for chan in c.channels)) await c.delete() # We ca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup(self, channel=None):\n # falls `channel` angegeben wurden, werden nur diese bereinigt,\n # ansonsten wird alles bereinigt\n if channel:\n # ueberpruefe, ob `channel` eine Zahl ist und erstelle eventuell eine Liste nur mit dieser Zahl\n # dies ist wichtig, weil...
[ "0.64337945", "0.6401022", "0.6107181", "0.6081878", "0.5946473", "0.5895014", "0.587733", "0.5871811", "0.5821551", "0.5815859", "0.57719624", "0.5770912", "0.5759033", "0.57166386", "0.5705552", "0.5697941", "0.5684132", "0.56386846", "0.55753577", "0.5554672", "0.55487365"...
0.8869049
0
Prevent both players from reporting at the same time.
def _add_to_recently_called(self, match, reporter): if utils.istrcmp(match.player1_tag, reporter): other = match.player2_tag else: other = match.player1_tag self.recently_called[other] = time()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def still_deciding(self):\n for player in self.players:\n if isinstance(player, user.User):\n if not player.has_played:\n return True\n return False", "def playerdefeated(self):\n globalvalues.gameover_combat()", "def losesChance(self):\n ...
[ "0.61262506", "0.60236615", "0.5634644", "0.56011015", "0.5578245", "0.5538049", "0.5537875", "0.55358166", "0.5534296", "0.5521882", "0.5503166", "0.55023617", "0.5500676", "0.5480155", "0.5468607", "0.54599667", "0.5449898", "0.54205763", "0.5392923", "0.5390785", "0.537815...
0.5070516
77
Check the participants list for players not on the server.
async def missing_tags(self, owner) -> List[str]: dms = await utils.get_dms(owner) missing = [player for player in await self.gar.get_players() if not self.get_user(player)] if not missing: return [] message = ['Missing Discord accounts for the following pl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_participants(self):\n for i in range(self.num):\n def check(m):\n if m.content.lower().strip() == \"i\" and m.author not in self.participants:\n return True\n\n return False\n\n # Wait with a timeout of 2 minutes and check ...
[ "0.6719684", "0.63900346", "0.6368742", "0.62854147", "0.6258194", "0.6222326", "0.6147451", "0.61474484", "0.6127953", "0.60543185", "0.598346", "0.59729105", "0.5960582", "0.5942845", "0.594048", "0.58446205", "0.5834904", "0.5820176", "0.5808948", "0.58085364", "0.5796258"...
0.6249625
5
Gets our permissions on the server.
def permissions(self) -> discord.Permissions: return self.channel.permissions_for(self.guild.me)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_permissions(self):\n return self.settings[\"permissions\"]", "def octopus_permissions_get(self, msg, args):\r\n return self.permissions.get_permissions()", "def permissions(self):\n return self.get_permissions()", "def get_permissions():\n return config.get_cfg_storage(ID_...
[ "0.7986771", "0.794256", "0.7887418", "0.78345644", "0.77169865", "0.76053184", "0.7577209", "0.75250983", "0.74911094", "0.7277559", "0.72693956", "0.72676855", "0.723835", "0.71908754", "0.7177519", "0.7157548", "0.7146727", "0.71430004", "0.7129717", "0.70936584", "0.70712...
0.7516241
8
Gets the user mention string. If the user isn't found, just return the username.
def mention_user(self, username: str) -> str: member = self.get_user(username) if member: return member.mention return username
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_user_mention(self, name: str) -> str:\n try:\n return self.known_user_ids[name]\n except KeyError:\n pass\n\n mention = name\n users = get_value_from_redis('slack-members') or []\n user = self._get_user(name, users)\n if user:\n me...
[ "0.78680474", "0.75037277", "0.698189", "0.698189", "0.68996614", "0.6867837", "0.67106825", "0.6666238", "0.66000545", "0.6591795", "0.6591795", "0.65639687", "0.65635896", "0.65554214", "0.65437853", "0.64928955", "0.64731586", "0.6467594", "0.6467354", "0.6457515", "0.6457...
0.8424426
0
Get member by username.
def get_user(self, username: str) -> Optional[discord.Member]: for m in self.guild.members: if utils.istrcmp(m.display_name, username): return m return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user(self, username):\n\t\treturn self.users.get(username, None)", "def get_member(self, user):\n for player in self.members:\n if player.uuid == user.id:\n return player\n return None", "def Get(self, username):\n if self._users:\n return self._users.get...
[ "0.75246143", "0.7495561", "0.74683446", "0.74049187", "0.73253155", "0.7299027", "0.72175676", "0.71334416", "0.7068116", "0.7049825", "0.7039728", "0.6946112", "0.69360876", "0.69183743", "0.69003195", "0.689256", "0.68825346", "0.6881717", "0.68705404", "0.68620247", "0.68...
0.8309965
0
Catch any method/attribute lookups that are not defined in this class and try to find them on the provided bridge object.
def __getattr__(self, name: str): return getattr(self._client, name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _lookup_method(self, call):\n raise Exception(\"_lookup_method must be implemented by subclasses.\")", "def lookup(self, *args, **kwargs): # real signature unknown\n pass", "def lookup(self, *args, **kwargs): # real signature unknown\n pass", "def test_lookup_parameter_handler_object...
[ "0.5799882", "0.56170505", "0.56170505", "0.5608421", "0.52733755", "0.51485467", "0.5021419", "0.49733004", "0.48889658", "0.48796782", "0.4817488", "0.47882497", "0.478772", "0.47650564", "0.4761213", "0.47604015", "0.475525", "0.47418138", "0.47340906", "0.47281703", "0.46...
0.0
-1
Test names like Goat Cat
def test_first_last(self): full_name = get_full_name("pony", "cat") self.assertEqual(full_name, "Pony Cat") full_name = get_full_name("goat", "cat") self.assertEqual(full_name, "Goat Cat")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_title(names):", "def test_name(self):\n\n self.check_search(\n dict(name=u'flamethrower'),\n [u'Flamethrower'],\n 'searching by name',\n exact=True,\n )\n\n self.check_search(\n dict(name=u'durp'),\n [],\n ...
[ "0.7272773", "0.72304636", "0.72284096", "0.69994545", "0.697421", "0.69290376", "0.689268", "0.68515533", "0.6850236", "0.6830433", "0.6828345", "0.6685354", "0.6678936", "0.6674695", "0.66445744", "0.6638108", "0.6600845", "0.65993506", "0.6574424", "0.657173", "0.65344596"...
0.6196084
50
Test names like Goat Studman Cat
def test_first_last_middle(self): full_name = get_full_name("pony", "cat", "sweetie") self.assertEqual(full_name, "Pony Sweetie Cat") full_name = get_full_name("goat", "cat", "studman") self.assertEqual(full_name, "Goat Studman Cat")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_legal_names(self):\n names = [prod.name for prod in generate_products()]\n sep = [(name.split()[0], name.split()[1]) for name in names]\n for name in sep:\n self.assertIn(name[0], ADJS)\n self.assertIn(name[1], NOUNS)", "def test_legal_names(self):\n tes...
[ "0.7357881", "0.7340329", "0.732584", "0.72818434", "0.72236216", "0.720758", "0.7120223", "0.69911456", "0.69444036", "0.69189924", "0.69121563", "0.69082373", "0.6899404", "0.6823745", "0.6816478", "0.68021417", "0.6771601", "0.6714057", "0.67046154", "0.67022836", "0.66533...
0.64093536
49
Calculate the bake time remaining.
def bake_time_remaining(elapsed_bake_time=EXPECTED_BAKE_TIME): time_remaining = EXPECTED_BAKE_TIME - elapsed_bake_time return time_remaining
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bake_time_remaining(elapsed_bake_time: int) -> int:\n return EXPECTED_BAKE_TIME - elapsed_bake_time", "def bake_time_remaining(elapsed_bake_time):\n return EXPECTED_BAKE_TIME - elapsed_bake_time", "def bake_time_remaining(elapsed_bake_time):\n return EXPECTED_BAKE_TIME - elapsed_bake_time", "def...
[ "0.8687785", "0.85834104", "0.85834104", "0.85834104", "0.7155303", "0.6970577", "0.6957602", "0.688031", "0.67487776", "0.6720861", "0.67003495", "0.66638684", "0.6635681", "0.6626661", "0.6574791", "0.65689373", "0.6551115", "0.65494686", "0.653096", "0.6519621", "0.6506905...
0.84728587
4
Calculate Time To Prepare All Layers. This funtion takes the lasagna number of layers as a parameter and mutiplies that value with the designated preparation time.
def preparation_time_in_minutes(number_of_layers): layers_preparation_time = number_of_layers * PREPARATION_TIME return layers_preparation_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preparation_time_in_minutes(number_of_layers: int) -> int:\n return PREPARATION_TIME_PER_LAYER_IN_MINUTES * number_of_layers", "def preparation_time_in_minutes(number_of_layers):\n return number_of_layers * 2", "def preparation_time_in_minutes(number_of_layers):\n return PREPARATION_TIME * number_...
[ "0.74356353", "0.7422801", "0.73030597", "0.7143981", "0.5985816", "0.5975828", "0.5915438", "0.5865488", "0.57980657", "0.5677244", "0.5349525", "0.5309606", "0.5289832", "0.52619296", "0.5260173", "0.5198084", "0.51720953", "0.5171042", "0.5160975", "0.5144867", "0.51287425...
0.7569402
0
Calculate Total Elapsed Time. This funtion takes the lasagna number of layers as a parameter and also the elapsed bake time and adds both values to aquire an accurate result hoe much time we have spent baking the lasagna.
def elapsed_time_in_minutes(number_of_layers, elapsed_bake_time): preparation_time = preparation_time_in_minutes(number_of_layers) total_bake_time = preparation_time + elapsed_bake_time return total_bake_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def elapsed_time_in_minutes(no_of_layers, elapsed_bake_time):\n return preparation_time_in_minutes(no_of_layers) + elapsed_bake_time", "def elapsed_time_in_minutes(number_of_layers: int, elapsed_bake_time: int) -> int:\n return preparation_time_in_minutes(number_of_layers) + elapsed_bake_time", "def elap...
[ "0.75032663", "0.7467269", "0.74404085", "0.73925406", "0.64541507", "0.6305446", "0.6257169", "0.6257169", "0.6257169", "0.6000466", "0.5808721", "0.5773526", "0.5667682", "0.5637501", "0.5635833", "0.55388767", "0.552437", "0.5441152", "0.5426811", "0.53834176", "0.53707606...
0.7721855
0
get address by id
def get_address_by_id(address_id: int): try: address = address_service.get_address_by_id(address_id) current_app.logger.info("Return data for address_id: {}".format(address_id)) return jsonify({ "data": { "address": address }}), 200 except SQLCusto...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bank_address_by_id(bank_id: int) -> str:\n # Open a new connection\n db, cursor = db_connector.cursor()\n\n query = \"select address from bank where name = '{}';\".format(bank_id)\n cursor.execute(query)\n data = cursor.fetchall()\n db.disconnect()\n return data[0][0]", "def get_supp...
[ "0.7158677", "0.70268", "0.6940104", "0.6777704", "0.67587537", "0.6659815", "0.6643687", "0.65674657", "0.6503904", "0.6471765", "0.64163893", "0.6403165", "0.63863844", "0.6383097", "0.6337203", "0.6270841", "0.6270169", "0.6261926", "0.62596136", "0.62596136", "0.6199845",...
0.75688535
0
delete address by id
def delete_address(address_id: int): try: current_app.logger.info("delete address : address_id: %s", address_id) return jsonify({ "status": address_service.delete_address_by_id(address_id) }), 200 except SQLCustomError as error: current_app.logger.error("fail to delet...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, request, *args, **kwargs):\n # validate address id and get object\n instance = self.get_object()\n\n # get last transaction save point id\n sid = transaction.savepoint()\n\n try:\n # soft delete address\n instance.delete_address(request.user...
[ "0.75762683", "0.72528064", "0.70932806", "0.7015976", "0.7014734", "0.6979125", "0.68229157", "0.6805178", "0.67385775", "0.67281526", "0.6688489", "0.66123915", "0.6570931", "0.6570451", "0.65646535", "0.6552276", "0.654469", "0.6536282", "0.6487301", "0.6466477", "0.645843...
0.7932358
0
get all addresses list
def get_all_addresses(): try: addresses = address_service.get_all_addresses() current_app.logger.info("get all addresses") return jsonify({ "data": { "count": len(addresses), "addresses": addresses }}), 200 except SQLCustomError as ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_addrs(self) -> List[Multiaddr]:", "def addresses(self) -> \"List[str]\":\n return self._attrs.get(\"addresses\")", "def addresses(self) -> \"List[str]\":\n return self._attrs.get(\"addresses\")", "def addresses(self) -> \"List[str]\":\n return self._attrs.get(\"addresses\")", "...
[ "0.7885754", "0.7816518", "0.7816518", "0.7816518", "0.7325519", "0.7184814", "0.71506286", "0.70696783", "0.705442", "0.70192426", "0.7001219", "0.6982373", "0.6977537", "0.69752955", "0.69717383", "0.6926956", "0.69209373", "0.69204617", "0.68843", "0.68579096", "0.68555427...
0.7560295
4
Get the XML representation as `ElementTree` object.
def get_xml(self): profile = self.profile version = self.version #self.attribs['xmlns'] = "http://www.w3.org/2000/svg" self.attribs['xmlns:xlink'] = "http://www.w3.org/1999/xlink" self.attribs['xmlns:ev'] = "http://www.w3.org/2001/xml-events" self.attribs['baseProfile'] = profile self.attri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_xml(self):\n with io.StringIO() as string:\n string.write(ET.tostring(self.root, encoding=\"unicode\"))\n return string.getvalue()", "def get_xml(self):\n return etree.tostring(self.get_etree())", "def get_tree():\n root = ET.fromstring(xmlstring)\n return ET.E...
[ "0.76870763", "0.75312847", "0.74353814", "0.69993716", "0.68324274", "0.6808984", "0.67279035", "0.67279035", "0.67270184", "0.67270184", "0.6613549", "0.65791756", "0.65375465", "0.6401415", "0.6362028", "0.6343287", "0.63272727", "0.6314633", "0.6282842", "0.6246787", "0.6...
0.0
-1
Get the XML representation as `ElementTree` object.
def get_xml(self): xml = svgwrite.etree.etree.Element(self.elementname) if self.debug: self.validator.check_all_svg_attribute_values(self.elementname, self.attribs) for attribute, value in self.attribs.items(): # filter 'None' values if value is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_xml(self):\n with io.StringIO() as string:\n string.write(ET.tostring(self.root, encoding=\"unicode\"))\n return string.getvalue()", "def get_xml(self):\n return etree.tostring(self.get_etree())", "def get_tree():\n root = ET.fromstring(xmlstring)\n return ET.E...
[ "0.7688683", "0.75327605", "0.7435341", "0.6999228", "0.6832689", "0.68084466", "0.67295486", "0.67295486", "0.67260617", "0.67260617", "0.66133803", "0.65811235", "0.65377057", "0.64042026", "0.63633126", "0.63447636", "0.6327719", "0.6314219", "0.6283882", "0.6245147", "0.6...
0.58009404
39
This will create persuasions in bulk and will push it to ES API /persuasion/bulk/create [ {
def bulk_create(): logger.info("Creating persuasions in bulk") try: request_data = json.loads(request.data) with concurrent.futures.ThreadPoolExecutor(max_workers=settings.MAX_WORKERS) as executor: {executor.submit(PersuasionServices.create, data): data for data i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle(self, *args, **options):\n self.create_indices()\n self.bulk()", "def insert_to_elastic(elastic, paper_authors, papers, authors, index_name):\n helpers.bulk(elastic, merge_to_elastic(paper_authors, papers, authors, index_name))", "def bulk_refresh():\n logger.info(\"Refreshin...
[ "0.60707426", "0.6044942", "0.6015414", "0.5868079", "0.58612776", "0.58422595", "0.57517433", "0.5748778", "0.5713514", "0.56829447", "0.56696784", "0.5647391", "0.5640021", "0.56258446", "0.5564406", "0.5555156", "0.5547321", "0.5522877", "0.5503289", "0.5487169", "0.544674...
0.79547685
0
This will update the persuasion and will return it API /persuasion/refresh?push_to_es=true&push_to_inflow=false {
def refresh_persuasion(): try: request_data = json.loads(request.data) meta = request.args persuasion = PersuasionServices.refresh(request_data, meta) except Exception as e: error_msg = "Getting persuasion details - " + repr(e) logger.error(err...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schedule_refresh():\n logger.info(\"Refreshing/Updating persuasions in bulk\")\n try:\n args = request.args\n if not args.get(\"type\") or not args.get(\"sub_type\"):\n return jsonify(\n dict(status=\"failure\", message=\"Invalid type/sub_ty...
[ "0.68004", "0.65762883", "0.6169109", "0.6017237", "0.58676904", "0.58676904", "0.5842514", "0.58078766", "0.571597", "0.5683472", "0.5669192", "0.56609315", "0.56607497", "0.56477195", "0.56477195", "0.5646708", "0.5581315", "0.5581315", "0.55265003", "0.5518151", "0.5514036...
0.8352617
0
This will update persuasions in bulk and will push it to ES API /persuasion/bulk/refresh?push_to_es=true&push_to_inflow=false [ {
def bulk_refresh(): logger.info("Refreshing/Updating persuasions in bulk") try: request_data = json.loads(request.data) args = request.args with concurrent.futures.ThreadPoolExecutor(max_workers=settings.MAX_WORKERS) as executor: {executor.submit(Persu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schedule_refresh():\n logger.info(\"Refreshing/Updating persuasions in bulk\")\n try:\n args = request.args\n if not args.get(\"type\") or not args.get(\"sub_type\"):\n return jsonify(\n dict(status=\"failure\", message=\"Invalid type/sub_ty...
[ "0.76656324", "0.6743843", "0.6214206", "0.59055984", "0.58515877", "0.57441527", "0.5547801", "0.54766494", "0.54745275", "0.54507333", "0.5444725", "0.542627", "0.53595006", "0.5348997", "0.5331371", "0.52764916", "0.527101", "0.52681786", "0.5237418", "0.5237225", "0.52309...
0.8021315
0
This will also update persuasions in bulk based on type subtype and will push it to ES API /persuasion/schedule/refresh?push_to_es=true&push_to_inflow=false&type=quality_score&sub_type=inventory_depth
def schedule_refresh(): logger.info("Refreshing/Updating persuasions in bulk") try: args = request.args if not args.get("type") or not args.get("sub_type"): return jsonify( dict(status="failure", message="Invalid type/sub_type")) p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bulk_refresh():\n logger.info(\"Refreshing/Updating persuasions in bulk\")\n try:\n request_data = json.loads(request.data)\n args = request.args\n with concurrent.futures.ThreadPoolExecutor(max_workers=settings.MAX_WORKERS) as executor:\n {executor...
[ "0.5894394", "0.552447", "0.5422689", "0.51684684", "0.51551306", "0.50729585", "0.50314814", "0.495626", "0.49350718", "0.48938638", "0.48739257", "0.48735148", "0.48624405", "0.48345262", "0.48125353", "0.47565222", "0.47560182", "0.47403848", "0.47322214", "0.46917525", "0...
0.6947471
0
Convert any text to a fernet key for encryption.
def any_text_to_fernet_key(self, text): md5 = fingerprint.fingerprint.of_text(text) fernet_key = base64.b64encode(md5.encode("utf-8")) return fernet_key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def text2PublicKey(text:str):\n return RSA.importKey(b58decode(text))", "def encrypt(text):\r\n\r\n cipher = fuzz(text)\r\n return hexify(cipher)", "def fernet_encript(key,message):\n\tf = Fernet(key)\n\treturn f.encrypt(message)", "def caesar_encryption(text):\n result = ''\n for char in text:\n ...
[ "0.6408409", "0.6371177", "0.63681877", "0.6212298", "0.61476415", "0.60205185", "0.60133415", "0.60062563", "0.6004446", "0.5816517", "0.5788318", "0.5727161", "0.56803447", "0.56624347", "0.5623659", "0.56033343", "0.560295", "0.55829906", "0.5578667", "0.5558498", "0.55552...
0.85045666
0
Manually enter a password for encryption on keyboard.
def input_password(self): # pragma: no cover password = input("Please enter your secret key (case sensitive): ") self.set_password(password)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enter_password(self):", "def enter_password(self):\n self.password.clear()\n self.password.click()\n self.password.send_keys(TestData.PASSWORD)\n sleep(TestData.DELAY)\n return self.password", "async def password(self, ctx):\n pass", "def prompt_pass():\n msg ...
[ "0.81982946", "0.7473501", "0.7234966", "0.7115085", "0.70761955", "0.7038702", "0.693298", "0.68611926", "0.68122035", "0.67915016", "0.67278564", "0.67168885", "0.6711128", "0.67014295", "0.66786796", "0.66681784", "0.66681784", "0.66681784", "0.66681784", "0.66681784", "0....
0.78404224
1
Set a new password for encryption.
def set_password(self, password): self.__init__(password=password)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setpassword(self, pwd):\n pass", "def set_password(self, value):\n # Salt need to be generated before set password\n m = hashlib.sha256()\n m.update('-'.join([\n str(datetime.now()),\n config.get('security.password_salt')\n ]))\n self.salt = m.h...
[ "0.8377578", "0.8145898", "0.8129737", "0.80971813", "0.8089785", "0.80798155", "0.80655986", "0.8056996", "0.8050682", "0.7988545", "0.7963893", "0.7942522", "0.7855977", "0.7843381", "0.7838417", "0.78155446", "0.78155446", "0.78155446", "0.78155446", "0.7810031", "0.778050...
0.7456274
39
Open the deletion modal for an address row.
def delete_address(self) -> object: self.delete_button.click() return DeletionModal(self).wait_for_component_to_be_present()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_address(self, address: dict) -> None:\n row = self.addresses_list.surface_address_row(address)\n\n row.open_kebab_menu()\n row.kebab_menu.delete_address()\n\n self.deletion_modal.confirm_address_deletion()", "def DeleteRow(self, entry):\n for a_link in entry.link:\n ...
[ "0.70819616", "0.61636835", "0.6088303", "0.5755534", "0.5709963", "0.55882573", "0.55848145", "0.5560167", "0.55589795", "0.55150014", "0.5407896", "0.5399962", "0.5394524", "0.53886646", "0.5371516", "0.5349296", "0.5309787", "0.53002477", "0.529465", "0.52785975", "0.52676...
0.77717626
0
Open the edit address form for an address row. A conditional check for whether the URL contains 'admin' allows this method to be used in both OnDemand Web and OnDemand Admin.
def edit_address(self) -> object: self.edit_button.click() if 'admin' not in self.driver.current_url: return WebAddressForm(self).wait_for_component_to_be_present() return AdminAddressForm(self).wait_for_component_to_be_present()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_edit_address(self, address: dict) -> None:\n row = self.addresses_list.surface_address_row(address)\n\n row.open_kebab_menu()\n row.kebab_menu.edit_address()", "def __editAddress(self):\n idx = self.bookmarksTree.currentIndex()\n idx = idx.sibling(idx.row(), 1)\n ...
[ "0.7748994", "0.6355615", "0.5770656", "0.5743798", "0.5656257", "0.55580795", "0.55527085", "0.55411637", "0.5522946", "0.5501704", "0.5454978", "0.5401237", "0.5389246", "0.5380006", "0.53368807", "0.53319603", "0.5306126", "0.52961576", "0.52745545", "0.52547807", "0.52438...
0.81699383
0
Run the algorithm for the scores in the axis layer (0 for x, 1 for y). This score and the associated ranking are reliable, the ranking of the opposite score is not.
def run(self, axis, gamma): # Trajectories of the main score to compute and the opposite one traj_s, traj_o = [_np.ones(self.d[axis])], [_np.ones(self.d[1-axis])] # Ranked indices of the scores rank_s, rank_o = _np.array([], dtype=int), _np.array([], dtype=int) # List of nod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_run(self, axis):\n if (self.x_traj, self.y_traj)[axis] is None:\n if (self.inverse_x_traj, self.inverse_y_traj)[axis] is None:\n raise Exception('The algorithm has not been run.')\n else:\n if self.params['print_info']:\n prin...
[ "0.6627804", "0.6555331", "0.6459971", "0.5922805", "0.5655154", "0.5596297", "0.5581356", "0.5572477", "0.55473816", "0.5538019", "0.5492573", "0.5474258", "0.5454743", "0.54495645", "0.54365635", "0.5428014", "0.54214275", "0.54198104", "0.5418108", "0.5414656", "0.5410967"...
0.66810125
0
Gets the fraction of positive stationary scores.
def positive_scores(self, axis, th_stat=10**(-2)): traj, rank = self._check_run(axis) low_boundary = _np.exp(_np.log(self.params['low_bound'])/2) t = len(traj)-1 stat = 0 # Iteration over the trajectories for i in range(len(traj[0])): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def positive_share(self) -> float:\n pos = self.tsdf.pct_change()[1:][self.tsdf.pct_change()[1:].values > 0.0].count()\n tot = self.tsdf.pct_change()[1:].count()\n return float(pos / tot)", "def game_score(self):\n score = self.score.quantize(Decimal('0.001'))\n return score if...
[ "0.6627993", "0.66167814", "0.66115385", "0.65545696", "0.64541936", "0.6416723", "0.63477427", "0.63358057", "0.63094145", "0.6304095", "0.628694", "0.62657887", "0.62262195", "0.61896664", "0.6168893", "0.61631715", "0.61393696", "0.6111311", "0.6108707", "0.6084148", "0.60...
0.0
-1
Compute the extinction area given the last ranking obtained through the run method
def ext_area(self, axis): traj, rank = self._check_run(axis) return _ext_area(axis, rank, self._neighb[1], self._neighb[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _overlap_energy(self, this, that):\n if not this.overlaps(that):\n return 0.0\n\n return min(10.0 / this.rank, 10.0 / that.rank)", "def _ext_area(axis, ranking, row_ind_at_col, col_ind_at_row):\n if axis == 0:\n indexes_lists = _np.array([col_ind_at_row[:], row_ind_at_col[:...
[ "0.5964079", "0.59478605", "0.5941593", "0.59182143", "0.5786603", "0.5778234", "0.57550836", "0.5740219", "0.5736216", "0.5681183", "0.5669513", "0.56531614", "0.56521064", "0.56079173", "0.55998206", "0.5591468", "0.5575538", "0.55385804", "0.5520699", "0.55159914", "0.5515...
0.55559903
17