code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def update(self, parent=None): """ Updates the resource. This will trigger an api PATCH request. :param parent ResourceBase: the parent of the resource - used for nesting the request url, optional :raises ResourceError: if the resource does not have an id (does not exist yet) :re...
def function[update, parameter[self, parent]]: constant[ Updates the resource. This will trigger an api PATCH request. :param parent ResourceBase: the parent of the resource - used for nesting the request url, optional :raises ResourceError: if the resource does not have an id (does not ...
keyword[def] identifier[update] ( identifier[self] , identifier[parent] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[id] : keyword[raise] identifier[self] . identifier[ResourceError] ( literal[string] ) identifier[data] = identif...
def update(self, parent=None): """ Updates the resource. This will trigger an api PATCH request. :param parent ResourceBase: the parent of the resource - used for nesting the request url, optional :raises ResourceError: if the resource does not have an id (does not exist yet) :return...
def get_hash160data(self, rawtx, output_index): """TODO doc string""" tx = deserialize.unsignedtx(rawtx) output_index = deserialize.positive_integer(output_index) data = control.get_hash160_data(tx, output_index) return serialize.data(data)
def function[get_hash160data, parameter[self, rawtx, output_index]]: constant[TODO doc string] variable[tx] assign[=] call[name[deserialize].unsignedtx, parameter[name[rawtx]]] variable[output_index] assign[=] call[name[deserialize].positive_integer, parameter[name[output_index]]] variab...
keyword[def] identifier[get_hash160data] ( identifier[self] , identifier[rawtx] , identifier[output_index] ): literal[string] identifier[tx] = identifier[deserialize] . identifier[unsignedtx] ( identifier[rawtx] ) identifier[output_index] = identifier[deserialize] . identifier[positive_int...
def get_hash160data(self, rawtx, output_index): """TODO doc string""" tx = deserialize.unsignedtx(rawtx) output_index = deserialize.positive_integer(output_index) data = control.get_hash160_data(tx, output_index) return serialize.data(data)
def gather_metrics(self, runs): """Write a JSON file with the result of every runs """ for run_dirs in runs.values(): with open(JSON_METRICS_FILE, 'w') as ostr: ostr.write('[\n') for i in range(len(run_dirs)): with open(osp.join(run...
def function[gather_metrics, parameter[self, runs]]: constant[Write a JSON file with the result of every runs ] for taget[name[run_dirs]] in starred[call[name[runs].values, parameter[]]] begin[:] with call[name[open], parameter[name[JSON_METRICS_FILE], constant[w]]] begin[:] ...
keyword[def] identifier[gather_metrics] ( identifier[self] , identifier[runs] ): literal[string] keyword[for] identifier[run_dirs] keyword[in] identifier[runs] . identifier[values] (): keyword[with] identifier[open] ( identifier[JSON_METRICS_FILE] , literal[string] ) keyword[as] i...
def gather_metrics(self, runs): """Write a JSON file with the result of every runs """ for run_dirs in runs.values(): with open(JSON_METRICS_FILE, 'w') as ostr: ostr.write('[\n') for i in range(len(run_dirs)): with open(osp.join(run_dirs[i], YAML_REPORT_FI...
def _get_axis_mode(self, axis): "will get the axis mode for the current series" if all([isinstance(getattr(s, axis), TimeVariable) for s in self._series]): return 'time' return None
def function[_get_axis_mode, parameter[self, axis]]: constant[will get the axis mode for the current series] if call[name[all], parameter[<ast.ListComp object at 0x7da1b021e440>]] begin[:] return[constant[time]] return[constant[None]]
keyword[def] identifier[_get_axis_mode] ( identifier[self] , identifier[axis] ): literal[string] keyword[if] identifier[all] ([ identifier[isinstance] ( identifier[getattr] ( identifier[s] , identifier[axis] ), identifier[TimeVariable] ) keyword[for] identifier[s] keyword[in] identifier[self] ....
def _get_axis_mode(self, axis): """will get the axis mode for the current series""" if all([isinstance(getattr(s, axis), TimeVariable) for s in self._series]): return 'time' # depends on [control=['if'], data=[]] return None
def extract_srcset(self, srcset): """ Handle ``srcset="image.png 1x, image@2x.jpg 2x"`` """ urls = [] for item in srcset.split(','): if item: urls.append(unquote_utf8(item.rsplit(' ', 1)[0])) return urls
def function[extract_srcset, parameter[self, srcset]]: constant[ Handle ``srcset="image.png 1x, image@2x.jpg 2x"`` ] variable[urls] assign[=] list[[]] for taget[name[item]] in starred[call[name[srcset].split, parameter[constant[,]]]] begin[:] if name[item] begin[:...
keyword[def] identifier[extract_srcset] ( identifier[self] , identifier[srcset] ): literal[string] identifier[urls] =[] keyword[for] identifier[item] keyword[in] identifier[srcset] . identifier[split] ( literal[string] ): keyword[if] identifier[item] : ide...
def extract_srcset(self, srcset): """ Handle ``srcset="image.png 1x, image@2x.jpg 2x"`` """ urls = [] for item in srcset.split(','): if item: urls.append(unquote_utf8(item.rsplit(' ', 1)[0])) # depends on [control=['if'], data=[]] # depends on [control=['for'], data=['i...
def report_and_save_keywords(self,relaxation_kwds,precomputed_kwds): """Save relaxation keywords to .txt and .pyc file""" report_name = os.path.join(self.backup_dir,'relaxation_keywords.txt') pretty_relax_kwds = pprint.pformat(relaxation_kwds,indent=4) with open(report_name,'w') as wf: ...
def function[report_and_save_keywords, parameter[self, relaxation_kwds, precomputed_kwds]]: constant[Save relaxation keywords to .txt and .pyc file] variable[report_name] assign[=] call[name[os].path.join, parameter[name[self].backup_dir, constant[relaxation_keywords.txt]]] variable[pretty_relax...
keyword[def] identifier[report_and_save_keywords] ( identifier[self] , identifier[relaxation_kwds] , identifier[precomputed_kwds] ): literal[string] identifier[report_name] = identifier[os] . identifier[path] . identifier[join] ( identifier[self] . identifier[backup_dir] , literal[string] ) ...
def report_and_save_keywords(self, relaxation_kwds, precomputed_kwds): """Save relaxation keywords to .txt and .pyc file""" report_name = os.path.join(self.backup_dir, 'relaxation_keywords.txt') pretty_relax_kwds = pprint.pformat(relaxation_kwds, indent=4) with open(report_name, 'w') as wf: wf.w...
def init_distributed(cuda): """ Initializes distributed backend. :param cuda: (bool) if True initializes nccl backend, if False initializes gloo backend """ world_size = int(os.environ.get('WORLD_SIZE', 1)) distributed = (world_size > 1) if distributed: backend = 'nccl' if c...
def function[init_distributed, parameter[cuda]]: constant[ Initializes distributed backend. :param cuda: (bool) if True initializes nccl backend, if False initializes gloo backend ] variable[world_size] assign[=] call[name[int], parameter[call[name[os].environ.get, parameter[constan...
keyword[def] identifier[init_distributed] ( identifier[cuda] ): literal[string] identifier[world_size] = identifier[int] ( identifier[os] . identifier[environ] . identifier[get] ( literal[string] , literal[int] )) identifier[distributed] =( identifier[world_size] > literal[int] ) keyword[if] ide...
def init_distributed(cuda): """ Initializes distributed backend. :param cuda: (bool) if True initializes nccl backend, if False initializes gloo backend """ world_size = int(os.environ.get('WORLD_SIZE', 1)) distributed = world_size > 1 if distributed: backend = 'nccl' if cud...
def get_json_tree_path(self, *args, **kwargs): """ Return path to ricecooker json tree file. Override this method to use a custom filename, e.g., for channel with multiple languages. """ json_tree_path = os.path.join(self.TREES_DATA_DIR, self.RICECOOKER_JSON_TREE) return ...
def function[get_json_tree_path, parameter[self]]: constant[ Return path to ricecooker json tree file. Override this method to use a custom filename, e.g., for channel with multiple languages. ] variable[json_tree_path] assign[=] call[name[os].path.join, parameter[name[self].TREE...
keyword[def] identifier[get_json_tree_path] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[json_tree_path] = identifier[os] . identifier[path] . identifier[join] ( identifier[self] . identifier[TREES_DATA_DIR] , identifier[self] . identifier[RICECOOKER_J...
def get_json_tree_path(self, *args, **kwargs): """ Return path to ricecooker json tree file. Override this method to use a custom filename, e.g., for channel with multiple languages. """ json_tree_path = os.path.join(self.TREES_DATA_DIR, self.RICECOOKER_JSON_TREE) return json_tree_pa...
def _apply_memory_config(config_spec, memory): ''' Sets memory size to the given value config_spec vm.ConfigSpec object memory Memory size and unit ''' log.trace('Configuring virtual machine memory ' 'settings memory=%s', memory) if 'size' in memory and 'unit'...
def function[_apply_memory_config, parameter[config_spec, memory]]: constant[ Sets memory size to the given value config_spec vm.ConfigSpec object memory Memory size and unit ] call[name[log].trace, parameter[constant[Configuring virtual machine memory settings memory=%...
keyword[def] identifier[_apply_memory_config] ( identifier[config_spec] , identifier[memory] ): literal[string] identifier[log] . identifier[trace] ( literal[string] literal[string] , identifier[memory] ) keyword[if] literal[string] keyword[in] identifier[memory] keyword[and] literal[string...
def _apply_memory_config(config_spec, memory): """ Sets memory size to the given value config_spec vm.ConfigSpec object memory Memory size and unit """ log.trace('Configuring virtual machine memory settings memory=%s', memory) if 'size' in memory and 'unit' in memory: ...
def ystep(self): r"""Minimise Augmented Lagrangian with respect to :math:`\mathbf{y}`. """ self.Y = self.Pcn(self.AX + self.U)
def function[ystep, parameter[self]]: constant[Minimise Augmented Lagrangian with respect to :math:`\mathbf{y}`. ] name[self].Y assign[=] call[name[self].Pcn, parameter[binary_operation[name[self].AX + name[self].U]]]
keyword[def] identifier[ystep] ( identifier[self] ): literal[string] identifier[self] . identifier[Y] = identifier[self] . identifier[Pcn] ( identifier[self] . identifier[AX] + identifier[self] . identifier[U] )
def ystep(self): """Minimise Augmented Lagrangian with respect to :math:`\\mathbf{y}`. """ self.Y = self.Pcn(self.AX + self.U)
def authorize_redirect(self, oauth_scope, callback_uri=None, ax_attrs=["name","email","language","username"]): """Authenticates and authorizes for the given Google resource. Some of the available resources are: * Gmail Contacts - http://www.google.com/m8/feeds/ ...
def function[authorize_redirect, parameter[self, oauth_scope, callback_uri, ax_attrs]]: constant[Authenticates and authorizes for the given Google resource. Some of the available resources are: * Gmail Contacts - http://www.google.com/m8/feeds/ * Calendar - http://www.google.com/calend...
keyword[def] identifier[authorize_redirect] ( identifier[self] , identifier[oauth_scope] , identifier[callback_uri] = keyword[None] , identifier[ax_attrs] =[ literal[string] , literal[string] , literal[string] , literal[string] ]): literal[string] identifier[callback_uri] = identifier[callback_uri...
def authorize_redirect(self, oauth_scope, callback_uri=None, ax_attrs=['name', 'email', 'language', 'username']): """Authenticates and authorizes for the given Google resource. Some of the available resources are: * Gmail Contacts - http://www.google.com/m8/feeds/ * Calendar - http://www.g...
def make_ccw(points): """ Static method. Returns a counterclock wise ordered sequence of points. If there are any repeated point, the method will raise an error. Due to the 3D character of the package, the order or the points will be tried following this...
def function[make_ccw, parameter[points]]: constant[ Static method. Returns a counterclock wise ordered sequence of points. If there are any repeated point, the method will raise an error. Due to the 3D character of the package, the order or the points will be ...
keyword[def] identifier[make_ccw] ( identifier[points] ): literal[string] keyword[from] identifier[scipy] . identifier[spatial] keyword[import] identifier[ConvexHull] keyword[from] identifier[pyny3d] . identifier[utils] keyword[import] identifier[sort_numpy] ...
def make_ccw(points): """ Static method. Returns a counterclock wise ordered sequence of points. If there are any repeated point, the method will raise an error. Due to the 3D character of the package, the order or the points will be tried following this order: ...
def history_report(history, config=None, html=True): """ Test a model and save a history report. Parameters ---------- history : memote.HistoryManager The manager grants access to previous results. config : dict, optional The final test report configuration. html : bool, opt...
def function[history_report, parameter[history, config, html]]: constant[ Test a model and save a history report. Parameters ---------- history : memote.HistoryManager The manager grants access to previous results. config : dict, optional The final test report configuration....
keyword[def] identifier[history_report] ( identifier[history] , identifier[config] = keyword[None] , identifier[html] = keyword[True] ): literal[string] keyword[if] identifier[config] keyword[is] keyword[None] : identifier[config] = identifier[ReportConfiguration] . identifier[load] () ide...
def history_report(history, config=None, html=True): """ Test a model and save a history report. Parameters ---------- history : memote.HistoryManager The manager grants access to previous results. config : dict, optional The final test report configuration. html : bool, opt...
def update_pass(user_id, newpass): ''' Update the password of a user. ''' out_dic = {'success': False, 'code': '00'} entry = TabMember.update(user_pass=tools.md5(newpass)).where(TabMember.uid == user_id) entry.execute() out_dic['success'] = True return...
def function[update_pass, parameter[user_id, newpass]]: constant[ Update the password of a user. ] variable[out_dic] assign[=] dictionary[[<ast.Constant object at 0x7da1b04f59c0>, <ast.Constant object at 0x7da1b04f4610>], [<ast.Constant object at 0x7da1b04f61a0>, <ast.Constant object at ...
keyword[def] identifier[update_pass] ( identifier[user_id] , identifier[newpass] ): literal[string] identifier[out_dic] ={ literal[string] : keyword[False] , literal[string] : literal[string] } identifier[entry] = identifier[TabMember] . identifier[update] ( identifier[user_pass] = ident...
def update_pass(user_id, newpass): """ Update the password of a user. """ out_dic = {'success': False, 'code': '00'} entry = TabMember.update(user_pass=tools.md5(newpass)).where(TabMember.uid == user_id) entry.execute() out_dic['success'] = True return out_dic
def distribution(self, **slice_kwargs): """ Calculates the number of papers in each slice, as defined by ``slice_kwargs``. Examples -------- .. code-block:: python >>> corpus.distribution(step_size=1, window_size=1) [5, 5] Parameters ...
def function[distribution, parameter[self]]: constant[ Calculates the number of papers in each slice, as defined by ``slice_kwargs``. Examples -------- .. code-block:: python >>> corpus.distribution(step_size=1, window_size=1) [5, 5] Param...
keyword[def] identifier[distribution] ( identifier[self] ,** identifier[slice_kwargs] ): literal[string] identifier[values] =[] identifier[keys] =[] keyword[for] identifier[key] , identifier[size] keyword[in] identifier[self] . identifier[slice] ( identifier[count_only] = keyw...
def distribution(self, **slice_kwargs): """ Calculates the number of papers in each slice, as defined by ``slice_kwargs``. Examples -------- .. code-block:: python >>> corpus.distribution(step_size=1, window_size=1) [5, 5] Parameters -...
def intersperse(iterable, element): """Generator yielding all elements of `iterable`, but with `element` inserted between each two consecutive elements""" iterable = iter(iterable) yield next(iterable) while True: next_from_iterable = next(iterable) yield element yield next_f...
def function[intersperse, parameter[iterable, element]]: constant[Generator yielding all elements of `iterable`, but with `element` inserted between each two consecutive elements] variable[iterable] assign[=] call[name[iter], parameter[name[iterable]]] <ast.Yield object at 0x7da204346530> ...
keyword[def] identifier[intersperse] ( identifier[iterable] , identifier[element] ): literal[string] identifier[iterable] = identifier[iter] ( identifier[iterable] ) keyword[yield] identifier[next] ( identifier[iterable] ) keyword[while] keyword[True] : identifier[next_from_iterable] =...
def intersperse(iterable, element): """Generator yielding all elements of `iterable`, but with `element` inserted between each two consecutive elements""" iterable = iter(iterable) yield next(iterable) while True: next_from_iterable = next(iterable) yield element yield next_f...
def pack(array, sub_field_array, mask, inplace=False): """ Packs a sub field's array into another array using a mask Parameters: ---------- array : numpy.ndarray The array in which the sub field array will be packed into array_in : numpy.ndarray sub field array to pack mask : ma...
def function[pack, parameter[array, sub_field_array, mask, inplace]]: constant[ Packs a sub field's array into another array using a mask Parameters: ---------- array : numpy.ndarray The array in which the sub field array will be packed into array_in : numpy.ndarray sub field ar...
keyword[def] identifier[pack] ( identifier[array] , identifier[sub_field_array] , identifier[mask] , identifier[inplace] = keyword[False] ): literal[string] identifier[lsb] = identifier[least_significant_bit] ( identifier[mask] ) identifier[max_value] = identifier[int] ( identifier[mask] >> identifier...
def pack(array, sub_field_array, mask, inplace=False): """ Packs a sub field's array into another array using a mask Parameters: ---------- array : numpy.ndarray The array in which the sub field array will be packed into array_in : numpy.ndarray sub field array to pack mask : ma...
def is_sortable_index(self, index_name, catalog): """Returns whether the index is sortable """ index = self.get_index(index_name, catalog) if not index: return False return index.meta_type in ["FieldIndex", "DateIndex"]
def function[is_sortable_index, parameter[self, index_name, catalog]]: constant[Returns whether the index is sortable ] variable[index] assign[=] call[name[self].get_index, parameter[name[index_name], name[catalog]]] if <ast.UnaryOp object at 0x7da1b2317340> begin[:] return[const...
keyword[def] identifier[is_sortable_index] ( identifier[self] , identifier[index_name] , identifier[catalog] ): literal[string] identifier[index] = identifier[self] . identifier[get_index] ( identifier[index_name] , identifier[catalog] ) keyword[if] keyword[not] identifier[index] : ...
def is_sortable_index(self, index_name, catalog): """Returns whether the index is sortable """ index = self.get_index(index_name, catalog) if not index: return False # depends on [control=['if'], data=[]] return index.meta_type in ['FieldIndex', 'DateIndex']
def get_index(self, name): """get an index by name TODO: Combine indexes of relevant catalogs depending on the portal_type which is searched for. """ catalog = self.get_catalog() index = catalog._catalog.getIndex(name) logger.debug("get_index={} of catalog '{}' -...
def function[get_index, parameter[self, name]]: constant[get an index by name TODO: Combine indexes of relevant catalogs depending on the portal_type which is searched for. ] variable[catalog] assign[=] call[name[self].get_catalog, parameter[]] variable[index] assign[=] ...
keyword[def] identifier[get_index] ( identifier[self] , identifier[name] ): literal[string] identifier[catalog] = identifier[self] . identifier[get_catalog] () identifier[index] = identifier[catalog] . identifier[_catalog] . identifier[getIndex] ( identifier[name] ) identifier[log...
def get_index(self, name): """get an index by name TODO: Combine indexes of relevant catalogs depending on the portal_type which is searched for. """ catalog = self.get_catalog() index = catalog._catalog.getIndex(name) logger.debug("get_index={} of catalog '{}' --> {}".format(na...
def dataframe_to_smp(dataframe,smp_filename,name_col="name", datetime_col="datetime",value_col="value", datetime_format="dd/mm/yyyy", value_format="{0:15.6E}", max_name_len=12): """ write a dataframe as an smp file Parameters ...
def function[dataframe_to_smp, parameter[dataframe, smp_filename, name_col, datetime_col, value_col, datetime_format, value_format, max_name_len]]: constant[ write a dataframe as an smp file Parameters ---------- dataframe : pandas.DataFrame smp_filename : str smp file to write name...
keyword[def] identifier[dataframe_to_smp] ( identifier[dataframe] , identifier[smp_filename] , identifier[name_col] = literal[string] , identifier[datetime_col] = literal[string] , identifier[value_col] = literal[string] , identifier[datetime_format] = literal[string] , identifier[value_format] = literal[string] ,...
def dataframe_to_smp(dataframe, smp_filename, name_col='name', datetime_col='datetime', value_col='value', datetime_format='dd/mm/yyyy', value_format='{0:15.6E}', max_name_len=12): """ write a dataframe as an smp file Parameters ---------- dataframe : pandas.DataFrame smp_filename : str smp...
def merge_to(self, target): """Starts merging the contents of this medium and all intermediate differencing media in the chain to the given target medium. The target medium must be either a descendant of this medium or its ancestor (otherwise this method will immediately return ...
def function[merge_to, parameter[self, target]]: constant[Starts merging the contents of this medium and all intermediate differencing media in the chain to the given target medium. The target medium must be either a descendant of this medium or its ancestor (otherwise this meth...
keyword[def] identifier[merge_to] ( identifier[self] , identifier[target] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[target] , identifier[IMedium] ): keyword[raise] identifier[TypeError] ( literal[string] ) identifier[progress] = identif...
def merge_to(self, target): """Starts merging the contents of this medium and all intermediate differencing media in the chain to the given target medium. The target medium must be either a descendant of this medium or its ancestor (otherwise this method will immediately return a fa...
def send_data_to_server(self, data, time_out=5): """ Sends given data to the Server. :param data: Data to send. :type data: unicode :param time_out: Connection timeout in seconds. :type time_out: float :return: Method success. :rtype: bool """ ...
def function[send_data_to_server, parameter[self, data, time_out]]: constant[ Sends given data to the Server. :param data: Data to send. :type data: unicode :param time_out: Connection timeout in seconds. :type time_out: float :return: Method success. :rt...
keyword[def] identifier[send_data_to_server] ( identifier[self] , identifier[data] , identifier[time_out] = literal[int] ): literal[string] keyword[if] keyword[not] identifier[data] . identifier[endswith] ( identifier[self] . identifier[__connection_end] ): identifier[data] = litera...
def send_data_to_server(self, data, time_out=5): """ Sends given data to the Server. :param data: Data to send. :type data: unicode :param time_out: Connection timeout in seconds. :type time_out: float :return: Method success. :rtype: bool """ if ...
def in_constraints(self): """ returns a list of the expressions in which this parameter constrains another """ expressions = [] for uniqueid in self._in_constraints: expressions.append(self._bundle.get_parameter(context='constraint', uniqueid=uniqueid)) return...
def function[in_constraints, parameter[self]]: constant[ returns a list of the expressions in which this parameter constrains another ] variable[expressions] assign[=] list[[]] for taget[name[uniqueid]] in starred[name[self]._in_constraints] begin[:] call[name[exp...
keyword[def] identifier[in_constraints] ( identifier[self] ): literal[string] identifier[expressions] =[] keyword[for] identifier[uniqueid] keyword[in] identifier[self] . identifier[_in_constraints] : identifier[expressions] . identifier[append] ( identifier[self] . identif...
def in_constraints(self): """ returns a list of the expressions in which this parameter constrains another """ expressions = [] for uniqueid in self._in_constraints: expressions.append(self._bundle.get_parameter(context='constraint', uniqueid=uniqueid)) # depends on [control=['for']...
def get(cls, payment_service_provider_credential_id, custom_headers=None): """ :type api_context: context.ApiContext :type payment_service_provider_credential_id: int :type custom_headers: dict[str, str]|None :rtype: BunqResponsePaymentServiceProviderCredential """ ...
def function[get, parameter[cls, payment_service_provider_credential_id, custom_headers]]: constant[ :type api_context: context.ApiContext :type payment_service_provider_credential_id: int :type custom_headers: dict[str, str]|None :rtype: BunqResponsePaymentServiceProviderCreden...
keyword[def] identifier[get] ( identifier[cls] , identifier[payment_service_provider_credential_id] , identifier[custom_headers] = keyword[None] ): literal[string] keyword[if] identifier[custom_headers] keyword[is] keyword[None] : identifier[custom_headers] ={} identifier...
def get(cls, payment_service_provider_credential_id, custom_headers=None): """ :type api_context: context.ApiContext :type payment_service_provider_credential_id: int :type custom_headers: dict[str, str]|None :rtype: BunqResponsePaymentServiceProviderCredential """ if cu...
def key(self): """Embedded supports curies.""" if self.curie is None: return self.name return ":".join((self.curie.name, self.name))
def function[key, parameter[self]]: constant[Embedded supports curies.] if compare[name[self].curie is constant[None]] begin[:] return[name[self].name] return[call[constant[:].join, parameter[tuple[[<ast.Attribute object at 0x7da1b1a4b8b0>, <ast.Attribute object at 0x7da1b1a48040>]]]]]
keyword[def] identifier[key] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[curie] keyword[is] keyword[None] : keyword[return] identifier[self] . identifier[name] keyword[return] literal[string] . identifier[join] (( identifier[self] . id...
def key(self): """Embedded supports curies.""" if self.curie is None: return self.name # depends on [control=['if'], data=[]] return ':'.join((self.curie.name, self.name))
def is_logged_in(username=None): """Checks if user is logged in if `username` is passed check if specified user is logged in username can be a list""" if username: if not isinstance(username, (list, tuple)): username = [username] return 'simple_logged_in' in session and get_u...
def function[is_logged_in, parameter[username]]: constant[Checks if user is logged in if `username` is passed check if specified user is logged in username can be a list] if name[username] begin[:] if <ast.UnaryOp object at 0x7da1b07bdc60> begin[:] variabl...
keyword[def] identifier[is_logged_in] ( identifier[username] = keyword[None] ): literal[string] keyword[if] identifier[username] : keyword[if] keyword[not] identifier[isinstance] ( identifier[username] ,( identifier[list] , identifier[tuple] )): identifier[username] =[ identifier[u...
def is_logged_in(username=None): """Checks if user is logged in if `username` is passed check if specified user is logged in username can be a list""" if username: if not isinstance(username, (list, tuple)): username = [username] # depends on [control=['if'], data=[]] return...
def transpose(self): """Create a transpose of this matrix.""" ma4 = Matrix4(self.get_col(0), self.get_col(1), self.get_col(2), self.get_col(3)) return ma4
def function[transpose, parameter[self]]: constant[Create a transpose of this matrix.] variable[ma4] assign[=] call[name[Matrix4], parameter[call[name[self].get_col, parameter[constant[0]]], call[name[self].get_col, parameter[constant[1]]], call[name[self].get_col, parameter[constant[2]]], call[name[sel...
keyword[def] identifier[transpose] ( identifier[self] ): literal[string] identifier[ma4] = identifier[Matrix4] ( identifier[self] . identifier[get_col] ( literal[int] ), identifier[self] . identifier[get_col] ( literal[int] ), identifier[self] . identifier[get_col] ( literal[int] ...
def transpose(self): """Create a transpose of this matrix.""" ma4 = Matrix4(self.get_col(0), self.get_col(1), self.get_col(2), self.get_col(3)) return ma4
def set_coordinates(self, x, y, z=None): """Set all coordinate dimensions at once.""" self.x = x self.y = y self.z = z
def function[set_coordinates, parameter[self, x, y, z]]: constant[Set all coordinate dimensions at once.] name[self].x assign[=] name[x] name[self].y assign[=] name[y] name[self].z assign[=] name[z]
keyword[def] identifier[set_coordinates] ( identifier[self] , identifier[x] , identifier[y] , identifier[z] = keyword[None] ): literal[string] identifier[self] . identifier[x] = identifier[x] identifier[self] . identifier[y] = identifier[y] identifier[self] . identifier[z] = ide...
def set_coordinates(self, x, y, z=None): """Set all coordinate dimensions at once.""" self.x = x self.y = y self.z = z
def _parse_conf(conf_file=_DEFAULT_CONF): ''' Parse a logrotate configuration file. Includes will also be parsed, and their configuration will be stored in the return dict, as if they were part of the main config file. A dict of which configs came from which includes will be stored in the 'include ...
def function[_parse_conf, parameter[conf_file]]: constant[ Parse a logrotate configuration file. Includes will also be parsed, and their configuration will be stored in the return dict, as if they were part of the main config file. A dict of which configs came from which includes will be stored...
keyword[def] identifier[_parse_conf] ( identifier[conf_file] = identifier[_DEFAULT_CONF] ): literal[string] identifier[ret] ={} identifier[mode] = literal[string] identifier[multi_names] =[] identifier[multi] ={} identifier[prev_comps] = keyword[None] keyword[with] identifier[s...
def _parse_conf(conf_file=_DEFAULT_CONF): """ Parse a logrotate configuration file. Includes will also be parsed, and their configuration will be stored in the return dict, as if they were part of the main config file. A dict of which configs came from which includes will be stored in the 'include ...
def delete_user(self, user_id, **kwargs): # noqa: E501 """Delete a user. # noqa: E501 An endpoint for deleting a user. **Example usage:** `curl -X DELETE https://api.us-east-1.mbedcloud.com/v3/users/{user-id} -H 'Authorization: Bearer API_KEY'` # noqa: E501 This method makes a synchronous ...
def function[delete_user, parameter[self, user_id]]: constant[Delete a user. # noqa: E501 An endpoint for deleting a user. **Example usage:** `curl -X DELETE https://api.us-east-1.mbedcloud.com/v3/users/{user-id} -H 'Authorization: Bearer API_KEY'` # noqa: E501 This method makes a synchrono...
keyword[def] identifier[delete_user] ( identifier[self] , identifier[user_id] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= keyword[True] keyword[if] identifier[kwargs] . identifier[get] ( literal[string] ): keyword[return] identifier[sel...
def delete_user(self, user_id, **kwargs): # noqa: E501 "Delete a user. # noqa: E501\n\n An endpoint for deleting a user. **Example usage:** `curl -X DELETE https://api.us-east-1.mbedcloud.com/v3/users/{user-id} -H 'Authorization: Bearer API_KEY'` # noqa: E501\n This method makes a synchronous HTT...
def is_linear(self): """ Tests whether all filters in the list are linear. CascadeFilter and ParallelFilter instances are also linear if all filters they group are linear. """ return all(isinstance(filt, LinearFilter) or (hasattr(filt, "is_linear") and filt.is_linear()) ...
def function[is_linear, parameter[self]]: constant[ Tests whether all filters in the list are linear. CascadeFilter and ParallelFilter instances are also linear if all filters they group are linear. ] return[call[name[all], parameter[<ast.GeneratorExp object at 0x7da1b0617ee0>]]]
keyword[def] identifier[is_linear] ( identifier[self] ): literal[string] keyword[return] identifier[all] ( identifier[isinstance] ( identifier[filt] , identifier[LinearFilter] ) keyword[or] ( identifier[hasattr] ( identifier[filt] , literal[string] ) keyword[and] identifier[filt] . identifier[is_lin...
def is_linear(self): """ Tests whether all filters in the list are linear. CascadeFilter and ParallelFilter instances are also linear if all filters they group are linear. """ return all((isinstance(filt, LinearFilter) or (hasattr(filt, 'is_linear') and filt.is_linear()) for filt in self.callab...
def replace_variables(sentence: List[str], sentence_variables: Dict[str, str]) -> Tuple[List[str], List[str]]: """ Replaces abstract variables in text with their concrete counterparts. """ tokens = [] tags = [] for token in sentence: if token not in sentence_variabl...
def function[replace_variables, parameter[sentence, sentence_variables]]: constant[ Replaces abstract variables in text with their concrete counterparts. ] variable[tokens] assign[=] list[[]] variable[tags] assign[=] list[[]] for taget[name[token]] in starred[name[sentence]] begi...
keyword[def] identifier[replace_variables] ( identifier[sentence] : identifier[List] [ identifier[str] ], identifier[sentence_variables] : identifier[Dict] [ identifier[str] , identifier[str] ])-> identifier[Tuple] [ identifier[List] [ identifier[str] ], identifier[List] [ identifier[str] ]]: literal[string] ...
def replace_variables(sentence: List[str], sentence_variables: Dict[str, str]) -> Tuple[List[str], List[str]]: """ Replaces abstract variables in text with their concrete counterparts. """ tokens = [] tags = [] for token in sentence: if token not in sentence_variables: tokens...
def generate_signed_url_v4( credentials, resource, expiration, api_access_endpoint=DEFAULT_ENDPOINT, method="GET", content_md5=None, content_type=None, response_type=None, response_disposition=None, generation=None, headers=None, query_parameters=None, _request_timest...
def function[generate_signed_url_v4, parameter[credentials, resource, expiration, api_access_endpoint, method, content_md5, content_type, response_type, response_disposition, generation, headers, query_parameters, _request_timestamp]]: constant[Generate a V4 signed URL to provide query-string auth'n to a resour...
keyword[def] identifier[generate_signed_url_v4] ( identifier[credentials] , identifier[resource] , identifier[expiration] , identifier[api_access_endpoint] = identifier[DEFAULT_ENDPOINT] , identifier[method] = literal[string] , identifier[content_md5] = keyword[None] , identifier[content_type] = keyword[None] ...
def generate_signed_url_v4(credentials, resource, expiration, api_access_endpoint=DEFAULT_ENDPOINT, method='GET', content_md5=None, content_type=None, response_type=None, response_disposition=None, generation=None, headers=None, query_parameters=None, _request_timestamp=None): # for testing only 'Generate a V4 sig...
def parse_nvra(nvra): """ Parse RPM N-E:V-R.A string to a dict. :param nvra: N-E:V-R.A string. This can be a file name or a file path including the '.rpm' suffix. :type nvra: str :rtype: dict, with "name", "epoch", "version", "release", and "arch" elements. """ if nvra.endswith(".rpm"): ...
def function[parse_nvra, parameter[nvra]]: constant[ Parse RPM N-E:V-R.A string to a dict. :param nvra: N-E:V-R.A string. This can be a file name or a file path including the '.rpm' suffix. :type nvra: str :rtype: dict, with "name", "epoch", "version", "release", and "arch" elements. ] ...
keyword[def] identifier[parse_nvra] ( identifier[nvra] ): literal[string] keyword[if] identifier[nvra] . identifier[endswith] ( literal[string] ): identifier[nvra] = identifier[nvra] [:- literal[int] ] identifier[result] = identifier[RPM_NVRA_RE] . identifier[match] ( identifier[nvra] ). ide...
def parse_nvra(nvra): """ Parse RPM N-E:V-R.A string to a dict. :param nvra: N-E:V-R.A string. This can be a file name or a file path including the '.rpm' suffix. :type nvra: str :rtype: dict, with "name", "epoch", "version", "release", and "arch" elements. """ if nvra.endswith('.rpm'): ...
def setup_page(self): """Setup config page widgets and options.""" settings_group = QGroupBox(_("Settings")) hist_spin = self.create_spinbox( _("History depth: "), _(" entries"), 'max_entries', min_=10, max_=10000, step=10, ...
def function[setup_page, parameter[self]]: constant[Setup config page widgets and options.] variable[settings_group] assign[=] call[name[QGroupBox], parameter[call[name[_], parameter[constant[Settings]]]]] variable[hist_spin] assign[=] call[name[self].create_spinbox, parameter[call[name[_], para...
keyword[def] identifier[setup_page] ( identifier[self] ): literal[string] identifier[settings_group] = identifier[QGroupBox] ( identifier[_] ( literal[string] )) identifier[hist_spin] = identifier[self] . identifier[create_spinbox] ( identifier[_] ( literal[string] ), identifier[_...
def setup_page(self): """Setup config page widgets and options.""" settings_group = QGroupBox(_('Settings')) hist_spin = self.create_spinbox(_('History depth: '), _(' entries'), 'max_entries', min_=10, max_=10000, step=10, tip=_('Set maximum line count')) sourcecode_group = QGroupBox(_('Source code')) ...
def create_review_node(self, review): """ Return a review node. """ review_node = BNode() type_triple = (review_node, RDF.type, self.spdx_namespace.Review) self.graph.add(type_triple) reviewer_node = Literal(review.reviewer.to_value()) self.graph.add((rev...
def function[create_review_node, parameter[self, review]]: constant[ Return a review node. ] variable[review_node] assign[=] call[name[BNode], parameter[]] variable[type_triple] assign[=] tuple[[<ast.Name object at 0x7da18ede7c10>, <ast.Attribute object at 0x7da18ede7be0>, <ast.A...
keyword[def] identifier[create_review_node] ( identifier[self] , identifier[review] ): literal[string] identifier[review_node] = identifier[BNode] () identifier[type_triple] =( identifier[review_node] , identifier[RDF] . identifier[type] , identifier[self] . identifier[spdx_namespace] . id...
def create_review_node(self, review): """ Return a review node. """ review_node = BNode() type_triple = (review_node, RDF.type, self.spdx_namespace.Review) self.graph.add(type_triple) reviewer_node = Literal(review.reviewer.to_value()) self.graph.add((review_node, self.spdx_names...
def initialize_hashes(self): """Create new hashlib objects for each hash we are going to calculate.""" if ('md5' in self.hashes): self.md5_calc = hashlib.md5() if ('sha-1' in self.hashes): self.sha1_calc = hashlib.sha1() if ('sha-256' in self.hashes): ...
def function[initialize_hashes, parameter[self]]: constant[Create new hashlib objects for each hash we are going to calculate.] if compare[constant[md5] in name[self].hashes] begin[:] name[self].md5_calc assign[=] call[name[hashlib].md5, parameter[]] if compare[constant[sha-1] in...
keyword[def] identifier[initialize_hashes] ( identifier[self] ): literal[string] keyword[if] ( literal[string] keyword[in] identifier[self] . identifier[hashes] ): identifier[self] . identifier[md5_calc] = identifier[hashlib] . identifier[md5] () keyword[if] ( literal[string...
def initialize_hashes(self): """Create new hashlib objects for each hash we are going to calculate.""" if 'md5' in self.hashes: self.md5_calc = hashlib.md5() # depends on [control=['if'], data=[]] if 'sha-1' in self.hashes: self.sha1_calc = hashlib.sha1() # depends on [control=['if'], data...
def on_connect(self, connection): "Re-subscribe to any channels and patterns previously subscribed to" # NOTE: for python3, we can't pass bytestrings as keyword arguments # so we need to decode channel/pattern names back to unicode strings # before passing them to [p]subscribe. s...
def function[on_connect, parameter[self, connection]]: constant[Re-subscribe to any channels and patterns previously subscribed to] call[name[self].pending_unsubscribe_channels.clear, parameter[]] call[name[self].pending_unsubscribe_patterns.clear, parameter[]] if name[self].channels beg...
keyword[def] identifier[on_connect] ( identifier[self] , identifier[connection] ): literal[string] identifier[self] . identifier[pending_unsubscribe_channels] . identifier[clear] () identifier[self] . identifier[pending_unsubscribe_patterns] . identifier[clear] (...
def on_connect(self, connection): """Re-subscribe to any channels and patterns previously subscribed to""" # NOTE: for python3, we can't pass bytestrings as keyword arguments # so we need to decode channel/pattern names back to unicode strings # before passing them to [p]subscribe. self.pending_unsu...
def updateMetadata(self, new): """ Update the metadata stored for this broker. Future connections made to the broker will use the host and port defined in the new metadata. Any existing connection is not dropped, however. :param new: :clas:`afkak.common.Brok...
def function[updateMetadata, parameter[self, new]]: constant[ Update the metadata stored for this broker. Future connections made to the broker will use the host and port defined in the new metadata. Any existing connection is not dropped, however. :param new: ...
keyword[def] identifier[updateMetadata] ( identifier[self] , identifier[new] ): literal[string] keyword[if] identifier[self] . identifier[node_id] != identifier[new] . identifier[node_id] : keyword[raise] identifier[ValueError] ( literal[string] . identifier[format] ( identifier[new]...
def updateMetadata(self, new): """ Update the metadata stored for this broker. Future connections made to the broker will use the host and port defined in the new metadata. Any existing connection is not dropped, however. :param new: :clas:`afkak.common.BrokerMe...
def is_valid_image(self, raw_data): """ Checks if the supplied raw data is valid image data. :param str raw_data: A string representation of the image data. :rtype: bool :returns: ``True`` if ``raw_data`` is valid, ``False`` if not. """ buf = StringIO(raw_data) ...
def function[is_valid_image, parameter[self, raw_data]]: constant[ Checks if the supplied raw data is valid image data. :param str raw_data: A string representation of the image data. :rtype: bool :returns: ``True`` if ``raw_data`` is valid, ``False`` if not. ] v...
keyword[def] identifier[is_valid_image] ( identifier[self] , identifier[raw_data] ): literal[string] identifier[buf] = identifier[StringIO] ( identifier[raw_data] ) keyword[try] : identifier[trial_image] = identifier[Image] . identifier[open] ( identifier[buf] ) i...
def is_valid_image(self, raw_data): """ Checks if the supplied raw data is valid image data. :param str raw_data: A string representation of the image data. :rtype: bool :returns: ``True`` if ``raw_data`` is valid, ``False`` if not. """ buf = StringIO(raw_data) try: ...
def get_vowel(syll): '''Return the firstmost vowel in 'syll'.''' return re.search(r'([ieaouäöy]{1})', syll, flags=FLAGS).group(1).upper()
def function[get_vowel, parameter[syll]]: constant[Return the firstmost vowel in 'syll'.] return[call[call[call[name[re].search, parameter[constant[([ieaouäöy]{1})], name[syll]]].group, parameter[constant[1]]].upper, parameter[]]]
keyword[def] identifier[get_vowel] ( identifier[syll] ): literal[string] keyword[return] identifier[re] . identifier[search] ( literal[string] , identifier[syll] , identifier[flags] = identifier[FLAGS] ). identifier[group] ( literal[int] ). identifier[upper] ()
def get_vowel(syll): """Return the firstmost vowel in 'syll'.""" return re.search('([ieaouäöy]{1})', syll, flags=FLAGS).group(1).upper()
def RemoveClass(self, class_name): """Removes an entry from the list of known classes. Args: class_name: A string with the class name that is to be removed. Raises: NonexistentMapping if there is no class with the specified class_name. """ if class_name not in self._class_mapping: ...
def function[RemoveClass, parameter[self, class_name]]: constant[Removes an entry from the list of known classes. Args: class_name: A string with the class name that is to be removed. Raises: NonexistentMapping if there is no class with the specified class_name. ] if compare...
keyword[def] identifier[RemoveClass] ( identifier[self] , identifier[class_name] ): literal[string] keyword[if] identifier[class_name] keyword[not] keyword[in] identifier[self] . identifier[_class_mapping] : keyword[raise] identifier[problems] . identifier[NonexistentMapping] ( identifier[class...
def RemoveClass(self, class_name): """Removes an entry from the list of known classes. Args: class_name: A string with the class name that is to be removed. Raises: NonexistentMapping if there is no class with the specified class_name. """ if class_name not in self._class_mapping: ...
def url_request(target_url, output_file): """ Use urllib to download the requested file from the target URL. Use the click progress bar to print download progress :param target_url: URL from which the file is to be downloaded :param output_file: Name and path of local copy of fil...
def function[url_request, parameter[target_url, output_file]]: constant[ Use urllib to download the requested file from the target URL. Use the click progress bar to print download progress :param target_url: URL from which the file is to be downloaded :param output_file: Name an...
keyword[def] identifier[url_request] ( identifier[target_url] , identifier[output_file] ): literal[string] identifier[request] = identifier[urllib] . identifier[request] . identifier[urlopen] ( identifier[target_url] ) keyword[with] identifier[open] ( identifier[output_f...
def url_request(target_url, output_file): """ Use urllib to download the requested file from the target URL. Use the click progress bar to print download progress :param target_url: URL from which the file is to be downloaded :param output_file: Name and path of local copy of file ...
def weld_cast_array(array, weld_type, to_weld_type): """Cast array to a different type. Parameters ---------- array : numpy.ndarray or WeldObject Input data. weld_type : WeldType Type of each element in the input array. to_weld_type : WeldType Desired type. Returns ...
def function[weld_cast_array, parameter[array, weld_type, to_weld_type]]: constant[Cast array to a different type. Parameters ---------- array : numpy.ndarray or WeldObject Input data. weld_type : WeldType Type of each element in the input array. to_weld_type : WeldType ...
keyword[def] identifier[weld_cast_array] ( identifier[array] , identifier[weld_type] , identifier[to_weld_type] ): literal[string] keyword[if] keyword[not] identifier[is_numeric] ( identifier[weld_type] ) keyword[or] keyword[not] identifier[is_numeric] ( identifier[to_weld_type] ): keyword[rai...
def weld_cast_array(array, weld_type, to_weld_type): """Cast array to a different type. Parameters ---------- array : numpy.ndarray or WeldObject Input data. weld_type : WeldType Type of each element in the input array. to_weld_type : WeldType Desired type. Returns ...
def replace(self, pat, rep): """Replace first occurrence of pat with rep in each element. Parameters ---------- pat : str rep : str Returns ------- Series """ check_type(pat, str) check_type(rep, str) return _series_str_...
def function[replace, parameter[self, pat, rep]]: constant[Replace first occurrence of pat with rep in each element. Parameters ---------- pat : str rep : str Returns ------- Series ] call[name[check_type], parameter[name[pat], name[str]...
keyword[def] identifier[replace] ( identifier[self] , identifier[pat] , identifier[rep] ): literal[string] identifier[check_type] ( identifier[pat] , identifier[str] ) identifier[check_type] ( identifier[rep] , identifier[str] ) keyword[return] identifier[_series_str_result] ( i...
def replace(self, pat, rep): """Replace first occurrence of pat with rep in each element. Parameters ---------- pat : str rep : str Returns ------- Series """ check_type(pat, str) check_type(rep, str) return _series_str_result(self, weld...
def dynamic_part_name(raml_resource, route_name, pk_field): """ Generate a dynamic part for a resource :raml_resource:. A dynamic part is generated using 2 parts: :route_name: of the resource and the dynamic part of first dynamic child resources. If :raml_resource: has no dynamic child resources, 'id' ...
def function[dynamic_part_name, parameter[raml_resource, route_name, pk_field]]: constant[ Generate a dynamic part for a resource :raml_resource:. A dynamic part is generated using 2 parts: :route_name: of the resource and the dynamic part of first dynamic child resources. If :raml_resource: has no...
keyword[def] identifier[dynamic_part_name] ( identifier[raml_resource] , identifier[route_name] , identifier[pk_field] ): literal[string] identifier[subresources] = identifier[get_resource_children] ( identifier[raml_resource] ) identifier[dynamic_uris] =[ identifier[res] . identifier[path] keyword[f...
def dynamic_part_name(raml_resource, route_name, pk_field): """ Generate a dynamic part for a resource :raml_resource:. A dynamic part is generated using 2 parts: :route_name: of the resource and the dynamic part of first dynamic child resources. If :raml_resource: has no dynamic child resources, 'id' ...
def _process_diff(self, yes_work, maybe_work, work_dir, ym_results_path, yn_results_path, stats): """Returns statistics on the difference between the intersection of `yes_work` and `maybe_work` and the intersection of `yes_work` and "no" works. :param yes_work: nam...
def function[_process_diff, parameter[self, yes_work, maybe_work, work_dir, ym_results_path, yn_results_path, stats]]: constant[Returns statistics on the difference between the intersection of `yes_work` and `maybe_work` and the intersection of `yes_work` and "no" works. :param yes_work...
keyword[def] identifier[_process_diff] ( identifier[self] , identifier[yes_work] , identifier[maybe_work] , identifier[work_dir] , identifier[ym_results_path] , identifier[yn_results_path] , identifier[stats] ): literal[string] identifier[distinct_results_path] = identifier[os] . identifier[path] ...
def _process_diff(self, yes_work, maybe_work, work_dir, ym_results_path, yn_results_path, stats): """Returns statistics on the difference between the intersection of `yes_work` and `maybe_work` and the intersection of `yes_work` and "no" works. :param yes_work: name of work for which stats ...
def fetch_items(self, category, **kwargs): """Fetch the bugs :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items """ from_date = kwargs['from_date'] logger.info("Looking for bugs: '%s' updated from '%...
def function[fetch_items, parameter[self, category]]: constant[Fetch the bugs :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items ] variable[from_date] assign[=] call[name[kwargs]][constant[from_date]] ...
keyword[def] identifier[fetch_items] ( identifier[self] , identifier[category] ,** identifier[kwargs] ): literal[string] identifier[from_date] = identifier[kwargs] [ literal[string] ] identifier[logger] . identifier[info] ( literal[string] , identifier[self] . identifier[url] , ...
def fetch_items(self, category, **kwargs): """Fetch the bugs :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items """ from_date = kwargs['from_date'] logger.info("Looking for bugs: '%s' updated from '%s'", self.url,...
def pl2nvp(plane): """ Return a unit normal vector and point that define a specified plane. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/pl2nvp_c.html :param plane: A SPICE plane. :type plane: supporttypes.Plane :return: A unit normal vector and point that define plane. :rtype:...
def function[pl2nvp, parameter[plane]]: constant[ Return a unit normal vector and point that define a specified plane. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/pl2nvp_c.html :param plane: A SPICE plane. :type plane: supporttypes.Plane :return: A unit normal vector and point...
keyword[def] identifier[pl2nvp] ( identifier[plane] ): literal[string] keyword[assert] ( identifier[isinstance] ( identifier[plane] , identifier[stypes] . identifier[Plane] )) identifier[normal] = identifier[stypes] . identifier[emptyDoubleVector] ( literal[int] ) identifier[point] = identifier[s...
def pl2nvp(plane): """ Return a unit normal vector and point that define a specified plane. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/pl2nvp_c.html :param plane: A SPICE plane. :type plane: supporttypes.Plane :return: A unit normal vector and point that define plane. :rtype:...
def _set_preferred_lifetime(self, v, load=False): """ Setter method for preferred_lifetime, mapped from YANG variable /interface/fortygigabitethernet/ipv6/ipv6_nd_ra/ipv6_intf_cmds/nd/prefix/lifetime/preferred/preferred_lifetime (common-def:time-interval-sec) If this variable is read-only (config: false) in...
def function[_set_preferred_lifetime, parameter[self, v, load]]: constant[ Setter method for preferred_lifetime, mapped from YANG variable /interface/fortygigabitethernet/ipv6/ipv6_nd_ra/ipv6_intf_cmds/nd/prefix/lifetime/preferred/preferred_lifetime (common-def:time-interval-sec) If this variable is rea...
keyword[def] identifier[_set_preferred_lifetime] ( 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] : ...
def _set_preferred_lifetime(self, v, load=False): """ Setter method for preferred_lifetime, mapped from YANG variable /interface/fortygigabitethernet/ipv6/ipv6_nd_ra/ipv6_intf_cmds/nd/prefix/lifetime/preferred/preferred_lifetime (common-def:time-interval-sec) If this variable is read-only (config: false) in...
def offset_overlays(self, text, offset=0, run_deps=True, **kw): """ The heavy lifting is done by fit_overlays. Override just that for alternatie implementation. """ if run_deps and self.dependencies: text.overlay(self.dependencies) for ovlf in self.matchers[...
def function[offset_overlays, parameter[self, text, offset, run_deps]]: constant[ The heavy lifting is done by fit_overlays. Override just that for alternatie implementation. ] if <ast.BoolOp object at 0x7da2045673a0> begin[:] call[name[text].overlay, parameter[na...
keyword[def] identifier[offset_overlays] ( identifier[self] , identifier[text] , identifier[offset] = literal[int] , identifier[run_deps] = keyword[True] ,** identifier[kw] ): literal[string] keyword[if] identifier[run_deps] keyword[and] identifier[self] . identifier[dependencies] : ...
def offset_overlays(self, text, offset=0, run_deps=True, **kw): """ The heavy lifting is done by fit_overlays. Override just that for alternatie implementation. """ if run_deps and self.dependencies: text.overlay(self.dependencies) # depends on [control=['if'], data=[]] for ...
def checkout(lancet, force, issue): """ Checkout the branch for the given issue. It is an error if the branch does no exist yet. """ issue = get_issue(lancet, issue) # Get the working branch branch = get_branch(lancet, issue, create=force) with taskstatus("Checking out working branch"...
def function[checkout, parameter[lancet, force, issue]]: constant[ Checkout the branch for the given issue. It is an error if the branch does no exist yet. ] variable[issue] assign[=] call[name[get_issue], parameter[name[lancet], name[issue]]] variable[branch] assign[=] call[name[ge...
keyword[def] identifier[checkout] ( identifier[lancet] , identifier[force] , identifier[issue] ): literal[string] identifier[issue] = identifier[get_issue] ( identifier[lancet] , identifier[issue] ) identifier[branch] = identifier[get_branch] ( identifier[lancet] , identifier[issue] , identifier...
def checkout(lancet, force, issue): """ Checkout the branch for the given issue. It is an error if the branch does no exist yet. """ issue = get_issue(lancet, issue) # Get the working branch branch = get_branch(lancet, issue, create=force) with taskstatus('Checking out working branch') ...
def __get_handle_record_if_necessary(self, handle, handlerecord_json): ''' Returns the handle record if it is None or if its handle is not the same as the specified handle. ''' if handlerecord_json is None: handlerecord_json = self.retrieve_handle_record_json(han...
def function[__get_handle_record_if_necessary, parameter[self, handle, handlerecord_json]]: constant[ Returns the handle record if it is None or if its handle is not the same as the specified handle. ] if compare[name[handlerecord_json] is constant[None]] begin[:] ...
keyword[def] identifier[__get_handle_record_if_necessary] ( identifier[self] , identifier[handle] , identifier[handlerecord_json] ): literal[string] keyword[if] identifier[handlerecord_json] keyword[is] keyword[None] : identifier[handlerecord_json] = identifier[self] . identifier[re...
def __get_handle_record_if_necessary(self, handle, handlerecord_json): """ Returns the handle record if it is None or if its handle is not the same as the specified handle. """ if handlerecord_json is None: handlerecord_json = self.retrieve_handle_record_json(handle) # depe...
def get_attachment(self, scope_identifier, hub_name, plan_id, timeline_id, record_id, type, name): """GetAttachment. [Preview API] :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for ...
def function[get_attachment, parameter[self, scope_identifier, hub_name, plan_id, timeline_id, record_id, type, name]]: constant[GetAttachment. [Preview API] :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for th...
keyword[def] identifier[get_attachment] ( identifier[self] , identifier[scope_identifier] , identifier[hub_name] , identifier[plan_id] , identifier[timeline_id] , identifier[record_id] , identifier[type] , identifier[name] ): literal[string] identifier[route_values] ={} keyword[if] identi...
def get_attachment(self, scope_identifier, hub_name, plan_id, timeline_id, record_id, type, name): """GetAttachment. [Preview API] :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the ...
def views_show_many(self, ids=None, **kwargs): "https://developer.zendesk.com/rest_api/docs/core/views#list-views-by-id" api_path = "/api/v2/views/show_many.json" api_query = {} if "query" in kwargs.keys(): api_query.update(kwargs["query"]) del kwargs["query"] ...
def function[views_show_many, parameter[self, ids]]: constant[https://developer.zendesk.com/rest_api/docs/core/views#list-views-by-id] variable[api_path] assign[=] constant[/api/v2/views/show_many.json] variable[api_query] assign[=] dictionary[[], []] if compare[constant[query] in call[n...
keyword[def] identifier[views_show_many] ( identifier[self] , identifier[ids] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[api_path] = literal[string] identifier[api_query] ={} keyword[if] literal[string] keyword[in] identifier[kwargs] . identifier[keys...
def views_show_many(self, ids=None, **kwargs): """https://developer.zendesk.com/rest_api/docs/core/views#list-views-by-id""" api_path = '/api/v2/views/show_many.json' api_query = {} if 'query' in kwargs.keys(): api_query.update(kwargs['query']) del kwargs['query'] # depends on [control=...
def update(self, callback=None, errback=None, **kwargs): """ Update record configuration. Pass list of keywords and their values to update. For the list of keywords available for zone configuration, see :attr:`ns1.rest.records.Records.INT_FIELDS`, :attr:`ns1.rest.records.Records....
def function[update, parameter[self, callback, errback]]: constant[ Update record configuration. Pass list of keywords and their values to update. For the list of keywords available for zone configuration, see :attr:`ns1.rest.records.Records.INT_FIELDS`, :attr:`ns1.rest.records.R...
keyword[def] identifier[update] ( identifier[self] , identifier[callback] = keyword[None] , identifier[errback] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[data] : keyword[raise] identifier[RecordException] ( liter...
def update(self, callback=None, errback=None, **kwargs): """ Update record configuration. Pass list of keywords and their values to update. For the list of keywords available for zone configuration, see :attr:`ns1.rest.records.Records.INT_FIELDS`, :attr:`ns1.rest.records.Records.PASS...
def euc_to_unicode(hexstr): """ Return EUC-CN (GB2312) hex to a Python unicode. Parameters ---------- hexstr : bytes Returns ------- unicode : Python unicode e.g. ``u'\\u4e00'`` / '一'. Examples -------- >>> u'\u4e00'.encode('gb2312').decode('utf-8') u'\u04bb'...
def function[euc_to_unicode, parameter[hexstr]]: constant[ Return EUC-CN (GB2312) hex to a Python unicode. Parameters ---------- hexstr : bytes Returns ------- unicode : Python unicode e.g. ``u'\u4e00'`` / '一'. Examples -------- >>> u'一'.encode('gb2312').deco...
keyword[def] identifier[euc_to_unicode] ( identifier[hexstr] ): literal[string] identifier[hi] = identifier[hexstr] [ literal[int] : literal[int] ] identifier[lo] = identifier[hexstr] [ literal[int] : literal[int] ] identifier[gb_enc] = literal[string] + identifier[hi] + literal[string] + i...
def euc_to_unicode(hexstr): """ Return EUC-CN (GB2312) hex to a Python unicode. Parameters ---------- hexstr : bytes Returns ------- unicode : Python unicode e.g. ``u'\\u4e00'`` / '一'. Examples -------- >>> u'一'.encode('gb2312').decode('utf-8') u'һ' >>> ...
def _t_update_b(self): r""" A method to update 'b' array at each time step according to 't_scheme' and the source term value """ network = self.project.network phase = self.project.phases()[self.settings['phase']] Vi = network['pore.volume'] dt = self.sett...
def function[_t_update_b, parameter[self]]: constant[ A method to update 'b' array at each time step according to 't_scheme' and the source term value ] variable[network] assign[=] name[self].project.network variable[phase] assign[=] call[call[name[self].project.phases, p...
keyword[def] identifier[_t_update_b] ( identifier[self] ): literal[string] identifier[network] = identifier[self] . identifier[project] . identifier[network] identifier[phase] = identifier[self] . identifier[project] . identifier[phases] ()[ identifier[self] . identifier[settings] [ liter...
def _t_update_b(self): """ A method to update 'b' array at each time step according to 't_scheme' and the source term value """ network = self.project.network phase = self.project.phases()[self.settings['phase']] Vi = network['pore.volume'] dt = self.settings['t_step'] s ...
def list_users(self, limit=20): """ List the public users in the system. :param limit: (optional) The number of users to fetch. :type limit: int | long :returns: The list of users. :rtype: list[dict] """ parameters = dict() parameters['limit'] = l...
def function[list_users, parameter[self, limit]]: constant[ List the public users in the system. :param limit: (optional) The number of users to fetch. :type limit: int | long :returns: The list of users. :rtype: list[dict] ] variable[parameters] assign[=...
keyword[def] identifier[list_users] ( identifier[self] , identifier[limit] = literal[int] ): literal[string] identifier[parameters] = identifier[dict] () identifier[parameters] [ literal[string] ]= identifier[limit] identifier[response] = identifier[self] . identifier[request] ( ...
def list_users(self, limit=20): """ List the public users in the system. :param limit: (optional) The number of users to fetch. :type limit: int | long :returns: The list of users. :rtype: list[dict] """ parameters = dict() parameters['limit'] = limit res...
def ParseRow(self, parser_mediator, query, row, **unused_kwargs): """Parses a row from the database. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. query (str): query that created the row. row (sqlite3.R...
def function[ParseRow, parameter[self, parser_mediator, query, row]]: constant[Parses a row from the database. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. query (str): query that created the row. ...
keyword[def] identifier[ParseRow] ( identifier[self] , identifier[parser_mediator] , identifier[query] , identifier[row] ,** identifier[unused_kwargs] ): literal[string] identifier[query_hash] = identifier[hash] ( identifier[query] ) identifier[event_data] = identifier[AndroidWebViewCacheEventData] (...
def ParseRow(self, parser_mediator, query, row, **unused_kwargs): """Parses a row from the database. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. query (str): query that created the row. row (sqlite3.R...
def mBank_set_iph_id(transactions, tag, tag_dict, *args): """ mBank Collect uses ID IPH to distinguish between virtual accounts, adding iph_id may be helpful in further processing """ matches = iph_id_re.search(tag_dict[tag.slug]) if matches: # pragma no branch tag_dict['iph_id'] = mat...
def function[mBank_set_iph_id, parameter[transactions, tag, tag_dict]]: constant[ mBank Collect uses ID IPH to distinguish between virtual accounts, adding iph_id may be helpful in further processing ] variable[matches] assign[=] call[name[iph_id_re].search, parameter[call[name[tag_dict]][na...
keyword[def] identifier[mBank_set_iph_id] ( identifier[transactions] , identifier[tag] , identifier[tag_dict] ,* identifier[args] ): literal[string] identifier[matches] = identifier[iph_id_re] . identifier[search] ( identifier[tag_dict] [ identifier[tag] . identifier[slug] ]) keyword[if] identifier[...
def mBank_set_iph_id(transactions, tag, tag_dict, *args): """ mBank Collect uses ID IPH to distinguish between virtual accounts, adding iph_id may be helpful in further processing """ matches = iph_id_re.search(tag_dict[tag.slug]) if matches: # pragma no branch tag_dict['iph_id'] = matc...
def parse_cmd_arguments(): """Parse command line arguments.""" parser = argparse.ArgumentParser() parser.add_argument('file', type=str, help='Filename to be staticfied') parser.add_argument('--static-endpoint', help='Static endpoint which is "static" by de...
def function[parse_cmd_arguments, parameter[]]: constant[Parse command line arguments.] variable[parser] assign[=] call[name[argparse].ArgumentParser, parameter[]] call[name[parser].add_argument, parameter[constant[file]]] call[name[parser].add_argument, parameter[constant[--static-endpo...
keyword[def] identifier[parse_cmd_arguments] (): literal[string] identifier[parser] = identifier[argparse] . identifier[ArgumentParser] () identifier[parser] . identifier[add_argument] ( literal[string] , identifier[type] = identifier[str] , identifier[help] = literal[string] ) identifier[pa...
def parse_cmd_arguments(): """Parse command line arguments.""" parser = argparse.ArgumentParser() parser.add_argument('file', type=str, help='Filename to be staticfied') parser.add_argument('--static-endpoint', help='Static endpoint which is "static" by default') parser.add_argument('--add-tags', ty...
def role_settings(self): """ Filter out unwanted to show groups """ result = super(SharingView, self).role_settings() uid = self.context.UID() filter_func = lambda x: not any(( x["id"].endswith(uid), x["id"] == "AuthenticatedUsers", x["id"] == INTRANET...
def function[role_settings, parameter[self]]: constant[ Filter out unwanted to show groups ] variable[result] assign[=] call[call[name[super], parameter[name[SharingView], name[self]]].role_settings, parameter[]] variable[uid] assign[=] call[name[self].context.UID, parameter[]] variable[...
keyword[def] identifier[role_settings] ( identifier[self] ): literal[string] identifier[result] = identifier[super] ( identifier[SharingView] , identifier[self] ). identifier[role_settings] () identifier[uid] = identifier[self] . identifier[context] . identifier[UID] () identifier...
def role_settings(self): """ Filter out unwanted to show groups """ result = super(SharingView, self).role_settings() uid = self.context.UID() filter_func = lambda x: not any((x['id'].endswith(uid), x['id'] == 'AuthenticatedUsers', x['id'] == INTRANET_USERS_GROUP_ID)) return filter(filter_func, resu...
def _addsub_offset_array(self, other, op): """ Add or subtract array-like of DateOffset objects Parameters ---------- other : Index, np.ndarray object-dtype containing pd.DateOffset objects op : {operator.add, operator.sub} Returns ------- ...
def function[_addsub_offset_array, parameter[self, other, op]]: constant[ Add or subtract array-like of DateOffset objects Parameters ---------- other : Index, np.ndarray object-dtype containing pd.DateOffset objects op : {operator.add, operator.sub} ...
keyword[def] identifier[_addsub_offset_array] ( identifier[self] , identifier[other] , identifier[op] ): literal[string] keyword[assert] identifier[op] keyword[in] [ identifier[operator] . identifier[add] , identifier[operator] . identifier[sub] ] keyword[if] identifier[len] ( identifie...
def _addsub_offset_array(self, other, op): """ Add or subtract array-like of DateOffset objects Parameters ---------- other : Index, np.ndarray object-dtype containing pd.DateOffset objects op : {operator.add, operator.sub} Returns ------- ...
def apply(self, manifest, db, force=False): """ Run the given patch to update the datamodel :return: the list of post-scriptum returned by the fixes """ fixes_pss = [] if not force: self.can_be_applied(manifest, db) for fix in self.fixes: ...
def function[apply, parameter[self, manifest, db, force]]: constant[ Run the given patch to update the datamodel :return: the list of post-scriptum returned by the fixes ] variable[fixes_pss] assign[=] list[[]] if <ast.UnaryOp object at 0x7da1b095f9a0> begin[:] ...
keyword[def] identifier[apply] ( identifier[self] , identifier[manifest] , identifier[db] , identifier[force] = keyword[False] ): literal[string] identifier[fixes_pss] =[] keyword[if] keyword[not] identifier[force] : identifier[self] . identifier[can_be_applied] ( identifier...
def apply(self, manifest, db, force=False): """ Run the given patch to update the datamodel :return: the list of post-scriptum returned by the fixes """ fixes_pss = [] if not force: self.can_be_applied(manifest, db) # depends on [control=['if'], data=[]] for fix in self...
def as_pil(ndarray, min_val=None, max_val=None): """ Converts an ndarray to a PIL image. :param ndarray: The numpy ndarray to convert :param min_val: The minimum pixel value in the image format :param max_val: The maximum pixel valie in the image format If min_val and max_val are not specified, attempts t...
def function[as_pil, parameter[ndarray, min_val, max_val]]: constant[ Converts an ndarray to a PIL image. :param ndarray: The numpy ndarray to convert :param min_val: The minimum pixel value in the image format :param max_val: The maximum pixel valie in the image format If min_val and max_val are no...
keyword[def] identifier[as_pil] ( identifier[ndarray] , identifier[min_val] = keyword[None] , identifier[max_val] = keyword[None] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[ndarray] , identifier[np] . identifier[ndarray] ) keyword[assert] identifier[ndarray] . identifie...
def as_pil(ndarray, min_val=None, max_val=None): """ Converts an ndarray to a PIL image. :param ndarray: The numpy ndarray to convert :param min_val: The minimum pixel value in the image format :param max_val: The maximum pixel valie in the image format If min_val and max_val are not specified, attempts...
def _execute_backend_on_spec(self): """Renders a source file into its final form.""" api_no_aliases_cache = None for attr_key in dir(self.backend_module): attr_value = getattr(self.backend_module, attr_key) if (inspect.isclass(attr_value) and issubcla...
def function[_execute_backend_on_spec, parameter[self]]: constant[Renders a source file into its final form.] variable[api_no_aliases_cache] assign[=] constant[None] for taget[name[attr_key]] in starred[call[name[dir], parameter[name[self].backend_module]]] begin[:] variable[attr...
keyword[def] identifier[_execute_backend_on_spec] ( identifier[self] ): literal[string] identifier[api_no_aliases_cache] = keyword[None] keyword[for] identifier[attr_key] keyword[in] identifier[dir] ( identifier[self] . identifier[backend_module] ): identifier[attr_value]...
def _execute_backend_on_spec(self): """Renders a source file into its final form.""" api_no_aliases_cache = None for attr_key in dir(self.backend_module): attr_value = getattr(self.backend_module, attr_key) if inspect.isclass(attr_value) and issubclass(attr_value, Backend) and (not inspect.i...
def do_disable(): """ Comment any lines that start with import in the .pth file """ from vext import vext_pth try: _lines = [] with open(vext_pth, mode='r') as f: for line in f.readlines(): if not line.startswith('#') and line.startswith('import '): ...
def function[do_disable, parameter[]]: constant[ Comment any lines that start with import in the .pth file ] from relative_module[vext] import module[vext_pth] <ast.Try object at 0x7da20c7c8a30>
keyword[def] identifier[do_disable] (): literal[string] keyword[from] identifier[vext] keyword[import] identifier[vext_pth] keyword[try] : identifier[_lines] =[] keyword[with] identifier[open] ( identifier[vext_pth] , identifier[mode] = literal[string] ) keyword[as] identifier...
def do_disable(): """ Comment any lines that start with import in the .pth file """ from vext import vext_pth try: _lines = [] with open(vext_pth, mode='r') as f: for line in f.readlines(): if not line.startswith('#') and line.startswith('import '): ...
def determine_hooks(self, controller=None): ''' Determines the hooks to be run, in which order. :param controller: If specified, includes hooks for a specific controller. ''' controller_hooks = [] if controller: controller_hooks = ...
def function[determine_hooks, parameter[self, controller]]: constant[ Determines the hooks to be run, in which order. :param controller: If specified, includes hooks for a specific controller. ] variable[controller_hooks] assign[=] list[[]] if ...
keyword[def] identifier[determine_hooks] ( identifier[self] , identifier[controller] = keyword[None] ): literal[string] identifier[controller_hooks] =[] keyword[if] identifier[controller] : identifier[controller_hooks] = identifier[_cfg] ( identifier[controller] ). identifie...
def determine_hooks(self, controller=None): """ Determines the hooks to be run, in which order. :param controller: If specified, includes hooks for a specific controller. """ controller_hooks = [] if controller: controller_hooks = _cfg(controller)....
def _unquote_or_none(s: Optional[str]) -> Optional[bytes]: # noqa: F811 """None-safe wrapper around url_unescape to handle unmatched optional groups correctly. Note that args are passed as bytes so the handler can decide what encoding to use. """ if s is None: return s return url_u...
def function[_unquote_or_none, parameter[s]]: constant[None-safe wrapper around url_unescape to handle unmatched optional groups correctly. Note that args are passed as bytes so the handler can decide what encoding to use. ] if compare[name[s] is constant[None]] begin[:] return[...
keyword[def] identifier[_unquote_or_none] ( identifier[s] : identifier[Optional] [ identifier[str] ])-> identifier[Optional] [ identifier[bytes] ]: literal[string] keyword[if] identifier[s] keyword[is] keyword[None] : keyword[return] identifier[s] keyword[return] identifier[url_unescape...
def _unquote_or_none(s: Optional[str]) -> Optional[bytes]: # noqa: F811 'None-safe wrapper around url_unescape to handle unmatched optional\n groups correctly.\n\n Note that args are passed as bytes so the handler can decide what\n encoding to use.\n ' if s is None: return s # depends on [...
def create_value(self, label, vtype, lang=None, description=None, unit=None): """Create a value on this Point. Values are descriptions in semantic metadata of the individual data items you are sharing (or expecting to receive, if this Point is a control). This will help others to search for yo...
def function[create_value, parameter[self, label, vtype, lang, description, unit]]: constant[Create a value on this Point. Values are descriptions in semantic metadata of the individual data items you are sharing (or expecting to receive, if this Point is a control). This will help others to search fo...
keyword[def] identifier[create_value] ( identifier[self] , identifier[label] , identifier[vtype] , identifier[lang] = keyword[None] , identifier[description] = keyword[None] , identifier[unit] = keyword[None] ): literal[string] identifier[evt] = identifier[self] . identifier[_client] . identifier[_...
def create_value(self, label, vtype, lang=None, description=None, unit=None): """Create a value on this Point. Values are descriptions in semantic metadata of the individual data items you are sharing (or expecting to receive, if this Point is a control). This will help others to search for your f...
def update_state(self, slots: Union[List[Tuple[str, Any]], Dict[str, Any]]) -> 'Tracker': """ Updates dialogue state with new ``slots``, calculates features. Returns: Tracker: .""" pass
def function[update_state, parameter[self, slots]]: constant[ Updates dialogue state with new ``slots``, calculates features. Returns: Tracker: .] pass
keyword[def] identifier[update_state] ( identifier[self] , identifier[slots] : identifier[Union] [ identifier[List] [ identifier[Tuple] [ identifier[str] , identifier[Any] ]], identifier[Dict] [ identifier[str] , identifier[Any] ]])-> literal[string] : literal[string] keyword[pass]
def update_state(self, slots: Union[List[Tuple[str, Any]], Dict[str, Any]]) -> 'Tracker': """ Updates dialogue state with new ``slots``, calculates features. Returns: Tracker: .""" pass
def _handshake(self, conn, addr): ''' Ensures that the client receives the AES key. ''' # waiting for the magic request message msg = conn.recv(len(MAGIC_REQ)) log.debug('Received message %s from %s', msg, addr) if msg != MAGIC_REQ: log.warning('%s is ...
def function[_handshake, parameter[self, conn, addr]]: constant[ Ensures that the client receives the AES key. ] variable[msg] assign[=] call[name[conn].recv, parameter[call[name[len], parameter[name[MAGIC_REQ]]]]] call[name[log].debug, parameter[constant[Received message %s from...
keyword[def] identifier[_handshake] ( identifier[self] , identifier[conn] , identifier[addr] ): literal[string] identifier[msg] = identifier[conn] . identifier[recv] ( identifier[len] ( identifier[MAGIC_REQ] )) identifier[log] . identifier[debug] ( literal[string] , identifier[msg...
def _handshake(self, conn, addr): """ Ensures that the client receives the AES key. """ # waiting for the magic request message msg = conn.recv(len(MAGIC_REQ)) log.debug('Received message %s from %s', msg, addr) if msg != MAGIC_REQ: log.warning('%s is not a valid REQ message ...
def device_from_request(request): """ Determine's the device name from the request by first looking for an overridding cookie, and if not found then matching the user agent. Used at both the template level for choosing the template to load and also at the cache level as a cache key prefix. """ ...
def function[device_from_request, parameter[request]]: constant[ Determine's the device name from the request by first looking for an overridding cookie, and if not found then matching the user agent. Used at both the template level for choosing the template to load and also at the cache level a...
keyword[def] identifier[device_from_request] ( identifier[request] ): literal[string] keyword[from] identifier[yacms] . identifier[conf] keyword[import] identifier[settings] keyword[try] : keyword[for] ( identifier[device] , identifier[_] ) keyword[in] identifier[settings] . identif...
def device_from_request(request): """ Determine's the device name from the request by first looking for an overridding cookie, and if not found then matching the user agent. Used at both the template level for choosing the template to load and also at the cache level as a cache key prefix. """ ...
def avg(self, vars_list: List[str]) -> 'TensorFluent': '''Returns the TensorFluent for the avg aggregation function. Args: vars_list: The list of variables to be aggregated over. Returns: A TensorFluent wrapping the avg aggregation function. ''' operand ...
def function[avg, parameter[self, vars_list]]: constant[Returns the TensorFluent for the avg aggregation function. Args: vars_list: The list of variables to be aggregated over. Returns: A TensorFluent wrapping the avg aggregation function. ] variable[ope...
keyword[def] identifier[avg] ( identifier[self] , identifier[vars_list] : identifier[List] [ identifier[str] ])-> literal[string] : literal[string] identifier[operand] = identifier[self] keyword[if] identifier[operand] . identifier[dtype] == identifier[tf] . identifier[bool] : ...
def avg(self, vars_list: List[str]) -> 'TensorFluent': """Returns the TensorFluent for the avg aggregation function. Args: vars_list: The list of variables to be aggregated over. Returns: A TensorFluent wrapping the avg aggregation function. """ operand = self ...
def add_inputs(self, es): """ returns the list of state pairs (stateF, stateB) obtained by adding inputs to both forward (stateF) and backward (stateB) RNNs. @param es: a list of Expression see also transduce(xs) .transduce(xs) is different from .add_inputs(xs) in t...
def function[add_inputs, parameter[self, es]]: constant[ returns the list of state pairs (stateF, stateB) obtained by adding inputs to both forward (stateF) and backward (stateB) RNNs. @param es: a list of Expression see also transduce(xs) .transduce(xs) is differen...
keyword[def] identifier[add_inputs] ( identifier[self] , identifier[es] ): literal[string] keyword[for] identifier[e] keyword[in] identifier[es] : identifier[ensure_freshness] ( identifier[e] ) keyword[for] ( identifier[fb] , identifier[bb] ) keyword[in] identifier[self] ....
def add_inputs(self, es): """ returns the list of state pairs (stateF, stateB) obtained by adding inputs to both forward (stateF) and backward (stateB) RNNs. @param es: a list of Expression see also transduce(xs) .transduce(xs) is different from .add_inputs(xs) in the f...
def url(self, host): """Generate url for coap client.""" path = '/'.join(str(v) for v in self._path) return 'coaps://{}:5684/{}'.format(host, path)
def function[url, parameter[self, host]]: constant[Generate url for coap client.] variable[path] assign[=] call[constant[/].join, parameter[<ast.GeneratorExp object at 0x7da207f00610>]] return[call[constant[coaps://{}:5684/{}].format, parameter[name[host], name[path]]]]
keyword[def] identifier[url] ( identifier[self] , identifier[host] ): literal[string] identifier[path] = literal[string] . identifier[join] ( identifier[str] ( identifier[v] ) keyword[for] identifier[v] keyword[in] identifier[self] . identifier[_path] ) keyword[return] literal[string] ...
def url(self, host): """Generate url for coap client.""" path = '/'.join((str(v) for v in self._path)) return 'coaps://{}:5684/{}'.format(host, path)
def tag(self, text): """Retrieves list of regex_matches in text. Parameters ---------- text: Text The estnltk text object to search for events. Returns ------- list of matches """ matches = self._match(text.text) matches = sel...
def function[tag, parameter[self, text]]: constant[Retrieves list of regex_matches in text. Parameters ---------- text: Text The estnltk text object to search for events. Returns ------- list of matches ] variable[matches] assign[=] c...
keyword[def] identifier[tag] ( identifier[self] , identifier[text] ): literal[string] identifier[matches] = identifier[self] . identifier[_match] ( identifier[text] . identifier[text] ) identifier[matches] = identifier[self] . identifier[_resolve_conflicts] ( identifier[matches] ) ...
def tag(self, text): """Retrieves list of regex_matches in text. Parameters ---------- text: Text The estnltk text object to search for events. Returns ------- list of matches """ matches = self._match(text.text) matches = self._resolve_c...
def handle_error(self, error, download_request): """ Checks what error occured and looks for an appropriate solution. Args: error: Exception The error that has occured. download_request: The request which resulted in the error. """ if ...
def function[handle_error, parameter[self, error, download_request]]: constant[ Checks what error occured and looks for an appropriate solution. Args: error: Exception The error that has occured. download_request: The request which resulted in the err...
keyword[def] identifier[handle_error] ( identifier[self] , identifier[error] , identifier[download_request] ): literal[string] keyword[if] identifier[hasattr] ( identifier[error] , literal[string] ) keyword[and] identifier[error] . identifier[errno] == identifier[errno] . identifier[EACCES] : ...
def handle_error(self, error, download_request): """ Checks what error occured and looks for an appropriate solution. Args: error: Exception The error that has occured. download_request: The request which resulted in the error. """ if hasattr(...
def clear_messages(self): """ Clears all messages. """ while len(self._messages): msg = self._messages.pop(0) usd = msg.block.userData() if usd and hasattr(usd, 'messages'): usd.messages[:] = [] if msg.decoration: ...
def function[clear_messages, parameter[self]]: constant[ Clears all messages. ] while call[name[len], parameter[name[self]._messages]] begin[:] variable[msg] assign[=] call[name[self]._messages.pop, parameter[constant[0]]] variable[usd] assign[=] call[name...
keyword[def] identifier[clear_messages] ( identifier[self] ): literal[string] keyword[while] identifier[len] ( identifier[self] . identifier[_messages] ): identifier[msg] = identifier[self] . identifier[_messages] . identifier[pop] ( literal[int] ) identifier[usd] = ident...
def clear_messages(self): """ Clears all messages. """ while len(self._messages): msg = self._messages.pop(0) usd = msg.block.userData() if usd and hasattr(usd, 'messages'): usd.messages[:] = [] # depends on [control=['if'], data=[]] if msg.decoration...
def add_file(self, *args): """ Add single file or list of files to bundle :type: file_path: str|unicode """ for file_path in args: self.files.append(FilePath(file_path, self))
def function[add_file, parameter[self]]: constant[ Add single file or list of files to bundle :type: file_path: str|unicode ] for taget[name[file_path]] in starred[name[args]] begin[:] call[name[self].files.append, parameter[call[name[FilePath], parameter[name[fi...
keyword[def] identifier[add_file] ( identifier[self] ,* identifier[args] ): literal[string] keyword[for] identifier[file_path] keyword[in] identifier[args] : identifier[self] . identifier[files] . identifier[append] ( identifier[FilePath] ( identifier[file_path] , identifier[self] )...
def add_file(self, *args): """ Add single file or list of files to bundle :type: file_path: str|unicode """ for file_path in args: self.files.append(FilePath(file_path, self)) # depends on [control=['for'], data=['file_path']]
def setupUI(self): '''Create graphical objects for menus.''' labelSizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) labelSizePolicy.setHorizontalStretch(0) labelSizePolicy.setVerticalStretch(0) menuSizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy....
def function[setupUI, parameter[self]]: constant[Create graphical objects for menus.] variable[labelSizePolicy] assign[=] call[name[QSizePolicy], parameter[name[QSizePolicy].Fixed, name[QSizePolicy].Fixed]] call[name[labelSizePolicy].setHorizontalStretch, parameter[constant[0]]] call[nam...
keyword[def] identifier[setupUI] ( identifier[self] ): literal[string] identifier[labelSizePolicy] = identifier[QSizePolicy] ( identifier[QSizePolicy] . identifier[Fixed] , identifier[QSizePolicy] . identifier[Fixed] ) identifier[labelSizePolicy] . identifier[setHorizontalStretch] ( liter...
def setupUI(self): """Create graphical objects for menus.""" labelSizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) labelSizePolicy.setHorizontalStretch(0) labelSizePolicy.setVerticalStretch(0) menuSizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) menuSizePolicy.set...
def load(path=None, root=None, db=None, load_user=True): "Load all of the config files. " config = load_config(path, load_user=load_user) remotes = load_remotes(path, load_user=load_user) # The external file overwrites the main config if remotes: if not 'remotes' in config: co...
def function[load, parameter[path, root, db, load_user]]: constant[Load all of the config files. ] variable[config] assign[=] call[name[load_config], parameter[name[path]]] variable[remotes] assign[=] call[name[load_remotes], parameter[name[path]]] if name[remotes] begin[:] ...
keyword[def] identifier[load] ( identifier[path] = keyword[None] , identifier[root] = keyword[None] , identifier[db] = keyword[None] , identifier[load_user] = keyword[True] ): literal[string] identifier[config] = identifier[load_config] ( identifier[path] , identifier[load_user] = identifier[load_user] ) ...
def load(path=None, root=None, db=None, load_user=True): """Load all of the config files. """ config = load_config(path, load_user=load_user) remotes = load_remotes(path, load_user=load_user) # The external file overwrites the main config if remotes: if not 'remotes' in config: c...
def intf_up(self, interface): ''' Can be called when an interface is put in service. FIXME: not currently used; more needs to be done to correctly put a new intf into service. ''' if interface.name not in self._devinfo: self._devinfo[interface.name] = interfac...
def function[intf_up, parameter[self, interface]]: constant[ Can be called when an interface is put in service. FIXME: not currently used; more needs to be done to correctly put a new intf into service. ] if compare[name[interface].name <ast.NotIn object at 0x7da2590d7190...
keyword[def] identifier[intf_up] ( identifier[self] , identifier[interface] ): literal[string] keyword[if] identifier[interface] . identifier[name] keyword[not] keyword[in] identifier[self] . identifier[_devinfo] : identifier[self] . identifier[_devinfo] [ identifier[interface] . i...
def intf_up(self, interface): """ Can be called when an interface is put in service. FIXME: not currently used; more needs to be done to correctly put a new intf into service. """ if interface.name not in self._devinfo: self._devinfo[interface.name] = interface if...
def prob_classify(self, text): """Return the label probability distribution for classifying a string of text. Example: :: >>> classifier = NaiveBayesClassifier(train_data) >>> prob_dist = classifier.prob_classify("I feel happy this morning.") >>> pro...
def function[prob_classify, parameter[self, text]]: constant[Return the label probability distribution for classifying a string of text. Example: :: >>> classifier = NaiveBayesClassifier(train_data) >>> prob_dist = classifier.prob_classify("I feel happy this mor...
keyword[def] identifier[prob_classify] ( identifier[self] , identifier[text] ): literal[string] identifier[text_features] = identifier[self] . identifier[extract_features] ( identifier[text] ) keyword[return] identifier[self] . identifier[classifier] . identifier[prob_classify] ( identifi...
def prob_classify(self, text): """Return the label probability distribution for classifying a string of text. Example: :: >>> classifier = NaiveBayesClassifier(train_data) >>> prob_dist = classifier.prob_classify("I feel happy this morning.") >>> prob_di...
def _merge_defaults(self, config): """The config object loads its values from two sources, with the following precedence: 1. data/default_config.yaml 2. The config file itself, passed in to this object in the constructor as `path`. in case of conflict, th...
def function[_merge_defaults, parameter[self, config]]: constant[The config object loads its values from two sources, with the following precedence: 1. data/default_config.yaml 2. The config file itself, passed in to this object in the constructor as `path`. ...
keyword[def] identifier[_merge_defaults] ( identifier[self] , identifier[config] ): literal[string] identifier[fn] = identifier[resource_filename] ( literal[string] , identifier[join] ( literal[string] , literal[string] )) keyword[with] identifier[open] ( identifier[fn] ) keyword[as] ide...
def _merge_defaults(self, config): """The config object loads its values from two sources, with the following precedence: 1. data/default_config.yaml 2. The config file itself, passed in to this object in the constructor as `path`. in case of conflict, the co...
def parse_index_parameter(self, node): """ Parses <IndexParameter> @param node: Node containing the <IndexParameter> element @type node: xml.etree.Element @raise ParseError: Raised when the IndexParameter does not have a name. """ if self.current_component_type...
def function[parse_index_parameter, parameter[self, node]]: constant[ Parses <IndexParameter> @param node: Node containing the <IndexParameter> element @type node: xml.etree.Element @raise ParseError: Raised when the IndexParameter does not have a name. ] if com...
keyword[def] identifier[parse_index_parameter] ( identifier[self] , identifier[node] ): literal[string] keyword[if] identifier[self] . identifier[current_component_type] == keyword[None] : identifier[self] . identifier[raise_error] ( literal[string] + literal[string] ) ...
def parse_index_parameter(self, node): """ Parses <IndexParameter> @param node: Node containing the <IndexParameter> element @type node: xml.etree.Element @raise ParseError: Raised when the IndexParameter does not have a name. """ if self.current_component_type == None:...
def _growSynapses(cls, connections, random, segment, nDesiredNewSynapes, prevWinnerCells, initialPermanence, maxSynapsesPerSegment): """ Creates nDesiredNewSynapes synapses on the segment passed in if possible, choosing random cells from the previous winner cells that are not already...
def function[_growSynapses, parameter[cls, connections, random, segment, nDesiredNewSynapes, prevWinnerCells, initialPermanence, maxSynapsesPerSegment]]: constant[ Creates nDesiredNewSynapes synapses on the segment passed in if possible, choosing random cells from the previous winner cells that are ...
keyword[def] identifier[_growSynapses] ( identifier[cls] , identifier[connections] , identifier[random] , identifier[segment] , identifier[nDesiredNewSynapes] , identifier[prevWinnerCells] , identifier[initialPermanence] , identifier[maxSynapsesPerSegment] ): literal[string] identifier[candidates] = ident...
def _growSynapses(cls, connections, random, segment, nDesiredNewSynapes, prevWinnerCells, initialPermanence, maxSynapsesPerSegment): """ Creates nDesiredNewSynapes synapses on the segment passed in if possible, choosing random cells from the previous winner cells that are not already on the segment. ...
def threatlist(self, ip: str): """Return threatlist information we have for the given IPv{4,6} address with history of changes """ url_path = "/api/threatlist/{ip}".format(ip=ip) return self._request(path=url_path)
def function[threatlist, parameter[self, ip]]: constant[Return threatlist information we have for the given IPv{4,6} address with history of changes ] variable[url_path] assign[=] call[constant[/api/threatlist/{ip}].format, parameter[]] return[call[name[self]._request, parameter[]]]
keyword[def] identifier[threatlist] ( identifier[self] , identifier[ip] : identifier[str] ): literal[string] identifier[url_path] = literal[string] . identifier[format] ( identifier[ip] = identifier[ip] ) keyword[return] identifier[self] . identifier[_request] ( identifier[path] = identif...
def threatlist(self, ip: str): """Return threatlist information we have for the given IPv{4,6} address with history of changes """ url_path = '/api/threatlist/{ip}'.format(ip=ip) return self._request(path=url_path)
def handleTrailingStops(self, tickerId): """ software-based trailing stop """ # existing? if tickerId not in self.trailingStops.keys(): return None # continue trailingStop = self.trailingStops[tickerId] price = self.marketData[tickerId]['last'][0]...
def function[handleTrailingStops, parameter[self, tickerId]]: constant[ software-based trailing stop ] if compare[name[tickerId] <ast.NotIn object at 0x7da2590d7190> call[name[self].trailingStops.keys, parameter[]]] begin[:] return[constant[None]] variable[trailingStop] assign[=] call[na...
keyword[def] identifier[handleTrailingStops] ( identifier[self] , identifier[tickerId] ): literal[string] keyword[if] identifier[tickerId] keyword[not] keyword[in] identifier[self] . identifier[trailingStops] . identifier[keys] (): keyword[return] keyword[None] ...
def handleTrailingStops(self, tickerId): """ software-based trailing stop """ # existing? if tickerId not in self.trailingStops.keys(): return None # depends on [control=['if'], data=[]] # continue trailingStop = self.trailingStops[tickerId] price = self.marketData[tickerId]['last'][0] ...
def exceptAll(self, other): """Return a new :class:`DataFrame` containing rows in this :class:`DataFrame` but not in another :class:`DataFrame` while preserving duplicates. This is equivalent to `EXCEPT ALL` in SQL. >>> df1 = spark.createDataFrame( ... [("a", 1), ("a", ...
def function[exceptAll, parameter[self, other]]: constant[Return a new :class:`DataFrame` containing rows in this :class:`DataFrame` but not in another :class:`DataFrame` while preserving duplicates. This is equivalent to `EXCEPT ALL` in SQL. >>> df1 = spark.createDataFrame( .....
keyword[def] identifier[exceptAll] ( identifier[self] , identifier[other] ): literal[string] keyword[return] identifier[DataFrame] ( identifier[self] . identifier[_jdf] . identifier[exceptAll] ( identifier[other] . identifier[_jdf] ), identifier[self] . identifier[sql_ctx] )
def exceptAll(self, other): """Return a new :class:`DataFrame` containing rows in this :class:`DataFrame` but not in another :class:`DataFrame` while preserving duplicates. This is equivalent to `EXCEPT ALL` in SQL. >>> df1 = spark.createDataFrame( ... [("a", 1), ("a", 1), ...
def get_bounds_x0_eps(tuning_options): """compute bounds, x0 (the initial guess), and eps""" values = tuning_options.tune_params.values() if tuning_options.scaling: #bounds = [(0, 1) for _ in values] #x0 = [0.5 for _ in bounds] eps = numpy.amin([1.0/len(v) for v in values]) ...
def function[get_bounds_x0_eps, parameter[tuning_options]]: constant[compute bounds, x0 (the initial guess), and eps] variable[values] assign[=] call[name[tuning_options].tune_params.values, parameter[]] if name[tuning_options].scaling begin[:] variable[eps] assign[=] call[name[n...
keyword[def] identifier[get_bounds_x0_eps] ( identifier[tuning_options] ): literal[string] identifier[values] = identifier[tuning_options] . identifier[tune_params] . identifier[values] () keyword[if] identifier[tuning_options] . identifier[scaling] : identifier[eps] = identifier[...
def get_bounds_x0_eps(tuning_options): """compute bounds, x0 (the initial guess), and eps""" values = tuning_options.tune_params.values() if tuning_options.scaling: #bounds = [(0, 1) for _ in values] #x0 = [0.5 for _ in bounds] eps = numpy.amin([1.0 / len(v) for v in values]) ...
def send_media(self, media_id, user_ids, text='', thread_id=None): """ :param media_id: :param self: bot :param text: text of message :param user_ids: list of user_ids for creating group or one user_id for send to one person :param thread_id: thread_id """ user_ids = _get_user_ids(self, ...
def function[send_media, parameter[self, media_id, user_ids, text, thread_id]]: constant[ :param media_id: :param self: bot :param text: text of message :param user_ids: list of user_ids for creating group or one user_id for send to one person :param thread_id: thread_id ] variab...
keyword[def] identifier[send_media] ( identifier[self] , identifier[media_id] , identifier[user_ids] , identifier[text] = literal[string] , identifier[thread_id] = keyword[None] ): literal[string] identifier[user_ids] = identifier[_get_user_ids] ( identifier[self] , identifier[user_ids] ) keyword[if] ...
def send_media(self, media_id, user_ids, text='', thread_id=None): """ :param media_id: :param self: bot :param text: text of message :param user_ids: list of user_ids for creating group or one user_id for send to one person :param thread_id: thread_id """ user_ids = _get_user_ids(self, ...
def match(self, opr, path): """ 检查操作员是否匹配资源 """ _url = urlparse.urlparse(path) if not _url.path or not opr: return False if _url.path in self.free_routes: return True if _url.path not in self.routes: return False return opr in s...
def function[match, parameter[self, opr, path]]: constant[ 检查操作员是否匹配资源 ] variable[_url] assign[=] call[name[urlparse].urlparse, parameter[name[path]]] if <ast.BoolOp object at 0x7da1b0810760> begin[:] return[constant[False]] if compare[name[_url].path in name[self].free_r...
keyword[def] identifier[match] ( identifier[self] , identifier[opr] , identifier[path] ): literal[string] identifier[_url] = identifier[urlparse] . identifier[urlparse] ( identifier[path] ) keyword[if] keyword[not] identifier[_url] . identifier[path] keyword[or] keyword[not] identifie...
def match(self, opr, path): """ 检查操作员是否匹配资源 """ _url = urlparse.urlparse(path) if not _url.path or not opr: return False # depends on [control=['if'], data=[]] if _url.path in self.free_routes: return True # depends on [control=['if'], data=[]] if _url.path not in self.rout...
def _set_exception(self): """Called by a Job object to tell that an exception occured during the processing of the function. The object will become ready but not successful. The collector's notify_ready() method will be called, but NOT the callback method""" assert not self.ready...
def function[_set_exception, parameter[self]]: constant[Called by a Job object to tell that an exception occured during the processing of the function. The object will become ready but not successful. The collector's notify_ready() method will be called, but NOT the callback method] ...
keyword[def] identifier[_set_exception] ( identifier[self] ): literal[string] keyword[assert] keyword[not] identifier[self] . identifier[ready] () identifier[self] . identifier[_data] = identifier[sys] . identifier[exc_info] () identifier[self] . identifier[_success] = keyword[F...
def _set_exception(self): """Called by a Job object to tell that an exception occured during the processing of the function. The object will become ready but not successful. The collector's notify_ready() method will be called, but NOT the callback method""" assert not self.ready() s...
def get_handlers(self, component_context, instance): """ Sets up service providers for the given component :param component_context: The ComponentContext bean :param instance: The component instance :return: The list of handlers associated to the given component """ ...
def function[get_handlers, parameter[self, component_context, instance]]: constant[ Sets up service providers for the given component :param component_context: The ComponentContext bean :param instance: The component instance :return: The list of handlers associated to the given...
keyword[def] identifier[get_handlers] ( identifier[self] , identifier[component_context] , identifier[instance] ): literal[string] identifier[configs] = identifier[component_context] . identifier[get_handler] ( identifier[ipopo_constants] . identifier[HANDLER_TEMPORAL] ) ...
def get_handlers(self, component_context, instance): """ Sets up service providers for the given component :param component_context: The ComponentContext bean :param instance: The component instance :return: The list of handlers associated to the given component """ # Ex...
def is_in_data_type_range(self, raise_exception=True): """Check if collection values are in physically possible ranges for the data_type. If this method returns False, the Data Collection's data is physically or mathematically impossible for the data_type.""" return self._header.data_ty...
def function[is_in_data_type_range, parameter[self, raise_exception]]: constant[Check if collection values are in physically possible ranges for the data_type. If this method returns False, the Data Collection's data is physically or mathematically impossible for the data_type.] return[call...
keyword[def] identifier[is_in_data_type_range] ( identifier[self] , identifier[raise_exception] = keyword[True] ): literal[string] keyword[return] identifier[self] . identifier[_header] . identifier[data_type] . identifier[is_in_range] ( identifier[self] . identifier[_values] , identifier...
def is_in_data_type_range(self, raise_exception=True): """Check if collection values are in physically possible ranges for the data_type. If this method returns False, the Data Collection's data is physically or mathematically impossible for the data_type.""" return self._header.data_type.is_in...
def change_owners(self, group_id, owner_id): """Change the owner of a group. .. note:: you must be the owner to change owners :param str group_id: the group_id of a group :param str owner_id: the ID of the new owner :return: the result :rtype: :class:`~groupy.api.groups...
def function[change_owners, parameter[self, group_id, owner_id]]: constant[Change the owner of a group. .. note:: you must be the owner to change owners :param str group_id: the group_id of a group :param str owner_id: the ID of the new owner :return: the result :rtype:...
keyword[def] identifier[change_owners] ( identifier[self] , identifier[group_id] , identifier[owner_id] ): literal[string] identifier[url] = identifier[utils] . identifier[urljoin] ( identifier[self] . identifier[url] , literal[string] ) identifier[payload] ={ literal[string] :[{ ...
def change_owners(self, group_id, owner_id): """Change the owner of a group. .. note:: you must be the owner to change owners :param str group_id: the group_id of a group :param str owner_id: the ID of the new owner :return: the result :rtype: :class:`~groupy.api.groups.Cha...
def dispatch(self, test=False): # pylint: disable=too-many-branches """ Send configuration to satellites :return: None """ if not self.new_to_dispatch: raise DispatcherError("Dispatcher cannot dispatch, " "because no configuration i...
def function[dispatch, parameter[self, test]]: constant[ Send configuration to satellites :return: None ] if <ast.UnaryOp object at 0x7da1b26af310> begin[:] <ast.Raise object at 0x7da1b26af670> if name[self].first_dispatch_done begin[:] <ast.Raise object ...
keyword[def] identifier[dispatch] ( identifier[self] , identifier[test] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[new_to_dispatch] : keyword[raise] identifier[DispatcherError] ( literal[string] literal[string] ) ...
def dispatch(self, test=False): # pylint: disable=too-many-branches '\n Send configuration to satellites\n\n :return: None\n ' if not self.new_to_dispatch: raise DispatcherError('Dispatcher cannot dispatch, because no configuration is prepared!') # depends on [control=['if'], data...
def generate_lines(text, ext=['.txt', '.md', '.rst', '.asciidoc', '.asc']): r""" Yield text one line at a time from from a single file path, files in a directory, or a text string >>> list(generate_lines('Hello crazy\r\nMS/Apple world\rof EOLS.\n')) ['Hello crazy\r\n', 'MS/Apple world\r', 'of EOLS.\n'] ...
def function[generate_lines, parameter[text, ext]]: constant[ Yield text one line at a time from from a single file path, files in a directory, or a text string >>> list(generate_lines('Hello crazy\r\nMS/Apple world\rof EOLS.\n')) ['Hello crazy\r\n', 'MS/Apple world\r', 'of EOLS.\n'] ] if c...
keyword[def] identifier[generate_lines] ( identifier[text] , identifier[ext] =[ literal[string] , literal[string] , literal[string] , literal[string] , literal[string] ]): literal[string] keyword[if] identifier[isinstance] ( identifier[text] , identifier[basestring] ): keyword[if] identifier[le...
def generate_lines(text, ext=['.txt', '.md', '.rst', '.asciidoc', '.asc']): """ Yield text one line at a time from from a single file path, files in a directory, or a text string >>> list(generate_lines('Hello crazy\\r\\nMS/Apple world\\rof EOLS.\\n')) ['Hello crazy\\r\\n', 'MS/Apple world\\r', 'of EOLS.\\...