code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def instance(cls, *args, **kwargs): """ Singleton getter """ if cls._instance is None: cls._instance = cls(*args, **kwargs) loaded = cls._instance.reload() logging.getLogger('luigi-interface').info('Loaded %r', loaded) return cls._instance
def function[instance, parameter[cls]]: constant[ Singleton getter ] if compare[name[cls]._instance is constant[None]] begin[:] name[cls]._instance assign[=] call[name[cls], parameter[<ast.Starred object at 0x7da1b1f46740>]] variable[loaded] assign[=] call[name[cls]._inst...
keyword[def] identifier[instance] ( identifier[cls] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[cls] . identifier[_instance] keyword[is] keyword[None] : identifier[cls] . identifier[_instance] = identifier[cls] (* identifier[args] ,** identif...
def instance(cls, *args, **kwargs): """ Singleton getter """ if cls._instance is None: cls._instance = cls(*args, **kwargs) loaded = cls._instance.reload() logging.getLogger('luigi-interface').info('Loaded %r', loaded) # depends on [control=['if'], data=[]] return cls._instance
def _markdownify(tag, _listType=None, _blockQuote=False, _listIndex=1): """recursively converts a tag into markdown""" children = tag.find_all(recursive=False) if tag.name == '[document]': for child in children: _markdownify(child) return if tag.name not in _supportedTags or not _supportedAttrs(tag): if ...
def function[_markdownify, parameter[tag, _listType, _blockQuote, _listIndex]]: constant[recursively converts a tag into markdown] variable[children] assign[=] call[name[tag].find_all, parameter[]] if compare[name[tag].name equal[==] constant[[document]]] begin[:] for taget[name[...
keyword[def] identifier[_markdownify] ( identifier[tag] , identifier[_listType] = keyword[None] , identifier[_blockQuote] = keyword[False] , identifier[_listIndex] = literal[int] ): literal[string] identifier[children] = identifier[tag] . identifier[find_all] ( identifier[recursive] = keyword[False] ) keyword...
def _markdownify(tag, _listType=None, _blockQuote=False, _listIndex=1): """recursively converts a tag into markdown""" children = tag.find_all(recursive=False) if tag.name == '[document]': for child in children: _markdownify(child) # depends on [control=['for'], data=['child']] ...
def __check_port(self, port): """check port status return True if port is free, False else """ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: s.bind((_host(), port)) return True except socket.error: return False fina...
def function[__check_port, parameter[self, port]]: constant[check port status return True if port is free, False else ] variable[s] assign[=] call[name[socket].socket, parameter[name[socket].AF_INET, name[socket].SOCK_STREAM]] <ast.Try object at 0x7da20c6e7220>
keyword[def] identifier[__check_port] ( identifier[self] , identifier[port] ): literal[string] identifier[s] = identifier[socket] . identifier[socket] ( identifier[socket] . identifier[AF_INET] , identifier[socket] . identifier[SOCK_STREAM] ) keyword[try] : identifier[s] . ide...
def __check_port(self, port): """check port status return True if port is free, False else """ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: s.bind((_host(), port)) return True # depends on [control=['try'], data=[]] except socket.error: return False...
def remove_droppable(self, droppable_id): """remove a droppable, given the id""" updated_droppables = [] for droppable in self.my_osid_object_form._my_map['droppables']: if droppable['id'] != droppable_id: updated_droppables.append(droppable) self.my_osid_obje...
def function[remove_droppable, parameter[self, droppable_id]]: constant[remove a droppable, given the id] variable[updated_droppables] assign[=] list[[]] for taget[name[droppable]] in starred[call[name[self].my_osid_object_form._my_map][constant[droppables]]] begin[:] if compare[...
keyword[def] identifier[remove_droppable] ( identifier[self] , identifier[droppable_id] ): literal[string] identifier[updated_droppables] =[] keyword[for] identifier[droppable] keyword[in] identifier[self] . identifier[my_osid_object_form] . identifier[_my_map] [ literal[string] ]: ...
def remove_droppable(self, droppable_id): """remove a droppable, given the id""" updated_droppables = [] for droppable in self.my_osid_object_form._my_map['droppables']: if droppable['id'] != droppable_id: updated_droppables.append(droppable) # depends on [control=['if'], data=[]] # de...
def _validate_nullable(self, nullable, field, value): """ {'type': 'boolean'} """ if value is None: if not nullable: self._error(field, errors.NOT_NULLABLE) self._drop_remaining_rules( 'allowed', 'empty', 'forbidden'...
def function[_validate_nullable, parameter[self, nullable, field, value]]: constant[ {'type': 'boolean'} ] if compare[name[value] is constant[None]] begin[:] if <ast.UnaryOp object at 0x7da2054a55d0> begin[:] call[name[self]._error, parameter[name[field], name[err...
keyword[def] identifier[_validate_nullable] ( identifier[self] , identifier[nullable] , identifier[field] , identifier[value] ): literal[string] keyword[if] identifier[value] keyword[is] keyword[None] : keyword[if] keyword[not] identifier[nullable] : identifier[se...
def _validate_nullable(self, nullable, field, value): """ {'type': 'boolean'} """ if value is None: if not nullable: self._error(field, errors.NOT_NULLABLE) # depends on [control=['if'], data=[]] self._drop_remaining_rules('allowed', 'empty', 'forbidden', 'items', 'keysrules', 'min'...
def set_param(self, param, value, header='Content-Type', requote=True, charset=None, language=''): """Set a parameter in the Content-Type header. If the parameter already exists in the header, its value will be replaced with the new value. If header is Content-Type an...
def function[set_param, parameter[self, param, value, header, requote, charset, language]]: constant[Set a parameter in the Content-Type header. If the parameter already exists in the header, its value will be replaced with the new value. If header is Content-Type and has not yet been ...
keyword[def] identifier[set_param] ( identifier[self] , identifier[param] , identifier[value] , identifier[header] = literal[string] , identifier[requote] = keyword[True] , identifier[charset] = keyword[None] , identifier[language] = literal[string] ): literal[string] keyword[if] keyword[not] id...
def set_param(self, param, value, header='Content-Type', requote=True, charset=None, language=''): """Set a parameter in the Content-Type header. If the parameter already exists in the header, its value will be replaced with the new value. If header is Content-Type and has not yet been def...
def load_map_file(filename, name=None, check_integrity=True): """ Loads a ContainerMap configuration from a YAML file. :param filename: YAML file name. :type filename: unicode | str :param name: Name of the ContainerMap. If ``None`` will attempt to find a ``name`` element on the root level of ...
def function[load_map_file, parameter[filename, name, check_integrity]]: constant[ Loads a ContainerMap configuration from a YAML file. :param filename: YAML file name. :type filename: unicode | str :param name: Name of the ContainerMap. If ``None`` will attempt to find a ``name`` element on th...
keyword[def] identifier[load_map_file] ( identifier[filename] , identifier[name] = keyword[None] , identifier[check_integrity] = keyword[True] ): literal[string] keyword[if] identifier[name] == literal[string] : identifier[base_name] = identifier[os] . identifier[path] . identifier[basename] ( id...
def load_map_file(filename, name=None, check_integrity=True): """ Loads a ContainerMap configuration from a YAML file. :param filename: YAML file name. :type filename: unicode | str :param name: Name of the ContainerMap. If ``None`` will attempt to find a ``name`` element on the root level of ...
def cli(): """Entry point for the application script""" parser = get_argparser() args = parser.parse_args() check_args(args) if args.v: print('ERAlchemy version {}.'.format(__version__)) exit(0) render_er( args.i, args.o, include_tables=args.include_table...
def function[cli, parameter[]]: constant[Entry point for the application script] variable[parser] assign[=] call[name[get_argparser], parameter[]] variable[args] assign[=] call[name[parser].parse_args, parameter[]] call[name[check_args], parameter[name[args]]] if name[args].v beg...
keyword[def] identifier[cli] (): literal[string] identifier[parser] = identifier[get_argparser] () identifier[args] = identifier[parser] . identifier[parse_args] () identifier[check_args] ( identifier[args] ) keyword[if] identifier[args] . identifier[v] : identifier[print] ( liter...
def cli(): """Entry point for the application script""" parser = get_argparser() args = parser.parse_args() check_args(args) if args.v: print('ERAlchemy version {}.'.format(__version__)) exit(0) # depends on [control=['if'], data=[]] render_er(args.i, args.o, include_tables=args...
def check_name_collision( self, name, block_id, checked_ops ): """ Are there any colliding names in this block? Set the '__collided__' flag and related flags if so, so we don't commit them. Not called directly; called by the @state_create() decorator in blockstack.lib.operations...
def function[check_name_collision, parameter[self, name, block_id, checked_ops]]: constant[ Are there any colliding names in this block? Set the '__collided__' flag and related flags if so, so we don't commit them. Not called directly; called by the @state_create() decorator in ...
keyword[def] identifier[check_name_collision] ( identifier[self] , identifier[name] , identifier[block_id] , identifier[checked_ops] ): literal[string] keyword[return] identifier[self] . identifier[check_collision] ( literal[string] , identifier[name] , identifier[block_id] , identifier[checked_o...
def check_name_collision(self, name, block_id, checked_ops): """ Are there any colliding names in this block? Set the '__collided__' flag and related flags if so, so we don't commit them. Not called directly; called by the @state_create() decorator in blockstack.lib.operations.regis...
def limit_pos(p, se_pos, nw_pos): """ Limits position p to stay inside containing state :param p: Position to limit :param se_pos: Bottom/Right boundary :param nw_pos: Top/Left boundary :return: """ if p > se_pos: _update(p, se_pos) eli...
def function[limit_pos, parameter[p, se_pos, nw_pos]]: constant[ Limits position p to stay inside containing state :param p: Position to limit :param se_pos: Bottom/Right boundary :param nw_pos: Top/Left boundary :return: ] if compare[name[p] greater[>] na...
keyword[def] identifier[limit_pos] ( identifier[p] , identifier[se_pos] , identifier[nw_pos] ): literal[string] keyword[if] identifier[p] > identifier[se_pos] : identifier[_update] ( identifier[p] , identifier[se_pos] ) keyword[elif] identifier[p] < identifier[nw_pos] : ...
def limit_pos(p, se_pos, nw_pos): """ Limits position p to stay inside containing state :param p: Position to limit :param se_pos: Bottom/Right boundary :param nw_pos: Top/Left boundary :return: """ if p > se_pos: _update(p, se_pos) # depends on [control=...
def getOverlayTexelAspect(self, ulOverlayHandle): """Gets the aspect ratio of the texels in the overlay. Defaults to 1.0""" fn = self.function_table.getOverlayTexelAspect pfTexelAspect = c_float() result = fn(ulOverlayHandle, byref(pfTexelAspect)) return result, pfTexelAspect.va...
def function[getOverlayTexelAspect, parameter[self, ulOverlayHandle]]: constant[Gets the aspect ratio of the texels in the overlay. Defaults to 1.0] variable[fn] assign[=] name[self].function_table.getOverlayTexelAspect variable[pfTexelAspect] assign[=] call[name[c_float], parameter[]] v...
keyword[def] identifier[getOverlayTexelAspect] ( identifier[self] , identifier[ulOverlayHandle] ): literal[string] identifier[fn] = identifier[self] . identifier[function_table] . identifier[getOverlayTexelAspect] identifier[pfTexelAspect] = identifier[c_float] () identifier[res...
def getOverlayTexelAspect(self, ulOverlayHandle): """Gets the aspect ratio of the texels in the overlay. Defaults to 1.0""" fn = self.function_table.getOverlayTexelAspect pfTexelAspect = c_float() result = fn(ulOverlayHandle, byref(pfTexelAspect)) return (result, pfTexelAspect.value)
def __load_identities(self, identities, uuid, verbose): """Store identities""" self.log("-- loading identities", verbose) for identity in identities: try: api.add_identity(self.db, identity.source, identity.email, identity.name, iden...
def function[__load_identities, parameter[self, identities, uuid, verbose]]: constant[Store identities] call[name[self].log, parameter[constant[-- loading identities], name[verbose]]] for taget[name[identity]] in starred[name[identities]] begin[:] <ast.Try object at 0x7da1b0c647c0> ...
keyword[def] identifier[__load_identities] ( identifier[self] , identifier[identities] , identifier[uuid] , identifier[verbose] ): literal[string] identifier[self] . identifier[log] ( literal[string] , identifier[verbose] ) keyword[for] identifier[identity] keyword[in] identifier[iden...
def __load_identities(self, identities, uuid, verbose): """Store identities""" self.log('-- loading identities', verbose) for identity in identities: try: api.add_identity(self.db, identity.source, identity.email, identity.name, identity.username, uuid) self.new_uids.add(uuid...
def send_attachment(self, recipient_id, attachment_type, attachment_path, notification_type=NotificationType.regular): """Send an attachment to the specified recipient using local path. Input: recipient_id: recipient id to send to attachment_type: type of ...
def function[send_attachment, parameter[self, recipient_id, attachment_type, attachment_path, notification_type]]: constant[Send an attachment to the specified recipient using local path. Input: recipient_id: recipient id to send to attachment_type: type of attachment (image, vid...
keyword[def] identifier[send_attachment] ( identifier[self] , identifier[recipient_id] , identifier[attachment_type] , identifier[attachment_path] , identifier[notification_type] = identifier[NotificationType] . identifier[regular] ): literal[string] identifier[payload] ={ literal[string]...
def send_attachment(self, recipient_id, attachment_type, attachment_path, notification_type=NotificationType.regular): """Send an attachment to the specified recipient using local path. Input: recipient_id: recipient id to send to attachment_type: type of attachment (image, video, au...
def _get_classpath(self, workunit_factory): """Returns the bootstrapped ivy classpath as a list of jar paths. :raises: Bootstrapper.Error if the classpath could not be bootstrapped """ if not self._classpath: self._classpath = self._bootstrap_ivy_classpath(workunit_factory) return self._class...
def function[_get_classpath, parameter[self, workunit_factory]]: constant[Returns the bootstrapped ivy classpath as a list of jar paths. :raises: Bootstrapper.Error if the classpath could not be bootstrapped ] if <ast.UnaryOp object at 0x7da1b1e5f5e0> begin[:] name[self]._classp...
keyword[def] identifier[_get_classpath] ( identifier[self] , identifier[workunit_factory] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_classpath] : identifier[self] . identifier[_classpath] = identifier[self] . identifier[_bootstrap_ivy_classpath] ( identifier[workuni...
def _get_classpath(self, workunit_factory): """Returns the bootstrapped ivy classpath as a list of jar paths. :raises: Bootstrapper.Error if the classpath could not be bootstrapped """ if not self._classpath: self._classpath = self._bootstrap_ivy_classpath(workunit_factory) # depends on [contr...
def register_handler(self, handler): """ Register a new namespace handler. """ self._handlers[handler.namespace] = handler handler.registered(self)
def function[register_handler, parameter[self, handler]]: constant[ Register a new namespace handler. ] call[name[self]._handlers][name[handler].namespace] assign[=] name[handler] call[name[handler].registered, parameter[name[self]]]
keyword[def] identifier[register_handler] ( identifier[self] , identifier[handler] ): literal[string] identifier[self] . identifier[_handlers] [ identifier[handler] . identifier[namespace] ]= identifier[handler] identifier[handler] . identifier[registered] ( identifier[self] )
def register_handler(self, handler): """ Register a new namespace handler. """ self._handlers[handler.namespace] = handler handler.registered(self)
def nlmsg_find_attr(nlh, hdrlen, attrtype): """Find a specific attribute in a Netlink message. https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L231 Positional arguments: nlh -- Netlink message header (nlmsghdr class instance). hdrlen -- length of family specific header (integer). a...
def function[nlmsg_find_attr, parameter[nlh, hdrlen, attrtype]]: constant[Find a specific attribute in a Netlink message. https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L231 Positional arguments: nlh -- Netlink message header (nlmsghdr class instance). hdrlen -- length of family s...
keyword[def] identifier[nlmsg_find_attr] ( identifier[nlh] , identifier[hdrlen] , identifier[attrtype] ): literal[string] keyword[return] identifier[nla_find] ( identifier[nlmsg_attrdata] ( identifier[nlh] , identifier[hdrlen] ), identifier[nlmsg_attrlen] ( identifier[nlh] , identifier[hdrlen] ), identifi...
def nlmsg_find_attr(nlh, hdrlen, attrtype): """Find a specific attribute in a Netlink message. https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L231 Positional arguments: nlh -- Netlink message header (nlmsghdr class instance). hdrlen -- length of family specific header (integer). a...
def _cumcount_array(self, ascending=True): """ Parameters ---------- ascending : bool, default True If False, number in reverse, from length of group - 1 to 0. Notes ----- this is currently implementing sort=False (though the default is sort=T...
def function[_cumcount_array, parameter[self, ascending]]: constant[ Parameters ---------- ascending : bool, default True If False, number in reverse, from length of group - 1 to 0. Notes ----- this is currently implementing sort=False (though...
keyword[def] identifier[_cumcount_array] ( identifier[self] , identifier[ascending] = keyword[True] ): literal[string] identifier[ids] , identifier[_] , identifier[ngroups] = identifier[self] . identifier[grouper] . identifier[group_info] identifier[sorter] = identifier[get_group_index_so...
def _cumcount_array(self, ascending=True): """ Parameters ---------- ascending : bool, default True If False, number in reverse, from length of group - 1 to 0. Notes ----- this is currently implementing sort=False (though the default is sort=True)...
def execute(self, resource, **kw): """ Execute the task and return a TaskOperationPoller. :rtype: TaskOperationPoller """ params = kw.pop('params', {}) json = kw.pop('json', None) task = self.make_request( TaskRunFailed, method='cr...
def function[execute, parameter[self, resource]]: constant[ Execute the task and return a TaskOperationPoller. :rtype: TaskOperationPoller ] variable[params] assign[=] call[name[kw].pop, parameter[constant[params], dictionary[[], []]]] variable[json] assign[=] ca...
keyword[def] identifier[execute] ( identifier[self] , identifier[resource] ,** identifier[kw] ): literal[string] identifier[params] = identifier[kw] . identifier[pop] ( literal[string] ,{}) identifier[json] = identifier[kw] . identifier[pop] ( literal[string] , keyword[None] ) ide...
def execute(self, resource, **kw): """ Execute the task and return a TaskOperationPoller. :rtype: TaskOperationPoller """ params = kw.pop('params', {}) json = kw.pop('json', None) task = self.make_request(TaskRunFailed, method='create', params=params, json=json, resource...
def get_metric_values(self): """ Get the faked metrics, for all metric groups and all resources that have been prepared on the manager object of this context object. Returns: iterable of tuple (group_name, iterable of values): The faked metrics, in the order they ...
def function[get_metric_values, parameter[self]]: constant[ Get the faked metrics, for all metric groups and all resources that have been prepared on the manager object of this context object. Returns: iterable of tuple (group_name, iterable of values): The faked ...
keyword[def] identifier[get_metric_values] ( identifier[self] ): literal[string] identifier[group_names] = identifier[self] . identifier[properties] . identifier[get] ( literal[string] , keyword[None] ) keyword[if] keyword[not] identifier[group_names] : identifier[group_name...
def get_metric_values(self): """ Get the faked metrics, for all metric groups and all resources that have been prepared on the manager object of this context object. Returns: iterable of tuple (group_name, iterable of values): The faked metrics, in the order they had ...
def set_proxy (self, proxy): """Parse given proxy information and store parsed values. Note that only http:// proxies are supported, both for ftp:// and http:// URLs. """ self.proxy = proxy self.proxytype = "http" self.proxyauth = None if not self.proxy: ...
def function[set_proxy, parameter[self, proxy]]: constant[Parse given proxy information and store parsed values. Note that only http:// proxies are supported, both for ftp:// and http:// URLs. ] name[self].proxy assign[=] name[proxy] name[self].proxytype assign[=] constan...
keyword[def] identifier[set_proxy] ( identifier[self] , identifier[proxy] ): literal[string] identifier[self] . identifier[proxy] = identifier[proxy] identifier[self] . identifier[proxytype] = literal[string] identifier[self] . identifier[proxyauth] = keyword[None] key...
def set_proxy(self, proxy): """Parse given proxy information and store parsed values. Note that only http:// proxies are supported, both for ftp:// and http:// URLs. """ self.proxy = proxy self.proxytype = 'http' self.proxyauth = None if not self.proxy: return # depe...
def html_elem(e, ct, withtype=False): """ Format a result element as an HTML table cell. @param e (list): a pair \c (value,type) @param ct (str): cell type (th or td) @param withtype (bool): add an additional cell with the element type """ # Header cell if ct == 'th': retur...
def function[html_elem, parameter[e, ct, withtype]]: constant[ Format a result element as an HTML table cell. @param e (list): a pair \c (value,type) @param ct (str): cell type (th or td) @param withtype (bool): add an additional cell with the element type ] if compare[name[ct]...
keyword[def] identifier[html_elem] ( identifier[e] , identifier[ct] , identifier[withtype] = keyword[False] ): literal[string] keyword[if] identifier[ct] == literal[string] : keyword[return] literal[string] . identifier[format] (* identifier[e] ) keyword[if] identifier[withtype] keyword[e...
def html_elem(e, ct, withtype=False): """ Format a result element as an HTML table cell. @param e (list): a pair \\c (value,type) @param ct (str): cell type (th or td) @param withtype (bool): add an additional cell with the element type """ # Header cell if ct == 'th': retu...
def plot_prior_dates(self, dwidth=30, ax=None): """Plot prior chronology dates in age-depth plot""" if ax is None: ax = plt.gca() depth, probs = self.prior_dates() pat = [] for i, d in enumerate(depth): p = probs[i] z = np.array([p[:, 0], dwidt...
def function[plot_prior_dates, parameter[self, dwidth, ax]]: constant[Plot prior chronology dates in age-depth plot] if compare[name[ax] is constant[None]] begin[:] variable[ax] assign[=] call[name[plt].gca, parameter[]] <ast.Tuple object at 0x7da2045659c0> assign[=] call[name[se...
keyword[def] identifier[plot_prior_dates] ( identifier[self] , identifier[dwidth] = literal[int] , identifier[ax] = keyword[None] ): literal[string] keyword[if] identifier[ax] keyword[is] keyword[None] : identifier[ax] = identifier[plt] . identifier[gca] () identifier[depth...
def plot_prior_dates(self, dwidth=30, ax=None): """Plot prior chronology dates in age-depth plot""" if ax is None: ax = plt.gca() # depends on [control=['if'], data=['ax']] (depth, probs) = self.prior_dates() pat = [] for (i, d) in enumerate(depth): p = probs[i] z = np.array...
def get_content(self, offset, size): """Return the specified number of bytes from the current section.""" return _bfd.section_get_content(self.bfd, self._ptr, offset, size)
def function[get_content, parameter[self, offset, size]]: constant[Return the specified number of bytes from the current section.] return[call[name[_bfd].section_get_content, parameter[name[self].bfd, name[self]._ptr, name[offset], name[size]]]]
keyword[def] identifier[get_content] ( identifier[self] , identifier[offset] , identifier[size] ): literal[string] keyword[return] identifier[_bfd] . identifier[section_get_content] ( identifier[self] . identifier[bfd] , identifier[self] . identifier[_ptr] , identifier[offset] , identifier[size] )
def get_content(self, offset, size): """Return the specified number of bytes from the current section.""" return _bfd.section_get_content(self.bfd, self._ptr, offset, size)
def whisper(self, peer, msg_p): """ Send message to single peer, specified as a UUID string Destroys message after sending """ return lib.zyre_whisper(self._as_parameter_, peer, byref(czmq.zmsg_p.from_param(msg_p)))
def function[whisper, parameter[self, peer, msg_p]]: constant[ Send message to single peer, specified as a UUID string Destroys message after sending ] return[call[name[lib].zyre_whisper, parameter[name[self]._as_parameter_, name[peer], call[name[byref], parameter[call[name[czmq].zmsg_p.from...
keyword[def] identifier[whisper] ( identifier[self] , identifier[peer] , identifier[msg_p] ): literal[string] keyword[return] identifier[lib] . identifier[zyre_whisper] ( identifier[self] . identifier[_as_parameter_] , identifier[peer] , identifier[byref] ( identifier[czmq] . identifier[zmsg_p] . ...
def whisper(self, peer, msg_p): """ Send message to single peer, specified as a UUID string Destroys message after sending """ return lib.zyre_whisper(self._as_parameter_, peer, byref(czmq.zmsg_p.from_param(msg_p)))
def get_m2m_value(session, request, obj): """ Set m2m value for model obj from request params like "group[]" :Parameters: - `session`: SQLAlchemy DBSession - `request`: request as dict - `obj`: model instance """ params = {} ''' m2m_request: {u'comp...
def function[get_m2m_value, parameter[session, request, obj]]: constant[ Set m2m value for model obj from request params like "group[]" :Parameters: - `session`: SQLAlchemy DBSession - `request`: request as dict - `obj`: model instance ] variable[params]...
keyword[def] identifier[get_m2m_value] ( identifier[session] , identifier[request] , identifier[obj] ): literal[string] identifier[params] ={} literal[string] identifier[m2m_request] ={ identifier[k] : identifier[v] keyword[for] identifier[k] , identifier[v] keyword[in] identifier[list] ( id...
def get_m2m_value(session, request, obj): """ Set m2m value for model obj from request params like "group[]" :Parameters: - `session`: SQLAlchemy DBSession - `request`: request as dict - `obj`: model instance """ params = {} ' m2m_request:\n\n {u\'com...
def sqrt_rc_imp(Ns,alpha,M=6): """ A truncated square root raised cosine pulse used in digital communications. The pulse shaping factor :math:`0 < \\alpha < 1` is required as well as the truncation factor M which sets the pulse duration to be :math:`2*M*T_{symbol}`. Parameters ----------...
def function[sqrt_rc_imp, parameter[Ns, alpha, M]]: constant[ A truncated square root raised cosine pulse used in digital communications. The pulse shaping factor :math:`0 < \alpha < 1` is required as well as the truncation factor M which sets the pulse duration to be :math:`2*M*T_{symbol}`. ...
keyword[def] identifier[sqrt_rc_imp] ( identifier[Ns] , identifier[alpha] , identifier[M] = literal[int] ): literal[string] identifier[n] = identifier[np] . identifier[arange] (- identifier[M] * identifier[Ns] , identifier[M] * identifier[Ns] + literal[int] ) identifier[b] = identifier[np] . iden...
def sqrt_rc_imp(Ns, alpha, M=6): """ A truncated square root raised cosine pulse used in digital communications. The pulse shaping factor :math:`0 < \\alpha < 1` is required as well as the truncation factor M which sets the pulse duration to be :math:`2*M*T_{symbol}`. Parameters --------...
def _add_validator(fv, validator_instance): """Register new flags validator to be checked. Args: fv: flags.FlagValues, the FlagValues instance to add the validator. validator_instance: validators.Validator, the validator to add. Raises: KeyError: Raised when validators work with a non-existing flag. ...
def function[_add_validator, parameter[fv, validator_instance]]: constant[Register new flags validator to be checked. Args: fv: flags.FlagValues, the FlagValues instance to add the validator. validator_instance: validators.Validator, the validator to add. Raises: KeyError: Raised when validator...
keyword[def] identifier[_add_validator] ( identifier[fv] , identifier[validator_instance] ): literal[string] keyword[for] identifier[flag_name] keyword[in] identifier[validator_instance] . identifier[get_flags_names] (): identifier[fv] [ identifier[flag_name] ]. identifier[validators] . identifier[appe...
def _add_validator(fv, validator_instance): """Register new flags validator to be checked. Args: fv: flags.FlagValues, the FlagValues instance to add the validator. validator_instance: validators.Validator, the validator to add. Raises: KeyError: Raised when validators work with a non-existing flag...
def run(args): """Start an oct project :param Namespace args: the commande-line arguments """ kwargs = vars(args) if 'func' in kwargs: del kwargs['func'] project_path = kwargs.pop('project_path') config = configure(project_path, kwargs.get('config_file')) output_dir = kwargs....
def function[run, parameter[args]]: constant[Start an oct project :param Namespace args: the commande-line arguments ] variable[kwargs] assign[=] call[name[vars], parameter[name[args]]] if compare[constant[func] in name[kwargs]] begin[:] <ast.Delete object at 0x7da18bcc8f40> ...
keyword[def] identifier[run] ( identifier[args] ): literal[string] identifier[kwargs] = identifier[vars] ( identifier[args] ) keyword[if] literal[string] keyword[in] identifier[kwargs] : keyword[del] identifier[kwargs] [ literal[string] ] identifier[project_path] = identifier[kwarg...
def run(args): """Start an oct project :param Namespace args: the commande-line arguments """ kwargs = vars(args) if 'func' in kwargs: del kwargs['func'] # depends on [control=['if'], data=['kwargs']] project_path = kwargs.pop('project_path') config = configure(project_path, kwargs...
def user_post_save_handler(**kwargs): """Sends a metric to InfluxDB when a new User object is created.""" if kwargs.get('created'): total = get_user_model().objects.all().count() data = [{ 'measurement': 'django_auth_user_create', 'tags': {'host': settings.INFLUXDB_TAGS_H...
def function[user_post_save_handler, parameter[]]: constant[Sends a metric to InfluxDB when a new User object is created.] if call[name[kwargs].get, parameter[constant[created]]] begin[:] variable[total] assign[=] call[call[call[name[get_user_model], parameter[]].objects.all, parameter[]...
keyword[def] identifier[user_post_save_handler] (** identifier[kwargs] ): literal[string] keyword[if] identifier[kwargs] . identifier[get] ( literal[string] ): identifier[total] = identifier[get_user_model] (). identifier[objects] . identifier[all] (). identifier[count] () identifier[dat...
def user_post_save_handler(**kwargs): """Sends a metric to InfluxDB when a new User object is created.""" if kwargs.get('created'): total = get_user_model().objects.all().count() data = [{'measurement': 'django_auth_user_create', 'tags': {'host': settings.INFLUXDB_TAGS_HOST}, 'fields': {'value':...
def setup_pcap_inputs(self, input_data): ''' Write the PCAPs to disk for Bro to process and return the pcap filenames ''' # Setup the pcap in the input data for processing by Bro. The input # may be either an individual sample or a sample set. file_list = [] if 'sample' in input...
def function[setup_pcap_inputs, parameter[self, input_data]]: constant[ Write the PCAPs to disk for Bro to process and return the pcap filenames ] variable[file_list] assign[=] list[[]] if compare[constant[sample] in name[input_data]] begin[:] variable[raw_bytes] assign[=] call[c...
keyword[def] identifier[setup_pcap_inputs] ( identifier[self] , identifier[input_data] ): literal[string] identifier[file_list] =[] keyword[if] literal[string] keyword[in] identifier[input_data] : identifier[raw_bytes] = identifier[input_data] [ literal[s...
def setup_pcap_inputs(self, input_data): """ Write the PCAPs to disk for Bro to process and return the pcap filenames """ # Setup the pcap in the input data for processing by Bro. The input # may be either an individual sample or a sample set. file_list = [] if 'sample' in input_data: raw_by...
def _handle_paper(article): """ Yields a :class:`.Paper` from an article ET node. Parameters ---------- article : Element ElementTree Element 'article'. Returns ------- paper : :class:`.Paper` """ paper = Paper() pdata = dict_from_node(article) for key, value i...
def function[_handle_paper, parameter[article]]: constant[ Yields a :class:`.Paper` from an article ET node. Parameters ---------- article : Element ElementTree Element 'article'. Returns ------- paper : :class:`.Paper` ] variable[paper] assign[=] call[name[Pape...
keyword[def] identifier[_handle_paper] ( identifier[article] ): literal[string] identifier[paper] = identifier[Paper] () identifier[pdata] = identifier[dict_from_node] ( identifier[article] ) keyword[for] identifier[key] , identifier[value] keyword[in] identifier[pdata] . identifier[iteritems...
def _handle_paper(article): """ Yields a :class:`.Paper` from an article ET node. Parameters ---------- article : Element ElementTree Element 'article'. Returns ------- paper : :class:`.Paper` """ paper = Paper() pdata = dict_from_node(article) for (key, value) ...
def map(self, mapper): """ Map categories using input correspondence (dict, Series, or function). Parameters ---------- mapper : dict, Series, callable The correspondence from old values to new. Returns ------- SparseArray The out...
def function[map, parameter[self, mapper]]: constant[ Map categories using input correspondence (dict, Series, or function). Parameters ---------- mapper : dict, Series, callable The correspondence from old values to new. Returns ------- Spar...
keyword[def] identifier[map] ( identifier[self] , identifier[mapper] ): literal[string] keyword[if] identifier[isinstance] ( identifier[mapper] , identifier[ABCSeries] ): identifier[mapper] = identifier[mapper] . identifier[to_dict] () keyword[if] ...
def map(self, mapper): """ Map categories using input correspondence (dict, Series, or function). Parameters ---------- mapper : dict, Series, callable The correspondence from old values to new. Returns ------- SparseArray The output ...
def libvlc_media_list_player_play_item(p_mlp, p_md): '''Play the given media item. @param p_mlp: media list player instance. @param p_md: the media instance. @return: 0 upon success, -1 if the media is not part of the media list. ''' f = _Cfunctions.get('libvlc_media_list_player_play_item', None...
def function[libvlc_media_list_player_play_item, parameter[p_mlp, p_md]]: constant[Play the given media item. @param p_mlp: media list player instance. @param p_md: the media instance. @return: 0 upon success, -1 if the media is not part of the media list. ] variable[f] assign[=] <ast.Bo...
keyword[def] identifier[libvlc_media_list_player_play_item] ( identifier[p_mlp] , identifier[p_md] ): literal[string] identifier[f] = identifier[_Cfunctions] . identifier[get] ( literal[string] , keyword[None] ) keyword[or] identifier[_Cfunction] ( literal[string] ,(( literal[int] ,),( literal[int] ,),), ...
def libvlc_media_list_player_play_item(p_mlp, p_md): """Play the given media item. @param p_mlp: media list player instance. @param p_md: the media instance. @return: 0 upon success, -1 if the media is not part of the media list. """ f = _Cfunctions.get('libvlc_media_list_player_play_item', None...
def parse_operand(self, buf): """ Parses an operand from buf :param buf: a buffer :type buf: iterator/generator/string """ buf = iter(buf) try: operand = 0 for _ in range(self.operand_size): operand <<= 8 op...
def function[parse_operand, parameter[self, buf]]: constant[ Parses an operand from buf :param buf: a buffer :type buf: iterator/generator/string ] variable[buf] assign[=] call[name[iter], parameter[name[buf]]] <ast.Try object at 0x7da1b00542b0>
keyword[def] identifier[parse_operand] ( identifier[self] , identifier[buf] ): literal[string] identifier[buf] = identifier[iter] ( identifier[buf] ) keyword[try] : identifier[operand] = literal[int] keyword[for] identifier[_] keyword[in] identifier[range] ( i...
def parse_operand(self, buf): """ Parses an operand from buf :param buf: a buffer :type buf: iterator/generator/string """ buf = iter(buf) try: operand = 0 for _ in range(self.operand_size): operand <<= 8 operand |= next(buf) # depend...
def preprocess_plain_text_file(self, filename, pmid, extra_annotations): """Preprocess a plain text file for use with ISI reder. Preprocessing results in a new text file with one sentence per line. Parameters ---------- filename : str The name of the plain t...
def function[preprocess_plain_text_file, parameter[self, filename, pmid, extra_annotations]]: constant[Preprocess a plain text file for use with ISI reder. Preprocessing results in a new text file with one sentence per line. Parameters ---------- filename : str ...
keyword[def] identifier[preprocess_plain_text_file] ( identifier[self] , identifier[filename] , identifier[pmid] , identifier[extra_annotations] ): literal[string] keyword[with] identifier[codecs] . identifier[open] ( identifier[filename] , literal[string] , identifier[encoding] = literal[string] ...
def preprocess_plain_text_file(self, filename, pmid, extra_annotations): """Preprocess a plain text file for use with ISI reder. Preprocessing results in a new text file with one sentence per line. Parameters ---------- filename : str The name of the plain text ...
def import_obj(clsname, default_module=None): """ Import the object given by clsname. If default_module is specified, import from this module. """ if default_module is not None: if not clsname.startswith(default_module + '.'): clsname = '{0}.{1}'.format(default_module, clsname) ...
def function[import_obj, parameter[clsname, default_module]]: constant[ Import the object given by clsname. If default_module is specified, import from this module. ] if compare[name[default_module] is_not constant[None]] begin[:] if <ast.UnaryOp object at 0x7da207f02aa0> beg...
keyword[def] identifier[import_obj] ( identifier[clsname] , identifier[default_module] = keyword[None] ): literal[string] keyword[if] identifier[default_module] keyword[is] keyword[not] keyword[None] : keyword[if] keyword[not] identifier[clsname] . identifier[startswith] ( identifier[default...
def import_obj(clsname, default_module=None): """ Import the object given by clsname. If default_module is specified, import from this module. """ if default_module is not None: if not clsname.startswith(default_module + '.'): clsname = '{0}.{1}'.format(default_module, clsname) ...
def filter_values(d, vals=None, list_of_dicts=False, deepcopy=True): """ filters leaf nodes of nested dictionary Parameters ---------- d : dict vals : list values to filter by list_of_dicts: bool treat list of dicts as additional branches deepcopy: bool deepcopy valu...
def function[filter_values, parameter[d, vals, list_of_dicts, deepcopy]]: constant[ filters leaf nodes of nested dictionary Parameters ---------- d : dict vals : list values to filter by list_of_dicts: bool treat list of dicts as additional branches deepcopy: bool ...
keyword[def] identifier[filter_values] ( identifier[d] , identifier[vals] = keyword[None] , identifier[list_of_dicts] = keyword[False] , identifier[deepcopy] = keyword[True] ): literal[string] identifier[vals] =[] keyword[if] identifier[vals] keyword[is] keyword[None] keyword[else] identifier[vals] ...
def filter_values(d, vals=None, list_of_dicts=False, deepcopy=True): """ filters leaf nodes of nested dictionary Parameters ---------- d : dict vals : list values to filter by list_of_dicts: bool treat list of dicts as additional branches deepcopy: bool deepcopy valu...
def site_config_dir(self): """Return ``site_config_dir``.""" directory = appdirs.site_config_dir(self.appname, self.appauthor, version=self.version, multipath=self.multipath) if self.create: self._ensure_directory_exists(directory) return director...
def function[site_config_dir, parameter[self]]: constant[Return ``site_config_dir``.] variable[directory] assign[=] call[name[appdirs].site_config_dir, parameter[name[self].appname, name[self].appauthor]] if name[self].create begin[:] call[name[self]._ensure_directory_exists, par...
keyword[def] identifier[site_config_dir] ( identifier[self] ): literal[string] identifier[directory] = identifier[appdirs] . identifier[site_config_dir] ( identifier[self] . identifier[appname] , identifier[self] . identifier[appauthor] , identifier[version] = identifier[self] . identifier...
def site_config_dir(self): """Return ``site_config_dir``.""" directory = appdirs.site_config_dir(self.appname, self.appauthor, version=self.version, multipath=self.multipath) if self.create: self._ensure_directory_exists(directory) # depends on [control=['if'], data=[]] return directory
def field_cache_to_index_pattern(self, field_cache): """Return a .kibana index-pattern doc_type""" mapping_dict = {} mapping_dict['customFormats'] = "{}" mapping_dict['title'] = self.index_pattern # now post the data into .kibana mapping_dict['fields'] = json.dumps(field_...
def function[field_cache_to_index_pattern, parameter[self, field_cache]]: constant[Return a .kibana index-pattern doc_type] variable[mapping_dict] assign[=] dictionary[[], []] call[name[mapping_dict]][constant[customFormats]] assign[=] constant[{}] call[name[mapping_dict]][constant[title...
keyword[def] identifier[field_cache_to_index_pattern] ( identifier[self] , identifier[field_cache] ): literal[string] identifier[mapping_dict] ={} identifier[mapping_dict] [ literal[string] ]= literal[string] identifier[mapping_dict] [ literal[string] ]= identifier[self] . identi...
def field_cache_to_index_pattern(self, field_cache): """Return a .kibana index-pattern doc_type""" mapping_dict = {} mapping_dict['customFormats'] = '{}' mapping_dict['title'] = self.index_pattern # now post the data into .kibana mapping_dict['fields'] = json.dumps(field_cache, separators=(',', ...
def from_keyed_iterable(iterable, key, filter_func=None): """Construct a dictionary out of an iterable, using an attribute name as the key. Optionally provide a filter function, to determine what should be kept in the dictionary.""" generated = {} for element in iterable: try: ...
def function[from_keyed_iterable, parameter[iterable, key, filter_func]]: constant[Construct a dictionary out of an iterable, using an attribute name as the key. Optionally provide a filter function, to determine what should be kept in the dictionary.] variable[generated] assign[=] dictionary[[]...
keyword[def] identifier[from_keyed_iterable] ( identifier[iterable] , identifier[key] , identifier[filter_func] = keyword[None] ): literal[string] identifier[generated] ={} keyword[for] identifier[element] keyword[in] identifier[iterable] : keyword[try] : identifier[k] = ide...
def from_keyed_iterable(iterable, key, filter_func=None): """Construct a dictionary out of an iterable, using an attribute name as the key. Optionally provide a filter function, to determine what should be kept in the dictionary.""" generated = {} for element in iterable: try: k ...
def print_row(self, row, rstrip=True): """ Format and print the pre-rendered data to the output device. """ line = ''.join(map(str, row)) print(line.rstrip() if rstrip else line, file=self.table.file)
def function[print_row, parameter[self, row, rstrip]]: constant[ Format and print the pre-rendered data to the output device. ] variable[line] assign[=] call[constant[].join, parameter[call[name[map], parameter[name[str], name[row]]]]] call[name[print], parameter[<ast.IfExp object at 0x7da2041da...
keyword[def] identifier[print_row] ( identifier[self] , identifier[row] , identifier[rstrip] = keyword[True] ): literal[string] identifier[line] = literal[string] . identifier[join] ( identifier[map] ( identifier[str] , identifier[row] )) identifier[print] ( identifier[line] . identifier[r...
def print_row(self, row, rstrip=True): """ Format and print the pre-rendered data to the output device. """ line = ''.join(map(str, row)) print(line.rstrip() if rstrip else line, file=self.table.file)
def com_google_fonts_check_metadata_copyright(family_metadata): """METADATA.pb: Copyright notice is the same in all fonts?""" copyright = None fail = False for f in family_metadata.fonts: if copyright and f.copyright != copyright: fail = True copyright = f.copyright if fail: yield FAIL, ("ME...
def function[com_google_fonts_check_metadata_copyright, parameter[family_metadata]]: constant[METADATA.pb: Copyright notice is the same in all fonts?] variable[copyright] assign[=] constant[None] variable[fail] assign[=] constant[False] for taget[name[f]] in starred[name[family_metadata]...
keyword[def] identifier[com_google_fonts_check_metadata_copyright] ( identifier[family_metadata] ): literal[string] identifier[copyright] = keyword[None] identifier[fail] = keyword[False] keyword[for] identifier[f] keyword[in] identifier[family_metadata] . identifier[fonts] : keyword[if] ident...
def com_google_fonts_check_metadata_copyright(family_metadata): """METADATA.pb: Copyright notice is the same in all fonts?""" copyright = None fail = False for f in family_metadata.fonts: if copyright and f.copyright != copyright: fail = True # depends on [control=['if'], data=[]] ...
def profile_loglike(self, x): """Profile log-likelihood. Returns ``L_prof(x,y=y_min|z')`` : where y_min is the value of y that minimizes L for a given x. This will used the cached '~fermipy.castro.Interp...
def function[profile_loglike, parameter[self, x]]: constant[Profile log-likelihood. Returns ``L_prof(x,y=y_min|z')`` : where y_min is the value of y that minimizes L for a given x. This will used the cac...
keyword[def] identifier[profile_loglike] ( identifier[self] , identifier[x] ): literal[string] keyword[if] identifier[self] . identifier[_prof_interp] keyword[is] keyword[None] : keyword[return] identifier[self] . identifier[_profile_loglike] ( identifier[x] )[ literal[int...
def profile_loglike(self, x): """Profile log-likelihood. Returns ``L_prof(x,y=y_min|z')`` : where y_min is the value of y that minimizes L for a given x. This will used the cached '~fermipy.castro.Interpolat...
def is_pg_at_least_nine_two(self): """ Some queries have different syntax depending what version of postgres we are querying against. :returns: boolean """ if self._is_pg_at_least_nine_two is None: results = self.version() regex = re.compile("Pos...
def function[is_pg_at_least_nine_two, parameter[self]]: constant[ Some queries have different syntax depending what version of postgres we are querying against. :returns: boolean ] if compare[name[self]._is_pg_at_least_nine_two is constant[None]] begin[:] ...
keyword[def] identifier[is_pg_at_least_nine_two] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_is_pg_at_least_nine_two] keyword[is] keyword[None] : identifier[results] = identifier[self] . identifier[version] () identifier[regex] = id...
def is_pg_at_least_nine_two(self): """ Some queries have different syntax depending what version of postgres we are querying against. :returns: boolean """ if self._is_pg_at_least_nine_two is None: results = self.version() regex = re.compile('PostgreSQL (\\d+\\.\...
def dump(self, obj): """ Dumps the given object in the Java serialization format """ self.references = [] self.object_obj = obj self.object_stream = BytesIO() self._writeStreamHeader() self.writeObject(obj) return self.object_stream.getvalue()
def function[dump, parameter[self, obj]]: constant[ Dumps the given object in the Java serialization format ] name[self].references assign[=] list[[]] name[self].object_obj assign[=] name[obj] name[self].object_stream assign[=] call[name[BytesIO], parameter[]] cal...
keyword[def] identifier[dump] ( identifier[self] , identifier[obj] ): literal[string] identifier[self] . identifier[references] =[] identifier[self] . identifier[object_obj] = identifier[obj] identifier[self] . identifier[object_stream] = identifier[BytesIO] () identifie...
def dump(self, obj): """ Dumps the given object in the Java serialization format """ self.references = [] self.object_obj = obj self.object_stream = BytesIO() self._writeStreamHeader() self.writeObject(obj) return self.object_stream.getvalue()
def GetCompressedStreamTypeIndicators(cls, path_spec, resolver_context=None): """Determines if a file contains a supported compressed stream types. Args: path_spec (PathSpec): path specification. resolver_context (Optional[Context]): resolver context, where None represents the built-in co...
def function[GetCompressedStreamTypeIndicators, parameter[cls, path_spec, resolver_context]]: constant[Determines if a file contains a supported compressed stream types. Args: path_spec (PathSpec): path specification. resolver_context (Optional[Context]): resolver context, where None ...
keyword[def] identifier[GetCompressedStreamTypeIndicators] ( identifier[cls] , identifier[path_spec] , identifier[resolver_context] = keyword[None] ): literal[string] keyword[if] ( identifier[cls] . identifier[_compressed_stream_remainder_list] keyword[is] keyword[None] keyword[or] identifier[cls]...
def GetCompressedStreamTypeIndicators(cls, path_spec, resolver_context=None): """Determines if a file contains a supported compressed stream types. Args: path_spec (PathSpec): path specification. resolver_context (Optional[Context]): resolver context, where None represents the built-in co...
def _load_from_file(self, filename): """Find filename in tar, and load it""" if filename in self.fdata: return self.fdata[filename] else: filepath = find_in_tarball(self.tarloc, filename) return read_from_tarball(self.tarloc, filepath)
def function[_load_from_file, parameter[self, filename]]: constant[Find filename in tar, and load it] if compare[name[filename] in name[self].fdata] begin[:] return[call[name[self].fdata][name[filename]]]
keyword[def] identifier[_load_from_file] ( identifier[self] , identifier[filename] ): literal[string] keyword[if] identifier[filename] keyword[in] identifier[self] . identifier[fdata] : keyword[return] identifier[self] . identifier[fdata] [ identifier[filename] ] keyword[e...
def _load_from_file(self, filename): """Find filename in tar, and load it""" if filename in self.fdata: return self.fdata[filename] # depends on [control=['if'], data=['filename']] else: filepath = find_in_tarball(self.tarloc, filename) return read_from_tarball(self.tarloc, filepath...
def _assert_valid_permission(self, perm_str): """Raise D1 exception if ``perm_str`` is not a valid permission.""" if perm_str not in ORDERED_PERM_LIST: raise d1_common.types.exceptions.InvalidRequest( 0, 'Permission must be one of {}. perm_str="{}"'.format( ...
def function[_assert_valid_permission, parameter[self, perm_str]]: constant[Raise D1 exception if ``perm_str`` is not a valid permission.] if compare[name[perm_str] <ast.NotIn object at 0x7da2590d7190> name[ORDERED_PERM_LIST]] begin[:] <ast.Raise object at 0x7da18dc04580>
keyword[def] identifier[_assert_valid_permission] ( identifier[self] , identifier[perm_str] ): literal[string] keyword[if] identifier[perm_str] keyword[not] keyword[in] identifier[ORDERED_PERM_LIST] : keyword[raise] identifier[d1_common] . identifier[types] . identifier[exceptions...
def _assert_valid_permission(self, perm_str): """Raise D1 exception if ``perm_str`` is not a valid permission.""" if perm_str not in ORDERED_PERM_LIST: raise d1_common.types.exceptions.InvalidRequest(0, 'Permission must be one of {}. perm_str="{}"'.format(', '.join(ORDERED_PERM_LIST), perm_str)) # depe...
def update_channels(self): """Update the channels list when a new group is selected.""" group_dict = {k['name']: i for i, k in enumerate(self.groups)} group_index = group_dict[self.idx_group.currentText()] self.one_grp = self.groups[group_index] self.idx_chan.clear() se...
def function[update_channels, parameter[self]]: constant[Update the channels list when a new group is selected.] variable[group_dict] assign[=] <ast.DictComp object at 0x7da1b26afd00> variable[group_index] assign[=] call[name[group_dict]][call[name[self].idx_group.currentText, parameter[]]] ...
keyword[def] identifier[update_channels] ( identifier[self] ): literal[string] identifier[group_dict] ={ identifier[k] [ literal[string] ]: identifier[i] keyword[for] identifier[i] , identifier[k] keyword[in] identifier[enumerate] ( identifier[self] . identifier[groups] )} identifier[g...
def update_channels(self): """Update the channels list when a new group is selected.""" group_dict = {k['name']: i for (i, k) in enumerate(self.groups)} group_index = group_dict[self.idx_group.currentText()] self.one_grp = self.groups[group_index] self.idx_chan.clear() self.idx_chan.setSelection...
def proj_l1(x, radius=1, out=None): r"""Projection onto l1-ball. Projection onto:: ``{ x \in X | ||x||_1 \leq r}`` with ``r`` being the radius. Parameters ---------- space : `LinearSpace` Space / domain ``X``. radius : positive float, optional Radius ``r`` of the ...
def function[proj_l1, parameter[x, radius, out]]: constant[Projection onto l1-ball. Projection onto:: ``{ x \in X | ||x||_1 \leq r}`` with ``r`` being the radius. Parameters ---------- space : `LinearSpace` Space / domain ``X``. radius : positive float, optional ...
keyword[def] identifier[proj_l1] ( identifier[x] , identifier[radius] = literal[int] , identifier[out] = keyword[None] ): literal[string] keyword[if] identifier[out] keyword[is] keyword[None] : identifier[out] = identifier[x] . identifier[space] . identifier[element] () identifier[u] = i...
def proj_l1(x, radius=1, out=None): """Projection onto l1-ball. Projection onto:: ``{ x \\in X | ||x||_1 \\leq r}`` with ``r`` being the radius. Parameters ---------- space : `LinearSpace` Space / domain ``X``. radius : positive float, optional Radius ``r`` of the...
def calculate_tip_probe_hotspots( tip_length: float, tip_probe_settings: tip_probe_config)\ -> List[HotSpot]: """ Generate a list of tuples describing motions for doing the xy part of tip probe based on the config's description of the tip probe box. """ # probe_dimensions is ...
def function[calculate_tip_probe_hotspots, parameter[tip_length, tip_probe_settings]]: constant[ Generate a list of tuples describing motions for doing the xy part of tip probe based on the config's description of the tip probe box. ] <ast.Tuple object at 0x7da20e9b2f50> assign[=] name[tip_p...
keyword[def] identifier[calculate_tip_probe_hotspots] ( identifier[tip_length] : identifier[float] , identifier[tip_probe_settings] : identifier[tip_probe_config] )-> identifier[List] [ identifier[HotSpot] ]: literal[string] identifier[size_x] , identifier[size_y] , identifier[size_z] = identifier[t...
def calculate_tip_probe_hotspots(tip_length: float, tip_probe_settings: tip_probe_config) -> List[HotSpot]: """ Generate a list of tuples describing motions for doing the xy part of tip probe based on the config's description of the tip probe box. """ # probe_dimensions is the external bounding box ...
def load_network_model(model): ''' Loads metabolic network models in metabolitics. :param str model: model name ''' if type(model) == str: if model in ['ecoli', 'textbook', 'salmonella']: return cb.test.create_test_model(model) elif model == 'recon2': return ...
def function[load_network_model, parameter[model]]: constant[ Loads metabolic network models in metabolitics. :param str model: model name ] if compare[call[name[type], parameter[name[model]]] equal[==] name[str]] begin[:] if compare[name[model] in list[[<ast.Constant object...
keyword[def] identifier[load_network_model] ( identifier[model] ): literal[string] keyword[if] identifier[type] ( identifier[model] )== identifier[str] : keyword[if] identifier[model] keyword[in] [ literal[string] , literal[string] , literal[string] ]: keyword[return] identifier[c...
def load_network_model(model): """ Loads metabolic network models in metabolitics. :param str model: model name """ if type(model) == str: if model in ['ecoli', 'textbook', 'salmonella']: return cb.test.create_test_model(model) # depends on [control=['if'], data=['model']] ...
def deserialize_from_headers(headers): """Deserialize a DataONE Exception that is stored in a map of HTTP headers (used in responses to HTTP HEAD requests).""" return create_exception_by_name( _get_header(headers, 'DataONE-Exception-Name'), _get_header(headers, 'DataONE-Exception-DetailCode'...
def function[deserialize_from_headers, parameter[headers]]: constant[Deserialize a DataONE Exception that is stored in a map of HTTP headers (used in responses to HTTP HEAD requests).] return[call[name[create_exception_by_name], parameter[call[name[_get_header], parameter[name[headers], constant[DataONE...
keyword[def] identifier[deserialize_from_headers] ( identifier[headers] ): literal[string] keyword[return] identifier[create_exception_by_name] ( identifier[_get_header] ( identifier[headers] , literal[string] ), identifier[_get_header] ( identifier[headers] , literal[string] ), identifier[...
def deserialize_from_headers(headers): """Deserialize a DataONE Exception that is stored in a map of HTTP headers (used in responses to HTTP HEAD requests).""" return create_exception_by_name(_get_header(headers, 'DataONE-Exception-Name'), _get_header(headers, 'DataONE-Exception-DetailCode'), _get_header(he...
def time_slices_to_layers(graphs, interslice_weight=1, slice_attr='slice', vertex_id_attr='id', edge_type_attr='type', weight_attr='weight'): """ Convert time slices to layer graphs. Ea...
def function[time_slices_to_layers, parameter[graphs, interslice_weight, slice_attr, vertex_id_attr, edge_type_attr, weight_attr]]: constant[ Convert time slices to layer graphs. Each graph is considered to represent a time slice. This function simply connects all the consecutive slices (i.e. the slice gra...
keyword[def] identifier[time_slices_to_layers] ( identifier[graphs] , identifier[interslice_weight] = literal[int] , identifier[slice_attr] = literal[string] , identifier[vertex_id_attr] = literal[string] , identifier[edge_type_attr] = literal[string] , identifier[weight_attr] = literal[string] ): literal[str...
def time_slices_to_layers(graphs, interslice_weight=1, slice_attr='slice', vertex_id_attr='id', edge_type_attr='type', weight_attr='weight'): """ Convert time slices to layer graphs. Each graph is considered to represent a time slice. This function simply connects all the consecutive slices (i.e. the slice gra...
def main(): """Entry point when running as script from commandline.""" from docopt import docopt args = docopt(__doc__) infile = args['INFILE'] outfile = args['OUTFILE'] i3extract(infile, outfile)
def function[main, parameter[]]: constant[Entry point when running as script from commandline.] from relative_module[docopt] import module[docopt] variable[args] assign[=] call[name[docopt], parameter[name[__doc__]]] variable[infile] assign[=] call[name[args]][constant[INFILE]] varia...
keyword[def] identifier[main] (): literal[string] keyword[from] identifier[docopt] keyword[import] identifier[docopt] identifier[args] = identifier[docopt] ( identifier[__doc__] ) identifier[infile] = identifier[args] [ literal[string] ] identifier[outfile] = identifier[args] [ literal[s...
def main(): """Entry point when running as script from commandline.""" from docopt import docopt args = docopt(__doc__) infile = args['INFILE'] outfile = args['OUTFILE'] i3extract(infile, outfile)
def domains(db, domain=None, top=False): """List the domains available in the registry. The function will return the list of domains. Settting the top flag, it will look for those domains that are top domains. If domain parameter is set, it will only return the information about that domain. When ...
def function[domains, parameter[db, domain, top]]: constant[List the domains available in the registry. The function will return the list of domains. Settting the top flag, it will look for those domains that are top domains. If domain parameter is set, it will only return the information about tha...
keyword[def] identifier[domains] ( identifier[db] , identifier[domain] = keyword[None] , identifier[top] = keyword[False] ): literal[string] identifier[doms] =[] keyword[with] identifier[db] . identifier[connect] () keyword[as] identifier[session] : keyword[if] identifier[domain] : ...
def domains(db, domain=None, top=False): """List the domains available in the registry. The function will return the list of domains. Settting the top flag, it will look for those domains that are top domains. If domain parameter is set, it will only return the information about that domain. When ...
def _wait_job_completion(self): """Wait for the cache to be empty before resizing the pool.""" # Issue a warning to the user about the bad effect of this usage. if len(self._pending_work_items) > 0: warnings.warn("Trying to resize an executor with running jobs: " ...
def function[_wait_job_completion, parameter[self]]: constant[Wait for the cache to be empty before resizing the pool.] if compare[call[name[len], parameter[name[self]._pending_work_items]] greater[>] constant[0]] begin[:] call[name[warnings].warn, parameter[constant[Trying to resize an ...
keyword[def] identifier[_wait_job_completion] ( identifier[self] ): literal[string] keyword[if] identifier[len] ( identifier[self] . identifier[_pending_work_items] )> literal[int] : identifier[warnings] . identifier[warn] ( literal[string] literal[string] , ...
def _wait_job_completion(self): """Wait for the cache to be empty before resizing the pool.""" # Issue a warning to the user about the bad effect of this usage. if len(self._pending_work_items) > 0: warnings.warn('Trying to resize an executor with running jobs: waiting for jobs completion before res...
def _render_item(self, depth, key, value = None, **settings): """ Format single list item. """ strptrn = self.INDENT * depth lchar = self.lchar(settings[self.SETTING_LIST_STYLE]) s = self._es_text(settings, settings[self.SETTING_LIST_FORMATING]) lchar = self.fmt...
def function[_render_item, parameter[self, depth, key, value]]: constant[ Format single list item. ] variable[strptrn] assign[=] binary_operation[name[self].INDENT * name[depth]] variable[lchar] assign[=] call[name[self].lchar, parameter[call[name[settings]][name[self].SETTING_LI...
keyword[def] identifier[_render_item] ( identifier[self] , identifier[depth] , identifier[key] , identifier[value] = keyword[None] ,** identifier[settings] ): literal[string] identifier[strptrn] = identifier[self] . identifier[INDENT] * identifier[depth] identifier[lchar] = identifier[se...
def _render_item(self, depth, key, value=None, **settings): """ Format single list item. """ strptrn = self.INDENT * depth lchar = self.lchar(settings[self.SETTING_LIST_STYLE]) s = self._es_text(settings, settings[self.SETTING_LIST_FORMATING]) lchar = self.fmt_text(lchar, **s) st...
def nvmlDeviceGetMemoryErrorCounter(handle, errorType, counterType, locationType): r""" /** * Retrieves the requested memory error counter for the device. * * For Fermi &tm; or newer fully supported devices. * Requires \a NVML_INFOROM_ECC version 2.0 or higher to report aggregate location-ba...
def function[nvmlDeviceGetMemoryErrorCounter, parameter[handle, errorType, counterType, locationType]]: constant[ /** * Retrieves the requested memory error counter for the device. * * For Fermi &tm; or newer fully supported devices. * Requires \a NVML_INFOROM_ECC version 2.0 or higher t...
keyword[def] identifier[nvmlDeviceGetMemoryErrorCounter] ( identifier[handle] , identifier[errorType] , identifier[counterType] , identifier[locationType] ): literal[string] identifier[c_count] = identifier[c_ulonglong] () identifier[fn] = identifier[_nvmlGetFunctionPointer] ( literal[string] ) i...
def nvmlDeviceGetMemoryErrorCounter(handle, errorType, counterType, locationType): """ /** * Retrieves the requested memory error counter for the device. * * For Fermi &tm; or newer fully supported devices. * Requires \\a NVML_INFOROM_ECC version 2.0 or higher to report aggregate location-ba...
def pauseProducing(self): """ Pause the reception of messages by canceling all existing consumers. This does not disconnect from the server. Message reception can be resumed with :meth:`resumeProducing`. Returns: Deferred: fired when the production is paused. ...
def function[pauseProducing, parameter[self]]: constant[ Pause the reception of messages by canceling all existing consumers. This does not disconnect from the server. Message reception can be resumed with :meth:`resumeProducing`. Returns: Deferred: fired when the p...
keyword[def] identifier[pauseProducing] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_running] : keyword[return] identifier[self] . identifier[_running] = keyword[False] keyword[for] identifier[consumer...
def pauseProducing(self): """ Pause the reception of messages by canceling all existing consumers. This does not disconnect from the server. Message reception can be resumed with :meth:`resumeProducing`. Returns: Deferred: fired when the production is paused. ""...
def touch(fpath, mode=0o666, dir_fd=None, verbose=0, **kwargs): """ change file timestamps Works like the touch unix utility Args: fpath (PathLike): name of the file mode (int): file permissions (python3 and unix only) dir_fd (file): optional directory file descriptor. If speci...
def function[touch, parameter[fpath, mode, dir_fd, verbose]]: constant[ change file timestamps Works like the touch unix utility Args: fpath (PathLike): name of the file mode (int): file permissions (python3 and unix only) dir_fd (file): optional directory file descriptor. ...
keyword[def] identifier[touch] ( identifier[fpath] , identifier[mode] = literal[int] , identifier[dir_fd] = keyword[None] , identifier[verbose] = literal[int] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[verbose] : identifier[print] ( literal[string] . identifier[format] ( ide...
def touch(fpath, mode=438, dir_fd=None, verbose=0, **kwargs): """ change file timestamps Works like the touch unix utility Args: fpath (PathLike): name of the file mode (int): file permissions (python3 and unix only) dir_fd (file): optional directory file descriptor. If specifi...
def cdf(self, y, f, var): r""" Cumulative density function of the likelihood. Parameters ---------- y: ndarray query quantiles, i.e.\ :math:`P(Y \leq y)`. f: ndarray latent function from the GLM prior (:math:`\mathbf{f} = \boldsymbol\...
def function[cdf, parameter[self, y, f, var]]: constant[ Cumulative density function of the likelihood. Parameters ---------- y: ndarray query quantiles, i.e.\ :math:`P(Y \leq y)`. f: ndarray latent function from the GLM prior (:math:`\mathbf{f} ...
keyword[def] identifier[cdf] ( identifier[self] , identifier[y] , identifier[f] , identifier[var] ): literal[string] identifier[var] = identifier[self] . identifier[_check_param] ( identifier[var] ) keyword[return] identifier[norm] . identifier[cdf] ( identifier[y] , identifier[loc] = ide...
def cdf(self, y, f, var): """ Cumulative density function of the likelihood. Parameters ---------- y: ndarray query quantiles, i.e.\\ :math:`P(Y \\leq y)`. f: ndarray latent function from the GLM prior (:math:`\\mathbf{f} = \\boldsymbol\\...
def get_as_integer_with_default(self, index, default_value): """ Converts array element into an integer or returns default value if conversion is not possible. :param index: an index of element to get. :param default_value: the default value :return: integer value ot the eleme...
def function[get_as_integer_with_default, parameter[self, index, default_value]]: constant[ Converts array element into an integer or returns default value if conversion is not possible. :param index: an index of element to get. :param default_value: the default value :return:...
keyword[def] identifier[get_as_integer_with_default] ( identifier[self] , identifier[index] , identifier[default_value] ): literal[string] identifier[value] = identifier[self] [ identifier[index] ] keyword[return] identifier[IntegerConverter] . identifier[to_integer_with_default] ( identi...
def get_as_integer_with_default(self, index, default_value): """ Converts array element into an integer or returns default value if conversion is not possible. :param index: an index of element to get. :param default_value: the default value :return: integer value ot the element o...
def get_string_at_rva(self, rva): """Get an ASCII string located at the given address.""" s = self.get_section_by_rva(rva) if not s: return self.get_string_from_data(0, self.__data__[rva:rva+MAX_STRING_LENGTH]) return self.get_string_from_data( 0, s.get_data(rva, le...
def function[get_string_at_rva, parameter[self, rva]]: constant[Get an ASCII string located at the given address.] variable[s] assign[=] call[name[self].get_section_by_rva, parameter[name[rva]]] if <ast.UnaryOp object at 0x7da1b0e440d0> begin[:] return[call[name[self].get_string_from_dat...
keyword[def] identifier[get_string_at_rva] ( identifier[self] , identifier[rva] ): literal[string] identifier[s] = identifier[self] . identifier[get_section_by_rva] ( identifier[rva] ) keyword[if] keyword[not] identifier[s] : keyword[return] identifier[self] . identifier[g...
def get_string_at_rva(self, rva): """Get an ASCII string located at the given address.""" s = self.get_section_by_rva(rva) if not s: return self.get_string_from_data(0, self.__data__[rva:rva + MAX_STRING_LENGTH]) # depends on [control=['if'], data=[]] return self.get_string_from_data(0, s.get_d...
def insert_text(self, text, at_end=False, error=False, prompt=False): """ Insert text at the current cursor position or at the end of the command line """ if at_end: # Insert text at the end of the command line self.append_text_to_shell(text, error,...
def function[insert_text, parameter[self, text, at_end, error, prompt]]: constant[ Insert text at the current cursor position or at the end of the command line ] if name[at_end] begin[:] call[name[self].append_text_to_shell, parameter[name[text], name[error], name...
keyword[def] identifier[insert_text] ( identifier[self] , identifier[text] , identifier[at_end] = keyword[False] , identifier[error] = keyword[False] , identifier[prompt] = keyword[False] ): literal[string] keyword[if] identifier[at_end] : identifier[self] . identifier[ap...
def insert_text(self, text, at_end=False, error=False, prompt=False): """ Insert text at the current cursor position or at the end of the command line """ if at_end: # Insert text at the end of the command line self.append_text_to_shell(text, error, prompt) # depends on [contro...
def switch_to_plugin(self): """Switch to plugin.""" # Unmaxizime currently maximized plugin if (self.main.last_plugin is not None and self.main.last_plugin.ismaximized and self.main.last_plugin is not self): self.main.maximize_dockwidget() ...
def function[switch_to_plugin, parameter[self]]: constant[Switch to plugin.] if <ast.BoolOp object at 0x7da18dc076d0> begin[:] call[name[self].main.maximize_dockwidget, parameter[]] if call[name[self].get_option, parameter[constant[visible_if_project_open]]] begin[:] ...
keyword[def] identifier[switch_to_plugin] ( identifier[self] ): literal[string] keyword[if] ( identifier[self] . identifier[main] . identifier[last_plugin] keyword[is] keyword[not] keyword[None] keyword[and] identifier[self] . identifier[main] . identifier[last_plugin] . ...
def switch_to_plugin(self): """Switch to plugin.""" # Unmaxizime currently maximized plugin if self.main.last_plugin is not None and self.main.last_plugin.ismaximized and (self.main.last_plugin is not self): self.main.maximize_dockwidget() # depends on [control=['if'], data=[]] # Show plugin only if ...
def save(self, clean=True): """Serialize into raw representation. Clears the dirty bit by default. Args: clean (bool): Whether to clear the dirty bit. Returns: dict: Raw. """ ret = {} if clean: self._dirty = False else: ...
def function[save, parameter[self, clean]]: constant[Serialize into raw representation. Clears the dirty bit by default. Args: clean (bool): Whether to clear the dirty bit. Returns: dict: Raw. ] variable[ret] assign[=] dictionary[[], []] if name[...
keyword[def] identifier[save] ( identifier[self] , identifier[clean] = keyword[True] ): literal[string] identifier[ret] ={} keyword[if] identifier[clean] : identifier[self] . identifier[_dirty] = keyword[False] keyword[else] : identifier[ret] [ literal[...
def save(self, clean=True): """Serialize into raw representation. Clears the dirty bit by default. Args: clean (bool): Whether to clear the dirty bit. Returns: dict: Raw. """ ret = {} if clean: self._dirty = False # depends on [control=['if'], data=...
def subscribe(self, user, verbose=None): """Returns a response after attempting to subscribe a member to the list. """ if not self.email_enabled: raise EmailNotEnabledError("See settings.EMAIL_ENABLED") if not user.email: raise UserEmailError(f"User {user}...
def function[subscribe, parameter[self, user, verbose]]: constant[Returns a response after attempting to subscribe a member to the list. ] if <ast.UnaryOp object at 0x7da2046216c0> begin[:] <ast.Raise object at 0x7da204622c50> if <ast.UnaryOp object at 0x7da2046223e0> beg...
keyword[def] identifier[subscribe] ( identifier[self] , identifier[user] , identifier[verbose] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[email_enabled] : keyword[raise] identifier[EmailNotEnabledError] ( literal[string] ) keyw...
def subscribe(self, user, verbose=None): """Returns a response after attempting to subscribe a member to the list. """ if not self.email_enabled: raise EmailNotEnabledError('See settings.EMAIL_ENABLED') # depends on [control=['if'], data=[]] if not user.email: raise UserEmai...
def WriteBuffer(self, responses): """Write the hash received to the blob image.""" index = responses.request_data["index"] if index not in self.state.pending_files: return # Failed to read the file - ignore it. if not responses.success: self._FileFetchFailed(index, responses.request.re...
def function[WriteBuffer, parameter[self, responses]]: constant[Write the hash received to the blob image.] variable[index] assign[=] call[name[responses].request_data][constant[index]] if compare[name[index] <ast.NotIn object at 0x7da2590d7190> name[self].state.pending_files] begin[:] r...
keyword[def] identifier[WriteBuffer] ( identifier[self] , identifier[responses] ): literal[string] identifier[index] = identifier[responses] . identifier[request_data] [ literal[string] ] keyword[if] identifier[index] keyword[not] keyword[in] identifier[self] . identifier[state] . identifier[pend...
def WriteBuffer(self, responses): """Write the hash received to the blob image.""" index = responses.request_data['index'] if index not in self.state.pending_files: return # depends on [control=['if'], data=[]] # Failed to read the file - ignore it. if not responses.success: self._F...
def search( self, q="yellow flower", lang="en", video_type="all", category="", min_width=0, min_height=0, editors_choice="false", safesearch="false", order="popular", page=1, p...
def function[search, parameter[self, q, lang, video_type, category, min_width, min_height, editors_choice, safesearch, order, page, per_page, callback, pretty]]: constant[returns videos API data in dict Videos search :param q :type str :desc A URL encoded search term. If omitted, all i...
keyword[def] identifier[search] ( identifier[self] , identifier[q] = literal[string] , identifier[lang] = literal[string] , identifier[video_type] = literal[string] , identifier[category] = literal[string] , identifier[min_width] = literal[int] , identifier[min_height] = literal[int] , identifier[editors_choi...
def search(self, q='yellow flower', lang='en', video_type='all', category='', min_width=0, min_height=0, editors_choice='false', safesearch='false', order='popular', page=1, per_page=20, callback='', pretty='false'): """returns videos API data in dict Videos search :param q :type str :desc A URL e...
def FPPplots(self, folder=None, format='png', tag=None, **kwargs): """ Make FPP diagnostic plots Makes likelihood "fuzz plot" for each model, a FPP summary figure, a plot of the :class:`TransitSignal`, and writes a ``results.txt`` file. :param folder: (optional) ...
def function[FPPplots, parameter[self, folder, format, tag]]: constant[ Make FPP diagnostic plots Makes likelihood "fuzz plot" for each model, a FPP summary figure, a plot of the :class:`TransitSignal`, and writes a ``results.txt`` file. :param folder: (optional) ...
keyword[def] identifier[FPPplots] ( identifier[self] , identifier[folder] = keyword[None] , identifier[format] = literal[string] , identifier[tag] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[folder] keyword[is] keyword[None] : identifier[folder] ...
def FPPplots(self, folder=None, format='png', tag=None, **kwargs): """ Make FPP diagnostic plots Makes likelihood "fuzz plot" for each model, a FPP summary figure, a plot of the :class:`TransitSignal`, and writes a ``results.txt`` file. :param folder: (optional) ...
def on_modified(self, event, dry_run=False, remove_uploaded=True): 'Called when a file (or directory) is modified. ' super(ArchiveEventHandler, self).on_modified(event) src_path = event.src_path if event.is_directory: if not platform.is_darwin(): log.info("eve...
def function[on_modified, parameter[self, event, dry_run, remove_uploaded]]: constant[Called when a file (or directory) is modified. ] call[call[name[super], parameter[name[ArchiveEventHandler], name[self]]].on_modified, parameter[name[event]]] variable[src_path] assign[=] name[event].src_path ...
keyword[def] identifier[on_modified] ( identifier[self] , identifier[event] , identifier[dry_run] = keyword[False] , identifier[remove_uploaded] = keyword[True] ): literal[string] identifier[super] ( identifier[ArchiveEventHandler] , identifier[self] ). identifier[on_modified] ( identifier[event] )...
def on_modified(self, event, dry_run=False, remove_uploaded=True): """Called when a file (or directory) is modified. """ super(ArchiveEventHandler, self).on_modified(event) src_path = event.src_path if event.is_directory: if not platform.is_darwin(): log.info('event is a directory, s...
def interface_options(score=False, raw=False, features=None, rgb=None): """Get an InterfaceOptions for the config.""" interface = sc_pb.InterfaceOptions() interface.score = score interface.raw = raw if features: interface.feature_layer.width = 24 interface.feature_layer.resolution.x = features int...
def function[interface_options, parameter[score, raw, features, rgb]]: constant[Get an InterfaceOptions for the config.] variable[interface] assign[=] call[name[sc_pb].InterfaceOptions, parameter[]] name[interface].score assign[=] name[score] name[interface].raw assign[=] name[raw] ...
keyword[def] identifier[interface_options] ( identifier[score] = keyword[False] , identifier[raw] = keyword[False] , identifier[features] = keyword[None] , identifier[rgb] = keyword[None] ): literal[string] identifier[interface] = identifier[sc_pb] . identifier[InterfaceOptions] () identifier[interface] . i...
def interface_options(score=False, raw=False, features=None, rgb=None): """Get an InterfaceOptions for the config.""" interface = sc_pb.InterfaceOptions() interface.score = score interface.raw = raw if features: interface.feature_layer.width = 24 interface.feature_layer.resolution.x ...
def parse_diff(self, diff: str) -> Dict[str, List[Tuple[int, str]]]: """ Given a diff, returns a dictionary with the added and deleted lines. The dictionary has 2 keys: "added" and "deleted", each containing the corresponding added or deleted lines. For both keys, the value is a ...
def function[parse_diff, parameter[self, diff]]: constant[ Given a diff, returns a dictionary with the added and deleted lines. The dictionary has 2 keys: "added" and "deleted", each containing the corresponding added or deleted lines. For both keys, the value is a list of Tuple ...
keyword[def] identifier[parse_diff] ( identifier[self] , identifier[diff] : identifier[str] )-> identifier[Dict] [ identifier[str] , identifier[List] [ identifier[Tuple] [ identifier[int] , identifier[str] ]]]: literal[string] identifier[lines] = identifier[diff] . identifier[split] ( literal[strin...
def parse_diff(self, diff: str) -> Dict[str, List[Tuple[int, str]]]: """ Given a diff, returns a dictionary with the added and deleted lines. The dictionary has 2 keys: "added" and "deleted", each containing the corresponding added or deleted lines. For both keys, the value is a list...
def _get_upload_arguments(self, content_type): """Get required arguments for performing an upload. The content type returned will be determined in order of precedence: - The value passed in to this method (if not :data:`None`) - The value stored on the current blob - The defaul...
def function[_get_upload_arguments, parameter[self, content_type]]: constant[Get required arguments for performing an upload. The content type returned will be determined in order of precedence: - The value passed in to this method (if not :data:`None`) - The value stored on the curren...
keyword[def] identifier[_get_upload_arguments] ( identifier[self] , identifier[content_type] ): literal[string] identifier[headers] = identifier[_get_encryption_headers] ( identifier[self] . identifier[_encryption_key] ) identifier[object_metadata] = identifier[self] . identifier[_get_writ...
def _get_upload_arguments(self, content_type): """Get required arguments for performing an upload. The content type returned will be determined in order of precedence: - The value passed in to this method (if not :data:`None`) - The value stored on the current blob - The default va...
def delete_ace(self, domain=None, user=None, sid=None): """ delete ACE for the share delete ACE for the share. User could either supply the domain and username or the sid of the user. :param domain: domain of the user :param user: username :param sid: sid of the user o...
def function[delete_ace, parameter[self, domain, user, sid]]: constant[ delete ACE for the share delete ACE for the share. User could either supply the domain and username or the sid of the user. :param domain: domain of the user :param user: username :param sid: sid o...
keyword[def] identifier[delete_ace] ( identifier[self] , identifier[domain] = keyword[None] , identifier[user] = keyword[None] , identifier[sid] = keyword[None] ): literal[string] keyword[if] identifier[sid] keyword[is] keyword[None] : keyword[if] identifier[domain] keyword[is] k...
def delete_ace(self, domain=None, user=None, sid=None): """ delete ACE for the share delete ACE for the share. User could either supply the domain and username or the sid of the user. :param domain: domain of the user :param user: username :param sid: sid of the user or si...
def print_traceback(self): """ Print the traceback of the exception wrapped by the AbbreviatedException. """ traceback.print_exception(self.etype, self.value, self.traceback)
def function[print_traceback, parameter[self]]: constant[ Print the traceback of the exception wrapped by the AbbreviatedException. ] call[name[traceback].print_exception, parameter[name[self].etype, name[self].value, name[self].traceback]]
keyword[def] identifier[print_traceback] ( identifier[self] ): literal[string] identifier[traceback] . identifier[print_exception] ( identifier[self] . identifier[etype] , identifier[self] . identifier[value] , identifier[self] . identifier[traceback] )
def print_traceback(self): """ Print the traceback of the exception wrapped by the AbbreviatedException. """ traceback.print_exception(self.etype, self.value, self.traceback)
def check_cache(self, template): ''' Cache a file only once ''' if template not in self.cached: self.cache_file(template) self.cached.append(template)
def function[check_cache, parameter[self, template]]: constant[ Cache a file only once ] if compare[name[template] <ast.NotIn object at 0x7da2590d7190> name[self].cached] begin[:] call[name[self].cache_file, parameter[name[template]]] call[name[self].cache...
keyword[def] identifier[check_cache] ( identifier[self] , identifier[template] ): literal[string] keyword[if] identifier[template] keyword[not] keyword[in] identifier[self] . identifier[cached] : identifier[self] . identifier[cache_file] ( identifier[template] ) identi...
def check_cache(self, template): """ Cache a file only once """ if template not in self.cached: self.cache_file(template) self.cached.append(template) # depends on [control=['if'], data=['template']]
def _dispatch_send(self, message): """ Dispatch the different steps of sending """ if self.dryrun: return message if not self.socket: raise GraphiteSendException( "Socket was not created before send" ) sending_functio...
def function[_dispatch_send, parameter[self, message]]: constant[ Dispatch the different steps of sending ] if name[self].dryrun begin[:] return[name[message]] if <ast.UnaryOp object at 0x7da1b1026860> begin[:] <ast.Raise object at 0x7da1b10261a0> variable...
keyword[def] identifier[_dispatch_send] ( identifier[self] , identifier[message] ): literal[string] keyword[if] identifier[self] . identifier[dryrun] : keyword[return] identifier[message] keyword[if] keyword[not] identifier[self] . identifier[socket] : keyw...
def _dispatch_send(self, message): """ Dispatch the different steps of sending """ if self.dryrun: return message # depends on [control=['if'], data=[]] if not self.socket: raise GraphiteSendException('Socket was not created before send') # depends on [control=['if'], data=...
def _get_server_cert(response): """ Get the certificate at the request_url and return it as a SHA256 hash. Will get the raw socket from the original response from the server. This socket is then checked if it is an SSL socket and then used to get the hash of the certificate. The certificate hash is then...
def function[_get_server_cert, parameter[response]]: constant[ Get the certificate at the request_url and return it as a SHA256 hash. Will get the raw socket from the original response from the server. This socket is then checked if it is an SSL socket and then used to get the hash of the certificat...
keyword[def] identifier[_get_server_cert] ( identifier[response] ): literal[string] identifier[certificate_hash] = keyword[None] identifier[raw_response] = identifier[response] . identifier[raw] keyword[if] identifier[isinstance] ( identifier[raw_response] , identifier[HTTPResponse] ): ...
def _get_server_cert(response): """ Get the certificate at the request_url and return it as a SHA256 hash. Will get the raw socket from the original response from the server. This socket is then checked if it is an SSL socket and then used to get the hash of the certificate. The certificate hash is then...
def growth(interval, pricecol, eqdata): """ Retrieve growth labels. Parameters -------------- interval : int Number of sessions over which growth is measured. For example, if the value of 32 is passed for `interval`, the data returned will show the growth 32 sessions ahead ...
def function[growth, parameter[interval, pricecol, eqdata]]: constant[ Retrieve growth labels. Parameters -------------- interval : int Number of sessions over which growth is measured. For example, if the value of 32 is passed for `interval`, the data returned will sho...
keyword[def] identifier[growth] ( identifier[interval] , identifier[pricecol] , identifier[eqdata] ): literal[string] identifier[size] = identifier[len] ( identifier[eqdata] . identifier[index] ) identifier[labeldata] = identifier[eqdata] . identifier[loc] [:, identifier[pricecol] ]. identifier[values...
def growth(interval, pricecol, eqdata): """ Retrieve growth labels. Parameters -------------- interval : int Number of sessions over which growth is measured. For example, if the value of 32 is passed for `interval`, the data returned will show the growth 32 sessions ahead ...
def _check_toolplus(x): """Parse options for adding non-standard/commercial tools like GATK and MuTecT. """ import argparse Tool = collections.namedtuple("Tool", ["name", "fname"]) std_choices = set(["data", "cadd", "dbnsfp", "ericscript"]) if x in std_choices: return Tool(x, None) e...
def function[_check_toolplus, parameter[x]]: constant[Parse options for adding non-standard/commercial tools like GATK and MuTecT. ] import module[argparse] variable[Tool] assign[=] call[name[collections].namedtuple, parameter[constant[Tool], list[[<ast.Constant object at 0x7da1b18aa440>, <ast.C...
keyword[def] identifier[_check_toolplus] ( identifier[x] ): literal[string] keyword[import] identifier[argparse] identifier[Tool] = identifier[collections] . identifier[namedtuple] ( literal[string] ,[ literal[string] , literal[string] ]) identifier[std_choices] = identifier[set] ([ literal[str...
def _check_toolplus(x): """Parse options for adding non-standard/commercial tools like GATK and MuTecT. """ import argparse Tool = collections.namedtuple('Tool', ['name', 'fname']) std_choices = set(['data', 'cadd', 'dbnsfp', 'ericscript']) if x in std_choices: return Tool(x, None) # de...
def get_ci(theta_star, blockratio=1.0): """ Get the confidence interval. """ # get rid of nans while we sort b_star = np.sort(theta_star[~np.isnan(theta_star)]) se = np.std(b_star) * np.sqrt(blockratio) # bootstrap 95% CI based on empirical percentiles ci = [b_star[int(len(b_star) * .025)], b_st...
def function[get_ci, parameter[theta_star, blockratio]]: constant[ Get the confidence interval. ] variable[b_star] assign[=] call[name[np].sort, parameter[call[name[theta_star]][<ast.UnaryOp object at 0x7da20c7cbbb0>]]] variable[se] assign[=] binary_operation[call[name[np].std, parameter[name[b_...
keyword[def] identifier[get_ci] ( identifier[theta_star] , identifier[blockratio] = literal[int] ): literal[string] identifier[b_star] = identifier[np] . identifier[sort] ( identifier[theta_star] [~ identifier[np] . identifier[isnan] ( identifier[theta_star] )]) identifier[se] = identifier[np] . ...
def get_ci(theta_star, blockratio=1.0): """ Get the confidence interval. """ # get rid of nans while we sort b_star = np.sort(theta_star[~np.isnan(theta_star)]) se = np.std(b_star) * np.sqrt(blockratio) # bootstrap 95% CI based on empirical percentiles ci = [b_star[int(len(b_star) * 0.025)], b_s...
def accept(self): """ Get the Accept option of a request. :return: the Accept value or None if not specified by the request :rtype : String """ for option in self.options: if option.number == defines.OptionRegistry.ACCEPT.number: return option...
def function[accept, parameter[self]]: constant[ Get the Accept option of a request. :return: the Accept value or None if not specified by the request :rtype : String ] for taget[name[option]] in starred[name[self].options] begin[:] if compare[name[option...
keyword[def] identifier[accept] ( identifier[self] ): literal[string] keyword[for] identifier[option] keyword[in] identifier[self] . identifier[options] : keyword[if] identifier[option] . identifier[number] == identifier[defines] . identifier[OptionRegistry] . identifier[ACCEPT] . ...
def accept(self): """ Get the Accept option of a request. :return: the Accept value or None if not specified by the request :rtype : String """ for option in self.options: if option.number == defines.OptionRegistry.ACCEPT.number: return option.value # depend...
def emit_node(self, name, **props): """emit a node with given properties. node properties: see http://www.graphviz.org/doc/info/attrs.html """ attrs = ['%s="%s"' % (prop, value) for prop, value in props.items()] self.emit("%s [%s];" % (normalize_node_id(name), ", ".join(sorted(at...
def function[emit_node, parameter[self, name]]: constant[emit a node with given properties. node properties: see http://www.graphviz.org/doc/info/attrs.html ] variable[attrs] assign[=] <ast.ListComp object at 0x7da1b025aaa0> call[name[self].emit, parameter[binary_operation[consta...
keyword[def] identifier[emit_node] ( identifier[self] , identifier[name] ,** identifier[props] ): literal[string] identifier[attrs] =[ literal[string] %( identifier[prop] , identifier[value] ) keyword[for] identifier[prop] , identifier[value] keyword[in] identifier[props] . identifier[items] ()]...
def emit_node(self, name, **props): """emit a node with given properties. node properties: see http://www.graphviz.org/doc/info/attrs.html """ attrs = ['%s="%s"' % (prop, value) for (prop, value) in props.items()] self.emit('%s [%s];' % (normalize_node_id(name), ', '.join(sorted(attrs))))
def plot_data_error(self, which_data_rows='all', which_data_ycols='all', visible_dims=None, projection='2d', label=None, **error_kwargs): """ Plot the training data input error. For higher dimensions than two, use fixed_inputs to plot the data points with some of the inputs fixed. Can ...
def function[plot_data_error, parameter[self, which_data_rows, which_data_ycols, visible_dims, projection, label]]: constant[ Plot the training data input error. For higher dimensions than two, use fixed_inputs to plot the data points with some of the inputs fixed. Can plot only part of the data ...
keyword[def] identifier[plot_data_error] ( identifier[self] , identifier[which_data_rows] = literal[string] , identifier[which_data_ycols] = literal[string] , identifier[visible_dims] = keyword[None] , identifier[projection] = literal[string] , identifier[label] = keyword[None] ,** identifier[error_kwargs] ): ...
def plot_data_error(self, which_data_rows='all', which_data_ycols='all', visible_dims=None, projection='2d', label=None, **error_kwargs): """ Plot the training data input error. For higher dimensions than two, use fixed_inputs to plot the data points with some of the inputs fixed. Can plot only part o...
def edit(self, name, label=None): """Edit this asset. :param str name: (required), The file name of the asset :param str label: (optional), An alternate description of the asset :returns: boolean """ if not name: return False edit_data = {'name': name...
def function[edit, parameter[self, name, label]]: constant[Edit this asset. :param str name: (required), The file name of the asset :param str label: (optional), An alternate description of the asset :returns: boolean ] if <ast.UnaryOp object at 0x7da1b0e0f160> begin[:] ...
keyword[def] identifier[edit] ( identifier[self] , identifier[name] , identifier[label] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[name] : keyword[return] keyword[False] identifier[edit_data] ={ literal[string] : identifier[name] , literal[strin...
def edit(self, name, label=None): """Edit this asset. :param str name: (required), The file name of the asset :param str label: (optional), An alternate description of the asset :returns: boolean """ if not name: return False # depends on [control=['if'], data=[]] e...
def enqueue_task(self, source, *args): """ Enqueue a task execution. It will run in the background as soon as the coordinator clears it to do so. """ yield from self.cell.coord.enqueue(self) route = Route(source, self.cell, self.spec, self.emit) self.cell.loop.create_task(self.c...
def function[enqueue_task, parameter[self, source]]: constant[ Enqueue a task execution. It will run in the background as soon as the coordinator clears it to do so. ] <ast.YieldFrom object at 0x7da204621300> variable[route] assign[=] call[name[Route], parameter[name[source], name[self]...
keyword[def] identifier[enqueue_task] ( identifier[self] , identifier[source] ,* identifier[args] ): literal[string] keyword[yield] keyword[from] identifier[self] . identifier[cell] . identifier[coord] . identifier[enqueue] ( identifier[self] ) identifier[route] = identifier[Route] ( ide...
def enqueue_task(self, source, *args): """ Enqueue a task execution. It will run in the background as soon as the coordinator clears it to do so. """ yield from self.cell.coord.enqueue(self) route = Route(source, self.cell, self.spec, self.emit) self.cell.loop.create_task(self.coord_wrap(route,...
def generateFromRaster(self, elevation_raster, shapefile_path=None, out_elevation_grid=None, resample_method=gdalconst.GRA_Average, load_raster_to_db=True): """ Generate...
def function[generateFromRaster, parameter[self, elevation_raster, shapefile_path, out_elevation_grid, resample_method, load_raster_to_db]]: constant[ Generates an elevation grid for the GSSHA simulation from an elevation raster Example:: from gsshapy.orm import ProjectFile...
keyword[def] identifier[generateFromRaster] ( identifier[self] , identifier[elevation_raster] , identifier[shapefile_path] = keyword[None] , identifier[out_elevation_grid] = keyword[None] , identifier[resample_method] = identifier[gdalconst] . identifier[GRA_Average] , identifier[load_raster_to_db] = keyword[Tru...
def generateFromRaster(self, elevation_raster, shapefile_path=None, out_elevation_grid=None, resample_method=gdalconst.GRA_Average, load_raster_to_db=True): """ Generates an elevation grid for the GSSHA simulation from an elevation raster Example:: from gsshapy.orm import Proje...
def _populate_rv(self, dataset, **kwargs): """ Populate columns necessary for an RV dataset This should not be called directly, but rather via :meth:`Body.populate_observable` or :meth:`System.populate_observables` """ logger.debug("{}._populate_rv(dataset={})".format(se...
def function[_populate_rv, parameter[self, dataset]]: constant[ Populate columns necessary for an RV dataset This should not be called directly, but rather via :meth:`Body.populate_observable` or :meth:`System.populate_observables` ] call[name[logger].debug, parameter[ca...
keyword[def] identifier[_populate_rv] ( identifier[self] , identifier[dataset] ,** identifier[kwargs] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] . identifier[format] ( identifier[self] . identifier[component] , identifier[dataset] )) iden...
def _populate_rv(self, dataset, **kwargs): """ Populate columns necessary for an RV dataset This should not be called directly, but rather via :meth:`Body.populate_observable` or :meth:`System.populate_observables` """ logger.debug('{}._populate_rv(dataset={})'.format(self.compo...
def parse_commit_message(message: str) -> Tuple[int, str, Optional[str], Tuple[str, str, str]]: """ Parses a commit message according to the 1.0 version of python-semantic-release. It expects a tag of some sort in the commit message and will use the rest of the first line as changelog content. :par...
def function[parse_commit_message, parameter[message]]: constant[ Parses a commit message according to the 1.0 version of python-semantic-release. It expects a tag of some sort in the commit message and will use the rest of the first line as changelog content. :param message: A string of a comm...
keyword[def] identifier[parse_commit_message] ( identifier[message] : identifier[str] )-> identifier[Tuple] [ identifier[int] , identifier[str] , identifier[Optional] [ identifier[str] ], identifier[Tuple] [ identifier[str] , identifier[str] , identifier[str] ]]: literal[string] identifier[parsed] = ident...
def parse_commit_message(message: str) -> Tuple[int, str, Optional[str], Tuple[str, str, str]]: """ Parses a commit message according to the 1.0 version of python-semantic-release. It expects a tag of some sort in the commit message and will use the rest of the first line as changelog content. :par...
def xml_to_tupletree_sax(xml_string, meaning, conn_id=None): """ Parse an XML string into tupletree with SAX parser. Parses the string using the class CIMContentHandler and returns the root element. As a SAX parser it uses minimal memory. This is a replacement for the previous parser (xml_to_t...
def function[xml_to_tupletree_sax, parameter[xml_string, meaning, conn_id]]: constant[ Parse an XML string into tupletree with SAX parser. Parses the string using the class CIMContentHandler and returns the root element. As a SAX parser it uses minimal memory. This is a replacement for the...
keyword[def] identifier[xml_to_tupletree_sax] ( identifier[xml_string] , identifier[meaning] , identifier[conn_id] = keyword[None] ): literal[string] identifier[handler] = identifier[CIMContentHandler] () identifier[xml_string] = identifier[_ensure_bytes]...
def xml_to_tupletree_sax(xml_string, meaning, conn_id=None): """ Parse an XML string into tupletree with SAX parser. Parses the string using the class CIMContentHandler and returns the root element. As a SAX parser it uses minimal memory. This is a replacement for the previous parser (xml_to_t...
def delete(self, request, response): """Processes a `DELETE` request.""" if self.slug is None: # Mass-DELETE is not implemented. raise http.exceptions.NotImplemented() # Ensure we're allowed to destroy a resource. self.assert_operations('destroy') # Dele...
def function[delete, parameter[self, request, response]]: constant[Processes a `DELETE` request.] if compare[name[self].slug is constant[None]] begin[:] <ast.Raise object at 0x7da1b008e440> call[name[self].assert_operations, parameter[constant[destroy]]] call[name[self].destroy, ...
keyword[def] identifier[delete] ( identifier[self] , identifier[request] , identifier[response] ): literal[string] keyword[if] identifier[self] . identifier[slug] keyword[is] keyword[None] : keyword[raise] identifier[http] . identifier[exceptions] . identifier[NotImplement...
def delete(self, request, response): """Processes a `DELETE` request.""" if self.slug is None: # Mass-DELETE is not implemented. raise http.exceptions.NotImplemented() # depends on [control=['if'], data=[]] # Ensure we're allowed to destroy a resource. self.assert_operations('destroy') ...
def parse_line(line): """Parses a line of a text embedding file. Args: line: (str) One line of the text embedding file. Returns: A token string and its embedding vector in floats. """ columns = line.split() token = columns.pop(0) values = [float(column) for column in columns] return token, val...
def function[parse_line, parameter[line]]: constant[Parses a line of a text embedding file. Args: line: (str) One line of the text embedding file. Returns: A token string and its embedding vector in floats. ] variable[columns] assign[=] call[name[line].split, parameter[]] variabl...
keyword[def] identifier[parse_line] ( identifier[line] ): literal[string] identifier[columns] = identifier[line] . identifier[split] () identifier[token] = identifier[columns] . identifier[pop] ( literal[int] ) identifier[values] =[ identifier[float] ( identifier[column] ) keyword[for] identifier[column...
def parse_line(line): """Parses a line of a text embedding file. Args: line: (str) One line of the text embedding file. Returns: A token string and its embedding vector in floats. """ columns = line.split() token = columns.pop(0) values = [float(column) for column in columns] return ...
async def create( cls, start_ip: str, end_ip: str, *, type: IPRangeType = IPRangeType.RESERVED, comment: str = None, subnet: Union[Subnet, int] = None): """ Create a `IPRange` in MAAS. :param start_ip: First IP address in the range (required). :type s...
<ast.AsyncFunctionDef object at 0x7da20c76f3d0>
keyword[async] keyword[def] identifier[create] ( identifier[cls] , identifier[start_ip] : identifier[str] , identifier[end_ip] : identifier[str] ,*, identifier[type] : identifier[IPRangeType] = identifier[IPRangeType] . identifier[RESERVED] , identifier[comment] : identifier[str] = keyword[None] , identifier[subn...
async def create(cls, start_ip: str, end_ip: str, *, type: IPRangeType=IPRangeType.RESERVED, comment: str=None, subnet: Union[Subnet, int]=None): """ Create a `IPRange` in MAAS. :param start_ip: First IP address in the range (required). :type start_ip: `str` :parma end_ip: Last IP a...
def remove_widget(self): """ Removes the Component Widget from the engine. :return: Method success. :rtype: bool """ LOGGER.debug("> Removing '{0}' Component Widget.".format(self.__class__.__name__)) self.__preferences_manager.findChild(QGridLayout, "Others_Pre...
def function[remove_widget, parameter[self]]: constant[ Removes the Component Widget from the engine. :return: Method success. :rtype: bool ] call[name[LOGGER].debug, parameter[call[constant[> Removing '{0}' Component Widget.].format, parameter[name[self].__class__.__nam...
keyword[def] identifier[remove_widget] ( identifier[self] ): literal[string] identifier[LOGGER] . identifier[debug] ( literal[string] . identifier[format] ( identifier[self] . identifier[__class__] . identifier[__name__] )) identifier[self] . identifier[__preferences_manager] . identifie...
def remove_widget(self): """ Removes the Component Widget from the engine. :return: Method success. :rtype: bool """ LOGGER.debug("> Removing '{0}' Component Widget.".format(self.__class__.__name__)) self.__preferences_manager.findChild(QGridLayout, 'Others_Preferences_gridL...
def factorset_product(*factorsets_list): r""" Base method used for product of factor sets. Suppose :math:`\vec\phi_1` and :math:`\vec\phi_2` are two factor sets then their product is a another factors set :math:`\vec\phi_3 = \vec\phi_1 \cup \vec\phi_2`. Parameters ---------- factorsets_lis...
def function[factorset_product, parameter[]]: constant[ Base method used for product of factor sets. Suppose :math:`\vec\phi_1` and :math:`\vec\phi_2` are two factor sets then their product is a another factors set :math:`\vec\phi_3 = \vec\phi_1 \cup \vec\phi_2`. Parameters ---------- ...
keyword[def] identifier[factorset_product] (* identifier[factorsets_list] ): literal[string] keyword[if] keyword[not] identifier[all] ( identifier[isinstance] ( identifier[factorset] , identifier[FactorSet] ) keyword[for] identifier[factorset] keyword[in] identifier[factorsets_list] ): keywor...
def factorset_product(*factorsets_list): """ Base method used for product of factor sets. Suppose :math:`\\vec\\phi_1` and :math:`\\vec\\phi_2` are two factor sets then their product is a another factors set :math:`\\vec\\phi_3 = \\vec\\phi_1 \\cup \\vec\\phi_2`. Parameters ---------- fact...
def _scan(self, type): """ Returns the matched text, and moves to the next token """ tok = self._scanner.token(self._pos, frozenset([type])) self._char_pos = tok[0] if tok[2] != type: raise SyntaxError("SyntaxError[@ char %s: %s]" % (repr(tok[0]), "Trying to f...
def function[_scan, parameter[self, type]]: constant[ Returns the matched text, and moves to the next token ] variable[tok] assign[=] call[name[self]._scanner.token, parameter[name[self]._pos, call[name[frozenset], parameter[list[[<ast.Name object at 0x7da18bccb070>]]]]]] name[se...
keyword[def] identifier[_scan] ( identifier[self] , identifier[type] ): literal[string] identifier[tok] = identifier[self] . identifier[_scanner] . identifier[token] ( identifier[self] . identifier[_pos] , identifier[frozenset] ([ identifier[type] ])) identifier[self] . identifier[_char_po...
def _scan(self, type): """ Returns the matched text, and moves to the next token """ tok = self._scanner.token(self._pos, frozenset([type])) self._char_pos = tok[0] if tok[2] != type: raise SyntaxError('SyntaxError[@ char %s: %s]' % (repr(tok[0]), 'Trying to find ' + type)) # de...
def parse_single_ad(ad, global_names, common_words, args={}): """ An example extraction of a Backpage ad, with the following parameters: ad -> A dict representing an ad that is scraped as such: ad = items.BackpageScrapeItem( backpage_id=response.url.split('.')[0].split('/')[2].encode('utf-...
def function[parse_single_ad, parameter[ad, global_names, common_words, args]]: constant[ An example extraction of a Backpage ad, with the following parameters: ad -> A dict representing an ad that is scraped as such: ad = items.BackpageScrapeItem( backpage_id=response.url.split('.')...
keyword[def] identifier[parse_single_ad] ( identifier[ad] , identifier[global_names] , identifier[common_words] , identifier[args] ={}): literal[string] identifier[multiple_phones] = keyword[False] keyword[if] literal[string] keyword[not] keyword[in] identifier[args] keyword[else] identifier[args] [ li...
def parse_single_ad(ad, global_names, common_words, args={}): """ An example extraction of a Backpage ad, with the following parameters: ad -> A dict representing an ad that is scraped as such: ad = items.BackpageScrapeItem( backpage_id=response.url.split('.')[0].split('/')[2].encode('ut...
def add(self, class_name, name, **kwargs): """ Add a single component to the network. Adds it to component DataFrames. Parameters ---------- class_name : string Component class name in ["Bus","Generator","Load","StorageUnit","Store","ShuntImpedance","Line","...
def function[add, parameter[self, class_name, name]]: constant[ Add a single component to the network. Adds it to component DataFrames. Parameters ---------- class_name : string Component class name in ["Bus","Generator","Load","StorageUnit","Store","ShuntIm...
keyword[def] identifier[add] ( identifier[self] , identifier[class_name] , identifier[name] ,** identifier[kwargs] ): literal[string] keyword[assert] identifier[class_name] keyword[in] identifier[self] . identifier[components] , literal[string] . identifier[format] ( identifier[class_name] ) ...
def add(self, class_name, name, **kwargs): """ Add a single component to the network. Adds it to component DataFrames. Parameters ---------- class_name : string Component class name in ["Bus","Generator","Load","StorageUnit","Store","ShuntImpedance","Line","Tran...