INSTRUCTION stringlengths 1 8.43k | RESPONSE stringlengths 75 104k |
|---|---|
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. | 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. | 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 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 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. | 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 handles GET requests. | 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. | 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. | 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. | 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 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 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 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: | 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:
... |
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... |
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... |
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 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) |
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. | 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 do so v... | 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... |
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 populate t... | 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 varia... | 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 variable... | 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 calling t... | 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 via calling... | 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 via cal... | 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 thisObj. ... | 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. _set_mac_gr... | 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 thisObj. _set_rb... | 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. _set_port_c... | 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 thisObj. _set_l... | 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 calling thisOb... | 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 () directly. | 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 () dire... | 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 populate th... | 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 variable sho... | 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 thisObj. _set... | 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 should... | 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로 변환합니다 | 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로 렌더링합니다 | 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 should d... | 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... |
Setter method for map_fport mapped from YANG variable/ rbridge_id/ ag/ nport_menu/ nport_interface/ nport/ map/ map_fport ( container ) If this variable is read - only ( config: false ) in the source YANG file then _set_map_fport is considered as a private method. Backends looking to populate this variable should do so... | def _set_map_fport(self, v, load=False):
"""
Setter method for map_fport, mapped from YANG variable /rbridge_id/ag/nport_menu/nport_interface/nport/map/map_fport (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_map_fport is considered as a private
method. ... |
Setter method for security mapped from YANG variable/ rbridge_id/ threshold_monitor/ security ( container ) If this variable is read - only ( config: false ) in the source YANG file then _set_security is considered as a private method. Backends looking to populate this variable should do so via calling thisObj. _set_se... | def _set_security(self, v, load=False):
"""
Setter method for security, mapped from YANG variable /rbridge_id/threshold_monitor/security (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_security is considered as a private
method. Backends looking to popula... |
convert headers in human readable format | def parse_request_headers(headers):
"""
convert headers in human readable format
:param headers:
:return:
"""
request_header_keys = set(headers.keys(lower=True))
request_meta_keys = set(XHEADERS_TO_ARGS_DICT.keys())
data_header_keys = request_header_keys.intersection(request_meta_keys)
... |
Separates the method s description and paramter s | def split_docstring(docstring):
"""
Separates the method's description and paramter's
:return: Return description string and list of fields strings
"""
docstring_list = [line.strip() for line in docstring.splitlines()]
description_list = list(
takewhile(lambda line: not (line.startswith... |
return method docstring if method docstring is empty we get docstring from parent | def get_method_docstring(cls, method_name):
"""
return method docstring
if method docstring is empty we get docstring from parent
:param method:
:type method:
:return:
:rtype:
"""
method = getattr(cls, method_name, None)
if method is None:
return
docstrign = inspect... |
: return: return dict description - method description arguments - dict of dicts arg_name: { description type_name required } return - dict: { description type } | def parse_docstring(docstring, cls=None):
"""
:return: return dict
description - method description
arguments - dict of dicts arg_name: {description, type_name, required}
return - dict: {description, type}
"""
def_arg_dict = lambda: {'description': None,
... |
Setter method for suppressing_address mapped from YANG variable/ routing_system/ interface/ ve/ ipv6/ ipv6_nd_ra/ ipv6_intf_cmds/ nd/ address/ suppressing_address ( list ) If this variable is read - only ( config: false ) in the source YANG file then _set_suppressing_address is considered as a private method. Backends ... | def _set_suppressing_address(self, v, load=False):
"""
Setter method for suppressing_address, mapped from YANG variable /routing_system/interface/ve/ipv6/ipv6_nd_ra/ipv6_intf_cmds/nd/address/suppressing_address (list)
If this variable is read-only (config: false) in the
source YANG file, then _set_suppr... |
Setter method for af_ipv4_unicast mapped from YANG variable/ routing_system/ router/ isis/ router_isis_cmds_holder/ address_family/ ipv4/ af_ipv4_unicast ( container ) If this variable is read - only ( config: false ) in the source YANG file then _set_af_ipv4_unicast is considered as a private method. Backends looking ... | def _set_af_ipv4_unicast(self, v, load=False):
"""
Setter method for af_ipv4_unicast, mapped from YANG variable /routing_system/router/isis/router_isis_cmds_holder/address_family/ipv4/af_ipv4_unicast (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_af_ipv4_uni... |
Setter method for auto_shut mapped from YANG variable/ rbridge_id/ vcs/ auto_shut ( container ) If this variable is read - only ( config: false ) in the source YANG file then _set_auto_shut is considered as a private method. Backends looking to populate this variable should do so via calling thisObj. _set_auto_shut () ... | def _set_auto_shut(self, v, load=False):
"""
Setter method for auto_shut, mapped from YANG variable /rbridge_id/vcs/auto_shut (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_auto_shut is considered as a private
method. Backends looking to populate this va... |
Setter method for designated_forwarder_hold_time mapped from YANG variable/ cluster/ designated_forwarder_hold_time ( uint16 ) If this variable is read - only ( config: false ) in the source YANG file then _set_designated_forwarder_hold_time is considered as a private method. Backends looking to populate this variable ... | def _set_designated_forwarder_hold_time(self, v, load=False):
"""
Setter method for designated_forwarder_hold_time, mapped from YANG variable /cluster/designated_forwarder_hold_time (uint16)
If this variable is read-only (config: false) in the
source YANG file, then _set_designated_forwarder_hold_time i... |
Setter method for client mapped from YANG variable/ cluster/ client ( list ) If this variable is read - only ( config: false ) in the source YANG file then _set_client is considered as a private method. Backends looking to populate this variable should do so via calling thisObj. _set_client () directly. | def _set_client(self, v, load=False):
"""
Setter method for client, mapped from YANG variable /cluster/client (list)
If this variable is read-only (config: false) in the
source YANG file, then _set_client is considered as a private
method. Backends looking to populate this variable should
do so ... |
Setter method for client_pw mapped from YANG variable/ cluster/ client_pw ( container ) If this variable is read - only ( config: false ) in the source YANG file then _set_client_pw is considered as a private method. Backends looking to populate this variable should do so via calling thisObj. _set_client_pw () directly... | def _set_client_pw(self, v, load=False):
"""
Setter method for client_pw, mapped from YANG variable /cluster/client_pw (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_client_pw is considered as a private
method. Backends looking to populate this variable ... |
Setter method for ospf mapped from YANG variable/ rbridge_id/ router/ ospf ( list ) If this variable is read - only ( config: false ) in the source YANG file then _set_ospf is considered as a private method. Backends looking to populate this variable should do so via calling thisObj. _set_ospf () directly. | def _set_ospf(self, v, load=False):
"""
Setter method for ospf, mapped from YANG variable /rbridge_id/router/ospf (list)
If this variable is read-only (config: false) in the
source YANG file, then _set_ospf is considered as a private
method. Backends looking to populate this variable should
do s... |
Setter method for site mapped from YANG variable/ overlay_gateway/ site ( list ) If this variable is read - only ( config: false ) in the source YANG file then _set_site is considered as a private method. Backends looking to populate this variable should do so via calling thisObj. _set_site () directly. | def _set_site(self, v, load=False):
"""
Setter method for site, mapped from YANG variable /overlay_gateway/site (list)
If this variable is read-only (config: false) in the
source YANG file, then _set_site is considered as a private
method. Backends looking to populate this variable should
do so ... |
Setter method for domain_name mapped from YANG variable/ protocol/ cfm/ domain_name/ domain_name ( string ) 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... | def _set_domain_name(self, v, load=False):
"""
Setter method for domain_name, mapped from YANG variable /protocol/cfm/domain_name/domain_name (string)
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 p... |
Setter method for domain_level mapped from YANG variable/ protocol/ cfm/ domain_name/ domain_level ( uint32 ) If this variable is read - only ( config: false ) in the source YANG file then _set_domain_level is considered as a private method. Backends looking to populate this variable should do so via calling thisObj. _... | def _set_domain_level(self, v, load=False):
"""
Setter method for domain_level, mapped from YANG variable /protocol/cfm/domain_name/domain_level (uint32)
If this variable is read-only (config: false) in the
source YANG file, then _set_domain_level is considered as a private
method. Backends looking ... |
Setter method for ma_name mapped from YANG variable/ protocol/ cfm/ domain_name/ ma_name ( list ) If this variable is read - only ( config: false ) in the source YANG file then _set_ma_name is considered as a private method. Backends looking to populate this variable should do so via calling thisObj. _set_ma_name () di... | def _set_ma_name(self, v, load=False):
"""
Setter method for ma_name, mapped from YANG variable /protocol/cfm/domain_name/ma_name (list)
If this variable is read-only (config: false) in the
source YANG file, then _set_ma_name is considered as a private
method. Backends looking to populate this varia... |
Setter method for net mapped from YANG variable/ routing_system/ router/ isis/ router_isis_cmds_holder/ net ( list ) If this variable is read - only ( config: false ) in the source YANG file then _set_net is considered as a private method. Backends looking to populate this variable should do so via calling thisObj. _se... | def _set_net(self, v, load=False):
"""
Setter method for net, mapped from YANG variable /routing_system/router/isis/router_isis_cmds_holder/net (list)
If this variable is read-only (config: false) in the
source YANG file, then _set_net is considered as a private
method. Backends looking to populate ... |
Setter method for port_security mapped from YANG variable/ interface/ ethernet/ switchport/ port_security ( container ) If this variable is read - only ( config: false ) in the source YANG file then _set_port_security is considered as a private method. Backends looking to populate this variable should do so via calling... | def _set_port_security(self, v, load=False):
"""
Setter method for port_security, mapped from YANG variable /interface/ethernet/switchport/port_security (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_port_security is considered as a private
method. Backe... |
Setter method for access_mac_vlan_classification mapped from YANG variable/ interface/ ethernet/ switchport/ access_mac_vlan_classification ( container ) If this variable is read - only ( config: false ) in the source YANG file then _set_access_mac_vlan_classification is considered as a private method. Backends looking... | def _set_access_mac_vlan_classification(self, v, load=False):
"""
Setter method for access_mac_vlan_classification, mapped from YANG variable /interface/ethernet/switchport/access_mac_vlan_classification (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_access_... |
Setter method for get_vnetwork_hosts mapped from YANG variable/ brocade_vswitch_rpc/ get_vnetwork_hosts ( rpc ) If this variable is read - only ( config: false ) in the source YANG file then _set_get_vnetwork_hosts is considered as a private method. Backends looking to populate this variable should do so via calling th... | def _set_get_vnetwork_hosts(self, v, load=False):
"""
Setter method for get_vnetwork_hosts, mapped from YANG variable /brocade_vswitch_rpc/get_vnetwork_hosts (rpc)
If this variable is read-only (config: false) in the
source YANG file, then _set_get_vnetwork_hosts is considered as a private
method. B... |
Setter method for get_vnetwork_vms mapped from YANG variable/ brocade_vswitch_rpc/ get_vnetwork_vms ( rpc ) If this variable is read - only ( config: false ) in the source YANG file then _set_get_vnetwork_vms is considered as a private method. Backends looking to populate this variable should do so via calling thisObj.... | def _set_get_vnetwork_vms(self, v, load=False):
"""
Setter method for get_vnetwork_vms, mapped from YANG variable /brocade_vswitch_rpc/get_vnetwork_vms (rpc)
If this variable is read-only (config: false) in the
source YANG file, then _set_get_vnetwork_vms is considered as a private
method. Backends ... |
Setter method for get_vnetwork_dvpgs mapped from YANG variable/ brocade_vswitch_rpc/ get_vnetwork_dvpgs ( rpc ) If this variable is read - only ( config: false ) in the source YANG file then _set_get_vnetwork_dvpgs is considered as a private method. Backends looking to populate this variable should do so via calling th... | def _set_get_vnetwork_dvpgs(self, v, load=False):
"""
Setter method for get_vnetwork_dvpgs, mapped from YANG variable /brocade_vswitch_rpc/get_vnetwork_dvpgs (rpc)
If this variable is read-only (config: false) in the
source YANG file, then _set_get_vnetwork_dvpgs is considered as a private
method. B... |
Setter method for get_vnetwork_dvs mapped from YANG variable/ brocade_vswitch_rpc/ get_vnetwork_dvs ( rpc ) If this variable is read - only ( config: false ) in the source YANG file then _set_get_vnetwork_dvs is considered as a private method. Backends looking to populate this variable should do so via calling thisObj.... | def _set_get_vnetwork_dvs(self, v, load=False):
"""
Setter method for get_vnetwork_dvs, mapped from YANG variable /brocade_vswitch_rpc/get_vnetwork_dvs (rpc)
If this variable is read-only (config: false) in the
source YANG file, then _set_get_vnetwork_dvs is considered as a private
method. Backends ... |
Setter method for get_vnetwork_vswitches mapped from YANG variable/ brocade_vswitch_rpc/ get_vnetwork_vswitches ( rpc ) If this variable is read - only ( config: false ) in the source YANG file then _set_get_vnetwork_vswitches is considered as a private method. Backends looking to populate this variable should do so vi... | def _set_get_vnetwork_vswitches(self, v, load=False):
"""
Setter method for get_vnetwork_vswitches, mapped from YANG variable /brocade_vswitch_rpc/get_vnetwork_vswitches (rpc)
If this variable is read-only (config: false) in the
source YANG file, then _set_get_vnetwork_vswitches is considered as a priva... |
Setter method for get_vnetwork_portgroups mapped from YANG variable/ brocade_vswitch_rpc/ get_vnetwork_portgroups ( rpc ) If this variable is read - only ( config: false ) in the source YANG file then _set_get_vnetwork_portgroups is considered as a private method. Backends looking to populate this variable should do so... | def _set_get_vnetwork_portgroups(self, v, load=False):
"""
Setter method for get_vnetwork_portgroups, mapped from YANG variable /brocade_vswitch_rpc/get_vnetwork_portgroups (rpc)
If this variable is read-only (config: false) in the
source YANG file, then _set_get_vnetwork_portgroups is considered as a p... |
Setter method for get_vmpolicy_macaddr mapped from YANG variable/ brocade_vswitch_rpc/ get_vmpolicy_macaddr ( rpc ) If this variable is read - only ( config: false ) in the source YANG file then _set_get_vmpolicy_macaddr is considered as a private method. Backends looking to populate this variable should do so via call... | def _set_get_vmpolicy_macaddr(self, v, load=False):
"""
Setter method for get_vmpolicy_macaddr, mapped from YANG variable /brocade_vswitch_rpc/get_vmpolicy_macaddr (rpc)
If this variable is read-only (config: false) in the
source YANG file, then _set_get_vmpolicy_macaddr is considered as a private
m... |
Setter method for defined_configuration mapped from YANG variable/ zoning/ defined_configuration ( container ) If this variable is read - only ( config: false ) in the source YANG file then _set_defined_configuration is considered as a private method. Backends looking to populate this variable should do so via calling ... | def _set_defined_configuration(self, v, load=False):
"""
Setter method for defined_configuration, mapped from YANG variable /zoning/defined_configuration (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_defined_configuration is considered as a private
meth... |
Setter method for fabric_virtual_gateway mapped from YANG variable/ router/ fabric_virtual_gateway ( container ) If this variable is read - only ( config: false ) in the source YANG file then _set_fabric_virtual_gateway is considered as a private method. Backends looking to populate this variable should do so via calli... | def _set_fabric_virtual_gateway(self, v, load=False):
"""
Setter method for fabric_virtual_gateway, mapped from YANG variable /router/fabric_virtual_gateway (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_fabric_virtual_gateway is considered as a private
... |
Setter method for get_netconf_client_capabilities mapped from YANG variable/ brocade_netconf_ext_rpc/ get_netconf_client_capabilities ( rpc ) If this variable is read - only ( config: false ) in the source YANG file then _set_get_netconf_client_capabilities is considered as a private method. Backends looking to populat... | def _set_get_netconf_client_capabilities(self, v, load=False):
"""
Setter method for get_netconf_client_capabilities, mapped from YANG variable /brocade_netconf_ext_rpc/get_netconf_client_capabilities (rpc)
If this variable is read-only (config: false) in the
source YANG file, then _set_get_netconf_clie... |
Setter method for receive_machine_state mapped from YANG variable/ brocade_lag_rpc/ get_portchannel_info_by_intf/ output/ lacp/ receive_machine_state ( enumeration ) If this variable is read - only ( config: false ) in the source YANG file then _set_receive_machine_state is considered as a private method. Backends look... | def _set_receive_machine_state(self, v, load=False):
"""
Setter method for receive_machine_state, mapped from YANG variable /brocade_lag_rpc/get_portchannel_info_by_intf/output/lacp/receive_machine_state (enumeration)
If this variable is read-only (config: false) in the
source YANG file, then _set_recei... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.