INSTRUCTION
stringlengths
1
46.3k
RESPONSE
stringlengths
75
80.2k
Setter method for intf_type, mapped from YANG variable /logical_interface_state/main_interface_physical/intf_type (intf-type) If this variable is read-only (config: false) in the source YANG file, then _set_intf_type is considered as a private method. Backends looking to populate this variable should do...
def _set_intf_type(self, v, load=False): """ Setter method for intf_type, mapped from YANG variable /logical_interface_state/main_interface_physical/intf_type (intf-type) If this variable is read-only (config: false) in the source YANG file, then _set_intf_type is considered as a private method. Bac...
Setter method for routes, mapped from YANG variable /rbridge_id/vrf/address_family/ipv6/unicast/ipv6/import/routes (list) If this variable is read-only (config: false) in the source YANG file, then _set_routes is considered as a private method. Backends looking to populate this variable should do so via...
def _set_routes(self, v, load=False): """ Setter method for routes, mapped from YANG variable /rbridge_id/vrf/address_family/ipv6/unicast/ipv6/import/routes (list) If this variable is read-only (config: false) in the source YANG file, then _set_routes is considered as a private method. Backends look...
Setter method for collector_vrf, mapped from YANG variable /sflow/collector_vrf (common-def:vrf-name) If this variable is read-only (config: false) in the source YANG file, then _set_collector_vrf is considered as a private method. Backends looking to populate this variable should do so via calling this...
def _set_collector_vrf(self, v, load=False): """ Setter method for collector_vrf, mapped from YANG variable /sflow/collector_vrf (common-def:vrf-name) If this variable is read-only (config: false) in the source YANG file, then _set_collector_vrf is considered as a private method. Backends looking to...
Setter method for linkinfo_isllink_srcport_type, mapped from YANG variable /brocade_fabric_service_rpc/show_linkinfo/output/show_link_info/linkinfo_isl/linkinfo_isllink_srcport_type (interfacetype-type) If this variable is read-only (config: false) in the source YANG file, then _set_linkinfo_isllink_srcport_typ...
def _set_linkinfo_isllink_srcport_type(self, v, load=False): """ Setter method for linkinfo_isllink_srcport_type, mapped from YANG variable /brocade_fabric_service_rpc/show_linkinfo/output/show_link_info/linkinfo_isl/linkinfo_isllink_srcport_type (interfacetype-type) If this variable is read-only (config: f...
Setter method for tcp, mapped from YANG variable /interface/management/tcp (container) If this variable is read-only (config: false) in the source YANG file, then _set_tcp is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_tcp() directly. ...
def _set_tcp(self, v, load=False): """ Setter method for tcp, mapped from YANG variable /interface/management/tcp (container) If this variable is read-only (config: false) in the source YANG file, then _set_tcp is considered as a private method. Backends looking to populate this variable should ...
Setter method for speed, mapped from YANG variable /interface/management/speed (enumeration) If this variable is read-only (config: false) in the source YANG file, then _set_speed is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_speed() ...
def _set_speed(self, v, load=False): """ Setter method for speed, mapped from YANG variable /interface/management/speed (enumeration) If this variable is read-only (config: false) in the source YANG file, then _set_speed is considered as a private method. Backends looking to populate this variable s...
Setter method for line_speed, mapped from YANG variable /interface/management/line_speed (container) If this variable is read-only (config: false) in the source YANG file, then _set_line_speed is considered as a private method. Backends looking to populate this variable should do so via calling thisObj....
def _set_line_speed(self, v, load=False): """ Setter method for line_speed, mapped from YANG variable /interface/management/line_speed (container) If this variable is read-only (config: false) in the source YANG file, then _set_line_speed is considered as a private method. Backends looking to popula...
Setter method for global_isis_info, mapped from YANG variable /isis_state/global_isis_info (container) If this variable is read-only (config: false) in the source YANG file, then _set_global_isis_info is considered as a private method. Backends looking to populate this variable should do so via calling ...
def _set_global_isis_info(self, v, load=False): """ Setter method for global_isis_info, mapped from YANG variable /isis_state/global_isis_info (container) If this variable is read-only (config: false) in the source YANG file, then _set_global_isis_info is considered as a private method. Backends loo...
Setter method for shutdown_management_oper, mapped from YANG variable /interface/management/shutdown_management_oper (string) If this variable is read-only (config: false) in the source YANG file, then _set_shutdown_management_oper is considered as a private method. Backends looking to populate this variabl...
def _set_shutdown_management_oper(self, v, load=False): """ Setter method for shutdown_management_oper, mapped from YANG variable /interface/management/shutdown_management_oper (string) If this variable is read-only (config: false) in the source YANG file, then _set_shutdown_management_oper is considere...
Setter method for router_isis_config, mapped from YANG variable /isis_state/router_isis_config (container) If this variable is read-only (config: false) in the source YANG file, then _set_router_isis_config is considered as a private method. Backends looking to populate this variable should do so via ca...
def _set_router_isis_config(self, v, load=False): """ Setter method for router_isis_config, mapped from YANG variable /isis_state/router_isis_config (container) If this variable is read-only (config: false) in the source YANG file, then _set_router_isis_config is considered as a private method. Back...
Setter method for ipv4_routes, mapped from YANG variable /isis_state/ipv4_routes (container) If this variable is read-only (config: false) in the source YANG file, then _set_ipv4_routes is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_ip...
def _set_ipv4_routes(self, v, load=False): """ Setter method for ipv4_routes, mapped from YANG variable /isis_state/ipv4_routes (container) If this variable is read-only (config: false) in the source YANG file, then _set_ipv4_routes is considered as a private method. Backends looking to populate thi...
Setter method for host_table, mapped from YANG variable /isis_state/host_table (container) If this variable is read-only (config: false) in the source YANG file, then _set_host_table is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_host_...
def _set_host_table(self, v, load=False): """ Setter method for host_table, mapped from YANG variable /isis_state/host_table (container) If this variable is read-only (config: false) in the source YANG file, then _set_host_table is considered as a private method. Backends looking to populate this va...
Setter method for ipv6_routes, mapped from YANG variable /isis_state/ipv6_routes (container) If this variable is read-only (config: false) in the source YANG file, then _set_ipv6_routes is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_ip...
def _set_ipv6_routes(self, v, load=False): """ Setter method for ipv6_routes, mapped from YANG variable /isis_state/ipv6_routes (container) If this variable is read-only (config: false) in the source YANG file, then _set_ipv6_routes is considered as a private method. Backends looking to populate thi...
Setter method for interface_brief, mapped from YANG variable /isis_state/interface_brief (container) If this variable is read-only (config: false) in the source YANG file, then _set_interface_brief is considered as a private method. Backends looking to populate this variable should do so via calling thi...
def _set_interface_brief(self, v, load=False): """ Setter method for interface_brief, mapped from YANG variable /isis_state/interface_brief (container) If this variable is read-only (config: false) in the source YANG file, then _set_interface_brief is considered as a private method. Backends looking...
Setter method for interface_detail, mapped from YANG variable /isis_state/interface_detail (container) If this variable is read-only (config: false) in the source YANG file, then _set_interface_detail is considered as a private method. Backends looking to populate this variable should do so via calling ...
def _set_interface_detail(self, v, load=False): """ Setter method for interface_detail, mapped from YANG variable /isis_state/interface_detail (container) If this variable is read-only (config: false) in the source YANG file, then _set_interface_detail is considered as a private method. Backends loo...
Invokes the pipeline with the defined command. Command line arguments, and the command need to be set with arg_builder, and command_builder respectively before this method can be invoked.
def run(self, args, pipeline_command): """ Invokes the pipeline with the defined command. Command line arguments, and the command need to be set with arg_builder, and command_builder respectively before this method can be invoked. """ # output that must be moved but not ...
Use this context manager to add arguments to an argparse object with the add_argument method. Arguments must be defined before the command is defined. Note that no-clean and resume are added upon exit and should not be added in the context manager. For more info about these default arguments see...
def get_args(self): """ Use this context manager to add arguments to an argparse object with the add_argument method. Arguments must be defined before the command is defined. Note that no-clean and resume are added upon exit and should not be added in the context manager. For mor...
Setter method for cos_threshold, mapped from YANG variable /interface/gigabitethernet/qos/rcv_queue/cos_threshold (container) If this variable is read-only (config: false) in the source YANG file, then _set_cos_threshold is considered as a private method. Backends looking to populate this variable should ...
def _set_cos_threshold(self, v, load=False): """ Setter method for cos_threshold, mapped from YANG variable /interface/gigabitethernet/qos/rcv_queue/cos_threshold (container) If this variable is read-only (config: false) in the source YANG file, then _set_cos_threshold is considered as a private met...
A wrapper for boost_ranks. :param dict rsem_files: Dict of results from rsem :param dict merged_mhc_calls: Dict of results from merging mhc peptide binding predictions :param dict transgene_out: Dict of results from running Transgene :param dict univ_options: Dict of universal options used by almost al...
def wrap_rankboost(job, rsem_files, merged_mhc_calls, transgene_out, univ_options, rankboost_options): """ A wrapper for boost_ranks. :param dict rsem_files: Dict of results from rsem :param dict merged_mhc_calls: Dict of results from merging mhc peptide binding predictions :para...
Boost the ranks of the predicted peptides:MHC combinations. :param toil.fileStore.FileID isoform_expression: fsID of rsem isoform expression file :param dict merged_mhc_calls: Dict of results from merging mhc peptide binding predictions :param dict transgene_out: Dict of results from running Transgene ...
def boost_ranks(job, isoform_expression, merged_mhc_calls, transgene_out, univ_options, rankboost_options): """ Boost the ranks of the predicted peptides:MHC combinations. :param toil.fileStore.FileID isoform_expression: fsID of rsem isoform expression file :param dict merged_mhc_calls:...
Setter method for vcs_cluster_type_info, mapped from YANG variable /brocade_vcs_rpc/show_vcs/output/vcs_cluster_type_info (vcs-cluster-type) If this variable is read-only (config: false) in the source YANG file, then _set_vcs_cluster_type_info is considered as a private method. Backends looking to populate ...
def _set_vcs_cluster_type_info(self, v, load=False): """ Setter method for vcs_cluster_type_info, mapped from YANG variable /brocade_vcs_rpc/show_vcs/output/vcs_cluster_type_info (vcs-cluster-type) If this variable is read-only (config: false) in the source YANG file, then _set_vcs_cluster_type_info is ...
Setter method for adjustment_threshold, mapped from YANG variable /mpls_config/router/mpls/mpls_cmds_holder/autobw_template/adjustment_threshold (container) If this variable is read-only (config: false) in the source YANG file, then _set_adjustment_threshold is considered as a private method. Backends looki...
def _set_adjustment_threshold(self, v, load=False): """ Setter method for adjustment_threshold, mapped from YANG variable /mpls_config/router/mpls/mpls_cmds_holder/autobw_template/adjustment_threshold (container) If this variable is read-only (config: false) in the source YANG file, then _set_adjustment...
Setter method for vrf, mapped from YANG variable /nas/server_ip/vrf (list) If this variable is read-only (config: false) in the source YANG file, then _set_vrf is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_vrf() directly.
def _set_vrf(self, v, load=False): """ Setter method for vrf, mapped from YANG variable /nas/server_ip/vrf (list) If this variable is read-only (config: false) in the source YANG file, then _set_vrf is considered as a private method. Backends looking to populate this variable should do so via ca...
Attempt to determine bot's filesystem path from its module.
def _path_from_module(module): """Attempt to determine bot's filesystem path from its module.""" # Convert paths to list because Python's _NamespacePath doesn't support # indexing. paths = list(getattr(module, '__path__', [])) if len(paths) != 1: filename = getattr(mo...
Factory that creates an bot config from an entry in INSTALLED_APPS.
def create(cls, entry): """ Factory that creates an bot config from an entry in INSTALLED_APPS. """ # trading_bots.example.bot.ExampleBot try: # If import_module succeeds, entry is a path to a bot module, # which may specify a bot class with a default_bot ...
Return the config with the given case-insensitive config_name. Raise LookupError if no config exists with this name.
def get_config(self, config_name, require_ready=True): """ Return the config with the given case-insensitive config_name. Raise LookupError if no config exists with this name. """ if require_ready: self.bots.check_configs_ready() else: self.bots.ch...
Return an iterable of models.
def get_configs(self): """ Return an iterable of models. """ self.bots.check_models_ready() for config in self.configs.values(): yield config
Load bots. Import each bot module. It is thread-safe and idempotent, but not re-entrant.
def populate(self, installed_bots=None): """ Load bots. Import each bot module. It is thread-safe and idempotent, but not re-entrant. """ if self.ready: return # populate() might be called by two threads in parallel on servers # that create th...
Import all bots and returns a bot class for the given label. Raise LookupError if no bot exists with this label.
def get_bot(self, bot_label): """ Import all bots and returns a bot class for the given label. Raise LookupError if no bot exists with this label. """ self.check_bots_ready() try: return self.bots[bot_label] except KeyError: message = "No i...
Return a list of all installed configs.
def get_configs(self): """ Return a list of all installed configs. """ self.check_configs_ready() result = [] for bot in self.bots.values(): result.extend(list(bot.get_models())) return result
Return the config matching the given bot_label and config_name. config_name is case-insensitive. Raise LookupError if no bot exists with this label, or no config exists with this name in the bot. Raise ValueError if called with a single argument that doesn't contain exactly one dot.
def get_config(self, bot_label, config_name=None, require_ready=True): """ Return the config matching the given bot_label and config_name. config_name is case-insensitive. Raise LookupError if no bot exists with this label, or no config exists with this name in the bot. Raise Val...
Check whether a bot with this name exists in the registry. bot_name is the full name of the bot e.g. 'trading_bots.core.bot'.
def is_installed(self, bot_name): """ Check whether a bot with this name exists in the registry. bot_name is the full name of the bot e.g. 'trading_bots.core.bot'. """ self.check_bots_ready() return any(b.name == bot_name for b in self.bots.values())
Setter method for class_, mapped from YANG variable /logging/auditlog/class (list) If this variable is read-only (config: false) in the source YANG file, then _set_class_ is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_class_() directly...
def _set_class_(self, v, load=False): """ Setter method for class_, mapped from YANG variable /logging/auditlog/class (list) If this variable is read-only (config: false) in the source YANG file, then _set_class_ is considered as a private method. Backends looking to populate this variable should ...
Convert val into float with digits decimal.
def __to_float(val, digits): """Convert val into float with digits decimal.""" try: return round(float(val), digits) except (ValueError, TypeError): return float(0)
Parse the pressure and return FC (numerical).
def __getBarFC(pressure): """Parse the pressure and return FC (numerical).""" if pressure is None: return 0 press = __to_float1(pressure) if press < 974: return 1 if press < 990: return 2 if press < 1002: return 3 if press < 1010: return 4 if press...
Parse the pressure and return FC (String).
def __getBarFCName(pressure): """Parse the pressure and return FC (String).""" if pressure is None: return None press = __to_float1(pressure) if press < 974: return "Thunderstorms" if press < 990: return "Stormy" if press < 1002: return "Rain" if press < 1010:...
Get buienradar json data and return results.
def get_json_data(latitude=52.091579, longitude=5.119734): """Get buienradar json data and return results.""" final_result = {SUCCESS: False, MESSAGE: None, CONTENT: None, RAINCONTENT: None} log.info("Getting buienradar json data for latitude=%s, ...
Parse the raw data and return as data dictionary.
def parse_json_data(content, raincontent, latitude=52.091579, longitude=5.119734, timeframe=60): """Parse the raw data and return as data dictionary.""" result = {SUCCESS: False, MESSAGE: None, DATA: None} if timeframe < 5 or timeframe > 120: raise ValueError("Timeframe must be ...
Get buienradar forecasted precipitation.
def __get_precipfc_data(latitude, longitude): """Get buienradar forecasted precipitation.""" url = 'https://gpsgadget.buienradar.nl/data/raintext?lat={}&lon={}' # rounding coordinates prevents unnecessary redirects/calls url = url.format( round(latitude, 2), round(longitude, 2) ) ...
Load json data from url and return result.
def __get_url(url): """Load json data from url and return result.""" log.info("Retrieving weather data (%s)...", url) result = {SUCCESS: False, MESSAGE: None} try: r = requests.get(url) result[STATUS_CODE] = r.status_code result[HEADERS] = r.headers result[CONTENT] = r.t...
Parse the buienradar json and rain data.
def __parse_ws_data(jsondata, latitude=52.091579, longitude=5.119734): """Parse the buienradar json and rain data.""" log.info("Parse ws data: latitude: %s, longitude: %s", latitude, longitude) result = {SUCCESS: False, MESSAGE: None, DATA: None} # select the nearest weather station loc_data = __se...
Parse the json data from selected weatherstation.
def __parse_loc_data(loc_data, result): """Parse the json data from selected weatherstation.""" result[DATA] = {ATTRIBUTION: ATTRIBUTION_INFO, FORECAST: [], PRECIPITATION_FORECAST: None} for key, [value, func] in SENSOR_TYPES.items(): result[DATA][key] = None...
Parse the forecast data from the json section.
def __parse_fc_data(fc_data): """Parse the forecast data from the json section.""" fc = [] for day in fc_data: fcdata = { CONDITION: __cond_from_desc( __get_str( day, __WEATHERDESCRIPTION) ), TEMPERATURE: __g...
Get the forecasted float from json section.
def __get_float(section, name): """Get the forecasted float from json section.""" try: return float(section[name]) except (ValueError, TypeError, KeyError): return float(0)
Parse the forecasted precipitation data.
def __parse_precipfc_data(data, timeframe): """Parse the forecasted precipitation data.""" result = {AVERAGE: None, TOTAL: None, TIMEFRAME: None} log.debug("Precipitation data: %s", data) lines = data.splitlines() index = 1 totalrain = 0 numberoflines = 0 nrlines = min(len(lines), round...
Get the condition name from the condition description.
def __cond_from_desc(desc): """Get the condition name from the condition description.""" # '{ 'code': 'conditon', 'detailed', 'exact', 'exact_nl'} for code, [condition, detailed, exact, exact_nl] in __BRCONDITIONS.items(): if exact_nl == desc: return {CONDCODE: code, ...
Select the nearest weatherstation.
def __select_nearest_ws(jsondata, latitude, longitude): """Select the nearest weatherstation.""" log.debug("__select_nearest_ws: latitude: %s, longitude: %s", latitude, longitude) dist = 0 dist2 = 0 loc_data = None try: ws_json = jsondata[__ACTUAL] ws_json = ws_jso...
Get the distance to the weatherstation from wstation section of json. wstation: weerstation section of buienradar json (dict) latitude: our latitude longitude: our longitude
def __get_ws_distance(wstation, latitude, longitude): """Get the distance to the weatherstation from wstation section of json. wstation: weerstation section of buienradar json (dict) latitude: our latitude longitude: our longitude """ if wstation: try: wslat = float(wstation...
Construct a staiion name.
def __getStationName(name, id): """Construct a staiion name.""" name = name.replace("Meetstation", "") name = name.strip() name += " (%s)" % id return name
This method is used within urls.py to create unique formwizard instances for every request. We need to override this method because we add some kwargs which are needed to make the formwizard usable.
def as_view(cls, *args, **kwargs): """ This method is used within urls.py to create unique formwizard instances for every request. We need to override this method because we add some kwargs which are needed to make the formwizard usable. """ initkwargs = cls.get_initkwarg...
Creates a dict with all needed parameters for the form wizard instances. * `form_list` - is a list of forms. The list entries can be single form classes or tuples of (`step_name`, `form_class`). If you pass a list of forms, the formwizard will convert the class list to (`zero_base...
def get_initkwargs(cls, form_list, initial_dict=None, instance_dict=None, condition_dict=None, *args, **kwargs): """ Creates a dict with all needed parameters for the form wizard instances. * `form_list` - is a list of forms. The list entries can be single form classes or tupl...
This method gets called by the routing engine. The first argument is `request` which contains a `HttpRequest` instance. The request is stored in `self.request` for later use. The storage instance is stored in `self.storage`. After processing the request using the `dispatch` method, the ...
def dispatch(self, request, *args, **kwargs): """ This method gets called by the routing engine. The first argument is `request` which contains a `HttpRequest` instance. The request is stored in `self.request` for later use. The storage instance is stored in `self.storage`. ...
This method returns a form_list based on the initial form list but checks if there is a condition method/value in the condition_list. If an entry exists in the condition list, it will call/read the value and respect the result. (True means add the form, False means ignore the form) ...
def get_form_list(self): """ This method returns a form_list based on the initial form list but checks if there is a condition method/value in the condition_list. If an entry exists in the condition list, it will call/read the value and respect the result. (True means add the for...
This method handles GET requests. If a GET request reaches this point, the wizard assumes that the user just starts at the first step or wants to restart the process. The data of the wizard will be resetted before rendering the first step.
def get(self, request, *args, **kwargs): """ This method handles GET requests. If a GET request reaches this point, the wizard assumes that the user just starts at the first step or wants to restart the process. The data of the wizard will be resetted before rendering the first ...
This method handles POST requests. The wizard will render either the current step (if form validation wasn't successful), the next step (if the current step was stored successful) or the done view (if no more steps are available)
def post(self, *args, **kwargs): """ This method handles POST requests. The wizard will render either the current step (if form validation wasn't successful), the next step (if the current step was stored successful) or the done view (if no more steps are available) """ ...
THis method gets called when the next step/form should be rendered. `form` contains the last/current form.
def render_next_step(self, form, **kwargs): """ THis method gets called when the next step/form should be rendered. `form` contains the last/current form. """ # get the form instance based on the data from the storage backend # (if available). next_step = self.ste...
This method gets called when all forms passed. The method should also re-validate all steps to prevent manipulation. If any form don't validate, `render_revalidation_failure` should get called. If everything is fine call `done`.
def render_done(self, form, **kwargs): """ This method gets called when all forms passed. The method should also re-validate all steps to prevent manipulation. If any form don't validate, `render_revalidation_failure` should get called. If everything is fine call `done`. ...
Returns the prefix which will be used when calling the actual form for the given step. `step` contains the step-name, `form` the form which will be called with the returned prefix. If no step is given, the form_prefix will determine the current step automatically.
def get_form_prefix(self, step=None, form=None): """ Returns the prefix which will be used when calling the actual form for the given step. `step` contains the step-name, `form` the form which will be called with the returned prefix. If no step is given, the form_prefix will det...
Constructs the form for a given `step`. If no `step` is defined, the current step will be determined automatically. The form will be initialized using the `data` argument to prefill the new form. If needed, instance or queryset (for `ModelForm` or `ModelFormSet`) will be added too.
def get_form(self, step=None, data=None, files=None): """ Constructs the form for a given `step`. If no `step` is defined, the current step will be determined automatically. The form will be initialized using the `data` argument to prefill the new form. If needed, instance or qu...
Gets called when a form doesn't validate when rendering the done view. By default, it changed the current step to failing forms step and renders the form.
def render_revalidation_failure(self, step, form, **kwargs): """ Gets called when a form doesn't validate when rendering the done view. By default, it changed the current step to failing forms step and renders the form. """ self.storage.current_step = step return ...
Returns a merged dictionary of all step cleaned_data dictionaries. If a step contains a `FormSet`, the key will be prefixed with formset and contain a list of the formset' cleaned_data dictionaries.
def get_all_cleaned_data(self): """ Returns a merged dictionary of all step cleaned_data dictionaries. If a step contains a `FormSet`, the key will be prefixed with formset and contain a list of the formset' cleaned_data dictionaries. """ cleaned_data = {} for for...
Returns the cleaned data for a given `step`. Before returning the cleaned data, the stored values are being revalidated through the form. If the data doesn't validate, None will be returned.
def get_cleaned_data_for_step(self, step): """ Returns the cleaned data for a given `step`. Before returning the cleaned data, the stored values are being revalidated through the form. If the data doesn't validate, None will be returned. """ if step in self.form_list: ...
Returns the next step after the given `step`. If no more steps are available, None will be returned. If the `step` argument is None, the current step will be determined automatically.
def get_next_step(self, step=None): """ Returns the next step after the given `step`. If no more steps are available, None will be returned. If the `step` argument is None, the current step will be determined automatically. """ if step is None: step = self.ste...
Returns the index for the given `step` name. If no step is given, the current step will be used to get the index.
def get_step_index(self, step=None): """ Returns the index for the given `step` name. If no step is given, the current step will be used to get the index. """ if step is None: step = self.steps.current return self.get_form_list().keyOrder.index(step)
Returns the previous step before the given `step`. If there are no steps available, None will be returned. If the `step` argument is None, the current step will be determined automatically.
def get_prev_step(self, step=None): """ Returns the previous step before the given `step`. If there are no steps available, None will be returned. If the `step` argument is None, the current step will be determined automatically. """ if step is None: step = se...
Returns a ``HttpResponse`` containing a all needed context data.
def render(self, form=None, **kwargs): """ Returns a ``HttpResponse`` containing a all needed context data. """ form = form or self.get_form() context = self.get_context_data(form, **kwargs) return self.render_to_response(context)
We require a url_name to reverse URLs later. Additionally users can pass a done_step_name to change the URL name of the "done" view.
def get_initkwargs(cls, *args, **kwargs): """ We require a url_name to reverse URLs later. Additionally users can pass a done_step_name to change the URL name of the "done" view. """ assert 'url_name' in kwargs, 'URL name is needed to resolve correct wizard URLs' extra_kw...
Returns the template context for a step. You can overwrite this method to add more data for all or some steps. This method returns a dictionary containing the rendered form step. Available template context variables are: * all extra data stored in the storage backend * `form` ...
def get_context_data(self, form, *args, **kwargs): """ Returns the template context for a step. You can overwrite this method to add more data for all or some steps. This method returns a dictionary containing the rendered form step. Available template context variables are: ...
Do a redirect if user presses the prev. step button. The rest of this is super'd from FormWizard.
def post(self, *args, **kwargs): """ Do a redirect if user presses the prev. step button. The rest of this is super'd from FormWizard. """ prev_step = self.request.POST.get('wizard_prev_step', None) if prev_step and prev_step in self.get_form_list(): self.stor...
When rendering the done view, we have to redirect first (if the URL name doesn't fit).
def render_done(self, form, **kwargs): """ When rendering the done view, we have to redirect first (if the URL name doesn't fit). """ if kwargs.get('step', None) != self.done_step_name: return redirect(self.url_name, step=self.done_step_name) return super(Name...
Given a unicode/str/bytes always return str. We prefer to work with the 'native' string type for the version of python we run on, and this gets us that.
def astext(data): """ Given a unicode/str/bytes always return str. We prefer to work with the 'native' string type for the version of python we run on, and this gets us that. """ if isinstance(data, str): return data elif isinstance(data, text_type): return data.encode("utf-...
Setter method for default_action, mapped from YANG variable /openflow_state/detail/default_action (default-packet-action) If this variable is read-only (config: false) in the source YANG file, then _set_default_action is considered as a private method. Backends looking to populate this variable should d...
def _set_default_action(self, v, load=False): """ Setter method for default_action, mapped from YANG variable /openflow_state/detail/default_action (default-packet-action) If this variable is read-only (config: false) in the source YANG file, then _set_default_action is considered as a private metho...
This renders the form or, if needed, does the http redirects.
def get(self, *args, **kwargs): """ This renders the form or, if needed, does the http redirects. """ step_url = kwargs.get('step', None) if step_url is None: if 'reset' in self.request.GET: self.storage.reset() self.storage.current_ste...
When using the NamedUrlFormWizard, we have to redirect to update the browser's URL to match the shown step.
def render_next_step(self, form, **kwargs): """ When using the NamedUrlFormWizard, we have to redirect to update the browser's URL to match the shown step. """ next_step = self.get_next_step() self.storage.current_step = next_step return redirect(self.url_name, st...
When a step fails, we have to redirect the user to the first failing step.
def render_revalidation_failure(self, failed_step, form, **kwargs): """ When a step fails, we have to redirect the user to the first failing step. """ self.storage.current_step = failed_step return redirect(self.url_name, step=failed_step)
Setter method for hardware_type, mapped from YANG variable /brocade_interface_ext_rpc/get_interface_detail/output/interface/hardware_type (enumeration) If this variable is read-only (config: false) in the source YANG file, then _set_hardware_type is considered as a private method. Backends looking to popula...
def _set_hardware_type(self, v, load=False): """ Setter method for hardware_type, mapped from YANG variable /brocade_interface_ext_rpc/get_interface_detail/output/interface/hardware_type (enumeration) If this variable is read-only (config: false) in the source YANG file, then _set_hardware_type is consi...
Setter method for media_type, mapped from YANG variable /brocade_interface_ext_rpc/get_interface_detail/output/interface/media_type (enumeration) If this variable is read-only (config: false) in the source YANG file, then _set_media_type is considered as a private method. Backends looking to populate this v...
def _set_media_type(self, v, load=False): """ Setter method for media_type, mapped from YANG variable /brocade_interface_ext_rpc/get_interface_detail/output/interface/media_type (enumeration) If this variable is read-only (config: false) in the source YANG file, then _set_media_type is considered as a p...
Setter method for port_mode, mapped from YANG variable /brocade_interface_ext_rpc/get_interface_detail/output/interface/port_mode (enumeration) If this variable is read-only (config: false) in the source YANG file, then _set_port_mode is considered as a private method. Backends looking to populate this vari...
def _set_port_mode(self, v, load=False): """ Setter method for port_mode, mapped from YANG variable /brocade_interface_ext_rpc/get_interface_detail/output/interface/port_mode (enumeration) If this variable is read-only (config: false) in the source YANG file, then _set_port_mode is considered as a priva...
Setter method for unnumbered, mapped from YANG variable /interface/port_channel/ip/ip_config/unnumbered (container) If this variable is read-only (config: false) in the source YANG file, then _set_unnumbered is considered as a private method. Backends looking to populate this variable should do so via c...
def _set_unnumbered(self, v, load=False): """ Setter method for unnumbered, mapped from YANG variable /interface/port_channel/ip/ip_config/unnumbered (container) If this variable is read-only (config: false) in the source YANG file, then _set_unnumbered is considered as a private method. Backends lo...
Setter method for dscp_to_cos_mapping, mapped from YANG variable /qos/map/dscp_cos/dscp_to_cos_mapping (list) If this variable is read-only (config: false) in the source YANG file, then _set_dscp_to_cos_mapping is considered as a private method. Backends looking to populate this variable should do so vi...
def _set_dscp_to_cos_mapping(self, v, load=False): """ Setter method for dscp_to_cos_mapping, mapped from YANG variable /qos/map/dscp_cos/dscp_to_cos_mapping (list) If this variable is read-only (config: false) in the source YANG file, then _set_dscp_to_cos_mapping is considered as a private method....
Setter method for ospf1, mapped from YANG variable /routing_system/interface/ve/ip/interface_vlan_ospf_conf/ospf1 (container) If this variable is read-only (config: false) in the source YANG file, then _set_ospf1 is considered as a private method. Backends looking to populate this variable should do so ...
def _set_ospf1(self, v, load=False): """ Setter method for ospf1, mapped from YANG variable /routing_system/interface/ve/ip/interface_vlan_ospf_conf/ospf1 (container) If this variable is read-only (config: false) in the source YANG file, then _set_ospf1 is considered as a private method. Backends lo...
Setter method for linecards, mapped from YANG variable /rbridge_id/global_lc_holder/linecard/linecards (list) If this variable is read-only (config: false) in the source YANG file, then _set_linecards is considered as a private method. Backends looking to populate this variable should do so via calling ...
def _set_linecards(self, v, load=False): """ Setter method for linecards, mapped from YANG variable /rbridge_id/global_lc_holder/linecard/linecards (list) If this variable is read-only (config: false) in the source YANG file, then _set_linecards is considered as a private method. Backends looking to...
Setter method for mac_group_entry, mapped from YANG variable /mac_group/mac_group_entry (list) If this variable is read-only (config: false) in the source YANG file, then _set_mac_group_entry is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._...
def _set_mac_group_entry(self, v, load=False): """ Setter method for mac_group_entry, mapped from YANG variable /mac_group/mac_group_entry (list) If this variable is read-only (config: false) in the source YANG file, then _set_mac_group_entry is considered as a private method. Backends looking to po...
Setter method for rbridge_id, mapped from YANG variable /overlay_gateway/attach/rbridge_id (container) If this variable is read-only (config: false) in the source YANG file, then _set_rbridge_id is considered as a private method. Backends looking to populate this variable should do so via calling thisOb...
def _set_rbridge_id(self, v, load=False): """ Setter method for rbridge_id, mapped from YANG variable /overlay_gateway/attach/rbridge_id (container) If this variable is read-only (config: false) in the source YANG file, then _set_rbridge_id is considered as a private method. Backends looking to popu...
Setter method for vlan, mapped from YANG variable /overlay_gateway/attach/vlan (list) If this variable is read-only (config: false) in the source YANG file, then _set_vlan is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_vlan() directly.
def _set_vlan(self, v, load=False): """ Setter method for vlan, mapped from YANG variable /overlay_gateway/attach/vlan (list) If this variable is read-only (config: false) in the source YANG file, then _set_vlan is considered as a private method. Backends looking to populate this variable should ...
Setter method for ecmp, mapped from YANG variable /rbridge_id/fabric/ecmp (container) If this variable is read-only (config: false) in the source YANG file, then _set_ecmp is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_ecmp() directly....
def _set_ecmp(self, v, load=False): """ Setter method for ecmp, mapped from YANG variable /rbridge_id/fabric/ecmp (container) If this variable is read-only (config: false) in the source YANG file, then _set_ecmp is considered as a private method. Backends looking to populate this variable should ...
Setter method for port_channel, mapped from YANG variable /rbridge_id/fabric/port_channel (list) 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 calling thisObj._s...
def _set_port_channel(self, v, load=False): """ Setter method for port_channel, mapped from YANG variable /rbridge_id/fabric/port_channel (list) 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 popula...
Setter method for login_policy, mapped from YANG variable /rbridge_id/fabric/login_policy (container) If this variable is read-only (config: false) in the source YANG file, then _set_login_policy is considered as a private method. Backends looking to populate this variable should do so via calling thisO...
def _set_login_policy(self, v, load=False): """ Setter method for login_policy, mapped from YANG variable /rbridge_id/fabric/login_policy (container) If this variable is read-only (config: false) in the source YANG file, then _set_login_policy is considered as a private method. Backends looking to p...
Setter method for get_system_uptime, mapped from YANG variable /brocade_system_rpc/get_system_uptime (rpc) If this variable is read-only (config: false) in the source YANG file, then _set_get_system_uptime is considered as a private method. Backends looking to populate this variable should do so via cal...
def _set_get_system_uptime(self, v, load=False): """ Setter method for get_system_uptime, mapped from YANG variable /brocade_system_rpc/get_system_uptime (rpc) If this variable is read-only (config: false) in the source YANG file, then _set_get_system_uptime is considered as a private method. Backen...
Setter method for show_ntp, mapped from YANG variable /brocade_ntp_rpc/show_ntp (rpc) If this variable is read-only (config: false) in the source YANG file, then _set_show_ntp is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_show_ntp() d...
def _set_show_ntp(self, v, load=False): """ Setter method for show_ntp, mapped from YANG variable /brocade_ntp_rpc/show_ntp (rpc) If this variable is read-only (config: false) in the source YANG file, then _set_show_ntp is considered as a private method. Backends looking to populate this variable sh...
Setter method for line, mapped from YANG variable /terminal_cfg/line (list) If this variable is read-only (config: false) in the source YANG file, then _set_line is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_line() directly.
def _set_line(self, v, load=False): """ Setter method for line, mapped from YANG variable /terminal_cfg/line (list) If this variable is read-only (config: false) in the source YANG file, then _set_line is considered as a private method. Backends looking to populate this variable should do so via...
Setter method for pim, mapped from YANG variable /rbridge_id/router/hide_pim_holder/pim (container) If this variable is read-only (config: false) in the source YANG file, then _set_pim is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_pim...
def _set_pim(self, v, load=False): """ Setter method for pim, mapped from YANG variable /rbridge_id/router/hide_pim_holder/pim (container) If this variable is read-only (config: false) in the source YANG file, then _set_pim is considered as a private method. Backends looking to populate this variabl...
Setter method for interface_phy_dhcp_conf, mapped from YANG variable /interface/fortygigabitethernet/ipv6/interface_phy_dhcp_conf (container) If this variable is read-only (config: false) in the source YANG file, then _set_interface_phy_dhcp_conf is considered as a private method. Backends looking to popula...
def _set_interface_phy_dhcp_conf(self, v, load=False): """ Setter method for interface_phy_dhcp_conf, mapped from YANG variable /interface/fortygigabitethernet/ipv6/interface_phy_dhcp_conf (container) If this variable is read-only (config: false) in the source YANG file, then _set_interface_phy_dhcp_con...
Setter method for ipv6_phy_intf_cmds, mapped from YANG variable /interface/fortygigabitethernet/ipv6/ipv6_phy_intf_cmds (container) If this variable is read-only (config: false) in the source YANG file, then _set_ipv6_phy_intf_cmds is considered as a private method. Backends looking to populate this variabl...
def _set_ipv6_phy_intf_cmds(self, v, load=False): """ Setter method for ipv6_phy_intf_cmds, mapped from YANG variable /interface/fortygigabitethernet/ipv6/ipv6_phy_intf_cmds (container) If this variable is read-only (config: false) in the source YANG file, then _set_ipv6_phy_intf_cmds is considered as a...
Get and configure the storage backend
def get_store(logger: Logger=None) -> 'Store': """Get and configure the storage backend""" from trading_bots.conf import settings store_settings = settings.storage store = store_settings.get('name', 'json') if store == 'json': store = 'trading_bots.core.storage.JSONStore' elif store == '...
Setter method for access_group, mapped from YANG variable /interface/ethernet/ipv6/access_group (list) If this variable is read-only (config: false) in the source YANG file, then _set_access_group is considered as a private method. Backends looking to populate this variable should do so via calling this...
def _set_access_group(self, v, load=False): """ Setter method for access_group, mapped from YANG variable /interface/ethernet/ipv6/access_group (list) If this variable is read-only (config: false) in the source YANG file, then _set_access_group is considered as a private method. Backends looking to ...
Setter method for intf_ipv6_router_isis, mapped from YANG variable /interface/ethernet/ipv6/intf_ipv6_router_isis (container) If this variable is read-only (config: false) in the source YANG file, then _set_intf_ipv6_router_isis is considered as a private method. Backends looking to populate this variable s...
def _set_intf_ipv6_router_isis(self, v, load=False): """ Setter method for intf_ipv6_router_isis, mapped from YANG variable /interface/ethernet/ipv6/intf_ipv6_router_isis (container) If this variable is read-only (config: false) in the source YANG file, then _set_intf_ipv6_router_isis is considered as a...
CamelCase로 주어진 ``name``\ 을 underscore_with_lower_case로 변환합니다 .. code-block:: python >>> camel_to_underscore('SomePythonClass') 'some_python_class' :param str name: name to convert :return: converted name :rtype: :class:`str`
def camel_to_underscore(name): """CamelCase로 주어진 ``name``\ 을 underscore_with_lower_case로 변환합니다 .. code-block:: python >>> camel_to_underscore('SomePythonClass') 'some_python_class' :param str name: name to convert :return: converted name :rtype: :class:`str` """ s1 = first_...
주어진 템플릿을 jinja로 렌더링합니다 :param template_name: :return:
def render(template_name, extra_environments=None, **kwargs): """주어진 템플릿을 jinja로 렌더링합니다 :param template_name: :return: """ if extra_environments is None: extra_environments = {} default_loader = PackageLoader('dodotable', 'templates') loader = extra_environments.get( 'templ...
Setter method for ipv6_anycast_address, mapped from YANG variable /rbridge_id/interface/ve/ipv6/ipv6_anycast_address (list) If this variable is read-only (config: false) in the source YANG file, then _set_ipv6_anycast_address is considered as a private method. Backends looking to populate this variable shou...
def _set_ipv6_anycast_address(self, v, load=False): """ Setter method for ipv6_anycast_address, mapped from YANG variable /rbridge_id/interface/ve/ipv6/ipv6_anycast_address (list) If this variable is read-only (config: false) in the source YANG file, then _set_ipv6_anycast_address is considered as a pri...