code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def assert_key_type_value(self, context_item, caller, extra_error_text=''): """Assert that keys exist of right type and has a value. Args: context_item: ContextItemInfo tuple caller: stri...
def function[assert_key_type_value, parameter[self, context_item, caller, extra_error_text]]: constant[Assert that keys exist of right type and has a value. Args: context_item: ContextItemInfo tuple caller: string. calling function name - this used to construct ...
keyword[def] identifier[assert_key_type_value] ( identifier[self] , identifier[context_item] , identifier[caller] , identifier[extra_error_text] = literal[string] ): literal[string] keyword[assert] identifier[context_item] ,( literal[string] ) keyword[if] identifier[extra_error_text]...
def assert_key_type_value(self, context_item, caller, extra_error_text=''): """Assert that keys exist of right type and has a value. Args: context_item: ContextItemInfo tuple caller: string. calling function name - this used to construct error messages ...
def show_ahrs_calibration(clb_upi, version='3'): """Show AHRS calibration data for given `clb_upi`.""" db = DBManager() ahrs_upi = clbupi2ahrsupi(clb_upi) print("AHRS UPI: {}".format(ahrs_upi)) content = db._get_content("show_product_test.htm?upi={0}&" "testtype=AHRS-CA...
def function[show_ahrs_calibration, parameter[clb_upi, version]]: constant[Show AHRS calibration data for given `clb_upi`.] variable[db] assign[=] call[name[DBManager], parameter[]] variable[ahrs_upi] assign[=] call[name[clbupi2ahrsupi], parameter[name[clb_upi]]] call[name[print], parame...
keyword[def] identifier[show_ahrs_calibration] ( identifier[clb_upi] , identifier[version] = literal[string] ): literal[string] identifier[db] = identifier[DBManager] () identifier[ahrs_upi] = identifier[clbupi2ahrsupi] ( identifier[clb_upi] ) identifier[print] ( literal[string] . identifier[form...
def show_ahrs_calibration(clb_upi, version='3'): """Show AHRS calibration data for given `clb_upi`.""" db = DBManager() ahrs_upi = clbupi2ahrsupi(clb_upi) print('AHRS UPI: {}'.format(ahrs_upi)) content = db._get_content('show_product_test.htm?upi={0}&testtype=AHRS-CALIBRATION-v{1}&n=1&out=xml'.forma...
def language(s): """ Returns a (language, confidence)-tuple for the given string. """ s = decode_utf8(s) s = set(w.strip(PUNCTUATION) for w in s.replace("'", "' ").split()) n = float(len(s) or 1) p = {} for xx in LANGUAGES: lexicon = _module(xx).__dict__["lexicon"] p[xx] = su...
def function[language, parameter[s]]: constant[ Returns a (language, confidence)-tuple for the given string. ] variable[s] assign[=] call[name[decode_utf8], parameter[name[s]]] variable[s] assign[=] call[name[set], parameter[<ast.GeneratorExp object at 0x7da207f9a6b0>]] variable[n] a...
keyword[def] identifier[language] ( identifier[s] ): literal[string] identifier[s] = identifier[decode_utf8] ( identifier[s] ) identifier[s] = identifier[set] ( identifier[w] . identifier[strip] ( identifier[PUNCTUATION] ) keyword[for] identifier[w] keyword[in] identifier[s] . identifier[replace] (...
def language(s): """ Returns a (language, confidence)-tuple for the given string. """ s = decode_utf8(s) s = set((w.strip(PUNCTUATION) for w in s.replace("'", "' ").split())) n = float(len(s) or 1) p = {} for xx in LANGUAGES: lexicon = _module(xx).__dict__['lexicon'] p[xx] = ...
def full_prepare(self, obj): """ Make django_ct equal to the type of get_model, to make polymorphic children show up in results. """ prepared_data = super(AbstractLayoutIndex, self).full_prepare(obj) prepared_data['django_ct'] = get_model_ct(self.get_model()) retu...
def function[full_prepare, parameter[self, obj]]: constant[ Make django_ct equal to the type of get_model, to make polymorphic children show up in results. ] variable[prepared_data] assign[=] call[call[name[super], parameter[name[AbstractLayoutIndex], name[self]]].full_prepare, p...
keyword[def] identifier[full_prepare] ( identifier[self] , identifier[obj] ): literal[string] identifier[prepared_data] = identifier[super] ( identifier[AbstractLayoutIndex] , identifier[self] ). identifier[full_prepare] ( identifier[obj] ) identifier[prepared_data] [ literal[string] ]= id...
def full_prepare(self, obj): """ Make django_ct equal to the type of get_model, to make polymorphic children show up in results. """ prepared_data = super(AbstractLayoutIndex, self).full_prepare(obj) prepared_data['django_ct'] = get_model_ct(self.get_model()) return prepared_data
def perr(self, *args, **kwargs): """ Console to STERR """ kwargs['file'] = self.err self.print(*args, **kwargs) sys.stderr.flush()
def function[perr, parameter[self]]: constant[ Console to STERR ] call[name[kwargs]][constant[file]] assign[=] name[self].err call[name[self].print, parameter[<ast.Starred object at 0x7da1b1409bd0>]] call[name[sys].stderr.flush, parameter[]]
keyword[def] identifier[perr] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= identifier[self] . identifier[err] identifier[self] . identifier[print] (* identifier[args] ,** identifier[kwargs] ) identifier[s...
def perr(self, *args, **kwargs): """ Console to STERR """ kwargs['file'] = self.err self.print(*args, **kwargs) sys.stderr.flush()
def schema_create(dbname, name, owner=None, user=None, db_user=None, db_password=None, db_host=None, db_port=None): ''' Creates a Postgres schema. CLI Example: .. code-block:: bash salt '*' postgres.schema_create dbname name owner='owner' ...
def function[schema_create, parameter[dbname, name, owner, user, db_user, db_password, db_host, db_port]]: constant[ Creates a Postgres schema. CLI Example: .. code-block:: bash salt '*' postgres.schema_create dbname name owner='owner' \ user='user' \ db_us...
keyword[def] identifier[schema_create] ( identifier[dbname] , identifier[name] , identifier[owner] = keyword[None] , identifier[user] = keyword[None] , identifier[db_user] = keyword[None] , identifier[db_password] = keyword[None] , identifier[db_host] = keyword[None] , identifier[db_port] = keyword[None] ): l...
def schema_create(dbname, name, owner=None, user=None, db_user=None, db_password=None, db_host=None, db_port=None): """ Creates a Postgres schema. CLI Example: .. code-block:: bash salt '*' postgres.schema_create dbname name owner='owner' \\ user='user' \\ db_u...
def _set_esi_timeout(self, v, load=False): """ Setter method for esi_timeout, mapped from YANG variable /isns/isns_vrf/esi_timeout (esi-time) If this variable is read-only (config: false) in the source YANG file, then _set_esi_timeout is considered as a private method. Backends looking to populate t...
def function[_set_esi_timeout, parameter[self, v, load]]: constant[ Setter method for esi_timeout, mapped from YANG variable /isns/isns_vrf/esi_timeout (esi-time) If this variable is read-only (config: false) in the source YANG file, then _set_esi_timeout is considered as a private method. Backe...
keyword[def] identifier[_set_esi_timeout] ( identifier[self] , identifier[v] , identifier[load] = keyword[False] ): literal[string] keyword[if] identifier[hasattr] ( identifier[v] , literal[string] ): identifier[v] = identifier[v] . identifier[_utype] ( identifier[v] ) keyword[try] : id...
def _set_esi_timeout(self, v, load=False): """ Setter method for esi_timeout, mapped from YANG variable /isns/isns_vrf/esi_timeout (esi-time) If this variable is read-only (config: false) in the source YANG file, then _set_esi_timeout is considered as a private method. Backends looking to populate t...
def shutdown(self, how=socket.SHUT_RDWR): """ Send a shutdown signal for both reading and writing, or whatever socket.SHUT_* constant you like. Shutdown differs from closing in that it explicitly changes the state of the socket resource to closed, whereas closing will only decre...
def function[shutdown, parameter[self, how]]: constant[ Send a shutdown signal for both reading and writing, or whatever socket.SHUT_* constant you like. Shutdown differs from closing in that it explicitly changes the state of the socket resource to closed, whereas closing will ...
keyword[def] identifier[shutdown] ( identifier[self] , identifier[how] = identifier[socket] . identifier[SHUT_RDWR] ): literal[string] keyword[if] identifier[self] . identifier[_sock_send] keyword[is] keyword[not] keyword[None] : identifier[self] . identifier[_sock_send] . identifi...
def shutdown(self, how=socket.SHUT_RDWR): """ Send a shutdown signal for both reading and writing, or whatever socket.SHUT_* constant you like. Shutdown differs from closing in that it explicitly changes the state of the socket resource to closed, whereas closing will only decrement...
def answer(self): """ Answer the phone call. :return: self (for chaining method calls) """ if self.ringing: self._gsmModem.write('ATA') self.ringing = False self.answered = True return self
def function[answer, parameter[self]]: constant[ Answer the phone call. :return: self (for chaining method calls) ] if name[self].ringing begin[:] call[name[self]._gsmModem.write, parameter[constant[ATA]]] name[self].ringing assign[=] constant[Fals...
keyword[def] identifier[answer] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[ringing] : identifier[self] . identifier[_gsmModem] . identifier[write] ( literal[string] ) identifier[self] . identifier[ringing] = keyword[False] ...
def answer(self): """ Answer the phone call. :return: self (for chaining method calls) """ if self.ringing: self._gsmModem.write('ATA') self.ringing = False self.answered = True # depends on [control=['if'], data=[]] return self
def _limit_data(self, data): """ Find the per-day average of each series in the data over the last 7 days; drop all but the top 10. :param data: original graph data :type data: dict :return: dict containing only the top 10 series, based on average over the last...
def function[_limit_data, parameter[self, data]]: constant[ Find the per-day average of each series in the data over the last 7 days; drop all but the top 10. :param data: original graph data :type data: dict :return: dict containing only the top 10 series, based on aver...
keyword[def] identifier[_limit_data] ( identifier[self] , identifier[data] ): literal[string] keyword[if] identifier[len] ( identifier[data] . identifier[keys] ())<= literal[int] : identifier[logger] . identifier[debug] ( literal[string] ) keyword[return] identifier[data...
def _limit_data(self, data): """ Find the per-day average of each series in the data over the last 7 days; drop all but the top 10. :param data: original graph data :type data: dict :return: dict containing only the top 10 series, based on average over the last 7 d...
def map(self, f, preservesPartitioning=False): """Apply function f :param f: mapping function :rtype: DStream Example: >>> import pysparkling >>> sc = pysparkling.Context() >>> ssc = pysparkling.streaming.StreamingContext(sc, 0.1) >>> ( ... ...
def function[map, parameter[self, f, preservesPartitioning]]: constant[Apply function f :param f: mapping function :rtype: DStream Example: >>> import pysparkling >>> sc = pysparkling.Context() >>> ssc = pysparkling.streaming.StreamingContext(sc, 0.1) ...
keyword[def] identifier[map] ( identifier[self] , identifier[f] , identifier[preservesPartitioning] = keyword[False] ): literal[string] keyword[return] ( identifier[self] . identifier[mapPartitions] ( keyword[lambda] identifier[p] :( identifier[f] ( identifier[e] ) keyword[for] ...
def map(self, f, preservesPartitioning=False): """Apply function f :param f: mapping function :rtype: DStream Example: >>> import pysparkling >>> sc = pysparkling.Context() >>> ssc = pysparkling.streaming.StreamingContext(sc, 0.1) >>> ( ... ssc...
def getAuthenticator(self, service_request): """ Gets an authenticator callable based on the service_request. This is granular, looking at the service method first, then at the service level and finally to see if there is a global authenticator function for the gateway. Returns C...
def function[getAuthenticator, parameter[self, service_request]]: constant[ Gets an authenticator callable based on the service_request. This is granular, looking at the service method first, then at the service level and finally to see if there is a global authenticator function ...
keyword[def] identifier[getAuthenticator] ( identifier[self] , identifier[service_request] ): literal[string] identifier[auth] = identifier[service_request] . identifier[service] . identifier[getAuthenticator] ( identifier[service_request] ) keyword[if] identifier[auth] keyword[is] key...
def getAuthenticator(self, service_request): """ Gets an authenticator callable based on the service_request. This is granular, looking at the service method first, then at the service level and finally to see if there is a global authenticator function for the gateway. Returns C{Non...
def spm_dispersion_derivative(tr, oversampling=50, time_length=32., onset=0.): """Implementation of the SPM dispersion derivative hrf model Parameters ---------- tr: float scan repeat time, in seconds oversampling: int, optional temporal oversampling factor in seconds time_len...
def function[spm_dispersion_derivative, parameter[tr, oversampling, time_length, onset]]: constant[Implementation of the SPM dispersion derivative hrf model Parameters ---------- tr: float scan repeat time, in seconds oversampling: int, optional temporal oversampling factor in ...
keyword[def] identifier[spm_dispersion_derivative] ( identifier[tr] , identifier[oversampling] = literal[int] , identifier[time_length] = literal[int] , identifier[onset] = literal[int] ): literal[string] identifier[dd] = literal[int] identifier[dhrf] = literal[int] / identifier[dd] *( - identifi...
def spm_dispersion_derivative(tr, oversampling=50, time_length=32.0, onset=0.0): """Implementation of the SPM dispersion derivative hrf model Parameters ---------- tr: float scan repeat time, in seconds oversampling: int, optional temporal oversampling factor in seconds time_l...
def receive_ack_renewing(self, pkt): """Receive ACK in RENEWING state.""" logger.debug("C3. Received ACK?, in RENEWING state.") if self.process_received_ack(pkt): logger.debug("C3: T. Received ACK, in RENEWING state, " "raise BOUND.") raise self.B...
def function[receive_ack_renewing, parameter[self, pkt]]: constant[Receive ACK in RENEWING state.] call[name[logger].debug, parameter[constant[C3. Received ACK?, in RENEWING state.]]] if call[name[self].process_received_ack, parameter[name[pkt]]] begin[:] call[name[logger].debug,...
keyword[def] identifier[receive_ack_renewing] ( identifier[self] , identifier[pkt] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] ) keyword[if] identifier[self] . identifier[process_received_ack] ( identifier[pkt] ): identifier[logger] . identifie...
def receive_ack_renewing(self, pkt): """Receive ACK in RENEWING state.""" logger.debug('C3. Received ACK?, in RENEWING state.') if self.process_received_ack(pkt): logger.debug('C3: T. Received ACK, in RENEWING state, raise BOUND.') raise self.BOUND() # depends on [control=['if'], data=[]]
def max_linear_flow(Diam, HeadlossCDC, Ratio_Error, KMinor): """Return the maximum flow that will meet the linear requirement. Maximum flow that can be put through a tube of a given diameter without exceeding the allowable deviation from linear head loss behavior """ flow = (pc.area_circle(Diam)).ma...
def function[max_linear_flow, parameter[Diam, HeadlossCDC, Ratio_Error, KMinor]]: constant[Return the maximum flow that will meet the linear requirement. Maximum flow that can be put through a tube of a given diameter without exceeding the allowable deviation from linear head loss behavior ] ...
keyword[def] identifier[max_linear_flow] ( identifier[Diam] , identifier[HeadlossCDC] , identifier[Ratio_Error] , identifier[KMinor] ): literal[string] identifier[flow] =( identifier[pc] . identifier[area_circle] ( identifier[Diam] )). identifier[magnitude] * identifier[np] . identifier[sqrt] (( literal[in...
def max_linear_flow(Diam, HeadlossCDC, Ratio_Error, KMinor): """Return the maximum flow that will meet the linear requirement. Maximum flow that can be put through a tube of a given diameter without exceeding the allowable deviation from linear head loss behavior """ flow = pc.area_circle(Diam).magn...
def edge_predicate(func: DictEdgePredicate) -> EdgePredicate: # noqa: D202 """Decorate an edge predicate function that only takes a dictionary as its singular argument. Apply this as a decorator to a function that takes a single argument, a PyBEL node data dictionary, to make sure that it can also accept ...
def function[edge_predicate, parameter[func]]: constant[Decorate an edge predicate function that only takes a dictionary as its singular argument. Apply this as a decorator to a function that takes a single argument, a PyBEL node data dictionary, to make sure that it can also accept a pair of arguments...
keyword[def] identifier[edge_predicate] ( identifier[func] : identifier[DictEdgePredicate] )-> identifier[EdgePredicate] : literal[string] @ identifier[wraps] ( identifier[func] ) keyword[def] identifier[_wrapped] (* identifier[args] ): identifier[x] = identifier[args] [ literal[int] ] ...
def edge_predicate(func: DictEdgePredicate) -> EdgePredicate: # noqa: D202 'Decorate an edge predicate function that only takes a dictionary as its singular argument.\n\n Apply this as a decorator to a function that takes a single argument, a PyBEL node data dictionary, to make\n sure that it can also accept...
def child_task(self, q, l, gq, gl): '''child process - this holds GUI elements''' mp_util.child_close_fds() from ..lib import wx_processguard from ..lib.wx_loader import wx from MAVProxy.modules.mavproxy_misseditor import missionEditorFrame self.app = wx.App(Fal...
def function[child_task, parameter[self, q, l, gq, gl]]: constant[child process - this holds GUI elements] call[name[mp_util].child_close_fds, parameter[]] from relative_module[lib] import module[wx_processguard] from relative_module[lib.wx_loader] import module[wx] from relative_module[MAVP...
keyword[def] identifier[child_task] ( identifier[self] , identifier[q] , identifier[l] , identifier[gq] , identifier[gl] ): literal[string] identifier[mp_util] . identifier[child_close_fds] () keyword[from] .. identifier[lib] keyword[import] identifier[wx_processguard] keyword...
def child_task(self, q, l, gq, gl): """child process - this holds GUI elements""" mp_util.child_close_fds() from ..lib import wx_processguard from ..lib.wx_loader import wx from MAVProxy.modules.mavproxy_misseditor import missionEditorFrame self.app = wx.App(False) self.app.frame = missionEd...
def import_keypair(kwargs=None, call=None): ''' Upload public key to cloud provider. Similar to EC2 import_keypair. .. versionadded:: 2016.11.0 kwargs file(mandatory): public key file-name keyname(mandatory): public key name in the provider ''' with salt.utils.files.fopen(k...
def function[import_keypair, parameter[kwargs, call]]: constant[ Upload public key to cloud provider. Similar to EC2 import_keypair. .. versionadded:: 2016.11.0 kwargs file(mandatory): public key file-name keyname(mandatory): public key name in the provider ] with c...
keyword[def] identifier[import_keypair] ( identifier[kwargs] = keyword[None] , identifier[call] = keyword[None] ): literal[string] keyword[with] identifier[salt] . identifier[utils] . identifier[files] . identifier[fopen] ( identifier[kwargs] [ literal[string] ], literal[string] ) keyword[as] identifier[...
def import_keypair(kwargs=None, call=None): """ Upload public key to cloud provider. Similar to EC2 import_keypair. .. versionadded:: 2016.11.0 kwargs file(mandatory): public key file-name keyname(mandatory): public key name in the provider """ with salt.utils.files.fopen(k...
def message_to_dict(msg): """Convert an email message into a dictionary. This function transforms an `email.message.Message` object into a dictionary. Headers are stored as key:value pairs while the body of the message is stored inside `body` key. Body may have two other keys inside, 'plain', for p...
def function[message_to_dict, parameter[msg]]: constant[Convert an email message into a dictionary. This function transforms an `email.message.Message` object into a dictionary. Headers are stored as key:value pairs while the body of the message is stored inside `body` key. Body may have two ot...
keyword[def] identifier[message_to_dict] ( identifier[msg] ): literal[string] keyword[def] identifier[parse_headers] ( identifier[msg] ): identifier[headers] ={} keyword[for] identifier[header] , identifier[value] keyword[in] identifier[msg] . identifier[items] (): ident...
def message_to_dict(msg): """Convert an email message into a dictionary. This function transforms an `email.message.Message` object into a dictionary. Headers are stored as key:value pairs while the body of the message is stored inside `body` key. Body may have two other keys inside, 'plain', for p...
def render_flow(self, data): """render the OpenDocument with the user data @param data: the input stream of user data. This should be a dictionary mapping, keys being the values accessible to your report. @type data: dictionary """ self.render_tree(data) # then...
def function[render_flow, parameter[self, data]]: constant[render the OpenDocument with the user data @param data: the input stream of user data. This should be a dictionary mapping, keys being the values accessible to your report. @type data: dictionary ] call[name[self...
keyword[def] identifier[render_flow] ( identifier[self] , identifier[data] ): literal[string] identifier[self] . identifier[render_tree] ( identifier[data] ) keyword[for] identifier[status] keyword[in] identifier[self] . identifier[__save_output] (): keyword[yiel...
def render_flow(self, data): """render the OpenDocument with the user data @param data: the input stream of user data. This should be a dictionary mapping, keys being the values accessible to your report. @type data: dictionary """ self.render_tree(data) # then reconstruct a...
def _extract_cell_info(self, structure, site_idx, sites, targets, voro, compute_adj_neighbors=False): """Get the information about a certain atom from the results of a tessellation Args: structure (Structure) - Structure being assessed site_idx (int) -...
def function[_extract_cell_info, parameter[self, structure, site_idx, sites, targets, voro, compute_adj_neighbors]]: constant[Get the information about a certain atom from the results of a tessellation Args: structure (Structure) - Structure being assessed site_idx (int) - Index...
keyword[def] identifier[_extract_cell_info] ( identifier[self] , identifier[structure] , identifier[site_idx] , identifier[sites] , identifier[targets] , identifier[voro] , identifier[compute_adj_neighbors] = keyword[False] ): literal[string] identifier[all_vertices] = identifier[voro] . ...
def _extract_cell_info(self, structure, site_idx, sites, targets, voro, compute_adj_neighbors=False): """Get the information about a certain atom from the results of a tessellation Args: structure (Structure) - Structure being assessed site_idx (int) - Index of the atom in question ...
def remove_plugin_filepaths(self, filepaths): """ Removes `filepaths` from `self.plugin_filepaths`. Recommend passing in absolute filepaths. Method will attempt to convert to absolute paths if not passed in. `filepaths` can be a single object or an iterable. """ ...
def function[remove_plugin_filepaths, parameter[self, filepaths]]: constant[ Removes `filepaths` from `self.plugin_filepaths`. Recommend passing in absolute filepaths. Method will attempt to convert to absolute paths if not passed in. `filepaths` can be a single object or an ite...
keyword[def] identifier[remove_plugin_filepaths] ( identifier[self] , identifier[filepaths] ): literal[string] identifier[filepaths] = identifier[util] . identifier[to_absolute_paths] ( identifier[filepaths] ) identifier[self] . identifier[plugin_filepaths] = identifier[util] . identifier[...
def remove_plugin_filepaths(self, filepaths): """ Removes `filepaths` from `self.plugin_filepaths`. Recommend passing in absolute filepaths. Method will attempt to convert to absolute paths if not passed in. `filepaths` can be a single object or an iterable. """ filepath...
def get_product_set( self, location, product_set_id, project_id=None, retry=None, timeout=None, metadata=None ): """ For the documentation see: :class:`~airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetGetOperator` """ client = self.get_conn() ...
def function[get_product_set, parameter[self, location, product_set_id, project_id, retry, timeout, metadata]]: constant[ For the documentation see: :class:`~airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetGetOperator` ] variable[client] assign[=] call[name[sel...
keyword[def] identifier[get_product_set] ( identifier[self] , identifier[location] , identifier[product_set_id] , identifier[project_id] = keyword[None] , identifier[retry] = keyword[None] , identifier[timeout] = keyword[None] , identifier[metadata] = keyword[None] ): literal[string] identifier[c...
def get_product_set(self, location, product_set_id, project_id=None, retry=None, timeout=None, metadata=None): """ For the documentation see: :class:`~airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetGetOperator` """ client = self.get_conn() name = ProductSearchClie...
def request_headers(self): '''Fill request headers from the environ dictionary and modify them via the list of :attr:`headers_middleware`. The returned headers will be sent to the target uri. ''' headers = CIMultiDict() for k in self.environ: if k.startswith('...
def function[request_headers, parameter[self]]: constant[Fill request headers from the environ dictionary and modify them via the list of :attr:`headers_middleware`. The returned headers will be sent to the target uri. ] variable[headers] assign[=] call[name[CIMultiDict], paramet...
keyword[def] identifier[request_headers] ( identifier[self] ): literal[string] identifier[headers] = identifier[CIMultiDict] () keyword[for] identifier[k] keyword[in] identifier[self] . identifier[environ] : keyword[if] identifier[k] . identifier[startswith] ( literal[stri...
def request_headers(self): """Fill request headers from the environ dictionary and modify them via the list of :attr:`headers_middleware`. The returned headers will be sent to the target uri. """ headers = CIMultiDict() for k in self.environ: if k.startswith('HTTP_'): ...
def get_maxweight(self, weight, concurrent_tasks, minweight=MINWEIGHT): """ Return an appropriate maxweight for use in the block_splitter """ totweight = self.get_weight(weight) ct = concurrent_tasks or 1 mw = math.ceil(totweight / ct) return max(mw, minweight)
def function[get_maxweight, parameter[self, weight, concurrent_tasks, minweight]]: constant[ Return an appropriate maxweight for use in the block_splitter ] variable[totweight] assign[=] call[name[self].get_weight, parameter[name[weight]]] variable[ct] assign[=] <ast.BoolOp objec...
keyword[def] identifier[get_maxweight] ( identifier[self] , identifier[weight] , identifier[concurrent_tasks] , identifier[minweight] = identifier[MINWEIGHT] ): literal[string] identifier[totweight] = identifier[self] . identifier[get_weight] ( identifier[weight] ) identifier[ct] = identif...
def get_maxweight(self, weight, concurrent_tasks, minweight=MINWEIGHT): """ Return an appropriate maxweight for use in the block_splitter """ totweight = self.get_weight(weight) ct = concurrent_tasks or 1 mw = math.ceil(totweight / ct) return max(mw, minweight)
def transpose(self): """Return the transpose of the operator.""" return Operator( np.transpose(self.data), self.input_dims(), self.output_dims())
def function[transpose, parameter[self]]: constant[Return the transpose of the operator.] return[call[name[Operator], parameter[call[name[np].transpose, parameter[name[self].data]], call[name[self].input_dims, parameter[]], call[name[self].output_dims, parameter[]]]]]
keyword[def] identifier[transpose] ( identifier[self] ): literal[string] keyword[return] identifier[Operator] ( identifier[np] . identifier[transpose] ( identifier[self] . identifier[data] ), identifier[self] . identifier[input_dims] (), identifier[self] . identifier[output_dims] ())
def transpose(self): """Return the transpose of the operator.""" return Operator(np.transpose(self.data), self.input_dims(), self.output_dims())
def clear_waiting_coordinators(self, cancel=False): ''' remove all entries from waiting queue or cancell all in waiting queue ''' with self._lockw: if cancel: for _coordinator in self._waiting_transfer_coordinators: _coordinator.notify_cancelled("Clear Wai...
def function[clear_waiting_coordinators, parameter[self, cancel]]: constant[ remove all entries from waiting queue or cancell all in waiting queue ] with name[self]._lockw begin[:] if name[cancel] begin[:] for taget[name[_coordinator]] in starred[name[self]._waiti...
keyword[def] identifier[clear_waiting_coordinators] ( identifier[self] , identifier[cancel] = keyword[False] ): literal[string] keyword[with] identifier[self] . identifier[_lockw] : keyword[if] identifier[cancel] : keyword[for] identifier[_coordinator] keyword[in] ...
def clear_waiting_coordinators(self, cancel=False): """ remove all entries from waiting queue or cancell all in waiting queue """ with self._lockw: if cancel: for _coordinator in self._waiting_transfer_coordinators: _coordinator.notify_cancelled('Clear Waiting Queue', False) ...
def register(func=None, name=None): """ Expose compiler to factory. :param func: the callable to expose :type func: callable :param name: name of format :type name: str It can be used as a decorator:: @register(name='my:validator') def my_validator(obj): if obj...
def function[register, parameter[func, name]]: constant[ Expose compiler to factory. :param func: the callable to expose :type func: callable :param name: name of format :type name: str It can be used as a decorator:: @register(name='my:validator') def my_validator(obj...
keyword[def] identifier[register] ( identifier[func] = keyword[None] , identifier[name] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[name] : keyword[raise] identifier[CompilationError] ( literal[string] ) keyword[if] keyword[not] identifier[func] : keyw...
def register(func=None, name=None): """ Expose compiler to factory. :param func: the callable to expose :type func: callable :param name: name of format :type name: str It can be used as a decorator:: @register(name='my:validator') def my_validator(obj): if obj...
def rest_equals(self, rest_object): """ Compare objects REST attributes """ if not self.equals(rest_object): return False return self.to_dict() == rest_object.to_dict()
def function[rest_equals, parameter[self, rest_object]]: constant[ Compare objects REST attributes ] if <ast.UnaryOp object at 0x7da1b0d1dd80> begin[:] return[constant[False]] return[compare[call[name[self].to_dict, parameter[]] equal[==] call[name[rest_object].to_dict, parameter[]]...
keyword[def] identifier[rest_equals] ( identifier[self] , identifier[rest_object] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[equals] ( identifier[rest_object] ): keyword[return] keyword[False] keyword[return] identifier[self] . identifier[t...
def rest_equals(self, rest_object): """ Compare objects REST attributes """ if not self.equals(rest_object): return False # depends on [control=['if'], data=[]] return self.to_dict() == rest_object.to_dict()
def _link_package_versions(self, link, search_name): """ Return an iterable of triples (pkg_resources_version_key, link, python_version) that can be extracted from the given link. Meant to be overridden by subclasses, not called by clients. """ if link.egg_fragme...
def function[_link_package_versions, parameter[self, link, search_name]]: constant[ Return an iterable of triples (pkg_resources_version_key, link, python_version) that can be extracted from the given link. Meant to be overridden by subclasses, not called by clients. ] ...
keyword[def] identifier[_link_package_versions] ( identifier[self] , identifier[link] , identifier[search_name] ): literal[string] keyword[if] identifier[link] . identifier[egg_fragment] : identifier[egg_info] = identifier[link] . identifier[egg_fragment] keyword[else] : ...
def _link_package_versions(self, link, search_name): """ Return an iterable of triples (pkg_resources_version_key, link, python_version) that can be extracted from the given link. Meant to be overridden by subclasses, not called by clients. """ if link.egg_fragment: ...
def parent_dir(path): '''Return the parent of a directory.''' return os.path.abspath(os.path.join(path, os.pardir, os.pardir, '_build'))
def function[parent_dir, parameter[path]]: constant[Return the parent of a directory.] return[call[name[os].path.abspath, parameter[call[name[os].path.join, parameter[name[path], name[os].pardir, name[os].pardir, constant[_build]]]]]]
keyword[def] identifier[parent_dir] ( identifier[path] ): literal[string] keyword[return] identifier[os] . identifier[path] . identifier[abspath] ( identifier[os] . identifier[path] . identifier[join] ( identifier[path] , identifier[os] . identifier[pardir] , identifier[os] . identifier[pardir] , literal[...
def parent_dir(path): """Return the parent of a directory.""" return os.path.abspath(os.path.join(path, os.pardir, os.pardir, '_build'))
def sparql(self, select='*', body=None, inject_prefixes=None, single_column=False): """ Execute a SPARQL query. The query is specified using `select` and `body` parameters. The argument for the Named Graph is injected into the query. The select parameter should be either '*' or...
def function[sparql, parameter[self, select, body, inject_prefixes, single_column]]: constant[ Execute a SPARQL query. The query is specified using `select` and `body` parameters. The argument for the Named Graph is injected into the query. The select parameter should be either...
keyword[def] identifier[sparql] ( identifier[self] , identifier[select] = literal[string] , identifier[body] = keyword[None] , identifier[inject_prefixes] = keyword[None] , identifier[single_column] = keyword[False] ): literal[string] keyword[if] identifier[inject_prefixes] keyword[is] keyword[N...
def sparql(self, select='*', body=None, inject_prefixes=None, single_column=False): """ Execute a SPARQL query. The query is specified using `select` and `body` parameters. The argument for the Named Graph is injected into the query. The select parameter should be either '*' or a l...
def check_for_bucket(self, bucket_name): """ Check if bucket_name exists. :param bucket_name: the name of the bucket :type bucket_name: str """ try: self.get_conn().head_bucket(Bucket=bucket_name) return True except ClientError as e: ...
def function[check_for_bucket, parameter[self, bucket_name]]: constant[ Check if bucket_name exists. :param bucket_name: the name of the bucket :type bucket_name: str ] <ast.Try object at 0x7da18bccaa10>
keyword[def] identifier[check_for_bucket] ( identifier[self] , identifier[bucket_name] ): literal[string] keyword[try] : identifier[self] . identifier[get_conn] (). identifier[head_bucket] ( identifier[Bucket] = identifier[bucket_name] ) keyword[return] keyword[True] ...
def check_for_bucket(self, bucket_name): """ Check if bucket_name exists. :param bucket_name: the name of the bucket :type bucket_name: str """ try: self.get_conn().head_bucket(Bucket=bucket_name) return True # depends on [control=['try'], data=[]] except Cl...
def check_serial_port(name): """returns valid COM Port.""" try: cdc = next(serial.tools.list_ports.grep(name)) return cdc[0] except StopIteration: msg = "device {} not found. ".format(name) msg += "available devices are: " ports = list(serial.tools.list_ports.comports...
def function[check_serial_port, parameter[name]]: constant[returns valid COM Port.] <ast.Try object at 0x7da1b1fdff10>
keyword[def] identifier[check_serial_port] ( identifier[name] ): literal[string] keyword[try] : identifier[cdc] = identifier[next] ( identifier[serial] . identifier[tools] . identifier[list_ports] . identifier[grep] ( identifier[name] )) keyword[return] identifier[cdc] [ literal[int] ] ...
def check_serial_port(name): """returns valid COM Port.""" try: cdc = next(serial.tools.list_ports.grep(name)) return cdc[0] # depends on [control=['try'], data=[]] except StopIteration: msg = 'device {} not found. '.format(name) msg += 'available devices are: ' port...
def _split_path(path): """split a path return by the api return - the sentinel: - the rest of the path as a list. - the original path stripped of / for normalisation. """ path = path.strip('/') list_path = path.split('/') sentinel = list_path.pop(0) return sentinel, ...
def function[_split_path, parameter[path]]: constant[split a path return by the api return - the sentinel: - the rest of the path as a list. - the original path stripped of / for normalisation. ] variable[path] assign[=] call[name[path].strip, parameter[constant[/]]] ...
keyword[def] identifier[_split_path] ( identifier[path] ): literal[string] identifier[path] = identifier[path] . identifier[strip] ( literal[string] ) identifier[list_path] = identifier[path] . identifier[split] ( literal[string] ) identifier[sentinel] = identifier[list_path] . identifier[pop] ( ...
def _split_path(path): """split a path return by the api return - the sentinel: - the rest of the path as a list. - the original path stripped of / for normalisation. """ path = path.strip('/') list_path = path.split('/') sentinel = list_path.pop(0) return (sentinel,...
def is_alpha(self): """Asserts that val is non-empty string and all characters are alphabetic.""" if not isinstance(self.val, str_types): raise TypeError('val is not a string') if len(self.val) == 0: raise ValueError('val is empty') if not self.val.isalpha(): ...
def function[is_alpha, parameter[self]]: constant[Asserts that val is non-empty string and all characters are alphabetic.] if <ast.UnaryOp object at 0x7da1b0126590> begin[:] <ast.Raise object at 0x7da1b0126650> if compare[call[name[len], parameter[name[self].val]] equal[==] constant[0]] ...
keyword[def] identifier[is_alpha] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[self] . identifier[val] , identifier[str_types] ): keyword[raise] identifier[TypeError] ( literal[string] ) keyword[if] identifier[len] ( id...
def is_alpha(self): """Asserts that val is non-empty string and all characters are alphabetic.""" if not isinstance(self.val, str_types): raise TypeError('val is not a string') # depends on [control=['if'], data=[]] if len(self.val) == 0: raise ValueError('val is empty') # depends on [cont...
def get_children(parent, idx): """Gets the child at parent[idx], or all the children if idx == "*".""" if isinstance(parent, dict): if idx in parent: yield parent[idx] else: raise JSONPathError("Invalid path at {0}".format(idx)) elif isinstance(parent, list): if idx == "*": yield fr...
def function[get_children, parameter[parent, idx]]: constant[Gets the child at parent[idx], or all the children if idx == "*".] if call[name[isinstance], parameter[name[parent], name[dict]]] begin[:] if compare[name[idx] in name[parent]] begin[:] <ast.Yield object...
keyword[def] identifier[get_children] ( identifier[parent] , identifier[idx] ): literal[string] keyword[if] identifier[isinstance] ( identifier[parent] , identifier[dict] ): keyword[if] identifier[idx] keyword[in] identifier[parent] : keyword[yield] identifier[parent] [ identifier[idx] ] ...
def get_children(parent, idx): """Gets the child at parent[idx], or all the children if idx == "*".""" if isinstance(parent, dict): if idx in parent: yield parent[idx] # depends on [control=['if'], data=['idx', 'parent']] else: raise JSONPathError('Invalid path at {0}'.f...
def stack(self, size=None): """ Aggregates records of a distributed array. Stacking should improve the performance of vectorized operations, but the resulting StackedArray object only exposes a restricted set of operations (e.g. map, reduce). The unstack method can be used ...
def function[stack, parameter[self, size]]: constant[ Aggregates records of a distributed array. Stacking should improve the performance of vectorized operations, but the resulting StackedArray object only exposes a restricted set of operations (e.g. map, reduce). The unstack me...
keyword[def] identifier[stack] ( identifier[self] , identifier[size] = keyword[None] ): literal[string] identifier[stk] = identifier[StackedArray] ( identifier[self] . identifier[_rdd] , identifier[shape] = identifier[self] . identifier[shape] , identifier[split] = identifier[self] . identifier[spl...
def stack(self, size=None): """ Aggregates records of a distributed array. Stacking should improve the performance of vectorized operations, but the resulting StackedArray object only exposes a restricted set of operations (e.g. map, reduce). The unstack method can be used t...
def load_lang_conf(): """ Load language setting from language config file if it exists, otherwise try to use the local settings if Spyder provides a translation, or return the default if no translation provided. """ if osp.isfile(LANG_FILE): with open(LANG_FILE, 'r') as f: ...
def function[load_lang_conf, parameter[]]: constant[ Load language setting from language config file if it exists, otherwise try to use the local settings if Spyder provides a translation, or return the default if no translation provided. ] if call[name[osp].isfile, parameter[name[LANG_F...
keyword[def] identifier[load_lang_conf] (): literal[string] keyword[if] identifier[osp] . identifier[isfile] ( identifier[LANG_FILE] ): keyword[with] identifier[open] ( identifier[LANG_FILE] , literal[string] ) keyword[as] identifier[f] : identifier[lang] = identifier[f] . iden...
def load_lang_conf(): """ Load language setting from language config file if it exists, otherwise try to use the local settings if Spyder provides a translation, or return the default if no translation provided. """ if osp.isfile(LANG_FILE): with open(LANG_FILE, 'r') as f: la...
def run(self, num_runs, show_trails, log_file_base): """ Run each agent in the world for 'num_runs' iterations Optionally saves grid results to file if base name is passed to method. """ print("--------------------------------------------------") print("Starting S...
def function[run, parameter[self, num_runs, show_trails, log_file_base]]: constant[ Run each agent in the world for 'num_runs' iterations Optionally saves grid results to file if base name is passed to method. ] call[name[print], parameter[constant[-----------------------...
keyword[def] identifier[run] ( identifier[self] , identifier[num_runs] , identifier[show_trails] , identifier[log_file_base] ): literal[string] identifier[print] ( literal[string] ) identifier[print] ( literal[string] , identifier[self] . identifier[agent_list] [ literal[int] ]. identifier...
def run(self, num_runs, show_trails, log_file_base): """ Run each agent in the world for 'num_runs' iterations Optionally saves grid results to file if base name is passed to method. """ print('--------------------------------------------------') print('Starting Simulation - ...
def _migrate_resource(instance, migrations, version=''): """ Migrate a resource instance Subresources are migrated first, then the resource is recursively migrated :param instance: a perch.Document instance :param migrations: the migrations for a resource :param version: the current resource v...
def function[_migrate_resource, parameter[instance, migrations, version]]: constant[ Migrate a resource instance Subresources are migrated first, then the resource is recursively migrated :param instance: a perch.Document instance :param migrations: the migrations for a resource :param ver...
keyword[def] identifier[_migrate_resource] ( identifier[instance] , identifier[migrations] , identifier[version] = literal[string] ): literal[string] keyword[if] identifier[version] keyword[not] keyword[in] identifier[migrations] : keyword[return] identifier[instance] identifier[instan...
def _migrate_resource(instance, migrations, version=''): """ Migrate a resource instance Subresources are migrated first, then the resource is recursively migrated :param instance: a perch.Document instance :param migrations: the migrations for a resource :param version: the current resource v...
def transmit_ack_bpdu(self): """ Send Topology Change Ack BPDU. """ ack_flags = 0b10000001 bpdu_data = self._generate_config_bpdu(ack_flags) self.ofctl.send_packet_out(self.ofport.port_no, bpdu_data)
def function[transmit_ack_bpdu, parameter[self]]: constant[ Send Topology Change Ack BPDU. ] variable[ack_flags] assign[=] constant[129] variable[bpdu_data] assign[=] call[name[self]._generate_config_bpdu, parameter[name[ack_flags]]] call[name[self].ofctl.send_packet_out, parameter[name[...
keyword[def] identifier[transmit_ack_bpdu] ( identifier[self] ): literal[string] identifier[ack_flags] = literal[int] identifier[bpdu_data] = identifier[self] . identifier[_generate_config_bpdu] ( identifier[ack_flags] ) identifier[self] . identifier[ofctl] . identifier[send_pack...
def transmit_ack_bpdu(self): """ Send Topology Change Ack BPDU. """ ack_flags = 129 bpdu_data = self._generate_config_bpdu(ack_flags) self.ofctl.send_packet_out(self.ofport.port_no, bpdu_data)
def flush(self): """ Force commit changes to the file and stdout """ if not self.nostdout: self.stdout.flush() if self.file is not None: self.file.flush()
def function[flush, parameter[self]]: constant[ Force commit changes to the file and stdout ] if <ast.UnaryOp object at 0x7da1b04005e0> begin[:] call[name[self].stdout.flush, parameter[]] if compare[name[self].file is_not constant[None]] begin[:] call[name[self].f...
keyword[def] identifier[flush] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[nostdout] : identifier[self] . identifier[stdout] . identifier[flush] () keyword[if] identifier[self] . identifier[file] keyword[is] keyword[not] k...
def flush(self): """ Force commit changes to the file and stdout """ if not self.nostdout: self.stdout.flush() # depends on [control=['if'], data=[]] if self.file is not None: self.file.flush() # depends on [control=['if'], data=[]]
def _update_id(record, new_id): """ Update a record id to new_id, also modifying the ID in record.description """ old_id = record.id record.id = new_id # At least for FASTA, record ID starts the description record.description = re.sub('^' + re.escape(old_id), new_id, record.description) ...
def function[_update_id, parameter[record, new_id]]: constant[ Update a record id to new_id, also modifying the ID in record.description ] variable[old_id] assign[=] name[record].id name[record].id assign[=] name[new_id] name[record].description assign[=] call[name[re].sub, param...
keyword[def] identifier[_update_id] ( identifier[record] , identifier[new_id] ): literal[string] identifier[old_id] = identifier[record] . identifier[id] identifier[record] . identifier[id] = identifier[new_id] identifier[record] . identifier[description] = identifier[re] . identifier[sub...
def _update_id(record, new_id): """ Update a record id to new_id, also modifying the ID in record.description """ old_id = record.id record.id = new_id # At least for FASTA, record ID starts the description record.description = re.sub('^' + re.escape(old_id), new_id, record.description) ...
def to_native(self): """ Convert to a native Python `datetime.time` value. """ h, m, s = self.hour_minute_second s, ns = nano_divmod(s, 1) ms = int(nano_mul(ns, 1000000)) return time(h, m, s, ms)
def function[to_native, parameter[self]]: constant[ Convert to a native Python `datetime.time` value. ] <ast.Tuple object at 0x7da1b2581960> assign[=] name[self].hour_minute_second <ast.Tuple object at 0x7da1b2582d10> assign[=] call[name[nano_divmod], parameter[name[s], constant[1]]] ...
keyword[def] identifier[to_native] ( identifier[self] ): literal[string] identifier[h] , identifier[m] , identifier[s] = identifier[self] . identifier[hour_minute_second] identifier[s] , identifier[ns] = identifier[nano_divmod] ( identifier[s] , literal[int] ) identifier[ms] = id...
def to_native(self): """ Convert to a native Python `datetime.time` value. """ (h, m, s) = self.hour_minute_second (s, ns) = nano_divmod(s, 1) ms = int(nano_mul(ns, 1000000)) return time(h, m, s, ms)
def get_desired(): """Populate ``DESIRED_TEMPLATE`` with public members. If there are no members, does nothing. Returns: str: The "desired" contents of ``bezier.rst``. """ public_members = get_public_members() if public_members: members = "\n :members: {}".format(", ".join(p...
def function[get_desired, parameter[]]: constant[Populate ``DESIRED_TEMPLATE`` with public members. If there are no members, does nothing. Returns: str: The "desired" contents of ``bezier.rst``. ] variable[public_members] assign[=] call[name[get_public_members], parameter[]] ...
keyword[def] identifier[get_desired] (): literal[string] identifier[public_members] = identifier[get_public_members] () keyword[if] identifier[public_members] : identifier[members] = literal[string] . identifier[format] ( literal[string] . identifier[join] ( identifier[public_members] )) ...
def get_desired(): """Populate ``DESIRED_TEMPLATE`` with public members. If there are no members, does nothing. Returns: str: The "desired" contents of ``bezier.rst``. """ public_members = get_public_members() if public_members: members = '\n :members: {}'.format(', '.join(p...
def marv(ctx, config, loglevel, logfilter, verbosity): """Manage a Marv site""" if config is None: cwd = os.path.abspath(os.path.curdir) while cwd != os.path.sep: config = os.path.join(cwd, 'marv.conf') if os.path.exists(config): break cwd = os...
def function[marv, parameter[ctx, config, loglevel, logfilter, verbosity]]: constant[Manage a Marv site] if compare[name[config] is constant[None]] begin[:] variable[cwd] assign[=] call[name[os].path.abspath, parameter[name[os].path.curdir]] while compare[name[cwd] not_eq...
keyword[def] identifier[marv] ( identifier[ctx] , identifier[config] , identifier[loglevel] , identifier[logfilter] , identifier[verbosity] ): literal[string] keyword[if] identifier[config] keyword[is] keyword[None] : identifier[cwd] = identifier[os] . identifier[path] . identifier[abspath] ( i...
def marv(ctx, config, loglevel, logfilter, verbosity): """Manage a Marv site""" if config is None: cwd = os.path.abspath(os.path.curdir) while cwd != os.path.sep: config = os.path.join(cwd, 'marv.conf') if os.path.exists(config): break # depends on [contr...
def BVS(name, size, min=None, max=None, stride=None, uninitialized=False, #pylint:disable=redefined-builtin explicit_name=None, discrete_set=False, discrete_set_max_card=None, **kwargs): """ Creates a bit-vector symbol (i.e., a variable). If you want to specify the maximum or minimum value of a no...
def function[BVS, parameter[name, size, min, max, stride, uninitialized, explicit_name, discrete_set, discrete_set_max_card]]: constant[ Creates a bit-vector symbol (i.e., a variable). If you want to specify the maximum or minimum value of a normal symbol that is not part of value-set analysis, you ...
keyword[def] identifier[BVS] ( identifier[name] , identifier[size] , identifier[min] = keyword[None] , identifier[max] = keyword[None] , identifier[stride] = keyword[None] , identifier[uninitialized] = keyword[False] , identifier[explicit_name] = keyword[None] , identifier[discrete_set] = keyword[False] , identifier...
def BVS(name, size, min=None, max=None, stride=None, uninitialized=False, explicit_name=None, discrete_set=False, discrete_set_max_card=None, **kwargs): #pylint:disable=redefined-builtin '\n Creates a bit-vector symbol (i.e., a variable).\n\n If you want to specify the maximum or minimum value of a normal sy...
def add_node_collection(self, node, collection): """Add the collected test items from a node The collection is stored in the ``.node2collection`` map. Called by the ``DSession.worker_collectionfinish`` hook. """ assert node in self.node2pending if self.collection_is_comp...
def function[add_node_collection, parameter[self, node, collection]]: constant[Add the collected test items from a node The collection is stored in the ``.node2collection`` map. Called by the ``DSession.worker_collectionfinish`` hook. ] assert[compare[name[node] in name[self].node2p...
keyword[def] identifier[add_node_collection] ( identifier[self] , identifier[node] , identifier[collection] ): literal[string] keyword[assert] identifier[node] keyword[in] identifier[self] . identifier[node2pending] keyword[if] identifier[self] . identifier[collection_is_completed] : ...
def add_node_collection(self, node, collection): """Add the collected test items from a node The collection is stored in the ``.node2collection`` map. Called by the ``DSession.worker_collectionfinish`` hook. """ assert node in self.node2pending if self.collection_is_completed: ...
def state_probability(self, direction, repertoire, purview,): """Compute the probability of the purview in its current state given the repertoire. Collapses the dimensions of the repertoire that correspond to the purview nodes onto their state. All other dimension are already si...
def function[state_probability, parameter[self, direction, repertoire, purview]]: constant[Compute the probability of the purview in its current state given the repertoire. Collapses the dimensions of the repertoire that correspond to the purview nodes onto their state. All other dimens...
keyword[def] identifier[state_probability] ( identifier[self] , identifier[direction] , identifier[repertoire] , identifier[purview] ,): literal[string] identifier[purview_state] = identifier[self] . identifier[purview_state] ( identifier[direction] ) identifier[index] = identifier[tuple]...
def state_probability(self, direction, repertoire, purview): """Compute the probability of the purview in its current state given the repertoire. Collapses the dimensions of the repertoire that correspond to the purview nodes onto their state. All other dimension are already singula...
def save_files(self, selections) -> None: """Save the |Selection| objects contained in the given |Selections| instance to separate network files.""" try: currentpath = self.currentpath selections = selectiontools.Selections(selections) for selection in selecti...
def function[save_files, parameter[self, selections]]: constant[Save the |Selection| objects contained in the given |Selections| instance to separate network files.] <ast.Try object at 0x7da2044c2cb0>
keyword[def] identifier[save_files] ( identifier[self] , identifier[selections] )-> keyword[None] : literal[string] keyword[try] : identifier[currentpath] = identifier[self] . identifier[currentpath] identifier[selections] = identifier[selectiontools] . identifier[Selecti...
def save_files(self, selections) -> None: """Save the |Selection| objects contained in the given |Selections| instance to separate network files.""" try: currentpath = self.currentpath selections = selectiontools.Selections(selections) for selection in selections: if ...
def add_petabencana_layer(self): """Add petabencana layer to the map. This uses the PetaBencana API to fetch the latest floods in JK. See https://data.petabencana.id/floods """ from safe.gui.tools.peta_bencana_dialog import PetaBencanaDialog dialog = PetaBencanaDialog(se...
def function[add_petabencana_layer, parameter[self]]: constant[Add petabencana layer to the map. This uses the PetaBencana API to fetch the latest floods in JK. See https://data.petabencana.id/floods ] from relative_module[safe.gui.tools.peta_bencana_dialog] import module[PetaBencan...
keyword[def] identifier[add_petabencana_layer] ( identifier[self] ): literal[string] keyword[from] identifier[safe] . identifier[gui] . identifier[tools] . identifier[peta_bencana_dialog] keyword[import] identifier[PetaBencanaDialog] identifier[dialog] = identifier[PetaBencanaDialog] (...
def add_petabencana_layer(self): """Add petabencana layer to the map. This uses the PetaBencana API to fetch the latest floods in JK. See https://data.petabencana.id/floods """ from safe.gui.tools.peta_bencana_dialog import PetaBencanaDialog dialog = PetaBencanaDialog(self.iface.mai...
def get_items(self, url, container, container_object, local_object): """Get an objects from a container. :param url: :param container: """ headers, container_uri = self._return_base_data( url=url, container=container, container_object=contain...
def function[get_items, parameter[self, url, container, container_object, local_object]]: constant[Get an objects from a container. :param url: :param container: ] <ast.Tuple object at 0x7da2054a5420> assign[=] call[name[self]._return_base_data, parameter[]] return[call[name...
keyword[def] identifier[get_items] ( identifier[self] , identifier[url] , identifier[container] , identifier[container_object] , identifier[local_object] ): literal[string] identifier[headers] , identifier[container_uri] = identifier[self] . identifier[_return_base_data] ( identifier[url]...
def get_items(self, url, container, container_object, local_object): """Get an objects from a container. :param url: :param container: """ (headers, container_uri) = self._return_base_data(url=url, container=container, container_object=container_object) return self._getter(uri=conta...
def _static_identity(cls, domain, dtype, missing_value, window_safe, ndim, params): """ Return the identity of the Term that would be constructed from the...
def function[_static_identity, parameter[cls, domain, dtype, missing_value, window_safe, ndim, params]]: constant[ Return the identity of the Term that would be constructed from the given arguments. Identities that compare equal will cause us to return a cached instance rather t...
keyword[def] identifier[_static_identity] ( identifier[cls] , identifier[domain] , identifier[dtype] , identifier[missing_value] , identifier[window_safe] , identifier[ndim] , identifier[params] ): literal[string] keyword[return] ( identifier[cls] , identifier[domain] , identifier[dtype] , id...
def _static_identity(cls, domain, dtype, missing_value, window_safe, ndim, params): """ Return the identity of the Term that would be constructed from the given arguments. Identities that compare equal will cause us to return a cached instance rather than constructing a new one. We...
def get_attribute(self, name): """ Get (find) a I{non-attribute} attribute by name. @param name: A attribute name. @type name: str @return: A tuple: the requested (attribute, ancestry). @rtype: (L{SchemaObject}, [L{SchemaObject},..]) """ for child, ancestr...
def function[get_attribute, parameter[self, name]]: constant[ Get (find) a I{non-attribute} attribute by name. @param name: A attribute name. @type name: str @return: A tuple: the requested (attribute, ancestry). @rtype: (L{SchemaObject}, [L{SchemaObject},..]) ] ...
keyword[def] identifier[get_attribute] ( identifier[self] , identifier[name] ): literal[string] keyword[for] identifier[child] , identifier[ancestry] keyword[in] identifier[self] . identifier[attributes] (): keyword[if] identifier[child] . identifier[name] == identifier[name] : ...
def get_attribute(self, name): """ Get (find) a I{non-attribute} attribute by name. @param name: A attribute name. @type name: str @return: A tuple: the requested (attribute, ancestry). @rtype: (L{SchemaObject}, [L{SchemaObject},..]) """ for (child, ancestry) in s...
def _ipsi(y, tol=1.48e-9, maxiter=10): '''Inverse of psi (digamma) using Newton's method. For the purposes of Dirichlet MLE, since the parameters a[i] must always satisfy a > 0, we define ipsi :: R -> (0,inf).''' y = asanyarray(y, dtype='float') x0 = _piecewise(y, [y >= -2.22, y < -2.22], ...
def function[_ipsi, parameter[y, tol, maxiter]]: constant[Inverse of psi (digamma) using Newton's method. For the purposes of Dirichlet MLE, since the parameters a[i] must always satisfy a > 0, we define ipsi :: R -> (0,inf).] variable[y] assign[=] call[name[asanyarray], parameter[name[y]]] ...
keyword[def] identifier[_ipsi] ( identifier[y] , identifier[tol] = literal[int] , identifier[maxiter] = literal[int] ): literal[string] identifier[y] = identifier[asanyarray] ( identifier[y] , identifier[dtype] = literal[string] ) identifier[x0] = identifier[_piecewise] ( identifier[y] ,[ identifier[y...
def _ipsi(y, tol=1.48e-09, maxiter=10): """Inverse of psi (digamma) using Newton's method. For the purposes of Dirichlet MLE, since the parameters a[i] must always satisfy a > 0, we define ipsi :: R -> (0,inf).""" y = asanyarray(y, dtype='float') x0 = _piecewise(y, [y >= -2.22, y < -2.22], [lambda x...
def _lookup_namespace(self, symbol, namespace): """Helper for lookup_symbol that only looks up variables in a namespace. Args: symbol: Symbol namespace: pointer into self.namespaces """ for namespace_part in symbol.parts: namespace = namespace.get...
def function[_lookup_namespace, parameter[self, symbol, namespace]]: constant[Helper for lookup_symbol that only looks up variables in a namespace. Args: symbol: Symbol namespace: pointer into self.namespaces ] for taget[name[namespace_part]] in starred[name[...
keyword[def] identifier[_lookup_namespace] ( identifier[self] , identifier[symbol] , identifier[namespace] ): literal[string] keyword[for] identifier[namespace_part] keyword[in] identifier[symbol] . identifier[parts] : identifier[namespace] = identifier[namespace] . identifier[get] ...
def _lookup_namespace(self, symbol, namespace): """Helper for lookup_symbol that only looks up variables in a namespace. Args: symbol: Symbol namespace: pointer into self.namespaces """ for namespace_part in symbol.parts: namespace = namespace.get(namespace_p...
def sync_heater_control(self, device_id, fan_status=None, power_status=None): """Set heater temps.""" loop = asyncio.get_event_loop() task = loop.create_task(self.heater_control(device_id, fan_status, ...
def function[sync_heater_control, parameter[self, device_id, fan_status, power_status]]: constant[Set heater temps.] variable[loop] assign[=] call[name[asyncio].get_event_loop, parameter[]] variable[task] assign[=] call[name[loop].create_task, parameter[call[name[self].heater_control, parameter[...
keyword[def] identifier[sync_heater_control] ( identifier[self] , identifier[device_id] , identifier[fan_status] = keyword[None] , identifier[power_status] = keyword[None] ): literal[string] identifier[loop] = identifier[asyncio] . identifier[get_event_loop] () identifier[task] = identifi...
def sync_heater_control(self, device_id, fan_status=None, power_status=None): """Set heater temps.""" loop = asyncio.get_event_loop() task = loop.create_task(self.heater_control(device_id, fan_status, power_status)) loop.run_until_complete(task)
def length(symlink_components): # type: (List[bytes]) -> int ''' Static method to return the length of the Rock Ridge Symbolic Link record. Parameters: symlink_components - A list containing a string for each of the symbolic link components...
def function[length, parameter[symlink_components]]: constant[ Static method to return the length of the Rock Ridge Symbolic Link record. Parameters: symlink_components - A list containing a string for each of the symbolic link components. ...
keyword[def] identifier[length] ( identifier[symlink_components] ): literal[string] identifier[length] = identifier[RRSLRecord] . identifier[header_length] () keyword[for] identifier[comp] keyword[in] identifier[symlink_components] : identifier[length] += identifier[RRSLRe...
def length(symlink_components): # type: (List[bytes]) -> int '\n Static method to return the length of the Rock Ridge Symbolic Link\n record.\n\n Parameters:\n symlink_components - A list containing a string for each of the\n symbolic link components.\n ...
def QueueClaimRecords(self, queue_id, item_rdf_type, limit=10000, timeout="30m", start_time=None, record_filter=lambda x: False, max_filtered=1000): ...
def function[QueueClaimRecords, parameter[self, queue_id, item_rdf_type, limit, timeout, start_time, record_filter, max_filtered]]: constant[Claims records from a queue. See server/aff4_objects/queue.py.] variable[now] assign[=] call[name[rdfvalue].RDFDatetime.Now, parameter[]] variable[expirati...
keyword[def] identifier[QueueClaimRecords] ( identifier[self] , identifier[queue_id] , identifier[item_rdf_type] , identifier[limit] = literal[int] , identifier[timeout] = literal[string] , identifier[start_time] = keyword[None] , identifier[record_filter] = keyword[lambda] identifier[x] : keyword[False] , id...
def QueueClaimRecords(self, queue_id, item_rdf_type, limit=10000, timeout='30m', start_time=None, record_filter=lambda x: False, max_filtered=1000): """Claims records from a queue. See server/aff4_objects/queue.py.""" now = rdfvalue.RDFDatetime.Now() expiration = rdfvalue.RDFDatetime.Now() + rdfvalue.Durati...
def Get(self): """Fetch file's data and return proper File object.""" args = vfs_pb2.ApiGetFileDetailsArgs( client_id=self.client_id, file_path=self.path) data = self._context.SendRequest("GetFileDetails", args).file return File(client_id=self.client_id, data=data, context=self._context)
def function[Get, parameter[self]]: constant[Fetch file's data and return proper File object.] variable[args] assign[=] call[name[vfs_pb2].ApiGetFileDetailsArgs, parameter[]] variable[data] assign[=] call[name[self]._context.SendRequest, parameter[constant[GetFileDetails], name[args]]].file ...
keyword[def] identifier[Get] ( identifier[self] ): literal[string] identifier[args] = identifier[vfs_pb2] . identifier[ApiGetFileDetailsArgs] ( identifier[client_id] = identifier[self] . identifier[client_id] , identifier[file_path] = identifier[self] . identifier[path] ) identifier[data] = iden...
def Get(self): """Fetch file's data and return proper File object.""" args = vfs_pb2.ApiGetFileDetailsArgs(client_id=self.client_id, file_path=self.path) data = self._context.SendRequest('GetFileDetails', args).file return File(client_id=self.client_id, data=data, context=self._context)
def load_skills_data() -> dict: """Contains info on how skills should be updated""" skills_data_file = expanduser('~/.mycroft/skills.json') if isfile(skills_data_file): try: with open(skills_data_file) as f: return json.load(f) except json.JSONDecodeError: ...
def function[load_skills_data, parameter[]]: constant[Contains info on how skills should be updated] variable[skills_data_file] assign[=] call[name[expanduser], parameter[constant[~/.mycroft/skills.json]]] if call[name[isfile], parameter[name[skills_data_file]]] begin[:] <ast.Try object ...
keyword[def] identifier[load_skills_data] ()-> identifier[dict] : literal[string] identifier[skills_data_file] = identifier[expanduser] ( literal[string] ) keyword[if] identifier[isfile] ( identifier[skills_data_file] ): keyword[try] : keyword[with] identifier[open] ( identifie...
def load_skills_data() -> dict: """Contains info on how skills should be updated""" skills_data_file = expanduser('~/.mycroft/skills.json') if isfile(skills_data_file): try: with open(skills_data_file) as f: return json.load(f) # depends on [control=['with'], data=['f']]...
def map_to_precursors_on_fly(seqs, names, loci, args): """map sequences to precursors with franpr algorithm to avoid writting on disk""" precursor = precursor_sequence(loci, args.ref).upper() dat = dict() for s, n in itertools.izip(seqs, names): res = pyMatch.Match(precursor, str(s), 1, 3) ...
def function[map_to_precursors_on_fly, parameter[seqs, names, loci, args]]: constant[map sequences to precursors with franpr algorithm to avoid writting on disk] variable[precursor] assign[=] call[call[name[precursor_sequence], parameter[name[loci], name[args].ref]].upper, parameter[]] variable[...
keyword[def] identifier[map_to_precursors_on_fly] ( identifier[seqs] , identifier[names] , identifier[loci] , identifier[args] ): literal[string] identifier[precursor] = identifier[precursor_sequence] ( identifier[loci] , identifier[args] . identifier[ref] ). identifier[upper] () identifier[dat] = ide...
def map_to_precursors_on_fly(seqs, names, loci, args): """map sequences to precursors with franpr algorithm to avoid writting on disk""" precursor = precursor_sequence(loci, args.ref).upper() dat = dict() for (s, n) in itertools.izip(seqs, names): res = pyMatch.Match(precursor, str(s), 1, 3) ...
def time_delta(self, end_datetime=None): """ Get a timedelta object """ start_datetime = self._parse_start_datetime('now') end_datetime = self._parse_end_datetime(end_datetime) seconds = end_datetime - start_datetime ts = self.generator.random.randint(*sorted([0,...
def function[time_delta, parameter[self, end_datetime]]: constant[ Get a timedelta object ] variable[start_datetime] assign[=] call[name[self]._parse_start_datetime, parameter[constant[now]]] variable[end_datetime] assign[=] call[name[self]._parse_end_datetime, parameter[name[end...
keyword[def] identifier[time_delta] ( identifier[self] , identifier[end_datetime] = keyword[None] ): literal[string] identifier[start_datetime] = identifier[self] . identifier[_parse_start_datetime] ( literal[string] ) identifier[end_datetime] = identifier[self] . identifier[_parse_end_dat...
def time_delta(self, end_datetime=None): """ Get a timedelta object """ start_datetime = self._parse_start_datetime('now') end_datetime = self._parse_end_datetime(end_datetime) seconds = end_datetime - start_datetime ts = self.generator.random.randint(*sorted([0, seconds])) retur...
def Query(r, what, fields, qfilter=None): """ Retrieves information about resources. @type what: string @param what: Resource name, one of L{constants.QR_VIA_RAPI} @type fields: list of string @param fields: Requested fields @type qfilter: None or list @param qfilter: Query filter ...
def function[Query, parameter[r, what, fields, qfilter]]: constant[ Retrieves information about resources. @type what: string @param what: Resource name, one of L{constants.QR_VIA_RAPI} @type fields: list of string @param fields: Requested fields @type qfilter: None or list @param q...
keyword[def] identifier[Query] ( identifier[r] , identifier[what] , identifier[fields] , identifier[qfilter] = keyword[None] ): literal[string] identifier[body] ={ literal[string] : identifier[fields] , } keyword[if] identifier[qfilter] keyword[is] keyword[not] keyword[None] : ...
def Query(r, what, fields, qfilter=None): """ Retrieves information about resources. @type what: string @param what: Resource name, one of L{constants.QR_VIA_RAPI} @type fields: list of string @param fields: Requested fields @type qfilter: None or list @param qfilter: Query filter ...
def to_dict(self): """Render a MessageElement as python dict. :return: Python dict representation :rtype: dict """ obj_dict = super(Table, self).to_dict() rows_dict = [r.to_dict() for r in self.rows] child_dict = { 'type': self.__class__.__name__, ...
def function[to_dict, parameter[self]]: constant[Render a MessageElement as python dict. :return: Python dict representation :rtype: dict ] variable[obj_dict] assign[=] call[call[name[super], parameter[name[Table], name[self]]].to_dict, parameter[]] variable[rows_dict] a...
keyword[def] identifier[to_dict] ( identifier[self] ): literal[string] identifier[obj_dict] = identifier[super] ( identifier[Table] , identifier[self] ). identifier[to_dict] () identifier[rows_dict] =[ identifier[r] . identifier[to_dict] () keyword[for] identifier[r] keyword[in] identif...
def to_dict(self): """Render a MessageElement as python dict. :return: Python dict representation :rtype: dict """ obj_dict = super(Table, self).to_dict() rows_dict = [r.to_dict() for r in self.rows] child_dict = {'type': self.__class__.__name__, 'caption': self.caption, 'rows':...
def descendents(self): """Iterate over all descendent terms""" for c in self.children: yield c for d in c.descendents: yield d
def function[descendents, parameter[self]]: constant[Iterate over all descendent terms] for taget[name[c]] in starred[name[self].children] begin[:] <ast.Yield object at 0x7da20c6e61a0> for taget[name[d]] in starred[name[c].descendents] begin[:] <as...
keyword[def] identifier[descendents] ( identifier[self] ): literal[string] keyword[for] identifier[c] keyword[in] identifier[self] . identifier[children] : keyword[yield] identifier[c] keyword[for] identifier[d] keyword[in] identifier[c] . identifier[descendents]...
def descendents(self): """Iterate over all descendent terms""" for c in self.children: yield c for d in c.descendents: yield d # depends on [control=['for'], data=['d']] # depends on [control=['for'], data=['c']]
def del_map(self, event, handle, *args): """ Remove a mapping like event -(arg0, arg1, arg2, ...)-> handle. """ if args: self.base[event].remove((handle, args)) else: self.base[event] = [ind for ind in self.base[event] if ind[0] != handle]
def function[del_map, parameter[self, event, handle]]: constant[ Remove a mapping like event -(arg0, arg1, arg2, ...)-> handle. ] if name[args] begin[:] call[call[name[self].base][name[event]].remove, parameter[tuple[[<ast.Name object at 0x7da1b24c26e0>, <ast.Name object ...
keyword[def] identifier[del_map] ( identifier[self] , identifier[event] , identifier[handle] ,* identifier[args] ): literal[string] keyword[if] identifier[args] : identifier[self] . identifier[base] [ identifier[event] ]. identifier[remove] (( identifier[handle] , identifier[args] )) ...
def del_map(self, event, handle, *args): """ Remove a mapping like event -(arg0, arg1, arg2, ...)-> handle. """ if args: self.base[event].remove((handle, args)) # depends on [control=['if'], data=[]] else: self.base[event] = [ind for ind in self.base[event] if ind[0] != hand...
def extract(context, data): """Extract a compressed file""" with context.http.rehash(data) as result: file_path = result.file_path content_type = result.content_type extract_dir = random_filename(context.work_path) if content_type in ZIP_MIME_TYPES: extracted_files = ...
def function[extract, parameter[context, data]]: constant[Extract a compressed file] with call[name[context].http.rehash, parameter[name[data]]] begin[:] variable[file_path] assign[=] name[result].file_path variable[content_type] assign[=] name[result].content_type ...
keyword[def] identifier[extract] ( identifier[context] , identifier[data] ): literal[string] keyword[with] identifier[context] . identifier[http] . identifier[rehash] ( identifier[data] ) keyword[as] identifier[result] : identifier[file_path] = identifier[result] . identifier[file_path] ...
def extract(context, data): """Extract a compressed file""" with context.http.rehash(data) as result: file_path = result.file_path content_type = result.content_type extract_dir = random_filename(context.work_path) if content_type in ZIP_MIME_TYPES: extracted_files = ...
def as_dict(self): """ Pre-serialisation of the meta data """ drepr = {} drepr["name"] = self.name drepr["time"] = self.time # error pre-serialisation drepr["errors"] = [str(err) for err in self.errors] # warning pre-serialisation drepr["warnings"] = [str...
def function[as_dict, parameter[self]]: constant[ Pre-serialisation of the meta data ] variable[drepr] assign[=] dictionary[[], []] call[name[drepr]][constant[name]] assign[=] name[self].name call[name[drepr]][constant[time]] assign[=] name[self].time call[name[drepr]][constant[e...
keyword[def] identifier[as_dict] ( identifier[self] ): literal[string] identifier[drepr] ={} identifier[drepr] [ literal[string] ]= identifier[self] . identifier[name] identifier[drepr] [ literal[string] ]= identifier[self] . identifier[time] identifier[drepr] ...
def as_dict(self): """ Pre-serialisation of the meta data """ drepr = {} drepr['name'] = self.name drepr['time'] = self.time # error pre-serialisation drepr['errors'] = [str(err) for err in self.errors] # warning pre-serialisation drepr['warnings'] = [str(warn) for warn in self.warnings...
def linkify(self, commands, notificationways): """Create link between objects:: * contacts -> notificationways :param notificationways: notificationways to link :type notificationways: alignak.objects.notificationway.Notificationways :return: None TODO: Clean this func...
def function[linkify, parameter[self, commands, notificationways]]: constant[Create link between objects:: * contacts -> notificationways :param notificationways: notificationways to link :type notificationways: alignak.objects.notificationway.Notificationways :return: None ...
keyword[def] identifier[linkify] ( identifier[self] , identifier[commands] , identifier[notificationways] ): literal[string] identifier[self] . identifier[linkify_with_notificationways] ( identifier[notificationways] ) identifier[self] . identifier[linkify_command_list_with_commands] ( ide...
def linkify(self, commands, notificationways): """Create link between objects:: * contacts -> notificationways :param notificationways: notificationways to link :type notificationways: alignak.objects.notificationway.Notificationways :return: None TODO: Clean this function...
def dumps(cls, obj, protocol=0): """ Equivalent to pickle.dumps except that the HoloViews option tree is saved appropriately. """ cls.save_option_state = True val = pickle.dumps(obj, protocol=protocol) cls.save_option_state = False return val
def function[dumps, parameter[cls, obj, protocol]]: constant[ Equivalent to pickle.dumps except that the HoloViews option tree is saved appropriately. ] name[cls].save_option_state assign[=] constant[True] variable[val] assign[=] call[name[pickle].dumps, parameter[name[ob...
keyword[def] identifier[dumps] ( identifier[cls] , identifier[obj] , identifier[protocol] = literal[int] ): literal[string] identifier[cls] . identifier[save_option_state] = keyword[True] identifier[val] = identifier[pickle] . identifier[dumps] ( identifier[obj] , identifier[protocol] = i...
def dumps(cls, obj, protocol=0): """ Equivalent to pickle.dumps except that the HoloViews option tree is saved appropriately. """ cls.save_option_state = True val = pickle.dumps(obj, protocol=protocol) cls.save_option_state = False return val
def check_link_status(): '''check status of master links''' tnow = time.time() if mpstate.status.last_message != 0 and tnow > mpstate.status.last_message + 5: say("no link") mpstate.status.heartbeat_error = True for master in mpstate.mav_master: if not master.linkerror and (tnow ...
def function[check_link_status, parameter[]]: constant[check status of master links] variable[tnow] assign[=] call[name[time].time, parameter[]] if <ast.BoolOp object at 0x7da1b16012a0> begin[:] call[name[say], parameter[constant[no link]]] name[mpstate].status.he...
keyword[def] identifier[check_link_status] (): literal[string] identifier[tnow] = identifier[time] . identifier[time] () keyword[if] identifier[mpstate] . identifier[status] . identifier[last_message] != literal[int] keyword[and] identifier[tnow] > identifier[mpstate] . identifier[status] . identif...
def check_link_status(): """check status of master links""" tnow = time.time() if mpstate.status.last_message != 0 and tnow > mpstate.status.last_message + 5: say('no link') mpstate.status.heartbeat_error = True # depends on [control=['if'], data=[]] for master in mpstate.mav_master: ...
def tridiag(below=None, diag=None, above=None, name=None): """Creates a matrix with values set above, below, and on the diagonal. Example: ```python tridiag(below=[1., 2., 3.], diag=[4., 5., 6., 7.], above=[8., 9., 10.]) # ==> array([[ 4., 8., 0., 0.], # [ 1., 5., ...
def function[tridiag, parameter[below, diag, above, name]]: constant[Creates a matrix with values set above, below, and on the diagonal. Example: ```python tridiag(below=[1., 2., 3.], diag=[4., 5., 6., 7.], above=[8., 9., 10.]) # ==> array([[ 4., 8., 0., 0.], # ...
keyword[def] identifier[tridiag] ( identifier[below] = keyword[None] , identifier[diag] = keyword[None] , identifier[above] = keyword[None] , identifier[name] = keyword[None] ): literal[string] keyword[def] identifier[_pad] ( identifier[x] ): literal[string] identifier[shape] = identifier[tf] . id...
def tridiag(below=None, diag=None, above=None, name=None): """Creates a matrix with values set above, below, and on the diagonal. Example: ```python tridiag(below=[1., 2., 3.], diag=[4., 5., 6., 7.], above=[8., 9., 10.]) # ==> array([[ 4., 8., 0., 0.], # [ 1., 5....
def _get_colors(self): """Returns a tuple of two integers representing current colors: (foreground, background).""" try: csbi = _WindowsCSBI.get_info(self.win32_stream_handle) return csbi['fg_color'], csbi['bg_color'] except IOError: return 7, 0
def function[_get_colors, parameter[self]]: constant[Returns a tuple of two integers representing current colors: (foreground, background).] <ast.Try object at 0x7da18eb57df0>
keyword[def] identifier[_get_colors] ( identifier[self] ): literal[string] keyword[try] : identifier[csbi] = identifier[_WindowsCSBI] . identifier[get_info] ( identifier[self] . identifier[win32_stream_handle] ) keyword[return] identifier[csbi] [ literal[string] ], identi...
def _get_colors(self): """Returns a tuple of two integers representing current colors: (foreground, background).""" try: csbi = _WindowsCSBI.get_info(self.win32_stream_handle) return (csbi['fg_color'], csbi['bg_color']) # depends on [control=['try'], data=[]] except IOError: return ...
def is_import(self): """Whether the stage file was created with `dvc import`.""" return not self.cmd and len(self.deps) == 1 and len(self.outs) == 1
def function[is_import, parameter[self]]: constant[Whether the stage file was created with `dvc import`.] return[<ast.BoolOp object at 0x7da1b1f1ba60>]
keyword[def] identifier[is_import] ( identifier[self] ): literal[string] keyword[return] keyword[not] identifier[self] . identifier[cmd] keyword[and] identifier[len] ( identifier[self] . identifier[deps] )== literal[int] keyword[and] identifier[len] ( identifier[self] . identifier[outs] )== l...
def is_import(self): """Whether the stage file was created with `dvc import`.""" return not self.cmd and len(self.deps) == 1 and (len(self.outs) == 1)
def install_metaboard( replace_existing=False, ): """install metaboard. http://metalab.at/wiki/Metaboard """ metaboard = AutoBunch() metaboard.name = 'Metaboard' metaboard.upload.protocol = 'usbasp' metaboard.upload.maximum_size = '14336' metaboard.upload.speed = '19200' meta...
def function[install_metaboard, parameter[replace_existing]]: constant[install metaboard. http://metalab.at/wiki/Metaboard ] variable[metaboard] assign[=] call[name[AutoBunch], parameter[]] name[metaboard].name assign[=] constant[Metaboard] name[metaboard].upload.protocol assig...
keyword[def] identifier[install_metaboard] ( identifier[replace_existing] = keyword[False] , ): literal[string] identifier[metaboard] = identifier[AutoBunch] () identifier[metaboard] . identifier[name] = literal[string] identifier[metaboard] . identifier[upload] . identifier[protocol] = litera...
def install_metaboard(replace_existing=False): """install metaboard. http://metalab.at/wiki/Metaboard """ metaboard = AutoBunch() metaboard.name = 'Metaboard' metaboard.upload.protocol = 'usbasp' metaboard.upload.maximum_size = '14336' metaboard.upload.speed = '19200' metaboard.bui...
def get_active_title(): '''returns the window title of the active window''' if os.name == 'posix': cmd = ['xdotool','getactivewindow','getwindowname'] proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) title = proc.communicate()[0].decode('utf-8') else: ...
def function[get_active_title, parameter[]]: constant[returns the window title of the active window] if compare[name[os].name equal[==] constant[posix]] begin[:] variable[cmd] assign[=] list[[<ast.Constant object at 0x7da204564c70>, <ast.Constant object at 0x7da204565330>, <ast.Constant ...
keyword[def] identifier[get_active_title] (): literal[string] keyword[if] identifier[os] . identifier[name] == literal[string] : identifier[cmd] =[ literal[string] , literal[string] , literal[string] ] identifier[proc] = identifier[subprocess] . identifier[Popen] ( identifier[cmd] , iden...
def get_active_title(): """returns the window title of the active window""" if os.name == 'posix': cmd = ['xdotool', 'getactivewindow', 'getwindowname'] proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) title = proc.communicate()[0].decode('utf-8') # depends o...
def main(self): """ A compulsary function that gets the output of the cmus-remote -Q command and converts it to unicode in order for it to be processed and finally output. """ try: # Setting stderr to subprocess.STDOUT seems to stop the error # mes...
def function[main, parameter[self]]: constant[ A compulsary function that gets the output of the cmus-remote -Q command and converts it to unicode in order for it to be processed and finally output. ] <ast.Try object at 0x7da18bc73130> if compare[constant[duration] in...
keyword[def] identifier[main] ( identifier[self] ): literal[string] keyword[try] : identifier[cmus_output] = identifier[subprocess] . identifier[check_output] ([ literal[string] , literal[string] ], identifier[stderr] = identifier[subprocess] . identifier...
def main(self): """ A compulsary function that gets the output of the cmus-remote -Q command and converts it to unicode in order for it to be processed and finally output. """ try: # Setting stderr to subprocess.STDOUT seems to stop the error # message returned by...
def _handle_actiondefinefunction(self, _): """Handle the ActionDefineFunction action.""" obj = _make_object("ActionDefineFunction") obj.FunctionName = self._get_struct_string() obj.NumParams = unpack_ui16(self._src) for i in range(1, obj.NumParams + 1): setattr(obj, "...
def function[_handle_actiondefinefunction, parameter[self, _]]: constant[Handle the ActionDefineFunction action.] variable[obj] assign[=] call[name[_make_object], parameter[constant[ActionDefineFunction]]] name[obj].FunctionName assign[=] call[name[self]._get_struct_string, parameter[]] ...
keyword[def] identifier[_handle_actiondefinefunction] ( identifier[self] , identifier[_] ): literal[string] identifier[obj] = identifier[_make_object] ( literal[string] ) identifier[obj] . identifier[FunctionName] = identifier[self] . identifier[_get_struct_string] () identifier[o...
def _handle_actiondefinefunction(self, _): """Handle the ActionDefineFunction action.""" obj = _make_object('ActionDefineFunction') obj.FunctionName = self._get_struct_string() obj.NumParams = unpack_ui16(self._src) for i in range(1, obj.NumParams + 1): setattr(obj, 'param' + str(i), self._g...
def project_interval_backward(self, c_interval): """ project c_interval on the destination transcript to the source transcript :param c_interval: an :class:`hgvs.interval.Interval` object on the destination transcript :returns: c_interval: an :class:`hgvs.interval.Interval` obje...
def function[project_interval_backward, parameter[self, c_interval]]: constant[ project c_interval on the destination transcript to the source transcript :param c_interval: an :class:`hgvs.interval.Interval` object on the destination transcript :returns: c_interval: an :class:`h...
keyword[def] identifier[project_interval_backward] ( identifier[self] , identifier[c_interval] ): literal[string] keyword[return] identifier[self] . identifier[src_tm] . identifier[g_to_c] ( identifier[self] . identifier[dst_tm] . identifier[c_to_g] ( identifier[c_interval] ))
def project_interval_backward(self, c_interval): """ project c_interval on the destination transcript to the source transcript :param c_interval: an :class:`hgvs.interval.Interval` object on the destination transcript :returns: c_interval: an :class:`hgvs.interval.Interval` object o...
def recv(self, bufsiz, flags=None): """ Receive data on the connection. :param bufsiz: The maximum number of bytes to read :param flags: (optional) The only supported flag is ``MSG_PEEK``, all other flags are ignored. :return: The string read from the Connection ...
def function[recv, parameter[self, bufsiz, flags]]: constant[ Receive data on the connection. :param bufsiz: The maximum number of bytes to read :param flags: (optional) The only supported flag is ``MSG_PEEK``, all other flags are ignored. :return: The string read fr...
keyword[def] identifier[recv] ( identifier[self] , identifier[bufsiz] , identifier[flags] = keyword[None] ): literal[string] identifier[buf] = identifier[_no_zero_allocator] ( literal[string] , identifier[bufsiz] ) keyword[if] identifier[flags] keyword[is] keyword[not] keyword[None] k...
def recv(self, bufsiz, flags=None): """ Receive data on the connection. :param bufsiz: The maximum number of bytes to read :param flags: (optional) The only supported flag is ``MSG_PEEK``, all other flags are ignored. :return: The string read from the Connection ...
def _add_token_span_to_document(self, span_element): """ adds an <intro>, <act> or <conclu> token span to the document. """ for token in span_element.text.split(): token_id = self._add_token_to_document(token) if span_element.tag == 'act': # doc can have 0+ acts ...
def function[_add_token_span_to_document, parameter[self, span_element]]: constant[ adds an <intro>, <act> or <conclu> token span to the document. ] for taget[name[token]] in starred[call[name[span_element].text.split, parameter[]]] begin[:] variable[token_id] assign[=] c...
keyword[def] identifier[_add_token_span_to_document] ( identifier[self] , identifier[span_element] ): literal[string] keyword[for] identifier[token] keyword[in] identifier[span_element] . identifier[text] . identifier[split] (): identifier[token_id] = identifier[self] . identifier[_...
def _add_token_span_to_document(self, span_element): """ adds an <intro>, <act> or <conclu> token span to the document. """ for token in span_element.text.split(): token_id = self._add_token_to_document(token) if span_element.tag == 'act': # doc can have 0+ acts self...
def can_claim_fifty_moves(self) -> bool: """ Draw by the fifty-move rule can be claimed once the clock of halfmoves since the last capture or pawn move becomes equal or greater to 100 and the side to move still has a legal move they can make. """ # Fifty-move rule. ...
def function[can_claim_fifty_moves, parameter[self]]: constant[ Draw by the fifty-move rule can be claimed once the clock of halfmoves since the last capture or pawn move becomes equal or greater to 100 and the side to move still has a legal move they can make. ] if compa...
keyword[def] identifier[can_claim_fifty_moves] ( identifier[self] )-> identifier[bool] : literal[string] keyword[if] identifier[self] . identifier[halfmove_clock] >= literal[int] : keyword[if] identifier[any] ( identifier[self] . identifier[generate_legal_moves] ()): ...
def can_claim_fifty_moves(self) -> bool: """ Draw by the fifty-move rule can be claimed once the clock of halfmoves since the last capture or pawn move becomes equal or greater to 100 and the side to move still has a legal move they can make. """ # Fifty-move rule. if self.ha...
def buscar_healthchecks(self, id_ambiente_vip): """Search healthcheck ​by environmentvip_id :return: Dictionary with the following structure: :: {'healthcheck_opt': [{'name': <name>, 'id': <id>},...]} :raise InvalidParameterError: Environment VIP identifier is null and in...
def function[buscar_healthchecks, parameter[self, id_ambiente_vip]]: constant[Search healthcheck ​by environmentvip_id :return: Dictionary with the following structure: :: {'healthcheck_opt': [{'name': <name>, 'id': <id>},...]} :raise InvalidParameterError: Environment VI...
keyword[def] identifier[buscar_healthchecks] ( identifier[self] , identifier[id_ambiente_vip] ): literal[string] identifier[url] = literal[string] + identifier[str] ( identifier[id_ambiente_vip] ) identifier[code] , identifier[xml] = identifier[self] . identifier[submit] ( keyword[None] ...
def buscar_healthchecks(self, id_ambiente_vip): """Search healthcheck \u200bby environmentvip_id :return: Dictionary with the following structure: :: {'healthcheck_opt': [{'name': <name>, 'id': <id>},...]} :raise InvalidParameterError: Environment VIP identifier is null and i...
def _handle_exception(ignore_callback_errors, print_callback_errors, obj, cb_event=None, node=None): """Helper for prining errors in callbacks See EventEmitter._invoke_callback for a use example. """ if not hasattr(obj, '_vispy_err_registry'): obj._vispy_err_registry = {} ...
def function[_handle_exception, parameter[ignore_callback_errors, print_callback_errors, obj, cb_event, node]]: constant[Helper for prining errors in callbacks See EventEmitter._invoke_callback for a use example. ] if <ast.UnaryOp object at 0x7da1b0e7a4a0> begin[:] name[obj]._vi...
keyword[def] identifier[_handle_exception] ( identifier[ignore_callback_errors] , identifier[print_callback_errors] , identifier[obj] , identifier[cb_event] = keyword[None] , identifier[node] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[hasattr] ( identifier[obj] , literal[stri...
def _handle_exception(ignore_callback_errors, print_callback_errors, obj, cb_event=None, node=None): """Helper for prining errors in callbacks See EventEmitter._invoke_callback for a use example. """ if not hasattr(obj, '_vispy_err_registry'): obj._vispy_err_registry = {} # depends on [control...
def retrieve_order(self, order_id): """Retrieve details on a single order.""" response = self.request(E.retrieveOrderSslCertRequest( E.id(order_id) )) return response.as_model(SSLOrder)
def function[retrieve_order, parameter[self, order_id]]: constant[Retrieve details on a single order.] variable[response] assign[=] call[name[self].request, parameter[call[name[E].retrieveOrderSslCertRequest, parameter[call[name[E].id, parameter[name[order_id]]]]]]] return[call[name[response].as_mod...
keyword[def] identifier[retrieve_order] ( identifier[self] , identifier[order_id] ): literal[string] identifier[response] = identifier[self] . identifier[request] ( identifier[E] . identifier[retrieveOrderSslCertRequest] ( identifier[E] . identifier[id] ( identifier[order_id] ) ))...
def retrieve_order(self, order_id): """Retrieve details on a single order.""" response = self.request(E.retrieveOrderSslCertRequest(E.id(order_id))) return response.as_model(SSLOrder)
def acquire_code(args, session, session3): """returns the user's token serial number, MFA token code, and an error code.""" serial_number = find_mfa_for_user(args.serial_number, session, session3) if not serial_number: print("There are no MFA devices associated with this user.", fi...
def function[acquire_code, parameter[args, session, session3]]: constant[returns the user's token serial number, MFA token code, and an error code.] variable[serial_number] assign[=] call[name[find_mfa_for_user], parameter[name[args].serial_number, name[session], name[session3]]] if <ast.Una...
keyword[def] identifier[acquire_code] ( identifier[args] , identifier[session] , identifier[session3] ): literal[string] identifier[serial_number] = identifier[find_mfa_for_user] ( identifier[args] . identifier[serial_number] , identifier[session] , identifier[session3] ) keyword[if] keyword[not] id...
def acquire_code(args, session, session3): """returns the user's token serial number, MFA token code, and an error code.""" serial_number = find_mfa_for_user(args.serial_number, session, session3) if not serial_number: print('There are no MFA devices associated with this user.', file=sys.stderr)...
def find(self, path, all=False): """ Work out the uncached name of the file and look that up instead """ try: start, _, extn = path.rsplit('.', 2) except ValueError: return [] path = '.'.join((start, extn)) return find(path, all=all) or []
def function[find, parameter[self, path, all]]: constant[ Work out the uncached name of the file and look that up instead ] <ast.Try object at 0x7da1b07941f0> variable[path] assign[=] call[constant[.].join, parameter[tuple[[<ast.Name object at 0x7da1b0845750>, <ast.Name object at 0x7...
keyword[def] identifier[find] ( identifier[self] , identifier[path] , identifier[all] = keyword[False] ): literal[string] keyword[try] : identifier[start] , identifier[_] , identifier[extn] = identifier[path] . identifier[rsplit] ( literal[string] , literal[int] ) keyword[exce...
def find(self, path, all=False): """ Work out the uncached name of the file and look that up instead """ try: (start, _, extn) = path.rsplit('.', 2) # depends on [control=['try'], data=[]] except ValueError: return [] # depends on [control=['except'], data=[]] path = '....
def parse_requirements(requirements_filename): """read in the dependencies from the requirements files """ dependencies, dependency_links = [], [] requirements_dir = os.path.dirname(requirements_filename) with open(requirements_filename, 'r') as stream: for line in stream: line =...
def function[parse_requirements, parameter[requirements_filename]]: constant[read in the dependencies from the requirements files ] <ast.Tuple object at 0x7da1b18bd240> assign[=] tuple[[<ast.List object at 0x7da1b18bfd00>, <ast.List object at 0x7da1b18bfac0>]] variable[requirements_dir] assi...
keyword[def] identifier[parse_requirements] ( identifier[requirements_filename] ): literal[string] identifier[dependencies] , identifier[dependency_links] =[],[] identifier[requirements_dir] = identifier[os] . identifier[path] . identifier[dirname] ( identifier[requirements_filename] ) keyword[wi...
def parse_requirements(requirements_filename): """read in the dependencies from the requirements files """ (dependencies, dependency_links) = ([], []) requirements_dir = os.path.dirname(requirements_filename) with open(requirements_filename, 'r') as stream: for line in stream: li...
def explain_prediction_linear_regressor(reg, doc, vec=None, top=None, top_targets=None, target_names=None, targets=None,...
def function[explain_prediction_linear_regressor, parameter[reg, doc, vec, top, top_targets, target_names, targets, feature_names, feature_re, feature_filter, vectorized]]: constant[ Explain prediction of a linear regressor. See :func:`eli5.explain_prediction` for description of ``top``, ``top_targ...
keyword[def] identifier[explain_prediction_linear_regressor] ( identifier[reg] , identifier[doc] , identifier[vec] = keyword[None] , identifier[top] = keyword[None] , identifier[top_targets] = keyword[None] , identifier[target_names] = keyword[None] , identifier[targets] = keyword[None] , identifier[feature_nam...
def explain_prediction_linear_regressor(reg, doc, vec=None, top=None, top_targets=None, target_names=None, targets=None, feature_names=None, feature_re=None, feature_filter=None, vectorized=False): """ Explain prediction of a linear regressor. See :func:`eli5.explain_prediction` for description of ``to...
def POST_AUTH(self, courseid): # pylint: disable=arguments-differ """ POST request """ course, __ = self.get_course_and_check_rights(courseid, allow_all_staff=False) msg = "" error = False data = web.input() if not data.get("token", "") == self.user_manager.session_tok...
def function[POST_AUTH, parameter[self, courseid]]: constant[ POST request ] <ast.Tuple object at 0x7da1b1737ee0> assign[=] call[name[self].get_course_and_check_rights, parameter[name[courseid]]] variable[msg] assign[=] constant[] variable[error] assign[=] constant[False] variabl...
keyword[def] identifier[POST_AUTH] ( identifier[self] , identifier[courseid] ): literal[string] identifier[course] , identifier[__] = identifier[self] . identifier[get_course_and_check_rights] ( identifier[courseid] , identifier[allow_all_staff] = keyword[False] ) identifier[msg] = litera...
def POST_AUTH(self, courseid): # pylint: disable=arguments-differ ' POST request ' (course, __) = self.get_course_and_check_rights(courseid, allow_all_staff=False) msg = '' error = False data = web.input() if not data.get('token', '') == self.user_manager.session_token(): msg = _('Opera...
def lin_sim_calc(goid1, goid2, sim_r, termcnts): ''' Computes Lin's similarity measure using pre-calculated Resnik's similarities. ''' if sim_r is not None: info = get_info_content(goid1, termcnts) + get_info_content(goid2, termcnts) if info != 0: return (2*sim_r)/info
def function[lin_sim_calc, parameter[goid1, goid2, sim_r, termcnts]]: constant[ Computes Lin's similarity measure using pre-calculated Resnik's similarities. ] if compare[name[sim_r] is_not constant[None]] begin[:] variable[info] assign[=] binary_operation[call[name[get_info_...
keyword[def] identifier[lin_sim_calc] ( identifier[goid1] , identifier[goid2] , identifier[sim_r] , identifier[termcnts] ): literal[string] keyword[if] identifier[sim_r] keyword[is] keyword[not] keyword[None] : identifier[info] = identifier[get_info_content] ( identifier[goid1] , identifier[te...
def lin_sim_calc(goid1, goid2, sim_r, termcnts): """ Computes Lin's similarity measure using pre-calculated Resnik's similarities. """ if sim_r is not None: info = get_info_content(goid1, termcnts) + get_info_content(goid2, termcnts) if info != 0: return 2 * sim_r / info ...
def guarded(self, call, *args): """ Catch exceptions thrown by filesystem calls, and don't really execute them in dry-run mode. """ self.LOG.debug('%s(%s)' % ( call.__name__, ', '.join([pretty_path(i) for i in args]), )) if not self.options.dry_run: ...
def function[guarded, parameter[self, call]]: constant[ Catch exceptions thrown by filesystem calls, and don't really execute them in dry-run mode. ] call[name[self].LOG.debug, parameter[binary_operation[constant[%s(%s)] <ast.Mod object at 0x7da2590d6920> tuple[[<ast.Attribute object...
keyword[def] identifier[guarded] ( identifier[self] , identifier[call] ,* identifier[args] ): literal[string] identifier[self] . identifier[LOG] . identifier[debug] ( literal[string] %( identifier[call] . identifier[__name__] , literal[string] . identifier[join] ([ identifier[pretty_path] ...
def guarded(self, call, *args): """ Catch exceptions thrown by filesystem calls, and don't really execute them in dry-run mode. """ self.LOG.debug('%s(%s)' % (call.__name__, ', '.join([pretty_path(i) for i in args]))) if not self.options.dry_run: try: call(*args) # d...
def _check_roSet(orb,kwargs,funcName): """Function to check whether ro is set, because it's required for funcName""" if not orb._roSet and kwargs.get('ro',None) is None: warnings.warn("Method %s(.) requires ro to be given at Orbit initialization or at method evaluation; using default ro which is %f kpc"...
def function[_check_roSet, parameter[orb, kwargs, funcName]]: constant[Function to check whether ro is set, because it's required for funcName] if <ast.BoolOp object at 0x7da1b0ec3f10> begin[:] call[name[warnings].warn, parameter[binary_operation[constant[Method %s(.) requires ro to be g...
keyword[def] identifier[_check_roSet] ( identifier[orb] , identifier[kwargs] , identifier[funcName] ): literal[string] keyword[if] keyword[not] identifier[orb] . identifier[_roSet] keyword[and] identifier[kwargs] . identifier[get] ( literal[string] , keyword[None] ) keyword[is] keyword[None] : ...
def _check_roSet(orb, kwargs, funcName): """Function to check whether ro is set, because it's required for funcName""" if not orb._roSet and kwargs.get('ro', None) is None: warnings.warn('Method %s(.) requires ro to be given at Orbit initialization or at method evaluation; using default ro which is %f k...
def __SoInit(self): '''fast_cut函数需要使用thulac.so,在这里导入.so文件''' if(not self.__user_specified_dict_name): self.__user_specified_dict_name = '' return SoExtention(self.__prefix, self.__user_specified_dict_name, self.__useT2S, self.__seg_only)
def function[__SoInit, parameter[self]]: constant[fast_cut函数需要使用thulac.so,在这里导入.so文件] if <ast.UnaryOp object at 0x7da18dc99660> begin[:] name[self].__user_specified_dict_name assign[=] constant[] return[call[name[SoExtention], parameter[name[self].__prefix, name[self].__user_specifie...
keyword[def] identifier[__SoInit] ( identifier[self] ): literal[string] keyword[if] ( keyword[not] identifier[self] . identifier[__user_specified_dict_name] ): identifier[self] . identifier[__user_specified_dict_name] = literal[string] keyword[return] identifier[SoExtention...
def __SoInit(self): """fast_cut函数需要使用thulac.so,在这里导入.so文件""" if not self.__user_specified_dict_name: self.__user_specified_dict_name = '' # depends on [control=['if'], data=[]] return SoExtention(self.__prefix, self.__user_specified_dict_name, self.__useT2S, self.__seg_only)
def GetClientStates(self, client_list, client_chunk=50): """Take in a client list and return dicts with their age and hostname.""" for client_group in collection.Batch(client_list, client_chunk): for fd in aff4.FACTORY.MultiOpen( client_group, mode="r", aff4_type=aff4_grr.VFS...
def function[GetClientStates, parameter[self, client_list, client_chunk]]: constant[Take in a client list and return dicts with their age and hostname.] for taget[name[client_group]] in starred[call[name[collection].Batch, parameter[name[client_list], name[client_chunk]]]] begin[:] for t...
keyword[def] identifier[GetClientStates] ( identifier[self] , identifier[client_list] , identifier[client_chunk] = literal[int] ): literal[string] keyword[for] identifier[client_group] keyword[in] identifier[collection] . identifier[Batch] ( identifier[client_list] , identifier[client_chunk] ): k...
def GetClientStates(self, client_list, client_chunk=50): """Take in a client list and return dicts with their age and hostname.""" for client_group in collection.Batch(client_list, client_chunk): for fd in aff4.FACTORY.MultiOpen(client_group, mode='r', aff4_type=aff4_grr.VFSGRRClient, token=self.token):...
def result(i): """ Returns which 8-bit registers are used by an asm instruction to return a result. """ ins = inst(i) op = oper(i) if ins in ('or', 'and') and op == ['a']: return ['f'] if ins in {'xor', 'or', 'and', 'neg', 'cpl', 'daa', 'rld', 'rrd', 'rra', 'rla', 'rrca', 'rlca'}: ...
def function[result, parameter[i]]: constant[ Returns which 8-bit registers are used by an asm instruction to return a result. ] variable[ins] assign[=] call[name[inst], parameter[name[i]]] variable[op] assign[=] call[name[oper], parameter[name[i]]] if <ast.BoolOp object at 0x7da...
keyword[def] identifier[result] ( identifier[i] ): literal[string] identifier[ins] = identifier[inst] ( identifier[i] ) identifier[op] = identifier[oper] ( identifier[i] ) keyword[if] identifier[ins] keyword[in] ( literal[string] , literal[string] ) keyword[and] identifier[op] ==[ literal[str...
def result(i): """ Returns which 8-bit registers are used by an asm instruction to return a result. """ ins = inst(i) op = oper(i) if ins in ('or', 'and') and op == ['a']: return ['f'] # depends on [control=['if'], data=[]] if ins in {'xor', 'or', 'and', 'neg', 'cpl', 'daa', 'rld', ...
def rfc2425encode(name,value,parameters=None,charset="utf-8"): """Encodes a vCard field into an RFC2425 line. :Parameters: - `name`: field type name - `value`: field value - `parameters`: optional parameters - `charset`: encoding of the output and of the `value` (if not ...
def function[rfc2425encode, parameter[name, value, parameters, charset]]: constant[Encodes a vCard field into an RFC2425 line. :Parameters: - `name`: field type name - `value`: field value - `parameters`: optional parameters - `charset`: encoding of the output and of the `va...
keyword[def] identifier[rfc2425encode] ( identifier[name] , identifier[value] , identifier[parameters] = keyword[None] , identifier[charset] = literal[string] ): literal[string] keyword[if] keyword[not] identifier[parameters] : identifier[parameters] ={} keyword[if] identifier[type] ( iden...
def rfc2425encode(name, value, parameters=None, charset='utf-8'): """Encodes a vCard field into an RFC2425 line. :Parameters: - `name`: field type name - `value`: field value - `parameters`: optional parameters - `charset`: encoding of the output and of the `value` (if not ...
def merge(self, sample): """ Use bbmerge to merge paired FASTQ files for use in metagenomics pipelines. Create a report with the total number of reads, and the number of reads that could be paired :param sample: metadata sample object flagged as a metagenome """ # Set the...
def function[merge, parameter[self, sample]]: constant[ Use bbmerge to merge paired FASTQ files for use in metagenomics pipelines. Create a report with the total number of reads, and the number of reads that could be paired :param sample: metadata sample object flagged as a metagenome ...
keyword[def] identifier[merge] ( identifier[self] , identifier[sample] ): literal[string] identifier[sample] . identifier[general] . identifier[assemblyfile] = literal[string] keyword[if] identifier[len] ( identifier[sample] . identifier[general] . identifier[fastqfiles...
def merge(self, sample): """ Use bbmerge to merge paired FASTQ files for use in metagenomics pipelines. Create a report with the total number of reads, and the number of reads that could be paired :param sample: metadata sample object flagged as a metagenome """ # Set the assembl...