code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def image_predict_proba(self, X): """ Predicts class probabilities for the entire image. Parameters: ----------- X: array, shape = [n_samples, n_pixels_x, n_pixels_y, n_bands] Array of training images y: array, shape = [n_samples] or [n_samples, n...
def function[image_predict_proba, parameter[self, X]]: constant[ Predicts class probabilities for the entire image. Parameters: ----------- X: array, shape = [n_samples, n_pixels_x, n_pixels_y, n_bands] Array of training images y: array, shape = [n_samples]...
keyword[def] identifier[image_predict_proba] ( identifier[self] , identifier[X] ): literal[string] identifier[self] . identifier[_check_image] ( identifier[X] ) identifier[probabilities] = identifier[self] . identifier[pixel_classifier] . identifier[image_predict_proba] ( identifier[X...
def image_predict_proba(self, X): """ Predicts class probabilities for the entire image. Parameters: ----------- X: array, shape = [n_samples, n_pixels_x, n_pixels_y, n_bands] Array of training images y: array, shape = [n_samples] or [n_samples, n_pixels_x, n_p...
def highlight_null(self, null_color='red'): """ Shade the background ``null_color`` for missing values. Parameters ---------- null_color : str Returns ------- self : Styler """ self.applymap(self._highlight_null, null_color=null_color) ...
def function[highlight_null, parameter[self, null_color]]: constant[ Shade the background ``null_color`` for missing values. Parameters ---------- null_color : str Returns ------- self : Styler ] call[name[self].applymap, parameter[name[s...
keyword[def] identifier[highlight_null] ( identifier[self] , identifier[null_color] = literal[string] ): literal[string] identifier[self] . identifier[applymap] ( identifier[self] . identifier[_highlight_null] , identifier[null_color] = identifier[null_color] ) keyword[return] identifier[...
def highlight_null(self, null_color='red'): """ Shade the background ``null_color`` for missing values. Parameters ---------- null_color : str Returns ------- self : Styler """ self.applymap(self._highlight_null, null_color=null_color) return...
def Validate(self, type_names): """Filtered types need to be RDFValues.""" errs = [n for n in self._RDFTypes(type_names) if not self._GetClass(n)] if errs: raise DefinitionError("Undefined RDF Types: %s" % ",".join(errs))
def function[Validate, parameter[self, type_names]]: constant[Filtered types need to be RDFValues.] variable[errs] assign[=] <ast.ListComp object at 0x7da1b1b0f700> if name[errs] begin[:] <ast.Raise object at 0x7da1b1b0c190>
keyword[def] identifier[Validate] ( identifier[self] , identifier[type_names] ): literal[string] identifier[errs] =[ identifier[n] keyword[for] identifier[n] keyword[in] identifier[self] . identifier[_RDFTypes] ( identifier[type_names] ) keyword[if] keyword[not] identifier[self] . identifier[_GetClas...
def Validate(self, type_names): """Filtered types need to be RDFValues.""" errs = [n for n in self._RDFTypes(type_names) if not self._GetClass(n)] if errs: raise DefinitionError('Undefined RDF Types: %s' % ','.join(errs)) # depends on [control=['if'], data=[]]
def hook(event=None, dependencies=None): """Hooking decorator. Just `@hook(event, dependencies)` on your function Kwargs: event (str): String or Iterable with events to hook dependencies (str): String or Iterable with modules whose hooks have to be called before this one for **this** ev...
def function[hook, parameter[event, dependencies]]: constant[Hooking decorator. Just `@hook(event, dependencies)` on your function Kwargs: event (str): String or Iterable with events to hook dependencies (str): String or Iterable with modules whose hooks have to be called before thi...
keyword[def] identifier[hook] ( identifier[event] = keyword[None] , identifier[dependencies] = keyword[None] ): literal[string] keyword[def] identifier[wrapper] ( identifier[func] ): literal[string] identifier[func] . identifier[__deps__] = identifier[dependencies] identifier...
def hook(event=None, dependencies=None): """Hooking decorator. Just `@hook(event, dependencies)` on your function Kwargs: event (str): String or Iterable with events to hook dependencies (str): String or Iterable with modules whose hooks have to be called before this one for **this** ev...
def sqlite3_find_tool(): """ Find the sqlite3 binary Return the path to the binary on success Return None on error """ # find sqlite3 path = os.environ.get("PATH", None) if path is None: path = "/usr/local/bin:/usr/bin:/bin" sqlite3_path = None dirs = path.split(":") ...
def function[sqlite3_find_tool, parameter[]]: constant[ Find the sqlite3 binary Return the path to the binary on success Return None on error ] variable[path] assign[=] call[name[os].environ.get, parameter[constant[PATH], constant[None]]] if compare[name[path] is constant[None]] ...
keyword[def] identifier[sqlite3_find_tool] (): literal[string] identifier[path] = identifier[os] . identifier[environ] . identifier[get] ( literal[string] , keyword[None] ) keyword[if] identifier[path] keyword[is] keyword[None] : identifier[path] = literal[string] identifier[s...
def sqlite3_find_tool(): """ Find the sqlite3 binary Return the path to the binary on success Return None on error """ # find sqlite3 path = os.environ.get('PATH', None) if path is None: path = '/usr/local/bin:/usr/bin:/bin' # depends on [control=['if'], data=['path']] sqlit...
def answer(request): """ Save the answer. GET parameters: html: turn on the HTML version of the API BODY json in following format: { "answer": #answer, -- for one answer "answers": [#answer, #answer, #answer ...] -- for multiple ans...
def function[answer, parameter[request]]: constant[ Save the answer. GET parameters: html: turn on the HTML version of the API BODY json in following format: { "answer": #answer, -- for one answer "answers": [#answer, #answer, #a...
keyword[def] identifier[answer] ( identifier[request] ): literal[string] keyword[if] identifier[request] . identifier[method] == literal[string] : keyword[return] identifier[render] ( identifier[request] , literal[string] ,{}, identifier[help_text] = identifier[answer] . identifier[__doc__] ) ...
def answer(request): """ Save the answer. GET parameters: html: turn on the HTML version of the API BODY json in following format: { "answer": #answer, -- for one answer "answers": [#answer, #answer, #answer ...] -- for multiple ans...
def combobox_activated(self): """Move the cursor to the selected definition.""" sender = self.sender() data = sender.itemData(sender.currentIndex()) if isinstance(data, FoldScopeHelper): self.editor.go_to_line(data.line + 1)
def function[combobox_activated, parameter[self]]: constant[Move the cursor to the selected definition.] variable[sender] assign[=] call[name[self].sender, parameter[]] variable[data] assign[=] call[name[sender].itemData, parameter[call[name[sender].currentIndex, parameter[]]]] if call[n...
keyword[def] identifier[combobox_activated] ( identifier[self] ): literal[string] identifier[sender] = identifier[self] . identifier[sender] () identifier[data] = identifier[sender] . identifier[itemData] ( identifier[sender] . identifier[currentIndex] ()) keyword[if] identifier...
def combobox_activated(self): """Move the cursor to the selected definition.""" sender = self.sender() data = sender.itemData(sender.currentIndex()) if isinstance(data, FoldScopeHelper): self.editor.go_to_line(data.line + 1) # depends on [control=['if'], data=[]]
def build_url_field(self, field_name, model_class): """ Create a field representing the object's own URL. """ field_class = self.serializer_url_field field_kwargs = rest_framework.serializers.get_url_kwargs(model_class) field_kwargs.update({"parent_lookup_field": self.get...
def function[build_url_field, parameter[self, field_name, model_class]]: constant[ Create a field representing the object's own URL. ] variable[field_class] assign[=] name[self].serializer_url_field variable[field_kwargs] assign[=] call[name[rest_framework].serializers.get_url_kw...
keyword[def] identifier[build_url_field] ( identifier[self] , identifier[field_name] , identifier[model_class] ): literal[string] identifier[field_class] = identifier[self] . identifier[serializer_url_field] identifier[field_kwargs] = identifier[rest_framework] . identifier[serializers] ....
def build_url_field(self, field_name, model_class): """ Create a field representing the object's own URL. """ field_class = self.serializer_url_field field_kwargs = rest_framework.serializers.get_url_kwargs(model_class) field_kwargs.update({'parent_lookup_field': self.get_parent_lookup_f...
def dropEvent(self, event): """Reimplement Qt method Unpack dropped data and handle it""" source = event.mimeData() # The second check is necessary when mimedata2url(source) # returns None. # Fixes issue 7742 if source.hasUrls() and mimedata2url(source): ...
def function[dropEvent, parameter[self, event]]: constant[Reimplement Qt method Unpack dropped data and handle it] variable[source] assign[=] call[name[event].mimeData, parameter[]] if <ast.BoolOp object at 0x7da20c6e5db0> begin[:] variable[files] assign[=] call[name[mime...
keyword[def] identifier[dropEvent] ( identifier[self] , identifier[event] ): literal[string] identifier[source] = identifier[event] . identifier[mimeData] () keyword[if] identifier[source] . identifier[hasUrls] () keyword[and] identifier[mimedata2url] ( i...
def dropEvent(self, event): """Reimplement Qt method Unpack dropped data and handle it""" source = event.mimeData() # The second check is necessary when mimedata2url(source) # returns None. # Fixes issue 7742 if source.hasUrls() and mimedata2url(source): files = mimedata2url(source)...
def filter_query(self, query): """ Filter the given query using the filter classes specified on the view if any are specified. """ for filter_class in list(self.filter_classes): query = filter_class().filter_query(self.request, query, self) return query
def function[filter_query, parameter[self, query]]: constant[ Filter the given query using the filter classes specified on the view if any are specified. ] for taget[name[filter_class]] in starred[call[name[list], parameter[name[self].filter_classes]]] begin[:] variable[q...
keyword[def] identifier[filter_query] ( identifier[self] , identifier[query] ): literal[string] keyword[for] identifier[filter_class] keyword[in] identifier[list] ( identifier[self] . identifier[filter_classes] ): identifier[query] = identifier[filter_class] (). identifier[filter_q...
def filter_query(self, query): """ Filter the given query using the filter classes specified on the view if any are specified. """ for filter_class in list(self.filter_classes): query = filter_class().filter_query(self.request, query, self) # depends on [control=['for'], data=['filter_c...
def dlogpdf_df_dtheta(self, f, y, Y_metadata=None): """ TODO: Doc strings """ if self.size > 0: if self.not_block_really: raise NotImplementedError("Need to make a decorator for this!") if isinstance(self.gp_link, link_functions.Identity): ...
def function[dlogpdf_df_dtheta, parameter[self, f, y, Y_metadata]]: constant[ TODO: Doc strings ] if compare[name[self].size greater[>] constant[0]] begin[:] if name[self].not_block_really begin[:] <ast.Raise object at 0x7da18dc98ca0> if call[n...
keyword[def] identifier[dlogpdf_df_dtheta] ( identifier[self] , identifier[f] , identifier[y] , identifier[Y_metadata] = keyword[None] ): literal[string] keyword[if] identifier[self] . identifier[size] > literal[int] : keyword[if] identifier[self] . identifier[not_block_really] : ...
def dlogpdf_df_dtheta(self, f, y, Y_metadata=None): """ TODO: Doc strings """ if self.size > 0: if self.not_block_really: raise NotImplementedError('Need to make a decorator for this!') # depends on [control=['if'], data=[]] if isinstance(self.gp_link, link_functions...
def move(self, destination=None, position=None, save=False): """ Moves this node and places it as a child node of the `destination` :class:`CTENode` (or makes it a root node if `destination` is ``None``). Optionally, `position` can be a callable which is invoked prior to ...
def function[move, parameter[self, destination, position, save]]: constant[ Moves this node and places it as a child node of the `destination` :class:`CTENode` (or makes it a root node if `destination` is ``None``). Optionally, `position` can be a callable which is invoked p...
keyword[def] identifier[move] ( identifier[self] , identifier[destination] = keyword[None] , identifier[position] = keyword[None] , identifier[save] = keyword[False] ): literal[string] keyword[return] identifier[self] . identifier[__class__] . identifier[objects] . identifier[move] ( identifier[se...
def move(self, destination=None, position=None, save=False): """ Moves this node and places it as a child node of the `destination` :class:`CTENode` (or makes it a root node if `destination` is ``None``). Optionally, `position` can be a callable which is invoked prior to ...
def Format(self, format_string, rdf): """Apply string formatting templates to rdf data. Uses some heuristics to coerce rdf values into a form compatible with string formatter rules. Repeated items are condensed into a single comma separated list. Unlike regular string.Formatter operations, we use objec...
def function[Format, parameter[self, format_string, rdf]]: constant[Apply string formatting templates to rdf data. Uses some heuristics to coerce rdf values into a form compatible with string formatter rules. Repeated items are condensed into a single comma separated list. Unlike regular string.For...
keyword[def] identifier[Format] ( identifier[self] , identifier[format_string] , identifier[rdf] ): literal[string] identifier[result] =[] keyword[for] identifier[literal_text] , identifier[field_name] , identifier[_] , identifier[_] keyword[in] identifier[self] . identifier[parse] ( identifier[for...
def Format(self, format_string, rdf): """Apply string formatting templates to rdf data. Uses some heuristics to coerce rdf values into a form compatible with string formatter rules. Repeated items are condensed into a single comma separated list. Unlike regular string.Formatter operations, we use objec...
def make_or_augment_meta(self, role): """ Create or augment a meta file. """ if not os.path.exists(self.paths["meta"]): utils.create_meta_main(self.paths["meta"], self.config, role, "") self.report["state"]["ok_role"] += 1 self.report["roles"][role]["s...
def function[make_or_augment_meta, parameter[self, role]]: constant[ Create or augment a meta file. ] if <ast.UnaryOp object at 0x7da1b0b86380> begin[:] call[name[utils].create_meta_main, parameter[call[name[self].paths][constant[meta]], name[self].config, name[role], con...
keyword[def] identifier[make_or_augment_meta] ( identifier[self] , identifier[role] ): literal[string] keyword[if] keyword[not] identifier[os] . identifier[path] . identifier[exists] ( identifier[self] . identifier[paths] [ literal[string] ]): identifier[utils] . identifier[create_me...
def make_or_augment_meta(self, role): """ Create or augment a meta file. """ if not os.path.exists(self.paths['meta']): utils.create_meta_main(self.paths['meta'], self.config, role, '') self.report['state']['ok_role'] += 1 self.report['roles'][role]['state'] = 'ok' # dep...
def main(): """Run the workflow task.""" log = logging.getLogger('sip.mock_workflow_stage') if len(sys.argv) != 2: log.critical('Expecting JSON string as first argument!') return config = json.loads(sys.argv[1]) log.info('Running mock_workflow_stage (version: %s).', __version__) ...
def function[main, parameter[]]: constant[Run the workflow task.] variable[log] assign[=] call[name[logging].getLogger, parameter[constant[sip.mock_workflow_stage]]] if compare[call[name[len], parameter[name[sys].argv]] not_equal[!=] constant[2]] begin[:] call[name[log].critical,...
keyword[def] identifier[main] (): literal[string] identifier[log] = identifier[logging] . identifier[getLogger] ( literal[string] ) keyword[if] identifier[len] ( identifier[sys] . identifier[argv] )!= literal[int] : identifier[log] . identifier[critical] ( literal[string] ) keyword...
def main(): """Run the workflow task.""" log = logging.getLogger('sip.mock_workflow_stage') if len(sys.argv) != 2: log.critical('Expecting JSON string as first argument!') return # depends on [control=['if'], data=[]] config = json.loads(sys.argv[1]) log.info('Running mock_workflow_...
def is_date(self): """Determine if a data record is of type DATE.""" dt = DATA_TYPES['date'] if type(self.data) is dt['type'] and '-' in str(self.data) and str(self.data).count('-') == 2: # Separate year, month and day date_split = str(self.data).split('-') y,...
def function[is_date, parameter[self]]: constant[Determine if a data record is of type DATE.] variable[dt] assign[=] call[name[DATA_TYPES]][constant[date]] if <ast.BoolOp object at 0x7da1b0b60580> begin[:] variable[date_split] assign[=] call[call[name[str], parameter[name[self].d...
keyword[def] identifier[is_date] ( identifier[self] ): literal[string] identifier[dt] = identifier[DATA_TYPES] [ literal[string] ] keyword[if] identifier[type] ( identifier[self] . identifier[data] ) keyword[is] identifier[dt] [ literal[string] ] keyword[and] literal[string] keyword[in...
def is_date(self): """Determine if a data record is of type DATE.""" dt = DATA_TYPES['date'] if type(self.data) is dt['type'] and '-' in str(self.data) and (str(self.data).count('-') == 2): # Separate year, month and day date_split = str(self.data).split('-') (y, m, d) = (date_split[...
def search(self, *args, **kwargs): """ Proxy to queryset's search method for the manager's model and any models that subclass from this manager's model if the model is abstract. """ if not settings.SEARCH_MODEL_CHOICES: # No choices defined - build a list of l...
def function[search, parameter[self]]: constant[ Proxy to queryset's search method for the manager's model and any models that subclass from this manager's model if the model is abstract. ] if <ast.UnaryOp object at 0x7da204622d40> begin[:] variable[models...
keyword[def] identifier[search] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] keyword[not] identifier[settings] . identifier[SEARCH_MODEL_CHOICES] : identifier[models] =[ identifier[m] keyword[for] identifier[m] keyw...
def search(self, *args, **kwargs): """ Proxy to queryset's search method for the manager's model and any models that subclass from this manager's model if the model is abstract. """ if not settings.SEARCH_MODEL_CHOICES: # No choices defined - build a list of leaf models (...
def methodcall(obj, method_name, *args, **kwargs): """Call a method of `obj`, either locally or remotely as appropriate. obj may be an ordinary object, or a Remote object (or Ref or object Id) If there are multiple remote arguments, they must be on the same engine. kwargs: prefer_local (bool,...
def function[methodcall, parameter[obj, method_name]]: constant[Call a method of `obj`, either locally or remotely as appropriate. obj may be an ordinary object, or a Remote object (or Ref or object Id) If there are multiple remote arguments, they must be on the same engine. kwargs: prefe...
keyword[def] identifier[methodcall] ( identifier[obj] , identifier[method_name] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[this_engine] = identifier[distob] . identifier[engine] . identifier[eid] identifier[args] =[ identifier[obj] ]+ identifier[list] ( identifier[args] ...
def methodcall(obj, method_name, *args, **kwargs): """Call a method of `obj`, either locally or remotely as appropriate. obj may be an ordinary object, or a Remote object (or Ref or object Id) If there are multiple remote arguments, they must be on the same engine. kwargs: prefer_local (bool,...
def run_cmd(cmd, log='log.log', cwd='.', stdout=sys.stdout, bufsize=1, encode='utf-8'): """ Runs a command in the backround by creating a new process and writes the output to a specified log file. :param log(str) - log filename to be used :param cwd(str) - basedir to write/create the log file :param stdout(p...
def function[run_cmd, parameter[cmd, log, cwd, stdout, bufsize, encode]]: constant[ Runs a command in the backround by creating a new process and writes the output to a specified log file. :param log(str) - log filename to be used :param cwd(str) - basedir to write/create the log file :param stdout(pip...
keyword[def] identifier[run_cmd] ( identifier[cmd] , identifier[log] = literal[string] , identifier[cwd] = literal[string] , identifier[stdout] = identifier[sys] . identifier[stdout] , identifier[bufsize] = literal[int] , identifier[encode] = literal[string] ): literal[string] identifier[logfile] = literal[str...
def run_cmd(cmd, log='log.log', cwd='.', stdout=sys.stdout, bufsize=1, encode='utf-8'): """ Runs a command in the backround by creating a new process and writes the output to a specified log file. :param log(str) - log filename to be used :param cwd(str) - basedir to write/create the log file :param stdout...
def search_report_event_for_facet(self, facet, **kwargs): # noqa: E501 """Lists the values of a specific facet over the customer's events # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=Tr...
def function[search_report_event_for_facet, parameter[self, facet]]: constant[Lists the values of a specific facet over the customer's events # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req...
keyword[def] identifier[search_report_event_for_facet] ( identifier[self] , identifier[facet] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= keyword[True] keyword[if] identifier[kwargs] . identifier[get] ( literal[string] ): keyword[return]...
def search_report_event_for_facet(self, facet, **kwargs): # noqa: E501 "Lists the values of a specific facet over the customer's events # noqa: E501\n\n # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True...
def subpnt(method, target, et, fixref, abcorr, obsrvr): """ Compute the rectangular coordinates of the sub-observer point on a target body at a specified epoch, optionally corrected for light time and stellar aberration. This routine supersedes :func:`subpt`. http://naif.jpl.nasa.gov/pub/naif/...
def function[subpnt, parameter[method, target, et, fixref, abcorr, obsrvr]]: constant[ Compute the rectangular coordinates of the sub-observer point on a target body at a specified epoch, optionally corrected for light time and stellar aberration. This routine supersedes :func:`subpt`. htt...
keyword[def] identifier[subpnt] ( identifier[method] , identifier[target] , identifier[et] , identifier[fixref] , identifier[abcorr] , identifier[obsrvr] ): literal[string] identifier[method] = identifier[stypes] . identifier[stringToCharP] ( identifier[method] ) identifier[target] = identifier[stypes...
def subpnt(method, target, et, fixref, abcorr, obsrvr): """ Compute the rectangular coordinates of the sub-observer point on a target body at a specified epoch, optionally corrected for light time and stellar aberration. This routine supersedes :func:`subpt`. http://naif.jpl.nasa.gov/pub/naif/...
def parsing_token_generator(data_dir, tmp_dir, train, source_vocab_size, target_vocab_size): """Generator for parsing as a sequence-to-sequence task that uses tokens. This generator assumes the files parsing_{train,dev}.trees, which contain trees in WSJ format. Args: data_dir: ...
def function[parsing_token_generator, parameter[data_dir, tmp_dir, train, source_vocab_size, target_vocab_size]]: constant[Generator for parsing as a sequence-to-sequence task that uses tokens. This generator assumes the files parsing_{train,dev}.trees, which contain trees in WSJ format. Args: data_...
keyword[def] identifier[parsing_token_generator] ( identifier[data_dir] , identifier[tmp_dir] , identifier[train] , identifier[source_vocab_size] , identifier[target_vocab_size] ): literal[string] keyword[del] ( identifier[data_dir] , identifier[tmp_dir] , identifier[train] , identifier[source_vocab_siz...
def parsing_token_generator(data_dir, tmp_dir, train, source_vocab_size, target_vocab_size): """Generator for parsing as a sequence-to-sequence task that uses tokens. This generator assumes the files parsing_{train,dev}.trees, which contain trees in WSJ format. Args: data_dir: path to the data directory...
def get_db_attribute(self, table, record, column, key=None): """ Gets values of 'column' in 'record' in 'table'. This method is corresponding to the following ovs-vsctl command:: $ ovs-vsctl get TBL REC COL[:KEY] """ if key is not None: column = '%s:%s' ...
def function[get_db_attribute, parameter[self, table, record, column, key]]: constant[ Gets values of 'column' in 'record' in 'table'. This method is corresponding to the following ovs-vsctl command:: $ ovs-vsctl get TBL REC COL[:KEY] ] if compare[name[key] is_not c...
keyword[def] identifier[get_db_attribute] ( identifier[self] , identifier[table] , identifier[record] , identifier[column] , identifier[key] = keyword[None] ): literal[string] keyword[if] identifier[key] keyword[is] keyword[not] keyword[None] : identifier[column] = literal[string] ...
def get_db_attribute(self, table, record, column, key=None): """ Gets values of 'column' in 'record' in 'table'. This method is corresponding to the following ovs-vsctl command:: $ ovs-vsctl get TBL REC COL[:KEY] """ if key is not None: column = '%s:%s' % (column, k...
def trigger(self, source): """ Triggers all actions meant to trigger on the board state from `source`. """ actions = self.evaluate(source) if actions: if not hasattr(actions, "__iter__"): actions = (actions, ) source.game.trigger_actions(source, actions)
def function[trigger, parameter[self, source]]: constant[ Triggers all actions meant to trigger on the board state from `source`. ] variable[actions] assign[=] call[name[self].evaluate, parameter[name[source]]] if name[actions] begin[:] if <ast.UnaryOp object at 0x7da18ede5b1...
keyword[def] identifier[trigger] ( identifier[self] , identifier[source] ): literal[string] identifier[actions] = identifier[self] . identifier[evaluate] ( identifier[source] ) keyword[if] identifier[actions] : keyword[if] keyword[not] identifier[hasattr] ( identifier[actions] , literal[string] ): ...
def trigger(self, source): """ Triggers all actions meant to trigger on the board state from `source`. """ actions = self.evaluate(source) if actions: if not hasattr(actions, '__iter__'): actions = (actions,) # depends on [control=['if'], data=[]] source.game.trigger_actions...
def selecttab(self, window_name, object_name, tab_name): """ Select tab based on name. @param window_name: Window name to type in, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object name to type in, eith...
def function[selecttab, parameter[self, window_name, object_name, tab_name]]: constant[ Select tab based on name. @param window_name: Window name to type in, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: O...
keyword[def] identifier[selecttab] ( identifier[self] , identifier[window_name] , identifier[object_name] , identifier[tab_name] ): literal[string] identifier[tab_handle] = identifier[self] . identifier[_get_tab_handle] ( identifier[window_name] , identifier[object_name] , identifier[tab_name] ) ...
def selecttab(self, window_name, object_name, tab_name): """ Select tab based on name. @param window_name: Window name to type in, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object name to type in, either f...
def evals_get(self, service_staff_id, start_date, end_date, session): '''taobao.wangwang.eservice.evals.get 获取评价详细 根据用户id查询用户对应的评价详细情况, 主账号id可以查询店铺内子账号的评价 组管理员可以查询组内账号的评价 非管理员的子账号可以查自己的评价''' request = TOPRequest('taobao.wangwang.eservice.evals.get') request['service_staff_id'] =...
def function[evals_get, parameter[self, service_staff_id, start_date, end_date, session]]: constant[taobao.wangwang.eservice.evals.get 获取评价详细 根据用户id查询用户对应的评价详细情况, 主账号id可以查询店铺内子账号的评价 组管理员可以查询组内账号的评价 非管理员的子账号可以查自己的评价] variable[request] assign[=] call[name[TOPRequest], parameter[constant[t...
keyword[def] identifier[evals_get] ( identifier[self] , identifier[service_staff_id] , identifier[start_date] , identifier[end_date] , identifier[session] ): literal[string] identifier[request] = identifier[TOPRequest] ( literal[string] ) identifier[request] [ literal[string] ]= identifier...
def evals_get(self, service_staff_id, start_date, end_date, session): """taobao.wangwang.eservice.evals.get 获取评价详细 根据用户id查询用户对应的评价详细情况, 主账号id可以查询店铺内子账号的评价 组管理员可以查询组内账号的评价 非管理员的子账号可以查自己的评价""" request = TOPRequest('taobao.wangwang.eservice.evals.get') request['service_staff_id'] = service_sta...
def universal_transformer_with_lstm_as_transition_function( layer_inputs, step, hparams, ffn_unit, attention_unit, pad_remover=None): """Universal Transformer which uses a lstm as transition function. It's kind of like having a lstm, filliped vertically next to the Universal Transformer that controls the flo...
def function[universal_transformer_with_lstm_as_transition_function, parameter[layer_inputs, step, hparams, ffn_unit, attention_unit, pad_remover]]: constant[Universal Transformer which uses a lstm as transition function. It's kind of like having a lstm, filliped vertically next to the Universal Transforme...
keyword[def] identifier[universal_transformer_with_lstm_as_transition_function] ( identifier[layer_inputs] , identifier[step] , identifier[hparams] , identifier[ffn_unit] , identifier[attention_unit] , identifier[pad_remover] = keyword[None] ): literal[string] identifier[state] , identifier[unused_inputs] , ...
def universal_transformer_with_lstm_as_transition_function(layer_inputs, step, hparams, ffn_unit, attention_unit, pad_remover=None): """Universal Transformer which uses a lstm as transition function. It's kind of like having a lstm, filliped vertically next to the Universal Transformer that controls the flow o...
def validate(self, messages): """ Validate all fields of the document and update the messages list with user friendly error messages for display. """ messages = self.validate_version(messages) messages = self.validate_data_lics(messages) messages = self.validate_n...
def function[validate, parameter[self, messages]]: constant[ Validate all fields of the document and update the messages list with user friendly error messages for display. ] variable[messages] assign[=] call[name[self].validate_version, parameter[name[messages]]] variabl...
keyword[def] identifier[validate] ( identifier[self] , identifier[messages] ): literal[string] identifier[messages] = identifier[self] . identifier[validate_version] ( identifier[messages] ) identifier[messages] = identifier[self] . identifier[validate_data_lics] ( identifier[messages] ) ...
def validate(self, messages): """ Validate all fields of the document and update the messages list with user friendly error messages for display. """ messages = self.validate_version(messages) messages = self.validate_data_lics(messages) messages = self.validate_name(messages) ...
def _close(self, e): """Really close the transport with a reason. e -- reason the socket is being closed. """ self.stop() self.sock.close() self.closed = True self.close_cb(e)
def function[_close, parameter[self, e]]: constant[Really close the transport with a reason. e -- reason the socket is being closed. ] call[name[self].stop, parameter[]] call[name[self].sock.close, parameter[]] name[self].closed assign[=] constant[True] call[nam...
keyword[def] identifier[_close] ( identifier[self] , identifier[e] ): literal[string] identifier[self] . identifier[stop] () identifier[self] . identifier[sock] . identifier[close] () identifier[self] . identifier[closed] = keyword[True] identifier[self] . identifier[clo...
def _close(self, e): """Really close the transport with a reason. e -- reason the socket is being closed. """ self.stop() self.sock.close() self.closed = True self.close_cb(e)
def vector_filter(actual_vector, predict_vector): """ Convert different type of items in vectors to str. :param actual_vector: actual values :type actual_vector : list :param predict_vector: predict value :type predict_vector : list :return: new actual and predict vector """ temp = ...
def function[vector_filter, parameter[actual_vector, predict_vector]]: constant[ Convert different type of items in vectors to str. :param actual_vector: actual values :type actual_vector : list :param predict_vector: predict value :type predict_vector : list :return: new actual and pre...
keyword[def] identifier[vector_filter] ( identifier[actual_vector] , identifier[predict_vector] ): literal[string] identifier[temp] =[] identifier[temp] . identifier[extend] ( identifier[actual_vector] ) identifier[temp] . identifier[extend] ( identifier[predict_vector] ) identifier[types] =...
def vector_filter(actual_vector, predict_vector): """ Convert different type of items in vectors to str. :param actual_vector: actual values :type actual_vector : list :param predict_vector: predict value :type predict_vector : list :return: new actual and predict vector """ temp = ...
def process_embed(embed_items=None, embed_tracks=None, embed_metadata=None, embed_insights=None): """Returns an embed field value based on the parameters.""" result = None embed = '' if embed_items: embed = 'items' if embed_tracks: ...
def function[process_embed, parameter[embed_items, embed_tracks, embed_metadata, embed_insights]]: constant[Returns an embed field value based on the parameters.] variable[result] assign[=] constant[None] variable[embed] assign[=] constant[] if name[embed_items] begin[:] ...
keyword[def] identifier[process_embed] ( identifier[embed_items] = keyword[None] , identifier[embed_tracks] = keyword[None] , identifier[embed_metadata] = keyword[None] , identifier[embed_insights] = keyword[None] ): literal[string] identifier[result] = keyword[None] identifier[embed] = literal[...
def process_embed(embed_items=None, embed_tracks=None, embed_metadata=None, embed_insights=None): """Returns an embed field value based on the parameters.""" result = None embed = '' if embed_items: embed = 'items' # depends on [control=['if'], data=[]] if embed_tracks: if embed != ...
def latex2png(snippet, outfile): """Compiles a LaTeX snippet to png""" pngimage = os.path.join(IMAGEDIR, outfile + '.png') environment = os.environ environment['openout_any'] = 'a' environment['shell_escape_commands'] = \ "bibtex,bibtex8,kpsewhich,makeindex,mpost,repstopdf,gregorio" proc...
def function[latex2png, parameter[snippet, outfile]]: constant[Compiles a LaTeX snippet to png] variable[pngimage] assign[=] call[name[os].path.join, parameter[name[IMAGEDIR], binary_operation[name[outfile] + constant[.png]]]] variable[environment] assign[=] name[os].environ call[name[en...
keyword[def] identifier[latex2png] ( identifier[snippet] , identifier[outfile] ): literal[string] identifier[pngimage] = identifier[os] . identifier[path] . identifier[join] ( identifier[IMAGEDIR] , identifier[outfile] + literal[string] ) identifier[environment] = identifier[os] . identifier[environ] ...
def latex2png(snippet, outfile): """Compiles a LaTeX snippet to png""" pngimage = os.path.join(IMAGEDIR, outfile + '.png') environment = os.environ environment['openout_any'] = 'a' environment['shell_escape_commands'] = 'bibtex,bibtex8,kpsewhich,makeindex,mpost,repstopdf,gregorio' proc = Popen([...
def ecc(self, n): r""" Calculate eccentricity harmonic `\varepsilon_n`. :param int n: Eccentricity order. """ ny, nx = self._profile.shape xmax, ymax = self._xymax xcm, ycm = self._cm # create (X, Y) grids relative to CM Y, X = np.mgrid[ymax:-ym...
def function[ecc, parameter[self, n]]: constant[ Calculate eccentricity harmonic `\varepsilon_n`. :param int n: Eccentricity order. ] <ast.Tuple object at 0x7da1b1196830> assign[=] name[self]._profile.shape <ast.Tuple object at 0x7da1b1196290> assign[=] name[self]._xyma...
keyword[def] identifier[ecc] ( identifier[self] , identifier[n] ): literal[string] identifier[ny] , identifier[nx] = identifier[self] . identifier[_profile] . identifier[shape] identifier[xmax] , identifier[ymax] = identifier[self] . identifier[_xymax] identifier[xcm] , identifi...
def ecc(self, n): """ Calculate eccentricity harmonic `\\varepsilon_n`. :param int n: Eccentricity order. """ (ny, nx) = self._profile.shape (xmax, ymax) = self._xymax (xcm, ycm) = self._cm # create (X, Y) grids relative to CM (Y, X) = np.mgrid[ymax:-ymax:1j * ny, -xmax...
def shutdown(self): 'Close all peer connections and stop listening for new ones' log.info("shutting down") for peer in self._dispatcher.peers.values(): peer.go_down(reconnect=False) if self._listener_coro: backend.schedule_exception( errors._...
def function[shutdown, parameter[self]]: constant[Close all peer connections and stop listening for new ones] call[name[log].info, parameter[constant[shutting down]]] for taget[name[peer]] in starred[call[name[self]._dispatcher.peers.values, parameter[]]] begin[:] call[name[peer]...
keyword[def] identifier[shutdown] ( identifier[self] ): literal[string] identifier[log] . identifier[info] ( literal[string] ) keyword[for] identifier[peer] keyword[in] identifier[self] . identifier[_dispatcher] . identifier[peers] . identifier[values] (): identifier[peer]...
def shutdown(self): """Close all peer connections and stop listening for new ones""" log.info('shutting down') for peer in self._dispatcher.peers.values(): peer.go_down(reconnect=False) # depends on [control=['for'], data=['peer']] if self._listener_coro: backend.schedule_exception(erro...
def _CreateShapePointFolder(self, shapes_folder, shape): """Create a KML Folder containing all the shape points in a shape. The folder contains placemarks for each shapepoint. Args: shapes_folder: A KML Shape Folder ElementTree.Element instance shape: The shape to plot. Returns: The...
def function[_CreateShapePointFolder, parameter[self, shapes_folder, shape]]: constant[Create a KML Folder containing all the shape points in a shape. The folder contains placemarks for each shapepoint. Args: shapes_folder: A KML Shape Folder ElementTree.Element instance shape: The shape t...
keyword[def] identifier[_CreateShapePointFolder] ( identifier[self] , identifier[shapes_folder] , identifier[shape] ): literal[string] identifier[folder_name] = identifier[shape] . identifier[shape_id] + literal[string] identifier[folder] = identifier[self] . identifier[_CreateFolder] ( identifier[s...
def _CreateShapePointFolder(self, shapes_folder, shape): """Create a KML Folder containing all the shape points in a shape. The folder contains placemarks for each shapepoint. Args: shapes_folder: A KML Shape Folder ElementTree.Element instance shape: The shape to plot. Returns: The...
def get_topology(self, topologyName, callback=None): """get topology""" if callback: self.topology_watchers[topologyName].append(callback) else: topology_path = self.get_topology_path(topologyName) with open(topology_path) as f: data = f.read() topology = Topology() ...
def function[get_topology, parameter[self, topologyName, callback]]: constant[get topology] if name[callback] begin[:] call[call[name[self].topology_watchers][name[topologyName]].append, parameter[name[callback]]]
keyword[def] identifier[get_topology] ( identifier[self] , identifier[topologyName] , identifier[callback] = keyword[None] ): literal[string] keyword[if] identifier[callback] : identifier[self] . identifier[topology_watchers] [ identifier[topologyName] ]. identifier[append] ( identifier[callback] )...
def get_topology(self, topologyName, callback=None): """get topology""" if callback: self.topology_watchers[topologyName].append(callback) # depends on [control=['if'], data=[]] else: topology_path = self.get_topology_path(topologyName) with open(topology_path) as f: dat...
def ensure_crossplat_path(path, winroot='C:'): r""" ensure_crossplat_path Args: path (str): Returns: str: crossplat_path Example(DOCTEST): >>> # ENABLE_DOCTEST >>> from utool.util_path import * # NOQA >>> path = r'C:\somedir' >>> cplat_path = ensur...
def function[ensure_crossplat_path, parameter[path, winroot]]: constant[ ensure_crossplat_path Args: path (str): Returns: str: crossplat_path Example(DOCTEST): >>> # ENABLE_DOCTEST >>> from utool.util_path import * # NOQA >>> path = r'C:\somedir' ...
keyword[def] identifier[ensure_crossplat_path] ( identifier[path] , identifier[winroot] = literal[string] ): literal[string] identifier[cplat_path] = identifier[path] . identifier[replace] ( literal[string] , literal[string] ) keyword[if] identifier[cplat_path] == identifier[winroot] : ident...
def ensure_crossplat_path(path, winroot='C:'): """ ensure_crossplat_path Args: path (str): Returns: str: crossplat_path Example(DOCTEST): >>> # ENABLE_DOCTEST >>> from utool.util_path import * # NOQA >>> path = r'C:\\somedir' >>> cplat_path = ensur...
def _select_theory(theories): """Return the most likely spacing convention given different options. Given a dictionary of convention options as keys and their occurrence as values, return the convention that occurs the most, or ``None`` if there is no clear preferred style. """ ...
def function[_select_theory, parameter[theories]]: constant[Return the most likely spacing convention given different options. Given a dictionary of convention options as keys and their occurrence as values, return the convention that occurs the most, or ``None`` if there is no clear pr...
keyword[def] identifier[_select_theory] ( identifier[theories] ): literal[string] keyword[if] identifier[theories] : identifier[values] = identifier[tuple] ( identifier[theories] . identifier[values] ()) identifier[best] = identifier[max] ( identifier[values] ) ...
def _select_theory(theories): """Return the most likely spacing convention given different options. Given a dictionary of convention options as keys and their occurrence as values, return the convention that occurs the most, or ``None`` if there is no clear preferred style. """ ...
def check_format(self, full_check=True): """Check whether the NDArray format is valid. Parameters ---------- full_check : bool, optional If `True`, rigorous check, O(N) operations. Otherwise basic check, O(1) operations (default True). """ check_c...
def function[check_format, parameter[self, full_check]]: constant[Check whether the NDArray format is valid. Parameters ---------- full_check : bool, optional If `True`, rigorous check, O(N) operations. Otherwise basic check, O(1) operations (default True). ...
keyword[def] identifier[check_format] ( identifier[self] , identifier[full_check] = keyword[True] ): literal[string] identifier[check_call] ( identifier[_LIB] . identifier[MXNDArraySyncCheckFormat] ( identifier[self] . identifier[handle] , identifier[ctypes] . identifier[c_bool] ( identifier[full_c...
def check_format(self, full_check=True): """Check whether the NDArray format is valid. Parameters ---------- full_check : bool, optional If `True`, rigorous check, O(N) operations. Otherwise basic check, O(1) operations (default True). """ check_call(_LIB...
def register_rml(self, filepath, **kwargs): """ Registers the filepath for an rml mapping Args: ----- filepath: the path the rml file """ name = os.path.split(filepath)[-1] if name in self.rml_maps and self.rml_maps[name] != filepath: rais...
def function[register_rml, parameter[self, filepath]]: constant[ Registers the filepath for an rml mapping Args: ----- filepath: the path the rml file ] variable[name] assign[=] call[call[name[os].path.split, parameter[name[filepath]]]][<ast.UnaryOp object at...
keyword[def] identifier[register_rml] ( identifier[self] , identifier[filepath] ,** identifier[kwargs] ): literal[string] identifier[name] = identifier[os] . identifier[path] . identifier[split] ( identifier[filepath] )[- literal[int] ] keyword[if] identifier[name] keyword[in] identifie...
def register_rml(self, filepath, **kwargs): """ Registers the filepath for an rml mapping Args: ----- filepath: the path the rml file """ name = os.path.split(filepath)[-1] if name in self.rml_maps and self.rml_maps[name] != filepath: raise Exception('RML...
def __analizar_errores(self, ret): "Comprueba y extrae errores si existen en la respuesta XML" self.Errores = [err['codigoDescripcion'] for err in ret.get('arrayErrores', [])] self.ErroresFormato = [err['codigoDescripcionString'] for err in ret.get('arrayErroresFormato', [])] errores = s...
def function[__analizar_errores, parameter[self, ret]]: constant[Comprueba y extrae errores si existen en la respuesta XML] name[self].Errores assign[=] <ast.ListComp object at 0x7da1b1d55ae0> name[self].ErroresFormato assign[=] <ast.ListComp object at 0x7da1b1e00d60> variable[errores] a...
keyword[def] identifier[__analizar_errores] ( identifier[self] , identifier[ret] ): literal[string] identifier[self] . identifier[Errores] =[ identifier[err] [ literal[string] ] keyword[for] identifier[err] keyword[in] identifier[ret] . identifier[get] ( literal[string] ,[])] identifier...
def __analizar_errores(self, ret): """Comprueba y extrae errores si existen en la respuesta XML""" self.Errores = [err['codigoDescripcion'] for err in ret.get('arrayErrores', [])] self.ErroresFormato = [err['codigoDescripcionString'] for err in ret.get('arrayErroresFormato', [])] errores = self.Errores ...
def set_column(self, X, column, value): """Sets a column on the matrix X with the given value. Args: X: `numpy.ndarray` or `pandas.DataFrame`. column: `int` or `str`. value: `np.ndarray` with shape (1,) Returns: `np.ndarray` or `pandas.DataFrame`...
def function[set_column, parameter[self, X, column, value]]: constant[Sets a column on the matrix X with the given value. Args: X: `numpy.ndarray` or `pandas.DataFrame`. column: `int` or `str`. value: `np.ndarray` with shape (1,) Returns: `np.nda...
keyword[def] identifier[set_column] ( identifier[self] , identifier[X] , identifier[column] , identifier[value] ): literal[string] keyword[if] identifier[isinstance] ( identifier[X] , identifier[pd] . identifier[DataFrame] ): identifier[X] . identifier[loc] [:, identifier[column] ]= ...
def set_column(self, X, column, value): """Sets a column on the matrix X with the given value. Args: X: `numpy.ndarray` or `pandas.DataFrame`. column: `int` or `str`. value: `np.ndarray` with shape (1,) Returns: `np.ndarray` or `pandas.DataFrame` wit...
def render_image(self, rgbobj, dst_x, dst_y): """Render the image represented by (rgbobj) at dst_x, dst_y in the pixel space. *** internal method-- do not use *** """ if self.surface is None: return self.logger.debug("redraw surface") # get window con...
def function[render_image, parameter[self, rgbobj, dst_x, dst_y]]: constant[Render the image represented by (rgbobj) at dst_x, dst_y in the pixel space. *** internal method-- do not use *** ] if compare[name[self].surface is constant[None]] begin[:] return[None] c...
keyword[def] identifier[render_image] ( identifier[self] , identifier[rgbobj] , identifier[dst_x] , identifier[dst_y] ): literal[string] keyword[if] identifier[self] . identifier[surface] keyword[is] keyword[None] : keyword[return] identifier[self] . identifier[logger] . i...
def render_image(self, rgbobj, dst_x, dst_y): """Render the image represented by (rgbobj) at dst_x, dst_y in the pixel space. *** internal method-- do not use *** """ if self.surface is None: return # depends on [control=['if'], data=[]] self.logger.debug('redraw surface') ...
def eratosthenes() -> Iterator[int]: """Generate the prime numbers with the sieve of Eratosthenes. https://oeis.org/A000040 """ d = {} # type: Dict[int, List[int]] for i in itertools.count(2): if i in d: for j in d[i]: d[i + j] = d.get(i + j, []) + [j] ...
def function[eratosthenes, parameter[]]: constant[Generate the prime numbers with the sieve of Eratosthenes. https://oeis.org/A000040 ] variable[d] assign[=] dictionary[[], []] for taget[name[i]] in starred[call[name[itertools].count, parameter[constant[2]]]] begin[:] if ...
keyword[def] identifier[eratosthenes] ()-> identifier[Iterator] [ identifier[int] ]: literal[string] identifier[d] ={} keyword[for] identifier[i] keyword[in] identifier[itertools] . identifier[count] ( literal[int] ): keyword[if] identifier[i] keyword[in] identifier[d] : ke...
def eratosthenes() -> Iterator[int]: """Generate the prime numbers with the sieve of Eratosthenes. https://oeis.org/A000040 """ d = {} # type: Dict[int, List[int]] for i in itertools.count(2): if i in d: for j in d[i]: d[i + j] = d.get(i + j, []) + [j] # depends...
def values(self): """Return data in `self` as a numpy array. If all columns are the same dtype, the resulting array will have this dtype. If there are >1 dtypes in columns, then the resulting array will have dtype `object`. """ dtypes = [col.dtype for col in self.columns...
def function[values, parameter[self]]: constant[Return data in `self` as a numpy array. If all columns are the same dtype, the resulting array will have this dtype. If there are >1 dtypes in columns, then the resulting array will have dtype `object`. ] variable[dtypes] a...
keyword[def] identifier[values] ( identifier[self] ): literal[string] identifier[dtypes] =[ identifier[col] . identifier[dtype] keyword[for] identifier[col] keyword[in] identifier[self] . identifier[columns] ] keyword[if] identifier[len] ( identifier[set] ( identifier[dtypes] ))> lite...
def values(self): """Return data in `self` as a numpy array. If all columns are the same dtype, the resulting array will have this dtype. If there are >1 dtypes in columns, then the resulting array will have dtype `object`. """ dtypes = [col.dtype for col in self.columns] if...
def render(self, row, style=None, adopt=True): """Render fields with values from `row`. Parameters ---------- row : dict A normalized row. style : dict, optional A style that follows the schema defined in pyout.elements. If None, `self.style`...
def function[render, parameter[self, row, style, adopt]]: constant[Render fields with values from `row`. Parameters ---------- row : dict A normalized row. style : dict, optional A style that follows the schema defined in pyout.elements. If N...
keyword[def] identifier[render] ( identifier[self] , identifier[row] , identifier[style] = keyword[None] , identifier[adopt] = keyword[True] ): literal[string] identifier[group] = identifier[self] . identifier[_proc_group] ( identifier[style] , identifier[adopt] = identifier[adopt] ) keywo...
def render(self, row, style=None, adopt=True): """Render fields with values from `row`. Parameters ---------- row : dict A normalized row. style : dict, optional A style that follows the schema defined in pyout.elements. If None, `self.style` is ...
def set_registers(self, cpu_id, names, values): """Sets zero or more registers atomically. This feature is not implemented in the 4.0.0 release but may show up in a dot release. in cpu_id of type int The identifier of the Virtual CPU. in names of type str ...
def function[set_registers, parameter[self, cpu_id, names, values]]: constant[Sets zero or more registers atomically. This feature is not implemented in the 4.0.0 release but may show up in a dot release. in cpu_id of type int The identifier of the Virtual CPU. ...
keyword[def] identifier[set_registers] ( identifier[self] , identifier[cpu_id] , identifier[names] , identifier[values] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[cpu_id] , identifier[baseinteger] ): keyword[raise] identifier[TypeError] ( literal...
def set_registers(self, cpu_id, names, values): """Sets zero or more registers atomically. This feature is not implemented in the 4.0.0 release but may show up in a dot release. in cpu_id of type int The identifier of the Virtual CPU. in names of type str ...
def compute_upper_limit(mu_in, post, alpha=0.9): """ Returns the upper limit mu_high of confidence level alpha for a posterior distribution post on the given parameter mu. The posterior need not be normalized. """ if 0 < alpha < 1: dp = integral_element(mu_in, post) high_idx = bi...
def function[compute_upper_limit, parameter[mu_in, post, alpha]]: constant[ Returns the upper limit mu_high of confidence level alpha for a posterior distribution post on the given parameter mu. The posterior need not be normalized. ] if compare[constant[0] less[<] name[alpha]] begin[:] ...
keyword[def] identifier[compute_upper_limit] ( identifier[mu_in] , identifier[post] , identifier[alpha] = literal[int] ): literal[string] keyword[if] literal[int] < identifier[alpha] < literal[int] : identifier[dp] = identifier[integral_element] ( identifier[mu_in] , identifier[post] ) i...
def compute_upper_limit(mu_in, post, alpha=0.9): """ Returns the upper limit mu_high of confidence level alpha for a posterior distribution post on the given parameter mu. The posterior need not be normalized. """ if 0 < alpha < 1: dp = integral_element(mu_in, post) high_idx = bi...
def _enumload(l: Loader, value, type_) -> Enum: """ This loads something into an Enum. It tries with basic types first. If that fails, it tries to look for type annotations inside the Enum, and tries to use those to load the value into something that is compatible with the Enum. Of course...
def function[_enumload, parameter[l, value, type_]]: constant[ This loads something into an Enum. It tries with basic types first. If that fails, it tries to look for type annotations inside the Enum, and tries to use those to load the value into something that is compatible with the Enum....
keyword[def] identifier[_enumload] ( identifier[l] : identifier[Loader] , identifier[value] , identifier[type_] )-> identifier[Enum] : literal[string] keyword[try] : keyword[return] identifier[type_] ( identifier[value] ) keyword[except] : keyword[pass] keyword[...
def _enumload(l: Loader, value, type_) -> Enum: """ This loads something into an Enum. It tries with basic types first. If that fails, it tries to look for type annotations inside the Enum, and tries to use those to load the value into something that is compatible with the Enum. Of course...
def transmit_content_metadata(self, user): """ Transmit content metadata to integrated channel. """ exporter = self.get_content_metadata_exporter(user) transmitter = self.get_content_metadata_transmitter() transmitter.transmit(exporter.export())
def function[transmit_content_metadata, parameter[self, user]]: constant[ Transmit content metadata to integrated channel. ] variable[exporter] assign[=] call[name[self].get_content_metadata_exporter, parameter[name[user]]] variable[transmitter] assign[=] call[name[self].get_cont...
keyword[def] identifier[transmit_content_metadata] ( identifier[self] , identifier[user] ): literal[string] identifier[exporter] = identifier[self] . identifier[get_content_metadata_exporter] ( identifier[user] ) identifier[transmitter] = identifier[self] . identifier[get_content_metadata_...
def transmit_content_metadata(self, user): """ Transmit content metadata to integrated channel. """ exporter = self.get_content_metadata_exporter(user) transmitter = self.get_content_metadata_transmitter() transmitter.transmit(exporter.export())
def forward(self, word_inputs, tag_inputs, arc_targets=None, rel_targets=None): """Run decoding Parameters ---------- word_inputs : mxnet.ndarray.NDArray word indices of seq_len x batch_size tag_inputs : mxnet.ndarray.NDArray tag indices of seq_len x batc...
def function[forward, parameter[self, word_inputs, tag_inputs, arc_targets, rel_targets]]: constant[Run decoding Parameters ---------- word_inputs : mxnet.ndarray.NDArray word indices of seq_len x batch_size tag_inputs : mxnet.ndarray.NDArray tag indices ...
keyword[def] identifier[forward] ( identifier[self] , identifier[word_inputs] , identifier[tag_inputs] , identifier[arc_targets] = keyword[None] , identifier[rel_targets] = keyword[None] ): literal[string] identifier[is_train] = identifier[autograd] . identifier[is_training] () keyword[de...
def forward(self, word_inputs, tag_inputs, arc_targets=None, rel_targets=None): """Run decoding Parameters ---------- word_inputs : mxnet.ndarray.NDArray word indices of seq_len x batch_size tag_inputs : mxnet.ndarray.NDArray tag indices of seq_len x batch_si...
def show_run(): ''' Shortcut to run `show run` on switch .. code-block:: bash salt '*' onyx.cmd show_run ''' try: enable() configure_terminal() ret = sendline('show running-config') configure_terminal_exit() disable() except TerminalException as ...
def function[show_run, parameter[]]: constant[ Shortcut to run `show run` on switch .. code-block:: bash salt '*' onyx.cmd show_run ] <ast.Try object at 0x7da18dc99540> return[name[ret]]
keyword[def] identifier[show_run] (): literal[string] keyword[try] : identifier[enable] () identifier[configure_terminal] () identifier[ret] = identifier[sendline] ( literal[string] ) identifier[configure_terminal_exit] () identifier[disable] () keyword[exc...
def show_run(): """ Shortcut to run `show run` on switch .. code-block:: bash salt '*' onyx.cmd show_run """ try: enable() configure_terminal() ret = sendline('show running-config') configure_terminal_exit() disable() # depends on [control=['try'], ...
def _inner_func_anot(func): """must be applied to all inner functions that return contexts. Wraps all instances of pygame.Surface in the input in Surface""" @wraps(func) def new_func(*args): return func(*_lmap(_wrap_surface, args)) return new_func
def function[_inner_func_anot, parameter[func]]: constant[must be applied to all inner functions that return contexts. Wraps all instances of pygame.Surface in the input in Surface] def function[new_func, parameter[]]: return[call[name[func], parameter[<ast.Starred object at 0x7da204347...
keyword[def] identifier[_inner_func_anot] ( identifier[func] ): literal[string] @ identifier[wraps] ( identifier[func] ) keyword[def] identifier[new_func] (* identifier[args] ): keyword[return] identifier[func] (* identifier[_lmap] ( identifier[_wrap_surface] , identifier[args] )) keywo...
def _inner_func_anot(func): """must be applied to all inner functions that return contexts. Wraps all instances of pygame.Surface in the input in Surface""" @wraps(func) def new_func(*args): return func(*_lmap(_wrap_surface, args)) return new_func
def channels_voice_greeting_recording(self, id, **kwargs): "https://developer.zendesk.com/rest_api/docs/voice-api/greetings#get-greeting-audio-file" api_path = "/api/v2/channels/voice/greetings/{id}/recording.mp3" api_path = api_path.format(id=id) return self.call(api_path, **kwargs)
def function[channels_voice_greeting_recording, parameter[self, id]]: constant[https://developer.zendesk.com/rest_api/docs/voice-api/greetings#get-greeting-audio-file] variable[api_path] assign[=] constant[/api/v2/channels/voice/greetings/{id}/recording.mp3] variable[api_path] assign[=] call[nam...
keyword[def] identifier[channels_voice_greeting_recording] ( identifier[self] , identifier[id] ,** identifier[kwargs] ): literal[string] identifier[api_path] = literal[string] identifier[api_path] = identifier[api_path] . identifier[format] ( identifier[id] = identifier[id] ) key...
def channels_voice_greeting_recording(self, id, **kwargs): """https://developer.zendesk.com/rest_api/docs/voice-api/greetings#get-greeting-audio-file""" api_path = '/api/v2/channels/voice/greetings/{id}/recording.mp3' api_path = api_path.format(id=id) return self.call(api_path, **kwargs)
def l1_distance(t1, t2, name=None): """l1 distance between t1 and t2. Args: t1: A tensor. t2: A tensor that is the same size as t1. name: Optional name for this op. Returns: The l1 distance between t1 and t2. """ with tf.name_scope(name, 'l1_distance', [t1, t2]) as scope: t1 = tf.convert_...
def function[l1_distance, parameter[t1, t2, name]]: constant[l1 distance between t1 and t2. Args: t1: A tensor. t2: A tensor that is the same size as t1. name: Optional name for this op. Returns: The l1 distance between t1 and t2. ] with call[name[tf].name_scope, parameter[name[na...
keyword[def] identifier[l1_distance] ( identifier[t1] , identifier[t2] , identifier[name] = keyword[None] ): literal[string] keyword[with] identifier[tf] . identifier[name_scope] ( identifier[name] , literal[string] ,[ identifier[t1] , identifier[t2] ]) keyword[as] identifier[scope] : identifier[t1] = i...
def l1_distance(t1, t2, name=None): """l1 distance between t1 and t2. Args: t1: A tensor. t2: A tensor that is the same size as t1. name: Optional name for this op. Returns: The l1 distance between t1 and t2. """ with tf.name_scope(name, 'l1_distance', [t1, t2]) as scope: t1 = tf....
def css(self, css_path, dom=None): """css find function abbreviation""" if dom is None: dom = self.browser return expect(dom.find_by_css, args=[css_path])
def function[css, parameter[self, css_path, dom]]: constant[css find function abbreviation] if compare[name[dom] is constant[None]] begin[:] variable[dom] assign[=] name[self].browser return[call[name[expect], parameter[name[dom].find_by_css]]]
keyword[def] identifier[css] ( identifier[self] , identifier[css_path] , identifier[dom] = keyword[None] ): literal[string] keyword[if] identifier[dom] keyword[is] keyword[None] : identifier[dom] = identifier[self] . identifier[browser] keyword[return] identifier[expect] ...
def css(self, css_path, dom=None): """css find function abbreviation""" if dom is None: dom = self.browser # depends on [control=['if'], data=['dom']] return expect(dom.find_by_css, args=[css_path])
def _filter_attrs(attrs, ignored_attrs): """ Return attrs that are not in ignored_attrs """ return dict((k, v) for k, v in attrs.items() if k not in ignored_attrs)
def function[_filter_attrs, parameter[attrs, ignored_attrs]]: constant[ Return attrs that are not in ignored_attrs ] return[call[name[dict], parameter[<ast.GeneratorExp object at 0x7da1b1f95450>]]]
keyword[def] identifier[_filter_attrs] ( identifier[attrs] , identifier[ignored_attrs] ): literal[string] keyword[return] identifier[dict] (( identifier[k] , identifier[v] ) keyword[for] identifier[k] , identifier[v] keyword[in] identifier[attrs] . identifier[items] () keyword[if] identifier[k] keywo...
def _filter_attrs(attrs, ignored_attrs): """ Return attrs that are not in ignored_attrs """ return dict(((k, v) for (k, v) in attrs.items() if k not in ignored_attrs))
def post(self, path, body, headers=None): """Perform a POST request, providing a body, which will be JSON-encoded. Args: path (str): A path that gets appended to ``base_url``. body (dict): Dictionary that will be JSON-encoded and sent as the body. Example: api_cli...
def function[post, parameter[self, path, body, headers]]: constant[Perform a POST request, providing a body, which will be JSON-encoded. Args: path (str): A path that gets appended to ``base_url``. body (dict): Dictionary that will be JSON-encoded and sent as the body. Exam...
keyword[def] identifier[post] ( identifier[self] , identifier[path] , identifier[body] , identifier[headers] = keyword[None] ): literal[string] identifier[response] = identifier[requests] . identifier[post] ( identifier[self] . identifier[_url_for] ( identifier[path] ), identifie...
def post(self, path, body, headers=None): """Perform a POST request, providing a body, which will be JSON-encoded. Args: path (str): A path that gets appended to ``base_url``. body (dict): Dictionary that will be JSON-encoded and sent as the body. Example: api_client....
def Nasv(macs,T): ''' Returns ------- Na*<sigma v> for MACS [mb] at T [K]. ''' Na = avogadro_constant k = boltzmann_constant vtherm=(2.*k*T/mass_H_atom)**0.5 s = macs*1.e-27 Nasv = s*vtherm*Na return Nasv
def function[Nasv, parameter[macs, T]]: constant[ Returns ------- Na*<sigma v> for MACS [mb] at T [K]. ] variable[Na] assign[=] name[avogadro_constant] variable[k] assign[=] name[boltzmann_constant] variable[vtherm] assign[=] binary_operation[binary_oper...
keyword[def] identifier[Nasv] ( identifier[macs] , identifier[T] ): literal[string] identifier[Na] = identifier[avogadro_constant] identifier[k] = identifier[boltzmann_constant] identifier[vtherm] =( literal[int] * identifier[k] * identifier[T] / identifier[mass_H_atom] )** literal[int] ...
def Nasv(macs, T): """ Returns ------- Na*<sigma v> for MACS [mb] at T [K]. """ Na = avogadro_constant k = boltzmann_constant vtherm = (2.0 * k * T / mass_H_atom) ** 0.5 s = macs * 1e-27 Nasv = s * vtherm * Na return Nasv
def format_rpc(self, address, rpc_id, payload): """Create a formated word list that encodes this rpc.""" addr_word = (rpc_id | (address << 16) | ((1 << 1) << 24)) send_length = len(payload) if len(payload) < 20: payload = payload + b'\0'*(20 - len(payload)) payload...
def function[format_rpc, parameter[self, address, rpc_id, payload]]: constant[Create a formated word list that encodes this rpc.] variable[addr_word] assign[=] binary_operation[binary_operation[name[rpc_id] <ast.BitOr object at 0x7da2590d6aa0> binary_operation[name[address] <ast.LShift object at 0x7da25...
keyword[def] identifier[format_rpc] ( identifier[self] , identifier[address] , identifier[rpc_id] , identifier[payload] ): literal[string] identifier[addr_word] =( identifier[rpc_id] |( identifier[address] << literal[int] )|(( literal[int] << literal[int] )<< literal[int] )) identifier[s...
def format_rpc(self, address, rpc_id, payload): """Create a formated word list that encodes this rpc.""" addr_word = rpc_id | address << 16 | 1 << 1 << 24 send_length = len(payload) if len(payload) < 20: payload = payload + b'\x00' * (20 - len(payload)) # depends on [control=['if'], data=[]] ...
def refresh_token(self, request, data, client): """ Handle ``grant_type=refresh_token`` requests as defined in :rfc:`6`. """ rt = self.get_refresh_token_grant(request, data, client) # this must be called first in case we need to purge expired tokens self.invalidate_refre...
def function[refresh_token, parameter[self, request, data, client]]: constant[ Handle ``grant_type=refresh_token`` requests as defined in :rfc:`6`. ] variable[rt] assign[=] call[name[self].get_refresh_token_grant, parameter[name[request], name[data], name[client]]] call[name[self...
keyword[def] identifier[refresh_token] ( identifier[self] , identifier[request] , identifier[data] , identifier[client] ): literal[string] identifier[rt] = identifier[self] . identifier[get_refresh_token_grant] ( identifier[request] , identifier[data] , identifier[client] ) ident...
def refresh_token(self, request, data, client): """ Handle ``grant_type=refresh_token`` requests as defined in :rfc:`6`. """ rt = self.get_refresh_token_grant(request, data, client) # this must be called first in case we need to purge expired tokens self.invalidate_refresh_token(rt) ...
def delete_multiple(self, ids=None, messages=None): """Execute an HTTP request to delete messages from queue. Arguments: ids -- A list of messages id to be deleted from the queue. messages -- Response to message reserving. """ url = "queues/%s/messages" % self.name ...
def function[delete_multiple, parameter[self, ids, messages]]: constant[Execute an HTTP request to delete messages from queue. Arguments: ids -- A list of messages id to be deleted from the queue. messages -- Response to message reserving. ] variable[url] assign[=] binar...
keyword[def] identifier[delete_multiple] ( identifier[self] , identifier[ids] = keyword[None] , identifier[messages] = keyword[None] ): literal[string] identifier[url] = literal[string] % identifier[self] . identifier[name] identifier[items] = keyword[None] keyword[if] identif...
def delete_multiple(self, ids=None, messages=None): """Execute an HTTP request to delete messages from queue. Arguments: ids -- A list of messages id to be deleted from the queue. messages -- Response to message reserving. """ url = 'queues/%s/messages' % self.name items = N...
def join(strin, items): """ Ramda implementation of join :param strin: :param items: :return: """ return strin.join(map(lambda item: str(item), items))
def function[join, parameter[strin, items]]: constant[ Ramda implementation of join :param strin: :param items: :return: ] return[call[name[strin].join, parameter[call[name[map], parameter[<ast.Lambda object at 0x7da207f02200>, name[items]]]]]]
keyword[def] identifier[join] ( identifier[strin] , identifier[items] ): literal[string] keyword[return] identifier[strin] . identifier[join] ( identifier[map] ( keyword[lambda] identifier[item] : identifier[str] ( identifier[item] ), identifier[items] ))
def join(strin, items): """ Ramda implementation of join :param strin: :param items: :return: """ return strin.join(map(lambda item: str(item), items))
def __validateExperimentControl(self, control): """ Validates control dictionary for the experiment context""" # Validate task list taskList = control.get('tasks', None) if taskList is not None: taskLabelsList = [] for task in taskList: validateOpfJsonValue(task, "opfTaskSchema.json...
def function[__validateExperimentControl, parameter[self, control]]: constant[ Validates control dictionary for the experiment context] variable[taskList] assign[=] call[name[control].get, parameter[constant[tasks], constant[None]]] if compare[name[taskList] is_not constant[None]] begin[:] ...
keyword[def] identifier[__validateExperimentControl] ( identifier[self] , identifier[control] ): literal[string] identifier[taskList] = identifier[control] . identifier[get] ( literal[string] , keyword[None] ) keyword[if] identifier[taskList] keyword[is] keyword[not] keyword[None] : id...
def __validateExperimentControl(self, control): """ Validates control dictionary for the experiment context""" # Validate task list taskList = control.get('tasks', None) if taskList is not None: taskLabelsList = [] for task in taskList: validateOpfJsonValue(task, 'opfTaskSche...
def realpath(self, filename): """Return the canonical path of the specified filename, eliminating any symbolic links encountered in the path. """ if self.filesystem.is_windows_fs: return self.abspath(filename) filename = make_string_path(filename) path, ok = s...
def function[realpath, parameter[self, filename]]: constant[Return the canonical path of the specified filename, eliminating any symbolic links encountered in the path. ] if name[self].filesystem.is_windows_fs begin[:] return[call[name[self].abspath, parameter[name[filename]]]] ...
keyword[def] identifier[realpath] ( identifier[self] , identifier[filename] ): literal[string] keyword[if] identifier[self] . identifier[filesystem] . identifier[is_windows_fs] : keyword[return] identifier[self] . identifier[abspath] ( identifier[filename] ) identifier[filen...
def realpath(self, filename): """Return the canonical path of the specified filename, eliminating any symbolic links encountered in the path. """ if self.filesystem.is_windows_fs: return self.abspath(filename) # depends on [control=['if'], data=[]] filename = make_string_path(filena...
def watchdogctl(ctx, kill=False, verbose=True): """Control / check a running Sphinx autobuild process.""" tries = 40 if kill else 0 cmd = 'lsof -i TCP:{} -s TCP:LISTEN -S -Fp 2>/dev/null'.format(ctx.rituals.docs.watchdog.port) pidno = 0 pidinfo = capture(cmd, ignore_failures=True) while pidinfo...
def function[watchdogctl, parameter[ctx, kill, verbose]]: constant[Control / check a running Sphinx autobuild process.] variable[tries] assign[=] <ast.IfExp object at 0x7da1b0057d60> variable[cmd] assign[=] call[constant[lsof -i TCP:{} -s TCP:LISTEN -S -Fp 2>/dev/null].format, parameter[name[ctx...
keyword[def] identifier[watchdogctl] ( identifier[ctx] , identifier[kill] = keyword[False] , identifier[verbose] = keyword[True] ): literal[string] identifier[tries] = literal[int] keyword[if] identifier[kill] keyword[else] literal[int] identifier[cmd] = literal[string] . identifier[format] ( ide...
def watchdogctl(ctx, kill=False, verbose=True): """Control / check a running Sphinx autobuild process.""" tries = 40 if kill else 0 cmd = 'lsof -i TCP:{} -s TCP:LISTEN -S -Fp 2>/dev/null'.format(ctx.rituals.docs.watchdog.port) pidno = 0 pidinfo = capture(cmd, ignore_failures=True) while pidinfo:...
def search(self, searchTerm): """Returns objects matching the query.""" if type(searchTerm)==type(''): searchTerm=SearchTerm(searchTerm) if searchTerm not in self.featpaths: matches = None if searchTerm.type != None and searchTerm.type != self.classname(): matches = self._searchInChildren(searchTerm...
def function[search, parameter[self, searchTerm]]: constant[Returns objects matching the query.] if compare[call[name[type], parameter[name[searchTerm]]] equal[==] call[name[type], parameter[constant[]]]] begin[:] variable[searchTerm] assign[=] call[name[SearchTerm], parameter[name[searc...
keyword[def] identifier[search] ( identifier[self] , identifier[searchTerm] ): literal[string] keyword[if] identifier[type] ( identifier[searchTerm] )== identifier[type] ( literal[string] ): identifier[searchTerm] = identifier[SearchTerm] ( identifier[searchTerm] ) keyword[if] identifier[searchTerm] ...
def search(self, searchTerm): """Returns objects matching the query.""" if type(searchTerm) == type(''): searchTerm = SearchTerm(searchTerm) # depends on [control=['if'], data=[]] if searchTerm not in self.featpaths: matches = None if searchTerm.type != None and searchTerm.type != s...
def unicode2Date(value, format=None): """ CONVERT UNICODE STRING TO UNIX TIMESTAMP VALUE """ # http://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior if value == None: return None if format != None: try: if format.endswith("%S.%f") and "." not ...
def function[unicode2Date, parameter[value, format]]: constant[ CONVERT UNICODE STRING TO UNIX TIMESTAMP VALUE ] if compare[name[value] equal[==] constant[None]] begin[:] return[constant[None]] if compare[name[format] not_equal[!=] constant[None]] begin[:] <ast.Try object...
keyword[def] identifier[unicode2Date] ( identifier[value] , identifier[format] = keyword[None] ): literal[string] keyword[if] identifier[value] == keyword[None] : keyword[return] keyword[None] keyword[if] identifier[format] != keyword[None] : keyword[try] : key...
def unicode2Date(value, format=None): """ CONVERT UNICODE STRING TO UNIX TIMESTAMP VALUE """ # http://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior if value == None: return None # depends on [control=['if'], data=[]] if format != None: try: i...
def get_attributes(self): """This function through the layers from top to bottom, and creates a list of all the attributes found :returns: A list of all the attributes names :rtype: list """ attributes = [] for i in reversed(xrange(len(self.layers))): ...
def function[get_attributes, parameter[self]]: constant[This function through the layers from top to bottom, and creates a list of all the attributes found :returns: A list of all the attributes names :rtype: list ] variable[attributes] assign[=] list[[]] for tag...
keyword[def] identifier[get_attributes] ( identifier[self] ): literal[string] identifier[attributes] =[] keyword[for] identifier[i] keyword[in] identifier[reversed] ( identifier[xrange] ( identifier[len] ( identifier[self] . identifier[layers] ))): identifier[obj] = identif...
def get_attributes(self): """This function through the layers from top to bottom, and creates a list of all the attributes found :returns: A list of all the attributes names :rtype: list """ attributes = [] for i in reversed(xrange(len(self.layers))): obj = self.laye...
def _path_completer_grammar(self): """ Return the grammar for matching paths inside strings inside Python code. """ # We make this lazy, because it delays startup time a little bit. # This way, the grammar is build during the first completion. if self._path_comple...
def function[_path_completer_grammar, parameter[self]]: constant[ Return the grammar for matching paths inside strings inside Python code. ] if compare[name[self]._path_completer_grammar_cache is constant[None]] begin[:] name[self]._path_completer_grammar_cache as...
keyword[def] identifier[_path_completer_grammar] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_path_completer_grammar_cache] keyword[is] keyword[None] : identifier[self] . identifier[_path_completer_grammar_cache] = identifier[sel...
def _path_completer_grammar(self): """ Return the grammar for matching paths inside strings inside Python code. """ # We make this lazy, because it delays startup time a little bit. # This way, the grammar is build during the first completion. if self._path_completer_grammar_cach...
def _encode_message_header(cls, client_id, correlation_id, request_key, api_version=0): """ Encode the common request envelope """ return (struct.pack('>hhih', request_key, # ApiKey api_versio...
def function[_encode_message_header, parameter[cls, client_id, correlation_id, request_key, api_version]]: constant[ Encode the common request envelope ] return[binary_operation[call[name[struct].pack, parameter[constant[>hhih], name[request_key], name[api_version], name[correlation_id], cal...
keyword[def] identifier[_encode_message_header] ( identifier[cls] , identifier[client_id] , identifier[correlation_id] , identifier[request_key] , identifier[api_version] = literal[int] ): literal[string] keyword[return] ( identifier[struct] . identifier[pack] ( literal[string] , identifi...
def _encode_message_header(cls, client_id, correlation_id, request_key, api_version=0): """ Encode the common request envelope """ # ApiKey # ApiVersion # CorrelationId # ClientId size return struct.pack('>hhih', request_key, api_version, correlation_id, len(client_id)) + client_id
def vmomentsurfacemass(self,*args,**kwargs): """ NAME: vmomentsurfacemass PURPOSE: calculate the an arbitrary moment of the velocity distribution at R times the surfacmass INPUT: R - radius at which to calculate the moment (in ...
def function[vmomentsurfacemass, parameter[self]]: constant[ NAME: vmomentsurfacemass PURPOSE: calculate the an arbitrary moment of the velocity distribution at R times the surfacmass INPUT: R - radius at which to calculate the...
keyword[def] identifier[vmomentsurfacemass] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[use_physical] = identifier[kwargs] . identifier[pop] ( literal[string] , keyword[True] ) identifier[ro] = identifier[kwargs] . identifier[pop] ( literal[s...
def vmomentsurfacemass(self, *args, **kwargs): """ NAME: vmomentsurfacemass PURPOSE: calculate the an arbitrary moment of the velocity distribution at R times the surfacmass INPUT: R - radius at which to calculate the moment (in na...
def get_display_label(choices, status): """Get a display label for resource status. This method is used in places where a resource's status or admin state labels need to assigned before they are sent to the view template. """ for (value, label) in choices: if value == (status or '').lo...
def function[get_display_label, parameter[choices, status]]: constant[Get a display label for resource status. This method is used in places where a resource's status or admin state labels need to assigned before they are sent to the view template. ] for taget[tuple[[<ast.Name object at...
keyword[def] identifier[get_display_label] ( identifier[choices] , identifier[status] ): literal[string] keyword[for] ( identifier[value] , identifier[label] ) keyword[in] identifier[choices] : keyword[if] identifier[value] ==( identifier[status] keyword[or] literal[string] ). identifier[lowe...
def get_display_label(choices, status): """Get a display label for resource status. This method is used in places where a resource's status or admin state labels need to assigned before they are sent to the view template. """ for (value, label) in choices: if value == (status or '').low...
def cable_page_by_id(reference_id): """\ Experimental: Returns the HTML page of the cable identified by `reference_id`. >>> cable_page_by_id('09BERLIN1167') is not None True >>> cable_page_by_id('22BERLIN1167') is None True >>> cable_page_by_id('09MOSCOW3010') is not None True >>> c...
def function[cable_page_by_id, parameter[reference_id]]: constant[ Experimental: Returns the HTML page of the cable identified by `reference_id`. >>> cable_page_by_id('09BERLIN1167') is not None True >>> cable_page_by_id('22BERLIN1167') is None True >>> cable_page_by_id('09MOSCOW3010') i...
keyword[def] identifier[cable_page_by_id] ( identifier[reference_id] ): literal[string] keyword[global] identifier[_CABLEID2MONTH] keyword[def] identifier[wikileaks_id] ( identifier[reference_id] ): keyword[if] identifier[reference_id] keyword[in] identifier[consts] . identifier[INVALID...
def cable_page_by_id(reference_id): """ Experimental: Returns the HTML page of the cable identified by `reference_id`. >>> cable_page_by_id('09BERLIN1167') is not None True >>> cable_page_by_id('22BERLIN1167') is None True >>> cable_page_by_id('09MOSCOW3010') is not None True >>> cab...
def uses_paral_kgb(self, value=1): """True if the task is a GS Task and uses paral_kgb with the given value.""" paral_kgb = self.get_inpvar("paral_kgb", 0) # paral_kgb is used only in the GS part. return paral_kgb == value and isinstance(self, GsTask)
def function[uses_paral_kgb, parameter[self, value]]: constant[True if the task is a GS Task and uses paral_kgb with the given value.] variable[paral_kgb] assign[=] call[name[self].get_inpvar, parameter[constant[paral_kgb], constant[0]]] return[<ast.BoolOp object at 0x7da18f7205b0>]
keyword[def] identifier[uses_paral_kgb] ( identifier[self] , identifier[value] = literal[int] ): literal[string] identifier[paral_kgb] = identifier[self] . identifier[get_inpvar] ( literal[string] , literal[int] ) keyword[return] identifier[paral_kgb] == identifier[value] keywor...
def uses_paral_kgb(self, value=1): """True if the task is a GS Task and uses paral_kgb with the given value.""" paral_kgb = self.get_inpvar('paral_kgb', 0) # paral_kgb is used only in the GS part. return paral_kgb == value and isinstance(self, GsTask)
def evaluate_ising(linear, quad, state): """Calculate the energy of a state given the Hamiltonian. Args: linear: Linear Hamiltonian terms. quad: Quadratic Hamiltonian terms. state: Vector of spins describing the system state. Returns: Energy of the state evaluated by the gi...
def function[evaluate_ising, parameter[linear, quad, state]]: constant[Calculate the energy of a state given the Hamiltonian. Args: linear: Linear Hamiltonian terms. quad: Quadratic Hamiltonian terms. state: Vector of spins describing the system state. Returns: Energy o...
keyword[def] identifier[evaluate_ising] ( identifier[linear] , identifier[quad] , identifier[state] ): literal[string] keyword[if] identifier[_numpy] keyword[and] identifier[isinstance] ( identifier[state] , identifier[np] . identifier[ndarray] ): keyword[return] identifier[evaluate_isin...
def evaluate_ising(linear, quad, state): """Calculate the energy of a state given the Hamiltonian. Args: linear: Linear Hamiltonian terms. quad: Quadratic Hamiltonian terms. state: Vector of spins describing the system state. Returns: Energy of the state evaluated by the gi...
def DeserializeForImport(self, reader): """ Deserialize full object. Args: reader (neo.IO.BinaryReader): """ super(Block, self).Deserialize(reader) self.Transactions = [] transaction_length = reader.ReadVarInt() for i in range(0, transaction...
def function[DeserializeForImport, parameter[self, reader]]: constant[ Deserialize full object. Args: reader (neo.IO.BinaryReader): ] call[call[name[super], parameter[name[Block], name[self]]].Deserialize, parameter[name[reader]]] name[self].Transactions assi...
keyword[def] identifier[DeserializeForImport] ( identifier[self] , identifier[reader] ): literal[string] identifier[super] ( identifier[Block] , identifier[self] ). identifier[Deserialize] ( identifier[reader] ) identifier[self] . identifier[Transactions] =[] identifier[transacti...
def DeserializeForImport(self, reader): """ Deserialize full object. Args: reader (neo.IO.BinaryReader): """ super(Block, self).Deserialize(reader) self.Transactions = [] transaction_length = reader.ReadVarInt() for i in range(0, transaction_length): tx =...
def from_function(cls, function): """Create a FunctionDescriptor from a function instance. This function is used to create the function descriptor from a python function. If a function is a class function, it should not be used by this function. Args: cls: Current c...
def function[from_function, parameter[cls, function]]: constant[Create a FunctionDescriptor from a function instance. This function is used to create the function descriptor from a python function. If a function is a class function, it should not be used by this function. Args:...
keyword[def] identifier[from_function] ( identifier[cls] , identifier[function] ): literal[string] identifier[module_name] = identifier[function] . identifier[__module__] identifier[function_name] = identifier[function] . identifier[__name__] identifier[class_name] = literal[str...
def from_function(cls, function): """Create a FunctionDescriptor from a function instance. This function is used to create the function descriptor from a python function. If a function is a class function, it should not be used by this function. Args: cls: Current class...
def count(self, data): """ Compute histogram of data. Counts the number of elements from array ``data`` in each bin of the histogram. Results are returned in an array, call it ``h``, of length ``nbin+2`` where ``h[0]`` is the number of data elements that fall below the range of ...
def function[count, parameter[self, data]]: constant[ Compute histogram of data. Counts the number of elements from array ``data`` in each bin of the histogram. Results are returned in an array, call it ``h``, of length ``nbin+2`` where ``h[0]`` is the number of data elements th...
keyword[def] identifier[count] ( identifier[self] , identifier[data] ): literal[string] keyword[if] identifier[isinstance] ( identifier[data] , identifier[float] ) keyword[or] identifier[isinstance] ( identifier[data] , identifier[int] ): identifier[hist] = identifier[numpy] . identi...
def count(self, data): """ Compute histogram of data. Counts the number of elements from array ``data`` in each bin of the histogram. Results are returned in an array, call it ``h``, of length ``nbin+2`` where ``h[0]`` is the number of data elements that fall below the range of the ...
def has_virtualenv(self): """ Returns true if the virtualenv tool is installed. """ with self.settings(warn_only=True): ret = self.run_or_local('which virtualenv').strip() return bool(ret)
def function[has_virtualenv, parameter[self]]: constant[ Returns true if the virtualenv tool is installed. ] with call[name[self].settings, parameter[]] begin[:] variable[ret] assign[=] call[call[name[self].run_or_local, parameter[constant[which virtualenv]]].strip, param...
keyword[def] identifier[has_virtualenv] ( identifier[self] ): literal[string] keyword[with] identifier[self] . identifier[settings] ( identifier[warn_only] = keyword[True] ): identifier[ret] = identifier[self] . identifier[run_or_local] ( literal[string] ). identifier[strip] () ...
def has_virtualenv(self): """ Returns true if the virtualenv tool is installed. """ with self.settings(warn_only=True): ret = self.run_or_local('which virtualenv').strip() return bool(ret) # depends on [control=['with'], data=[]]
def load_data(self, num_samples=1000, percentiles=None): """ Args: num_samples: Number of random samples at each grid point percentiles: Which percentiles to extract from the random samples Returns: """ self.percentiles = percentiles self.num_samp...
def function[load_data, parameter[self, num_samples, percentiles]]: constant[ Args: num_samples: Number of random samples at each grid point percentiles: Which percentiles to extract from the random samples Returns: ] name[self].percentiles assign[=] name...
keyword[def] identifier[load_data] ( identifier[self] , identifier[num_samples] = literal[int] , identifier[percentiles] = keyword[None] ): literal[string] identifier[self] . identifier[percentiles] = identifier[percentiles] identifier[self] . identifier[num_samples] = identifier[num_samp...
def load_data(self, num_samples=1000, percentiles=None): """ Args: num_samples: Number of random samples at each grid point percentiles: Which percentiles to extract from the random samples Returns: """ self.percentiles = percentiles self.num_samples = num_sa...
def sc(simulated_array, observed_array, replace_nan=None, replace_inf=None, remove_neg=False, remove_zero=False): """Compute the Spectral Correlation (SC). .. image:: /pictures/SC.png **Range:** -π/2 ≤ SA < π/2, closer to 0 is better. **Notes:** The spectral correlation metric measures the ang...
def function[sc, parameter[simulated_array, observed_array, replace_nan, replace_inf, remove_neg, remove_zero]]: constant[Compute the Spectral Correlation (SC). .. image:: /pictures/SC.png **Range:** -π/2 ≤ SA < π/2, closer to 0 is better. **Notes:** The spectral correlation metric measures the a...
keyword[def] identifier[sc] ( identifier[simulated_array] , identifier[observed_array] , identifier[replace_nan] = keyword[None] , identifier[replace_inf] = keyword[None] , identifier[remove_neg] = keyword[False] , identifier[remove_zero] = keyword[False] ): literal[string] identifier[simulated_arra...
def sc(simulated_array, observed_array, replace_nan=None, replace_inf=None, remove_neg=False, remove_zero=False): """Compute the Spectral Correlation (SC). .. image:: /pictures/SC.png **Range:** -π/2 ≤ SA < π/2, closer to 0 is better. **Notes:** The spectral correlation metric measures the angle betw...
def _build(self, model): """Creates `dist_fn`, `dist_fn_wrapped`, `dist_fn_args`.""" if not isinstance(model, collections.Sequence): raise TypeError('`model` must be `list`-like (saw: {}).'.format( type(model).__name__)) self._dist_fn = model self._dist_fn_wrapped, self._dist_fn_args = z...
def function[_build, parameter[self, model]]: constant[Creates `dist_fn`, `dist_fn_wrapped`, `dist_fn_args`.] if <ast.UnaryOp object at 0x7da1b03561d0> begin[:] <ast.Raise object at 0x7da1b03560b0> name[self]._dist_fn assign[=] name[model] <ast.Tuple object at 0x7da1b0357070> ass...
keyword[def] identifier[_build] ( identifier[self] , identifier[model] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[model] , identifier[collections] . identifier[Sequence] ): keyword[raise] identifier[TypeError] ( literal[string] . identifier[format] ( id...
def _build(self, model): """Creates `dist_fn`, `dist_fn_wrapped`, `dist_fn_args`.""" if not isinstance(model, collections.Sequence): raise TypeError('`model` must be `list`-like (saw: {}).'.format(type(model).__name__)) # depends on [control=['if'], data=[]] self._dist_fn = model (self._dist_fn...
def decode(self, packet): """Check a parsed packet and figure out if it is an Eddystone Beacon. If it is , return the relevant data as a dictionary. Return None, it is not an Eddystone Beacon advertising packet""" ssu=packet.retrieve("Complete uuids") found=False for x ...
def function[decode, parameter[self, packet]]: constant[Check a parsed packet and figure out if it is an Eddystone Beacon. If it is , return the relevant data as a dictionary. Return None, it is not an Eddystone Beacon advertising packet] variable[ssu] assign[=] call[name[packet].retrie...
keyword[def] identifier[decode] ( identifier[self] , identifier[packet] ): literal[string] identifier[ssu] = identifier[packet] . identifier[retrieve] ( literal[string] ) identifier[found] = keyword[False] keyword[for] identifier[x] keyword[in] identifier[ssu] : ...
def decode(self, packet): """Check a parsed packet and figure out if it is an Eddystone Beacon. If it is , return the relevant data as a dictionary. Return None, it is not an Eddystone Beacon advertising packet""" ssu = packet.retrieve('Complete uuids') found = False for x in ssu: ...
def scan(self, thing, thing_type=None, blocking=False): """ \nScan a single or list of URLs, or Domains\n NOTE: URLs must include the scheme (http:// or https://)\n NOTE: For a single domain or list of domains this method will automatically append an 'http://' to the \n beginning...
def function[scan, parameter[self, thing, thing_type, blocking]]: constant[ Scan a single or list of URLs, or Domains NOTE: URLs must include the scheme (http:// or https://) NOTE: For a single domain or list of domains this method will automatically append an 'http://' to the ...
keyword[def] identifier[scan] ( identifier[self] , identifier[thing] , identifier[thing_type] = keyword[None] , identifier[blocking] = keyword[False] ): literal[string] identifier[thing_id] = identifier[self] . identifier[_whatis] ( identifier[thing] ) keyword[if] identifier[thing_type] ...
def scan(self, thing, thing_type=None, blocking=False): """ Scan a single or list of URLs, or Domains NOTE: URLs must include the scheme (http:// or https://) NOTE: For a single domain or list of domains this method will automatically append an 'http://' to the beginningof the d...
def rel_path(base, path): """Return path relative to base.""" if base == path: return '' assert is_prefix(base, path), "{} not a prefix of {}".format(base, path) return path[len(base):].strip('.')
def function[rel_path, parameter[base, path]]: constant[Return path relative to base.] if compare[name[base] equal[==] name[path]] begin[:] return[constant[]] assert[call[name[is_prefix], parameter[name[base], name[path]]]] return[call[call[name[path]][<ast.Slice object at 0x7da1b1831540...
keyword[def] identifier[rel_path] ( identifier[base] , identifier[path] ): literal[string] keyword[if] identifier[base] == identifier[path] : keyword[return] literal[string] keyword[assert] identifier[is_prefix] ( identifier[base] , identifier[path] ), literal[string] . identifier[format]...
def rel_path(base, path): """Return path relative to base.""" if base == path: return '' # depends on [control=['if'], data=[]] assert is_prefix(base, path), '{} not a prefix of {}'.format(base, path) return path[len(base):].strip('.')
def _collapse_header(self, header): """Combine header columns into related groups. """ out = [] for i, h in enumerate(header): if h.startswith(self._col_quals): out[-1].append(i) else: out.append([i]) return out
def function[_collapse_header, parameter[self, header]]: constant[Combine header columns into related groups. ] variable[out] assign[=] list[[]] for taget[tuple[[<ast.Name object at 0x7da204344ca0>, <ast.Name object at 0x7da204345480>]]] in starred[call[name[enumerate], parameter[name[he...
keyword[def] identifier[_collapse_header] ( identifier[self] , identifier[header] ): literal[string] identifier[out] =[] keyword[for] identifier[i] , identifier[h] keyword[in] identifier[enumerate] ( identifier[header] ): keyword[if] identifier[h] . identifier[startswith] ...
def _collapse_header(self, header): """Combine header columns into related groups. """ out = [] for (i, h) in enumerate(header): if h.startswith(self._col_quals): out[-1].append(i) # depends on [control=['if'], data=[]] else: out.append([i]) # depends on [co...
def write_metadata(self, fp): """Writes metadata to the given file handler. Parameters ---------- fp : pycbc.inference.io.BaseInferenceFile instance The inference file to write to. """ fp.attrs['model'] = self.name fp.attrs['variable_params'] = list(s...
def function[write_metadata, parameter[self, fp]]: constant[Writes metadata to the given file handler. Parameters ---------- fp : pycbc.inference.io.BaseInferenceFile instance The inference file to write to. ] call[name[fp].attrs][constant[model]] assign[=] n...
keyword[def] identifier[write_metadata] ( identifier[self] , identifier[fp] ): literal[string] identifier[fp] . identifier[attrs] [ literal[string] ]= identifier[self] . identifier[name] identifier[fp] . identifier[attrs] [ literal[string] ]= identifier[list] ( identifier[self] . identifi...
def write_metadata(self, fp): """Writes metadata to the given file handler. Parameters ---------- fp : pycbc.inference.io.BaseInferenceFile instance The inference file to write to. """ fp.attrs['model'] = self.name fp.attrs['variable_params'] = list(self.variable...
def unbuild(self): """ Iterates through the views pointed to by self.detail_views, runs unbuild_object with `self`, and calls _build_extra() and _build_related(). """ for detail_view in self.detail_views: view = self._get_view(detail_view) view().u...
def function[unbuild, parameter[self]]: constant[ Iterates through the views pointed to by self.detail_views, runs unbuild_object with `self`, and calls _build_extra() and _build_related(). ] for taget[name[detail_view]] in starred[name[self].detail_views] begin[:] ...
keyword[def] identifier[unbuild] ( identifier[self] ): literal[string] keyword[for] identifier[detail_view] keyword[in] identifier[self] . identifier[detail_views] : identifier[view] = identifier[self] . identifier[_get_view] ( identifier[detail_view] ) identifier[view]...
def unbuild(self): """ Iterates through the views pointed to by self.detail_views, runs unbuild_object with `self`, and calls _build_extra() and _build_related(). """ for detail_view in self.detail_views: view = self._get_view(detail_view) view().unbuild_object(se...
def removeTab(self, index): """ Removes the tab at the inputed index. :param index | <int> """ curr_index = self.currentIndex() items = list(self.items()) item = items[index] item.close() if index <= curr_index: self._currentInde...
def function[removeTab, parameter[self, index]]: constant[ Removes the tab at the inputed index. :param index | <int> ] variable[curr_index] assign[=] call[name[self].currentIndex, parameter[]] variable[items] assign[=] call[name[list], parameter[call[name[self].ite...
keyword[def] identifier[removeTab] ( identifier[self] , identifier[index] ): literal[string] identifier[curr_index] = identifier[self] . identifier[currentIndex] () identifier[items] = identifier[list] ( identifier[self] . identifier[items] ()) identifier[item] = identifier[items...
def removeTab(self, index): """ Removes the tab at the inputed index. :param index | <int> """ curr_index = self.currentIndex() items = list(self.items()) item = items[index] item.close() if index <= curr_index: self._currentIndex -= 1 # depends on [control...
def console_get_char_background( con: tcod.console.Console, x: int, y: int ) -> Color: """Return the background color at the x,y of this console. .. deprecated:: 8.4 Array access performs significantly faster than using this function. See :any:`Console.bg`. """ return Color._new_fro...
def function[console_get_char_background, parameter[con, x, y]]: constant[Return the background color at the x,y of this console. .. deprecated:: 8.4 Array access performs significantly faster than using this function. See :any:`Console.bg`. ] return[call[name[Color]._new_from_cdata...
keyword[def] identifier[console_get_char_background] ( identifier[con] : identifier[tcod] . identifier[console] . identifier[Console] , identifier[x] : identifier[int] , identifier[y] : identifier[int] )-> identifier[Color] : literal[string] keyword[return] identifier[Color] . identifier[_new_from_cdata...
def console_get_char_background(con: tcod.console.Console, x: int, y: int) -> Color: """Return the background color at the x,y of this console. .. deprecated:: 8.4 Array access performs significantly faster than using this function. See :any:`Console.bg`. """ return Color._new_from_cdat...
def averagingData(array, windowSize=None, averagingType='median'): """#TODO: docstring :param array: #TODO: docstring :param windowSize: #TODO: docstring :param averagingType: "median" or "mean" :returns: #TODO: docstring """ assert averagingType in ['median', 'mean'] if windowSize is ...
def function[averagingData, parameter[array, windowSize, averagingType]]: constant[#TODO: docstring :param array: #TODO: docstring :param windowSize: #TODO: docstring :param averagingType: "median" or "mean" :returns: #TODO: docstring ] assert[compare[name[averagingType] in list[[<ast....
keyword[def] identifier[averagingData] ( identifier[array] , identifier[windowSize] = keyword[None] , identifier[averagingType] = literal[string] ): literal[string] keyword[assert] identifier[averagingType] keyword[in] [ literal[string] , literal[string] ] keyword[if] identifier[windowSize] keywor...
def averagingData(array, windowSize=None, averagingType='median'): """#TODO: docstring :param array: #TODO: docstring :param windowSize: #TODO: docstring :param averagingType: "median" or "mean" :returns: #TODO: docstring """ assert averagingType in ['median', 'mean'] if windowSize is ...
def _tokenize_mteval_13a(segment): r""" Tokenizes a string following the tokenizer in mteval-v13a.pl. See https://github.com/moses-smt/mosesdecoder/" "blob/master/scripts/generic/mteval-v14.pl#L917-L942 Parameters ---------- segment: str A string to be tokenized Returns ...
def function[_tokenize_mteval_13a, parameter[segment]]: constant[ Tokenizes a string following the tokenizer in mteval-v13a.pl. See https://github.com/moses-smt/mosesdecoder/" "blob/master/scripts/generic/mteval-v14.pl#L917-L942 Parameters ---------- segment: str A string ...
keyword[def] identifier[_tokenize_mteval_13a] ( identifier[segment] ): literal[string] identifier[norm] = identifier[segment] . identifier[rstrip] () identifier[norm] = identifier[norm] . identifier[replace] ( literal[string] , literal[string] ) identifier[norm] = identifier[norm] . identifier[...
def _tokenize_mteval_13a(segment): """ Tokenizes a string following the tokenizer in mteval-v13a.pl. See https://github.com/moses-smt/mosesdecoder/" "blob/master/scripts/generic/mteval-v14.pl#L917-L942 Parameters ---------- segment: str A string to be tokenized Returns ...
def get_ns_info_from_node_name(self, name, impl_node): """ Return a three-element tuple with the prefix, local name, and namespace URI for the given element/attribute name (in the context of the given node's hierarchy). If the name has no associated prefix or namespace informatio...
def function[get_ns_info_from_node_name, parameter[self, name, impl_node]]: constant[ Return a three-element tuple with the prefix, local name, and namespace URI for the given element/attribute name (in the context of the given node's hierarchy). If the name has no associated prefix or n...
keyword[def] identifier[get_ns_info_from_node_name] ( identifier[self] , identifier[name] , identifier[impl_node] ): literal[string] keyword[if] literal[string] keyword[in] identifier[name] : identifier[ns_uri] , identifier[name] = identifier[name] . identifier[split] ( literal[stri...
def get_ns_info_from_node_name(self, name, impl_node): """ Return a three-element tuple with the prefix, local name, and namespace URI for the given element/attribute name (in the context of the given node's hierarchy). If the name has no associated prefix or namespace information, N...
def __clean_dict(dictionary): """ Takes the dictionary from __parse_content() and creates a well formatted list :param dictionary: unformatted dict :returns: a list which contains dict's as it's elements """ key_dict = {} value_dict = {} final_list = [] ...
def function[__clean_dict, parameter[dictionary]]: constant[ Takes the dictionary from __parse_content() and creates a well formatted list :param dictionary: unformatted dict :returns: a list which contains dict's as it's elements ] variable[key_dict] assign[=] dictionar...
keyword[def] identifier[__clean_dict] ( identifier[dictionary] ): literal[string] identifier[key_dict] ={} identifier[value_dict] ={} identifier[final_list] =[] keyword[for] identifier[key] keyword[in] identifier[dictionary] . identifier[keys] (): identifi...
def __clean_dict(dictionary): """ Takes the dictionary from __parse_content() and creates a well formatted list :param dictionary: unformatted dict :returns: a list which contains dict's as it's elements """ key_dict = {} value_dict = {} final_list = [] for key in di...
def get_branch(self, i): """Gets a branch associated with leaf i. This will trace the tree from the leaves down to the root, constructing a list of tuples that represent the pairs of nodes all the way from leaf i to the root. :param i: the leaf identifying the branch to retrieve ...
def function[get_branch, parameter[self, i]]: constant[Gets a branch associated with leaf i. This will trace the tree from the leaves down to the root, constructing a list of tuples that represent the pairs of nodes all the way from leaf i to the root. :param i: the leaf identifying th...
keyword[def] identifier[get_branch] ( identifier[self] , identifier[i] ): literal[string] identifier[branch] = identifier[MerkleBranch] ( identifier[self] . identifier[order] ) identifier[j] = identifier[i] + literal[int] ** identifier[self] . identifier[order] - literal[int] ke...
def get_branch(self, i): """Gets a branch associated with leaf i. This will trace the tree from the leaves down to the root, constructing a list of tuples that represent the pairs of nodes all the way from leaf i to the root. :param i: the leaf identifying the branch to retrieve ""...
def add_local_charm(self, charm_file, series, size=None): """Upload a local charm archive to the model. Returns the 'local:...' url that should be used to deploy the charm. :param charm_file: Path to charm zip archive :param series: Charm series :param size: Size of the archive...
def function[add_local_charm, parameter[self, charm_file, series, size]]: constant[Upload a local charm archive to the model. Returns the 'local:...' url that should be used to deploy the charm. :param charm_file: Path to charm zip archive :param series: Charm series :param siz...
keyword[def] identifier[add_local_charm] ( identifier[self] , identifier[charm_file] , identifier[series] , identifier[size] = keyword[None] ): literal[string] identifier[conn] , identifier[headers] , identifier[path_prefix] = identifier[self] . identifier[connection] (). identifier[https_connectio...
def add_local_charm(self, charm_file, series, size=None): """Upload a local charm archive to the model. Returns the 'local:...' url that should be used to deploy the charm. :param charm_file: Path to charm zip archive :param series: Charm series :param size: Size of the archive, in...
def start_after(self, document_fields): """Start query after a cursor with this collection as parent. See :meth:`~.firestore_v1beta1.query.Query.start_after` for more information on this method. Args: document_fields (Union[~.firestore_v1beta1.\ docu...
def function[start_after, parameter[self, document_fields]]: constant[Start query after a cursor with this collection as parent. See :meth:`~.firestore_v1beta1.query.Query.start_after` for more information on this method. Args: document_fields (Union[~.firestore_v1b...
keyword[def] identifier[start_after] ( identifier[self] , identifier[document_fields] ): literal[string] identifier[query] = identifier[query_mod] . identifier[Query] ( identifier[self] ) keyword[return] identifier[query] . identifier[start_after] ( identifier[document_fields] )
def start_after(self, document_fields): """Start query after a cursor with this collection as parent. See :meth:`~.firestore_v1beta1.query.Query.start_after` for more information on this method. Args: document_fields (Union[~.firestore_v1beta1. document.D...
def editor_interfaces(self, space_id, environment_id, content_type_id): """ Provides access to editor interfaces management methods. API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/editor-interface :return: :class:`EditorInterface...
def function[editor_interfaces, parameter[self, space_id, environment_id, content_type_id]]: constant[ Provides access to editor interfaces management methods. API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/editor-interface :retu...
keyword[def] identifier[editor_interfaces] ( identifier[self] , identifier[space_id] , identifier[environment_id] , identifier[content_type_id] ): literal[string] keyword[return] identifier[EditorInterfacesProxy] ( identifier[self] , identifier[space_id] , identifier[environment_id] , identifier[...
def editor_interfaces(self, space_id, environment_id, content_type_id): """ Provides access to editor interfaces management methods. API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/editor-interface :return: :class:`EditorInterfacesPro...
def update_webhook_metadata(self, scaling_group, policy, webhook, metadata): """ Adds the given metadata dict to the existing metadata for the specified webhook. """ return self._manager.update_webhook_metadata(scaling_group, policy, webhook, metadata)
def function[update_webhook_metadata, parameter[self, scaling_group, policy, webhook, metadata]]: constant[ Adds the given metadata dict to the existing metadata for the specified webhook. ] return[call[name[self]._manager.update_webhook_metadata, parameter[name[scaling_group], name[...
keyword[def] identifier[update_webhook_metadata] ( identifier[self] , identifier[scaling_group] , identifier[policy] , identifier[webhook] , identifier[metadata] ): literal[string] keyword[return] identifier[self] . identifier[_manager] . identifier[update_webhook_metadata] ( identifier[scaling_gr...
def update_webhook_metadata(self, scaling_group, policy, webhook, metadata): """ Adds the given metadata dict to the existing metadata for the specified webhook. """ return self._manager.update_webhook_metadata(scaling_group, policy, webhook, metadata)