code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def match(self, f, *args): """Match grammar function 'f' against next token and set 'self.matched'. Arguments: f: A grammar function - see efilter.parsers.common.grammar. Must return TokenMatch or None. args: Passed to 'f', if any. Returns: I...
def function[match, parameter[self, f]]: constant[Match grammar function 'f' against next token and set 'self.matched'. Arguments: f: A grammar function - see efilter.parsers.common.grammar. Must return TokenMatch or None. args: Passed to 'f', if any. Re...
keyword[def] identifier[match] ( identifier[self] , identifier[f] ,* identifier[args] ): literal[string] keyword[try] : identifier[match] = identifier[f] ( identifier[self] . identifier[tokenizer] ,* identifier[args] ) keyword[except] identifier[StopIteration] : ...
def match(self, f, *args): """Match grammar function 'f' against next token and set 'self.matched'. Arguments: f: A grammar function - see efilter.parsers.common.grammar. Must return TokenMatch or None. args: Passed to 'f', if any. Returns: Insta...
def updateTrackerItem( self, point = None ): """ Updates the tracker item information. """ item = self.trackerItem() if not item: return gridRect = self._buildData.get('grid_rect') if ( not (gridRect and gridRect.isValid()) ...
def function[updateTrackerItem, parameter[self, point]]: constant[ Updates the tracker item information. ] variable[item] assign[=] call[name[self].trackerItem, parameter[]] if <ast.UnaryOp object at 0x7da20cabf400> begin[:] return[None] variable[gridRect] assign[...
keyword[def] identifier[updateTrackerItem] ( identifier[self] , identifier[point] = keyword[None] ): literal[string] identifier[item] = identifier[self] . identifier[trackerItem] () keyword[if] keyword[not] identifier[item] : keyword[return] identifier[gridR...
def updateTrackerItem(self, point=None): """ Updates the tracker item information. """ item = self.trackerItem() if not item: return # depends on [control=['if'], data=[]] gridRect = self._buildData.get('grid_rect') if not (gridRect and gridRect.isValid()): item.setV...
def icons(self, strip_ext=False): '''Get all icons in this DAP, optionally strip extensions''' result = [f for f in self._stripped_files if self._icons_pattern.match(f)] if strip_ext: result = [strip_suffix(f, '\.({ext})'.format(ext=self._icons_ext), regex=True) for f in result] ...
def function[icons, parameter[self, strip_ext]]: constant[Get all icons in this DAP, optionally strip extensions] variable[result] assign[=] <ast.ListComp object at 0x7da1b1025c60> if name[strip_ext] begin[:] variable[result] assign[=] <ast.ListComp object at 0x7da1b1152410> ...
keyword[def] identifier[icons] ( identifier[self] , identifier[strip_ext] = keyword[False] ): literal[string] identifier[result] =[ identifier[f] keyword[for] identifier[f] keyword[in] identifier[self] . identifier[_stripped_files] keyword[if] identifier[self] . identifier[_icons_pattern] . i...
def icons(self, strip_ext=False): """Get all icons in this DAP, optionally strip extensions""" result = [f for f in self._stripped_files if self._icons_pattern.match(f)] if strip_ext: result = [strip_suffix(f, '\\.({ext})'.format(ext=self._icons_ext), regex=True) for f in result] # depends on [cont...
def get_visualizations(): """Get the available visualizations from the request context. Put the visualizations in the request context if they are not yet there. Returns: :obj:`list` of instances of :class:`.BaseVisualization` or derived class """ if not hasattr(g, 'visualizations'...
def function[get_visualizations, parameter[]]: constant[Get the available visualizations from the request context. Put the visualizations in the request context if they are not yet there. Returns: :obj:`list` of instances of :class:`.BaseVisualization` or derived class ] i...
keyword[def] identifier[get_visualizations] (): literal[string] keyword[if] keyword[not] identifier[hasattr] ( identifier[g] , literal[string] ): identifier[g] . identifier[visualizations] ={} keyword[for] identifier[VisClass] keyword[in] identifier[_get_visualization_classes] (): ...
def get_visualizations(): """Get the available visualizations from the request context. Put the visualizations in the request context if they are not yet there. Returns: :obj:`list` of instances of :class:`.BaseVisualization` or derived class """ if not hasattr(g, 'visualizations'...
def get_limits(self, coord='data'): """Get the bounding box of the viewer extents. Returns ------- limits : tuple Bounding box in coordinates of type `coord` in the form of ``(ll_pt, ur_pt)``. """ limits = self.t_['limits'] if limits ...
def function[get_limits, parameter[self, coord]]: constant[Get the bounding box of the viewer extents. Returns ------- limits : tuple Bounding box in coordinates of type `coord` in the form of ``(ll_pt, ur_pt)``. ] variable[limits] assign[=] c...
keyword[def] identifier[get_limits] ( identifier[self] , identifier[coord] = literal[string] ): literal[string] identifier[limits] = identifier[self] . identifier[t_] [ literal[string] ] keyword[if] identifier[limits] keyword[is] keyword[None] : identifie...
def get_limits(self, coord='data'): """Get the bounding box of the viewer extents. Returns ------- limits : tuple Bounding box in coordinates of type `coord` in the form of ``(ll_pt, ur_pt)``. """ limits = self.t_['limits'] if limits is None: ...
def askretrycancel(title=None, message=None, **options): """Original doc: Ask if operation should be retried; return true if the answer is yes""" return psidialogs.ask_ok_cancel(title=title, message=message, ok='Retry')
def function[askretrycancel, parameter[title, message]]: constant[Original doc: Ask if operation should be retried; return true if the answer is yes] return[call[name[psidialogs].ask_ok_cancel, parameter[]]]
keyword[def] identifier[askretrycancel] ( identifier[title] = keyword[None] , identifier[message] = keyword[None] ,** identifier[options] ): literal[string] keyword[return] identifier[psidialogs] . identifier[ask_ok_cancel] ( identifier[title] = identifier[title] , identifier[message] = identifier[message...
def askretrycancel(title=None, message=None, **options): """Original doc: Ask if operation should be retried; return true if the answer is yes""" return psidialogs.ask_ok_cancel(title=title, message=message, ok='Retry')
def _get_basic_logger(loggername, log_to_file, logpath): """ Get a logger with our basic configuration done. :param loggername: Name of logger. :param log_to_file: Boolean, True if this logger should write a file. :return: Logger """ logger = logging.getLogger(loggername) logger.propaga...
def function[_get_basic_logger, parameter[loggername, log_to_file, logpath]]: constant[ Get a logger with our basic configuration done. :param loggername: Name of logger. :param log_to_file: Boolean, True if this logger should write a file. :return: Logger ] variable[logger] assign[...
keyword[def] identifier[_get_basic_logger] ( identifier[loggername] , identifier[log_to_file] , identifier[logpath] ): literal[string] identifier[logger] = identifier[logging] . identifier[getLogger] ( identifier[loggername] ) identifier[logger] . identifier[propagate] = keyword[False] identifie...
def _get_basic_logger(loggername, log_to_file, logpath): """ Get a logger with our basic configuration done. :param loggername: Name of logger. :param log_to_file: Boolean, True if this logger should write a file. :return: Logger """ logger = logging.getLogger(loggername) logger.propaga...
def datetime(self): """ Returns a datetime object representing the date the game was played. """ date_string = '%s %s %s' % (self._day, self._date, self._year) return datetime.strptime(date_string, '%a %B %d ...
def function[datetime, parameter[self]]: constant[ Returns a datetime object representing the date the game was played. ] variable[date_string] assign[=] binary_operation[constant[%s %s %s] <ast.Mod object at 0x7da2590d6920> tuple[[<ast.Attribute object at 0x7da1b0b37cd0>, <ast.Attribute...
keyword[def] identifier[datetime] ( identifier[self] ): literal[string] identifier[date_string] = literal[string] %( identifier[self] . identifier[_day] , identifier[self] . identifier[_date] , identifier[self] . identifier[_year] ) keyword[return] identifier[datetime] ....
def datetime(self): """ Returns a datetime object representing the date the game was played. """ date_string = '%s %s %s' % (self._day, self._date, self._year) return datetime.strptime(date_string, '%a %B %d %Y')
def child_added(self, child): """ Handle the child added event from the declaration. This handler will unparent the child toolkit widget. Subclasses which need more control should reimplement this method. """ super(UiKitView, self).child_added(child) widget = self.widg...
def function[child_added, parameter[self, child]]: constant[ Handle the child added event from the declaration. This handler will unparent the child toolkit widget. Subclasses which need more control should reimplement this method. ] call[call[name[super], parameter[name[UiKitV...
keyword[def] identifier[child_added] ( identifier[self] , identifier[child] ): literal[string] identifier[super] ( identifier[UiKitView] , identifier[self] ). identifier[child_added] ( identifier[child] ) identifier[widget] = identifier[self] . identifier[widget] keywor...
def child_added(self, child): """ Handle the child added event from the declaration. This handler will unparent the child toolkit widget. Subclasses which need more control should reimplement this method. """ super(UiKitView, self).child_added(child) widget = self.widget #: TOD...
def create_information_tear_sheet(factor_data, group_neutral=False, by_group=False): """ Creates a tear sheet for information analysis of a factor. Parameters ---------- factor_data : pd.DataFrame - MultiIndex A MultiIndex ...
def function[create_information_tear_sheet, parameter[factor_data, group_neutral, by_group]]: constant[ Creates a tear sheet for information analysis of a factor. Parameters ---------- factor_data : pd.DataFrame - MultiIndex A MultiIndex DataFrame indexed by date (level 0) and asset (le...
keyword[def] identifier[create_information_tear_sheet] ( identifier[factor_data] , identifier[group_neutral] = keyword[False] , identifier[by_group] = keyword[False] ): literal[string] identifier[ic] = identifier[perf] . identifier[factor_information_coefficient] ( identifier[factor_data] , identifier[g...
def create_information_tear_sheet(factor_data, group_neutral=False, by_group=False): """ Creates a tear sheet for information analysis of a factor. Parameters ---------- factor_data : pd.DataFrame - MultiIndex A MultiIndex DataFrame indexed by date (level 0) and asset (level 1), con...
def make_router(self, rule, method=None, handler=None, cls=None, name=None, **params): '''Create a new :class:`.Router` from a ``rule`` and parameters. This method is used during initialisation when building child Routers from the :attr:`rule_methods`. ''' cl...
def function[make_router, parameter[self, rule, method, handler, cls, name]]: constant[Create a new :class:`.Router` from a ``rule`` and parameters. This method is used during initialisation when building child Routers from the :attr:`rule_methods`. ] variable[cls] assign[=] <as...
keyword[def] identifier[make_router] ( identifier[self] , identifier[rule] , identifier[method] = keyword[None] , identifier[handler] = keyword[None] , identifier[cls] = keyword[None] , identifier[name] = keyword[None] ,** identifier[params] ): literal[string] identifier[cls] = identifier[cls] ke...
def make_router(self, rule, method=None, handler=None, cls=None, name=None, **params): """Create a new :class:`.Router` from a ``rule`` and parameters. This method is used during initialisation when building child Routers from the :attr:`rule_methods`. """ cls = cls or Router router...
def get(self, direction=NOMINAL, names=ALL, diff=False, factor=False): """ get(direction=NOMINAL, names=ALL, diff=False, factor=False) Returns different representations of the contained value(s). *direction* should be any of *NOMINAL*, *UP* or *DOWN*. When not *NOMINAL*, *names* decides which un...
def function[get, parameter[self, direction, names, diff, factor]]: constant[ get(direction=NOMINAL, names=ALL, diff=False, factor=False) Returns different representations of the contained value(s). *direction* should be any of *NOMINAL*, *UP* or *DOWN*. When not *NOMINAL*, *names* decides which...
keyword[def] identifier[get] ( identifier[self] , identifier[direction] = identifier[NOMINAL] , identifier[names] = identifier[ALL] , identifier[diff] = keyword[False] , identifier[factor] = keyword[False] ): literal[string] keyword[if] identifier[direction] == identifier[self] . identifier[NOMINA...
def get(self, direction=NOMINAL, names=ALL, diff=False, factor=False): """ get(direction=NOMINAL, names=ALL, diff=False, factor=False) Returns different representations of the contained value(s). *direction* should be any of *NOMINAL*, *UP* or *DOWN*. When not *NOMINAL*, *names* decides which uncert...
def registerevent(self, event_name, fn_name, *args): """ Register at-spi event @param event_name: Event name in at-spi format. @type event_name: string @param fn_name: Callback function @type fn_name: function @param *args: arguments to be passed to the callback ...
def function[registerevent, parameter[self, event_name, fn_name]]: constant[ Register at-spi event @param event_name: Event name in at-spi format. @type event_name: string @param fn_name: Callback function @type fn_name: function @param *args: arguments to be pas...
keyword[def] identifier[registerevent] ( identifier[self] , identifier[event_name] , identifier[fn_name] ,* identifier[args] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[event_name] , identifier[str] ): keyword[raise] identifier[ValueError] ( liter...
def registerevent(self, event_name, fn_name, *args): """ Register at-spi event @param event_name: Event name in at-spi format. @type event_name: string @param fn_name: Callback function @type fn_name: function @param *args: arguments to be passed to the callback func...
def make_user_list(self, emails, usernames): """ Given a list of emails and usernames fetch DukeDS user info. Parameters that are None will be skipped. :param emails: [str]: list of emails (can be null) :param usernames: [str]: list of usernames(netid) :return: [RemoteUs...
def function[make_user_list, parameter[self, emails, usernames]]: constant[ Given a list of emails and usernames fetch DukeDS user info. Parameters that are None will be skipped. :param emails: [str]: list of emails (can be null) :param usernames: [str]: list of usernames(netid)...
keyword[def] identifier[make_user_list] ( identifier[self] , identifier[emails] , identifier[usernames] ): literal[string] identifier[to_users] =[] identifier[remaining_emails] =[] keyword[if] keyword[not] identifier[emails] keyword[else] identifier[list] ( identifier[emails] ) ...
def make_user_list(self, emails, usernames): """ Given a list of emails and usernames fetch DukeDS user info. Parameters that are None will be skipped. :param emails: [str]: list of emails (can be null) :param usernames: [str]: list of usernames(netid) :return: [RemoteUser]:...
def unicode_wrapper(self, property, default=ugettext('Untitled')): """ Wrapper to allow for easy unicode representation of an object by the specified property. If this wrapper is not able to find the right translation of the specified property, it will return the default value in...
def function[unicode_wrapper, parameter[self, property, default]]: constant[ Wrapper to allow for easy unicode representation of an object by the specified property. If this wrapper is not able to find the right translation of the specified property, it will return the default va...
keyword[def] identifier[unicode_wrapper] ( identifier[self] , identifier[property] , identifier[default] = identifier[ugettext] ( literal[string] )): literal[string] keyword[try] : identifier[value] = identifier[getattr] ( identifier[self] , identifier[property] ) key...
def unicode_wrapper(self, property, default=ugettext('Untitled')): """ Wrapper to allow for easy unicode representation of an object by the specified property. If this wrapper is not able to find the right translation of the specified property, it will return the default value instea...
def print_results(distributions, list_all_files): """ Print the informations from installed distributions found. """ results_printed = False for dist in distributions: results_printed = True logger.info("---") logger.info("Metadata-Version: %s" % dist.get('metadata-version'))...
def function[print_results, parameter[distributions, list_all_files]]: constant[ Print the informations from installed distributions found. ] variable[results_printed] assign[=] constant[False] for taget[name[dist]] in starred[name[distributions]] begin[:] variable[result...
keyword[def] identifier[print_results] ( identifier[distributions] , identifier[list_all_files] ): literal[string] identifier[results_printed] = keyword[False] keyword[for] identifier[dist] keyword[in] identifier[distributions] : identifier[results_printed] = keyword[True] ident...
def print_results(distributions, list_all_files): """ Print the informations from installed distributions found. """ results_printed = False for dist in distributions: results_printed = True logger.info('---') logger.info('Metadata-Version: %s' % dist.get('metadata-version'))...
def goes_requires(self, regs): """ Returns whether any of the goes_to block requires any of the given registers. """ if len(self) and self.mem[-1].inst == 'call' and self.mem[-1].condition_flag is None: for block in self.calls: if block.is_used(regs, 0): ...
def function[goes_requires, parameter[self, regs]]: constant[ Returns whether any of the goes_to block requires any of the given registers. ] if <ast.BoolOp object at 0x7da1b26ad9c0> begin[:] for taget[name[block]] in starred[name[self].calls] begin[:] ...
keyword[def] identifier[goes_requires] ( identifier[self] , identifier[regs] ): literal[string] keyword[if] identifier[len] ( identifier[self] ) keyword[and] identifier[self] . identifier[mem] [- literal[int] ]. identifier[inst] == literal[string] keyword[and] identifier[self] . identifier[mem]...
def goes_requires(self, regs): """ Returns whether any of the goes_to block requires any of the given registers. """ if len(self) and self.mem[-1].inst == 'call' and (self.mem[-1].condition_flag is None): for block in self.calls: if block.is_used(regs, 0): ret...
def _config_getter(get_opt, key, value_regex=None, cwd=None, user=None, password=None, ignore_retcode=False, output_encoding=None, **kwargs): ''' Common code fo...
def function[_config_getter, parameter[get_opt, key, value_regex, cwd, user, password, ignore_retcode, output_encoding]]: constant[ Common code for config.get_* functions, builds and runs the git CLI command and returns the result dict for the calling function to parse. ] variable[kwargs] as...
keyword[def] identifier[_config_getter] ( identifier[get_opt] , identifier[key] , identifier[value_regex] = keyword[None] , identifier[cwd] = keyword[None] , identifier[user] = keyword[None] , identifier[password] = keyword[None] , identifier[ignore_retcode] = keyword[False] , identifier[output_encoding] = key...
def _config_getter(get_opt, key, value_regex=None, cwd=None, user=None, password=None, ignore_retcode=False, output_encoding=None, **kwargs): """ Common code for config.get_* functions, builds and runs the git CLI command and returns the result dict for the calling function to parse. """ kwargs = sa...
def present(name, params, static_host_list=True, **kwargs): ''' Creates Zabbix Template object or if differs update it according defined parameters. See Zabbix API documentation. Zabbix API version: >3.0 :param name: Zabbix Template name :param params: Additional parameters according to Zabbix API...
def function[present, parameter[name, params, static_host_list]]: constant[ Creates Zabbix Template object or if differs update it according defined parameters. See Zabbix API documentation. Zabbix API version: >3.0 :param name: Zabbix Template name :param params: Additional parameters accordi...
keyword[def] identifier[present] ( identifier[name] , identifier[params] , identifier[static_host_list] = keyword[True] ,** identifier[kwargs] ): literal[string] identifier[zabbix_id_mapper] = identifier[__salt__] [ literal[string] ]() identifier[dry_run] = identifier[__opts__] [ literal[string] ] ...
def present(name, params, static_host_list=True, **kwargs): """ Creates Zabbix Template object or if differs update it according defined parameters. See Zabbix API documentation. Zabbix API version: >3.0 :param name: Zabbix Template name :param params: Additional parameters according to Zabbix API...
def import_training_data(self, positive_corpus_file=os.path.join(os.path.dirname(__file__), "positive.txt"), negative_corpus_file=os.path.join(os.path.dirname(__file__), "negative.txt") ): """ This method imports the positive and negati...
def function[import_training_data, parameter[self, positive_corpus_file, negative_corpus_file]]: constant[ This method imports the positive and negative training data from the two corpus files and creates the training data list. ] variable[positive_corpus] assign[=] call[name[op...
keyword[def] identifier[import_training_data] ( identifier[self] , identifier[positive_corpus_file] = identifier[os] . identifier[path] . identifier[join] ( identifier[os] . identifier[path] . identifier[dirname] ( identifier[__file__] ), literal[string] ), identifier[negative_corpus_file] = identifier[os] . ident...
def import_training_data(self, positive_corpus_file=os.path.join(os.path.dirname(__file__), 'positive.txt'), negative_corpus_file=os.path.join(os.path.dirname(__file__), 'negative.txt')): """ This method imports the positive and negative training data from the two corpus files and creates the traini...
def _merge_perm(self, permission_name, view_menu_name): """ Add the new permission , view_menu to ab_permission_view_role if not exists. It will add the related entry to ab_permission and ab_view_menu two meta tables as well. :param permission_name: Name of the permission. ...
def function[_merge_perm, parameter[self, permission_name, view_menu_name]]: constant[ Add the new permission , view_menu to ab_permission_view_role if not exists. It will add the related entry to ab_permission and ab_view_menu two meta tables as well. :param permission_name: Na...
keyword[def] identifier[_merge_perm] ( identifier[self] , identifier[permission_name] , identifier[view_menu_name] ): literal[string] identifier[permission] = identifier[self] . identifier[find_permission] ( identifier[permission_name] ) identifier[view_menu] = identifier[self] . identifie...
def _merge_perm(self, permission_name, view_menu_name): """ Add the new permission , view_menu to ab_permission_view_role if not exists. It will add the related entry to ab_permission and ab_view_menu two meta tables as well. :param permission_name: Name of the permission. :...
def forward(self, x, mask): """Pass the input (and mask) through each layer in turn.""" all_layers = [] for layer in self.layers: x = layer(x, mask) if self.return_all_layers: all_layers.append(x) if self.return_all_layers: all_layers[...
def function[forward, parameter[self, x, mask]]: constant[Pass the input (and mask) through each layer in turn.] variable[all_layers] assign[=] list[[]] for taget[name[layer]] in starred[name[self].layers] begin[:] variable[x] assign[=] call[name[layer], parameter[name[x], name[m...
keyword[def] identifier[forward] ( identifier[self] , identifier[x] , identifier[mask] ): literal[string] identifier[all_layers] =[] keyword[for] identifier[layer] keyword[in] identifier[self] . identifier[layers] : identifier[x] = identifier[layer] ( identifier[x] , identi...
def forward(self, x, mask): """Pass the input (and mask) through each layer in turn.""" all_layers = [] for layer in self.layers: x = layer(x, mask) if self.return_all_layers: all_layers.append(x) # depends on [control=['if'], data=[]] # depends on [control=['for'], data=['laye...
def sector_shift(self): """ Property with current sector size shift. Actually sector size is 2 ** sector shift """ header = self.source.header return header.mini_sector_shift if self._is_mini \ else header.sector_shift
def function[sector_shift, parameter[self]]: constant[ Property with current sector size shift. Actually sector size is 2 ** sector shift ] variable[header] assign[=] name[self].source.header return[<ast.IfExp object at 0x7da1b0a65180>]
keyword[def] identifier[sector_shift] ( identifier[self] ): literal[string] identifier[header] = identifier[self] . identifier[source] . identifier[header] keyword[return] identifier[header] . identifier[mini_sector_shift] keyword[if] identifier[self] . identifier[_is_mini] keyword[el...
def sector_shift(self): """ Property with current sector size shift. Actually sector size is 2 ** sector shift """ header = self.source.header return header.mini_sector_shift if self._is_mini else header.sector_shift
def find_templates(self): """ Look for templates and extract the nodes containing the SASS file. """ paths = set() for loader in self.get_loaders(): try: module = import_module(loader.__module__) get_template_sources = getattr( ...
def function[find_templates, parameter[self]]: constant[ Look for templates and extract the nodes containing the SASS file. ] variable[paths] assign[=] call[name[set], parameter[]] for taget[name[loader]] in starred[call[name[self].get_loaders, parameter[]]] begin[:] <ast...
keyword[def] identifier[find_templates] ( identifier[self] ): literal[string] identifier[paths] = identifier[set] () keyword[for] identifier[loader] keyword[in] identifier[self] . identifier[get_loaders] (): keyword[try] : identifier[module] = identifier[im...
def find_templates(self): """ Look for templates and extract the nodes containing the SASS file. """ paths = set() for loader in self.get_loaders(): try: module = import_module(loader.__module__) get_template_sources = getattr(module, 'get_template_sources', l...
def escape(self, obj, mapping=None): """Escape whatever value you pass to it. Non-standard, for internal use; do not use this in your applications. """ if isinstance(obj, str_type): return "'" + self.escape_string(obj) + "'" if isinstance(obj, (bytes, bytearray)): ...
def function[escape, parameter[self, obj, mapping]]: constant[Escape whatever value you pass to it. Non-standard, for internal use; do not use this in your applications. ] if call[name[isinstance], parameter[name[obj], name[str_type]]] begin[:] return[binary_operation[binary_ope...
keyword[def] identifier[escape] ( identifier[self] , identifier[obj] , identifier[mapping] = keyword[None] ): literal[string] keyword[if] identifier[isinstance] ( identifier[obj] , identifier[str_type] ): keyword[return] literal[string] + identifier[self] . identifier[escape_string] ...
def escape(self, obj, mapping=None): """Escape whatever value you pass to it. Non-standard, for internal use; do not use this in your applications. """ if isinstance(obj, str_type): return "'" + self.escape_string(obj) + "'" # depends on [control=['if'], data=[]] if isinstance(obj,...
def get_fp_raw(): ''' 生成fp_raw_str ''' fp_file_path = os.path.expanduser('~/.xunleipy_fp') fp_list = [] try: with open(fp_file_path, 'r') as fp_file: fp_str = fp_file.readline() if len(fp_str) > 0: fp_list = fp_str.split('###') except IOErr...
def function[get_fp_raw, parameter[]]: constant[ 生成fp_raw_str ] variable[fp_file_path] assign[=] call[name[os].path.expanduser, parameter[constant[~/.xunleipy_fp]]] variable[fp_list] assign[=] list[[]] <ast.Try object at 0x7da18bc70670> if compare[call[name[len], paramete...
keyword[def] identifier[get_fp_raw] (): literal[string] identifier[fp_file_path] = identifier[os] . identifier[path] . identifier[expanduser] ( literal[string] ) identifier[fp_list] =[] keyword[try] : keyword[with] identifier[open] ( identifier[fp_file_path] , literal[string] ) keyword[...
def get_fp_raw(): """ 生成fp_raw_str """ fp_file_path = os.path.expanduser('~/.xunleipy_fp') fp_list = [] try: with open(fp_file_path, 'r') as fp_file: fp_str = fp_file.readline() if len(fp_str) > 0: fp_list = fp_str.split('###') # depends on [c...
def resolve_memory_access(self, tb, x86_mem_operand): """Return operand memory access translation. """ size = self.__get_memory_access_size(x86_mem_operand) addr = None if x86_mem_operand.base: addr = ReilRegisterOperand(x86_mem_operand.base, size) if x86_m...
def function[resolve_memory_access, parameter[self, tb, x86_mem_operand]]: constant[Return operand memory access translation. ] variable[size] assign[=] call[name[self].__get_memory_access_size, parameter[name[x86_mem_operand]]] variable[addr] assign[=] constant[None] if name[x86...
keyword[def] identifier[resolve_memory_access] ( identifier[self] , identifier[tb] , identifier[x86_mem_operand] ): literal[string] identifier[size] = identifier[self] . identifier[__get_memory_access_size] ( identifier[x86_mem_operand] ) identifier[addr] = keyword[None] keywor...
def resolve_memory_access(self, tb, x86_mem_operand): """Return operand memory access translation. """ size = self.__get_memory_access_size(x86_mem_operand) addr = None if x86_mem_operand.base: addr = ReilRegisterOperand(x86_mem_operand.base, size) # depends on [control=['if'], data=[]]...
def open(self) -> bool: """ This property is ``True`` when the connection is usable. It may be used to detect disconnections but this is discouraged per the EAFP_ principle. When ``open`` is ``False``, using the connection raises a :exc:`~websockets.exceptions.ConnectionClosed` ...
def function[open, parameter[self]]: constant[ This property is ``True`` when the connection is usable. It may be used to detect disconnections but this is discouraged per the EAFP_ principle. When ``open`` is ``False``, using the connection raises a :exc:`~websockets.exceptions...
keyword[def] identifier[open] ( identifier[self] )-> identifier[bool] : literal[string] keyword[return] identifier[self] . identifier[state] keyword[is] identifier[State] . identifier[OPEN] keyword[and] keyword[not] identifier[self] . identifier[transfer_data_task] . identifier[done] ()
def open(self) -> bool: """ This property is ``True`` when the connection is usable. It may be used to detect disconnections but this is discouraged per the EAFP_ principle. When ``open`` is ``False``, using the connection raises a :exc:`~websockets.exceptions.ConnectionClosed` exce...
def validate_password_strength(value): """Validates that a password is as least 7 characters long and has at least 1 digit and 1 letter. """ min_length = 7 if len(value) < min_length: raise ValidationError(_('Password must be at least {0} characters ' 'long.'...
def function[validate_password_strength, parameter[value]]: constant[Validates that a password is as least 7 characters long and has at least 1 digit and 1 letter. ] variable[min_length] assign[=] constant[7] if compare[call[name[len], parameter[name[value]]] less[<] name[min_length]] be...
keyword[def] identifier[validate_password_strength] ( identifier[value] ): literal[string] identifier[min_length] = literal[int] keyword[if] identifier[len] ( identifier[value] )< identifier[min_length] : keyword[raise] identifier[ValidationError] ( identifier[_] ( literal[string] ...
def validate_password_strength(value): """Validates that a password is as least 7 characters long and has at least 1 digit and 1 letter. """ min_length = 7 if len(value) < min_length: raise ValidationError(_('Password must be at least {0} characters long.').format(min_length)) # depends on ...
def init_datamembers(self, rec): """Initialize current GOTerm with data members for storing optional attributes.""" # pylint: disable=multiple-statements if 'synonym' in self.optional_attrs: rec.synonym = [] if 'xref' in self.optional_attrs: rec.xref = set() if 'subs...
def function[init_datamembers, parameter[self, rec]]: constant[Initialize current GOTerm with data members for storing optional attributes.] if compare[constant[synonym] in name[self].optional_attrs] begin[:] name[rec].synonym assign[=] list[[]] if compare[constant[xref] in name[...
keyword[def] identifier[init_datamembers] ( identifier[self] , identifier[rec] ): literal[string] keyword[if] literal[string] keyword[in] identifier[self] . identifier[optional_attrs] : identifier[rec] . identifier[synonym] =[] keyword[if] literal[string] keyword[in] identif...
def init_datamembers(self, rec): """Initialize current GOTerm with data members for storing optional attributes.""" # pylint: disable=multiple-statements if 'synonym' in self.optional_attrs: rec.synonym = [] # depends on [control=['if'], data=[]] if 'xref' in self.optional_attrs: rec.xr...
def _extract_lambda_function_code(resource_properties, code_property_key): """ Extracts the Lambda Function Code from the Resource Properties Parameters ---------- resource_properties dict Dictionary representing the Properties of the Resource code_property_k...
def function[_extract_lambda_function_code, parameter[resource_properties, code_property_key]]: constant[ Extracts the Lambda Function Code from the Resource Properties Parameters ---------- resource_properties dict Dictionary representing the Properties of the Resou...
keyword[def] identifier[_extract_lambda_function_code] ( identifier[resource_properties] , identifier[code_property_key] ): literal[string] identifier[codeuri] = identifier[resource_properties] . identifier[get] ( identifier[code_property_key] , identifier[SamFunctionProvider] . identifier[_DEFAUL...
def _extract_lambda_function_code(resource_properties, code_property_key): """ Extracts the Lambda Function Code from the Resource Properties Parameters ---------- resource_properties dict Dictionary representing the Properties of the Resource code_property_key s...
def warn_startup_with_shell_off(platform, gdb_args): """return True if user may need to turn shell off if mac OS version is 16 (sierra) or higher, may need to set shell off due to os's security requirements http://stackoverflow.com/questions/39702871/gdb-kind-of-doesnt-work-on-macos-sierra """ d...
def function[warn_startup_with_shell_off, parameter[platform, gdb_args]]: constant[return True if user may need to turn shell off if mac OS version is 16 (sierra) or higher, may need to set shell off due to os's security requirements http://stackoverflow.com/questions/39702871/gdb-kind-of-doesnt-wor...
keyword[def] identifier[warn_startup_with_shell_off] ( identifier[platform] , identifier[gdb_args] ): literal[string] identifier[darwin_match] = identifier[re] . identifier[match] ( literal[string] , identifier[platform] ) identifier[on_darwin] = identifier[darwin_match] keyword[is] keyword[not] ke...
def warn_startup_with_shell_off(platform, gdb_args): """return True if user may need to turn shell off if mac OS version is 16 (sierra) or higher, may need to set shell off due to os's security requirements http://stackoverflow.com/questions/39702871/gdb-kind-of-doesnt-work-on-macos-sierra """ d...
def physical_pin(self, function): """ Return the physical pin supporting the specified *function*. If no pins support the desired *function*, this function raises :exc:`PinNoPins`. If multiple pins support the desired *function*, :exc:`PinMultiplePins` will be raised (use :func:`...
def function[physical_pin, parameter[self, function]]: constant[ Return the physical pin supporting the specified *function*. If no pins support the desired *function*, this function raises :exc:`PinNoPins`. If multiple pins support the desired *function*, :exc:`PinMultiplePins` ...
keyword[def] identifier[physical_pin] ( identifier[self] , identifier[function] ): literal[string] identifier[result] = identifier[self] . identifier[physical_pins] ( identifier[function] ) keyword[if] identifier[len] ( identifier[result] )> literal[int] : keyword[raise] ide...
def physical_pin(self, function): """ Return the physical pin supporting the specified *function*. If no pins support the desired *function*, this function raises :exc:`PinNoPins`. If multiple pins support the desired *function*, :exc:`PinMultiplePins` will be raised (use :func:`phys...
def open(self): """ open: Opens zipfile to write to Args: None Returns: None """ self.zf = zipfile.ZipFile(self.write_to_path, self.mode)
def function[open, parameter[self]]: constant[ open: Opens zipfile to write to Args: None Returns: None ] name[self].zf assign[=] call[name[zipfile].ZipFile, parameter[name[self].write_to_path, name[self].mode]]
keyword[def] identifier[open] ( identifier[self] ): literal[string] identifier[self] . identifier[zf] = identifier[zipfile] . identifier[ZipFile] ( identifier[self] . identifier[write_to_path] , identifier[self] . identifier[mode] )
def open(self): """ open: Opens zipfile to write to Args: None Returns: None """ self.zf = zipfile.ZipFile(self.write_to_path, self.mode)
def in_simo_and_inner(self): """ Test if a node is simo: single input and multiple output """ return len(self.successor) > 1 and self.successor[0] is not None and not self.successor[0].in_or_out and \ len(self.precedence) == 1 and self.precedence[0] is not None and not sel...
def function[in_simo_and_inner, parameter[self]]: constant[ Test if a node is simo: single input and multiple output ] return[<ast.BoolOp object at 0x7da1b1d9a470>]
keyword[def] identifier[in_simo_and_inner] ( identifier[self] ): literal[string] keyword[return] identifier[len] ( identifier[self] . identifier[successor] )> literal[int] keyword[and] identifier[self] . identifier[successor] [ literal[int] ] keyword[is] keyword[not] keyword[None] keyword[and...
def in_simo_and_inner(self): """ Test if a node is simo: single input and multiple output """ return len(self.successor) > 1 and self.successor[0] is not None and (not self.successor[0].in_or_out) and (len(self.precedence) == 1) and (self.precedence[0] is not None) and (not self.successor[0].in_...
def embed_kernel(module=None, local_ns=None, **kwargs): """Embed and start an IPython kernel in a given scope. Parameters ---------- module : ModuleType, optional The module to load into IPython globals (default: caller) local_ns : dict, optional The namespace to load into IPyth...
def function[embed_kernel, parameter[module, local_ns]]: constant[Embed and start an IPython kernel in a given scope. Parameters ---------- module : ModuleType, optional The module to load into IPython globals (default: caller) local_ns : dict, optional The namespace to load...
keyword[def] identifier[embed_kernel] ( identifier[module] = keyword[None] , identifier[local_ns] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[IPKernelApp] . identifier[initialized] (): identifier[app] = identifier[IPKernelApp] . identifier[instance] () ...
def embed_kernel(module=None, local_ns=None, **kwargs): """Embed and start an IPython kernel in a given scope. Parameters ---------- module : ModuleType, optional The module to load into IPython globals (default: caller) local_ns : dict, optional The namespace to load into IPyth...
def delete(obj, key=None): """ Delete a single key if specified, or all env if key is none :param obj: settings object :param key: key to delete from store location :return: None """ client = StrictRedis(**obj.REDIS_FOR_DYNACONF) holder = obj.get("ENVVAR_PREFIX_FOR_DYNACONF") if key:...
def function[delete, parameter[obj, key]]: constant[ Delete a single key if specified, or all env if key is none :param obj: settings object :param key: key to delete from store location :return: None ] variable[client] assign[=] call[name[StrictRedis], parameter[]] variable[...
keyword[def] identifier[delete] ( identifier[obj] , identifier[key] = keyword[None] ): literal[string] identifier[client] = identifier[StrictRedis] (** identifier[obj] . identifier[REDIS_FOR_DYNACONF] ) identifier[holder] = identifier[obj] . identifier[get] ( literal[string] ) keyword[if] identi...
def delete(obj, key=None): """ Delete a single key if specified, or all env if key is none :param obj: settings object :param key: key to delete from store location :return: None """ client = StrictRedis(**obj.REDIS_FOR_DYNACONF) holder = obj.get('ENVVAR_PREFIX_FOR_DYNACONF') if key:...
def roughpage(request, url): """ Public interface to the rough page view. """ if settings.APPEND_SLASH and not url.endswith('/'): # redirect to the url which have end slash return redirect(url + '/', permanent=True) # get base filename from url filename = url_to_filename(url) ...
def function[roughpage, parameter[request, url]]: constant[ Public interface to the rough page view. ] if <ast.BoolOp object at 0x7da18eb56d10> begin[:] return[call[name[redirect], parameter[binary_operation[name[url] + constant[/]]]]] variable[filename] assign[=] call[name[url_t...
keyword[def] identifier[roughpage] ( identifier[request] , identifier[url] ): literal[string] keyword[if] identifier[settings] . identifier[APPEND_SLASH] keyword[and] keyword[not] identifier[url] . identifier[endswith] ( literal[string] ): keyword[return] identifier[redirect] ( identifie...
def roughpage(request, url): """ Public interface to the rough page view. """ if settings.APPEND_SLASH and (not url.endswith('/')): # redirect to the url which have end slash return redirect(url + '/', permanent=True) # depends on [control=['if'], data=[]] # get base filename from u...
def build(ctx): """Build documentation as HTML. The build HTML site is located in the ``doc/_build/html`` directory of the package. """ return_code = run_sphinx(ctx.obj['root_dir']) if return_code > 0: sys.exit(return_code)
def function[build, parameter[ctx]]: constant[Build documentation as HTML. The build HTML site is located in the ``doc/_build/html`` directory of the package. ] variable[return_code] assign[=] call[name[run_sphinx], parameter[call[name[ctx].obj][constant[root_dir]]]] if compare[name...
keyword[def] identifier[build] ( identifier[ctx] ): literal[string] identifier[return_code] = identifier[run_sphinx] ( identifier[ctx] . identifier[obj] [ literal[string] ]) keyword[if] identifier[return_code] > literal[int] : identifier[sys] . identifier[exit] ( identifier[return_code] )
def build(ctx): """Build documentation as HTML. The build HTML site is located in the ``doc/_build/html`` directory of the package. """ return_code = run_sphinx(ctx.obj['root_dir']) if return_code > 0: sys.exit(return_code) # depends on [control=['if'], data=['return_code']]
def get_plugin(self, service_provider=None, auth_url=None, plugins=None, **kwargs): """Authenticate using keystone to keystone federation. This plugin uses other v3 plugins to authenticate a user to a identity provider in order to authenticate the user to a service pr...
def function[get_plugin, parameter[self, service_provider, auth_url, plugins]]: constant[Authenticate using keystone to keystone federation. This plugin uses other v3 plugins to authenticate a user to a identity provider in order to authenticate the user to a service provider :...
keyword[def] identifier[get_plugin] ( identifier[self] , identifier[service_provider] = keyword[None] , identifier[auth_url] = keyword[None] , identifier[plugins] = keyword[None] , ** identifier[kwargs] ): literal[string] identifier[plugins] = identifier[plugins] keyword[or] [] ...
def get_plugin(self, service_provider=None, auth_url=None, plugins=None, **kwargs): """Authenticate using keystone to keystone federation. This plugin uses other v3 plugins to authenticate a user to a identity provider in order to authenticate the user to a service provider :param ...
def shutdown(self): """shutdown connection""" if self.verbose: print(self.socket.getsockname(), 'xx', self.peername) try: self.socket.shutdown(socket.SHUT_RDWR) except IOError as err: assert err.errno is _ENOTCONN, "unexpected IOError: %s" % err ...
def function[shutdown, parameter[self]]: constant[shutdown connection] if name[self].verbose begin[:] call[name[print], parameter[call[name[self].socket.getsockname, parameter[]], constant[xx], name[self].peername]] <ast.Try object at 0x7da1b0f3e620>
keyword[def] identifier[shutdown] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[verbose] : identifier[print] ( identifier[self] . identifier[socket] . identifier[getsockname] (), literal[string] , identifier[self] . identifier[peername] ) k...
def shutdown(self): """shutdown connection""" if self.verbose: print(self.socket.getsockname(), 'xx', self.peername) # depends on [control=['if'], data=[]] try: self.socket.shutdown(socket.SHUT_RDWR) # depends on [control=['try'], data=[]] except IOError as err: assert err.errn...
def list(ctx, show_hidden, oath_type, period): """ List all credentials. List all credentials stored on your YubiKey. """ ensure_validated(ctx) controller = ctx.obj['controller'] creds = [cred for cred in controller.list() if show_hidden or not cred.is_hidden ...
def function[list, parameter[ctx, show_hidden, oath_type, period]]: constant[ List all credentials. List all credentials stored on your YubiKey. ] call[name[ensure_validated], parameter[name[ctx]]] variable[controller] assign[=] call[name[ctx].obj][constant[controller]] vari...
keyword[def] identifier[list] ( identifier[ctx] , identifier[show_hidden] , identifier[oath_type] , identifier[period] ): literal[string] identifier[ensure_validated] ( identifier[ctx] ) identifier[controller] = identifier[ctx] . identifier[obj] [ literal[string] ] identifier[creds] =[ identifier...
def list(ctx, show_hidden, oath_type, period): """ List all credentials. List all credentials stored on your YubiKey. """ ensure_validated(ctx) controller = ctx.obj['controller'] creds = [cred for cred in controller.list() if show_hidden or not cred.is_hidden] creds.sort() for cred ...
def _onsuccess(self, result): """ To execute on execution success :param kser.result.Result result: Execution result :return: Execution result :rtype: kser.result.Result """ if KSER_METRICS_ENABLED == "yes": KSER_TASKS_STATUS.labels( __hostnam...
def function[_onsuccess, parameter[self, result]]: constant[ To execute on execution success :param kser.result.Result result: Execution result :return: Execution result :rtype: kser.result.Result ] if compare[name[KSER_METRICS_ENABLED] equal[==] constant[yes]] begin[:] ...
keyword[def] identifier[_onsuccess] ( identifier[self] , identifier[result] ): literal[string] keyword[if] identifier[KSER_METRICS_ENABLED] == literal[string] : identifier[KSER_TASKS_STATUS] . identifier[labels] ( identifier[__hostname__] , identifier[self] . identifier[_...
def _onsuccess(self, result): """ To execute on execution success :param kser.result.Result result: Execution result :return: Execution result :rtype: kser.result.Result """ if KSER_METRICS_ENABLED == 'yes': KSER_TASKS_STATUS.labels(__hostname__, self.__class__.path, 'SU...
def create_new_csv(samples, args): """create csv file that can be use with bcbio -w template""" out_fn = os.path.splitext(args.csv)[0] + "-merged.csv" logger.info("Preparing new csv: %s" % out_fn) with file_transaction(out_fn) as tx_out: with open(tx_out, 'w') as handle: handle.write...
def function[create_new_csv, parameter[samples, args]]: constant[create csv file that can be use with bcbio -w template] variable[out_fn] assign[=] binary_operation[call[call[name[os].path.splitext, parameter[name[args].csv]]][constant[0]] + constant[-merged.csv]] call[name[logger].info, paramet...
keyword[def] identifier[create_new_csv] ( identifier[samples] , identifier[args] ): literal[string] identifier[out_fn] = identifier[os] . identifier[path] . identifier[splitext] ( identifier[args] . identifier[csv] )[ literal[int] ]+ literal[string] identifier[logger] . identifier[info] ( literal[str...
def create_new_csv(samples, args): """create csv file that can be use with bcbio -w template""" out_fn = os.path.splitext(args.csv)[0] + '-merged.csv' logger.info('Preparing new csv: %s' % out_fn) with file_transaction(out_fn) as tx_out: with open(tx_out, 'w') as handle: handle.write...
def hide(self): """ Call `hide_all()` on all known top widgets. """ top = self.get_top_widget() if isinstance(top, (list, tuple)): for t in top: if t is not None: t.hide_all() elif top is not None: top.hide_all()
def function[hide, parameter[self]]: constant[ Call `hide_all()` on all known top widgets. ] variable[top] assign[=] call[name[self].get_top_widget, parameter[]] if call[name[isinstance], parameter[name[top], tuple[[<ast.Name object at 0x7da1b14383d0>, <ast.Name object at 0x7da1b...
keyword[def] identifier[hide] ( identifier[self] ): literal[string] identifier[top] = identifier[self] . identifier[get_top_widget] () keyword[if] identifier[isinstance] ( identifier[top] ,( identifier[list] , identifier[tuple] )): keyword[for] identifier[t] keyword[in] id...
def hide(self): """ Call `hide_all()` on all known top widgets. """ top = self.get_top_widget() if isinstance(top, (list, tuple)): for t in top: if t is not None: t.hide_all() # depends on [control=['if'], data=['t']] # depends on [control=['for'], data=...
def import_model(self, source): """Import and return model instance.""" model = super(NonstrictImporter, self).import_model(source) sbml.convert_sbml_model(model) return model
def function[import_model, parameter[self, source]]: constant[Import and return model instance.] variable[model] assign[=] call[call[name[super], parameter[name[NonstrictImporter], name[self]]].import_model, parameter[name[source]]] call[name[sbml].convert_sbml_model, parameter[name[model]]] ...
keyword[def] identifier[import_model] ( identifier[self] , identifier[source] ): literal[string] identifier[model] = identifier[super] ( identifier[NonstrictImporter] , identifier[self] ). identifier[import_model] ( identifier[source] ) identifier[sbml] . identifier[convert_sbml_model] ( i...
def import_model(self, source): """Import and return model instance.""" model = super(NonstrictImporter, self).import_model(source) sbml.convert_sbml_model(model) return model
def template(self, resources): """ Get the template from: YAML, hierarchy, or class """ template_name = self.acquire(resources, 'template') if template_name: return template_name else: # We're putting an exception for "resource", the built-in # rtype/...
def function[template, parameter[self, resources]]: constant[ Get the template from: YAML, hierarchy, or class ] variable[template_name] assign[=] call[name[self].acquire, parameter[name[resources], constant[template]]] if name[template_name] begin[:] return[name[template_name]]
keyword[def] identifier[template] ( identifier[self] , identifier[resources] ): literal[string] identifier[template_name] = identifier[self] . identifier[acquire] ( identifier[resources] , literal[string] ) keyword[if] identifier[template_name] : keyword[return] identifier[...
def template(self, resources): """ Get the template from: YAML, hierarchy, or class """ template_name = self.acquire(resources, 'template') if template_name: return template_name # depends on [control=['if'], data=[]] # We're putting an exception for "resource", the built-in # rtype/directi...
def label_from_re(self, pat:str, full_path:bool=False, label_cls:Callable=None, **kwargs)->'LabelList': "Apply the re in `pat` to determine the label of every filename. If `full_path`, search in the full name." pat = re.compile(pat) def _inner(o): s = str((os.path.join(self.path,o) ...
def function[label_from_re, parameter[self, pat, full_path, label_cls]]: constant[Apply the re in `pat` to determine the label of every filename. If `full_path`, search in the full name.] variable[pat] assign[=] call[name[re].compile, parameter[name[pat]]] def function[_inner, parameter[o]]: ...
keyword[def] identifier[label_from_re] ( identifier[self] , identifier[pat] : identifier[str] , identifier[full_path] : identifier[bool] = keyword[False] , identifier[label_cls] : identifier[Callable] = keyword[None] ,** identifier[kwargs] )-> literal[string] : literal[string] identifier[pat] = ide...
def label_from_re(self, pat: str, full_path: bool=False, label_cls: Callable=None, **kwargs) -> 'LabelList': """Apply the re in `pat` to determine the label of every filename. If `full_path`, search in the full name.""" pat = re.compile(pat) def _inner(o): s = str((os.path.join(self.path, o) if fu...
def filter(self, relation_id=None, duedate__lt=None, duedate__gte=None, **kwargs): """ A common query would be duedate__lt=date(2015, 1, 1) to get all Receivables that are due in 2014 and earlier. """ if relation_id is not None: # Filter by (relation) a...
def function[filter, parameter[self, relation_id, duedate__lt, duedate__gte]]: constant[ A common query would be duedate__lt=date(2015, 1, 1) to get all Receivables that are due in 2014 and earlier. ] if compare[name[relation_id] is_not constant[None]] begin[:] va...
keyword[def] identifier[filter] ( identifier[self] , identifier[relation_id] = keyword[None] , identifier[duedate__lt] = keyword[None] , identifier[duedate__gte] = keyword[None] , ** identifier[kwargs] ): literal[string] keyword[if] identifier[relation_id] keyword[is] keyword[not] keyword[None]...
def filter(self, relation_id=None, duedate__lt=None, duedate__gte=None, **kwargs): """ A common query would be duedate__lt=date(2015, 1, 1) to get all Receivables that are due in 2014 and earlier. """ if relation_id is not None: # Filter by (relation) account_id. There doesn't se...
def lineEdit(self): """ Returns the line editor associated with this combobox. This will return the object stored at the reference for the editor since sometimes the internal Qt process will raise a RuntimeError that the C/C++ object has been deleted. :return ...
def function[lineEdit, parameter[self]]: constant[ Returns the line editor associated with this combobox. This will return the object stored at the reference for the editor since sometimes the internal Qt process will raise a RuntimeError that the C/C++ object has been deleted. ...
keyword[def] identifier[lineEdit] ( identifier[self] ): literal[string] keyword[try] : identifier[edit] = identifier[self] . identifier[_lineEdit] () keyword[except] identifier[TypeError] : identifier[edit] = keyword[None] keyword[if] identifier[edit]...
def lineEdit(self): """ Returns the line editor associated with this combobox. This will return the object stored at the reference for the editor since sometimes the internal Qt process will raise a RuntimeError that the C/C++ object has been deleted. :return <X...
def ftpparse (line): """Parse a FTP list line into a dictionary with attributes: name - name of file (string) trycwd - False if cwd is definitely pointless, True otherwise tryretr - False if retr is definitely pointless, True otherwise If the line has no file information, None is returned """ ...
def function[ftpparse, parameter[line]]: constant[Parse a FTP list line into a dictionary with attributes: name - name of file (string) trycwd - False if cwd is definitely pointless, True otherwise tryretr - False if retr is definitely pointless, True otherwise If the line has no file informati...
keyword[def] identifier[ftpparse] ( identifier[line] ): literal[string] keyword[if] identifier[len] ( identifier[line] )< literal[int] : keyword[return] keyword[None] identifier[info] = identifier[dict] ( identifier[name] = keyword[None] , identifier[trycwd] = keyword[False] , identif...
def ftpparse(line): """Parse a FTP list line into a dictionary with attributes: name - name of file (string) trycwd - False if cwd is definitely pointless, True otherwise tryretr - False if retr is definitely pointless, True otherwise If the line has no file information, None is returned """ ...
def load_graphml(filename, folder=None, node_type=int): """ Load a GraphML file from disk and convert the node/edge attributes to correct data types. Parameters ---------- filename : string the name of the graphml file (including file extension) folder : string the folder co...
def function[load_graphml, parameter[filename, folder, node_type]]: constant[ Load a GraphML file from disk and convert the node/edge attributes to correct data types. Parameters ---------- filename : string the name of the graphml file (including file extension) folder : string...
keyword[def] identifier[load_graphml] ( identifier[filename] , identifier[folder] = keyword[None] , identifier[node_type] = identifier[int] ): literal[string] identifier[start_time] = identifier[time] . identifier[time] () keyword[if] identifier[folder] keyword[is] keyword[None] : id...
def load_graphml(filename, folder=None, node_type=int): """ Load a GraphML file from disk and convert the node/edge attributes to correct data types. Parameters ---------- filename : string the name of the graphml file (including file extension) folder : string the folder co...
def run(self, cmd): """Similar to profile.Profile.run .""" import __main__ dikt = __main__.__dict__ return self.runctx(cmd, dikt, dikt)
def function[run, parameter[self, cmd]]: constant[Similar to profile.Profile.run .] import module[__main__] variable[dikt] assign[=] name[__main__].__dict__ return[call[name[self].runctx, parameter[name[cmd], name[dikt], name[dikt]]]]
keyword[def] identifier[run] ( identifier[self] , identifier[cmd] ): literal[string] keyword[import] identifier[__main__] identifier[dikt] = identifier[__main__] . identifier[__dict__] keyword[return] identifier[self] . identifier[runctx] ( identifier[cmd] , identifier[dikt] ,...
def run(self, cmd): """Similar to profile.Profile.run .""" import __main__ dikt = __main__.__dict__ return self.runctx(cmd, dikt, dikt)
def run_command(self, args: List[str], max_num_processes: int=None, max_stack_size: int=None, max_virtual_memory: int=None, as_root: bool=False, stdin: FileIO=None, timeout: int=No...
def function[run_command, parameter[self, args, max_num_processes, max_stack_size, max_virtual_memory, as_root, stdin, timeout, check, truncate_stdout, truncate_stderr]]: constant[ Runs a command inside the sandbox and returns the results. :param args: A list of strings that specify which comma...
keyword[def] identifier[run_command] ( identifier[self] , identifier[args] : identifier[List] [ identifier[str] ], identifier[max_num_processes] : identifier[int] = keyword[None] , identifier[max_stack_size] : identifier[int] = keyword[None] , identifier[max_virtual_memory] : identifier[int] = keyword[None] , id...
def run_command(self, args: List[str], max_num_processes: int=None, max_stack_size: int=None, max_virtual_memory: int=None, as_root: bool=False, stdin: FileIO=None, timeout: int=None, check: bool=False, truncate_stdout: int=None, truncate_stderr: int=None) -> 'CompletedCommand': """ Runs a command inside th...
def keys(self, desc = None): '''numpy asarray does not copy data''' res = asarray(self.rc('index')) if desc == True: return reversed(res) else: return res
def function[keys, parameter[self, desc]]: constant[numpy asarray does not copy data] variable[res] assign[=] call[name[asarray], parameter[call[name[self].rc, parameter[constant[index]]]]] if compare[name[desc] equal[==] constant[True]] begin[:] return[call[name[reversed], parameter[nam...
keyword[def] identifier[keys] ( identifier[self] , identifier[desc] = keyword[None] ): literal[string] identifier[res] = identifier[asarray] ( identifier[self] . identifier[rc] ( literal[string] )) keyword[if] identifier[desc] == keyword[True] : keyword[return] identifie...
def keys(self, desc=None): """numpy asarray does not copy data""" res = asarray(self.rc('index')) if desc == True: return reversed(res) # depends on [control=['if'], data=[]] else: return res
def generate_matrices(dim = 40): """ Generates the matrices that positive and negative samples are multiplied with. The matrix for positive samples is randomly drawn from a uniform distribution, with elements in [-1, 1]. The matrix for negative examples is the sum of the positive matrix with a matrix drawn ...
def function[generate_matrices, parameter[dim]]: constant[ Generates the matrices that positive and negative samples are multiplied with. The matrix for positive samples is randomly drawn from a uniform distribution, with elements in [-1, 1]. The matrix for negative examples is the sum of the positive...
keyword[def] identifier[generate_matrices] ( identifier[dim] = literal[int] ): literal[string] identifier[positive] = identifier[numpy] . identifier[random] . identifier[uniform] (- literal[int] , literal[int] ,( identifier[dim] , identifier[dim] )) identifier[negative] = identifier[positive] + identifier[n...
def generate_matrices(dim=40): """ Generates the matrices that positive and negative samples are multiplied with. The matrix for positive samples is randomly drawn from a uniform distribution, with elements in [-1, 1]. The matrix for negative examples is the sum of the positive matrix with a matrix drawn ...
def save_config(self, cmd="write memory", confirm=False, confirm_response=""): """Saves configuration.""" return super(UbiquitiEdgeSSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
def function[save_config, parameter[self, cmd, confirm, confirm_response]]: constant[Saves configuration.] return[call[call[name[super], parameter[name[UbiquitiEdgeSSH], name[self]]].save_config, parameter[]]]
keyword[def] identifier[save_config] ( identifier[self] , identifier[cmd] = literal[string] , identifier[confirm] = keyword[False] , identifier[confirm_response] = literal[string] ): literal[string] keyword[return] identifier[super] ( identifier[UbiquitiEdgeSSH] , identifier[self] ). identifier[sa...
def save_config(self, cmd='write memory', confirm=False, confirm_response=''): """Saves configuration.""" return super(UbiquitiEdgeSSH, self).save_config(cmd=cmd, confirm=confirm, confirm_response=confirm_response)
def Scripts(unicode_dir=_UNICODE_DIR): """Returns dict mapping script names to code lists. Args: unicode_dir: Unicode data directory Returns: dict mapping script names to code lists """ scripts = {} def DoLine(codes, fields): """Process single Scripts.txt line, updating scripts.""" (_, n...
def function[Scripts, parameter[unicode_dir]]: constant[Returns dict mapping script names to code lists. Args: unicode_dir: Unicode data directory Returns: dict mapping script names to code lists ] variable[scripts] assign[=] dictionary[[], []] def function[DoLine, parameter[code...
keyword[def] identifier[Scripts] ( identifier[unicode_dir] = identifier[_UNICODE_DIR] ): literal[string] identifier[scripts] ={} keyword[def] identifier[DoLine] ( identifier[codes] , identifier[fields] ): literal[string] ( identifier[_] , identifier[name] )= identifier[fields] identifier[...
def Scripts(unicode_dir=_UNICODE_DIR): """Returns dict mapping script names to code lists. Args: unicode_dir: Unicode data directory Returns: dict mapping script names to code lists """ scripts = {} def DoLine(codes, fields): """Process single Scripts.txt line, updating scripts.""" ...
def reset(c7n_async=None): """Delete all persistent cluster state. """ click.echo('Delete db? Are you Sure? [yn] ', nl=False) c = click.getchar() click.echo() if c == 'y': click.echo('Wiping database') worker.connection.flushdb() elif c == 'n': click.echo('Abort!') ...
def function[reset, parameter[c7n_async]]: constant[Delete all persistent cluster state. ] call[name[click].echo, parameter[constant[Delete db? Are you Sure? [yn] ]]] variable[c] assign[=] call[name[click].getchar, parameter[]] call[name[click].echo, parameter[]] if compare[n...
keyword[def] identifier[reset] ( identifier[c7n_async] = keyword[None] ): literal[string] identifier[click] . identifier[echo] ( literal[string] , identifier[nl] = keyword[False] ) identifier[c] = identifier[click] . identifier[getchar] () identifier[click] . identifier[echo] () keyword[if] ...
def reset(c7n_async=None): """Delete all persistent cluster state. """ click.echo('Delete db? Are you Sure? [yn] ', nl=False) c = click.getchar() click.echo() if c == 'y': click.echo('Wiping database') worker.connection.flushdb() # depends on [control=['if'], data=[]] elif c...
def remove(self, key): """ Transactional implementation of :func:`Map.remove(key) <hazelcast.proxy.map.Map.remove>` The object to be removed will be removed from only the current transaction context until the transaction is committed. :param key: (object), key of the mapping to...
def function[remove, parameter[self, key]]: constant[ Transactional implementation of :func:`Map.remove(key) <hazelcast.proxy.map.Map.remove>` The object to be removed will be removed from only the current transaction context until the transaction is committed. :param key: (obj...
keyword[def] identifier[remove] ( identifier[self] , identifier[key] ): literal[string] identifier[check_not_none] ( identifier[key] , literal[string] ) keyword[return] identifier[self] . identifier[_encode_invoke] ( identifier[transactional_map_remove_codec] , identifier[key] = identifie...
def remove(self, key): """ Transactional implementation of :func:`Map.remove(key) <hazelcast.proxy.map.Map.remove>` The object to be removed will be removed from only the current transaction context until the transaction is committed. :param key: (object), key of the mapping to be ...
def sense(self): """ Launches a few "sensing" commands such as 'ls', or 'pwd' and updates the current bait state. """ cmd_name = random.choice(self.senses) command = getattr(self, cmd_name) self.state['last_command'] = cmd_name command()
def function[sense, parameter[self]]: constant[ Launches a few "sensing" commands such as 'ls', or 'pwd' and updates the current bait state. ] variable[cmd_name] assign[=] call[name[random].choice, parameter[name[self].senses]] variable[command] assign[=] call[nam...
keyword[def] identifier[sense] ( identifier[self] ): literal[string] identifier[cmd_name] = identifier[random] . identifier[choice] ( identifier[self] . identifier[senses] ) identifier[command] = identifier[getattr] ( identifier[self] , identifier[cmd_name] ) identifier[self] . id...
def sense(self): """ Launches a few "sensing" commands such as 'ls', or 'pwd' and updates the current bait state. """ cmd_name = random.choice(self.senses) command = getattr(self, cmd_name) self.state['last_command'] = cmd_name command()
def show_vcs_output_vcs_nodes_vcs_node_info_node_switch_subtype(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") show_vcs = ET.Element("show_vcs") config = show_vcs output = ET.SubElement(show_vcs, "output") vcs_nodes = ET.SubElement(outpu...
def function[show_vcs_output_vcs_nodes_vcs_node_info_node_switch_subtype, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[show_vcs] assign[=] call[name[ET].Element, parameter[constant[show_vcs]]] ...
keyword[def] identifier[show_vcs_output_vcs_nodes_vcs_node_info_node_switch_subtype] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[show_vcs] = identifier[ET] . identifier[Element] ( lite...
def show_vcs_output_vcs_nodes_vcs_node_info_node_switch_subtype(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') show_vcs = ET.Element('show_vcs') config = show_vcs output = ET.SubElement(show_vcs, 'output') vcs_nodes = ET.SubElement(output, 'vcs-nodes') vcs_...
def generate_payload(self, config, context): """ Generate payload by checking Django request object. :param context: current context. :param config: honeybadger configuration. :return: a dict with the generated payload. """ request = current_request() pay...
def function[generate_payload, parameter[self, config, context]]: constant[ Generate payload by checking Django request object. :param context: current context. :param config: honeybadger configuration. :return: a dict with the generated payload. ] variable[reques...
keyword[def] identifier[generate_payload] ( identifier[self] , identifier[config] , identifier[context] ): literal[string] identifier[request] = identifier[current_request] () identifier[payload] ={ literal[string] : identifier[request] . identifier[build_absolute_uri] (), ...
def generate_payload(self, config, context): """ Generate payload by checking Django request object. :param context: current context. :param config: honeybadger configuration. :return: a dict with the generated payload. """ request = current_request() payload = {'url'...
def sg_max(tensor, opt): r"""Computes the maximum of elements across axis of a tensor. See `tf.reduce_max()` in tensorflow. Args: tensor: A `Tensor` (automatically given by chain). opt: axis : A tuple/list of integers or an integer. The axis to reduce. keep_dims: If true, retai...
def function[sg_max, parameter[tensor, opt]]: constant[Computes the maximum of elements across axis of a tensor. See `tf.reduce_max()` in tensorflow. Args: tensor: A `Tensor` (automatically given by chain). opt: axis : A tuple/list of integers or an integer. The axis to reduce. ...
keyword[def] identifier[sg_max] ( identifier[tensor] , identifier[opt] ): literal[string] keyword[return] identifier[tf] . identifier[reduce_max] ( identifier[tensor] , identifier[axis] = identifier[opt] . identifier[axis] , identifier[keep_dims] = identifier[opt] . identifier[keep_dims] , identifier[name...
def sg_max(tensor, opt): """Computes the maximum of elements across axis of a tensor. See `tf.reduce_max()` in tensorflow. Args: tensor: A `Tensor` (automatically given by chain). opt: axis : A tuple/list of integers or an integer. The axis to reduce. keep_dims: If true, retain...
def clear(self): """Remove all nodes and edges from the graph. Unlike the regular networkx implementation, this does *not* remove the graph's name. But all the other graph, node, and edge attributes go away. """ self.adj.clear() self.node.clear() self.gr...
def function[clear, parameter[self]]: constant[Remove all nodes and edges from the graph. Unlike the regular networkx implementation, this does *not* remove the graph's name. But all the other graph, node, and edge attributes go away. ] call[name[self].adj.clear, parame...
keyword[def] identifier[clear] ( identifier[self] ): literal[string] identifier[self] . identifier[adj] . identifier[clear] () identifier[self] . identifier[node] . identifier[clear] () identifier[self] . identifier[graph] . identifier[clear] ()
def clear(self): """Remove all nodes and edges from the graph. Unlike the regular networkx implementation, this does *not* remove the graph's name. But all the other graph, node, and edge attributes go away. """ self.adj.clear() self.node.clear() self.graph.clear()
def post_public(self, path, data, is_json=True): '''Make a post request requiring no auth.''' return self._post(path, data, is_json)
def function[post_public, parameter[self, path, data, is_json]]: constant[Make a post request requiring no auth.] return[call[name[self]._post, parameter[name[path], name[data], name[is_json]]]]
keyword[def] identifier[post_public] ( identifier[self] , identifier[path] , identifier[data] , identifier[is_json] = keyword[True] ): literal[string] keyword[return] identifier[self] . identifier[_post] ( identifier[path] , identifier[data] , identifier[is_json] )
def post_public(self, path, data, is_json=True): """Make a post request requiring no auth.""" return self._post(path, data, is_json)
def _check_pool_attr(self, attr, req_attr=None): """ Check pool attributes. """ if req_attr is None: req_attr = [] # check attribute names self._check_attr(attr, req_attr, _pool_attrs) # validate IPv4 prefix length if attr.get('ipv4_default_prefix_l...
def function[_check_pool_attr, parameter[self, attr, req_attr]]: constant[ Check pool attributes. ] if compare[name[req_attr] is constant[None]] begin[:] variable[req_attr] assign[=] list[[]] call[name[self]._check_attr, parameter[name[attr], name[req_attr], name[_pool_at...
keyword[def] identifier[_check_pool_attr] ( identifier[self] , identifier[attr] , identifier[req_attr] = keyword[None] ): literal[string] keyword[if] identifier[req_attr] keyword[is] keyword[None] : identifier[req_attr] =[] identifier[self] . identifier[_chec...
def _check_pool_attr(self, attr, req_attr=None): """ Check pool attributes. """ if req_attr is None: req_attr = [] # depends on [control=['if'], data=['req_attr']] # check attribute names self._check_attr(attr, req_attr, _pool_attrs) # validate IPv4 prefix length if attr.get('ip...
def cache(): """Returns a 304 if an If-Modified-Since header or If-None-Match is present. Returns the same as a GET otherwise. --- tags: - Response inspection parameters: - in: header name: If-Modified-Since - in: header name: If-None-Match produces: - applica...
def function[cache, parameter[]]: constant[Returns a 304 if an If-Modified-Since header or If-None-Match is present. Returns the same as a GET otherwise. --- tags: - Response inspection parameters: - in: header name: If-Modified-Since - in: header name: If-None-Matc...
keyword[def] identifier[cache] (): literal[string] identifier[is_conditional] = identifier[request] . identifier[headers] . identifier[get] ( literal[string] ) keyword[or] identifier[request] . identifier[headers] . identifier[get] ( literal[string] ) keyword[if] identifier[is_conditional...
def cache(): """Returns a 304 if an If-Modified-Since header or If-None-Match is present. Returns the same as a GET otherwise. --- tags: - Response inspection parameters: - in: header name: If-Modified-Since - in: header name: If-None-Match produces: - applica...
def info(self, category_id, store_view=None, attributes=None): """ Retrieve Category details :param category_id: ID of category to retrieve :param store_view: Store view ID or code :param attributes: Return the fields specified :return: Dictionary of data """ ...
def function[info, parameter[self, category_id, store_view, attributes]]: constant[ Retrieve Category details :param category_id: ID of category to retrieve :param store_view: Store view ID or code :param attributes: Return the fields specified :return: Dictionary of dat...
keyword[def] identifier[info] ( identifier[self] , identifier[category_id] , identifier[store_view] = keyword[None] , identifier[attributes] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[call] ( literal[string] ,[ identifier[category_id] , identifier[sto...
def info(self, category_id, store_view=None, attributes=None): """ Retrieve Category details :param category_id: ID of category to retrieve :param store_view: Store view ID or code :param attributes: Return the fields specified :return: Dictionary of data """ ret...
def from_rectilinear(cls, x, y, z, formatter=numpy_formatter): """Construct a contour generator from a rectilinear grid. Parameters ---------- x : array_like x coordinates of each column of `z`. Must be the same length as the number of columns in `z`. (len(x) =...
def function[from_rectilinear, parameter[cls, x, y, z, formatter]]: constant[Construct a contour generator from a rectilinear grid. Parameters ---------- x : array_like x coordinates of each column of `z`. Must be the same length as the number of columns in `z`....
keyword[def] identifier[from_rectilinear] ( identifier[cls] , identifier[x] , identifier[y] , identifier[z] , identifier[formatter] = identifier[numpy_formatter] ): literal[string] identifier[x] = identifier[np] . identifier[asarray] ( identifier[x] , identifier[dtype] = identifier[np] . identifier...
def from_rectilinear(cls, x, y, z, formatter=numpy_formatter): """Construct a contour generator from a rectilinear grid. Parameters ---------- x : array_like x coordinates of each column of `z`. Must be the same length as the number of columns in `z`. (len(x) == z....
def get_service_health(service_id: str) -> str: """Get the health of a service using service_id. Args: service_id Returns: str, health status """ # Check if the current and actual replica levels are the same if DC.get_replicas(service_id) != DC....
def function[get_service_health, parameter[service_id]]: constant[Get the health of a service using service_id. Args: service_id Returns: str, health status ] if compare[call[name[DC].get_replicas, parameter[name[service_id]]] not_equal[!=] call[name[DC...
keyword[def] identifier[get_service_health] ( identifier[service_id] : identifier[str] )-> identifier[str] : literal[string] keyword[if] identifier[DC] . identifier[get_replicas] ( identifier[service_id] )!= identifier[DC] . identifier[get_actual_replica] ( identifier[service_id] ): ...
def get_service_health(service_id: str) -> str: """Get the health of a service using service_id. Args: service_id Returns: str, health status """ # Check if the current and actual replica levels are the same if DC.get_replicas(service_id) != DC.get_actual_r...
def loginfo(logger, msg, *args, **kwargs): ''' Logs messages as INFO, unless esgfpid.defaults.LOG_INFO_TO_DEBUG, (then it logs messages as DEBUG). ''' if esgfpid.defaults.LOG_INFO_TO_DEBUG: logger.debug(msg, *args, **kwargs) else: logger.info(msg, *args, **kwargs)
def function[loginfo, parameter[logger, msg]]: constant[ Logs messages as INFO, unless esgfpid.defaults.LOG_INFO_TO_DEBUG, (then it logs messages as DEBUG). ] if name[esgfpid].defaults.LOG_INFO_TO_DEBUG begin[:] call[name[logger].debug, parameter[name[msg], <ast.Starred o...
keyword[def] identifier[loginfo] ( identifier[logger] , identifier[msg] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[esgfpid] . identifier[defaults] . identifier[LOG_INFO_TO_DEBUG] : identifier[logger] . identifier[debug] ( identifier[msg] ,* identifier[arg...
def loginfo(logger, msg, *args, **kwargs): """ Logs messages as INFO, unless esgfpid.defaults.LOG_INFO_TO_DEBUG, (then it logs messages as DEBUG). """ if esgfpid.defaults.LOG_INFO_TO_DEBUG: logger.debug(msg, *args, **kwargs) # depends on [control=['if'], data=[]] else: logge...
def upload_model(self, ndex_cred=None, private=True, style='default'): """Creates a new NDEx network of the assembled CX model. To upload the assembled CX model to NDEx, you need to have a registered account on NDEx (http://ndexbio.org/) and have the `ndex` python package installed. The...
def function[upload_model, parameter[self, ndex_cred, private, style]]: constant[Creates a new NDEx network of the assembled CX model. To upload the assembled CX model to NDEx, you need to have a registered account on NDEx (http://ndexbio.org/) and have the `ndex` python package install...
keyword[def] identifier[upload_model] ( identifier[self] , identifier[ndex_cred] = keyword[None] , identifier[private] = keyword[True] , identifier[style] = literal[string] ): literal[string] identifier[cx_str] = identifier[self] . identifier[print_cx] () keyword[if] keyword[not] identif...
def upload_model(self, ndex_cred=None, private=True, style='default'): """Creates a new NDEx network of the assembled CX model. To upload the assembled CX model to NDEx, you need to have a registered account on NDEx (http://ndexbio.org/) and have the `ndex` python package installed. The upl...
def _build_endpoint_url(self, url, name=None): """ Method that constructs a full url with the given url and the snapshot name. Example: full_url = _build_endpoint_url('/users', '1') full_url => 'http://firebase.localhost/users/1.json' """ if not url.endsw...
def function[_build_endpoint_url, parameter[self, url, name]]: constant[ Method that constructs a full url with the given url and the snapshot name. Example: full_url = _build_endpoint_url('/users', '1') full_url => 'http://firebase.localhost/users/1.json' ] ...
keyword[def] identifier[_build_endpoint_url] ( identifier[self] , identifier[url] , identifier[name] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[url] . identifier[endswith] ( identifier[self] . identifier[URL_SEPERATOR] ): identifier[url] = identifier[url] ...
def _build_endpoint_url(self, url, name=None): """ Method that constructs a full url with the given url and the snapshot name. Example: full_url = _build_endpoint_url('/users', '1') full_url => 'http://firebase.localhost/users/1.json' """ if not url.endswith(self...
def set_permissions_in_context(self, context={}): """ Provides permissions for mongoadmin for use in the context""" context['has_view_permission'] = self.mongoadmin.has_view_permission(self.request) context['has_edit_permission'] = self.mongoadmin.has_edit_permission(self.request) conte...
def function[set_permissions_in_context, parameter[self, context]]: constant[ Provides permissions for mongoadmin for use in the context] call[name[context]][constant[has_view_permission]] assign[=] call[name[self].mongoadmin.has_view_permission, parameter[name[self].request]] call[name[context]...
keyword[def] identifier[set_permissions_in_context] ( identifier[self] , identifier[context] ={}): literal[string] identifier[context] [ literal[string] ]= identifier[self] . identifier[mongoadmin] . identifier[has_view_permission] ( identifier[self] . identifier[request] ) identifier[con...
def set_permissions_in_context(self, context={}): """ Provides permissions for mongoadmin for use in the context""" context['has_view_permission'] = self.mongoadmin.has_view_permission(self.request) context['has_edit_permission'] = self.mongoadmin.has_edit_permission(self.request) context['has_add_permi...
def remove_account_alias(self, account, alias): """ :param account: an account object to be used as a selector :param alias: email alias address :returns: None (the API itself returns nothing) """ self.request('RemoveAccountAlias', { 'id': self._g...
def function[remove_account_alias, parameter[self, account, alias]]: constant[ :param account: an account object to be used as a selector :param alias: email alias address :returns: None (the API itself returns nothing) ] call[name[self].request, parameter[co...
keyword[def] identifier[remove_account_alias] ( identifier[self] , identifier[account] , identifier[alias] ): literal[string] identifier[self] . identifier[request] ( literal[string] ,{ literal[string] : identifier[self] . identifier[_get_or_fetch_id] ( identifier[account] , identifier[sel...
def remove_account_alias(self, account, alias): """ :param account: an account object to be used as a selector :param alias: email alias address :returns: None (the API itself returns nothing) """ self.request('RemoveAccountAlias', {'id': self._get_or_fetch_id(accoun...
def state(): '''Get The playback state: 'playing', 'paused', or 'stopped'. If PLAYING or PAUSED, show information on current track. Calls PlaybackController.get_state(), and if state is PLAYING or PAUSED, get PlaybackController.get_current_track() and PlaybackController.get_time_position()''' ...
def function[state, parameter[]]: constant[Get The playback state: 'playing', 'paused', or 'stopped'. If PLAYING or PAUSED, show information on current track. Calls PlaybackController.get_state(), and if state is PLAYING or PAUSED, get PlaybackController.get_current_track() and PlaybackCon...
keyword[def] identifier[state] (): literal[string] identifier[server] = identifier[getServer] () identifier[state] = identifier[server] . identifier[core] . identifier[playback] . identifier[get_state] () identifier[logging] . identifier[debug] ( literal[string] , identifier[state] ) keywor...
def state(): """Get The playback state: 'playing', 'paused', or 'stopped'. If PLAYING or PAUSED, show information on current track. Calls PlaybackController.get_state(), and if state is PLAYING or PAUSED, get PlaybackController.get_current_track() and PlaybackController.get_time_position()""" ...
def _spill(self): """ dump already partitioned data into disks. """ global MemoryBytesSpilled, DiskBytesSpilled path = self._get_spill_dir(self.spills) if not os.path.exists(path): os.makedirs(path) used_memory = get_used_memory() if not self....
def function[_spill, parameter[self]]: constant[ dump already partitioned data into disks. ] <ast.Global object at 0x7da20c795f00> variable[path] assign[=] call[name[self]._get_spill_dir, parameter[name[self].spills]] if <ast.UnaryOp object at 0x7da20c796a40> begin[:] ...
keyword[def] identifier[_spill] ( identifier[self] ): literal[string] keyword[global] identifier[MemoryBytesSpilled] , identifier[DiskBytesSpilled] identifier[path] = identifier[self] . identifier[_get_spill_dir] ( identifier[self] . identifier[spills] ) keyword[if] keyword[not...
def _spill(self): """ dump already partitioned data into disks. """ global MemoryBytesSpilled, DiskBytesSpilled path = self._get_spill_dir(self.spills) if not os.path.exists(path): os.makedirs(path) # depends on [control=['if'], data=[]] used_memory = get_used_memory() i...
def _get_course_content(course_id, course_url, sailthru_client, site_code, config): """Get course information using the Sailthru content api or from cache. If there is an error, just return with an empty response. Arguments: course_id (str): course key of the course course_url (str): LMS u...
def function[_get_course_content, parameter[course_id, course_url, sailthru_client, site_code, config]]: constant[Get course information using the Sailthru content api or from cache. If there is an error, just return with an empty response. Arguments: course_id (str): course key of the course ...
keyword[def] identifier[_get_course_content] ( identifier[course_id] , identifier[course_url] , identifier[sailthru_client] , identifier[site_code] , identifier[config] ): literal[string] identifier[cache_key] = literal[string] . identifier[format] ( identifier[site_code] , identifier[course_url] ) ...
def _get_course_content(course_id, course_url, sailthru_client, site_code, config): """Get course information using the Sailthru content api or from cache. If there is an error, just return with an empty response. Arguments: course_id (str): course key of the course course_url (str): LMS u...
def _inherit_from(context, uri, calling_uri): """called by the _inherit method in template modules to set up the inheritance chain at the start of a template's execution.""" if uri is None: return None template = _lookup_template(context, uri, calling_uri) self_ns = context['self'] ...
def function[_inherit_from, parameter[context, uri, calling_uri]]: constant[called by the _inherit method in template modules to set up the inheritance chain at the start of a template's execution.] if compare[name[uri] is constant[None]] begin[:] return[constant[None]] variable[...
keyword[def] identifier[_inherit_from] ( identifier[context] , identifier[uri] , identifier[calling_uri] ): literal[string] keyword[if] identifier[uri] keyword[is] keyword[None] : keyword[return] keyword[None] identifier[template] = identifier[_lookup_template] ( identifier[context] , i...
def _inherit_from(context, uri, calling_uri): """called by the _inherit method in template modules to set up the inheritance chain at the start of a template's execution.""" if uri is None: return None # depends on [control=['if'], data=[]] template = _lookup_template(context, uri, calling_...
def EQ127(T, A, B, C, D, E, F, G, order=0): r'''DIPPR Equation #127. Rarely used, and then only in calculating ideal-gas heat capacity. All 7 parameters are required. .. math:: Y = A+B\left[\frac{\left(\frac{C}{T}\right)^2\exp\left(\frac{C}{T} \right)}{\left(\exp\frac{C}{T}-1 \right)^2}\rig...
def function[EQ127, parameter[T, A, B, C, D, E, F, G, order]]: constant[DIPPR Equation #127. Rarely used, and then only in calculating ideal-gas heat capacity. All 7 parameters are required. .. math:: Y = A+B\left[\frac{\left(\frac{C}{T}\right)^2\exp\left(\frac{C}{T} \right)}{\left(\exp...
keyword[def] identifier[EQ127] ( identifier[T] , identifier[A] , identifier[B] , identifier[C] , identifier[D] , identifier[E] , identifier[F] , identifier[G] , identifier[order] = literal[int] ): literal[string] keyword[if] identifier[order] == literal[int] : keyword[return] ( identifier[A] + id...
def EQ127(T, A, B, C, D, E, F, G, order=0): """DIPPR Equation #127. Rarely used, and then only in calculating ideal-gas heat capacity. All 7 parameters are required. .. math:: Y = A+B\\left[\\frac{\\left(\\frac{C}{T}\\right)^2\\exp\\left(\\frac{C}{T} \\right)}{\\left(\\exp\\frac{C}{T}-1 \\r...
def segment(text: str) -> str: """ Enhanced Thai Character Cluster (ETCC) :param string text: word input :return: etcc """ if not text or not isinstance(text, str): return "" if re.search(r"[เแ]" + _C + r"[" + "".join(_UV) + r"]" + r"\w", text): search = re.findall(r"[เแ]...
def function[segment, parameter[text]]: constant[ Enhanced Thai Character Cluster (ETCC) :param string text: word input :return: etcc ] if <ast.BoolOp object at 0x7da1b1797e20> begin[:] return[constant[]] if call[name[re].search, parameter[binary_operation[binary_operat...
keyword[def] identifier[segment] ( identifier[text] : identifier[str] )-> identifier[str] : literal[string] keyword[if] keyword[not] identifier[text] keyword[or] keyword[not] identifier[isinstance] ( identifier[text] , identifier[str] ): keyword[return] literal[string] keyword[if] i...
def segment(text: str) -> str: """ Enhanced Thai Character Cluster (ETCC) :param string text: word input :return: etcc """ if not text or not isinstance(text, str): return '' # depends on [control=['if'], data=[]] if re.search('[เแ]' + _C + '[' + ''.join(_UV) + ']' + '\\w', text):...
def remove_nonancestors_of(self, node): """Remove all of the non-ancestors operation nodes of node.""" if isinstance(node, int): warnings.warn('Calling remove_nonancestors_of() with a node id is deprecated,' ' use a DAGNode instead', Deprec...
def function[remove_nonancestors_of, parameter[self, node]]: constant[Remove all of the non-ancestors operation nodes of node.] if call[name[isinstance], parameter[name[node], name[int]]] begin[:] call[name[warnings].warn, parameter[constant[Calling remove_nonancestors_of() with a node i...
keyword[def] identifier[remove_nonancestors_of] ( identifier[self] , identifier[node] ): literal[string] keyword[if] identifier[isinstance] ( identifier[node] , identifier[int] ): identifier[warnings] . identifier[warn] ( literal[string] literal[string] , id...
def remove_nonancestors_of(self, node): """Remove all of the non-ancestors operation nodes of node.""" if isinstance(node, int): warnings.warn('Calling remove_nonancestors_of() with a node id is deprecated, use a DAGNode instead', DeprecationWarning, 2) node = self._id_to_node[node] # depends o...
def get_child_objective_bank_ids(self, objective_bank_id): """Gets the child ``Ids`` of the given objective bank. arg: objective_bank_id (osid.id.Id): the ``Id`` to query return: (osid.id.IdList) - the children of the objective bank raise: NotFound - ``objective_bank_id`` is not fou...
def function[get_child_objective_bank_ids, parameter[self, objective_bank_id]]: constant[Gets the child ``Ids`` of the given objective bank. arg: objective_bank_id (osid.id.Id): the ``Id`` to query return: (osid.id.IdList) - the children of the objective bank raise: NotFound - ``obj...
keyword[def] identifier[get_child_objective_bank_ids] ( identifier[self] , identifier[objective_bank_id] ): literal[string] keyword[if] identifier[self] . identifier[_catalog_session] keyword[is] keyword[not] keyword[None] : keyword[return] identifier[self] . ide...
def get_child_objective_bank_ids(self, objective_bank_id): """Gets the child ``Ids`` of the given objective bank. arg: objective_bank_id (osid.id.Id): the ``Id`` to query return: (osid.id.IdList) - the children of the objective bank raise: NotFound - ``objective_bank_id`` is not found ...
def reboot(env, identifier, hard): """Reboot an active virtual server.""" virtual_guest = env.client['Virtual_Guest'] mgr = SoftLayer.HardwareManager(env.client) vs_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'VS') if not (env.skip_confirmations or formatting.confirm('This will...
def function[reboot, parameter[env, identifier, hard]]: constant[Reboot an active virtual server.] variable[virtual_guest] assign[=] call[name[env].client][constant[Virtual_Guest]] variable[mgr] assign[=] call[name[SoftLayer].HardwareManager, parameter[name[env].client]] variable[vs_id] ...
keyword[def] identifier[reboot] ( identifier[env] , identifier[identifier] , identifier[hard] ): literal[string] identifier[virtual_guest] = identifier[env] . identifier[client] [ literal[string] ] identifier[mgr] = identifier[SoftLayer] . identifier[HardwareManager] ( identifier[env] . identifier[cl...
def reboot(env, identifier, hard): """Reboot an active virtual server.""" virtual_guest = env.client['Virtual_Guest'] mgr = SoftLayer.HardwareManager(env.client) vs_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'VS') if not (env.skip_confirmations or formatting.confirm('This will reboot the V...
def moving_patterson_f3(acc, aca, acb, size, start=0, stop=None, step=None, normed=True): """Estimate F3(C; A, B) in moving windows. Parameters ---------- acc : array_like, int, shape (n_variants, 2) Allele counts for the test population (C). aca : array_like, int, s...
def function[moving_patterson_f3, parameter[acc, aca, acb, size, start, stop, step, normed]]: constant[Estimate F3(C; A, B) in moving windows. Parameters ---------- acc : array_like, int, shape (n_variants, 2) Allele counts for the test population (C). aca : array_like, int, shape (n_va...
keyword[def] identifier[moving_patterson_f3] ( identifier[acc] , identifier[aca] , identifier[acb] , identifier[size] , identifier[start] = literal[int] , identifier[stop] = keyword[None] , identifier[step] = keyword[None] , identifier[normed] = keyword[True] ): literal[string] identifier[T] , ident...
def moving_patterson_f3(acc, aca, acb, size, start=0, stop=None, step=None, normed=True): """Estimate F3(C; A, B) in moving windows. Parameters ---------- acc : array_like, int, shape (n_variants, 2) Allele counts for the test population (C). aca : array_like, int, shape (n_variants, 2) ...
def get_data_times_for_job_workflow(self, num_job): """ Get the data that this job will need to read in. """ # small factor of 0.0001 to avoid float round offs causing us to # miss a second at end of segments. shift_dur = self.curr_seg[0] + int(self.job_time_shift * num_job\ ...
def function[get_data_times_for_job_workflow, parameter[self, num_job]]: constant[ Get the data that this job will need to read in. ] variable[shift_dur] assign[=] binary_operation[call[name[self].curr_seg][constant[0]] + call[name[int], parameter[binary_operation[binary_operation[name[self].job_time_sh...
keyword[def] identifier[get_data_times_for_job_workflow] ( identifier[self] , identifier[num_job] ): literal[string] identifier[shift_dur] = identifier[self] . identifier[curr_seg] [ literal[int] ]+ identifier[int] ( identifier[self] . identifier[job_time_shift] * identifier[num_j...
def get_data_times_for_job_workflow(self, num_job): """ Get the data that this job will need to read in. """ # small factor of 0.0001 to avoid float round offs causing us to # miss a second at end of segments. shift_dur = self.curr_seg[0] + int(self.job_time_shift * num_job + 0.0001) job_data_seg = ...
def run(self, n_steps=None): r""" Perform the algorithm Parameters ---------- n_steps : int The number of throats to invaded during this step """ if n_steps is None: n_steps = sp.inf queue = self.queue if len(queue) == 0:...
def function[run, parameter[self, n_steps]]: constant[ Perform the algorithm Parameters ---------- n_steps : int The number of throats to invaded during this step ] if compare[name[n_steps] is constant[None]] begin[:] variable[n_steps...
keyword[def] identifier[run] ( identifier[self] , identifier[n_steps] = keyword[None] ): literal[string] keyword[if] identifier[n_steps] keyword[is] keyword[None] : identifier[n_steps] = identifier[sp] . identifier[inf] identifier[queue] = identifier[self] . identifier[qu...
def run(self, n_steps=None): """ Perform the algorithm Parameters ---------- n_steps : int The number of throats to invaded during this step """ if n_steps is None: n_steps = sp.inf # depends on [control=['if'], data=['n_steps']] queue = self.qu...
def close(self): """Close the zip file. Note underlying tempfile is removed when archive is garbage collected. """ self._closed = True self._zip_file.close() log.debug( "Created custodian serverless archive size: %0.2fmb", (os.path.getsize(self._t...
def function[close, parameter[self]]: constant[Close the zip file. Note underlying tempfile is removed when archive is garbage collected. ] name[self]._closed assign[=] constant[True] call[name[self]._zip_file.close, parameter[]] call[name[log].debug, parameter[constant[...
keyword[def] identifier[close] ( identifier[self] ): literal[string] identifier[self] . identifier[_closed] = keyword[True] identifier[self] . identifier[_zip_file] . identifier[close] () identifier[log] . identifier[debug] ( literal[string] , ( identifier[os] . ...
def close(self): """Close the zip file. Note underlying tempfile is removed when archive is garbage collected. """ self._closed = True self._zip_file.close() log.debug('Created custodian serverless archive size: %0.2fmb', os.path.getsize(self._temp_archive_file.name) / (1024.0 * 1024.0)...
def stripext (cmd, archive, verbosity, extension=""): """Print the name without suffix.""" if verbosity >= 0: print(util.stripext(archive)+extension) return None
def function[stripext, parameter[cmd, archive, verbosity, extension]]: constant[Print the name without suffix.] if compare[name[verbosity] greater_or_equal[>=] constant[0]] begin[:] call[name[print], parameter[binary_operation[call[name[util].stripext, parameter[name[archive]]] + name[ex...
keyword[def] identifier[stripext] ( identifier[cmd] , identifier[archive] , identifier[verbosity] , identifier[extension] = literal[string] ): literal[string] keyword[if] identifier[verbosity] >= literal[int] : identifier[print] ( identifier[util] . identifier[stripext] ( identifier[archive] )+ i...
def stripext(cmd, archive, verbosity, extension=''): """Print the name without suffix.""" if verbosity >= 0: print(util.stripext(archive) + extension) # depends on [control=['if'], data=[]] return None
def pop(self): """ Pops the latest additional context. If the additional context was pushed by a different additional manager, a ``RuntimeError`` is raised. """ rv = _additional_ctx_stack.pop() if rv is None or rv[0] is not self: raise RuntimeError( ...
def function[pop, parameter[self]]: constant[ Pops the latest additional context. If the additional context was pushed by a different additional manager, a ``RuntimeError`` is raised. ] variable[rv] assign[=] call[name[_additional_ctx_stack].pop, parameter[]] if ...
keyword[def] identifier[pop] ( identifier[self] ): literal[string] identifier[rv] = identifier[_additional_ctx_stack] . identifier[pop] () keyword[if] identifier[rv] keyword[is] keyword[None] keyword[or] identifier[rv] [ literal[int] ] keyword[is] keyword[not] identifier[self] : ...
def pop(self): """ Pops the latest additional context. If the additional context was pushed by a different additional manager, a ``RuntimeError`` is raised. """ rv = _additional_ctx_stack.pop() if rv is None or rv[0] is not self: raise RuntimeError('popped wrong addi...
def make_roi_plots(self, gta, mcube_tot, **kwargs): """Make various diagnostic plots for the 1D and 2D counts/model distributions. Parameters ---------- prefix : str Prefix that will be appended to all filenames. """ fmt = kwargs.get('format', self...
def function[make_roi_plots, parameter[self, gta, mcube_tot]]: constant[Make various diagnostic plots for the 1D and 2D counts/model distributions. Parameters ---------- prefix : str Prefix that will be appended to all filenames. ] variable[fmt] ass...
keyword[def] identifier[make_roi_plots] ( identifier[self] , identifier[gta] , identifier[mcube_tot] ,** identifier[kwargs] ): literal[string] identifier[fmt] = identifier[kwargs] . identifier[get] ( literal[string] , identifier[self] . identifier[config] [ literal[string] ]) identifier[f...
def make_roi_plots(self, gta, mcube_tot, **kwargs): """Make various diagnostic plots for the 1D and 2D counts/model distributions. Parameters ---------- prefix : str Prefix that will be appended to all filenames. """ fmt = kwargs.get('format', self.config['...
def toProtocolElement(self): """ Returns the representation of this ContinuousSet as the corresponding ProtocolElement. """ gaContinuousSet = protocol.ContinuousSet() gaContinuousSet.id = self.getId() gaContinuousSet.dataset_id = self.getParentContainer().getId() ...
def function[toProtocolElement, parameter[self]]: constant[ Returns the representation of this ContinuousSet as the corresponding ProtocolElement. ] variable[gaContinuousSet] assign[=] call[name[protocol].ContinuousSet, parameter[]] name[gaContinuousSet].id assign[=] call...
keyword[def] identifier[toProtocolElement] ( identifier[self] ): literal[string] identifier[gaContinuousSet] = identifier[protocol] . identifier[ContinuousSet] () identifier[gaContinuousSet] . identifier[id] = identifier[self] . identifier[getId] () identifier[gaContinuousSet] . i...
def toProtocolElement(self): """ Returns the representation of this ContinuousSet as the corresponding ProtocolElement. """ gaContinuousSet = protocol.ContinuousSet() gaContinuousSet.id = self.getId() gaContinuousSet.dataset_id = self.getParentContainer().getId() gaContinuous...
def Sample(self, task, status): """Takes a sample of the status of a task for profiling. Args: task (Task): a task. status (str): status. """ sample_time = time.time() sample = '{0:f}\t{1:s}\t{2:s}\n'.format( sample_time, task.identifier, status) self._WritesString(sample)
def function[Sample, parameter[self, task, status]]: constant[Takes a sample of the status of a task for profiling. Args: task (Task): a task. status (str): status. ] variable[sample_time] assign[=] call[name[time].time, parameter[]] variable[sample] assign[=] call[constant[...
keyword[def] identifier[Sample] ( identifier[self] , identifier[task] , identifier[status] ): literal[string] identifier[sample_time] = identifier[time] . identifier[time] () identifier[sample] = literal[string] . identifier[format] ( identifier[sample_time] , identifier[task] . identifier[identi...
def Sample(self, task, status): """Takes a sample of the status of a task for profiling. Args: task (Task): a task. status (str): status. """ sample_time = time.time() sample = '{0:f}\t{1:s}\t{2:s}\n'.format(sample_time, task.identifier, status) self._WritesString(sample)
def generate_snapshot(self, prov_dep): # type: (MutableMapping[Text, Any]) -> None """Copy all of the CWL files to the snapshot/ directory.""" self.self_check() for key, value in prov_dep.items(): if key == "location" and value.split("/")[-1]: filename = value...
def function[generate_snapshot, parameter[self, prov_dep]]: constant[Copy all of the CWL files to the snapshot/ directory.] call[name[self].self_check, parameter[]] for taget[tuple[[<ast.Name object at 0x7da20c6e79d0>, <ast.Name object at 0x7da20c6e6050>]]] in starred[call[name[prov_dep].items, ...
keyword[def] identifier[generate_snapshot] ( identifier[self] , identifier[prov_dep] ): literal[string] identifier[self] . identifier[self_check] () keyword[for] identifier[key] , identifier[value] keyword[in] identifier[prov_dep] . identifier[items] (): keyword[if] ident...
def generate_snapshot(self, prov_dep): # type: (MutableMapping[Text, Any]) -> None 'Copy all of the CWL files to the snapshot/ directory.' self.self_check() for (key, value) in prov_dep.items(): if key == 'location' and value.split('/')[-1]: filename = value.split('/')[-1] ...
def a_thing(random=random, *args, **kwargs): """ Return a ... thing. >>> mock_random.seed(0) >>> a_thing(random=mock_random) 'two secrets' >>> mock_random.seed(1) >>> a_thing(random=mock_random, capitalize=True) 'A Mighty Poop' >>> mock_random.seed(2) >>> a_thing(random=mock_ran...
def function[a_thing, parameter[random]]: constant[ Return a ... thing. >>> mock_random.seed(0) >>> a_thing(random=mock_random) 'two secrets' >>> mock_random.seed(1) >>> a_thing(random=mock_random, capitalize=True) 'A Mighty Poop' >>> mock_random.seed(2) >>> a_thing(random=m...
keyword[def] identifier[a_thing] ( identifier[random] = identifier[random] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[thing] ( identifier[random] = identifier[random] , identifier[an] = keyword[True] ,* identifier[args] ,** identifier[kwargs] )
def a_thing(random=random, *args, **kwargs): """ Return a ... thing. >>> mock_random.seed(0) >>> a_thing(random=mock_random) 'two secrets' >>> mock_random.seed(1) >>> a_thing(random=mock_random, capitalize=True) 'A Mighty Poop' >>> mock_random.seed(2) >>> a_thing(random=mock_ran...
def data_to_binary(self): """ :return: bytes """ return bytes([ COMMAND_CODE, self.channels_to_byte([self.channel]), self.disable_inhibit_forced, self.status, self.led_status ]) + struct.pack('>L', self.delay_time)[-3:]
def function[data_to_binary, parameter[self]]: constant[ :return: bytes ] return[binary_operation[call[name[bytes], parameter[list[[<ast.Name object at 0x7da18f723130>, <ast.Call object at 0x7da18f7216f0>, <ast.Attribute object at 0x7da204960430>, <ast.Attribute object at 0x7da204961f00>, <a...
keyword[def] identifier[data_to_binary] ( identifier[self] ): literal[string] keyword[return] identifier[bytes] ([ identifier[COMMAND_CODE] , identifier[self] . identifier[channels_to_byte] ([ identifier[self] . identifier[channel] ]), identifier[self] . identifier[disab...
def data_to_binary(self): """ :return: bytes """ return bytes([COMMAND_CODE, self.channels_to_byte([self.channel]), self.disable_inhibit_forced, self.status, self.led_status]) + struct.pack('>L', self.delay_time)[-3:]
async def edit_settings(self, **kwargs): """|coro| Edits the client user's settings. .. note:: This only applies to non-bot accounts. Parameters ------- afk_timeout: :class:`int` How long (in seconds) the user needs to be AFK until Discord ...
<ast.AsyncFunctionDef object at 0x7da1b2062d10>
keyword[async] keyword[def] identifier[edit_settings] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[payload] ={} identifier[content_filter] = identifier[kwargs] . identifier[pop] ( literal[string] , keyword[None] ) keyword[if] identifier[content_filter...
async def edit_settings(self, **kwargs): """|coro| Edits the client user's settings. .. note:: This only applies to non-bot accounts. Parameters ------- afk_timeout: :class:`int` How long (in seconds) the user needs to be AFK until Discord ...
def send_signals(self): """Shout for the world to hear whether a txn was successful.""" if self.flag: invalid_ipn_received.send(sender=self) return else: valid_ipn_received.send(sender=self)
def function[send_signals, parameter[self]]: constant[Shout for the world to hear whether a txn was successful.] if name[self].flag begin[:] call[name[invalid_ipn_received].send, parameter[]] return[None]
keyword[def] identifier[send_signals] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[flag] : identifier[invalid_ipn_received] . identifier[send] ( identifier[sender] = identifier[self] ) keyword[return] keyword[else] : ...
def send_signals(self): """Shout for the world to hear whether a txn was successful.""" if self.flag: invalid_ipn_received.send(sender=self) return # depends on [control=['if'], data=[]] else: valid_ipn_received.send(sender=self)
def _GetParserFilters(cls, parser_filter_expression): """Retrieves the parsers and plugins to include and exclude. Takes a comma separated string and splits it up into two dictionaries, of parsers and plugins to include and to exclude from selection. If a particular filter is prepended with an exclamat...
def function[_GetParserFilters, parameter[cls, parser_filter_expression]]: constant[Retrieves the parsers and plugins to include and exclude. Takes a comma separated string and splits it up into two dictionaries, of parsers and plugins to include and to exclude from selection. If a particular filte...
keyword[def] identifier[_GetParserFilters] ( identifier[cls] , identifier[parser_filter_expression] ): literal[string] keyword[if] keyword[not] identifier[parser_filter_expression] : keyword[return] {},{} identifier[includes] ={} identifier[excludes] ={} identifier[preset_names] =...
def _GetParserFilters(cls, parser_filter_expression): """Retrieves the parsers and plugins to include and exclude. Takes a comma separated string and splits it up into two dictionaries, of parsers and plugins to include and to exclude from selection. If a particular filter is prepended with an exclamat...