hexsha
string
size
int64
ext
string
lang
string
max_stars_repo_path
string
max_stars_repo_name
string
max_stars_repo_head_hexsha
string
max_stars_repo_licenses
list
max_stars_count
int64
max_stars_repo_stars_event_min_datetime
string
max_stars_repo_stars_event_max_datetime
string
max_issues_repo_path
string
max_issues_repo_name
string
max_issues_repo_head_hexsha
string
max_issues_repo_licenses
list
max_issues_count
int64
max_issues_repo_issues_event_min_datetime
string
max_issues_repo_issues_event_max_datetime
string
max_forks_repo_path
string
max_forks_repo_name
string
max_forks_repo_head_hexsha
string
max_forks_repo_licenses
list
max_forks_count
int64
max_forks_repo_forks_event_min_datetime
string
max_forks_repo_forks_event_max_datetime
string
content
string
avg_line_length
float64
max_line_length
int64
alphanum_fraction
float64
qsc_code_num_words_quality_signal
int64
qsc_code_num_chars_quality_signal
float64
qsc_code_mean_word_length_quality_signal
float64
qsc_code_frac_words_unique_quality_signal
float64
qsc_code_frac_chars_top_2grams_quality_signal
float64
qsc_code_frac_chars_top_3grams_quality_signal
float64
qsc_code_frac_chars_top_4grams_quality_signal
float64
qsc_code_frac_chars_dupe_5grams_quality_signal
float64
qsc_code_frac_chars_dupe_6grams_quality_signal
float64
qsc_code_frac_chars_dupe_7grams_quality_signal
float64
qsc_code_frac_chars_dupe_8grams_quality_signal
float64
qsc_code_frac_chars_dupe_9grams_quality_signal
float64
qsc_code_frac_chars_dupe_10grams_quality_signal
float64
qsc_code_frac_chars_replacement_symbols_quality_signal
float64
qsc_code_frac_chars_digital_quality_signal
float64
qsc_code_frac_chars_whitespace_quality_signal
float64
qsc_code_size_file_byte_quality_signal
float64
qsc_code_num_lines_quality_signal
float64
qsc_code_num_chars_line_max_quality_signal
float64
qsc_code_num_chars_line_mean_quality_signal
float64
qsc_code_frac_chars_alphabet_quality_signal
float64
qsc_code_frac_chars_comments_quality_signal
float64
qsc_code_cate_xml_start_quality_signal
float64
qsc_code_frac_lines_dupe_lines_quality_signal
float64
qsc_code_cate_autogen_quality_signal
float64
qsc_code_frac_lines_long_string_quality_signal
float64
qsc_code_frac_chars_string_length_quality_signal
float64
qsc_code_frac_chars_long_word_length_quality_signal
float64
qsc_code_frac_lines_string_concat_quality_signal
float64
qsc_code_cate_encoded_data_quality_signal
float64
qsc_code_frac_chars_hex_words_quality_signal
float64
qsc_code_frac_lines_prompt_comments_quality_signal
float64
qsc_code_frac_lines_assert_quality_signal
float64
qsc_codepython_cate_ast_quality_signal
float64
qsc_codepython_frac_lines_func_ratio_quality_signal
float64
qsc_codepython_cate_var_zero_quality_signal
bool
qsc_codepython_frac_lines_pass_quality_signal
float64
qsc_codepython_frac_lines_import_quality_signal
float64
qsc_codepython_frac_lines_simplefunc_quality_signal
float64
qsc_codepython_score_lines_no_logic_quality_signal
float64
qsc_codepython_frac_lines_print_quality_signal
float64
qsc_code_num_words
int64
qsc_code_num_chars
int64
qsc_code_mean_word_length
int64
qsc_code_frac_words_unique
null
qsc_code_frac_chars_top_2grams
int64
qsc_code_frac_chars_top_3grams
int64
qsc_code_frac_chars_top_4grams
int64
qsc_code_frac_chars_dupe_5grams
int64
qsc_code_frac_chars_dupe_6grams
int64
qsc_code_frac_chars_dupe_7grams
int64
qsc_code_frac_chars_dupe_8grams
int64
qsc_code_frac_chars_dupe_9grams
int64
qsc_code_frac_chars_dupe_10grams
int64
qsc_code_frac_chars_replacement_symbols
int64
qsc_code_frac_chars_digital
int64
qsc_code_frac_chars_whitespace
int64
qsc_code_size_file_byte
int64
qsc_code_num_lines
int64
qsc_code_num_chars_line_max
int64
qsc_code_num_chars_line_mean
int64
qsc_code_frac_chars_alphabet
int64
qsc_code_frac_chars_comments
int64
qsc_code_cate_xml_start
int64
qsc_code_frac_lines_dupe_lines
int64
qsc_code_cate_autogen
int64
qsc_code_frac_lines_long_string
int64
qsc_code_frac_chars_string_length
int64
qsc_code_frac_chars_long_word_length
int64
qsc_code_frac_lines_string_concat
null
qsc_code_cate_encoded_data
int64
qsc_code_frac_chars_hex_words
int64
qsc_code_frac_lines_prompt_comments
int64
qsc_code_frac_lines_assert
int64
qsc_codepython_cate_ast
int64
qsc_codepython_frac_lines_func_ratio
int64
qsc_codepython_cate_var_zero
int64
qsc_codepython_frac_lines_pass
int64
qsc_codepython_frac_lines_import
int64
qsc_codepython_frac_lines_simplefunc
int64
qsc_codepython_score_lines_no_logic
int64
qsc_codepython_frac_lines_print
int64
effective
string
hits
int64
123adcf3a231401c540c1189aa47ebd9b4e3f560
541
py
Python
object_detection2/mot_toolkit/tracking_utils/utils.py
vghost2008/wml
d0c5a1da6c228e321ae59a563e9ac84aa66266ff
[ "MIT" ]
6
2019-12-10T17:18:56.000Z
2022-03-01T01:00:35.000Z
object_detection2/mot_toolkit/tracking_utils/utils.py
vghost2008/wml
d0c5a1da6c228e321ae59a563e9ac84aa66266ff
[ "MIT" ]
2
2021-08-25T16:16:01.000Z
2022-02-10T05:21:19.000Z
object_detection2/mot_toolkit/tracking_utils/utils.py
vghost2008/wml
d0c5a1da6c228e321ae59a563e9ac84aa66266ff
[ "MIT" ]
2
2019-12-07T09:57:35.000Z
2021-09-06T04:58:10.000Z
import glob import random import time import os import os.path as osp import cv2 import matplotlib.pyplot as plt import numpy as np #import maskrcnn_benchmark.layers.nms as nms # Set printoptions np.set_printoptions(linewidth=320, formatter={'float_kind': '{:11.5g}'.format}) # format short g, %precision=5 def mkdir_if_missing(d): if not osp.exists(d): os.makedirs(d) def float3(x): # format floats to 3 decimals return float(format(x, '.3f')) def init_seeds(seed=0): random.seed(seed) np.random.seed(seed)
20.037037
111
0.719039
87
541
4.402299
0.597701
0.041775
0.073107
0
0
0
0
0
0
0
0
0.026667
0.168207
541
26
112
20.807692
0.824444
0.216266
0
0
0
0
0.05
0
0
0
0
0
0
1
0.176471
false
0
0.470588
0.058824
0.705882
0.058824
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
124f44f3d08bb93fcb25b0a56a2543d527b7880e
350
py
Python
remote_controller.py
ProjectifyOfficial/automatic-gate-opener-rpy
9b66d9f078c6be66b9139114811305b3e6b2c124
[ "MIT" ]
10
2017-07-06T22:54:10.000Z
2021-02-23T14:26:03.000Z
remote_controller.py
ProjectifyOfficial/automatic-gate-opener-rpy
9b66d9f078c6be66b9139114811305b3e6b2c124
[ "MIT" ]
null
null
null
remote_controller.py
ProjectifyOfficial/automatic-gate-opener-rpy
9b66d9f078c6be66b9139114811305b3e6b2c124
[ "MIT" ]
1
2020-06-22T17:49:35.000Z
2020-06-22T17:49:35.000Z
import RPi.GPIO as GPIO import time def toggle_relay(number): GPIO.setmode(GPIO.BCM) GPIO.setup(number, GPIO.OUT) try: GPIO.output(number, GPIO.LOW) time.sleep(1) GPIO.output(number, GPIO.HIGH) print "OFF" except KeyboardInterrupt: print "exit" # Reset GPIO settings GPIO.cleanup()
14.583333
37
0.622857
45
350
4.822222
0.6
0.184332
0.147465
0.184332
0
0
0
0
0
0
0
0.003937
0.274286
350
23
38
15.217391
0.850394
0.054286
0
0
0
0
0.021472
0
0
0
0
0
0
0
null
null
0
0.153846
null
null
0.153846
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
89c7260af4edc1a5cc77b6dc4b2b4738d5c0a753
364
py
Python
psi/core/enaml/manifest.py
bburan/psiexperiment
9b70f7f0b4a4379d8c3fc463e1df272153afd247
[ "MIT" ]
5
2016-05-26T13:46:00.000Z
2020-03-03T13:07:47.000Z
psi/core/enaml/manifest.py
bburan/psiexperiment
9b70f7f0b4a4379d8c3fc463e1df272153afd247
[ "MIT" ]
2
2018-04-17T15:06:35.000Z
2019-03-25T18:13:10.000Z
psi/core/enaml/manifest.py
bburan/psiexperiment
9b70f7f0b4a4379d8c3fc463e1df272153afd247
[ "MIT" ]
1
2016-05-28T19:36:38.000Z
2016-05-28T19:36:38.000Z
from atom.api import Typed, Property from enaml.workbench.api import PluginManifest from .contribution import PSIContribution class PSIManifest(PluginManifest): contribution = Typed(PSIContribution) id = Property(cached=True) def _get_id(self): class_type = self.__class__.__name__ return f'{self.contribution.name}.{class_type}'
22.75
55
0.747253
42
364
6.190476
0.547619
0.069231
0
0
0
0
0
0
0
0
0
0
0.17033
364
15
56
24.266667
0.860927
0
0
0
0
0
0.101648
0.101648
0
0
0
0
0
1
0.111111
false
0
0.333333
0
0.888889
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
89d21653403e5a1ee5e3bad611ce4ea7c9fdd26c
424
py
Python
tests/opera/parser/tosca/v_1_3/test_node_filter_definition.py
sstanovnik/xopera-opera
06031d37268913c6ba6dbc30ec6b4acb3a17dc5a
[ "Apache-2.0" ]
null
null
null
tests/opera/parser/tosca/v_1_3/test_node_filter_definition.py
sstanovnik/xopera-opera
06031d37268913c6ba6dbc30ec6b4acb3a17dc5a
[ "Apache-2.0" ]
null
null
null
tests/opera/parser/tosca/v_1_3/test_node_filter_definition.py
sstanovnik/xopera-opera
06031d37268913c6ba6dbc30ec6b4acb3a17dc5a
[ "Apache-2.0" ]
null
null
null
from opera.parser.tosca.v_1_3.node_filter_definition import ( NodeFilterDefinition, ) class TestParse: def test_full(self, yaml_ast): NodeFilterDefinition.parse(yaml_ast( """ properties: - num_cpus: { in_range: [ 3, 6 ] } capabilities: [] """ )) def test_minimal(self, yaml_ast): NodeFilterDefinition.parse(yaml_ast("{}"))
23.555556
61
0.575472
42
424
5.52381
0.690476
0.12069
0.094828
0.267241
0.37069
0.37069
0.37069
0
0
0
0
0.013699
0.311321
424
17
62
24.941176
0.780822
0
0
0
0
0
0.006601
0
0
0
0
0
0
1
0.222222
false
0
0.111111
0
0.444444
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
2
89e6694c79f36c23d2981e1c4bf2805232540759
936
py
Python
scripts/license/verify.py
enterstudio/azure-cli
b0504c3b634e17f1afc944a9572864a40da6bc18
[ "MIT" ]
11
2017-05-24T05:57:41.000Z
2022-03-21T13:05:25.000Z
scripts/license/verify.py
enterstudio/azure-cli
b0504c3b634e17f1afc944a9572864a40da6bc18
[ "MIT" ]
87
2017-03-16T21:04:59.000Z
2022-03-31T13:59:20.000Z
scripts/license/verify.py
enterstudio/azure-cli
b0504c3b634e17f1afc944a9572864a40da6bc18
[ "MIT" ]
20
2017-03-15T23:04:28.000Z
2021-01-20T00:26:05.000Z
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Verify that all *.py files have a license header in the file. from __future__ import print_function import sys from _common import get_files_without_header files_without_header = [file_path for file_path, file_contents in get_files_without_header()] if files_without_header: print("Error: The following files don't have the required license headers:", file=sys.stderr) print('\n'.join(files_without_header), file=sys.stderr) print("Error: {} file(s) found without license headers.".format(len(files_without_header)), file=sys.stderr) sys.exit(1) else: print('OK')
42.545455
112
0.613248
113
936
4.876106
0.495575
0.130672
0.196007
0.119782
0.112523
0.112523
0
0
0
0
0
0.001209
0.116453
936
21
113
44.571429
0.665054
0.425214
0
0
0
0
0.223684
0
0
0
0
0
0
1
0
false
0
0.272727
0
0.272727
0.454545
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
2
89ea0540d41a56ec4ed426549db4eb3835759d9c
58
py
Python
competition/DrEvil.py
hdert/2018.py
66fc5afc853af2ed5d6b2fc5f280e73be200a542
[ "BSD-3-Clause" ]
null
null
null
competition/DrEvil.py
hdert/2018.py
66fc5afc853af2ed5d6b2fc5f280e73be200a542
[ "BSD-3-Clause" ]
null
null
null
competition/DrEvil.py
hdert/2018.py
66fc5afc853af2ed5d6b2fc5f280e73be200a542
[ "BSD-3-Clause" ]
null
null
null
w = input() for i in reversed(w): print(i, end='')
14.5
22
0.517241
10
58
3
0.8
0
0
0
0
0
0
0
0
0
0
0
0.275862
58
3
23
19.333333
0.714286
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
d62183cd0f6361556914f0d3f882d20962a2bb59
3,872
py
Python
tests/components/zoneminder/test_config_flow.py
ccatterina/core
36789cfc310f270bf343676eb94d123e5d0dfa83
[ "Apache-2.0" ]
1
2020-04-30T04:58:17.000Z
2020-04-30T04:58:17.000Z
tests/components/zoneminder/test_config_flow.py
ccatterina/core
36789cfc310f270bf343676eb94d123e5d0dfa83
[ "Apache-2.0" ]
45
2020-07-23T17:47:56.000Z
2022-03-31T06:02:00.000Z
tests/components/zoneminder/test_config_flow.py
ccatterina/core
36789cfc310f270bf343676eb94d123e5d0dfa83
[ "Apache-2.0" ]
null
null
null
"""Config flow tests.""" import requests from zoneminder.zm import ZoneMinder from homeassistant import config_entries from homeassistant.components.zoneminder import ClientAvailabilityResult, const from homeassistant.const import ( CONF_HOST, CONF_PASSWORD, CONF_PATH, CONF_SOURCE, CONF_SSL, CONF_USERNAME, CONF_VERIFY_SSL, ) from homeassistant.core import HomeAssistant from tests.async_mock import MagicMock, patch async def test_import(hass: HomeAssistant) -> None: """Test import from configuration yaml.""" with patch( "homeassistant.components.zoneminder.common.ZoneMinder", autospec=ZoneMinder ) as zoneminder_mock: conf_data = { CONF_HOST: "host1", CONF_USERNAME: "username1", CONF_PASSWORD: "password1", CONF_PATH: "path1", const.CONF_PATH_ZMS: "path_zms1", CONF_SSL: False, CONF_VERIFY_SSL: True, } zm_client: ZoneMinder = MagicMock(spec=ZoneMinder) zm_client.get_zms_url.return_value = "http://host1/path_zms1" zoneminder_mock.return_value = zm_client zm_client.login.return_value = False result = await hass.config_entries.flow.async_init( const.DOMAIN, context={"source": config_entries.SOURCE_IMPORT}, data=conf_data, ) assert result assert result["type"] == "abort" assert result["reason"] == "invalid_auth" zm_client.login.return_value = True result = await hass.config_entries.flow.async_init( const.DOMAIN, context={"source": config_entries.SOURCE_IMPORT}, data=conf_data, ) assert result assert result["type"] == "create_entry" assert result["data"] == { **conf_data, CONF_SOURCE: config_entries.SOURCE_IMPORT, } async def test_user(hass: HomeAssistant) -> None: """Test user initiated creation.""" with patch( "homeassistant.components.zoneminder.common.ZoneMinder", autospec=ZoneMinder ) as zoneminder_mock: conf_data = { CONF_HOST: "host1", CONF_USERNAME: "username1", CONF_PASSWORD: "password1", CONF_PATH: "path1", const.CONF_PATH_ZMS: "path_zms1", CONF_SSL: False, CONF_VERIFY_SSL: True, } result = await hass.config_entries.flow.async_init( const.DOMAIN, context={"source": config_entries.SOURCE_USER} ) assert result assert result["type"] == "form" zm_client: ZoneMinder = MagicMock(spec=ZoneMinder) zoneminder_mock.return_value = zm_client zm_client.login.side_effect = requests.exceptions.ConnectionError() result = await hass.config_entries.flow.async_configure( result["flow_id"], conf_data, ) assert result assert result["type"] == "form" assert result["errors"] == { "base": ClientAvailabilityResult.ERROR_CONNECTION_ERROR.value } zm_client.login.side_effect = None zm_client.login.return_value = False result = await hass.config_entries.flow.async_configure( result["flow_id"], conf_data, ) assert result assert result["type"] == "form" assert result["errors"] == { "base": ClientAvailabilityResult.ERROR_AUTH_FAIL.value } zm_client.login.return_value = True zm_client.get_zms_url.return_value = "http://host1/path_zms1" result = await hass.config_entries.flow.async_configure( result["flow_id"], conf_data, ) assert result assert result["type"] == "create_entry" assert result["data"] == conf_data
32.266667
84
0.620351
408
3,872
5.632353
0.198529
0.088773
0.033943
0.05483
0.74369
0.71584
0.643603
0.643603
0.643603
0.609225
0
0.005049
0.283833
3,872
119
85
32.537815
0.823657
0.004649
0
0.617647
0
0
0.099178
0.028109
0
0
0
0
0.166667
1
0
false
0.029412
0.107843
0
0.107843
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
d6319b9866ac48b016d77b1dbbcdda9f3f92feb9
462
py
Python
esipy/__init__.py
cbz/EsiPy
5e1d396e190ca43c0bc3c9c44137ffcc6f93e0e9
[ "BSD-3-Clause" ]
null
null
null
esipy/__init__.py
cbz/EsiPy
5e1d396e190ca43c0bc3c9c44137ffcc6f93e0e9
[ "BSD-3-Clause" ]
null
null
null
esipy/__init__.py
cbz/EsiPy
5e1d396e190ca43c0bc3c9c44137ffcc6f93e0e9
[ "BSD-3-Clause" ]
null
null
null
# -*- encoding: utf-8 -*- """ Entry point of EsiPy, also contains shortcuts for all required objects """ from __future__ import absolute_import try: from .client import EsiClient # noqa from .security import EsiSecurity # noqa from .app import EsiApp # noqa from pyswagger import App # noqa except ImportError: # pragma: no cover # Not installed or in install (not yet installed) so ignore pass __version__ = '1.1.0'
30.8
79
0.679654
60
462
5.083333
0.733333
0.078689
0
0
0
0
0
0
0
0
0
0.011461
0.244589
462
14
80
33
0.862464
0.41342
0
0
0
0
0.020492
0
0
0
0
0
0
1
0
false
0.111111
0.666667
0
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
0
0
0
2
d6351439db635c1bb0d152a2522c89e49b93fd64
511
py
Python
exercises/patterns/src/house.py
bmazey/summer2020
0e943c356677f1d0ec55da5fe4b30a54b37507cd
[ "MIT" ]
null
null
null
exercises/patterns/src/house.py
bmazey/summer2020
0e943c356677f1d0ec55da5fe4b30a54b37507cd
[ "MIT" ]
null
null
null
exercises/patterns/src/house.py
bmazey/summer2020
0e943c356677f1d0ec55da5fe4b30a54b37507cd
[ "MIT" ]
null
null
null
class House: """All houses have rooms, a type of roof, and may have a porch.""" def __init__(self): self.__rooms = list() self.__roof = None self.__porch = False def add_room(self, room): self.__rooms.append(room) def set_roof(self, roof): self.__roof = roof def set_porch(self, porch): self.__porch = porch def __str__(self): return 'rooms: ' + str(self.__rooms) + '\nroof: ' + self.__roof + '\nporch: ' + str(self.__porch)
24.333333
105
0.585127
67
511
4.029851
0.402985
0.118519
0.088889
0
0
0
0
0
0
0
0
0
0.283757
511
20
106
25.55
0.737705
0.117417
0
0
0
0
0.054176
0
0
0
0
0
0
1
0.384615
false
0
0
0.076923
0.538462
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
d6490b7b8fa86ad8f795465aedaf115def64ea6c
133
py
Python
autogluon_utils/benchmarking/baselines/autopilot/autopilot_aws_config.py
jwmueller/autogluon-benchmarking
28f35188a65c5fb37d4950fa9657ea84c9163049
[ "Apache-2.0" ]
15
2020-03-18T21:07:33.000Z
2022-01-11T20:21:21.000Z
autogluon_utils/benchmarking/baselines/autopilot/autopilot_aws_config.py
jwmueller/autogluon-benchmarking
28f35188a65c5fb37d4950fa9657ea84c9163049
[ "Apache-2.0" ]
5
2020-04-10T07:41:02.000Z
2022-01-11T23:49:42.000Z
autogluon_utils/benchmarking/baselines/autopilot/autopilot_aws_config.py
jwmueller/autogluon-benchmarking
28f35188a65c5fb37d4950fa9657ea84c9163049
[ "Apache-2.0" ]
5
2020-03-13T21:21:48.000Z
2021-02-01T23:39:20.000Z
DEFAULT_AUTOPILOT_CONFIG = { 'region_name': 'YOUR_REGION', 's3_bucket': 'YOUR_S3_BUCKET', 'role_arn': 'YOUR_ROLE_ARN', }
22.166667
34
0.676692
17
133
4.705882
0.588235
0.2
0
0
0
0
0
0
0
0
0
0.018018
0.165414
133
5
35
26.6
0.702703
0
0
0
0
0
0.496241
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
c38b7501f92db8758614e08a5045465f32e6ecda
265
py
Python
code/abc016_3_01.py
KoyanagiHitoshi/AtCoder
731892543769b5df15254e1f32b756190378d292
[ "MIT" ]
3
2019-08-16T16:55:48.000Z
2021-04-11T10:21:40.000Z
code/abc016_3_01.py
KoyanagiHitoshi/AtCoder
731892543769b5df15254e1f32b756190378d292
[ "MIT" ]
null
null
null
code/abc016_3_01.py
KoyanagiHitoshi/AtCoder
731892543769b5df15254e1f32b756190378d292
[ "MIT" ]
null
null
null
V,E=map(int,input().split()) edges=[set() for i in range(V)] for i in range(E): a,b=map(int,input().split()) edges[a-1].add(b-1) edges[b-1].add(a-1) for i in range(V): print(len({n for v in edges[i] for n in edges[v] if not n in edges[i] and n!=i}))
33.125
85
0.588679
63
265
2.47619
0.349206
0.076923
0.115385
0.211538
0.423077
0
0
0
0
0
0
0.018433
0.181132
265
8
85
33.125
0.700461
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.125
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
c39342de8f133b1d0897e8b8ffc50921643a5dce
251
py
Python
digitsort.py
krishna-prasath/My_programs
96bac29eb448beda2dda439ac7adea7a5343c066
[ "bzip2-1.0.6" ]
null
null
null
digitsort.py
krishna-prasath/My_programs
96bac29eb448beda2dda439ac7adea7a5343c066
[ "bzip2-1.0.6" ]
null
null
null
digitsort.py
krishna-prasath/My_programs
96bac29eb448beda2dda439ac7adea7a5343c066
[ "bzip2-1.0.6" ]
null
null
null
a=[12,9,1,3] a1=[12,9,1,3] s=[] z=0 c=0 #expected a=[1,3,12,9] for i in range(len(a)): q=0 while(a1[i]>0): z=a1[i]%10 q=q+z a1[i]=a1[i]//10 s.append(q) print(a) s.sort() print(s)
14.764706
25
0.398406
54
251
1.851852
0.407407
0.12
0.08
0.1
0
0
0
0
0
0
0
0.176101
0.366534
251
16
26
15.6875
0.45283
0.083665
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.133333
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
c39e41ac2813050f7d5dfaaa13c7a985804afc3d
233
py
Python
ion1/ion_test.py
bocklund/database-concepts
0b5c95b9f09d8d5963ec23fa52f2feb708eebbb7
[ "MIT" ]
1
2021-08-13T19:46:29.000Z
2021-08-13T19:46:29.000Z
ion1/ion_test.py
bocklund/database-concepts
0b5c95b9f09d8d5963ec23fa52f2feb708eebbb7
[ "MIT" ]
1
2022-03-23T19:06:47.000Z
2022-03-24T20:24:43.000Z
ion1/ion_test.py
bocklund/database-concepts
0b5c95b9f09d8d5963ec23fa52f2feb708eebbb7
[ "MIT" ]
1
2022-02-02T06:57:27.000Z
2022-02-02T06:57:27.000Z
from pycalphad import Database, Model, calculate, variables as v import ion_parser dbf_ion = Database('test.ion') mod = Model(dbf_ion, ['AL', 'ZN'], 'LIQUID') res = calculate(dbf_ion, ['AL', 'ZN'], 'LIQUID', T=600, P=1e5) print(res)
33.285714
64
0.690987
37
233
4.243243
0.621622
0.11465
0.101911
0.127389
0.203822
0
0
0
0
0
0
0.02451
0.124464
233
7
65
33.285714
0.745098
0
0
0
0
0
0.119658
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0.166667
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
c39fce3b3888b1767c22182814d81e1367c41252
2,401
py
Python
tests/test_gtin.py
asyncee/gtin
faa4e3d983080674e68394a6448e89e5055cd3b3
[ "MIT" ]
null
null
null
tests/test_gtin.py
asyncee/gtin
faa4e3d983080674e68394a6448e89e5055cd3b3
[ "MIT" ]
null
null
null
tests/test_gtin.py
asyncee/gtin
faa4e3d983080674e68394a6448e89e5055cd3b3
[ "MIT" ]
null
null
null
from decimal import Decimal from gtin import GTIN from gtin.gcp import GCP_PREFIXES def test_check_digit(): assert GTIN(raw=890123456789).check_digit == '0' assert GTIN(raw=10101).check_digit == '1' assert GTIN(raw=567898901234).check_digit == '2' assert GTIN(raw=82957399425).check_digit == '3' assert GTIN(raw=5936663101).check_digit == '4' assert GTIN(raw=15059928976).check_digit == '5' assert GTIN(raw=901234567890).check_digit == '6' assert GTIN(raw=36013101).check_digit == '7' assert GTIN(raw=123456789012).check_digit == '8' assert GTIN(raw=208957399425).check_digit == '9' def test_str(): # 14-digit # str - implicit length assert str(GTIN(raw='0123456789012')) == '01234567890128' # str - explicit length assert str(GTIN(raw='0123456789012', length=14)) == '01234567890128' # int - implicit length assert str(GTIN(raw=123456789012)) == '01234567890128' # int - explicit length assert str(GTIN(raw=123456789012, length=14)) == '01234567890128' # 12-digit # str - implicit length assert str(GTIN(raw='01234567890')) == '012345678905' # str - explicit length assert str(GTIN(raw='01234567890', length=12)) == '012345678905' # int assert str(GTIN(raw=1234567890, length=12)) == '012345678905' # 8-digit # str - implicit length assert str(GTIN(raw='0123456')) == '01234565' # str - explicit length assert str(GTIN(raw='0123456', length=8)) == '01234565' # int assert str(GTIN(raw=123456, length=8)) == '01234565' # Verify that an invalid type throws an error error = None # float - implicit length try: str(GTIN(raw=123456789012.0)) == '01234567890128' except TypeError as e: error = e assert isinstance(error, TypeError) def test_gcp(): # GS1 US assert GCP_PREFIXES['03321'] == 6 assert GTIN('00332100000001').gcp == '033210' assert GCP_PREFIXES['0810000'] == 9 # Restricted distribution assert '2' not in GCP_PREFIXES assert '02' not in GCP_PREFIXES # Test restricted distribution GCPs assert GTIN('02345678901289').gcp == '' assert GTIN('00234567890129').gcp == '' # Test a missing GCP assert GTIN('01345678901280').gcp == '' # Test refreshing XML GCP_PREFIXES.refresh() if __name__ == '__main__': test_check_digit() test_str() test_gcp()
30.782051
72
0.658892
295
2,401
5.254237
0.288136
0.094839
0.070968
0.103226
0.256129
0.231613
0.137419
0.073548
0
0
0
0.239348
0.208247
2,401
77
73
31.181818
0.576013
0.1591
0
0
0
0
0.143644
0
0
0
0
0
0.644444
1
0.066667
false
0
0.066667
0
0.133333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
2
c3a7863e0812b836e2853495c175e6c5b085a351
1,452
py
Python
sequence_assembly/tyranniSQL/DbFactoryMP.py
mgharvey/tyranni
859f162e55124c72603f25b21172ac0b63188203
[ "BSD-3-Clause" ]
7
2021-02-03T17:36:08.000Z
2022-02-07T22:36:17.000Z
sequence_assembly/tyranniSQL/DbFactoryMP.py
mgharvey/tyranni
859f162e55124c72603f25b21172ac0b63188203
[ "BSD-3-Clause" ]
null
null
null
sequence_assembly/tyranniSQL/DbFactoryMP.py
mgharvey/tyranni
859f162e55124c72603f25b21172ac0b63188203
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python2 from __future__ import print_function import itertools, os from multiprocessing import RLock, Pool, Process """ Name: PipelineDb.py Author: Graham E Derryberry Date: 11 September 2016 Description: Tools for handling MP access to PipelineDb. """ global db_factory_singleton = None db_pool = None; def master_init(pdb): "Called to set connection arguments for the workers andd initialize the pool" pass def worker_init(db_factory): "Passed to the pool to initialize the workers" pass class DbFactory(Object): """The factory object As I plan on making this some form of singleton, I probably should make this class a new style class that inherits from Object. Upon initiation, the singleton instance either inherits or creates a PipelineDb object, known as master. MP calls are worked such that when foo.pldb is None, DbFactory.getPLDB() is called. DbFactory then grabs the singleton, and checks to see if the current process has a PipelineDb object. If not, master is cloned to create the current process instance. The instance for current process is then returned. """ def __new__(cls): """Grab the singleton""" pass self._master self._local def getPLDB(): """Get the pipeline db for the current process""" if db_factory_singleton is None: db_factory_singleton=DbFactory() return db_factory_singleton._getPLDB() def _getPLDB(self): """The local instance accessor""" pass
24.610169
84
0.761019
216
1,452
5
0.50463
0.041667
0.066667
0
0
0
0
0
0
0
0
0.005838
0.174242
1,452
59
85
24.610169
0.894912
0.014463
0
0.181818
0
0
0.196694
0
0
0
0
0
0
0
null
null
0.227273
0.136364
null
null
0.045455
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
1
0
0
0
0
0
2
c3ac409b244e4a3e65e61875ce237bd2ef64fbc8
8,474
py
Python
videos/tests/test_tasks.py
robcharlwood/you-judge
16c15c8ac725f364fdfe0c48b7485d747d38c4d3
[ "MIT" ]
5
2018-11-05T14:51:08.000Z
2020-11-29T10:32:20.000Z
videos/tests/test_tasks.py
robcharlwood/you-judge
16c15c8ac725f364fdfe0c48b7485d747d38c4d3
[ "MIT" ]
41
2018-07-30T19:49:30.000Z
2021-12-13T19:49:06.000Z
videos/tests/test_tasks.py
robcharlwood/you-judge
16c15c8ac725f364fdfe0c48b7485d747d38c4d3
[ "MIT" ]
1
2021-03-01T09:24:59.000Z
2021-03-01T09:24:59.000Z
from djangae.test import TestCase import mock from core.tests.factories import VideoCommentFactory, VideoFactory from videos.models import VideoComment from videos.tasks import ( cloudnlp_analyze_comment, cloudnlp_analyze_transcript, youtube_import_comments, youtube_import_transcript ) class YoutubeImportCommentsTestCase(TestCase): def test_video_does_not_exist(self): resp = youtube_import_comments(9999) self.assertEqual(None, resp) self.assertEqual(0, len(VideoComment.objects.all())) def test_youtube_client_exception(self): video = VideoFactory() service = mock.Mock() service.get_video_comments.side_effect = Exception with mock.patch('videos.tasks.youtube.Client') as mock_yt: mock_yt.return_value = service resp = youtube_import_comments(video.pk) self.assertEqual(None, resp) self.assertEqual(0, len(VideoComment.objects.all())) def test_no_comments_returned(self): video = VideoFactory() service = mock.Mock() service.get_video_comments.return_value = [] with mock.patch('videos.tasks.youtube.Client') as mock_yt: mock_yt.return_value = service resp = youtube_import_comments(video.pk) self.assertEqual(None, resp) self.assertEqual(0, len(VideoComment.objects.all())) def test_ok(self): expected_comments = [{ u'snippet': { u'totalReplyCount': 500, u'canReply': False, u'topLevelComment': { u'snippet': { u'authorChannelUrl': u'http://sample.com/channel/', u'authorDisplayName': u'Some display name', u'updatedAt': u'2018-01-01T00:00:00.000Z', u'videoId': u'video1234', u'publishedAt': u'2018-01-01T00:00:00.000Z', u'viewerRating': u'none', u'authorChannelId': { u'value': u'channel1234' }, u'canRate': True, u'textOriginal': u"Original text", u'likeCount': 7336, u'authorProfileImageUrl': u'http://sample.com/pic.jpg', u'textDisplay': u'Display text' }, u'kind': u'youtube#comment', u'etag': u'"etag/123456789"', u'id': u'comment1234' }, u'videoId': u'video1234', u'isPublic': True }, u'kind': u'youtube#commentThread', u'etag': u'"foobarblah123456789"', u'id': u'thread1234' }] video = VideoFactory() service = mock.Mock() service.get_video_comments.return_value = expected_comments with mock.patch('videos.tasks.youtube.Client') as mock_yt: mock_yt.return_value = service resp = youtube_import_comments(video.pk) self.assertEqual(None, resp) self.assertEqual(1, len(VideoComment.objects.all())) class YoutubeImportTranscriptTestCase(TestCase): def test_video_does_not_exist(self): resp = youtube_import_transcript(9999) self.assertEqual(None, resp) def test_youtube_client_exception(self): video = VideoFactory(transcript='') service = mock.Mock() service.get_video_transcript.side_effect = Exception with mock.patch('videos.tasks.youtube.Client') as mock_yt: mock_yt.return_value = service resp = youtube_import_transcript(video.pk) self.assertEqual(None, resp) video.refresh_from_db() self.assertEqual('', video.transcript) self.assertEqual(False, video.transcript_failed) def test_no_transcript_returned(self): video = VideoFactory(transcript='') service = mock.Mock() service.get_video_transcript.return_value = None with mock.patch('videos.tasks.youtube.Client') as mock_yt: mock_yt.return_value = service resp = youtube_import_transcript(video.pk) self.assertEqual(None, resp) video.refresh_from_db() self.assertEqual('', video.transcript) self.assertEqual(True, video.transcript_failed) def test_ok(self): video = VideoFactory(transcript='') service = mock.Mock() service.get_video_transcript.return_value = 'Im a transcript.' with mock.patch('videos.tasks.youtube.Client') as mock_yt: mock_yt.return_value = service resp = youtube_import_transcript(video.pk) self.assertEqual(None, resp) video.refresh_from_db() self.assertEqual(video.transcript, 'Im a transcript.') self.assertEqual(False, video.transcript_failed) class CloudnlpAnalyzeTranscriptTestCase(TestCase): def test_video_does_not_exist(self): resp = cloudnlp_analyze_transcript(9999) self.assertEqual(None, resp) def test_video_does_not_have_transcript(self): video = VideoFactory(transcript='') resp = cloudnlp_analyze_transcript(video.pk) self.assertEqual(None, resp) video.refresh_from_db() self.assertEqual({}, video.analyzed_transcript) self.assertEqual(0, video.sentiment) self.assertEqual(0, video.magnitude) def test_cloudnlp_client_exception(self): video = VideoFactory(transcript='Hello world!') service = mock.Mock() service.analyze_sentiment.side_effect = Exception with mock.patch('videos.tasks.cloudnlp.Client') as mock_cloudnlp: mock_cloudnlp.return_value = service resp = cloudnlp_analyze_transcript(video.pk) self.assertEqual(None, resp) video.refresh_from_db() self.assertEqual({}, video.analyzed_transcript) self.assertEqual(0, video.sentiment) self.assertEqual(0, video.magnitude) def test_ok(self): mock_analysis = { 'documentSentiment': { 'score': -0.8, 'magnitude': 17.0 } } video = VideoFactory(transcript='Hello world!') service = mock.Mock() service.analyze_sentiment.return_value = mock_analysis with mock.patch('videos.tasks.cloudnlp.Client') as mock_cloudnlp: mock_cloudnlp.return_value = service resp = cloudnlp_analyze_transcript(video.pk) self.assertEqual(None, resp) video.refresh_from_db() self.assertEqual(mock_analysis, video.analyzed_transcript) self.assertEqual(-0.8, video.sentiment) self.assertEqual(17.0, video.magnitude) class CloudnlpAnalyzeCommentTestCase(TestCase): def test_comment_does_not_exist(self): resp = cloudnlp_analyze_comment(9999) self.assertEqual(None, resp) def test_cloudnlp_client_exception(self): comment = VideoCommentFactory(comment_raw='Hello world!') service = mock.Mock() service.analyze_sentiment.side_effect = Exception with mock.patch('videos.tasks.cloudnlp.Client') as mock_cloudnlp: mock_cloudnlp.return_value = service resp = cloudnlp_analyze_comment(comment.pk) self.assertEqual(None, resp) comment.refresh_from_db() self.assertEqual({}, comment.analyzed_comment) self.assertEqual(0, comment.sentiment) self.assertEqual(0, comment.magnitude) self.assertEqual(True, comment.analysis_failed) def test_ok(self): mock_analysis = { 'documentSentiment': { 'score': -0.8, 'magnitude': 17.0 } } comment = VideoCommentFactory(comment_raw='Hello world!') service = mock.Mock() service.analyze_sentiment.return_value = mock_analysis with mock.patch('videos.tasks.cloudnlp.Client') as mock_cloudnlp: mock_cloudnlp.return_value = service resp = cloudnlp_analyze_comment(comment.pk) self.assertEqual(None, resp) comment.refresh_from_db() self.assertEqual(mock_analysis, comment.analyzed_comment) self.assertEqual(-0.8, comment.sentiment) self.assertEqual(17.0, comment.magnitude) self.assertEqual(False, comment.analysis_failed)
40.161137
79
0.622846
894
8,474
5.710291
0.137584
0.123408
0.055828
0.067581
0.773359
0.731636
0.698531
0.662292
0.628208
0.620372
0
0.020435
0.278145
8,474
210
80
40.352381
0.814125
0
0
0.608466
0
0
0.108921
0.045433
0
0
0
0
0.222222
1
0.079365
false
0
0.089947
0
0.190476
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
c3eb3874109e4c7c9278b7e05a57861915fa5057
1,316
py
Python
dive/BaseHTMLProcessor.py
abos5/pythontutor
eba451700def8bd98d74668d1b6cc08c0ccc0d3c
[ "MIT" ]
null
null
null
dive/BaseHTMLProcessor.py
abos5/pythontutor
eba451700def8bd98d74668d1b6cc08c0ccc0d3c
[ "MIT" ]
null
null
null
dive/BaseHTMLProcessor.py
abos5/pythontutor
eba451700def8bd98d74668d1b6cc08c0ccc0d3c
[ "MIT" ]
null
null
null
from sgmllib import SGMLParser import htmlentitydefs class BaseHTMLProcessor(SGMLParser): def reset(self): self.pieces = [] SGMLParser.reset(self) def unknown_starttag(self, tag, attrs): """ attrs is a list of (attr, value) tuples e.g. for <pre class="screen">, tag="pre", attrs=[("class", "screen")] """ starttrs = "".join(['%s="%s"' % (key, value) for key, value in attrs]) self.pieces.append("<%(tag)s %(starttrs)s>" % locals()) def unknown_endtag(self, tag): self.pieces.append("</%(tag)s>" % locals()) def handle_charref(self, ref): self.pieces.append("&#%(ref)s;" % locals()) def handle_entityref(self, ref): self.pieces.append("&#%(ref)s" % locals()) if ref in htmlentitydefs.entitydefs: self.pieces.append(";") def handle_data(self, text): self.pieces.append(text) def handle_comment(self, text): self.pieces.append("<!-%(text)s->" % locals()) def handle_pi(self, text): self.pieces.append("<?%(text)s>" % locals()) def handle_decl(self, text): self.pieces.append("<!%(text)s>" % locals()) def output(self): """Return processed HTML as a single string""" return "".join(self.pieces) # end of file
26.857143
78
0.578267
161
1,316
4.677019
0.341615
0.146082
0.191235
0.084993
0.345286
0.292165
0.25498
0.25498
0.167331
0.116866
0
0
0.243921
1,316
48
79
27.416667
0.756784
0.12386
0
0
0
0
0.084229
0
0
0
0
0
0
1
0.37037
false
0
0.074074
0
0.518519
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
2
c3f5abd3cfa942540396dd9ee848e623fd2ddc8f
9,154
py
Python
pysnmp/HPN-ICF-DHCPSNOOP-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
11
2021-02-02T16:27:16.000Z
2021-08-31T06:22:49.000Z
pysnmp/HPN-ICF-DHCPSNOOP-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
75
2021-02-24T17:30:31.000Z
2021-12-08T00:01:18.000Z
pysnmp/HPN-ICF-DHCPSNOOP-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
10
2019-04-30T05:51:36.000Z
2022-02-16T03:33:41.000Z
# # PySNMP MIB module HPN-ICF-DHCPSNOOP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-DHCPSNOOP-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:25:32 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection", "ValueSizeConstraint") hpnicfdot1qVlanIndex, = mibBuilder.importSymbols("HPN-ICF-LswVLAN-MIB", "hpnicfdot1qVlanIndex") hpnicfCommon, = mibBuilder.importSymbols("HPN-ICF-OID-MIB", "hpnicfCommon") ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex") InetAddressType, InetAddress = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressType", "InetAddress") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") MibIdentifier, TimeTicks, NotificationType, Counter64, Bits, ModuleIdentity, ObjectIdentity, IpAddress, Gauge32, Unsigned32, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, Integer32 = mibBuilder.importSymbols("SNMPv2-SMI", "MibIdentifier", "TimeTicks", "NotificationType", "Counter64", "Bits", "ModuleIdentity", "ObjectIdentity", "IpAddress", "Gauge32", "Unsigned32", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "Integer32") TextualConvention, DisplayString, MacAddress, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "MacAddress", "TruthValue") hpnicfDhcpSnoop = ModuleIdentity((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36)) if mibBuilder.loadTexts: hpnicfDhcpSnoop.setLastUpdated('200501140000Z') if mibBuilder.loadTexts: hpnicfDhcpSnoop.setOrganization('') hpnicfDhcpSnoopMibObject = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 1)) hpnicfDhcpSnoopEnable = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpnicfDhcpSnoopEnable.setStatus('current') hpnicfDhcpSnoopTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 1, 2), ) if mibBuilder.loadTexts: hpnicfDhcpSnoopTable.setStatus('current') hpnicfDhcpSnoopEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 1, 2, 1), ).setIndexNames((0, "HPN-ICF-DHCPSNOOP-MIB", "hpnicfDhcpSnoopClientIpAddressType"), (0, "HPN-ICF-DHCPSNOOP-MIB", "hpnicfDhcpSnoopClientIpAddress")) if mibBuilder.loadTexts: hpnicfDhcpSnoopEntry.setStatus('current') hpnicfDhcpSnoopClientIpAddressType = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 1, 2, 1, 1), InetAddressType().clone('ipv4')) if mibBuilder.loadTexts: hpnicfDhcpSnoopClientIpAddressType.setStatus('current') hpnicfDhcpSnoopClientIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 1, 2, 1, 2), InetAddress()) if mibBuilder.loadTexts: hpnicfDhcpSnoopClientIpAddress.setStatus('current') hpnicfDhcpSnoopClientMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 1, 2, 1, 3), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfDhcpSnoopClientMacAddress.setStatus('current') hpnicfDhcpSnoopClientProperty = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("static", 1), ("dynamic", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfDhcpSnoopClientProperty.setStatus('current') hpnicfDhcpSnoopClientUnitNum = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 1, 2, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfDhcpSnoopClientUnitNum.setStatus('current') hpnicfDhcpSnoopTrustTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 1, 3), ) if mibBuilder.loadTexts: hpnicfDhcpSnoopTrustTable.setStatus('current') hpnicfDhcpSnoopTrustEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 1, 3, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: hpnicfDhcpSnoopTrustEntry.setStatus('current') hpnicfDhcpSnoopTrustStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("untrusted", 0), ("trusted", 1))).clone('untrusted')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpnicfDhcpSnoopTrustStatus.setStatus('current') hpnicfDhcpSnoopVlanTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 1, 4), ) if mibBuilder.loadTexts: hpnicfDhcpSnoopVlanTable.setStatus('current') hpnicfDhcpSnoopVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 1, 4, 1), ).setIndexNames((0, "HPN-ICF-DHCPSNOOP-MIB", "hpnicfDhcpSnoopVlanIndex")) if mibBuilder.loadTexts: hpnicfDhcpSnoopVlanEntry.setStatus('current') hpnicfDhcpSnoopVlanIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 1, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))) if mibBuilder.loadTexts: hpnicfDhcpSnoopVlanIndex.setStatus('current') hpnicfDhcpSnoopVlanEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 1, 4, 1, 2), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpnicfDhcpSnoopVlanEnable.setStatus('current') hpnicfDhcpSnoopTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 2)) hpnicfDhcpSnoopTrapsPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 2, 0)) hpnicfDhcpSnoopTrapsObject = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 2, 1)) hpnicfDhcpSnoopSpoofServerMac = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 2, 1, 1), MacAddress()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hpnicfDhcpSnoopSpoofServerMac.setStatus('current') hpnicfDhcpSnoopSpoofServerIP = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 2, 1, 2), IpAddress()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hpnicfDhcpSnoopSpoofServerIP.setStatus('current') hpnicfDhcpSnoopBindingIP = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 2, 1, 3), IpAddress()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hpnicfDhcpSnoopBindingIP.setStatus('current') hpnicfDhcpSnoopBindingMac = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 2, 1, 4), MacAddress()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hpnicfDhcpSnoopBindingMac.setStatus('current') hpnicfDhcpSnoopSpoofServerDetected = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 2, 0, 1)).setObjects(("IF-MIB", "ifIndex"), ("HPN-ICF-LswVLAN-MIB", "hpnicfdot1qVlanIndex"), ("HPN-ICF-DHCPSNOOP-MIB", "hpnicfDhcpSnoopSpoofServerMac"), ("HPN-ICF-DHCPSNOOP-MIB", "hpnicfDhcpSnoopSpoofServerIP")) if mibBuilder.loadTexts: hpnicfDhcpSnoopSpoofServerDetected.setStatus('current') hpnicfDhcpSnoopNewBinding = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 36, 2, 0, 2)).setObjects(("HPN-ICF-DHCPSNOOP-MIB", "hpnicfDhcpSnoopBindingIP"), ("HPN-ICF-DHCPSNOOP-MIB", "hpnicfDhcpSnoopBindingMac")) if mibBuilder.loadTexts: hpnicfDhcpSnoopNewBinding.setStatus('current') mibBuilder.exportSymbols("HPN-ICF-DHCPSNOOP-MIB", hpnicfDhcpSnoopTraps=hpnicfDhcpSnoopTraps, hpnicfDhcpSnoopClientMacAddress=hpnicfDhcpSnoopClientMacAddress, hpnicfDhcpSnoopBindingIP=hpnicfDhcpSnoopBindingIP, hpnicfDhcpSnoopVlanEntry=hpnicfDhcpSnoopVlanEntry, hpnicfDhcpSnoopTable=hpnicfDhcpSnoopTable, hpnicfDhcpSnoopClientUnitNum=hpnicfDhcpSnoopClientUnitNum, hpnicfDhcpSnoopEnable=hpnicfDhcpSnoopEnable, hpnicfDhcpSnoopTrapsObject=hpnicfDhcpSnoopTrapsObject, hpnicfDhcpSnoopSpoofServerIP=hpnicfDhcpSnoopSpoofServerIP, hpnicfDhcpSnoopVlanIndex=hpnicfDhcpSnoopVlanIndex, hpnicfDhcpSnoopBindingMac=hpnicfDhcpSnoopBindingMac, PYSNMP_MODULE_ID=hpnicfDhcpSnoop, hpnicfDhcpSnoopTrustStatus=hpnicfDhcpSnoopTrustStatus, hpnicfDhcpSnoop=hpnicfDhcpSnoop, hpnicfDhcpSnoopMibObject=hpnicfDhcpSnoopMibObject, hpnicfDhcpSnoopTrustTable=hpnicfDhcpSnoopTrustTable, hpnicfDhcpSnoopVlanTable=hpnicfDhcpSnoopVlanTable, hpnicfDhcpSnoopClientIpAddressType=hpnicfDhcpSnoopClientIpAddressType, hpnicfDhcpSnoopClientProperty=hpnicfDhcpSnoopClientProperty, hpnicfDhcpSnoopSpoofServerDetected=hpnicfDhcpSnoopSpoofServerDetected, hpnicfDhcpSnoopClientIpAddress=hpnicfDhcpSnoopClientIpAddress, hpnicfDhcpSnoopNewBinding=hpnicfDhcpSnoopNewBinding, hpnicfDhcpSnoopVlanEnable=hpnicfDhcpSnoopVlanEnable, hpnicfDhcpSnoopTrustEntry=hpnicfDhcpSnoopTrustEntry, hpnicfDhcpSnoopEntry=hpnicfDhcpSnoopEntry, hpnicfDhcpSnoopTrapsPrefix=hpnicfDhcpSnoopTrapsPrefix, hpnicfDhcpSnoopSpoofServerMac=hpnicfDhcpSnoopSpoofServerMac)
134.617647
1,485
0.773651
987
9,154
7.173252
0.160081
0.00904
0.012288
0.014689
0.323164
0.24322
0.208475
0.190113
0.190113
0.190113
0
0.078882
0.081822
9,154
67
1,486
136.626866
0.763474
0.036705
0
0
0
0
0.154615
0.046089
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
c3fbf63673f0b26495d943876bcf66057c2b9555
1,373
py
Python
slack_wordcloud/cli.py
angel-hernandez91/slack-wordcloud
f5da77f49d8156405ab92feb6a13cbc0013f5cf2
[ "MIT" ]
1
2021-04-04T20:50:58.000Z
2021-04-04T20:50:58.000Z
slack_wordcloud/cli.py
angel-hernandez91/slack-wordcloud
f5da77f49d8156405ab92feb6a13cbc0013f5cf2
[ "MIT" ]
3
2020-03-25T21:02:46.000Z
2020-10-01T18:32:37.000Z
slack_wordcloud/cli.py
angel-hernandez91/slack-wordcloud
f5da77f49d8156405ab92feb6a13cbc0013f5cf2
[ "MIT" ]
null
null
null
""" slack_worcloud Usage: slack_wordcloud generate --channel <channel> [--token=token] [-f] slack_wordcloud -h | --help slack_wordcloud --version Options: -h --help Show this screen. --version Show version. --token Slack API token. --channel Slack channel name. --file Ouput to file in current dir. Examples: slack_wordcloud generate --channel my_channel slack_wordcloud generate --channel my_channel --token $API_TOKEN slack_wordcloud generate --channel my_channel --token $API_TOKEN --file Help: For help using this tool, please open an issue on the Github repository: https://github.com/angel-hernandez91/slack-wordcloud """ from inspect import getmembers, isclass from docopt import docopt from . import __version__ as VERSION # Here we'll try to dynamically match the command the user is trying to run # with a pre-defined command class we've already created. def main(): """Main CLI entrypoint.""" import slack_wordcloud.commands options = docopt(__doc__, version=VERSION) for (k, v) in options.items(): if hasattr(slack_wordcloud.commands, k) and v: module = getattr(slack_wordcloud.commands, k) slack_wordcloud.commands = getmembers(module, isclass) command = [command[1] for command in slack_wordcloud.commands if command[0] != 'Base'][0] command = command(options) command.run()
27.46
92
0.727604
187
1,373
5.208556
0.44385
0.172485
0.112936
0.119097
0.143737
0.143737
0.104723
0.104723
0.104723
0
0
0.004413
0.1748
1,373
50
93
27.46
0.855252
0.604516
0
0
1
0
0.007353
0
0
0
0
0
0
1
0.076923
false
0
0.307692
0
0.384615
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
7f0aef88acbf1f5b61a5f66fa5d53a6647f3e29c
729
py
Python
program/test.py
ngrande/CaesarPy
9ff139e0ce703cbfdc6d0e345f09c2b6c8747ce5
[ "MIT" ]
null
null
null
program/test.py
ngrande/CaesarPy
9ff139e0ce703cbfdc6d0e345f09c2b6c8747ce5
[ "MIT" ]
null
null
null
program/test.py
ngrande/CaesarPy
9ff139e0ce703cbfdc6d0e345f09c2b6c8747ce5
[ "MIT" ]
null
null
null
import unittest import program.main as main class Test(unittest.TestCase): ''' ''' def setUp(self): pass def test_remove_duplicates(self): c = main.CaesarEncryption("REGENSCHIRMSTAENDER") self.assertEqual(c._remove_duplicates("aabbcc"), "ABC") def test_generate_key_alphabet(self): ''' ''' test_key = "REGENSCHIRMSTAENDER" c = main.CaesarEncryption(test_key) self.assertEqual(c.key_alphabet, "REGNSCHIMTADZYXWVUQPOLKJFB") def test_encrypt(self): c = main.CaesarEncryption("REGENSCHIRMSTAENDER") self.assertEqual(c.encrypt("WASSER KOCHT IM TEEKESSEL"), "KRQQSU AXGIP MZ PSSASQQSD") if __name__ == "__main__": unittest.main()
27
93
0.670782
76
729
6.184211
0.460526
0.044681
0.134043
0.106383
0.255319
0.255319
0.255319
0.255319
0
0
0
0
0.21262
729
26
94
28.038462
0.818815
0
0
0.117647
0
0
0.210379
0.036466
0
0
0
0
0.176471
1
0.235294
false
0.058824
0.117647
0
0.411765
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
2
7f13ab593568b83f3e9cffb429089d246983012e
270
py
Python
massemail/config.py
NdubisiOnuora/massemail
05b7e2298ff599fa8f4d1ccc8d87d844d9e52b50
[ "MIT" ]
1
2019-04-27T02:06:45.000Z
2019-04-27T02:06:45.000Z
massemail/config.py
NdubisiOnuora/massemail
05b7e2298ff599fa8f4d1ccc8d87d844d9e52b50
[ "MIT" ]
null
null
null
massemail/config.py
NdubisiOnuora/massemail
05b7e2298ff599fa8f4d1ccc8d87d844d9e52b50
[ "MIT" ]
null
null
null
import json class Config(object): def __init__(self, config_file_name): with open(config_file_name) as f: config = json.load(f) for config_key, config_value in config.items(): setattr(self, config_key, config_value)
27
59
0.633333
36
270
4.416667
0.583333
0.125786
0.176101
0.251572
0
0
0
0
0
0
0
0
0.281481
270
9
60
30
0.819588
0
0
0
0
0
0
0
0
0
0
0
0
1
0.142857
false
0
0.142857
0
0.428571
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
7f1cab41d961aeb26d1ab8cbe9b02776d46721e4
164
py
Python
poly_decomp/__init__.py
lpenguin/poly_decomp.py
ef81071619ad106c03df07b67e4a4c8a12f9164a
[ "MIT" ]
19
2017-03-13T23:20:42.000Z
2022-03-06T03:04:37.000Z
poly_decomp/__init__.py
lpenguin/poly_decomp.py
ef81071619ad106c03df07b67e4a4c8a12f9164a
[ "MIT" ]
1
2020-04-01T08:39:34.000Z
2020-08-02T00:12:43.000Z
poly_decomp/__init__.py
lpenguin/poly_decomp.py
ef81071619ad106c03df07b67e4a4c8a12f9164a
[ "MIT" ]
2
2021-01-29T18:04:02.000Z
2021-02-15T12:51:17.000Z
__title__ = 'poly_decomp' __version__ = '0.0.1' __author__ = 'Will Silva' __license__ = 'MIT' __copyright__ = 'Copyright 2016 Will Silva' from poly_decomp import *
23.428571
43
0.75
21
164
4.809524
0.714286
0.19802
0
0
0
0
0
0
0
0
0
0.049645
0.140244
164
7
44
23.428571
0.666667
0
0
0
0
0
0.327273
0
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
612e6de903e7a57aaa047c1e57e4dececc0e049d
6,705
py
Python
scripts/sdn_topo_gen.py
rombie/contrail-test
a68c71d6f282142501a7e2e889bbb232fdd82dc3
[ "Apache-2.0" ]
null
null
null
scripts/sdn_topo_gen.py
rombie/contrail-test
a68c71d6f282142501a7e2e889bbb232fdd82dc3
[ "Apache-2.0" ]
null
null
null
scripts/sdn_topo_gen.py
rombie/contrail-test
a68c71d6f282142501a7e2e889bbb232fdd82dc3
[ "Apache-2.0" ]
null
null
null
''' Generate test topology based on user input. SDN test cases can be built based on this topology. ''' import sys import copy from random import choice class basic_topo(): def __init__(self): # set domain, project to defaults self.domain = 'default-domain' self.project = 'admin' self.vmc_list = [] self.vnet_list = [] self.policy_list = [] self.net_list = [] self.vn_nets = {} self.vn_of_cn = {} self.vm_of_cn = {} self.vn_of_vm = {} self.vn_policy = {} self.policy_vn = {} # seed for topology - user can enter as needed: begin_oct = 10 base_net = '.1.1.0/30' numPolicyPerVN = 2 numRules = 4 numVM = 2 numNetsPerVn = 2 numVNsPerVM = 1 # for now, leave it to 1, infra support needed for >1 numVN = numVM * numVNsPerVM numNets = numVN * numNetsPerVn numPolicies = numVN * numPolicyPerVN # end topology seed section # Generate policy names based on user data type = 'policy' for i in range(numPolicies): name = type + str(i) self.policy_list.append(name) # Generate networks based on user data for i in range(numNets): net = str(begin_oct) + base_net begin_oct += 1 self.net_list.append(net) # Generate VN names based on user data type = 'vnet' for i in range(numVN): name = type + str(i) self.vnet_list.append(name) # Generate VM names based on user data type = 'vmc' for i in range(numVM): name = type + str(i) self.vmc_list.append(name) # associate nets to VN dup_net_list = copy.copy(self.net_list) for vn in self.vnet_list: self.vn_nets[vn] = [] for j in range(numNetsPerVn): net = dup_net_list.pop(0) self.vn_nets[vn].append(net) # associate VN's to VM dup_vnet_list = copy.copy(self.vnet_list) for vm in self.vmc_list: self.vn_of_vm[vm] = [] for j in range(numVNsPerVM): vn = dup_vnet_list.pop(0) self.vn_of_vm[vm].append(vn) # for now return a single element until infra support is added to # handle list self.vn_of_vm[vm] = self.vn_of_vm[vm][0] # associate policies to VN dup_policy_list = copy.copy(self.policy_list) for vn in self.vnet_list: self.vn_policy[vn] = [] for j in range(numPolicyPerVN): policy_mem = dup_policy_list.pop(0) self.vn_policy[vn].append(policy_mem) # There can be multple VNs associated to same policy, build the list of # VNs by policy self.policy_vn = {} for policy in self.policy_list: self.policy_vn[policy] = [] for vn in self.vnet_list: if policy in self.vn_policy[vn]: self.policy_vn[policy].append(vn) # end of vn and policy for loops # Generate m different rules for each policy self.rules = {} for i in range(len(self.policy_list)): #proto_opts= [6, 17, 1, 'any'] proto_opts = ['6', '17', '1'] proto = choice(proto_opts) policy = 'policy' + str(i) self.rules[policy] = [] policy_vn = self.policy_vn[policy] for j in range(numRules): rule_base = {'direction': '>', 'protocol': proto, 'source_network': policy_vn[0], 'src_ports': [j, j], 'dest_network': policy_vn[0], 'dst_ports': 'any', 'simple_action': 'deny'} self.rules['policy' + str(i)].append(rule_base) # end __init__ def print_topology(self, topology_name): print "'''*******AUTO-GENERATED TOPOLOGY*********'''" print "class %s ():" % (topology_name) print "\tdef __init__(self, domain= 'default-domain', project= 'admin'):" print "\t\t##" print "\t\t# Domain and project defaults: Do not change until support for non-default is tested!" print "\t\tself.domain= domain; self.project= project" print "\t\t##" print "\t\t# Define VN's in the project:" print "\t\tself.vnet_list= ", self.vnet_list print "\t\t##" print "\t\t# Define network info for each VN:" print "\t\tself.vn_nets= ", self.vn_nets print "\t\t##" print "\t\t# Define network policies" print "\t\tself.policy_list= ", self.policy_list print "\t\tself.vn_policy= ", self.vn_policy print "\t\t##" print "\t\t# Define VM's" print "\t\t# VM distribution on available compute nodes is handled by nova scheduler or contrail vm naming scheme" print "\t\tself.vn_of_vm= ", self.vn_of_vm print "\t\t##" print "\t\t# Define network policy rules" print "\t\tself.rules= {}" for policy in self.policy_list: print "\n\t\tself.rules[\'%s\']= %s" % (policy, self.rules[policy]) # end for print "\t\t# end __init__" print print "if __name__ == '__main__':" print "\tprint \"Currently topology limited to one domain/project..\"" print "\tprint \"Based on need, can be extended to cover config for multiple domain/projects\"" print "\tprint" print "\tmy_topo= basic_topo(domain= 'default-domain', project= 'admin')" print "\tx= my_topo.__dict__" print "\t#print \"keys only:\"" print "\t#for key, value in x.iteritems(): print key" print "\t#print" print "\t#print \"keys & values:\"" print "\t#for key, value in x.iteritems(): print key, \"-->\", value" print "\timport topo_helper" print "\ttopo_h= topo_helper.topology_helper(my_topo)" print "\t#vmc_list= topo_h.get_vmc_list()" print "\tpolicy_vn= topo_h.get_policy_vn()" print "#" * 80 # end class if __name__ == '__main__': p = basic_topo() # Run main with print option to display generated topology, redirect to a # file, say topo.py, to capture topology if len(sys.argv) > 1 and sys.argv[1] == 'print': p.print_topology('basic_topo') else: print "\nUsage: <%s print> to display generated topology" % (sys.argv[0]) print "\nprinting created topology attribs: \n" print p.policy_list, p.vmc_list, p.vnet_list, p.vn_nets, p.vn_policy, p.vn_of_vm # end __main__
37.668539
122
0.56182
895
6,705
4.032402
0.222346
0.044888
0.027154
0.016625
0.212801
0.154891
0.070103
0.059019
0.036575
0.020504
0
0.007463
0.320507
6,705
177
123
37.881356
0.78468
0.118121
0
0.120301
1
0.015038
0.23565
0.025761
0
0
0
0
0
0
null
null
0
0.030075
null
null
0.360902
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
612e98d741d484b95c46c02d6e42e40b182e4c87
44,436
py
Python
loss_landscape/seminarsalamiguy.py
HyamsG/EmpiricalSeminar2021
d1813a07a5e421d8e07c2f718132340220632e36
[ "MIT" ]
null
null
null
loss_landscape/seminarsalamiguy.py
HyamsG/EmpiricalSeminar2021
d1813a07a5e421d8e07c2f718132340220632e36
[ "MIT" ]
null
null
null
loss_landscape/seminarsalamiguy.py
HyamsG/EmpiricalSeminar2021
d1813a07a5e421d8e07c2f718132340220632e36
[ "MIT" ]
5
2021-04-08T18:53:12.000Z
2021-07-01T09:40:57.000Z
# -*- coding: utf-8 -*- """SeminarSalamiGuy.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/10q0CHu_QVPq2t5Vrz3I983slC_JpqM-m #Libraries """ import torch.nn as nn import torchvision.transforms as transforms from torchvision import datasets import math import os import torch import sys import time import torch.nn.functional as F import torchvision import tabulate import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from torch.nn import Module, Parameter from torch.nn.modules.utils import _pair from scipy.special import binom from google.colab import drive drive.mount('/content/drive') """#Functions""" def adjust_learning_rate(optimizer, lr): for param_group in optimizer.param_groups: param_group['lr'] = lr return lr def cyclic_learning_rate(epoch, cycle, alpha_1, alpha_2): def schedule(iter): t = ((epoch % cycle) + iter) / cycle if t < 0.5: return alpha_1 * (1.0 - 2.0 * t) + alpha_2 * 2.0 * t else: return alpha_1 * (2.0 * t - 1.0) + alpha_2 * (2.0 - 2.0 * t) return schedule def save_checkpoint(dir, epoch, **kwargs): state = { 'epoch': epoch, } state.update(kwargs) filepath = os.path.join(dir, 'checkpoint-%d.pt' % epoch) torch.save(state, filepath) def train_epoch(loader, model, criterion, optimizer): loss_sum = 0.0 correct = 0.0 model.train() for i, (input, target) in enumerate(loader): input = input.cuda(non_blocking=True) target = target.cuda(non_blocking=True) input_var = torch.autograd.Variable(input) target_var = torch.autograd.Variable(target) output = model(input_var) loss = criterion(output, target_var) optimizer.zero_grad() loss.backward() optimizer.step() loss_sum += loss.item() * input.size(0) pred = output.data.max(1, keepdim=True)[1] correct += pred.eq(target_var.data.view_as(pred)).sum().item() return { 'loss': loss_sum / len(loader.dataset), 'accuracy': correct / len(loader.dataset) * 100.0, } def eval(loader, model, criterion): loss_sum = 0.0 correct = 0.0 model.eval() for i, (input, target) in enumerate(loader): input = input.cuda(non_blocking=True) target = target.cuda(non_blocking=True) input_var = torch.autograd.Variable(input) target_var = torch.autograd.Variable(target) output = model(input_var) loss = criterion(output, target_var) loss_sum += loss.item() * input.size(0) pred = output.data.max(1, keepdim=True)[1] correct += pred.eq(target_var.data.view_as(pred)).sum().item() return { 'loss': loss_sum / len(loader.dataset), 'accuracy': correct / len(loader.dataset) * 100.0, } import numpy as np import os import torch import torch.nn.functional as F def l2_regularizer(weight_decay): def regularizer(model): l2 = 0.0 for p in model.parameters(): l2 += torch.sqrt(torch.sum(p ** 2)) return 0.5 * weight_decay * l2 return regularizer def cyclic_learning_rate(epoch, cycle, alpha_1, alpha_2): def schedule(iter): t = ((epoch % cycle) + iter) / cycle if t < 0.5: return alpha_1 * (1.0 - 2.0 * t) + alpha_2 * 2.0 * t else: return alpha_1 * (2.0 * t - 1.0) + alpha_2 * (2.0 - 2.0 * t) return schedule def adjust_learning_rate(optimizer, lr): for param_group in optimizer.param_groups: param_group['lr'] = lr return lr def save_checkpoint(dir, epoch, name='checkpoint', **kwargs): state = { 'epoch': epoch, } state.update(kwargs) filepath = os.path.join(dir, '%s-%d.pt' % (name, epoch)) torch.save(state, filepath) def fge_train_epoch(train_loader, model, optimizer, criterion, regularizer=None, lr_schedule=None): loss_sum = 0.0 correct = 0.0 num_iters = len(train_loader) model.train() for iter, (input, target) in enumerate(train_loader): if lr_schedule is not None: lr = lr_schedule(iter / num_iters) adjust_learning_rate(optimizer, lr) input = input.cuda(non_blocking=True) target = target.cuda(non_blocking=True) output = model(input) loss = criterion(output, target) if regularizer is not None: loss += regularizer(model) optimizer.zero_grad() loss.backward() optimizer.step() loss_sum += loss.item() * input.size(0) pred = output.data.argmax(1, keepdim=True) correct += pred.eq(target.data.view_as(pred)).sum().item() return { 'loss': loss_sum / len(train_loader.dataset), 'accuracy': correct * 100.0 / len(train_loader.dataset), } def predictions(test_loader, model, **kwargs): model.eval() preds = [] targets = [] for input, target in test_loader: input = input.cuda(non_blocking=True) output = model(input, **kwargs) probs = F.softmax(output, dim=1) preds.append(probs.cpu().data.numpy()) targets.append(target.numpy()) return np.vstack(preds), np.concatenate(targets) def moving_average(net1, net2, alpha=1): for param1, param2 in zip(net1.parameters(), net2.parameters()): param1.data *= (1.0 - alpha) param1.data += param2.data * alpha def _check_bn(module, flag): if issubclass(module.__class__, torch.nn.modules.batchnorm._BatchNorm): flag[0] = True def check_bn(model): flag = [False] model.apply(lambda module: _check_bn(module, flag)) return flag[0] def reset_bn(module): if issubclass(module.__class__, torch.nn.modules.batchnorm._BatchNorm): module.running_mean = torch.zeros_like(module.running_mean) module.running_var = torch.ones_like(module.running_var) def _get_momenta(module, momenta): if issubclass(module.__class__, torch.nn.modules.batchnorm._BatchNorm): momenta[module] = module.momentum def _set_momenta(module, momenta): if issubclass(module.__class__, torch.nn.modules.batchnorm._BatchNorm): module.momentum = momenta[module] def bn_update(loader, model): """ BatchNorm buffers update (if any). Performs 1 epochs to estimate buffers average using train dataset. :param loader: train dataset loader for buffers average estimation. :param model: model being update :return: None """ if not check_bn(model): return model.train() momenta = {} model.apply(reset_bn) model.apply(lambda module: _get_momenta(module, momenta)) n = 0 for input, _ in loader: input = input.cuda(non_blocking=True) input_var = torch.autograd.Variable(input) b = input_var.data.size(0) momentum = b / (n + b) for module in momenta.keys(): module.momentum = momentum model(input_var) n += b model.apply(lambda module: _set_momenta(module, momenta)) """#Curve""" class Bezier(Module): def __init__(self, num_bends): super(Bezier, self).__init__() self.register_buffer( 'binom', torch.Tensor(binom(num_bends - 1, np.arange(num_bends), dtype=np.float32)) ) self.register_buffer('range', torch.arange(0, float(num_bends))) self.register_buffer('rev_range', torch.arange(float(num_bends - 1), -1, -1)) def forward(self, t): return self.binom * \ torch.pow(t, self.range) * \ torch.pow((1.0 - t), self.rev_range) class PolyChain(Module): def __init__(self, num_bends): super(PolyChain, self).__init__() self.num_bends = num_bends self.register_buffer('range', torch.arange(0, float(num_bends))) def forward(self, t): t_n = t * (self.num_bends - 1) return torch.max(self.range.new([0.0]), 1.0 - torch.abs(t_n - self.range)) class CurveModule(Module): def __init__(self, fix_points, parameter_names=()): super(CurveModule, self).__init__() self.fix_points = fix_points self.num_bends = len(self.fix_points) self.parameter_names = parameter_names self.l2 = 0.0 def compute_weights_t(self, coeffs_t): w_t = [None] * len(self.parameter_names) self.l2 = 0.0 for i, parameter_name in enumerate(self.parameter_names): for j, coeff in enumerate(coeffs_t): parameter = getattr(self, '%s_%d' % (parameter_name, j)) if parameter is not None: if w_t[i] is None: w_t[i] = parameter * coeff else: w_t[i] += parameter * coeff if w_t[i] is not None: self.l2 += torch.sum(w_t[i] ** 2) return w_t class Linear(CurveModule): def __init__(self, in_features, out_features, fix_points, bias=True): super(Linear, self).__init__(fix_points, ('weight', 'bias')) self.in_features = in_features self.out_features = out_features self.l2 = 0.0 for i, fixed in enumerate(self.fix_points): self.register_parameter( 'weight_%d' % i, Parameter(torch.Tensor(out_features, in_features), requires_grad=not fixed) ) for i, fixed in enumerate(self.fix_points): if bias: self.register_parameter( 'bias_%d' % i, Parameter(torch.Tensor(out_features), requires_grad=not fixed) ) else: self.register_parameter('bias_%d' % i, None) self.reset_parameters() def reset_parameters(self): stdv = 1. / math.sqrt(self.in_features) for i in range(self.num_bends): getattr(self, 'weight_%d' % i).data.uniform_(-stdv, stdv) bias = getattr(self, 'bias_%d' % i) if bias is not None: bias.data.uniform_(-stdv, stdv) def forward(self, input, coeffs_t): weight_t, bias_t = self.compute_weights_t(coeffs_t) return F.linear(input, weight_t, bias_t) class Conv2d(CurveModule): def __init__(self, in_channels, out_channels, kernel_size, fix_points, stride=1, padding=0, dilation=1, groups=1, bias=True): super(Conv2d, self).__init__(fix_points, ('weight', 'bias')) if in_channels % groups != 0: raise ValueError('in_channels must be divisible by groups') if out_channels % groups != 0: raise ValueError('out_channels must be divisible by groups') kernel_size = _pair(kernel_size) stride = _pair(stride) padding = _pair(padding) dilation = _pair(dilation) self.in_channels = in_channels self.out_channels = out_channels self.kernel_size = kernel_size self.stride = stride self.padding = padding self.dilation = dilation self.groups = groups for i, fixed in enumerate(self.fix_points): self.register_parameter( 'weight_%d' % i, Parameter( torch.Tensor(out_channels, in_channels // groups, *kernel_size), requires_grad=not fixed ) ) for i, fixed in enumerate(self.fix_points): if bias: self.register_parameter( 'bias_%d' % i, Parameter(torch.Tensor(out_channels), requires_grad=not fixed) ) else: self.register_parameter('bias_%d' % i, None) self.reset_parameters() def reset_parameters(self): n = self.in_channels for k in self.kernel_size: n *= k stdv = 1. / math.sqrt(n) for i in range(self.num_bends): getattr(self, 'weight_%d' % i).data.uniform_(-stdv, stdv) bias = getattr(self, 'bias_%d' % i) if bias is not None: bias.data.uniform_(-stdv, stdv) def forward(self, input, coeffs_t): weight_t, bias_t = self.compute_weights_t(coeffs_t) return F.conv2d(input, weight_t, bias_t, self.stride, self.padding, self.dilation, self.groups) class _BatchNorm(CurveModule): _version = 2 def __init__(self, num_features, fix_points, eps=1e-5, momentum=0.1, affine=True, track_running_stats=True): super(_BatchNorm, self).__init__(fix_points, ('weight', 'bias')) self.num_features = num_features self.eps = eps self.momentum = momentum self.affine = affine self.track_running_stats = track_running_stats self.l2 = 0.0 for i, fixed in enumerate(self.fix_points): if self.affine: self.register_parameter( 'weight_%d' % i, Parameter(torch.Tensor(num_features), requires_grad=not fixed) ) else: self.register_parameter('weight_%d' % i, None) for i, fixed in enumerate(self.fix_points): if self.affine: self.register_parameter( 'bias_%d' % i, Parameter(torch.Tensor(num_features), requires_grad=not fixed) ) else: self.register_parameter('bias_%d' % i, None) if self.track_running_stats: self.register_buffer('running_mean', torch.zeros(num_features)) self.register_buffer('running_var', torch.ones(num_features)) self.register_buffer('num_batches_tracked', torch.tensor(0, dtype=torch.long)) else: self.register_parameter('running_mean', None) self.register_parameter('running_var', None) self.register_parameter('num_batches_tracked', None) self.reset_parameters() def reset_running_stats(self): if self.track_running_stats: self.running_mean.zero_() self.running_var.fill_(1) self.num_batches_tracked.zero_() def reset_parameters(self): self.reset_running_stats() if self.affine: for i in range(self.num_bends): getattr(self, 'weight_%d' % i).data.uniform_() getattr(self, 'bias_%d' % i).data.zero_() def _check_input_dim(self, input): raise NotImplementedError def forward(self, input, coeffs_t): self._check_input_dim(input) exponential_average_factor = 0.0 if self.training and self.track_running_stats: self.num_batches_tracked += 1 if self.momentum is None: # use cumulative moving average exponential_average_factor = 1.0 / self.num_batches_tracked.item() else: # use exponential moving average exponential_average_factor = self.momentum weight_t, bias_t = self.compute_weights_t(coeffs_t) return F.batch_norm( input, self.running_mean, self.running_var, weight_t, bias_t, self.training or not self.track_running_stats, exponential_average_factor, self.eps) def extra_repr(self): return '{num_features}, eps={eps}, momentum={momentum}, affine={affine}, ' \ 'track_running_stats={track_running_stats}'.format(**self.__dict__) def _load_from_state_dict(self, state_dict, prefix, metadata, strict, missing_keys, unexpected_keys, error_msgs): version = metadata.get('version', None) if (version is None or version < 2) and self.track_running_stats: # at version 2: added num_batches_tracked buffer # this should have a default value of 0 num_batches_tracked_key = prefix + 'num_batches_tracked' if num_batches_tracked_key not in state_dict: state_dict[num_batches_tracked_key] = torch.tensor(0, dtype=torch.long) super(_BatchNorm, self)._load_from_state_dict( state_dict, prefix, metadata, strict, missing_keys, unexpected_keys, error_msgs) class BatchNorm2d(_BatchNorm): def _check_input_dim(self, input): if input.dim() != 4: raise ValueError('expected 4D input (got {}D input)' .format(input.dim())) class CurveNet(Module): def __init__(self, num_classes, curve, architecture, num_bends, fix_start=True, fix_end=True, architecture_kwargs={}): super(CurveNet, self).__init__() self.num_classes = num_classes self.num_bends = num_bends self.fix_points = [fix_start] + [False] * (self.num_bends - 2) + [fix_end] self.curve = curve self.architecture = architecture self.l2 = 0.0 self.coeff_layer = self.curve(self.num_bends) self.net = self.architecture(num_classes, fix_points=self.fix_points, **architecture_kwargs) self.curve_modules = [] for module in self.net.modules(): if issubclass(module.__class__, CurveModule): self.curve_modules.append(module) def import_base_parameters(self, base_model, index): parameters = list(self.net.parameters())[index::self.num_bends] base_parameters = base_model.parameters() for parameter, base_parameter in zip(parameters, base_parameters): parameter.data.copy_(base_parameter.data) def import_base_buffers(self, base_model): for buffer, base_buffer in zip(self.net._all_buffers(), base_model._all_buffers()): buffer.data.copy_(base_buffer.data) def export_base_parameters(self, base_model, index): parameters = list(self.net.parameters())[index::self.num_bends] base_parameters = base_model.parameters() for parameter, base_parameter in zip(parameters, base_parameters): base_parameter.data.copy_(parameter.data) def init_linear(self): parameters = list(self.net.parameters()) for i in range(0, len(parameters), self.num_bends): weights = parameters[i:i+self.num_bends] for j in range(1, self.num_bends - 1): alpha = j * 1.0 / (self.num_bends - 1) weights[j].data.copy_(alpha * weights[-1].data + (1.0 - alpha) * weights[0].data) def weights(self, t): coeffs_t = self.coeff_layer(t) weights = [] for module in self.curve_modules: weights.extend([w for w in module.compute_weights_t(coeffs_t) if w is not None]) return np.concatenate([w.detach().cpu().numpy().ravel() for w in weights]) def _compute_l2(self): self.l2 = sum(module.l2 for module in self.curve_modules) def forward(self, input, t=None): if t is None: t = input.data.new(1).uniform_() coeffs_t = self.coeff_layer(t) output = self.net(input, coeffs_t) self._compute_l2() return output def l2_regularizer(weight_decay): return lambda model: 0.5 * weight_decay * model.l2 """#Models ## PreResNet model definition """ __all__ = ['PreResNet110', 'PreResNet164'] def conv3x3(in_planes, out_planes, stride=1): return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False) class BasicBlock(nn.Module): expansion = 1 def __init__(self, inplanes, planes, stride=1, downsample=None): super(BasicBlock, self).__init__() self.bn1 = nn.BatchNorm2d(inplanes) self.relu = nn.ReLU(inplace=True) self.conv1 = conv3x3(inplanes, planes, stride) self.bn2 = nn.BatchNorm2d(planes) self.conv2 = conv3x3(planes, planes) self.downsample = downsample self.stride = stride def forward(self, x): residual = x out = self.bn1(x) out = self.relu(out) out = self.conv1(out) out = self.bn2(out) out = self.relu(out) out = self.conv2(out) if self.downsample is not None: residual = self.downsample(x) out += residual return out class Bottleneck(nn.Module): expansion = 4 def __init__(self, inplanes, planes, stride=1, downsample=None): super(Bottleneck, self).__init__() self.bn1 = nn.BatchNorm2d(inplanes) self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=1, bias=False) self.bn2 = nn.BatchNorm2d(planes) self.conv2 = nn.Conv2d(planes, planes, kernel_size=3, stride=stride, padding=1, bias=False) self.bn3 = nn.BatchNorm2d(planes) self.conv3 = nn.Conv2d(planes, planes * 4, kernel_size=1, bias=False) self.relu = nn.ReLU(inplace=True) self.downsample = downsample self.stride = stride def forward(self, x): residual = x out = self.bn1(x) out = self.relu(out) out = self.conv1(out) out = self.bn2(out) out = self.relu(out) out = self.conv2(out) out = self.bn3(out) out = self.relu(out) out = self.conv3(out) if self.downsample is not None: residual = self.downsample(x) out += residual return out class PreResNet(nn.Module): def __init__(self, num_classes=10, depth=110): super(PreResNet, self).__init__() if depth >= 44: assert (depth - 2) % 9 == 0, 'depth should be 9n+2' n = (depth - 2) // 9 block = Bottleneck else: assert (depth - 2) % 6 == 0, 'depth should be 6n+2' n = (depth - 2) // 6 block = BasicBlock self.inplanes = 16 self.conv1 = nn.Conv2d(3, 16, kernel_size=3, padding=1, bias=False) self.layer1 = self._make_layer(block, 16, n) self.layer2 = self._make_layer(block, 32, n, stride=2) self.layer3 = self._make_layer(block, 64, n, stride=2) self.bn = nn.BatchNorm2d(64 * block.expansion) self.relu = nn.ReLU(inplace=True) self.avgpool = nn.AvgPool2d(8) self.fc = nn.Linear(64 * block.expansion, num_classes) for m in self.modules(): if isinstance(m, nn.Conv2d): n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels m.weight.data.normal_(0, math.sqrt(2. / n)) elif isinstance(m, nn.BatchNorm2d): m.weight.data.fill_(1) m.bias.data.zero_() def _make_layer(self, block, planes, blocks, stride=1): downsample = None if stride != 1 or self.inplanes != planes * block.expansion: downsample = nn.Sequential( nn.Conv2d(self.inplanes, planes * block.expansion, kernel_size=1, stride=stride, bias=False), ) layers = list() layers.append(block(self.inplanes, planes, stride, downsample)) self.inplanes = planes * block.expansion for i in range(1, blocks): layers.append(block(self.inplanes, planes)) return nn.Sequential(*layers) def forward(self, x): x = self.conv1(x) x = self.layer1(x) # 32x32 x = self.layer2(x) # 16x16 x = self.layer3(x) # 8x8 x = self.bn(x) x = self.relu(x) x = self.avgpool(x) x = x.view(x.size(0), -1) x = self.fc(x) return x #PreResNet110 class PreResNet110: base = PreResNet args = list() kwargs = {'depth': 110} transform_train = transforms.Compose([ transforms.RandomCrop(32, padding=4), transforms.RandomHorizontalFlip(), transforms.ToTensor(), transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)), ]) transform_test = transforms.Compose([ transforms.ToTensor(), transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)), ]) class PreResNet164: base = PreResNet args = list() kwargs = {'depth': 164} transform_train = transforms.Compose([ transforms.RandomCrop(32, padding=4), transforms.RandomHorizontalFlip(), transforms.ToTensor(), transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)), ]) transform_test = transforms.Compose([ transforms.ToTensor(), transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)), ]) """##VGG model definition""" __all__ = ['VGG16', 'VGG16BN', 'VGG19', 'VGG19BN'] def make_layers(cfg, batch_norm=False): layers = list() in_channels = 3 for v in cfg: if v == 'M': layers += [nn.MaxPool2d(kernel_size=2, stride=2)] else: conv2d = nn.Conv2d(in_channels, v, kernel_size=3, padding=1) if batch_norm: layers += [conv2d, nn.BatchNorm2d(v), nn.ReLU(inplace=True)] else: layers += [conv2d, nn.ReLU(inplace=True)] in_channels = v return nn.Sequential(*layers) cfg = { 16: [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 'M', 512, 512, 512, 'M', 512, 512, 512, 'M'], 19: [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 256, 'M', 512, 512, 512, 512, 'M', 512, 512, 512, 512, 'M'], } class VGG(nn.Module): def __init__(self, num_classes=10, depth=16, batch_norm=False): super(VGG, self).__init__() self.features = make_layers(cfg[depth], batch_norm) self.classifier = nn.Sequential( nn.Dropout(), nn.Linear(512, 512), nn.ReLU(True), nn.Dropout(), nn.Linear(512, 512), nn.ReLU(True), nn.Linear(512, num_classes), ) for m in self.modules(): if isinstance(m, nn.Conv2d): n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels m.weight.data.normal_(0, math.sqrt(2. / n)) m.bias.data.zero_() def forward(self, x): x = self.features(x) x = x.view(x.size(0), -1) x = self.classifier(x) return x class Base: base = VGG args = list() kwargs = dict() transform_train = transforms.Compose([ transforms.RandomHorizontalFlip(), transforms.RandomCrop(32, padding=4), transforms.ToTensor(), transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225)) ]) transform_test = transforms.Compose([ transforms.ToTensor(), transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225)) ]) class VGG16(Base): pass class VGG16BN(Base): kwargs = {'batch_norm': True} class VGG19(Base): kwargs = {'depth': 19} class VGG19BN(Base): kwargs = {'depth': 19, 'batch_norm': True} """#Hyper-Parameters""" DATASET= 'CIFAR100' #str DATA_PATH = '/content/drive/MyDrive/colab_projects_files/dnn-mode-connectivity' #str BATCH_SIZE = 128 #int NUM_WORKERS = 2 #int {0-1-2-4-16} to speed up the training process EPOCHS = 4 #int IS_SWA = True #bool SWA_START_EPOCH = 2 #int smaller than EPOCHS LR_INIT = 0.1#float SWA_LR = 0.01#float SWA_C_EPOCHS = 2 #int SWA model collection frequency/cycle length in epochs SAVE_FREQ = 2 #int save frequency WD =1e-4 #float EVAL_FREQ = 1 #int evaluation frequency MOMENTUM = 0.9 #float SGD momentum MODEL_NAME = VGG16 TRANSFORM = 'VGG' FGE_CYCLE = 2 FGE_LR1 = 0.05 FGE_LR2 = 0.0001 """#Data""" ds = getattr(torchvision.datasets, DATASET) path = os.path.join(DATA_PATH, DATASET.lower()) train_set = ds(path, train=True, download=True, transform=MODEL_NAME.transform_train) test_set = ds(path, train=False, download=True, transform=MODEL_NAME.transform_test) loaders = { 'train': torch.utils.data.DataLoader( train_set, batch_size=BATCH_SIZE, shuffle=True, num_workers= NUM_WORKERS, pin_memory=True ), 'test': torch.utils.data.DataLoader( test_set, batch_size=BATCH_SIZE, shuffle=False, num_workers=NUM_WORKERS, pin_memory=True ) } num_classes = max(train_set.targets) + 1 """#Train""" torch.backends.cudnn.benchmark = True torch.manual_seed(1) torch.cuda.manual_seed(1) def schedule(epoch): t = (epoch) / (SWA_START_EPOCH if IS_SWA else EPOCHS) lr_ratio = SWA_LR / LR_INIT if IS_SWA else 0.01 if t <= 0.5: factor = 1.0 elif t <= 0.9: factor = 1.0 - (1.0 - lr_ratio) * (t - 0.5) / 0.4 else: factor = lr_ratio return LR_INIT * factor def train_model(model, optimizer, criterion, start_epoch=0, swa_model=None, swa_n=0): # difine the table columns = ['ep', 'lr', 'tr_loss', 'tr_acc', 'te_loss', 'te_acc', 'time'] if IS_SWA: columns = columns[:-1] + ['swa_train_loss', 'swa_train_acc','swa_te_loss', 'swa_te_acc'] + columns[-1:] swa_train_res={'loss':None, 'accuracy': None} swa_res = {'loss': None, 'accuracy': None} data_table =[] # saving the first check point(initial point) save_checkpoint(DIR, start_epoch, state_dict=model.state_dict(), swa_state_dict=swa_model.state_dict() if IS_SWA else None, swa_n=swa_n if IS_SWA else None, optimizer=optimizer.state_dict()) # start training for epoch in range(start_epoch, EPOCHS): time_ep = time.time() lr = schedule(epoch) adjust_learning_rate(optimizer, lr) train_res = train_epoch(loaders['train'], model, criterion, optimizer) if epoch == 0 or epoch % EVAL_FREQ == EVAL_FREQ - 1 or epoch == EPOCHS - 1: test_res = eval(loaders['test'], model, criterion) else: test_res = {'loss': None, 'accuracy': None} if IS_SWA and (epoch + 1) >= SWA_START_EPOCH and (epoch + 1 - SWA_START_EPOCH) % SWA_C_EPOCHS == 0: moving_average(swa_model, model, 1.0 / (swa_n + 1)) swa_train_res = train_epoch(loaders['train'], swa_model, criterion, optimizer) swa_n += 1 if epoch == 0 or epoch % EVAL_FREQ == EVAL_FREQ - 1 or epoch == EPOCHS - 1: bn_update(loaders['train'], swa_model) swa_res = eval(loaders['test'], swa_model, criterion) else: swa_res = {'loss': None, 'accuracy': None} if (epoch + 1) % SAVE_FREQ == 0: save_checkpoint(DIR, epoch + 1, state_dict=model.state_dict(), swa_state_dict=swa_model.state_dict() if IS_SWA else None, swa_n=swa_n if IS_SWA else None, optimizer=optimizer.state_dict()) #preparing the table of the results time_ep = time.time() - time_ep values = [epoch + 1, lr, train_res['loss'], train_res['accuracy'], test_res['loss'], test_res['accuracy'], time_ep] if IS_SWA: values = values[:-1] + [swa_train_res['loss'], swa_train_res['accuracy'], swa_res['loss'], swa_res['accuracy']] + values[-1:] swa_train_res={'loss':None, 'accuracy': None} swa_res = {'loss': None, 'accuracy': None} data_table.append(values) table = tabulate.tabulate([values], columns, tablefmt='simple', floatfmt='8.4f') if epoch % 40 == 0: table = table.split('\n') table = '\n'.join([table[1]] + table) else: table = table.split('\n')[2] print(table) # save the last checkpoint if EPOCHS % SAVE_FREQ != 0: save_checkpoint(DIR, EPOCHS, state_dict=model.state_dict(), swa_state_dict=swa_model.state_dict() if IS_SWA else None, swa_n=swa_n if IS_SWA else None, optimizer=optimizer.state_dict()) #save data table df_table = pd.DataFrame(data_table,columns=columns) table_path = os.path.join(DIR,'table.csv') df_table.to_csv(table_path) # resume_point: checkpoint to resume training from def resume_train_model(model, optimizer, criterion, resume_point,swa_model=None): print('Resume training from %s' % resume_point) checkpoint = torch.load(resume_point) start_epoch = checkpoint['epoch'] + 1 model.load_state_dict(checkpoint['state_dict']) model.cuda() optimizer.load_state_dict(checkpoint['optimizer']) if IS_SWA: swa_state_dict = checkpoint['swa_state_dict'] if swa_state_dict is not None: swa_model.load_state_dict(swa_state_dict) swa_n_ckpt = checkpoint['swa_n'] if swa_n_ckpt is not None: swa_n = swa_n_ckpt train_model(model, optimizer, criterion, start_epoch, swa_model, swa_n) else: train_model(model, optimizer, criterion, start_epoch,swa_model) else: train_model(model, optimizer, criterion, start_epoch) """##Train fge""" def train_fge(ckpt, model, optimizer, criterion): checkpoint = torch.load(ckpt) start_epoch = checkpoint['epoch'] + 1 model.load_state_dict(checkpoint['state_dict']) model.cuda() optimizer.load_state_dict(checkpoint['optimizer']) ensemble_size = 0 predictions_sum = np.zeros((len(loaders['test'].dataset), num_classes)) data_table =[] columns = ['ep', 'lr', 'tr_loss', 'tr_acc', 'te_loss', 'te_acc','FGE_acc', 'time'] for epoch in range(start_epoch, EPOCHS): time_ep = time.time() lr_schedule = cyclic_learning_rate(epoch,FGE_CYCLE , LR_INIT, FGE_LR2) train_res = fge_train_epoch(loaders['train'], model, optimizer, criterion, lr_schedule=lr_schedule) test_res = eval(loaders['test'], model, criterion) time_ep = time.time() - time_ep prediction, targets = predictions(loaders['test'], model) ens_acc = None if (epoch % FGE_CYCLE + 1) == FGE_CYCLE // 2: ensemble_size += 1 predictions_sum += prediction ens_acc = 100.0 * np.mean(np.argmax(predictions_sum, axis=1) == targets) if (epoch + 1) % (FGE_CYCLE // 2) == 0: save_checkpoint(DIR, epoch+ 1, name='fge', model_state=model.state_dict(), swa_state_dict= None, swa_n=None, optimizer=optimizer.state_dict()) values = [epoch, lr_schedule(1.0), train_res['loss'], train_res['accuracy'], test_res['loss'], test_res['accuracy'], ens_acc, time_ep] data_table.append(values) table = tabulate.tabulate([values], columns, tablefmt='simple', floatfmt='9.4f') if epoch % 40 == 0: table = table.split('\n') table = '\n'.join([table[1]] + table) else: table = table.split('\n')[2] print(table) if EPOCHS % SAVE_FREQ != 0: save_checkpoint(DIR, EPOCHS, name='fge', state_dict=model.state_dict(), swa_state_dict=swa_model.state_dict() if IS_SWA else None, swa_n=swa_n if IS_SWA else None, optimizer=optimizer.state_dict()) df_table = pd.DataFrame(data_table,columns=columns) table_path = os.path.join(DIR,'table.csv') df_table.to_csv(table_path) """# Run""" #Define SGD model def prep_model(model_name): model = model_name.base(num_classes=num_classes,**model_name.kwargs) model.cuda() criterion = F.cross_entropy optimizer = torch.optim.SGD(model.parameters(), lr=LR_INIT, momentum=MOMENTUM, weight_decay=WD) return model, criterion, optimizer #Define SWA model def prep_swa_model(model_name): swa_model = model_name.base(num_classes=num_classes,**model_name.kwargs) swa_model.cuda() swa_n = 0 return swa_model, swa_n """##SWA train and eval""" for i in range(8,11): DIR = f'/content/drive/MyDrive/colab_projects_files/dnn-mode-connectivity/Experiment_{i}/SWA' model, criterion, optimizer = prep_model(MODEL_NAME) swa_model, swa_n = prep_swa_model(MODEL_NAME) train_model(model, optimizer, criterion, 0, swa_model, swa_n) """##FGE train and eval""" for i in range(1,11): DIR = f'/content/drive/MyDrive/colab_projects_files/dnn-mode-connectivity/Experiment_{i}/fge' RESUME_POINT = f'/content/drive/MyDrive/colab_projects_files/dnn-mode-connectivity/Experiment_{i}/SWA/checkpoint-2.pt' model, criterion, optimizer = prep_model(MODEL_NAME) train_fge(RESUME_POINT, model, optimizer, criterion) """#plots for train/test errors""" independent = [] independence_ensemble50 = [] FGE = [] SWA = [] for i in range(1, 11): prefix = f"/content/drive/MyDrive/dnn-mode-connectivity/Experiment_{i}/" # independent.append(pd.read_csv(prefix+"ind_3/table.csv")) # independence_ensemble50.append(pd.read_csv(prefix+"Ensemble_50/table_ind.csv")) independent.append(pd.read_csv(prefix+"fge/train_for_fge/table.csv")) FGE.append(pd.read_csv(prefix+"fge/fge_model/table.csv")) SWA.append(pd.read_csv(prefix+"SWA/table.csv")) sns.set() # comparison between SGD fully trained to SWA (FGE and independent ensembles can be added in every stage as points) # comparison between diversity between FGE and individual. # train loss over epochs. def aggregate(lst_of_exps, fge=False, swa=False): loss = [] acc = [] for df in lst_of_exps: if swa: df = df[df.ep % 2 == 1] if fge: loss.append(df['tr_loss']) acc.append(df['ens_acc']) elif swa: acc.append(df['swa_te_acc']) loss.append(df['swa_train_loss']) else: loss.append(df['tr_loss']) acc.append(df['te_acc']) loss = pd.DataFrame(loss) acc = pd.DataFrame(acc) epochs = acc.columns if fge or swa: epochs = epochs + 40 stats = pd.DataFrame({'epoch': epochs, 'loss': loss.mean(), 'loss_std': loss.std(), "test_error": 100-acc.mean(), "test_error_std": acc.std()}) return stats full_trained_sgd = aggregate(independent) fge = aggregate(FGE, True).dropna() swa = aggregate(SWA, False, True).dropna() f, ax = plt.subplots(figsize=(8,5)) ax.errorbar(x=full_trained_sgd['epoch'], y=full_trained_sgd['loss'], yerr=full_trained_sgd["loss_std"], label='fully trained SGD') ax.errorbar(x=swa['epoch'], y=swa['loss'], yerr=swa['loss_std'], label='SWA ensemble (cycle=2)', fmt='o', color='red') plt.legend() plt.ylabel("Train Loss") plt.xlabel("Epoch") plt.xlim(30,50) f, ax = plt.subplots(figsize=(8,5)) ax.errorbar(x=full_trained_sgd['epoch'], y=full_trained_sgd['test_error'], yerr=full_trained_sgd["test_error_std"], label='fully trained SGD') ax.errorbar(x=fge['epoch'], y=fge['test_error'], yerr=fge['test_error_std'], label='FGE ensemble (cycle=2)', fmt='o', color='black') ax.errorbar(x=swa['epoch'], y=swa['test_error'], yerr=swa['test_error_std'], label='SWA ensemble (cycle=2)', fmt='o', color='red') plt.legend() plt.ylabel("% Test error") plt.xlabel("Epoch") plt.xlim(30,50) f, ax = plt.subplots() x = np.arange(50) x0 = np.arange(10) + 40 for i in range(10): ax.plot(x, independent[i]['tr_loss'], label='full_sgd', color='b') ax.plot(x0, SWA[i]['swa_train_loss'], label='swa',color='orange') plt.xlim(35,50) f, ax = plt.subplots() x = np.arange(50) x0 = np.arange(10) + 40 x1 = [40,42,44,46,48] for i in range(10): ax.plot(x, independent[i]['te_acc'], label='full_sgd', color='b') ax.plot(x0, SWA[i]['swa_te_acc'], label='swa',color='orange') ax.plot(x1, FGE[i]['ens_acc'].dropna(), label='fge',color='red') plt.xlim(35,50) """#Loss Land Scape""" !pip install loss_landscapes # code from this library - import the lines module import copy import matplotlib import matplotlib.pyplot as plt from mpl_toolkits import mplot3d import loss_landscapes import loss_landscapes.metrics matplotlib.rcParams['figure.figsize'] = [8, 6] def prep_model_for_loss(model_name): model = model_name.base(num_classes=num_classes,**model_name.kwargs) criterion = F.cross_entropy optimizer = torch.optim.SGD(model.parameters(), lr=LR_INIT, momentum=MOMENTUM, weight_decay=WD) return model, criterion, optimizer def plot_around(loss_data_fin, model_name): plt.contour(loss_data_fin, levels=50) plt.title(f'Loss Contours around {model_name} Trained Model') plt.show() """#LOSS LAND SCAPE FOR SGD""" # contour plot resolution def sgd_loss_land(): for i in range(1,11): RESUME_POINT = f'/content/drive/MyDrive/colab_projects_files/dnn-mode-connectivity/Experiment_{i}/SWA/checkpoint-50.pt' model, criterion, optimizer = prep_model_for_loss(MODEL_NAME) checkpoint = torch.load(RESUME_POINT) model.load_state_dict(checkpoint['model_state']) optimizer.load_state_dict(checkpoint['optimizer_state']) # data that the evaluator will use when evaluating loss criterion = criterion x, y = iter(loaders['train']).__next__() metric = loss_landscapes.metrics.Loss(criterion, x, y) # compute loss data loss_data_fin = loss_landscapes.random_plane(model, metric, distance=15, steps=STEPS, normalization='filter', deepcopy_model=True) fig = plt.figure() ax = plt.axes(projection='3d') X = np.array([[j for j in range(STEPS)] for i in range(STEPS)]) Y = np.array([[i for _ in range(STEPS)] for i in range(STEPS)]) ax.plot_surface(X, Y, loss_data_fin, rstride=1, cstride=1, cmap='viridis', edgecolor='none') ax.set_title('Surface Plot of Loss Landscape for SGD') fig.show() sgd_loss_land() """##LOSS LAND SCAPE FOR SWA""" def swa_loss_land(): for i in range(1,11): RESUME_POINT = f'/content/drive/MyDrive/colab_projects_files/dnn-mode-connectivity/Experiment_{i}/SWA/checkpoint-50.pt' model, criterion, optimizer = prep_model_for_loss(MODEL_NAME) checkpoint = torch.load(RESUME_POINT) model.load_state_dict(checkpoint['state_dict']) optimizer.load_state_dict(checkpoint['optimizer']) # data that the evaluator will use when evaluating loss criterion = criterion x, y = iter(loaders['train']).__next__() metric = loss_landscapes.metrics.Loss(criterion, x, y) # compute loss data loss_data_fin = loss_landscapes.random_plane(model, metric, distance=15, steps=STEPS, normalization='filter', deepcopy_model=True) fig = plt.figure() ax = plt.axes(projection='3d') X = np.array([[j for j in range(STEPS)] for i in range(STEPS)]) Y = np.array([[i for _ in range(STEPS)] for i in range(STEPS)]) ax.plot_surface(X, Y, loss_data_fin, rstride=1, cstride=1, cmap='viridis', edgecolor='none') ax.set_title('Surface Plot of Loss Landscape for SWA') fig.show() swa_loss_land() """#Linear Interpolations of Loss between Two Points of SWA and SGD""" def inter_loss(): swa_point = f'/content/drive/MyDrive/colab_projects_files/dnn-mode-connectivity/Experiment_2/SWA/checkpoint-50.pt' sgd_point = f'/content/drive/MyDrive/colab_projects_files/dnn-mode-connectivity/Experiment_2/fge/train_for_fge/checkpoint-50.pt' #prep swa model model_swa, criterion_swa, optimizer_swa = prep_model_for_loss(MODEL_NAME) checkpoint = torch.load(swa_point) model_swa.load_state_dict(checkpoint['state_dict']) optimizer_swa.load_state_dict(checkpoint['optimizer']) #prep model sgd model_sgd, criterion_sgd, optimizer_sgd = prep_model_for_loss(MODEL_NAME) checkpoint = torch.load(sgd_point) model_sgd.load_state_dict(checkpoint['model_state']) optimizer_sgd.load_state_dict(checkpoint['optimizer_state']) # data that the evaluator will use when evaluating loss criterion = criterion_swa x, y = iter(loaders['train']).__next__() metric = loss_landscapes.metrics.Loss(criterion_swa, x, y) # compute loss data loss_data_swa_to_sgd = loss_landscapes.linear_interpolation(model_swa, model_sgd, metric, STEPS, deepcopy_model=True) loss_data_sgd_to_swa = loss_landscapes.linear_interpolation(model_sgd, model_swa, metric, STEPS, deepcopy_model=True) return loss_data_swa_to_sgd, loss_data_sgd_to_swa STEPS = 35 loss_data_swa_to_sgd, loss_data_sgd_to_swa = inter_loss() plt.plot([1/STEPS * i for i in range(STEPS)], loss_data_swa_to_sgd) plt.title('Linear Interpolation of Loss from SWA to SGD') plt.xlabel('Interpolation Coefficient') plt.ylabel('Loss') axes = plt.gca() # axes.set_ylim([2.300,2.325]) plt.show() plt.plot([1/STEPS * i for i in range(STEPS)], loss_data_sgd_to_swa) plt.title('Linear Interpolation of Loss from SGD to SWA') plt.xlabel('Interpolation Coefficient') plt.ylabel('Loss') axes = plt.gca() # axes.set_ylim([2.300,2.325]) plt.show()
34.634451
142
0.630682
6,011
44,436
4.460655
0.098153
0.016783
0.004028
0.007384
0.571104
0.513669
0.453586
0.415209
0.403909
0.383956
0
0.027051
0.243789
44,436
1,283
143
34.634451
0.770884
0.030898
0
0.441176
1
0.005071
0.070334
0.021309
0
0
0
0
0.002028
0
null
null
0.001014
0.03144
null
null
0.003043
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
61419a70669efabca3fe0dc01cc848e4c1d80c9a
4,090
py
Python
models/head.py
Magicboomliu/DeepLearning-Tricks
bde9c379abcee7adfbd81cf77cfbd5398e843202
[ "Apache-2.0" ]
null
null
null
models/head.py
Magicboomliu/DeepLearning-Tricks
bde9c379abcee7adfbd81cf77cfbd5398e843202
[ "Apache-2.0" ]
null
null
null
models/head.py
Magicboomliu/DeepLearning-Tricks
bde9c379abcee7adfbd81cf77cfbd5398e843202
[ "Apache-2.0" ]
null
null
null
import torch from torch import nn import torch.nn.functional as F # torch.Size([1, 18, 104, 104]) # torch.Size([1, 36, 52, 52]) # torch.Size([1, 72, 26, 26]) # torch.Size([1, 144, 13, 13]) class ConcatHead(nn.Module): ''' 把 backbone 的多尺度输出合在一起 ''' def __init__(self, args): super().__init__() self.args = args def forward(self, x_list): upsample_list = [] for id, x in enumerate(x_list): upsample_list.append(F.interpolate(x, scale_factor=int(1<<id), mode="bilinear") ) upsample_out = torch.cat(upsample_list, dim=1) downsample_list = [] for id, x in enumerate(reversed(x_list)): downsample_list.append(F.interpolate(x, scale_factor=1.0/(1<<id), mode="bilinear") ) downsample_out = torch.cat(downsample_list, dim=1) return upsample_out, downsample_out class ConcatHeadV1(nn.Module): ''' 把 backbone 的多尺度输出合在一起 ''' def __init__(self, args): super().__init__() self.args = args def forward(self, x_list): upsample_list = [] for id, x in enumerate(x_list): upsample_list.append(F.interpolate(x, scale_factor=int(1<<id), mode="bilinear") ) upsample_out = torch.cat(upsample_list, dim=1) downsample_out = F.interpolate(upsample_out, scale_factor=1.0/(1<<(len(x_list) -1)), mode="bilinear") return upsample_out, downsample_out class SegHead(nn.Module): ''' 用于分割的 head ''' def __init__(self, args): super().__init__() self.args = args self.ch = sum(self.args.hrn_out_channel) self.conv1 = nn.Conv2d(self.ch, self.ch, kernel_size=3, stride=1, padding=1, bias=False) self.norm = args.norm_layer(self.ch) self.relu = nn.ReLU() self.conv2 = nn.Conv2d(self.ch, self.args.seg_class_num, kernel_size=1, stride=1, padding=0, bias=False) def forward(self, x): out = self.relu(self.norm(self.conv1(x))) out = self.conv2(out) return out class PSHead(nn.Module): ''' 用于库位检测的 head,角点 pair 检测 && 角点方向、坐标检测 slot: (6, self.args.feature_map_size, self.args.feature_map_size) && channel is [x1, y1, x2, y2, confidence, slot_use] 记录每个 grid 中心点到两个角点的 vector,长度归一化到(0,1) mark: (5, self.args.feature_map_size, self.args.feature_map_size) && channel is [x, y, dx, dy, confidence] 记录每个角点的坐标和方向,confidence, x, y, from(0,1), dx, dy, from (-1, 1) ''' def __init__(self, args): super().__init__() self.args = args self.ch = sum(self.args.hrn_out_channel) self.conv_slot = nn.Conv2d(self.ch, self.args.slot_channel, kernel_size=3, stride=1, padding=1, bias=False) self.conv_mark = nn.Conv2d(self.ch, self.args.mark_channel, kernel_size=3, stride=1, padding=1, bias=False) self.activate = nn.Sigmoid() def forward(self, x): slot_out = self.activate(self.conv_slot(x)) mark_out = self.activate(self.conv_mark(x)) return slot_out, mark_out class PSHeadV2(nn.Module): ''' 用于库位检测的 head,角点 pair 检测 && 角点方向、坐标检测 slot: (6, self.args.feature_map_size, self.args.feature_map_size) && channel is [x1, y1, x2, y2, confidence, slot_use] 记录每个 grid 中心点到两个角点的 vector,长度归一化到(0,1) mark: (5, self.args.feature_map_size, self.args.feature_map_size) && channel is [x, y, dx, dy, confidence] 记录每个角点的坐标和方向,confidence, x, y, from(0,1), dx, dy, from (-1, 1) ''' def __init__(self, args): super().__init__() self.args = args self.ch = sum(self.args.hrn_out_channel) self.conv_slot = nn.Conv2d(self.ch, self.args.slot_channel, kernel_size=3, stride=1, padding=1, bias=False) self.conv_mark = nn.Conv2d(self.ch, self.args.mark_channel, kernel_size=3, stride=1, padding=1, bias=False) self.activate = nn.Sigmoid() def forward(self, x): slot_logit = self.conv_slot(x) mark_logit = self.conv_mark(x) slot_out = self.activate(slot_logit) mark_out = self.activate(mark_logit) return slot_out, mark_out, slot_logit, mark_logit
38.952381
173
0.640098
610
4,090
4.083607
0.17541
0.083501
0.048173
0.057808
0.771979
0.704938
0.659574
0.645925
0.645925
0.645925
0
0.030341
0.218337
4,090
104
174
39.326923
0.748827
0.220049
0
0.58209
0
0
0.010339
0
0
0
0
0
0
1
0.149254
false
0
0.044776
0
0.343284
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
614c85cd7b1e4a32e4eed023308ab881c219427b
250
py
Python
tangspiderframe/main.py
Jsonming/tangspiderframe
21bb0dbf26dbce81ffb9c2d881a4974eddc8abc6
[ "Apache-2.0" ]
null
null
null
tangspiderframe/main.py
Jsonming/tangspiderframe
21bb0dbf26dbce81ffb9c2d881a4974eddc8abc6
[ "Apache-2.0" ]
null
null
null
tangspiderframe/main.py
Jsonming/tangspiderframe
21bb0dbf26dbce81ffb9c2d881a4974eddc8abc6
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/11/20 19:55 # @Author : yangmingming # @Site : ww # @File : main.py # @Software: PyCharm from scrapy import cmdline cmdline.execute("scrapy crawl text_korea_kids_link".split())
20.833333
60
0.652
35
250
4.571429
0.942857
0
0
0
0
0
0
0
0
0
0
0.063725
0.184
250
11
61
22.727273
0.720588
0.584
0
0
0
0
0.340206
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
2
6150107f9dde29c197d2d45abcb2f74237930462
456
py
Python
src/xsarsea/windspeed/__init__.py
umr-lops/xsarsea
580869d8adc4a80ed3c0742737304f98ef9ac606
[ "MIT" ]
null
null
null
src/xsarsea/windspeed/__init__.py
umr-lops/xsarsea
580869d8adc4a80ed3c0742737304f98ef9ac606
[ "MIT" ]
6
2021-09-11T19:36:02.000Z
2022-02-09T17:48:46.000Z
src/xsarsea/windspeed/__init__.py
umr-lops/xsarsea
580869d8adc4a80ed3c0742737304f98ef9ac606
[ "MIT" ]
3
2021-09-11T19:23:46.000Z
2022-01-26T13:23:15.000Z
""" windspeed module, for retrieving wind speed from sigma0 and models. """ __all__ = ['invert_from_model', 'available_models', 'get_model', 'register_all_sarwing_luts', 'register_all_nc_luts', 'nesz_flattening'] from .windspeed import invert_from_model from .models import available_models, get_model, register_all_nc_luts from .sarwing_luts import register_all_sarwing_luts from .utils import nesz_flattening from . import gmfs from . import gmfs_impl
35.076923
136
0.815789
65
456
5.292308
0.384615
0.127907
0.087209
0.133721
0.197674
0.197674
0
0
0
0
0
0.002451
0.105263
456
12
137
38
0.840686
0.14693
0
0
0
0
0.269129
0.065963
0
0
0
0
0
1
0
false
0
0.857143
0
0.857143
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
61549d481c41e7719c3b6a6e14d20ce918559acb
472
py
Python
python/207.py
kylekanos/project-euler-1
af7089356a4cea90f8ef331cfdc65e696def6140
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
python/207.py
kylekanos/project-euler-1
af7089356a4cea90f8ef331cfdc65e696def6140
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
python/207.py
kylekanos/project-euler-1
af7089356a4cea90f8ef331cfdc65e696def6140
[ "BSD-2-Clause-FreeBSD" ]
1
2019-09-17T00:55:58.000Z
2019-09-17T00:55:58.000Z
#!/usr/bin/env python from math import log def x1(u): return 4*u + 1 def y1(u): return 4*u*u + 2*u def x2(u): return 4*u + 3 def y2(u): return 4*u*u + 6*u + 2 def nextk(): u1, u2 = 1, 0 while True: if y1(u1)<y2(u2): yield (y1(u1),(x1(u1)+1)/2) u1 += 1 else: yield (y2(u2),(x2(u2)+1)/2) u2 += 1 i=0 for t in nextk(): n = t[1] if 12345*int(log(n,2)) < n-1: print t[0] break
18.153846
39
0.455508
94
472
2.287234
0.404255
0.130233
0.148837
0.167442
0.093023
0
0
0
0
0
0
0.155116
0.358051
472
25
40
18.88
0.554455
0.042373
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0.05
null
null
0.05
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
61699babe68a18ffdc87d0bebad152f6d5b5c3eb
96
py
Python
Curso/ExMundo2/Ex046For1PrintLinhas.py
DavidBitner/Aprendizado-Python
e1dcf18f9473c697fc2302f34a2d3e025ca6c969
[ "MIT" ]
null
null
null
Curso/ExMundo2/Ex046For1PrintLinhas.py
DavidBitner/Aprendizado-Python
e1dcf18f9473c697fc2302f34a2d3e025ca6c969
[ "MIT" ]
null
null
null
Curso/ExMundo2/Ex046For1PrintLinhas.py
DavidBitner/Aprendizado-Python
e1dcf18f9473c697fc2302f34a2d3e025ca6c969
[ "MIT" ]
null
null
null
from time import sleep i = 10 f = -1 p = -1 for c in range(i, f, p): print(c) sleep(1)
10.666667
24
0.541667
21
96
2.47619
0.666667
0
0
0
0
0
0
0
0
0
0
0.075758
0.3125
96
8
25
12
0.712121
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.142857
0
0.142857
0.142857
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
616f7744d73064501d07ef4de98918ce72939b11
327
py
Python
src/app_donate.py
pychecksum/PyChecksum-1.0
19f4b85f1de1ff94d7299677d6f52240e48c12c4
[ "MIT" ]
null
null
null
src/app_donate.py
pychecksum/PyChecksum-1.0
19f4b85f1de1ff94d7299677d6f52240e48c12c4
[ "MIT" ]
null
null
null
src/app_donate.py
pychecksum/PyChecksum-1.0
19f4b85f1de1ff94d7299677d6f52240e48c12c4
[ "MIT" ]
null
null
null
donate_msg = """{name} is an open source project, created with the intention of sharing a simple and easy-to-use application for the care of information integrity, through the use of hash table files. If you like {name}, feel free to make a donation if you think so. Any kind of support will be immensely grateful."""
40.875
77
0.749235
56
327
4.357143
0.803571
0.040984
0
0
0
0
0
0
0
0
0
0
0.192661
327
7
78
46.714286
0.924242
0
0
0
0
0
0.937304
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
617320371742108f48788014acb7340e9c839169
317
py
Python
database.py
allanice001/LicenseServer
72f77bb838b7e749c06d22ed5394213961ed2259
[ "MIT" ]
44
2018-01-28T07:11:40.000Z
2021-11-28T16:53:58.000Z
database.py
allanice001/LicenseServer
72f77bb838b7e749c06d22ed5394213961ed2259
[ "MIT" ]
3
2017-08-09T21:26:13.000Z
2020-06-09T23:01:09.000Z
database.py
allanice001/LicenseServer
72f77bb838b7e749c06d22ed5394213961ed2259
[ "MIT" ]
18
2017-08-07T06:33:07.000Z
2022-03-31T11:37:14.000Z
# MIT Licensed. Copyright (c) 2017 import sqlite3 from sqlalchemy import create_engine from sqlalchemy.ext.automap import automap_base # Setup our connection to the database engine = create_engine('sqlite+pysqlite:///license_database.sqlite3', module=sqlite3) Base = automap_base() Base.prepare(engine, reflect=True)
35.222222
85
0.810726
43
317
5.860465
0.627907
0.111111
0
0
0
0
0
0
0
0
0
0.024561
0.100946
317
9
86
35.222222
0.859649
0.217666
0
0
0
0
0.174797
0.174797
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
6177388b767231ec70f0349a1229d0fbee4572fb
3,065
py
Python
dmsuMarket/dmsuMarket/apps/verification/views.py
IzayoiRin/DmSuMarket
ead8380ca7edca573c920fe78ca99ec59f9564ca
[ "MIT" ]
null
null
null
dmsuMarket/dmsuMarket/apps/verification/views.py
IzayoiRin/DmSuMarket
ead8380ca7edca573c920fe78ca99ec59f9564ca
[ "MIT" ]
1
2019-06-30T07:16:13.000Z
2019-06-30T07:16:13.000Z
dmsuMarket/dmsuMarket/apps/verification/views.py
IzayoiRin/DmSuMarket
ead8380ca7edca573c920fe78ca99ec59f9564ca
[ "MIT" ]
null
null
null
import random from django.shortcuts import render from rest_framework import status from rest_framework.generics import GenericAPIView from rest_framework.renderers import JSONRenderer from rest_framework.response import Response # from celery_tasks.sms.tasks import send_sms_code from dmsuMarket.utils.captcha.captcha import captcha from dmsuMarket.utils.renderers import JPEGRenderer from verification.serializers import ImageCodeSerializer, SmsCodeSerializer class ImageCodeMixin(object): # GET /image-codes/(?P<image_code_id>[\w-]+)/ def image_(self, request, image_code_id): _, text, img = captcha.generate_captcha() s = self.get_serializer(data={'image_code_id': image_code_id}) s.is_valid(raise_exception=True) setattr(s, 'text', text) ret = s.save() print(">>>>> UUID:{image_code_id} >>>>>> ImgCode: {text} >>>>>".format(**ret)) return Response(data=img, status=status.HTTP_200_OK) def get_serializer(self, *args, **kwargs): s = super().get_serializer(*args, **kwargs) # type: ImageCodeSerializer s.validate_rule = r'^.*' s.redis = self.redis_con return s class SmsCodeMixin(object): # GET /sms-codes/(?P<mobile>1[3-9]\d{9})/?image_code_id=&text= def sms_(self, request, mobile): s = self.get_serializer(data=request.query_params) s.is_valid(raise_exception=True) sms = '%06d' % random.randint(0, 999999) # TODO send_sms_code.delay(mobile, sms) print('>>>>>>>>>>>>Clouds Communicating>>>>>>>>>>>>>>') setattr(s, 'sms', sms) ret = s.save() print(">>>>> Mobile:{mobile} >>>>>> SmsCode: {sms} >>>>>".format(**ret)) return Response(data={'message': 'OK'}, status=status.HTTP_200_OK) def get_serializer(self, *args, **kwargs): s = super().get_serializer(*args, **kwargs) # type: SmsCodeSerializer s.redis = self.redis_con return s class ImageCodeAPI(ImageCodeMixin, GenericAPIView): """ GET /image-codes/(?P<image_code_id>)/ Request: :path_param: image_code_id UUIDField Serializer: ImageCodeSerializer Renderer: JPEGRenderer :return JPG BinaryType """ serializer_class = ImageCodeSerializer redis_con = 'verification' renderer_classes = (JPEGRenderer,) def get(self, request, *args, **kwargs): return self.image_(request, *args, **kwargs) class SmsCodeAPI(SmsCodeMixin, GenericAPIView): """ GET /sms-codes/(?P<mobile>1[3-9]\d{9})/?image_code_id=UUID&text=XXXX Request: :path_param: mobile :query_params: QueryDict{image_code_id: UUIDField, text: r'^[A-Za-z0-9]{4}$'} Serializer: SmsCodeSerializer Renderer: JOSNRenderer :return {'message': ok} {'non_field_errors': error} """ serializer_class = SmsCodeSerializer redis_con = 'verification' renderer_classes = (JSONRenderer,) def get(self, request, *args, **kwargs): return self.sms_(request, *args, **kwargs)
33.681319
86
0.653834
361
3,065
5.373961
0.299169
0.046392
0.056701
0.014433
0.329897
0.243299
0.216495
0.190722
0.121649
0.121649
0
0.010678
0.205546
3,065
90
87
34.055556
0.786037
0.238173
0
0.326531
0
0
0.093625
0.012037
0
0
0
0.011111
0
1
0.122449
false
0
0.183673
0.040816
0.632653
0.061224
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
1
0
0
2
6184b2b25dd06792df94babfe04b06c504b17a62
2,436
py
Python
django/donta_rpg/main/models.py
MiyaSteven/python_stack
c0f766d646b155efb4f6dd9df3eddfe72b14d91c
[ "MIT" ]
null
null
null
django/donta_rpg/main/models.py
MiyaSteven/python_stack
c0f766d646b155efb4f6dd9df3eddfe72b14d91c
[ "MIT" ]
null
null
null
django/donta_rpg/main/models.py
MiyaSteven/python_stack
c0f766d646b155efb4f6dd9df3eddfe72b14d91c
[ "MIT" ]
null
null
null
from django.db import models from django import forms import re class UserManager(models.Manager): def register_validator(self, post_data): errors = {} EMAIL_REGEX = re.compile(r'^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+$') if len(post_data['first_name']) < 1: errors['first_name'] = "First name must be at least 2 characters long" if len(post_data['last_name']) < 1: errors['last_name'] = "Last name must be at least 2 characters long" if not EMAIL_REGEX.match(post_data['email']): errors['email'] = "Invalid email" if len(post_data['password']) < 7: errors['password'] = "Password must be at least 8 characters long" if post_data['password'] != post_data['confirm_password']: errors['password'] = "Passwords do not match!" return errors class User(models.Model): first_name = models.CharField(max_length=20) last_name = models.CharField(max_length=20) email = models.EmailField(max_length=20) password = models.CharField(max_length=20) confirm_password = models.CharField(max_length=20) chosen_one = models.BooleanField(default=False) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) objects = UserManager() class Character(models.Model): name = models.CharField(max_length=20) ability = models.CharField(max_length=20) attack = models.CharField(max_length=20) health = models.IntegerField() user = models.ForeignKey(User, related_name="character", on_delete = models.CASCADE) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) class Item(models.Model): item_name = models.CharField(max_length=20) item_effect = models.CharField(max_length=255) special_ability = models.CharField(max_length=255) character = models.ForeignKey(Character, related_name="item", on_delete = models.CASCADE) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) class Obstacle(models.Model): obstacle_name = models.CharField(max_length=20) health = models.IntegerField() item = models.ForeignKey(Item, related_name="obstacle", on_delete = models.CASCADE) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True)
44.290909
93
0.705255
322
2,436
5.139752
0.26087
0.065257
0.119637
0.159517
0.523263
0.466465
0.34139
0.34139
0.280967
0.239879
0
0.017937
0.176108
2,436
54
94
45.111111
0.806677
0
0
0.204082
0
0.020408
0.135468
0.018473
0
0
0
0
0
1
0.020408
false
0.122449
0.061224
0
0.755102
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
2
619719d2eea4fdbd0d8a891bc172b3a45fe99fe4
895
py
Python
project/libs/user/infrastructure/cqrs/change_user_password_command_handler.py
ticdenis/python-skeleton
cb1dc68fa4453709545af4072775aeb373d20df8
[ "MIT" ]
2
2020-08-14T21:01:22.000Z
2021-02-03T12:04:39.000Z
project/libs/user/infrastructure/cqrs/change_user_password_command_handler.py
ticdenis/python-skeleton
cb1dc68fa4453709545af4072775aeb373d20df8
[ "MIT" ]
null
null
null
project/libs/user/infrastructure/cqrs/change_user_password_command_handler.py
ticdenis/python-skeleton
cb1dc68fa4453709545af4072775aeb373d20df8
[ "MIT" ]
1
2022-01-10T16:03:59.000Z
2022-01-10T16:03:59.000Z
from typing import Type, final from aioddd import Command, CommandHandler from pydantic import BaseModel, Field from project.libs.user.application.password_changer_service import ( UserPasswordChangerService, ) from project.libs.user.domain.properties import UserId, UserPassword @final class ChangeUserPasswordCommand(Command, BaseModel): user_id: str = Field(alias='id') old_password: str new_password: str @final class ChangeUserPasswordCommandHandler(CommandHandler): __slots__ = '_service' def __init__(self, service: UserPasswordChangerService) -> None: self._service = service def subscribed_to(self) -> Type[Command]: return ChangeUserPasswordCommand async def handle(self, command: ChangeUserPasswordCommand) -> None: await self._service(UserId(command.user_id), command.old_password, UserPassword(command.new_password))
28.870968
110
0.769832
95
895
7.042105
0.442105
0.049327
0.044843
0.056801
0
0
0
0
0
0
0
0
0.150838
895
30
111
29.833333
0.880263
0
0
0.095238
0
0
0.011173
0
0
0
0
0
0
1
0.095238
false
0.52381
0.238095
0.047619
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
2
619a99089ff2a35fc0703c4532b4292c2f52b172
726
py
Python
ibidem/advent_of_code/y2019/test/test_dec16.py
mortenlj/advent_of_code
738c1f3116f6a817a67183f076e1fe93680ea407
[ "MIT" ]
null
null
null
ibidem/advent_of_code/y2019/test/test_dec16.py
mortenlj/advent_of_code
738c1f3116f6a817a67183f076e1fe93680ea407
[ "MIT" ]
null
null
null
ibidem/advent_of_code/y2019/test/test_dec16.py
mortenlj/advent_of_code
738c1f3116f6a817a67183f076e1fe93680ea407
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 import pytest from ..dec16 import process @pytest.mark.parametrize("signal, result", ( ("80871224585914546619083218645595", "24176176"), ("19617804207202209144916044189917", "73745418"), ("69317163492948606335995924319873", "52432133"), )) def test_process(signal, result): actual = process(signal, offset=0) assert actual == result @pytest.mark.parametrize("signal, result", ( ("03036732577212944063491565474664", "84462026"), ("02935109699940807407585447034323", "78725270"), ("03081770884921959731165446850517", "53553731"), )) def test_real_process(signal, result): actual = process(signal, repetitions=10000) assert actual == result
26.888889
53
0.717631
62
726
8.354839
0.596774
0.092664
0.081081
0.104247
0.274131
0.146718
0
0
0
0
0
0.397764
0.137741
726
26
54
27.923077
0.429712
0.052342
0
0.333333
0
0
0.390671
0.279883
0
0
0
0
0.111111
1
0.111111
false
0
0.111111
0
0.222222
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
619ba549cb6b7544532d4607d106d3ded7fbf621
8,742
gyp
Python
config/libcolony.gyp
LinusU/t1-runtime
dd434be5499ed04709d78a0eba497f908e2cc235
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
null
null
null
config/libcolony.gyp
LinusU/t1-runtime
dd434be5499ed04709d78a0eba497f908e2cc235
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
null
null
null
config/libcolony.gyp
LinusU/t1-runtime
dd434be5499ed04709d78a0eba497f908e2cc235
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
null
null
null
{ "includes": [ "common.gypi", ], "targets": [ { "target_name": "colony-lua", "product_name": "colony-lua", "type": "static_library", "defines": [ 'LUA_USELONGLONG', ], "sources": [ '<(colony_lua_path)/src/lapi.c', '<(colony_lua_path)/src/lauxlib.c', '<(colony_lua_path)/src/lbaselib.c', '<(colony_lua_path)/src/lcode.c', '<(colony_lua_path)/src/ldblib.c', '<(colony_lua_path)/src/ldebug.c', '<(colony_lua_path)/src/ldo.c', '<(colony_lua_path)/src/ldump.c', '<(colony_lua_path)/src/lfunc.c', '<(colony_lua_path)/src/lgc.c', '<(colony_lua_path)/src/linit.c', '<(colony_lua_path)/src/liolib.c', '<(colony_lua_path)/src/llex.c', '<(colony_lua_path)/src/lmathlib.c', '<(colony_lua_path)/src/lmem.c', '<(colony_lua_path)/src/loadlib.c', '<(colony_lua_path)/src/lobject.c', '<(colony_lua_path)/src/lopcodes.c', '<(colony_lua_path)/src/loslib.c', '<(colony_lua_path)/src/lparser.c', '<(colony_lua_path)/src/lstate.c', '<(colony_lua_path)/src/lstring.c', '<(colony_lua_path)/src/lstrlib.c', '<(colony_lua_path)/src/ltable.c', '<(colony_lua_path)/src/ltablib.c', '<(colony_lua_path)/src/ltm.c', '<(colony_lua_path)/src/lundump.c', '<(colony_lua_path)/src/lvm.c', '<(colony_lua_path)/src/lzio.c', '<(colony_lua_path)/src/print.c', '<(lua_bitop_path)/bit.c' ], # Lua uses tmpname and has empty bodies and doesn't use some vars 'cflags': [ '-Wno-deprecated-declarations', '-Wno-empty-body', '-Wno-unused-but-set-variable', '-Wno-unused-value', '-Wno-unused-variable', '-Wno-unknown-warning-option', ], 'xcode_settings': { 'OTHER_CFLAGS': [ '-Wno-deprecated-declarations', '-Wno-empty-body', '-Wno-unused-but-set-variable', '-Wno-unused-value', '-Wno-unknown-warning-option', ], }, "include_dirs": [ "<(colony_lua_path)/src", "<(lua_bitop_path)/", ], 'direct_dependent_settings': { 'defines': [ 'COLONY_LUA', 'LUA_USELONGLONG', ], 'include_dirs': [ "<(colony_lua_path)/src", ], 'link_settings': { 'libraries': [ '-lm' ] } } }, { "target_name": "colony-luajit", "product_name": "colony-luajit", "type": "static_library", 'sources': [ # generated by the action below '<(INTERMEDIATE_DIR)/libluajit.o', ], 'actions': [ { 'action_name': 'luajit-build', 'inputs': [ '<(colony_luajit_path)/Makefile', ], 'outputs': [ '<(INTERMEDIATE_DIR)/libluajit.o', ], 'action': ['<(tools_path)/luajit-build.sh', '<(OS)', '<@(_outputs)'], }, ], 'direct_dependent_settings': { 'defines': [ 'COLONY_LUA', ], 'include_dirs': [ "<(colony_luajit_path)/src", ], 'link_settings': { 'libraries': [ '-lm' ] } } }, { 'target_name': 'dir_builtin', 'type': 'none', 'sources': [ '<(SHARED_INTERMEDIATE_DIR)/<(_target_name).c' ], 'actions': [ { 'action_name': '<(_target_name)_compile', 'inputs': [ '<(node_libs_path)/_stream_duplex.js', '<(node_libs_path)/_stream_passthrough.js', '<(node_libs_path)/_stream_readable.js', '<(node_libs_path)/_stream_transform.js', '<(node_libs_path)/_stream_writable.js', '<(runtime_path)/colony/modules/_structured_clone.js', '<(node_libs_path)/assert.js', '<(runtime_path)/colony/modules/buffer.js', '<(runtime_path)/colony/modules/child_process.js', '<(runtime_path)/colony/modules/console.js', '<(runtime_path)/colony/modules/crypto.js', '<(runtime_path)/colony/modules/dgram.js', '<(runtime_path)/colony/modules/domain.js', '<(runtime_path)/colony/modules/dns.js', '<(node_libs_path)/events.js', '<(runtime_path)/colony/modules/fs.js', '<(runtime_path)/colony/modules/http.js', '<(runtime_path)/colony/modules/https.js', '<(runtime_path)/colony/modules/net.js', '<(runtime_path)/colony/modules/os.js', '<(node_libs_path)/path.js', '<(node_libs_path)/punycode.js', '<(node_libs_path)/querystring.js', '<(runtime_path)/colony/modules/repl.js', '<(node_libs_path)/stream.js', '<(node_libs_path)/string_decoder.js', '<(runtime_path)/colony/modules/tls.js', '<(runtime_path)/colony/modules/tty.js', '<(node_libs_path)/url.js', '<(runtime_path)/colony/modules/util.js', '<(runtime_path)/colony/modules/zlib.js', ], 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/<(_target_name).c', ], 'action': [ '<(tools_path)/compile_folder.sh', '<(SHARED_INTERMEDIATE_DIR)/<(_target_name).c', '<(_target_name)', '<(enable_luajit)', '<@(_inputs)' ], }, ] }, { 'target_name': 'dir_runtime_lib', 'type': 'none', 'sources': [ '<(SHARED_INTERMEDIATE_DIR)/<(_target_name).c' ], 'actions': [ { 'action_name': '<(_target_name)_compile', 'inputs': [ '<(runtime_path)/colony/lua/cli.lua', '<(runtime_path)/colony/lua/colony-init.lua', '<(runtime_path)/colony/lua/colony-js.lua', '<(runtime_path)/colony/lua/colony-node.lua', '<(runtime_path)/colony/lua/colony.lua', '<(runtime_path)/colony/lua/preload.lua', ], 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/<(_target_name).c', ], 'action': [ '<(tools_path)/compile_folder.sh', '<(SHARED_INTERMEDIATE_DIR)/<(_target_name).c', '<(_target_name)', '<(enable_luajit)', '<@(_inputs)' ], }, ] }, { "target_name": "libcolony", "product_name": "libcolony", "type": "static_library", 'cflags': [ '-Wall', '-Wextra', '-Werror' ], 'defines': [ 'COLONY_COMPILER_PATH=<(compiler_path)', 'COLONY_NODE_VERSION=<(node_version)', '__TESSEL_RUNTIME_SEMVER__=<!(node -p \"require(\\\"../package.json\\\").version")', ], "sources": [ '<(runtime_path)/tm_event.c', '<(runtime_path)/tm_timer.c', '<(runtime_path)/colony/lua_hsregex.c', '<(runtime_path)/colony/lua_tm.c', '<(runtime_path)/colony/lua_rapidjson.c', '<(runtime_path)/colony/colony.c', '<(runtime_path)/colony/colony_init.c', '<(runtime_path)/colony/colony_runtime.c', '<(runtime_path)/colony/lua_http_parser.c', '<(SHARED_INTERMEDIATE_DIR)/dir_builtin.c', '<(SHARED_INTERMEDIATE_DIR)/dir_runtime_lib.c', ], "include_dirs": [ '<(runtime_path)/', '<(runtime_path)/colony/', "<(colony_lua_path)/src", ], "dependencies": [ 'dir_builtin', 'dir_runtime_lib', 'libtm.gyp:hsregex', 'libtm.gyp:fortuna', 'libtm.gyp:dlmalloc', 'libtm.gyp:libtm', 'libtm.gyp:approxidate', 'libtm.gyp:http_parser', ], "direct_dependent_settings": { "include_dirs": [ '<(runtime_path)/colony/' ] }, 'conditions': [ ['enable_luajit!=1', { "dependencies": [ 'colony-lua', ] }], ['enable_luajit==1', { "dependencies": [ 'colony-luajit', ] }], ['OS=="linux"', { "link_settings": { "libraries": [ "-ldl" ], }, }], ['OS!="arm"', { "sources": [ '<(runtime_path)/posix/tm_uptime.c', '<(runtime_path)/posix/tm_timestamp.c', ], }], ['enable_ssl==1', { 'dependencies': [ "libtm.gyp:axtls", "libtm.gyp:tm-ssl", ], }], ['enable_net==1', { 'sources': [ '<(runtime_path)/colony/lua_cares.c', ], 'dependencies': [ 'libtm.gyp:c-ares', ], }], ], } ] }
31.221429
160
0.504461
860
8,742
4.80814
0.215116
0.108827
0.139782
0.12769
0.554051
0.227086
0.168803
0.168803
0.149456
0.149456
0
0.00066
0.306337
8,742
279
161
31.333333
0.681234
0.010638
0
0.385185
0
0
0.590215
0.445177
0
0
0
0
0.003704
1
0
true
0.003704
0
0
0
0.003704
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
61a678d16e311ab9d83e77a012de8bdccd40dede
201
py
Python
scripts/reinforce.py
1bayezian/deep-q
c9612b7f100e6fee296f0d21d1fed0c0dfe78c9c
[ "MIT" ]
null
null
null
scripts/reinforce.py
1bayezian/deep-q
c9612b7f100e6fee296f0d21d1fed0c0dfe78c9c
[ "MIT" ]
null
null
null
scripts/reinforce.py
1bayezian/deep-q
c9612b7f100e6fee296f0d21d1fed0c0dfe78c9c
[ "MIT" ]
null
null
null
from architecture.trainer import Trainer LEARNING_RATES = [ 0.01, 0.001, 0.0001 ] for current in LEARNING_RATES: trainer = Trainer(learning_rate = current) trainer.train(num_episodes = 500)
18.272727
44
0.741294
28
201
5.178571
0.642857
0.206897
0
0
0
0
0
0
0
0
0
0.08982
0.169154
201
11
45
18.272727
0.778443
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.111111
0
0.111111
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
61b3d0812bf5cd3d65f89e5fac9c367f5e3eaae0
1,066
py
Python
tsod/custom_exceptions.py
DHI/tsod
d0db0a07ef2374648d5ae62075b34dcfd0dca57d
[ "MIT" ]
86
2021-03-27T17:12:25.000Z
2022-03-28T07:09:32.000Z
tsod/custom_exceptions.py
DHI/anomalydetection
efd1ad86122fa24e2e088ccb4642c5c7f6f6d109
[ "MIT" ]
13
2021-01-12T15:05:15.000Z
2021-03-09T10:14:22.000Z
tsod/custom_exceptions.py
DHI/anomalydetection
efd1ad86122fa24e2e088ccb4642c5c7f6f6d109
[ "MIT" ]
7
2021-04-16T04:43:31.000Z
2022-03-22T09:33:14.000Z
class WrongInputDataType(Exception): def __init__(self, message="Input data must be a pandas.Series."): self.message = message super().__init__(self.message) class NotFittedError(Exception): def __init__(self, message="Please call fit() before detect().", tip=""): self.message = " ".join([message, tip]) super().__init__(self.message) class NoRangeDefinedError(NotFittedError): def __init__(self, message="Or specify min/max range when instantiating detector object."): super().__init__(message) class InvalidArgument(Exception): def __init__(self, argument_name, requirement): self.message = f"{argument_name} must be {requirement}." super().__init__(self.message) class NotInteger(InvalidArgument): def __init__(self, argument_name): super().__init__(argument_name, "an integer") class NonUniqueTimeStamps(Exception): def __init__(self, message="Found multiple values at the same time stamp."): self.message = message super().__init__(self.message)
32.30303
95
0.696998
119
1,066
5.806723
0.420168
0.191028
0.173661
0.115774
0.373372
0.109986
0.109986
0
0
0
0
0
0.181989
1,066
32
96
33.3125
0.792431
0
0
0.272727
0
0
0.209193
0
0
0
0
0
0
1
0.272727
false
0
0
0
0.545455
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
61b452fdd47bf248ca85e2d0af68e35ff58125da
189
py
Python
Python/School/C6/excersize 12.py
abdalrhmanyasser/Abdalrhman_Rep
e0fc3caa2cc04e92f591ccd7934586986d194000
[ "CC0-1.0" ]
null
null
null
Python/School/C6/excersize 12.py
abdalrhmanyasser/Abdalrhman_Rep
e0fc3caa2cc04e92f591ccd7934586986d194000
[ "CC0-1.0" ]
null
null
null
Python/School/C6/excersize 12.py
abdalrhmanyasser/Abdalrhman_Rep
e0fc3caa2cc04e92f591ccd7934586986d194000
[ "CC0-1.0" ]
null
null
null
alpha = "abcdefghijklmnopqrstuvwxyz" key = "xznlwebgjhqdyvtkfuompciasr" message = input("enter the message : ") cipher = "" for i in message: cipher+=key[alpha.index(i)] print(cipher)
27
39
0.724868
21
189
6.52381
0.666667
0.189781
0
0
0
0
0
0
0
0
0
0
0.142857
189
7
40
27
0.845679
0
0
0
0
0
0.378947
0.273684
0
0
0
0
0
1
0
false
0
0
0
0
0.142857
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
61b5ef14a4e6e2829e0b998f1099a11fa6cc81c3
748
py
Python
nesta/core/orms/tests/test_uk_geography_lookup.py
anniyanvr/nesta
4b3ae79922cebde0ad33e08ac4c40b9a10e8e7c3
[ "MIT" ]
13
2019-06-18T16:53:53.000Z
2021-03-04T10:58:52.000Z
nesta/core/orms/tests/test_uk_geography_lookup.py
nestauk/old_nesta_daps
4b3ae79922cebde0ad33e08ac4c40b9a10e8e7c3
[ "MIT" ]
208
2018-08-10T13:15:40.000Z
2021-07-21T10:16:07.000Z
nesta/core/orms/tests/test_uk_geography_lookup.py
nestauk/old_nesta_daps
4b3ae79922cebde0ad33e08ac4c40b9a10e8e7c3
[ "MIT" ]
8
2018-09-20T15:19:23.000Z
2020-12-15T17:41:34.000Z
import unittest from sqlalchemy.orm import sessionmaker #from nesta.core.orms.uk_geography_lookup_orm import UkGeographyLookup from nesta.core.orms.uk_geography_lookup_orm import Base from nesta.core.orms.orm_utils import get_mysql_engine class TestUkGeographyLookup(unittest.TestCase): '''Check that the WiktionaryNgram ORM works as expected''' engine = get_mysql_engine("MYSQLDBCONF", "mysqldb") Session = sessionmaker(engine) def setUp(self): '''Create the temporary table''' Base.metadata.create_all(self.engine) def tearDown(self): '''Drop the temporary table''' Base.metadata.drop_all(self.engine) def test_build(self): pass if __name__ == "__main__": unittest.main()
28.769231
70
0.729947
94
748
5.574468
0.5
0.051527
0.074427
0.097328
0.274809
0.164122
0.164122
0.164122
0.164122
0
0
0
0.175134
748
25
71
29.92
0.849271
0.23262
0
0
0
0
0.046595
0
0
0
0
0
0
1
0.2
false
0.066667
0.266667
0
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
2
4ee12077c735043e86d5acdcfc9bea6829801898
307
py
Python
Parte 1/Lista 01/013.py
Raiane-nepomuceno/Python
acf8bd0436c717614fe7fd4f62e9fa2e432c386a
[ "MIT" ]
null
null
null
Parte 1/Lista 01/013.py
Raiane-nepomuceno/Python
acf8bd0436c717614fe7fd4f62e9fa2e432c386a
[ "MIT" ]
null
null
null
Parte 1/Lista 01/013.py
Raiane-nepomuceno/Python
acf8bd0436c717614fe7fd4f62e9fa2e432c386a
[ "MIT" ]
null
null
null
n1=int(input('Digite a idade da primeira pessoa:')) n2=int(input('Digite a idade da segunda pessoa:')) n3=int(input('Digite a idade da terceira pessoa:')) #Maior ou igual a 100 #menor que 100 soma = n1+ n2+ n3 if soma > 100 or soma == 100: print('Maior ou igual a 100') else: print('Menor que 100')
27.909091
51
0.680782
56
307
3.732143
0.428571
0.114833
0.200957
0.215311
0.4689
0.315789
0
0
0
0
0
0.095618
0.18241
307
10
52
30.7
0.737052
0.107492
0
0
0
0
0.492647
0
0
0
0
0
0
1
0
false
0
0
0
0
0.25
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
4ee21304348b98954362120f1691b77f97406b53
5,291
py
Python
test/integration/029_docs_generate_tests/test_docs_generate.py
gsf/dbt
457db9d09e8d8025c8a6e8e648ad0a13cb6c1b34
[ "Apache-2.0" ]
null
null
null
test/integration/029_docs_generate_tests/test_docs_generate.py
gsf/dbt
457db9d09e8d8025c8a6e8e648ad0a13cb6c1b34
[ "Apache-2.0" ]
null
null
null
test/integration/029_docs_generate_tests/test_docs_generate.py
gsf/dbt
457db9d09e8d8025c8a6e8e648ad0a13cb6c1b34
[ "Apache-2.0" ]
1
2018-10-18T18:45:38.000Z
2018-10-18T18:45:38.000Z
import json import os from nose.plugins.attrib import attr from test.integration.base import DBTIntegrationTest class TestDocsGenerate(DBTIntegrationTest): def setUp(self): super(TestDocsGenerate, self).setUp() self.run_sql_file("test/integration/029_docs_generate_tests/seed.sql") @property def schema(self): return "simple_dependency_029" @property def models(self): return "test/integration/029_docs_generate_tests/models" @property def project_config(self): return { "repositories": [ 'https://github.com/fishtown-analytics/dbt-integration-project' ] } @attr(type='postgres') def test_simple_generate(self): self.run_dbt(["docs", "generate"]) self.assertTrue(os.path.exists('./target/catalog.json')) with open('./target/catalog.json') as fp: data = json.load(fp) my_schema_name = self.unique_schema() self.assertIn(my_schema_name, data) my_schema = data[my_schema_name] expected = { 'seed': { 'metadata': { 'schema': my_schema_name, 'name': 'seed', 'type': 'BASE TABLE', 'comment': None }, 'columns': [ { 'name': 'id', 'index': 1, 'type': 'integer', 'comment': None }, { 'name': 'first_name', 'index': 2, 'type': 'character varying', 'comment': None }, { 'name': 'email', 'index': 3, 'type': 'character varying', 'comment': None, }, { 'name': 'ip_address', 'index': 4, 'type': 'character varying', 'comment': None }, { 'name': 'updated_at', 'index': 5, 'type': 'timestamp without time zone', 'comment': None }, ], }, 'seed_config_expected_1': { 'metadata': { 'schema': my_schema_name, 'name': 'seed_config_expected_1', 'type': 'BASE TABLE', 'comment': None, }, 'columns': [ { 'name': 'id', 'index': 1, 'type': 'integer', 'comment': None, }, { 'name': 'first_name', 'index': 2, 'type': 'character varying', 'comment': None, }, { 'name': 'email', 'index': 3, 'type': 'character varying', 'comment': None, }, { 'name': 'ip_address', 'index': 4, 'type': 'character varying', 'comment': None, }, { 'name': 'updated_at', 'index': 5, 'type': 'timestamp without time zone', 'comment': None, }, { 'name': 'c1', 'index': 6, 'type': 'text', 'comment': None, }, { 'name': 'c2', 'index': 7, 'type': 'text', 'comment': None, }, { 'name': 'some_bool', 'index': 8, 'type': 'text', 'comment': None, }, ], }, 'seed_summary': { 'metadata': { 'schema': my_schema_name, 'name': 'seed_summary', 'type': 'BASE TABLE', 'comment': None }, 'columns': [ { 'name': 'year', 'index': 1, 'type': 'timestamp without time zone', 'comment': None, }, { 'name': 'count', 'index': 2, 'type': 'bigint', 'comment': None, }, ] } } self.assertEqual(expected, my_schema)
32.066667
79
0.316008
321
5,291
5.071651
0.302181
0.121622
0.110565
0.099509
0.514742
0.486486
0.443489
0.359337
0.330467
0.330467
0
0.012456
0.575128
5,291
164
80
32.262195
0.711744
0
0
0.437909
1
0
0.203553
0.038367
0
0
0
0
0.019608
1
0.03268
false
0
0.026144
0.019608
0.084967
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
f6017c6da7df398a076d121d8195b3552de229a2
1,321
py
Python
0063.unqiue_paths_II/solution.py
WZMJ/Algorithms
07f648541d38e24df38bda469665c12df6a50637
[ "MIT" ]
5
2020-05-23T02:18:26.000Z
2021-07-05T05:36:01.000Z
0063.unqiue_paths_II/solution.py
WZMJ/Algorithms
07f648541d38e24df38bda469665c12df6a50637
[ "MIT" ]
1
2020-06-10T07:17:24.000Z
2020-07-20T02:21:24.000Z
0063.unqiue_paths_II/solution.py
WZMJ/Algorithms
07f648541d38e24df38bda469665c12df6a50637
[ "MIT" ]
1
2019-04-23T13:01:50.000Z
2019-04-23T13:01:50.000Z
from typing import List class Solution: def unique_paths_with_obstacle(self, obstacle_grid: List[List[int]]) -> int: """ 二维数组 关键点在于 obstacle_grid[i][j] = obstacle_grid[i-1][j] + obstacle_grid[i][j-1] 如果遇到障碍1,后续都为0 """ if obstacle_grid[0][0]: # 出发点是障碍 return 0 down = len(obstacle_grid) right = len(obstacle_grid[0]) obstacle_grid[0][0] = 1 # 判断第一行的情况 for i in range(1, right): obstacle_grid[0][i] = obstacle_grid[0][i - 1] if obstacle_grid[0][i] == 0 else 0 # 判断第一列的情况 for i in range(1, down): obstacle_grid[i][0] = obstacle_grid[i - 1][0] if obstacle_grid[i][0] == 0 else 0 # 从(1,1)开始将上和左的次数相加 for i in range(1, down): for j in range(1, right): if obstacle_grid[i][j] == 1: obstacle_grid[i][j] = 0 else: obstacle_grid[i][j] = obstacle_grid[i][j - 1] + obstacle_grid[i - 1][j] return obstacle_grid[down - 1][right - 1] if __name__ == "__main__": grid = [[0, 0, 0], [0, 1, 0], [0, 0, 0]] assert Solution().unique_paths_with_obstacle(grid) == 2 grid = [[0, 0, 0, 1], [0, 1, 0, 0], [0, 0, 0, 0]] assert Solution().unique_paths_with_obstacle(grid) == 3
30.72093
92
0.533687
197
1,321
3.390863
0.208122
0.39521
0.214072
0.125749
0.392216
0.360778
0.27994
0.218563
0.134731
0.134731
0
0.064159
0.31567
1,321
42
93
31.452381
0.674779
0.102952
0
0.083333
0
0
0.006957
0
0
0
0
0
0.083333
1
0.041667
false
0
0.041667
0
0.208333
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
f61c6f89f44466d2b14c538d3b0c92ac4bf97d59
131
py
Python
jailed/__init__.py
duanegtr/legendv3-cogs
ffde1452a75ad42b4f6511b612ce486e96fcd6de
[ "MIT" ]
10
2020-05-25T13:32:30.000Z
2022-02-01T12:33:07.000Z
jailed/__init__.py
darcyle/tl-cogs
6b13c4a6247115571c5a2bb6ea98ed1fe2d44d79
[ "MIT" ]
2
2020-05-23T22:53:07.000Z
2020-08-09T11:28:12.000Z
jailed/__init__.py
darcyle/tl-cogs
6b13c4a6247115571c5a2bb6ea98ed1fe2d44d79
[ "MIT" ]
7
2020-05-18T17:37:33.000Z
2022-01-13T04:08:05.000Z
from .jailed import Jail async def setup(bot): cog = Jail(bot) await cog.initialize(bot) bot.add_cog(cog)
16.375
30
0.610687
19
131
4.157895
0.631579
0
0
0
0
0
0
0
0
0
0
0
0.290076
131
7
31
18.714286
0.849462
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
f6263c879d8b2aed7a7bd1717ea281706717efe1
1,260
py
Python
dynamic_scraper/migrations/0016_optional_xpath_fields_text_type_for_x_path_reg_exp_processor_fields.py
Sonatrix/django-dynamic-scraper
e9837c5d5c2c3f8c7f6b05ed01dfaf20aca4f79a
[ "BSD-3-Clause" ]
1
2020-03-24T00:14:56.000Z
2020-03-24T00:14:56.000Z
dynamic_scraper/migrations/0016_optional_xpath_fields_text_type_for_x_path_reg_exp_processor_fields.py
Sonatrix/django-dynamic-scraper
e9837c5d5c2c3f8c7f6b05ed01dfaf20aca4f79a
[ "BSD-3-Clause" ]
8
2020-06-05T20:50:45.000Z
2022-03-11T23:47:00.000Z
dynamic_scraper/migrations/0016_optional_xpath_fields_text_type_for_x_path_reg_exp_processor_fields.py
Sonatrix/django-dynamic-scraper
e9837c5d5c2c3f8c7f6b05ed01dfaf20aca4f79a
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dynamic_scraper', '0015_added_datetime_fields_for_last_scraper_save_and_checker_delete_alert'), ] operations = [ migrations.AlterField( model_name='checker', name='checker_x_path', field=models.TextField(blank=True), ), migrations.AlterField( model_name='checker', name='checker_x_path_result', field=models.TextField(blank=True), ), migrations.AlterField( model_name='scraperelem', name='proc_ctxt', field=models.TextField(blank=True), ), migrations.AlterField( model_name='scraperelem', name='processors', field=models.TextField(blank=True), ), migrations.AlterField( model_name='scraperelem', name='reg_exp', field=models.TextField(blank=True), ), migrations.AlterField( model_name='scraperelem', name='x_path', field=models.TextField(blank=True), ), ]
28
105
0.57619
114
1,260
6.096491
0.394737
0.172662
0.215827
0.25036
0.660432
0.660432
0.660432
0.611511
0.611511
0.420144
0
0.005794
0.315079
1,260
44
106
28.636364
0.799537
0.016667
0
0.631579
0
0
0.172191
0.07599
0
0
0
0
0
1
0
false
0
0.052632
0
0.131579
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
f6335d2e20818ac41f9c26525c876d47384b88eb
633
py
Python
cheby_container/pythonServer.py
Smithsonian/cheby_checker
ce1542e4b1b3303ac08ea823be1eaec06322fd48
[ "MIT" ]
1
2020-03-05T15:20:30.000Z
2020-03-05T15:20:30.000Z
cheby_container/pythonServer.py
Smithsonian/cheby_checker
ce1542e4b1b3303ac08ea823be1eaec06322fd48
[ "MIT" ]
12
2020-08-05T18:11:34.000Z
2021-07-16T18:25:07.000Z
cheby_container/pythonServer.py
Smithsonian/cheby_checker
ce1542e4b1b3303ac08ea823be1eaec06322fd48
[ "MIT" ]
2
2020-02-04T15:26:08.000Z
2020-02-04T18:23:13.000Z
import time #from sqs_class import aws_sqs import logging #aws_sqs = aws_sqs() logging.basicConfig( format = '%s(asctime)s %(levelname)-8s %(message)s', level=logging.INFO, datefmt='%Y-%m-%d %H:%M:%S', filename='pythonLog') while (1): ''' message = aws_sqs.receive_message( ) if message == None: logging.info('No new message in Queue') else: logging.info("New Message in Queue") logging.info(message) #for key in message: # print (key) if message['MessageAttributes']['Title']['StringValue'] == 'FindOrb': print ('Fire UP FindOrb') #stop print ('hello PythonServer is working') ''' time.sleep(60)
19.78125
124
0.671406
88
633
4.761364
0.556818
0.057279
0.057279
0.081146
0
0
0
0
0
0
0
0.007533
0.161137
633
32
125
19.78125
0.781544
0.075829
0
0
0
0
0.317308
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
2
f66210bd34bd7b2a68c6d0c95523001e17249827
838
py
Python
data_scout/connectors/data_source_type.py
janthiemen/data_scout
6366eedfb20ed429bc96100de4dd2c7409e5dd88
[ "MIT" ]
null
null
null
data_scout/connectors/data_source_type.py
janthiemen/data_scout
6366eedfb20ed429bc96100de4dd2c7409e5dd88
[ "MIT" ]
null
null
null
data_scout/connectors/data_source_type.py
janthiemen/data_scout
6366eedfb20ed429bc96100de4dd2c7409e5dd88
[ "MIT" ]
null
null
null
from typing import Type from .sql import SQL from .excel import Excel from .connector import Connector from .csv import CSV from .big_query import BigQuery from ..exceptions import DataSourceConnectorUnavailableException class DataSourceType: data_source_types = {"BigQuery": BigQuery, "CSV": CSV, "Excel": Excel, "SQL": SQL} def serialize(self): serialized = [] for data_source_type in self.data_source_types.values(): serialized.append({"name": data_source_type.__name__, "fields": data_source_type.fields}) return serialized @staticmethod def get_by_string(name: str) -> Type[Connector]: data_source = DataSourceType.data_source_types.get(name) if data_source is None: raise DataSourceConnectorUnavailableException(name) return data_source
29.928571
101
0.71957
98
838
5.928571
0.387755
0.154905
0.077453
0.099828
0
0
0
0
0
0
0
0
0.199284
838
27
102
31.037037
0.865872
0
0
0
0
0
0.034648
0
0
0
0
0
0
1
0.1
false
0
0.35
0
0.65
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
f6679ac68b5663fc7e4d59d821de4c9ad9b79ba1
1,003
py
Python
zerver/migrations/0264_migrate_is_announcement_only.py
DD2480-group7-2020/zulip
9a1e18bcf383c38c35da168563a7345768c6d784
[ "Apache-2.0" ]
1
2020-03-17T14:58:50.000Z
2020-03-17T14:58:50.000Z
zerver/migrations/0264_migrate_is_announcement_only.py
DD2480-group7-2020/zulip
9a1e18bcf383c38c35da168563a7345768c6d784
[ "Apache-2.0" ]
null
null
null
zerver/migrations/0264_migrate_is_announcement_only.py
DD2480-group7-2020/zulip
9a1e18bcf383c38c35da168563a7345768c6d784
[ "Apache-2.0" ]
1
2020-07-16T06:00:10.000Z
2020-07-16T06:00:10.000Z
# -*- coding: utf-8 -*- # Generated by Django 1.11.26 on 2020-01-25 23:47 from __future__ import unicode_literals from django.db import migrations from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor from django.db.migrations.state import StateApps def upgrade_stream_post_policy(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None: STREAM_POST_POLICY_EVERYONE = 1 STREAM_POST_POLICY_ADMINS = 2 Stream = apps.get_model('zerver', 'Stream') Stream.objects.filter(is_announcement_only=False) \ .update(stream_post_policy=STREAM_POST_POLICY_EVERYONE) Stream.objects.filter(is_announcement_only=True) \ .update(stream_post_policy=STREAM_POST_POLICY_ADMINS) class Migration(migrations.Migration): dependencies = [ ('zerver', '0263_stream_stream_post_policy'), ] operations = [ migrations.RunPython(upgrade_stream_post_policy, reverse_code=migrations.RunPython.noop), ]
33.433333
93
0.742772
121
1,003
5.834711
0.495868
0.127479
0.203966
0.065156
0.212465
0.212465
0.107649
0
0
0
0
0.030012
0.169492
1,003
29
94
34.586207
0.817527
0.068794
0
0
1
0
0.051557
0.032223
0
0
0
0
0
1
0.05
false
0
0.2
0
0.4
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
9ca642f791acb69ed5e39467d0d69bc10b39f133
167
py
Python
tests/test9.py
Cavenfish/qmspy
4ac6191b22d606ce007b5fb7b75a3c0734b41a70
[ "MIT" ]
null
null
null
tests/test9.py
Cavenfish/qmspy
4ac6191b22d606ce007b5fb7b75a3c0734b41a70
[ "MIT" ]
null
null
null
tests/test9.py
Cavenfish/qmspy
4ac6191b22d606ce007b5fb7b75a3c0734b41a70
[ "MIT" ]
null
null
null
import qmspy as qp import pandas as pd import matplotlib.pyplot as plt data = pd.read_csv('./Data.csv') size = (10,8) fig, ax = qp.scatter(data, size) plt.show(fig)
16.7
32
0.706587
31
167
3.774194
0.612903
0
0
0
0
0
0
0
0
0
0
0.021277
0.155689
167
9
33
18.555556
0.808511
0
0
0
0
0
0.05988
0
0
0
0
0
0
1
0
false
0
0.428571
0
0.428571
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
9cae024b2d764e76648fef9863cc1057d73f7162
1,692
py
Python
data_feeder.py
chiuhans111/RSE
152639e51b76120f1006bb64eb3689a054e01b92
[ "MIT" ]
40
2020-04-24T01:03:12.000Z
2022-03-20T18:19:30.000Z
data_feeder.py
chiuhans111/RSE
152639e51b76120f1006bb64eb3689a054e01b92
[ "MIT" ]
4
2021-09-09T13:26:09.000Z
2022-03-31T18:37:05.000Z
data_feeder.py
chiuhans111/RSE
152639e51b76120f1006bb64eb3689a054e01b92
[ "MIT" ]
7
2020-11-25T14:26:09.000Z
2022-01-29T10:18:40.000Z
"""For feeding the data to the model""" import random import config as cnf import data_utils as data_gen class DataSupplier: def supply_training_data(self, length, batch_size) -> tuple: pass def supply_validation_data(self, length, batch_size) -> tuple: pass def supply_test_data(self, length, batch_size) -> tuple: pass class DefaultSupplier(DataSupplier): def supply_training_data(self, length, batch_size) -> tuple: return self.__gen_training_data(True) def supply_validation_data(self, length, batch_size) -> tuple: return self.__gen_training_data(False) @staticmethod def __gen_training_data(for_training): x = [] y = [] for index, seq_len in enumerate(cnf.bins): data, labels = data_gen.get_batch(seq_len, cnf.batch_size, for_training, cnf.task) x += [data] y += [labels] return x, y def supply_test_data(self, length, batch_size): data, labels = data_gen.get_batch(length, batch_size, False, cnf.task) return [data], [labels] def create_batch(generator, batch_size, length, for_training=False): qna = [] while len(qna) < batch_size: question, answer = next(generator) if max(len(question), len(answer)) > length: continue question_and_answer = data_gen.add_padding(question, answer, length) qna.append(question_and_answer) random.shuffle(qna) questions, answers = tuple(zip(*qna)) return [questions], [answers] def create_data_supplier() -> DataSupplier: return DefaultSupplier()
27.290323
95
0.638889
207
1,692
4.961353
0.294686
0.087634
0.10224
0.111003
0.386563
0.386563
0.337877
0.329114
0.26777
0.186952
0
0
0.265366
1,692
61
96
27.737705
0.826227
0.019504
0
0.175
0
0
0
0
0
0
0
0
0
1
0.225
false
0.075
0.075
0.075
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
2
9cb0c07291f31ff2f506adb97adda5c943f632c8
101,502
py
Python
pysnmp-with-texts/NTWS-AP-CONFIG-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
8
2019-05-09T17:04:00.000Z
2021-06-09T06:50:51.000Z
pysnmp-with-texts/NTWS-AP-CONFIG-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
4
2019-05-31T16:42:59.000Z
2020-01-31T21:57:17.000Z
pysnmp-with-texts/NTWS-AP-CONFIG-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
10
2019-04-30T05:51:36.000Z
2022-02-16T03:33:41.000Z
# # PySNMP MIB module NTWS-AP-CONFIG-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NTWS-AP-CONFIG-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:25:33 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint") NtwsChannelNum, NtwsApFingerprint, NtwsApSerialNum, NtwsApRadioIndex, NtwsApPowerMode, NtwsApLedMode, NtwsPowerLevel, NtwsRadioMode, NtwsRadioAntennaLocation, NtwsRadioType, NtwsRadioChannelWidth, NtwsApBias, NtwsApNum, NtwsApAttachType = mibBuilder.importSymbols("NTWS-AP-TC", "NtwsChannelNum", "NtwsApFingerprint", "NtwsApSerialNum", "NtwsApRadioIndex", "NtwsApPowerMode", "NtwsApLedMode", "NtwsPowerLevel", "NtwsRadioMode", "NtwsRadioAntennaLocation", "NtwsRadioType", "NtwsRadioChannelWidth", "NtwsApBias", "NtwsApNum", "NtwsApAttachType") NtwsPhysPortNumberOrZero, = mibBuilder.importSymbols("NTWS-BASIC-TC", "NtwsPhysPortNumberOrZero") ntwsMibs, = mibBuilder.importSymbols("NTWS-ROOT-MIB", "ntwsMibs") NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance") MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, Counter64, ObjectIdentity, Gauge32, Unsigned32, NotificationType, Counter32, Integer32, MibIdentifier, TimeTicks, Bits, ModuleIdentity, iso = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "Counter64", "ObjectIdentity", "Gauge32", "Unsigned32", "NotificationType", "Counter32", "Integer32", "MibIdentifier", "TimeTicks", "Bits", "ModuleIdentity", "iso") RowStatus, TruthValue, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "TruthValue", "DisplayString", "TextualConvention") ntwsApConfigMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14)) ntwsApConfigMib.setRevisions(('2009-11-19 01:08',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ntwsApConfigMib.setRevisionsDescriptions(('v1.0.8: Initial version',)) if mibBuilder.loadTexts: ntwsApConfigMib.setLastUpdated('200911190108Z') if mibBuilder.loadTexts: ntwsApConfigMib.setOrganization('Nortel Networks') if mibBuilder.loadTexts: ntwsApConfigMib.setContactInfo('www.nortelnetworks.com') if mibBuilder.loadTexts: ntwsApConfigMib.setDescription("AP Configuration objects for Nortel Networks wireless switches. AP = Access Point; AC = Access Controller (wireless switch), the device that runs a SNMP Agent implementing this MIB. Copyright 2009 Nortel Networks. All rights reserved. This Nortel Networks SNMP Management Information Base Specification (Specification) embodies Nortel Networks' confidential and proprietary intellectual property. This Specification is supplied 'AS IS' and Nortel Networks makes no warranty, either express or implied, as to the use, operation, condition, or performance of the Specification.") class NtwsApTemplateName(TextualConvention, OctetString): description = 'AP Template Name, consists of printable ASCII characters between 0x21 (!), and 0x7d (}) with no leading, embedded, or trailing space. Cannot be a zero length string.' status = 'current' displayHint = '255a' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(1, 32) class NtwsRadioProfileName(TextualConvention, OctetString): description = 'Radio Profile Name, consists of printable ASCII characters between 0x21 (!), and 0x7d (}) with no leading, embedded, or trailing space. Cannot be a zero length string.' status = 'current' displayHint = '255a' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(1, 16) class NtwsServiceProfileName(TextualConvention, OctetString): description = 'Service Profile Name, consists of printable ASCII characters between 0x21 (!), and 0x7d (}) with no leading, embedded, or trailing space. Cannot be a zero length string.' status = 'current' displayHint = '255a' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(1, 32) class NtwsSnoopFilterName(TextualConvention, OctetString): description = 'Snoop Filter Name, consists of printable ASCII characters between 0x21 (!), and 0x7d (}) with no leading, embedded, or trailing space. Cannot be a zero length string.' status = 'current' displayHint = '255a' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(1, 15) class NtwsServiceProfileSsidType(TextualConvention, Integer32): description = 'Enumeration of Service Types provided on a service profile.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("clear", 1), ("crypto", 2)) class NtwsServiceProfile11nMode(TextualConvention, Integer32): description = 'Enumeration of 802.11n modes for a service profile.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("enable", 1), ("disable", 2), ("required", 3)) class NtwsServiceProfile11nFrameAggregationType(TextualConvention, Integer32): description = 'Enumeration of 802.11n frame aggregation types for a service profile.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4)) namedValues = NamedValues(("msdu", 1), ("mpdu", 2), ("all", 3), ("disable", 4)) class NtwsServiceProfile11nMsduMaxLength(TextualConvention, Integer32): description = 'Enumeration of 802.11n A-MSDU maximum lengths for a service profile.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("msdu-4k", 1), ("msdu-8k", 2)) class NtwsServiceProfile11nMpduMaxLength(TextualConvention, Integer32): description = 'Enumeration of 802.11n A-MPDU maximum lengths for a service profile.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4)) namedValues = NamedValues(("mpdu-8k", 1), ("mpdu-16k", 2), ("mpdu-32k", 3), ("mpdu-64k", 4)) class NtwsServiceProfileAuthFallthruType(TextualConvention, Integer32): description = 'Enumeration of Authentication Fallthrough types for a service profile.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4)) namedValues = NamedValues(("none", 1), ("web-auth", 2), ("web-aaa-portal", 3), ("last-resort", 4)) class NtwsServiceProfileCacMode(TextualConvention, Integer32): description = 'Enumeration of Call Admission Control types for a service profile.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("none", 1), ("session", 2), ("vendor", 3)) class NtwsRadioProfileCountermeasuresMode(TextualConvention, Integer32): description = 'Enumeration of the Countermeasure modes for a radio profile.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4)) namedValues = NamedValues(("none", 1), ("all", 2), ("rogue", 3), ("configured", 4)) class NtwsRadioProfileRFScanChannelScope(TextualConvention, Integer32): description = 'Enumeration of RF scanning channel scopes for a radio profile.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("operating", 1), ("regulatory", 2), ("all", 3)) class NtwsRadioProfileAutoTuneChannelRange(TextualConvention, Integer32): description = 'Enumeration of Auto-Tune channel ranges for a radio profile.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("all-bands", 1), ("lower-bands", 2)) class NtwsRadioProfileRFScanMode(TextualConvention, Integer32): description = 'Enumeration of RF scanning modes for a radio profile.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("active", 1), ("passive", 2)) ntwsApConfigMibObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1)) ntwsApConfApConfigTable = MibTable((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2), ) if mibBuilder.loadTexts: ntwsApConfApConfigTable.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigTable.setDescription('A table describing all the APs currently configured on this AC.') ntwsApConfApConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1), ).setIndexNames((0, "NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigApNum")) if mibBuilder.loadTexts: ntwsApConfApConfigEntry.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigEntry.setDescription('Configuration for a particular AP that could be attached to the AC.') ntwsApConfApConfigApNum = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1, 1), NtwsApNum()) if mibBuilder.loadTexts: ntwsApConfApConfigApNum.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigApNum.setDescription('The Number of this AP (administratively assigned).') ntwsApConfApConfigApAttachType = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1, 2), NtwsApAttachType()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApConfigApAttachType.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigApAttachType.setDescription('How this AP is attached to the AC (directly or via L2/L3 network).') ntwsApConfApConfigPhysPortNum = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1, 3), NtwsPhysPortNumberOrZero()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApConfigPhysPortNum.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigPhysPortNum.setDescription('Identifies the physical port used to attach this AP. Only valid for directly attached APs, otherwise will be zero.') ntwsApConfApConfigApSerialNum = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1, 4), NtwsApSerialNum()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApConfigApSerialNum.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigApSerialNum.setDescription('The Serial Number used to identify this AP. Only valid for network attached APs, otherwise will be a zero length string.') ntwsApConfApConfigApModelName = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 24))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApConfigApModelName.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigApModelName.setDescription('The Model name of this AP.') ntwsApConfApConfigFingerprint = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1, 6), NtwsApFingerprint()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApConfigFingerprint.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigFingerprint.setDescription('The RSA key fingerprint configured on this AP (binary value: it is the MD5 hash of the public key of the RSA key pair). For directly attached APs the fingerprint is a zero length string.') ntwsApConfApConfigBias = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1, 7), NtwsApBias()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApConfigBias.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigBias.setDescription('Bias (high/low/sticky).') ntwsApConfApConfigApTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1, 8), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApConfigApTimeout.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigApTimeout.setDescription('The communication timeout for this AP, in seconds.') ntwsApConfApConfigApName = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApConfigApName.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigApName.setDescription('The configured Name for this AP.') ntwsApConfApConfigContact = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApConfigContact.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigContact.setDescription('The Contact information for this AP.') ntwsApConfApConfigLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1, 11), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApConfigLocation.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigLocation.setDescription('The Location information for this AP.') ntwsApConfApConfigBlinkEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1, 12), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApConfigBlinkEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigBlinkEnabled.setDescription('Indicates whether the LED blink mode is enabled on this AP.') ntwsApConfApConfigForceImageDownloadEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1, 13), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApConfigForceImageDownloadEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigForceImageDownloadEnabled.setDescription('Indicates whether this AP is forced to always download an image from the AC upon boot.') ntwsApConfApConfigFirmwareUpgradeEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1, 14), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApConfigFirmwareUpgradeEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigFirmwareUpgradeEnabled.setDescription('Indicates whether automatic boot firmware upgrade is enabled on this AP.') ntwsApConfApConfigLocalSwitchingEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1, 15), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApConfigLocalSwitchingEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigLocalSwitchingEnabled.setDescription('Indicates whether local switching is enabled on this AP.') ntwsApConfApConfigPowerMode = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1, 16), NtwsApPowerMode()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApConfigPowerMode.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigPowerMode.setDescription('The mode in which this AP is supplying power to its radios.') ntwsApConfApConfigLedMode = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1, 17), NtwsApLedMode()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApConfigLedMode.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigLedMode.setDescription('LED Mode (auto/static/off).') ntwsApConfApConfigDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 2, 1, 18), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 256))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApConfigDescription.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigDescription.setDescription('The configured Description for this AP.') ntwsApConfRadioConfigTable = MibTable((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 3), ) if mibBuilder.loadTexts: ntwsApConfRadioConfigTable.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioConfigTable.setDescription('A table describing the radios on all the APs currently configured on this AC.') ntwsApConfRadioConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 3, 1), ).setIndexNames((0, "NTWS-AP-CONFIG-MIB", "ntwsApConfRadioConfigApNum"), (0, "NTWS-AP-CONFIG-MIB", "ntwsApConfRadioConfigRadioIndex")) if mibBuilder.loadTexts: ntwsApConfRadioConfigEntry.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioConfigEntry.setDescription('Configuration for a particular Radio on a particular AP that could be attached to the AC.') ntwsApConfRadioConfigApNum = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 3, 1, 1), NtwsApNum()) if mibBuilder.loadTexts: ntwsApConfRadioConfigApNum.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioConfigApNum.setDescription('The Number of the AP (administratively assigned).') ntwsApConfRadioConfigRadioIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 3, 1, 2), NtwsApRadioIndex()) if mibBuilder.loadTexts: ntwsApConfRadioConfigRadioIndex.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioConfigRadioIndex.setDescription('The number of this Radio on the AP.') ntwsApConfRadioConfigRadioType = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 3, 1, 3), NtwsRadioType()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioConfigRadioType.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioConfigRadioType.setDescription('The configured Type of this radio (typeA, typeB, typeG, typeNA, typeNG)') ntwsApConfRadioConfigRadioMode = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 3, 1, 4), NtwsRadioMode()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioConfigRadioMode.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioConfigRadioMode.setDescription('The configured Mode of this radio (enabled/disabled/sentry)') ntwsApConfRadioConfigRadioProfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 3, 1, 5), NtwsRadioProfileName()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioConfigRadioProfileName.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioConfigRadioProfileName.setDescription('Identifies the Radio Profile to be applied to this radio') ntwsApConfRadioConfigChannel = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 3, 1, 6), NtwsChannelNum()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioConfigChannel.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioConfigChannel.setDescription('The configured Channel Number of this radio.') ntwsApConfRadioConfigTxPower = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 3, 1, 7), NtwsPowerLevel()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioConfigTxPower.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioConfigTxPower.setDescription('The configured Tx Power level of this radio.') ntwsApConfRadioConfigAutoTuneMaxTxPower = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 3, 1, 8), NtwsPowerLevel()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioConfigAutoTuneMaxTxPower.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioConfigAutoTuneMaxTxPower.setDescription('The Maximum Tx Power that Auto Tune is allowed to set for this radio.') ntwsApConfRadioConfigAntennaType = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 3, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioConfigAntennaType.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioConfigAntennaType.setDescription('The configured Antenna Type for this radio.') ntwsApConfRadioConfigAntennaLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 3, 1, 10), NtwsRadioAntennaLocation()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioConfigAntennaLocation.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioConfigAntennaLocation.setDescription('The configured Antenna Location for this radio.') ntwsApConfRadioConfigLoadBalancingEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 3, 1, 11), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioConfigLoadBalancingEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioConfigLoadBalancingEnabled.setDescription('Indicates whether RF Load Balancing is enabled on this radio.') ntwsApConfRadioConfigLoadBalancingGroup = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 3, 1, 12), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioConfigLoadBalancingGroup.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioConfigLoadBalancingGroup.setDescription('Indicates the RF Load Balancing group that this radio is assigned to.') ntwsApConfRadioConfigLoadRebalancingEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 3, 1, 13), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioConfigLoadRebalancingEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioConfigLoadRebalancingEnabled.setDescription('Indicates whether RF Load Rebalancing is enabled for this radio.') ntwsApConfApTemplateConfigTable = MibTable((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 4), ) if mibBuilder.loadTexts: ntwsApConfApTemplateConfigTable.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemplateConfigTable.setDescription('A table describing all the AP Templates currently configured on this AC.') ntwsApConfApTemplateConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 4, 1), ).setIndexNames((0, "NTWS-AP-CONFIG-MIB", "ntwsApConfApTemplConfApTemplateName")) if mibBuilder.loadTexts: ntwsApConfApTemplateConfigEntry.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemplateConfigEntry.setDescription('Template configuration for APs that could be attached to the AC.') ntwsApConfApTemplConfApTemplateName = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 4, 1, 1), NtwsApTemplateName()) if mibBuilder.loadTexts: ntwsApConfApTemplConfApTemplateName.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemplConfApTemplateName.setDescription('AP Template Name.') ntwsApConfApTemplConfApTemplateEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 4, 1, 2), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApTemplConfApTemplateEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemplConfApTemplateEnabled.setDescription('Indicates whether this AP Template is Enabled (can be used for bringing up APs).') ntwsApConfApTemplConfBias = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 4, 1, 3), NtwsApBias()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApTemplConfBias.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemplConfBias.setDescription('Bias (high/low/sticky).') ntwsApConfApTemplConfApTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 4, 1, 4), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApTemplConfApTimeout.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemplConfApTimeout.setDescription('The communication timeout for this AP Template, in seconds.') ntwsApConfApTemplConfBlinkEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 4, 1, 5), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApTemplConfBlinkEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemplConfBlinkEnabled.setDescription('Indicates whether the LED blink mode is enabled on this AP Template.') ntwsApConfApTemplConfForceImageDownloadEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 4, 1, 6), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApTemplConfForceImageDownloadEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemplConfForceImageDownloadEnabled.setDescription('Indicates whether this AP is forced to always download an image from the AC upon boot.') ntwsApConfApTemplConfFirmwareUpgradeEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 4, 1, 7), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApTemplConfFirmwareUpgradeEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemplConfFirmwareUpgradeEnabled.setDescription('Indicates whether automatic boot firmware upgrade is enabled on this AP Template.') ntwsApConfApTemplConfLocalSwitchingEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 4, 1, 8), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApTemplConfLocalSwitchingEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemplConfLocalSwitchingEnabled.setDescription('Indicates whether local switching is enabled on this AP Template.') ntwsApConfApTemplConfPowerMode = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 4, 1, 9), NtwsApPowerMode()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApTemplConfPowerMode.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemplConfPowerMode.setDescription('The mode in which an AP using this Template will be supplying power to its radios.') ntwsApConfApTemplConfLedMode = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 4, 1, 10), NtwsApLedMode()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApTemplConfLedMode.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemplConfLedMode.setDescription('The LED Mode (auto/static/off) for an AP using this Template.') ntwsApConfApTemplateRadioConfigTable = MibTable((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 5), ) if mibBuilder.loadTexts: ntwsApConfApTemplateRadioConfigTable.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemplateRadioConfigTable.setDescription('A table describing the radios for all the AP Templates currently configured on this AC.') ntwsApConfApTemplateRadioConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 5, 1), ).setIndexNames((0, "NTWS-AP-CONFIG-MIB", "ntwsApConfApTemRadioConfApTemplateName"), (0, "NTWS-AP-CONFIG-MIB", "ntwsApConfApTemRadioConfRadioIndex")) if mibBuilder.loadTexts: ntwsApConfApTemplateRadioConfigEntry.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemplateRadioConfigEntry.setDescription('Template configuration for a particular Radio index on an AP Template configured on this AC.') ntwsApConfApTemRadioConfApTemplateName = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 5, 1, 1), NtwsApTemplateName()) if mibBuilder.loadTexts: ntwsApConfApTemRadioConfApTemplateName.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemRadioConfApTemplateName.setDescription('AP Template Name.') ntwsApConfApTemRadioConfRadioIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 5, 1, 2), NtwsApRadioIndex()) if mibBuilder.loadTexts: ntwsApConfApTemRadioConfRadioIndex.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemRadioConfRadioIndex.setDescription('The number of this Radio on the AP Template.') ntwsApConfApTemRadioConfRadioMode = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 5, 1, 3), NtwsRadioMode()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApTemRadioConfRadioMode.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemRadioConfRadioMode.setDescription('The configured mode of a radio using this Template (enabled/disabled/sentry)') ntwsApConfApTemRadioConfRadioProfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 5, 1, 4), NtwsRadioProfileName()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApTemRadioConfRadioProfileName.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemRadioConfRadioProfileName.setDescription('Identifies the Radio Profile to be applied to a radio using this Template') ntwsApConfApTemRadioConfAutoTuneMaxTxPower = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 5, 1, 5), NtwsPowerLevel()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApTemRadioConfAutoTuneMaxTxPower.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemRadioConfAutoTuneMaxTxPower.setDescription('The Maximum Tx Power that Auto Tune will be allowed to set for a radio using this Template.') ntwsApConfApTemRadioConfLoadBalancingEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 5, 1, 6), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApTemRadioConfLoadBalancingEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemRadioConfLoadBalancingEnabled.setDescription('Indicates whether RF Load Balancing will be enabled on a radio using this Template.') ntwsApConfApTemRadioConfLoadBalancingGroup = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 5, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApTemRadioConfLoadBalancingGroup.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemRadioConfLoadBalancingGroup.setDescription('Indicates the RF Load Balancing group that a radio using this Template will be assigned to.') ntwsApConfApTemRadioConfLoadRebalancingEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 5, 1, 8), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfApTemRadioConfLoadRebalancingEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemRadioConfLoadRebalancingEnabled.setDescription('Indicates whether RF Load Rebalancing will be enabled for a radio using this Template.') ntwsApConfRadioProfileTable = MibTable((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6), ) if mibBuilder.loadTexts: ntwsApConfRadioProfileTable.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfileTable.setDescription('A table describing the Radio Profiles currently configured on this AC.') ntwsApConfRadioProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1), ).setIndexNames((0, "NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfRadioProfileName")) if mibBuilder.loadTexts: ntwsApConfRadioProfileEntry.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfileEntry.setDescription('Configuration for a particular Radio Profile.') ntwsApConfRadioProfRadioProfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 1), NtwsRadioProfileName()) if mibBuilder.loadTexts: ntwsApConfRadioProfRadioProfileName.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfRadioProfileName.setDescription('Name of this radio profile.') ntwsApConfRadioProfBeaconInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 2), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfBeaconInterval.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfBeaconInterval.setDescription('Beacon Interval, time in thousandths of a second, for this radio profile.') ntwsApConfRadioProfDtimInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 3), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfDtimInterval.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfDtimInterval.setDescription('The number of times after every beacon that each AP radio in a radio profile sends a delivery traffic indication map (DTIM), for the AP radios using this radio profile.') ntwsApConfRadioProfChannelWidth11na = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 4), NtwsRadioChannelWidth()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfChannelWidth11na.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfChannelWidth11na.setDescription('802.11n Channel Width for the AP radios using this radio profile.') ntwsApConfRadioProfMaxTxLifetime = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 5), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfMaxTxLifetime.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfMaxTxLifetime.setDescription('The maximum transmit threshold for the AP radios using this radio profile.') ntwsApConfRadioProfMaxRxLifetime = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 6), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfMaxRxLifetime.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfMaxRxLifetime.setDescription('The maximum receive threshold for the AP radios using this radio profile.') ntwsApConfRadioProfRtsThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 7), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfRtsThreshold.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfRtsThreshold.setDescription('The RTS threshold for the AP radios using this radio profile.') ntwsApConfRadioProfFragThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 8), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfFragThreshold.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfFragThreshold.setDescription('The fragmentation threshold for the AP radios using this radio profile.') ntwsApConfRadioProfLongXmitPreambleEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 9), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfLongXmitPreambleEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfLongXmitPreambleEnabled.setDescription('Indicates whether an 802.11b/g AP radio using this radio profile transmits Long Preamble.') ntwsApConfRadioProfCountermeasuresMode = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 10), NtwsRadioProfileCountermeasuresMode()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfCountermeasuresMode.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfCountermeasuresMode.setDescription('Countermeasures Mode for the AP radios using this radio profile.') ntwsApConfRadioProfRFScanMode = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 11), NtwsRadioProfileRFScanMode()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfRFScanMode.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfRFScanMode.setDescription('RF Scanning Mode for the AP radios using this radio profile.') ntwsApConfRadioProfRFScanChannelScope = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 12), NtwsRadioProfileRFScanChannelScope()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfRFScanChannelScope.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfRFScanChannelScope.setDescription('RF scanning Channel Scope for the AP radios using this radio profile.') ntwsApConfRadioProfRFScanCTSEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 13), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfRFScanCTSEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfRFScanCTSEnabled.setDescription('Indicates whether the AP radios using this radio profile send CTS To Self packet before going off channel.') ntwsApConfRadioProfAutoTune11aChannelRange = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 14), NtwsRadioProfileAutoTuneChannelRange()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfAutoTune11aChannelRange.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfAutoTune11aChannelRange.setDescription('The allowable 802.11a Channel Range used by Auto-Tune for the AP radios using this radio profile.') ntwsApConfRadioProfAutoTuneIgnoreClientsEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 15), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfAutoTuneIgnoreClientsEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfAutoTuneIgnoreClientsEnabled.setDescription('Indicates whether the AP radios using this radio profile Ignore Client connections in Auto-Tune channel selections.') ntwsApConfRadioProfAutoTuneChannelEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 16), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfAutoTuneChannelEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfAutoTuneChannelEnabled.setDescription('Indicates whether Channel Auto-Tuning is enabled for the AP radios using this radio profile.') ntwsApConfRadioProfAutoTuneChannelHolddownInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 17), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfAutoTuneChannelHolddownInterval.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfAutoTuneChannelHolddownInterval.setDescription('Minimum Interval (in seconds) between Channel changes due to Auto-Tuning, for the AP radios using this radio profile.') ntwsApConfRadioProfAutoTuneChannelChangeInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 18), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfAutoTuneChannelChangeInterval.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfAutoTuneChannelChangeInterval.setDescription('The interval (in seconds) at which RF Auto-Tuning decides whether to Change the Channel for the AP radios using this radio profile.') ntwsApConfRadioProfAutoTunePowerEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 19), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfAutoTunePowerEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfAutoTunePowerEnabled.setDescription('Indicates whether Power Auto-Tuning is enabled for the AP radios using this radio profile.') ntwsApConfRadioProfAutoTunePowerRampInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 20), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfAutoTunePowerRampInterval.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfAutoTunePowerRampInterval.setDescription('Minimum Interval (in seconds) between Power changes due to Auto-Tuning, for the AP radios using this radio profile.') ntwsApConfRadioProfAutoTunePowerChangeInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 21), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfAutoTunePowerChangeInterval.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfAutoTunePowerChangeInterval.setDescription('The interval (in seconds) at which RF Auto-Tuning decides whether to Change the Power for the AP radios using this radio profile.') ntwsApConfRadioProfFairQueuingEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 22), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfFairQueuingEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfFairQueuingEnabled.setDescription('Indicates whether weighted Fair Queuing is enabled for this radio profile.') ntwsApConfRadioProfCacBackgroundACMandatory = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 23), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfCacBackgroundACMandatory.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfCacBackgroundACMandatory.setDescription('Indicates whether Admission Control for Background traffic is Mandatory for the AP radios using this radio profile.') ntwsApConfRadioProfCacBackgroundMaxUtilization = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 24), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfCacBackgroundMaxUtilization.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfCacBackgroundMaxUtilization.setDescription('Maximum admission control limit for Background traffic, for the AP radios using this radio profile.') ntwsApConfRadioProfCacBackgroundPolicingEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 25), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfCacBackgroundPolicingEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfCacBackgroundPolicingEnabled.setDescription('Indicates that admission control Policing for Background traffic is enabled, for the AP radios using this radio profile.') ntwsApConfRadioProfCacBestEffortACMandatory = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 26), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfCacBestEffortACMandatory.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfCacBestEffortACMandatory.setDescription('Indicates that Admission Control for Best Effort traffic is Mandatory for the AP radios using this radio profile.') ntwsApConfRadioProfCacBestEffortMaxUtilization = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 27), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfCacBestEffortMaxUtilization.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfCacBestEffortMaxUtilization.setDescription('Maximum admission control limit for Best Effort traffic, for the AP radios using this radio profile.') ntwsApConfRadioProfCacBestEffortPolicingEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 28), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfCacBestEffortPolicingEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfCacBestEffortPolicingEnabled.setDescription('Indicates that admission control Policing for Best Effort traffic is enabled, for the AP radios using this radio profile.') ntwsApConfRadioProfCacVideoACMandatory = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 29), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfCacVideoACMandatory.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfCacVideoACMandatory.setDescription('Indicates that Admission Control for Video traffic is Mandatory for the AP radios using this radio profile.') ntwsApConfRadioProfCacVideoMaxUtilization = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 30), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfCacVideoMaxUtilization.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfCacVideoMaxUtilization.setDescription('Maximum admission control limit for Video traffic, for the AP radios using this radio profile.') ntwsApConfRadioProfCacVideoPolicingEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 31), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfCacVideoPolicingEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfCacVideoPolicingEnabled.setDescription('Indicates that admission control Policing for Video traffic is enabled, for the AP radios using this radio profile.') ntwsApConfRadioProfCacVoiceACMandatory = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 32), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfCacVoiceACMandatory.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfCacVoiceACMandatory.setDescription('Indicates that Admission Control for Voice traffic is Mandatory for the AP radios using this radio profile.') ntwsApConfRadioProfCacVoiceMaxUtilization = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 33), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfCacVoiceMaxUtilization.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfCacVoiceMaxUtilization.setDescription('Maximum admission control limit for Voice traffic, for the AP radios using this radio profile.') ntwsApConfRadioProfCacVoicePolicingEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 34), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfCacVoicePolicingEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfCacVoicePolicingEnabled.setDescription('Indicates that admission control Policing for Voice traffic is enabled, for the AP radios using this radio profile.') ntwsApConfRadioProfRfidTagEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 35), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfRfidTagEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfRfidTagEnabled.setDescription('Indicates whether an AP radio using this radio profile is enabled to function as location receivers in an AeroScout Visibility System.') ntwsApConfRadioProfWmmPowerSaveEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 36), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfWmmPowerSaveEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfWmmPowerSaveEnabled.setDescription('Indicates whether the AP radios using this radio profile enable power save mode on WMM clients.') ntwsApConfRadioProfRateEnforcementEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 37), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfRateEnforcementEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfRateEnforcementEnabled.setDescription('Indicates whether data rates are enforced for the AP radios using this radio profile, which means that a connecting client must transmit at one of the mandatory or standard rates in order to associate with the AP.') ntwsApConfRadioProfDfsChannelsEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 6, 1, 38), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfRadioProfDfsChannelsEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfDfsChannelsEnabled.setDescription('Indicates that the AP radios using this radio profile use DFS channels to meet regulatory requirements.') ntwsApConfRadioProfServiceProfileTable = MibTable((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 7), ) if mibBuilder.loadTexts: ntwsApConfRadioProfServiceProfileTable.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfServiceProfileTable.setDescription('A table describing the currently configured connections between Radio Profiles and Service Profiles.') ntwsApConfRadioProfServiceProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 7, 1), ).setIndexNames((0, "NTWS-AP-CONFIG-MIB", "ntwsApConfRpServpRadioProfileName"), (0, "NTWS-AP-CONFIG-MIB", "ntwsApConfRpServpServiceProfileName")) if mibBuilder.loadTexts: ntwsApConfRadioProfServiceProfileEntry.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfServiceProfileEntry.setDescription('Connection between a Radio Profile and a Service Profile, currently configured on the AC.') ntwsApConfRpServpRadioProfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 7, 1, 1), NtwsRadioProfileName()) if mibBuilder.loadTexts: ntwsApConfRpServpRadioProfileName.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRpServpRadioProfileName.setDescription('Name of this Radio Profile.') ntwsApConfRpServpServiceProfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 7, 1, 2), NtwsServiceProfileName()) if mibBuilder.loadTexts: ntwsApConfRpServpServiceProfileName.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRpServpServiceProfileName.setDescription('Name of a Service Profile connected to this Radio Profile.') ntwsApConfRpServpRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 7, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: ntwsApConfRpServpRowStatus.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRpServpRowStatus.setDescription("This object is used to create a new row or delete an existing row in this table. To create a row, set this object to 'createAndGo'. To delete a row, set this object to 'destroy'. Only these two values 'createAndGo' and 'destroy' will be accepted.") ntwsApConfRadioProfSnoopFilterTable = MibTable((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 8), ) if mibBuilder.loadTexts: ntwsApConfRadioProfSnoopFilterTable.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfSnoopFilterTable.setDescription('A table describing the currently configured connections between Radio Profiles and Snoop Filters.') ntwsApConfRadioProfSnoopFilterEntry = MibTableRow((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 8, 1), ).setIndexNames((0, "NTWS-AP-CONFIG-MIB", "ntwsApConfRpSnoopfRadioProfileName"), (0, "NTWS-AP-CONFIG-MIB", "ntwsApConfRpSnoopfSnoopFilterName")) if mibBuilder.loadTexts: ntwsApConfRadioProfSnoopFilterEntry.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfSnoopFilterEntry.setDescription('Connection between a Radio Profile and a Snoop Filter, currently configured on the AC.') ntwsApConfRpSnoopfRadioProfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 8, 1, 1), NtwsRadioProfileName()) if mibBuilder.loadTexts: ntwsApConfRpSnoopfRadioProfileName.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRpSnoopfRadioProfileName.setDescription('Name of this Radio Profile.') ntwsApConfRpSnoopfSnoopFilterName = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 8, 1, 2), NtwsSnoopFilterName()) if mibBuilder.loadTexts: ntwsApConfRpSnoopfSnoopFilterName.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRpSnoopfSnoopFilterName.setDescription('Name of a Snoop Filter connected to this Radio Profile.') ntwsApConfRpSnoopfRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 8, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: ntwsApConfRpSnoopfRowStatus.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRpSnoopfRowStatus.setDescription("This object is used to create a new row or delete an existing row in this table. To create a row, set this object to 'createAndGo'. To delete a row, set this object to 'destroy'. Only these two values 'createAndGo' and 'destroy' will be accepted.") ntwsApConfServiceProfileTable = MibTable((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9), ) if mibBuilder.loadTexts: ntwsApConfServiceProfileTable.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServiceProfileTable.setDescription('A table describing the Service Profiles currently configured on this AC.') ntwsApConfServiceProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1), ).setIndexNames((0, "NTWS-AP-CONFIG-MIB", "ntwsApConfServProfServiceProfileName")) if mibBuilder.loadTexts: ntwsApConfServiceProfileEntry.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServiceProfileEntry.setDescription('Configuration for a particular Service Profile.') ntwsApConfServProfServiceProfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 1), NtwsServiceProfileName()) if mibBuilder.loadTexts: ntwsApConfServProfServiceProfileName.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfServiceProfileName.setDescription('Name of this service profile') ntwsApConfServProfSsidType = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 2), NtwsServiceProfileSsidType()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfSsidType.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfSsidType.setDescription('The type of this service profile (clear/crypto).') ntwsApConfServProfBeaconEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 3), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfBeaconEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfBeaconEnabled.setDescription('Indicates whether beacons are enabled for this service profile.') ntwsApConfServProf11naMode = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 4), NtwsServiceProfile11nMode()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProf11naMode.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProf11naMode.setDescription('Indicates the 802.11n (na) mode for this service profile.') ntwsApConfServProf11ngMode = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 5), NtwsServiceProfile11nMode()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProf11ngMode.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProf11ngMode.setDescription('Indicates the 802.11n (ng) mode for this service profile.') ntwsApConfServProf11nShortGuardIntervalEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 6), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProf11nShortGuardIntervalEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProf11nShortGuardIntervalEnabled.setDescription('Indicates whether short guard interval is enabled for this service profile.') ntwsApConfServProf11nFrameAggregation = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 7), NtwsServiceProfile11nFrameAggregationType()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProf11nFrameAggregation.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProf11nFrameAggregation.setDescription('Indicates the Frame Aggregation mode for this service profile.') ntwsApConfServProf11nMsduMaxLength = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 8), NtwsServiceProfile11nMsduMaxLength()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProf11nMsduMaxLength.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProf11nMsduMaxLength.setDescription('The maximum MSDU length for this service profile.') ntwsApConfServProf11nMpduMaxLength = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 9), NtwsServiceProfile11nMpduMaxLength()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProf11nMpduMaxLength.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProf11nMpduMaxLength.setDescription('The maximum MPDU length for this service profile.') ntwsApConfServProfAuthFallthru = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 10), NtwsServiceProfileAuthFallthruType()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfAuthFallthru.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfAuthFallthru.setDescription('The authentication type to be attempted for users who do not match a 802.1X or MAC authentication rule, for this service profile.') ntwsApConfServProfWebAAAForm = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 11), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfWebAAAForm.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfWebAAAForm.setDescription('The custom login page that loads for WebAAA users, for this service profile.') ntwsApConfServProfSharedKeyAuthEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 12), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfSharedKeyAuthEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfSharedKeyAuthEnabled.setDescription('Indicates whether shared-key authentication is enabled for this service profile.') ntwsApConfServProfWpaIeEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 13), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfWpaIeEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfWpaIeEnabled.setDescription('Indicates whether WPA IE beaconing is enabled for this service profile.') ntwsApConfServProfWpaIeCipherTkipEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 14), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfWpaIeCipherTkipEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfWpaIeCipherTkipEnabled.setDescription('Indicates whether TKIP cipher is advertised in WPA IE, for this service profile.') ntwsApConfServProfWpaIeCipherCcmpEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 15), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfWpaIeCipherCcmpEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfWpaIeCipherCcmpEnabled.setDescription('Indicates whether CCMP cipher is advertised in WPA IE, for this service profile.') ntwsApConfServProfWpaIeCipherWep40Enabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 16), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfWpaIeCipherWep40Enabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfWpaIeCipherWep40Enabled.setDescription('Indicates whether WEP-40 cipher is advertised in WPA IE, for this service profile.') ntwsApConfServProfWpaIeCipherWep104Enabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 17), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfWpaIeCipherWep104Enabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfWpaIeCipherWep104Enabled.setDescription('Indicates whether WEP-104 cipher is advertised in WPA IE, for this service profile.') ntwsApConfServProfWpaIeAuthDot1xEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 18), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfWpaIeAuthDot1xEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfWpaIeAuthDot1xEnabled.setDescription('Indicates whether 802.1X authentication is advertised in WPA IE, for this service profile.') ntwsApConfServProfWpaIeAuthPskEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 19), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfWpaIeAuthPskEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfWpaIeAuthPskEnabled.setDescription('Indicates whether Pre-Shared Key authentication is advertised in WPA IE, for this service profile.') ntwsApConfServProfRsnIeEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 20), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfRsnIeEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfRsnIeEnabled.setDescription('Indicates whether RSN IE beaconing is enabled for this service profile.') ntwsApConfServProfRsnIeCipherTkipEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 21), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfRsnIeCipherTkipEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfRsnIeCipherTkipEnabled.setDescription('Indicates whether TKIP cipher is advertised in RSN IE, for this service profile.') ntwsApConfServProfRsnIeCipherCcmpEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 22), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfRsnIeCipherCcmpEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfRsnIeCipherCcmpEnabled.setDescription('Indicates whether CCMP cipher is advertised in RSN IE, for this service profile.') ntwsApConfServProfRsnIeCipherWep40Enabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 23), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfRsnIeCipherWep40Enabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfRsnIeCipherWep40Enabled.setDescription('Indicates whether WEP-40 cipher is advertised in RSN IE, for this service profile.') ntwsApConfServProfRsnIeCipherWep104Enabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 24), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfRsnIeCipherWep104Enabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfRsnIeCipherWep104Enabled.setDescription('Indicates whether WEP-104 cipher is advertised in RSN IE, for this service profile.') ntwsApConfServProfRsnIeAuthDot1xEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 25), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfRsnIeAuthDot1xEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfRsnIeAuthDot1xEnabled.setDescription('Indicates whether 802.1X authentication is advertised in RSN IE, for this service profile.') ntwsApConfServProfRsnIeAuthPskEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 26), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfRsnIeAuthPskEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfRsnIeAuthPskEnabled.setDescription('Indicates whether Pre-Shared Key authentication is advertised in RSN IE, for this service profile.') ntwsApConfServProfTkipMicCountermeasuresTime = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 27), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfTkipMicCountermeasuresTime.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfTkipMicCountermeasuresTime.setDescription('Indicates the TKIP MIC countermeasures time in milliseconds for this service profile. This is the length of time that AP radios use countermeasures if two Message Integrity Code (MIC) failures occur within 60 seconds.') ntwsApConfServProfMaxBandwidthKbps = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 28), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfMaxBandwidthKbps.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfMaxBandwidthKbps.setDescription('The bandwidth limit for this service profile, in Kbits/second. A value of zero means unlimited.') ntwsApConfServProfCacMode = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 29), NtwsServiceProfileCacMode()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfCacMode.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfCacMode.setDescription('The Call Admission Control (CAC) mode, for this service profile.') ntwsApConfServProfCacSessCount = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 30), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfCacSessCount.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfCacSessCount.setDescription('The maximum number of active sessions a radio can have when session-based CAC is enabled, for this service profile.') ntwsApConfServProfUserIdleTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 31), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfUserIdleTimeout.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfUserIdleTimeout.setDescription('The number of seconds MSS has a session available for a client not sending data and is not responding to keepalives (idle-client probes). If the timer expires, the client session is changed to the Dissociated state, for this service profile.') ntwsApConfServProfIdleClientProbingEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 32), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfIdleClientProbingEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfIdleClientProbingEnabled.setDescription('Indicates whether the AC radio sends a unicast null-data frame to each client every 10 seconds, for this service profile.') ntwsApConfServProfShortRetryCount = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 33), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfShortRetryCount.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfShortRetryCount.setDescription('The number of times a radio can send a short unicast frame without receiving an acknowledgment, for this service profile.') ntwsApConfServProfLongRetryCount = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 34), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfLongRetryCount.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfLongRetryCount.setDescription('The number of times a radio can send a long unicast frame without receiving an acknowledgment, for this service profile.') ntwsApConfServProfProxyArpEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 35), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfProxyArpEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfProxyArpEnabled.setDescription('Indicates whether proxy ARP is enabled for this service profile.') ntwsApConfServProfDhcpRestrictEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 36), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfDhcpRestrictEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfDhcpRestrictEnabled.setDescription('Indicates whether only DHCP traffic is allowed until a newly associated client has been authenticated and authorized, for this service profile.') ntwsApConfServProfNoBroadcastEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 37), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfNoBroadcastEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfNoBroadcastEnabled.setDescription('Indicates whether broadcast ARP and DHCP packets are converted to unicast for this service profile.') ntwsApConfServProfSygateOnDemandEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 38), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfSygateOnDemandEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfSygateOnDemandEnabled.setDescription('Indicates whether Sygate On-Demand Manager (SODA Manager) is enabled for this service profile.') ntwsApConfServProfEnforceChecksEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 39), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfEnforceChecksEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfEnforceChecksEnabled.setDescription('Indicates whether Enforcement of the SODA security checks is enabled for this service profile.') ntwsApConfServProfSodaRemediationAcl = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 40), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfSodaRemediationAcl.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfSodaRemediationAcl.setDescription('Remediation page ACL to apply to the client when the failure page is loaded, for this service profile.') ntwsApConfServProfSodaSuccessPage = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 41), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfSodaSuccessPage.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfSodaSuccessPage.setDescription('Success page that is displayed on the client when a client successfully runs the checks performed by the SODA agent, for this service profile.') ntwsApConfServProfSodaFailurePage = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 42), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfSodaFailurePage.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfSodaFailurePage.setDescription('Failure page that is displayed on the client when the SODA agent checks fail, for this service profile.') ntwsApConfServProfSodaLogoutPage = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 43), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfSodaLogoutPage.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfSodaLogoutPage.setDescription('The page to load when a client closes the SODA virtual desktop and logs out of the network, for this service profile.') ntwsApConfServProfSodaAgentDirectory = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 44), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfSodaAgentDirectory.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfSodaAgentDirectory.setDescription('Specifies a different directory for the SODA agent files used for this service profile.') ntwsApConfServProfWebPortalSessionTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 45), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfWebPortalSessionTimeout.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfWebPortalSessionTimeout.setDescription('Time interval, in seconds, for which a Web Portal WebAAA session remains in the Deassociated state before being terminated automatically, for this service profile.') ntwsApConfServProfWebPortalAcl = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 46), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfWebPortalAcl.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfWebPortalAcl.setDescription('Name of ACL used for filtering traffic for Web Portal users during authentication, for this service profile.') ntwsApConfServProfWebPortalLogoutEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 47), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfWebPortalLogoutEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfWebPortalLogoutEnabled.setDescription('Indicates whether the Web Portal logout functionality is enabled for this service profile.') ntwsApConfServProfWebPortalLogoutUrl = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 48), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfWebPortalLogoutUrl.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfWebPortalLogoutUrl.setDescription('Indicates the Web Portal Logout URL for this service profile.') ntwsApConfServProfKeepInitialVlanEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 49), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfKeepInitialVlanEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfKeepInitialVlanEnabled.setDescription('Indicates whether, after roaming, the user keeps the VLAN assigned from the first connection, for this service profile.') ntwsApConfServProfMeshModeEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 50), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfMeshModeEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfMeshModeEnabled.setDescription('Indicates whether wireless mesh between APs is enabled for this service profile.') ntwsApConfServProfBridgingEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 51), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfBridgingEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfBridgingEnabled.setDescription('Indicates whether wireless bridging of traffic between APs is enabled for this service profile.') ntwsApConfServProfLoadBalanceExemptEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 9, 1, 52), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfServProfLoadBalanceExemptEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServProfLoadBalanceExemptEnabled.setDescription('Indicates whether this service profile is exempted from load balancing.') ntwsApConfSnoopFilterTable = MibTable((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 10), ) if mibBuilder.loadTexts: ntwsApConfSnoopFilterTable.setStatus('current') if mibBuilder.loadTexts: ntwsApConfSnoopFilterTable.setDescription('A table describing the Snoop Filters currently configured on this AC.') ntwsApConfSnoopFilterEntry = MibTableRow((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 10, 1), ).setIndexNames((0, "NTWS-AP-CONFIG-MIB", "ntwsApConfSnoopFilterName")) if mibBuilder.loadTexts: ntwsApConfSnoopFilterEntry.setStatus('current') if mibBuilder.loadTexts: ntwsApConfSnoopFilterEntry.setDescription('Configuration for a particular Snoop Filter.') ntwsApConfSnoopFilterName = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 10, 1, 1), NtwsSnoopFilterName()) if mibBuilder.loadTexts: ntwsApConfSnoopFilterName.setStatus('current') if mibBuilder.loadTexts: ntwsApConfSnoopFilterName.setDescription('Name of this snoop filter.') ntwsApConfSnoopFilterEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 1, 10, 1, 2), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwsApConfSnoopFilterEnabled.setStatus('current') if mibBuilder.loadTexts: ntwsApConfSnoopFilterEnabled.setDescription('Indicates whether this snoop filter is enabled.') ntwsApConfigConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 2)) ntwsApConfigCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 2, 1)) ntwsApConfigGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 2, 2)) ntwsApConfigCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 2, 1, 1)).setObjects(("NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigTableGroup"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioConfigTableGroup"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApTemplateConfigTableGroup"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApTemplateRadioConfigTableGroup"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfileTableGroup"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfServiceProfileTableGroup"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfSnoopFilterTableGroup"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServiceProfileTableGroup"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfSnoopFilterTableGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ntwsApConfigCompliance = ntwsApConfigCompliance.setStatus('current') if mibBuilder.loadTexts: ntwsApConfigCompliance.setDescription('The compliance statement for devices that implement AP Config MIB.') ntwsApConfApConfigTableGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 2, 2, 1)).setObjects(("NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigApAttachType"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigPhysPortNum"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigApSerialNum"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigApModelName"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigFingerprint"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigBias"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigApTimeout"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigApName"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigContact"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigLocation"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigBlinkEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigForceImageDownloadEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigFirmwareUpgradeEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigLocalSwitchingEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigPowerMode"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigLedMode"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApConfigDescription")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ntwsApConfApConfigTableGroup = ntwsApConfApConfigTableGroup.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApConfigTableGroup.setDescription('Group of columnar objects implemented to provide AP Configuration info in releases 7.1 and greater.') ntwsApConfRadioConfigTableGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 2, 2, 2)).setObjects(("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioConfigRadioType"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioConfigRadioMode"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioConfigRadioProfileName"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioConfigChannel"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioConfigTxPower"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioConfigAutoTuneMaxTxPower"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioConfigAntennaType"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioConfigAntennaLocation"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioConfigLoadBalancingEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioConfigLoadBalancingGroup"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioConfigLoadRebalancingEnabled")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ntwsApConfRadioConfigTableGroup = ntwsApConfRadioConfigTableGroup.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioConfigTableGroup.setDescription('Group of columnar objects implemented to provide Radio Configuration info in releases 7.1 and greater.') ntwsApConfApTemplateConfigTableGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 2, 2, 3)).setObjects(("NTWS-AP-CONFIG-MIB", "ntwsApConfApTemplConfApTemplateEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApTemplConfBias"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApTemplConfApTimeout"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApTemplConfBlinkEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApTemplConfForceImageDownloadEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApTemplConfFirmwareUpgradeEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApTemplConfLocalSwitchingEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApTemplConfPowerMode"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApTemplConfLedMode")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ntwsApConfApTemplateConfigTableGroup = ntwsApConfApTemplateConfigTableGroup.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemplateConfigTableGroup.setDescription('Group of columnar objects implemented to provide AP Configuration Template info in releases 7.1 and greater.') ntwsApConfApTemplateRadioConfigTableGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 2, 2, 4)).setObjects(("NTWS-AP-CONFIG-MIB", "ntwsApConfApTemRadioConfRadioMode"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApTemRadioConfRadioProfileName"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApTemRadioConfAutoTuneMaxTxPower"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApTemRadioConfLoadBalancingEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApTemRadioConfLoadBalancingGroup"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfApTemRadioConfLoadRebalancingEnabled")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ntwsApConfApTemplateRadioConfigTableGroup = ntwsApConfApTemplateRadioConfigTableGroup.setStatus('current') if mibBuilder.loadTexts: ntwsApConfApTemplateRadioConfigTableGroup.setDescription('Group of columnar objects implemented to provide Radio Configuration Template info in releases 7.1 and greater.') ntwsApConfRadioProfileTableGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 2, 2, 5)).setObjects(("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfBeaconInterval"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfDtimInterval"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfChannelWidth11na"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfMaxTxLifetime"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfMaxRxLifetime"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfRtsThreshold"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfFragThreshold"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfLongXmitPreambleEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfCountermeasuresMode"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfRFScanMode"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfRFScanChannelScope"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfRFScanCTSEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfAutoTune11aChannelRange"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfAutoTuneIgnoreClientsEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfAutoTuneChannelEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfAutoTuneChannelHolddownInterval"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfAutoTuneChannelChangeInterval"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfAutoTunePowerEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfAutoTunePowerRampInterval"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfAutoTunePowerChangeInterval"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfFairQueuingEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfCacBackgroundACMandatory"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfCacBackgroundMaxUtilization"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfCacBackgroundPolicingEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfCacBestEffortACMandatory"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfCacBestEffortMaxUtilization"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfCacBestEffortPolicingEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfCacVideoACMandatory"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfCacVideoMaxUtilization"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfCacVideoPolicingEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfCacVoiceACMandatory"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfCacVoiceMaxUtilization"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfCacVoicePolicingEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfRfidTagEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfWmmPowerSaveEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfRateEnforcementEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfRadioProfDfsChannelsEnabled")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ntwsApConfRadioProfileTableGroup = ntwsApConfRadioProfileTableGroup.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfileTableGroup.setDescription('Group of columnar objects implemented to provide Radio Profile configuration info in releases 7.1 and greater.') ntwsApConfRadioProfServiceProfileTableGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 2, 2, 6)).setObjects(("NTWS-AP-CONFIG-MIB", "ntwsApConfRpServpRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ntwsApConfRadioProfServiceProfileTableGroup = ntwsApConfRadioProfServiceProfileTableGroup.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfServiceProfileTableGroup.setDescription('Group of columnar objects implemented to provide Service Profiles associated to each Radio Profile in releases 7.1 and greater.') ntwsApConfRadioProfSnoopFilterTableGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 2, 2, 7)).setObjects(("NTWS-AP-CONFIG-MIB", "ntwsApConfRpSnoopfRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ntwsApConfRadioProfSnoopFilterTableGroup = ntwsApConfRadioProfSnoopFilterTableGroup.setStatus('current') if mibBuilder.loadTexts: ntwsApConfRadioProfSnoopFilterTableGroup.setDescription('Group of columnar objects implemented to provide Snoop Filters associated to each Radio Profile in releases 7.1 and greater.') ntwsApConfServiceProfileTableGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 2, 2, 8)).setObjects(("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfSsidType"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfBeaconEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProf11naMode"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProf11ngMode"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProf11nShortGuardIntervalEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProf11nFrameAggregation"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProf11nMsduMaxLength"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProf11nMpduMaxLength"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfAuthFallthru"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfWebAAAForm"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfSharedKeyAuthEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfWpaIeEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfWpaIeCipherTkipEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfWpaIeCipherCcmpEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfWpaIeCipherWep40Enabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfWpaIeCipherWep104Enabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfWpaIeAuthDot1xEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfWpaIeAuthPskEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfRsnIeEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfRsnIeCipherTkipEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfRsnIeCipherCcmpEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfRsnIeCipherWep40Enabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfRsnIeCipherWep104Enabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfRsnIeAuthDot1xEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfRsnIeAuthPskEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfTkipMicCountermeasuresTime"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfMaxBandwidthKbps"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfCacMode"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfCacSessCount"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfUserIdleTimeout"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfIdleClientProbingEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfShortRetryCount"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfLongRetryCount"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfProxyArpEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfDhcpRestrictEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfNoBroadcastEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfSygateOnDemandEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfEnforceChecksEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfSodaRemediationAcl"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfSodaSuccessPage"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfSodaFailurePage"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfSodaLogoutPage"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfSodaAgentDirectory"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfWebPortalSessionTimeout"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfWebPortalAcl"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfWebPortalLogoutEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfWebPortalLogoutUrl"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfKeepInitialVlanEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfMeshModeEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfBridgingEnabled"), ("NTWS-AP-CONFIG-MIB", "ntwsApConfServProfLoadBalanceExemptEnabled")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ntwsApConfServiceProfileTableGroup = ntwsApConfServiceProfileTableGroup.setStatus('current') if mibBuilder.loadTexts: ntwsApConfServiceProfileTableGroup.setDescription('Group of columnar objects implemented to provide Service Profile configuration info in releases 7.1 and greater.') ntwsApConfSnoopFilterTableGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 45, 6, 1, 4, 14, 2, 2, 9)).setObjects(("NTWS-AP-CONFIG-MIB", "ntwsApConfSnoopFilterEnabled")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ntwsApConfSnoopFilterTableGroup = ntwsApConfSnoopFilterTableGroup.setStatus('current') if mibBuilder.loadTexts: ntwsApConfSnoopFilterTableGroup.setDescription('Group of columnar objects implemented to provide Snoop Filter configuration info in releases 7.1 and greater.') mibBuilder.exportSymbols("NTWS-AP-CONFIG-MIB", ntwsApConfServProfWebPortalLogoutEnabled=ntwsApConfServProfWebPortalLogoutEnabled, ntwsApConfApConfigApSerialNum=ntwsApConfApConfigApSerialNum, ntwsApConfRadioConfigApNum=ntwsApConfRadioConfigApNum, NtwsRadioProfileRFScanChannelScope=NtwsRadioProfileRFScanChannelScope, ntwsApConfRadioProfRFScanMode=ntwsApConfRadioProfRFScanMode, NtwsRadioProfileRFScanMode=NtwsRadioProfileRFScanMode, ntwsApConfApTemplConfLocalSwitchingEnabled=ntwsApConfApTemplConfLocalSwitchingEnabled, ntwsApConfigCompliances=ntwsApConfigCompliances, ntwsApConfApConfigPhysPortNum=ntwsApConfApConfigPhysPortNum, ntwsApConfRadioConfigRadioMode=ntwsApConfRadioConfigRadioMode, ntwsApConfServProfEnforceChecksEnabled=ntwsApConfServProfEnforceChecksEnabled, ntwsApConfApTemplConfApTemplateName=ntwsApConfApTemplConfApTemplateName, ntwsApConfRadioProfSnoopFilterTableGroup=ntwsApConfRadioProfSnoopFilterTableGroup, ntwsApConfApConfigLedMode=ntwsApConfApConfigLedMode, ntwsApConfRadioConfigLoadBalancingGroup=ntwsApConfRadioConfigLoadBalancingGroup, ntwsApConfApTemRadioConfRadioIndex=ntwsApConfApTemRadioConfRadioIndex, ntwsApConfRadioProfLongXmitPreambleEnabled=ntwsApConfRadioProfLongXmitPreambleEnabled, ntwsApConfServProfWebPortalLogoutUrl=ntwsApConfServProfWebPortalLogoutUrl, ntwsApConfApTemRadioConfLoadBalancingEnabled=ntwsApConfApTemRadioConfLoadBalancingEnabled, ntwsApConfServProf11naMode=ntwsApConfServProf11naMode, ntwsApConfRpServpRowStatus=ntwsApConfRpServpRowStatus, ntwsApConfRadioProfAutoTunePowerEnabled=ntwsApConfRadioProfAutoTunePowerEnabled, ntwsApConfRadioConfigRadioIndex=ntwsApConfRadioConfigRadioIndex, ntwsApConfRadioProfRFScanCTSEnabled=ntwsApConfRadioProfRFScanCTSEnabled, ntwsApConfApTemplateConfigTableGroup=ntwsApConfApTemplateConfigTableGroup, NtwsRadioProfileAutoTuneChannelRange=NtwsRadioProfileAutoTuneChannelRange, NtwsApTemplateName=NtwsApTemplateName, ntwsApConfRadioProfAutoTuneChannelEnabled=ntwsApConfRadioProfAutoTuneChannelEnabled, ntwsApConfigMib=ntwsApConfigMib, ntwsApConfApTemplateConfigEntry=ntwsApConfApTemplateConfigEntry, ntwsApConfRadioConfigTable=ntwsApConfRadioConfigTable, ntwsApConfRadioProfCacBestEffortACMandatory=ntwsApConfRadioProfCacBestEffortACMandatory, ntwsApConfigConformance=ntwsApConfigConformance, ntwsApConfSnoopFilterTableGroup=ntwsApConfSnoopFilterTableGroup, ntwsApConfRadioProfCountermeasuresMode=ntwsApConfRadioProfCountermeasuresMode, ntwsApConfRadioProfAutoTune11aChannelRange=ntwsApConfRadioProfAutoTune11aChannelRange, ntwsApConfServProfWpaIeEnabled=ntwsApConfServProfWpaIeEnabled, ntwsApConfRadioProfServiceProfileTableGroup=ntwsApConfRadioProfServiceProfileTableGroup, ntwsApConfRadioConfigAntennaLocation=ntwsApConfRadioConfigAntennaLocation, ntwsApConfRadioProfCacVoiceMaxUtilization=ntwsApConfRadioProfCacVoiceMaxUtilization, ntwsApConfApTemplConfBlinkEnabled=ntwsApConfApTemplConfBlinkEnabled, ntwsApConfApTemplConfForceImageDownloadEnabled=ntwsApConfApTemplConfForceImageDownloadEnabled, NtwsServiceProfile11nMode=NtwsServiceProfile11nMode, ntwsApConfServProfSodaLogoutPage=ntwsApConfServProfSodaLogoutPage, ntwsApConfRadioProfCacVideoMaxUtilization=ntwsApConfRadioProfCacVideoMaxUtilization, ntwsApConfServProfRsnIeCipherTkipEnabled=ntwsApConfServProfRsnIeCipherTkipEnabled, ntwsApConfServProfMaxBandwidthKbps=ntwsApConfServProfMaxBandwidthKbps, NtwsServiceProfile11nFrameAggregationType=NtwsServiceProfile11nFrameAggregationType, ntwsApConfRadioProfAutoTunePowerRampInterval=ntwsApConfRadioProfAutoTunePowerRampInterval, ntwsApConfServProfWpaIeCipherWep40Enabled=ntwsApConfServProfWpaIeCipherWep40Enabled, ntwsApConfRadioConfigTableGroup=ntwsApConfRadioConfigTableGroup, ntwsApConfRadioProfRFScanChannelScope=ntwsApConfRadioProfRFScanChannelScope, NtwsRadioProfileName=NtwsRadioProfileName, ntwsApConfServProf11nFrameAggregation=ntwsApConfServProf11nFrameAggregation, ntwsApConfServProfBridgingEnabled=ntwsApConfServProfBridgingEnabled, ntwsApConfRadioProfCacBestEffortPolicingEnabled=ntwsApConfRadioProfCacBestEffortPolicingEnabled, ntwsApConfRadioProfAutoTunePowerChangeInterval=ntwsApConfRadioProfAutoTunePowerChangeInterval, ntwsApConfRadioProfBeaconInterval=ntwsApConfRadioProfBeaconInterval, ntwsApConfRadioProfServiceProfileEntry=ntwsApConfRadioProfServiceProfileEntry, ntwsApConfServProfRsnIeCipherCcmpEnabled=ntwsApConfServProfRsnIeCipherCcmpEnabled, ntwsApConfServProfWebAAAForm=ntwsApConfServProfWebAAAForm, ntwsApConfApConfigTable=ntwsApConfApConfigTable, ntwsApConfApConfigApModelName=ntwsApConfApConfigApModelName, ntwsApConfRadioConfigEntry=ntwsApConfRadioConfigEntry, ntwsApConfServProfKeepInitialVlanEnabled=ntwsApConfServProfKeepInitialVlanEnabled, ntwsApConfServProfWpaIeCipherTkipEnabled=ntwsApConfServProfWpaIeCipherTkipEnabled, ntwsApConfApTemplConfApTimeout=ntwsApConfApTemplConfApTimeout, ntwsApConfServProfProxyArpEnabled=ntwsApConfServProfProxyArpEnabled, ntwsApConfServProfUserIdleTimeout=ntwsApConfServProfUserIdleTimeout, ntwsApConfApTemplateRadioConfigTableGroup=ntwsApConfApTemplateRadioConfigTableGroup, ntwsApConfServProf11ngMode=ntwsApConfServProf11ngMode, ntwsApConfServProfSygateOnDemandEnabled=ntwsApConfServProfSygateOnDemandEnabled, ntwsApConfigCompliance=ntwsApConfigCompliance, ntwsApConfRadioProfCacBestEffortMaxUtilization=ntwsApConfRadioProfCacBestEffortMaxUtilization, ntwsApConfRadioProfCacBackgroundPolicingEnabled=ntwsApConfRadioProfCacBackgroundPolicingEnabled, ntwsApConfServProf11nMsduMaxLength=ntwsApConfServProf11nMsduMaxLength, ntwsApConfServProfWebPortalSessionTimeout=ntwsApConfServProfWebPortalSessionTimeout, ntwsApConfServProfWpaIeCipherCcmpEnabled=ntwsApConfServProfWpaIeCipherCcmpEnabled, ntwsApConfApConfigApName=ntwsApConfApConfigApName, ntwsApConfServProfRsnIeCipherWep40Enabled=ntwsApConfServProfRsnIeCipherWep40Enabled, ntwsApConfServProfIdleClientProbingEnabled=ntwsApConfServProfIdleClientProbingEnabled, ntwsApConfApTemplateRadioConfigEntry=ntwsApConfApTemplateRadioConfigEntry, ntwsApConfSnoopFilterEntry=ntwsApConfSnoopFilterEntry, ntwsApConfServProfRsnIeEnabled=ntwsApConfServProfRsnIeEnabled, NtwsServiceProfile11nMpduMaxLength=NtwsServiceProfile11nMpduMaxLength, ntwsApConfRadioProfFairQueuingEnabled=ntwsApConfRadioProfFairQueuingEnabled, ntwsApConfServProfLoadBalanceExemptEnabled=ntwsApConfServProfLoadBalanceExemptEnabled, ntwsApConfServProf11nShortGuardIntervalEnabled=ntwsApConfServProf11nShortGuardIntervalEnabled, ntwsApConfApConfigLocation=ntwsApConfApConfigLocation, ntwsApConfRadioProfChannelWidth11na=ntwsApConfRadioProfChannelWidth11na, ntwsApConfRadioProfCacBackgroundACMandatory=ntwsApConfRadioProfCacBackgroundACMandatory, ntwsApConfRpSnoopfRadioProfileName=ntwsApConfRpSnoopfRadioProfileName, ntwsApConfApConfigForceImageDownloadEnabled=ntwsApConfApConfigForceImageDownloadEnabled, ntwsApConfRadioProfRfidTagEnabled=ntwsApConfRadioProfRfidTagEnabled, ntwsApConfRpServpServiceProfileName=ntwsApConfRpServpServiceProfileName, ntwsApConfServProfSharedKeyAuthEnabled=ntwsApConfServProfSharedKeyAuthEnabled, ntwsApConfRadioProfCacVoiceACMandatory=ntwsApConfRadioProfCacVoiceACMandatory, ntwsApConfApConfigLocalSwitchingEnabled=ntwsApConfApConfigLocalSwitchingEnabled, ntwsApConfApConfigBias=ntwsApConfApConfigBias, ntwsApConfServProfWpaIeAuthPskEnabled=ntwsApConfServProfWpaIeAuthPskEnabled, ntwsApConfRpSnoopfSnoopFilterName=ntwsApConfRpSnoopfSnoopFilterName, ntwsApConfApConfigFirmwareUpgradeEnabled=ntwsApConfApConfigFirmwareUpgradeEnabled, ntwsApConfRadioConfigRadioProfileName=ntwsApConfRadioConfigRadioProfileName, ntwsApConfServProfSodaSuccessPage=ntwsApConfServProfSodaSuccessPage, ntwsApConfServProf11nMpduMaxLength=ntwsApConfServProf11nMpduMaxLength, ntwsApConfServProfCacMode=ntwsApConfServProfCacMode, ntwsApConfApTemplConfLedMode=ntwsApConfApTemplConfLedMode, ntwsApConfRadioProfCacVideoPolicingEnabled=ntwsApConfRadioProfCacVideoPolicingEnabled, ntwsApConfRpServpRadioProfileName=ntwsApConfRpServpRadioProfileName, NtwsServiceProfileName=NtwsServiceProfileName, ntwsApConfRadioProfMaxTxLifetime=ntwsApConfRadioProfMaxTxLifetime, ntwsApConfServiceProfileTable=ntwsApConfServiceProfileTable, ntwsApConfServProfAuthFallthru=ntwsApConfServProfAuthFallthru, ntwsApConfServProfServiceProfileName=ntwsApConfServProfServiceProfileName, ntwsApConfServiceProfileEntry=ntwsApConfServiceProfileEntry, ntwsApConfApTemplConfBias=ntwsApConfApTemplConfBias, ntwsApConfServProfSsidType=ntwsApConfServProfSsidType, ntwsApConfServProfTkipMicCountermeasuresTime=ntwsApConfServProfTkipMicCountermeasuresTime, NtwsServiceProfile11nMsduMaxLength=NtwsServiceProfile11nMsduMaxLength, ntwsApConfApConfigTableGroup=ntwsApConfApConfigTableGroup, ntwsApConfRadioProfDtimInterval=ntwsApConfRadioProfDtimInterval, ntwsApConfApConfigBlinkEnabled=ntwsApConfApConfigBlinkEnabled, ntwsApConfRadioProfileTable=ntwsApConfRadioProfileTable, ntwsApConfServProfRsnIeCipherWep104Enabled=ntwsApConfServProfRsnIeCipherWep104Enabled, ntwsApConfApConfigDescription=ntwsApConfApConfigDescription, ntwsApConfApTemRadioConfLoadBalancingGroup=ntwsApConfApTemRadioConfLoadBalancingGroup, ntwsApConfRadioProfFragThreshold=ntwsApConfRadioProfFragThreshold, ntwsApConfRadioProfServiceProfileTable=ntwsApConfRadioProfServiceProfileTable, ntwsApConfRadioProfDfsChannelsEnabled=ntwsApConfRadioProfDfsChannelsEnabled, NtwsServiceProfileCacMode=NtwsServiceProfileCacMode, ntwsApConfRpSnoopfRowStatus=ntwsApConfRpSnoopfRowStatus, ntwsApConfServProfSodaFailurePage=ntwsApConfServProfSodaFailurePage, ntwsApConfSnoopFilterTable=ntwsApConfSnoopFilterTable, ntwsApConfRadioConfigChannel=ntwsApConfRadioConfigChannel, ntwsApConfApTemRadioConfRadioMode=ntwsApConfApTemRadioConfRadioMode, ntwsApConfigGroups=ntwsApConfigGroups, ntwsApConfApConfigApTimeout=ntwsApConfApConfigApTimeout, ntwsApConfApConfigContact=ntwsApConfApConfigContact, ntwsApConfRadioProfRadioProfileName=ntwsApConfRadioProfRadioProfileName, ntwsApConfServProfRsnIeAuthDot1xEnabled=ntwsApConfServProfRsnIeAuthDot1xEnabled, ntwsApConfApTemRadioConfAutoTuneMaxTxPower=ntwsApConfApTemRadioConfAutoTuneMaxTxPower, ntwsApConfServProfDhcpRestrictEnabled=ntwsApConfServProfDhcpRestrictEnabled, ntwsApConfigMibObjects=ntwsApConfigMibObjects, PYSNMP_MODULE_ID=ntwsApConfigMib, ntwsApConfApTemRadioConfLoadRebalancingEnabled=ntwsApConfApTemRadioConfLoadRebalancingEnabled, ntwsApConfRadioProfMaxRxLifetime=ntwsApConfRadioProfMaxRxLifetime, ntwsApConfSnoopFilterEnabled=ntwsApConfSnoopFilterEnabled, ntwsApConfServiceProfileTableGroup=ntwsApConfServiceProfileTableGroup, ntwsApConfRadioProfCacVideoACMandatory=ntwsApConfRadioProfCacVideoACMandatory, NtwsServiceProfileSsidType=NtwsServiceProfileSsidType, ntwsApConfServProfMeshModeEnabled=ntwsApConfServProfMeshModeEnabled, ntwsApConfApTemplConfFirmwareUpgradeEnabled=ntwsApConfApTemplConfFirmwareUpgradeEnabled, ntwsApConfRadioProfAutoTuneChannelHolddownInterval=ntwsApConfRadioProfAutoTuneChannelHolddownInterval, ntwsApConfRadioProfCacVoicePolicingEnabled=ntwsApConfRadioProfCacVoicePolicingEnabled, ntwsApConfRadioProfileEntry=ntwsApConfRadioProfileEntry, ntwsApConfRadioConfigAntennaType=ntwsApConfRadioConfigAntennaType, ntwsApConfApConfigFingerprint=ntwsApConfApConfigFingerprint, ntwsApConfServProfWpaIeCipherWep104Enabled=ntwsApConfServProfWpaIeCipherWep104Enabled, ntwsApConfServProfCacSessCount=ntwsApConfServProfCacSessCount, ntwsApConfApConfigEntry=ntwsApConfApConfigEntry, ntwsApConfRadioConfigLoadRebalancingEnabled=ntwsApConfRadioConfigLoadRebalancingEnabled, ntwsApConfApTemplConfPowerMode=ntwsApConfApTemplConfPowerMode, NtwsRadioProfileCountermeasuresMode=NtwsRadioProfileCountermeasuresMode, ntwsApConfRadioConfigTxPower=ntwsApConfRadioConfigTxPower, ntwsApConfServProfSodaRemediationAcl=ntwsApConfServProfSodaRemediationAcl, ntwsApConfServProfWpaIeAuthDot1xEnabled=ntwsApConfServProfWpaIeAuthDot1xEnabled, ntwsApConfApConfigApAttachType=ntwsApConfApConfigApAttachType, ntwsApConfApTemplateRadioConfigTable=ntwsApConfApTemplateRadioConfigTable, NtwsSnoopFilterName=NtwsSnoopFilterName, ntwsApConfServProfLongRetryCount=ntwsApConfServProfLongRetryCount, ntwsApConfServProfWebPortalAcl=ntwsApConfServProfWebPortalAcl, ntwsApConfRadioProfSnoopFilterEntry=ntwsApConfRadioProfSnoopFilterEntry, ntwsApConfRadioProfRateEnforcementEnabled=ntwsApConfRadioProfRateEnforcementEnabled, NtwsServiceProfileAuthFallthruType=NtwsServiceProfileAuthFallthruType, ntwsApConfRadioProfCacBackgroundMaxUtilization=ntwsApConfRadioProfCacBackgroundMaxUtilization, ntwsApConfRadioProfAutoTuneChannelChangeInterval=ntwsApConfRadioProfAutoTuneChannelChangeInterval, ntwsApConfRadioConfigLoadBalancingEnabled=ntwsApConfRadioConfigLoadBalancingEnabled, ntwsApConfRadioConfigAutoTuneMaxTxPower=ntwsApConfRadioConfigAutoTuneMaxTxPower, ntwsApConfSnoopFilterName=ntwsApConfSnoopFilterName, ntwsApConfApTemplConfApTemplateEnabled=ntwsApConfApTemplConfApTemplateEnabled, ntwsApConfApTemplateConfigTable=ntwsApConfApTemplateConfigTable, ntwsApConfApTemRadioConfRadioProfileName=ntwsApConfApTemRadioConfRadioProfileName, ntwsApConfRadioConfigRadioType=ntwsApConfRadioConfigRadioType, ntwsApConfRadioProfWmmPowerSaveEnabled=ntwsApConfRadioProfWmmPowerSaveEnabled, ntwsApConfServProfShortRetryCount=ntwsApConfServProfShortRetryCount, ntwsApConfServProfRsnIeAuthPskEnabled=ntwsApConfServProfRsnIeAuthPskEnabled, ntwsApConfServProfSodaAgentDirectory=ntwsApConfServProfSodaAgentDirectory, ntwsApConfRadioProfSnoopFilterTable=ntwsApConfRadioProfSnoopFilterTable, ntwsApConfRadioProfileTableGroup=ntwsApConfRadioProfileTableGroup, ntwsApConfRadioProfRtsThreshold=ntwsApConfRadioProfRtsThreshold, ntwsApConfApConfigApNum=ntwsApConfApConfigApNum, ntwsApConfApTemRadioConfApTemplateName=ntwsApConfApTemRadioConfApTemplateName, ntwsApConfServProfBeaconEnabled=ntwsApConfServProfBeaconEnabled, ntwsApConfApConfigPowerMode=ntwsApConfApConfigPowerMode, ntwsApConfRadioProfAutoTuneIgnoreClientsEnabled=ntwsApConfRadioProfAutoTuneIgnoreClientsEnabled, ntwsApConfServProfNoBroadcastEnabled=ntwsApConfServProfNoBroadcastEnabled)
154.493151
13,937
0.813994
10,035
101,502
8.233184
0.082711
0.009659
0.013108
0.008715
0.403365
0.288102
0.235185
0.22474
0.178613
0.161946
0
0.041109
0.080432
101,502
656
13,938
154.728659
0.844061
0.003251
0
0.068038
0
0.052215
0.283621
0.056612
0
0
0.000316
0
0
1
0
false
0.001582
0.014241
0
0.132911
0.015823
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
9cbb614c090fe674317ef327eae11fce055c1e03
3,069
py
Python
passwords_test.py
maurinesinami/Password-locker
c17ece611eb8aebb5f83f284b00504c189ce4800
[ "MIT", "Unlicense" ]
null
null
null
passwords_test.py
maurinesinami/Password-locker
c17ece611eb8aebb5f83f284b00504c189ce4800
[ "MIT", "Unlicense" ]
null
null
null
passwords_test.py
maurinesinami/Password-locker
c17ece611eb8aebb5f83f284b00504c189ce4800
[ "MIT", "Unlicense" ]
null
null
null
import unittest # Importing the unittest module from passwords import User # Importing the contact class from passwords import Credentials class TestUser(unittest.TestCase): ''' Test class that defines test cases for the contact class behaviours. Args: unittest.TestCase: TestCase class that helps in creating test cases ''' def setUp(self): ''' Set up method to run before each test cases. ''' self.new_user = User("a.s.s.matic","Instagram","maurinesinami") def test_init(self): ''' test_init test case to test if the object is initialized properly ''' self.assertEqual(self.new_user.username,"a.s.s.matic") self.assertEqual(self.new_user.account,"Instagram") self.assertEqual(self.new_user.password,"maurinesinami") def test_save_user(self): ''' test_save_user test case to test if the user object is saved to the user_list ''' self.new_user.save_user() self.assertEqual(len(User.user_list),1) def tearDown(self): ''' tearDown does clear up after each test case has run ''' User.user_list = [] def test_save_multiple_users(self): ''' test_save_multiple_users to check if we can save multiple users in our user_list ''' self.new_user.save_user() test_user = User("polokoi", "Facebook", "trudet") test_user.save_user() self.assertEqual(len(User.user_list),2) def test_delete_user(self): ''' test_delete_user to test if we can remove a user from object user_list ''' self.new_user.save_user() test_user = User("polokoi", "Facebook", "trudet") test_user.save_user() self.new_user.delete_user() self.assertEqual(len(User.user_list),1) def test_find_user_by_account(self): ''' test to check if we can find a user by account ''' self.new_user.save_user() test_user = User("polokoi", "Facebook", "trudet") test_user.save_user() found_user = User.find_by_account("Facebook") self.assertEqual(found_user.account, test_user.account) def test_user_exists(self): ''' test to check if we can return a Boolean if we don't find the user ''' self.new_user.save_user() test_user = User("polokoi", "Facebook", "trudet") test_user.save_user() user_exists = User.user_exists("Facebook") self.assertTrue(user_exists) def test_display_all_users(self): ''' method that returns a list of all users saved ''' self.assertEqual(User.display_users(),User.user_list) def test_copy_password(self): ''' Test to confirm that we are copying the email address from a found contact ''' self.new_user.save_user() User.copy_password("trudent") self.assertEqual(self.new_user.password,pyperclip.paste()) if __name__ == '__main__': unittest.main()
33.358696
88
0.631476
405
3,069
4.577778
0.237037
0.06041
0.071197
0.048544
0.374326
0.307983
0.250809
0.218986
0.218986
0.159655
0
0.001335
0.267514
3,069
92
89
33.358696
0.823399
0.27175
0
0.347826
0
0
0.091368
0
0
0
0
0
0.217391
1
0.217391
false
0.130435
0.065217
0
0.304348
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
2
9cc9fe8752340f3697367f273212ffb237ccf0ce
28,906
py
Python
pysnmp-with-texts/UBNT-AirMAX-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
8
2019-05-09T17:04:00.000Z
2021-06-09T06:50:51.000Z
pysnmp-with-texts/UBNT-AirMAX-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
4
2019-05-31T16:42:59.000Z
2020-01-31T21:57:17.000Z
pysnmp-with-texts/UBNT-AirMAX-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
10
2019-04-30T05:51:36.000Z
2022-02-16T03:33:41.000Z
# # PySNMP MIB module UBNT-AirMAX-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/UBNT-AirMAX-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:28:21 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint", "ValueSizeConstraint") ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup") Counter32, Gauge32, ModuleIdentity, Counter64, ObjectIdentity, IpAddress, Bits, NotificationType, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, MibIdentifier, iso, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "Gauge32", "ModuleIdentity", "Counter64", "ObjectIdentity", "IpAddress", "Bits", "NotificationType", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "MibIdentifier", "iso", "Unsigned32") MacAddress, TextualConvention, DisplayString, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "MacAddress", "TextualConvention", "DisplayString", "TruthValue") ubntMIB, ubntAirosGroups = mibBuilder.importSymbols("UBNT-MIB", "ubntMIB", "ubntAirosGroups") ubntAirMAX = ModuleIdentity((1, 3, 6, 1, 4, 1, 41112, 1, 4)) ubntAirMAX.setRevisions(('2015-09-17 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ubntAirMAX.setRevisionsDescriptions(('ubntAirMAX revision',)) if mibBuilder.loadTexts: ubntAirMAX.setLastUpdated('201509170000Z') if mibBuilder.loadTexts: ubntAirMAX.setOrganization('Ubiquiti Networks, Inc.') if mibBuilder.loadTexts: ubntAirMAX.setContactInfo('support@ubnt.com') if mibBuilder.loadTexts: ubntAirMAX.setDescription('The AirMAX MIB module for Ubiquiti Networks, Inc. entities') ubntRadioTable = MibTable((1, 3, 6, 1, 4, 1, 41112, 1, 4, 1), ) if mibBuilder.loadTexts: ubntRadioTable.setStatus('current') if mibBuilder.loadTexts: ubntRadioTable.setDescription('Radio status & statistics') ubntRadioEntry = MibTableRow((1, 3, 6, 1, 4, 1, 41112, 1, 4, 1, 1), ).setIndexNames((0, "UBNT-AirMAX-MIB", "ubntRadioIndex")) if mibBuilder.loadTexts: ubntRadioEntry.setStatus('current') if mibBuilder.loadTexts: ubntRadioEntry.setDescription('An entry in the ubntRadioTable') ubntRadioIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))) if mibBuilder.loadTexts: ubntRadioIndex.setStatus('current') if mibBuilder.loadTexts: ubntRadioIndex.setDescription('Index for the ubntRadioTable') ubntRadioMode = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("sta", 1), ("ap", 2), ("aprepeater", 3), ("apwds", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntRadioMode.setStatus('current') if mibBuilder.loadTexts: ubntRadioMode.setDescription('Radio mode') ubntRadioCCode = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntRadioCCode.setStatus('current') if mibBuilder.loadTexts: ubntRadioCCode.setDescription('Country code') ubntRadioFreq = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntRadioFreq.setStatus('current') if mibBuilder.loadTexts: ubntRadioFreq.setDescription('Operating frequency') ubntRadioDfsEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 1, 1, 5), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntRadioDfsEnabled.setStatus('current') if mibBuilder.loadTexts: ubntRadioDfsEnabled.setDescription('DFS status') ubntRadioTxPower = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntRadioTxPower.setStatus('current') if mibBuilder.loadTexts: ubntRadioTxPower.setDescription('Transmit power') ubntRadioDistance = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntRadioDistance.setStatus('current') if mibBuilder.loadTexts: ubntRadioDistance.setDescription('Distance') ubntRadioChainmask = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntRadioChainmask.setStatus('current') if mibBuilder.loadTexts: ubntRadioChainmask.setDescription('Chainmask') ubntRadioAntenna = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 1, 1, 9), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntRadioAntenna.setStatus('current') if mibBuilder.loadTexts: ubntRadioAntenna.setDescription('Antenna') ubntRadioRssiTable = MibTable((1, 3, 6, 1, 4, 1, 41112, 1, 4, 2), ) if mibBuilder.loadTexts: ubntRadioRssiTable.setStatus('current') if mibBuilder.loadTexts: ubntRadioRssiTable.setDescription('Radio RSSI per chain') ubntRadioRssiEntry = MibTableRow((1, 3, 6, 1, 4, 1, 41112, 1, 4, 2, 1), ).setIndexNames((0, "UBNT-AirMAX-MIB", "ubntRadioIndex"), (0, "UBNT-AirMAX-MIB", "ubntRadioRssiIndex")) if mibBuilder.loadTexts: ubntRadioRssiEntry.setStatus('current') if mibBuilder.loadTexts: ubntRadioRssiEntry.setDescription('An entry in the ubntRadioRssiTable') ubntRadioRssiIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))) if mibBuilder.loadTexts: ubntRadioRssiIndex.setStatus('current') if mibBuilder.loadTexts: ubntRadioRssiIndex.setDescription('Index for the ubntRadioRssiTable') ubntRadioRssi = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 2, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntRadioRssi.setStatus('current') if mibBuilder.loadTexts: ubntRadioRssi.setDescription('Data frames rssi per chain') ubntRadioRssiMgmt = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 2, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntRadioRssiMgmt.setStatus('current') if mibBuilder.loadTexts: ubntRadioRssiMgmt.setDescription('Management frames rssi per chain') ubntRadioRssiExt = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 2, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntRadioRssiExt.setStatus('current') if mibBuilder.loadTexts: ubntRadioRssiExt.setDescription('Extension channel rssi per chain') ubntAirMaxTable = MibTable((1, 3, 6, 1, 4, 1, 41112, 1, 4, 6), ) if mibBuilder.loadTexts: ubntAirMaxTable.setStatus('current') if mibBuilder.loadTexts: ubntAirMaxTable.setDescription('airMAX protocol statistics') ubntAirMaxEntry = MibTableRow((1, 3, 6, 1, 4, 1, 41112, 1, 4, 6, 1), ).setIndexNames((0, "UBNT-AirMAX-MIB", "ubntAirMaxIfIndex")) if mibBuilder.loadTexts: ubntAirMaxEntry.setStatus('current') if mibBuilder.loadTexts: ubntAirMaxEntry.setDescription('An entry in the ubntAirMaxTable') ubntAirMaxIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 6, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))) if mibBuilder.loadTexts: ubntAirMaxIfIndex.setStatus('current') if mibBuilder.loadTexts: ubntAirMaxIfIndex.setDescription('Index for the ubntAirMaxTable') ubntAirMaxEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 6, 1, 2), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntAirMaxEnabled.setStatus('current') if mibBuilder.loadTexts: ubntAirMaxEnabled.setDescription('airMAX status - on/off') ubntAirMaxQuality = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 6, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntAirMaxQuality.setStatus('current') if mibBuilder.loadTexts: ubntAirMaxQuality.setDescription('airMAX quality - percentage') ubntAirMaxCapacity = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 6, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntAirMaxCapacity.setStatus('current') if mibBuilder.loadTexts: ubntAirMaxCapacity.setDescription('airMAX capacity - percentage') ubntAirMaxPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 6, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("high", 0), ("medium", 1), ("low", 2), ("none", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntAirMaxPriority.setStatus('current') if mibBuilder.loadTexts: ubntAirMaxPriority.setDescription('airMAX priority - none/high/low/medium') ubntAirMaxNoAck = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 6, 1, 6), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntAirMaxNoAck.setStatus('current') if mibBuilder.loadTexts: ubntAirMaxNoAck.setDescription('airMAX NoACK mode - on/off') ubntAirSyncTable = MibTable((1, 3, 6, 1, 4, 1, 41112, 1, 4, 3), ) if mibBuilder.loadTexts: ubntAirSyncTable.setStatus('current') if mibBuilder.loadTexts: ubntAirSyncTable.setDescription('airSync protocol statistics') ubntAirSyncEntry = MibTableRow((1, 3, 6, 1, 4, 1, 41112, 1, 4, 3, 1), ).setIndexNames((0, "UBNT-AirMAX-MIB", "ubntAirSyncIfIndex")) if mibBuilder.loadTexts: ubntAirSyncEntry.setStatus('current') if mibBuilder.loadTexts: ubntAirSyncEntry.setDescription('An entry in the ubntAirSyncTable') ubntAirSyncIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))) if mibBuilder.loadTexts: ubntAirSyncIfIndex.setStatus('current') if mibBuilder.loadTexts: ubntAirSyncIfIndex.setDescription('Index for the ubntAirSyncTable') ubntAirSyncMode = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("disabled", 0), ("master", 1), ("slave", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntAirSyncMode.setStatus('current') if mibBuilder.loadTexts: ubntAirSyncMode.setDescription('airSync mode - master/slave') ubntAirSyncCount = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntAirSyncCount.setStatus('current') if mibBuilder.loadTexts: ubntAirSyncCount.setDescription('airSync client count') ubntAirSyncDownUtil = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 3, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntAirSyncDownUtil.setStatus('current') if mibBuilder.loadTexts: ubntAirSyncDownUtil.setDescription('airSync down utilization') ubntAirSyncUpUtil = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 3, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntAirSyncUpUtil.setStatus('current') if mibBuilder.loadTexts: ubntAirSyncUpUtil.setDescription('airSync up utilization') ubntAirSelTable = MibTable((1, 3, 6, 1, 4, 1, 41112, 1, 4, 4), ) if mibBuilder.loadTexts: ubntAirSelTable.setStatus('current') if mibBuilder.loadTexts: ubntAirSelTable.setDescription('airSelect protocol statistics') ubntAirSelEntry = MibTableRow((1, 3, 6, 1, 4, 1, 41112, 1, 4, 4, 1), ).setIndexNames((0, "UBNT-AirMAX-MIB", "ubntAirSelIfIndex")) if mibBuilder.loadTexts: ubntAirSelEntry.setStatus('current') if mibBuilder.loadTexts: ubntAirSelEntry.setDescription('An entry in the ubntAirSelTable') ubntAirSelIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))) if mibBuilder.loadTexts: ubntAirSelIfIndex.setStatus('current') if mibBuilder.loadTexts: ubntAirSelIfIndex.setDescription('Index for the ubntAirSelTable') ubntAirSelEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 4, 1, 2), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntAirSelEnabled.setStatus('current') if mibBuilder.loadTexts: ubntAirSelEnabled.setDescription('airSelect status - on/off') ubntAirSelInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 4, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntAirSelInterval.setStatus('current') if mibBuilder.loadTexts: ubntAirSelInterval.setDescription('airSelect hop interval (miliseconds)') ubntWlStatTable = MibTable((1, 3, 6, 1, 4, 1, 41112, 1, 4, 5), ) if mibBuilder.loadTexts: ubntWlStatTable.setStatus('current') if mibBuilder.loadTexts: ubntWlStatTable.setDescription('Wireless statistics') ubntWlStatEntry = MibTableRow((1, 3, 6, 1, 4, 1, 41112, 1, 4, 5, 1), ).setIndexNames((0, "UBNT-AirMAX-MIB", "ubntWlStatIndex")) if mibBuilder.loadTexts: ubntWlStatEntry.setStatus('current') if mibBuilder.loadTexts: ubntWlStatEntry.setDescription('An entry in the ubntWlStatTable') ubntWlStatIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))) if mibBuilder.loadTexts: ubntWlStatIndex.setStatus('current') if mibBuilder.loadTexts: ubntWlStatIndex.setDescription('Index for the ubntWlStatTable') ubntWlStatSsid = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 5, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntWlStatSsid.setStatus('current') if mibBuilder.loadTexts: ubntWlStatSsid.setDescription('SSID') ubntWlStatHideSsid = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 5, 1, 3), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntWlStatHideSsid.setStatus('current') if mibBuilder.loadTexts: ubntWlStatHideSsid.setDescription('Hide SSID - on/off') ubntWlStatApMac = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 5, 1, 4), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntWlStatApMac.setStatus('current') if mibBuilder.loadTexts: ubntWlStatApMac.setDescription('AP MAC address') ubntWlStatSignal = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 5, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntWlStatSignal.setStatus('current') if mibBuilder.loadTexts: ubntWlStatSignal.setDescription('Signal strength, dBm') ubntWlStatRssi = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 5, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntWlStatRssi.setStatus('current') if mibBuilder.loadTexts: ubntWlStatRssi.setDescription('RSSI, dBm') ubntWlStatCcq = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 5, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntWlStatCcq.setStatus('current') if mibBuilder.loadTexts: ubntWlStatCcq.setDescription('CCQ in %') ubntWlStatNoiseFloor = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 5, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntWlStatNoiseFloor.setStatus('current') if mibBuilder.loadTexts: ubntWlStatNoiseFloor.setDescription('Noise floor') ubntWlStatTxRate = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 5, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntWlStatTxRate.setStatus('current') if mibBuilder.loadTexts: ubntWlStatTxRate.setDescription('TX rate') ubntWlStatRxRate = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 5, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntWlStatRxRate.setStatus('current') if mibBuilder.loadTexts: ubntWlStatRxRate.setDescription('RX rate') ubntWlStatSecurity = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 5, 1, 11), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntWlStatSecurity.setStatus('current') if mibBuilder.loadTexts: ubntWlStatSecurity.setDescription('Wireless security mode') ubntWlStatWdsEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 5, 1, 12), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntWlStatWdsEnabled.setStatus('current') if mibBuilder.loadTexts: ubntWlStatWdsEnabled.setDescription('WDS - on/off') ubntWlStatApRepeater = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 5, 1, 13), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntWlStatApRepeater.setStatus('current') if mibBuilder.loadTexts: ubntWlStatApRepeater.setDescription('AP repeater - on/off') ubntWlStatChanWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 5, 1, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntWlStatChanWidth.setStatus('current') if mibBuilder.loadTexts: ubntWlStatChanWidth.setDescription('Channel Width') ubntWlStatStaCount = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 5, 1, 15), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntWlStatStaCount.setStatus('current') if mibBuilder.loadTexts: ubntWlStatStaCount.setDescription('Station count') ubntStaTable = MibTable((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7), ) if mibBuilder.loadTexts: ubntStaTable.setStatus('current') if mibBuilder.loadTexts: ubntStaTable.setDescription('Station list') ubntStaEntry = MibTableRow((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1), ).setIndexNames((0, "UBNT-AirMAX-MIB", "ubntWlStatIndex"), (0, "UBNT-AirMAX-MIB", "ubntStaMac")) if mibBuilder.loadTexts: ubntStaEntry.setStatus('current') if mibBuilder.loadTexts: ubntStaEntry.setDescription('An entry in the ubntStaEntry') ubntStaMac = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 1), MacAddress()) if mibBuilder.loadTexts: ubntStaMac.setStatus('current') if mibBuilder.loadTexts: ubntStaMac.setDescription('Station MAC address') ubntStaName = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaName.setStatus('current') if mibBuilder.loadTexts: ubntStaName.setDescription('Station name') ubntStaSignal = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaSignal.setStatus('current') if mibBuilder.loadTexts: ubntStaSignal.setDescription('Signal strength, dBm') ubntStaNoiseFloor = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaNoiseFloor.setStatus('current') if mibBuilder.loadTexts: ubntStaNoiseFloor.setDescription('Noise floor') ubntStaDistance = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaDistance.setStatus('current') if mibBuilder.loadTexts: ubntStaDistance.setDescription('Distance') ubntStaCcq = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaCcq.setStatus('current') if mibBuilder.loadTexts: ubntStaCcq.setDescription('CCQ in %') ubntStaAmp = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaAmp.setStatus('current') if mibBuilder.loadTexts: ubntStaAmp.setDescription('airMAX priority') ubntStaAmq = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaAmq.setStatus('current') if mibBuilder.loadTexts: ubntStaAmq.setDescription('airMAX quality') ubntStaAmc = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaAmc.setStatus('current') if mibBuilder.loadTexts: ubntStaAmc.setDescription('airMAX capacity') ubntStaLastIp = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 10), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaLastIp.setStatus('current') if mibBuilder.loadTexts: ubntStaLastIp.setDescription('Last known IP address') ubntStaTxRate = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaTxRate.setStatus('current') if mibBuilder.loadTexts: ubntStaTxRate.setDescription('TX rate') ubntStaRxRate = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaRxRate.setStatus('current') if mibBuilder.loadTexts: ubntStaRxRate.setDescription('RX rate') ubntStaTxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 13), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaTxBytes.setStatus('current') if mibBuilder.loadTexts: ubntStaTxBytes.setDescription('TX bytes') ubntStaRxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 14), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaRxBytes.setStatus('current') if mibBuilder.loadTexts: ubntStaRxBytes.setDescription('TX rate') ubntStaConnTime = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 15), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaConnTime.setStatus('current') if mibBuilder.loadTexts: ubntStaConnTime.setDescription('Connection Time in seconds') ubntStaLocalCINR = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 16), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaLocalCINR.setStatus('current') if mibBuilder.loadTexts: ubntStaLocalCINR.setDescription('Local CINR') ubntStaTxCapacity = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 17), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaTxCapacity.setStatus('current') if mibBuilder.loadTexts: ubntStaTxCapacity.setDescription('Uplink Capacity in Kbps') ubntStaRxCapacity = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 18), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaRxCapacity.setStatus('current') if mibBuilder.loadTexts: ubntStaRxCapacity.setDescription('Downlink Capacity in Kbps') ubntStaTxAirtime = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 19), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaTxAirtime.setStatus('current') if mibBuilder.loadTexts: ubntStaTxAirtime.setDescription('Uplink Airtime in % multiplied by 10') ubntStaRxAirtime = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 20), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaRxAirtime.setStatus('current') if mibBuilder.loadTexts: ubntStaRxAirtime.setDescription('Downlink Airtime in % multiplied by 10') ubntStaTxLatency = MibTableColumn((1, 3, 6, 1, 4, 1, 41112, 1, 4, 7, 1, 21), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ubntStaTxLatency.setStatus('current') if mibBuilder.loadTexts: ubntStaTxLatency.setDescription('Uplink Latency in milliseconds') ubntAirMAXStatusGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 41112, 1, 2, 2, 1)).setObjects(("UBNT-AirMAX-MIB", "ubntStaName"), ("UBNT-AirMAX-MIB", "ubntStaSignal"), ("UBNT-AirMAX-MIB", "ubntStaNoiseFloor"), ("UBNT-AirMAX-MIB", "ubntStaDistance"), ("UBNT-AirMAX-MIB", "ubntStaCcq"), ("UBNT-AirMAX-MIB", "ubntStaAmp"), ("UBNT-AirMAX-MIB", "ubntStaAmq"), ("UBNT-AirMAX-MIB", "ubntStaAmc"), ("UBNT-AirMAX-MIB", "ubntStaLastIp"), ("UBNT-AirMAX-MIB", "ubntStaTxRate"), ("UBNT-AirMAX-MIB", "ubntStaRxRate"), ("UBNT-AirMAX-MIB", "ubntStaTxBytes"), ("UBNT-AirMAX-MIB", "ubntStaRxBytes"), ("UBNT-AirMAX-MIB", "ubntStaConnTime"), ("UBNT-AirMAX-MIB", "ubntStaLocalCINR"), ("UBNT-AirMAX-MIB", "ubntStaTxCapacity"), ("UBNT-AirMAX-MIB", "ubntStaRxCapacity"), ("UBNT-AirMAX-MIB", "ubntStaTxAirtime"), ("UBNT-AirMAX-MIB", "ubntStaRxAirtime"), ("UBNT-AirMAX-MIB", "ubntStaTxLatency"), ("UBNT-AirMAX-MIB", "ubntRadioMode"), ("UBNT-AirMAX-MIB", "ubntRadioCCode"), ("UBNT-AirMAX-MIB", "ubntRadioFreq"), ("UBNT-AirMAX-MIB", "ubntRadioDfsEnabled"), ("UBNT-AirMAX-MIB", "ubntRadioTxPower"), ("UBNT-AirMAX-MIB", "ubntRadioDistance"), ("UBNT-AirMAX-MIB", "ubntRadioChainmask"), ("UBNT-AirMAX-MIB", "ubntRadioAntenna"), ("UBNT-AirMAX-MIB", "ubntRadioRssi"), ("UBNT-AirMAX-MIB", "ubntRadioRssiMgmt"), ("UBNT-AirMAX-MIB", "ubntRadioRssiExt"), ("UBNT-AirMAX-MIB", "ubntAirMaxEnabled"), ("UBNT-AirMAX-MIB", "ubntAirMaxQuality"), ("UBNT-AirMAX-MIB", "ubntAirMaxCapacity"), ("UBNT-AirMAX-MIB", "ubntAirMaxPriority"), ("UBNT-AirMAX-MIB", "ubntAirMaxNoAck"), ("UBNT-AirMAX-MIB", "ubntAirSyncMode"), ("UBNT-AirMAX-MIB", "ubntAirSyncCount"), ("UBNT-AirMAX-MIB", "ubntAirSyncDownUtil"), ("UBNT-AirMAX-MIB", "ubntAirSyncUpUtil"), ("UBNT-AirMAX-MIB", "ubntAirSelEnabled"), ("UBNT-AirMAX-MIB", "ubntAirSelInterval"), ("UBNT-AirMAX-MIB", "ubntWlStatSsid"), ("UBNT-AirMAX-MIB", "ubntWlStatHideSsid"), ("UBNT-AirMAX-MIB", "ubntWlStatApMac"), ("UBNT-AirMAX-MIB", "ubntWlStatSignal"), ("UBNT-AirMAX-MIB", "ubntWlStatRssi"), ("UBNT-AirMAX-MIB", "ubntWlStatCcq"), ("UBNT-AirMAX-MIB", "ubntWlStatNoiseFloor"), ("UBNT-AirMAX-MIB", "ubntWlStatTxRate"), ("UBNT-AirMAX-MIB", "ubntWlStatRxRate"), ("UBNT-AirMAX-MIB", "ubntWlStatSecurity"), ("UBNT-AirMAX-MIB", "ubntWlStatWdsEnabled"), ("UBNT-AirMAX-MIB", "ubntWlStatApRepeater"), ("UBNT-AirMAX-MIB", "ubntWlStatChanWidth"), ("UBNT-AirMAX-MIB", "ubntWlStatStaCount")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ubntAirMAXStatusGroup = ubntAirMAXStatusGroup.setStatus('current') if mibBuilder.loadTexts: ubntAirMAXStatusGroup.setDescription('Status and statistics for AirMax monitoring') ubntAirMAXStatusCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 41112, 1, 2, 2, 2)).setObjects(("UBNT-AirMAX-MIB", "ubntAirMAXStatusGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ubntAirMAXStatusCompliance = ubntAirMAXStatusCompliance.setStatus('current') if mibBuilder.loadTexts: ubntAirMAXStatusCompliance.setDescription('The compliance statement for Ubiquiti AirMax entities.') mibBuilder.exportSymbols("UBNT-AirMAX-MIB", ubntStaRxBytes=ubntStaRxBytes, ubntWlStatIndex=ubntWlStatIndex, ubntWlStatNoiseFloor=ubntWlStatNoiseFloor, ubntStaName=ubntStaName, ubntStaTxLatency=ubntStaTxLatency, ubntAirMAX=ubntAirMAX, ubntStaAmp=ubntStaAmp, ubntWlStatStaCount=ubntWlStatStaCount, ubntRadioChainmask=ubntRadioChainmask, ubntAirSyncDownUtil=ubntAirSyncDownUtil, ubntRadioTxPower=ubntRadioTxPower, ubntWlStatSecurity=ubntWlStatSecurity, ubntStaDistance=ubntStaDistance, ubntStaNoiseFloor=ubntStaNoiseFloor, ubntWlStatTxRate=ubntWlStatTxRate, ubntStaRxCapacity=ubntStaRxCapacity, ubntWlStatHideSsid=ubntWlStatHideSsid, ubntRadioRssiMgmt=ubntRadioRssiMgmt, ubntAirSyncIfIndex=ubntAirSyncIfIndex, ubntRadioEntry=ubntRadioEntry, ubntStaEntry=ubntStaEntry, ubntAirSyncUpUtil=ubntAirSyncUpUtil, ubntStaRxAirtime=ubntStaRxAirtime, ubntAirSelEntry=ubntAirSelEntry, ubntRadioRssiExt=ubntRadioRssiExt, ubntWlStatRssi=ubntWlStatRssi, ubntRadioTable=ubntRadioTable, ubntRadioAntenna=ubntRadioAntenna, ubntStaTxCapacity=ubntStaTxCapacity, ubntRadioFreq=ubntRadioFreq, ubntWlStatEntry=ubntWlStatEntry, ubntStaTxRate=ubntStaTxRate, ubntAirMaxNoAck=ubntAirMaxNoAck, ubntStaSignal=ubntStaSignal, ubntAirSelInterval=ubntAirSelInterval, ubntWlStatRxRate=ubntWlStatRxRate, ubntRadioRssi=ubntRadioRssi, ubntAirMaxEnabled=ubntAirMaxEnabled, ubntWlStatApRepeater=ubntWlStatApRepeater, ubntWlStatChanWidth=ubntWlStatChanWidth, ubntRadioIndex=ubntRadioIndex, ubntAirSyncCount=ubntAirSyncCount, ubntAirMaxQuality=ubntAirMaxQuality, ubntAirMaxTable=ubntAirMaxTable, ubntStaTxBytes=ubntStaTxBytes, ubntRadioCCode=ubntRadioCCode, ubntAirMaxCapacity=ubntAirMaxCapacity, ubntRadioDistance=ubntRadioDistance, ubntStaConnTime=ubntStaConnTime, ubntAirMaxIfIndex=ubntAirMaxIfIndex, ubntStaAmq=ubntStaAmq, ubntAirSyncMode=ubntAirSyncMode, ubntRadioRssiTable=ubntRadioRssiTable, ubntStaLocalCINR=ubntStaLocalCINR, ubntWlStatWdsEnabled=ubntWlStatWdsEnabled, ubntStaAmc=ubntStaAmc, ubntRadioMode=ubntRadioMode, ubntWlStatTable=ubntWlStatTable, ubntAirSyncEntry=ubntAirSyncEntry, ubntWlStatCcq=ubntWlStatCcq, PYSNMP_MODULE_ID=ubntAirMAX, ubntAirMAXStatusGroup=ubntAirMAXStatusGroup, ubntWlStatSignal=ubntWlStatSignal, ubntAirMaxEntry=ubntAirMaxEntry, ubntStaMac=ubntStaMac, ubntAirSyncTable=ubntAirSyncTable, ubntWlStatSsid=ubntWlStatSsid, ubntWlStatApMac=ubntWlStatApMac, ubntStaRxRate=ubntStaRxRate, ubntRadioRssiEntry=ubntRadioRssiEntry, ubntAirSelIfIndex=ubntAirSelIfIndex, ubntRadioDfsEnabled=ubntRadioDfsEnabled, ubntRadioRssiIndex=ubntRadioRssiIndex, ubntAirSelTable=ubntAirSelTable, ubntStaLastIp=ubntStaLastIp, ubntAirMaxPriority=ubntAirMaxPriority, ubntStaTxAirtime=ubntStaTxAirtime, ubntAirSelEnabled=ubntAirSelEnabled, ubntAirMAXStatusCompliance=ubntAirMAXStatusCompliance, ubntStaCcq=ubntStaCcq, ubntStaTable=ubntStaTable)
109.079245
2,808
0.772366
3,224
28,906
6.924318
0.097395
0.014693
0.151451
0.014334
0.453682
0.290763
0.231231
0.216404
0.171116
0.170534
0
0.059772
0.079153
28,906
264
2,809
109.492424
0.778909
0.011209
0
0.011765
0
0
0.189725
0.002275
0
0
0
0
0
1
0
false
0
0.027451
0
0.027451
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
9cd0acd39332ff93528f39180077adf9cedb9132
7,621
py
Python
geokey/contributions/tests/media/test_models.py
universityofsussex/geokey
25e161dbc81841c57c148053dbe99facc81e84b8
[ "Apache-2.0" ]
null
null
null
geokey/contributions/tests/media/test_models.py
universityofsussex/geokey
25e161dbc81841c57c148053dbe99facc81e84b8
[ "Apache-2.0" ]
null
null
null
geokey/contributions/tests/media/test_models.py
universityofsussex/geokey
25e161dbc81841c57c148053dbe99facc81e84b8
[ "Apache-2.0" ]
null
null
null
"""Tests for models of contributions (media files).""" from django.test import TestCase from geokey.contributions.models import ( ImageFile, DocumentFile, VideoFile, AudioFile, post_save_count_update ) from geokey.contributions.tests.model_factories import ObservationFactory from geokey.contributions.tests.media.helpers.document_helpers import ( get_pdf_document ) from geokey.users.tests.model_factories import UserFactory from .model_factories import get_image class TestImageFilePostSave(TestCase): def test_post_save_image_file_count_update(self): observation = ObservationFactory() image_file = ImageFile.objects.create( name='Test name', description='Test Description', contribution=observation, creator=UserFactory.create(), image=get_image() ) ImageFile.objects.create( status='deleted', name='Test name', description='Test Description', contribution=observation, creator=UserFactory.create(), image=get_image() ) post_save_count_update( ImageFile, instance=image_file, created=True) observation.refresh_from_db() self.assertEqual(observation.num_media, 1) self.assertEqual(observation.num_comments, 0) class ImageFileTest(TestCase): def test_get_type_name(self): image_file = ImageFile.objects.create( name='Test name', description='Test Description', contribution=ObservationFactory.create(), creator=UserFactory.create(), image=get_image() ) self.assertEqual(image_file.type_name, 'ImageFile') def test_delete_file(self): image_file = ImageFile.objects.create( name='Test name', description='Test Description', contribution=ObservationFactory.create(), creator=UserFactory.create(), image=get_image() ) image_file.delete() self.assertEqual(image_file.status, 'deleted') class TestDocumentFilePostSave(TestCase): def test_post_save_document_file_count_update(self): observation = ObservationFactory() document_file = DocumentFile.objects.create( name='Test name', description='Test Description', contribution=observation, creator=UserFactory.create(), document=get_pdf_document() ) DocumentFile.objects.create( status='deleted', name='Test name', description='Test Description', contribution=observation, creator=UserFactory.create(), document=get_pdf_document() ) post_save_count_update( DocumentFile, instance=document_file, created=True) observation.refresh_from_db() self.assertEqual(observation.num_media, 1) self.assertEqual(observation.num_comments, 0) class DocumentFileTest(TestCase): def test_get_type_name(self): document_file = DocumentFile.objects.create( name='Test name', description='Test Description', contribution=ObservationFactory.create(), creator=UserFactory.create(), document=get_pdf_document() ) self.assertEqual(document_file.type_name, 'DocumentFile') def test_delete_file(self): document_file = DocumentFile.objects.create( name='Test name', description='Test Description', contribution=ObservationFactory.create(), creator=UserFactory.create(), document=get_pdf_document() ) document_file.delete() self.assertEquals(document_file.status, 'deleted') class TestVideoFilePostSave(TestCase): def test_post_save_video_file_count_update(self): observation = ObservationFactory() video_file = VideoFile.objects.create( name='Test name', description='Test Description', contribution=observation, creator=UserFactory.create(), video=get_image(), youtube_link='http://example.com/1122323', swf_link='http://example.com/1122323.swf' ) VideoFile.objects.create( status='deleted', name='Test name', description='Test Description', contribution=observation, creator=UserFactory.create(), video=get_image(), youtube_link='http://example.com/1122323', swf_link='http://example.com/1122323.swf' ) post_save_count_update( VideoFile, instance=video_file, created=True) observation.refresh_from_db() self.assertEqual(observation.num_media, 1) self.assertEqual(observation.num_comments, 0) class VideoFileTest(TestCase): def test_get_type_name(self): video_file = VideoFile.objects.create( name='Test name', description='Test Description', contribution=ObservationFactory.create(), creator=UserFactory.create(), video=get_image(), youtube_link='http://example.com/1122323', swf_link='http://example.com/1122323.swf' ) self.assertEqual(video_file.type_name, 'VideoFile') def test_delete_file(self): video_file = VideoFile.objects.create( name='Test name', description='Test Description', contribution=ObservationFactory.create(), creator=UserFactory.create(), video=get_image(), youtube_link='http://example.com/1122323', swf_link='http://example.com/1122323.swf' ) video_file.delete() self.assertEqual(video_file.status, 'deleted') class TestAudioFilePostSave(TestCase): def test_post_save_audio_file_count_update(self): observation = ObservationFactory() audio_file = AudioFile.objects.create( name='Test name', description='Test Description', contribution=observation, creator=UserFactory.create(), audio=get_image() ) AudioFile.objects.create( status='deleted', name='Test name', description='Test Description', contribution=observation, creator=UserFactory.create(), audio=get_image() ) post_save_count_update( AudioFile, instance=audio_file, created=True) observation.refresh_from_db() self.assertEqual(observation.num_media, 1) self.assertEqual(observation.num_comments, 0) class AudioFileTest(TestCase): def test_get_type_name(self): audio_file = AudioFile.objects.create( name='Test name', description='Test Description', contribution=ObservationFactory.create(), creator=UserFactory.create(), audio=get_image() ) self.assertEqual(audio_file.type_name, 'AudioFile') def test_delete_file(self): audio_file = AudioFile.objects.create( name='Test name', description='Test Description', contribution=ObservationFactory.create(), creator=UserFactory.create(), audio=get_image() ) audio_file.delete() self.assertEqual(audio_file.status, 'deleted')
32.849138
73
0.618685
707
7,621
6.468175
0.104668
0.045484
0.041986
0.080472
0.753991
0.719003
0.668708
0.645965
0.645965
0.645965
0
0.011758
0.285789
7,621
231
74
32.991342
0.828403
0.006298
0
0.683417
0
0
0.095018
0
0
0
0
0
0.080402
1
0.060302
false
0
0.030151
0
0.130653
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
9cd6782e5487c270abc97df953a502531040d959
1,021
py
Python
leetcode/1-easy/8-math/3-powerthree/power_three.py
ai7/study
be490336dc70ade62a8ff8d7866af7ac52bef4c1
[ "MIT" ]
null
null
null
leetcode/1-easy/8-math/3-powerthree/power_three.py
ai7/study
be490336dc70ade62a8ff8d7866af7ac52bef4c1
[ "MIT" ]
null
null
null
leetcode/1-easy/8-math/3-powerthree/power_three.py
ai7/study
be490336dc70ade62a8ff8d7866af7ac52bef4c1
[ "MIT" ]
null
null
null
# https://leetcode.com/explore/interview/card/top-interview-questions-easy/102/math/745/ # https://leetcode.com/problems/power-of-three/description/ # Power of Three # # Given an integer, write a function to determine if it is a power of three. # ie, 45 % 3 is 0, but 45 is not power of 3 # so it is not simply "n % 3 == 0" haha class Solution: def isPowerOfThree(self, n): """ :type n: int :rtype: bool """ return self.check1_divide(n) # option1: loop iteration: keep divide by 3 until 1 def check1_divide(self, n): if n < 1: return False while n % 3 == 0: n //= 3 return n == 1 # option2: convert to base 3, and ensure it is like 10000... # option3, log(n)/log(3) should be integer, tricky to implement # option4: integer limitation def check4_int_limit(self, n): # 1162261467 = pow(3, 19), or 3^19, the highest n power of n for 32bit int return n > 0 and 1162261467 % n == 0
26.179487
88
0.60431
158
1,021
3.879747
0.531646
0.057096
0.058728
0
0
0
0
0
0
0
0
0.090784
0.287953
1,021
38
89
26.868421
0.752407
0.600392
0
0
0
0
0
0
0
0
0
0
0
1
0.272727
false
0
0
0.090909
0.727273
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
9cd9ad024484470294c0aa56c5252f55d478d042
5,480
py
Python
python-cim/samples/ui/tree.py
pombredanne/flare-wmi
fdde184b7bf98e1043f8246e0c75a7a1316c48c9
[ "Apache-2.0" ]
390
2015-08-06T20:33:01.000Z
2021-09-11T21:43:34.000Z
python-cim/samples/ui/tree.py
pombredanne/flare-wmi
fdde184b7bf98e1043f8246e0c75a7a1316c48c9
[ "Apache-2.0" ]
15
2015-08-11T18:02:10.000Z
2019-08-11T10:16:49.000Z
python-cim/samples/ui/tree.py
pombredanne/flare-wmi
fdde184b7bf98e1043f8246e0c75a7a1316c48c9
[ "Apache-2.0" ]
106
2015-08-08T22:44:50.000Z
2021-08-25T09:20:57.000Z
from collections import namedtuple from PyQt5.QtCore import Qt from PyQt5.QtCore import QModelIndex from PyQt5.QtCore import QAbstractItemModel class Item(object): """ interface """ def __init__(self): pass def __repr__(self): raise NotImplementedError() @property def children(self): return [] @property def type(self): raise NotImplementedError() @property def name(self): raise NotImplementedError() class ListItem(Item): """ a node in a list of nodes whose children will be dynamically loaded """ def __init__(self, name, getter): super(ListItem, self).__init__() self._name = name self._getter = getter self._children = None def __repr__(self): return "ListItem(numChildren: {:s})".format(str(len(self.children))) def _getChildren(self): if self._children is None: self._children = sorted(self._getter(), key=lambda i: i.name()) return self._children @property def children(self): return self._getChildren() @property def type(self): return "" @property def name(self): return self._name class TestItem(Item): def __init__(self, name): super(TestItem, self).__init__() self._name = name @property def children(self): return [ TestItem(self._name + "1"), TestItem(self._name + "2"), TestItem(self._name + "3"), TestItem(self._name + "4"), ] @property def type(self): return "Test" @property def name(self): return self._name class TreeNode(object): """ adapter from Item to QAbstractItemModel interface """ def __init__(self, parent, data): super(TreeNode, self).__init__() self._parent = parent self._data = data self._children = None @property def parent(self): return self._parent @property def children(self): if self._children is None: self._children = [TreeNode(self, c) for c in self._data.children] return self._children @property def data(self): return self._data @property def row(self): if self._parent: return self._parent.children.index(self) return 0 _ColumnDef = namedtuple("ColumnDef", ["displayName", "attributeName", "formatter"]) def ColumnDef(displayName, attributeName, formatter=str): return _ColumnDef(displayName, attributeName, formatter) class TreeModel(QAbstractItemModel): """ adapter from Item to QAbstractItemModel interface """ def __init__(self, root, columns, parent=None): super(TreeModel, self).__init__(parent) self._root = TreeNode(None, root) self._columns = columns self._indexItems = {} # int to Item self._counter = 0 # index.internalPointer() is not working for me consistently, # so we keep track of live objects ourselves def _addIndexItem(self, index, item): self._indexItems[index.internalId()] = item def _getIndexItem(self, id_): return self._indexItems[id_] def _createIndex(self, row, column, item): i = self.createIndex(row, column, item) self._addIndexItem(i, item) return i def columnCount(self, parent): return len(self._columns) def flags(self, index): if not index.isValid(): return Qt.NoItemFlags return Qt.ItemIsEnabled | Qt.ItemIsSelectable def headerData(self, section, orientation, role): if orientation == Qt.Horizontal and role == Qt.DisplayRole: return self._columns[section].displayName return None def data(self, index, role): if not index.isValid(): return None if role != Qt.DisplayRole: return None item = self._getIndexItem(index.internalId()) coldef = self._columns[index.column()] return coldef.formatter(getattr(item.data, coldef.attributeName)) def index(self, row, column, parent): if not self.hasIndex(row, column, parent): return QModelIndex() if not parent.isValid(): parentItem = self._root else: parentItem = self._getIndexItem(parent.internalId()) childItem = parentItem.children[row] if childItem: return self._createIndex(row, column, childItem) else: return QModelIndex() def parent(self, index): if not index.isValid(): return QModelIndex() childItem = self._getIndexItem(index.internalId()) parentItem = childItem.parent if parentItem == self._root: return QModelIndex() return self._createIndex(parentItem.row, 0, parentItem) def rowCount(self, parent): if parent.column() > 0: return 0 if not parent.isValid(): parentItem = self._root else: parentItem = self._getIndexItem(parent.internalId()) return len(parentItem.children) def getIndexData(self, itemIndex): """ since we're hacking at the index data storage, need to provide an accessor. bad design to force the receiver of the index to have a reference to the model :-(. """ return self._getIndexItem(itemIndex.internalId()).data
25.7277
83
0.613869
589
5,480
5.544992
0.229202
0.043784
0.01684
0.028169
0.244948
0.148806
0.148806
0.12921
0.083895
0.050214
0
0.003075
0.287774
5,480
212
84
25.849057
0.833718
0.084124
0
0.406897
0
0
0.015571
0.004247
0
0
0
0
0
1
0.227586
false
0.006897
0.027586
0.089655
0.524138
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
9ce306fc2d47f27c0de686398ed4a73a2f71ad87
743
py
Python
lepmlutils/pdutils/typetfm.py
Lewington-pitsos/mlutils
c92322a8a2fc0b5342d44b0d92051a93c6eede44
[ "MIT" ]
null
null
null
lepmlutils/pdutils/typetfm.py
Lewington-pitsos/mlutils
c92322a8a2fc0b5342d44b0d92051a93c6eede44
[ "MIT" ]
null
null
null
lepmlutils/pdutils/typetfm.py
Lewington-pitsos/mlutils
c92322a8a2fc0b5342d44b0d92051a93c6eede44
[ "MIT" ]
null
null
null
from .transform import Transform from .taggeddataframe import TaggedDataFrame from .coltag import ColTag from .help import all_cols_except from typing import List import pandas as pd # TypeTfm transforms the type of the given columns to # the given pandas type. class TypeTfm(Transform): def __init__(self, to_convert: List[str], data_type): self.to_convert = to_convert self.type = data_type def operate(self, df: TaggedDataFrame) -> None: for name in self.to_convert: df.frame[name] = df.frame[name].astype(self.type) df.tag_column(name, ColTag.modified) # Alias for operate. def re_operate(self, new_df: TaggedDataFrame) -> None: self.operate(new_df)
30.958333
61
0.695828
102
743
4.911765
0.421569
0.071856
0.077844
0
0
0
0
0
0
0
0
0
0.224764
743
23
62
32.304348
0.869792
0.126514
0
0
0
0
0
0
0
0
0
0
0
1
0.1875
false
0
0.375
0
0.625
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
9ce4833c3fa42b51c58f681ecc0f2f6df01ca194
6,353
py
Python
app_common/scimath/tests/test_more_units.py
KBIbiopharma/app_common
bd913e24741fb070aad058a0f90cbb2c64d8b106
[ "MIT" ]
2
2020-02-12T17:51:13.000Z
2021-05-03T05:36:15.000Z
app_common/scimath/tests/test_more_units.py
KBIbiopharma/app_common
bd913e24741fb070aad058a0f90cbb2c64d8b106
[ "MIT" ]
30
2020-02-04T21:38:58.000Z
2021-05-25T20:55:01.000Z
app_common/scimath/tests/test_more_units.py
KBIbiopharma/app_common
bd913e24741fb070aad058a0f90cbb2c64d8b106
[ "MIT" ]
null
null
null
""" Tests for the utility functions in more_units module. """ from unittest import TestCase from scimath.units.api import dimensionless, UnitScalar, UnitArray from scimath.units import mass, substance from app_common.scimath.assertion_utils import assert_unit_array_almost_equal,\ assert_unit_scalar_almost_equal from app_common.scimath import more_units from app_common.scimath.units_utils import convert_units class TestVolumeUnits(TestCase): # Tests ------------------------------------------------------------------- def test_column_volume(self): vol = UnitScalar(1, units=more_units.column_volumes) self.assertIsInstance(vol, UnitScalar) unit = more_units.column_volumes # It's dimensionless since it's a ratio of volumes: self.assertEqual(unit.derivation, dimensionless.derivation) self.assertEqual(unit.label, "CV") def test_parse_column_volume_label(self): vol = UnitScalar(1, units="CV") vol2 = UnitScalar(1, units=more_units.column_volumes) assert_unit_scalar_almost_equal(vol, vol2) def test_g_per_liter_resin(self): vol = UnitScalar(1, units=more_units.g_per_liter_resin) self.assertIsInstance(vol, UnitScalar) # It's dimensionless since custom and dimensions meaningless: unit = more_units.g_per_liter_resin self.assertEqual(unit.derivation, dimensionless.derivation) self.assertIn("g", unit.label) self.assertIn("L", unit.label) self.assertIn("resin", unit.label) def test_parse_g_per_liter_resin_label(self): vol = UnitScalar(1, units="g/Liter_resin") vol2 = UnitScalar(1, units=more_units.g_per_liter_resin) assert_unit_scalar_almost_equal(vol, vol2) def test_g_per_liter_resin_to_cv(self): concentration = UnitScalar(8.03, units="g/L") vol = UnitScalar(0.0635, units=more_units.g_per_liter_resin) # without a concentration, the conversion is impossible: with self.assertRaises(ValueError): convert_units(vol, tgt_unit="CV") new_vol = convert_units(vol, tgt_unit="CV", concentration=concentration) expected = UnitScalar(0.0635 / 8.03, units="CV") assert_unit_scalar_almost_equal(new_vol, expected) def test_g_per_liter_resin_to_cv_conc_units(self): """ g/L_resin -> CV, passing concentration in different unit. """ concentration = UnitScalar(8030, units="g/m**3") vol = UnitScalar(0.0635, units=more_units.g_per_liter_resin) expected = UnitScalar(0.0635/8.03, units="CV") new_vol = convert_units(vol, tgt_unit="CV", concentration=concentration) assert_unit_scalar_almost_equal(new_vol, expected) def test_cv_to_g_per_liter_resin(self): concentration = UnitScalar(8.03, units="g/L") # 0.0635/8.03 vol = UnitScalar(0.007907845579078457, units="CV") # without a concentration, the conversion is impossible: with self.assertRaises(ValueError): convert_units(vol, tgt_unit=more_units.g_per_liter_resin) expected = UnitScalar(0.0635, units=more_units.g_per_liter_resin) new_vol = convert_units(vol, tgt_unit=more_units.g_per_liter_resin, concentration=concentration) assert_unit_scalar_almost_equal(new_vol, expected) class TestAbsorptionUnit(TestCase): def test_au_to_milli_au(self): x = UnitArray([1, 2, 3], units=more_units.absorption_unit) conv_data = convert_units(x, more_units.milli_absorption_unit) expected = UnitArray([1000, 2000, 3000], units=more_units.milli_absorption_unit) assert_unit_array_almost_equal(conv_data, expected) def test_milli_au_to_au(self): x = UnitArray([1000, 2000, 3000], units=more_units.milli_absorption_unit) conv_data = convert_units(x, more_units.absorption_unit) expected = UnitArray([1, 2, 3], units=more_units.absorption_unit) assert_unit_array_almost_equal(conv_data, expected) class TestMolecularWeightUnits(TestCase): def test_gram_per_mol(self): x = UnitArray([1000, 2000, 3000], units=more_units.gram_per_mol) expected = UnitArray([1000, 2000, 3000], units=mass.g / substance.mole) assert_unit_array_almost_equal(x, expected) y = UnitArray([1000, 2000, 3000], units="g/mol") assert_unit_array_almost_equal(y, expected) def test_gram_per_mol_to_kilo_per_mol(self): x = UnitArray([1000, 2000, 3000], units=more_units.gram_per_mol) expected = UnitArray([1, 2, 3], units=more_units.kilogram_per_mol) assert_unit_array_almost_equal(x, expected) def test_gram_per_mol_to_kilo_per_mol_str(self): y = UnitArray([1000, 2000, 3000], units="g/mol") expected = UnitArray([1, 2, 3], units="kg/mol") assert_unit_array_almost_equal(y, expected) def test_dalton(self): x = UnitArray([1000, 2000, 3000], units=more_units.gram_per_mol) expected = UnitArray([1000, 2000, 3000], units=more_units.dalton) assert_unit_array_almost_equal(x, expected) # This unit is equal but distinct: self.assertIsNot(more_units.dalton, more_units.gram_per_mol) y = UnitArray([1000, 2000, 3000], units="Da") assert_unit_array_almost_equal(y, expected) def test_kilo_dalton(self): x = UnitArray([1, 2, 3], units=more_units.kilo_dalton) expected = UnitArray([1, 2, 3], units=more_units.kilogram_per_mol) assert_unit_array_almost_equal(x, expected) # This unit is equal but distinct: self.assertIsNot(more_units.kilo_dalton, more_units.kilogram_per_mol) y = UnitArray([1, 2, 3], units="kDa") assert_unit_array_almost_equal(y, expected) def test_dalton_to_kilo_dalton(self): x = UnitArray([1000, 2000, 3000], units=more_units.dalton) expected = UnitArray([1, 2, 3], units=more_units.kilo_dalton) assert_unit_array_almost_equal(x, expected) def test_dalton_to_kilo_dalton_str(self): y = UnitArray([1000, 2000, 3000], units="Da") expected = UnitArray([1, 2, 3], units="kDa") assert_unit_array_almost_equal(y, expected)
42.925676
79
0.681096
846
6,353
4.801418
0.134752
0.070901
0.068932
0.067208
0.762678
0.725997
0.708272
0.621123
0.555145
0.45938
0
0.04988
0.211081
6,353
147
80
43.217687
0.760575
0.077759
0
0.428571
0
0
0.012673
0
0
0
0
0
0.295238
1
0.152381
false
0
0.057143
0
0.238095
0
0
0
0
null
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
9cf55ecddb0e7265a04e749dd74539aaa1de89cc
370
py
Python
neural_networks/config.py
kelvinducray/neural-networks
612c4f8c2eaa01d337b7e62007e5ac84182c1b58
[ "MIT" ]
null
null
null
neural_networks/config.py
kelvinducray/neural-networks
612c4f8c2eaa01d337b7e62007e5ac84182c1b58
[ "MIT" ]
null
null
null
neural_networks/config.py
kelvinducray/neural-networks
612c4f8c2eaa01d337b7e62007e5ac84182c1b58
[ "MIT" ]
null
null
null
from typing import Union from pydantic import BaseSettings class ProjectBaseSettings(BaseSettings): DATA_DIR: str = "./data/" GPU: str = "" # TODO - should this be dynamic? class FullyConnectedSettings(ProjectBaseSettings): BATCH_SIZE: int = 64 DATA_USE_SUBSET: bool = True # For type checking purposes: Settings = Union[FullyConnectedSettings]
19.473684
51
0.737838
41
370
6.560976
0.756098
0
0
0
0
0
0
0
0
0
0
0.006623
0.183784
370
18
52
20.555556
0.884106
0.156757
0
0
0
0
0.022654
0
0
0
0
0.055556
0
1
0
false
0
0.222222
0
0.888889
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
1
0
0
2
9cfea97772e0bc69c14dea51cad8b9b175e04dec
2,443
py
Python
src/engine/entity.py
xproj2501x/ecs-python
7947a9e8551c0f379ac59f57e0268b4054aaafae
[ "MIT" ]
null
null
null
src/engine/entity.py
xproj2501x/ecs-python
7947a9e8551c0f379ac59f57e0268b4054aaafae
[ "MIT" ]
null
null
null
src/engine/entity.py
xproj2501x/ecs-python
7947a9e8551c0f379ac59f57e0268b4054aaafae
[ "MIT" ]
null
null
null
import uuid class Entity: @property def id(self): """ Read only property :return: The id of the entity. :rtype: string """ return self._id def __init__(self, entity_id): """ Constructor :param entity_id: The identifier for the entity :type entity_id: str """ if not entity_id: raise Exception('Entity id cannot be null') self._id = entity_id self._components = {} def attach_component(self, component_type, component): """ :param component_type: The type of component to be attached :type component_type: str :param component: The component to be attached :type component: Component """ if self.has_component(component_type): raise Exception('Component type ' + component_type + ' already attached to entity ' + self._id) self._components[type] = component def has_component(self, component_type): """ :param component_type: The type of component :type component_type: str :return: :rtype: bool """ return component_type in self._components def get_component(self, component_type): """ :param component_type: The type of component :type component_type: str :return: The component of specified type :rtype: Component """ if not self.has_component(component_type): raise Exception('Component type ' + component_type + ' not attached to entity ' + self._id) return self._components[component_type] def detach_component(self, component_type): """ :param component_type: The type of component :type component_type: str """ if not self.has_component(component_type): raise Exception('Component type ' + component_type + ' not attached to entity ' + self._id) del self._components[component_type] @staticmethod def create(entity_id=None): """ Static factory method :param entity_id: The id for the entity :type entity_id: str :return: The created entity :rtype: Entity """ entity_id = entity_id if entity_id else uuid.uuid4() return Entity(entity_id)
29.083333
108
0.58289
267
2,443
5.131086
0.191011
0.256204
0.112409
0.113869
0.508029
0.491971
0.448905
0.383212
0.383212
0.383212
0
0.00062
0.339746
2,443
83
109
29.433735
0.848729
0.297994
0
0.142857
0
0
0.109682
0
0
0
0
0
0
1
0.25
false
0
0.035714
0
0.464286
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
2
14204c192bc47807b3b1a4acef589cabafdae20d
4,296
py
Python
creational/builder/builder_1.py
software-foundations/design-patterns
db3a04cb17ab2d1d1b3c7d4c0df548c08659390b
[ "MIT" ]
null
null
null
creational/builder/builder_1.py
software-foundations/design-patterns
db3a04cb17ab2d1d1b3c7d4c0df548c08659390b
[ "MIT" ]
null
null
null
creational/builder/builder_1.py
software-foundations/design-patterns
db3a04cb17ab2d1d1b3c7d4c0df548c08659390b
[ "MIT" ]
null
null
null
from __future__ import annotations from abc import ABC, abstractmethod from typing import List class StringReprMixin: def __str__(self) -> str: params = ', '.join( [f'{k}={v}' for k, v in self.__dict__.items()] ) return f'{self.__class__.__name__}({params})' def __repr__(self) -> str: return self.__str__() # Class to be instantiated class User(StringReprMixin): def __init__(self) -> None: self.firstname: str = None self.lastname: str = None self.age: int = None self.phone_numbers: List = [] self.addresses: List = [] # Interface of User Builder # Interface/Abstract class has abstract methods # Doesn't have __init__ because it is an interface/abstract class class IUserBuilder(ABC): """ Methods to be specializated by the builder instance """ @property @abstractmethod def result(self) -> User: pass @abstractmethod def add_firstname(self, firstname) -> UserBuilder: pass @abstractmethod def add_lastname(self, lastname) -> UserBuilder: pass @abstractmethod def add_age(self, age) -> UserBuilder: pass @abstractmethod def add_phone(self, phone) -> UserBuilder: pass @abstractmethod def add_address(self, address) -> UserBuilder: pass # Builder of User class UserBuilder(IUserBuilder): def __init__(self) -> None: self.reset() def reset(self) -> None: self._result = User() # The user instance to be returned @property def result(self) -> User: # overrides the result of the abstract class """ Every time it is called, return the User instance itself and instantiate a new User object and storage it in the self._result (agregation, a kind of association) """ return_data = self._result self.reset() # Reset The User instance to be returned return return_data """ implement the abstract methods defined in IUserBuilder(ABC) with the same signature """ """ return self -> it is to anable to chain methods at the UserDirector class (a kind of an User class, not a subclass) Returning the object, it is possible to invoque other methods in chain at the same object """ def add_firstname(self, firstname) -> UserBuilder: self._result.firstname = firstname return self def add_lastname(self, lastname) -> UserBuilder: self._result.lastname = lastname return self def add_age(self, age) -> UserBuilder: self._result.age = age return self def add_phone(self, phone) -> UserBuilder: self._result.phone_numbers.append(phone) return self def add_address(self, address) -> UserBuilder: self._result.addresses.append(address) return self # Instantiate a Directory User (kind of User, but not a subclass of user) class UserDirector: def __init__(self, builder: UserBuilder) -> None: self._builder = builder # Receives the builder of the user # Returns a User (of Directory kind) with age def with_age(self, firstname, lastname, age) -> User: # chaining methods (obj.method1.method2 ...) self._builder.add_firstname(firstname)\ .add_lastname(lastname)\ .add_age(age) return self._builder.result # return the object creacted with firstname, last_name and age and clear it of the memory of the UserBuilder instance (in fact, remove the recently created and create a new empty User instance) # Returns a User (of Director kind) with address def with_address(self, firstname, lastname, address) -> User: # chaining methods (obj.method1.method2 ...) self._builder.add_firstname(firstname)\ .add_lastname(lastname)\ .add_address(address) return self._builder.result if __name__ == "__main__": user_builder = UserBuilder() # The builder of the user user_director = UserDirector(user_builder) # The builder of the Director user1 = user_director.with_age('Luiz', 'Otávio', 30) # Build a Director User with age user2 = user_director.with_address('Maria', 'Miranda', 'Av Brasil') # Build a Director user with address print(user1) print(user2)
33.302326
229
0.665503
536
4,296
5.156716
0.23694
0.021708
0.037988
0.043415
0.276411
0.206946
0.065123
0.065123
0.065123
0.065123
0
0.003094
0.247672
4,296
128
230
33.5625
0.852104
0.257449
0
0.298701
0
0
0.02977
0.012554
0
0
0
0
0
1
0.25974
false
0.077922
0.038961
0.012987
0.493506
0.025974
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
2
142ac8d77d7c7fc09779b03d38ac728b02b8328e
92
py
Python
Chapter12/listing12-2.py
TYRMars/PythonLearn
573c8d0b94b890924942e6ba7882eaf73597fb63
[ "MIT" ]
null
null
null
Chapter12/listing12-2.py
TYRMars/PythonLearn
573c8d0b94b890924942e6ba7882eaf73597fb63
[ "MIT" ]
null
null
null
Chapter12/listing12-2.py
TYRMars/PythonLearn
573c8d0b94b890924942e6ba7882eaf73597fb63
[ "MIT" ]
1
2018-08-23T14:41:32.000Z
2018-08-23T14:41:32.000Z
import wx app = wx.App() win = wx.Frame(None) btn = wx.Button(win) win.Show() app.MainLoop()
15.333333
20
0.673913
17
92
3.647059
0.588235
0.16129
0
0
0
0
0
0
0
0
0
0
0.130435
92
6
21
15.333333
0.775
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
14406ac0fc99fe7615da84cc9bf1c56b8ebc8a52
449
py
Python
P05/ex04_rand.py
ChanganXLTZ/project_test
b6aa323de105beb6281045bf7b89ed3857ed3d9f
[ "CNRI-Python" ]
1
2018-09-16T13:51:06.000Z
2018-09-16T13:51:06.000Z
P05/ex04_rand.py
ChanganXLTZ/project_test
b6aa323de105beb6281045bf7b89ed3857ed3d9f
[ "CNRI-Python" ]
null
null
null
P05/ex04_rand.py
ChanganXLTZ/project_test
b6aa323de105beb6281045bf7b89ed3857ed3d9f
[ "CNRI-Python" ]
null
null
null
# -*- coding:UTF-8 -*- #! /usr/bin/python3 import random list_a = [1,2,3,4,1,2,3,4,5,1,4,3,4,1,10] print(range(10)) print('将range(10)转化成数组:',list(range(10))) print(random.choice(list_a)) print(random.choice(range(10))) # print(random.randrange(-10,10,1.5)) # randrange ([start,] stop [,step]) print(random.random()) # 随机生成下一个实数,它在[0,1)范围内。 print(random.shuffle(list_a)) # 将序列的所有元素随机排序。 print(random.uniform(-10,10)) # 随机生成实数,它在[x,y]范围内。
34.538462
74
0.66147
80
449
3.675
0.4375
0.22449
0.122449
0.027211
0
0
0
0
0
0
0
0.093596
0.095768
449
13
75
34.538462
0.630542
0.365256
0
0
0
0
0.06015
0
0
0
0
0
0
1
0
false
0
0.111111
0
0.111111
0.777778
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
2
1464db94121c08fb6e66462812bad6e9f8c738c2
1,103
py
Python
tests/test_pairwisevariationmphf.py
iqbal-lab-org/pangenome_variations
0aa8f5233bb2130b1876a5197f3ffbe7c3830601
[ "MIT" ]
null
null
null
tests/test_pairwisevariationmphf.py
iqbal-lab-org/pangenome_variations
0aa8f5233bb2130b1876a5197f3ffbe7c3830601
[ "MIT" ]
9
2021-03-30T12:28:36.000Z
2022-01-13T03:28:10.000Z
tests/test_pairwisevariationmphf.py
iqbal-lab-org/pangenome_variations
0aa8f5233bb2130b1876a5197f3ffbe7c3830601
[ "MIT" ]
1
2020-11-04T15:13:30.000Z
2020-11-04T15:13:30.000Z
from unittest import TestCase from src.PairwiseVariationMPHF import PairwiseVariationMPHF from src.PairwiseVariation import PairwiseVariation class TestPairwiseVariationMPHF(TestCase): def test___get_pairwise_variation_id_to_alleles_id(self): mphf = PairwiseVariationMPHF() pairwise_variation_1 = PairwiseVariation(0, 1) pairwise_variation_2 = PairwiseVariation(1, 2) pairwise_variation_3 = PairwiseVariation(2, 3) mphf.add_object(pairwise_variation_1) mphf.add_object(pairwise_variation_1) mphf.add_object(pairwise_variation_3) mphf.add_object(pairwise_variation_1) mphf.add_object(pairwise_variation_2) mphf.add_object(pairwise_variation_3) mphf.add_object(pairwise_variation_1) actual_pairwise_variation_id_to_alleles_id = mphf.get_pairwise_variation_id_to_alleles_id() expected_pairwise_variation_id_to_alleles_id = [(0,1), (2,3), (1,2)] self.assertListEqual(actual_pairwise_variation_id_to_alleles_id, expected_pairwise_variation_id_to_alleles_id)
42.423077
99
0.760653
133
1,103
5.81203
0.210526
0.351876
0.117723
0.190168
0.557568
0.557568
0.557568
0.456662
0.456662
0.456662
0
0.024309
0.17951
1,103
26
100
42.423077
0.829834
0
0
0.3
0
0
0
0
0
0
0
0
0.05
1
0.05
false
0
0.15
0
0.25
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
1467bc21802ec6c989f2f71c5b189577e8dabb00
509
py
Python
database.py
shivanshthapliyal/Pharmaceutical-Management-System
a442c7179896d6e381a082f3d90bc98c10ed4187
[ "Unlicense" ]
8
2018-07-29T08:57:07.000Z
2022-02-12T23:24:06.000Z
database.py
shivanshthapliyal/Pharmaceutical-Management-System
a442c7179896d6e381a082f3d90bc98c10ed4187
[ "Unlicense" ]
null
null
null
database.py
shivanshthapliyal/Pharmaceutical-Management-System
a442c7179896d6e381a082f3d90bc98c10ed4187
[ "Unlicense" ]
12
2018-08-01T13:38:01.000Z
2021-12-20T08:32:03.000Z
''' Created on 07-Aug-2018 @author: Shivansh Thapliyal ''' import pymysql class database: conn=None curs=None @staticmethod def connection(): database.conn = pymysql.connect(user='root', password='root', database='pharmacy') return database.conn @staticmethod def cursor(): database.curs=database.conn.cursor() return database.curs @staticmethod def close(): database.curs.close() database.conn.close()
21.208333
91
0.611002
52
509
5.980769
0.5
0.192926
0
0
0
0
0
0
0
0
0
0.016304
0.277014
509
23
92
22.130435
0.828804
0.100196
0
0.1875
0
0
0.037471
0
0
0
0
0
0
1
0.1875
false
0.0625
0.0625
0
0.5625
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
2
1478f74165081735ebd509ebbbb979b80886e4a8
21,929
py
Python
src/setprogramoptions/unittests/test_SetProgramOptions.py
sandialabs/SetProgramOptions
c0b3cec0e2309d726f450b449c080a33e7df3092
[ "BSD-3-Clause" ]
1
2021-12-21T21:53:26.000Z
2021-12-21T21:53:26.000Z
src/setprogramoptions/unittests/test_SetProgramOptions.py
sandialabs/SetProgramOptions
c0b3cec0e2309d726f450b449c080a33e7df3092
[ "BSD-3-Clause" ]
null
null
null
src/setprogramoptions/unittests/test_SetProgramOptions.py
sandialabs/SetProgramOptions
c0b3cec0e2309d726f450b449c080a33e7df3092
[ "BSD-3-Clause" ]
3
2021-12-27T18:29:04.000Z
2022-01-31T14:08:41.000Z
#!/usr/bin/env python3 # -*- mode: python; py-indent-offset: 4; py-continuation-offset: 4 -*- #=============================================================================== # # License (3-Clause BSD) # ---------------------- # Copyright 2021 National Technology & Engineering Solutions of Sandia, # LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, # the U.S. Government retains certain rights in this software. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following # disclaimer in the documentation and/or other materials provided # with the distribution. # # 3. Neither the name of the copyright holder nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #=============================================================================== """ """ from __future__ import print_function import sys sys.dont_write_bytecode = True import os sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from pprint import pprint import unittest from unittest import TestCase # Coverage will always miss one of these depending on the system # and what is available. try: # pragma: no cover import unittest.mock as mock # pragma: no cover except: # pragma: no cover import mock # pragma: no cover from mock import Mock from mock import MagicMock from mock import patch import filecmp from textwrap import dedent try: from cStringIO import StringIO except ImportError: from io import StringIO from configparserenhanced import HandlerParameters from setprogramoptions import * from .common import * # =============================================================================== # # General Utility Functions # # =============================================================================== global_gen_new_ground_truth_files = False # global_gen_new_ground_truth_files = True # comment this out for production. # =============================================================================== # # General Utility Functions # # =============================================================================== # =============================================================================== # # Mock Helpers # # =============================================================================== # =============================================================================== # # Tests # # =============================================================================== class SetProgramOptionsTest(TestCase): """ Main test driver for the SetProgramOptions class """ def setUp(self): print("") self.maxDiff = None self._filename = find_config_ini(filename="config_test_setprogramoptions.ini") # Get the location of the unit testing scripts (for file writing tests) unit_test_path = os.path.realpath(__file__) self.unit_test_file = os.path.basename(unit_test_path) self.unit_test_path = os.path.dirname(unit_test_path) return def test_SetProgramOptions_Template(self): """ Basic template test for SetProgramOptions. This test doesn't really validate any output -- it just runs a basic check. """ print("\n") print("Load file: {}".format(self._filename)) parser = SetProgramOptions(self._filename) parser.debug_level = 5 parser.exception_control_level = 4 parser.exception_control_compact_warnings = False print("-----[ TEST BEGIN ]----------------------------------------") section = "TEST_OPTION_REMOVAL_VARIABLES" print("Section : {}".format(section)) # parse a section print("-" * 40) print("Execute Parser") print("-" * 40) data = parser.parse_section(section) # pretty print the output print("-" * 40) print("Data") print("-" * 40) pprint(data, width=120) # pretty print the loginfo print("-" * 40) print("LogInfo") print("-" * 40) parser._loginfo_print() # pretty print the options data print("-" * 40) print("Options") print("-" * 40) pprint(parser.options, width=120) # pretty print the options list print("-" * 40) print("Options List") print("-" * 40) pprint(parser.gen_option_list(section, generator='bash'), width=120) print("-----[ TEST END ]------------------------------------------") print("OK") return 0 def test_SetProgramOptions_property_inifilepath(self): """ Runs a check that loads the filename using `inifilepath` property rather than the parameter in the c'tor. """ print("\n") print("Load file: {}".format(self._filename)) parser = SetProgramOptions() parser.debug_level = 5 parser.exception_control_level = 4 parser.exception_control_compact_warnings = False parser.inifilepath = self._filename print("-----[ TEST BEGIN ]----------------------------------------") # parse all sections print("-" * 40) print("Execute Parser") print("-" * 40) sections = parser.configparserenhanceddata.sections(parse=False) self.assertGreater(len(sections), 2) print("-----[ TEST END ]------------------------------------------") print("OK") return 0 def test_SetProgramOptions_property_options_setter(self): """ Test the ``setter`` for property: ``options`` """ print("\n") print("Load file: {}".format(self._filename)) parser = SetProgramOptions(self._filename) parser.debug_level = 5 parser.exception_control_level = 4 parser.exception_control_compact_warnings = False print("-----[ TEST BEGIN ]----------------------------------------") # Set options to a valid type new_options_value = {} parser.options = new_options_value self.assertEqual(new_options_value, parser.options) print("-----[ TEST END ]------------------------------------------") print("-----[ TEST BEGIN ]----------------------------------------") # Set options to an invalid type new_options_value = None with self.assertRaises(TypeError): parser.options = new_options_value print("-----[ TEST END ]------------------------------------------") print("OK") return 0 def test_SetProgramOptions_method_gen_options_list_01(self): """ Test the ``gen_options_list`` method. """ print("\n") print("Load file: {}".format(self._filename)) parser = SetProgramOptions(self._filename) parser.debug_level = 5 parser.exception_control_level = 4 parser.exception_control_compact_warnings = False print("-----[ TEST BEGIN ]----------------------------------------") section = "TEST_OPTION_REMOVAL_VARIABLES" print("Section : {}".format(section)) option_list_expect = [ '-AParam1Param2Param3=VALUE_A', '-BParam4Param5Param6=VALUE_B', '-CArg1Arg2Arg3=VALUE_C' ] # parse a section print("-" * 40) print("Execute Parser") print("-" * 40) option_list_actual = parser.gen_option_list(section) # pretty print the loginfo print("-" * 40) print("LogInfo") print("-" * 40) parser._loginfo_print() # pretty print the options data print("-" * 40) print("Options") print("-" * 40) pprint(parser.options, width=120) # pretty print the expected output print("-" * 40) print("Option List Expected") print("-" * 40) pprint(option_list_expect, width=120) # pretty print the actual output print("-" * 40) print("Option List Actual") print("-" * 40) pprint(option_list_actual, width=120) # Validate the results self.assertListEqual(option_list_expect, option_list_actual) print("-----[ TEST END ]------------------------------------------") print("OK") return 0 def test_SetProgramOptions_method_gen_options_list_02(self): """ Test the ``gen_options_list`` method. """ print("\n") print("Load file: {}".format(self._filename)) parser = SetProgramOptions(self._filename) parser.debug_level = 5 parser.exception_control_level = 5 parser.exception_control_compact_warnings = False print("-----[ TEST BEGIN ]----------------------------------------") section = "TEST_GEN_OPTION_LIST_ERROR_01" print("Section : {}".format(section)) option_entry = {'type': ['opt_set_undefined_type'], 'value': None, 'params': ['cmake']} with self.assertRaises(ValueError): parser._gen_option_entry(option_entry) print("-----[ TEST END ]------------------------------------------") print("OK") return 0 def test_SetProgramOptions_handler_opt_remove_no_params(self): """ Test the ``gen_options_list`` method. """ print("\n") print("Load file: {}".format(self._filename)) parser = SetProgramOptions(self._filename) parser.debug_level = 5 parser.exception_control_level = 4 parser.exception_control_compact_warnings = False print("-----[ TEST BEGIN ]----------------------------------------") section = "TEST_OPT_REMOVE_NO_PARAMS_01" print("Section : {}".format(section)) with self.assertRaises(IndexError): data = parser.parse_section(section) print("-----[ TEST END ]------------------------------------------") print("OK") return 0 def test_SetProgramOptions_initialize_handler_parameters_01(self): """ Test some coverage on ``_initialize_handler_parameters``. Calls the initialize_handler_parameters function a 2nd time, which would have the private attribute defined. """ print("\n") print("Load file: {}".format(self._filename)) parser = SetProgramOptions(self._filename) parser.debug_level = 5 parser.exception_control_level = 4 parser.exception_control_compact_warnings = False print("-----[ TEST BEGIN ]----------------------------------------") section = "TEST_OPTION_REMOVAL_VARIABLES" print("Section : {}".format(section)) handler_parameters = HandlerParameters.HandlerParameters() handler_parameters.data_internal['processed_sections'] = set() handler_parameters.data_shared[parser._data_shared_key] = [] parser._initialize_handler_parameters(section, handler_parameters) print("-----[ TEST END ]------------------------------------------") print("OK") return 0 def test_SetProgramOptions_handler_opt_remove_01(self): """ Testing for opt_remove """ print("\n") print("Load file: {}".format(self._filename)) parser = SetProgramOptions(self._filename) parser.debug_level = 5 parser.exception_control_level = 4 parser.exception_control_compact_warnings = False print("-----[ TEST BEGIN ]----------------------------------------") section = "TEST_OPTION_REMOVAL_VARS_01" print("Section : {}".format(section)) # parse a section print("-" * 40) print("Execute Parser") print("-" * 40) data = parser.parse_section(section) # pretty print the output print("-" * 40) print("Data") print("-" * 40) pprint(data, width=120) # pretty print the loginfo print("-" * 40) print("LogInfo") print("-" * 40) parser._loginfo_print() # pretty print the options data print("-" * 40) print("Options") print("-" * 40) pprint(parser.options, width=120) # pretty print the options list print("-" * 40) print("Options List") print("-" * 40) options_list_expect = ['-BParam4Param5Param6=VALUE_B', '-CArg1Arg2Arg3=VALUE_C'] options_list_actual = parser.gen_option_list(section, generator='bash') print("Expected Options List:") pprint(options_list_expect) print("Actual Options List:") pprint(options_list_actual) self.assertListEqual(options_list_expect, options_list_actual) print("-----[ TEST END ]------------------------------------------") print("OK") return 0 def test_SetProgramOptions_handler_opt_remove_02(self): """ Testing for opt_remove """ print("\n") print("Load file: {}".format(self._filename)) parser = SetProgramOptions(self._filename) parser.debug_level = 5 parser.exception_control_level = 4 parser.exception_control_compact_warnings = False print("-----[ TEST BEGIN ]----------------------------------------") section = "TEST_OPTION_REMOVAL_VARS_02" print("Section : {}".format(section)) # parse a section print("-" * 40) print("Execute Parser") print("-" * 40) data = parser.parse_section(section) # pretty print the output print("-" * 40) print("Data") print("-" * 40) pprint(data, width=120) # pretty print the loginfo print("-" * 40) print("LogInfo") print("-" * 40) parser._loginfo_print() # pretty print the options data print("-" * 40) print("Options") print("-" * 40) pprint(parser.options, width=120) # pretty print the options list print("-" * 40) print("Options List") print("-" * 40) options_list_expect = ['-CArg1Arg2Arg3=VALUE_C'] options_list_actual = parser.gen_option_list(section, generator='bash') print("Expected Options List:") pprint(options_list_expect) print("Actual Options List:") pprint(options_list_actual) self.assertListEqual(options_list_expect, options_list_actual) print("-----[ TEST END ]------------------------------------------") print("OK") return 0 def test_SetProgramOptions_method__gen_option_entry_method_not_found(self): """ Test ``_gen_option_entry`` when the app can't locate a suitable line generator method and ``exception_control_level`` is less than 5, thus ensuring the ``exception_control_event`` triggers a "SILENT" event that won't be raised. """ print("\n") print("Load file: {}".format(self._filename)) parser = SetProgramOptions(self._filename) parser.debug_level = 5 parser.exception_control_level = 4 parser.exception_control_compact_warnings = False print("-----[ TEST BEGIN ]----------------------------------------") section = "TEST_OPTION_REMOVAL_VARIABLES" print("Section : {}".format(section)) option_entry = {'type': ['nonexistent_command'], 'value': None, 'params': ['cmake']} output_expected = None output_actual = parser._gen_option_entry(option_entry, generator="bash") self.assertEqual(output_expected, output_actual) print("-----[ TEST END ]------------------------------------------") print("OK") return 0 def test_SetProgramOptions_method__gen_option_entry_generator_not_found(self): """ Test ``_gen_option_entry`` the requested generator isn't found. """ print("\n") print("Load file: {}".format(self._filename)) parser = SetProgramOptions(self._filename) parser.debug_level = 5 parser.exception_control_level = 4 parser.exception_control_compact_warnings = False print("-----[ TEST BEGIN ]----------------------------------------") section = "TEST_OPTION_REMOVAL_VARIABLES" print("Section : {}".format(section)) option_entry = {'type': ['opt_set'], 'value': None, 'params': ['cmake']} output_expected = None output_actual = parser._gen_option_entry(option_entry, generator="foobar") self.assertEqual(output_expected, output_actual) print("-----[ TEST END ]------------------------------------------") print("OK") return 0 def test_SetProgramOptions_test_spaces_in_value(self): """ Test values with spaces to verify that quotes get added. """ print("\n") print("Load file: {}".format(self._filename)) parser = SetProgramOptions(self._filename) parser.debug_level = 5 parser.exception_control_level = 4 parser.exception_control_compact_warnings = False print("-----[ TEST BEGIN ]----------------------------------------") section = "TEST_SPACES_IN_VALUE" print("Section : {}".format(section)) option_list_expect = ['TEST_OPTIONS="-ldl -fsanitize=address"'] option_list_actual = parser.gen_option_list(section, generator="bash") print("-" * 40) print("Options List Expect") print("-" * 40) pprint(option_list_expect, width=120) print("") print("Options List Actual") print("-" * 40) pprint(option_list_actual, width=120) self.assertEqual(option_list_expect, option_list_actual) print("-----[ TEST END ]------------------------------------------") print("OK") return 0 def test_SetProgramOptions_test_var_exansion(self): """ Test var expansion """ print("\n") print("Load file: {}".format(self._filename)) parser = SetProgramOptions(self._filename) parser.debug_level = 5 parser.exception_control_level = 4 parser.exception_control_compact_warnings = False print("-----[ TEST BEGIN ]----------------------------------------") #section = "TEST_VAR_EXPANSION_DEFAULT" section = "TEST_VAR_EXPANSION_ENV" print("Section : {}".format(section)) option_list_expect = ['FOO="${FOOBAR} -baz"'] #with self.assertRaises(ValueError): option_list_actual = parser.gen_option_list(section, generator="bash") print("-" * 40) print("Options List Expect") print("-" * 40) pprint(option_list_expect, width=120) print("") print("Options List Actual") print("-" * 40) pprint(option_list_actual, width=120) self.assertEqual(option_list_expect, option_list_actual) print("-----[ TEST END ]------------------------------------------") print("OK") return 0 def test_SetProgramOptions_test_var_exansion_no_type_given(self): """ Test var expansion """ print("\n") print("Load file: {}".format(self._filename)) parser = SetProgramOptions(self._filename) parser.debug_level = 5 parser.exception_control_level = 4 parser.exception_control_compact_warnings = False print("-----[ TEST BEGIN ]----------------------------------------") section = "TEST_VAR_EXPANSION_NO_TYPE" print("Section : {}".format(section)) with self.assertRaises(ValueError): parser.gen_option_list(section, generator="bash") print("-----[ TEST END ]------------------------------------------") print("OK") return 0 class SetProgramOptionsTestCommon(TestCase): """ Test free function(s) in the ``common.py`` file. """ def test_common_freefunction_get_function_ref(self): """ Test var expansion """ class test_class(object): def testme(self): # create a class member called 'foobar' self.foobar = None # This should raise an error because self.foobar is not callable. get_function_ref(self, 'foobar') print("-----[ TEST BEGIN ]----------------------------------------") ccc = test_class() with self.assertRaises(TypeError): ccc.testme() print("-----[ TEST END ]------------------------------------------") print("OK") return 0 #
33.428354
100
0.553422
2,167
21,929
5.392709
0.177665
0.028752
0.052713
0.023276
0.651634
0.628958
0.60919
0.573678
0.563152
0.558703
0
0.014488
0.247754
21,929
655
101
33.479389
0.693926
0.220439
0
0.755319
0
0
0.207402
0.111883
0
0
0
0
0.037234
1
0.045213
false
0
0.050532
0
0.146277
0.507979
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
2
14824fa0846f5431ff4004ee37fac6408017883c
1,021
py
Python
python/380_Insert_Delete_GetRandom.py
LiangRong3020/leetcode
63579052b20f5260e4a2858dc38a60d0582d4efd
[ "MIT" ]
null
null
null
python/380_Insert_Delete_GetRandom.py
LiangRong3020/leetcode
63579052b20f5260e4a2858dc38a60d0582d4efd
[ "MIT" ]
null
null
null
python/380_Insert_Delete_GetRandom.py
LiangRong3020/leetcode
63579052b20f5260e4a2858dc38a60d0582d4efd
[ "MIT" ]
null
null
null
import random class RandomizedSet(object): def __init__(self): self.data_list = [] def insert(self, val): """ :type val: int :rtype: bool """ if val in self.data_list: return False self.data_list += [val] return True def remove(self, val): """ :type val: int :rtype: bool """ if not val in self.data_list: return False self.data_list.remove(val) return True def getRandom(self): """ :rtype: int """ random.shuffle(self.data_list) return self.data_list[0] # Your RandomizedSet object will be instantiated and called as such: # obj = RandomizedSet() # param_1 = obj.insert(val) # param_2 = obj.remove(val) # param_3 = obj.getRandom() # Your RandomizedSet object will be instantiated and called as such: # obj = RandomizedSet() # param_1 = obj.insert(val) # param_2 = obj.remove(val) # param_3 = obj.getRandom()
20.019608
68
0.572968
126
1,021
4.507937
0.309524
0.098592
0.147887
0.09507
0.683099
0.683099
0.683099
0.683099
0.584507
0.584507
0
0.010057
0.318315
1,021
51
69
20.019608
0.806034
0.393732
0
0.235294
0
0
0
0
0
0
0
0
0
1
0.235294
false
0
0.058824
0
0.647059
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
148f29cdb1b1746cec88758135c29780b48c1e44
2,799
py
Python
app/models.py
audreynjiraini/neighbourhood
b8937181e4ce0da8a9b0a9132cba6ae363da1a48
[ "MIT" ]
null
null
null
app/models.py
audreynjiraini/neighbourhood
b8937181e4ce0da8a9b0a9132cba6ae363da1a48
[ "MIT" ]
4
2020-06-06T00:02:34.000Z
2021-09-08T01:23:32.000Z
app/models.py
audreynjiraini/neighbourhood
b8937181e4ce0da8a9b0a9132cba6ae363da1a48
[ "MIT" ]
null
null
null
from django.db import models from django.contrib.auth.models import User # Create your models here. class Location(models.Model): name = models.CharField(max_length = 30) def __str__(self): return self.name class Neighbourhood(models.Model): name = models.CharField(max_length=30) location = models.ForeignKey(Location, on_delete=models.CASCADE) occupants = models.IntegerField(null=True, default=0) def create_neighbourhood(self): self.save() def delete_neighbourhood(self): self.delete() @classmethod def find_neighbourhood(cls, neighbourhood_id): neighbourhood = cls.objects.get(id = neighbourhood_id) return neighbourhood def update_neighbourhod(self, name): self.name = name self.save() def update_occupants(self, occupants): self.occupants = occupants self.save() def __str__(self): return self.name class Profile(models.Model): name = models.CharField(max_length = 30) neighbourhood = models.ForeignKey(Neighbourhood, on_delete=models.CASCADE, null=True) bio = models.TextField(null=True) email = models.EmailField(null=True) user = models.OneToOneField(User, on_delete=models.CASCADE) def __str__(self): return self.name class Business(models.Model): name = models.CharField(max_length = 50) email = models.EmailField() description = models.TextField(null=True) neighbourhood = models.ForeignKey(Neighbourhood, on_delete=models.CASCADE) user = models.ForeignKey(Profile, on_delete=models.CASCADE) def create_business(self): self.save() def delete_business(self): self.delete() @classmethod def find_business(cls, business_id): business = cls.objects.get(id = business_id) return business def update_business(self, name): self.name = name self.save() @classmethod def search_by_name(cls,search_term): business = cls.objects.filter(name__icontains = search_term) return business def __str__(self): return self.name class Post(models.Model): title = models.CharField(max_length=100) content = models.TextField() user = models.ForeignKey(User, on_delete=models.CASCADE) neighbourhood = models.ForeignKey(Neighbourhood, on_delete=models.CASCADE) pub_date = models.DateTimeField(auto_now_add=True, null=True) def __str__(self): return self.title
21.697674
89
0.615934
296
2,799
5.641892
0.226351
0.038323
0.058683
0.088024
0.432934
0.351497
0.313174
0.186826
0
0
0
0.006101
0.297249
2,799
129
90
21.697674
0.842908
0.008574
0
0.430769
0
0
0
0
0
0
0
0
0
1
0.230769
false
0
0.030769
0.076923
0.753846
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
149650e2491293d92c2d4b48e16ae631cc307ff9
13,376
py
Python
examples/MemoryBenchmark/generate_readme.py
bxparks/AceSegment
732df1bf4e22ab214010e9e4b534b338896ffedc
[ "MIT" ]
4
2021-04-19T16:47:34.000Z
2022-02-06T03:48:17.000Z
examples/MemoryBenchmark/generate_readme.py
bxparks/AceSegment
732df1bf4e22ab214010e9e4b534b338896ffedc
[ "MIT" ]
9
2018-04-03T23:28:56.000Z
2021-05-14T21:44:04.000Z
examples/MemoryBenchmark/generate_readme.py
bxparks/AceSegment
732df1bf4e22ab214010e9e4b534b338896ffedc
[ "MIT" ]
1
2021-08-18T22:03:51.000Z
2021-08-18T22:03:51.000Z
#!/usr/bin/python3 # # Python script that regenerates the README.md from the embedded template. Uses # ./generate_table.awk to regenerate the ASCII tables from the various *.txt # files. from subprocess import check_output attiny_results = check_output( "./generate_table.awk < attiny.txt", shell=True, text=True) nano_results = check_output( "./generate_table.awk < nano.txt", shell=True, text=True) micro_results = check_output( "./generate_table.awk < micro.txt", shell=True, text=True) samd_results = check_output( "./generate_table.awk < samd.txt", shell=True, text=True) stm32_results = check_output( "./generate_table.awk < stm32.txt", shell=True, text=True) esp8266_results = check_output( "./generate_table.awk < esp8266.txt", shell=True, text=True) esp32_results = check_output( "./generate_table.awk < esp32.txt", shell=True, text=True) teensy32_results = check_output( "./generate_table.awk < teensy32.txt", shell=True, text=True) print(f"""\ # Memory Benchmark The `MemoryBenchmark.ino` collects the amount of flash and static memory consumed by different implementations in the AceSegment library. It compiles various code snippets which are controlled by the `FEATURE` macro flag. The `collect.sh` edits this `FEATURE` flag programmatically, then runs the Arduino IDE compiler on the program, and extracts the flash and static memory usage into a text file (e.g. `nano.txt`). The numbers shown below should be considered to be rough estimates. It is often difficult to separate out the code size of the library from the overhead imposed by the runtime environment of the processor. For example, it often seems like the ESP8266 allocates flash memory in blocks of a certain quantity, so the calculated flash size can jump around in unexpected ways. **Version**: AceSegment v0.9.1 **DO NOT EDIT**: This file was auto-generated using `make README.md`. ## How to Generate This requires the [AUniter](https://github.com/bxparks/AUniter) script to execute the Arduino IDE programmatically. The `Makefile` has rules for several microcontrollers: ``` $ make benchmarks ``` produces the following files: ``` nano.txt micro.txt samd.txt stm32.txt esp8266.txt esp32.txt teensy32.txt ``` The `generate_table.awk` program reads one of `*.txt` files and prints out an ASCII table that can be directly embedded into this README.md file. For example the following command produces the table in the Nano section below: ``` $ ./generate_table.awk < nano.txt ``` Fortunately, we no longer need to run `generate_table.awk` for each `*.txt` file. The process has been automated using the `generate_readme.py` script which will be invoked by the following command: ``` $ make README.md ``` ## Library Size Changes **v0.3** * Initial MemoryBenchmark using the old v0.3 implementation from 2018, before substantional refactoring in 2021. **v0.4** * Reduce flash size from 4.0-4.4kB by about 200-500 bytes on AVR by simplifying `LedMatrix` class hierarchy by extracting out the `SpiInterface` class to handle both hardware and software SPI, instead of calling `shiftOut()` directly. * Reduce flash size from 3.8-4.2kB down 800-1000 bytes on AVR by simplifying the `Driver` class hierarchy into a single `Renderer` class, by making the `LedMatrix` class into a better abstraction and unifying the API into a single `draw(group, elementPattern)` method. * Reduce flash by 20-50 bytes on AVR by merging `Renderer` into `ScanningModule`. * Reduce flash by 100-200 bytes on AVR, SAMD21, STM32 and ESP8266 by templatizing the `ScanningModule` on `NUM_DIGITS` and `NUM_SUBFIELDS`, and merging `patterns` and `brightnesses` arrays directly into `ScanningModule`. Flash usage actually goes up by ~40 bytes on Teensy3.2, but it has enough flash memory. * Reduce flash by 300-350 bytes on AVR (~150 on SAMD, 150-500 bytes on STM32, ~250 bytes on ESP8266, 300-600 bytes on ESP32) by templatizing LedMatrix and ScanningModule on `NUM_DIGITS`, `NUM_SUBFIELDS`, `SimpleSpiInterface` and `HardSpiInterface`. * Reduce flash by flattening the `LedMatrix` hierarchy into templatized classes, and removing virtual methods. Saves 250-300 bytes on AVR, 150-200 on SAMD, 150-300 on STM32, 200-300 on ESP8266, 300-1300 bytes on ESP32, 800-1300 bytes on Teensy 3.2. * Reduce flash by 250-400 bytes on AVR by providing ability to use `digitalWriteFast()` (https://github.com/NicksonYap/digitalWriteFast) using the `scanning/LedMatrixDirectFast4.h` and `ace_spi/SimpleSpiFastInterface.h` classes. * Total flash size saved is around 2kB for AVR, from (4 to 4.4) kB to (2 to 2.5) kB. * Reduce flash size by 828 bytes on AVR, 3kB on ESP8266, 5kB on ESP32 in commit c5da272 which simplified the test classes under `src/ace_segment/testing/` so that they no longer inherit from `TestOnce` classes in the `AUnit` library. Apparently, just making a reference to AUnit causes the `Serial` instance of the `HardwareSerial` class to be pulled in. The compiler/linker is not able to detect that it is actually never used, so it keeps around the code for the HardwareSerial class. (I will make a fix to AUnit so that the `HardwareSerial` will not be pulled in by other libraries in the future.) * Reduce flash size by ~130 bytes on AVR and 70-80 bytes on 32-bit processors by removing the pointer to `TimingStats` from `ScanningModule`. The pointer causes the code for the `TimingStats` class to be pulled in, even if it is not used. **v0.5** * Slight increase in memory usage (20-30 bytes) on some processors (AVR, ESP8266, ESP8266), but slight decrease on others (STM32, Teensy), I think the changes are due to some removal/addition of some methods in `PatternWriter`. * Add memory usage for `Tm1637Module`. Seems to consume something in between similar to the `ScanningModule` w/ SW SPI and `ScanningModule` with HW SPI. * Add memory usage for `Tm1637Module` using `SimpleTmiFastInterface` which uses `digitalWriteFast` library for AVR processors. Saves 662 - 776 bytes of flash on AVR processors compared to `Tm1637Module` using normal `SimpleTmiInterface`. * Save 150-200 bytes of flash on AVR processors by lifting all of the `PatternWriter::writePatternAt()` type of methods to `PatternWriter`, making them non-virtual, then funneling these methods through just 2 lower-level virtual methods: `setPatternAt()` and `getPatternAt()`. It also made the implementation of `Tm1637Module` position remapping easier. * Extracting `LedModule` from `PatternWriter` saves 10-40 bytes on AVR for `ScanningModule` and `Tm1637Module`, but add about that many bytes for various Writer classes (probably because they have to go though one additional layer of indirection through the `LedModule`). So overall, I think it's a wash. * Add `HardSpiFastInterface` which saves 70 bytes for `ScanningModule(Single)`, 90 bytes for `ScanningModule(Dual)`, and 250 bytes for `Max7219Module`. * Hide implementation details involving `LedMatrixXxx` and `ScanningModule` by using the convenience classes (`DirectModule`, `DirectFast4Module`, `HybridModule`, `Hc595Module`). * Enabling user-defined character sets in `CharWriter` causes the flash memory consumption to increase by 30 bytes on AVR processors, and 36 bytes on 32-bit processors. Similar increase in `StringWriter` which now explicitly depends on CharWriter. But I think the additional configurability is worth it since different people have different aesthetic standards and want different fonts. * Adding `byteOrder` and `remapArray` parameters to `Hc595Module` increases the memory consumption by 60 bytes on AVR and about 20-40 bytes on 32-bit processors. **v0.6** * Add support for multiple SPI buses in `HardSpiInterface` and `HardSpiFastInterface`. Increases flash memory by 10-30 bytes. * Add benchmarks for `StringScroller` and `LevelWriter`. **v0.7** * Add benchmarks for `Ht16k33Module`. Consumes about 2400 bytes of flash on ATmega328 (Nano) or ATmega32U4 (Pro Micro), about 2X larger than any other LED module due to the I2C `<Wire.h>` library. * The `Max7219(HardSpiFast)` increases by about 100 on AVR because the previous version neglected to call `Max7219Module::flush()`. * Modules using hardware SPI (through `HardSpiInterface` or `HardSpiFastInterface`) becomes slightly smaller (30 bytes of flash, 2 bytes of static RAM on AVR) due to removal of explicit `pinMode(dataPin, X)` and `pinMode(clockPin, X)`. These are deferred to `SPIClass::begin()`. * Extract out `readAck()`, saving 10 bytes of flash for `SimpleTmiInterface` and 6 bytes of flash for `SimpleTmiFastInterface`. * Add `Ht16k33Module(SimpleWire)` and `Ht16k33Module(SimpleWireFast)`. * Rename `LedDisplay` to `PatternWriter` and remove one layer of abstraction. Saves 10-22 bytes of flash and 2 bytes of static RAM for most Writer classes (exception: `ClockWriter` and `StringWriter` which increases by 10-16 bytes of flash). * Modify `FEATURE_BASELINE` for TeensyDuino so that `malloc()` and `free()` are included in its memory consumption. When a class is used polymorphically (i.e. its virtual methods are called), TeensyDuino seems to automatically pull in `malloc()` and `free()`, which seems to consume about 3200 bytes of flash and 1100 bytes of static memory. This happens for all FEATURES other than BASELINE, so we have to make sure that BASELINE also pulls in these. All results for Teensy 3.2 become lower by 3200 bytes of flash and 1100 bytes of static RAM. **v0.8** * Extract communcation interfaces into AceSPI, AceTMI, and AceWire libraries. No change in memory consumption. * Copy AceSPI, AceTMI, and AceWire interface objects by *value* into various modules (i.e. Hc595Module, Ht16k33Module, Max7219Module, Tm1637Module) instead of by *reference*. * Interface objects are thin-adapters which hold only a few parameters (0 to 3) and are immutable. * Copying them by-value into the various modules eliminates an extra level of indirection through a pointer to the interface objects. * On AVR processors, this saves between 0 to 90 bytes of flash on most configurations. The most significant savings occur with the following: * Tm1637Module(SimpleTmi) saves 90 bytes, * Ht16k33Module(SimpleWire) saves 68 bytes of flash, * Max7219Module(SimpleSpi) saves 30 bytes of flash. * On 32-bit processors, the flash consumption usually goes *up* by 4-20 bytes, but decreases by a few bytes in a few cases. * The 32-bit processors have so much more flash memory than 8-bit processors, I think this tradeoff is worth it. **v0.8.2** * Remove `virtual` keyword from `LedModule` methods. * Decreases flash usage by 60 bytes for `Tm1637Module`, 14 bytes for `Max7219Module`, 32 bytes for `Ht16k33Module`, and 2-14 bytes for `Hc595Module`. * Decreases static ram usage by 7-8 bytes for all Module classes. * Further decreases flash usage by 10-70 bytes for various Writer classes. * Templatize Writer classes on `T_LED_MODULE` instead of hardcoding it to `LedModule`. * Seems to reduce flash size of some Writer classes on some platforms by hundreds of bytes, I think because methods can be better inlined, and unused methods are not compiled and linked in. * Add `isFlushRequired()` and clear appropriate flags after `flush()`. * Increases flash consumption by about 8 bytes on AVR. **v0.9** * Moved Writer classes to AceSegmentWriter library. **v0.9+** * Add `beginTransmission()`, `endTransmission()`, `transfer()`, and `transfer16()` methods to AceSPI library, which become the building blocks for the `send8()` and `send16()` convenience fnctions. * Seems to increase flash usage by about 20 bytes on AVR for * `HardSpiInterface` and `HardSpiFastInterface`, even though nothing really changed functionally. * On 32-bit processors, no significant difference. ## Results The following shows the flash and static memory sizes of the `MemoryBenchmark` program for various LED modules. * `ClockInterface`, `GpioInterface` (usually optimized away by the compiler) * `SimpleSpiInterface`, `SimpleSpiFastInterface`, `HardSpiInterface`, `HardSpiFastInterface` * `DirectModule` * `DirectFast4Module` * `HybridModule` * `Hc595Module` * `Tm1637Module` * `Max7219Module` * `Ht16k33Module` ### ATtiny85 * 8MHz ATtiny85 * Arduino IDE 1.8.13 * SpenceKonde/ATTinyCore 1.5.2 ``` {attiny_results} ``` ### Arduino Nano * 16MHz ATmega328P * Arduino IDE 1.8.13 * Arduino AVR Boards 1.8.3 ``` {nano_results} ``` ### Sparkfun Pro Micro * 16 MHz ATmega32U4 * Arduino IDE 1.8.13 * SparkFun AVR Boards 1.1.13 ``` {micro_results} ``` ### SAMD21 M0 Mini * 48 MHz ARM Cortex-M0+ * Arduino IDE 1.8.13 * Sparkfun SAMD Core 1.8.3 ``` {samd_results} ``` ### STM32 Blue Pill * STM32F103C8, 72 MHz ARM Cortex-M3 * Arduino IDE 1.8.13 * STM32duino 2.0.0 ``` {stm32_results} ``` ### ESP8266 * NodeMCU 1.0, 80MHz ESP8266 * Arduino IDE 1.8.13 * ESP8266 Boards 2.7.4 ``` {esp8266_results} ``` ### ESP32 * ESP32-01 Dev Board, 240 MHz Tensilica LX6 * Arduino IDE 1.8.13 * ESP32 Boards 1.0.6 ``` {esp32_results} ``` ### Teensy 3.2 * 96 MHz ARM Cortex-M4 * Arduino IDE 1.8.13 * Teensyduino 1.53 * Compiler options: "Faster" ``` {teensy32_results} ``` """)
38.217143
80
0.747309
1,962
13,376
5.070846
0.302752
0.016886
0.014072
0.020907
0.10584
0.044427
0.007237
0.007237
0.007237
0
0
0.05567
0.168735
13,376
349
81
38.326648
0.839104
0.013233
0
0.113475
1
0.014184
0.958239
0.048962
0
0
0
0
0
1
0
false
0
0.003546
0
0.003546
0.007092
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
14af5147b2626bd36ef6320723d2022edb05b0f0
6,172
py
Python
plugins/modules/zmf_authenticate.py
IBM/ibm_zosmf
b0c44a72ba41b560ee8bbff20802f9105605f764
[ "Apache-2.0" ]
2
2021-04-14T07:14:47.000Z
2022-02-04T08:54:43.000Z
plugins/modules/zmf_authenticate.py
IBM/ibm_zosmf
b0c44a72ba41b560ee8bbff20802f9105605f764
[ "Apache-2.0" ]
null
null
null
plugins/modules/zmf_authenticate.py
IBM/ibm_zosmf
b0c44a72ba41b560ee8bbff20802f9105605f764
[ "Apache-2.0" ]
1
2021-04-14T07:38:36.000Z
2021-04-14T07:38:36.000Z
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) IBM Corporation 2021 # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = r""" --- module: zmf_authenticate short_description: Authenticate with z/OSMF server description: - > Authenticate with z/OSMF server by either username/password or HTTPS client authenticate. - Return the authentication credentials for successful authentication. - > The credential can be then used for succeeding Ansible tasks which call z/OSMF Ansible module or role. version_added: "1.0.0" author: - Yang Cao (@zosmf-Young) - Yun Juan Yang (@zosmf-Robyn) options: zmf_host: description: - Hostname of the z/OSMF server. required: True type: str zmf_port: description: - Port number of the z/OSMF server. required: False type: int default: null zmf_user: description: - User name to be used for authenticating with z/OSMF server. - Required when I(zmf_crt) and I(zmf_key) are not supplied. - > If I(zmf_crt) and I(zmf_key) are supplied, I(zmf_user) and I(zmf_password) are ignored. required: False type: str default: null zmf_password: description: - Password to be used for authenticating with z/OSMF server. - Required when I(zmf_crt) and I(zmf_key) are not supplied. - > If I(zmf_crt) and I(zmf_key) are supplied, I(zmf_user) and I(zmf_password) are ignored. required: False type: str default: null zmf_crt: description: - > Location of the PEM-formatted certificate chain file to be used for HTTPS client authentication. - Required when I(zmf_user) and I(zmf_password) are not supplied. required: False type: str default: null zmf_key: description: - > Location of the PEM-formatted file with your private key to be used for HTTPS client authentication. - Required when I(zmf_user) and I(zmf_password) are not supplied. required: False type: str default: null requirements: - requests >= 2.23.0 """ EXAMPLES = r""" - name: Authenticate with z/OSMF server by username/password zmf_authenticate: zmf_host: "sample.ibm.com" zmf_user: "your_username" zmf_password: "your_password" - name: Authenticate with z/OSMF server by HTTPS client authenticate zmf_authenticate: zmf_host: "sample.ibm.com" zmf_crt: "/file_with_your_certificate_chain.crt" zmf_key: "/file_with_your_private_key.key" - name: Authenticate with z/OSMF server by prompting to input username/password vars_prompt: - name: zmf_user prompt: "Enter your zOSMF username" private: no - name: zmf_password prompt: "Enter your zOSMF password" private: yes tasks: - zmf_authenticate: zmf_host: "{{ zmf_host }}" zmf_port: "{{ zmf_port }}" zmf_user: "{{ zmf_user }}" zmf_password: "{{ zmf_password }}" """ RETURN = r""" changed: description: Indicates if any change is made during the module operation. returned: always type: bool ltpa_token_2: description: - > The value of Lightweight Third Party Access (LTPA) token, which supports strong encryption. returned: on success type: str sample: "yDS7uJxqrd3h8v5WXq9pf1yPtztQ4JzroZN3XQKF26ZicXgHc7mdzgycMCa......" jwt_token: description: The value of JSON Web token, which supports strong encryption. returned: on success type: str sample: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ0b2tlmVhcmVyIiwicie......" zmf_host: description: Hostname of the z/OSMF server. returned: on success type: str zmf_port: description: Port number of the z/OSMF server. returned: on success type: int """ from ansible.module_utils.basic import AnsibleModule from ansible_collections.ibm.ibm_zosmf.plugins.module_utils.zmf_util import ( get_auth_argument_spec, get_connect_session ) from ansible_collections.ibm.ibm_zosmf.plugins.module_utils.zmf_auth_api \ import call_auth_api import re def authenticate(module): """ Authenticate with z/OSMF server. Return the authentication token. :param AnsibleModule module: the ansible module """ # create session session = get_connect_session(module) # get authentication token response_getAuth = call_auth_api(module, session, 'getAuth') if isinstance(response_getAuth, dict): if ('Set-Cookie' in response_getAuth and ('LtpaToken2' in response_getAuth['Set-Cookie'] or 'jwtToken' in response_getAuth['Set-Cookie'])): auth = dict() if 'LtpaToken2' in response_getAuth['Set-Cookie']: auth['ltpa_token_2'] = \ re.findall('LtpaToken2=(.+?);', response_getAuth['Set-Cookie'])[0] if 'jwtToken' in response_getAuth['Set-Cookie']: auth['jwt_token'] = \ re.findall('jwtToken=(.+?);', response_getAuth['Set-Cookie'])[0] auth['zmf_host'] = module.params['zmf_host'] auth['zmf_port'] = module.params['zmf_port'] module.exit_json(**auth) else: module.fail_json( msg='Failed to authenticate with z/OSMF server ' + '---- Cannot obtain the authentication token.') else: module.fail_json(msg='Failed to authenticate with z/OSMF server ---- ' + response_getAuth) def main(): argument_spec = get_auth_argument_spec() module = AnsibleModule( argument_spec=argument_spec, supports_check_mode=False ) authenticate(module) if __name__ == '__main__': main()
31.979275
79
0.630428
731
6,172
5.149111
0.25855
0.017003
0.040914
0.039851
0.472635
0.440489
0.376196
0.328905
0.309245
0.276833
0
0.009021
0.281594
6,172
192
80
32.145833
0.839874
0.049255
0
0.371257
0
0
0.718445
0.03528
0
0
0
0
0
1
0.011976
false
0.077844
0.02994
0
0.041916
0.005988
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
14b778a65818fd54b260fff6799ad6eca5ef0b89
2,939
py
Python
tests/main/legacy/test_main.py
robcxyz/tackle-box
a7a1403d4f7549cdacb32e5b11c1f9043bdd5762
[ "BSD-3-Clause" ]
5
2021-01-05T04:21:37.000Z
2022-01-01T22:12:32.000Z
tests/main/legacy/test_main.py
robcxyz/tackle-box
a7a1403d4f7549cdacb32e5b11c1f9043bdd5762
[ "BSD-3-Clause" ]
51
2021-01-03T00:41:59.000Z
2022-03-27T00:13:51.000Z
tests/main/legacy/test_main.py
robcxyz/tackle-box
a7a1403d4f7549cdacb32e5b11c1f9043bdd5762
[ "BSD-3-Clause" ]
1
2022-01-03T11:46:02.000Z
2022-01-03T11:46:02.000Z
"""Collection of tests around cookiecutter's replay feature.""" from tackle.main import tackle # TODO: Fix with replay # def test_replay_dump_template_name( # monkeypatch, mocker, user_config_data, user_config_file, change_dir_main_fixtures # ): # """Check that replay_dump is called with a valid template_name. # # Template name must not be a relative path. # # Otherwise files such as ``..json`` are created, which are not just cryptic # but also later mistaken for replay files of other templates if invoked with # '.' and '--replay'. # # Change the current working directory temporarily to 'tests/legacy/fixtures/fake-repo-tmpl' # for this test and call cookiecutter with '.' for the target template. # """ # monkeypatch.chdir('fake-repo-tmpl') # # mock_replay_dump = mocker.patch('tackle.utils.files.dump') # mocker.patch('tackle.generate.generate_files') # # tackle( # '.', no_input=True, replay=False, config_file=user_config_file, # ) # # mock_replay_dump.assert_called_once_with( # user_config_data['replay_dir'], 'fake-repo-tmpl', mocker.ANY, 'cookiecutter', # ) # def test_replay_load_template_name( # monkeypatch, mocker, user_config_data, user_config_file # ): # """Check that replay_load is called correctly. # # Calls require valid template_name that is not a relative path. # # Change the current working directory temporarily to 'tests/legacy/fixtures/fake-repo-tmpl' # for this test and call cookiecutter with '.' for the target template. # """ # monkeypatch.chdir( # os.path.join( # os.path.abspath(os.path.dirname(__file__)), # '..', # 'fixtures', # 'fake-repo-tmpl', # ) # ) # # mock_replay_load = mocker.patch('cookiecutter.main.load') # mocker.patch('cookiecutter.main.generate_files') # # cookiecutter( # '.', replay=True, config_file=user_config_file, # ) # # mock_replay_load.assert_called_once_with( # user_config_data['replay_dir'], 'fake-repo-tmpl', 'cookiecutter' # ) # TODO: Fix with replay # def test_custom_replay_file(change_dir_main_fixtures, monkeypatch, mocker, user_config_file): # """Check that reply.load is called with the custom replay_file.""" # monkeypatch.chdir('fake-repo-tmpl') # # mock_replay_load = mocker.patch('cookiecutter.main.load') # mocker.patch('cookiecutter.generate.generate_files') # # tackle( # '.', replay='./custom-replay-file', config_file=user_config_file, # ) # # mock_replay_load.assert_called_once_with('.', 'custom-replay-file', 'cookiecutter') def test__embed(change_dir_main_fixtures, tmpdir): """Verify Jinja2 time extension work correctly.""" context = tackle( 'fake-repo-tmpl-tackle-embed', no_input=True, output_dir=str(tmpdir) ) assert 'sterf' in list(context['stuff'].keys())
33.397727
96
0.677101
368
2,939
5.182065
0.298913
0.052438
0.050341
0.056633
0.51075
0.46775
0.44258
0.404824
0.404824
0.404824
0
0.000424
0.196666
2,939
87
97
33.781609
0.807285
0.862879
0
0
0
0
0.114198
0.083333
0
0
0
0.011494
0.166667
1
0.166667
false
0
0.166667
0
0.333333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
2
1ae0c22dc3bb1c13c6bc6a9c5a07e47003413ba4
509
py
Python
tests/test_issues/test_include_schema.py
joeflack4/linkml-runtime
58443ff90da419404a77386e7aa790ece4b12354
[ "CC0-1.0" ]
9
2021-06-18T04:02:30.000Z
2022-03-08T12:47:05.000Z
tests/test_issues/test_include_schema.py
joeflack4/linkml-runtime
58443ff90da419404a77386e7aa790ece4b12354
[ "CC0-1.0" ]
83
2021-03-24T20:45:58.000Z
2022-03-31T23:20:02.000Z
tests/test_issues/test_include_schema.py
joeflack4/linkml-runtime
58443ff90da419404a77386e7aa790ece4b12354
[ "CC0-1.0" ]
6
2021-07-06T20:06:27.000Z
2022-03-04T20:55:14.000Z
import unittest from linkml_runtime.linkml_model.meta import SchemaDefinition from linkml_runtime.loaders import yaml_loader from tests.test_issues.environment import env class IncludeSchemaTestCase(unittest.TestCase): """ include_schema.yaml produces a Python exception on an uncaught error""" # "Awaiting fix for issue #3" def test_include_schema(self): inp = yaml_loader.load(env.input_path('include_schema.yaml'), SchemaDefinition) if __name__ == '__main__': unittest.main()
28.277778
87
0.774067
65
509
5.769231
0.661538
0.104
0.090667
0
0
0
0
0
0
0
0
0.002294
0.143418
509
17
88
29.941176
0.857798
0.188605
0
0
0
0
0.066667
0
0
0
0
0
0
1
0.111111
false
0
0.444444
0
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
1ae3a672cedc203b73d729d2118ca58b2145bddb
1,631
py
Python
KFR/build/examples/Debug/window_cosine.py
Asifadam93/FiltreMusical
dcd53bc41934f219fb9b3d5aef281099fb572a49
[ "BSD-3-Clause" ]
null
null
null
KFR/build/examples/Debug/window_cosine.py
Asifadam93/FiltreMusical
dcd53bc41934f219fb9b3d5aef281099fb572a49
[ "BSD-3-Clause" ]
null
null
null
KFR/build/examples/Debug/window_cosine.py
Asifadam93/FiltreMusical
dcd53bc41934f219fb9b3d5aef281099fb572a49
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python import dspplot data = [ 0, 0.049845885660697156, 0.099567846595816648, 0.14904226617617444, 0.19814614319939755, 0.24675739769029362, 0.29475517441090415, 0.34202014332566871, 0.38843479627469468, 0.43388373911755812, 0.47825397862131813, 0.521435203379498, 0.56332005806362195, 0.60380441032547738, 0.64278760968653925, 0.68017273777091936, 0.71586684925971844, 0.74978120296773398, 0.78183148246802969, 0.81193800571585639, 0.8400259231507714, 0.8660254037844386, 0.88987180881146855, 0.91150585231167303, 0.93087374864420414, 0.9479273461671317, 0.96262424695001203, 0.97492791218182362, 0.98480775301220802, 0.99223920660017206, 0.99720379718118013, 0.99968918200081625, 0.99968918200081625, 0.99720379718118013, 0.99223920660017206, 0.98480775301220802, 0.97492791218182362, 0.96262424695001214, 0.94792734616713181, 0.93087374864420425, 0.91150585231167325, 0.88987180881146877, 0.86602540378443882, 0.84002592315077151, 0.81193800571585673, 0.78183148246803014, 0.74978120296773443, 0.71586684925971855, 0.68017273777091969, 0.64278760968653947, 0.60380441032547771, 0.56332005806362218, 0.52143520337949811, 0.47825397862131847, 0.43388373911755823, 0.38843479627469463, 0.34202014332566888, 0.2947551744109046, 0.24675739769029384, 0.19814614319939758, 0.14904226617617469, 0.099567846595817161, 0.049845885660697482, 1.2246467991473515e-16, ] dspplot.plot(data, freqresp=True, dots=True, padwidth=1024, log_freq=False, horizontal=False, normalized_freq=True, title='Cosine window', file='../svg/window_cosine.svg')
22.971831
171
0.79767
160
1,631
8.1125
0.525
0.027735
0.029276
0
0
0
0
0
0
0
0
0.776792
0.101778
1,631
70
172
23.3
0.109215
0.012262
0
0.147059
0
0
0.022981
0.014907
0
0
0
0
0
1
0
false
0
0.014706
0
0.014706
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
1ae9258452d05dbf97c05037e114b5af96d101c0
6,849
py
Python
onadata/apps/api/tests/viewsets/test_attachment_viewset.py
sounay/flaming-octo-tribble
21f21f0e7b2d7f745173f7957375a9d96c2a065e
[ "BSD-2-Clause" ]
2
2017-11-30T17:43:48.000Z
2018-10-26T23:44:32.000Z
onadata/apps/api/tests/viewsets/test_attachment_viewset.py
sounay/flaming-octo-tribble
21f21f0e7b2d7f745173f7957375a9d96c2a065e
[ "BSD-2-Clause" ]
null
null
null
onadata/apps/api/tests/viewsets/test_attachment_viewset.py
sounay/flaming-octo-tribble
21f21f0e7b2d7f745173f7957375a9d96c2a065e
[ "BSD-2-Clause" ]
3
2016-04-17T06:02:51.000Z
2018-08-23T21:29:03.000Z
from os import path from onadata.apps.api.tests.viewsets.test_abstract_viewset import \ TestAbstractViewSet from onadata.apps.api.viewsets.attachment_viewset import AttachmentViewSet from onadata.libs.utils.image_tools import image_url class TestAttachmentViewSet(TestAbstractViewSet): def setUp(self): super(TestAttachmentViewSet, self).setUp() self.retrieve_view = AttachmentViewSet.as_view({ 'get': 'retrieve' }) self.list_view = AttachmentViewSet.as_view({ 'get': 'list' }) self._publish_xls_form_to_project() def test_retrieve_view(self): self._submit_transport_instance_w_attachment() pk = self.attachment.pk data = { 'url': 'http://testserver/api/v1/media/%s' % pk, 'field_xpath': None, 'download_url': self.attachment.media_file.url, 'small_download_url': image_url(self.attachment, 'small'), 'medium_download_url': image_url(self.attachment, 'medium'), 'id': pk, 'xform': self.xform.pk, 'instance': self.attachment.instance.pk, 'mimetype': self.attachment.mimetype, 'filename': self.attachment.media_file.name } request = self.factory.get('/', **self.extra) response = self.retrieve_view(request, pk=pk) self.assertNotEqual(response.get('Last-Modified'), None) self.assertEqual(response.status_code, 200) self.assertTrue(isinstance(response.data, dict)) self.assertEqual(response.data, data) # file download filename = data['filename'] ext = filename[filename.rindex('.') + 1:] request = self.factory.get('/', **self.extra) response = self.retrieve_view(request, pk=pk, format=ext) self.assertNotEqual(response.get('Last-Modified'), None) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'image/jpeg') def test_retrieve_and_list_views_with_anonymous_user(self): """Retrieve metadata of a public form""" # anon user private form access not allowed self._submit_transport_instance_w_attachment() pk = self.attachment.pk request = self.factory.get('/') response = self.retrieve_view(request, pk=pk) self.assertEqual(response.status_code, 404) request = self.factory.get('/') response = self.list_view(request) self.assertEqual(response.status_code, 200) self.assertEqual(response.data, []) xform = self.attachment.instance.xform xform.shared_data = True xform.save() request = self.factory.get('/') response = self.retrieve_view(request, pk=pk) self.assertEqual(response.status_code, 200) request = self.factory.get('/') response = self.list_view(request) self.assertEqual(response.status_code, 200) def test_list_view(self): self._submit_transport_instance_w_attachment() request = self.factory.get('/', **self.extra) response = self.list_view(request) self.assertNotEqual(response.get('Last-Modified'), None) self.assertEqual(response.status_code, 200) self.assertTrue(isinstance(response.data, list)) def test_list_view_filter_by_xform(self): self._submit_transport_instance_w_attachment() data = { 'xform': self.xform.pk } request = self.factory.get('/', data, **self.extra) response = self.list_view(request) self.assertNotEqual(response.get('Last-Modified'), None) self.assertEqual(response.status_code, 200) self.assertTrue(isinstance(response.data, list)) data['xform'] = 10000000 request = self.factory.get('/', data, **self.extra) response = self.list_view(request) self.assertEqual(response.status_code, 404) data['xform'] = 'lol' request = self.factory.get('/', data, **self.extra) response = self.list_view(request) self.assertEqual(response.status_code, 400) self.assertEqual(response.get('Last-Modified'), None) def test_list_view_filter_by_instance(self): self._submit_transport_instance_w_attachment() data = { 'instance': self.attachment.instance.pk } request = self.factory.get('/', data, **self.extra) response = self.list_view(request) self.assertNotEqual(response.get('Last-Modified'), None) self.assertEqual(response.status_code, 200) self.assertTrue(isinstance(response.data, list)) data['instance'] = 10000000 request = self.factory.get('/', data, **self.extra) response = self.list_view(request) self.assertEqual(response.status_code, 404) data['instance'] = 'lol' request = self.factory.get('/', data, **self.extra) response = self.list_view(request) self.assertEqual(response.status_code, 400) self.assertEqual(response.get('Last-Modified'), None) def test_direct_image_link(self): self._submit_transport_instance_w_attachment() data = { 'filename': self.attachment.media_file.name } request = self.factory.get('/', data, **self.extra) response = self.retrieve_view(request, pk=self.attachment.pk) self.assertNotEqual(response.get('Last-Modified'), None) self.assertEqual(response.status_code, 200) self.assertTrue(isinstance(response.data, basestring)) self.assertEqual(response.data, self.attachment.media_file.url) data['filename'] = 10000000 request = self.factory.get('/', data, **self.extra) response = self.retrieve_view(request, pk=self.attachment.instance.pk) self.assertEqual(response.status_code, 404) data['filename'] = 'lol' request = self.factory.get('/', data, **self.extra) response = self.retrieve_view(request, pk=self.attachment.instance.pk) self.assertEqual(response.status_code, 404) def test_direct_image_link_uppercase(self): self._submit_transport_instance_w_attachment( media_file="1335783522564.JPG") filename = self.attachment.media_file.name file_base, file_extension = path.splitext(filename) data = { 'filename': file_base + file_extension.upper() } request = self.factory.get('/', data, **self.extra) response = self.retrieve_view(request, pk=self.attachment.pk) self.assertNotEqual(response.get('Last-Modified'), None) self.assertEqual(response.status_code, 200) self.assertTrue(isinstance(response.data, basestring)) self.assertEqual(response.data, self.attachment.media_file.url)
39.362069
78
0.650752
766
6,849
5.646214
0.14752
0.066127
0.12763
0.082543
0.770405
0.72763
0.694566
0.683237
0.633988
0.624277
0
0.016981
0.226164
6,849
173
79
39.589595
0.799057
0.013287
0
0.592857
0
0
0.060139
0
0
0
0
0
0.264286
1
0.057143
false
0
0.028571
0
0.092857
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
1af060a32aa4708df324823d45cac1062ab85615
1,069
py
Python
scripts/uteqsym.py
aodelta/python_utility
072137ee4c2572664e2c4046c7ce70bc3f5c10db
[ "MIT" ]
1
2020-11-20T13:24:15.000Z
2020-11-20T13:24:15.000Z
scripts/uteqsym.py
aodelta/python_utility
072137ee4c2572664e2c4046c7ce70bc3f5c10db
[ "MIT" ]
null
null
null
scripts/uteqsym.py
aodelta/python_utility
072137ee4c2572664e2c4046c7ce70bc3f5c10db
[ "MIT" ]
null
null
null
NUMBER = (1 << 15) OPERATOR = (1 << 16) FUNCTION = (1 << 17) OTHER = (1 << 18) OPERATOR_PRIORITY_1 = (1 << 10) OPERATOR_PRIORITY_2 = (1 << 11) # Multiplication & Division OPERATOR_PRIORITY_3 = (1 << 12) # Implicit Multiplication (0.5/2x, a/b(c)) OPERATOR_PRIORITY_4 = (1 << 13) # Root & Exponent STUndefined = 0 STNumber = NUMBER | 1 STFactor = NUMBER | 2 # 2x, 3y STAddition = OPERATOR | OPERATOR_PRIORITY_1 | 2 STSubtraction = OPERATOR | OPERATOR_PRIORITY_1 | 3 STMultiplication = OPERATOR | OPERATOR_PRIORITY_2 | 4 STDivision = OPERATOR | OPERATOR_PRIORITY_2 | 5 STExponent = OPERATOR | OPERATOR_PRIORITY_4 | 6 STRoot = OPERATOR | OPERATOR_PRIORITY_4 | 7 STOpenParenthesis = OTHER | 1 STCloseParenthesis = OTHER | 2 class Symbol: def __init__(self, data: list, symbol_type: int, index: int, length: int): # All data of the symbol (e.g. : [] : operator, [value] : digit, [value, unknowns] for unknowns factor self.data = data self.type = symbol_type self.index_in_equation = index self.length_in_equation = length
33.40625
110
0.686623
142
1,069
4.957746
0.457746
0.227273
0.204545
0.071023
0
0
0
0
0
0
0
0.058685
0.202993
1,069
31
111
34.483871
0.767606
0.177736
0
0
0
0
0
0
0
0
0
0
0
1
0.04
false
0
0
0
0.08
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
2105004764a2c5ddbb41d71f33c48aefa39dd0c4
300
py
Python
Password Generator.py
ahmedsaadalvi/Assignments
17b1cef43b915d7bd8838b0e7f025cd9a939744d
[ "MIT" ]
null
null
null
Password Generator.py
ahmedsaadalvi/Assignments
17b1cef43b915d7bd8838b0e7f025cd9a939744d
[ "MIT" ]
null
null
null
Password Generator.py
ahmedsaadalvi/Assignments
17b1cef43b915d7bd8838b0e7f025cd9a939744d
[ "MIT" ]
null
null
null
import random s1 = 'abcdefghijkl' s2 = 'ABCDEFGHIJKL' s3 = '0987654' s4 = '@$#?%&*)' s = s1 + s2 + s3 + s4 print ('\nPasswords =\n') for i in range(7): password = '' for j in range(7): password = password + random.choice(s) print ('Password', i+1, ': ', password)
20
47
0.533333
38
300
4.210526
0.552632
0.0875
0.1
0.2
0
0
0
0
0
0
0
0.083333
0.28
300
15
48
20
0.657407
0
0
0
0
0
0.222997
0
0
0
0
0
0
1
0
false
0.333333
0.083333
0
0.083333
0.166667
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
21066ecd0551e131956c405fba24f8190715a813
995
py
Python
xinyu/python/common/io/file/PlainTextClient.py
xzhuah/codingDimension
9b90b93a3a3b8afee28e3a2a571050ca3f86f066
[ "Apache-2.0" ]
1
2020-11-06T20:39:11.000Z
2020-11-06T20:39:11.000Z
xinyu/python/common/io/file/PlainTextClient.py
xzhuah/codingDimension
9b90b93a3a3b8afee28e3a2a571050ca3f86f066
[ "Apache-2.0" ]
1
2021-08-28T02:29:51.000Z
2021-08-28T02:29:51.000Z
xinyu/python/common/io/file/PlainTextClient.py
xzhuah/codingDimension
9b90b93a3a3b8afee28e3a2a571050ca3f86f066
[ "Apache-2.0" ]
null
null
null
# Provide basic functions to read string content from file from common.io.file import project_input_root, project_output_root, project_io_root def read_file_from(filename) -> str: with open(filename, encoding='utf-8') as f: data = f.read() return data def get_file(filename, mode="r"): mode = mode.lower() if mode == "r": return open(project_input_root + filename, mode=mode, encoding="utf-8") elif mode == "w": return open(project_output_root + filename, mode=mode, encoding="utf-8") else: raise Exception(mode + " is not a valid mode") def get_io_file(filename, mode="r"): return open(project_io_root + filename, mode=mode, encoding="utf-8") def read_file(filename) -> str: with open(project_input_root + filename, encoding='utf-8') as f: data = f.read() return data def read_io_file(filename) -> str: with open(project_io_root + filename, encoding='utf-8') as f: data = f.read() return data
29.264706
83
0.668342
149
995
4.302013
0.281879
0.102964
0.112324
0.088924
0.552262
0.461778
0.368175
0.218409
0.218409
0.218409
0
0.007624
0.209045
995
33
84
30.151515
0.806862
0.056281
0
0.26087
0
0
0.057631
0
0
0
0
0
0
1
0.217391
false
0
0.043478
0.043478
0.521739
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
2108ed4c75be378c196eb6ce239bc3a5f31af303
190
py
Python
build/lib/pywulai/data.py
takewiki/pywulai
955ecf66d7017e46ea27c503bc3a4ef6eca9361f
[ "Apache-2.0" ]
1
2020-05-17T03:36:30.000Z
2020-05-17T03:36:30.000Z
pywulai/data.py
takewiki/pywulai
955ecf66d7017e46ea27c503bc3a4ef6eca9361f
[ "Apache-2.0" ]
null
null
null
pywulai/data.py
takewiki/pywulai
955ecf66d7017e46ea27c503bc3a4ef6eca9361f
[ "Apache-2.0" ]
null
null
null
# test for function notation def helloworld(txt:dict(type=str,help='input text')): print(txt) if __name__ == '__main__' : helloworld('hawken') print(helloworld.__annotations__)
23.75
53
0.710526
23
190
5.347826
0.826087
0
0
0
0
0
0
0
0
0
0
0
0.152632
190
8
54
23.75
0.763975
0.136842
0
0
0
0
0.147239
0
0
0
0
0
0
1
0.2
false
0
0
0
0.2
0.4
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
2112af59ede410f4601e4fca9edb7d9b320d8993
2,321
py
Python
Python/decorators/decorators.py
JacobCallahan/Understanding
1379c7478973be74d8df5b7aecaaa97abedb72a1
[ "MIT" ]
5
2020-02-25T23:54:03.000Z
2021-12-12T07:46:47.000Z
Python/decorators/decorators.py
JacobCallahan/Understanding
1379c7478973be74d8df5b7aecaaa97abedb72a1
[ "MIT" ]
null
null
null
Python/decorators/decorators.py
JacobCallahan/Understanding
1379c7478973be74d8df5b7aecaaa97abedb72a1
[ "MIT" ]
4
2020-02-25T23:54:09.000Z
2022-02-20T19:34:20.000Z
""" Decorators provide a way to intercept a decorated function, method, or class. Ultimately, the decorator accepts the function as its only argument Decorators can then either return the original function, or another one """ # pattern 1: Decorator that returns the original function def change_default(func): """This decorator changes the default value of a single-argument function""" func.__defaults__ = ("changed",) return func @change_default def test_func(a=5): return a print(f"Calling test_func: {test_func()}") # pattern 2: Decorator that returns a new function def deprecate(func): """This decorator stops a function from running and prints a message""" def nothing(*args, **kwargs): print(f"{func.__name__} has been deprecated") return nothing @deprecate def old_func(): return "I'm and old function that shouldn't be used" print(f"Calling old_func: {old_func()}") # pattern 3: Decorator that accepts arguments and returns original function def add_attributes(**attributes): """This decorator adds specified attributes to a function""" def decorator(func): for key, value in attributes.items(): setattr(func, key, value) return func return decorator @add_attributes(something="else", another=True) def basic_func(): return print(f"Calling basic_func: {basic_func()}") print(f"basic_func.something: {basic_func.something}") print(f"basic_func.another: {basic_func.another}") # pattern 4: Decorator that accepts arguments and returns a new function def return_type(ret_type): def decorator(func): def runner(*args, **kwargs): result = func(*args, **kwargs) assert isinstance(result, ret_type) return result return runner return decorator @return_type(str) def loose_return(obj): print(f"I'm returning an object of type {type(obj)}") return obj print(f"Calling loose_return with a string: {loose_return('Test')}") # print(f"Calling loose_return with an integer: {loose_return(15)}") # Decorators can stack @add_attributes(something="else") @return_type(str) @change_default def very_decorated(argument=17): return argument print(f"Calling very_decorated: {very_decorated()}") print(f"very_decorated.something: {very_decorated.something}")
29.0125
80
0.719087
320
2,321
5.084375
0.325
0.040565
0.047941
0.023356
0.105101
0.08236
0
0
0
0
0
0.004707
0.176217
2,321
79
81
29.379747
0.846234
0.322275
0
0.212766
0
0
0.302913
0.075081
0
0
0
0
0.021277
1
0.276596
false
0
0
0.085106
0.531915
0.212766
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
212292dadc779a9fec4034b2630df77b1987efad
640
py
Python
server/vcr-server/api/v4/serializers/search/fuzzy.py
esune/indy-catalyst
009e1113fc9761aad8742a70b0ab16832f7ee04d
[ "Apache-2.0" ]
38
2019-01-07T02:49:55.000Z
2020-01-27T17:26:09.000Z
server/vcr-server/api/v4/serializers/search/fuzzy.py
esune/indy-catalyst
009e1113fc9761aad8742a70b0ab16832f7ee04d
[ "Apache-2.0" ]
364
2019-01-07T20:22:15.000Z
2020-03-10T21:59:23.000Z
server/vcr-server/api/v4/serializers/search/fuzzy.py
esune/indy-catalyst
009e1113fc9761aad8742a70b0ab16832f7ee04d
[ "Apache-2.0" ]
34
2019-01-04T19:16:04.000Z
2020-02-20T19:24:25.000Z
from rest_framework import serializers from rest_framework.serializers import Serializer, SerializerMethodField class SearchSerializer(Serializer): id = SerializerMethodField() topic_source_id = serializers.CharField() topic_issuer_id = serializers.IntegerField() topic_type_id = serializers.IntegerField() topic_names = SerializerMethodField() topic_inactive = serializers.BooleanField() topic_revoked = serializers.BooleanField() @staticmethod def get_id(obj): return int(obj['django_id']) @staticmethod def get_topic_names(obj): return [name for name in obj['topic_name']]
30.47619
72
0.748438
67
640
6.910448
0.447761
0.084233
0.073434
0.12959
0
0
0
0
0
0
0
0
0.171875
640
20
73
32
0.873585
0
0
0.125
0
0
0.029688
0
0
0
0
0
0
1
0.125
false
0
0.125
0.125
0.875
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
2
212c6594332dbbcf7585fb0ccce0459e142920b0
3,196
py
Python
test_autoconf/json_prior/test_json_config.py
jonathanfrawley/PyAutoConf
a399444a7beced6d42985f08c6ac3f241ab5de4b
[ "MIT" ]
1
2020-01-23T13:13:30.000Z
2020-01-23T13:13:30.000Z
test_autoconf/json_prior/test_json_config.py
jonathanfrawley/PyAutoConf
a399444a7beced6d42985f08c6ac3f241ab5de4b
[ "MIT" ]
5
2020-12-24T09:50:09.000Z
2022-01-13T08:03:50.000Z
test_autoconf/json_prior/test_json_config.py
jonathanfrawley/PyAutoConf
a399444a7beced6d42985f08c6ac3f241ab5de4b
[ "MIT" ]
3
2020-07-26T06:17:45.000Z
2022-01-21T17:39:47.000Z
import pytest import autoconf as aconf from autoconf.mock.mock_real import SphProfile @pytest.fixture(name="geometry_profile_path") def make_geometry_profile_path(): return ["autoconf", "mock", "mock_real", "SphProfile"] def test_path_for_class(geometry_profile_path): assert aconf.path_for_class(SphProfile) == geometry_profile_path @pytest.mark.parametrize( "config_dict, paths", [ ( { "autoconf.mock.mock_real.SphProfile": "test", "autoconf.mock.mock_real.Other": "toast", }, ["autoconf.mock.mock_real.SphProfile", "autoconf.mock.mock_real.Other"], ), ( {"autoconf.mock.mock_real": {"SphProfile": "test", "Other": "toast"}}, [ "autoconf.mock.mock_real", "autoconf.mock.mock_real.SphProfile", "autoconf.mock.mock_real.Other", ], ), ( {"autoconf": {"mock": {"mock_real": {"SphProfile": "test", "Other": "toast"}}}}, [ "autoconf", "autoconf.mock", "autoconf.mock.mock_real", "autoconf.mock.mock_real.SphProfile", "autoconf.mock.mock_real.Other", ], ), ( {"autoconf": {"mock": {"mock_real.SphProfile": "test", "mock_real.Other": "toast"}}}, [ "autoconf", "autoconf.mock", "autoconf.mock.mock_real.SphProfile", "autoconf.mock.mock_real.Other", ], ), ({"SphProfile": "test", "Other": "toast"}, ["SphProfile", "Other"]), ( {"mock_real.SphProfile": "test", "mock_real.Other": "toast"}, ["mock_real.SphProfile", "mock_real.Other"], ), ( {"mock_real": {"SphProfile": "test", "Other": "toast"}}, ["mock_real", "mock_real.SphProfile", "mock_real.Other"], ), ], ) def test_paths(config_dict, paths): config = aconf.JSONPriorConfig(config_dict) assert config.paths == paths @pytest.mark.parametrize( "config_dict", [ { "autoconf.mock.mock_real.SphProfile": "test", "autoconf.mock.mock_real.Other": "toast", }, {"autoconf.mock.mock_real": {"SphProfile": "test", "Other": "toast"}}, {"autoconf":{"mock": {"mock_real": {"SphProfile": "test", "Other": "toast"}}}}, {"autoconf":{"mock": {"mock_real.SphProfile": "test", "mock_real.Other": "toast"}}}, {"SphProfile": "test", "Other": "toast"}, {"mock_real": {"SphProfile": "test", "Other": "toast"}}, ], ) def test_config_for_path(geometry_profile_path, config_dict): config = aconf.JSONPriorConfig(config_dict) assert config(geometry_profile_path) == "test" assert config(["autoconf", "mock", "mock_real", "Other"]) == "toast" def test_path_double(): config = aconf.JSONPriorConfig({"mock_real": {"SphProfile": "test"}}) assert config(["something", "mock_real", "mock_real", "SphProfile"]) == "test"
34.73913
98
0.532854
296
3,196
5.527027
0.10473
0.180929
0.224939
0.281174
0.70599
0.630807
0.515892
0.457213
0.432763
0.413203
0
0
0.295682
3,196
91
99
35.120879
0.726788
0
0
0.4875
0
0
0.390338
0.158132
0
0
0
0
0.0625
1
0.0625
false
0
0.0375
0.0125
0.1125
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
2136b551d273b148558668b62ce148cdc2d425ee
799
py
Python
tests/functional/conftest.py
staticdev/human-readable
1c3328560f9b8097e1bc3ec6fceefa486c264fd5
[ "MIT" ]
5
2021-03-10T21:22:31.000Z
2022-03-23T04:38:07.000Z
tests/functional/conftest.py
staticdev/human-readable
1c3328560f9b8097e1bc3ec6fceefa486c264fd5
[ "MIT" ]
59
2021-02-13T10:08:23.000Z
2022-03-14T19:43:55.000Z
tests/functional/conftest.py
staticdev/human-readable
1c3328560f9b8097e1bc3ec6fceefa486c264fd5
[ "MIT" ]
null
null
null
"""Fixtures for functional tests.""" import pytest from pytest_mock import MockerFixture import human_readable.i18n as i18n @pytest.fixture(scope="module") def activate_en_abbr() -> MockerFixture: """Activate abbreviated English.""" i18n.activate("en_ABBR") yield None i18n.deactivate() @pytest.fixture(scope="module") def activate_fr_fr() -> MockerFixture: """Activate French.""" i18n.activate("fr_FR") yield None i18n.deactivate() @pytest.fixture() def activate_pt_br() -> MockerFixture: """Activate Brazilian Portuguese.""" i18n.activate("pt_BR") yield None i18n.deactivate() @pytest.fixture(scope="module") def activate_ru_ru() -> MockerFixture: """Activate Russian.""" i18n.activate("ru_RU") yield None i18n.deactivate()
21.026316
40
0.692115
93
799
5.795699
0.354839
0.096475
0.096475
0.170686
0.346939
0.346939
0.215213
0.215213
0.215213
0.215213
0
0.03003
0.166458
799
37
41
21.594595
0.779279
0.157697
0
0.478261
0
0
0.061824
0
0
0
0
0
0
1
0.173913
true
0
0.130435
0
0.304348
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
215258009f10eea434896ef38a9ccec1442b84b8
434
py
Python
testData/typeinspection/fieldField.py
alek-sun/pydantic-pycharm-plugin
6b07519aadf0ff8b8a644c1f9ede88e09c687c80
[ "Apache-2.0", "MIT" ]
238
2019-08-05T12:46:09.000Z
2022-03-25T08:53:25.000Z
testData/typeinspection/fieldField.py
alek-sun/pydantic-pycharm-plugin
6b07519aadf0ff8b8a644c1f9ede88e09c687c80
[ "Apache-2.0", "MIT" ]
415
2019-07-15T17:39:35.000Z
2022-03-31T01:18:38.000Z
testData/typeinspection/fieldField.py
KotlinIsland/pydantic-pycharm-plugin
6a20563c3a174931ff49759c713c7fa609a82abb
[ "Apache-2.0", "MIT" ]
7
2019-08-09T01:03:16.000Z
2022-02-08T03:28:19.000Z
from pydantic import BaseModel, Field NUMBER = 123 class A(BaseModel): a: int = Field(int(123)) b = Field(123) c = Field(default=int(123)) d: int = Field(...) e: int = Field(NUMBER) f: int = Field(default=NUMBER) g = Field(NUMBER) h: int = Field(NUMBER) i: int = Field(default=NUMBER) j = Field(NUMBER) A(a=int(123), b=int(123), c=int(123), d=int(123), e=int(123), f=int(123), g=int(123))
21.7
85
0.589862
72
434
3.555556
0.277778
0.210938
0.054688
0.078125
0
0
0
0
0
0
0
0.098214
0.225806
434
19
86
22.842105
0.66369
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.071429
0
0.857143
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
215b4ad2706a8bd2020664e4c2e118c59b174c3d
147
py
Python
tests/fixtures/test_body_block_content/content_01_expected.py
elifesciences/elife-tools
ee345bf0e6703ef0f7e718355e85730abbdfd117
[ "MIT" ]
9
2015-04-16T08:13:31.000Z
2020-05-18T14:03:06.000Z
tests/fixtures/test_body_block_content/content_01_expected.py
elifesciences/elife-tools
ee345bf0e6703ef0f7e718355e85730abbdfd117
[ "MIT" ]
310
2015-02-11T00:30:09.000Z
2021-07-14T23:58:50.000Z
tests/fixtures/test_body_block_content/content_01_expected.py
elifesciences/elife-tools
ee345bf0e6703ef0f7e718355e85730abbdfd117
[ "MIT" ]
9
2015-02-04T01:21:28.000Z
2021-06-15T12:50:47.000Z
from collections import OrderedDict expected = OrderedDict( [("type", "section"), ("id", u"s1"), ("title", u"Introduction <i>section</i>")] )
24.5
83
0.639456
17
147
5.529412
0.764706
0
0
0
0
0
0
0
0
0
0
0.007874
0.136054
147
5
84
29.4
0.732283
0
0
0
0
0
0.319728
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
215c447b901f74f3c0cae7ee63af0d9b081f8c22
575
py
Python
SAElections/director/views.py
seanballais/SAElections
c245122c6eb1afee86fa4dc7de17b327255af508
[ "MIT" ]
1
2015-05-21T08:35:01.000Z
2015-05-21T08:35:01.000Z
SAElections/director/views.py
seanballais/SAElections
c245122c6eb1afee86fa4dc7de17b327255af508
[ "MIT" ]
null
null
null
SAElections/director/views.py
seanballais/SAElections
c245122c6eb1afee86fa4dc7de17b327255af508
[ "MIT" ]
null
null
null
from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.template.context import RequestContext from django.contrib.auth.models import User def direct(request): # The homepage user = request.user if user.is_authenticated() and not user.has_voted: return render_to_response('vote.html', RequestContext(request)) elif user.is_authenticated() and user.has_voted: return render_to_response('thank-you.html', RequestContext(request)) return render_to_response('login.html', RequestContext(request))
44.230769
76
0.786087
75
575
5.866667
0.466667
0.090909
0.145455
0.15
0.154545
0.154545
0.154545
0
0
0
0
0
0.130435
575
13
77
44.230769
0.88
0.02087
0
0
0
0
0.058719
0
0
0
0
0
0
1
0.090909
false
0
0.363636
0
0.727273
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
216320b385774dad4b86fd73e20328bde5369875
164
py
Python
run_toy.py
zhuzhenping/Wt4ElegantRL
cc9f327e34618ded51aa0f41cda8ef33242daec1
[ "Apache-2.0" ]
25
2021-09-27T06:49:46.000Z
2022-03-19T01:02:37.000Z
run_toy.py
zhuzhenping/Wt4ElegantRL
cc9f327e34618ded51aa0f41cda8ef33242daec1
[ "Apache-2.0" ]
null
null
null
run_toy.py
zhuzhenping/Wt4ElegantRL
cc9f327e34618ded51aa0f41cda8ef33242daec1
[ "Apache-2.0" ]
12
2021-10-18T06:37:47.000Z
2022-03-04T06:59:55.000Z
from runner import entry, Runner class SimpleRunner(Runner): def test(self): print('test1') if __name__ == '__main__': entry(obj=SimpleRunner())
16.4
32
0.664634
19
164
5.315789
0.789474
0
0
0
0
0
0
0
0
0
0
0.007692
0.207317
164
9
33
18.222222
0.769231
0
0
0
0
0
0.079268
0
0
0
0
0
0
1
0.166667
false
0
0.166667
0
0.5
0.166667
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
dcd2d38b693cf1cbc3c10f43ec314063579226aa
3,892
py
Python
app/models/User.py
LeilaniAnn/tasksnew
4c5ef24c86eeaa22f567c813510b96a8949e1c46
[ "MIT" ]
null
null
null
app/models/User.py
LeilaniAnn/tasksnew
4c5ef24c86eeaa22f567c813510b96a8949e1c46
[ "MIT" ]
null
null
null
app/models/User.py
LeilaniAnn/tasksnew
4c5ef24c86eeaa22f567c813510b96a8949e1c46
[ "MIT" ]
null
null
null
from system.core.model import Model import re class User(Model): def __init__(self): super(User, self).__init__() def create_user(self, info): EMAIL_REGEX = re.compile(r'^[a-zA-Z0-9\.\+_-]+@[a-zA-Z0-9\._-]+\.[a-zA-Z]*$') errors = [] if not info['name']: errors.append('Name cannot be blank') elif len(info['name']) < 2: errors.append('Name must be at least 2 characters long') if not info['email']: errors.append('Email cannot be blank') elif not EMAIL_REGEX.match(info['email']): errors.append('Email format must be valid!') if not info['password']: errors.append('Password cannot be blank') elif len(info['password']) < 8: errors.append('Password must be at least 8 characters long') elif info['password'] != info['pw_confirmation']: errors.append('Password and confirmation must match!') if not info['dob']: errors.append('MUST enter your date of birth to continue!') if errors: return {"status": False, "errors": errors} else: password = info['password'] hashed_pw = self.bcrypt.generate_password_hash(password) query = 'INSERT INTO users (name, email, pw_hash, dob, created_at, updated_at) VALUES (%s,%s,%s,%s, NOW(), NOW())' data=[info['name'], info['email'], hashed_pw, info['dob']] self.db.query_db(query, data) get_user_query = "SELECT * FROM users ORDER BY id DESC LIMIT 1" users = self.db.query_db(get_user_query) return { "status": True, "user": users[0] } def get_users(self): query = 'SELECT * FROM users' return self.db.query_db(query) def delete(self, id): query='DELETE FROM dates WHERE date_id={}'.format(id) return self.db.query_db(query) def edit(self, info): query='UPDATE dates SET task=%s, date=%s, time=%s, status=%s WHERE date_id=%s' data=[info['task'], info['date'], info['time'], info['status'], info['date_id']] return self.db.query_db(query, data) def add_task(self, info): query = 'INSERT INTO dates (session_id, task, date, time, status) VALUES (%s,%s,%s,%s,%s)' data=[info['session_id'], info['task'], info['date'], info['time'], info['status']] self.db.query_db(query, data) def get_user_by_id(self, id): query = 'SELECT * FROM users LEFT JOIN dates ON users.id=dates.session_id WHERE dates.session_id={}'.format(id) print query return self.db.query_db(query) def get_date_by_id(self, id): query='SELECT * FROM dates WHERE date_id={}'.format(id) return self.db.query_db(query) def login_user(self, login_info): EMAIL_REGEX = re.compile(r'^[a-zA-Z0-9\.\+_-]+@[a-zA-Z0-9\._-]+\.[a-zA-Z]*$') errors = [] if not login_info['email']: errors.append('E-mail field required!') elif not EMAIL_REGEX.match(login_info['email']): errors.append('Pease enter a valid e-mail address!') if not login_info['password']: errors.append('Password field required!') if errors: return {'status': False, 'errors': errors} else: password = login_info['password'] user_query = "SELECT * FROM users WHERE email = '{}' LIMIT 1".format(login_info['email']) users = self.db.query_db(user_query) if users[0]: if self.bcrypt.check_password_hash(users[0]['pw_hash'], password): return { "status": True, "user": users[0] } else: errors.append('Password incorrect!') return {'status': False, 'errors': errors}
40.123711
126
0.567318
511
3,892
4.191781
0.209393
0.052288
0.046218
0.054622
0.468254
0.30719
0.250233
0.176471
0.144725
0.098973
0
0.006456
0.283659
3,892
96
127
40.541667
0.761836
0
0
0.2125
0
0.0625
0.308068
0.031089
0
0
0
0
0
0
null
null
0.1625
0.025
null
null
0.0125
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
1
0
0
0
0
0
2
dce68c5a242c679aa4c42f92e5bc3ed20256b1dd
314
py
Python
biblepaycentral/core/cms_plugins.py
Lichtsucher/biblepaycentral
0575c9c6851bd87d35d8cda9840301ee510698e8
[ "MIT" ]
3
2018-03-18T22:36:20.000Z
2020-02-13T15:52:25.000Z
biblepaycentral/core/cms_plugins.py
Lichtsucher/biblepaycentral
0575c9c6851bd87d35d8cda9840301ee510698e8
[ "MIT" ]
null
null
null
biblepaycentral/core/cms_plugins.py
Lichtsucher/biblepaycentral
0575c9c6851bd87d35d8cda9840301ee510698e8
[ "MIT" ]
1
2018-10-16T10:51:11.000Z
2018-10-16T10:51:11.000Z
from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from cms.models.pluginmodel import CMSPlugin from django.utils.translation import ugettext_lazy as _ @plugin_pool.register_plugin class Disqus(CMSPluginBase): model = CMSPlugin render_template = "core/disqus.html"
31.4
56
0.802548
41
314
5.95122
0.585366
0.086066
0.106557
0
0
0
0
0
0
0
0
0
0.143312
314
9
57
34.888889
0.907063
0
0
0
0
0
0.052459
0
0
0
0
0
0
1
0
false
0
0.5
0
0.875
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
dce6b1460600eb52e9a6fe45a30ff22d5fb8d0f1
1,183
py
Python
xunit-autolabeler-v2/ast_parser/core/polyglot_drift_data.py
GoogleCloudPlatform/repo-automation-playground
a4c8f104c246ede002f6c18fcebfc0496c8abb94
[ "Apache-2.0" ]
5
2019-07-11T17:35:44.000Z
2021-10-09T01:49:04.000Z
xunit-autolabeler-v2/ast_parser/core/polyglot_drift_data.py
GoogleCloudPlatform/repo-automation-playground
a4c8f104c246ede002f6c18fcebfc0496c8abb94
[ "Apache-2.0" ]
36
2019-08-27T18:20:21.000Z
2022-01-12T21:29:00.000Z
xunit-autolabeler-v2/ast_parser/core/polyglot_drift_data.py
GoogleCloudPlatform/repo-automation-playground
a4c8f104c246ede002f6c18fcebfc0496c8abb94
[ "Apache-2.0" ]
13
2019-10-30T19:39:51.000Z
2021-04-04T09:31:52.000Z
# Copyright 2020 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from typing import List, Tuple from recordclass import RecordClass class PolyglotDriftData(RecordClass): """Struct for storing snippet metadata This object stores language-agnostic ("polyglot") snippet data extracted from snippet source files for use by the second-stage "polyglot" parser. """ name: str class_name: str method_name: str source_path: str start_line: int end_line: int parser: str region_tags: List[str] = [] test_methods: List[Tuple[str, str]] = [] children: List[str] = [] url: str = None http_methods: List[str] = []
30.333333
74
0.715976
167
1,183
5.023952
0.60479
0.071514
0.030989
0.038141
0
0
0
0
0
0
0
0.008511
0.20541
1,183
38
75
31.131579
0.884043
0.618766
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.133333
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
1
0
0
2
dce6b40d2e7d2e24385fea6b26cc1bbeabebeafe
660
py
Python
artificial_intelligence/statistics_and_machine_learning/stat_warmup/test_main.py
bionikspoon/hackerrank-challenges
fba792d062148f69d4af1556dfe95e1e8b120426
[ "MIT" ]
null
null
null
artificial_intelligence/statistics_and_machine_learning/stat_warmup/test_main.py
bionikspoon/hackerrank-challenges
fba792d062148f69d4af1556dfe95e1e8b120426
[ "MIT" ]
null
null
null
artificial_intelligence/statistics_and_machine_learning/stat_warmup/test_main.py
bionikspoon/hackerrank-challenges
fba792d062148f69d4af1556dfe95e1e8b120426
[ "MIT" ]
null
null
null
# coding=utf-8 import pytest from .main import describe @pytest.fixture def data(): return 64630, 11735, 14216, 99233, 14470, 4978, 73429, 38120, 51135, 67060 def test_describe_mean(data): summary = describe(data) assert summary.mean == 43900.6 def test_describe_median(data): summary = describe(data) assert summary.median == 44627.5 def test_describe_mode(data): summary = describe(data) assert summary.mode == 4978 def test_describe_std(data): summary = describe(data) assert summary.std == 30466.9 def test_describe_interval(data): summary = describe(data) assert summary.interval == (25017.0, 62784.2)
21.290323
78
0.709091
90
660
5.088889
0.444444
0.076419
0.163755
0.251092
0.393013
0.393013
0
0
0
0
0
0.155844
0.183333
660
30
79
22
0.693878
0.018182
0
0.25
0
0
0
0
0
0
0
0
0.25
1
0.3
false
0
0.1
0.05
0.45
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
2
dcf2b9ba33677fc524147bb9ab4f75c3411d5790
835
py
Python
unit_tests/click_extensions/test_decorators_exception.py
naphatkrit/click-extensions
80fc1a70419fdaf00833649677a9031bdbf8c47b
[ "MIT" ]
1
2017-06-25T13:30:57.000Z
2017-06-25T13:30:57.000Z
unit_tests/click_extensions/test_decorators_exception.py
naphatkrit/click-extensions
80fc1a70419fdaf00833649677a9031bdbf8c47b
[ "MIT" ]
null
null
null
unit_tests/click_extensions/test_decorators_exception.py
naphatkrit/click-extensions
80fc1a70419fdaf00833649677a9031bdbf8c47b
[ "MIT" ]
null
null
null
import click import pytest from click_extensions import decorators class ErrorA(Exception): pass class ErrorB(Exception): pass @click.command() @decorators.catch_exception(ErrorA) def throw_A(): raise ErrorA @click.command() @decorators.catch_exception(ErrorA) def throw_B(): raise ErrorB @click.command() @click.pass_context @decorators.catch_exception(ErrorA) def throw_A_with_context(ctx): raise ErrorA @click.command() @click.pass_context @decorators.catch_exception(ErrorA) def throw_B_with_context(ctx): raise ErrorB @pytest.mark.parametrize('command,exit_code', [ (throw_A, 2), (throw_B, -1), (throw_A_with_context, 2), (throw_B_with_context, -1), ]) def test_simple(runner, command, exit_code): result = runner.invoke(command) assert result.exit_code == exit_code
16.7
47
0.736527
112
835
5.241071
0.294643
0.081772
0.163543
0.204429
0.402044
0.402044
0.402044
0.39523
0.224872
0.224872
0
0.005634
0.149701
835
49
48
17.040816
0.821127
0
0
0.470588
0
0
0.020359
0
0
0
0
0
0.029412
1
0.147059
false
0.117647
0.088235
0
0.294118
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
0d12e933e33fb9d35f3197b206ae176e83ec3430
184
py
Python
Unit_3_Sprint_3_Challenge/OPENAQ/app.py
zwarshavsky/DS-Unit-3-Sprint-3-Productization-and-Cloud
1f90cd554287e40aeef9a901660b7c8d3a511862
[ "MIT" ]
1
2019-11-11T17:29:57.000Z
2019-11-11T17:29:57.000Z
Unit_3_Sprint_3_Challenge/OPENAQ/app.py
zwarshavsky/DS-Unit-3-Sprint-3-Productization-and-Cloud
1f90cd554287e40aeef9a901660b7c8d3a511862
[ "MIT" ]
null
null
null
Unit_3_Sprint_3_Challenge/OPENAQ/app.py
zwarshavsky/DS-Unit-3-Sprint-3-Productization-and-Cloud
1f90cd554287e40aeef9a901660b7c8d3a511862
[ "MIT" ]
null
null
null
"""OpenAQ Air Quality Dashboard with Flask.""" from flask import Flask APP = Flask(__name__) @APP.route('/') def root(): """Base view.""" return 'TODO - part 2 and beyond!'
16.727273
46
0.63587
25
184
4.52
0.84
0
0
0
0
0
0
0
0
0
0
0.006757
0.195652
184
10
47
18.4
0.756757
0.277174
0
0
0
0
0.213115
0
0
0
0
0
0
1
0.2
false
0
0.2
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
0d1bc5a81f048a1e0c7cc6062e2882deb8568b04
279
py
Python
tests/unit/utils.py
spahan/pyigd
9e445f979f93184fb7b8eaa8cd61dae8caaed94c
[ "MIT" ]
7
2018-10-02T09:48:16.000Z
2022-02-21T00:06:10.000Z
tests/unit/utils.py
spahan/pyigd
9e445f979f93184fb7b8eaa8cd61dae8caaed94c
[ "MIT" ]
3
2018-01-25T19:54:05.000Z
2022-01-18T11:02:28.000Z
tests/unit/utils.py
spahan/pyigd
9e445f979f93184fb7b8eaa8cd61dae8caaed94c
[ "MIT" ]
3
2021-01-05T14:57:16.000Z
2022-02-21T10:10:46.000Z
from aiomock import AIOMock class AsyncMock(AIOMock): def __init__(self, *args, **kwargs) -> None: super().__init__(*args, **kwargs) self.async_return_value = kwargs.get('async_return_value') self.async_side_effect = kwargs.get('async_side_effect')
31
66
0.691756
35
279
5.057143
0.514286
0.112994
0.180791
0
0
0
0
0
0
0
0
0
0.179211
279
8
67
34.875
0.772926
0
0
0
0
0
0.125448
0
0
0
0
0
0
1
0.166667
false
0
0.166667
0
0.5
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0d1e80355a2c17cb9a100fc9ff28a139c220b660
769
py
Python
pavo_cristatus/interactions/non_annotated_project_loader_interaction/non_annotated_project_loader_interaction.py
MATTHEWFRAZER/pavo_cristatus
a4b96c0eb6c454fbe38d2092e29f63457a4ee955
[ "MIT" ]
null
null
null
pavo_cristatus/interactions/non_annotated_project_loader_interaction/non_annotated_project_loader_interaction.py
MATTHEWFRAZER/pavo_cristatus
a4b96c0eb6c454fbe38d2092e29f63457a4ee955
[ "MIT" ]
null
null
null
pavo_cristatus/interactions/non_annotated_project_loader_interaction/non_annotated_project_loader_interaction.py
MATTHEWFRAZER/pavo_cristatus
a4b96c0eb6c454fbe38d2092e29f63457a4ee955
[ "MIT" ]
null
null
null
from pavo_cristatus.interactions.pavo_cristatus_result import PavoCristatusResult from pavo_cristatus.interactions.pavo_cristatus_status import PavoCristatusStatus from pavo_cristatus.project_loader.project_loader import load_non_annotated_project __all__ = ["interact"] def interact(project_root_path): """ loads non annotated symbols from a project :param project_root_path: the project root of the source :return: a set of ModuleSymbols within a result that will be manipulated with in the PavoCristatusMonad """ try: return PavoCristatusResult(load_non_annotated_project(project_root_path), PavoCristatusStatus.SUCCESS) except Exception as ex: return PavoCristatusResult(None, PavoCristatusStatus.FAILURE, ex.message)
42.722222
110
0.808843
93
769
6.419355
0.494624
0.108878
0.085427
0.097152
0.140704
0.140704
0
0
0
0
0
0
0.141743
769
18
111
42.722222
0.904545
0.263979
0
0
0
0
0.014733
0
0
0
0
0
0
1
0.111111
false
0
0.333333
0
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
0d2359fbd442482affa0ab0ac600d1e96d7ca004
300
py
Python
game_modules/map_creator_runner.py
chenalan02/SidescrollerGame
5053a4028a496681ebe19ce749344a325e09c469
[ "MIT" ]
null
null
null
game_modules/map_creator_runner.py
chenalan02/SidescrollerGame
5053a4028a496681ebe19ce749344a325e09c469
[ "MIT" ]
null
null
null
game_modules/map_creator_runner.py
chenalan02/SidescrollerGame
5053a4028a496681ebe19ce749344a325e09c469
[ "MIT" ]
null
null
null
from map_creation_tool import create_map, edit_map from map import Map if __name__ == "__main__": create_map('map1', True, 'forest.jpg', "universe.jpg", "night_sky.jpg", 'cityskyline.jpg') ''' map = Map() map.load_map('map1.json') edit_map(map, 'map1_edited.json', True) '''
27.272727
94
0.66
43
300
4.209302
0.488372
0.116022
0
0
0
0
0
0
0
0
0
0.012146
0.176667
300
11
95
27.272727
0.720648
0
0
0
0
0
0.31
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
2
0d2a6a76b179416661c1730b7f1c981a87fa2763
283
py
Python
{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/models.py
bahattincinic/cookiecutter-apistar
dc4c6f2d38809d6fb053ca30f1038b114001c097
[ "MIT" ]
2
2018-02-04T11:38:00.000Z
2018-06-15T04:58:35.000Z
{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/models.py
bahattincinic/cookiecutter-apistar
dc4c6f2d38809d6fb053ca30f1038b114001c097
[ "MIT" ]
null
null
null
{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/models.py
bahattincinic/cookiecutter-apistar
dc4c6f2d38809d6fb053ca30f1038b114001c097
[ "MIT" ]
null
null
null
from typing import Any from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String Base: Any = declarative_base() class Example(Base): __tablename__ = 'Example' id = Column(Integer, primary_key=True) name = Column(String)
18.866667
55
0.75265
35
283
5.885714
0.542857
0.135922
0
0
0
0
0
0
0
0
0
0
0.169611
283
14
56
20.214286
0.876596
0
0
0
0
0
0.024735
0
0
0
0
0
0
1
0
false
0
0.375
0
0.875
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
0d37d14a1a1f9dbd6e4e975bf236eec8276b2876
28,984
py
Python
pysnmp/HP-ICF-DHCPv6-SNOOP-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
11
2021-02-02T16:27:16.000Z
2021-08-31T06:22:49.000Z
pysnmp/HP-ICF-DHCPv6-SNOOP-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
75
2021-02-24T17:30:31.000Z
2021-12-08T00:01:18.000Z
pysnmp/HP-ICF-DHCPv6-SNOOP-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
10
2019-04-30T05:51:36.000Z
2022-02-16T03:33:41.000Z
# # PySNMP MIB module HP-ICF-DHCPv6-SNOOP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HP-ICF-DHCPv6-SNOOP-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:21:15 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ValueSizeConstraint, ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsUnion", "SingleValueConstraint") hpSwitch, = mibBuilder.importSymbols("HP-ICF-OID", "hpSwitch") VidList, = mibBuilder.importSymbols("HP-ICF-TC", "VidList") hpicfSaviObjectsPortEntry, hpicfSaviObjectsBindingEntry = mibBuilder.importSymbols("HPICF-SAVI-MIB", "hpicfSaviObjectsPortEntry", "hpicfSaviObjectsBindingEntry") InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex") InetAddressType, InetAddress = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressType", "InetAddress") VlanIndex, = mibBuilder.importSymbols("Q-BRIDGE-MIB", "VlanIndex") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance") NotificationType, ObjectIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, Integer32, IpAddress, TimeTicks, iso, ModuleIdentity, Gauge32, Counter32, MibIdentifier, Bits, Unsigned32, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "ObjectIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Integer32", "IpAddress", "TimeTicks", "iso", "ModuleIdentity", "Gauge32", "Counter32", "MibIdentifier", "Bits", "Unsigned32", "Counter64") RowStatus, TruthValue, TextualConvention, DateAndTime, MacAddress, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "TruthValue", "TextualConvention", "DateAndTime", "MacAddress", "DisplayString") hpicfDSnoopV6 = ModuleIdentity((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102)) hpicfDSnoopV6.setRevisions(('2017-11-08 00:00', '2015-01-28 00:00', '2013-10-06 00:00', '2013-04-30 00:00',)) if mibBuilder.loadTexts: hpicfDSnoopV6.setLastUpdated('201711080000Z') if mibBuilder.loadTexts: hpicfDSnoopV6.setOrganization('HP Networking') hpicfDSnoopV6Notifications = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 0)) hpicfDSnoopV6Objects = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1)) hpicfDSnoopV6Config = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1)) hpicfDSnoopV6GlobalCfg = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 1)) hpicfDSnoopV6Enable = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 1, 1), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfDSnoopV6Enable.setStatus('current') hpicfDSnoopV6VlanEnable = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 1, 2), VidList()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfDSnoopV6VlanEnable.setStatus('current') hpicfDSnoopV6DatabaseFile = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 1, 3), SnmpAdminString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfDSnoopV6DatabaseFile.setStatus('current') hpicfDSnoopV6DatabaseWriteDelay = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(15, 86400))).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfDSnoopV6DatabaseWriteDelay.setStatus('current') hpicfDSnoopV6DatabaseWriteTimeout = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 86400))).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfDSnoopV6DatabaseWriteTimeout.setStatus('current') hpicfDSnoopV6OutOfResourcesTrapCtrl = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone(1)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfDSnoopV6OutOfResourcesTrapCtrl.setStatus('current') hpicfDSnoopV6ErrantReplyTrapCtrl = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('enabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfDSnoopV6ErrantReplyTrapCtrl.setStatus('current') hpicfDSnoopV6DatabaseFTPort = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 1, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfDSnoopV6DatabaseFTPort.setStatus('current') hpicfDSnoopV6DatabaseSFTPUsername = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 1, 9), SnmpAdminString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfDSnoopV6DatabaseSFTPUsername.setStatus('current') hpicfDSnoopV6DatabaseSFTPPassword = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 1, 10), SnmpAdminString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfDSnoopV6DatabaseSFTPPassword.setStatus('current') hpicfDSnoopV6DatabaseValidateSFTPServer = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfDSnoopV6DatabaseValidateSFTPServer.setStatus('current') hpicfDSnoopV6AuthorizedServerTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 2), ) if mibBuilder.loadTexts: hpicfDSnoopV6AuthorizedServerTable.setStatus('current') hpicfDSnoopV6AuthorizedServerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 2, 1), ).setIndexNames((0, "HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6AuthorizedServerAddrType"), (0, "HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6AuthorizedServerAddress")) if mibBuilder.loadTexts: hpicfDSnoopV6AuthorizedServerEntry.setStatus('current') hpicfDSnoopV6AuthorizedServerAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 2, 1, 1), InetAddressType()) if mibBuilder.loadTexts: hpicfDSnoopV6AuthorizedServerAddrType.setStatus('current') hpicfDSnoopV6AuthorizedServerAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 2, 1, 2), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(16, 16), ValueSizeConstraint(20, 20), ))) if mibBuilder.loadTexts: hpicfDSnoopV6AuthorizedServerAddress.setStatus('current') hpicfDSnoopV6AuthorizedServerStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 2, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hpicfDSnoopV6AuthorizedServerStatus.setStatus('current') hpicfDSnoopV6GlobalStats = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 2)) hpicfDSnoopV6CSForwards = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 2, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfDSnoopV6CSForwards.setStatus('current') hpicfDSnoopV6CSMACMismatches = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 2, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfDSnoopV6CSMACMismatches.setStatus('current') hpicfDSnoopV6CSBadReleases = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 2, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfDSnoopV6CSBadReleases.setStatus('current') hpicfDSnoopV6CSUntrustedDestPorts = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 2, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfDSnoopV6CSUntrustedDestPorts.setStatus('current') hpicfDSnoopV6SCForwards = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 2, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfDSnoopV6SCForwards.setStatus('current') hpicfDSnoopV6SCUntrustedPorts = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 2, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfDSnoopV6SCUntrustedPorts.setStatus('current') hpicfDSnoopV6SCRelayReplyUntrustedPorts = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 2, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfDSnoopV6SCRelayReplyUntrustedPorts.setStatus('current') hpicfDSnoopV6SCUnauthorizedServers = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 2, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfDSnoopV6SCUnauthorizedServers.setStatus('current') hpicfDSnoopV6DBFileWriteAttempts = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 2, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfDSnoopV6DBFileWriteAttempts.setStatus('current') hpicfDSnoopV6DBFileWriteFailures = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 2, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfDSnoopV6DBFileWriteFailures.setStatus('current') hpicfDSnoopV6DBFileReadStatus = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 2, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("notConfigured", 1), ("inProgress", 2), ("succeeded", 3), ("failed", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfDSnoopV6DBFileReadStatus.setStatus('current') hpicfDSnoopV6DBFileWriteStatus = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 2, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("notConfigured", 1), ("delaying", 2), ("inProgress", 3), ("succeeded", 4), ("failed", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfDSnoopV6DBFileWriteStatus.setStatus('current') hpicfDSnoopV6DBFileLastWriteTime = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 2, 13), DateAndTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfDSnoopV6DBFileLastWriteTime.setStatus('current') hpicfDSnoopV6MaxbindPktsDropped = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 2, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfDSnoopV6MaxbindPktsDropped.setStatus('current') hpicfDSnoopV6ClearStatsOptions = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 3)) hpicfDSnoopV6ClearStats = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 3, 1), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfDSnoopV6ClearStats.setStatus('current') hpicfDSnoopV6PortMaxBindingTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 3), ) if mibBuilder.loadTexts: hpicfDSnoopV6PortMaxBindingTable.setStatus('current') hpicfDSnoopV6PortMaxBindingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 3, 1), ) hpicfSaviObjectsPortEntry.registerAugmentions(("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6PortMaxBindingEntry")) hpicfDSnoopV6PortMaxBindingEntry.setIndexNames(*hpicfSaviObjectsPortEntry.getIndexNames()) if mibBuilder.loadTexts: hpicfDSnoopV6PortMaxBindingEntry.setStatus('current') hpicfDSnoopV6PortStaticBinding = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 3, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 8192))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfDSnoopV6PortStaticBinding.setStatus('current') hpicfDSnoopV6PortDynamicBinding = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 3, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 8192))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfDSnoopV6PortDynamicBinding.setStatus('current') hpicfDSnoopV6StaticBindingTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 4), ) if mibBuilder.loadTexts: hpicfDSnoopV6StaticBindingTable.setStatus('current') hpicfDSnoopV6StaticBindingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 4, 1), ) hpicfSaviObjectsBindingEntry.registerAugmentions(("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6StaticBindingEntry")) hpicfDSnoopV6StaticBindingEntry.setIndexNames(*hpicfSaviObjectsBindingEntry.getIndexNames()) if mibBuilder.loadTexts: hpicfDSnoopV6StaticBindingEntry.setStatus('current') hpicfDSnoopV6BindingVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 4, 1, 1), VlanIndex().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfDSnoopV6BindingVlanId.setStatus('current') hpicfDSnoopV6BindingLLAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 4, 1, 2), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfDSnoopV6BindingLLAddress.setStatus('current') hpicfDSnoopV6BindingSecVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 1, 1, 4, 1, 3), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfDSnoopV6BindingSecVlan.setStatus('current') hpicfDSnoopV6SourceBindingOutOfResources = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 0, 1)).setObjects(("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDsnoopV6SourceBindingPort"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDsnoopV6SourceBindingMacAddress"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDsnoopV6SourceBindingIpAddressType"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDsnoopV6SourceBindingIpAddress"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDsnoopV6SourceBindingVlan")) if mibBuilder.loadTexts: hpicfDSnoopV6SourceBindingOutOfResources.setStatus('current') hpicfDsnoopV6SourceBindingOutOfResourcesObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 0, 2)) hpicfDsnoopV6SourceBindingPort = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 0, 2, 1), InterfaceIndex()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hpicfDsnoopV6SourceBindingPort.setStatus('current') hpicfDsnoopV6SourceBindingMacAddress = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 0, 2, 2), MacAddress()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hpicfDsnoopV6SourceBindingMacAddress.setStatus('current') hpicfDsnoopV6SourceBindingIpAddressType = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 0, 2, 3), InetAddressType()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hpicfDsnoopV6SourceBindingIpAddressType.setStatus('current') hpicfDsnoopV6SourceBindingIpAddress = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 0, 2, 4), InetAddress()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hpicfDsnoopV6SourceBindingIpAddress.setStatus('current') hpicfDsnoopV6SourceBindingVlan = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 0, 2, 5), VlanIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfDsnoopV6SourceBindingVlan.setStatus('current') hpicfDSnoopV6SourceBindingErrantReply = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 0, 3)).setObjects(("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6SourceBindingNotifyCount"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6SourceBindingErrantSrcMAC"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6SourceBindingErrantSrcIPType"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6SourceBindingErrantSrcIP")) if mibBuilder.loadTexts: hpicfDSnoopV6SourceBindingErrantReply.setStatus('current') hpicfDSnoopV6SourceBindingNotifyObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 0, 4)) hpicfDSnoopV6SourceBindingNotifyCount = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 0, 4, 1), Counter32()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hpicfDSnoopV6SourceBindingNotifyCount.setStatus('current') hpicfDSnoopV6SourceBindingErrantSrcMAC = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 0, 4, 2), MacAddress()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hpicfDSnoopV6SourceBindingErrantSrcMAC.setStatus('current') hpicfDSnoopV6SourceBindingErrantSrcIPType = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 0, 4, 3), InetAddressType()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hpicfDSnoopV6SourceBindingErrantSrcIPType.setStatus('current') hpicfDSnoopV6SourceBindingErrantSrcIP = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 0, 4, 4), InetAddress()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hpicfDSnoopV6SourceBindingErrantSrcIP.setStatus('current') hpicfDSnoopV6Conformance = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 2)) hpicfDSnoopV6Groups = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 2, 1)) hpicfDSnoopV6BaseGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 2, 1, 1)).setObjects(("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6Enable"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6VlanEnable"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6CSForwards"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6CSBadReleases"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6CSUntrustedDestPorts"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6CSMACMismatches"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6SCForwards"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6SCUnauthorizedServers"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6SCUntrustedPorts"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6SCRelayReplyUntrustedPorts")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfDSnoopV6BaseGroup = hpicfDSnoopV6BaseGroup.setStatus('current') hpicfDSnoopV6ServersGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 2, 1, 2)).setObjects(("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6AuthorizedServerStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfDSnoopV6ServersGroup = hpicfDSnoopV6ServersGroup.setStatus('current') hpicfDSnoopV6DbaseFileGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 2, 1, 3)).setObjects(("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DatabaseFile"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DatabaseWriteDelay"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DatabaseWriteTimeout"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DBFileWriteAttempts"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DBFileWriteFailures"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DBFileReadStatus"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DBFileWriteStatus"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DBFileLastWriteTime")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfDSnoopV6DbaseFileGroup = hpicfDSnoopV6DbaseFileGroup.setStatus('deprecated') hpicfDSnoopV6MaxBindingsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 2, 1, 4)).setObjects(("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6MaxbindPktsDropped"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6PortStaticBinding"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6PortDynamicBinding")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfDSnoopV6MaxBindingsGroup = hpicfDSnoopV6MaxBindingsGroup.setStatus('current') hpicfDSnoopV6StaticBindingsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 2, 1, 5)).setObjects(("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6BindingVlanId"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6BindingLLAddress"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6BindingSecVlan")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfDSnoopV6StaticBindingsGroup = hpicfDSnoopV6StaticBindingsGroup.setStatus('current') hpicfDSnoopV6ClearStatsOptionsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 2, 1, 6)).setObjects(("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6ClearStats")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfDSnoopV6ClearStatsOptionsGroup = hpicfDSnoopV6ClearStatsOptionsGroup.setStatus('current') hpicfDSnoopV6TrapObjectsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 2, 1, 7)).setObjects(("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6SourceBindingNotifyCount"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6SourceBindingErrantSrcMAC"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6SourceBindingErrantSrcIPType"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6SourceBindingErrantSrcIP"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDsnoopV6SourceBindingPort"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDsnoopV6SourceBindingMacAddress"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDsnoopV6SourceBindingIpAddressType"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDsnoopV6SourceBindingIpAddress"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDsnoopV6SourceBindingVlan"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6OutOfResourcesTrapCtrl"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6ErrantReplyTrapCtrl")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfDSnoopV6TrapObjectsGroup = hpicfDSnoopV6TrapObjectsGroup.setStatus('current') hpicfDSnoopV6TrapsGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 2, 1, 8)).setObjects(("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6SourceBindingOutOfResources"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6SourceBindingErrantReply")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfDSnoopV6TrapsGroup = hpicfDSnoopV6TrapsGroup.setStatus('current') hpicfDSnoopV6DbaseFileGroup1 = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 2, 1, 9)).setObjects(("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DatabaseFile"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DatabaseWriteDelay"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DatabaseWriteTimeout"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DBFileWriteAttempts"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DBFileWriteFailures"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DBFileReadStatus"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DBFileWriteStatus"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DBFileLastWriteTime"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DatabaseFTPort"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DatabaseSFTPUsername"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DatabaseSFTPPassword"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DatabaseValidateSFTPServer")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfDSnoopV6DbaseFileGroup1 = hpicfDSnoopV6DbaseFileGroup1.setStatus('current') hpicfDSnoopV6Compliances = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 2, 3)) hpicfDSnoopV6Compliance2 = ModuleCompliance((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 2, 3, 1)).setObjects(("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6BaseGroup"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6ServersGroup"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DbaseFileGroup"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6MaxBindingsGroup"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6StaticBindingsGroup"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6ClearStatsOptionsGroup"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6TrapObjectsGroup"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6TrapsGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfDSnoopV6Compliance2 = hpicfDSnoopV6Compliance2.setStatus('deprecated') hpicfDSnoopV6Compliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 102, 2, 3, 2)).setObjects(("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6BaseGroup"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6ServersGroup"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6MaxBindingsGroup"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6StaticBindingsGroup"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6ClearStatsOptionsGroup"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6TrapObjectsGroup"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6TrapsGroup"), ("HP-ICF-DHCPv6-SNOOP-MIB", "hpicfDSnoopV6DbaseFileGroup1")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfDSnoopV6Compliance = hpicfDSnoopV6Compliance.setStatus('current') mibBuilder.exportSymbols("HP-ICF-DHCPv6-SNOOP-MIB", hpicfDSnoopV6DatabaseWriteDelay=hpicfDSnoopV6DatabaseWriteDelay, hpicfDSnoopV6MaxbindPktsDropped=hpicfDSnoopV6MaxbindPktsDropped, hpicfDSnoopV6ClearStats=hpicfDSnoopV6ClearStats, hpicfDSnoopV6BindingVlanId=hpicfDSnoopV6BindingVlanId, hpicfDSnoopV6Compliance2=hpicfDSnoopV6Compliance2, hpicfDSnoopV6AuthorizedServerAddress=hpicfDSnoopV6AuthorizedServerAddress, hpicfDSnoopV6DBFileReadStatus=hpicfDSnoopV6DBFileReadStatus, hpicfDSnoopV6SourceBindingOutOfResources=hpicfDSnoopV6SourceBindingOutOfResources, hpicfDSnoopV6DatabaseSFTPPassword=hpicfDSnoopV6DatabaseSFTPPassword, hpicfDSnoopV6AuthorizedServerTable=hpicfDSnoopV6AuthorizedServerTable, hpicfDSnoopV6PortMaxBindingEntry=hpicfDSnoopV6PortMaxBindingEntry, hpicfDSnoopV6StaticBindingTable=hpicfDSnoopV6StaticBindingTable, hpicfDSnoopV6BindingSecVlan=hpicfDSnoopV6BindingSecVlan, hpicfDSnoopV6Objects=hpicfDSnoopV6Objects, hpicfDsnoopV6SourceBindingIpAddressType=hpicfDsnoopV6SourceBindingIpAddressType, hpicfDSnoopV6VlanEnable=hpicfDSnoopV6VlanEnable, hpicfDSnoopV6SourceBindingErrantSrcIPType=hpicfDSnoopV6SourceBindingErrantSrcIPType, hpicfDSnoopV6ClearStatsOptionsGroup=hpicfDSnoopV6ClearStatsOptionsGroup, hpicfDSnoopV6CSForwards=hpicfDSnoopV6CSForwards, hpicfDSnoopV6PortDynamicBinding=hpicfDSnoopV6PortDynamicBinding, hpicfDSnoopV6DatabaseWriteTimeout=hpicfDSnoopV6DatabaseWriteTimeout, hpicfDSnoopV6DBFileWriteStatus=hpicfDSnoopV6DBFileWriteStatus, hpicfDSnoopV6SourceBindingNotifyCount=hpicfDSnoopV6SourceBindingNotifyCount, hpicfDSnoopV6SourceBindingErrantSrcIP=hpicfDSnoopV6SourceBindingErrantSrcIP, hpicfDSnoopV6MaxBindingsGroup=hpicfDSnoopV6MaxBindingsGroup, hpicfDSnoopV6AuthorizedServerAddrType=hpicfDSnoopV6AuthorizedServerAddrType, hpicfDSnoopV6DbaseFileGroup=hpicfDSnoopV6DbaseFileGroup, hpicfDSnoopV6ErrantReplyTrapCtrl=hpicfDSnoopV6ErrantReplyTrapCtrl, hpicfDSnoopV6DatabaseSFTPUsername=hpicfDSnoopV6DatabaseSFTPUsername, hpicfDSnoopV6CSUntrustedDestPorts=hpicfDSnoopV6CSUntrustedDestPorts, hpicfDSnoopV6DBFileWriteFailures=hpicfDSnoopV6DBFileWriteFailures, hpicfDSnoopV6StaticBindingEntry=hpicfDSnoopV6StaticBindingEntry, hpicfDSnoopV6Groups=hpicfDSnoopV6Groups, hpicfDsnoopV6SourceBindingOutOfResourcesObjects=hpicfDsnoopV6SourceBindingOutOfResourcesObjects, hpicfDSnoopV6SourceBindingErrantSrcMAC=hpicfDSnoopV6SourceBindingErrantSrcMAC, hpicfDSnoopV6TrapObjectsGroup=hpicfDSnoopV6TrapObjectsGroup, hpicfDSnoopV6SCUntrustedPorts=hpicfDSnoopV6SCUntrustedPorts, hpicfDSnoopV6OutOfResourcesTrapCtrl=hpicfDSnoopV6OutOfResourcesTrapCtrl, hpicfDSnoopV6CSBadReleases=hpicfDSnoopV6CSBadReleases, hpicfDSnoopV6DbaseFileGroup1=hpicfDSnoopV6DbaseFileGroup1, hpicfDSnoopV6ClearStatsOptions=hpicfDSnoopV6ClearStatsOptions, hpicfDSnoopV6DBFileLastWriteTime=hpicfDSnoopV6DBFileLastWriteTime, hpicfDSnoopV6PortStaticBinding=hpicfDSnoopV6PortStaticBinding, hpicfDSnoopV6SCForwards=hpicfDSnoopV6SCForwards, PYSNMP_MODULE_ID=hpicfDSnoopV6, hpicfDSnoopV6PortMaxBindingTable=hpicfDSnoopV6PortMaxBindingTable, hpicfDSnoopV6BindingLLAddress=hpicfDSnoopV6BindingLLAddress, hpicfDsnoopV6SourceBindingMacAddress=hpicfDsnoopV6SourceBindingMacAddress, hpicfDSnoopV6AuthorizedServerEntry=hpicfDSnoopV6AuthorizedServerEntry, hpicfDSnoopV6AuthorizedServerStatus=hpicfDSnoopV6AuthorizedServerStatus, hpicfDSnoopV6SourceBindingNotifyObjects=hpicfDSnoopV6SourceBindingNotifyObjects, hpicfDSnoopV6Conformance=hpicfDSnoopV6Conformance, hpicfDSnoopV6BaseGroup=hpicfDSnoopV6BaseGroup, hpicfDsnoopV6SourceBindingPort=hpicfDsnoopV6SourceBindingPort, hpicfDSnoopV6Compliance=hpicfDSnoopV6Compliance, hpicfDSnoopV6Enable=hpicfDSnoopV6Enable, hpicfDSnoopV6SCUnauthorizedServers=hpicfDSnoopV6SCUnauthorizedServers, hpicfDSnoopV6CSMACMismatches=hpicfDSnoopV6CSMACMismatches, hpicfDsnoopV6SourceBindingIpAddress=hpicfDsnoopV6SourceBindingIpAddress, hpicfDSnoopV6SourceBindingErrantReply=hpicfDSnoopV6SourceBindingErrantReply, hpicfDSnoopV6GlobalStats=hpicfDSnoopV6GlobalStats, hpicfDSnoopV6StaticBindingsGroup=hpicfDSnoopV6StaticBindingsGroup, hpicfDSnoopV6DatabaseFile=hpicfDSnoopV6DatabaseFile, hpicfDSnoopV6Config=hpicfDSnoopV6Config, hpicfDSnoopV6DatabaseValidateSFTPServer=hpicfDSnoopV6DatabaseValidateSFTPServer, hpicfDSnoopV6SCRelayReplyUntrustedPorts=hpicfDSnoopV6SCRelayReplyUntrustedPorts, hpicfDSnoopV6ServersGroup=hpicfDSnoopV6ServersGroup, hpicfDSnoopV6Notifications=hpicfDSnoopV6Notifications, hpicfDSnoopV6TrapsGroup=hpicfDSnoopV6TrapsGroup, hpicfDSnoopV6DBFileWriteAttempts=hpicfDSnoopV6DBFileWriteAttempts, hpicfDSnoopV6Compliances=hpicfDSnoopV6Compliances, hpicfDsnoopV6SourceBindingVlan=hpicfDsnoopV6SourceBindingVlan, hpicfDSnoopV6=hpicfDSnoopV6, hpicfDSnoopV6DatabaseFTPort=hpicfDSnoopV6DatabaseFTPort, hpicfDSnoopV6GlobalCfg=hpicfDSnoopV6GlobalCfg)
162.831461
4,751
0.77943
2,981
28,984
7.577659
0.082523
0.018814
0.040418
0.05879
0.422595
0.359821
0.309221
0.278189
0.272522
0.266501
0
0.08843
0.075317
28,984
177
4,752
163.751412
0.754412
0.011731
0
0.065476
0
0
0.218614
0.15509
0
0
0
0
0
1
0
false
0.02381
0.077381
0
0.077381
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0d39c4853c76269a10c08ead1723c69d07422299
75,411
py
Python
pysnmp/ESI-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
11
2021-02-02T16:27:16.000Z
2021-08-31T06:22:49.000Z
pysnmp/ESI-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
75
2021-02-24T17:30:31.000Z
2021-12-08T00:01:18.000Z
pysnmp/ESI-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
10
2019-04-30T05:51:36.000Z
2022-02-16T03:33:41.000Z
# # PySNMP MIB module ESI-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ESI-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:52:21 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") iso, NotificationType, Counter64, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, Integer32, Counter32, ObjectIdentity, Unsigned32, MibIdentifier, enterprises, Bits, Gauge32, TimeTicks, ModuleIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "NotificationType", "Counter64", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "Integer32", "Counter32", "ObjectIdentity", "Unsigned32", "MibIdentifier", "enterprises", "Bits", "Gauge32", "TimeTicks", "ModuleIdentity") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") esi = MibIdentifier((1, 3, 6, 1, 4, 1, 683)) general = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 1)) commands = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 2)) esiSNMP = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 3)) esiSNMPCommands = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 3, 2)) driver = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 4)) tokenRing = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 5)) printServers = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6)) psGeneral = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 1)) psOutput = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 2)) psProtocols = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 3)) genProtocols = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 1, 15)) outputCommands = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 2, 2)) outputConfigure = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 2, 3)) outputJobLog = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 2, 6)) trCommands = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 5, 2)) trConfigure = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 5, 3)) tcpip = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 3, 1)) netware = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 3, 2)) vines = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 3, 3)) lanManager = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 3, 4)) eTalk = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 3, 5)) tcpipCommands = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 3)) tcpipConfigure = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4)) tcpipStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 5)) nwCommands = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 3)) nwConfigure = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4)) nwStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 5)) bvCommands = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 3)) bvConfigure = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 4)) bvStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 5)) eTalkCommands = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 3)) eTalkConfigure = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 4)) eTalkStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 5)) genGroupVersion = MibScalar((1, 3, 6, 1, 4, 1, 683, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: genGroupVersion.setStatus('mandatory') genMIBVersion = MibScalar((1, 3, 6, 1, 4, 1, 683, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: genMIBVersion.setStatus('mandatory') genProductName = MibScalar((1, 3, 6, 1, 4, 1, 683, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readonly") if mibBuilder.loadTexts: genProductName.setStatus('mandatory') genProductNumber = MibScalar((1, 3, 6, 1, 4, 1, 683, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 5))).setMaxAccess("readonly") if mibBuilder.loadTexts: genProductNumber.setStatus('mandatory') genSerialNumber = MibScalar((1, 3, 6, 1, 4, 1, 683, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 7))).setMaxAccess("readonly") if mibBuilder.loadTexts: genSerialNumber.setStatus('mandatory') genHWAddress = MibScalar((1, 3, 6, 1, 4, 1, 683, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(6, 6)).setFixedLength(6)).setMaxAccess("readonly") if mibBuilder.loadTexts: genHWAddress.setStatus('mandatory') genCableType = MibScalar((1, 3, 6, 1, 4, 1, 683, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("tenbase2", 1), ("tenbaseT", 2), ("aui", 3), ("utp", 4), ("stp", 5), ("fiber100fx", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: genCableType.setStatus('mandatory') genDateCode = MibScalar((1, 3, 6, 1, 4, 1, 683, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10))).setMaxAccess("readonly") if mibBuilder.loadTexts: genDateCode.setStatus('mandatory') genVersion = MibScalar((1, 3, 6, 1, 4, 1, 683, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10))).setMaxAccess("readonly") if mibBuilder.loadTexts: genVersion.setStatus('mandatory') genConfigurationDirty = MibScalar((1, 3, 6, 1, 4, 1, 683, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: genConfigurationDirty.setStatus('mandatory') genCompanyName = MibScalar((1, 3, 6, 1, 4, 1, 683, 1, 11), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 30))).setMaxAccess("readonly") if mibBuilder.loadTexts: genCompanyName.setStatus('mandatory') genCompanyLoc = MibScalar((1, 3, 6, 1, 4, 1, 683, 1, 12), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 30))).setMaxAccess("readonly") if mibBuilder.loadTexts: genCompanyLoc.setStatus('mandatory') genCompanyPhone = MibScalar((1, 3, 6, 1, 4, 1, 683, 1, 13), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 15))).setMaxAccess("readonly") if mibBuilder.loadTexts: genCompanyPhone.setStatus('mandatory') genCompanyTechSupport = MibScalar((1, 3, 6, 1, 4, 1, 683, 1, 14), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: genCompanyTechSupport.setStatus('mandatory') genNumProtocols = MibScalar((1, 3, 6, 1, 4, 1, 683, 1, 15, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: genNumProtocols.setStatus('mandatory') genProtocolTable = MibTable((1, 3, 6, 1, 4, 1, 683, 1, 15, 2), ) if mibBuilder.loadTexts: genProtocolTable.setStatus('mandatory') genProtocolEntry = MibTableRow((1, 3, 6, 1, 4, 1, 683, 1, 15, 2, 1), ).setIndexNames((0, "ESI-MIB", "genProtocolIndex")) if mibBuilder.loadTexts: genProtocolEntry.setStatus('mandatory') genProtocolIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 1, 15, 2, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: genProtocolIndex.setStatus('mandatory') genProtocolDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 1, 15, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: genProtocolDescr.setStatus('mandatory') genProtocolID = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 1, 15, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("tcp-ip", 1), ("netware", 2), ("vines", 3), ("lanmanger", 4), ("ethertalk", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: genProtocolID.setStatus('mandatory') genSysUpTimeString = MibScalar((1, 3, 6, 1, 4, 1, 683, 1, 16), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 35))).setMaxAccess("readonly") if mibBuilder.loadTexts: genSysUpTimeString.setStatus('mandatory') cmdGroupVersion = MibScalar((1, 3, 6, 1, 4, 1, 683, 2, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cmdGroupVersion.setStatus('mandatory') cmdReset = MibScalar((1, 3, 6, 1, 4, 1, 683, 2, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: cmdReset.setStatus('optional') cmdPrintConfig = MibScalar((1, 3, 6, 1, 4, 1, 683, 2, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: cmdPrintConfig.setStatus('optional') cmdRestoreDefaults = MibScalar((1, 3, 6, 1, 4, 1, 683, 2, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: cmdRestoreDefaults.setStatus('optional') snmpGroupVersion = MibScalar((1, 3, 6, 1, 4, 1, 683, 3, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpGroupVersion.setStatus('mandatory') snmpRestoreDefaults = MibScalar((1, 3, 6, 1, 4, 1, 683, 3, 2, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: snmpRestoreDefaults.setStatus('optional') snmpGetCommunityName = MibScalar((1, 3, 6, 1, 4, 1, 683, 3, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: snmpGetCommunityName.setStatus('optional') snmpSetCommunityName = MibScalar((1, 3, 6, 1, 4, 1, 683, 3, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: snmpSetCommunityName.setStatus('optional') snmpTrapCommunityName = MibScalar((1, 3, 6, 1, 4, 1, 683, 3, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: snmpTrapCommunityName.setStatus('optional') driverGroupVersion = MibScalar((1, 3, 6, 1, 4, 1, 683, 4, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: driverGroupVersion.setStatus('mandatory') driverRXPackets = MibScalar((1, 3, 6, 1, 4, 1, 683, 4, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: driverRXPackets.setStatus('mandatory') driverTXPackets = MibScalar((1, 3, 6, 1, 4, 1, 683, 4, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: driverTXPackets.setStatus('mandatory') driverRXPacketsUnavailable = MibScalar((1, 3, 6, 1, 4, 1, 683, 4, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: driverRXPacketsUnavailable.setStatus('mandatory') driverRXPacketErrors = MibScalar((1, 3, 6, 1, 4, 1, 683, 4, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: driverRXPacketErrors.setStatus('mandatory') driverTXPacketErrors = MibScalar((1, 3, 6, 1, 4, 1, 683, 4, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: driverTXPacketErrors.setStatus('mandatory') driverTXPacketRetries = MibScalar((1, 3, 6, 1, 4, 1, 683, 4, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: driverTXPacketRetries.setStatus('mandatory') driverChecksumErrors = MibScalar((1, 3, 6, 1, 4, 1, 683, 4, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: driverChecksumErrors.setStatus('mandatory') trGroupVersion = MibScalar((1, 3, 6, 1, 4, 1, 683, 5, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trGroupVersion.setStatus('mandatory') trRestoreDefaults = MibScalar((1, 3, 6, 1, 4, 1, 683, 5, 2, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: trRestoreDefaults.setStatus('optional') trPriority = MibScalar((1, 3, 6, 1, 4, 1, 683, 5, 3, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 6))).setMaxAccess("readwrite") if mibBuilder.loadTexts: trPriority.setStatus('optional') trEarlyTokenRelease = MibScalar((1, 3, 6, 1, 4, 1, 683, 5, 3, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: trEarlyTokenRelease.setStatus('optional') trPacketSize = MibScalar((1, 3, 6, 1, 4, 1, 683, 5, 3, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("one-k", 1), ("two-k", 2), ("four-k", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: trPacketSize.setStatus('optional') trRouting = MibScalar((1, 3, 6, 1, 4, 1, 683, 5, 3, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("off", 1), ("all-None", 2), ("single-All", 3), ("single-None", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: trRouting.setStatus('optional') trLocallyAdminAddr = MibScalar((1, 3, 6, 1, 4, 1, 683, 5, 3, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(6, 6)).setFixedLength(6)).setMaxAccess("readwrite") if mibBuilder.loadTexts: trLocallyAdminAddr.setStatus('optional') psGroupVersion = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: psGroupVersion.setStatus('mandatory') psJetAdminEnabled = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: psJetAdminEnabled.setStatus('mandatory') psVerifyConfiguration = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("getvalue", 0), ("serial-configuration", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: psVerifyConfiguration.setStatus('optional') outputGroupVersion = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 2, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outputGroupVersion.setStatus('mandatory') outputRestoreDefaults = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 2, 2, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outputRestoreDefaults.setStatus('mandatory') outputCommandsTable = MibTable((1, 3, 6, 1, 4, 1, 683, 6, 2, 2, 2), ) if mibBuilder.loadTexts: outputCommandsTable.setStatus('mandatory') outputCommandsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 683, 6, 2, 2, 2, 1), ).setIndexNames((0, "ESI-MIB", "outputIndex")) if mibBuilder.loadTexts: outputCommandsEntry.setStatus('mandatory') outputCancelCurrentJob = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outputCancelCurrentJob.setStatus('optional') outputNumPorts = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outputNumPorts.setStatus('mandatory') outputTable = MibTable((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2), ) if mibBuilder.loadTexts: outputTable.setStatus('mandatory') outputEntry = MibTableRow((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1), ).setIndexNames((0, "ESI-MIB", "outputIndex")) if mibBuilder.loadTexts: outputEntry.setStatus('mandatory') outputIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outputIndex.setStatus('mandatory') outputName = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 15))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outputName.setStatus('mandatory') outputStatusString = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly") if mibBuilder.loadTexts: outputStatusString.setStatus('mandatory') outputStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("on-Line", 1), ("off-Line", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: outputStatus.setStatus('mandatory') outputExtendedStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 15))).clone(namedValues=NamedValues(("none", 1), ("no-Printer-Attached", 2), ("toner-Low", 3), ("paper-Out", 4), ("paper-Jam", 5), ("door-Open", 6), ("printer-Error", 15)))).setMaxAccess("readonly") if mibBuilder.loadTexts: outputExtendedStatus.setStatus('mandatory') outputPrinter = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("hp-III", 1), ("hp-IIISi", 2), ("ibm", 3), ("no-Specific-Printer", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outputPrinter.setStatus('optional') outputLanguageSwitching = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("off", 1), ("pcl", 2), ("postScript", 3), ("als", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outputLanguageSwitching.setStatus('optional') outputConfigLanguage = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("text", 1), ("pcl", 2), ("postScript", 3), ("off", 4), ("epl-zpl", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outputConfigLanguage.setStatus('mandatory') outputPCLString = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(127, 127)).setFixedLength(127)).setMaxAccess("readwrite") if mibBuilder.loadTexts: outputPCLString.setStatus('optional') outputPSString = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 10), OctetString().subtype(subtypeSpec=ValueSizeConstraint(127, 127)).setFixedLength(127)).setMaxAccess("readwrite") if mibBuilder.loadTexts: outputPSString.setStatus('optional') outputCascaded = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outputCascaded.setStatus('optional') outputSetting = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(32758, 32759, 32760, 32761, 32762, 32763, 32764, 32765, 32766, 32767))).clone(namedValues=NamedValues(("serial-infrared", 32758), ("serial-bidirectional", 32759), ("serial-unidirectional", 32760), ("serial-input", 32761), ("parallel-compatibility-no-bidi", 32762), ("ieee-1284-std-nibble-mode", 32763), ("z-Link", 32764), ("internal", 32765), ("ieee-1284-ecp-or-fast-nibble-mode", 32766), ("extendedLink", 32767)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outputSetting.setStatus('mandatory') outputOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("no-Owner", 1), ("tcpip", 2), ("netware", 3), ("vines", 4), ("lanManager", 5), ("etherTalk", 6), ("config-Page", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: outputOwner.setStatus('mandatory') outputBIDIStatusEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outputBIDIStatusEnabled.setStatus('optional') outputPrinterModel = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 15), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 60))).setMaxAccess("readonly") if mibBuilder.loadTexts: outputPrinterModel.setStatus('optional') outputPrinterDisplay = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 16), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 30))).setMaxAccess("readonly") if mibBuilder.loadTexts: outputPrinterDisplay.setStatus('optional') outputCapabilities = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4, 8, 16, 32, 64, 128, 256, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824))).clone(namedValues=NamedValues(("serial-Uni-Baud-9600", 1), ("serial-Uni-Baud-19200", 2), ("serial-Uni-Baud-38400", 4), ("serial-Uni-Baud-57600", 8), ("serial-Uni-Baud-115200", 16), ("serial-bidi-Baud-9600", 32), ("serial-bidi-Baud-19200", 64), ("serial-bidi-Baud-38400", 128), ("serial-bidi-Baud-57600", 256), ("zpl-epl-capable", 262144), ("serial-irin", 524288), ("serial-in", 1048576), ("serial-config-settings", 2097152), ("parallel-compatibility-no-bidi", 4194304), ("ieee-1284-std-nibble-mode", 8388608), ("z-link", 16777216), ("bidirectional", 33554432), ("serial-Software-Handshake", 67108864), ("serial-Output", 134217728), ("extendedLink", 268435456), ("internal", 536870912), ("ieee-1284-ecp-or-fast-nibble-mode", 1073741824)))).setMaxAccess("readonly") if mibBuilder.loadTexts: outputCapabilities.setStatus('mandatory') outputHandshake = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("not-Supported", 1), ("hardware-Software", 2), ("hardware", 3), ("software", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outputHandshake.setStatus('optional') outputDataBits = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(7, 8, 255))).clone(namedValues=NamedValues(("seven-bits", 7), ("eight-bits", 8), ("not-Supported", 255)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outputDataBits.setStatus('optional') outputStopBits = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 255))).clone(namedValues=NamedValues(("one-bit", 1), ("two-bits", 2), ("not-Supported", 255)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outputStopBits.setStatus('optional') outputParity = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 255))).clone(namedValues=NamedValues(("none", 1), ("odd", 2), ("even", 3), ("not-Supported", 255)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outputParity.setStatus('optional') outputBaudRate = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("unidirectional-9600", 1), ("unidirectional-19200", 2), ("unidirectional-38400", 3), ("unidirectional-57600", 4), ("unidirectional-115200", 5), ("bidirectional-9600", 6), ("bidirectional-19200", 7), ("bidirectional-38400", 8), ("bidirectional-57600", 9)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outputBaudRate.setStatus('optional') outputProtocolManager = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 3, 2, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("protocol-none", 0), ("protocol-compatibility", 1), ("protocol-1284-4", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: outputProtocolManager.setStatus('optional') outputDisplayMask = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 2, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outputDisplayMask.setStatus('mandatory') outputAvailableTrapsMask = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 2, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outputAvailableTrapsMask.setStatus('mandatory') outputNumLogEntries = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 2, 6, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outputNumLogEntries.setStatus('mandatory') outputJobLogTable = MibTable((1, 3, 6, 1, 4, 1, 683, 6, 2, 6, 2), ) if mibBuilder.loadTexts: outputJobLogTable.setStatus('mandatory') outputJobLogEntry = MibTableRow((1, 3, 6, 1, 4, 1, 683, 6, 2, 6, 2, 1), ).setIndexNames((0, "ESI-MIB", "outputIndex")) if mibBuilder.loadTexts: outputJobLogEntry.setStatus('mandatory') outputJobLogInformation = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 6, 2, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: outputJobLogInformation.setStatus('mandatory') outputJobLogTime = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 6, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 50))).setMaxAccess("readonly") if mibBuilder.loadTexts: outputJobLogTime.setStatus('mandatory') outputTotalJobTable = MibTable((1, 3, 6, 1, 4, 1, 683, 6, 2, 6, 3), ) if mibBuilder.loadTexts: outputTotalJobTable.setStatus('mandatory') outputTotalJobEntry = MibTableRow((1, 3, 6, 1, 4, 1, 683, 6, 2, 6, 3, 1), ).setIndexNames((0, "ESI-MIB", "outputTotalJobIndex")) if mibBuilder.loadTexts: outputTotalJobEntry.setStatus('mandatory') outputTotalJobIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 6, 3, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outputTotalJobIndex.setStatus('mandatory') outputTotalJobsLogged = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 2, 6, 3, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outputTotalJobsLogged.setStatus('mandatory') tcpipGroupVersion = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpipGroupVersion.setStatus('mandatory') tcpipEnabled = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipEnabled.setStatus('optional') tcpipRestoreDefaults = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 3, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipRestoreDefaults.setStatus('optional') tcpipFirmwareUpgrade = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 3, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipFirmwareUpgrade.setStatus('optional') tcpipIPAddress = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipIPAddress.setStatus('optional') tcpipDefaultGateway = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipDefaultGateway.setStatus('optional') tcpipSubnetMask = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipSubnetMask.setStatus('optional') tcpipUsingNetProtocols = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipUsingNetProtocols.setStatus('optional') tcpipBootProtocolsEnabled = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipBootProtocolsEnabled.setStatus('optional') tcpipIPAddressSource = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("permanent", 1), ("default", 2), ("rarp", 3), ("bootp", 4), ("dhcp", 5), ("glean", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpipIPAddressSource.setStatus('optional') tcpipIPAddressServerAddress = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 7), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpipIPAddressServerAddress.setStatus('optional') tcpipTimeoutChecking = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipTimeoutChecking.setStatus('optional') tcpipNumTraps = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpipNumTraps.setStatus('mandatory') tcpipTrapTable = MibTable((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 10), ) if mibBuilder.loadTexts: tcpipTrapTable.setStatus('mandatory') tcpipTrapEntry = MibTableRow((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 10, 1), ).setIndexNames((0, "ESI-MIB", "tcpipTrapIndex")) if mibBuilder.loadTexts: tcpipTrapEntry.setStatus('mandatory') tcpipTrapIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 10, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpipTrapIndex.setStatus('mandatory') tcpipTrapDestination = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 10, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipTrapDestination.setStatus('optional') tcpipProtocolTrapMask = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 10, 1, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipProtocolTrapMask.setStatus('optional') tcpipPrinterTrapMask = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 10, 1, 4), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipPrinterTrapMask.setStatus('optional') tcpipOutputTrapMask = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 10, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipOutputTrapMask.setStatus('optional') tcpipBanners = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipBanners.setStatus('optional') tcpipWinsAddress = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 12), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipWinsAddress.setStatus('optional') tcpipWinsAddressSource = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("dhcp", 1), ("permanent", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipWinsAddressSource.setStatus('optional') tcpipConfigPassword = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 14), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(5, 24))).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipConfigPassword.setStatus('optional') tcpipTimeoutCheckingValue = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipTimeoutCheckingValue.setStatus('optional') tcpipArpInterval = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 30))).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipArpInterval.setStatus('optional') tcpipRawPortNumber = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 17), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipRawPortNumber.setStatus('optional') tcpipNumSecurity = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 18), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpipNumSecurity.setStatus('mandatory') tcpipSecurityTable = MibTable((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 19), ) if mibBuilder.loadTexts: tcpipSecurityTable.setStatus('mandatory') tcpipSecurityEntry = MibTableRow((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 19, 1), ).setIndexNames((0, "ESI-MIB", "tcpipSecurityIndex")) if mibBuilder.loadTexts: tcpipSecurityEntry.setStatus('mandatory') tcpipSecurityIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 19, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpipSecurityIndex.setStatus('mandatory') tcpipSecureStartIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 19, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipSecureStartIPAddress.setStatus('optional') tcpipSecureEndIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 19, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipSecureEndIPAddress.setStatus('optional') tcpipSecurePrinterMask = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 19, 1, 4), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipSecurePrinterMask.setStatus('optional') tcpipSecureAdminEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 19, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipSecureAdminEnabled.setStatus('optional') tcpipLowBandwidth = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipLowBandwidth.setStatus('optional') tcpipNumLogicalPrinters = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 21), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpipNumLogicalPrinters.setStatus('mandatory') tcpipMLPTable = MibTable((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 22), ) if mibBuilder.loadTexts: tcpipMLPTable.setStatus('mandatory') tcpipMLPEntry = MibTableRow((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 22, 1), ).setIndexNames((0, "ESI-MIB", "tcpipMLPIndex")) if mibBuilder.loadTexts: tcpipMLPEntry.setStatus('mandatory') tcpipMLPIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 22, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpipMLPIndex.setStatus('optional') tcpipMLPName = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 22, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipMLPName.setStatus('optional') tcpipMLPPort = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 22, 1, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipMLPPort.setStatus('optional') tcpipMLPTCPPort = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 22, 1, 4), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipMLPTCPPort.setStatus('optional') tcpipMLPPreString = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 22, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipMLPPreString.setStatus('optional') tcpipMLPPostString = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 22, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipMLPPostString.setStatus('optional') tcpipMLPDeleteBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 22, 1, 7), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipMLPDeleteBytes.setStatus('optional') tcpipSmtpServerAddr = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 23), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipSmtpServerAddr.setStatus('optional') tcpipNumSmtpDestinations = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 24), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpipNumSmtpDestinations.setStatus('mandatory') tcpipSmtpTable = MibTable((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 25), ) if mibBuilder.loadTexts: tcpipSmtpTable.setStatus('mandatory') tcpipSmtpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 25, 1), ).setIndexNames((0, "ESI-MIB", "tcpipSmtpIndex")) if mibBuilder.loadTexts: tcpipSmtpEntry.setStatus('mandatory') tcpipSmtpIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 25, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpipSmtpIndex.setStatus('mandatory') tcpipSmtpEmailAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 25, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(64, 64)).setFixedLength(64)).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipSmtpEmailAddr.setStatus('optional') tcpipSmtpProtocolMask = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 25, 1, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipSmtpProtocolMask.setStatus('optional') tcpipSmtpPrinterMask = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 25, 1, 4), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipSmtpPrinterMask.setStatus('optional') tcpipSmtpOutputMask = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 25, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipSmtpOutputMask.setStatus('optional') tcpipWebAdminName = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 26), OctetString().subtype(subtypeSpec=ValueSizeConstraint(25, 25)).setFixedLength(25)).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipWebAdminName.setStatus('optional') tcpipWebAdminPassword = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 27), OctetString().subtype(subtypeSpec=ValueSizeConstraint(25, 25)).setFixedLength(25)).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipWebAdminPassword.setStatus('optional') tcpipWebUserName = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 28), OctetString().subtype(subtypeSpec=ValueSizeConstraint(25, 25)).setFixedLength(25)).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipWebUserName.setStatus('optional') tcpipWebUserPassword = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 29), OctetString().subtype(subtypeSpec=ValueSizeConstraint(25, 25)).setFixedLength(25)).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipWebUserPassword.setStatus('optional') tcpipWebHtttpPort = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 30), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipWebHtttpPort.setStatus('optional') tcpipWebFaqURL = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 31), OctetString().subtype(subtypeSpec=ValueSizeConstraint(64, 64)).setFixedLength(64)).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipWebFaqURL.setStatus('optional') tcpipWebUpdateURL = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 32), OctetString().subtype(subtypeSpec=ValueSizeConstraint(64, 64)).setFixedLength(64)).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipWebUpdateURL.setStatus('optional') tcpipWebCustomLinkName = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 33), OctetString().subtype(subtypeSpec=ValueSizeConstraint(25, 25)).setFixedLength(25)).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipWebCustomLinkName.setStatus('optional') tcpipWebCustomLinkURL = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 34), OctetString().subtype(subtypeSpec=ValueSizeConstraint(64, 64)).setFixedLength(64)).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipWebCustomLinkURL.setStatus('optional') tcpipPOP3ServerAddress = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 35), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipPOP3ServerAddress.setStatus('optional') tcpipPOP3PollInterval = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 36), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipPOP3PollInterval.setStatus('mandatory') tcpipPOP3UserName = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 37), OctetString().subtype(subtypeSpec=ValueSizeConstraint(64, 64)).setFixedLength(64)).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipPOP3UserName.setStatus('optional') tcpipPOP3Password = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 38), OctetString().subtype(subtypeSpec=ValueSizeConstraint(20, 20)).setFixedLength(20)).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipPOP3Password.setStatus('optional') tcpipDomainName = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 4, 39), OctetString().subtype(subtypeSpec=ValueSizeConstraint(64, 64)).setFixedLength(64)).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpipDomainName.setStatus('optional') tcpipError = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 5, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpipError.setStatus('optional') tcpipDisplayMask = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpipDisplayMask.setStatus('mandatory') nwGroupVersion = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nwGroupVersion.setStatus('mandatory') nwEnabled = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwEnabled.setStatus('optional') nwRestoreDefaults = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 3, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwRestoreDefaults.setStatus('optional') nwFirmwareUpgrade = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 3, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwFirmwareUpgrade.setStatus('optional') nwFrameFormat = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("unknown", 1), ("ethernet-II", 2), ("ethernet-802-3", 3), ("ethernet-802-2", 4), ("ethernet-Snap", 5), ("token-Ring", 6), ("token-Ring-Snap", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: nwFrameFormat.setStatus('optional') nwSetFrameFormat = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("auto-Sense", 1), ("forced-Ethernet-II", 2), ("forced-Ethernet-802-3", 3), ("forced-Ethernet-802-2", 4), ("forced-Ethernet-Snap", 5), ("forced-Token-Ring", 6), ("forced-Token-Ring-Snap", 7)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwSetFrameFormat.setStatus('optional') nwMode = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("unknown", 1), ("pserver", 2), ("rprinter", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwMode.setStatus('optional') nwPrintServerName = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 47))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwPrintServerName.setStatus('optional') nwPrintServerPassword = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 9))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwPrintServerPassword.setStatus('optional') nwQueueScanTime = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwQueueScanTime.setStatus('optional') nwNetworkNumber = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly") if mibBuilder.loadTexts: nwNetworkNumber.setStatus('optional') nwMaxFileServers = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nwMaxFileServers.setStatus('optional') nwFileServerTable = MibTable((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 9), ) if mibBuilder.loadTexts: nwFileServerTable.setStatus('optional') nwFileServerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 9, 1), ).setIndexNames((0, "ESI-MIB", "nwFileServerIndex")) if mibBuilder.loadTexts: nwFileServerEntry.setStatus('optional') nwFileServerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 9, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nwFileServerIndex.setStatus('optional') nwFileServerName = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 9, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 47))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwFileServerName.setStatus('optional') nwFileServerConnectionStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 9, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 258, 261, 276, 512, 515, 768, 769, 32767))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("startupInProgress", 3), ("serverReattaching", 4), ("serverNeverAttached", 5), ("pse-UNKNOWN-FILE-SERVER", 258), ("pse-NO-RESPONSE", 261), ("pse-CANT-LOGIN", 276), ("pse-NO-SUCH-QUEUE", 512), ("pse-UNABLE-TO-ATTACH-TO-QUEUE", 515), ("bad-CONNECTION", 768), ("bad-SERVICE-CONNECTION", 769), ("other", 32767)))).setMaxAccess("readonly") if mibBuilder.loadTexts: nwFileServerConnectionStatus.setStatus('optional') nwPortTable = MibTable((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 10), ) if mibBuilder.loadTexts: nwPortTable.setStatus('optional') nwPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 10, 1), ).setIndexNames((0, "ESI-MIB", "nwPortIndex")) if mibBuilder.loadTexts: nwPortEntry.setStatus('optional') nwPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 10, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nwPortIndex.setStatus('optional') nwPortStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 10, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly") if mibBuilder.loadTexts: nwPortStatus.setStatus('optional') nwPortPrinterNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 10, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwPortPrinterNumber.setStatus('optional') nwPortFontDownload = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 10, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled-No-Power-Sense", 2), ("enabled-Power-Sense", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwPortFontDownload.setStatus('optional') nwPortPCLQueue = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 10, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 47))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwPortPCLQueue.setStatus('optional') nwPortPSQueue = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 10, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 47))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwPortPSQueue.setStatus('optional') nwPortFormsOn = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 10, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwPortFormsOn.setStatus('optional') nwPortFormNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 10, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwPortFormNumber.setStatus('optional') nwPortNotification = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 10, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwPortNotification.setStatus('optional') nwNumTraps = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nwNumTraps.setStatus('mandatory') nwTrapTable = MibTable((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 12), ) if mibBuilder.loadTexts: nwTrapTable.setStatus('mandatory') nwTrapEntry = MibTableRow((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 12, 1), ).setIndexNames((0, "ESI-MIB", "nwTrapIndex")) if mibBuilder.loadTexts: nwTrapEntry.setStatus('mandatory') nwTrapIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 12, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nwTrapIndex.setStatus('mandatory') nwTrapDestination = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 12, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(6, 6)).setFixedLength(6)).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwTrapDestination.setStatus('optional') nwTrapDestinationNet = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 12, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwTrapDestinationNet.setStatus('mandatory') nwProtocolTrapMask = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 12, 1, 4), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwProtocolTrapMask.setStatus('optional') nwPrinterTrapMask = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 12, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwPrinterTrapMask.setStatus('optional') nwOutputTrapMask = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 12, 1, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwOutputTrapMask.setStatus('optional') nwNDSPrintServerName = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 13), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 512))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwNDSPrintServerName.setStatus('optional') nwNDSPreferredDSTree = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 14), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 47))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwNDSPreferredDSTree.setStatus('optional') nwNDSPreferredDSFileServer = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 15), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 47))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwNDSPreferredDSFileServer.setStatus('optional') nwNDSPacketCheckSumEnabled = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 16), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwNDSPacketCheckSumEnabled.setStatus('optional') nwNDSPacketSignatureLevel = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 17), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwNDSPacketSignatureLevel.setStatus('optional') nwAvailablePrintModes = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 18), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nwAvailablePrintModes.setStatus('optional') nwDirectPrintEnabled = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwDirectPrintEnabled.setStatus('optional') nwJAConfig = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: nwJAConfig.setStatus('optional') nwDisableSAP = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 4, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nwDisableSAP.setStatus('optional') nwError = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 5, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 160))).setMaxAccess("readonly") if mibBuilder.loadTexts: nwError.setStatus('optional') nwDisplayMask = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 2, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nwDisplayMask.setStatus('mandatory') bvGroupVersion = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: bvGroupVersion.setStatus('mandatory') bvEnabled = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: bvEnabled.setStatus('optional') bvRestoreDefaults = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 3, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: bvRestoreDefaults.setStatus('optional') bvFirmwareUpgrade = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 3, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: bvFirmwareUpgrade.setStatus('optional') bvSetSequenceRouting = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 3, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("automatic-Routing", 1), ("force-Sequenced-Routing", 2), ("force-Non-Sequenced-Routing", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: bvSetSequenceRouting.setStatus('optional') bvDisableVPMan = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 3, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: bvDisableVPMan.setStatus('optional') bvLoginName = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 4, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(5, 63))).setMaxAccess("readwrite") if mibBuilder.loadTexts: bvLoginName.setStatus('optional') bvLoginPassword = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 4, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 15))).setMaxAccess("readwrite") if mibBuilder.loadTexts: bvLoginPassword.setStatus('optional') bvNumberPrintServices = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 4, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: bvNumberPrintServices.setStatus('optional') bvPrintServiceTable = MibTable((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 4, 4), ) if mibBuilder.loadTexts: bvPrintServiceTable.setStatus('optional') bvPrintServiceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 4, 4, 1), ).setIndexNames((0, "ESI-MIB", "bvPrintServiceIndex")) if mibBuilder.loadTexts: bvPrintServiceEntry.setStatus('optional') bvPrintServiceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 4, 4, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: bvPrintServiceIndex.setStatus('optional') bvPrintServiceName = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 4, 4, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readwrite") if mibBuilder.loadTexts: bvPrintServiceName.setStatus('optional') bvPrintServiceRouting = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 4, 4, 1, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: bvPrintServiceRouting.setStatus('optional') bvPnicDescription = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 4, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: bvPnicDescription.setStatus('optional') bvError = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 5, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 48))).setMaxAccess("readonly") if mibBuilder.loadTexts: bvError.setStatus('optional') bvRouting = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 5, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 32766, 32767))).clone(namedValues=NamedValues(("sequenced-Routing", 1), ("non-Sequenced-Routing", 2), ("unknown-Routing", 32766), ("protocol-Disabled", 32767)))).setMaxAccess("readonly") if mibBuilder.loadTexts: bvRouting.setStatus('optional') bvNumPrintServices = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 5, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: bvNumPrintServices.setStatus('optional') bvPrintServiceStatusTable = MibTable((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 5, 4), ) if mibBuilder.loadTexts: bvPrintServiceStatusTable.setStatus('optional') bvPrintServiceStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 5, 4, 1), ).setIndexNames((0, "ESI-MIB", "bvPSStatusIndex")) if mibBuilder.loadTexts: bvPrintServiceStatusEntry.setStatus('optional') bvPSStatusIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 5, 4, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: bvPSStatusIndex.setStatus('optional') bvPSName = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 5, 4, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: bvPSName.setStatus('optional') bvPSStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 5, 4, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 48))).setMaxAccess("readonly") if mibBuilder.loadTexts: bvPSStatus.setStatus('optional') bvPSDestination = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 5, 4, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: bvPSDestination.setStatus('optional') bvPrinterStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 5, 4, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly") if mibBuilder.loadTexts: bvPrinterStatus.setStatus('optional') bvJobActive = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 5, 4, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: bvJobActive.setStatus('optional') bvJobSource = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 5, 4, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: bvJobSource.setStatus('optional') bvJobTitle = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 5, 4, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: bvJobTitle.setStatus('optional') bvJobSize = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 5, 4, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 9))).setMaxAccess("readonly") if mibBuilder.loadTexts: bvJobSize.setStatus('optional') bvJobNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 3, 5, 4, 1, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 4))).setMaxAccess("readonly") if mibBuilder.loadTexts: bvJobNumber.setStatus('optional') lmGroupVersion = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 4, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: lmGroupVersion.setStatus('mandatory') lmEnabled = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 4, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: lmEnabled.setStatus('optional') eTalkGroupVersion = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eTalkGroupVersion.setStatus('mandatory') eTalkEnabled = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: eTalkEnabled.setStatus('optional') eTalkRestoreDefaults = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 3, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: eTalkRestoreDefaults.setStatus('optional') eTalkNetwork = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 4, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(2, 2)).setFixedLength(2)).setMaxAccess("readonly") if mibBuilder.loadTexts: eTalkNetwork.setStatus('optional') eTalkNode = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 4, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1)).setMaxAccess("readonly") if mibBuilder.loadTexts: eTalkNode.setStatus('optional') eTalkNumPorts = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 4, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eTalkNumPorts.setStatus('optional') eTalkPortTable = MibTable((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 4, 4), ) if mibBuilder.loadTexts: eTalkPortTable.setStatus('optional') eTalkPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 4, 4, 1), ).setIndexNames((0, "ESI-MIB", "eTalkPortIndex")) if mibBuilder.loadTexts: eTalkPortEntry.setStatus('optional') eTalkPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 4, 4, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eTalkPortIndex.setStatus('optional') eTalkPortEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 4, 4, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: eTalkPortEnable.setStatus('optional') eTalkName = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 4, 4, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: eTalkName.setStatus('optional') eTalkActiveName = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 4, 4, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: eTalkActiveName.setStatus('optional') eTalkType1 = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 4, 4, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: eTalkType1.setStatus('optional') eTalkType2 = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 4, 4, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: eTalkType2.setStatus('optional') eTalkZone = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 4, 4, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: eTalkZone.setStatus('optional') eTalkActiveZone = MibTableColumn((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 4, 4, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: eTalkActiveZone.setStatus('optional') eTalkError = MibScalar((1, 3, 6, 1, 4, 1, 683, 6, 3, 5, 5, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly") if mibBuilder.loadTexts: eTalkError.setStatus('optional') trapPrinterOnline = NotificationType((1, 3, 6, 1, 4, 1, 683, 6) + (0,1)).setObjects(("ESI-MIB", "outputIndex")) trapPrinterOffline = NotificationType((1, 3, 6, 1, 4, 1, 683, 6) + (0,2)).setObjects(("ESI-MIB", "outputIndex")) trapNoPrinterAttached = NotificationType((1, 3, 6, 1, 4, 1, 683, 6) + (0,3)).setObjects(("ESI-MIB", "outputIndex")) trapPrinterTonerLow = NotificationType((1, 3, 6, 1, 4, 1, 683, 6) + (0,4)).setObjects(("ESI-MIB", "outputIndex")) trapPrinterPaperOut = NotificationType((1, 3, 6, 1, 4, 1, 683, 6) + (0,5)).setObjects(("ESI-MIB", "outputIndex")) trapPrinterPaperJam = NotificationType((1, 3, 6, 1, 4, 1, 683, 6) + (0,6)).setObjects(("ESI-MIB", "outputIndex")) trapPrinterDoorOpen = NotificationType((1, 3, 6, 1, 4, 1, 683, 6) + (0,7)).setObjects(("ESI-MIB", "outputIndex")) trapPrinterError = NotificationType((1, 3, 6, 1, 4, 1, 683, 6) + (0,16)).setObjects(("ESI-MIB", "outputIndex")) mibBuilder.exportSymbols("ESI-MIB", genNumProtocols=genNumProtocols, tcpipSmtpServerAddr=tcpipSmtpServerAddr, outputStopBits=outputStopBits, genSerialNumber=genSerialNumber, tcpipWebUserName=tcpipWebUserName, nwGroupVersion=nwGroupVersion, outputPrinterDisplay=outputPrinterDisplay, cmdRestoreDefaults=cmdRestoreDefaults, tcpipArpInterval=tcpipArpInterval, genSysUpTimeString=genSysUpTimeString, tcpipSecureStartIPAddress=tcpipSecureStartIPAddress, tokenRing=tokenRing, outputConfigure=outputConfigure, outputJobLogInformation=outputJobLogInformation, tcpipConfigPassword=tcpipConfigPassword, tcpipMLPTable=tcpipMLPTable, tcpipSmtpOutputMask=tcpipSmtpOutputMask, driverGroupVersion=driverGroupVersion, tcpipSmtpPrinterMask=tcpipSmtpPrinterMask, trapPrinterTonerLow=trapPrinterTonerLow, lmGroupVersion=lmGroupVersion, tcpipNumSecurity=tcpipNumSecurity, outputTotalJobEntry=outputTotalJobEntry, commands=commands, tcpipSmtpTable=tcpipSmtpTable, snmpGroupVersion=snmpGroupVersion, psOutput=psOutput, tcpipSecureEndIPAddress=tcpipSecureEndIPAddress, tcpipPOP3UserName=tcpipPOP3UserName, genProtocolEntry=genProtocolEntry, tcpipPrinterTrapMask=tcpipPrinterTrapMask, tcpipPOP3Password=tcpipPOP3Password, cmdReset=cmdReset, cmdPrintConfig=cmdPrintConfig, outputPrinter=outputPrinter, trEarlyTokenRelease=trEarlyTokenRelease, nwCommands=nwCommands, tcpipDomainName=tcpipDomainName, nwFirmwareUpgrade=nwFirmwareUpgrade, bvPrintServiceName=bvPrintServiceName, driverTXPacketErrors=driverTXPacketErrors, outputPrinterModel=outputPrinterModel, nwFileServerConnectionStatus=nwFileServerConnectionStatus, nwFileServerIndex=nwFileServerIndex, eTalkPortIndex=eTalkPortIndex, tcpipTrapDestination=tcpipTrapDestination, outputCommandsTable=outputCommandsTable, nwNumTraps=nwNumTraps, genProtocolIndex=genProtocolIndex, nwEnabled=nwEnabled, eTalk=eTalk, nwFileServerTable=nwFileServerTable, bvPrintServiceEntry=bvPrintServiceEntry, nwNDSPacketSignatureLevel=nwNDSPacketSignatureLevel, nwNDSPacketCheckSumEnabled=nwNDSPacketCheckSumEnabled, eTalkEnabled=eTalkEnabled, outputCommands=outputCommands, nwDirectPrintEnabled=nwDirectPrintEnabled, psGroupVersion=psGroupVersion, bvPrintServiceRouting=bvPrintServiceRouting, eTalkActiveName=eTalkActiveName, outputCommandsEntry=outputCommandsEntry, nwTrapEntry=nwTrapEntry, nwNDSPreferredDSFileServer=nwNDSPreferredDSFileServer, tcpipGroupVersion=tcpipGroupVersion, tcpipSecurePrinterMask=tcpipSecurePrinterMask, bvPSName=bvPSName, tcpipWinsAddress=tcpipWinsAddress, eTalkName=eTalkName, tcpipIPAddress=tcpipIPAddress, genCableType=genCableType, nwTrapTable=nwTrapTable, trapPrinterPaperOut=trapPrinterPaperOut, trRestoreDefaults=trRestoreDefaults, tcpipTimeoutCheckingValue=tcpipTimeoutCheckingValue, bvLoginName=bvLoginName, outputGroupVersion=outputGroupVersion, trPriority=trPriority, tcpipMLPName=tcpipMLPName, outputJobLogTable=outputJobLogTable, genCompanyTechSupport=genCompanyTechSupport, tcpipWebHtttpPort=tcpipWebHtttpPort, printServers=printServers, outputDataBits=outputDataBits, nwPrinterTrapMask=nwPrinterTrapMask, genCompanyLoc=genCompanyLoc, eTalkCommands=eTalkCommands, nwAvailablePrintModes=nwAvailablePrintModes, bvFirmwareUpgrade=bvFirmwareUpgrade, bvPrinterStatus=bvPrinterStatus, trapPrinterPaperJam=trapPrinterPaperJam, nwPortPSQueue=nwPortPSQueue, nwNetworkNumber=nwNetworkNumber, nwPortPrinterNumber=nwPortPrinterNumber, outputNumPorts=outputNumPorts, bvPSStatus=bvPSStatus, genCompanyName=genCompanyName, tcpipBanners=tcpipBanners, tcpipSecurityEntry=tcpipSecurityEntry, tcpipMLPTCPPort=tcpipMLPTCPPort, nwProtocolTrapMask=nwProtocolTrapMask, outputTable=outputTable, nwMaxFileServers=nwMaxFileServers, bvPrintServiceIndex=bvPrintServiceIndex, tcpipNumSmtpDestinations=tcpipNumSmtpDestinations, bvJobSource=bvJobSource, tcpip=tcpip, tcpipMLPPreString=tcpipMLPPreString, bvPrintServiceStatusTable=bvPrintServiceStatusTable, eTalkGroupVersion=eTalkGroupVersion, genProductNumber=genProductNumber, outputConfigLanguage=outputConfigLanguage, tcpipWebUpdateURL=tcpipWebUpdateURL, tcpipTrapTable=tcpipTrapTable, driverChecksumErrors=driverChecksumErrors, outputCancelCurrentJob=outputCancelCurrentJob, tcpipSubnetMask=tcpipSubnetMask, outputBIDIStatusEnabled=outputBIDIStatusEnabled, tcpipSmtpProtocolMask=tcpipSmtpProtocolMask, snmpSetCommunityName=snmpSetCommunityName, nwPortFormsOn=nwPortFormsOn, outputTotalJobsLogged=outputTotalJobsLogged, eTalkNumPorts=eTalkNumPorts, nwQueueScanTime=nwQueueScanTime, nwPortFormNumber=nwPortFormNumber, genProductName=genProductName, psJetAdminEnabled=psJetAdminEnabled, tcpipSecureAdminEnabled=tcpipSecureAdminEnabled, nwTrapDestinationNet=nwTrapDestinationNet, tcpipMLPIndex=tcpipMLPIndex, tcpipMLPDeleteBytes=tcpipMLPDeleteBytes, esiSNMPCommands=esiSNMPCommands, driver=driver, bvJobTitle=bvJobTitle, bvSetSequenceRouting=bvSetSequenceRouting, bvStatus=bvStatus, outputDisplayMask=outputDisplayMask, tcpipPOP3PollInterval=tcpipPOP3PollInterval, vines=vines, genGroupVersion=genGroupVersion, outputOwner=outputOwner, nwFileServerName=nwFileServerName, tcpipWinsAddressSource=tcpipWinsAddressSource, bvRestoreDefaults=bvRestoreDefaults, nwPortTable=nwPortTable, trapPrinterOnline=trapPrinterOnline, trGroupVersion=trGroupVersion, tcpipNumLogicalPrinters=tcpipNumLogicalPrinters, tcpipBootProtocolsEnabled=tcpipBootProtocolsEnabled, nwFileServerEntry=nwFileServerEntry, outputAvailableTrapsMask=outputAvailableTrapsMask, trapPrinterDoorOpen=trapPrinterDoorOpen, nwTrapDestination=nwTrapDestination, eTalkError=eTalkError, tcpipSmtpEmailAddr=tcpipSmtpEmailAddr, outputEntry=outputEntry, nwPortStatus=nwPortStatus, outputPSString=outputPSString, snmpRestoreDefaults=snmpRestoreDefaults, outputParity=outputParity, tcpipConfigure=tcpipConfigure, tcpipEnabled=tcpipEnabled, tcpipNumTraps=tcpipNumTraps, outputIndex=outputIndex, nwTrapIndex=nwTrapIndex, bvLoginPassword=bvLoginPassword, eTalkRestoreDefaults=eTalkRestoreDefaults, tcpipTrapIndex=tcpipTrapIndex, nwPortEntry=nwPortEntry, tcpipSmtpIndex=tcpipSmtpIndex, snmpGetCommunityName=snmpGetCommunityName, bvNumPrintServices=bvNumPrintServices, general=general, eTalkType1=eTalkType1, bvPrintServiceStatusEntry=bvPrintServiceStatusEntry, esiSNMP=esiSNMP, tcpipTrapEntry=tcpipTrapEntry, nwPortIndex=nwPortIndex, nwPortNotification=nwPortNotification, genConfigurationDirty=genConfigurationDirty, eTalkPortEnable=eTalkPortEnable, tcpipDefaultGateway=tcpipDefaultGateway, tcpipDisplayMask=tcpipDisplayMask, outputRestoreDefaults=outputRestoreDefaults, bvJobNumber=bvJobNumber, tcpipUsingNetProtocols=tcpipUsingNetProtocols, nwMode=nwMode, bvDisableVPMan=bvDisableVPMan, nwPortFontDownload=nwPortFontDownload, driverTXPackets=driverTXPackets, tcpipMLPEntry=tcpipMLPEntry, tcpipWebFaqURL=tcpipWebFaqURL, tcpipWebAdminPassword=tcpipWebAdminPassword, tcpipSecurityTable=tcpipSecurityTable, eTalkZone=eTalkZone, trLocallyAdminAddr=trLocallyAdminAddr, tcpipCommands=tcpipCommands, tcpipIPAddressSource=tcpipIPAddressSource, nwError=nwError, lmEnabled=lmEnabled, genProtocolTable=genProtocolTable, outputJobLogTime=outputJobLogTime, nwPortPCLQueue=nwPortPCLQueue, outputJobLogEntry=outputJobLogEntry, tcpipTimeoutChecking=tcpipTimeoutChecking, eTalkActiveZone=eTalkActiveZone, eTalkNode=eTalkNode, tcpipSecurityIndex=tcpipSecurityIndex, outputProtocolManager=outputProtocolManager, tcpipProtocolTrapMask=tcpipProtocolTrapMask, tcpipSmtpEntry=tcpipSmtpEntry, outputStatus=outputStatus, driverRXPacketErrors=driverRXPacketErrors, trRouting=trRouting, tcpipStatus=tcpipStatus, cmdGroupVersion=cmdGroupVersion, nwConfigure=nwConfigure, trPacketSize=trPacketSize, tcpipRestoreDefaults=tcpipRestoreDefaults, nwJAConfig=nwJAConfig, eTalkPortTable=eTalkPortTable, nwFrameFormat=nwFrameFormat, psVerifyConfiguration=psVerifyConfiguration, tcpipWebUserPassword=tcpipWebUserPassword, netware=netware, driverTXPacketRetries=driverTXPacketRetries, outputSetting=outputSetting, bvJobActive=bvJobActive, tcpipWebCustomLinkName=tcpipWebCustomLinkName, tcpipMLPPostString=tcpipMLPPostString, lanManager=lanManager, esi=esi, trapPrinterError=trapPrinterError, outputExtendedStatus=outputExtendedStatus, outputBaudRate=outputBaudRate, genCompanyPhone=genCompanyPhone, psGeneral=psGeneral, outputName=outputName, tcpipOutputTrapMask=tcpipOutputTrapMask, trConfigure=trConfigure, bvGroupVersion=bvGroupVersion, tcpipWebAdminName=tcpipWebAdminName, psProtocols=psProtocols, eTalkStatus=eTalkStatus, nwDisplayMask=nwDisplayMask, outputLanguageSwitching=outputLanguageSwitching, nwPrintServerPassword=nwPrintServerPassword, bvEnabled=bvEnabled, bvPSDestination=bvPSDestination, bvError=bvError, eTalkPortEntry=eTalkPortEntry, driverRXPackets=driverRXPackets, trapPrinterOffline=trapPrinterOffline, tcpipIPAddressServerAddress=tcpipIPAddressServerAddress) mibBuilder.exportSymbols("ESI-MIB", nwRestoreDefaults=nwRestoreDefaults, genProtocolID=genProtocolID, outputPCLString=outputPCLString, eTalkType2=eTalkType2, trCommands=trCommands, tcpipError=tcpipError, outputHandshake=outputHandshake, tcpipPOP3ServerAddress=tcpipPOP3ServerAddress, nwSetFrameFormat=nwSetFrameFormat, outputTotalJobIndex=outputTotalJobIndex, bvRouting=bvRouting, genHWAddress=genHWAddress, outputJobLog=outputJobLog, outputStatusString=outputStatusString, outputTotalJobTable=outputTotalJobTable, trapNoPrinterAttached=trapNoPrinterAttached, outputCascaded=outputCascaded, tcpipMLPPort=tcpipMLPPort, bvConfigure=bvConfigure, bvPSStatusIndex=bvPSStatusIndex, tcpipFirmwareUpgrade=tcpipFirmwareUpgrade, nwNDSPrintServerName=nwNDSPrintServerName, tcpipLowBandwidth=tcpipLowBandwidth, bvJobSize=bvJobSize, nwPrintServerName=nwPrintServerName, driverRXPacketsUnavailable=driverRXPacketsUnavailable, nwNDSPreferredDSTree=nwNDSPreferredDSTree, genMIBVersion=genMIBVersion, genProtocols=genProtocols, genDateCode=genDateCode, snmpTrapCommunityName=snmpTrapCommunityName, outputNumLogEntries=outputNumLogEntries, bvPrintServiceTable=bvPrintServiceTable, genProtocolDescr=genProtocolDescr, bvNumberPrintServices=bvNumberPrintServices, nwDisableSAP=nwDisableSAP, tcpipWebCustomLinkURL=tcpipWebCustomLinkURL, eTalkNetwork=eTalkNetwork, genVersion=genVersion, eTalkConfigure=eTalkConfigure, outputCapabilities=outputCapabilities, bvPnicDescription=bvPnicDescription, tcpipRawPortNumber=tcpipRawPortNumber, nwOutputTrapMask=nwOutputTrapMask, nwStatus=nwStatus, bvCommands=bvCommands)
131.378049
8,753
0.749095
8,979
75,411
6.291346
0.067714
0.013312
0.015985
0.021243
0.524677
0.492831
0.439883
0.411931
0.367357
0.344893
0
0.084527
0.082879
75,411
573
8,754
131.60733
0.732262
0.004084
0
0
0
0
0.096173
0.009774
0
0
0
0
0
1
0
false
0.022968
0.010601
0
0.010601
0.007067
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0d4bbf870d995e41819c34b159eb34735b1b5747
989
py
Python
products_api/models/database.py
rfayan/kabum_product_api
bc59d40194d3ebfe561415c8a9721711d6d3b7b1
[ "MIT" ]
null
null
null
products_api/models/database.py
rfayan/kabum_product_api
bc59d40194d3ebfe561415c8a9721711d6d3b7b1
[ "MIT" ]
null
null
null
products_api/models/database.py
rfayan/kabum_product_api
bc59d40194d3ebfe561415c8a9721711d6d3b7b1
[ "MIT" ]
1
2021-02-01T13:36:10.000Z
2021-02-01T13:36:10.000Z
from contextlib import contextmanager from typing import Iterator from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import Session, sessionmaker from products_api.environment import DB Base = declarative_base() _SQLALCHEMY_DATABASE_URL = f"postgresql://{DB.user}:{DB.password}@{DB.host}:{DB.port}/{DB.name}" engine = create_engine(_SQLALCHEMY_DATABASE_URL) SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) # Verify if all tables exist. If they do not, create them def verify_and_create_db_tables() -> None: """Create all database tables based on defined models metadata if they are not created yet.""" Base.metadata.create_all(bind=engine) @contextmanager def get_db() -> Iterator[Session]: """Yield a database session to perform operations and close after it is done.""" db_session = SessionLocal() try: yield db_session finally: db_session.close()
30.90625
98
0.764408
133
989
5.533835
0.496241
0.057065
0.057065
0
0
0
0
0
0
0
0
0
0.147624
989
31
99
31.903226
0.873072
0.222447
0
0
0
0.052632
0.087071
0.087071
0
0
0
0
0
1
0.105263
false
0.052632
0.315789
0
0.421053
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
0
0
0
2
0d4f5f482d3b1924b8d706ad7b8777100cb923c1
1,226
py
Python
geocamUtil/management/commands/prepbootstrap.py
geocam/geocamUtilWeb
b64fc063c64b4b0baa140db4c126f2ff980756ab
[ "NASA-1.3" ]
4
2017-03-03T16:24:24.000Z
2018-06-24T05:50:40.000Z
geocamUtil/management/commands/prepbootstrap.py
geocam/geocamUtilWeb
b64fc063c64b4b0baa140db4c126f2ff980756ab
[ "NASA-1.3" ]
1
2021-09-29T17:17:30.000Z
2021-09-29T17:17:30.000Z
geocamUtil/management/commands/prepbootstrap.py
geocam/geocamUtilWeb
b64fc063c64b4b0baa140db4c126f2ff980756ab
[ "NASA-1.3" ]
1
2017-12-19T20:45:53.000Z
2017-12-19T20:45:53.000Z
# __BEGIN_LICENSE__ #Copyright (c) 2015, United States Government, as represented by the #Administrator of the National Aeronautics and Space Administration. #All rights reserved. # __END_LICENSE__ import os import sys import django from optparse import make_option from django.core.management.base import BaseCommand from geocamUtil.management.commandUtil import getSiteDir, dosys from django.conf import settings """ Call grunt to compile bootstrap 4 """ class Command(BaseCommand): help = 'Use grunt to compile css from sass in various directories. Node, Ruby, grunt-cli, bundler must be installed.' def handle(self, *args, **options): verbosity = int(options.get('verbosity', 0)) siteDir = getSiteDir() staticDir = getattr(settings, 'STATIC_ROOT', '%sbuild/static' % siteDir) bootstrapDir = os.path.join(staticDir, 'bootstrap') ret = os.chdir(bootstrapDir) if ret != 0: if verbosity > 1: print >> sys.stderr, ret if verbosity > 1: print 'about to grunt dist-css for bootstrap' dosys('grunt dist-css ', verbosity) if verbosity > 1: print 'done with grunt dist-css for bootstrap'
29.902439
122
0.682708
151
1,226
5.463576
0.609272
0.04
0.043636
0.061818
0.058182
0
0
0
0
0
0
0.010616
0.231648
1,226
40
123
30.65
0.86518
0.15416
0
0.130435
0
0.043478
0.244692
0
0
0
0
0
0
0
null
null
0
0.304348
null
null
0.130435
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
2