INSTRUCTION
stringlengths
1
46.3k
RESPONSE
stringlengths
75
80.2k
Setter method for private_vlan, mapped from YANG variable /interface_vlan/interface/vlan/private_vlan (container) If this variable is read-only (config: false) in the source YANG file, then _set_private_vlan is considered as a private method. Backends looking to populate this variable should do so via c...
def _set_private_vlan(self, v, load=False): """ Setter method for private_vlan, mapped from YANG variable /interface_vlan/interface/vlan/private_vlan (container) If this variable is read-only (config: false) in the source YANG file, then _set_private_vlan is considered as a private method. Backends ...
Setter method for remote_span, mapped from YANG variable /interface_vlan/interface/vlan/remote_span (empty) If this variable is read-only (config: false) in the source YANG file, then _set_remote_span is considered as a private method. Backends looking to populate this variable should do so via calling ...
def _set_remote_span(self, v, load=False): """ Setter method for remote_span, mapped from YANG variable /interface_vlan/interface/vlan/remote_span (empty) If this variable is read-only (config: false) in the source YANG file, then _set_remote_span is considered as a private method. Backends looking ...
Setter method for exp_traffic_class, mapped from YANG variable /qos_mpls/map/exp_traffic_class (list) If this variable is read-only (config: false) in the source YANG file, then _set_exp_traffic_class is considered as a private method. Backends looking to populate this variable should do so via calling ...
def _set_exp_traffic_class(self, v, load=False): """ Setter method for exp_traffic_class, mapped from YANG variable /qos_mpls/map/exp_traffic_class (list) If this variable is read-only (config: false) in the source YANG file, then _set_exp_traffic_class is considered as a private method. Backends lo...
Setter method for traffic_class_exp, mapped from YANG variable /qos_mpls/map/traffic_class_exp (list) If this variable is read-only (config: false) in the source YANG file, then _set_traffic_class_exp is considered as a private method. Backends looking to populate this variable should do so via calling ...
def _set_traffic_class_exp(self, v, load=False): """ Setter method for traffic_class_exp, mapped from YANG variable /qos_mpls/map/traffic_class_exp (list) If this variable is read-only (config: false) in the source YANG file, then _set_traffic_class_exp is considered as a private method. Backends lo...
Setter method for exp_dscp, mapped from YANG variable /qos_mpls/map/exp_dscp (list) If this variable is read-only (config: false) in the source YANG file, then _set_exp_dscp is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_exp_dscp() dir...
def _set_exp_dscp(self, v, load=False): """ Setter method for exp_dscp, mapped from YANG variable /qos_mpls/map/exp_dscp (list) If this variable is read-only (config: false) in the source YANG file, then _set_exp_dscp is considered as a private method. Backends looking to populate this variable shou...
Setter method for dscp_exp, mapped from YANG variable /qos_mpls/map/dscp_exp (list) If this variable is read-only (config: false) in the source YANG file, then _set_dscp_exp is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_dscp_exp() dir...
def _set_dscp_exp(self, v, load=False): """ Setter method for dscp_exp, mapped from YANG variable /qos_mpls/map/dscp_exp (list) If this variable is read-only (config: false) in the source YANG file, then _set_dscp_exp is considered as a private method. Backends looking to populate this variable shou...
Setter method for inexp_outexp, mapped from YANG variable /qos_mpls/map/inexp_outexp (list) If this variable is read-only (config: false) in the source YANG file, then _set_inexp_outexp is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_in...
def _set_inexp_outexp(self, v, load=False): """ Setter method for inexp_outexp, mapped from YANG variable /qos_mpls/map/inexp_outexp (list) If this variable is read-only (config: false) in the source YANG file, then _set_inexp_outexp is considered as a private method. Backends looking to populate th...
Setter method for computation_mode, mapped from YANG variable /mpls_state/lsp/frr/computation_mode (lsp-cspf-computation-mode) If this variable is read-only (config: false) in the source YANG file, then _set_computation_mode is considered as a private method. Backends looking to populate this variable shoul...
def _set_computation_mode(self, v, load=False): """ Setter method for computation_mode, mapped from YANG variable /mpls_state/lsp/frr/computation_mode (lsp-cspf-computation-mode) If this variable is read-only (config: false) in the source YANG file, then _set_computation_mode is considered as a private ...
Setter method for map_apply, mapped from YANG variable /qos_mpls/map_apply (container) If this variable is read-only (config: false) in the source YANG file, then _set_map_apply is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_map_apply(...
def _set_map_apply(self, v, load=False): """ Setter method for map_apply, mapped from YANG variable /qos_mpls/map_apply (container) If this variable is read-only (config: false) in the source YANG file, then _set_map_apply is considered as a private method. Backends looking to populate this variable...
Setter method for domain_name, mapped from YANG variable /protocol/cfm/domain_name (list) If this variable is read-only (config: false) in the source YANG file, then _set_domain_name is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_domai...
def _set_domain_name(self, v, load=False): """ Setter method for domain_name, mapped from YANG variable /protocol/cfm/domain_name (list) If this variable is read-only (config: false) in the source YANG file, then _set_domain_name is considered as a private method. Backends looking to populate this v...
A wrapper for the the entire SomaticSniper sub-graph. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict normal_bam: Dict of bam and bai for normal DNA-Seq :param dict univ_options: Dict of universal options used by almost all tools :param dict somaticsniper_options: Options speci...
def run_somaticsniper_with_merge(job, tumor_bam, normal_bam, univ_options, somaticsniper_options): """ A wrapper for the the entire SomaticSniper sub-graph. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict normal_bam: Dict of bam and bai for normal DNA-Seq :param dict univ_o...
Run the SomaticSniper subgraph on the DNA bams. Optionally split the results into per-chromosome vcfs. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict normal_bam: Dict of bam and bai for normal DNA-Seq :param dict univ_options: Dict of universal options used by almost all tool...
def run_somaticsniper(job, tumor_bam, normal_bam, univ_options, somaticsniper_options, split=True): """ Run the SomaticSniper subgraph on the DNA bams. Optionally split the results into per-chromosome vcfs. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict normal_bam: Dict o...
Run SomaticSniper on the DNA bams. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict normal_bam: Dict of bam and bai for normal DNA-Seq :param dict univ_options: Dict of universal options used by almost all tools :param dict somaticsniper_options: Options specific to SomaticSnipe...
def run_somaticsniper_full(job, tumor_bam, normal_bam, univ_options, somaticsniper_options): """ Run SomaticSniper on the DNA bams. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict normal_bam: Dict of bam and bai for normal DNA-Seq :param dict univ_options: Dict of universal...
Filter SomaticSniper calls. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param toil.fileStore.FileID somaticsniper_output: SomaticSniper output vcf :param toil.fileStore.FileID tumor_pileup: Pileup generated for the tumor bam :param dict univ_options: Dict of universal options used by ...
def filter_somaticsniper(job, tumor_bam, somaticsniper_output, tumor_pileup, univ_options, somaticsniper_options): """ Filter SomaticSniper calls. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param toil.fileStore.FileID somaticsniper_output: SomaticSniper outpu...
Runs a samtools pileup on the tumor bam. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict univ_options: Dict of universal options used by almost all tools :param dict somaticsniper_options: Options specific to SomaticSniper :return: fsID for the pileup file :rtype: toil.file...
def run_pileup(job, tumor_bam, univ_options, somaticsniper_options): """ Runs a samtools pileup on the tumor bam. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict univ_options: Dict of universal options used by almost all tools :param dict somaticsniper_options: Options spec...
Get an action cache key string.
def get_action_cache_key(name, argument): """Get an action cache key string.""" tokens = [str(name)] if argument: tokens.append(str(argument)) return '::'.join(tokens)
Remove the action from cache when an item is inserted or deleted.
def removed_or_inserted_action(mapper, connection, target): """Remove the action from cache when an item is inserted or deleted.""" current_access.delete_action_cache(get_action_cache_key(target.action, target.argument))
Remove the action from cache when an item is updated.
def changed_action(mapper, connection, target): """Remove the action from cache when an item is updated.""" action_history = get_history(target, 'action') argument_history = get_history(target, 'argument') owner_history = get_history( target, 'user' if isinstance(target, ActionUsers) els...
Create new database row using the provided action need. :param action: An object containing a method equal to ``'action'`` and a value. :param argument: The action argument. If this parameter is not passed, then the ``action.argument`` will be used instead. If the ``...
def create(cls, action, **kwargs): """Create new database row using the provided action need. :param action: An object containing a method equal to ``'action'`` and a value. :param argument: The action argument. If this parameter is not passed, then the ``action.argument...
Allow the given action need. :param action: The action to allow. :returns: A :class:`invenio_access.models.ActionNeedMixin` instance.
def allow(cls, action, **kwargs): """Allow the given action need. :param action: The action to allow. :returns: A :class:`invenio_access.models.ActionNeedMixin` instance. """ return cls.create(action, exclude=False, **kwargs)
Deny the given action need. :param action: The action to deny. :returns: A :class:`invenio_access.models.ActionNeedMixin` instance.
def deny(cls, action, **kwargs): """Deny the given action need. :param action: The action to deny. :returns: A :class:`invenio_access.models.ActionNeedMixin` instance. """ return cls.create(action, exclude=True, **kwargs)
Prepare query object with filtered action. :param action: The action to deny. :param argument: The action argument. If it's ``None`` then, if exists, the ``action.argument`` will be taken. In the worst case will be set as ``None``. (Default: ``None``) :returns: A query o...
def query_by_action(cls, action, argument=None): """Prepare query object with filtered action. :param action: The action to deny. :param argument: The action argument. If it's ``None`` then, if exists, the ``action.argument`` will be taken. In the worst case will be set ...
Create new database row using the provided action need.
def create(cls, action, **kwargs): """Create new database row using the provided action need.""" role = kwargs.pop('role', None) if role: assert role.method == 'system_role' kwargs['role_name'] = role.value return super(ActionSystemRoles, cls).create(action, **kwa...
Setter method for bna_config_cmd, mapped from YANG variable /brocade_ras_rpc/bna_config_cmd (rpc) If this variable is read-only (config: false) in the source YANG file, then _set_bna_config_cmd is considered as a private method. Backends looking to populate this variable should do so via calling thisObj...
def _set_bna_config_cmd(self, v, load=False): """ Setter method for bna_config_cmd, mapped from YANG variable /brocade_ras_rpc/bna_config_cmd (rpc) If this variable is read-only (config: false) in the source YANG file, then _set_bna_config_cmd is considered as a private method. Backends looking to p...
Setter method for show_cluster_mem_bd, mapped from YANG variable /mct_l2ys_state/show_cluster_mem_bd (container) If this variable is read-only (config: false) in the source YANG file, then _set_show_cluster_mem_bd is considered as a private method. Backends looking to populate this variable should do so...
def _set_show_cluster_mem_bd(self, v, load=False): """ Setter method for show_cluster_mem_bd, mapped from YANG variable /mct_l2ys_state/show_cluster_mem_bd (container) If this variable is read-only (config: false) in the source YANG file, then _set_show_cluster_mem_bd is considered as a private meth...
Setter method for master_vlan, mapped from YANG variable /topology_group_state/topology_group_data/master_vlan (container) If this variable is read-only (config: false) in the source YANG file, then _set_master_vlan is considered as a private method. Backends looking to populate this variable should do ...
def _set_master_vlan(self, v, load=False): """ Setter method for master_vlan, mapped from YANG variable /topology_group_state/topology_group_data/master_vlan (container) If this variable is read-only (config: false) in the source YANG file, then _set_master_vlan is considered as a private method. Ba...
Setter method for redistribute_connected, mapped from YANG variable /rbridge_id/ipv6/router/ospf/redistribute/redistribute_connected (container) If this variable is read-only (config: false) in the source YANG file, then _set_redistribute_connected is considered as a private method. Backends looking to popu...
def _set_redistribute_connected(self, v, load=False): """ Setter method for redistribute_connected, mapped from YANG variable /rbridge_id/ipv6/router/ospf/redistribute/redistribute_connected (container) If this variable is read-only (config: false) in the source YANG file, then _set_redistribute_connect...
Setter method for redistribute_static, mapped from YANG variable /rbridge_id/ipv6/router/ospf/redistribute/redistribute_static (container) If this variable is read-only (config: false) in the source YANG file, then _set_redistribute_static is considered as a private method. Backends looking to populate this...
def _set_redistribute_static(self, v, load=False): """ Setter method for redistribute_static, mapped from YANG variable /rbridge_id/ipv6/router/ospf/redistribute/redistribute_static (container) If this variable is read-only (config: false) in the source YANG file, then _set_redistribute_static is consid...
Setter method for redistribute_bgp, mapped from YANG variable /rbridge_id/ipv6/router/ospf/redistribute/redistribute_bgp (container) If this variable is read-only (config: false) in the source YANG file, then _set_redistribute_bgp is considered as a private method. Backends looking to populate this variable...
def _set_redistribute_bgp(self, v, load=False): """ Setter method for redistribute_bgp, mapped from YANG variable /rbridge_id/ipv6/router/ospf/redistribute/redistribute_bgp (container) If this variable is read-only (config: false) in the source YANG file, then _set_redistribute_bgp is considered as a pr...
Predict binding for each peptide in `peptfile` to `allele` using the IEDB mhci binding prediction tool. :param toil.fileStore.FileID peptfile: The input peptide fasta :param str allele: Allele to predict binding against :param str peplen: Length of peptides to process :param dict univ_options: Dict...
def predict_mhci_binding(job, peptfile, allele, peplen, univ_options, mhci_options): """ Predict binding for each peptide in `peptfile` to `allele` using the IEDB mhci binding prediction tool. :param toil.fileStore.FileID peptfile: The input peptide fasta :param str allele: Allele to predict bindin...
Setter method for redistribute_ospf, mapped from YANG variable /rbridge_id/ipv6/router/ospf/redistribute/redistribute_ospf (container) If this variable is read-only (config: false) in the source YANG file, then _set_redistribute_ospf is considered as a private method. Backends looking to populate this varia...
def _set_redistribute_ospf(self, v, load=False): """ Setter method for redistribute_ospf, mapped from YANG variable /rbridge_id/ipv6/router/ospf/redistribute/redistribute_ospf (container) If this variable is read-only (config: false) in the source YANG file, then _set_redistribute_ospf is considered as ...
Setter method for throttle, mapped from YANG variable /rbridge_id/router/ospf/timers/throttle (container) If this variable is read-only (config: false) in the source YANG file, then _set_throttle is considered as a private method. Backends looking to populate this variable should do so via calling thisO...
def _set_throttle(self, v, load=False): """ Setter method for throttle, mapped from YANG variable /rbridge_id/router/ospf/timers/throttle (container) If this variable is read-only (config: false) in the source YANG file, then _set_throttle is considered as a private method. Backends looking to popul...
Setter method for private_vlan_trunk, mapped from YANG variable /interface/port_channel/switchport/mode/private_vlan/private_vlan_trunk (container) If this variable is read-only (config: false) in the source YANG file, then _set_private_vlan_trunk is considered as a private method. Backends looking to popul...
def _set_private_vlan_trunk(self, v, load=False): """ Setter method for private_vlan_trunk, mapped from YANG variable /interface/port_channel/switchport/mode/private_vlan/private_vlan_trunk (container) If this variable is read-only (config: false) in the source YANG file, then _set_private_vlan_trunk is...
Setter method for cngn_mon_dev, mapped from YANG variable /tm_state/cngn_mon_dev (container) If this variable is read-only (config: false) in the source YANG file, then _set_cngn_mon_dev is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_c...
def _set_cngn_mon_dev(self, v, load=False): """ Setter method for cngn_mon_dev, mapped from YANG variable /tm_state/cngn_mon_dev (container) If this variable is read-only (config: false) in the source YANG file, then _set_cngn_mon_dev is considered as a private method. Backends looking to populate t...
Setter method for cngn_mon_voq, mapped from YANG variable /tm_state/cngn_mon_voq (container) If this variable is read-only (config: false) in the source YANG file, then _set_cngn_mon_voq is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_c...
def _set_cngn_mon_voq(self, v, load=False): """ Setter method for cngn_mon_voq, mapped from YANG variable /tm_state/cngn_mon_voq (container) If this variable is read-only (config: false) in the source YANG file, then _set_cngn_mon_voq is considered as a private method. Backends looking to populate t...
Setter method for cngn_mon_del_pkt, mapped from YANG variable /tm_state/cngn_mon_del_pkt (container) If this variable is read-only (config: false) in the source YANG file, then _set_cngn_mon_del_pkt is considered as a private method. Backends looking to populate this variable should do so via calling th...
def _set_cngn_mon_del_pkt(self, v, load=False): """ Setter method for cngn_mon_del_pkt, mapped from YANG variable /tm_state/cngn_mon_del_pkt (container) If this variable is read-only (config: false) in the source YANG file, then _set_cngn_mon_del_pkt is considered as a private method. Backends looki...
Setter method for ignore_delete_all_response, mapped from YANG variable /vcenter/discovery/ignore_delete_all_response (container) If this variable is read-only (config: false) in the source YANG file, then _set_ignore_delete_all_response is considered as a private method. Backends looking to populate this v...
def _set_ignore_delete_all_response(self, v, load=False): """ Setter method for ignore_delete_all_response, mapped from YANG variable /vcenter/discovery/ignore_delete_all_response (container) If this variable is read-only (config: false) in the source YANG file, then _set_ignore_delete_all_response is c...
Setter method for map_, mapped from YANG variable /overlay_gateway/map (container) If this variable is read-only (config: false) in the source YANG file, then _set_map_ is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_map_() directly.
def _set_map_(self, v, load=False): """ Setter method for map_, mapped from YANG variable /overlay_gateway/map (container) If this variable is read-only (config: false) in the source YANG file, then _set_map_ is considered as a private method. Backends looking to populate this variable should do...
Setter method for gw_type, mapped from YANG variable /overlay_gateway/gw_type (overlay-gw-type) If this variable is read-only (config: false) in the source YANG file, then _set_gw_type is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_gw_...
def _set_gw_type(self, v, load=False): """ Setter method for gw_type, mapped from YANG variable /overlay_gateway/gw_type (overlay-gw-type) If this variable is read-only (config: false) in the source YANG file, then _set_gw_type is considered as a private method. Backends looking to populate this var...
Setter method for overlay_service_policy, mapped from YANG variable /overlay_gateway/overlay_service_policy (container) If this variable is read-only (config: false) in the source YANG file, then _set_overlay_service_policy is considered as a private method. Backends looking to populate this variable should...
def _set_overlay_service_policy(self, v, load=False): """ Setter method for overlay_service_policy, mapped from YANG variable /overlay_gateway/overlay_service_policy (container) If this variable is read-only (config: false) in the source YANG file, then _set_overlay_service_policy is considered as a pri...
Setter method for nd_global, mapped from YANG variable /ipv6/ipv6_global_cmds/nd_global (container) If this variable is read-only (config: false) in the source YANG file, then _set_nd_global is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._s...
def _set_nd_global(self, v, load=False): """ Setter method for nd_global, mapped from YANG variable /ipv6/ipv6_global_cmds/nd_global (container) If this variable is read-only (config: false) in the source YANG file, then _set_nd_global is considered as a private method. Backends looking to populate ...
Setter method for error_disable_timeout, mapped from YANG variable /protocol/spanning_tree/rpvst/error_disable_timeout (container) If this variable is read-only (config: false) in the source YANG file, then _set_error_disable_timeout is considered as a private method. Backends looking to populate this varia...
def _set_error_disable_timeout(self, v, load=False): """ Setter method for error_disable_timeout, mapped from YANG variable /protocol/spanning_tree/rpvst/error_disable_timeout (container) If this variable is read-only (config: false) in the source YANG file, then _set_error_disable_timeout is considered...
Setter method for port_channel, mapped from YANG variable /protocol/spanning_tree/rpvst/port_channel (container) If this variable is read-only (config: false) in the source YANG file, then _set_port_channel is considered as a private method. Backends looking to populate this variable should do so via ca...
def _set_port_channel(self, v, load=False): """ Setter method for port_channel, mapped from YANG variable /protocol/spanning_tree/rpvst/port_channel (container) If this variable is read-only (config: false) in the source YANG file, then _set_port_channel is considered as a private method. Backends l...
Yield file contents by block then close the file.
def iter_and_close(file_like, block_size): """Yield file contents by block then close the file.""" while 1: try: block = file_like.read(block_size) if block: yield block else: raise StopIteration except StopIteration: ...
Return a Cling that serves from the given package and dir_name. This uses pkg_resources.resource_filename which is not the recommended way, since it extracts the files. I think this works fine unless you have some _very_ serious requirements for static content, in which case you probably shouldn't...
def cling_wrap(package_name, dir_name, **kw): """Return a Cling that serves from the given package and dir_name. This uses pkg_resources.resource_filename which is not the recommended way, since it extracts the files. I think this works fine unless you have some _very_ serious requirements for sta...
Guard against arbitrary file retrieval.
def _is_under_root(self, full_path): """Guard against arbitrary file retrieval.""" if (path.abspath(full_path) + path.sep)\ .startswith(path.abspath(self.root) + path.sep): return True else: return False
Return a tuple of etag, last_modified by mtime from stat.
def _conditions(self, full_path, environ): """Return a tuple of etag, last_modified by mtime from stat.""" mtime = stat(full_path).st_mtime return str(mtime), rfc822.formatdate(mtime)
Return an iterator over the body of the response.
def _body(self, full_path, environ, file_like): """Return an iterator over the body of the response.""" way_to_send = environ.get('wsgi.file_wrapper', iter_and_close) return way_to_send(file_like, self.block_size)
Return the first magic that matches this path or None.
def _match_magic(self, full_path): """Return the first magic that matches this path or None.""" for magic in self.magics: if magic.matches(full_path): return magic
Return the full path from which to read.
def _full_path(self, path_info): """Return the full path from which to read.""" full_path = self.root + path_info if path.exists(full_path): return full_path else: for magic in self.magics: if path.exists(magic.new_path(full_path)): ...
Guess the mime type magically or using the mimetypes module.
def _guess_type(self, full_path): """Guess the mime type magically or using the mimetypes module.""" magic = self._match_magic(full_path) if magic is not None: return (mimetypes.guess_type(magic.old_path(full_path))[0] or 'text/plain') else: re...
Return Etag and Last-Modified values defaults to now for both.
def _conditions(self, full_path, environ): """Return Etag and Last-Modified values defaults to now for both.""" magic = self._match_magic(full_path) if magic is not None: return magic.conditions(full_path, environ) else: mtime = stat(full_path).st_mtime ...
Return the appropriate file object.
def _file_like(self, full_path): """Return the appropriate file object.""" magic = self._match_magic(full_path) if magic is not None: return magic.file_like(full_path, self.encoding) else: return open(full_path, 'rb')
Return an iterator over the body of the response.
def _body(self, full_path, environ, file_like): """Return an iterator over the body of the response.""" magic = self._match_magic(full_path) if magic is not None: return [_encode(s, self.encoding) for s in magic.body(environ, ...
Check that self.new_path(full_path) exists.
def exists(self, full_path): """Check that self.new_path(full_path) exists.""" if path.exists(self.new_path(full_path)): return self.new_path(full_path)
Remove self.extension from path or raise MagicError.
def old_path(self, full_path): """Remove self.extension from path or raise MagicError.""" if self.matches(full_path): return full_path[:-len(self.extension)] else: raise MagicError("Path does not match this magic.")
Return Etag and Last-Modified values (based on mtime).
def conditions(self, full_path, environ): """Return Etag and Last-Modified values (based on mtime).""" mtime = int(time.time()) return str(mtime), rfc822.formatdate(mtime)
Pass environ and self.variables in to template. self.variables overrides environ so that suprises in environ don't cause unexpected output if you are passing a value in explicitly.
def body(self, environ, file_like): """Pass environ and self.variables in to template. self.variables overrides environ so that suprises in environ don't cause unexpected output if you are passing a value in explicitly. """ variables = environ.copy() variables.update(sel...
Pass environ and **self.variables into the template.
def body(self, environ, full_path): """Pass environ and **self.variables into the template.""" template = kid.Template(file=full_path, environ=environ, **self.variables) return [template.serialize()]
Pass environ and **self.variables into the template.
def body(self, environ, full_path): """Pass environ and **self.variables into the template.""" template = MarkupTemplate(full_path.read()) variables = self.variables.copy() variables["environ"] = environ return [template.generate(**variables) .render('html', doct...
Setter method for route_target_evpn, mapped from YANG variable /vrf/address_family/ipv6/unicast/route_target_container_ipv6/route_target_evpn (list) If this variable is read-only (config: false) in the source YANG file, then _set_route_target_evpn is considered as a private method. Backends looking to popul...
def _set_route_target_evpn(self, v, load=False): """ Setter method for route_target_evpn, mapped from YANG variable /vrf/address_family/ipv6/unicast/route_target_container_ipv6/route_target_evpn (list) If this variable is read-only (config: false) in the source YANG file, then _set_route_target_evpn is ...
Get current market rate for currency
def get_rate_for(self, currency: str, to: str, reverse: bool=False) -> Number: """Get current market rate for currency""" # Return 1 when currencies match if currency.upper() == to.upper(): return self._format_number('1.0') # Set base and quote currencies base, quot...
Convert amount to another currency
def convert(self, amount: Number, currency: str, to: str, reverse: bool=False) -> Number: """Convert amount to another currency""" rate = self.get_rate_for(currency, to, reverse) if self.return_decimal: amount = Decimal(amount) return amount * rate
Convert money to another currency
def convert_money(self, money: Money, to: str, reverse: bool=False) -> Money: """Convert money to another currency""" converted = self.convert(money.amount, money.currency, to, reverse) return Money(converted, to)
Setter method for aggregate_ipv6_address, mapped from YANG variable /rbridge_id/router/router_bgp/address_family/ipv6/ipv6_unicast/af_ipv6_vrf/aggregate_ipv6_address (list) If this variable is read-only (config: false) in the source YANG file, then _set_aggregate_ipv6_address is considered as a private meth...
def _set_aggregate_ipv6_address(self, v, load=False): """ Setter method for aggregate_ipv6_address, mapped from YANG variable /rbridge_id/router/router_bgp/address_family/ipv6/ipv6_unicast/af_ipv6_vrf/aggregate_ipv6_address (list) If this variable is read-only (config: false) in the source YANG file, th...
Setter method for intf_router_isis, mapped from YANG variable /routing_system/interface/loopback/ip/intf_router_isis (container) If this variable is read-only (config: false) in the source YANG file, then _set_intf_router_isis is considered as a private method. Backends looking to populate this variable sho...
def _set_intf_router_isis(self, v, load=False): """ Setter method for intf_router_isis, mapped from YANG variable /routing_system/interface/loopback/ip/intf_router_isis (container) If this variable is read-only (config: false) in the source YANG file, then _set_intf_router_isis is considered as a privat...
Setter method for interface_loopback_ospf_conf, mapped from YANG variable /routing_system/interface/loopback/ip/interface_loopback_ospf_conf (container) If this variable is read-only (config: false) in the source YANG file, then _set_interface_loopback_ospf_conf is considered as a private method. Backends l...
def _set_interface_loopback_ospf_conf(self, v, load=False): """ Setter method for interface_loopback_ospf_conf, mapped from YANG variable /routing_system/interface/loopback/ip/interface_loopback_ospf_conf (container) If this variable is read-only (config: false) in the source YANG file, then _set_interf...
Setter method for pim_intf_loopback_cont, mapped from YANG variable /routing_system/interface/loopback/ip/pim_intf_loopback_cont (container) If this variable is read-only (config: false) in the source YANG file, then _set_pim_intf_loopback_cont is considered as a private method. Backends looking to populate...
def _set_pim_intf_loopback_cont(self, v, load=False): """ Setter method for pim_intf_loopback_cont, mapped from YANG variable /routing_system/interface/loopback/ip/pim_intf_loopback_cont (container) If this variable is read-only (config: false) in the source YANG file, then _set_pim_intf_loopback_cont i...
Setter method for key, mapped from YANG variable /rbridge_id/crypto/key (list) If this variable is read-only (config: false) in the source YANG file, then _set_key is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_key() directly.
def _set_key(self, v, load=False): """ Setter method for key, mapped from YANG variable /rbridge_id/crypto/key (list) If this variable is read-only (config: false) in the source YANG file, then _set_key is considered as a private method. Backends looking to populate this variable should do so vi...
Setter method for ca, mapped from YANG variable /rbridge_id/crypto/ca (list) If this variable is read-only (config: false) in the source YANG file, then _set_ca is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_ca() directly.
def _set_ca(self, v, load=False): """ Setter method for ca, mapped from YANG variable /rbridge_id/crypto/ca (list) If this variable is read-only (config: false) in the source YANG file, then _set_ca is considered as a private method. Backends looking to populate this variable should do so via ca...
Setter method for red_profile_ecn, mapped from YANG variable /qos/ecn/red_profile/red_profile_ecn (container) If this variable is read-only (config: false) in the source YANG file, then _set_red_profile_ecn is considered as a private method. Backends looking to populate this variable should do so via ca...
def _set_red_profile_ecn(self, v, load=False): """ Setter method for red_profile_ecn, mapped from YANG variable /qos/ecn/red_profile/red_profile_ecn (container) If this variable is read-only (config: false) in the source YANG file, then _set_red_profile_ecn is considered as a private method. Backend...
Clear Screen
def clear(self): """ Clear Screen """ w1 = StringWidget(self, ref="_w1_", text=" "*20, x=1, y=1) w2 = StringWidget(self, ref="_w2_", text=" "*20, x=1, y=2) w3 = StringWidget(self, ref="_w3_", text=" "*20, x=1, y=3) w4 = StringWidget(self, ref="_w4_", text=" "*20...
Add Icon Widget
def add_icon_widget(self, ref, x=1, y=1, name="heart"): """ Add Icon Widget """ if ref not in self.widgets: widget = IconWidget(screen=self, ref=ref, x=x, y=y, name=name) self.widgets[ref] = widget return self.widgets[ref]
Add Scroller Widget
def add_scroller_widget(self, ref, left=1, top=1, right=20, bottom=1, direction="h", speed=1, text="Message"): """ Add Scroller Widget """ if ref not in self.widgets: widget = ScrollerWidget(screen=self, ref=ref, left=left, top=top, right=right, bottom=bottom, direc...
Setter method for mem_list, mapped from YANG variable /mem_state/mem_list (container) If this variable is read-only (config: false) in the source YANG file, then _set_mem_list is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_mem_list() d...
def _set_mem_list(self, v, load=False): """ Setter method for mem_list, mapped from YANG variable /mem_state/mem_list (container) If this variable is read-only (config: false) in the source YANG file, then _set_mem_list is considered as a private method. Backends looking to populate this variable sh...
Setter method for alternate_as, mapped from YANG variable /rbridge_id/router/router_bgp/router_bgp_attributes/neighbor/peer_grps/neighbor_peer_grp/alternate_as (container) If this variable is read-only (config: false) in the source YANG file, then _set_alternate_as is considered as a private method. Backend...
def _set_alternate_as(self, v, load=False): """ Setter method for alternate_as, mapped from YANG variable /rbridge_id/router/router_bgp/router_bgp_attributes/neighbor/peer_grps/neighbor_peer_grp/alternate_as (container) If this variable is read-only (config: false) in the source YANG file, then _set_alt...
Setter method for af_neighbor_capability, mapped from YANG variable /rbridge_id/router/router_bgp/router_bgp_attributes/neighbor/peer_grps/neighbor_peer_grp/af_neighbor_capability (container) If this variable is read-only (config: false) in the source YANG file, then _set_af_neighbor_capability is considered as...
def _set_af_neighbor_capability(self, v, load=False): """ Setter method for af_neighbor_capability, mapped from YANG variable /rbridge_id/router/router_bgp/router_bgp_attributes/neighbor/peer_grps/neighbor_peer_grp/af_neighbor_capability (container) If this variable is read-only (config: false) in the s...
Setter method for fabric_isl, mapped from YANG variable /interface/fortygigabitethernet/fabric/fabric_isl (container) If this variable is read-only (config: false) in the source YANG file, then _set_fabric_isl is considered as a private method. Backends looking to populate this variable should do so via...
def _set_fabric_isl(self, v, load=False): """ Setter method for fabric_isl, mapped from YANG variable /interface/fortygigabitethernet/fabric/fabric_isl (container) If this variable is read-only (config: false) in the source YANG file, then _set_fabric_isl is considered as a private method. Backends ...
Setter method for fabric_trunk, mapped from YANG variable /interface/fortygigabitethernet/fabric/fabric_trunk (container) If this variable is read-only (config: false) in the source YANG file, then _set_fabric_trunk is considered as a private method. Backends looking to populate this variable should do ...
def _set_fabric_trunk(self, v, load=False): """ Setter method for fabric_trunk, mapped from YANG variable /interface/fortygigabitethernet/fabric/fabric_trunk (container) If this variable is read-only (config: false) in the source YANG file, then _set_fabric_trunk is considered as a private method. B...
Setter method for neighbor_discovery, mapped from YANG variable /interface/fortygigabitethernet/fabric/neighbor_discovery (container) If this variable is read-only (config: false) in the source YANG file, then _set_neighbor_discovery is considered as a private method. Backends looking to populate this varia...
def _set_neighbor_discovery(self, v, load=False): """ Setter method for neighbor_discovery, mapped from YANG variable /interface/fortygigabitethernet/fabric/neighbor_discovery (container) If this variable is read-only (config: false) in the source YANG file, then _set_neighbor_discovery is considered as...
Setter method for source, mapped from YANG variable /acl_mirror/source (list) If this variable is read-only (config: false) in the source YANG file, then _set_source is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_source() directly.
def _set_source(self, v, load=False): """ Setter method for source, mapped from YANG variable /acl_mirror/source (list) If this variable is read-only (config: false) in the source YANG file, then _set_source is considered as a private method. Backends looking to populate this variable should do ...
Setter method for learning_mode, mapped from YANG variable /mac_address_table/learning_mode (enumeration) If this variable is read-only (config: false) in the source YANG file, then _set_learning_mode is considered as a private method. Backends looking to populate this variable should do so via calling ...
def _set_learning_mode(self, v, load=False): """ Setter method for learning_mode, mapped from YANG variable /mac_address_table/learning_mode (enumeration) If this variable is read-only (config: false) in the source YANG file, then _set_learning_mode is considered as a private method. Backends lookin...
Setter method for mac_move, mapped from YANG variable /mac_address_table/mac_move (container) If this variable is read-only (config: false) in the source YANG file, then _set_mac_move is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_mac_...
def _set_mac_move(self, v, load=False): """ Setter method for mac_move, mapped from YANG variable /mac_address_table/mac_move (container) If this variable is read-only (config: false) in the source YANG file, then _set_mac_move is considered as a private method. Backends looking to populate this var...
Returns application installation path. .. note:: If fails this falls back to a restricted interface, which can only be used by approved apps. :rtype: str
def install_dir(self): """Returns application installation path. .. note:: If fails this falls back to a restricted interface, which can only be used by approved apps. :rtype: str """ max_len = 500 directory = self._get_str(self._iface.get_install_dir, [se...
Date and time of app purchase. :rtype: datetime
def purchase_time(self): """Date and time of app purchase. :rtype: datetime """ ts = self._iface.get_purchase_time(self.app_id) return datetime.utcfromtimestamp(ts)
Returns tuple with download progress (for optional DLCs): (bytes_downloaded, bytes_total) :rtype: tuple
def get_download_progress(self): """Returns tuple with download progress (for optional DLCs): (bytes_downloaded, bytes_total) :rtype: tuple """ downloaded = CRef.cint() total = CRef.cint() result = self._iface.get_dlc_download_progress(self.app_id, download...
Setter method for protocol_type, mapped from YANG variable /mpls_state/ldp/tunnels/ldp_tunnels/protocol_type (mpls-protocol-type) If this variable is read-only (config: false) in the source YANG file, then _set_protocol_type is considered as a private method. Backends looking to populate this variable shoul...
def _set_protocol_type(self, v, load=False): """ Setter method for protocol_type, mapped from YANG variable /mpls_state/ldp/tunnels/ldp_tunnels/protocol_type (mpls-protocol-type) If this variable is read-only (config: false) in the source YANG file, then _set_protocol_type is considered as a private ...
Setter method for engineID, mapped from YANG variable /rbridge_id/snmp_server/engineID (container) If this variable is read-only (config: false) in the source YANG file, then _set_engineID is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set...
def _set_engineID(self, v, load=False): """ Setter method for engineID, mapped from YANG variable /rbridge_id/snmp_server/engineID (container) If this variable is read-only (config: false) in the source YANG file, then _set_engineID is considered as a private method. Backends looking to populate thi...
Setter method for offline_if, mapped from YANG variable /rbridge_id/snmp_server/offline_if (container) If this variable is read-only (config: false) in the source YANG file, then _set_offline_if is considered as a private method. Backends looking to populate this variable should do so via calling thisOb...
def _set_offline_if(self, v, load=False): """ Setter method for offline_if, mapped from YANG variable /rbridge_id/snmp_server/offline_if (container) If this variable is read-only (config: false) in the source YANG file, then _set_offline_if is considered as a private method. Backends looking to popu...
Setter method for three_tuple_if, mapped from YANG variable /rbridge_id/snmp_server/three_tuple_if (container) If this variable is read-only (config: false) in the source YANG file, then _set_three_tuple_if is considered as a private method. Backends looking to populate this variable should do so via ca...
def _set_three_tuple_if(self, v, load=False): """ Setter method for three_tuple_if, mapped from YANG variable /rbridge_id/snmp_server/three_tuple_if (container) If this variable is read-only (config: false) in the source YANG file, then _set_three_tuple_if is considered as a private method. Backends...
Setter method for ldp_out, mapped from YANG variable /mpls_state/ldp/ldp_out (container) If this variable is read-only (config: false) in the source YANG file, then _set_ldp_out is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_ldp_out() ...
def _set_ldp_out(self, v, load=False): """ Setter method for ldp_out, mapped from YANG variable /mpls_state/ldp/ldp_out (container) If this variable is read-only (config: false) in the source YANG file, then _set_ldp_out is considered as a private method. Backends looking to populate this variable s...
Setter method for port, mapped from YANG variable /qos/cpu/slot/port_group/port (container) If this variable is read-only (config: false) in the source YANG file, then _set_port is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_port() dir...
def _set_port(self, v, load=False): """ Setter method for port, mapped from YANG variable /qos/cpu/slot/port_group/port (container) If this variable is read-only (config: false) in the source YANG file, then _set_port is considered as a private method. Backends looking to populate this variable shou...
Setter method for group, mapped from YANG variable /qos/cpu/slot/port_group/group (list) If this variable is read-only (config: false) in the source YANG file, then _set_group is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_group() dire...
def _set_group(self, v, load=False): """ Setter method for group, mapped from YANG variable /qos/cpu/slot/port_group/group (list) If this variable is read-only (config: false) in the source YANG file, then _set_group is considered as a private method. Backends looking to populate this variable shoul...
Setter method for port_to_port_profile_domain_association, mapped from YANG variable /interface/port_channel/port_profile_to_interface_associations/port_profile_port/port_to_port_profile_domain_association (container) If this variable is read-only (config: false) in the source YANG file, then _set_port_to_port_...
def _set_port_to_port_profile_domain_association(self, v, load=False): """ Setter method for port_to_port_profile_domain_association, mapped from YANG variable /interface/port_channel/port_profile_to_interface_associations/port_profile_port/port_to_port_profile_domain_association (container) If this variabl...
Setter method for context, mapped from YANG variable /snmp_server/context (list) If this variable is read-only (config: false) in the source YANG file, then _set_context is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_context() directly...
def _set_context(self, v, load=False): """ Setter method for context, mapped from YANG variable /snmp_server/context (list) If this variable is read-only (config: false) in the source YANG file, then _set_context is considered as a private method. Backends looking to populate this variable should ...
Setter method for port_to_port_profile_associations, mapped from YANG variable /interface/port_channel/port_profile_to_interface_associations/port_profile_port/port_to_port_profile_associations (list) If this variable is read-only (config: false) in the source YANG file, then _set_port_to_port_profile_associati...
def _set_port_to_port_profile_associations(self, v, load=False): """ Setter method for port_to_port_profile_associations, mapped from YANG variable /interface/port_channel/port_profile_to_interface_associations/port_profile_port/port_to_port_profile_associations (list) If this variable is read-only (config:...
Setter method for community, mapped from YANG variable /snmp_server/community (list) If this variable is read-only (config: false) in the source YANG file, then _set_community is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_community() ...
def _set_community(self, v, load=False): """ Setter method for community, mapped from YANG variable /snmp_server/community (list) If this variable is read-only (config: false) in the source YANG file, then _set_community is considered as a private method. Backends looking to populate this variable s...
Setter method for host, mapped from YANG variable /snmp_server/host (list) If this variable is read-only (config: false) in the source YANG file, then _set_host is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_host() directly.
def _set_host(self, v, load=False): """ Setter method for host, mapped from YANG variable /snmp_server/host (list) If this variable is read-only (config: false) in the source YANG file, then _set_host is considered as a private method. Backends looking to populate this variable should do so via ...
Setter method for view, mapped from YANG variable /snmp_server/view (list) If this variable is read-only (config: false) in the source YANG file, then _set_view is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_view() directly.
def _set_view(self, v, load=False): """ Setter method for view, mapped from YANG variable /snmp_server/view (list) If this variable is read-only (config: false) in the source YANG file, then _set_view is considered as a private method. Backends looking to populate this variable should do so via ...
Setter method for network, mapped from YANG variable /routing_system/interface/ve/ipv6/interface_ospfv3_conf/network (enumeration) If this variable is read-only (config: false) in the source YANG file, then _set_network is considered as a private method. Backends looking to populate this variable should ...
def _set_network(self, v, load=False): """ Setter method for network, mapped from YANG variable /routing_system/interface/ve/ipv6/interface_ospfv3_conf/network (enumeration) If this variable is read-only (config: false) in the source YANG file, then _set_network is considered as a private method. Ba...